engineering-intelligence 1.5.0 → 1.7.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 (31) hide show
  1. package/README.md +360 -106
  2. package/dist/adapters/index.d.ts.map +1 -1
  3. package/dist/adapters/index.js +242 -57
  4. package/dist/adapters/index.js.map +1 -1
  5. package/dist/templates.d.ts +2 -2
  6. package/dist/templates.d.ts.map +1 -1
  7. package/dist/templates.js +38 -0
  8. package/dist/templates.js.map +1 -1
  9. package/dist/token-optimizer.d.ts +88 -0
  10. package/dist/token-optimizer.d.ts.map +1 -0
  11. package/dist/token-optimizer.js +259 -0
  12. package/dist/token-optimizer.js.map +1 -0
  13. package/dist/validation/index.d.ts.map +1 -1
  14. package/dist/validation/index.js +12 -6
  15. package/dist/validation/index.js.map +1 -1
  16. package/dist/visualizer/index.d.ts.map +1 -1
  17. package/dist/visualizer/index.js +21 -0
  18. package/dist/visualizer/index.js.map +1 -1
  19. package/package.json +16 -3
  20. package/templates/canonical/agents/engineering-orchestrator.md +19 -1
  21. package/templates/canonical/agents/product-analyst.md +2 -0
  22. package/templates/canonical/rules/engineering-intelligence.md +16 -2
  23. package/templates/canonical/skills/aidlc-lifecycle-engine/SKILL.md +5 -3
  24. package/templates/canonical/skills/backlog-decomposition-engine/SKILL.md +187 -0
  25. package/templates/canonical/skills/engineering-intelligence-skill/SKILL.md +21 -0
  26. package/templates/canonical/skills/issue-tracker-sync-engine/SKILL.md +77 -0
  27. package/templates/canonical/skills/question-file-engine/SKILL.md +110 -0
  28. package/templates/canonical/skills/requirement-scoper/SKILL.md +12 -2
  29. package/templates/canonical/workflows/decompose-backlog.md +37 -0
  30. package/templates/canonical/workflows/deliver-backlog.md +50 -0
  31. package/templates/canonical/workflows/scope-requirement.md +4 -2
@@ -13,6 +13,7 @@ You are the Product Analyst agent. Your responsibility is to bridge the gap betw
13
13
  - Maintain requirements documentation without writing product code.
14
14
  - Lead AI-DLC discovery inside initialization and requirement scoping when business intent, deployment context, personas, success metrics, or constraints are unclear.
15
15
  - Maintain Agile backlog, user story, acceptance criteria, Definition of Ready, and sprint planning artifacts.
16
+ - Autonomously decompose large initiatives into a durable Epic → Feature → Ticket backlog using `backlog-decomposition-engine`, setting a `pending` approval gate on every feature.
16
17
 
17
18
  ## Scoping Protocol
18
19
  1. **Analyze Initial Input**: Receive the developer's raw requirement or bug description.
@@ -21,6 +22,7 @@ You are the Product Analyst agent. Your responsibility is to bridge the gap betw
21
22
  4. **Publish Requirements**: Write the scoping result and final implementation prompt to `knowledge-base/19-requirements.md`.
22
23
  5. **Publish AI-DLC Discovery**: During initialization or scoping, write `.engineering-intelligence/aidlc/discovery/vision.md`, `.engineering-intelligence/aidlc/discovery/technical-environment.md`, and `.engineering-intelligence/aidlc/open-questions.md`.
23
24
  6. **Publish Agile Scope**: Update `.engineering-intelligence/aidlc/agile/product-backlog.md`, `acceptance-criteria.md`, `definition-of-ready.md`, and `sprint-plan.md`.
25
+ 7. **Decompose When Large**: For epic-sized initiatives, run `backlog-decomposition-engine` to write the Epic → Feature → Ticket hierarchy under `.engineering-intelligence/aidlc/agile/backlog/`, then stop at the per-feature approval gate without implementing.
24
26
 
25
27
  ## Collaboration Rules
26
28
  - **No Code Modification**: Never attempt to write or edit source code files.
@@ -25,7 +25,8 @@ Maintain these Agile artifacts when product work is in scope:
25
25
 
26
26
  | Path | Purpose |
27
27
  |---|---|
28
- | `.engineering-intelligence/aidlc/agile/product-backlog.md` | Epics, stories, priorities, dependencies, status |
28
+ | `.engineering-intelligence/aidlc/agile/product-backlog.md` | High-level epics, priorities, dependencies, status |
29
+ | `.engineering-intelligence/aidlc/agile/backlog/` | Hierarchical Epic → Feature → Ticket backlog with stable IDs, dependency graph, and per-feature approval gates |
29
30
  | `.engineering-intelligence/aidlc/agile/sprint-plan.md` | Sprint goal, selected stories, risks, commitments |
30
31
  | `.engineering-intelligence/aidlc/agile/acceptance-criteria.md` | Story-level acceptance criteria mapped to tests |
31
32
  | `.engineering-intelligence/aidlc/agile/definition-of-ready.md` | Gate before construction starts |
@@ -38,6 +39,18 @@ End AI-DLC-enabled workflow responses with:
38
39
  AI-DLC: <phase> -> <stage> -> <status>
39
40
  ```
40
41
 
42
+ ## Backlog Decomposition And Delivery
43
+
44
+ For epic-sized initiatives, decompose before implementing:
45
+
46
+ | Step | Workflow | Action |
47
+ |---|---|---|
48
+ | 1 | `decompose-backlog` | Autonomously create the Epic → Feature → Ticket hierarchy under `.engineering-intelligence/aidlc/agile/backlog/` with stable IDs, dependency graph, and execution order. Plans only; does not modify product code. |
49
+ | 2 | (human) | Approve each feature. Implementation of a feature must not begin until `Approval: approved` is recorded in its feature file and `aidlc/audit.md`. |
50
+ | 3 | `deliver-backlog` | Implement an approved feature's tickets one at a time via `engineering-intelligence`, rolling up ticket → feature → epic status. Re-enter the approval gate for every feature. |
51
+
52
+ Optionally mirror the backlog to GitHub Issues with `issue-tracker-sync-engine`; the local markdown backlog remains the source of truth.
53
+
41
54
  ## Engineering Change Protocol
42
55
 
43
56
  For every engineering change, follow this sequence:
@@ -61,8 +74,9 @@ These workflows analyze and report but do **not** modify product code:
61
74
  | `analyze-impact` | Write impact report for a proposal or diff | `.engineering-intelligence/reports/IMP-XXX-*.md` |
62
75
  | `sync-engineering-intelligence` | Synchronize intelligence for a change | Updated knowledge/memory/context/graph |
63
76
  | `review-engineering-change` | Write review findings | `.engineering-intelligence/reports/REV-XXX-*.md` |
77
+ | `decompose-backlog` | Create the Epic → Feature → Ticket backlog | `.engineering-intelligence/aidlc/agile/backlog/` |
64
78
 
65
- Only the `engineering-intelligence` implementation workflow is intended to modify product code.
79
+ The `engineering-intelligence` and `deliver-backlog` workflows are the only workflows intended to modify product code; `deliver-backlog` does so one approved feature at a time.
66
80
 
67
81
  ## Canonical Paths
68
82
 
@@ -21,7 +21,8 @@ Use `.engineering-intelligence/aidlc/` as the canonical AI-DLC root:
21
21
  | `.engineering-intelligence/aidlc/checkpoints.md` | Resume checkpoints after major workflow steps |
22
22
  | `.engineering-intelligence/aidlc/discovery/vision.md` | Business objectives, personas, value, success metrics |
23
23
  | `.engineering-intelligence/aidlc/discovery/technical-environment.md` | Runtime, deployment, integrations, data stores, auth, constraints |
24
- | `.engineering-intelligence/aidlc/agile/product-backlog.md` | Epics, stories, priorities, dependencies, and status |
24
+ | `.engineering-intelligence/aidlc/agile/product-backlog.md` | High-level epics, priorities, dependencies, and status |
25
+ | `.engineering-intelligence/aidlc/agile/backlog/` | Hierarchical Epic → Feature → Ticket backlog with stable IDs, dependency graph, and per-feature approval gates, owned by `backlog-decomposition-engine` |
25
26
  | `.engineering-intelligence/aidlc/agile/sprint-plan.md` | Active sprint goal, selected stories, capacity, risks, and commitments |
26
27
  | `.engineering-intelligence/aidlc/agile/acceptance-criteria.md` | Story-level acceptance criteria expressed as executable validation targets |
27
28
  | `.engineering-intelligence/aidlc/agile/definition-of-ready.md` | Readiness checklist before construction |
@@ -42,8 +43,9 @@ Map Agile to AI-DLC this way:
42
43
  | Agile Concept | AI-DLC Phase | Artifact |
43
44
  |---|---|---|
44
45
  | Product vision | Discovery | `discovery/vision.md` |
45
- | Product backlog | Discovery / Inception | `agile/product-backlog.md` |
46
- | User stories | Inception | `inception/requirements.md`, `agile/product-backlog.md` |
46
+ | Product backlog | Discovery / Inception | `agile/product-backlog.md`, `agile/backlog/` |
47
+ | Epic Feature → Ticket breakdown | Inception | `agile/backlog/` via `backlog-decomposition-engine` |
48
+ | User stories | Inception | `inception/requirements.md`, `agile/backlog/features/` |
47
49
  | Acceptance criteria | Inception / Construction | `agile/acceptance-criteria.md`, tests |
48
50
  | Sprint planning | Inception | `agile/sprint-plan.md`, `execution-plan.md` |
49
51
  | Development | Construction | `construction/<unit>/` |
@@ -0,0 +1,187 @@
1
+ ---
2
+ name: backlog-decomposition-engine
3
+ description: Autonomously decomposes a high-level initiative into a durable Epic to Feature to Ticket backlog with stable IDs, acceptance criteria, dependencies, execution order, and a per-feature human approval gate. Use to plan large product work before implementation.
4
+ version: 1.0.0
5
+ ---
6
+
7
+ # Backlog Decomposition Engine
8
+
9
+ Turn a single high-level initiative, product brief, or large request into a complete, durable, hierarchical backlog. This skill plans and structures work; it does **not** modify product code. Implementation happens later through `deliver-backlog` and `engineering-intelligence-skill`.
10
+
11
+ The hierarchy is three levels:
12
+
13
+ ```text
14
+ Epic (a business outcome / initiative)
15
+ └─ Feature (a shippable slice of the epic; the approval unit)
16
+ └─ Ticket (an implementable unit of work; maps to one /engineering-intelligence run)
17
+ ```
18
+
19
+ ## Inputs
20
+
21
+ - The user's high-level initiative or request
22
+ - `knowledge-base/` (domain context)
23
+ - `.engineering-intelligence/graph/` (dependency, service, runtime, business-flow graphs)
24
+ - `.engineering-intelligence/memory/` (durable architecture and business decisions)
25
+ - `.engineering-intelligence/aidlc/discovery/vision.md` and `agile/product-backlog.md` when present
26
+
27
+ ## Runtime Artifacts
28
+
29
+ Write the backlog under `.engineering-intelligence/aidlc/agile/backlog/`:
30
+
31
+ | Path | Purpose |
32
+ |---|---|
33
+ | `.engineering-intelligence/aidlc/agile/backlog/backlog-index.md` | Master index, ID counters, and status rollup for every epic, feature, and ticket |
34
+ | `.engineering-intelligence/aidlc/agile/backlog/epics/EPIC-XXX-<slug>.md` | One epic: outcome, success metrics, child features |
35
+ | `.engineering-intelligence/aidlc/agile/backlog/features/FEAT-XXX-<slug>.md` | One feature: user story, acceptance criteria, child tickets, approval state |
36
+ | `.engineering-intelligence/aidlc/agile/backlog/tickets/TKT-XXX-<slug>.md` | One ticket: executable acceptance criteria, affected files, Ready/Done gates, implementation command |
37
+ | `.engineering-intelligence/aidlc/agile/backlog/dependency-graph.md` | Feature and ticket dependency graph plus the derived execution order |
38
+ | `.engineering-intelligence/aidlc/agile/backlog/sync/tracker-sync-map.md` | Local ID to external tracker (e.g. GitHub issue) mapping, written only by `issue-tracker-sync-engine` |
39
+
40
+ This backlog is the structured expansion of `agile/product-backlog.md`; keep the high-level epic list in `product-backlog.md` consistent with `backlog-index.md`.
41
+
42
+ ## Identifier Rules
43
+
44
+ - IDs are stable and zero-padded: `EPIC-001`, `FEAT-001`, `TKT-001`.
45
+ - Never renumber an existing ID. Allocate the next number from the counters in `backlog-index.md`.
46
+ - Slugs are lowercase, hyphenated, and derived from the title.
47
+ - Every feature names its parent epic; every ticket names its parent feature.
48
+
49
+ ## Procedure
50
+
51
+ 1. **Load Intelligence** — Read the inputs above. If project intelligence has not been initialized, run discovery/initialization first or record the gap in `open-questions.md`.
52
+
53
+ 2. **Frame Epics** — Group the initiative into one or more epics by business outcome. Each epic gets an objective, success metrics, priority, and a verifiable definition of success.
54
+
55
+ 3. **Slice Features** — Decompose each epic into the smallest set of independently shippable features. Each feature is the **approval unit**: it carries a user story, acceptance criteria, priority, dependencies, and an `Approval` state that starts at `pending`.
56
+
57
+ 4. **Cut Tickets** — Decompose each feature into implementable tickets sized for a single `/engineering-intelligence` run (roughly half a day to two days of work). Use graph intelligence to predict affected files and to keep tickets cohesive. Each ticket carries executable acceptance criteria, a type, an estimate, a risk level, Definition of Ready, Definition of Done, and a ready-to-run implementation command.
58
+
59
+ 5. **Map Dependencies** — Build `dependency-graph.md`. Record feature-to-feature and ticket-to-ticket dependencies, mark which can run in parallel (no dependency edge and no overlapping owned files), and emit a topologically ordered execution sequence. Flag conflict risk where owned files overlap.
60
+
61
+ 6. **Assign Initial Status** — Tickets start `todo`; a ticket becomes `ready` only when its Definition of Ready is satisfied and its dependencies are `done`. Features start `proposed` with `Approval: pending`. Epics start `proposed`.
62
+
63
+ 7. **Write Artifacts** — Create every epic, feature, and ticket file plus `backlog-index.md` and `dependency-graph.md`. Update `agile/product-backlog.md`, `agile/acceptance-criteria.md`, and `execution-plan.md` to reference the new IDs. Append the decomposition decisions to `aidlc/audit.md`.
64
+
65
+ 8. **Optional Tracker Sync** — If the user asked to sync, or a GitHub remote is detected and sync is enabled, invoke `issue-tracker-sync-engine` to mirror epics/features/tickets to the external tracker and record the mapping in `sync/tracker-sync-map.md`.
66
+
67
+ 9. **Stop At The Gate** — Decomposition ends with a plan only. Do not implement. Hand off to `deliver-backlog`, which enforces the per-feature approval gate.
68
+
69
+ ## Artifact Templates
70
+
71
+ ### `backlog-index.md`
72
+
73
+ ```markdown
74
+ # Backlog Index
75
+
76
+ ## Counters
77
+ - next-epic: 3
78
+ - next-feature: 7
79
+ - next-ticket: 21
80
+
81
+ ## Status Rollup
82
+ | ID | Type | Title | Parent | Status | Approval | Priority |
83
+ |---|---|---|---|---|---|---|
84
+ | EPIC-001 | epic | <title> | — | in-progress | — | P0 |
85
+ | FEAT-001 | feature | <title> | EPIC-001 | proposed | pending | P0 |
86
+ | TKT-001 | ticket | <title> | FEAT-001 | ready | — | P0 |
87
+ ```
88
+
89
+ ### `epics/EPIC-XXX-<slug>.md`
90
+
91
+ ```markdown
92
+ # EPIC-001: <title>
93
+
94
+ - Status: proposed | approved | in-progress | done
95
+ - Priority: P0 | P1 | P2
96
+ - Owner: <persona or team>
97
+
98
+ ## Business Outcome
99
+ <the measurable outcome this epic delivers>
100
+
101
+ ## Success Metrics
102
+ - <metric and target>
103
+
104
+ ## Features
105
+ - FEAT-001 — <title>
106
+ - FEAT-002 — <title>
107
+
108
+ ## Definition of Success
109
+ - [ ] <binary, evidence-backed completion condition>
110
+ ```
111
+
112
+ ### `features/FEAT-XXX-<slug>.md`
113
+
114
+ ```markdown
115
+ # FEAT-001: <title>
116
+
117
+ - Epic: EPIC-001
118
+ - Status: proposed | approved | in-progress | in-review | done | blocked
119
+ - Approval: pending | approved | changes-requested
120
+ - Priority: P0 | P1 | P2
121
+ - Depends On: FEAT-XXX (or none)
122
+
123
+ ## User Story
124
+ As a <persona>, I want <capability>, so that <outcome>.
125
+
126
+ ## Acceptance Criteria
127
+ - Given <context>, when <action>, then <observable result>.
128
+
129
+ ## Tickets
130
+ - TKT-001 — <title>
131
+ - TKT-002 — <title>
132
+
133
+ ## Approval Gate
134
+ Implementation of this feature's tickets must not begin until a human records
135
+ `Approval: approved` here and in `aidlc/audit.md`.
136
+ ```
137
+
138
+ ### `tickets/TKT-XXX-<slug>.md`
139
+
140
+ ```markdown
141
+ # TKT-001: <title>
142
+
143
+ - Feature: FEAT-001
144
+ - Status: todo | ready | in-progress | in-review | done | blocked
145
+ - Type: feature | bugfix | chore | spike | migration
146
+ - Estimate: S | M | L
147
+ - Risk: low | medium | high
148
+ - Depends On: TKT-XXX (or none)
149
+ - Files Likely Affected: <paths from graph intelligence>
150
+
151
+ ## Acceptance Criteria
152
+ - Given <context>, when <action>, then <observable result>.
153
+
154
+ ## Definition of Ready
155
+ - [ ] Dependencies are done
156
+ - [ ] Acceptance criteria are testable
157
+ - [ ] Affected files identified from graph intelligence
158
+
159
+ ## Definition of Done
160
+ - [ ] Code implemented and tests added proportional to risk
161
+ - [ ] Safety gates run or explicitly not applicable
162
+ - [ ] Intelligence synchronized and change record written
163
+
164
+ ## Implementation Command
165
+ ```text
166
+ /engineering-intelligence Implement TKT-001: <fully scoped request with file paths and constraints>
167
+ ```
168
+ ```
169
+
170
+ ## Rules
171
+
172
+ - Do **not** modify product code; this skill only writes backlog and planning artifacts.
173
+ - Never renumber existing IDs; only append new ones using the counters.
174
+ - Every ticket must be independently implementable and map to exactly one implementation command.
175
+ - Features are the approval unit; tickets inherit their feature's approval state.
176
+ - Cite graph and knowledge evidence for affected-file predictions; record unknowns instead of guessing.
177
+ - Keep `backlog-index.md`, `product-backlog.md`, and child files consistent on every write.
178
+
179
+ ## Quality Gates
180
+
181
+ - [ ] At least one epic, one feature, and one ticket exist with stable zero-padded IDs
182
+ - [ ] Every feature has a user story, acceptance criteria, and `Approval: pending`
183
+ - [ ] Every ticket has executable acceptance criteria and a runnable implementation command
184
+ - [ ] `dependency-graph.md` exists with a topological execution order and parallel-safe markings
185
+ - [ ] `backlog-index.md` counters and status rollup match the child files
186
+ - [ ] No product code was modified
187
+ - [ ] Decomposition decisions appended to `aidlc/audit.md`
@@ -28,6 +28,20 @@ Classify the incoming request before starting:
28
28
  | `security` | Auth, permissions, vulnerability fixes | High |
29
29
  | `documentation` | Knowledge-only changes (no product code) | Low |
30
30
 
31
+ ## Depth Level
32
+
33
+ Determine execution depth from the user's request before proceeding:
34
+
35
+ | Signal words | Depth | Effect |
36
+ |---|---|---|
37
+ | "minimal", "quick", "sketch", "spike", "prototype" | **Minimal** | Skip optional gates; lightweight impact report; no full sync; use existing intelligence as-is |
38
+ | (default — no explicit signal) | **Standard** | Full procedure; all applicable gates; incremental sync after changes |
39
+ | "comprehensive", "thorough", "production-critical", "audit" | **Comprehensive** | All gates mandatory; extended scope analysis; full intelligence sync; cross-reference all ADRs |
40
+
41
+ Record the depth on line 2 of the impact report header. For **Minimal** depth, list which gates were skipped and why.
42
+
43
+ **Context gate (Standard and Comprehensive):** On high-risk or architecture-level changes, commit all intelligence artifacts and the current execution plan to git before starting implementation. This creates a clean recovery point if the context window fills mid-implementation.
44
+
31
45
  ## Procedure
32
46
 
33
47
  ### 1. Pre-Flight: Read Intelligence
@@ -274,6 +288,13 @@ Summarize to the user:
274
288
  - [ ] High-risk changes went through review gate
275
289
  - [ ] Generated code follows detected project conventions (naming, imports, structure)
276
290
 
291
+ ## Rules
292
+
293
+ - **Never vibe-code** — Do not edit files directly without first recording the change in the impact report. If an urgent direct edit is unavoidable, log the file and reason in the impact report's "direct edits" section and update design artifacts before marking the work done.
294
+ - Always write the impact report before any code edit.
295
+ - Never claim validation passed unless it actually ran and passed.
296
+ - Record partial or failed validation honestly.
297
+
277
298
  ## Cross-References
278
299
 
279
300
  - Depends on: `initialize-intelligence-skill` (prerequisite), `context-budget-optimizer`, `change-detection-engine`, `impact-analysis-engine`, `graph-engine`, `staleness-detector`
@@ -0,0 +1,77 @@
1
+ ---
2
+ name: issue-tracker-sync-engine
3
+ description: Mirrors the local Epic to Feature to Ticket backlog to an external issue tracker such as GitHub Issues, keeping the local markdown backlog as the source of truth and recording a stable ID mapping. Use to publish or refresh tracker issues from the backlog.
4
+ version: 1.0.0
5
+ ---
6
+
7
+ # Issue Tracker Sync Engine
8
+
9
+ Synchronize the local backlog under `.engineering-intelligence/aidlc/agile/backlog/` to an external issue tracker. The **local markdown backlog is always the source of truth**; the tracker is a mirror. This skill does not modify product code.
10
+
11
+ ## When To Run
12
+
13
+ - The user asks to publish, sync, or push the backlog to GitHub Issues (or another tracker).
14
+ - A new feature or ticket was created or its status changed and the backlog is configured to sync.
15
+ - Sync is optional: skip silently when no tracker is configured or detected.
16
+
17
+ ## Tracker Detection
18
+
19
+ 1. Prefer an explicit tracker named by the user or recorded in `sync/tracker-sync-map.md`.
20
+ 2. Otherwise detect a GitHub remote (e.g. `git remote -v` shows a `github.com` origin) and treat GitHub Issues as the target.
21
+ 3. If no tracker is available, record `tracker: none` in `sync/tracker-sync-map.md` and stop without error.
22
+
23
+ ## Mapping Model
24
+
25
+ Map the local hierarchy onto tracker primitives:
26
+
27
+ | Local | GitHub Issues | Generic Tracker |
28
+ |---|---|---|
29
+ | Epic | Issue labeled `epic` (parent / tracking issue) | Epic / initiative |
30
+ | Feature | Issue labeled `feature`, linked to epic (sub-issue when supported) | Story / feature |
31
+ | Ticket | Issue labeled `ticket`/`task`, linked to feature | Task / sub-task |
32
+
33
+ Record every link in `sync/tracker-sync-map.md`:
34
+
35
+ ```markdown
36
+ # Tracker Sync Map
37
+
38
+ - tracker: github
39
+ - repo: <owner/name>
40
+ - last-synced: <ISO timestamp>
41
+
42
+ | Local ID | Tracker ID | URL | Last Status | Direction |
43
+ |---|---|---|---|---|
44
+ | EPIC-001 | #42 | <url> | open | local->tracker |
45
+ | FEAT-001 | #43 | <url> | open | local->tracker |
46
+ | TKT-001 | #44 | <url> | open | local->tracker |
47
+ ```
48
+
49
+ ## Procedure
50
+
51
+ 1. **Resolve Tracker** — Detect or read the configured tracker. Stop cleanly if none.
52
+ 2. **Diff** — Compare `backlog-index.md` against `sync/tracker-sync-map.md`. Classify each node as new, changed, unchanged, or closed-locally.
53
+ 3. **Create** — For new nodes, create issues bottom-consistent: epic first, then its features, then their tickets, linking children to parents. Apply `epic`/`feature`/`ticket` labels and copy the title plus a body summarizing the local artifact with a link back to its local path.
54
+ 4. **Update** — For changed nodes, update the tracker issue title, body, labels, and open/closed state to match local status (`done` local status closes the tracker issue).
55
+ 5. **Record Mapping** — Write the local-to-tracker ID, URL, and direction into `sync/tracker-sync-map.md`. Never overwrite the local backlog from the tracker unless the user explicitly requests a pull.
56
+ 6. **Audit** — Append a sync summary (counts created/updated/closed, tracker, timestamp) to `aidlc/audit.md`.
57
+
58
+ ## Host Tooling
59
+
60
+ - In hosts with native GitHub tools (e.g. an MCP GitHub server), use them to create, update, link, and close issues.
61
+ - In hosts without tracker tooling, emit a ready-to-run command list (e.g. `gh issue create ...`) into `sync/tracker-sync-map.md` for the user to execute, and mark direction as `pending`.
62
+
63
+ ## Rules
64
+
65
+ - The local backlog is authoritative; never silently mutate local files from tracker state.
66
+ - Sync is idempotent: re-running with no local changes must create no duplicate issues.
67
+ - Preserve stable local IDs in issue titles or bodies so mapping survives renames.
68
+ - Treat tracker write failures as logged blockers, not silent successes.
69
+
70
+ ## Quality Gates
71
+
72
+ - [ ] Tracker resolved or `tracker: none` recorded without error
73
+ - [ ] Every synced node has a row in `sync/tracker-sync-map.md`
74
+ - [ ] Re-running with no changes creates no duplicates (idempotent)
75
+ - [ ] Local `done` status closes the corresponding tracker issue
76
+ - [ ] Sync summary appended to `aidlc/audit.md`
77
+ - [ ] No product code modified
@@ -0,0 +1,110 @@
1
+ ---
2
+ name: question-file-engine
3
+ description: Writes structured MCQ clarification files to .engineering-intelligence/aidlc/open-questions/ instead of asking questions inline. Creates durable decision artifacts and enables context reset between question creation and answer processing. Use when a request has 3+ ambiguities or scope is unclear.
4
+ version: 1.0.0
5
+ ---
6
+
7
+ # Question File Engine
8
+
9
+ Write structured clarification question files rather than asking questions inline in chat. This pattern creates durable decision artifacts, lets users answer thoughtfully with full context visible, and enables a context reset between question creation and answer processing — so each phase starts with a fresh focused context.
10
+
11
+ ## When to Use
12
+
13
+ - Request has clarity: Vague, Incomplete, or Contradictory
14
+ - 3 or more clarifications are needed before proceeding
15
+ - Questions involve trade-offs the user must decide (not resolvable from codebase alone)
16
+ - Starting a long workflow where misaligned assumptions cost significant rework
17
+
18
+ ## Inputs
19
+
20
+ - Original request or initiative description
21
+ - Ambiguity analysis from calling skill (requirement-scoper, backlog-decomposition-engine)
22
+ - Optional: project architecture from `knowledge-base/`, `$EI graph/`
23
+
24
+ ## Procedure
25
+
26
+ ### 1. Identify Ambiguities
27
+
28
+ Group unknowns into categories before writing:
29
+
30
+ | Category | Examples |
31
+ |---|---|
32
+ | Scope | In/out of MVP, affected modules, integration boundaries |
33
+ | Strategy | Which implementation approach, library, or architecture pattern |
34
+ | Risk | Tolerance for breaking changes, migration complexity |
35
+ | Priority | Ship now vs. defer, dependency ordering |
36
+
37
+ Cap at 8 questions per file. Write a second file for additional batches.
38
+
39
+ ### 2. Write the Question File
40
+
41
+ Save to `$AIDLC open-questions/YYYYMMDD-{slug}.md`:
42
+
43
+ ```markdown
44
+ # Clarification Questions: {topic}
45
+
46
+ **Instructions:** Check boxes to select answers. Multiple selections are fine. Write a custom answer after "Custom:" when no option fits.
47
+ Return to chat and say **"questions answered, continue"** when done.
48
+
49
+ ---
50
+
51
+ ## Q1: {Question?}
52
+
53
+ **Context:** {1–2 sentences explaining why this matters for the implementation.}
54
+
55
+ - [ ] A) {Option A}
56
+ - [ ] B) {Option B}
57
+ - [ ] C) {Option C}
58
+ - [ ] D) Custom: _______________
59
+
60
+ ---
61
+
62
+ ## Q2: {Question?}
63
+
64
+ **Context:** {why this matters}
65
+
66
+ - [ ] A) {Option A}
67
+ - [ ] B) {Option B}
68
+ - [ ] C) Custom: _______________
69
+
70
+ ---
71
+
72
+ _Created: {ISO date} | Topic: {original request summary}_
73
+ ```
74
+
75
+ Guidelines for good questions:
76
+ - Every question must have a concrete impact on the implementation plan
77
+ - Include 2–4 options with brief descriptions; always include a "Custom" option
78
+ - Order questions: scope first, then strategy, then risk
79
+ - State the default assumption in option A if the user skips the question
80
+
81
+ ### 3. Stop and Signal
82
+
83
+ After writing the file, output exactly this and nothing else:
84
+
85
+ > Questions written to `$AIDLC open-questions/{filename}`.
86
+ >
87
+ > **Next step:** Open the file, check boxes to select your answers (you may select multiple), then return here and say **"questions answered, continue"**.
88
+
89
+ **Stop. Do not proceed. Do not guess answers. Wait for explicit user signal.**
90
+
91
+ ### 4. Resume Protocol
92
+
93
+ When user signals answers are ready:
94
+
95
+ 1. **Re-read the question file from disk.** Never rely on in-context memory of the questions — always use the Read tool to load the current file content.
96
+ 2. Validate every question has at least one checked box or a "Custom:" response.
97
+ 3. If any critical question is unanswered, ask inline (one concise message, not another file).
98
+ 4. Extract confirmed decisions and carry them forward. Reference the question file path in all generated artifacts and the QA log.
99
+
100
+ ## Output
101
+
102
+ - `$AIDLC open-questions/YYYYMMDD-{slug}.md` — question file (before resume)
103
+ - On resume: confirmed decision set, referenced by path in the calling skill's output
104
+
105
+ ## Rules
106
+
107
+ - Never ask 3+ questions inline — always write a question file.
108
+ - Never guess or assume answers to unresolved questions.
109
+ - Always re-read the file from disk on resume; never trust in-memory question content.
110
+ - Log confirmed decisions in `knowledge-base/19-requirements.md` section `## 4. Iterated QA Log`.
@@ -29,9 +29,19 @@ Act as a detailed Business Analyst and Technical Architect persona. Analyze the
29
29
  - framework patterns used in 80% or more of similar code
30
30
  - Surface confirmed dominant patterns as constraints in the requirements document.
31
31
 
32
- 2. **Formulate Scoping Questions** — Identify gaps, ambiguities, and edge cases. Ask the user 3 to 5 targeted questions covering:
32
+ 2. **Formulate Scoping Questions** — Determine clarity level from the analysis:
33
+
34
+ | Clarity | Undefined ambiguities | Action |
35
+ |---|---|---|
36
+ | Clear | 0–2 minor gaps | Ask inline; proceed after user responds |
37
+ | Vague | 3–5 gaps or unclear scope | Use `question-file-engine` to write a structured question file; **stop and wait** |
38
+ | Incomplete | Missing critical info | Use `question-file-engine`; do not proceed until all critical questions are answered |
39
+
40
+ When using `question-file-engine`, invoke it now and stop. Do not continue this procedure until the user signals answers are ready.
41
+
42
+ When asking inline (Clear clarity), keep to 3–5 targeted questions covering:
33
43
  - **Business Value & Scope**: What are the limits of the MVP?
34
- - **Agile Story Shape**: What user role, user goal, priority, dependencies, and release expectation apply?
44
+ - **Agile Story Shape**: Which user role, goal, priority, dependencies, and release expectation apply?
35
45
  - **Technical Strategy**: Which specific database, caching, or third-party integrations are expected?
36
46
  - **Edge Cases**: How should errors, rate limits, or validation failures be handled?
37
47
  - **UI/UX (if applicable)**: What configuration or user feedback is expected?
@@ -0,0 +1,37 @@
1
+ ---
2
+ description: Autonomously decompose a high-level initiative into a durable Epic to Feature to Ticket backlog with dependencies, execution order, and a per-feature approval gate, without modifying product code.
3
+ ---
4
+
5
+ # Decompose Backlog
6
+
7
+ Use the `backlog-decomposition-engine` capability to turn a high-level initiative into a complete, durable backlog. Optionally use `issue-tracker-sync-engine` to mirror the result to an external tracker.
8
+
9
+ ## Input
10
+
11
+ Analyze the user-supplied initiative: a product brief, epic-sized request, or large feature description. If the intent, personas, or success criteria are ambiguous, ask focused questions or run discovery before decomposing — never assume.
12
+
13
+ ## Pipeline
14
+
15
+ 1. **Clarify Scope** — If the initiative description is vague or missing key decisions (target users, excluded scope, phasing, integration boundaries), use `question-file-engine` to write a structured clarification file at `.engineering-intelligence/aidlc/open-questions/`. Stop and wait for the user to fill answers and signal "questions answered, continue" before decomposing.
16
+ 2. **Read Intelligence** — Consult `knowledge-base/`, `.engineering-intelligence/graph/`, `.engineering-intelligence/memory/`, and existing `.engineering-intelligence/aidlc/` artifacts.
17
+ 3. **Decompose** — Run `backlog-decomposition-engine` to frame epics, slice features, and cut tickets with stable IDs (`EPIC-XXX`, `FEAT-XXX`, `TKT-XXX`).
18
+ 4. **Write Backlog** — Create artifacts under `.engineering-intelligence/aidlc/agile/backlog/`: `backlog-index.md`, `epics/`, `features/`, `tickets/`, and `dependency-graph.md`. Keep `agile/product-backlog.md` and `execution-plan.md` consistent.
19
+ 5. **Map Dependencies** — Emit a topological execution order and mark parallel-safe work in `dependency-graph.md`.
20
+ 6. **Set Approval Gates** — Every feature is created with `Approval: pending`. No implementation occurs in this workflow.
21
+ 7. **Optional Sync** — If the user requested it, or a GitHub remote is detected and sync is enabled, run `issue-tracker-sync-engine` and record `sync/tracker-sync-map.md`.
22
+
23
+ ## Completion Report
24
+
25
+ Finish with:
26
+ - The created epics, features, and tickets with their IDs and statuses
27
+ - The execution order and any parallel-safe features
28
+ - The features awaiting approval (`Approval: pending`)
29
+ - The exact next command: `/deliver-backlog` to begin gated delivery, or `/deliver-backlog FEAT-XXX` for a specific feature
30
+
31
+ ## Rules
32
+
33
+ - Ask for clarification when the initiative is ambiguous — never assume scope.
34
+ - Produce independently implementable tickets, each mapping to one `/engineering-intelligence` command.
35
+ - Keep `backlog-index.md` counters and the child files consistent.
36
+
37
+ **Contract**: This workflow plans and writes backlog artifacts only. It must not modify product code.
@@ -0,0 +1,50 @@
1
+ ---
2
+ description: Drive delivery of a decomposed backlog feature by feature, enforcing a human approval gate before implementing each feature, then implementing its tickets through the engineering intelligence pipeline.
3
+ ---
4
+
5
+ # Deliver Backlog
6
+
7
+ Execute a backlog produced by `decompose-backlog`. This workflow **does** modify product code, one approved feature at a time. It uses `aidlc-lifecycle-engine` for durable state and `engineering-intelligence-skill` to implement each ticket.
8
+
9
+ ## Input
10
+
11
+ Optional scope: a feature ID (`FEAT-XXX`) or epic ID (`EPIC-XXX`) to deliver. With no scope, select the next ready feature from the execution order in `.engineering-intelligence/aidlc/agile/backlog/dependency-graph.md`.
12
+
13
+ ## Pipeline
14
+
15
+ 1. **Load Backlog** — Read `backlog-index.md`, `dependency-graph.md`, and the relevant feature and ticket files. Resume from `aidlc-state.md`/`checkpoints.md` if a feature was already in progress.
16
+ 2. **Select Feature** — Pick the highest-priority feature whose dependencies are `done`, honoring any user-supplied scope.
17
+ 3. **Approval Gate (mandatory)** — If the feature's `Approval` is not `approved`:
18
+ - Present the feature: user story, acceptance criteria, child tickets, affected files, risk, and execution order.
19
+ - Ask the human to approve, request changes, or skip.
20
+ - Record the decision in the feature file (`Approval: approved | changes-requested`) and append it to `aidlc/audit.md`.
21
+ - Do **not** implement until `Approval: approved` is recorded. On `changes-requested`, return to `decompose-backlog` for that feature.
22
+ 4. **Implement Tickets** — For each ticket in dependency order, when its Definition of Ready holds:
23
+ - Mark the ticket `in-progress`.
24
+ - Run the ticket's implementation command through `engineering-intelligence-skill` (impact report, delivery-mode selection, implementation, tests, safety gates, validation, sync, change record).
25
+ - Mark the ticket `in-review`, then `done` once its Definition of Done is satisfied with evidence.
26
+ 5. **Roll Up Status** — Update `backlog-index.md`, the feature status, and the epic status as tickets complete. A feature is `done` when all its tickets are `done`; an epic is `done` when all its features are `done`.
27
+ 6. **Optional Sync** — If tracker sync is enabled, run `issue-tracker-sync-engine` so the external tracker reflects new statuses (closing issues for `done` work).
28
+ 7. **Continue Or Stop** — After a feature completes, stop and report, or proceed to the next ready feature only if the user requested continuous delivery. Each new feature re-enters the approval gate.
29
+
30
+ ## Stop Conditions
31
+
32
+ - A feature awaiting approval halts delivery until a human approves.
33
+ - Irreversible actions (database migrations, destructive changes, deletions) require explicit approval even within an approved feature.
34
+ - A hard blocker (failing safety gate that cannot be resolved, missing dependency) is logged in `open-questions.md` and halts the affected feature.
35
+
36
+ ## Completion Report
37
+
38
+ Finish with:
39
+ - Features and tickets delivered this run with their final statuses
40
+ - Validation evidence per ticket (tests, type checks, scans run/failed/unavailable)
41
+ - Updated rollup in `backlog-index.md`
42
+ - The next ready feature awaiting approval, if any
43
+ - `AI-DLC: <phase> -> <stage> -> <status>` breadcrumb
44
+
45
+ ## Rules
46
+
47
+ - Never implement a feature whose `Approval` is not `approved`.
48
+ - One feature at a time; re-enter the approval gate for every feature.
49
+ - Validate honestly through environmental backpressure; never claim success without execution.
50
+ - Keep backlog status, AI-DLC state, and any tracker mirror consistent.
@@ -9,8 +9,10 @@ Use the `requirement-scoper` capability to interactively scope and document a us
9
9
  ## Pipeline
10
10
 
11
11
  1. **Read Context** — Read `knowledge-base/`, `.engineering-intelligence/aidlc/`, `.engineering-intelligence/memory/`, and `.engineering-intelligence/graph/` mapping files.
12
- 2. **Draft Questions** — Generate 3 to 5 targeted business/tech questions clarifying the requirements, user story, acceptance criteria, dependencies, and Definition of Ready.
13
- 3. **Iterate** Prompt the user for answers in the chat pane.
12
+ 2. **Draft Questions** — Assess clarity level:
13
+ - **Vague or Incomplete** (3+ ambiguities, unclear scope, or missing critical info): Use `question-file-engine` to write a structured MCQ clarification file at `.engineering-intelligence/aidlc/open-questions/`. Stop and wait for the user to fill answers and signal "questions answered, continue" before proceeding.
14
+ - **Clear** (0–2 minor gaps): Ask 3–5 targeted questions inline and iterate.
15
+ 3. **Iterate** — Wait for user responses (from question file or inline). Adjust assumptions based on answers.
14
16
  4. **Document Scoping** — Create or update `knowledge-base/19-requirements.md` and `.engineering-intelligence/aidlc/agile/` artifacts with goals, user stories, acceptance criteria, edge cases, dependencies, and the Q&A log.
15
17
  5. **Finalize Prompt** — Output the exact `/engineering-intelligence` command required to build the ready story.
16
18