@akjamie/agentic-sdlc 1.9.1 → 1.9.3
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/README.md +3 -3
- package/assets/skills/asdlc-impl-review/SKILL.md +27 -14
- package/assets/skills/asdlc-lint/SKILL.md +5 -2
- package/assets/skills/asdlc-pr/SKILL.md +8 -7
- package/assets/skills/asdlc-spec-review/SKILL.md +15 -6
- package/package.json +1 -1
- package/src/commands/pr.js +11 -15
- package/src/commands/skills.js +10 -2
- package/src/commands/verify.js +5 -4
- package/src/lib/tools.js +11 -1
- package/assets/skills/asdlc-review/SKILL.md +0 -80
package/README.md
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
# agentic-sdlc
|
|
2
2
|
|
|
3
3
|
[](https://www.npmjs.com/package/@akjamie/agentic-sdlc)
|
|
4
|
-
[](package.json)
|
|
5
5
|
[](LICENSE)
|
|
6
6
|
[](https://nodejs.org/)
|
|
7
|
-
[](#development--verification)
|
|
8
8
|
[](#adaptive-risk-tiered-governance-l0l3)
|
|
9
9
|
|
|
10
10
|
> **The Intelligent Governance Engine for Autonomous AI Coding.**
|
|
@@ -371,7 +371,7 @@ git clone https://github.com/akjamie/agentic-sdlc.git
|
|
|
371
371
|
cd agentic-sdlc
|
|
372
372
|
npm install
|
|
373
373
|
|
|
374
|
-
# Run complete test suite (
|
|
374
|
+
# Run complete test suite (213 tests passing, 100% pass rate)
|
|
375
375
|
npm test
|
|
376
376
|
|
|
377
377
|
# Run end-to-end multi-language simulation tests
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: asdlc-impl-review
|
|
3
|
-
description: "
|
|
3
|
+
description: "Comprehensive code review & independent implementation review (Stage 6.5). Evaluates any PR, code review request, or local change for spec conformance, bug classes, code quality, test fidelity, and production readiness. Triggers on 'review PR', 'code review', 'impl review', PR URLs (https://github.com/.../pull/...), PR numbers (#N), or local CHANGE_ID. Supports standalone PR-only review without requiring local repo checkout or OpenSpec artifacts."
|
|
4
4
|
aliases:
|
|
5
5
|
- impl-review
|
|
6
6
|
- code-review-asdlc
|
|
7
|
+
- pr-review
|
|
8
|
+
- code-review
|
|
7
9
|
---
|
|
8
10
|
|
|
9
11
|
# /asdlc:impl-review — Independent Implementation Review Agent
|
|
@@ -26,16 +28,21 @@ Drawing from Anthropic's engineering practices for scaling AI code reviews, this
|
|
|
26
28
|
|
|
27
29
|
> [!IMPORTANT]
|
|
28
30
|
> **Scope**: Reviews *implementation conformance and code quality* — spec adherence, test rigor, architecture, and production safety.
|
|
29
|
-
>
|
|
31
|
+
> When reviewing an OpenSpec change, requires `asdlc test <CHANGE_ID>` and `asdlc verify <CHANGE_ID>` to have passed before this review can issue an APPROVE verdict. For standalone PRs without OpenSpec artifacts, checks CI status (`gh pr checks`) and test coverage directly.
|
|
30
32
|
> Does NOT review spec intent — that is `asdlc-spec-review`.
|
|
33
|
+
>
|
|
34
|
+
> **Output Routing Contract (PR vs. Local)**:
|
|
35
|
+
> - **PR Mode** (invoked with a PR URL, PR number, or via CI PR trigger): **Post the review comment directly to the PR** via `gh pr comment` — **NEVER pause to ask the user whether to post comments**.
|
|
36
|
+
> - **Local Mode** (invoked with `<CHANGE_ID>` only, no PR context): **Print the formatted review report directly** in your response; do NOT run `gh pr comment`.
|
|
31
37
|
|
|
32
38
|
---
|
|
33
39
|
|
|
34
40
|
## Invocation & Triggers
|
|
35
41
|
|
|
36
42
|
This skill can be invoked:
|
|
37
|
-
1. **
|
|
38
|
-
2. **
|
|
43
|
+
1. **Interactive Prompt**: Whenever the user asks to "review PR", "code review", "review this PR", passes a GitHub/GitLab PR URL (`https://github.com/owner/repo/pull/123`), or gives a PR number (`#123`).
|
|
44
|
+
2. **Locally by an independent agent**: `/asdlc:impl-review <CHANGE_ID>` or `/asdlc:impl-review <PR_URL>`
|
|
45
|
+
3. **Automatically on PRs** carrying the `asdlc:impl-review` label via PR automation workflows:
|
|
39
46
|
|
|
40
47
|
```yaml
|
|
41
48
|
# GitHub Actions / PR Automation example
|
|
@@ -96,19 +103,21 @@ Classify the PR into one of three risk tiers based on files changed (**highest-r
|
|
|
96
103
|
- **Tier 3 (High Risk)**: Auth/security, payment/billing, cryptography, DB migrations, core CI/governance engine, or **any PR modifying `REVIEW.md` or governance files**.
|
|
97
104
|
*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.
|
|
98
105
|
|
|
99
|
-
#### Read Approved Spec Ground Truth
|
|
106
|
+
#### Read Approved Spec Ground Truth (if available)
|
|
100
107
|
```bash
|
|
101
|
-
# Read the approved spec from the base branch
|
|
102
|
-
git show origin/<baseRefName>:openspec/changes/<CHANGE_ID>/specs/<capability>/spec.md
|
|
103
|
-
git show origin/<baseRefName>:openspec/changes/<CHANGE_ID>/tasks.md
|
|
108
|
+
# Read the approved spec from the base branch (when CHANGE_ID / OpenSpec is used)
|
|
109
|
+
git show origin/<baseRefName>:openspec/changes/<CHANGE_ID>/specs/<capability>/spec.md 2>/dev/null || true
|
|
110
|
+
git show origin/<baseRefName>:openspec/changes/<CHANGE_ID>/tasks.md 2>/dev/null || true
|
|
104
111
|
|
|
105
|
-
# Execute Acceptance Tests in CI (Player != Referee gate)
|
|
106
|
-
asdlc test <CHANGE_ID> --json
|
|
112
|
+
# Execute Acceptance Tests in CI (Player != Referee gate) when local checkout and asdlc are available
|
|
113
|
+
asdlc test <CHANGE_ID> --json 2>/dev/null || true
|
|
107
114
|
```
|
|
108
115
|
|
|
109
116
|
> [!NOTE]
|
|
110
|
-
>
|
|
111
|
-
>
|
|
117
|
+
> **OpenSpec vs. Standalone PR Mode**:
|
|
118
|
+
> - If the repository uses OpenSpec / changesets (`openspec/changes/<CHANGE_ID>`), read the **spec first**, then the implementation diff. The spec is the ground truth; the code is the candidate.
|
|
119
|
+
> - If this is a standalone PR without OpenSpec artifacts or local clone (e.g. reviewed via PR URL only), derive requirements directly from the PR title, PR description, linked issue context, and repository `REVIEW.md` contract. Lack of an OpenSpec `CHANGE_ID` **NEVER blocks** reviewing the PR.
|
|
120
|
+
> - Enforce **Player ≠ Referee**: When local checkout exists, CI executes `asdlc test <CHANGE_ID> --json` independently rather than trusting claims in `tasks.md`. In standalone PR-only mode, inspect CI test run checks via `gh pr checks $PR_NUMBER --repo $REPO`.
|
|
112
121
|
|
|
113
122
|
---
|
|
114
123
|
|
|
@@ -214,9 +223,11 @@ Every finding must follow a structured schema with explicit defect attribution s
|
|
|
214
223
|
|
|
215
224
|
---
|
|
216
225
|
|
|
217
|
-
### Step 5: Post PR Comment
|
|
226
|
+
### Step 5: Deliver Review (Post PR Comment or Print Locally)
|
|
218
227
|
|
|
219
|
-
Compose the review markdown
|
|
228
|
+
Compose the review using the markdown format below, then deliver it according to the invocation mode:
|
|
229
|
+
|
|
230
|
+
- **If reviewing a PR** (PR URL, PR number, or CI PR trigger): **Post the comment directly** without asking the user for confirmation:
|
|
220
231
|
|
|
221
232
|
```bash
|
|
222
233
|
gh pr comment $PR_NUMBER --repo $REPO --body "$(cat <<'EOF'
|
|
@@ -225,6 +236,8 @@ EOF
|
|
|
225
236
|
)"
|
|
226
237
|
```
|
|
227
238
|
|
|
239
|
+
- **If reviewing locally** (`<CHANGE_ID>` only, no PR): **Print the formatted review markdown directly** in your response and skip `gh pr comment` and Step 6.
|
|
240
|
+
|
|
228
241
|
Format the comment body strictly as:
|
|
229
242
|
|
|
230
243
|
~~~markdown
|
|
@@ -53,7 +53,10 @@ If `pass` is false:
|
|
|
53
53
|
|
|
54
54
|
### Step 3: Lint Complete (Self-Review Passed)
|
|
55
55
|
When `pass` is true (`0 blockers`):
|
|
56
|
-
Report to the author that the spec is structurally valid, fully traceable, and passes all BDD/acceptance criteria checks:
|
|
56
|
+
Report to the author that the spec is structurally valid, fully traceable, and passes all BDD/acceptance criteria checks, then guide them based on the change's governance track (`asdlc status <CHANGE_ID>`):
|
|
57
57
|
|
|
58
|
-
|
|
58
|
+
- **Track A (Dual-PR — L2 / L3 or `spec-first`)**:
|
|
59
|
+
> "Spec lint passed with 0 blocking issues. Open the Spec PR with `asdlc pr <CHANGE_ID> [targetBranch]`."
|
|
60
|
+
- **Track B (Single-PR — L0 / L1 under `supervised` or `auto`)**:
|
|
61
|
+
> "Spec lint passed with 0 blocking issues. In Single-PR mode, no separate Spec PR or `asdlc approve` is needed — draft `tasks.md` and run `asdlc apply <CHANGE_ID>` to start TDD."
|
|
59
62
|
|
|
@@ -12,20 +12,20 @@ This skill opens a **Spec PR** (Stage 3) or an **Implementation PR** (Stage 6.5)
|
|
|
12
12
|
## Command
|
|
13
13
|
|
|
14
14
|
```powershell
|
|
15
|
-
asdlc pr <CHANGE_ID>
|
|
15
|
+
asdlc pr <CHANGE_ID> [targetBranch]
|
|
16
16
|
```
|
|
17
17
|
|
|
18
|
-
-
|
|
19
|
-
- Zero manual flags: `asdlc pr` automatically detects whether to open a Spec PR or an Implementation PR.
|
|
18
|
+
- `[targetBranch]`: Target branch to merge into (e.g. `main`, `master`, `develop`). Optional — defaults to `.openspec.yaml`'s `targetBranch` or the repository's default branch (`resolveDefaultBranch`).
|
|
19
|
+
- Zero manual flags: `asdlc pr` automatically detects whether to open a Spec PR (Track A) or an Implementation / Single PR (Track A/B).
|
|
20
20
|
|
|
21
21
|
---
|
|
22
22
|
|
|
23
|
-
##
|
|
23
|
+
## Two-Track Lifecycle & Pre-flight Gates
|
|
24
24
|
|
|
25
|
-
| PR Type |
|
|
25
|
+
| PR Type | Track & Moment | Pre-Flight Guard | Auto Labels | Review Automation Trigger |
|
|
26
26
|
| :--- | :--- | :--- | :--- | :--- |
|
|
27
|
-
| **Spec PR** | Stage 3 (
|
|
28
|
-
| **Impl PR** | Stage 6.5 (
|
|
27
|
+
| **Spec PR** | **Track A** Stage 3 (L2/L3/`spec-first` after drafting proposal & specs) | **`asdlc lint <ID>`**<br>(0 blocking BDD/AC issues) | `asdlc:spec-review`<br>`spec` | Runs `asdlc lint` + routes to **Independent Spec AI Review** (`asdlc-spec-review`) |
|
|
28
|
+
| **Impl / Single PR** | **Track A** Stage 6.5 or **Track B** (L0/L1 Single-PR after TDD & tasks complete) | **`asdlc verify <ID>`**<br>(12 deterministic gates pass) | `asdlc:impl-review`<br>`impl` | Runs `asdlc verify` + routes to **Independent Impl AI Review** (`asdlc-impl-review`) |
|
|
29
29
|
|
|
30
30
|
---
|
|
31
31
|
|
|
@@ -37,6 +37,7 @@ asdlc pr <CHANGE_ID> <targetBranch>
|
|
|
37
37
|
- `.openspec.yaml` has `status: ready_for_impl` or a locked `specSha`.
|
|
38
38
|
- Spec intent commit is already merged on `<targetBranch>`.
|
|
39
39
|
- Branch name starts with `impl/`.
|
|
40
|
+
- Single-PR change (`L0`/`L1` under `supervised`/`auto`) with source code changes outside `openspec/changes/<slug>/`.
|
|
40
41
|
- Source code changes exist outside `openspec/changes/<slug>/` and tasks in `tasks.md` are marked complete.
|
|
41
42
|
- **Detected as Spec PR (`spec`) otherwise**:
|
|
42
43
|
- Spec artifacts (`proposal.md`, `specs/**`) are in drafting/review stage before approval.
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: asdlc-spec-review
|
|
3
|
-
description: "Independent AI Spec Review (Stage 3)
|
|
3
|
+
description: "Independent AI Spec & Architecture Review (Stage 3). Evaluates a spec PR, RFC, design doc, proposal.md, or OpenSpec change for completeness, ambiguity, contradiction, testability, and security before human TL approval. Triggers on 'review spec', 'review proposal', 'spec review', or Spec PRs carrying the 'asdlc:spec-review' label. Accepts a GitHub PR URL or local CHANGE_ID."
|
|
4
4
|
aliases:
|
|
5
5
|
- spec-review
|
|
6
|
+
- proposal-review
|
|
6
7
|
---
|
|
7
8
|
|
|
8
9
|
# /asdlc:spec-review — Independent Spec Review Agent
|
|
@@ -16,15 +17,19 @@ It applies the **Player ≠ Referee** principle: the reviewing agent MUST NOT be
|
|
|
16
17
|
> **Scope**: Reviews *intent* — BDD quality, logical consistency, architectural soundness, AC testability.
|
|
17
18
|
> Does NOT re-run `asdlc lint` (deterministic structural checks are already gated by `asdlc pr`).
|
|
18
19
|
> Does NOT review implementation code — that is `asdlc-impl-review`.
|
|
19
|
-
>
|
|
20
|
+
>
|
|
21
|
+
> **Output Routing Contract (PR vs. Local)**:
|
|
22
|
+
> - **PR Mode** (invoked with a PR URL, PR number, or via CI PR trigger): **Post the review comment directly to the PR** via `gh pr comment` — **NEVER pause to ask the user whether to post comments**.
|
|
23
|
+
> - **Local Mode** (invoked with `<CHANGE_ID>` only, no PR context): **Print the formatted review report directly** in your response; do NOT run `gh pr comment`.
|
|
20
24
|
|
|
21
25
|
---
|
|
22
26
|
|
|
23
27
|
## Invocation & Triggers
|
|
24
28
|
|
|
25
29
|
This skill can be invoked:
|
|
26
|
-
1. **
|
|
27
|
-
2. **
|
|
30
|
+
1. **Interactive Prompt**: Whenever the user asks to "review spec", "review proposal", "review design", "review RFC", or provides a Spec PR URL.
|
|
31
|
+
2. **Locally by an independent agent**: `/asdlc:spec-review <CHANGE_ID>`
|
|
32
|
+
3. **Automatically on PRs** carrying the `asdlc:spec-review` label via PR automation workflows:
|
|
28
33
|
|
|
29
34
|
```yaml
|
|
30
35
|
# GitHub Actions / PR Automation example
|
|
@@ -121,9 +126,11 @@ Classify each finding:
|
|
|
121
126
|
|
|
122
127
|
---
|
|
123
128
|
|
|
124
|
-
### Step 5: Post PR Comment
|
|
129
|
+
### Step 5: Deliver Review (Post PR Comment or Print Locally)
|
|
125
130
|
|
|
126
|
-
Compose the review
|
|
131
|
+
Compose the review using the markdown format below, then deliver it according to the invocation mode:
|
|
132
|
+
|
|
133
|
+
- **If reviewing a PR** (PR URL, PR number, or CI PR trigger): **Post the comment directly** without asking the user for confirmation:
|
|
127
134
|
|
|
128
135
|
```bash
|
|
129
136
|
gh pr comment $PR_NUMBER --repo $REPO --body "$(cat <<'EOF'
|
|
@@ -132,6 +139,8 @@ EOF
|
|
|
132
139
|
)"
|
|
133
140
|
```
|
|
134
141
|
|
|
142
|
+
- **If reviewing locally** (`<CHANGE_ID>` only, no PR): **Print the formatted review markdown directly** in your response and skip `gh pr comment` and Step 6.
|
|
143
|
+
|
|
135
144
|
Format the comment body strictly as:
|
|
136
145
|
|
|
137
146
|
~~~markdown
|
package/package.json
CHANGED
package/src/commands/pr.js
CHANGED
|
@@ -4,15 +4,14 @@ import { execFileSync } from 'node:child_process';
|
|
|
4
4
|
import { exists, readText, writeText } from '../lib/fs.js';
|
|
5
5
|
import { changeDir } from '../lib/paths.js';
|
|
6
6
|
import { requireRepo, toChangeSlug } from '../lib/cliutil.js';
|
|
7
|
-
import { git, isGitRepo, changeOnRef, lastCommitTouching, safeCommit } from '../lib/git.js';
|
|
7
|
+
import { git, isGitRepo, changeOnRef, lastCommitTouching, safeCommit, resolveDefaultBranch } from '../lib/git.js';
|
|
8
8
|
import { loadPolicy, matchesAny } from '../lib/policy.js';
|
|
9
9
|
import { runLint } from './lint.js';
|
|
10
10
|
import { runVerify } from './verify.js';
|
|
11
11
|
import { fail } from '../lib/errors.js';
|
|
12
12
|
import { log } from '../lib/log.js';
|
|
13
13
|
import { assess, renderLabels, renderPRComment } from '../assess/index.js';
|
|
14
|
-
import { readEffectiveLevel } from '../lib/level.js';
|
|
15
|
-
import { resolveWorkflowMode } from '../lib/config.js';
|
|
14
|
+
import { readEffectiveLevel, resolveTopology } from '../lib/level.js';
|
|
16
15
|
|
|
17
16
|
const SAFE_ENV_TEMPLATE_RE = /(^|\/)\.env\.(example|sample|template|defaults|schema)$/i;
|
|
18
17
|
const SENSITIVE_OR_DUMP_PATTERNS = [
|
|
@@ -129,13 +128,6 @@ export async function createPR(changeId, targetBranch, opts = {}) {
|
|
|
129
128
|
const repoRoot = requireRepo(opts);
|
|
130
129
|
if (!isGitRepo(repoRoot)) fail('not a git repository');
|
|
131
130
|
|
|
132
|
-
if (!targetBranch) {
|
|
133
|
-
fail('target branch is required (e.g. `asdlc pr <changeId> main` or `asdlc pr <changeId> develop`)', {
|
|
134
|
-
code: 'MISSING_TARGET_BRANCH',
|
|
135
|
-
hint: 'specify the base branch to merge into: asdlc pr <changeId> <targetBranch>',
|
|
136
|
-
});
|
|
137
|
-
}
|
|
138
|
-
|
|
139
131
|
const slug = toChangeSlug(changeId);
|
|
140
132
|
const cdir = changeDir(repoRoot, slug);
|
|
141
133
|
if (!exists(cdir)) fail(`change '${slug}' not found`);
|
|
@@ -143,6 +135,11 @@ export async function createPR(changeId, targetBranch, opts = {}) {
|
|
|
143
135
|
// Detect PR type 100% automatically (Spec PR vs Impl PR)
|
|
144
136
|
const metaPath = path.join(cdir, '.openspec.yaml');
|
|
145
137
|
const metaText = exists(metaPath) ? readText(metaPath) : '';
|
|
138
|
+
const tbMatch = metaText.match(/^\s*targetBranch:\s*['"]?([^\s'"]+)['"]?\s*$/m);
|
|
139
|
+
const metaTargetBranch = tbMatch ? tbMatch[1] : null;
|
|
140
|
+
if (!targetBranch) {
|
|
141
|
+
targetBranch = metaTargetBranch || resolveDefaultBranch(repoRoot).replace(/^origin\//, '');
|
|
142
|
+
}
|
|
146
143
|
const statusMatch = metaText.match(/^\s*status:\s*['"]?([^\s'"]+)['"]?\s*$/m);
|
|
147
144
|
const changeStatus = statusMatch ? statusMatch[1].toLowerCase() : '';
|
|
148
145
|
const shaMatch = metaText.match(/^\s*specSha:\s*['"]?([^\s'"]+)['"]?\s*$/m);
|
|
@@ -172,10 +169,9 @@ export async function createPR(changeId, targetBranch, opts = {}) {
|
|
|
172
169
|
const allPotentialFiles = [...diffFilesPre, ...uncommittedFiles];
|
|
173
170
|
const hasSourceChanges = allPotentialFiles.some((f) => !f.startsWith(`openspec/changes/${slug}/`));
|
|
174
171
|
|
|
175
|
-
const
|
|
176
|
-
const
|
|
177
|
-
const
|
|
178
|
-
const isSinglePr = (changeLevel === 'L0' || changeLevel === 'L1') && resolvedMode !== 'spec-first' && !metaText.match(/^\s*workflowMode:\s*['"]?spec-first['"]?/m);
|
|
172
|
+
const topology = resolveTopology({ repoRoot, slug, baseRef: targetBranch, cliMode: opts.mode });
|
|
173
|
+
const resolvedMode = topology.mode;
|
|
174
|
+
const isSinglePr = topology.isSinglePr;
|
|
179
175
|
|
|
180
176
|
let prType;
|
|
181
177
|
if (opts.type) {
|
|
@@ -598,7 +594,7 @@ export function parseRemoteUrl(url, opts = {}) {
|
|
|
598
594
|
|
|
599
595
|
export function register(program) {
|
|
600
596
|
program
|
|
601
|
-
.command('pr <changeId>
|
|
597
|
+
.command('pr <changeId> [targetBranch]')
|
|
602
598
|
.description('automatically open a Spec or Implementation PR: auto-detects stage, pre-flight checks, pushes branch, and attaches labels for CI AI review')
|
|
603
599
|
.option('--mode <mode>', 'workflow mode: supervised (default) | spec-first | auto')
|
|
604
600
|
.option('--repo-root <path>')
|
package/src/commands/skills.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import path from 'node:path';
|
|
2
2
|
import os from 'node:os';
|
|
3
3
|
import fs from 'node:fs';
|
|
4
|
-
import { exists, listDir, readText, copyTree, ensureDir } from '../lib/fs.js';
|
|
4
|
+
import { exists, listDir, readText, copyTree, ensureDir, removeDir } from '../lib/fs.js';
|
|
5
5
|
import { skillsAssetDir, resolveRepoRoot, openspecDir } from '../lib/paths.js';
|
|
6
6
|
import { detectTools, installSkills } from './init.js';
|
|
7
7
|
import { fail } from '../lib/errors.js';
|
|
8
8
|
import { log } from '../lib/log.js';
|
|
9
9
|
|
|
10
|
-
import { TOOL_REGISTRY, getToolDefinition } from '../lib/tools.js';
|
|
10
|
+
import { TOOL_REGISTRY, getToolDefinition, DEPRECATED_SKILLS } from '../lib/tools.js';
|
|
11
11
|
|
|
12
12
|
/**
|
|
13
13
|
* Parse YAML frontmatter from a SKILL.md file
|
|
@@ -124,6 +124,14 @@ export function installGlobalSkills(opts = {}) {
|
|
|
124
124
|
log.ok(`installed skills -> ~/${dir}/skills/`);
|
|
125
125
|
installedCount++;
|
|
126
126
|
}
|
|
127
|
+
// Prune deprecated legacy skills from global user agent directory
|
|
128
|
+
for (const dep of DEPRECATED_SKILLS) {
|
|
129
|
+
const depPath = path.join(dest, dep);
|
|
130
|
+
if (exists(depPath)) {
|
|
131
|
+
removeDir(depPath);
|
|
132
|
+
log.ok(`pruned deprecated skill '${dep}' from ~/${dir}/skills/`);
|
|
133
|
+
}
|
|
134
|
+
}
|
|
127
135
|
}
|
|
128
136
|
|
|
129
137
|
log.info('');
|
package/src/commands/verify.js
CHANGED
|
@@ -6,7 +6,7 @@ import { openspecDir, changeDir } from '../lib/paths.js';
|
|
|
6
6
|
import { requireRepo, toChangeSlug, readLintConfig, jsonOut } from '../lib/cliutil.js';
|
|
7
7
|
import { validateChange } from '../lib/openspec.js';
|
|
8
8
|
import { runShell } from '../lib/exec.js';
|
|
9
|
-
import { lastCommitTouching, changeOnRef, git } from '../lib/git.js';
|
|
9
|
+
import { lastCommitTouching, changeOnRef, git, resolveDefaultBranch } from '../lib/git.js';
|
|
10
10
|
import { lintSpecText, countBlockers } from '../lib/speclint.js';
|
|
11
11
|
import { checkSchema } from '../lib/schema.js';
|
|
12
12
|
import { loadPolicy, isAdvisory, DEFAULT_POLICY, matchesAny } from '../lib/policy.js';
|
|
@@ -195,7 +195,6 @@ export function extractJson(text) {
|
|
|
195
195
|
export function runVerify(changeId, opts = {}) {
|
|
196
196
|
const results = [];
|
|
197
197
|
const add = (name, status, detail) => results.push({ name, status, detail });
|
|
198
|
-
const branch = opts.protectedBranch ?? 'origin/main';
|
|
199
198
|
|
|
200
199
|
let repoRoot;
|
|
201
200
|
try {
|
|
@@ -206,6 +205,8 @@ export function runVerify(changeId, opts = {}) {
|
|
|
206
205
|
return finish(results, DEFAULT_POLICY);
|
|
207
206
|
}
|
|
208
207
|
|
|
208
|
+
const branch = opts.protectedBranch ?? resolveDefaultBranch(repoRoot);
|
|
209
|
+
|
|
209
210
|
const slug = toChangeSlug(changeId);
|
|
210
211
|
const base = opts.base ?? branch;
|
|
211
212
|
const head = opts.head ?? 'HEAD';
|
|
@@ -266,7 +267,7 @@ export function runVerify(changeId, opts = {}) {
|
|
|
266
267
|
} else if (isSinglePr) {
|
|
267
268
|
add('approved-spec', 'pass', `${changeLevel || 'single-pr'} single-PR mode (spec approval co-located in implementation PR)`);
|
|
268
269
|
} else if (!approvedSha) {
|
|
269
|
-
add('approved-spec', 'fail', `no commit on locked paths is merged into ${branch} (not approved)`);
|
|
270
|
+
add('approved-spec', 'fail', `no commit on locked paths is merged into ${branch} (not approved; ensure target branch is fetched, e.g. git fetch)`);
|
|
270
271
|
} else if (specSha && specSha !== approvedSha) {
|
|
271
272
|
add('approved-spec', 'fail', `declared specSha ${specSha.slice(0, 8)} != approved commit ${approvedSha.slice(0, 8)}`);
|
|
272
273
|
} else {
|
|
@@ -285,7 +286,7 @@ export function runVerify(changeId, opts = {}) {
|
|
|
285
286
|
add('flow-state', 'pass', `${changeLevel || 'single-pr'} single-PR mode (direct implementation)`);
|
|
286
287
|
} else {
|
|
287
288
|
add('flow-state', status === 'ready_for_impl' ? 'pass' : 'fail',
|
|
288
|
-
status === 'ready_for_impl' ? 'READY_FOR_IMPL' : `status is ${status ?? 'unset'} (run: asdlc approve ${changeId})`);
|
|
289
|
+
status === 'ready_for_impl' ? 'READY_FOR_IMPL' : `status is ${status ?? 'unset'} (ensure target branch is fetched, then run: asdlc approve ${changeId})`);
|
|
289
290
|
}
|
|
290
291
|
|
|
291
292
|
const isCI = opts.ci !== undefined
|
package/src/lib/tools.js
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import path from 'node:path';
|
|
2
|
-
import { exists, listDir, copyTree, ensureDir, readText, writeText } from './fs.js';
|
|
2
|
+
import { exists, listDir, copyTree, ensureDir, readText, writeText, removeDir } from './fs.js';
|
|
3
3
|
import { skillsAssetDir, commandsAssetDir } from './paths.js';
|
|
4
4
|
import { log } from './log.js';
|
|
5
5
|
|
|
6
|
+
export const DEPRECATED_SKILLS = ['asdlc-review'];
|
|
7
|
+
|
|
6
8
|
export const TOOL_REGISTRY = {
|
|
7
9
|
claude: {
|
|
8
10
|
id: 'claude',
|
|
@@ -207,6 +209,14 @@ export function installSkills(repoRoot, tools = []) {
|
|
|
207
209
|
for (const dir of targetDirs) {
|
|
208
210
|
const dest = path.join(repoRoot, dir);
|
|
209
211
|
copyTree(skillsAssetDir, dest);
|
|
212
|
+
// Prune deprecated legacy skills from target directory to prevent orphan skill pollution
|
|
213
|
+
for (const dep of DEPRECATED_SKILLS) {
|
|
214
|
+
const depPath = path.join(dest, dep);
|
|
215
|
+
if (exists(depPath)) {
|
|
216
|
+
removeDir(depPath);
|
|
217
|
+
log.ok(`pruned deprecated skill '${dep}' from ${dir}/`);
|
|
218
|
+
}
|
|
219
|
+
}
|
|
210
220
|
log.ok(`installed bundled skills (${count} skills) -> ${dir}/`);
|
|
211
221
|
}
|
|
212
222
|
}
|
|
@@ -1,80 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: asdlc-review
|
|
3
|
-
description: "Independent fresh-context spec review helper. Primary reviews run via asdlc-spec-review and asdlc-impl-review agent sessions."
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
# /asdlc:review - Independent Spec Review Helper
|
|
7
|
-
|
|
8
|
-
> [!NOTE]
|
|
9
|
-
> **Independent Agent Session Review**:
|
|
10
|
-
> Spec and implementation reviews are executed by dedicated **Independent Review Agent Sessions** (`asdlc-spec-review` and `asdlc-impl-review`) adhering to the **Player ≠ Referee** principle.
|
|
11
|
-
> This skill (`asdlc-review`) is retained as a local fresh-context dry-run helper to inspect changes and generate or preview `review.md`.
|
|
12
|
-
|
|
13
|
-
When invoked, it switches into the **Independent Reviewer** role (Player ≠ Referee). The reviewer MUST NOT be the authoring agent of the change.
|
|
14
|
-
|
|
15
|
-
---
|
|
16
|
-
|
|
17
|
-
## Review Dimensions
|
|
18
|
-
|
|
19
|
-
Every change is evaluated along six core 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.
|