issue-discover
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseIssue Discover
Issue Discover
Unified issue discovery and creation skill covering three entry points: manual issue creation, perspective-based discovery, and prompt-driven exploration.
一款统一的问题发现与创建工具,包含三个入口:手动创建问题、多视角发现问题以及提示词驱动的探索。
Architecture Overview
架构概述
┌─────────────────────────────────────────────────────────────────┐
│ Issue Discover Orchestrator (SKILL.md) │
│ → Action selection → Route to phase → Execute → Summary │
└───────────────┬─────────────────────────────────────────────────┘
│
├─ ASK_USER: Select action
│
┌───────────┼───────────┬───────────┐
↓ ↓ ↓ │
┌─────────┐ ┌─────────┐ ┌─────────┐ │
│ Phase 1 │ │ Phase 2 │ │ Phase 3 │ │
│ Create │ │Discover │ │Discover │ │
│ New │ │ Multi │ │by Prompt│ │
└─────────┘ └─────────┘ └─────────┘ │
↓ ↓ ↓ │
Issue Discoveries Discoveries │
(registered) (export) (export) │
│ │ │ │
│ ├───────────┤ │
│ ↓ │
│ ┌───────────┐ │
│ │ Phase 4 │ │
│ │Quick Plan │ │
│ │& Execute │ │
│ └─────┬─────┘ │
│ ↓ │
│ .task/*.json │
│ ↓ │
│ Direct Execution │
│ │ │
└───────────┴──────────────────────┘
↓ (fallback/remaining)
issue-resolve (plan/queue)
↓
/issue:execute┌─────────────────────────────────────────────────────────────────┐
│ Issue Discover Orchestrator (SKILL.md) │
│ → 选择操作 → 路由至对应阶段 → 执行 → 总结 │
└───────────────┬─────────────────────────────────────────────────┘
│
├─ ASK_USER: 选择操作
│
┌───────────┼───────────┬───────────┐
↓ ↓ ↓ │
┌─────────┐ ┌─────────┐ ┌─────────┐ │
│ 阶段1 │ │ 阶段2 │ │ 阶段3 │ │
│ 创建新问题 │ │ 多视角发现 │ │ 提示词驱动发现 │ │
└─────────┘ └─────────┘ └─────────┘ │
↓ ↓ ↓ │
已注册的问题 可导出的发现结果 可导出的发现结果 │
│ │ │ │
│ ├───────────┤ │
│ ↓ │
│ ┌───────────┐ │
│ │ 阶段4 │ │
│ │快速规划与执行 │ │
│ └─────┬─────┘ │
│ ↓ │
│ .task/*.json │
│ ↓ │
│ 直接执行 │
│ │ │
└───────────┴──────────────────────┘
↓ (回退/剩余任务)
issue-resolve (规划/排队)
↓
/issue:executeKey Design Principles
核心设计原则
- Action-Driven Routing: ASK_USER selects action, then load single phase
- Progressive Phase Loading: Only read the selected phase document
- CLI-First Data Access: All issue CRUD via CLI commands
ccw issue - Auto Mode Support: flag skips action selection with auto-detection
-y - Subagent Lifecycle: Explicit lifecycle management with spawn_agent → wait → close_agent
- Role Path Loading: Subagent roles loaded via path reference in MANDATORY FIRST STEPS
- 操作驱动路由:通过ASK_USER选择操作,然后加载单个阶段
- 渐进式阶段加载:仅读取所选阶段的文档
- CLI优先的数据访问:所有问题的增删改查(CRUD)均通过CLI命令完成
ccw issue - 支持自动模式:标志可跳过操作选择,启用自动检测
-y - 子代理生命周期:通过spawn_agent → wait → close_agent实现明确的生命周期管理
- 角色路径加载:子代理角色通过MANDATORY FIRST STEPS中的路径引用加载
Auto Mode
自动模式
When or : Skip action selection, auto-detect action from input type.
--yes-y当使用或参数时:跳过操作选择,根据输入类型自动检测操作。
--yes-yUsage
使用方法
issue-discover <input>
issue-discover [FLAGS] "<input>"issue-discover <input>
issue-discover [FLAGS] "<input>"Flags
标志
-y, --yes Skip all confirmations (auto mode)
--action <type> Pre-select action: new|discover|discover-by-prompt
-y, --yes 跳过所有确认(自动模式)
--action <type> 预先选择操作类型:new|discover|discover-by-prompt
Phase-specific flags
阶段专属标志
--priority <1-5> Issue priority (new mode)
--perspectives <list> Comma-separated perspectives (discover mode)
--external Enable Exa research (discover mode)
--scope <pattern> File scope (discover/discover-by-prompt mode)
--depth <level> standard|deep (discover-by-prompt mode)
--max-iterations <n> Max exploration iterations (discover-by-prompt mode)
--priority <1-5> 问题优先级(创建新问题模式)
--perspectives <list> 逗号分隔的视角列表(发现模式)
--external 启用Exa调研(发现模式)
--scope <pattern> 文件范围(发现/提示词驱动发现模式)
--depth <level> standard|deep(提示词驱动发现模式)
--max-iterations <n> 最大探索迭代次数(提示词驱动发现模式)
Examples
示例
issue-discover https://github.com/org/repo/issues/42 # Create from GitHub
issue-discover "Login fails with special chars" # Create from text
issue-discover --action discover src/auth/** # Multi-perspective discovery
issue-discover --action discover src/api/** --perspectives=security,bug # Focused discovery
issue-discover --action discover-by-prompt "Check API contracts" # Prompt-driven discovery
issue-discover -y "auth broken" # Auto mode create
undefinedissue-discover https://github.com/org/repo/issues/42 # 从GitHub创建问题
issue-discover "登录时输入特殊字符失败" # 从文本创建问题
issue-discover --action discover src/auth/** # 多视角发现问题
issue-discover --action discover src/api/** --perspectives=security,bug # 定向发现问题
issue-discover --action discover-by-prompt "检查API契约" # 提示词驱动的问题发现
issue-discover -y "认证功能异常" # 自动模式创建问题
undefinedExecution Flow
执行流程
Input Parsing:
└─ Parse flags (--action, -y, --perspectives, etc.) and positional args
Action Selection:
├─ --action flag provided → Route directly
├─ Auto-detect from input:
│ ├─ GitHub URL or #number → Create New (Phase 1)
│ ├─ Path pattern (src/**, *.ts) → Discover (Phase 2)
│ ├─ Short text (< 80 chars) → Create New (Phase 1)
│ └─ Long descriptive text (≥ 80 chars) → Discover by Prompt (Phase 3)
└─ Otherwise → ASK_USER to select action
Phase Execution (load one phase):
├─ Phase 1: Create New → phases/01-issue-new.md
├─ Phase 2: Discover → phases/02-discover.md
└─ Phase 3: Discover by Prompt → phases/03-discover-by-prompt.md
Post-Phase:
└─ Summary + Next steps recommendation输入解析:
└─ 解析标志(--action、-y、--perspectives等)和位置参数
操作选择:
├─ 若提供--action标志 → 直接路由至对应阶段
├─ 根据输入自动检测:
│ ├─ GitHub链接或#数字 → 创建新问题(阶段1)
│ ├─ 路径模式(src/**、*.ts) → 多视角发现(阶段2)
│ ├─ 短文本(<80字符) → 创建新问题(阶段1)
│ └─ 长描述文本(≥80字符) → 提示词驱动发现(阶段3)
└─ 否则 → 调用ASK_USER让用户选择操作
阶段执行(加载单个阶段):
├─ 阶段1:创建新问题 → phases/01-issue-new.md
├─ 阶段2:多视角发现 → phases/02-discover.md
└─ 阶段3:提示词驱动发现 → phases/03-discover-by-prompt.md
阶段后处理:
└─ 总结 + 下一步操作建议Phase Reference Documents
阶段参考文档
| Phase | Document | Load When | Purpose |
|---|---|---|---|
| Phase 1 | phases/01-issue-new.md | Action = Create New | Create issue from GitHub URL or text description |
| Phase 2 | phases/02-discover.md | Action = Discover | Multi-perspective issue discovery (bug, security, test, etc.) |
| Phase 3 | phases/03-discover-by-prompt.md | Action = Discover by Prompt | Prompt-driven iterative exploration with Gemini planning |
| Phase 4 | phases/04-quick-execute.md | Post-Phase = Quick Plan & Execute | Convert high-confidence findings to tasks and execute directly |
| 阶段 | 文档 | 加载时机 | 用途 |
|---|---|---|---|
| 阶段1 | phases/01-issue-new.md | 操作 = 创建新问题 | 从GitHub链接或文本描述创建问题 |
| 阶段2 | phases/02-discover.md | 操作 = 多视角发现 | 多视角问题发现(漏洞、安全、测试等) |
| 阶段3 | phases/03-discover-by-prompt.md | 操作 = 提示词驱动发现 | 借助Gemini进行提示词驱动的迭代探索 |
| 阶段4 | phases/04-quick-execute.md | 阶段后处理 = 快速规划与执行 | 将高可信度的发现结果转换为任务并直接执行 |
Core Rules
核心规则
- Action Selection First: Always determine action before loading any phase
- Single Phase Load: Only read the selected phase document, never load all phases
- CLI Data Access: Use CLI for all issue operations, NEVER read files directly
ccw issue - Content Preservation: Each phase contains complete execution logic from original commands
- Auto-Detect Input: Smart input parsing reduces need for explicit --action flag
- ⚠️ CRITICAL: DO NOT STOP: Continuous multi-phase workflow. After completing each phase, immediately proceed to next
- Progressive Phase Loading: Read phase docs ONLY when that phase is about to execute
- Explicit Lifecycle: Always close_agent after wait completes to free resources
- 先选择操作:在加载任何阶段之前,必须先确定操作类型
- 仅加载单个阶段:仅读取所选阶段的文档,绝不加载所有阶段
- CLI数据访问:所有问题操作均使用CLI命令,绝不直接读取文件
ccw issue - 内容保留:每个阶段包含原始命令的完整执行逻辑
- 自动检测输入:智能输入解析减少对显式--action标志的需求
- ⚠️ 重要:请勿中断:持续的多阶段工作流。完成每个阶段后,立即进入下一阶段
- 渐进式阶段加载:仅当即将执行该阶段时才读取阶段文档
- 明确的生命周期:在wait完成后必须调用close_agent以释放资源
Input Processing
输入处理
Auto-Detection Logic
自动检测逻辑
javascript
function detectAction(input, flags) {
// 1. Explicit --action flag
if (flags.action) return flags.action;
const trimmed = input.trim();
// 2. GitHub URL → new
if (trimmed.match(/github\.com\/[\w-]+\/[\w-]+\/issues\/\d+/) || trimmed.match(/^#\d+$/)) {
return 'new';
}
// 3. Path pattern (contains **, /, or --perspectives) → discover
if (trimmed.match(/\*\*/) || trimmed.match(/^src\//) || flags.perspectives) {
return 'discover';
}
// 4. Short text (< 80 chars, no special patterns) → new
if (trimmed.length > 0 && trimmed.length < 80 && !trimmed.includes('--')) {
return 'new';
}
// 5. Long descriptive text → discover-by-prompt
if (trimmed.length >= 80) {
return 'discover-by-prompt';
}
// Cannot auto-detect → ask user
return null;
}javascript
function detectAction(input, flags) {
// 1. Explicit --action flag
if (flags.action) return flags.action;
const trimmed = input.trim();
// 2. GitHub URL → new
if (trimmed.match(/github\.com\/[\w-]+\/[\w-]+\/issues\/\d+/) || trimmed.match(/^#\d+$/)) {
return 'new';
}
// 3. Path pattern (contains **, /, or --perspectives) → discover
if (trimmed.match(/\*\*/) || trimmed.match(/^src\//) || flags.perspectives) {
return 'discover';
}
// 4. Short text (< 80 chars, no special patterns) → new
if (trimmed.length > 0 && trimmed.length < 80 && !trimmed.includes('--')) {
return 'new';
}
// 5. Long descriptive text → discover-by-prompt
if (trimmed.length >= 80) {
return 'discover-by-prompt';
}
// Cannot auto-detect → ask user
return null;
}Action Selection (ASK_USER)
操作选择(ASK_USER)
javascript
// When action cannot be auto-detected
const answer = ASK_USER([{
id: "action",
type: "select",
prompt: "What would you like to do?",
options: [
{
label: "Create New Issue (Recommended)",
description: "Create issue from GitHub URL, text description, or structured input"
},
{
label: "Discover Issues",
description: "Multi-perspective discovery: bug, security, test, quality, performance, etc."
},
{
label: "Discover by Prompt",
description: "Describe what to find — Gemini plans the exploration strategy iteratively"
}
]
}]); // BLOCKS (wait for user response)
// Route based on selection
const actionMap = {
"Create New Issue": "new",
"Discover Issues": "discover",
"Discover by Prompt": "discover-by-prompt"
};javascript
// When action cannot be auto-detected
const answer = ASK_USER([{
id: "action",
type: "select",
prompt: "What would you like to do?",
options: [
{
label: "Create New Issue (Recommended)",
description: "Create issue from GitHub URL, text description, or structured input"
},
{
label: "Discover Issues",
description: "Multi-perspective discovery: bug, security, test, quality, performance, etc."
},
{
label: "Discover by Prompt",
description: "Describe what to find — Gemini plans the exploration strategy iteratively"
}
]
}]); // BLOCKS (wait for user response)
// Route based on selection
const actionMap = {
"Create New Issue": "new",
"Discover Issues": "discover",
"Discover by Prompt": "discover-by-prompt"
};Data Flow
数据流
User Input (URL / text / path pattern / descriptive prompt)
↓
[Parse Flags + Auto-Detect Action]
↓
[Action Selection] ← ASK_USER (if needed)
↓
[Read Selected Phase Document]
↓
[Execute Phase Logic]
↓
[Summary + Next Steps]
├─ After Create → Suggest issue-resolve (plan solution)
└─ After Discover → Suggest export to issues, then issue-resolve用户输入(链接/文本/路径模式/描述性提示词)
↓
[解析标志 + 自动检测操作]
↓
[操作选择] ← 若需要则调用ASK_USER
↓
[读取所选阶段的文档]
↓
[执行阶段逻辑]
↓
[总结 + 下一步操作建议]
├─ 创建问题后 → 建议使用issue-resolve(规划解决方案)
└─ 发现问题后 → 建议导出为问题,然后使用issue-resolveSubagent API Reference
子代理API参考
spawn_agent
spawn_agent
Create a new subagent with task assignment.
javascript
const agentId = spawn_agent({
message: `创建一个分配了任务的新子代理。
javascript
const agentId = spawn_agent({
message: `TASK ASSIGNMENT
TASK ASSIGNMENT
MANDATORY FIRST STEPS (Agent Execute)
MANDATORY FIRST STEPS (Agent Execute)
- Read role definition: ~/.codex/agents/{agent-type}.md (MUST read first)
- Execute: ccw spec load --category exploration
- Read role definition: ~/.codex/agents/{agent-type}.md (MUST read first)
- Execute: ccw spec load --category exploration
TASK CONTEXT
TASK CONTEXT
${taskContext}
${taskContext}
DELIVERABLES
DELIVERABLES
${deliverables}
`
})
undefined${deliverables}
`
})
undefinedwait
wait
Get results from subagent (only way to retrieve results).
javascript
const result = wait({
ids: [agentId],
timeout_ms: 600000 // 10 minutes
})
if (result.timed_out) {
// Handle timeout - can continue waiting or send_input to prompt completion
}
// Check completion status
if (result.status[agentId].completed) {
const output = result.status[agentId].completed;
}获取子代理的执行结果(唯一的结果获取方式)。
javascript
const result = wait({
ids: [agentId],
timeout_ms: 600000 // 10 minutes
})
if (result.timed_out) {
// Handle timeout - can continue waiting or send_input to prompt completion
}
// Check completion status
if (result.status[agentId].completed) {
const output = result.status[agentId].completed;
}send_input
send_input
Continue interaction with active subagent (for clarification or follow-up).
javascript
send_input({
id: agentId,
message: `与活跃的子代理继续交互(用于澄清或后续操作)。
javascript
send_input({
id: agentId,
message: `CLARIFICATION ANSWERS
CLARIFICATION ANSWERS
${answers}
${answers}
NEXT STEP
NEXT STEP
Continue with plan generation.
`
})
undefinedContinue with plan generation.
`
})
undefinedclose_agent
close_agent
Clean up subagent resources (irreversible).
javascript
close_agent({ id: agentId })清理子代理资源(不可逆操作)。
javascript
close_agent({ id: agentId })Core Guidelines
核心指南
Data Access Principle: Issues files can grow very large. To avoid context overflow:
| Operation | Correct | Incorrect |
|---|---|---|
| List issues (brief) | | |
| Read issue details | | |
| Create issue | | Direct file write |
| Update status | | Direct file edit |
ALWAYS use CLI commands for CRUD operations. NEVER read entire directly.
issues.jsonl数据访问原则:问题文件可能会变得非常大。为避免上下文溢出:
| 操作 | 正确方式 | 错误方式 |
|---|---|---|
| 列出问题(简洁模式) | | |
| 读取问题详情 | | |
| 创建问题 | | 直接写入文件 |
| 更新状态 | | 直接编辑文件 |
必须使用CLI命令进行增删改查(CRUD)操作。绝不直接读取整个文件。
issues.jsonlError Handling
错误处理
| Error | Resolution |
|---|---|
| No action detected | Show ASK_USER with all 3 options |
| Invalid action type | Show available actions, re-prompt |
| Phase execution fails | Report error, suggest manual intervention |
| No files matched (discover) | Check target pattern, verify path exists |
| Gemini planning failed (discover-by-prompt) | Retry with qwen fallback |
| Agent lifecycle errors | Ensure close_agent in error paths to prevent resource leaks |
| 错误类型 | 解决方法 |
|---|---|
| 无法检测操作类型 | 显示ASK_USER界面,提供全部3个选项 |
| 无效的操作类型 | 显示可用操作,重新提示用户选择 |
| 阶段执行失败 | 报告错误,建议手动干预 |
| 未匹配到任何文件(发现模式) | 检查目标模式,验证路径是否存在 |
| Gemini规划失败(提示词驱动发现) | 使用qwen作为回退方案重试 |
| 子代理生命周期错误 | 确保在错误路径中调用close_agent以防止资源泄漏 |
Post-Phase Next Steps
阶段后下一步操作建议
After successful phase execution, recommend next action:
javascript
// After Create New (issue created)
ASK_USER([{
id: "next_after_create",
type: "select",
prompt: "Issue created. What next?",
options: [
{ label: "Plan Solution", description: "Generate solution via issue-resolve" },
{ label: "Create Another", description: "Create more issues" },
{ label: "View Issues", description: "Review all issues" },
{ label: "Done", description: "Exit workflow" }
]
}]); // BLOCKS (wait for user response)
// After Discover / Discover by Prompt (discoveries generated)
ASK_USER([{
id: "next_after_discover",
type: "select",
prompt: `Discovery complete: ${findings.length} findings, ${executableFindings.length} executable. What next?`,
options: [
{ label: "Quick Plan & Execute (Recommended)", description: `Fix ${executableFindings.length} high-confidence findings directly` },
{ label: "Export to Issues", description: "Convert discoveries to issues" },
{ label: "Plan Solutions", description: "Plan solutions for exported issues via issue-resolve" },
{ label: "Done", description: "Exit workflow" }
]
}]); // BLOCKS (wait for user response)
// If "Quick Plan & Execute" → Read phases/04-quick-execute.md, execute成功执行阶段后,推荐以下操作:
javascript
// After Create New (issue created)
ASK_USER([{
id: "next_after_create",
type: "select",
prompt: "Issue created. What next?",
options: [
{ label: "Plan Solution", description: "Generate solution via issue-resolve" },
{ label: "Create Another", description: "Create more issues" },
{ label: "View Issues", description: "Review all issues" },
{ label: "Done", description: "Exit workflow" }
]
}]); // BLOCKS (wait for user response)
// After Discover / Discover by Prompt (discoveries generated)
ASK_USER([{
id: "next_after_discover",
type: "select",
prompt: `Discovery complete: ${findings.length} findings, ${executableFindings.length} executable. What next?`,
options: [
{ label: "Quick Plan & Execute (Recommended)", description: `Fix ${executableFindings.length} high-confidence findings directly` },
{ label: "Export to Issues", description: "Convert discoveries to issues" },
{ label: "Plan Solutions", description: "Plan solutions for exported issues via issue-resolve" },
{ label: "Done", description: "Exit workflow" }
]
}]); // BLOCKS (wait for user response)
// If "Quick Plan & Execute" → Read phases/04-quick-execute.md, executeRelated Skills & Commands
相关技能与命令
- - Plan solutions, convert artifacts, form queues, from brainstorm
issue-resolve - - Interactive issue CRUD operations
issue-manage - - Execute queue with DAG-based parallel orchestration
/issue:execute - - List all issues
ccw issue list - - View issue details
ccw issue status <id>
- - 通过头脑风暴规划解决方案、转换工件、形成任务队列
issue-resolve - - 交互式问题增删改查操作
issue-manage - - 基于DAG的并行编排执行任务队列
/issue:execute - - 列出所有问题
ccw issue list - - 查看问题详情
ccw issue status <id>