@delete101020/aidlc 4.0.0

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 (93) hide show
  1. package/AUTOMATION.md +148 -0
  2. package/README.md +684 -0
  3. package/dist/assets/annotate-artifact.skill.md +121 -0
  4. package/dist/assets/epic-context.skill.md +55 -0
  5. package/dist/bundle.js +49470 -0
  6. package/dist/templates/ainative/agents/native-engineer.md +66 -0
  7. package/dist/templates/ainative/agents/native-operator.md +71 -0
  8. package/dist/templates/ainative/agents/native-originator.md +56 -0
  9. package/dist/templates/ainative/agents/native-product-owner.md +68 -0
  10. package/dist/templates/ainative/agents/native-reviewer.md +65 -0
  11. package/dist/templates/ainative/agents/native-verifier.md +58 -0
  12. package/dist/templates/ainative/artifacts/build-plan.md +56 -0
  13. package/dist/templates/ainative/artifacts/implement.md +55 -0
  14. package/dist/templates/ainative/artifacts/intent.md +50 -0
  15. package/dist/templates/ainative/artifacts/maintain.md +85 -0
  16. package/dist/templates/ainative/artifacts/review.md +68 -0
  17. package/dist/templates/ainative/artifacts/spec.md +69 -0
  18. package/dist/templates/ainative/artifacts/verify.md +55 -0
  19. package/dist/templates/ainative/skills/native-build-plan.md +74 -0
  20. package/dist/templates/ainative/skills/native-implement.md +62 -0
  21. package/dist/templates/ainative/skills/native-intent.md +50 -0
  22. package/dist/templates/ainative/skills/native-maintain.md +94 -0
  23. package/dist/templates/ainative/skills/native-review.md +82 -0
  24. package/dist/templates/ainative/skills/native-spec.md +83 -0
  25. package/dist/templates/ainative/skills/native-verify.md +60 -0
  26. package/dist/templates/sdlc/agents/designer.md +87 -0
  27. package/dist/templates/sdlc/agents/developer.md +178 -0
  28. package/dist/templates/sdlc/agents/example-with-skills.md +59 -0
  29. package/dist/templates/sdlc/agents/orchestrator.md +186 -0
  30. package/dist/templates/sdlc/agents/po.md +115 -0
  31. package/dist/templates/sdlc/agents/qa.md +141 -0
  32. package/dist/templates/sdlc/agents/tech-lead.md +124 -0
  33. package/dist/templates/sdlc/artifacts/design.md +130 -0
  34. package/dist/templates/sdlc/artifacts/execute-test.md +64 -0
  35. package/dist/templates/sdlc/artifacts/implement.backend.md +96 -0
  36. package/dist/templates/sdlc/artifacts/implement.md +70 -0
  37. package/dist/templates/sdlc/artifacts/implement.web-react.md +109 -0
  38. package/dist/templates/sdlc/artifacts/implement.web.md +99 -0
  39. package/dist/templates/sdlc/artifacts/plan.md +97 -0
  40. package/dist/templates/sdlc/artifacts/prototype.md +141 -0
  41. package/dist/templates/sdlc/artifacts/test-cases.md +47 -0
  42. package/dist/templates/sdlc/artifacts/test-plan.md +100 -0
  43. package/dist/templates/sdlc/artifacts/unit-test.md +32 -0
  44. package/dist/templates/sdlc/profiles/agile-lite.yaml +29 -0
  45. package/dist/templates/sdlc/profiles/hybrid.yaml +43 -0
  46. package/dist/templates/sdlc/profiles/iso-ieee.yaml +67 -0
  47. package/dist/templates/sdlc/profiles/none.yaml +21 -0
  48. package/dist/templates/sdlc/skills/advance-epic.md +77 -0
  49. package/dist/templates/sdlc/skills/analyze-requirements.md +279 -0
  50. package/dist/templates/sdlc/skills/discovery-gate.md +118 -0
  51. package/dist/templates/sdlc/skills/execute-test.md +74 -0
  52. package/dist/templates/sdlc/skills/generate-test-cases.md +77 -0
  53. package/dist/templates/sdlc/skills/implement.md +74 -0
  54. package/dist/templates/sdlc/skills/prd.md +114 -0
  55. package/dist/templates/sdlc/skills/prototype.md +128 -0
  56. package/dist/templates/sdlc/skills/tech-design.md +134 -0
  57. package/dist/templates/sdlc/skills/test-plan.md +115 -0
  58. package/dist/templates/sdlc/skills/test-report.md +38 -0
  59. package/dist/templates/sdlc/skills/unit-test.md +43 -0
  60. package/dist/templates/sdlc/validators/ci.mjs +49 -0
  61. package/dist/templates/sdlc/validators/traceability.mjs +244 -0
  62. package/dist/templates/speckit/agents/analyst.md +42 -0
  63. package/dist/templates/speckit/agents/speckit-developer.md +36 -0
  64. package/dist/templates/speckit/agents/speckit-qa.md +38 -0
  65. package/dist/templates/speckit/agents/speckit-tech-lead.md +40 -0
  66. package/dist/templates/speckit/artifacts/analyze.md +48 -0
  67. package/dist/templates/speckit/artifacts/clarify.md +64 -0
  68. package/dist/templates/speckit/artifacts/plan.md +57 -0
  69. package/dist/templates/speckit/artifacts/specify.md +64 -0
  70. package/dist/templates/speckit/artifacts/tasks.md +33 -0
  71. package/dist/templates/speckit/skills/analyze.md +50 -0
  72. package/dist/templates/speckit/skills/clarify.md +31 -0
  73. package/dist/templates/speckit/skills/plan.md +56 -0
  74. package/dist/templates/speckit/skills/specify.md +52 -0
  75. package/dist/templates/speckit/skills/speckit-implement.md +33 -0
  76. package/dist/templates/speckit/skills/tasks.md +38 -0
  77. package/dist/tools/epic-memory-hook.mjs +78 -0
  78. package/dist/tools/epic-memory.mjs +130 -0
  79. package/dist/tools/md-to-html.mjs +478 -0
  80. package/dist/tools/vendor/marked.esm.mjs +2432 -0
  81. package/dist/vendor/annotron/LICENSE +21 -0
  82. package/dist/vendor/annotron/README.md +213 -0
  83. package/dist/vendor/annotron/bin/annotron +467 -0
  84. package/dist/vendor/annotron/commands/annotron.md +11 -0
  85. package/dist/vendor/annotron/hooks/annotron-hook.sh +38 -0
  86. package/dist/vendor/annotron/hooks/hooks.json +50 -0
  87. package/dist/vendor/annotron/package.json +72 -0
  88. package/dist/vendor/annotron/skills/annotron-review/SKILL.md +86 -0
  89. package/dist/vendor/annotron/src/chrome.html +2029 -0
  90. package/dist/vendor/annotron/src/mdRender.js +208 -0
  91. package/dist/vendor/annotron/src/sdk.js +1042 -0
  92. package/dist/vendor/annotron/src/server.js +780 -0
  93. package/package.json +60 -0
@@ -0,0 +1,29 @@
1
+ # SDLC compliance profile — `agile-lite` (GH-69)
2
+ #
3
+ # Lightweight rigor: user stories + testable acceptance criteria + every AC
4
+ # covered by at least one test case. No full section coverage, no RTM.
5
+ #
6
+ # NOTE: mirrors the embedded manifest in
7
+ # packages/core/src/profiles/StandardProfile.ts — keep the two in sync.
8
+ id: agile-lite
9
+ name: Agile-lite
10
+ description: >-
11
+ Lightweight: user stories + testable acceptance criteria + every AC covered
12
+ by ≥1 test case. No full section coverage.
13
+ anchors:
14
+ plan: User stories / ACs
15
+ traceability:
16
+ enforce: true
17
+ rules:
18
+ - ac-testable # ACs must be testable, not vague prose
19
+ - ac-has-test # every AC covered by ≥1 test case (once test cases exist)
20
+ phases:
21
+ plan:
22
+ persona: po
23
+ skills: [prd]
24
+ implement:
25
+ persona: developer
26
+ skills: [implement, unit-test]
27
+ execute-test:
28
+ persona: qa
29
+ skills: [execute-test, test-report]
@@ -0,0 +1,43 @@
1
+ # SDLC compliance profile — `hybrid` (GH-69, recommended default for new projects)
2
+ #
3
+ # Anchors artifacts to standard names and enforces the full traceability chain
4
+ # (AC → test case → result, RTM references resolve), but keeps presentation
5
+ # lean — no mandatory ISO section coverage.
6
+ #
7
+ # NOTE: mirrors the embedded manifest in
8
+ # packages/core/src/profiles/StandardProfile.ts — keep the two in sync.
9
+ id: hybrid
10
+ name: Hybrid (recommended)
11
+ description: >-
12
+ Anchors artifacts to standard names and enforces the full traceability chain,
13
+ but keeps presentation lean.
14
+ anchors:
15
+ plan: ISO/IEC/IEEE 29148
16
+ design: ISO/IEC/IEEE 1016 / 42010
17
+ test-plan: ISO/IEC/IEEE 29119
18
+ traceability:
19
+ enforce: true
20
+ rules:
21
+ - ac-testable
22
+ - ac-has-test
23
+ - tc-has-result # every test case has a recorded result (once report exists)
24
+ - rtm-no-dangling # RTM references resolve (once traceability.md exists)
25
+ phases:
26
+ plan:
27
+ persona: po
28
+ skills: [prd]
29
+ design:
30
+ persona: tech-lead
31
+ skills: [tech-design]
32
+ test-plan:
33
+ persona: qa
34
+ skills: [test-plan]
35
+ implement:
36
+ persona: developer
37
+ skills: [implement, unit-test]
38
+ generate-test-cases:
39
+ persona: qa
40
+ skills: [generate-test-cases]
41
+ execute-test:
42
+ persona: qa
43
+ skills: [execute-test, test-report]
@@ -0,0 +1,67 @@
1
+ # SDLC compliance profile — `iso-ieee` (GH-69)
2
+ #
3
+ # Full section coverage per ISO/IEC/IEEE 29148 (requirements) / 1016+42010
4
+ # (design) / 29119 (testing), plus a mandatory RTM. For audit / compliance
5
+ # teams that must certify artifacts against a named standard.
6
+ #
7
+ # NOTE: mirrors the embedded manifest in
8
+ # packages/core/src/profiles/StandardProfile.ts — keep the two in sync.
9
+ id: iso-ieee
10
+ name: ISO/IEC/IEEE
11
+ description: >-
12
+ Full section coverage per 29148 / 1016 / 29119 plus a mandatory RTM. For
13
+ audit / compliance teams.
14
+ anchors:
15
+ plan: ISO/IEC/IEEE 29148
16
+ design: ISO/IEC/IEEE 1016 / 42010
17
+ test-plan: ISO/IEC/IEEE 29119
18
+ traceability:
19
+ enforce: true
20
+ rules:
21
+ - ac-testable
22
+ - ac-has-test
23
+ - tc-has-result
24
+ - rtm-no-dangling
25
+ - mandatory-sections # each present artifact carries the profile's required sections
26
+ artifacts:
27
+ PRD:
28
+ mandatory_sections:
29
+ - Problem & Goal
30
+ - User Flow
31
+ - Acceptance Criteria
32
+ - Non-Functional Requirements
33
+ - Dependencies
34
+ id_scheme:
35
+ req: REQ
36
+ ac: AC
37
+ TECH-DESIGN:
38
+ mandatory_sections:
39
+ - Architecture
40
+ - API
41
+ - Data Model
42
+ id_scheme:
43
+ des: DES
44
+ TEST-CASES:
45
+ mandatory_sections:
46
+ - Test Cases
47
+ id_scheme:
48
+ tc: TC
49
+ phases:
50
+ plan:
51
+ persona: po
52
+ skills: [prd]
53
+ design:
54
+ persona: tech-lead
55
+ skills: [tech-design]
56
+ test-plan:
57
+ persona: qa
58
+ skills: [test-plan]
59
+ implement:
60
+ persona: developer
61
+ skills: [implement, unit-test]
62
+ generate-test-cases:
63
+ persona: qa
64
+ skills: [generate-test-cases]
65
+ execute-test:
66
+ persona: qa
67
+ skills: [execute-test, test-report]
@@ -0,0 +1,21 @@
1
+ # SDLC compliance profile — `none` (GH-69)
2
+ #
3
+ # Backward-compatible default. Nothing is enforced and no AIDLC persona/skill
4
+ # opinion is composed. The structural/context layer (epic id + input paths +
5
+ # artifact output path + gate contract) is STILL injected regardless of
6
+ # profile, so artifacts land in docs/epics/<epic>/artifacts/ and the gate works.
7
+ #
8
+ # A workspace with no `standard:` key behaves exactly like this profile.
9
+ #
10
+ # NOTE: the built-in profiles are also embedded in
11
+ # packages/core/src/profiles/StandardProfile.ts — keep the two in sync.
12
+ id: none
13
+ name: None (backward-compatible)
14
+ description: >-
15
+ No opinion enforced and no AIDLC persona/skill composed. The
16
+ structural/context layer is still injected so artifacts land correctly.
17
+ Nothing is validated.
18
+ traceability:
19
+ enforce: false
20
+ rules: []
21
+ phases: {}
@@ -0,0 +1,77 @@
1
+ ---
2
+ name: advance-epic
3
+ description: Full-auto orchestrated run of the SDLC pipeline for an epic. The Orchestrator agent dispatches workers and stops at the human gates for approval. Runs plan → design ∥ test-plan → implement ∥ generate-test-cases → execute-test.
4
+ argument-hint: <{{EPIC_PREFIX}}-XXXX> [--skip-gates]
5
+ ---
6
+
7
+ # Advance Epic $0
8
+
9
+ You are about to run the **full-auto orchestrator** for epic `$0`.
10
+
11
+ ## What this does
12
+
13
+ The Orchestrator agent (loaded from `.claude/agents/orchestrator.md`) runs this loop until it hits a stopping condition:
14
+
15
+ ```
16
+ next_step → dispatch worker → done? ─┬─ gate phase → pause for human approve/reject
17
+ └─ else → advance to next step
18
+ ```
19
+
20
+ Stopping conditions:
21
+ - ✅ `completed` — all phases through execute-test passed
22
+ - 🔔 `paused_at_gate` — waiting for human approve/reject at a human gate
23
+ - ⛔ `halted` — a worker couldn't finish after a retry, human must intervene
24
+
25
+ ## Prerequisites
26
+
27
+ - `docs/epics/$0/epic.json` must exist with required fields (`epic_id`, `project`, `brief`, `affected_modules`).
28
+ - If missing: run `/epic $0` first to scaffold, or call the `init_epic` MCP tool, or edit `epic.json` by hand following `.claude/schemas/epic.schema.md`.
29
+ - The MCP server `sdlc` (or whatever name you bound it to) must be configured in `.claude/settings.json`.
30
+
31
+ ## Steps
32
+
33
+ 1. **Verify epic.json exists.**
34
+ ```
35
+ Read docs/epics/$0/epic.json
36
+ ```
37
+ If not found → tell the user to run `/epic $0` first and STOP.
38
+
39
+ 2. **Check if affected_modules is populated.**
40
+ If the array is empty:
41
+ - Call MCP tool `list_project_modules` (with the workspace path) to see what modules the workspace defines under `docs/core-business/`.
42
+ - Show them to the user with a short blurb for each. If the list is empty, tell the user the orchestrator can still run but workers will only see the epic brief and upstream artifacts — they may want to populate `docs/core-business/` first.
43
+ - Ask the user to edit `epic.json` and list the modules this epic affects (or leave empty intentionally).
44
+ - STOP. Re-running `/advance-epic` after editing will continue.
45
+
46
+ 3. **Dispatch the Orchestrator agent** via the `Task` tool:
47
+ ```
48
+ subagent_type: orchestrator
49
+ prompt:
50
+ Run the full-auto SDLC loop for epic $0.
51
+ Workspace: <absolute path to the user's project root>
52
+ Skip gates: <true if "--skip-gates" present in arguments, else false>
53
+
54
+ Follow the core loop in your persona (.claude/agents/orchestrator.md).
55
+ Use the MCP tools: epic_status, phase_context, start_phase,
56
+ set_phase_status, reject_gate, amend_affected_modules.
57
+ Dispatch workers via the Task tool.
58
+
59
+ Stop when you hit completed, paused_at_gate, or halted. Return a
60
+ one-line summary of the stop reason.
61
+ ```
62
+
63
+ 4. **Relay the orchestrator's summary** back to the user. Do not add commentary.
64
+
65
+ ## If the user is running `/advance-epic` after approving a gate
66
+
67
+ Just re-invoke step 3 — the orchestrator picks up from wherever `next_step` points.
68
+
69
+ ## If the user passes `--skip-gates`
70
+
71
+ Set `skip_gates: true` in the dispatch prompt. The orchestrator will not pause at human gates; it advances every phase straight through to execute-test. Use this for hotfixes, not normal epics.
72
+
73
+ ## Anti-patterns (do not do in this skill)
74
+
75
+ - ❌ Running workers directly here. The whole point of `/advance-epic` is to delegate to the Orchestrator.
76
+ - ❌ Skipping the affected_modules check. Without it, context packaging is empty.
77
+ - ❌ Bypassing the MCP tool set and writing `status.json` files by hand.
@@ -0,0 +1,279 @@
1
+ ---
2
+ name: analyze-requirements
3
+ description: Analyze requirements from a document, file, or URL — break them into detailed tasks and create them on Jira (auto), GitHub Issues, Linear, Redmine, or export locally.
4
+ argument-hint: "<REQ-ID>"
5
+ ---
6
+
7
+ # Analyze Requirements — $0
8
+
9
+ You are a **Senior Business Analyst / Product Analyst** skilled at decomposing product requirements into sprint-sized, well-scoped engineering tasks.
10
+
11
+ ## Step 1 — Load context
12
+
13
+ Read `docs/task-breakdowns/$0/inputs.json`. It contains:
14
+ - `requirements_source` — file path (relative), URL (`http://…`), or `inline:<text>`
15
+ - `task_platform` — `jira` | `github` | `linear` | `redmine` | `local`
16
+ - `parent_task` — Jira epic key, GitHub repo, Linear project, etc. May be empty.
17
+ - `detail_level` — `brief` or `detailed` (default: `detailed`)
18
+ - `project_key` (optional) — Jira project key (e.g. `PROJ`)
19
+ - `custom_instructions` (optional) — extra project-specific guidance for task creation (e.g. sprint assignments, naming conventions, post-creation actions)
20
+ - `extra_projects` (optional) — JSON array of `{type, ref, label}` objects for additional codebases (local paths or GitHub repos) to cross-reference
21
+ - `business_context` (optional) — inline text, URL, or Confluence/Notion page describing the company's domain, product strategy, and business rules
22
+ - `its_context` (optional) — URL or reference to existing ITS issues (Jira project board, GitHub issues, Linear team) to check for duplicates and alignment
23
+
24
+ ## Step 2 — Read requirements
25
+
26
+ - **File path** (no URL prefix): read from disk relative to project root
27
+ - **URL** (`http://` or `https://`): fetch the page content
28
+ - **Inline** (`inline:` prefix): use the text directly after `inline:`
29
+
30
+ **Extra projects** (if `extra_projects` is non-empty): For each entry, briefly survey the project's structure:
31
+ - Type `local`: read `README.md` and top-level directory listing
32
+ - Type `github`: fetch `https://raw.githubusercontent.com/{ref}/HEAD/README.md` (or the repo's default branch)
33
+
34
+ **Business context** (if `business_context` is non-empty): Read or fetch it and extract: product domain, core business rules, naming conventions, architectural constraints. Apply throughout analysis.
35
+
36
+ **ITS context** (if `its_context` is non-empty): Fetch or query the issue tracker and note existing epics, open tickets, and in-progress work. Avoid duplicating existing issues in the task list.
37
+
38
+ ## Step 3 — Analyze and break down tasks
39
+
40
+ Carefully analyze the requirements. For each task determine:
41
+
42
+ | Field | Guidance |
43
+ |---|---|
44
+ | **Task ID** | Sequential `T-01`, `T-02`, … for internal dependency tracking |
45
+ | **Title** | Action-oriented, ≤ 80 chars, starts with a verb |
46
+ | **Type** | `Story` \| `Task` \| `Bug` \| `Spike` \| `Testing` |
47
+ | **Priority** | `High` \| `Medium` \| `Low` |
48
+ | **Description** | What needs to be built and why, from a user/product perspective |
49
+ | **Acceptance Criteria** | Given/When/Then format, 3–7 per task, each independently testable (skip if `brief`) |
50
+ | **Story Points** | Fibonacci (1, 2, 3, 5, 8, 13). Break anything >13 into sub-tasks. (skip if `brief`) |
51
+ | **Labels** | Technical area: `frontend` \| `backend` \| `api` \| `database` \| `infra` \| `devops` \| `testing` \| `ux` \| `docs` |
52
+ | **Depends on** | Task IDs this one requires first (empty if none) |
53
+
54
+ **Cross-codebase impact** (if `extra_projects` is set): For tasks that touch interfaces shared across projects, add an explicit `Depends on` note or a separate integration task.
55
+
56
+ **Business alignment** (if `business_context` is set): Each task's Description must explain how it aligns with the business context — avoid purely technical descriptions with no product rationale.
57
+
58
+ **ITS deduplication** (if `its_context` is set): If a proposed task is essentially the same as an existing ITS issue, replace it with a reference to that issue (e.g. "→ Already tracked as PROJ-42") instead of creating a duplicate.
59
+
60
+ **Custom instructions:** If `custom_instructions` is non-empty, read it carefully before generating any tasks. Apply it throughout — it may specify sprint targets, naming conventions, T-shirt sizing instead of story points, Jira labels to add, or actions to perform after creating each task. Follow the instructions literally.
61
+
62
+ **Type assignment rules:**
63
+ - Use `Testing` for tasks whose primary output is test cases, test scripts, QA verification, regression suites, or acceptance testing
64
+ - Use `Story` for user-facing feature work
65
+ - Use `Task` for technical/infrastructure work with no direct user story
66
+ - Use `Bug` for fixing known defects
67
+ - Use `Spike` for research/prototyping with a time-box
68
+
69
+ **Scope rules:**
70
+ - Keep tasks sprint-sized: 3–13 story points each
71
+ - Every happy path needs a corresponding error/edge-case task or explicit AC
72
+ - Do not duplicate — if a task already exists in the parent epic, note it and skip
73
+
74
+ ## Step 4 — Write local files (always first)
75
+
76
+ Write these before any platform API calls.
77
+
78
+ ### `docs/task-breakdowns/$0/requirements.md`
79
+
80
+ Save the **full original requirements content** here — whatever was fetched or provided in Step 2. If the source was a URL, include the URL and the fetched text. If inline, include the text as-is. This file is the source of truth so the breakdown can be reviewed and re-run without the original URL being reachable.
81
+
82
+ ```markdown
83
+ # Requirements — $0
84
+
85
+ **Source**: {requirements_source}
86
+ **Fetched at**: {ISO timestamp}
87
+
88
+ ---
89
+
90
+ {full requirements content as fetched/provided}
91
+ ```
92
+
93
+ ### `docs/task-breakdowns/$0/tasks.md`
94
+
95
+ ```markdown
96
+ # Task Breakdown — $0
97
+
98
+ **Source**: {requirements_source}
99
+ **Target**: {task_platform}{parent note}
100
+ **Detail**: {detail_level}
101
+
102
+ ## Summary
103
+
104
+ {2-3 sentences: what the requirements cover, total scope, any assumptions or ambiguities}
105
+
106
+ **Total tasks**: N | **Total story points**: SP
107
+
108
+ ---
109
+
110
+ ## Group: {Feature Area or Component}
111
+
112
+ ### T-01: {Title}
113
+ - **Type**: Story | **Priority**: High | **Points**: 5 | **Labels**: backend, api
114
+ - **Depends on**: —
115
+
116
+ **Description**: {description — this text goes verbatim into the platform task description}
117
+
118
+ **Acceptance Criteria**:
119
+ - [ ] Given … When … Then …
120
+ - [ ] Given … When … Then …
121
+
122
+ ---
123
+ {repeat for each task}
124
+ ```
125
+
126
+ ### `docs/task-breakdowns/$0/tasks.json`
127
+
128
+ ```json
129
+ [
130
+ {
131
+ "id": "T-01",
132
+ "title": "…",
133
+ "type": "Story",
134
+ "priority": "High",
135
+ "points": 5,
136
+ "labels": ["backend", "api"],
137
+ "description": "…",
138
+ "acceptance_criteria": ["Given … When … Then …"],
139
+ "depends_on": []
140
+ }
141
+ ]
142
+ ```
143
+
144
+ ## Step 5 — Handle empty `parent_task`
145
+
146
+ If `parent_task` is empty or blank:
147
+ 1. Confirm the local files are written (Step 4 complete).
148
+ 2. Print the full task list clearly in the conversation.
149
+ 3. Ask the user:
150
+
151
+ ```
152
+ 📋 Task breakdown complete — $0
153
+
154
+ I generated N tasks (SP story points total). Where would you like to create them?
155
+
156
+ Options:
157
+ 1. Jira — provide an epic key (e.g. PROJ-100)
158
+ 2. GitHub Issues — provide owner/repo (e.g. acme/myapp)
159
+ 3. Linear — provide a project name or URL
160
+ 4. Redmine — I'll generate a CSV for import
161
+ 5. Local only — keep the tasks.md / tasks.json files as-is
162
+
163
+ Reply with the number and your reference (e.g. "1 PROJ-100"), or "5" to keep locally.
164
+ ```
165
+
166
+ Once the user replies, proceed with the corresponding platform section below.
167
+
168
+ ---
169
+
170
+ ## Step 6 — Create tasks on platform
171
+
172
+ ### Jira (`task_platform = "jira"`)
173
+
174
+ **Step A — Add analysis as an epic comment**
175
+
176
+ Use `addCommentToJiraIssue` on `parent_task` with the following body:
177
+
178
+ ```
179
+ ## Requirement Analysis — $0
180
+
181
+ {full content of tasks.md summary section}
182
+
183
+ **Generated tasks** (N total, SP story points):
184
+ {list each task: "- T-01 [Story, High, 5pts]: Title"}
185
+
186
+ Analysis file: docs/task-breakdowns/$0/tasks.md
187
+ ```
188
+
189
+ **Step B — Create child issues**
190
+
191
+ For each task in order:
192
+ 1. Call `createJiraIssue` with:
193
+ - `projectKey`: from `project_key` or derived from `parent_task` (e.g. `PROJ` from `PROJ-100`)
194
+ - `issueType`: map `Story→Story`, `Task→Task`, `Bug→Bug`, `Spike→Task`, `Testing→Test` (or `"Testing"` if `Test` is not available)
195
+ - `summary`: task Title (≤ 255 chars)
196
+ - `description`: full task Description + Acceptance Criteria formatted as plain text or ADF
197
+ - `priority`: task Priority
198
+ 2. After creating each issue, call `createIssueLink` to link it as a child of `parent_task`:
199
+ - Link type: `"is child of"` or `"Epic Link"` (whichever is available)
200
+ 3. After all issues are created, output a summary:
201
+
202
+ ```
203
+ ✅ Created N Jira issues under {parent_task}:
204
+ - PROJ-101 [Story]: Title
205
+ - PROJ-102 [Test]: Title
206
+ …
207
+ ```
208
+
209
+ If Atlassian MCP tools are not available: write `docs/task-breakdowns/$0/tasks-jira-import.csv` with columns:
210
+ `Summary,Issue Type,Priority,Description,Story Points,Epic Link`
211
+
212
+ Inform the user about the CSV and skip the comment step.
213
+
214
+ ---
215
+
216
+ ### GitHub Issues (`task_platform = "github"`)
217
+
218
+ Parse `parent_task`: `owner/repo` or `owner/repo#N` (milestone number).
219
+
220
+ For each task:
221
+ 1. Create a GitHub issue: `title` = task Title, `body` = Description + ACs in Markdown, `labels` = task Labels
222
+ 2. If a milestone number was given, assign it
223
+ 3. Report all created issue URLs
224
+
225
+ If unavailable: write `docs/task-breakdowns/$0/tasks-github.md` with copy-paste issue bodies.
226
+
227
+ ---
228
+
229
+ ### Linear (`task_platform = "linear"`)
230
+
231
+ Use Linear MCP tools if connected. Create issues under the project/cycle in `parent_task`, setting priority and estimate (story points).
232
+
233
+ If unavailable: write `docs/task-breakdowns/$0/tasks-linear.json` in Linear import format.
234
+
235
+ ---
236
+
237
+ ### Redmine (`task_platform = "redmine"`)
238
+
239
+ Write `docs/task-breakdowns/$0/tasks-redmine.csv`:
240
+
241
+ ```
242
+ Subject,Tracker,Priority,Description,Parent issue #,Estimated hours
243
+ {title},{Story→Feature/Task,Testing→Test,Bug→Bug},{priority},{description},{parent_task},{points * 2}
244
+ ```
245
+
246
+ Inform the user to import via Redmine → Project → Issues → Import.
247
+
248
+ ---
249
+
250
+ ### Local (`task_platform = "local"`)
251
+
252
+ Only the `tasks.md` and `tasks.json` from Step 4. No API calls needed.
253
+
254
+ ---
255
+
256
+ ## Step 7 — Final summary
257
+
258
+ ```
259
+ ✅ Requirement Analysis Complete — $0
260
+
261
+ Source: {requirements_source}
262
+ Platform: {task_platform} / {parent_task or "local"}
263
+ Tasks: N ({SP} story points)
264
+
265
+ {list of created issue keys/URLs — or "Local files only"}
266
+
267
+ Files:
268
+ docs/task-breakdowns/$0/tasks.md
269
+ docs/task-breakdowns/$0/tasks.json
270
+ ```
271
+
272
+ ## Rules
273
+
274
+ - **Always write local files (Step 4) before any API calls.** The user always has a local copy.
275
+ - **Never fabricate issue keys or URLs.** Only report IDs returned by actual tool calls.
276
+ - **If the MCP tool is unavailable**, fall back to the CSV/markdown export and say so clearly.
277
+ - **Task description → platform description.** The Description field in each task goes directly into the platform issue's description — write it with that in mind (clear, complete, no references to "the requirement doc").
278
+ - **Ambiguity stops creation.** If requirements are ambiguous enough to affect task scope, list the ambiguities and ask for clarification before creating platform issues.
279
+ - **`brief` mode:** skip Acceptance Criteria and Story Points; all other fields remain.
@@ -0,0 +1,118 @@
1
+ ---
2
+ name: discovery-gate
3
+ description: Human-in-the-loop discovery gate — when a phase accumulates open questions before it can produce a good artifact, turn them into a point-and-click questionnaire (DISCOVERY.md), open it in annotron, let the human answer/annotate, then resume the phase from the confirmed choices. Invoke via /discovery-gate <epic>. This is a gate any phase runs up front, NOT a separate phase.
4
+ argument-hint: "<{{EPIC_PREFIX}}-XXXX>"
5
+ ---
6
+
7
+ # /discovery-gate — confirm open questions before the phase commits
8
+
9
+ The mirror image of `/annotate-artifact`. That skill reviews a *finished* artifact; this one
10
+ runs at the **start** of a phase, when the agent has **open questions** it would otherwise ask
11
+ one-at-a-time in chat or silently guess. Instead of inline questions, compose a questionnaire,
12
+ let the human answer it point-and-click in annotron, and resume the phase from confirmed
13
+ choices.
14
+
15
+ **Discovery is not a separate phase.** It is a gate the calling phase runs up front (most often
16
+ **Plan**, also **Design**). There is no `discovery` slash command in the pipeline, no
17
+ `discovery` node, and `DISCOVERY.md` is a **working doc, never a `produces:` / `depends_on`
18
+ artifact**. The durable output is a `## Discovery decisions` (Plan) / confirmed choices section
19
+ written into the calling phase's real artifact (`PRD.md`, `TECH-DESIGN.md`, …).
20
+
21
+ ## When to invoke (the gate rule)
22
+
23
+ Run this gate **instead of asking inline** when either is true:
24
+ - there are **≥ 3 open questions** before you can write a good artifact, **or**
25
+ - there is **any single high-impact question** — scope, architecture, or acceptance criteria.
26
+
27
+ A small / clear epic that has no such questions **skips the gate entirely** — write the artifact
28
+ directly, no annotron round. The agent can't truly self-trigger mid-thought; this is a
29
+ documented rule the phase skill follows, not automatic behavior.
30
+
31
+ ## Tools
32
+
33
+ Both ship with the AIDLC extension under `~/.claude/tools/` — no `python`, no `pip`, just
34
+ `node` (the same tools `/annotate-artifact` uses):
35
+ - Renderer: `R = node "$HOME/.claude/tools/md-to-html.mjs"`
36
+ - annotron: `A = node "$HOME/.claude/tools/annotron/bin/annotron"`
37
+
38
+ Paths (relative to the open project): `ARTIFACTS = docs/epics/<epic>/artifacts`,
39
+ `MD = $ARTIFACTS/DISCOVERY.md`, `HTML = $ARTIFACTS/DISCOVERY.html`.
40
+
41
+ **MD-canonical rule (same as `/annotate-artifact`):** Markdown is the source; the `.html` is a
42
+ throwaway render. Annotation feedback arrives as selectors/text on the rendered HTML, but you
43
+ **always apply edits to `$MD`**, then re-render. Never edit the `.html`. Do NOT use annotron's
44
+ bundled `/annotron` command — its step 3 edits the HTML, the wrong layer here.
45
+
46
+ ## Loop
47
+
48
+ 1. **Compose the questionnaire.** Write `$MD` — a `# Discovery — <epic>` doc where each open
49
+ question is its own `## Q<n>: <question>` section containing:
50
+ - a checkbox list of concrete options (`- [ ] Option A`, `- [ ] Option B`, …);
51
+ - an `- [ ] Other / notes:` line with a blank for freeform input;
52
+ - a `- [x] Decide for me` **default** the agent pre-ticks — so a human who just clicks
53
+ Finalize still resolves every question (you pick a sensible default and say so).
54
+
55
+ Keep questions decision-shaped and mutually exclusive where possible. Group by topic
56
+ (scope, users, data, density, edge cases, approach, boundaries). One question per behavior.
57
+
58
+ 2. **Render.** `$R --all "$ARTIFACTS"` (`--all` so cross-links between sibling artifacts
59
+ resolve `.md`→`.html`).
60
+
61
+ 3. **Open.** `$A "$HTML"` — starts the background server (if needed), registers the file, opens
62
+ the editor in the browser. Print the editor URL. Tell the user: turn on **Annotate**
63
+ (press `A`), tick the options they want / add notes on the "Other" lines, then **Send
64
+ feedback** — or just type a message. They can also edit checkboxes and Finalize; the
65
+ pre-ticked "Decide for me" defaults stand for anything they leave untouched.
66
+
67
+ 4. **Wait for feedback.** `$A poll "$HTML"` — blocks until the user sends. Output JSON:
68
+ - `items[]` — each `{ kind: element|text, selector, text, note }` (which option / note they
69
+ ticked or wrote);
70
+ - `message` — freeform message;
71
+ - `finalized: true` — the user clicked **Finalize** → go to step 6.
72
+ If it returns empty / times out with nothing, run it again.
73
+
74
+ **End signal (robust):** if `finalized` is true, OR the `message` is essentially just
75
+ "done" / "xong" / "finalize" / "close" / "stop" (with no `items`), the user is finished →
76
+ go to step 6. Tell the user up front they can end either way — clicking Finalize, or typing
77
+ "done" and Send.
78
+
79
+ 5. **Apply answers to `$MD` (never the `.html`, and ONLY this `.md`).** The poll feedback includes:
80
+ - **Text annotations** — user selected text to comment on
81
+ - **Form-control changes** — checkboxes, radios, selects, text inputs auto-captured when user interacts
82
+ - **Freeform message** — any message the user typed
83
+
84
+ For each form-control item, update the corresponding control in DISCOVERY.md:
85
+ - **Checkbox**: tick `[x]` if value is true, clear `[ ]` if false
86
+ - **Radio/Select**: record the selected value
87
+ - **Text input**: record the input text
88
+
89
+ For text annotations, find the matching question and record the user's note. Then re-render and re-arm:
90
+ - `$R --all "$ARTIFACTS"` — re-render; annotron live-reloads the browser.
91
+ - `$A poll "$HTML" --reply "<short summary of what you captured>"` — posts your reply and
92
+ re-arms the poll. Loop back to step 4.
93
+ **Scope:** during the loop edit ONLY `$MD`. Do not create/edit other files yet — the
94
+ resolved choices land in the calling phase's artifact in step 6.
95
+
96
+ 6. **Finalize — write `## Decisions` and hand back (do NOT re-arm).** When the end signal fires:
97
+ - Append a `## Decisions` section to `$MD` summarizing each resolved question → chosen answer
98
+ (one line each, including any "Decide for me" defaults that stood). This is the compact
99
+ hand-off the calling phase reads.
100
+ - **Do not call `poll` again** — `poll --reply` re-arms and would hang.
101
+ - Optionally `$A stop` to shut the annotron server.
102
+ - Return control to the calling phase with the resolved choices. The phase then writes them
103
+ into its **real artifact** — Plan → a `## Discovery decisions` section at the top of
104
+ `PRD.md`; Design → the confirmed approach/boundaries into `TECH-DESIGN.md` — and proceeds.
105
+
106
+ ## Guardrails
107
+
108
+ - **`DISCOVERY.md` is a working doc, not a pipeline artifact.** Never add it to any step's
109
+ `produces:` / `depends_on`. The durable record is the calling phase's artifact section.
110
+ - **Never edit `$HTML`.** Edits go in `$MD`; the render is derived.
111
+ - **Only touch `$MD` during the loop.** The resolved decisions are written into the phase
112
+ artifact by the calling phase after this gate returns.
113
+ - **Never edit while a poll is in flight** — wait for the feedback JSON first.
114
+ - **Skippable.** If the gate rule doesn't fire (< 3 questions, none high-impact), don't compose
115
+ a questionnaire — write the artifact directly.
116
+ - One questionnaire per gate. Re-invoke to open a fresh round.
117
+
118
+ <!-- AIDLC annotation tool — reinstalled by AIDLC; hand edits are overwritten -->