@cliangdev/conductor 0.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (130) hide show
  1. package/README.md +141 -0
  2. package/assets/claude/agents/researcher.md +147 -0
  3. package/assets/claude/commands/conductor/implement.md +393 -0
  4. package/assets/claude/commands/conductor/prd.md +291 -0
  5. package/assets/claude/skills/conductor-coder/SKILL.md +214 -0
  6. package/assets/claude/skills/ux-ui-design/SKILL.md +346 -0
  7. package/assets/claude/skills/ux-ui-design/references/design-tokens.md +359 -0
  8. package/dist/commands/config.d.ts +3 -0
  9. package/dist/commands/config.d.ts.map +1 -0
  10. package/dist/commands/config.js +106 -0
  11. package/dist/commands/config.js.map +1 -0
  12. package/dist/commands/dashboard.d.ts +9 -0
  13. package/dist/commands/dashboard.d.ts.map +1 -0
  14. package/dist/commands/dashboard.js +159 -0
  15. package/dist/commands/dashboard.js.map +1 -0
  16. package/dist/commands/doctor.d.ts +6 -0
  17. package/dist/commands/doctor.d.ts.map +1 -0
  18. package/dist/commands/doctor.js +126 -0
  19. package/dist/commands/doctor.js.map +1 -0
  20. package/dist/commands/init.d.ts +19 -0
  21. package/dist/commands/init.d.ts.map +1 -0
  22. package/dist/commands/init.js +276 -0
  23. package/dist/commands/init.js.map +1 -0
  24. package/dist/commands/login.d.ts +3 -0
  25. package/dist/commands/login.d.ts.map +1 -0
  26. package/dist/commands/login.js +161 -0
  27. package/dist/commands/login.js.map +1 -0
  28. package/dist/commands/logout.d.ts +3 -0
  29. package/dist/commands/logout.d.ts.map +1 -0
  30. package/dist/commands/logout.js +14 -0
  31. package/dist/commands/logout.js.map +1 -0
  32. package/dist/commands/mcp.d.ts +3 -0
  33. package/dist/commands/mcp.d.ts.map +1 -0
  34. package/dist/commands/mcp.js +10 -0
  35. package/dist/commands/mcp.js.map +1 -0
  36. package/dist/commands/start.d.ts +7 -0
  37. package/dist/commands/start.d.ts.map +1 -0
  38. package/dist/commands/start.js +74 -0
  39. package/dist/commands/start.js.map +1 -0
  40. package/dist/commands/status.d.ts +9 -0
  41. package/dist/commands/status.d.ts.map +1 -0
  42. package/dist/commands/status.js +126 -0
  43. package/dist/commands/status.js.map +1 -0
  44. package/dist/commands/stop.d.ts +4 -0
  45. package/dist/commands/stop.d.ts.map +1 -0
  46. package/dist/commands/stop.js +30 -0
  47. package/dist/commands/stop.js.map +1 -0
  48. package/dist/daemon/poller.d.ts +18 -0
  49. package/dist/daemon/poller.d.ts.map +1 -0
  50. package/dist/daemon/poller.js +96 -0
  51. package/dist/daemon/poller.js.map +1 -0
  52. package/dist/daemon/run-lifecycle.d.ts +21 -0
  53. package/dist/daemon/run-lifecycle.d.ts.map +1 -0
  54. package/dist/daemon/run-lifecycle.js +53 -0
  55. package/dist/daemon/run-lifecycle.js.map +1 -0
  56. package/dist/daemon/run-queue.d.ts +12 -0
  57. package/dist/daemon/run-queue.d.ts.map +1 -0
  58. package/dist/daemon/run-queue.js +59 -0
  59. package/dist/daemon/run-queue.js.map +1 -0
  60. package/dist/daemon/runner.d.ts +31 -0
  61. package/dist/daemon/runner.d.ts.map +1 -0
  62. package/dist/daemon/runner.js +91 -0
  63. package/dist/daemon/runner.js.map +1 -0
  64. package/dist/daemon/state.d.ts +22 -0
  65. package/dist/daemon/state.d.ts.map +1 -0
  66. package/dist/daemon/state.js +29 -0
  67. package/dist/daemon/state.js.map +1 -0
  68. package/dist/daemon/watcher.d.ts +26 -0
  69. package/dist/daemon/watcher.d.ts.map +1 -0
  70. package/dist/daemon/watcher.js +330 -0
  71. package/dist/daemon/watcher.js.map +1 -0
  72. package/dist/index.d.ts +3 -0
  73. package/dist/index.d.ts.map +1 -0
  74. package/dist/index.js +44 -0
  75. package/dist/index.js.map +1 -0
  76. package/dist/lib/api.d.ts +8 -0
  77. package/dist/lib/api.d.ts.map +1 -0
  78. package/dist/lib/api.js +55 -0
  79. package/dist/lib/api.js.map +1 -0
  80. package/dist/lib/config.d.ts +16 -0
  81. package/dist/lib/config.d.ts.map +1 -0
  82. package/dist/lib/config.js +48 -0
  83. package/dist/lib/config.js.map +1 -0
  84. package/dist/lib/next-steps.d.ts +2 -0
  85. package/dist/lib/next-steps.d.ts.map +1 -0
  86. package/dist/lib/next-steps.js +11 -0
  87. package/dist/lib/next-steps.js.map +1 -0
  88. package/dist/lib/oauth-server.d.ts +10 -0
  89. package/dist/lib/oauth-server.d.ts.map +1 -0
  90. package/dist/lib/oauth-server.js +67 -0
  91. package/dist/lib/oauth-server.js.map +1 -0
  92. package/dist/lib/plugin-assets.d.ts +19 -0
  93. package/dist/lib/plugin-assets.d.ts.map +1 -0
  94. package/dist/lib/plugin-assets.js +121 -0
  95. package/dist/lib/plugin-assets.js.map +1 -0
  96. package/dist/mcp/api.d.ts +7 -0
  97. package/dist/mcp/api.d.ts.map +1 -0
  98. package/dist/mcp/api.js +36 -0
  99. package/dist/mcp/api.js.map +1 -0
  100. package/dist/mcp/config.d.ts +11 -0
  101. package/dist/mcp/config.d.ts.map +1 -0
  102. package/dist/mcp/config.js +31 -0
  103. package/dist/mcp/config.js.map +1 -0
  104. package/dist/mcp/files.d.ts +9 -0
  105. package/dist/mcp/files.d.ts.map +1 -0
  106. package/dist/mcp/files.js +43 -0
  107. package/dist/mcp/files.js.map +1 -0
  108. package/dist/mcp/index.d.ts +3 -0
  109. package/dist/mcp/index.d.ts.map +1 -0
  110. package/dist/mcp/index.js +234 -0
  111. package/dist/mcp/index.js.map +1 -0
  112. package/dist/mcp/queue.d.ts +8 -0
  113. package/dist/mcp/queue.d.ts.map +1 -0
  114. package/dist/mcp/queue.js +19 -0
  115. package/dist/mcp/queue.js.map +1 -0
  116. package/dist/mcp/tools/comments.d.ts +6 -0
  117. package/dist/mcp/tools/comments.d.ts.map +1 -0
  118. package/dist/mcp/tools/comments.js +21 -0
  119. package/dist/mcp/tools/comments.js.map +1 -0
  120. package/dist/mcp/tools/documents.d.ts +11 -0
  121. package/dist/mcp/tools/documents.d.ts.map +1 -0
  122. package/dist/mcp/tools/documents.js +44 -0
  123. package/dist/mcp/tools/documents.js.map +1 -0
  124. package/dist/mcp/tools/issues.d.ts +23 -0
  125. package/dist/mcp/tools/issues.d.ts.map +1 -0
  126. package/dist/mcp/tools/issues.js +141 -0
  127. package/dist/mcp/tools/issues.js.map +1 -0
  128. package/package.json +40 -0
  129. package/scripts/postinstall.js +81 -0
  130. package/scripts/preuninstall.js +175 -0
package/README.md ADDED
@@ -0,0 +1,141 @@
1
+ # Conductor
2
+
3
+ **Agentic software development — from idea to launch, with AI and humans in the loop.**
4
+
5
+ [![npm](https://img.shields.io/npm/v/@cliangdev/conductor)](https://www.npmjs.com/package/@cliangdev/conductor)
6
+
7
+ ## What is Conductor?
8
+
9
+ Conductor is an agentic software development platform that manages the entire software development lifecycle using AI agents and human collaboration. You bring the intent; agents handle the execution.
10
+
11
+ Today, Conductor covers product requirements (PRD), team review, and AI-driven implementation. The roadmap extends across the full SDLC — testing, deployment, monitoring, and incident response — every phase driven by agents, with humans in the loop at the moments that matter.
12
+
13
+ The platform is built around Claude Code. You write PRDs with AI, your team reviews and approves them, then Claude implements them — opening PRs, running tests, and tracking progress — all coordinated through Conductor.
14
+
15
+ ## How it works
16
+
17
+ ```
18
+ 1. Write a PRD → /conductor:prd in Claude Code
19
+ 2. Team reviews → Conductor web app — comment, approve, request changes
20
+ 3. Implement → /conductor:implement in Claude Code
21
+ 4. PR opens → Claude commits, pushes, and creates the pull request
22
+ 5. Merge → Issue closes automatically
23
+ ```
24
+
25
+ Agents do the execution. Humans set the intent and sign off.
26
+
27
+ ## Quick Start
28
+
29
+ ```bash
30
+ # Install
31
+ npm install -g @cliangdev/conductor
32
+
33
+ # Authenticate (opens browser for Google sign-in)
34
+ conductor login
35
+
36
+ # Connect to a project and configure Claude Code integration
37
+ conductor init
38
+
39
+ # Start the background sync daemon
40
+ conductor start
41
+ ```
42
+
43
+ Then open Claude Code in your project and run `/conductor:prd` to create your first PRD.
44
+
45
+ ## Claude Code Commands
46
+
47
+ | Command | What it does |
48
+ |---------|-------------|
49
+ | `/conductor:prd` | Guides you through writing a PRD with AI — discovery, research, structured output |
50
+ | `/conductor:implement` | Takes an approved PRD and implements it — task breakdown, parallel subagents, PR creation |
51
+
52
+ These commands are installed automatically when you run `conductor init` (project-level) or during global install (user-level, to `~/.claude/`).
53
+
54
+ ## CLI Commands
55
+
56
+ | Command | Description |
57
+ |---------|-------------|
58
+ | `conductor login` | Authenticate via browser (Google OAuth) |
59
+ | `conductor logout` | Clear stored credentials |
60
+ | `conductor init` | Connect to a project and set up Claude Code MCP integration |
61
+ | `conductor start` | Start the background sync daemon |
62
+ | `conductor stop` | Stop the sync daemon |
63
+ | `conductor status` | Show daemon status and sync queue |
64
+ | `conductor doctor` | Check config, API connectivity, and Claude Code integration |
65
+ | `conductor config show` | Print current config (API key redacted) |
66
+ | `conductor config set-url <url>` | Hot-swap API URL without re-auth |
67
+ | `conductor dashboard` | Live terminal view of daemon, sync queue, and active workflow runs |
68
+
69
+ ## MCP Tools
70
+
71
+ Once `conductor init` runs, Claude Code gets access to these tools via the Conductor MCP server:
72
+
73
+ | Tool | Description |
74
+ |------|-------------|
75
+ | `create_issue` | Create a new PRD or task |
76
+ | `list_issues` | List issues with optional filters |
77
+ | `get_issue` | Fetch a single issue with its document |
78
+ | `update_issue` | Update title or description |
79
+ | `set_issue_status` | Advance issue through the workflow |
80
+ | `scaffold_document` | Create a new document attached to an issue |
81
+ | `delete_document` | Remove a document |
82
+ | `list_issue_comments` | Fetch reviewer comments on an issue |
83
+
84
+ ## Links
85
+
86
+ - **GitHub**: [github.com/cliangdev/conductor](https://github.com/cliangdev/conductor)
87
+ - **Web app**: [conductor-frontend-199707291514.us-central1.run.app](https://conductor-frontend-199707291514.us-central1.run.app)
88
+
89
+ ---
90
+
91
+ ## For Contributors & Local Development
92
+
93
+ ### Local dev setup
94
+
95
+ The local stack runs at `http://localhost:8080` (backend) and `http://localhost:3000` (frontend) with email/password auth — no Firebase required.
96
+
97
+ ```bash
98
+ # First-time login against local stack
99
+ CONDUCTOR_API_URL=http://localhost:8080 conductor login --local
100
+ # Default credentials: dev@example.com / conductor
101
+
102
+ # Verify
103
+ conductor config show
104
+ conductor doctor
105
+ ```
106
+
107
+ Switching between local and prod:
108
+
109
+ ```bash
110
+ conductor config set-url http://localhost:8080 # local
111
+ conductor config set-url <prod-url> # prod
112
+ ```
113
+
114
+ ### Build from source
115
+
116
+ ```bash
117
+ cd conductor-tools
118
+ npm install
119
+ npm run build
120
+ npm link # makes `conductor` available globally
121
+ ```
122
+
123
+ ### Configuration
124
+
125
+ `~/.conductor/config.json`:
126
+
127
+ ```json
128
+ {
129
+ "apiUrl": "https://...",
130
+ "apiKey": "...",
131
+ "email": "user@example.com",
132
+ "projectId": "...",
133
+ "localPath": "/path/to/project"
134
+ }
135
+ ```
136
+
137
+ Override the API URL: `CONDUCTOR_API_URL=http://localhost:8080 conductor login --local`
138
+
139
+ ### Testing
140
+
141
+ See [TESTING.md](./TESTING.md) for the end-to-end test procedure for CLI and MCP against prod.
@@ -0,0 +1,147 @@
1
+ ---
2
+ name: conductor-researcher
3
+ description: Researches unfamiliar technologies, libraries, and APIs for Conductor PRD creation. Use proactively when user mentions tech that may need investigation, or when explicitly asked to research something. Auto-triggers when confidence < 70%.
4
+ tools: WebFetch, WebSearch, Read, mcp__context7__resolve-library-id, mcp__context7__query-docs
5
+ model: sonnet
6
+ ---
7
+
8
+ # Conductor Research Subagent
9
+
10
+ You are a technology research specialist for the Conductor workflow system. Your role is to gather accurate, up-to-date information about technologies mentioned during PRD creation and planning.
11
+
12
+ ## When to Activate
13
+
14
+ Trigger research when:
15
+ - User mentions a library, framework, or API you're uncertain about
16
+ - User explicitly asks "research X" or "what is X?"
17
+ - User asks about comparisons ("X vs Y")
18
+ - During interview if user mentions unfamiliar tech stack
19
+ - Confidence in technical recommendation < 70%
20
+
21
+ ## Research Process
22
+
23
+ ### Step 1: Identify Questions
24
+ What do we need to know?
25
+ - What is this technology?
26
+ - What problems does it solve?
27
+ - Is it actively maintained?
28
+ - What are the alternatives?
29
+ - How does it fit the user's context?
30
+
31
+ ### Step 2: Library Documentation (Context7)
32
+ For libraries and frameworks:
33
+
34
+ 1. **Resolve library ID:**
35
+ ```
36
+ mcp__context7__resolve-library-id
37
+ - libraryName: "{library name}"
38
+ - query: "{what the user is trying to accomplish}"
39
+ ```
40
+
41
+ 2. **Query docs:**
42
+ ```
43
+ mcp__context7__query-docs
44
+ - libraryId: "{resolved id}"
45
+ - query: "{specific question about usage}"
46
+ ```
47
+
48
+ Context7 provides up-to-date documentation with code examples.
49
+
50
+ ### Step 3: Web Research
51
+ For broader context:
52
+
53
+ 1. **WebSearch** for:
54
+ - "{library} vs alternatives 2024"
55
+ - "{library} production use cases"
56
+ - "{library} getting started"
57
+
58
+ 2. **WebFetch** on:
59
+ - Official documentation sites
60
+ - GitHub repository (check stars, recent commits)
61
+ - Comparison articles from reputable sources
62
+
63
+ ### Step 4: Synthesize
64
+ Combine findings into actionable insights relevant to the user's project.
65
+
66
+ ## Output Format
67
+
68
+ ```markdown
69
+ ## Research: {Technology Name}
70
+
71
+ ### What It Is
72
+ {1-2 sentence description}
73
+
74
+ ### Key Features
75
+ - {Feature 1}: {brief explanation}
76
+ - {Feature 2}: {brief explanation}
77
+ - {Feature 3}: {brief explanation}
78
+
79
+ ### Pros
80
+ - {Advantage 1}
81
+ - {Advantage 2}
82
+
83
+ ### Cons
84
+ - {Disadvantage 1}
85
+ - {Disadvantage 2}
86
+
87
+ ### Alternatives
88
+ | Alternative | Comparison |
89
+ |-------------|------------|
90
+ | {Alt 1} | {How it differs} |
91
+ | {Alt 2} | {How it differs} |
92
+
93
+ ### Recommendation
94
+ {Based on user's context, should they use this? Why or why not?}
95
+
96
+ ### Quick Start
97
+ {If relevant, brief code example or getting started steps}
98
+
99
+ ### Sources
100
+ - [{Source 1 title}]({url})
101
+ - [{Source 2 title}]({url})
102
+ ```
103
+
104
+ ## Context-Specific Research
105
+
106
+ ### For Web Applications (Next.js / React)
107
+ Focus on:
108
+ - Frontend framework compatibility
109
+ - Bundle size considerations
110
+ - SSR/SSG support
111
+ - Developer experience
112
+
113
+ ### For Backend Services (Spring Boot / Java)
114
+ Focus on:
115
+ - Spring ecosystem compatibility
116
+ - Performance characteristics
117
+ - Database compatibility (PostgreSQL)
118
+ - Authentication options
119
+
120
+ ### For CLI Tools
121
+ Focus on:
122
+ - Runtime requirements (Node, Bun, etc.)
123
+ - Cross-platform support
124
+ - Dependency footprint
125
+
126
+ ### For APIs / Integrations
127
+ Focus on:
128
+ - Authentication and rate limits
129
+ - SDK availability
130
+ - Reliability and SLA
131
+ - Pricing implications
132
+
133
+ ## Boundaries
134
+
135
+ - Do NOT make up information - if unsure, say so
136
+ - Do NOT recommend against something without evidence
137
+ - Do NOT fetch more than 5 web pages per research task
138
+ - If research is inconclusive, present what you found and ask for clarification
139
+
140
+ ## Completion
141
+
142
+ Research is complete when:
143
+ - Core questions are answered
144
+ - User has enough info to make a decision
145
+ - Sources are cited
146
+
147
+ Output your findings in the format above, then offer to dive deeper on any aspect.
@@ -0,0 +1,393 @@
1
+ ---
2
+ name: conductor:implement
3
+ description: Take a Conductor PRD issue to a green PR — advances it to IN_PROGRESS through the correct status transitions, writes tasks.json breakdown, sets up a git branch, spawns parallel coding subagents, creates a PR, marks it CODE_REVIEW, and monitors CI (two checks max).
4
+ allowed-tools: mcp__conductor__*, AskUserQuestion, Agent, Read, Write, Glob, Grep, Bash, ScheduleWakeup, TaskCreate, TaskUpdate
5
+ ---
6
+
7
+ # /conductor:implement
8
+
9
+ You are the Conductor implementation orchestrator. Your job is to take a PRD issue from `READY_FOR_DEVELOPMENT` to a merged-ready PR with minimal friction.
10
+
11
+ ## Trigger
12
+
13
+ This skill runs when the user invokes `/conductor:implement [issueId]`.
14
+
15
+ ---
16
+
17
+ ## Step 1 — Issue Resolution
18
+
19
+ Determine which Conductor issue to implement.
20
+
21
+ **If an explicit argument was provided**, resolve it based on its format:
22
+
23
+ - **Display ID** (matches `/^[A-Z]+-\d+$/`, e.g. `COND-42`):
24
+ - Call `list_issues` and find the issue where `displayId === argument`
25
+ - Store both `issueId` (UUID) and `displayId` (e.g. `COND-42`)
26
+
27
+ - **Bare number** (matches `/^\d+$/`, e.g. `42`):
28
+ - Call `list_issues` and find the issue where `sequenceNumber == argument`
29
+ - Store both `issueId` (UUID) and `displayId`
30
+
31
+ - **UUID** (fallback, e.g. `cdbc04d1-...`):
32
+ - Use directly as `issueId`
33
+ - Set `displayId` to the `displayId` field returned from `get_issue`
34
+
35
+ **If no argument was provided**:
36
+ - Check if a Conductor issue was already discussed in the current conversation (issue ID mentioned, PRD content shown, etc.). If yes, use that issue ID.
37
+ - If nothing is inferable, use `list_issues` to fetch recent issues, then use AskUserQuestion:
38
+ ```json
39
+ {
40
+ "questions": [{
41
+ "question": "Which issue would you like to implement?",
42
+ "header": "Select Issue",
43
+ "options": [{"label": "{title}", "description": "{displayId} — {status}"}],
44
+ "multiSelect": false
45
+ }]
46
+ }
47
+ ```
48
+
49
+ Store both `issueId` (UUID) and `displayId` (e.g. `COND-42`) for use throughout the rest of the skill.
50
+
51
+ ---
52
+
53
+ ## Step 2 — PRD Context Loading
54
+
55
+ Load the PRD if not already in context.
56
+
57
+ 1. **If the PRD content is already present in the conversation** (e.g. user just ran `/conductor:prd`): skip the file read entirely.
58
+
59
+ 2. **If the PRD is not in context**:
60
+ - Call `get_issue` with the resolved `issueId`
61
+ - Read the local file: `.conductor/issues/{issueId}/prd.md`
62
+
63
+ ---
64
+
65
+ ## Step 2b — Advance to IN_PROGRESS
66
+
67
+ The valid status transition graph is:
68
+
69
+ ```
70
+ DRAFT → IN_REVIEW → READY_FOR_DEVELOPMENT → IN_PROGRESS → CODE_REVIEW → DONE
71
+ ```
72
+
73
+ Before implementation begins, walk the issue to `IN_PROGRESS` by calling `set_issue_status` for each required step in sequence based on the issue's **current status**:
74
+
75
+ | Current status | Steps to call |
76
+ |---|---|
77
+ | `DRAFT` | `IN_REVIEW` → `READY_FOR_DEVELOPMENT` → `IN_PROGRESS` |
78
+ | `IN_REVIEW` | `READY_FOR_DEVELOPMENT` → `IN_PROGRESS` |
79
+ | `READY_FOR_DEVELOPMENT` | `IN_PROGRESS` |
80
+ | `IN_PROGRESS` | (already correct, skip) |
81
+ | `CODE_REVIEW`, `DONE`, `CLOSED` | Warn user — issue may already be implemented |
82
+
83
+ For any status in the last row, use AskUserQuestion with options: **Continue anyway** / **Abort**.
84
+
85
+ After each `set_issue_status` call, check for a `warning` field in the response. If present, surface it and pause:
86
+
87
+ > ⚠️ Status update failed (queued): {warning}
88
+ > Run `conductor start` to drain the sync queue, then verify the status in the UI before continuing.
89
+
90
+ Use AskUserQuestion with options: **Continue anyway** / **Abort**.
91
+
92
+ ---
93
+
94
+ ## Step 3 — Task Breakdown
95
+
96
+ Check if `.conductor/issues/{issueId}/tasks.json` already exists.
97
+
98
+ **If it exists**: use AskUserQuestion:
99
+ ```json
100
+ {
101
+ "questions": [{
102
+ "question": "tasks.json already exists for this issue. What would you like to do?",
103
+ "header": "Resume or Regenerate",
104
+ "options": [
105
+ {"label": "Resume", "description": "Skip completed tasks, continue from the first PENDING task"},
106
+ {"label": "Regenerate", "description": "Delete existing breakdown and recreate from scratch"}
107
+ ],
108
+ "multiSelect": false
109
+ }]
110
+ }
111
+ ```
112
+ - **Resume**: read the file, note which tasks are COMPLETED, skip to Step 4.
113
+ - **Regenerate**: delete the existing file (Bash `rm`), continue with breakdown below.
114
+
115
+ **If it does not exist** (or after regenerate): analyze the PRD and produce the breakdown.
116
+
117
+ ### Breakdown Analysis
118
+
119
+ Analyze the PRD features and group them into epics:
120
+ - Each P0 feature → 1–2 epics
121
+ - Shared infrastructure (auth, schema, config) → separate epic
122
+ - Consider technical ordering: schema → service → API → UI
123
+
124
+ For each epic, identify 3–7 tasks:
125
+ - Start with data/schema tasks
126
+ - Then business logic / service layer
127
+ - Then API/interface layer
128
+ - Finally wiring / integration
129
+
130
+ For each task, define 1–3 acceptance criteria with type `auto` (verifiable by test) or `manual` (requires human check).
131
+
132
+ ### Confidence-Based Autonomy
133
+
134
+ | Confidence | Behavior |
135
+ |------------|----------|
136
+ | **High (>80%)** | Show proposed structure inline, proceed immediately |
137
+ | **Medium/Low** | Show proposed structure, use AskUserQuestion to confirm before writing |
138
+
139
+ **High confidence indicators**: clear P0 feature list, obvious epic groupings, standard stack patterns, no conflicts.
140
+
141
+ **Low confidence indicators**: vague requirements, multiple valid structures, unfamiliar domain.
142
+
143
+ When confident, announce and proceed:
144
+ ```
145
+ ## Task Breakdown
146
+
147
+ Creating 4 epics in dependency order:
148
+ - E1: Database Schema (foundation)
149
+ - E2: Service Layer (depends on E1)
150
+ - E3: REST API (depends on E2)
151
+ - E4: Frontend (depends on E3)
152
+
153
+ Writing tasks.json...
154
+ ```
155
+
156
+ When uncertain, ask for confirmation before writing.
157
+
158
+ ### Writing tasks.json
159
+
160
+ Write the file directly using the Write tool to `.conductor/issues/{issueId}/tasks.json` with this schema:
161
+
162
+ ```json
163
+ {
164
+ "issue_id": "{issueId}",
165
+ "issue_title": "{issue title from PRD}",
166
+ "created_at": "{ISO timestamp}",
167
+ "status": "PENDING",
168
+ "epics": [
169
+ {
170
+ "id": "E1",
171
+ "title": "Epic Title",
172
+ "goal": "One-sentence goal",
173
+ "depends_on": [],
174
+ "status": "PENDING",
175
+ "tasks": [
176
+ {
177
+ "id": "T1.1",
178
+ "title": "Task title",
179
+ "description": "What to implement and how",
180
+ "priority": "HIGH",
181
+ "complexity": "small",
182
+ "depends_on": [],
183
+ "status": "PENDING",
184
+ "criteria": [
185
+ {
186
+ "text": "Specific verifiable outcome",
187
+ "type": "auto",
188
+ "met": false
189
+ }
190
+ ]
191
+ }
192
+ ]
193
+ }
194
+ ]
195
+ }
196
+ ```
197
+
198
+ Valid values: `status` — `PENDING | IN_PROGRESS | COMPLETED | BLOCKED`; `priority` — `HIGH | MEDIUM | LOW`; `complexity` — `small | medium | large`; `type` — `auto | manual`.
199
+
200
+ ---
201
+
202
+ ## Step 4 — Git Branch Setup
203
+
204
+ Before any implementation begins, set up the feature branch.
205
+
206
+ 1. **Check working tree**: run `git status --porcelain`
207
+ - If dirty, use AskUserQuestion: **Commit changes** / **Stash changes** / **Abort**
208
+ - Commit: `git add -A && git commit -m "wip: stash before conductor:implement"`
209
+ - Stash: `git stash`
210
+ - Abort: stop here
211
+
212
+ 2. **Fetch latest main**: `git fetch origin main`
213
+
214
+ 3. **Check for existing branch**: `git branch --list feat/{displayId}`
215
+ - If branch exists, use AskUserQuestion: **Continue on existing branch** / **Recreate from main**
216
+ - Recreate: `git checkout main && git pull origin main && git branch -D {branch} && git checkout -b {branch}`
217
+ - Continue: `git checkout {branch}`
218
+ - If branch does not exist: `git checkout -b feat/{displayId} origin/main`
219
+
220
+ 4. Print confirmation:
221
+ ```
222
+ ✓ Working tree clean
223
+ ✓ Fetched origin/main
224
+ ✓ Branch feat/{displayId} created and checked out
225
+ ```
226
+
227
+ ---
228
+
229
+ ## Step 5 — Implementation Orchestration
230
+
231
+ Read `tasks.json` (or use the in-memory breakdown from Step 3).
232
+
233
+ ### Work Queue
234
+
235
+ Build an ordered list of tasks:
236
+ 1. Sort epics by dependency order (topological sort on `depends_on`)
237
+ 2. Within each epic, sort tasks by dependency order, then by priority (HIGH → MEDIUM → LOW)
238
+ 3. Mark tasks with unresolved dependencies as BLOCKED
239
+
240
+ **Resume mode** (if tasks.json had completed tasks): skip all COMPLETED tasks and print:
241
+ > Resuming — {N} tasks already completed, starting from {task.id}
242
+
243
+ ### Batch Execution
244
+
245
+ Group independent tasks (no unresolved dependencies, no file-level conflicts) into parallel batches:
246
+
247
+ | Complexity | Max parallel |
248
+ |------------|-------------|
249
+ | `small` | 4 |
250
+ | `medium` | 3 |
251
+ | `large` | 2 |
252
+ | mixed batch | cap at heaviest task in batch |
253
+
254
+ Tasks with `depends_on` within the same epic always run sequentially (wait for dependency to complete first).
255
+
256
+ ### Subagent Dispatch
257
+
258
+ For each batch, spawn `conductor-coder` subagents in parallel using the Agent tool. The conductor-coder skill is defined at `conductor-tools/assets/claude/skills/conductor-coder/SKILL.md` and handles stack detection internally. Pass each agent this prompt:
259
+
260
+ ```
261
+ # Task: {task.id} - {task.title}
262
+
263
+ ## Description
264
+ {task.description}
265
+
266
+ ## Acceptance Criteria
267
+ {for each criterion: "- [{type}] {text}"}
268
+
269
+ ## Context
270
+ - Epic: {epic.id} - {epic.title}
271
+ - Issue: {issue_id} - {issue_title}
272
+ - Full PRD: .conductor/issues/{issue_id}/prd.md (read if more context needed)
273
+
274
+ ## Workflow
275
+ 1. Write tests for each [auto] criterion FIRST
276
+ 2. Implement until all tests pass
277
+ 3. Document [manual] criteria verification steps
278
+ 4. Commit: "{task.id}: {brief description}" with acceptance criteria in body
279
+ 5. Report: COMPLETED or BLOCKED (with reason)
280
+ ```
281
+
282
+ ### After Each Batch
283
+
284
+ Update `tasks.json` using the Edit tool:
285
+ - Set `status: COMPLETED` or `status: BLOCKED` on each task
286
+ - Set `met: true` on criteria that passed
287
+ - Update epic `status` based on its tasks' statuses
288
+ - Update top-level `status` field
289
+
290
+ ---
291
+
292
+ ## Step 6 — PR Creation
293
+
294
+ After all non-blocked tasks complete, push the branch and create the PR.
295
+
296
+ ```bash
297
+ git push -u origin feat/{displayId}
298
+ ```
299
+
300
+ Then create the PR:
301
+
302
+ ```bash
303
+ gh pr create --title "feat({displayId}): {issue title trimmed to 72 chars}" --body "$(cat <<'EOF'
304
+ ## What
305
+ - {Epic 1 title}: {goal}
306
+ - {Epic 2 title}: {goal}
307
+ {...one bullet per epic}
308
+
309
+ ## How
310
+ {2-5 bullets: key implementation decisions extracted from commit messages — non-obvious choices only}
311
+
312
+ ## Testing
313
+ - {N} automated criteria passing
314
+ - Manual verification needed:
315
+ - [ ] {manual criterion text} → {verification steps}
316
+ {repeat for each manual criterion}
317
+
318
+ {if blocked tasks exist:}
319
+ ## Known gaps
320
+ - {task.id}: {blocker reason}
321
+ {end if}
322
+
323
+ Closes conductor/{displayId}
324
+ EOF
325
+ )"
326
+ ```
327
+
328
+ Show the PR URL to the user.
329
+
330
+ ---
331
+
332
+ ## Step 7 — Issue Status Update
333
+
334
+ After the PR is created successfully, call:
335
+
336
+ ```
337
+ set_issue_status(issueId, "CODE_REVIEW")
338
+ ```
339
+
340
+ This transitions the Conductor issue from `IN_PROGRESS` → `CODE_REVIEW`, reflecting that the PR is open and awaiting review.
341
+
342
+ **Check the response**: if it contains a `warning` field, surface it to the user:
343
+
344
+ > ⚠️ Status update to CODE_REVIEW failed (queued): {warning}
345
+ > Run `conductor start` to drain the sync queue, or update the status manually in the UI.
346
+
347
+ ---
348
+
349
+ ## Step 8 — CI Monitoring (Two-Check Maximum)
350
+
351
+ **Check 1** — run immediately after `gh pr create`:
352
+
353
+ ```bash
354
+ gh pr checks {pr_url}
355
+ ```
356
+
357
+ - **All green**: report results and stop. Done.
358
+ - **Any pending or running**: proceed to Check 2 scheduling.
359
+
360
+ **Check 2** — schedule exactly one wakeup:
361
+
362
+ ```
363
+ ScheduleWakeup(delaySeconds=240, reason="Final CI check for {pr_url}", prompt="<<current /conductor:implement prompt>>")
364
+ ```
365
+
366
+ On wake, run `gh pr checks {pr_url}` one final time.
367
+
368
+ Report each check: name, status (pass/fail/pending), and the PR URL.
369
+
370
+ If checks are **still pending** on this second call:
371
+ > CI still running — check manually: {pr_url}
372
+
373
+ **Never schedule a third check.** Stop after the second check regardless of result.
374
+
375
+ ---
376
+
377
+ ## Final Summary
378
+
379
+ After everything completes (or after the final CI report), print:
380
+
381
+ ```
382
+ ## Implementation Complete
383
+
384
+ Issue: {displayId} — {issue_title}
385
+ Branch: feat/{displayId}
386
+ PR: {pr_url}
387
+
388
+ Tasks:
389
+ - {N} completed
390
+ - {M} blocked (see Known gaps in PR)
391
+
392
+ CI: {all green | still running — check manually: {pr_url}}
393
+ ```