@akjamie/agentic-sdlc 1.1.0 → 1.3.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 +201 -21
- package/README.md +264 -154
- package/assets/schema/risk-assessment.schema.json +225 -0
- package/assets/schema/templates/design.md +94 -31
- package/assets/skills/api-design/SKILL.md +204 -0
- package/assets/skills/asdlc-apply/SKILL.md +43 -18
- package/assets/skills/asdlc-impl-review/SKILL.md +153 -47
- package/assets/skills/asdlc-new/SKILL.md +42 -24
- package/assets/skills/asdlc-verify/SKILL.md +16 -6
- package/assets/skills/batch-grill-me/SKILL.md +11 -7
- package/assets/skills/frontend-design/SKILL.md +84 -0
- package/assets/skills/grilling/SKILL.md +43 -17
- package/package.json +2 -2
- package/src/assess/ai_judge.js +163 -0
- package/src/assess/decide.js +164 -0
- package/src/assess/governance.js +53 -0
- package/src/assess/index.js +183 -0
- package/src/assess/render.js +71 -0
- package/src/assess/rules/builtin.js +195 -0
- package/src/assess/schema.js +148 -0
- package/src/assess/store.js +138 -0
- package/src/assess/vectors/v1_intent.js +80 -0
- package/src/assess/vectors/v2_security.js +131 -0
- package/src/assess/vectors/v3_topology.js +107 -0
- package/src/cli.js +91 -89
- package/src/commands/apply.js +103 -36
- package/src/commands/assess.js +57 -0
- package/src/commands/doctor.js +1 -14
- package/src/commands/init.js +0 -9
- package/src/commands/new.js +97 -19
- package/src/commands/pr.js +27 -3
- package/src/commands/upgrade.js +1 -1
- package/src/commands/verify.js +109 -15
- package/src/lib/agents.js +5 -4
- package/src/lib/fs.js +26 -3
- package/src/lib/level.js +118 -0
- package/src/lib/paths.js +2 -1
- package/src/lib/prtype.js +17 -4
- package/src/lib/risk.js +50 -0
- package/src/lib/schema.js +4 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
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."
|
|
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. Defaults to local-only implementation; auto-PR is permitted only with explicit delegation via --auto-pr."
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# /asdlc:apply - Task-Level TDD Implementation Engine
|
|
@@ -22,18 +22,24 @@ This skill executes **Stage 5 (Apply)** of the Agentic SDLC. It enforces strict
|
|
|
22
22
|
Before editing any implementation or test code, run the apply guard:
|
|
23
23
|
|
|
24
24
|
```powershell
|
|
25
|
-
asdlc apply <CHANGE_ID>
|
|
25
|
+
asdlc apply <CHANGE_ID> [--auto-pr] [--target-branch <ref>]
|
|
26
26
|
```
|
|
27
27
|
|
|
28
|
-
`asdlc apply` deterministically verifies
|
|
28
|
+
`asdlc apply` deterministically verifies cryptographic preconditions:
|
|
29
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
30
|
2. **Change State Machine (`ready_for_impl`)**: Confirms `.openspec.yaml` has been transitioned to `status: ready_for_impl` (via `asdlc approve <ID>`).
|
|
31
31
|
3. **Spec Fingerprint Integrity (`specSha`)**: Verifies that the declared `specSha` in `.openspec.yaml` exactly matches the `approvedSha` on the protected branch.
|
|
32
32
|
4. **Working Tree Tamper Defense**: Ensures that locked spec files (`proposal.md`, `specs/**`) have no uncommitted local modifications.
|
|
33
|
+
5. **PR Authority Delegation (`--auto-pr`)**: By default, `apply` operates in **local-only mode** (`autoPr: false`). Supplying `--auto-pr` explicitly delegates authority to automatically create an Implementation PR after verification passes (persisted to `.openspec.yaml`).
|
|
33
34
|
|
|
34
35
|
- If `asdlc apply` fails: **STOP immediately**. Follow the provided hint (e.g. merge Spec PR or run `asdlc approve`).
|
|
35
36
|
- If `asdlc apply` succeeds: Proceed to Step 2.
|
|
36
37
|
|
|
38
|
+
> [!NOTE]
|
|
39
|
+
> **Governance Level & Single PR Flow (L0 / L1)**:
|
|
40
|
+
> For changes evaluated as `level: L0` or `level: L1`, prior merging of a Spec PR to the protected branch is waived. `asdlc apply` immediately unblocks local TDD implementation, allowing source code and spec delta to be submitted together in a Single PR.
|
|
41
|
+
|
|
42
|
+
|
|
37
43
|
### Step 2: Read `tasks.md` and Ground Context
|
|
38
44
|
1. Open and read `openspec/changes/<CHANGE_ID>/tasks.md`.
|
|
39
45
|
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>)`).
|
|
@@ -95,8 +101,8 @@ When a change introduces or modifies user-facing interfaces (web, mobile, or des
|
|
|
95
101
|
|
|
96
102
|
---
|
|
97
103
|
|
|
98
|
-
### Step 4: Run Verification
|
|
99
|
-
Once all tasks in `tasks.md` are checked and evidenced, run `asdlc verify
|
|
104
|
+
### Step 4: Run Local Verification Check
|
|
105
|
+
Once all tasks in `tasks.md` are checked and evidenced, run `asdlc verify <CHANGE_ID>` locally:
|
|
100
106
|
|
|
101
107
|
```powershell
|
|
102
108
|
asdlc verify <CHANGE_ID>
|
|
@@ -111,18 +117,37 @@ Verify that all checks pass:
|
|
|
111
117
|
- `BDD + acceptance criteria`
|
|
112
118
|
- `openspec-validate`
|
|
113
119
|
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
### Step 5: Open Implementation PR
|
|
117
|
-
Once `asdlc verify <CHANGE_ID>` passes, execute `asdlc pr` to open the Implementation PR:
|
|
120
|
+
If any check fails, resolve the issue locally within the TDD loop and re-run `asdlc verify <CHANGE_ID>`.
|
|
118
121
|
|
|
119
|
-
|
|
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.
|
|
122
|
+
---
|
|
128
123
|
|
|
124
|
+
### Step 5: Implementation Complete & Submission Protocol (Dual-Mode Authority)
|
|
125
|
+
|
|
126
|
+
Once all tasks in `tasks.md` are marked complete with captured evidence and local `asdlc verify <CHANGE_ID>` passes (all 12 verification gates exit 0), determine the submission path based on explicit authority:
|
|
127
|
+
|
|
128
|
+
#### Path A: Default Local Mode (Safe Default, `autoPr: false` or unspecified)
|
|
129
|
+
> [!CAUTION]
|
|
130
|
+
> **Stage Boundary Guard — No Automatic PR Creation by Default**:
|
|
131
|
+
> `asdlc-apply` is strictly the **local implementation engine** (Stage 5).
|
|
132
|
+
> **NEVER automatically push commits to origin or open a Pull Request during `apply` by default.**
|
|
133
|
+
> Pushing code to a remote repository and opening a PR is a public, collaborative action with team-wide visibility, git ref mutation, and CI compute costs.
|
|
134
|
+
>
|
|
135
|
+
> In default mode, an agent executing `apply` must NEVER run `asdlc pr` or `git push` on its own.
|
|
136
|
+
|
|
137
|
+
1. Summarize completed tasks and verification results for the developer.
|
|
138
|
+
2. Inform the developer that the implementation is verified locally and ready:
|
|
139
|
+
> "🎉 Implementation complete! All tasks in `tasks.md` are implemented with TDD evidence, and all local verification checks passed.
|
|
140
|
+
> When you are ready to open the Implementation PR, run:
|
|
141
|
+
> `asdlc pr <CHANGE_ID> <targetBranch>` (or trigger `/asdlc:pr`)."
|
|
142
|
+
|
|
143
|
+
#### Path B: Explicit Delegation Mode (`--auto-pr` or explicit intent)
|
|
144
|
+
> [!TIP]
|
|
145
|
+
> **Authorized Agent Delegation Channel**:
|
|
146
|
+
> When the user has explicitly authorized automatic PR creation (via `asdlc apply <CHANGE_ID> --auto-pr`, `autoPr: true` in `.openspec.yaml`, or explicit user prompt instructions):
|
|
147
|
+
>
|
|
148
|
+
> 1. Confirm that `asdlc verify <CHANGE_ID>` exited 0 with all verification checks passing cleanly.
|
|
149
|
+
> 2. The agent is authorized to automatically open the Implementation PR via:
|
|
150
|
+
> ```powershell
|
|
151
|
+
> asdlc pr <CHANGE_ID> <targetBranch>
|
|
152
|
+
> ```
|
|
153
|
+
> 3. Provide the resulting PR link to the user and announce readiness for AI / Human Implementation Review.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: asdlc-impl-review
|
|
3
|
-
description: "Independent AI Implementation Review (Stage 6.5): evaluate an Impl PR for spec conformance, code quality, test fidelity, and production readiness before human lead approval. Accepts a GitHub PR URL or local CHANGE_ID."
|
|
3
|
+
description: "Independent AI Implementation Review (Stage 6.5): evaluate an Impl PR for spec conformance, code quality, test fidelity, and production readiness before human lead approval. Incorporates Anthropic code review principles (anti-thrashing convergence, 3-round cap, repo-level REVIEW.md contracts, introduced-vs-preexisting defect attribution, and risk tiering). Accepts a GitHub PR URL or local CHANGE_ID."
|
|
4
4
|
aliases:
|
|
5
5
|
- impl-review
|
|
6
6
|
- code-review-asdlc
|
|
@@ -13,6 +13,16 @@ It posts its findings as a **markdown PR comment** via the GitHub API so the hum
|
|
|
13
13
|
|
|
14
14
|
It applies the **Player ≠ Referee** principle: the reviewing agent MUST NOT be the agent that authored the implementation.
|
|
15
15
|
|
|
16
|
+
### Core Philosophy: Protecting Human Time & Attention
|
|
17
|
+
|
|
18
|
+
Drawing from Anthropic's engineering practices for scaling AI code reviews, this reviewer enforces:
|
|
19
|
+
1. **Convergence Protocol**: Review loops must converge, not thrash. Capped at **3 rounds** max; re-reviews inspect **incremental diffs only**.
|
|
20
|
+
2. **Defect Attribution**: Clearly separates defects introduced by this PR (`[Blocker: Introduced]`) from pre-existing legacy issues (`[Tech Debt: Pre-existing]`). Pre-existing flaws **never block** the PR.
|
|
21
|
+
3. **Repository Contract (`REVIEW.md`)**: Respects repository-defined domain rules, failure modes, and ignore paths from the trusted base branch over generic AI opinions.
|
|
22
|
+
4. **Risk-Based Tiering**: Scrutiny scales with the change's risk profile (Tier 1 Docs/Style, Tier 2 Standard, Tier 3 Critical/Auth/Billing). Highest-risk file sets the PR tier.
|
|
23
|
+
5. **Class-of-Bug Grouping**: Defect patterns are grouped into singular findings rather than fragmented into line-by-line spam.
|
|
24
|
+
6. **Structural & Actionable Findings**: Every finding provides explicit Location, Defect, Impact, and Action Required for instant clarity to both AI agents and human leads.
|
|
25
|
+
|
|
16
26
|
> [!IMPORTANT]
|
|
17
27
|
> **Scope**: Reviews *implementation conformance and code quality* — spec adherence, test rigor, architecture, and production safety.
|
|
18
28
|
> Requires `asdlc verify <CHANGE_ID>` to have passed (12 gates) before this review is meaningful.
|
|
@@ -53,24 +63,50 @@ stage('Implementation AI Review') {
|
|
|
53
63
|
|
|
54
64
|
## Workflow Sequence
|
|
55
65
|
|
|
56
|
-
### Step 1: Acquire PR Context
|
|
66
|
+
### Step 1: Acquire PR Context & Discover Repo Contract
|
|
57
67
|
|
|
58
|
-
Run the following commands to collect
|
|
68
|
+
Run the following commands to collect PR metadata, history, and repo review contracts:
|
|
59
69
|
|
|
60
70
|
```bash
|
|
61
|
-
#
|
|
62
|
-
gh pr view $PR_NUMBER --repo $REPO --json title,body,baseRefName,headRefName,files
|
|
63
|
-
|
|
64
|
-
#
|
|
65
|
-
|
|
71
|
+
# 1. Fetch PR metadata and previous review comments
|
|
72
|
+
gh pr view $PR_NUMBER --repo $REPO --json title,body,baseRefName,headRefName,headRefOid,comments,files
|
|
73
|
+
|
|
74
|
+
# 2. Check for repository-level REVIEW.md contract from trusted base branch
|
|
75
|
+
# Checked in order: .asdlc/REVIEW.md -> openspec/REVIEW.md -> REVIEW.md
|
|
76
|
+
# IMPORTANT: Always read from origin/<baseRefName>, NEVER from PR HEAD,
|
|
77
|
+
# to prevent self-review bypasses (e.g., PR injecting path exclusions or rewriting failure definitions).
|
|
78
|
+
git show origin/<baseRefName>:.asdlc/REVIEW.md 2>/dev/null || \
|
|
79
|
+
git show origin/<baseRefName>:openspec/REVIEW.md 2>/dev/null || \
|
|
80
|
+
git show origin/<baseRefName>:REVIEW.md 2>/dev/null || true
|
|
66
81
|
```
|
|
67
82
|
|
|
68
|
-
Extract from the PR body
|
|
69
|
-
- `CHANGE_ID` from the `**Change ID**:` field or branch name
|
|
70
|
-
- `specSha` from `.openspec.yaml` (read from
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
83
|
+
Extract from the PR body, comments, and repo contract:
|
|
84
|
+
- `CHANGE_ID` from the `**Change ID**:` field or branch name (`asdlc/impl/<CHANGE_ID>`)
|
|
85
|
+
- `specSha` from `.openspec.yaml` (read from base branch or PR files)
|
|
86
|
+
- `headRefOid`: Current commit SHA under review
|
|
87
|
+
- `reviewRound`: Count previous `## 🤖 AI Implementation Review` comments on this PR:
|
|
88
|
+
- If 0 previous comments → **Round 1 (Initial Review)**
|
|
89
|
+
- If 1 previous comment → **Round 2 (Re-review)**
|
|
90
|
+
- If 2 previous comments → **Round 3 (Final Automated Round)**
|
|
91
|
+
- If 3+ previous comments → **ESCALATED TO HUMAN** (Anti-thrashing limit reached: do NOT post another review comment; set CI status to failure pointing to previous escalation).
|
|
92
|
+
- `lastReviewedSha`: Extracted from the `> **Commit SHA**:` line of the most recent AI review comment.
|
|
93
|
+
|
|
94
|
+
#### Repository Review Contract (`REVIEW.md`)
|
|
95
|
+
If a `REVIEW.md` exists on the base branch, parse and enforce its declared specifications:
|
|
96
|
+
- **What failure looks like**: Domain-specific definitions of defect (e.g., "for billing: currency precision loss; for router: unhandled 404 fallback").
|
|
97
|
+
- **Path Exclusions / Ignores**: Exclude auto-generated files, lockfiles, or fixture dumps from review scrutiny.
|
|
98
|
+
- **Non-Negotiable Invariants**: Explicit architectural rules that supersede generic style preferences.
|
|
99
|
+
|
|
100
|
+
#### Risk-Based Tiering
|
|
101
|
+
Classify the PR into one of three risk tiers based on files changed (**highest-risk file sets the PR tier**):
|
|
102
|
+
- **Tier 1 (Low Risk)**: Documentation, comments, copy, purely additive test fixtures, styling/CSS.
|
|
103
|
+
*Protocol*: Single-pass lightweight check for factual accuracy, typos, and broken links. Skip the AC Conformance Matrix unless specific ACs were defined in the spec.
|
|
104
|
+
- **Tier 2 (Standard Risk)**: Standard application features, domain services, UI state, API endpoints.
|
|
105
|
+
*Protocol*: Full 5-dimension review, AC Conformance Matrix, test fidelity check.
|
|
106
|
+
- **Tier 3 (High Risk)**: Auth/security, payment/billing, cryptography, DB migrations, core CI/governance engine, or **any PR modifying `REVIEW.md` or governance files**.
|
|
107
|
+
*Protocol*: Rigorous scrutiny, failure-mode analysis, strict zero-tolerance for untested edge cases, mandatory human lead sign-off. Flag governance modification explicitly in the review body.
|
|
108
|
+
|
|
109
|
+
#### Read Approved Spec Ground Truth
|
|
74
110
|
```bash
|
|
75
111
|
# Read the approved spec from the base branch
|
|
76
112
|
git show origin/<baseRefName>:openspec/changes/<CHANGE_ID>/specs/<capability>/spec.md
|
|
@@ -86,21 +122,70 @@ asdlc test <CHANGE_ID> --json
|
|
|
86
122
|
|
|
87
123
|
---
|
|
88
124
|
|
|
89
|
-
### Step 2:
|
|
125
|
+
### Step 2: Determine Diff Scope & Anti-Thrashing Protocol
|
|
126
|
+
|
|
127
|
+
To prevent infinite review-author thrashing and fatigue:
|
|
128
|
+
|
|
129
|
+
#### A. Diff-Only Re-Review (Rounds 2 & 3)
|
|
130
|
+
- **Round 1**: Inspect the full PR diff:
|
|
131
|
+
```bash
|
|
132
|
+
gh pr diff $PR_NUMBER --repo $REPO
|
|
133
|
+
```
|
|
134
|
+
- **Round 2+**: Inspect **ONLY** the incremental diff since the last reviewed commit:
|
|
135
|
+
```bash
|
|
136
|
+
# Ensure lastReviewedSha is available in shallow CI clones
|
|
137
|
+
git cat-file -e $lastReviewedSha^{commit} 2>/dev/null || \
|
|
138
|
+
git fetch origin $lastReviewedSha --depth=1 2>/dev/null || \
|
|
139
|
+
git fetch origin $baseRefName --depth=50 2>/dev/null || true
|
|
140
|
+
|
|
141
|
+
# Check for force-push / history rewrite:
|
|
142
|
+
# If lastReviewedSha is not an ancestor of headRefOid, reset to fresh Round 1 full diff
|
|
143
|
+
if ! git merge-base --is-ancestor $lastReviewedSha $headRefOid 2>/dev/null; then
|
|
144
|
+
echo "Force-push or rebase detected: commit history was rewritten. Resetting to full-diff review."
|
|
145
|
+
gh pr diff $PR_NUMBER --repo $REPO
|
|
146
|
+
else
|
|
147
|
+
git diff $lastReviewedSha...$headRefOid
|
|
148
|
+
fi
|
|
149
|
+
```
|
|
150
|
+
*Never re-review unchanged baseline code or lines previously deemed acceptable.*
|
|
151
|
+
|
|
152
|
+
#### B. Thread Resolution & Accounting
|
|
153
|
+
On re-reviews (Rounds 2 & 3), audit each previously reported Blocker and Major finding using stable IDs (`R1-#1`, `R1-#2`, `R2-#1`):
|
|
154
|
+
- **✅ Resolved**: Explicitly verified as fixed in the incremental diff.
|
|
155
|
+
- **⚠️ Disputed / Justified**: Author provided clear architectural justification or documented trade-off in PR comments.
|
|
156
|
+
- **❌ Unresolved**: Finding remains unaddressed without justification.
|
|
157
|
+
|
|
158
|
+
#### C. Class-of-Bug Grouping
|
|
159
|
+
Do not post 10 separate line comments for the same recurring pattern (e.g., missing timeout on HTTP requests or unhandled nulls).
|
|
160
|
+
Roll them up into a single finding citing all affected locations:
|
|
161
|
+
> *"Class of Bug: Missing timeoutMs on outbound fetch calls in 4 handlers (`api/users.ts:42`, `api/billing.ts:88`, ...)"*
|
|
162
|
+
|
|
163
|
+
#### D. No-Repeat Suppression
|
|
164
|
+
Do not re-surface previously posted findings unless the author explicitly claimed to fix them in the current commit and failed.
|
|
165
|
+
|
|
166
|
+
#### E. 3-Round Convergence Cap
|
|
167
|
+
If Round 3 completes with unresolved blockers:
|
|
168
|
+
- Set verdict to `⚠️ ESCALATED_TO_HUMAN`.
|
|
169
|
+
- Do not trigger further automated loops.
|
|
170
|
+
- Provide a concise summary of the impasse for the human lead.
|
|
90
171
|
|
|
91
|
-
|
|
172
|
+
---
|
|
173
|
+
|
|
174
|
+
### Step 3: Apply the Five Review Dimensions
|
|
175
|
+
|
|
176
|
+
Evaluate the diff against all five dimensions, informed by `REVIEW.md` and spec ground truth. Mark each `PASS`, `CONCERN`, or `FAIL`.
|
|
92
177
|
|
|
93
178
|
#### D1 — Spec Conformance (AC-by-AC)
|
|
94
|
-
- **Acceptance Test Gate**: Did `asdlc test <CHANGE_ID>` pass with exit code 0? If any mapped test failed or is missing, mark as **🔴 Blocker**.
|
|
179
|
+
- **Acceptance Test Gate**: Did `asdlc test <CHANGE_ID>` pass with exit code 0? If any mapped test failed or is missing, mark as **🔴 Blocker: Introduced**.
|
|
95
180
|
- For every `ACn:` in `specs/**/*.md`:
|
|
96
181
|
- Does the implementation satisfy the exact acceptance criterion as written?
|
|
97
182
|
- Is the behavior exercised in the mapped `(test: <path>)` test?
|
|
98
183
|
- Are there any requirements in the spec with **no implementation coverage**?
|
|
99
184
|
- Are there any implemented behaviors with **no corresponding AC** (scope creep)?
|
|
100
|
-
|
|
101
|
-
Flag scope creep as Major: it bypasses the governance gate and introduces untested surface area.
|
|
185
|
+
- Flag scope creep as Major: it bypasses the governance gate and introduces untested surface area.
|
|
102
186
|
|
|
103
187
|
#### D2 — Code Quality & Architecture
|
|
188
|
+
- **REVIEW.md Compliance**: Adheres to all repository-declared architectural invariants.
|
|
104
189
|
- **Deep modules**: Does each new module expose a simple interface hiding a complex interior? Flag shallow wrappers that leak implementation detail.
|
|
105
190
|
- **Single Responsibility**: Does each function / class do one thing? Flag functions mixing IO and business logic in the same body.
|
|
106
191
|
- **Error propagation**: Are errors surfaced explicitly (typed error objects or Result types), not swallowed silently?
|
|
@@ -112,7 +197,7 @@ Flag scope creep as Major: it bypasses the governance gate and introduces untest
|
|
|
112
197
|
- Are mocks **minimal and scoped**? A mock replacing an entire subsystem and always returning a happy-path fixture is a vacuous test.
|
|
113
198
|
- Does each test exercise the **failure path** as well as the happy path?
|
|
114
199
|
- Does `tasks.md` contain real test runner output for every `[x]` task (not just "✅ done")?
|
|
115
|
-
- Are edge cases from the spec
|
|
200
|
+
- Are edge cases from the spec each exercised by a distinct test case?
|
|
116
201
|
|
|
117
202
|
#### D4 — Production Readiness & Performance
|
|
118
203
|
- **NFRs met**: If the spec declares a latency SLA, is there a test or benchmark that fails when the SLA is violated?
|
|
@@ -128,31 +213,20 @@ Flag scope creep as Major: it bypasses the governance gate and introduces untest
|
|
|
128
213
|
|
|
129
214
|
---
|
|
130
215
|
|
|
131
|
-
### Step
|
|
216
|
+
### Step 4: Formulate Structural Findings with Defect Attribution
|
|
132
217
|
|
|
133
|
-
|
|
218
|
+
Every finding must follow a structured schema with explicit defect attribution so that findings are unambiguously actionable for both AI agents and human engineers:
|
|
134
219
|
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
Mark `❌ MISSING` for any AC whose implementation or test cannot be located in the diff.
|
|
140
|
-
|
|
141
|
-
---
|
|
142
|
-
|
|
143
|
-
### Step 4: Formulate Findings
|
|
144
|
-
|
|
145
|
-
Classify each finding:
|
|
146
|
-
|
|
147
|
-
- **🔴 Blocker** — AC not implemented, test always passes regardless of code, hard-coded secret, resource leak, spec-forbidden behavior present. Blocks merge.
|
|
148
|
-
- **🟡 Major** — Scope creep (code not covered by any AC), vacuous mock, missing timeout on upstream HTTP call, PII in logs.
|
|
149
|
-
- **🟢 Advisory** — Naming clarity, minor refactor opportunity, optional performance improvement.
|
|
220
|
+
- **🔴 [Blocker: Introduced]** — Broken AC, test cheating/vacuous mock, regression, hardcoded secret, or resource leak **introduced by this PR**. **Blocks merge.**
|
|
221
|
+
- **🟡 [Major: Introduced]** — Material defect introduced by this PR (scope creep, missing error handling, unhandled edge case). Requires resolution or author justification.
|
|
222
|
+
- **⚪ [Tech Debt: Pre-existing]** — Existing legacy codebase flaw or code smell observed in touched files but **not introduced by this PR**. **DOES NOT block merge.** Documented separately for backlog tracking.
|
|
223
|
+
- **🟢 [Advisory]** — Non-blocking suggestions for readability, naming clarity, or optional polish.
|
|
150
224
|
|
|
151
225
|
---
|
|
152
226
|
|
|
153
227
|
### Step 5: Post PR Comment
|
|
154
228
|
|
|
155
|
-
Compose the review
|
|
229
|
+
Compose the review markdown and post it as a PR comment using the GitHub API:
|
|
156
230
|
|
|
157
231
|
```bash
|
|
158
232
|
gh pr comment $PR_NUMBER --repo $REPO --body "$(cat <<'EOF'
|
|
@@ -167,8 +241,11 @@ Format the comment body strictly as:
|
|
|
167
241
|
## 🤖 AI Implementation Review — `<CHANGE_ID>`
|
|
168
242
|
|
|
169
243
|
> **Reviewer**: AI Independent Implementation Reviewer (`asdlc-impl-review`)
|
|
244
|
+
> **Commit SHA**: `<headRefOid>`
|
|
170
245
|
> **Base spec SHA**: `<specSha>`
|
|
171
|
-
> **
|
|
246
|
+
> **Risk Tier**: Tier 1 (Low) | Tier 2 (Standard) | Tier 3 (High)
|
|
247
|
+
> **Review Round**: Round 1 of 3 | Round 2 of 3 | Round 3 of 3 (Final)
|
|
248
|
+
> **Verdict**: ✅ APPROVE | 🔴 REQUEST_CHANGES | ⚠️ ESCALATED_TO_HUMAN
|
|
172
249
|
|
|
173
250
|
### Dimension Scores
|
|
174
251
|
|
|
@@ -181,21 +258,49 @@ Format the comment body strictly as:
|
|
|
181
258
|
| D5 Security & Secret Hygiene | ✅ / ⚠️ / ❌ | <one-line summary> |
|
|
182
259
|
|
|
183
260
|
### AC Conformance Matrix
|
|
261
|
+
<!-- For Tier 1 changes with no spec ACs, replace table with: "*Tier 1 change — AC Conformance Matrix omitted.*" -->
|
|
184
262
|
|
|
185
263
|
| AC | Spec Assertion | Implemented In | Test File | Status |
|
|
186
264
|
| :--- | :--- | :--- | :--- | :--- |
|
|
187
265
|
| AC1 | <assertion text> | src/<module>.ts | test/<feature>.test.ts | ✅ PASS |
|
|
188
266
|
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
267
|
+
<!-- On Rounds 2 and 3, include Thread Resolution Accounting -->
|
|
268
|
+
### 🔄 Re-Review Accounting (Round <round>)
|
|
269
|
+
| Finding ID | Previous Finding Summary | Status | Resolution / Author Rationale |
|
|
270
|
+
| :---: | :--- | :---: | :--- |
|
|
271
|
+
| `R1-#1` | Missing 5000ms timeout in fetch | ✅ Resolved | Added `AbortSignal.timeout(5000)` in `src/http.ts:24` |
|
|
272
|
+
| `R1-#2` | Scope creep helper `parseAmount` | ⚠️ Justified | Author rationale: Shared utility required for currency normalization |
|
|
273
|
+
|
|
274
|
+
### 🔴 Blocking Findings (Introduced)
|
|
275
|
+
<!-- Omit section if none. Use structural format for AI/Human clarity -->
|
|
276
|
+
- **ID**: `R<round>-#<num>`
|
|
277
|
+
- **Category**: `Spec Conformance` | `Code Quality` | `Test Fidelity` | `Production Readiness` | `Security`
|
|
278
|
+
- **Rule / AC**: `<ACn or REVIEW.md invariant or Dimension D1-D5>`
|
|
279
|
+
- **Location**: `<file>:<line-range>`
|
|
280
|
+
- **Defect**: `<concise statement of what is broken>`
|
|
281
|
+
- **Impact**: `<why this breaks correctness, security, or production>`
|
|
282
|
+
- **Action Required**: `<exact condition or code fix required to resolve>`
|
|
283
|
+
|
|
284
|
+
### 🟡 Major Findings (Introduced)
|
|
194
285
|
<!-- Omit section if none -->
|
|
195
|
-
|
|
286
|
+
- **ID**: `R<round>-#<num>`
|
|
287
|
+
- **Category**: `<category>`
|
|
288
|
+
- **Location**: `<file>:<line-range>`
|
|
289
|
+
- **Defect**: `<description>`
|
|
290
|
+
- **Impact**: `<impact>`
|
|
291
|
+
- **Action Required**: `<action required>`
|
|
292
|
+
|
|
293
|
+
### ⚪ Tech Debt: Pre-existing Codebase Observations
|
|
294
|
+
<!-- Non-blocking; omit section if none -->
|
|
295
|
+
- **ID**: `DEBT-#<num>`
|
|
296
|
+
- **Location**: `<file>:<line-range>`
|
|
297
|
+
- **Defect**: `<description of pre-existing legacy issue, untouched by PR>`
|
|
298
|
+
- **Attribution**: Pre-existing code untouched by this PR diff.
|
|
299
|
+
- **Status**: Non-blocking. Logged for tech debt backlog.
|
|
196
300
|
|
|
197
301
|
### 🟢 Advisory Notes
|
|
198
302
|
<!-- Omit section if none -->
|
|
303
|
+
1. **[Advisory]** <description>
|
|
199
304
|
|
|
200
305
|
---
|
|
201
306
|
*Human lead: review the findings above, then merge when satisfied. After merge, run `asdlc archive <CHANGE_ID>`.*
|
|
@@ -205,15 +310,16 @@ Format the comment body strictly as:
|
|
|
205
310
|
|
|
206
311
|
### Step 6: Set CI Status
|
|
207
312
|
|
|
208
|
-
After posting the comment:
|
|
313
|
+
After posting the comment, set the commit status check:
|
|
209
314
|
|
|
210
315
|
- **If APPROVE**: set CI check status to `success` (green). The PR is unblocked for lead approval and merge.
|
|
211
316
|
- **If REQUEST_CHANGES**: set CI check status to `failure` (red). The PR is blocked until blockers are resolved.
|
|
317
|
+
- **If ESCALATED_TO_HUMAN**: set CI check status to `failure` (red) with description noting human arbitration is required.
|
|
212
318
|
|
|
213
319
|
```bash
|
|
214
320
|
gh api repos/$REPO/statuses/$SHA \
|
|
215
321
|
-f state="success|failure" \
|
|
216
322
|
-f context="asdlc/impl-ai-review" \
|
|
217
|
-
-f description="AI Impl Review: APPROVE|REQUEST_CHANGES" \
|
|
323
|
+
-f description="AI Impl Review: APPROVE | REQUEST_CHANGES | ESCALATED_TO_HUMAN" \
|
|
218
324
|
-f target_url="$PR_URL"
|
|
219
325
|
```
|
|
@@ -15,19 +15,22 @@ This skill executes **Stage 2 (New)** of the Agentic SDLC. It transforms a natur
|
|
|
15
15
|
When the user invokes `/asdlc:new "<requirement>"`:
|
|
16
16
|
|
|
17
17
|
```powershell
|
|
18
|
-
asdlc new "<requirement>"
|
|
18
|
+
asdlc new "<requirement>" [--batch-grill] [--no-grill]
|
|
19
19
|
```
|
|
20
20
|
|
|
21
21
|
The CLI:
|
|
22
22
|
1. Derives a clean canonical slug (e.g. `jwt-authentication-payment-api` or content-hashed `change-<id>`).
|
|
23
23
|
2. Creates `openspec/changes/<SLUG>/`.
|
|
24
24
|
3. Runs Graphify queries using the extracted requirement terms to discover real codebase AST nodes and call chains.
|
|
25
|
-
4. Generates `explore.md` and seeds `clarifications.md
|
|
25
|
+
4. Generates `explore.md` and seeds `clarifications.md` configured for the chosen grilling mode:
|
|
26
|
+
- **Default (conversational)**: Runs high-signal, recommendation-led `grill-me` (1 material decision at a time).
|
|
27
|
+
- **`--batch-grill`**: Evaluates the entire design tree and presents the active frontier in structured batches.
|
|
28
|
+
- **`--no-grill`**: Bypasses interactive grilling for self-evident fixes and pre-aligned tasks.
|
|
26
29
|
5. **Technical Design Auto-Detection**: If the requirement touches UI/UX, frontend, APIs, services, databases, or architecture (or if `--design` is passed), seeds `design.md` with enterprise-grade technical design scaffolding.
|
|
27
30
|
|
|
28
31
|
> [!IMPORTANT]
|
|
29
32
|
> **NO PAUSE / CONTINUOUS EXECUTION**: Do NOT stop after `asdlc new` to ask the author "Should I start grilling?".
|
|
30
|
-
> You MUST proceed immediately to Step 2 and Step 3
|
|
33
|
+
> You MUST proceed immediately to Step 2 and Step 3 in the same turn!
|
|
31
34
|
> Only after `clarifications.md` has all questions settled may you draft `proposal.md`, `design.md`, and `specs/**`.
|
|
32
35
|
|
|
33
36
|
### Step 2: Ground Yourself in Codebase & External Context (Strict Order)
|
|
@@ -52,18 +55,25 @@ Follow this strict discovery sequence:
|
|
|
52
55
|
Tag any unverified external API assumptions, endpoints, schemas, or rate limits in `clarifications.md` and `design.md` with `[UNVERIFIED: <reason>]`.
|
|
53
56
|
These will be explicitly surfaced on the PR review by CI/D7 for mandatory human confirmation before merge.
|
|
54
57
|
|
|
55
|
-
### Step 3: Run the
|
|
56
|
-
Before authoring any spec markdown,
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
58
|
+
### Step 3: Run the Grilling Phase (Mode-Aware)
|
|
59
|
+
Before authoring any spec markdown, settle all open architectural questions into `clarifications.md`:
|
|
60
|
+
|
|
61
|
+
1. **If Mode is `interactive` (Default `grill-me`)**:
|
|
62
|
+
- Run conversational, recommendation-led grilling (skill: `grilling`).
|
|
63
|
+
- **Anti-Fatigue Guardrails**:
|
|
64
|
+
- *Codebase-first*: Never ask questions that can be answered by reading the code or AST.
|
|
65
|
+
- *Material forks only*: Ask only about real architectural trade-offs (e.g. storage options, error policies, backwards compatibility); decide implementation micro-details yourself.
|
|
66
|
+
- *Lead with recommendations*: Frame each question with a concrete recommended default and rationale (e.g. "Recommend Option A because... Agree, or prefer Option B?").
|
|
67
|
+
- *Early Exit*: Immediately halt questioning if the author says "proceed", "use defaults", or when open forks hit zero.
|
|
68
|
+
|
|
69
|
+
2. **If Mode is `batch` (`--batch-grill` passed)**:
|
|
70
|
+
- Run `batch-grill-me` protocol: evaluate the active decision frontier and present all independent trade-offs in one structured numbered batch with recommended options.
|
|
71
|
+
- Author approves all or adjusts specific choices.
|
|
72
|
+
|
|
73
|
+
3. **If Mode is `none` (`--no-grill` passed)**:
|
|
74
|
+
- Ground assumptions in AST / codebase facts, record context-inferred decisions in `clarifications.md`, leave open questions as none, and proceed directly to Step 4.
|
|
75
|
+
|
|
65
76
|
4. Record every agreed answer in `openspec/changes/<SLUG>/clarifications.md` under `## Settled decisions`.
|
|
66
|
-
5. If overrides unblock child questions, run Batch Round 2; otherwise close the interview.
|
|
67
77
|
|
|
68
78
|
### Step 4: Author Approved Intent Artifacts
|
|
69
79
|
Once `## Open questions` in `clarifications.md` is empty, author the change documents:
|
|
@@ -74,16 +84,24 @@ Once `## Open questions` in `clarifications.md` is empty, author the change docu
|
|
|
74
84
|
|
|
75
85
|
2. **`design.md` (Technical Design Document - Mandatory for UI & Complex Systems)**:
|
|
76
86
|
- When a change touches UI/frontend, external APIs, databases, or services, author `design.md` to define **HOW**:
|
|
77
|
-
- **Architecture & Component Interaction**:
|
|
78
|
-
|
|
79
|
-
- **
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
-
|
|
83
|
-
-
|
|
84
|
-
|
|
85
|
-
-
|
|
86
|
-
-
|
|
87
|
+
- **Architecture & Component Interaction**:
|
|
88
|
+
- Embed clean, self-contained Mermaid flowcharts, sequence diagrams, or state transitions directly in `design.md`. Keep diagrams focused on component boundaries, responsibilities, and request/response lifecycles.
|
|
89
|
+
- **Interface Contracts & Schemas (`api-design` recommended)**:
|
|
90
|
+
- Follow the `api-design` skill for RESTful conventions (plural nouns, kebab-case, hierarchical nesting, zero verbs in URLs).
|
|
91
|
+
- Specify exact TypeScript interfaces or JSON schemas for request/response payloads.
|
|
92
|
+
- Standardize on structured error envelopes (Stripe-style `{ error: { code, message, details } }` or RFC 7807 problem details `{ type, title, status, detail, instance }`). Never return `200 OK` with an error body.
|
|
93
|
+
- Define explicit pagination strategy: cursor-based (`cursor`, `limit`, `has_more`) or offset-based.
|
|
94
|
+
- **External API Integration & Resilience**:
|
|
95
|
+
- Endpoints, authentication, rate limits (`X-RateLimit-*`), client-level in-memory/TTL caching (never recreate clients per request).
|
|
96
|
+
- Mutating endpoints must specify `Idempotency-Key` header with deduplication cache.
|
|
97
|
+
- Error taxonomy, fallback degradation, and exponential backoff retry with jitter.
|
|
98
|
+
- **Security & Operational NFRs (Optional / When Applicable)**: Document authentication, boundary validation, secret lifecycles, and performance budgets/quotas when the architecture demands them.
|
|
99
|
+
- **UI/UX Design Specifications (`frontend-design` & Vercel Guidelines)**:
|
|
100
|
+
- **Anti-AI Slop Mandate**: Zero tolerance for cliché glowing cards, arbitrary gradient text highlights, uniform pill buttons, or monotonous card grids.
|
|
101
|
+
- **Design Direction & Subject Grounding**: Real subject matter, vernacular, and domain tone (e.g., high-density analytical dashboard vs consumer app). Link to mockup, brand tokens, or benchmark URL.
|
|
102
|
+
- **Concrete Palettes & Typography**: 4–6 deliberate Hex color tokens (`--color-primary`, `--color-background`, `--color-surface`, etc.) and distinct font pairings (heading + body) with WCAG AA/AAA contrast.
|
|
103
|
+
- **Hero Treatment & Layout**: Opening hero element, responsive breakpoints (Mobile <= 640px, Tablet 641-1024px, Desktop > 1024px).
|
|
104
|
+
- **5 Mandatory States**: Default, Hover/Focus (150-200ms ease, `:focus-visible`), Loading Skeleton (never blank screens), Empty State with prompt, Error Banner with retry.
|
|
87
105
|
|
|
88
106
|
3. **`specs/<capability>/spec.md`**:
|
|
89
107
|
- `## Purpose`: Clear capability statement (50+ chars).
|
|
@@ -46,10 +46,20 @@ If any check outputs `[FAIL]`:
|
|
|
46
46
|
- **`BDD + AC`**: An acceptance criterion points to a test file that does not exist. Create the missing test file.
|
|
47
47
|
- **`external` (unit tests)**: Run the failing test command, debug the failure, fix the code, and re-run.
|
|
48
48
|
|
|
49
|
-
### Step 3:
|
|
49
|
+
### Step 3: Next Actions (Depending on Lifecycle Stage)
|
|
50
50
|
When all checks output `[PASS]` and verify succeeds:
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
>
|
|
51
|
+
|
|
52
|
+
- **Scenario A: Pre-PR Local Implementation Verification (Stage 6)**
|
|
53
|
+
If running on a feature branch before opening the Implementation PR:
|
|
54
|
+
Inform the developer:
|
|
55
|
+
> "🎉 Local verification passed! All 12 gates satisfied.
|
|
56
|
+
> When you are ready to submit this implementation for CI AI review and team approval, run:
|
|
57
|
+
> `asdlc pr <CHANGE_ID> <targetBranch>` (or trigger `/asdlc:pr`).
|
|
58
|
+
> *(The agent will NOT automatically open a PR without your explicit command).* "
|
|
59
|
+
|
|
60
|
+
- **Scenario B: Post-Merge Trunk Verification (Stage 6 -> Stage 7)**
|
|
61
|
+
If running after the Implementation PR has been approved and merged into the protected target branch (`main`):
|
|
62
|
+
Inform the developer:
|
|
63
|
+
> "🎉 Post-merge verification passed! All 12 gates verified on the target branch.
|
|
64
|
+
> To close out and archive this change into the master specification catalog, run:
|
|
65
|
+
> `asdlc archive <CHANGE_ID>` (or trigger `/asdlc:archive`)."
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: batch-grill-me
|
|
3
|
-
description: "A relentless design-tree interview that
|
|
3
|
+
description: "A relentless design-tree interview that evaluates the active frontier and asks questions in structured batches with recommended defaults and non-blocking fact discovery. Invoked via asdlc new --batch-grill or /batch-grill-me."
|
|
4
4
|
aliases:
|
|
5
5
|
- grilling
|
|
6
6
|
- grill-me
|
|
@@ -8,7 +8,7 @@ aliases:
|
|
|
8
8
|
|
|
9
9
|
# Batch Grilling — Relentless Design-Tree Interview (`batch-grill-me`)
|
|
10
10
|
|
|
11
|
-
This skill drives the **Grilling phase** (Stage 2) of the Agentic SDLC
|
|
11
|
+
This skill drives the **Grilling phase** (Stage 2) of the Agentic SDLC when invoked in batch mode (via `asdlc new "<requirement>" --batch-grill` or `/batch-grill-me`). For interactive 1-by-1 dialogue, use `/grill-me`.
|
|
12
12
|
|
|
13
13
|
Interview the author relentlessly until you reach a shared understanding. Map the requirement as a **design tree**: every decision branches into the decisions that hang off it.
|
|
14
14
|
|
|
@@ -24,11 +24,16 @@ Interview the author relentlessly until you reach a shared understanding. Map th
|
|
|
24
24
|
|
|
25
25
|
- Never ask child or grandchild questions whose parent decision is still open in the current round.
|
|
26
26
|
- If Question C1 asks *"Should we support internationalization (en + zh)?"*, you **CANNOT** ask *"Which fields should be translated?"* or *"What format should the message catalog use?"* in the same round! Those depend on C1 being answered.
|
|
27
|
-
- Asking child questions prematurely forces you to guess at parent answers, which leads directly to pseudo-questions and fake choices. Hold them for
|
|
27
|
+
- Asking child questions prematurely forces you to guess at parent answers, which leads directly to pseudo-questions and fake choices. Hold them for later rounds.
|
|
28
28
|
|
|
29
29
|
3. **Dynamic Tree Reshaping.**
|
|
30
30
|
Each round the author answers reshapes the tree — settled decisions push the frontier outward and unblock questions that depended on them. Recompute the frontier and ask the next round.
|
|
31
31
|
|
|
32
|
+
4. **Early Exit / Fast-Forward Protocol**:
|
|
33
|
+
If the author says:
|
|
34
|
+
- *"Approve all recommendations"* / *"Proceed with defaults"* / *"LGTM"*
|
|
35
|
+
The agent must **immediately halt questioning**, resolve any remaining open decisions using its stated engineering recommendations, write them into `clarifications.md`, and proceed directly to drafting `proposal.md` and `specs/**`.
|
|
36
|
+
|
|
32
37
|
---
|
|
33
38
|
|
|
34
39
|
## 2. Fact-Finding vs. Human Decisions
|
|
@@ -113,7 +118,7 @@ Active Frontier: <N> independent decisions ready for resolution.
|
|
|
113
118
|
|
|
114
119
|
---
|
|
115
120
|
|
|
116
|
-
💡 *To proceed efficiently, reply **"Approve all recommendations"**,
|
|
121
|
+
💡 *To proceed efficiently, reply **"Approve all recommendations"**, specify adjustments (e.g. `Q1: B, Q2: accept`), or type "proceed with defaults".*
|
|
117
122
|
```
|
|
118
123
|
|
|
119
124
|
---
|
|
@@ -123,8 +128,7 @@ Active Frontier: <N> independent decisions ready for resolution.
|
|
|
123
128
|
The session is done when the **frontier is empty**:
|
|
124
129
|
1. Every branch of the design tree has been visited.
|
|
125
130
|
2. Nothing is left silently assumed.
|
|
126
|
-
3.
|
|
127
|
-
4. Record all settled decisions in `openspec/changes/<SLUG>/clarifications.md`:
|
|
131
|
+
3. Record all settled decisions in `openspec/changes/<SLUG>/clarifications.md`:
|
|
128
132
|
```markdown
|
|
129
133
|
## Settled decisions
|
|
130
134
|
|
|
@@ -133,4 +137,4 @@ The session is done when the **frontier is empty**:
|
|
|
133
137
|
- **<Decision 2 Title>**: <Chosen Option>
|
|
134
138
|
- *Rationale*: <Why this was chosen>
|
|
135
139
|
```
|
|
136
|
-
|
|
140
|
+
4. Only after `clarifications.md` is settled may you transition to authoring `proposal.md` and `specs/**`.
|