@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,214 @@
|
|
|
1
|
+
---
|
|
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."
|
|
4
|
+
aliases:
|
|
5
|
+
- impl-review
|
|
6
|
+
- code-review-asdlc
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# /asdlc:impl-review — CI-Triggered Independent Implementation Reviewer
|
|
10
|
+
|
|
11
|
+
This skill executes **independent AI implementation review**, triggered by CI when a PR carries the `asdlc:impl-review` label.
|
|
12
|
+
It posts its findings as a **markdown PR comment** via the GitHub API so the human lead sees them inline on the PR.
|
|
13
|
+
|
|
14
|
+
It applies the **Player ≠ Referee** principle: the reviewing agent MUST NOT be the agent that authored the implementation.
|
|
15
|
+
|
|
16
|
+
> [!IMPORTANT]
|
|
17
|
+
> **Scope**: Reviews *implementation conformance and code quality* — spec adherence, test rigor, architecture, and production safety.
|
|
18
|
+
> Requires `asdlc verify <CHANGE_ID>` to have passed (12 gates) before this review is meaningful.
|
|
19
|
+
> Does NOT re-run `asdlc verify`. Does NOT review spec intent — that is `asdlc-spec-review`.
|
|
20
|
+
> Output is a **PR comment**, not a local file.
|
|
21
|
+
|
|
22
|
+
---
|
|
23
|
+
|
|
24
|
+
## Trigger
|
|
25
|
+
|
|
26
|
+
This skill is invoked by CI when a PR is labeled `asdlc:impl-review`. The typical invocation in a GitHub Actions workflow or Jenkinsfile:
|
|
27
|
+
|
|
28
|
+
```yaml
|
|
29
|
+
# GitHub Actions example
|
|
30
|
+
- name: AI Implementation Review
|
|
31
|
+
if: contains(github.event.pull_request.labels.*.name, 'asdlc:impl-review')
|
|
32
|
+
env:
|
|
33
|
+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
34
|
+
PR_NUMBER: ${{ github.event.pull_request.number }}
|
|
35
|
+
REPO: ${{ github.repository }}
|
|
36
|
+
run: |
|
|
37
|
+
# Agent CLI / SDK invokes this skill with: /asdlc:impl-review $PR_NUMBER $REPO
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
```groovy
|
|
41
|
+
// Jenkinsfile example
|
|
42
|
+
stage('Implementation AI Review') {
|
|
43
|
+
when { expression { env.IS_IMPL == 'true' } }
|
|
44
|
+
steps {
|
|
45
|
+
withCredentials([string(credentialsId: 'github-token', variable: 'GH_TOKEN')]) {
|
|
46
|
+
sh "${env.ASDLC} impl-review --pr ${env.PR_NUMBER} --repo ${env.REPO}"
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
---
|
|
53
|
+
|
|
54
|
+
## Workflow Sequence
|
|
55
|
+
|
|
56
|
+
### Step 1: Acquire PR Context
|
|
57
|
+
|
|
58
|
+
Run the following commands to collect everything needed for review:
|
|
59
|
+
|
|
60
|
+
```bash
|
|
61
|
+
# List changed files and metadata
|
|
62
|
+
gh pr view $PR_NUMBER --repo $REPO --json title,body,baseRefName,headRefName,files
|
|
63
|
+
|
|
64
|
+
# Read the full implementation diff
|
|
65
|
+
gh pr diff $PR_NUMBER --repo $REPO
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
Extract from the PR body or branch:
|
|
69
|
+
- `CHANGE_ID` from the `**Change ID**:` field or branch name
|
|
70
|
+
- `specSha` from `.openspec.yaml` (read from the base branch or PR file list)
|
|
71
|
+
|
|
72
|
+
Then read the approved spec to use as ground truth:
|
|
73
|
+
|
|
74
|
+
```bash
|
|
75
|
+
# Read the approved spec from the base branch
|
|
76
|
+
git show origin/<baseRefName>:openspec/changes/<CHANGE_ID>/specs/<capability>/spec.md
|
|
77
|
+
git show origin/<baseRefName>:openspec/changes/<CHANGE_ID>/tasks.md
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
> [!NOTE]
|
|
81
|
+
> Read the **spec first**, then the implementation diff. The spec is the ground truth; the code is the candidate.
|
|
82
|
+
|
|
83
|
+
---
|
|
84
|
+
|
|
85
|
+
### Step 2: Apply the Five Review Dimensions
|
|
86
|
+
|
|
87
|
+
Evaluate the full diff against all five dimensions. Mark each `PASS`, `CONCERN`, or `FAIL`.
|
|
88
|
+
|
|
89
|
+
#### D1 — Spec Conformance (AC-by-AC)
|
|
90
|
+
For every `ACn:` in `specs/**/*.md`:
|
|
91
|
+
- Does the implementation satisfy the exact acceptance criterion as written?
|
|
92
|
+
- Is the behavior exercised in the mapped `(test: <path>)` test?
|
|
93
|
+
- Are there any requirements in the spec with **no implementation coverage**?
|
|
94
|
+
- Are there any implemented behaviors with **no corresponding AC** (scope creep)?
|
|
95
|
+
|
|
96
|
+
Flag scope creep as Major: it bypasses the governance gate and introduces untested surface area.
|
|
97
|
+
|
|
98
|
+
#### D2 — Code Quality & Architecture
|
|
99
|
+
- **Deep modules**: Does each new module expose a simple interface hiding a complex interior? Flag shallow wrappers that leak implementation detail.
|
|
100
|
+
- **Single Responsibility**: Does each function / class do one thing? Flag functions mixing IO and business logic in the same body.
|
|
101
|
+
- **Error propagation**: Are errors surfaced explicitly (typed error objects or Result types), not swallowed silently?
|
|
102
|
+
- **Dead code**: Flag any commented-out or unreachable production code.
|
|
103
|
+
- **Naming**: Are names precise and consistent with the spec's domain language (enum values, field names, error codes defined in the spec)?
|
|
104
|
+
|
|
105
|
+
#### D3 — Test Fidelity & TDD Evidence
|
|
106
|
+
- Are tests **behavior-driven**, not implementation-driven? (Assert observable outputs for given inputs, not call order or internal state)
|
|
107
|
+
- Are mocks **minimal and scoped**? A mock replacing an entire subsystem and always returning a happy-path fixture is a vacuous test.
|
|
108
|
+
- Does each test exercise the **failure path** as well as the happy path?
|
|
109
|
+
- Does `tasks.md` contain real test runner output for every `[x]` task (not just "✅ done")?
|
|
110
|
+
- Are edge cases from the spec (e.g. rainy-day ranking, high-temp advisory, upstream-API-unavailable fallback) each exercised by a distinct test case?
|
|
111
|
+
|
|
112
|
+
#### D4 — Production Readiness & Performance
|
|
113
|
+
- **NFRs met**: If the spec declares a latency SLA, is there a test or benchmark that fails when the SLA is violated?
|
|
114
|
+
- **Resource leaks**: Are HTTP connections, file handles, and streams properly closed?
|
|
115
|
+
- **Retry / timeout**: Are upstream HTTP calls wrapped with timeouts to prevent hanging?
|
|
116
|
+
- **Observability**: Are structured log statements present at entry and exit of key operations? Are PII fields excluded from logs?
|
|
117
|
+
|
|
118
|
+
#### D5 — Security & Secret Hygiene
|
|
119
|
+
- Are there any hard-coded credentials, API keys, or tokens in the diff?
|
|
120
|
+
- Is user-supplied input sanitized before being passed to external API query parameters or shell commands?
|
|
121
|
+
- Are error messages free of internal stack traces or system paths that would leak to end users?
|
|
122
|
+
- Is any new HTTP endpoint protected from excessively large or malformed payloads?
|
|
123
|
+
|
|
124
|
+
---
|
|
125
|
+
|
|
126
|
+
### Step 3: Build the AC Conformance Matrix
|
|
127
|
+
|
|
128
|
+
For each `ACn:` in the approved spec, produce one row:
|
|
129
|
+
|
|
130
|
+
| AC | Spec Assertion | Implemented In | Test File | Status |
|
|
131
|
+
| :--- | :--- | :--- | :--- | :--- |
|
|
132
|
+
| AC1 | <assertion text> | src/<module>.ts | test/<feature>.test.ts | ✅ PASS / ❌ MISSING |
|
|
133
|
+
|
|
134
|
+
Mark `❌ MISSING` for any AC whose implementation or test cannot be located in the diff.
|
|
135
|
+
|
|
136
|
+
---
|
|
137
|
+
|
|
138
|
+
### Step 4: Formulate Findings
|
|
139
|
+
|
|
140
|
+
Classify each finding:
|
|
141
|
+
|
|
142
|
+
- **🔴 Blocker** — AC not implemented, test always passes regardless of code, hard-coded secret, resource leak, spec-forbidden behavior present. Blocks merge.
|
|
143
|
+
- **🟡 Major** — Scope creep (code not covered by any AC), vacuous mock, missing timeout on upstream HTTP call, PII in logs.
|
|
144
|
+
- **🟢 Advisory** — Naming clarity, minor refactor opportunity, optional performance improvement.
|
|
145
|
+
|
|
146
|
+
---
|
|
147
|
+
|
|
148
|
+
### Step 5: Post PR Comment
|
|
149
|
+
|
|
150
|
+
Compose the review as markdown and post it as a PR comment using the GitHub API:
|
|
151
|
+
|
|
152
|
+
```bash
|
|
153
|
+
gh pr comment $PR_NUMBER --repo $REPO --body "$(cat <<'EOF'
|
|
154
|
+
<review-markdown>
|
|
155
|
+
EOF
|
|
156
|
+
)"
|
|
157
|
+
```
|
|
158
|
+
|
|
159
|
+
Format the comment body strictly as:
|
|
160
|
+
|
|
161
|
+
~~~markdown
|
|
162
|
+
## 🤖 AI Implementation Review — `<CHANGE_ID>`
|
|
163
|
+
|
|
164
|
+
> **Reviewer**: AI Independent Implementation Reviewer (`asdlc-impl-review`)
|
|
165
|
+
> **Base spec SHA**: `<specSha>`
|
|
166
|
+
> **Verdict**: ✅ APPROVE | 🔴 REQUEST_CHANGES
|
|
167
|
+
|
|
168
|
+
### Dimension Scores
|
|
169
|
+
|
|
170
|
+
| Dimension | Rating | Key Finding |
|
|
171
|
+
| :--- | :---: | :--- |
|
|
172
|
+
| D1 Spec Conformance | ✅ PASS / ⚠️ CONCERN / ❌ FAIL | <one-line summary> |
|
|
173
|
+
| D2 Code Quality & Architecture | ✅ / ⚠️ / ❌ | <one-line summary> |
|
|
174
|
+
| D3 Test Fidelity & TDD Evidence | ✅ / ⚠️ / ❌ | <one-line summary> |
|
|
175
|
+
| D4 Production Readiness | ✅ / ⚠️ / ❌ | <one-line summary> |
|
|
176
|
+
| D5 Security & Secret Hygiene | ✅ / ⚠️ / ❌ | <one-line summary> |
|
|
177
|
+
|
|
178
|
+
### AC Conformance Matrix
|
|
179
|
+
|
|
180
|
+
| AC | Spec Assertion | Implemented In | Test File | Status |
|
|
181
|
+
| :--- | :--- | :--- | :--- | :--- |
|
|
182
|
+
| AC1 | <assertion text> | src/<module>.ts | test/<feature>.test.ts | ✅ PASS |
|
|
183
|
+
|
|
184
|
+
### 🔴 Blocking Findings
|
|
185
|
+
<!-- Omit section if none -->
|
|
186
|
+
1. **[Blocker]** `<file>:<line-range>` — AC<n>: <description of gap or violation>
|
|
187
|
+
|
|
188
|
+
### 🟡 Major Findings
|
|
189
|
+
<!-- Omit section if none -->
|
|
190
|
+
1. **[Major]** <description>
|
|
191
|
+
|
|
192
|
+
### 🟢 Advisory Notes
|
|
193
|
+
<!-- Omit section if none -->
|
|
194
|
+
|
|
195
|
+
---
|
|
196
|
+
*Human lead: review the findings above, then merge when satisfied. After merge, run `asdlc archive <CHANGE_ID>`.*
|
|
197
|
+
~~~
|
|
198
|
+
|
|
199
|
+
---
|
|
200
|
+
|
|
201
|
+
### Step 6: Set CI Status
|
|
202
|
+
|
|
203
|
+
After posting the comment:
|
|
204
|
+
|
|
205
|
+
- **If APPROVE**: set CI check status to `success` (green). The PR is unblocked for lead approval and merge.
|
|
206
|
+
- **If REQUEST_CHANGES**: set CI check status to `failure` (red). The PR is blocked until blockers are resolved.
|
|
207
|
+
|
|
208
|
+
```bash
|
|
209
|
+
gh api repos/$REPO/statuses/$SHA \
|
|
210
|
+
-f state="success|failure" \
|
|
211
|
+
-f context="asdlc/impl-ai-review" \
|
|
212
|
+
-f description="AI Impl Review: APPROVE|REQUEST_CHANGES" \
|
|
213
|
+
-f target_url="$PR_URL"
|
|
214
|
+
```
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: asdlc-init
|
|
3
|
+
description: "Initialize an enterprise repository for Agentic SDLC: setup OpenSpec, Graphify code AST graph, governance policies, CI pipelines, and bundled skills."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# /asdlc:init - Repository Initialization & Tooling Setup
|
|
7
|
+
|
|
8
|
+
This skill executes **Stage 1 (Init)** of the Agentic SDLC. It transitions an unmanaged or standard codebase into an enterprise-governed agentic repository.
|
|
9
|
+
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
## What this skill does
|
|
13
|
+
|
|
14
|
+
1. **Detects Environment**: Inspects the repository type (Node, Python, Go, Java) and active agent toolchains (`.agents`, `.claude`, `.opencode`, Cursor, etc.).
|
|
15
|
+
2. **Confirms CI Strategy**: Prompts the developer whether to generate a CI gate pipeline (`--ci jenkins`).
|
|
16
|
+
3. **Executes `asdlc init`**: Runs the CLI initialization command to install:
|
|
17
|
+
- The pinned OpenSpec engine (as devDependency)
|
|
18
|
+
- Graphify code knowledge graph engine
|
|
19
|
+
- Enterprise managed schema (`agentic-repo-change`)
|
|
20
|
+
- Platform governance policy (`.sdlc/policy.yaml`)
|
|
21
|
+
- Git hook guards (`.githooks/` for pre-push and post-merge)
|
|
22
|
+
- Bundled IDE skills (`grilling`, `asdlc-apply`, and `/asdlc:*` suite)
|
|
23
|
+
- Context routing layer (`AGENTS.md`)
|
|
24
|
+
4. **Validates Health**: Automatically runs `asdlc doctor` to ensure zero configuration drifts.
|
|
25
|
+
|
|
26
|
+
---
|
|
27
|
+
|
|
28
|
+
## Workflow Sequence
|
|
29
|
+
|
|
30
|
+
### Step 1: Inquire CI & Setup Preferences
|
|
31
|
+
Ask the user if they want automated Jenkins CI gate pipeline generation:
|
|
32
|
+
- Standard: `asdlc init`
|
|
33
|
+
- With Jenkins CI: `asdlc init --ci jenkins`
|
|
34
|
+
|
|
35
|
+
### Step 2: Execute Initialization
|
|
36
|
+
Run in the repository root:
|
|
37
|
+
|
|
38
|
+
```powershell
|
|
39
|
+
asdlc init --ci jenkins
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
Parse output and verify:
|
|
43
|
+
- `installed openspec` (pinned engine)
|
|
44
|
+
- `installed managed schema v1`
|
|
45
|
+
- `wrote governance config (openspec/config.yaml)`
|
|
46
|
+
- `installed .githooks`
|
|
47
|
+
- `installed bundled skills -> .agents/skills/`
|
|
48
|
+
- `built graphify code graph -> graphify-out/`
|
|
49
|
+
- `refreshed AGENTS.md`
|
|
50
|
+
|
|
51
|
+
### Step 3: Run Environment Health Check
|
|
52
|
+
Execute:
|
|
53
|
+
|
|
54
|
+
```powershell
|
|
55
|
+
asdlc doctor
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
Verify that all checks are `[PASS]`:
|
|
59
|
+
- Node version >= 20.19
|
|
60
|
+
- OpenSpec CLI present
|
|
61
|
+
- Managed schema installed centrally
|
|
62
|
+
- `.sdlc/policy.yaml` present
|
|
63
|
+
- `AGENTS.md` routing valid
|
|
64
|
+
|
|
65
|
+
### Step 4: Next Steps Orientation
|
|
66
|
+
Inform the developer:
|
|
67
|
+
> "Repository successfully initialized with Agentic SDLC governance! To start your first feature, run:
|
|
68
|
+
> `/asdlc:new \"<your feature requirement>\"`"
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: asdlc-lint
|
|
3
|
+
description: "Verify spec quality against deterministic BDD, Acceptance Criteria, and review rules (R0-R8). Iteratively diagnose and fix blocking findings before opening the spec PR."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# /asdlc:lint - Deterministic Spec Quality Gate
|
|
7
|
+
|
|
8
|
+
This skill executes **Stage 3 (Lint)** of the Agentic SDLC. It ensures that the change artifacts (`proposal.md`, `specs/**/*.md`, `review.md`) meet enterprise BDD, traceability, and review standards before creating a Pull Request.
|
|
9
|
+
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
## What this skill checks
|
|
13
|
+
|
|
14
|
+
The linter evaluates spec text with pure deterministic rules (no LLM jitter):
|
|
15
|
+
- **`R0-no-requirements`**: Must contain at least one `### Requirement:`.
|
|
16
|
+
- **`R1-purpose`**: Capability `## Purpose` must be at least 50 characters.
|
|
17
|
+
- **`R2-normative`**: Every requirement must contain a normative statement using `SHALL` or `MUST`.
|
|
18
|
+
- **`R3-scenario`**: Every requirement must have at least one `#### Scenario:`.
|
|
19
|
+
- **`R4-when / R4-then / R4-given`**: Every scenario must follow BDD structure with **WHEN**, **THEN**, and **GIVEN**.
|
|
20
|
+
- **`R5-ac`**: Every requirement must have an Acceptance Criteria block (`- [ ] AC1: ...`).
|
|
21
|
+
- **`R6-ac-test`**: Every acceptance criterion must map to an explicit test file path (`(test: <path>)`).
|
|
22
|
+
- **`R7-test-strategy`**: Must contain a non-empty `## Test Strategy` section.
|
|
23
|
+
- **`R8-removed-reason`**: Any requirement under `## REMOVED Requirements` must document a `**Reason**`.
|
|
24
|
+
- **Review Status**: If `review.md` is present, it must have `## Verdict: APPROVE` and zero blocking findings. (On pre-merge branches, `review.md` is pending human PR review and is automatically generated upon `asdlc approve`).
|
|
25
|
+
|
|
26
|
+
---
|
|
27
|
+
|
|
28
|
+
## Workflow Sequence
|
|
29
|
+
|
|
30
|
+
### Step 1: Execute `asdlc lint` with JSON Output
|
|
31
|
+
Run:
|
|
32
|
+
|
|
33
|
+
```powershell
|
|
34
|
+
asdlc lint <CHANGE_ID> --json
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
Parse the JSON output:
|
|
38
|
+
- `pass`: Boolean indicating overall pass or failure.
|
|
39
|
+
- `results`: Detailed breakdown per rule and artifact file.
|
|
40
|
+
|
|
41
|
+
### Step 2: Handle Blocking Findings (If Failed)
|
|
42
|
+
If `pass` is false:
|
|
43
|
+
1. Group findings by file (`specs/<capability>/spec.md` or `review.md`).
|
|
44
|
+
2. For each blocking finding:
|
|
45
|
+
- Identify the exact section and requirement name.
|
|
46
|
+
- Explain the rule violation in plain language.
|
|
47
|
+
- Propose the exact markdown fix (e.g. adding `**WHEN** / **THEN**`, converting prose to normative `SHALL`, or adding `(test: path/to/test)`).
|
|
48
|
+
3. Apply the edits directly to the spec files.
|
|
49
|
+
4. Re-run `asdlc lint <CHANGE_ID> --json` to verify that blockers reach zero.
|
|
50
|
+
|
|
51
|
+
### Step 3: Lint Complete (Self-Review Passed)
|
|
52
|
+
When `pass` is true (`0 blockers`):
|
|
53
|
+
Report to the author that the spec is structurally valid, fully traceable, and passes all BDD/acceptance criteria checks:
|
|
54
|
+
|
|
55
|
+
> "Spec lint passed with 0 blocking issues. The spec is ready for PR. When you are ready to submit it for review, use `asdlc pr <CHANGE_ID> <targetBranch>`."
|
|
56
|
+
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: asdlc-new
|
|
3
|
+
description: "Start a new spec-driven change: derives change slug from natural language requirement, grounds in knowledge graph (explore.md), runs batch-grill-me interview, and drafts initial proposal and spec deltas."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# /asdlc:new - Start Feature & Batch-Grill Author
|
|
7
|
+
|
|
8
|
+
This skill executes **Stage 2 (New)** of the Agentic SDLC. It transforms a natural language requirement into an approved intent change package (`proposal.md`, `specs/**`, `review.md`).
|
|
9
|
+
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
## Workflow Sequence
|
|
13
|
+
|
|
14
|
+
### Step 1: Scaffold Change & Refresh Graph
|
|
15
|
+
When the user invokes `/asdlc:new "<requirement>"`:
|
|
16
|
+
|
|
17
|
+
```powershell
|
|
18
|
+
asdlc new "<requirement>"
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
The CLI:
|
|
22
|
+
1. Derives a clean canonical slug (e.g. `jwt-authentication-payment-api` or content-hashed `change-<id>`).
|
|
23
|
+
2. Creates `openspec/changes/<SLUG>/`.
|
|
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`.
|
|
26
|
+
|
|
27
|
+
> [!IMPORTANT]
|
|
28
|
+
> **NO PAUSE / CONTINUOUS EXECUTION**: Do NOT stop after `asdlc new` to ask the author "Should I start grilling?".
|
|
29
|
+
> You MUST proceed immediately to Step 2 and Step 3 (**batch-grill-me** interview) in the same turn!
|
|
30
|
+
> Only after `clarifications.md` has all questions settled may you draft `proposal.md` and `specs/**`.
|
|
31
|
+
|
|
32
|
+
### Step 2: Ground Yourself in Codebase & External Context (Strict Order)
|
|
33
|
+
Follow this strict discovery sequence:
|
|
34
|
+
1. **Local Graph & Workspace First (Primary)**:
|
|
35
|
+
- Read `openspec/changes/<SLUG>/explore.md`.
|
|
36
|
+
- Note the **Architectural Hubs (god nodes)** that this change touches.
|
|
37
|
+
- Review existing functions, types, and exported symbols. Never guess: ground internal assumptions in real paths from `explore.md`.
|
|
38
|
+
2. **Targeted External Search (Secondary & Conditional)**:
|
|
39
|
+
- If the requirement references 3rd-party APIs, vendor SDKs, protocols, or external library specs:
|
|
40
|
+
Execute a targeted web/doc search for authoritative facts (if `web_search: allow` in `.sdlc/policy.yaml`).
|
|
41
|
+
- **Non-blocking failure tolerance**: If external search fails (offline, rate limited, network timeout), **DO NOT BLOCK**. Emit `[WARN] External search failed: <reason>; proceeding with local context`, record unverified assumptions in `clarifications.md`, and proceed immediately.
|
|
42
|
+
|
|
43
|
+
### Step 3: Run the `batch-grill-me` Interview
|
|
44
|
+
Before authoring any spec markdown, run the **`batch-grill-me`** protocol:
|
|
45
|
+
1. Evaluate the entire open decision frontier for this feature.
|
|
46
|
+
2. Present all architectural forks and boundary questions in **one structured batch**:
|
|
47
|
+
- Number each question (`Q1`, `Q2`, `Q3`...).
|
|
48
|
+
- Provide concrete options (A / B / C).
|
|
49
|
+
- Supply a fact-backed **Recommended Default** grounded in codebase evidence.
|
|
50
|
+
3. Invite the author to batch-approve (`"Approve all recommendations"`) or provide selective overrides.
|
|
51
|
+
4. Record every agreed answer in `openspec/changes/<SLUG>/clarifications.md` under `## Settled decisions`.
|
|
52
|
+
5. If overrides unblock child questions, run Batch Round 2; otherwise close the interview.
|
|
53
|
+
|
|
54
|
+
### Step 4: Author Approved Intent Artifacts
|
|
55
|
+
Once `## Open questions` in `clarifications.md` is empty, author the change documents:
|
|
56
|
+
|
|
57
|
+
1. **`proposal.md`**:
|
|
58
|
+
- Sections: `## Why`, `## What Changes`, `## Capabilities`, `## Impact`, `## Out of Scope`, `## Dependencies & Assumptions`.
|
|
59
|
+
- 1-2 pages maximum. Focus on **WHY**, not code implementation details.
|
|
60
|
+
2. **`specs/<capability>/spec.md`**:
|
|
61
|
+
- `## Purpose`: Clear capability statement (50+ chars).
|
|
62
|
+
- `## ADDED Requirements`:
|
|
63
|
+
- Every requirement: `### Requirement: <name>` using **SHALL** or **MUST**.
|
|
64
|
+
- Every requirement has `#### Scenario: <name>` with **GIVEN / WHEN / THEN**.
|
|
65
|
+
- Every requirement has an `**Acceptance criteria**` block:
|
|
66
|
+
`- [ ] AC1: <concrete testable assertion> (test: <path/to/test>)`
|
|
67
|
+
- `## Constraints & NFRs`: Verifiable performance/security statements.
|
|
68
|
+
- `## Out of Scope` and `## Test Strategy`.
|
|
69
|
+
3. **`review.md`**:
|
|
70
|
+
- Run an independent review pass and stamp `## Verdict: APPROVE`.
|
|
71
|
+
|
|
72
|
+
### Step 5: Transition to Lint
|
|
73
|
+
Once artifacts are written, guide the developer:
|
|
74
|
+
> "Artifacts drafted! Now run `/asdlc:lint <SLUG>` to verify BDD scenarios and acceptance criteria before opening the spec PR."
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: asdlc-pr
|
|
3
|
+
description: "Open a Spec or Implementation PR: pre-flight checks (lint vs verify), git pushing, auto-extract title/body, and attach labels (asdlc:spec-review vs asdlc:impl-review) for CI AI review."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# /asdlc:pr - Automated Pull Request Engine (Spec & Implementation)
|
|
7
|
+
|
|
8
|
+
This skill opens a **Spec PR** (Stage 3) or an **Implementation PR** (Stage 6.5) with deterministic pre-flight quality gates and distinct labels for CI AI review triggers.
|
|
9
|
+
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
## Command
|
|
13
|
+
|
|
14
|
+
```powershell
|
|
15
|
+
asdlc pr <CHANGE_ID> <targetBranch>
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
- `<targetBranch>`: Target branch to merge into (e.g. `main`, `develop`, `release/*`). Required.
|
|
19
|
+
- Zero manual flags: `asdlc pr` automatically detects whether to open a Spec PR or an Implementation PR.
|
|
20
|
+
|
|
21
|
+
---
|
|
22
|
+
|
|
23
|
+
## Dual-PR Lifecycle & Pre-flight Gates
|
|
24
|
+
|
|
25
|
+
| PR Type | Phase & Moment | Pre-Flight Guard | Auto Labels | CI Automation Trigger |
|
|
26
|
+
| :--- | :--- | :--- | :--- | :--- |
|
|
27
|
+
| **Spec PR** | Stage 3 (After drafting proposal & specs) | **`asdlc lint <ID>`**<br>(0 blocking BDD/AC issues) | `asdlc:spec-review`<br>`spec` | Runs `asdlc lint` + triggers **Spec AI Review** |
|
|
28
|
+
| **Impl PR** | Stage 6.5 (After TDD apply & tasks complete) | **`asdlc verify <ID>`**<br>(12 deterministic gates pass) | `asdlc:impl-review`<br>`impl` | Runs `asdlc verify` + triggers **Code AI Review** |
|
|
29
|
+
|
|
30
|
+
---
|
|
31
|
+
|
|
32
|
+
## Execution Pipeline
|
|
33
|
+
|
|
34
|
+
1. **Auto-Detection (Spec PR vs Implementation PR)**:
|
|
35
|
+
`asdlc pr` inspects the state machine deterministically without requiring manual flags:
|
|
36
|
+
- **Detected as Implementation PR (`impl`) if ANY of these conditions match**:
|
|
37
|
+
- `.openspec.yaml` has `status: ready_for_impl` or a locked `specSha`.
|
|
38
|
+
- Spec intent commit is already merged on `<targetBranch>`.
|
|
39
|
+
- Branch name starts with `impl/`.
|
|
40
|
+
- Source code changes exist outside `openspec/changes/<slug>/` and tasks in `tasks.md` are marked complete.
|
|
41
|
+
- **Detected as Spec PR (`spec`) otherwise**:
|
|
42
|
+
- Spec artifacts (`proposal.md`, `specs/**`) are in drafting/review stage before approval.
|
|
43
|
+
|
|
44
|
+
2. **Pre-flight Quality Gate**:
|
|
45
|
+
- **Spec PR**: runs `asdlc lint <ID>`. Fails fast if any blocking BDD or acceptance criteria findings exist.
|
|
46
|
+
- **Impl PR**: runs `asdlc verify <ID>`. Fails fast if any of the 12 verification checks fail.
|
|
47
|
+
|
|
48
|
+
3. **Title & Body Extraction**:
|
|
49
|
+
- **Spec PR**: derives clean title (`spec(<slug>): <title>`) and embeds proposal intent.
|
|
50
|
+
- **Impl PR**: derives title (`impl(<slug>): <title>`) and embeds completed tasks, TDD evidence, and spec intent.
|
|
51
|
+
|
|
52
|
+
4. **Commit & Push**: Stages changes, commits with standard prefix, and pushes branch to origin.
|
|
53
|
+
|
|
54
|
+
5. **Creation Strategy & Self-Healing Label Guarantee**:
|
|
55
|
+
- **JIT Label Provisioning**: Before creating or editing the PR, `asdlc pr` provisions required governance labels on remote (`asdlc:spec-review` + `spec` or `asdlc:impl-review` + `impl`). This prevents GitHub from dropping labels or failing PR creation.
|
|
56
|
+
- **Tier 1 (CLI)**: Executes `gh pr create` with both labels (`--label asdlc:spec-review,spec`). If a PR for the branch already exists, detects it and runs `gh pr edit --add-label` to ensure labels are attached.
|
|
57
|
+
- **Tier 2 (Direct REST API)**: Pre-creates labels via GitHub API and attaches them to the PR issue.
|
|
58
|
+
- **Tier 3 (Browser Fallback)**: Generates a 1-click comparison URL pre-filled with branch and label query parameters.
|
|
59
|
+
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: asdlc-review
|
|
3
|
+
description: "[DORMANT / CI-MANAGED] Spec review is executed automatically by CI on PRs (leaving comments and summary directly on GitHub/GitLab). Local review.md generation is dormant."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# /asdlc:review - Independent Spec Review (Dormant / CI-Managed)
|
|
7
|
+
|
|
8
|
+
> [!NOTE]
|
|
9
|
+
> **Workflow Update**: Local generation of `review.md` is **dormant**.
|
|
10
|
+
> Spec quality and 6-dimension reviews are executed automatically by the **CI AI Reviewer Action** on Spec PRs.
|
|
11
|
+
> Feedback and ratings are posted directly as PR comments/summaries to facilitate Human TL Review.
|
|
12
|
+
|
|
13
|
+
This skill is retained for reference or manual pre-PR dry runs if requested. When invoked, it switches into the **Independent Reviewer** role (Player ≠ Referee). The reviewer MUST NOT be the authoring agent.
|
|
14
|
+
|
|
15
|
+
---
|
|
16
|
+
|
|
17
|
+
## Review Dimensions
|
|
18
|
+
|
|
19
|
+
Every change is evaluated along six dimensions:
|
|
20
|
+
|
|
21
|
+
1. **Completeness**: Are all user journeys covered? Are edge cases, error conditions, and nil/empty inputs handled?
|
|
22
|
+
2. **Ambiguity**: Are requirements clear and unambiguous? Does each use strict normative language (`SHALL` / `MUST`) rather than passive voice?
|
|
23
|
+
3. **Cross-repo consistency**: Does this change break or impact cross-repo API/event contracts? If so, is a System Design Amendment required?
|
|
24
|
+
4. **Contract impact**: Are breaking changes flagged with `**BREAKING**` in `proposal.md`? Are backwards compatibility guarantees documented?
|
|
25
|
+
5. **Testability**: Does every requirement have verifiable Acceptance Criteria (`AC<n>`) with concrete test paths?
|
|
26
|
+
6. **Security**: Are authentication, authorization, input validation, secret hygiene, and data privacy respected?
|
|
27
|
+
|
|
28
|
+
---
|
|
29
|
+
|
|
30
|
+
## Workflow Sequence
|
|
31
|
+
|
|
32
|
+
### Step 1: Read Change Context (Read-Only)
|
|
33
|
+
Inspect all intent files under `openspec/changes/<CHANGE_ID>/`:
|
|
34
|
+
- `proposal.md`
|
|
35
|
+
- `specs/**/*.md`
|
|
36
|
+
- `explore.md`
|
|
37
|
+
|
|
38
|
+
### Step 2: Formulate Findings
|
|
39
|
+
Categorize findings by severity:
|
|
40
|
+
- **Blocker**: Spec violation, missing acceptance criteria, untestable assertion, or security risk.
|
|
41
|
+
- **Major**: Ambiguous scenario, missing `**GIVEN**`, or unaddressed edge cases.
|
|
42
|
+
- **Minor / Advisory**: Documentation clarity, style suggestions.
|
|
43
|
+
|
|
44
|
+
### Step 3: Author `review.md`
|
|
45
|
+
Write `openspec/changes/<CHANGE_ID>/review.md` with the following structure:
|
|
46
|
+
|
|
47
|
+
```markdown
|
|
48
|
+
# Review: <CHANGE_ID>
|
|
49
|
+
|
|
50
|
+
## Summary
|
|
51
|
+
<2-3 sentences summarizing the change and the evaluation outcome>
|
|
52
|
+
|
|
53
|
+
## Dimensions Evaluation
|
|
54
|
+
- Completeness: PASS | CONCERN | FAIL
|
|
55
|
+
- Ambiguity: PASS | CONCERN | FAIL
|
|
56
|
+
- Cross-repo consistency: PASS | CONCERN | FAIL
|
|
57
|
+
- Contract impact: PASS | CONCERN | FAIL
|
|
58
|
+
- Testability: PASS | CONCERN | FAIL
|
|
59
|
+
- Security: PASS | CONCERN | FAIL
|
|
60
|
+
|
|
61
|
+
## Requirement -> Implementation -> Test Traceability
|
|
62
|
+
| Requirement | Acceptance Criteria | Target Test | Status |
|
|
63
|
+
|---|---|---|---|
|
|
64
|
+
| Req 1 | AC1: ... | test/foo.test.js | VERIFIED |
|
|
65
|
+
|
|
66
|
+
## Blocking Findings
|
|
67
|
+
(none)
|
|
68
|
+
<!-- Or list: 1. [Blocker] <description> -->
|
|
69
|
+
|
|
70
|
+
## Advisory Notes
|
|
71
|
+
<Optional recommendations>
|
|
72
|
+
|
|
73
|
+
## Verdict
|
|
74
|
+
APPROVE
|
|
75
|
+
<!-- Or: NEEDS_REVISION -->
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
### Step 4: Next Steps
|
|
79
|
+
- If verdict is `APPROVE`: Guide the author to run `/asdlc:lint <CHANGE_ID>` and submit the Spec PR.
|
|
80
|
+
- If verdict is `NEEDS_REVISION`: List blocking items that the spec author must address.
|