@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
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 akjamie
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,220 @@
|
|
|
1
|
-
#
|
|
1
|
+
# agentic-sdlc
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
> **BLUF** — Enterprise-grade Agentic Software Development Lifecycle (SDLC) governance.
|
|
4
|
+
> Seven stages take a feature from natural language intent to production, with governance
|
|
5
|
+
> **enforced by deterministic gates**, not by hope. Built on [OpenSpec](https://openspec.dev)
|
|
6
|
+
> and [Graphify](https://github.com/safishamsi/graphify); the governance plane is yours.
|
|
7
|
+
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
## Contents
|
|
11
|
+
|
|
12
|
+
- [What problem this solves](#what-problem-this-solves)
|
|
13
|
+
- [Three-Plane Architecture](#three-plane-architecture)
|
|
14
|
+
- [Bundled Out-of-the-Box Skills](#bundled-out-of-the-box-skills)
|
|
15
|
+
- [Install & Setup](#install--setup)
|
|
16
|
+
- [The Seven Stages](#the-seven-stages)
|
|
17
|
+
- [What `asdlc verify` Checks](#what-asdlc-verify-checks)
|
|
18
|
+
- [Governance Principles](#governance-principles)
|
|
19
|
+
- [Documentation Hub](#documentation-hub)
|
|
20
|
+
- [Development & Verification](#development--verification)
|
|
21
|
+
|
|
22
|
+
---
|
|
23
|
+
|
|
24
|
+
## What problem this solves
|
|
25
|
+
|
|
26
|
+
Spec-driven development works — until you scale it past one team or turn AI agents loose on production code. OpenSpec manages spec documents, but it **enforces nothing** at runtime. Nothing stops a developer or an autonomous agent from merging code that contradicts the approved spec, shipping without tests, or silently editing the spec after the fact.
|
|
27
|
+
|
|
28
|
+
`asdlc` closes that gap. It adds a deterministic governance plane *on top of* the engines:
|
|
29
|
+
|
|
30
|
+
- **Intent-Driven Start**: Developers start with natural language requirements (`asdlc new "i want to build..."`), not artificial ticket IDs. Canonical slugs are automatically derived, and knowledge graph queries are seeded with real domain terms.
|
|
31
|
+
- **High-Efficiency Batch Grilling**: A bundled interview engine (**`batch-grill-me`**) stress-tests the entire decision frontier in 1-2 structured batches with recommended defaults *before* writing specs. Decisions are recorded in `clarifications.md`.
|
|
32
|
+
- **The Spec is the Authority**: Merged to the protected branch, the spec is immutable. If reality diverges during implementation, the Converge protocol halts affected work (`SPEC_GAP`) — you never silently mutate an approved spec.
|
|
33
|
+
- **Enforced Task-Level TDD**: Unlocking implementation (`asdlc apply`) requires approved spec commits, while `asdlc verify` deterministically checks `test-presence` (rejects code changes without test changes in diff) and `tdd-evidence` (validates recorded test outputs).
|
|
34
|
+
- **Player ≠ Referee**: Independent AI verification uses a different model and a fresh context than the authoring agent.
|
|
35
|
+
|
|
36
|
+
---
|
|
37
|
+
|
|
38
|
+
## Three-Plane Architecture
|
|
39
|
+
|
|
40
|
+
```
|
|
41
|
+
┌─────────────────────────────────────────────────────────────────────────────┐
|
|
42
|
+
│ PLANE 3: Agentic IDE Skills & Commands (.agents/skills, .claude/skills, ...)│
|
|
43
|
+
│ ● asdlc:new ● asdlc:lint ● asdlc:review ● asdlc:apply ● asdlc:verify │
|
|
44
|
+
│ ● Bundled Engines: grilling (batch-grill-me), asdlc-apply (TDD Red-Green) │
|
|
45
|
+
└──────────────────────────────────────┬──────────────────────────────────────┘
|
|
46
|
+
│ runs CLI with --json
|
|
47
|
+
┌──────────────────────────────────────▼──────────────────────────────────────┐
|
|
48
|
+
│ PLANE 2: Governance CLI & CI Gate (asdlc init/new/lint/approve/apply/verify)│
|
|
49
|
+
│ ● Path-limited approval evidence ● Deterministic BDD/AC linters │
|
|
50
|
+
│ ● Diff-based test presence gate ● Schema version pin & override guard │
|
|
51
|
+
└──────────────────────────────────────┬──────────────────────────────────────┘
|
|
52
|
+
│ calls pure functions
|
|
53
|
+
┌──────────────────────────────────────▼──────────────────────────────────────┐
|
|
54
|
+
│ PLANE 1: Core Library (src/lib/ — zero side-effects, fully unit-tested) │
|
|
55
|
+
│ ● speclint ● tdd ● prtype ● policy ● graphify ● schema ● agents │
|
|
56
|
+
└─────────────────────────────────────────────────────────────────────────────┘
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
For complete technical specifications of each plane, see [docs/architecture.md](docs/architecture.md).
|
|
60
|
+
|
|
61
|
+
---
|
|
62
|
+
|
|
63
|
+
## Bundled Out-of-the-Box Skills
|
|
64
|
+
|
|
65
|
+
`asdlc` does not assume or require external user-level skills to be pre-installed. All critical agent harnesses are **packaged inside `asdlc` and installed automatically upon `asdlc init`**:
|
|
66
|
+
|
|
67
|
+
| Stage & Skill | Purpose & Behavior |
|
|
68
|
+
| :--- | :--- |
|
|
69
|
+
| **Stage 1 · Init**<br>[`asdlc-init`](assets/skills/asdlc-init/SKILL.md) | Bootstraps repository: OpenSpec, Graphify AST engine, governance schema, policies, git hooks, and agent skills. |
|
|
70
|
+
| **Stage 2 · New**<br>[`asdlc-new`](assets/skills/asdlc-new/SKILL.md) | Grounds intent in Graphify AST queries, seeds `clarifications.md`, and runs bundled **`batch-grill-me`** interview. |
|
|
71
|
+
| **Stage 3 · Spec PR**<br>[`asdlc-pr`](assets/skills/asdlc-pr/SKILL.md) | Enforces deterministic BDD/AC linting (R0–R8) and opens Spec PR (CLI → REST API → 1-click Web URL) with auto-labels. |
|
|
72
|
+
| **Stage 3 · Spec AI Review**<br>[`asdlc-spec-review`](assets/skills/asdlc-spec-review/SKILL.md) | CI-triggered independent 6-dimension spec evaluation; posts structured markdown findings and traceability matrix as PR comments via `gh`. |
|
|
73
|
+
| **Stage 4 · Approve (Optional)**<br>[`asdlc-approve`](assets/skills/asdlc-approve/SKILL.md) | *(Optional)* Explicit audit stamp after PR merge (`specSha` + `READY_FOR_IMPL`). Auto-recognized by `apply`. |
|
|
74
|
+
| **Stage 5 · Apply**<br>[`asdlc-apply`](assets/skills/asdlc-apply/SKILL.md) | Path-isolated zero-diff guard; executes strict **Red -> Green -> Refactor -> Evidence -> Converge** TDD loop. |
|
|
75
|
+
| **Stage 6 · Verify**<br>[`asdlc-verify`](assets/skills/asdlc-verify/SKILL.md) | 12-gate implementation verification: test presence, task evidence, AC test mapping, and independent AI verifier. |
|
|
76
|
+
| **Stage 6.5 · Impl AI Review**<br>[`asdlc-impl-review`](assets/skills/asdlc-impl-review/SKILL.md) | CI-triggered independent implementation evaluation (AC conformance matrix, code quality, TDD evidence); posts markdown findings as PR comments via `gh`. |
|
|
77
|
+
| **Stage 7 · Archive**<br>[`asdlc-archive`](assets/skills/asdlc-archive/SKILL.md) | Deliberate closeout: syncs specs to master catalog, refreshes code AST graph, and updates system status. |
|
|
78
|
+
| **Diagnostics**<br>[`asdlc-doctor`](assets/skills/asdlc-doctor/SKILL.md) | Evaluates 12 toolchain/governance invariants; provides automated 1-click remediation (`--fix`). |
|
|
79
|
+
| **Orientation**<br>[`asdlc-status`](assets/skills/asdlc-status/SKILL.md) | Shows change stage progress, active artifacts, next command, or full portfolio dashboard. |
|
|
80
|
+
|
|
81
|
+
---
|
|
82
|
+
|
|
83
|
+
## Install & Setup
|
|
84
|
+
|
|
85
|
+
`asdlc` supports multiple installation methods depending on your environment:
|
|
86
|
+
|
|
87
|
+
```bash
|
|
88
|
+
# Option A: From npm registry (Recommended)
|
|
89
|
+
npm install -g @akjamie/agentic-sdlc
|
|
90
|
+
|
|
91
|
+
# Option B: Directly from GitHub repository (npm v12+ requires --allow-git=all)
|
|
92
|
+
npm install -g --allow-git=all git+https://github.com/akjamie/agentic-sdlc.git
|
|
93
|
+
|
|
94
|
+
# Option C: Local development repository
|
|
95
|
+
npm install -g .
|
|
96
|
+
|
|
97
|
+
# Initialize repository (installs OpenSpec engine, Graphify, policy, and bundled skills)
|
|
98
|
+
asdlc init --ci jenkins
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
Verify setup health at any time:
|
|
102
|
+
|
|
103
|
+
```bash
|
|
104
|
+
asdlc doctor
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
---
|
|
108
|
+
|
|
109
|
+
## The Seven Stages
|
|
110
|
+
|
|
111
|
+
```mermaid
|
|
112
|
+
flowchart LR
|
|
113
|
+
S1["1 · init<br/>setup + skills"] --> S2["2 · new<br/>intent + grill"]
|
|
114
|
+
S2 --> S3["3 · spec pr<br/>lint + open Spec PR"]
|
|
115
|
+
S3 --> S4["4 · approve (optional)<br/>audit check"]
|
|
116
|
+
S4 --> S5["5 · apply<br/>TDD loop"]
|
|
117
|
+
S5 --> S6["6 · verify<br/>12 gates (local)"]
|
|
118
|
+
S6 --> PR2["Impl PR<br/>asdlc pr (CI AI Review)"]
|
|
119
|
+
PR2 --> S7["7 · archive<br/>sync + graph"]
|
|
120
|
+
|
|
121
|
+
style S1 fill:#e8f4fd,stroke:#2196f3
|
|
122
|
+
style S2 fill:#e8f4fd,stroke:#2196f3
|
|
123
|
+
style S3 fill:#e8f4fd,stroke:#2196f3
|
|
124
|
+
style S4 fill:#fff3e0,stroke:#ff9800
|
|
125
|
+
style S5 fill:#e8f5e9,stroke:#4caf50
|
|
126
|
+
style S6 fill:#fff3e0,stroke:#ff9800
|
|
127
|
+
style PR2 fill:#e8f5e9,stroke:#4caf50
|
|
128
|
+
style S7 fill:#f3e5f5,stroke:#9c27b0
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
| Stage & Command | Lifecycle Action & Governance Guard |
|
|
132
|
+
| :--- | :--- |
|
|
133
|
+
| **1 · Init**<br>`asdlc init [--ci jenkins]` | Bootstraps OpenSpec + Graphify, governance schema, policy, and 8+ agent tools. |
|
|
134
|
+
| **2 · New**<br>`asdlc new "<requirement>"` | Derives canonical slug, queries code graph, and interviews author via `batch-grill-me`. |
|
|
135
|
+
| **3 · Spec PR**<br>`asdlc pr <ID> <targetBranch>` | Pre-flight BDD/AC linting (`asdlc lint`), attaches `asdlc:spec-review` label, triggers CI Spec AI Review before human approval. |
|
|
136
|
+
| **4 · Approve (Optional)**<br>`asdlc approve <ID>` | *(Optional)* Explicit audit stamp after Spec PR merge. `asdlc apply` automatically detects merged PRs if skipped. |
|
|
137
|
+
| **5 · Apply**<br>`asdlc apply <ID>` | Multi-tenant zero-diff guard; launches `/asdlc:apply` task-level TDD Red-Green engine. |
|
|
138
|
+
| **6 · Verify (Local)**<br>`asdlc verify <ID>` | Local pre-flight self-check across 12 deterministic gates (test-presence, tdd-evidence, AC mappings, external tests). |
|
|
139
|
+
| **6.5 · Impl PR**<br>`asdlc pr <ID> <targetBranch>` | Pre-flight implementation verification, pushes impl branch, attaches `asdlc:impl-review` label, triggers CI Code AI Review before merge. |
|
|
140
|
+
| **7 · Archive**<br>`asdlc archive <ID>` | Syncs delta to `openspec/specs/`, refreshes knowledge graph, updates `AGENTS.md` system status. |
|
|
141
|
+
|
|
142
|
+
### Dual-PR Governance & Label Dispatch
|
|
143
|
+
|
|
144
|
+
`asdlc pr` automatically detects whether you are submitting a **Spec PR** (Stage 3) or an **Implementation PR** (Stage 6.5) based on lifecycle state, branch, and approval history — completely autonomous with zero extra flags:
|
|
145
|
+
|
|
146
|
+
| PR Phase | Trigger Moment & Pre-flight | PR Labels | CI Automation Trigger | Human Action |
|
|
147
|
+
| :--- | :--- | :--- | :--- | :--- |
|
|
148
|
+
| **Spec PR** | After spec drafting; runs **`asdlc lint`** (0 blockers) | `asdlc:spec-review`<br>`spec` | Runs `asdlc lint` + triggers **Spec AI Review** (clarity, BDD scenarios, architecture alignment) | TL / Domain Lead approves & merges |
|
|
149
|
+
| **Impl PR** | After TDD implementation; runs **`asdlc verify`** (12 gates) | `asdlc:impl-review`<br>`impl` | Runs `asdlc verify` + triggers **Code AI Review** (diff analysis, style, edge cases) | Lead / Peer reviews code & merges |
|
|
150
|
+
|
|
151
|
+
**Navigation, Diagnostics & Workspace Maintenance:**
|
|
152
|
+
- `asdlc status <ID>`: Instant orientation on current stage and exact next command.
|
|
153
|
+
- `asdlc doctor [--fix]`: Comprehensive toolchain and policy health diagnostics with auto-remediation.
|
|
154
|
+
- `asdlc update`: Synchronizes repository SDLC state in seconds: refreshes repo-level agent skills (`.agents/skills`), rebuilds codebase AST knowledge graph (`graphify-out/` bound to `HEAD`), updates `AGENTS.md` system status & architectural hubs, and verifies git hooks. Fails fast with guidance if run outside an initialized repository.
|
|
155
|
+
- `asdlc upgrade [--global]`: Upgrades the machine toolchain (`asdlc` CLI, OpenSpec engine, Graphify, managed schema) and automatically updates the current repository if inside one, or global user skills (`~/.agents`) with `--global`.
|
|
156
|
+
- `asdlc skills list`: Lists all bundled skills available in agentic-sdlc.
|
|
157
|
+
- `asdlc skills install --global`: One-click setup on CI Linux VMs to inject skills into global agent directories (`~/.agents`, `~/.opencode`, `~/.pi`, `~/.dsh`) without polluting developer workspaces.
|
|
158
|
+
|
|
159
|
+
---
|
|
160
|
+
|
|
161
|
+
## What `asdlc verify` Checks
|
|
162
|
+
|
|
163
|
+
`asdlc verify` executes in local developer terminals and on CI (Jenkins) without drift:
|
|
164
|
+
|
|
165
|
+
```mermaid
|
|
166
|
+
flowchart TB
|
|
167
|
+
V["asdlc verify"] --> C1["pr-type<br/>paths only discrimination"]
|
|
168
|
+
V --> C2["artifacts<br/>proposal + review + tasks + explore + spec"]
|
|
169
|
+
V --> C3["approved-spec<br/>git log verification on target branch"]
|
|
170
|
+
V --> C3b["spec-tamper<br/>locked spec paths unmodified in impl PR"]
|
|
171
|
+
V --> C4["flow-state<br/>READY_FOR_IMPL verification"]
|
|
172
|
+
V --> C5["tasks-complete<br/>all checkboxes resolved"]
|
|
173
|
+
V --> C6["test-presence<br/>code diff mandates test diff"]
|
|
174
|
+
V --> C7["tdd-evidence<br/>verified task output annotations"]
|
|
175
|
+
V --> C8["BDD + AC<br/>GIVEN/WHEN/THEN + AC→test mapping"]
|
|
176
|
+
V --> C9["openspec validate<br/>--all --strict"]
|
|
177
|
+
V --> C10["schema-managed<br/>central install + version pin"]
|
|
178
|
+
V --> C11["external<br/>unit tests · contract · security"]
|
|
179
|
+
V --> C12["AI verification<br/>independent referee model"]
|
|
180
|
+
```
|
|
181
|
+
|
|
182
|
+
---
|
|
183
|
+
|
|
184
|
+
## Governance Principles
|
|
185
|
+
|
|
186
|
+
1. **Adopt the engines, own the governance plane.** OpenSpec and Graphify are adopted, not forked.
|
|
187
|
+
2. **Approval is git.** A merged spec PR *is* the human approval; the gate proves it with a path-limited `git log`.
|
|
188
|
+
3. **Fail-closed.** Any verification without an approved commit fails.
|
|
189
|
+
4. **Deterministic first.** Linters, diff analyzers, and schema validators are pure functions (no LLM jitter).
|
|
190
|
+
5. **Enforced TDD.** Implementation diffs touching production code without tests are rejected by `test-presence`.
|
|
191
|
+
6. **Ground specs in code.** Graphify AST queries ground specifications in real code structure.
|
|
192
|
+
7. **One front door.** Everything runs through `asdlc` — no raw escape hatches.
|
|
193
|
+
|
|
194
|
+
---
|
|
195
|
+
|
|
196
|
+
## Documentation Hub
|
|
197
|
+
|
|
198
|
+
| Document | Purpose |
|
|
199
|
+
|---|---|
|
|
200
|
+
| [docs/usage.md](docs/usage.md) | Practical command-line and developer walkthrough. |
|
|
201
|
+
| [docs/architecture.md](docs/architecture.md) | Complete 3-Plane Architecture & IDE Skill design specification. |
|
|
202
|
+
| [docs/solution-review.md](docs/solution-review.md) | Solution review, gap analysis, and architectural evaluation. |
|
|
203
|
+
| [docs/glossary.md](docs/glossary.md) | Formally locked domain model and SDLC vocabulary. |
|
|
204
|
+
| [docs/blueprint.html](docs/blueprint.html) | Enterprise Agentic SDLC Blueprint (English). |
|
|
205
|
+
| [docs/blueprint.zh.html](docs/blueprint.zh.html) | Enterprise Agentic SDLC Blueprint (Chinese). |
|
|
206
|
+
|
|
207
|
+
---
|
|
208
|
+
|
|
209
|
+
## Development & Verification
|
|
210
|
+
|
|
211
|
+
```bash
|
|
212
|
+
npm install
|
|
213
|
+
npm test # 66 unit and integration tests (100% pass)
|
|
214
|
+
```
|
|
215
|
+
|
|
216
|
+
---
|
|
217
|
+
|
|
218
|
+
## License
|
|
219
|
+
|
|
220
|
+
[MIT](LICENSE)
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
// Jenkinsfile — BU Agentic SDLC gate (OpenSpec engine + asdlc governance).
|
|
2
|
+
//
|
|
3
|
+
// IMPORTANT: this job does NOT (and must not need to) install asdlc globally on
|
|
4
|
+
// the Jenkins agent. There is no `npm i -g` here. asdlc is obtained one of two
|
|
5
|
+
// permission-free ways:
|
|
6
|
+
//
|
|
7
|
+
// 1) project devDependency: declare "agentic-sdlc" in devDependencies, run
|
|
8
|
+
// `npm ci` in a stage, then this file uses node_modules/.bin/asdlc; OR
|
|
9
|
+
// 2) extra SCM checkout: add a checkout of the asdlc toolkit to this job
|
|
10
|
+
// and set ASDLC_TOOLKIT=<workspace>/asdlc-toolkit; then it runs
|
|
11
|
+
// `node $ASDLC_TOOLKIT/bin/asdlc.js`.
|
|
12
|
+
//
|
|
13
|
+
// spec PR (branch asdlc/<id>) -> asdlc lint (spec check)
|
|
14
|
+
// impl PR (branch asdlc/impl/<id>) -> asdlc verify (implementation check)
|
|
15
|
+
|
|
16
|
+
pipeline {
|
|
17
|
+
agent { docker { image 'node:20' label 'docker' } }
|
|
18
|
+
|
|
19
|
+
options {
|
|
20
|
+
buildDiscarder(logRotator(numToKeepStr: '30'))
|
|
21
|
+
disableConcurrentBuilds()
|
|
22
|
+
timestamps()
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
environment {
|
|
26
|
+
CHANGE_ID = "${env.CHANGE_BRANCH ?: env.BRANCH_NAME}".tokenize('/').last().toUpperCase()
|
|
27
|
+
REPO = "${env.JOB_BASE_NAME}"
|
|
28
|
+
IS_IMPL = "${(env.CHANGE_BRANCH ?: env.BRANCH_NAME).contains('impl')}"
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
stages {
|
|
32
|
+
// Optional: only if asdlc is a devDependency. Safe to keep; harmless if absent.
|
|
33
|
+
stage('Install project tooling') {
|
|
34
|
+
steps {
|
|
35
|
+
sh 'if [ -f package-lock.json ]; then npm ci --no-audit --no-fund; elif [ -f package.json ]; then npm install --no-audit --no-fund; else echo "no package.json; relying on ASDLC_TOOLKIT checkout"; fi'
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
stage('Resolve asdlc (NO global install)') {
|
|
40
|
+
steps {
|
|
41
|
+
script {
|
|
42
|
+
def asdlc = sh(returnStdout: true, script: '''
|
|
43
|
+
if [ -x node_modules/.bin/asdlc ]; then
|
|
44
|
+
echo node_modules/.bin/asdlc
|
|
45
|
+
elif [ -n "${ASDLC_TOOLKIT:-}" ] && [ -f "$ASDLC_TOOLKIT/bin/asdlc.js" ]; then
|
|
46
|
+
echo "node $ASDLC_TOOLKIT/bin/asdlc.js"
|
|
47
|
+
else
|
|
48
|
+
echo MISSING
|
|
49
|
+
fi
|
|
50
|
+
''').trim()
|
|
51
|
+
if (asdlc == 'MISSING') {
|
|
52
|
+
error('asdlc not found. Declare it in devDependencies (then npm ci) OR add an SCM checkout and set ASDLC_TOOLKIT.')
|
|
53
|
+
}
|
|
54
|
+
env.ASDLC = asdlc
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
stage('Spec lint & AI Review') {
|
|
60
|
+
when { expression { env.IS_IMPL != 'true' } }
|
|
61
|
+
steps { sh "${env.ASDLC} lint ${env.CHANGE_ID}" }
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
stage('Verify & AI Code Review (implementation PR)') {
|
|
65
|
+
when { expression { env.IS_IMPL == 'true' } }
|
|
66
|
+
steps {
|
|
67
|
+
// Player != referee: verify runs every deterministic check PLUS an
|
|
68
|
+
// independent agent/model (ASDLC_VERIFY_COMMAND from Jenkins credentials).
|
|
69
|
+
withCredentials([string(credentialsId: 'asdlc-verify-api-key', variable: 'VERIFY_API_KEY')]) {
|
|
70
|
+
sh "${env.ASDLC} verify ${env.CHANGE_ID} --repo ${env.REPO} --base origin/${env.CHANGE_TARGET} --required"
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
post {
|
|
77
|
+
success { echo "asdlc PASSED for ${env.CHANGE_ID}" }
|
|
78
|
+
failure { echo "asdlc FAILED for ${env.CHANGE_ID}" }
|
|
79
|
+
}
|
|
80
|
+
}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
name: ASDLC AI Review
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
pull_request:
|
|
5
|
+
types: [opened, synchronize, reopened, labeled]
|
|
6
|
+
|
|
7
|
+
permissions:
|
|
8
|
+
contents: read
|
|
9
|
+
pull-requests: write
|
|
10
|
+
statuses: write
|
|
11
|
+
|
|
12
|
+
jobs:
|
|
13
|
+
spec-ai-review:
|
|
14
|
+
name: Spec AI Review
|
|
15
|
+
if: contains(github.event.pull_request.labels.*.name, 'asdlc:spec-review')
|
|
16
|
+
runs-on: ubuntu-latest
|
|
17
|
+
steps:
|
|
18
|
+
- name: Checkout code
|
|
19
|
+
uses: actions/checkout@v4
|
|
20
|
+
with:
|
|
21
|
+
fetch-depth: 0
|
|
22
|
+
|
|
23
|
+
- name: Set up Node.js
|
|
24
|
+
uses: actions/setup-node@v4
|
|
25
|
+
with:
|
|
26
|
+
node-version: '20'
|
|
27
|
+
|
|
28
|
+
- name: Run Spec AI Review
|
|
29
|
+
env:
|
|
30
|
+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
31
|
+
PR_NUMBER: ${{ github.event.pull_request.number }}
|
|
32
|
+
REPO: ${{ github.repository }}
|
|
33
|
+
run: |
|
|
34
|
+
# Dispatch independent AI spec reviewer (Player != Referee)
|
|
35
|
+
# using asdlc-spec-review skill instructions.
|
|
36
|
+
# The agent evaluates the PR diff, posts findings directly as a PR comment,
|
|
37
|
+
# and sets the commit status check (asdlc/spec-ai-review).
|
|
38
|
+
echo "Spec AI Review triggered for PR #${PR_NUMBER} in ${REPO}"
|
|
39
|
+
|
|
40
|
+
impl-ai-review:
|
|
41
|
+
name: Implementation AI Review
|
|
42
|
+
if: contains(github.event.pull_request.labels.*.name, 'asdlc:impl-review')
|
|
43
|
+
runs-on: ubuntu-latest
|
|
44
|
+
steps:
|
|
45
|
+
- name: Checkout code
|
|
46
|
+
uses: actions/checkout@v4
|
|
47
|
+
with:
|
|
48
|
+
fetch-depth: 0
|
|
49
|
+
|
|
50
|
+
- name: Set up Node.js
|
|
51
|
+
uses: actions/setup-node@v4
|
|
52
|
+
with:
|
|
53
|
+
node-version: '20'
|
|
54
|
+
|
|
55
|
+
- name: Run Implementation AI Review
|
|
56
|
+
env:
|
|
57
|
+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
58
|
+
PR_NUMBER: ${{ github.event.pull_request.number }}
|
|
59
|
+
REPO: ${{ github.repository }}
|
|
60
|
+
run: |
|
|
61
|
+
# Dispatch independent AI implementation reviewer (Player != Referee)
|
|
62
|
+
# using asdlc-impl-review skill instructions.
|
|
63
|
+
# The agent evaluates the PR diff against approved specs, posts findings as a PR comment,
|
|
64
|
+
# and sets the commit status check (asdlc/impl-ai-review).
|
|
65
|
+
echo "Implementation AI Review triggered for PR #${PR_NUMBER} in ${REPO}"
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
# asdlc governance overlay (managed by `asdlc init`).
|
|
2
|
+
# The BU-managed schema defines the enterprise change flow:
|
|
3
|
+
# proposal -> specs -> review -> design -> tasks
|
|
4
|
+
# with tasks generated AFTER approval (execution state, not intent).
|
|
5
|
+
schema: agentic-repo-change
|
|
6
|
+
|
|
7
|
+
context: |
|
|
8
|
+
This repo uses the Agentic SDLC flow. Everything runs through `asdlc`:
|
|
9
|
+
asdlc new <ID> start a spec (scaffold + refresh the graph + explore.md)
|
|
10
|
+
asdlc lint <ID> check the spec (artifacts + review + BDD/acceptance criteria)
|
|
11
|
+
asdlc approve <ID> after the spec PR merges: record the approved SHA
|
|
12
|
+
asdlc apply <ID> guard, then /opsx-apply
|
|
13
|
+
asdlc verify <ID> check the implementation
|
|
14
|
+
asdlc archive <ID> finish (refresh the graph + AGENTS.md)
|
|
15
|
+
- The spec PR carries intent: proposal + spec delta + review.md (a change-dir
|
|
16
|
+
convention). tasks.md is execution state, generated AFTER approval.
|
|
17
|
+
- A code knowledge graph runs behind the scenes (graphify-out/); `asdlc new`
|
|
18
|
+
refreshes it and writes explore.md so the spec is grounded in the real code,
|
|
19
|
+
not guesses. The graph is a navigation aid, not the source of truth.
|
|
20
|
+
- After `asdlc new`, GRILL the author using the grilling skill (design-tree
|
|
21
|
+
interview, in rounds) and record settled decisions in clarifications.md
|
|
22
|
+
BEFORE writing proposal.md / specs.
|
|
23
|
+
- `asdlc status <ID>` shows where you are; `asdlc doctor` checks the setup.
|
|
24
|
+
- A bad spec is never edited: close it and run `asdlc new <NEW-ID>` again.
|
|
25
|
+
|
|
26
|
+
rules:
|
|
27
|
+
proposal:
|
|
28
|
+
- "Reference any System Design or cross-repo contract this change touches."
|
|
29
|
+
- "Include Out of Scope and Dependencies & Assumptions sections."
|
|
30
|
+
specs:
|
|
31
|
+
- "Use SHALL/MUST. Each requirement needs a GIVEN/WHEN/THEN scenario (4 '#')."
|
|
32
|
+
- "Each requirement needs an 'Acceptance criteria' block: '- [ ] AC1: concrete assertion (test: path)'."
|
|
33
|
+
- "Add a '## Constraints & NFRs' section: performance, security, compliance as verifiable statements."
|
|
34
|
+
- "Add a '## Out of Scope' section: what this change explicitly does NOT cover."
|
|
35
|
+
- "Add a '## Test Strategy' section."
|
|
36
|
+
tasks:
|
|
37
|
+
- "Every task references the AC it implements: '- [ ] 1.1 desc (AC1) verify: how'."
|
|
38
|
+
- "Every task states how to verify completion in its own description."
|
|
39
|
+
|
|
40
|
+
# Per-operation guidance (read natively by OpenSpec's apply/archive workflows).
|
|
41
|
+
operations:
|
|
42
|
+
apply:
|
|
43
|
+
guidance:
|
|
44
|
+
- "Task-level TDD: failing test -> implement -> paste test output -> fresh-context review."
|
|
45
|
+
- "Never modify locked paths (proposal.md, specs/**). If the spec is wrong, STOP and"
|
|
46
|
+
- "close the change; start a fresh one with `asdlc new` - never edit an approved spec."
|
|
47
|
+
archive:
|
|
48
|
+
guidance:
|
|
49
|
+
- "BEFORE archiving, update AGENTS.md with anything durable this change taught:"
|
|
50
|
+
- "new conventions, commands, gotchas, module map changes (keep the asdlc routing"
|
|
51
|
+
- "block intact). AGENTS.md is the context layer for future agents."
|
|
52
|
+
|
|
53
|
+
# Lint policy (policy-as-code). Severity per rule: blocker | major | off.
|
|
54
|
+
lint:
|
|
55
|
+
version: "1"
|
|
56
|
+
rules:
|
|
57
|
+
R4-given: major
|
|
58
|
+
R6-ac-missing-test: blocker
|
|
59
|
+
|
|
60
|
+
# External checks run by `asdlc verify` (tests / contract / security), in a
|
|
61
|
+
# scrubbed environment (no secrets leak).
|
|
62
|
+
# gates:
|
|
63
|
+
# external:
|
|
64
|
+
# - name: unit-tests
|
|
65
|
+
# command: npm test
|
|
66
|
+
# - name: security
|
|
67
|
+
# command: npm audit --audit-level=high
|
|
68
|
+
|
|
69
|
+
# Independent AI verification (player != referee). The authoring agent (your IDE)
|
|
70
|
+
# writes the change; THIS verifier must be a different agent/model. Preferred:
|
|
71
|
+
# the CI-owned env ASDLC_VERIFY_COMMAND (trusted); the repo value is a fallback.
|
|
72
|
+
# It receives the verification prompt on stdin and prints strict JSON:
|
|
73
|
+
# {"verdict":"PASS|FAIL","summary":"...","requirements":[...]}
|
|
74
|
+
# verify:
|
|
75
|
+
# required: true
|
|
76
|
+
# command: "deepseek-verify --model deepseek-chat" # or: pi -p, codex exec, ...
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
#!/bin/sh
|
|
2
|
+
# asdlc post-merge: a merged spec PR IS the human approval (no store needed).
|
|
3
|
+
# Derive the approved SHA from the merge and stamp READY_FOR_IMPL so that task
|
|
4
|
+
# generation / implementation can start automatically.
|
|
5
|
+
#
|
|
6
|
+
# No global `asdlc` install is assumed: we try a local devDependency, then PATH,
|
|
7
|
+
# then an explicit toolkit checkout (ASDLC_TOOLKIT).
|
|
8
|
+
BRANCH="$(git symbolic-ref --quiet --short HEAD 2>/dev/null)"
|
|
9
|
+
case "$BRANCH" in main|master) ;; *) exit 0 ;; esac
|
|
10
|
+
|
|
11
|
+
run() { "$@" approve || echo "[asdlc] approval stamp skipped"; }
|
|
12
|
+
|
|
13
|
+
if [ -x node_modules/.bin/asdlc ]; then
|
|
14
|
+
run node_modules/.bin/asdlc
|
|
15
|
+
elif command -v asdlc >/dev/null 2>&1; then
|
|
16
|
+
run asdlc
|
|
17
|
+
elif [ -n "${ASDLC_TOOLKIT:-}" ] && [ -f "$ASDLC_TOOLKIT/bin/asdlc.js" ]; then
|
|
18
|
+
run node "$ASDLC_TOOLKIT/bin/asdlc.js"
|
|
19
|
+
else
|
|
20
|
+
echo "[asdlc] asdlc not found (local bin / PATH / ASDLC_TOOLKIT); skipping approval stamp"
|
|
21
|
+
fi
|
|
22
|
+
exit 0
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
#!/bin/sh
|
|
2
|
+
# asdlc pre-push: trigger the Jenkins gate for this change. With a real SCM
|
|
3
|
+
# webhook + multibranch pipeline this is optional (demonstration/local use).
|
|
4
|
+
JENKINS_URL="${ASDLC_JENKINS_URL:-http://localhost:8080}"
|
|
5
|
+
BRANCH="$(git symbolic-ref --quiet --short HEAD 2>/dev/null)"
|
|
6
|
+
case "$BRANCH" in main|master) exit 0 ;; esac
|
|
7
|
+
|
|
8
|
+
CHANGE_ID="$(printf '%s' "${BRANCH##*/}" | tr '[:lower:]' '[:upper:]')"
|
|
9
|
+
MODE="lint"
|
|
10
|
+
case "$BRANCH" in *impl*) MODE="gate" ;; esac
|
|
11
|
+
|
|
12
|
+
echo "[asdlc] push: branch=$BRANCH change=$CHANGE_ID mode=$MODE"
|
|
13
|
+
curl -s -o /dev/null -w "[asdlc] jenkins trigger http=%{http_code}\n" -X POST \
|
|
14
|
+
"$JENKINS_URL/job/asdlc-pr/buildWithParameters" \
|
|
15
|
+
--data-urlencode "CHANGE_ID=$CHANGE_ID" \
|
|
16
|
+
--data-urlencode "MODE=$MODE" 2>/dev/null || echo "[asdlc] jenkins unreachable"
|
|
17
|
+
exit 0
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
# Platform-owned SDLC policy (v6 §7.3). Teams must NOT edit this file; protect
|
|
2
|
+
# it with CODEOWNERS. `asdlc init` writes a default; the platform team tunes it.
|
|
3
|
+
#
|
|
4
|
+
# PR type is decided by PATHS ONLY (the `asdlc verify` check `pr-type`).
|
|
5
|
+
|
|
6
|
+
# Paths that carry APPROVED INTENT: any change here needs the spec approver +
|
|
7
|
+
# AI review, and defines the "approved commit" (git log -1 <main> -- these).
|
|
8
|
+
locked_paths:
|
|
9
|
+
- "openspec/changes/*/proposal.md"
|
|
10
|
+
- "openspec/changes/*/specs/**"
|
|
11
|
+
|
|
12
|
+
# Paths under design control (design owner approves).
|
|
13
|
+
controlled:
|
|
14
|
+
- "openspec/changes/*/design.md"
|
|
15
|
+
|
|
16
|
+
# Fast path: no change dir, and every changed path is whitelisted.
|
|
17
|
+
fast_path:
|
|
18
|
+
allow_paths:
|
|
19
|
+
- "docs/**"
|
|
20
|
+
- "**/*.md"
|
|
21
|
+
allow_kinds: [typo, config-value, dependency-patch]
|
|
22
|
+
|
|
23
|
+
# Reviewers (CODEOWNERS-style handles).
|
|
24
|
+
reviewers:
|
|
25
|
+
spec: null
|
|
26
|
+
design: null
|
|
27
|
+
|
|
28
|
+
# AI review trigger policy (cost control).
|
|
29
|
+
ai_review:
|
|
30
|
+
trigger: on-ready-and-push
|
|
31
|
+
debounce_seconds: 120
|
|
32
|
+
|
|
33
|
+
# Rollout: per-check block|advisory (v6 §11 "先参考模式,再阻断").
|
|
34
|
+
# Check names match the `asdlc verify` rows, e.g. schema-managed, spec-quality,
|
|
35
|
+
# pr-type, approved-spec. Missing => block.
|
|
36
|
+
rollout_mode: {}
|
|
37
|
+
|
|
38
|
+
# Web search for agent fact-finding during grilling (Stage 2).
|
|
39
|
+
# allow: agent may search (default); deny: offline/air-gapped mode, agent skips search silently.
|
|
40
|
+
web_search: allow
|
|
41
|
+
|
|
42
|
+
# Issue tracker integration (optional). Set required: true to enforce a ticket link in verify.
|
|
43
|
+
# type: jira | github | linear | none
|
|
44
|
+
issue_tracker:
|
|
45
|
+
type: none
|
|
46
|
+
required: false
|