Unified issue discovery and creation. Create issues from GitHub/text, discover issues via multi-perspective analysis, or prompt-driven iterative exploration...
Unified issue discovery and creation skill covering three entry points: manual issue creation, perspective-based discovery, and prompt-driven exploration.
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Issue Discover Orchestrator (SKILL.md) β
β β Action selection β Route to phase β Execute β Summary β
βββββββββββββββββ¬ββββββββββββββββββββββββββββββββββββββββββββββββββ
β
ββ request_user_input: 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
ccw issue CLI commands-y flag skips action selection with auto-detectionWhen --yes or -y: Skip action selection, auto-detect action from input type.
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
# 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)
# 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
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 β request_user_input to select action
ββ Initialize progress tracking: functions.update_plan([...phases])
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
| 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 |
ccw issue CLI for all issue operations, NEVER read files directlyfunction 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;
}
// When action cannot be auto-detected
const answer = functions.request_user_input({
questions: [{
header: "Action",
id: "action",
question: "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
// answer.answers.action.answers[0] β selected label
const actionMap = {
"Create New Issue (Recommended)": "new",
"Discover Issues": "discover",
"Discover by Prompt": "discover-by-prompt"
};
// Initialize progress tracking (MANDATORY)
functions.update_plan([
{ id: "action-select", title: "Action Selection", status: "completed" },
{ id: "phase-exec", title: `Phase: ${selectedAction}`, status: "in_progress" },
{ id: "post-phase", title: "Post-Phase: Next Steps", status: "pending" }
])
User Input (URL / text / path pattern / descriptive prompt)
β
[Parse Flags + Auto-Detect Action]
β
[Action Selection] β request_user_input (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
Create a new subagent with task assignment.
const agentId = spawn_agent({
agent_type: "{agent_type}",
message: `
## TASK ASSIGNMENT
### MANDATORY FIRST STEPS (Agent Execute)
1. Execute: ccw spec load --category exploration
2. Execute: ccw spec load --category debug (known issues cross-reference)
## TASK CONTEXT
${taskContext}
## DELIVERABLES
${deliverables}
`
})
Get results from subagent (only way to retrieve results).
const result = wait_agent({
timeout_ms: 1800000 // 30 minutes
})
if (result.timed_out) {
// Handle timeout via 4-step cascade: status probe β force finalize β close
}
// Check completion status
if (result.status[agentId].completed) {
const output = result.status[agentId].completed;
}
Assign new work to active subagent (for clarification or follow-up).
followup_task({
target: agentId,
message: `
## CLARIFICATION ANSWERS
${answers}
## NEXT STEP
Continue with plan generation.
`
})
Clean up subagent resources (irreversible).
close_agent({ target: agentId })
Data Access Principle: Issues files can grow very large. To avoid context overflow:
| Operation | Correct | Incorrect |
|---|---|---|
| List issues (brief) | ccw issue list --status pending --brief |
Read('issues.jsonl') |
| Read issue details | ccw issue status <id> --json |
Read('issues.jsonl') |
| Create issue | echo '...' | ccw issue create |
Direct file write |
| Update status | ccw issue update <id> --status ... |
Direct file edit |
ALWAYS use CLI commands for CRUD operations. NEVER read entire issues.jsonl directly.
| Error | Resolution |
|---|---|
| No action detected | Show request_user_input 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 |
Progress: functions.update_plan([{id: "phase-exec", status: "completed"}, {id: "post-phase", status: "in_progress"}])
After successful phase execution, recommend next action:
// After Create New (issue created)
functions.request_user_input({
questions: [{
header: "Next Step",
id: "next_after_create",
question: "Issue created. What next?",
options: [
{ label: "Plan Solution (Recommended)", description: "Generate solution via issue-resolve" },
{ label: "Create Another", description: "Create more issues" },
{ label: "Done", description: "Exit workflow" }
]
}]
}); // BLOCKS (wait for user response)
// answer.answers.next_after_create.answers[0] β selected label
// After Discover / Discover by Prompt (discoveries generated)
functions.request_user_input({
questions: [{
header: "Next Step",
id: "next_after_discover",
question: `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: "Done", description: "Exit workflow" }
]
}]
}); // BLOCKS (wait for user response)
// answer.answers.next_after_discover.answers[0] β selected label
// If "Quick Plan & Execute (Recommended)" β Read phases/04-quick-execute.md, execute
// Mark workflow complete
functions.update_plan([{ id: "post-phase", status: "completed" }])
issue-resolve - Plan solutions, convert artifacts, form queues, from brainstormissue-manage - Interactive issue CRUD operations/issue:execute - Execute queue with DAG-based parallel orchestrationccw issue list - List all issuesccw issue status <id> - View issue details