@akjamie/agentic-sdlc 1.5.0 → 1.6.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 (39) hide show
  1. package/README.md +42 -18
  2. package/assets/config/config.yaml +1 -1
  3. package/assets/policy/policy.yaml +6 -0
  4. package/assets/schema/schema.yaml +168 -168
  5. package/assets/skills/asdlc-approve/SKILL.md +1 -1
  6. package/assets/skills/asdlc-archive/SKILL.md +17 -13
  7. package/assets/skills/asdlc-doctor/SKILL.md +8 -8
  8. package/assets/skills/asdlc-impl-review/SKILL.md +2 -14
  9. package/assets/skills/asdlc-init/SKILL.md +11 -18
  10. package/assets/skills/asdlc-pr/SKILL.md +13 -8
  11. package/assets/skills/asdlc-review/SKILL.md +7 -7
  12. package/assets/skills/asdlc-spec-review/SKILL.md +2 -14
  13. package/package.json +2 -1
  14. package/src/assess/ai_judge.js +36 -3
  15. package/src/assess/rules/builtin.js +2 -2
  16. package/src/assess/vectors/v2_security.js +24 -1
  17. package/src/assess/vectors/v3_topology.js +29 -11
  18. package/src/commands/apply.js +1 -1
  19. package/src/commands/approve.js +2 -3
  20. package/src/commands/archive.js +116 -64
  21. package/src/commands/doctor.js +22 -19
  22. package/src/commands/init.js +24 -50
  23. package/src/commands/pr.js +106 -25
  24. package/src/commands/test.js +90 -21
  25. package/src/commands/update.js +1 -11
  26. package/src/commands/verify.js +94 -14
  27. package/src/lib/agents.js +2 -2
  28. package/src/lib/cliutil.js +57 -7
  29. package/src/lib/git.js +10 -4
  30. package/src/lib/graphify.js +22 -11
  31. package/src/lib/level.js +63 -9
  32. package/src/lib/openspec.js +61 -31
  33. package/src/lib/paths.js +0 -2
  34. package/src/lib/policy.js +4 -0
  35. package/src/lib/schema.js +32 -11
  36. package/src/lib/tdd.js +29 -9
  37. package/assets/ci/asdlc-ai-review.yml +0 -65
  38. package/assets/githooks/post-merge +0 -22
  39. package/assets/githooks/pre-push +0 -17
package/README.md CHANGED
@@ -3,7 +3,7 @@
3
3
  [![npm version](https://img.shields.io/npm/v/@akjamie/agentic-sdlc?color=6366f1&label=npm)](https://www.npmjs.com/package/@akjamie/agentic-sdlc)
4
4
  [![license: Apache-2.0](https://img.shields.io/badge/license-Apache--2.0-10b981.svg)](LICENSE)
5
5
  [![Node.js](https://img.shields.io/badge/node-%3E%3D20.19.0-38bdf8.svg)](https://nodejs.org/)
6
- [![tests](https://img.shields.io/badge/tests-128%20passing-10b981.svg)](#development--verification)
6
+ [![tests](https://img.shields.io/badge/tests-168%20passing-10b981.svg)](#development--verification)
7
7
  [![architecture](https://img.shields.io/badge/governance-L0--L3%20Adaptive%20Dual--Track-f59e0b.svg)](#adaptive-risk-tiered-governance-l0l3)
8
8
 
9
9
  > **The Intelligent Governance Engine for Autonomous AI Coding.**
@@ -15,31 +15,36 @@
15
15
 
16
16
  ---
17
17
 
18
- ## ⚡ The AI Software Engineering Bottleneck Shift
18
+ ## ⚡ The Practical Bottlenecks of Autonomous AI Coding
19
19
 
20
- AI coding agents (Claude Code, Cursor, OpenCode, Codex) write hundreds of lines of code in seconds. However, as code generation cost approaches zero, the engineering bottleneck shifts to **three predictable modes of failure in real-world codebases**:
20
+ AI coding agents (Claude Code, Cursor, OpenCode, Codex) write hundreds of lines of code in seconds. However, as code generation velocity increases, enterprise engineering teams encounter **three practical bottlenecks in real-world delivery**:
21
21
 
22
22
  ```
23
- HOW AUTONOMOUS AI AGENTS DRIFT IN PRODUCTION
23
+ THE PRACTICAL BOTTLENECKS OF AUTONOMOUS CODING
24
24
  ┌───────────────────────────┐ ┌───────────────────────────┐ ┌───────────────────────────┐
25
- │ 1. Guessing on Ambiguity │ │ 2. Reward-Hacking Exams │ │ 3. Review Fatigue Chaos │
25
+ │ 1. Review Bandwidth │ │ 2. Verification Bias │ │ 3. Boundary & Assumptions │
26
26
  ├───────────────────────────┤ ├───────────────────────────┤ ├───────────────────────────┤
27
- │ Agents guess architecture │ │ When tests or edge cases │ │ Tech Leads are flooded │
28
- │ and schema assumptions │ │ fail, agents weaken test │ │ with 500-line AI diffs │
29
- │ silently across 15 files │ │ assertions or modify specs│ │ lacking verified intent, │
30
- │ instead of clarifying. │ │ to force green builds. │ │ tests, or rationale. │
27
+ │ Generation throughput has │ │ When the same agent writes│ │ Natural language leaves │
28
+ │ outpaced human review │ │ both code and tests, tests│ │ scope implicit. Agents may│
29
+ │ capacity, risking review │ │ risk validating own bias │ │ overstep boundaries and │
30
+ │ depth dilution. │ │ rather than actual specs. │ │ cause cascading breaks. │
31
31
  └───────────────────────────┘ └───────────────────────────┘ └───────────────────────────┘
32
32
  ```
33
33
 
34
+ 1. **Review Bandwidth Asymmetry**: Code generation throughput has scaled by an order of magnitude, but human cognitive capacity for deep architectural comprehension remains constant. When teams are inundated with frequent multi-file PRs, line-by-line review becomes unsustainable, inadvertently diluting review depth on critical paths.
35
+ 2. **Shared-Context Verification Bias (The "Player == Referee" Dilemma)**: When an agent implements code and writes unit tests within the same reasoning context, tests naturally inherit the agent’s internal interpretations. Passing tests confirm that code aligns with the agent’s own understanding, which can mask divergence from actual system contracts.
36
+ 3. **Implicit Assumptions & Boundary Spillover**: Natural language prompts are inherently concise, stating localized intent while leaving architectural boundaries, blast-radius limits, and edge behaviors unspecified. Autonomous agents resolve these ambiguities independently and frequently modify high fan-in shared modules, common middleware, or public contracts to satisfy a localized prompt. Without early alignment on scope and contracts, unverified boundary crossovers trigger unintended cascading regressions across dependent components.
37
+
34
38
  > **Why prompts alone (`AGENTS.md`, `CLAUDE.md`) cannot fix this:**
35
- > Prompts are **suggestions**, not gates. An autonomous agent under token pressure will prioritize getting code written over adherence to instructions. True governance requires **deterministic exit-coded gates and independent verification agents**.
39
+ > Prompts are **guidelines**, not deterministic gates. Under complex task and token constraints, agents prioritize code completion over subtle governance boundaries. Robust governance requires **deterministic exit-coded gates, Git-anchored contracts, and independent verification**.
36
40
 
37
41
  ### The Solution: Adaptive Dual-Track SDLC (`asdlc`)
38
42
 
39
- `agentic-sdlc` bridges this gap with an **Intelligent, Adaptive Governance Plane**:
43
+ `agentic-sdlc` bridges these bottlenecks with a **practical, Git-native governance plane**:
40
44
  - 🚀 **Frictionless Agility for Routine Work (L0 / L1)**: Pure test additions, documentation updates, and bounded local refactors run in a streamlined **Single-PR** mode with automated validation and zero red tape.
41
- - 🛡️ **Ironclad Rigor for High-Impact Changes (L2 / L3)**: Cross-boundary APIs (Spring Boot, FastAPI, Go, NestJS), database schemas, security tokens, and constitutional rules enforce **Dual-PR Spec-First** contracts with human sign-off.
42
- - 🤝 **Humane In-Place Scope Escalation**: If scope unexpectedly expands during implementation, the system **never punishes the engineer** by ripping their Git branch apart. It maintains the single PR in-place, revokes auto-merge, and routes to a Tech Lead for human review.
45
+ - 🛡️ **Structured Rigor for High-Impact Changes (L2 / L3)**: Cross-boundary APIs (Spring Boot, FastAPI, Go, NestJS), database schemas, security tokens, and constitutional rules enforce **Dual-PR Spec-First** contracts with human sign-off on intent.
46
+ - 🔍 **Player ≠ Referee Verification**: Independent Review Agent Sessions (`asdlc-spec-review`, `asdlc-impl-review`) evaluate specifications and implementations against locked contracts in isolated reasoning sessions, eliminating shared-context verification bias.
47
+ - 🤝 **Humane In-Place Scope Escalation**: If scope expands or crosses boundaries during implementation, the system **never punishes the engineer** by tearing branches apart. It preserves the single PR in-place, revokes auto-merge, and routes to a Tech Lead for approval.
43
48
 
44
49
  ---
45
50
 
@@ -116,7 +121,7 @@ Enterprise teams rely on deterministic code, not agent compliance or prompt enth
116
121
  | **4** | **AI Classifier Invariant Defense** | AI semantic classifier output is validated against hard mathematical expectations. | 🚫 **Evasion Shield** — Prompts claiming a `DROP TABLE` is "just a test" are vetoed to L3. |
117
122
  | **5** | **Zero Untested Code (`test-presence`)** | Any change touching production source code (`src/**`, `app/**`) requires test diffs. | 🚫 **Rejection** — Stops AI "code dumps" without corresponding test coverage. |
118
123
  | **6** | **Deterministic AC Assertions (`asdlc test`)** | Parses `- [ ] ACn: (test: <path>)` annotations and runs native test suites. | 🚫 **Fake Claim Gate** — Unimplemented acceptance criteria immediately fail CI. |
119
- | **7** | **Player ≠ Referee Isolation** | CI runs independent verification with a fresh LLM instance outside the author agent context. | 🚫 **Audit Integrity** — Authoring agents can never grade their own exam. |
124
+ | **7** | **Player ≠ Referee Isolation** | Independent review agent sessions (`asdlc-spec-review`, `asdlc-impl-review`) evaluate contracts and diffs in fresh sessions. | 🚫 **Audit Integrity** — Authoring agents can never grade their own exam. |
120
125
  | **8** | **Humane In-Place Scope Escalation** | If an L1 change touches an API during implementation, single PR is preserved with mandatory human sign-off. | **Safe Convergence** — No messy branch rebases; human stays in control. |
121
126
 
122
127
  ---
@@ -150,6 +155,25 @@ Enterprise teams rely on deterministic code, not agent compliance or prompt enth
150
155
 
151
156
  ---
152
157
 
158
+ ## 🏛️ Explicit Architectural Boundaries & Non-Goals
159
+
160
+ To maintain high engineering discipline and avoid platform over-engineering, `agentic-sdlc` establishes three explicit architectural boundaries:
161
+
162
+ 1. **Strict Spec Immutability on L2/L3 (`spec-tamper` — Why We Explicitly Reject `asdlc amend`)**:
163
+ - In autonomous AI coding, allowing an in-flight spec amendment (`asdlc amend`) inside an active implementation loop opens the door to **Agent Reward Hacking**: an agent failing a difficult contract test could quietly modify the specification to match its buggy code rather than fixing the implementation.
164
+ - For routine changes (L0/L1), engineers and agents already iterate freely within Single-PR mode.
165
+ - For high-impact contracts (L2/L3), once a spec is approved and its Git commit hash locked (`specSha`), **the specification is immutable law**. If implementation reveals a genuine architectural flaw or contract gap, the change must be closed and re-scaffolded via `asdlc new`. A bad spec is never mutated in-place.
166
+
167
+ 2. **Single-Repository Sovereign AST & Git Boundary (Why We Do Not Orchestrate Multi-Repo State Machines)**:
168
+ - `1 Repository = 1 AST Knowledge Graph + 1 Git History + 1 Autonomous Verification Boundary`.
169
+ - Cross-repository orchestration across microservices introduces distributed state-machine split-brain risks, partial rollouts, and brittle inter-repo lockups. Cross-service contract alignment belongs in upstream System Design RFCs / Architecture Epics (`proposal.md ## System Design refs`), while each repository sovereignly governs and independently verifies its own contracts, tests, and blast radius.
170
+
171
+ 3. **Session-Isolated Agent Review & Platform-Native RBAC (Player ≠ Referee)**:
172
+ - Review is not a cosmetic echo stub in CI. `asdlc` provides dedicated, independent review skills (`asdlc-spec-review`, `asdlc-impl-review`) designed to run in fresh, isolated agent sessions outside the authoring agent's context.
173
+ - We do not reinvent bespoke user RBAC or token auth engines inside the CLI. Enterprise access control and merge permissions are delegated to platform-native, battle-tested Git forge controls (GitHub/GitLab `CODEOWNERS`, protected branch rules, and signed commits).
174
+
175
+ ---
176
+
153
177
  ## 🚀 Quickstart: 5-Minute Walkthrough
154
178
 
155
179
  > 🧭 **New to Agentic SDLC?**
@@ -282,15 +306,15 @@ flowchart TD
282
306
  ## 🛠️ CLI Reference
283
307
 
284
308
  ```bash
285
- asdlc init [--ci jenkins|github] # Scaffold repository with OpenSpec, Graphify, and skills
309
+ asdlc init # Scaffold repository with OpenSpec, Graphify, and skills
286
310
  asdlc new "<intent>" # Scaffold change with AST explore + grill-me interview
287
311
  asdlc lint <ID> # Validate BDD scenarios, AC rules, and coverage (docs/spec-format.md)
288
- asdlc pr <ID> <target-branch> # Smart PR creator (auto-handles Spec PR vs Impl PR)
312
+ asdlc pr <ID> <target-branch> # Smart PR creator (auto-handles Spec PR vs Impl PR + smart staging)
289
313
  asdlc approve <ID> # Record approvedSha and transition to ready_for_impl
290
314
  asdlc apply <ID> # Guarded implementation launcher (checks approvedSha)
291
315
  asdlc test <ID> [--json] # Execute real test runners mapped to AC annotations
292
316
  asdlc verify <ID> # Audit diff against all 12 quality gates
293
- asdlc archive <ID> # Sync delta to living specs and refresh code graph
317
+ asdlc archive [<ID> | --merged] # Post-merge compaction: sync living specs & refresh code graph
294
318
  asdlc doctor [--fix] # 12-point toolchain & governance health check
295
319
  asdlc status [<ID>] # Change progress orientation or portfolio dashboard
296
320
  asdlc upgrade [--global] # Seamless upgrade of CLI, engine, and schemas
@@ -307,7 +331,7 @@ git clone https://github.com/akjamie/agentic-sdlc.git
307
331
  cd agentic-sdlc
308
332
  npm install
309
333
 
310
- # Run complete test suite (128 tests passing, 100% pass rate)
334
+ # Run complete test suite (168 tests passing, 100% pass rate)
311
335
  npm test
312
336
 
313
337
  # Run end-to-end multi-language simulation tests
@@ -11,7 +11,7 @@ context: |
11
11
  asdlc approve <ID> after the spec PR merges: record the approved SHA
12
12
  asdlc apply <ID> guard, then /opsx-apply
13
13
  asdlc verify <ID> check the implementation
14
- asdlc archive <ID> finish (refresh the graph + AGENTS.md)
14
+ asdlc archive <ID> post-merge compaction (sync living specs; refresh AGENTS.md only on constitutional changes)
15
15
  - The spec PR carries intent: proposal + spec delta + review.md (a change-dir
16
16
  convention). tasks.md is execution state, generated AFTER approval.
17
17
  - A code knowledge graph runs behind the scenes (graphify-out/); `asdlc new`
@@ -39,6 +39,12 @@ rollout_mode: {}
39
39
  # allow: agent may search (default); deny: offline/air-gapped mode, agent skips search silently.
40
40
  web_search: allow
41
41
 
42
+ # Smart staging hygiene for `asdlc pr`: skips untracked secrets, crash dumps, and
43
+ # oversized blobs (> max_file_size_mb) with a warning without halting automation.
44
+ staging:
45
+ max_file_size_mb: 50
46
+ ignore_patterns: []
47
+
42
48
  # Issue tracker integration (optional). Set required: true to enforce a ticket link in verify.
43
49
  # type: jira | github | linear | none
44
50
  issue_tracker:
@@ -1,168 +1,168 @@
1
- name: agentic-repo-change
2
- version: 1
3
- description: Agentic SDLC change flow - intent (proposal/specs/review) then, after approval, tasks
4
- artifacts:
5
- - id: proposal
6
- generates: proposal.md
7
- description: WHY this change is needed
8
- template: proposal.md
9
- instruction: |
10
- Create the proposal establishing WHY this change is needed.
11
-
12
- Sections:
13
- - **Why**: 1-2 sentences on the problem or opportunity, and why now.
14
- - **What Changes**: specific changes; mark breaking changes with **BREAKING**.
15
- - **Capabilities**: which spec deltas will be created/modified. Each needs a
16
- corresponding specs/**/*.md file.
17
- - **Impact**: affected code, APIs, dependencies, systems.
18
- - **Out of Scope**: what this change explicitly does NOT cover.
19
- - **Dependencies & Assumptions**: what this assumes about other systems/teams.
20
- - **System Design refs**: reference any System Design / cross-repo contract
21
- this change touches (e.g. payment-settlement@v2). Leave empty if none.
22
-
23
- Ground yourself in the codebase first: `asdlc new` refreshed the knowledge
24
- graph and wrote explore.md (structured queries against the real code, not
25
- guesses). Read explore.md, then READ the specific files it points to (and
26
- openspec/specs/**) before writing. If you need more detail, query the
27
- graph directly: `graphify query "<q>"` / `graphify explain <node>` /
28
- `graphify path <A> <B>`. The graph is a navigation map, never the truth.
29
-
30
- Keep it 1-2 pages. Focus on WHY; HOW belongs in design.md.
31
- requires: []
32
-
33
- - id: specs
34
- generates: "specs/**/*.md"
35
- description: Approved intent - behavior contract for this repo
36
- template: spec.md
37
- instruction: |
38
- Create the spec delta(s). This is the APPROVED INTENT artifact, not an
39
- implementation plan. Enforced by `asdlc lint`:
40
-
41
- Ground yourself in the codebase first: `asdlc new` refreshed the knowledge
42
- graph and wrote explore.md. Read explore.md, then READ the files it points
43
- to (and openspec/specs/**) before writing. The graph is a map, not the truth.
44
-
45
- - Each requirement: `### Requirement: <name>` using SHALL/MUST.
46
- - Each scenario: `#### Scenario: <name>` with GIVEN / WHEN / THEN (4 '#').
47
- - Each requirement needs an `**Acceptance criteria**` block:
48
- `- [ ] AC1: <concrete, testable assertion - not prose> (test: <path/to/test>)`
49
- - Add a `## Constraints & NFRs` section: performance, security, compliance
50
- as verifiable statements, not adjectives (e.g. "p99 < 200ms for read ops").
51
- - Add a `## Out of Scope` section: what this change explicitly does NOT cover.
52
- - Add a `## Test Strategy` section describing how every AC is verified.
53
- - New capabilities: first section is `## Purpose` (50+ chars).
54
- - Every requirement must reference its Jira story (the change ID is the key).
55
-
56
- Exclude internal class/function names and implementation steps - those
57
- belong in design.md or tasks.md.
58
-
59
- IMPORTANT: once approved (PR merged) this is IMMUTABLE. Never edit it to
60
- record execution state - that is what tasks.md is for.
61
- requires:
62
- - proposal
63
-
64
- - id: review
65
- generates: review.md
66
- description: Independent fresh-context review output (read-only)
67
- template: review.md
68
- instruction: |
69
- You are an INDEPENDENT reviewer with a FRESH CONTEXT, different from the
70
- Draft agent. You MUST NOT modify proposal.md, specs/** or tasks.md. Your
71
- only output is review.md.
72
-
73
- Give a verdict per dimension (PASS / CONCERN / FAIL):
74
- Completeness, Ambiguity, Cross-repo consistency, Contract impact,
75
- Testability, Security.
76
-
77
- Findings must have severity: blocker / major / minor.
78
-
79
- Also produce a requirement -> implementation -> test mapping table
80
- (implementation/test may be TBD pre-code; AC must be listed).
81
-
82
- End with an overall verdict APPROVE / NEEDS_REVISION and the blocking
83
- findings. Do not rubber-stamp.
84
- requires:
85
- - specs
86
-
87
- - id: design
88
- generates: design.md
89
- description: Repo-internal technical design (HOW) - required for UI and external APIs
90
- template: design.md
91
- instruction: |
92
- Required when the change introduces UI/frontend views, 3rd-party API integrations,
93
- architectural patterns, new data models, or security/perf complexity. Mandatory in asdlc lint.
94
-
95
- Sections:
96
- - **Context & Background**: constraints, current architecture.
97
- - **System Architecture**: component interaction, Mermaid sequence/flowcharts.
98
- - **Interface Contracts**: TypeScript interfaces / schemas for requests & responses.
99
- - **External API Integration**: endpoints, auth, rate-limits, client caching & error taxonomy.
100
- - **UI/UX Design & Aesthetics**: tokens, typography, component layout, responsive breakpoints (mobile/tablet/desktop), and states (loading/empty/error).
101
- - **Security & NFRs**: input validation, path traversal defense, resource bounds.
102
- - **Decisions & Migration**: choices made with rationale and deployment plan.
103
-
104
- Do NOT restate requirements. Do NOT make cross-repo design decisions here;
105
- raise a System Design Amendment instead.
106
- requires:
107
- - proposal
108
-
109
- - id: tasks
110
- generates: tasks.md
111
- description: Mutable execution checklist - generated AFTER approval
112
- template: tasks.md
113
- instruction: |
114
- Create the implementation checklist from the APPROVED spec. tasks.md is
115
- MUTABLE EXECUTION STATE and is NOT part of approved intent - never edit
116
- the spec to record progress.
117
-
118
- Format:
119
- - Group related tasks under `## N. <group>` headings
120
- - Follow task-level TDD structure: pair test creation with implementation
121
- (`- [ ] N.M [TEST] ... (AC<n>) verify: <command>`) followed by
122
- (`- [ ] N.M+1 [IMPL] ... (AC<n>) evidence: <pass-evidence>`)
123
- - Every task references the AC it implements and states its verification method
124
- - Include test execution output under completed tasks as immutable evidence
125
- - Order by dependency
126
- requires:
127
- - specs
128
- - review
129
-
130
- apply:
131
- requires: [tasks]
132
- tracks: tasks.md
133
- instruction: |
134
- Work through the pending tasks in tasks.md. For EACH task, follow task-level
135
- TDD (v6 5.2):
136
- 1. write a FAILING test that expresses the task's verification;
137
- 2. implement the minimum to make it pass;
138
- 3. run the tests and PASTE the output under the task before claiming it is done;
139
- 4. before moving on, a fresh-context reviewer checks the task against the
140
- approved spec first, code quality second.
141
- Mark each task complete only after its verification passes and test evidence is recorded.
142
-
143
- NEVER modify the spec (approved intent: proposal.md, specs/**).
144
-
145
- CONVERGE = Report First (v6 6). When reality disagrees with the spec, first
146
- classify the gap and NEVER silently absorb it into code:
147
- A implementation error -> write a reproducing test, append a fix task, stay in this PR
148
- B missing test -> add the test, stay in this PR
149
- C spec gap/conflict -> STOP the affected tasks and report a SPEC_GAP
150
- (needs the spec approver; see asdlc review/lint)
151
- D post-merge defect -> new Jira bug; spec said the right thing -> fast fix,
152
- spec itself wrong -> new change
153
- Cross-repo contract changes are always C: stop and raise a System Design
154
- Amendment - never absorb them here.
155
-
156
- archive:
157
- description: Sync living specs, update README, and conditionally update AGENTS.md
158
- instruction: |
159
- Archive the verified change:
160
- 1. Living Specs (Knowledge Layer):
161
- Merge delta specs into `openspec/specs/` and record the capability in `README.md`.
162
- Do NOT touch `AGENTS.md` for standard business or feature specs (zero prompt pollution).
163
- 2. Constitutional Changes (Governance Layer):
164
- Automatically detected when the change modifies governance policies, SDLC rules,
165
- or workflow contracts (`.sdlc/policy.yaml`, `openspec/config.yaml`, `AGENTS.md`, `governance/**`).
166
- In these cases, `AGENTS.md` is automatically refreshed so all agent IDE sessions
167
- immediately adhere to the updated constitution.
168
-
1
+ name: agentic-repo-change
2
+ version: 1
3
+ description: Agentic SDLC change flow - intent (proposal/specs/review) then, after approval, tasks
4
+ artifacts:
5
+ - id: proposal
6
+ generates: proposal.md
7
+ description: WHY this change is needed
8
+ template: proposal.md
9
+ instruction: |
10
+ Create the proposal establishing WHY this change is needed.
11
+
12
+ Sections:
13
+ - **Why**: 1-2 sentences on the problem or opportunity, and why now.
14
+ - **What Changes**: specific changes; mark breaking changes with **BREAKING**.
15
+ - **Capabilities**: which spec deltas will be created/modified. Each needs a
16
+ corresponding specs/**/*.md file.
17
+ - **Impact**: affected code, APIs, dependencies, systems.
18
+ - **Out of Scope**: what this change explicitly does NOT cover.
19
+ - **Dependencies & Assumptions**: what this assumes about other systems/teams.
20
+ - **System Design refs**: reference any System Design / cross-repo contract
21
+ this change touches (e.g. payment-settlement@v2). Leave empty if none.
22
+
23
+ Ground yourself in the codebase first: `asdlc new` refreshed the knowledge
24
+ graph and wrote explore.md (structured queries against the real code, not
25
+ guesses). Read explore.md, then READ the specific files it points to (and
26
+ openspec/specs/**) before writing. If you need more detail, query the
27
+ graph directly: `graphify query "<q>"` / `graphify explain <node>` /
28
+ `graphify path <A> <B>`. The graph is a navigation map, never the truth.
29
+
30
+ Keep it 1-2 pages. Focus on WHY; HOW belongs in design.md.
31
+ requires: []
32
+
33
+ - id: specs
34
+ generates: "specs/**/*.md"
35
+ description: Approved intent - behavior contract for this repo
36
+ template: spec.md
37
+ instruction: |
38
+ Create the spec delta(s). This is the APPROVED INTENT artifact, not an
39
+ implementation plan. Enforced by `asdlc lint`:
40
+
41
+ Ground yourself in the codebase first: `asdlc new` refreshed the knowledge
42
+ graph and wrote explore.md. Read explore.md, then READ the files it points
43
+ to (and openspec/specs/**) before writing. The graph is a map, not the truth.
44
+
45
+ - Each requirement: `### Requirement: <name>` using SHALL/MUST.
46
+ - Each scenario: `#### Scenario: <name>` with GIVEN / WHEN / THEN (4 '#').
47
+ - Each requirement needs an `**Acceptance criteria**` block:
48
+ `- [ ] AC1: <concrete, testable assertion - not prose> (test: <path/to/test>)`
49
+ - Add a `## Constraints & NFRs` section: performance, security, compliance
50
+ as verifiable statements, not adjectives (e.g. "p99 < 200ms for read ops").
51
+ - Add a `## Out of Scope` section: what this change explicitly does NOT cover.
52
+ - Add a `## Test Strategy` section describing how every AC is verified.
53
+ - New capabilities: first section is `## Purpose` (50+ chars).
54
+ - Every requirement must reference its Jira story (the change ID is the key).
55
+
56
+ Exclude internal class/function names and implementation steps - those
57
+ belong in design.md or tasks.md.
58
+
59
+ IMPORTANT: once approved (PR merged) this is IMMUTABLE. Never edit it to
60
+ record execution state - that is what tasks.md is for.
61
+ requires:
62
+ - proposal
63
+
64
+ - id: review
65
+ generates: review.md
66
+ description: Independent fresh-context review output (read-only)
67
+ template: review.md
68
+ instruction: |
69
+ You are an INDEPENDENT reviewer with a FRESH CONTEXT, different from the
70
+ Draft agent. You MUST NOT modify proposal.md, specs/** or tasks.md. Your
71
+ only output is review.md.
72
+
73
+ Give a verdict per dimension (PASS / CONCERN / FAIL):
74
+ Completeness, Ambiguity, Cross-repo consistency, Contract impact,
75
+ Testability, Security.
76
+
77
+ Findings must have severity: blocker / major / minor.
78
+
79
+ Also produce a requirement -> implementation -> test mapping table
80
+ (implementation/test may be TBD pre-code; AC must be listed).
81
+
82
+ End with an overall verdict APPROVE / NEEDS_REVISION and the blocking
83
+ findings. Do not rubber-stamp.
84
+ requires:
85
+ - specs
86
+
87
+ - id: design
88
+ generates: design.md
89
+ description: Repo-internal technical design (HOW) - required for UI and external APIs
90
+ template: design.md
91
+ instruction: |
92
+ Required when the change introduces UI/frontend views, 3rd-party API integrations,
93
+ architectural patterns, new data models, or security/perf complexity. Mandatory in asdlc lint.
94
+
95
+ Sections:
96
+ - **Context & Background**: constraints, current architecture.
97
+ - **System Architecture**: component interaction, Mermaid sequence/flowcharts.
98
+ - **Interface Contracts**: TypeScript interfaces / schemas for requests & responses.
99
+ - **External API Integration**: endpoints, auth, rate-limits, client caching & error taxonomy.
100
+ - **UI/UX Design & Aesthetics**: tokens, typography, component layout, responsive breakpoints (mobile/tablet/desktop), and states (loading/empty/error).
101
+ - **Security & NFRs**: input validation, path traversal defense, resource bounds.
102
+ - **Decisions & Migration**: choices made with rationale and deployment plan.
103
+
104
+ Do NOT restate requirements. Do NOT make cross-repo design decisions here;
105
+ raise a System Design Amendment instead.
106
+ requires:
107
+ - proposal
108
+
109
+ - id: tasks
110
+ generates: tasks.md
111
+ description: Mutable execution checklist - generated AFTER approval
112
+ template: tasks.md
113
+ instruction: |
114
+ Create the implementation checklist from the APPROVED spec. tasks.md is
115
+ MUTABLE EXECUTION STATE and is NOT part of approved intent - never edit
116
+ the spec to record progress.
117
+
118
+ Format:
119
+ - Group related tasks under `## N. <group>` headings
120
+ - Follow task-level TDD structure: pair test creation with implementation
121
+ (`- [ ] N.M [TEST] ... (AC<n>) verify: <command>`) followed by
122
+ (`- [ ] N.M+1 [IMPL] ... (AC<n>) evidence: <pass-evidence>`)
123
+ - Every task references the AC it implements and states its verification method
124
+ - Include test execution output under completed tasks as immutable evidence
125
+ - Order by dependency
126
+ requires:
127
+ - specs
128
+ - review
129
+
130
+ apply:
131
+ requires: [tasks]
132
+ tracks: tasks.md
133
+ instruction: |
134
+ Work through the pending tasks in tasks.md. For EACH task, follow task-level
135
+ TDD (v6 5.2):
136
+ 1. write a FAILING test that expresses the task's verification;
137
+ 2. implement the minimum to make it pass;
138
+ 3. run the tests and PASTE the output under the task before claiming it is done;
139
+ 4. before moving on, a fresh-context reviewer checks the task against the
140
+ approved spec first, code quality second.
141
+ Mark each task complete only after its verification passes and test evidence is recorded.
142
+
143
+ NEVER modify the spec (approved intent: proposal.md, specs/**).
144
+
145
+ CONVERGE = Report First (v6 6). When reality disagrees with the spec, first
146
+ classify the gap and NEVER silently absorb it into code:
147
+ A implementation error -> write a reproducing test, append a fix task, stay in this PR
148
+ B missing test -> add the test, stay in this PR
149
+ C spec gap/conflict -> STOP the affected tasks and report a SPEC_GAP
150
+ (needs the spec approver; see asdlc review/lint)
151
+ D post-merge defect -> new Jira bug; spec said the right thing -> fast fix,
152
+ spec itself wrong -> new change
153
+ Cross-repo contract changes are always C: stop and raise a System Design
154
+ Amendment - never absorb them here.
155
+
156
+ archive:
157
+ description: Sync living specs into openspec/specs/ and conditionally update AGENTS.md
158
+ instruction: |
159
+ Archive the verified change:
160
+ 1. Living Specs (Knowledge Layer):
161
+ Merge delta specs into `openspec/specs/` and record the capability in `README.md`.
162
+ Do NOT touch `AGENTS.md` for standard business or feature specs (zero merge-conflict hotspot & zero prompt pollution).
163
+ 2. Constitutional Changes (Governance Layer):
164
+ Automatically detected when the change modifies governance policies, SDLC rules,
165
+ or workflow contracts (`.sdlc/policy.yaml`, `openspec/config.yaml`, `AGENTS.md`, `governance/**`).
166
+ In these cases, `AGENTS.md` is automatically refreshed so all agent IDE sessions
167
+ immediately adhere to the updated constitution.
168
+
@@ -52,7 +52,7 @@ From this moment on, **Stage 5 (`asdlc apply`) is unlocked**, and **Stage 6 (`as
52
52
 
53
53
  ### 2. Spec-First Staged PR Flow (Multi-tier Enterprise Pipelines)
54
54
  - Spec is submitted as an isolated Spec-only PR into `staging` or `main`.
55
- - When the Spec PR merges, the `post-merge` hook or CI automatically runs `asdlc approve <ID>`.
55
+ - When the Spec PR merges, the target-branch merge commit SHA is recognized by `asdlc apply` and `asdlc verify`, or stamped via `asdlc approve <ID>`.
56
56
  - The implementation is then performed on an implementation branch branching from the approved merge commit.
57
57
 
58
58
  ### 3. Local / In-Place Fast Loop (Agile Squads)
@@ -5,15 +5,15 @@ description: "Explicitly close and archive a verified change (Stage 7): confirm
5
5
 
6
6
  # /asdlc:archive - Deliberate Human Archive Gate
7
7
 
8
- This skill executes **Stage 7 (Archive)** of the Agentic SDLC. Archiving is an explicit, human-confirmed milestone — never automatically triggered by verify — marking that post-merge testing and human validation are complete.
8
+ This skill executes **Stage 7 (Archive)** of the Agentic SDLC. Archiving is an explicit post-merge milestone — never automatically triggered during active implementation or unmerged PRs — marking that post-merge testing and trunk integration are complete.
9
9
 
10
10
  ---
11
11
 
12
- ## Why Archive is an Explicit Gate
12
+ ## Why Archive is an Explicit Post-Merge Gate
13
13
 
14
- 1. `asdlc verify` proves that code matches the approved spec on CI.
15
- 2. In production engineering, teams often perform staging regression runs, canary validations, or stakeholder demos after merge.
16
- 3. Therefore, **a human makes the call** to archive and close the change.
14
+ 1. `asdlc verify` proves that code matches the approved spec before merging.
15
+ 2. An open implementation PR may receive comments, review rounds, or rework. Running archive inside an unmerged PR would corrupt state.
16
+ 3. Therefore, **archiving happens strictly post-merge**. Root `README.md` is never mutated during archiving (eliminating merge conflict hotspots), and `AGENTS.md` is only updated for constitutional governance changes or when explicitly requested via `--agents`.
17
17
 
18
18
  ---
19
19
 
@@ -21,29 +21,33 @@ This skill executes **Stage 7 (Archive)** of the Agentic SDLC. Archiving is an e
21
21
 
22
22
  ### Step 1: Human Confirmation Check
23
23
  Confirm with the user:
24
- > "Have post-merge verification, staging testing, and stakeholder reviews completed for change `<CHANGE_ID>`?"
24
+ > "Have the PR merge, post-merge verification, and staging testing completed for change `<CHANGE_ID>`?"
25
25
 
26
26
  Wait for human confirmation before proceeding.
27
27
 
28
28
  ### Step 2: Capture Durable Lessons Learned
29
- Before archiving, check if this change introduced durable system knowledge (new conventions, commands, architectural patterns). If so, update the relevant section of `AGENTS.md` (while leaving the `<!-- asdlc:routing -->` blocks intact).
29
+ Before archiving, check if this change introduced durable governance knowledge or constitutional contracts (`.sdlc/policy.yaml`, `openspec/config.yaml`, `governance/**`). If so, `AGENTS.md` will be refreshed automatically, or run `asdlc archive <CHANGE_ID> --agents`.
30
30
 
31
31
  ### Step 3: Execute `asdlc archive`
32
- Run:
33
-
32
+ For a single merged change:
34
33
  ```powershell
35
34
  asdlc archive <CHANGE_ID>
36
35
  ```
37
36
 
37
+ Or for post-merge batch compaction across all merged changes:
38
+ ```powershell
39
+ asdlc archive --merged
40
+ ```
41
+
38
42
  The CLI:
39
43
  1. Moves `openspec/changes/<SLUG>/` into `openspec/changes/archive/<SLUG>/`.
40
- 2. Syncs living specs into `openspec/specs/` and records the capability in `README.md`.
44
+ 2. Syncs living specs into `openspec/specs/` without mutating root `README.md`.
41
45
  3. Rebuilds the AST knowledge graph (`graphify-out/`) against the new HEAD commit.
42
- 4. Creates `AGENTS.md` (if missing) and regenerates its `system-status` block with newly calculated architectural hubs and god nodes.
46
+ 4. Updates `AGENTS.md` only if the change modified constitutional governance paths or if `--agents` was passed.
43
47
 
44
48
  ### Step 4: Confirm Archive Completion
45
49
  Summarize the result to the user:
46
50
  > "✅ Change `<CHANGE_ID>` successfully archived!
47
51
  > - The change artifacts are archived under `openspec/changes/archive/<SLUG>/`.
48
- > - The code knowledge graph has been refreshed to reflect the updated codebase.
49
- > - `AGENTS.md` is updated with fresh system status."
52
+ > - Living specs have synced into `openspec/specs/`.
53
+ > - The code knowledge graph has been refreshed to reflect the updated codebase."
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: asdlc-doctor
3
- description: "Diagnose repository health, toolchain integrity, and governance drift across Node, OpenSpec, Graphify AST, schemas, policy, and git hooks. Provide automated remediation."
3
+ description: "Diagnose repository health, toolchain integrity, and governance drift across Node, OpenSpec, Graphify AST, schemas, and policy. Provide automated remediation."
4
4
  ---
5
5
 
6
6
  # /asdlc:doctor - Repository Health & Governance Diagnostics
@@ -11,19 +11,18 @@ This skill executes health, environment, and configuration integrity checks for
11
11
 
12
12
  ## What this skill checks
13
13
 
14
- `asdlc doctor` verifies 12 environmental and governance invariants:
14
+ `asdlc doctor` verifies environmental and governance invariants:
15
15
 
16
16
  | Check | Requirement | Failure Impact | Remediation |
17
17
  |---|---|---|---|
18
18
  | **`node >= 20.19`** | Node.js version >= 20.19.0 | CLI sub-processes fail | Upgrade Node via `nvm` or system installer |
19
- | **`OpenSpec CLI`** | Pinned `openspec` binary installed | Schema validation fails | Run `asdlc init` or `npm install -D openspec` |
19
+ | **`OpenSpec CLI`** | Pinned or bundled `openspec` runtime available | Schema validation fails | Run `asdlc init` |
20
20
  | **`Graphify`** | Graphify CLI installed | Cannot build code AST graph | Run `uv tool install graphifyy` or `pip install graphifyy` |
21
21
  | **`OpenSpec project`** | `openspec/` directory exists | Cannot store changes | Run `asdlc init` |
22
- | **`managed schema`** | `agentic-repo-change` v1 installed centrally | Cannot validate changes | Run `asdlc init` |
22
+ | **`managed schema`** | `agentic-repo-change` v1 installed centrally or bundled | Cannot validate changes | Run `asdlc init` |
23
23
  | **`schema override`** | No committed overrides in `openspec/schemas/` | Forbidden local fork | Delete tracked local schema file |
24
24
  | **`repo config schema`**| `openspec/config.yaml` declares `schema: agentic-repo-change` | Schema mismatch | Run `asdlc init --force` |
25
25
  | **`.sdlc/policy.yaml`** | Committed platform policy exists | Approval & gate policy unset | Run `asdlc init` |
26
- | **`.githooks`** | `core.hooksPath` set to `.githooks` | Git push/merge guards inactive | Run `git config core.hooksPath .githooks` |
27
26
  | **`AGENTS.md routing`** | `AGENTS.md` contains routing block | Agent lacks navigation rules | Run `asdlc init` |
28
27
  | **`knowledge graph`** | `graphify-out/` is fresh vs `HEAD` | Graph queries stale | Run `asdlc init` or `graphify .` |
29
28
  | **`graphify-out ignored`**| `graphify-out` present in `.gitignore` | Cache committed to repo | Add `graphify-out` to `.gitignore` |
@@ -61,11 +60,12 @@ git rm -f openspec/schemas/agentic-repo-change/schema.yaml
61
60
  git commit -m "chore(governance): remove local schema override"
62
61
  ```
63
62
 
64
- #### Scenario C: Missing Git Hooks
65
- If `.githooks` is unset:
63
+ #### Scenario C: Stale Git Hooks Configuration
64
+ If legacy hooks path remains configured:
66
65
  ```bash
67
- git config core.hooksPath .githooks
66
+ asdlc doctor --fix
68
67
  ```
68
+ This automatically clears legacy `core.hooksPath` settings.
69
69
 
70
70
  #### Scenario D: Stale Knowledge Graph
71
71
  If `knowledge graph` is stale or missing: