@akjamie/agentic-sdlc 0.0.0-stage → 1.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.
- package/LICENSE +21 -0
- package/README.md +219 -2
- package/assets/ci/Jenkinsfile +80 -0
- package/assets/ci/asdlc-ai-review.yml +65 -0
- package/assets/config/config.yaml +76 -0
- package/assets/githooks/post-merge +22 -0
- package/assets/githooks/pre-push +17 -0
- package/assets/policy/policy.yaml +46 -0
- package/assets/schema/schema.yaml +162 -0
- package/assets/schema/templates/design.md +16 -0
- package/assets/schema/templates/proposal.md +25 -0
- package/assets/schema/templates/review.md +24 -0
- package/assets/schema/templates/spec.md +37 -0
- package/assets/schema/templates/tasks.md +10 -0
- package/assets/skills/asdlc-apply/SKILL.md +128 -0
- package/assets/skills/asdlc-approve/SKILL.md +107 -0
- package/assets/skills/asdlc-archive/SKILL.md +48 -0
- package/assets/skills/asdlc-doctor/SKILL.md +82 -0
- package/assets/skills/asdlc-impl-review/SKILL.md +214 -0
- package/assets/skills/asdlc-init/SKILL.md +68 -0
- package/assets/skills/asdlc-lint/SKILL.md +56 -0
- package/assets/skills/asdlc-new/SKILL.md +74 -0
- package/assets/skills/asdlc-pr/SKILL.md +59 -0
- package/assets/skills/asdlc-review/SKILL.md +80 -0
- package/assets/skills/asdlc-spec-review/SKILL.md +194 -0
- package/assets/skills/asdlc-status/SKILL.md +49 -0
- package/assets/skills/asdlc-upgrade/SKILL.md +34 -0
- package/assets/skills/asdlc-verify/SKILL.md +55 -0
- package/assets/skills/batch-grill-me/SKILL.md +136 -0
- package/assets/skills/grilling/SKILL.md +136 -0
- package/bin/asdlc.js +6 -0
- package/package.json +43 -4
- package/src/cli.js +86 -0
- package/src/commands/apply.js +114 -0
- package/src/commands/approve.js +166 -0
- package/src/commands/archive.js +115 -0
- package/src/commands/doctor.js +163 -0
- package/src/commands/init.js +201 -0
- package/src/commands/lint.js +103 -0
- package/src/commands/new.js +142 -0
- package/src/commands/pr.js +495 -0
- package/src/commands/skills.js +184 -0
- package/src/commands/status.js +65 -0
- package/src/commands/update.js +103 -0
- package/src/commands/upgrade.js +175 -0
- package/src/commands/verify.js +229 -0
- package/src/index.js +3 -0
- package/src/lib/agents.js +73 -0
- package/src/lib/cliutil.js +99 -0
- package/src/lib/errors.js +18 -0
- package/src/lib/exec.js +19 -0
- package/src/lib/fs.js +83 -0
- package/src/lib/git.js +76 -0
- package/src/lib/graphify.js +106 -0
- package/src/lib/log.js +15 -0
- package/src/lib/openspec.js +91 -0
- package/src/lib/paths.js +43 -0
- package/src/lib/policy.js +54 -0
- package/src/lib/prtype.js +41 -0
- package/src/lib/schema.js +86 -0
- package/src/lib/speclint.js +168 -0
- package/src/lib/tdd.js +71 -0
- package/src/lib/yaml.js +18 -0
|
@@ -0,0 +1,162 @@
|
|
|
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) - optional
|
|
90
|
+
template: design.md
|
|
91
|
+
instruction: |
|
|
92
|
+
Create only if the change is cross-cutting, introduces a new
|
|
93
|
+
pattern/dependency, or has migration/security/perf complexity.
|
|
94
|
+
|
|
95
|
+
Sections: Context; Goals / Non-Goals; Decisions (+alternatives);
|
|
96
|
+
Risks / Trade-offs ([Risk] -> Mitigation); Migration Plan.
|
|
97
|
+
|
|
98
|
+
Do NOT restate requirements. Do NOT make cross-repo design decisions here;
|
|
99
|
+
raise a System Design Amendment instead.
|
|
100
|
+
requires:
|
|
101
|
+
- proposal
|
|
102
|
+
|
|
103
|
+
- id: tasks
|
|
104
|
+
generates: tasks.md
|
|
105
|
+
description: Mutable execution checklist - generated AFTER approval
|
|
106
|
+
template: tasks.md
|
|
107
|
+
instruction: |
|
|
108
|
+
Create the implementation checklist from the APPROVED spec. tasks.md is
|
|
109
|
+
MUTABLE EXECUTION STATE and is NOT part of approved intent - never edit
|
|
110
|
+
the spec to record progress.
|
|
111
|
+
|
|
112
|
+
Format:
|
|
113
|
+
- Group related tasks under `## N. <group>` headings
|
|
114
|
+
- Follow task-level TDD structure: pair test creation with implementation
|
|
115
|
+
(`- [ ] N.M [TEST] ... (AC<n>) verify: <command>`) followed by
|
|
116
|
+
(`- [ ] N.M+1 [IMPL] ... (AC<n>) evidence: <pass-evidence>`)
|
|
117
|
+
- Every task references the AC it implements and states its verification method
|
|
118
|
+
- Include test execution output under completed tasks as immutable evidence
|
|
119
|
+
- Order by dependency
|
|
120
|
+
requires:
|
|
121
|
+
- specs
|
|
122
|
+
- review
|
|
123
|
+
|
|
124
|
+
apply:
|
|
125
|
+
requires: [tasks]
|
|
126
|
+
tracks: tasks.md
|
|
127
|
+
instruction: |
|
|
128
|
+
Work through the pending tasks in tasks.md. For EACH task, follow task-level
|
|
129
|
+
TDD (v6 5.2):
|
|
130
|
+
1. write a FAILING test that expresses the task's verification;
|
|
131
|
+
2. implement the minimum to make it pass;
|
|
132
|
+
3. run the tests and PASTE the output under the task before claiming it is done;
|
|
133
|
+
4. before moving on, a fresh-context reviewer checks the task against the
|
|
134
|
+
approved spec first, code quality second.
|
|
135
|
+
Mark each task complete only after its verification passes and test evidence is recorded.
|
|
136
|
+
|
|
137
|
+
NEVER modify the spec (approved intent: proposal.md, specs/**).
|
|
138
|
+
|
|
139
|
+
CONVERGE = Report First (v6 6). When reality disagrees with the spec, first
|
|
140
|
+
classify the gap and NEVER silently absorb it into code:
|
|
141
|
+
A implementation error -> write a reproducing test, append a fix task, stay in this PR
|
|
142
|
+
B missing test -> add the test, stay in this PR
|
|
143
|
+
C spec gap/conflict -> STOP the affected tasks and report a SPEC_GAP
|
|
144
|
+
(needs the spec approver; see asdlc review/lint)
|
|
145
|
+
D post-merge defect -> new Jira bug; spec said the right thing -> fast fix,
|
|
146
|
+
spec itself wrong -> new change
|
|
147
|
+
Cross-repo contract changes are always C: stop and raise a System Design
|
|
148
|
+
Amendment - never absorb them here.
|
|
149
|
+
|
|
150
|
+
archive:
|
|
151
|
+
description: Sync living specs, update README, and conditionally update AGENTS.md
|
|
152
|
+
instruction: |
|
|
153
|
+
Archive the verified change:
|
|
154
|
+
1. Living Specs (Knowledge Layer):
|
|
155
|
+
Merge delta specs into `openspec/specs/` and record the capability in `README.md`.
|
|
156
|
+
Do NOT touch `AGENTS.md` for standard business or feature specs (zero prompt pollution).
|
|
157
|
+
2. Constitutional Changes (Governance Layer):
|
|
158
|
+
Automatically detected when the change modifies governance policies, SDLC rules,
|
|
159
|
+
or workflow contracts (`.sdlc/policy.yaml`, `openspec/config.yaml`, `AGENTS.md`, `governance/**`).
|
|
160
|
+
In these cases, `AGENTS.md` is automatically refreshed so all agent IDE sessions
|
|
161
|
+
immediately adhere to the updated constitution.
|
|
162
|
+
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
# Design: <!-- change id -->
|
|
2
|
+
|
|
3
|
+
## Context
|
|
4
|
+
<!-- current state and constraints needed to explain the approach -->
|
|
5
|
+
|
|
6
|
+
## Goals / Non-Goals
|
|
7
|
+
<!-- design-level boundaries only; do not restate requirements -->
|
|
8
|
+
|
|
9
|
+
## Decisions
|
|
10
|
+
<!-- key technical choices with rationale and alternatives considered -->
|
|
11
|
+
|
|
12
|
+
## Risks / Trade-offs
|
|
13
|
+
<!-- format: [Risk] -> Mitigation -->
|
|
14
|
+
|
|
15
|
+
## Migration Plan
|
|
16
|
+
<!-- deploy steps and rollback, if applicable -->
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# Proposal: <!-- change title -->
|
|
2
|
+
|
|
3
|
+
## Why
|
|
4
|
+
<!-- 1-2 sentences: the problem or opportunity, and why now -->
|
|
5
|
+
|
|
6
|
+
## What Changes
|
|
7
|
+
<!-- specific changes; mark breaking changes with **BREAKING** -->
|
|
8
|
+
-
|
|
9
|
+
|
|
10
|
+
## Capabilities
|
|
11
|
+
- **New Capabilities**: <!-- each becomes specs/<capability-path>/spec.md -->
|
|
12
|
+
- **Modified Capabilities**: <!-- exact existing path under openspec/specs/ -->
|
|
13
|
+
|
|
14
|
+
## Impact
|
|
15
|
+
<!-- affected code, APIs, dependencies, or systems -->
|
|
16
|
+
-
|
|
17
|
+
|
|
18
|
+
## Out of Scope
|
|
19
|
+
<!-- What this change explicitly does NOT cover. Prevents scope creep. -->
|
|
20
|
+
|
|
21
|
+
## Dependencies & Assumptions
|
|
22
|
+
<!-- What this change assumes about other systems, teams, or timelines -->
|
|
23
|
+
|
|
24
|
+
## System Design refs
|
|
25
|
+
<!-- e.g. payment-settlement@v2 ; leave empty if no cross-repo contract -->
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
# Independent Review: <!-- change id -->
|
|
2
|
+
|
|
3
|
+
> Reviewer agent (fresh context, different from Draft). Read-only: must not modify proposal/specs/tasks.
|
|
4
|
+
|
|
5
|
+
## Verdict
|
|
6
|
+
<!-- overall: APPROVE | NEEDS_REVISION -->
|
|
7
|
+
|
|
8
|
+
## Dimension Verdicts
|
|
9
|
+
| Dimension | Verdict | Notes |
|
|
10
|
+
|---|---|---|
|
|
11
|
+
| Completeness | | |
|
|
12
|
+
| Ambiguity | | |
|
|
13
|
+
| Cross-repo consistency | | |
|
|
14
|
+
| Contract impact | | |
|
|
15
|
+
| Testability | | |
|
|
16
|
+
| Security | | |
|
|
17
|
+
|
|
18
|
+
## Requirement -> Implementation -> Test
|
|
19
|
+
| AC | Implementation | Test |
|
|
20
|
+
|---|---|---|
|
|
21
|
+
| | TBD | TBD |
|
|
22
|
+
|
|
23
|
+
## Blocking Findings
|
|
24
|
+
<!-- numbered list; empty if none -->
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
# Spec Delta
|
|
2
|
+
|
|
3
|
+
## Purpose
|
|
4
|
+
<!-- New capabilities only: 1-2 sentences (50+ chars). Delete for an existing capability. -->
|
|
5
|
+
|
|
6
|
+
## ADDED Requirements
|
|
7
|
+
|
|
8
|
+
### Requirement: <!-- requirement name -->
|
|
9
|
+
<!-- The system SHALL ... -->
|
|
10
|
+
|
|
11
|
+
#### Scenario: <!-- scenario name -->
|
|
12
|
+
- **GIVEN** <!-- context / precondition -->
|
|
13
|
+
- **WHEN** <!-- action / trigger -->
|
|
14
|
+
- **THEN** <!-- observable outcome -->
|
|
15
|
+
|
|
16
|
+
**Acceptance criteria**
|
|
17
|
+
<!-- Each AC: concrete, testable assertion — not prose. Must map to a test. -->
|
|
18
|
+
- [ ] AC1: <!-- concrete assertion --> (test: <!-- path/to/test -->)
|
|
19
|
+
- [ ] AC2: <!-- concrete assertion --> (test: <!-- path/to/test -->)
|
|
20
|
+
|
|
21
|
+
## MODIFIED Requirements
|
|
22
|
+
<!-- Copy the ENTIRE existing requirement block (incl. scenarios + AC), then edit. -->
|
|
23
|
+
|
|
24
|
+
## REMOVED Requirements
|
|
25
|
+
<!-- ### Requirement: <name> ; **Reason**: ... ; **Migration**: ... -->
|
|
26
|
+
|
|
27
|
+
## Constraints & NFRs
|
|
28
|
+
<!-- Non-functional requirements as verifiable statements, not adjectives. -->
|
|
29
|
+
<!-- e.g. "p99 < 200ms for read ops", "no PII in logs", "works offline" -->
|
|
30
|
+
|
|
31
|
+
## Out of Scope
|
|
32
|
+
<!-- What this change explicitly does NOT cover. Prevents scope creep. -->
|
|
33
|
+
|
|
34
|
+
## Test Strategy
|
|
35
|
+
<!-- How every AC is verified: unit / integration / contract / UI, and which are manual. -->
|
|
36
|
+
|
|
37
|
+
<!-- IMMUTABLE once approved (PR merged). Execution state belongs in tasks.md. -->
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
# Tasks
|
|
2
|
+
|
|
3
|
+
<!-- Mutable execution state, generated AFTER approval. Not part of approved intent. -->
|
|
4
|
+
<!-- Follow task-level TDD: for each task or task-pair, write failing test -> implement -> paste test output. -->
|
|
5
|
+
|
|
6
|
+
## 1. <!-- group name -->
|
|
7
|
+
- [ ] 1.1 [TEST] <!-- write failing test for AC<n> (test: path/to/test) -->
|
|
8
|
+
- <!-- verify: run test command, assert expected failure -->
|
|
9
|
+
- [ ] 1.2 [IMPL] <!-- implement minimum code to pass 1.1 (AC<n>) -->
|
|
10
|
+
- <!-- evidence: paste test runner pass output -->
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: asdlc-apply
|
|
3
|
+
description: "Execute Stage 5 of Agentic SDLC: guard verification followed by strict task-level TDD loop (Red -> Green -> Refactor -> Evidence -> Converge) from tasks.md."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# /asdlc:apply - Task-Level TDD Implementation Engine
|
|
7
|
+
|
|
8
|
+
This skill executes **Stage 5 (Apply)** of the Agentic SDLC. It enforces strict task-level Test-Driven Development (TDD) and the Converge protocol.
|
|
9
|
+
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
## The TDD Principle
|
|
13
|
+
|
|
14
|
+
> **No production code is written without a prior failing test.**
|
|
15
|
+
> Marking a task complete without captured test evidence is a verification blocker.
|
|
16
|
+
|
|
17
|
+
---
|
|
18
|
+
|
|
19
|
+
## Workflow Sequence
|
|
20
|
+
|
|
21
|
+
### Step 1: Run the Apply Guard (Pre-Implementation Security Check)
|
|
22
|
+
Before editing any implementation or test code, run the apply guard:
|
|
23
|
+
|
|
24
|
+
```powershell
|
|
25
|
+
asdlc apply <CHANGE_ID>
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
`asdlc apply` deterministically verifies four cryptographic preconditions:
|
|
29
|
+
1. **Target Branch Approved Commit (`approvedSha`)**: Confirms that a commit touching the locked paths (`proposal.md` and `specs/**`) is physically merged into the target branch (`main` or `origin/main`).
|
|
30
|
+
2. **Change State Machine (`ready_for_impl`)**: Confirms `.openspec.yaml` has been transitioned to `status: ready_for_impl` (via `asdlc approve <ID>`).
|
|
31
|
+
3. **Spec Fingerprint Integrity (`specSha`)**: Verifies that the declared `specSha` in `.openspec.yaml` exactly matches the `approvedSha` on the protected branch.
|
|
32
|
+
4. **Working Tree Tamper Defense**: Ensures that locked spec files (`proposal.md`, `specs/**`) have no uncommitted local modifications.
|
|
33
|
+
|
|
34
|
+
- If `asdlc apply` fails: **STOP immediately**. Follow the provided hint (e.g. merge Spec PR or run `asdlc approve`).
|
|
35
|
+
- If `asdlc apply` succeeds: Proceed to Step 2.
|
|
36
|
+
|
|
37
|
+
### Step 2: Read `tasks.md` and Ground Context
|
|
38
|
+
1. Open and read `openspec/changes/<CHANGE_ID>/tasks.md`.
|
|
39
|
+
2. Inspect the spec requirements in `openspec/changes/<CHANGE_ID>/specs/**/*.md` to understand the acceptance criteria (`AC<n>`) and required test mappings (`(test: <path>)`).
|
|
40
|
+
3. Identify the next unchecked task (`- [ ]`).
|
|
41
|
+
|
|
42
|
+
### Step 3: The Task-Level TDD Loop (Per Task)
|
|
43
|
+
|
|
44
|
+
For every task in `tasks.md`, execute this exact 5-phase loop:
|
|
45
|
+
|
|
46
|
+
#### Phase A: RED (Write the Failing Test)
|
|
47
|
+
1. Write or expand the unit/integration test in the target test file.
|
|
48
|
+
2. Run the repository test command (e.g., `npm test`, `pytest`, `go test`).
|
|
49
|
+
3. **Assert Failure:** Verify that the test fails for the *expected* reason (e.g., function not found, assertion mismatched).
|
|
50
|
+
4. If the test passes before implementation: the test is invalid or redundant. Fix the test until it accurately tests the unwritten feature.
|
|
51
|
+
|
|
52
|
+
#### Phase B: GREEN (Implement the Minimum Code)
|
|
53
|
+
1. Implement the minimal code required to satisfy the failing test.
|
|
54
|
+
2. Do not write anticipatory code or unrequested abstractions.
|
|
55
|
+
3. Run the test command again.
|
|
56
|
+
4. **Assert Pass:** Verify that the test now passes cleanly (`Exit Code: 0`).
|
|
57
|
+
|
|
58
|
+
#### Phase C: REFACTOR & CONVERGE
|
|
59
|
+
1. Clean up implementation, adhere to repo standards, remove dead code.
|
|
60
|
+
2. Re-run all existing tests to ensure no regressions.
|
|
61
|
+
3. **Converge Protocol:** If reality disagrees with the spec during implementation:
|
|
62
|
+
- **Type A (Implementation error):** Write reproducing test, append fix task, remain in PR.
|
|
63
|
+
- **Type B (Missing test):** Add missing test, remain in PR.
|
|
64
|
+
- **Type C (Spec gap/conflict):** **STOP**. Never silently edit locked spec files (`proposal.md`, `specs/**`). Report `SPEC_GAP` to the user and approver.
|
|
65
|
+
|
|
66
|
+
#### Phase D: Record Evidence & Check Box
|
|
67
|
+
1. Under the completed task in `tasks.md`, record the test run command and output:
|
|
68
|
+
```markdown
|
|
69
|
+
- [x] 1.1 [TEST] Add failing test for AC1 (`test/feature.test.js`)
|
|
70
|
+
- verify: `npm test` -> PASS (test/feature.test.js: 3 passed)
|
|
71
|
+
- [x] 1.2 [IMPL] Implement minimal code for AC1
|
|
72
|
+
- evidence: `npm test` -> PASS (all 35 passed)
|
|
73
|
+
```
|
|
74
|
+
2. Mark the checkbox `- [x]`.
|
|
75
|
+
|
|
76
|
+
---
|
|
77
|
+
|
|
78
|
+
### Special Guidance: Web & Mobile Applications (UI Design Tasks)
|
|
79
|
+
|
|
80
|
+
> [!IMPORTANT]
|
|
81
|
+
> **Is UI Design required or nice-to-have for Web/Mobile apps?**
|
|
82
|
+
> **Verdict: It is ESSENTIAL (Required in `tasks.md`), not a nice-to-have.**
|
|
83
|
+
|
|
84
|
+
When a change introduces or modifies user-facing interfaces (web, mobile, or desktop):
|
|
85
|
+
1. **Design Foundation Must Precede Logic**:
|
|
86
|
+
Never jump directly into business logic or raw HTML/JSX. Skipping UI design creates unstyled, disjointed MVPs that violate usability and require costly refactoring.
|
|
87
|
+
2. **Decompose UI Work into Explicit `tasks.md` Tasks**:
|
|
88
|
+
For any change touching frontend views, `tasks.md` should structure tasks into three progressive tiers:
|
|
89
|
+
- **Tier 1 · [UI/DESIGN] Visual & Token Scaffolding**:
|
|
90
|
+
Establish or update design tokens (colors, typography, spacing, CSS variables, dark/light theme), responsive layout containers, and navigation hierarchy.
|
|
91
|
+
- **Tier 2 · [UI/COMPONENTS] Interactive Component States**:
|
|
92
|
+
Build reusable components with all mandatory states: **Empty**, **Loading**, **Error**, and **Success/Data-bound**. Validate via component render tests or visual snapshots.
|
|
93
|
+
- **Tier 3 · [LOGIC/INTEGRATION] State & API Wiring**:
|
|
94
|
+
Wire state stores, API clients, forms, and business logic with unit & E2E integration tests fulfilling the spec's ACs.
|
|
95
|
+
|
|
96
|
+
---
|
|
97
|
+
|
|
98
|
+
### Step 4: Run Verification Gate
|
|
99
|
+
Once all tasks in `tasks.md` are checked and evidenced, run `asdlc verify`:
|
|
100
|
+
|
|
101
|
+
```powershell
|
|
102
|
+
asdlc verify <CHANGE_ID>
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
Verify that all checks pass:
|
|
106
|
+
- `approved-spec`
|
|
107
|
+
- `flow-state`
|
|
108
|
+
- `tasks-complete`
|
|
109
|
+
- `test-presence` (diff contains tests alongside source code)
|
|
110
|
+
- `tdd-evidence` (tasks have valid verification statements/evidence)
|
|
111
|
+
- `BDD + acceptance criteria`
|
|
112
|
+
- `openspec-validate`
|
|
113
|
+
|
|
114
|
+
---
|
|
115
|
+
|
|
116
|
+
### Step 5: Open Implementation PR
|
|
117
|
+
Once `asdlc verify <CHANGE_ID>` passes, execute `asdlc pr` to open the Implementation PR:
|
|
118
|
+
|
|
119
|
+
```powershell
|
|
120
|
+
asdlc pr <CHANGE_ID> <targetBranch>
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
`asdlc pr` will:
|
|
124
|
+
1. Automatically detect this is an **Implementation PR** (status is `ready_for_impl`, spec is approved, tasks are complete, and source changes exist).
|
|
125
|
+
2. Run `asdlc verify <CHANGE_ID>` as a pre-flight guard (requiring all 12 verification checks to pass).
|
|
126
|
+
3. Commit implementation code and test evidence, then push to origin.
|
|
127
|
+
4. Pre-provision and attach `asdlc:impl-review` and `impl` labels to trigger CI Code AI Review.
|
|
128
|
+
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: asdlc-approve
|
|
3
|
+
description: "Execute Stage 4 of Agentic SDLC: approve spec intent, lock specSha, and transition change to READY_FOR_IMPL across any enterprise Git workflow."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# /asdlc:approve - Spec Approval & Implementation Unlocking
|
|
7
|
+
|
|
8
|
+
This skill executes **Stage 4 (Approve)** of the Agentic SDLC. It transitions a change from approved intent into the implementation stage (`READY_FOR_IMPL`), locking the spec to a path-limited approved commit SHA (`specSha`).
|
|
9
|
+
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
## Core Concept: The Spec SHA Freeze Gate
|
|
13
|
+
|
|
14
|
+
`asdlc approve` is **branch-agnostic**. It does not enforce a rigid branching dogma, nor does it require selecting artificial "modes".
|
|
15
|
+
|
|
16
|
+
In enterprise environments (whether using `feature -> staging -> main`, trunk-based, or multi-level git flow), **Approve** represents a single cryptographic gate:
|
|
17
|
+
|
|
18
|
+
```text
|
|
19
|
+
[Stage 2: Grilling / Proposal]
|
|
20
|
+
↓
|
|
21
|
+
[Stage 3: Lint & Spec PR] ── asdlc lint <ID> / asdlc pr <ID> [target]
|
|
22
|
+
↓
|
|
23
|
+
[Stage 4: APPROVE GATE] ── asdlc approve <ID>
|
|
24
|
+
│ Locks: specSha = sha(proposal.md + specs/**)
|
|
25
|
+
│ Sets: status = ready_for_impl
|
|
26
|
+
│ Writes: review.md (verdict: APPROVE)
|
|
27
|
+
↓
|
|
28
|
+
[Stage 5: TDD Implementation] ── asdlc apply <ID>
|
|
29
|
+
↓
|
|
30
|
+
[Stage 6: CI Verification] ── asdlc verify <ID>
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
Whenever human stakeholders or Tech Leads agree on the spec:
|
|
34
|
+
1. `asdlc approve <CHANGE_ID>` calculates the exact Git commit SHA that touched `proposal.md` and `specs/**`.
|
|
35
|
+
2. Stamped into `.openspec.yaml` as `specSha: <sha>` and `status: ready_for_impl`.
|
|
36
|
+
3. Stamped into `review.md` with `## Verdict: APPROVE`.
|
|
37
|
+
4. Git commit automatically created for the approval stamp.
|
|
38
|
+
|
|
39
|
+
From this moment on, **Stage 5 (`asdlc apply`) is unlocked**, and **Stage 6 (`asdlc verify`) will fail if anyone or any AI tampers with the approved spec files during implementation**.
|
|
40
|
+
|
|
41
|
+
---
|
|
42
|
+
|
|
43
|
+
## Enterprise Workflows Supported
|
|
44
|
+
|
|
45
|
+
### 1. Unified Feature Branch Flow (Most Popular)
|
|
46
|
+
- Developer/AI authors spec on `feat/xxx` (or `spec/xxx`).
|
|
47
|
+
- Open Spec PR for early feedback: `asdlc pr <ID> staging` (or `main`, matching your pipeline).
|
|
48
|
+
- Tech Lead / Product Owner reviews:
|
|
49
|
+
- Run `asdlc approve <ID>` directly on the branch.
|
|
50
|
+
- Developer/AI runs `asdlc apply <ID>` and writes code + tests on the same branch.
|
|
51
|
+
- Final PR merges code + verified spec together into the target branch.
|
|
52
|
+
|
|
53
|
+
### 2. Spec-First Staged PR Flow (Multi-tier Enterprise Pipelines)
|
|
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>`.
|
|
56
|
+
- The implementation is then performed on an implementation branch branching from the approved merge commit.
|
|
57
|
+
|
|
58
|
+
### 3. Local / In-Place Fast Loop (Agile Squads)
|
|
59
|
+
- Tech Lead and developers collaborate locally or pair on a branch.
|
|
60
|
+
- Tech Lead reviews locally and executes `asdlc approve <ID>`.
|
|
61
|
+
- Unblocks `asdlc apply <ID>` immediately.
|
|
62
|
+
|
|
63
|
+
---
|
|
64
|
+
|
|
65
|
+
## Command Reference
|
|
66
|
+
|
|
67
|
+
### Opening the Spec PR
|
|
68
|
+
```powershell
|
|
69
|
+
asdlc pr <CHANGE_ID> [targetBranch]
|
|
70
|
+
```
|
|
71
|
+
- `targetBranch`: The base branch this PR will merge into (`staging`, `main`, `develop`, or parent feature branch). If omitted, defaults to the repository's upstream or default branch.
|
|
72
|
+
- Automatically lints the spec before pushing (fails fast if blocking findings).
|
|
73
|
+
- Automatically extracts the PR Title and Body from `proposal.md`.
|
|
74
|
+
- Automatically opens PR via `gh`/`glab` CLI, GitHub REST API, or 1-click web comparison link.
|
|
75
|
+
|
|
76
|
+
### Approving the Spec
|
|
77
|
+
```powershell
|
|
78
|
+
asdlc approve <CHANGE_ID>
|
|
79
|
+
```
|
|
80
|
+
Executes:
|
|
81
|
+
1. Identifies the path-limited `approvedSha` of the spec.
|
|
82
|
+
2. Updates `.openspec.yaml`: `specSha: <approvedSha>`, `status: ready_for_impl`.
|
|
83
|
+
3. Creates or updates `review.md` with `APPROVE` verdict and approval audit record.
|
|
84
|
+
4. Creates a Git commit with the approval stamp.
|
|
85
|
+
|
|
86
|
+
Expected output:
|
|
87
|
+
```text
|
|
88
|
+
✔ <SLUG>: APPROVED specSha=<shortSha> status=ready_for_impl
|
|
89
|
+
✔ <SLUG>: stamped review.md (verdict=APPROVE, specSha=<shortSha>)
|
|
90
|
+
✔ committed approval stamp
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
---
|
|
94
|
+
|
|
95
|
+
## Next Steps After Approval
|
|
96
|
+
|
|
97
|
+
1. Inspect `openspec/changes/<CHANGE_ID>/tasks.md` and confirm strict TDD task pairing:
|
|
98
|
+
```markdown
|
|
99
|
+
## 1. Implementation
|
|
100
|
+
- [ ] 1.1 [TEST] Add failing test for AC1 in `test/auth.test.js`
|
|
101
|
+
- [ ] 1.2 [IMPL] Implement authentication logic
|
|
102
|
+
```
|
|
103
|
+
2. Prompt developer / AI:
|
|
104
|
+
> "✅ Spec successfully approved!
|
|
105
|
+
> - `specSha` locked at `<shortSha>`.
|
|
106
|
+
> - Status stamped: `READY_FOR_IMPL`.
|
|
107
|
+
> Run `/asdlc:apply <CHANGE_ID>` to begin the task-level TDD implementation loop."
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: asdlc-archive
|
|
3
|
+
description: "Explicitly close and archive a verified change (Stage 7): confirm post-merge review, move change to archive, refresh code knowledge graph, and update AGENTS.md system status."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# /asdlc:archive - Deliberate Human Archive Gate
|
|
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.
|
|
9
|
+
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
## Why Archive is an Explicit Gate
|
|
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.
|
|
17
|
+
|
|
18
|
+
---
|
|
19
|
+
|
|
20
|
+
## Workflow Sequence
|
|
21
|
+
|
|
22
|
+
### Step 1: Human Confirmation Check
|
|
23
|
+
Confirm with the user:
|
|
24
|
+
> "Have post-merge verification, staging testing, and stakeholder reviews completed for change `<CHANGE_ID>`?"
|
|
25
|
+
|
|
26
|
+
Wait for human confirmation before proceeding.
|
|
27
|
+
|
|
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).
|
|
30
|
+
|
|
31
|
+
### Step 3: Execute `asdlc archive`
|
|
32
|
+
Run:
|
|
33
|
+
|
|
34
|
+
```powershell
|
|
35
|
+
asdlc archive <CHANGE_ID>
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
The CLI:
|
|
39
|
+
1. Moves `openspec/changes/<SLUG>/` into `openspec/changes/archive/<SLUG>/`.
|
|
40
|
+
2. Triggers Graphify to rebuild the AST knowledge graph against the new HEAD commit.
|
|
41
|
+
3. Regenerates the `system-status` block in `AGENTS.md` with newly calculated architectural hubs and god nodes.
|
|
42
|
+
|
|
43
|
+
### Step 4: Confirm Archive Completion
|
|
44
|
+
Summarize the result to the user:
|
|
45
|
+
> "✅ Change `<CHANGE_ID>` successfully archived!
|
|
46
|
+
> - The change artifacts are archived under `openspec/changes/archive/<SLUG>/`.
|
|
47
|
+
> - The code knowledge graph has been refreshed to reflect the updated codebase.
|
|
48
|
+
> - `AGENTS.md` is updated with fresh system status."
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
---
|
|
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."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# /asdlc:doctor - Repository Health & Governance Diagnostics
|
|
7
|
+
|
|
8
|
+
This skill executes health, environment, and configuration integrity checks for the Agentic SDLC toolchain. It provides structured diagnostics and automated remediation recipes when platform drift occurs.
|
|
9
|
+
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
## What this skill checks
|
|
13
|
+
|
|
14
|
+
`asdlc doctor` verifies 12 environmental and governance invariants:
|
|
15
|
+
|
|
16
|
+
| Check | Requirement | Failure Impact | Remediation |
|
|
17
|
+
|---|---|---|---|
|
|
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` |
|
|
20
|
+
| **`Graphify`** | Graphify CLI installed | Cannot build code AST graph | Run `uv tool install graphifyy` or `pip install graphifyy` |
|
|
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` |
|
|
23
|
+
| **`schema override`** | No committed overrides in `openspec/schemas/` | Forbidden local fork | Delete tracked local schema file |
|
|
24
|
+
| **`repo config schema`**| `openspec/config.yaml` declares `schema: agentic-repo-change` | Schema mismatch | Run `asdlc init --force` |
|
|
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
|
+
| **`AGENTS.md routing`** | `AGENTS.md` contains routing block | Agent lacks navigation rules | Run `asdlc init` |
|
|
28
|
+
| **`knowledge graph`** | `graphify-out/` is fresh vs `HEAD` | Graph queries stale | Run `asdlc init` or `graphify .` |
|
|
29
|
+
| **`graphify-out ignored`**| `graphify-out` present in `.gitignore` | Cache committed to repo | Add `graphify-out` to `.gitignore` |
|
|
30
|
+
|
|
31
|
+
---
|
|
32
|
+
|
|
33
|
+
## Workflow Sequence
|
|
34
|
+
|
|
35
|
+
### Step 1: Run Diagnostics
|
|
36
|
+
Run in the repository root:
|
|
37
|
+
|
|
38
|
+
```powershell
|
|
39
|
+
asdlc doctor
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
Inspect output summary:
|
|
43
|
+
- If all checks show `[PASS]`: Report that the repository is completely healthy and aligned with platform standards.
|
|
44
|
+
- If any check shows `[FAIL]` or `[WARN]`: Proceed to Step 2.
|
|
45
|
+
|
|
46
|
+
### Step 2: Automated Remediation Playbooks
|
|
47
|
+
|
|
48
|
+
#### Scenario A: Missing Governance or OpenSpec Project
|
|
49
|
+
If `OpenSpec project`, `managed schema`, or `.sdlc/policy.yaml` failed:
|
|
50
|
+
```powershell
|
|
51
|
+
asdlc init --force
|
|
52
|
+
```
|
|
53
|
+
This restores all core templates, policy files, and central schema pins.
|
|
54
|
+
|
|
55
|
+
#### Scenario B: Forbidden Schema Override
|
|
56
|
+
If `schema override` failed (e.g. `openspec/schemas/agentic-repo-change/schema.yaml COMMITTED (forbidden)`):
|
|
57
|
+
Platform governance forbids individual repository overrides of the enterprise schema.
|
|
58
|
+
Run:
|
|
59
|
+
```bash
|
|
60
|
+
git rm -f openspec/schemas/agentic-repo-change/schema.yaml
|
|
61
|
+
git commit -m "chore(governance): remove local schema override"
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
#### Scenario C: Missing Git Hooks
|
|
65
|
+
If `.githooks` is unset:
|
|
66
|
+
```bash
|
|
67
|
+
git config core.hooksPath .githooks
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
#### Scenario D: Stale Knowledge Graph
|
|
71
|
+
If `knowledge graph` is stale or missing:
|
|
72
|
+
Run:
|
|
73
|
+
```powershell
|
|
74
|
+
asdlc init
|
|
75
|
+
```
|
|
76
|
+
Or directly refresh the AST graph:
|
|
77
|
+
```bash
|
|
78
|
+
graphify .
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
### Step 3: Re-verify Health
|
|
82
|
+
Re-run `asdlc doctor` to confirm `doctor: ok (0 failed, 0 warnings)` before continuing work.
|