@akjamie/agentic-sdlc 0.0.0-stage → 1.1.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/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 +168 -0
- package/assets/schema/templates/design.md +134 -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 +49 -0
- package/assets/skills/asdlc-doctor/SKILL.md +82 -0
- package/assets/skills/asdlc-impl-review/SKILL.md +219 -0
- package/assets/skills/asdlc-init/SKILL.md +68 -0
- package/assets/skills/asdlc-lint/SKILL.md +59 -0
- package/assets/skills/asdlc-new/SKILL.md +107 -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 +206 -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 +89 -0
- package/src/commands/apply.js +114 -0
- package/src/commands/approve.js +166 -0
- package/src/commands/archive.js +143 -0
- package/src/commands/doctor.js +163 -0
- package/src/commands/init.js +201 -0
- package/src/commands/lint.js +127 -0
- package/src/commands/new.js +171 -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/test.js +137 -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 +23 -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 +60 -0
- package/src/lib/prtype.js +41 -0
- package/src/lib/schema.js +86 -0
- package/src/lib/speclint.js +173 -0
- package/src/lib/tdd.js +71 -0
- package/src/lib/yaml.js +18 -0
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
# Technical Design: <!-- change id -->
|
|
2
|
+
|
|
3
|
+
> Requirement: "<!-- requirement summary -->"
|
|
4
|
+
> Purpose: Concrete architecture, interface contracts, external integration models, and UI/UX specifications.
|
|
5
|
+
> NOTE: This document guides implementation (HOW). Do NOT duplicate behavioral BDD requirements from spec.md.
|
|
6
|
+
|
|
7
|
+
## 1. Context & Background
|
|
8
|
+
<!-- Current state, existing architectural patterns, dependencies, and constraints needed to ground the approach. -->
|
|
9
|
+
|
|
10
|
+
## 2. System Architecture & Component Interaction
|
|
11
|
+
<!--
|
|
12
|
+
Component breakdown, responsibilities, data flow, and lifecycles.
|
|
13
|
+
Include a Mermaid flowchart or sequence diagram where components interact:
|
|
14
|
+
```mermaid
|
|
15
|
+
sequenceDiagram
|
|
16
|
+
autonumber
|
|
17
|
+
actor User
|
|
18
|
+
participant Client as Frontend/UI
|
|
19
|
+
participant Svc as Service/API Layer
|
|
20
|
+
participant Ext as External 3rd-Party API
|
|
21
|
+
User->>Client: Triggers action
|
|
22
|
+
Client->>Svc: Request with validated params
|
|
23
|
+
Svc->>Ext: Upstream call (cached/debounced)
|
|
24
|
+
Ext-->>Svc: Response or error
|
|
25
|
+
Svc-->>Client: Normalized contract
|
|
26
|
+
Client-->>User: Render state (success/empty/error)
|
|
27
|
+
```
|
|
28
|
+
-->
|
|
29
|
+
|
|
30
|
+
## 3. Interface Contracts & Data Models
|
|
31
|
+
<!--
|
|
32
|
+
Specify exact TypeScript interfaces, JSON schemas, or DTO structures.
|
|
33
|
+
Define request, response, and domain models to eliminate ambiguity during implementation.
|
|
34
|
+
-->
|
|
35
|
+
|
|
36
|
+
## 4. External Services & 3rd-Party API Integration
|
|
37
|
+
<!--
|
|
38
|
+
MANDATORY if this change integrates external vendor APIs or services.
|
|
39
|
+
- Endpoints & Authentication: Exact URLs, parameters, headers, and secret management.
|
|
40
|
+
- Rate Limiting & Quotas: Upstream limit constraints (e.g. 100 req/min, 5,000/day).
|
|
41
|
+
- Client Lifecycle & Caching Strategy:
|
|
42
|
+
- Cache type: in-memory Map / TTL cache / Redis.
|
|
43
|
+
- Cache key formulation, TTL duration, eviction policy.
|
|
44
|
+
- Lifecycle: Reuse client instance (singleton/service pool); NEVER re-instantiate clients per request.
|
|
45
|
+
- Error Taxonomy & Degradation/Fallback:
|
|
46
|
+
- Ambiguous input: Candidate list returned, never wrong guess.
|
|
47
|
+
- Upstream 4xx/5xx / Quota exhaustion: User-friendly error message, fallback cache, retry with exponential backoff.
|
|
48
|
+
- Offline/Network failure: Clear degradation banner without unhandled rejections.
|
|
49
|
+
- Unverified endpoints/limits: Tag with [UNVERIFIED: <reason>] for explicit human review.
|
|
50
|
+
-->
|
|
51
|
+
|
|
52
|
+
## 5. UI/UX Design, Visual Hierarchy & Aesthetics
|
|
53
|
+
<!--
|
|
54
|
+
MANDATORY if this change adds or modifies user interfaces (Web, Mobile, Desktop).
|
|
55
|
+
Zero tolerance for unstyled, raw, or toy HTML!
|
|
56
|
+
-->
|
|
57
|
+
|
|
58
|
+
### 5.1 Design Reference Ground Truth (REQUIRED)
|
|
59
|
+
<!--
|
|
60
|
+
Do NOT invent design tokens or palettes in isolation.
|
|
61
|
+
Specify the concrete human-provided design ground truth:
|
|
62
|
+
- Mockup link / Figma URL: <url or file path>
|
|
63
|
+
- Brand styleguide / design tokens: <reference or existing CSS tokens file>
|
|
64
|
+
- Reference application / URL: <benchmark url>
|
|
65
|
+
- Key visual style notes: <e.g., modern dark card-based dashboard, rounded corners, subtle glassmorphism>
|
|
66
|
+
-->
|
|
67
|
+
- Reference: <!-- insert link, file, or brand token reference -->
|
|
68
|
+
- Style summary: <!-- 1-2 sentences on visual direction -->
|
|
69
|
+
|
|
70
|
+
### 5.2 Visual Theme & Design Tokens
|
|
71
|
+
<!-- Derive concrete variables from the reference above: -->
|
|
72
|
+
- Color Palette:
|
|
73
|
+
- `--color-primary`: <!-- e.g. #2563eb -->
|
|
74
|
+
- `--color-background`: <!-- e.g. #0f172a -->
|
|
75
|
+
- `--color-surface`: <!-- e.g. #1e293b -->
|
|
76
|
+
- `--color-text-primary`: <!-- e.g. #f8fafc -->
|
|
77
|
+
- `--color-text-muted`: <!-- e.g. #94a3b8 -->
|
|
78
|
+
- `--color-border`: <!-- e.g. #334155 -->
|
|
79
|
+
- `--color-accent`: <!-- e.g. #38bdf8 -->
|
|
80
|
+
- Typography:
|
|
81
|
+
- Font family: <!-- e.g. 'Plus Jakarta Sans', system-ui -->
|
|
82
|
+
- Scale: base (16px), heading (24px/32px)
|
|
83
|
+
- Spacing & Radii:
|
|
84
|
+
- `--radius`: <!-- e.g. 12px -->
|
|
85
|
+
- `--spacing-unit`: <!-- e.g. 8px -->
|
|
86
|
+
|
|
87
|
+
### 5.3 Component Hierarchy & Responsive Breakpoints
|
|
88
|
+
- Layout: Topbar/Hero, Search with debounce, Content Cards Grid, Detail Panel.
|
|
89
|
+
- Breakpoints:
|
|
90
|
+
- Mobile (<= 640px): single-column, stacked layout.
|
|
91
|
+
- Tablet (<= 1024px): 2-column grid.
|
|
92
|
+
- Desktop (> 1024px): 3-column / sidebar + main grid.
|
|
93
|
+
|
|
94
|
+
### 5.4 Mandatory Interactive States
|
|
95
|
+
Every UI component must specify all 5 states:
|
|
96
|
+
1. Default: Polished styling adhering to design tokens.
|
|
97
|
+
2. Hover/Active: Micro-transitions (0.2s ease).
|
|
98
|
+
3. Loading State: Skeleton cards or subtle spinners (no blank screens).
|
|
99
|
+
4. Empty State: Friendly icon/illustration, descriptive message, actionable prompt.
|
|
100
|
+
5. Error State: Banner with clear explanation and retry action.
|
|
101
|
+
|
|
102
|
+
## 6. Security Architecture & Operational NFRs (Optional / When Applicable)
|
|
103
|
+
<!--
|
|
104
|
+
Document this section when the change introduces public interfaces, handles sensitive/user data,
|
|
105
|
+
integrates external rate-limited services, or has explicit latency/resource constraints.
|
|
106
|
+
For changes without external dependencies or strict SLAs, omit this section or mark as (N/A).
|
|
107
|
+
Do NOT invent arbitrary default values.
|
|
108
|
+
-->
|
|
109
|
+
|
|
110
|
+
### 6.1 Security & Threat Mitigation (If Applicable)
|
|
111
|
+
<!-- Detail concrete defense mechanisms if the change touches auth, inputs, or secrets: -->
|
|
112
|
+
- Authentication & Authorization: <!-- Caller identity verification, role/scope enforcement, or N/A -->
|
|
113
|
+
- Input Validation & Boundaries: <!-- Schema constraints, bounds, sanitization, or N/A -->
|
|
114
|
+
- Secret & Credential Lifecycle: <!-- Injected via environment variables, never logged, or N/A -->
|
|
115
|
+
- Data Privacy & PII Protection: <!-- Data classification, retention policies, or N/A -->
|
|
116
|
+
|
|
117
|
+
### 6.2 Performance Budgets & Operational NFRs (If Applicable)
|
|
118
|
+
<!-- Document operational constraints only when required by architecture, scale, or SLAs: -->
|
|
119
|
+
- Latency Budgets & SLAs: <!-- Target p95/p99 latency or response time bounds, if applicable -->
|
|
120
|
+
- Resource Bounds & Lifecycles: <!-- Cache size caps, TTL expiration, memory guards, if applicable -->
|
|
121
|
+
- Upstream Quota & Rate Limit Protection: <!-- Singleton client reuse, exponential backoff, if applicable -->
|
|
122
|
+
- Graceful Degradation: <!-- Downstream timeout bounds, stale/offline fallback, if applicable -->
|
|
123
|
+
|
|
124
|
+
## 7. Key Decisions & Alternatives
|
|
125
|
+
<!--
|
|
126
|
+
Document technical decisions made during grilling:
|
|
127
|
+
- Decision 1: [Choice] vs [Alternative] -> Rationale.
|
|
128
|
+
- Decision 2: ...
|
|
129
|
+
-->
|
|
130
|
+
|
|
131
|
+
## 8. Migration, Rollout & Rollback
|
|
132
|
+
<!--
|
|
133
|
+
Database migrations, deployment steps, feature flags, or rollback procedures (if applicable).
|
|
134
|
+
-->
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# Proposal: <!-- change title -->
|
|
2
|
+
|
|
3
|
+
## Why
|
|
4
|
+
<!-- 1-2 sentences: the problem or opportunity, and why now -->
|
|
5
|
+
|
|
6
|
+
## What Changes
|
|
7
|
+
<!-- specific changes; mark breaking changes with **BREAKING** -->
|
|
8
|
+
-
|
|
9
|
+
|
|
10
|
+
## Capabilities
|
|
11
|
+
- **New Capabilities**: <!-- each becomes specs/<capability-path>/spec.md -->
|
|
12
|
+
- **Modified Capabilities**: <!-- exact existing path under openspec/specs/ -->
|
|
13
|
+
|
|
14
|
+
## Impact
|
|
15
|
+
<!-- affected code, APIs, dependencies, or systems -->
|
|
16
|
+
-
|
|
17
|
+
|
|
18
|
+
## Out of Scope
|
|
19
|
+
<!-- What this change explicitly does NOT cover. Prevents scope creep. -->
|
|
20
|
+
|
|
21
|
+
## Dependencies & Assumptions
|
|
22
|
+
<!-- What this change assumes about other systems, teams, or timelines -->
|
|
23
|
+
|
|
24
|
+
## System Design refs
|
|
25
|
+
<!-- e.g. payment-settlement@v2 ; leave empty if no cross-repo contract -->
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
# Independent Review: <!-- change id -->
|
|
2
|
+
|
|
3
|
+
> Reviewer agent (fresh context, different from Draft). Read-only: must not modify proposal/specs/tasks.
|
|
4
|
+
|
|
5
|
+
## Verdict
|
|
6
|
+
<!-- overall: APPROVE | NEEDS_REVISION -->
|
|
7
|
+
|
|
8
|
+
## Dimension Verdicts
|
|
9
|
+
| Dimension | Verdict | Notes |
|
|
10
|
+
|---|---|---|
|
|
11
|
+
| Completeness | | |
|
|
12
|
+
| Ambiguity | | |
|
|
13
|
+
| Cross-repo consistency | | |
|
|
14
|
+
| Contract impact | | |
|
|
15
|
+
| Testability | | |
|
|
16
|
+
| Security | | |
|
|
17
|
+
|
|
18
|
+
## Requirement -> Implementation -> Test
|
|
19
|
+
| AC | Implementation | Test |
|
|
20
|
+
|---|---|---|
|
|
21
|
+
| | TBD | TBD |
|
|
22
|
+
|
|
23
|
+
## Blocking Findings
|
|
24
|
+
<!-- numbered list; empty if none -->
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
# Spec Delta
|
|
2
|
+
|
|
3
|
+
## Purpose
|
|
4
|
+
<!-- New capabilities only: 1-2 sentences (50+ chars). Delete for an existing capability. -->
|
|
5
|
+
|
|
6
|
+
## ADDED Requirements
|
|
7
|
+
|
|
8
|
+
### Requirement: <!-- requirement name -->
|
|
9
|
+
<!-- The system SHALL ... -->
|
|
10
|
+
|
|
11
|
+
#### Scenario: <!-- scenario name -->
|
|
12
|
+
- **GIVEN** <!-- context / precondition -->
|
|
13
|
+
- **WHEN** <!-- action / trigger -->
|
|
14
|
+
- **THEN** <!-- observable outcome -->
|
|
15
|
+
|
|
16
|
+
**Acceptance criteria**
|
|
17
|
+
<!-- Each AC: concrete, testable assertion — not prose. Must map to a test. -->
|
|
18
|
+
- [ ] AC1: <!-- concrete assertion --> (test: <!-- path/to/test -->)
|
|
19
|
+
- [ ] AC2: <!-- concrete assertion --> (test: <!-- path/to/test -->)
|
|
20
|
+
|
|
21
|
+
## MODIFIED Requirements
|
|
22
|
+
<!-- Copy the ENTIRE existing requirement block (incl. scenarios + AC), then edit. -->
|
|
23
|
+
|
|
24
|
+
## REMOVED Requirements
|
|
25
|
+
<!-- ### Requirement: <name> ; **Reason**: ... ; **Migration**: ... -->
|
|
26
|
+
|
|
27
|
+
## Constraints & NFRs
|
|
28
|
+
<!-- Non-functional requirements as verifiable statements, not adjectives. -->
|
|
29
|
+
<!-- e.g. "p99 < 200ms for read ops", "no PII in logs", "works offline" -->
|
|
30
|
+
|
|
31
|
+
## Out of Scope
|
|
32
|
+
<!-- What this change explicitly does NOT cover. Prevents scope creep. -->
|
|
33
|
+
|
|
34
|
+
## Test Strategy
|
|
35
|
+
<!-- How every AC is verified: unit / integration / contract / UI, and which are manual. -->
|
|
36
|
+
|
|
37
|
+
<!-- IMMUTABLE once approved (PR merged). Execution state belongs in tasks.md. -->
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
# Tasks
|
|
2
|
+
|
|
3
|
+
<!-- Mutable execution state, generated AFTER approval. Not part of approved intent. -->
|
|
4
|
+
<!-- Follow task-level TDD: for each task or task-pair, write failing test -> implement -> paste test output. -->
|
|
5
|
+
|
|
6
|
+
## 1. <!-- group name -->
|
|
7
|
+
- [ ] 1.1 [TEST] <!-- write failing test for AC<n> (test: path/to/test) -->
|
|
8
|
+
- <!-- verify: run test command, assert expected failure -->
|
|
9
|
+
- [ ] 1.2 [IMPL] <!-- implement minimum code to pass 1.1 (AC<n>) -->
|
|
10
|
+
- <!-- evidence: paste test runner pass output -->
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: asdlc-apply
|
|
3
|
+
description: "Execute Stage 5 of Agentic SDLC: guard verification followed by strict task-level TDD loop (Red -> Green -> Refactor -> Evidence -> Converge) from tasks.md."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# /asdlc:apply - Task-Level TDD Implementation Engine
|
|
7
|
+
|
|
8
|
+
This skill executes **Stage 5 (Apply)** of the Agentic SDLC. It enforces strict task-level Test-Driven Development (TDD) and the Converge protocol.
|
|
9
|
+
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
## The TDD Principle
|
|
13
|
+
|
|
14
|
+
> **No production code is written without a prior failing test.**
|
|
15
|
+
> Marking a task complete without captured test evidence is a verification blocker.
|
|
16
|
+
|
|
17
|
+
---
|
|
18
|
+
|
|
19
|
+
## Workflow Sequence
|
|
20
|
+
|
|
21
|
+
### Step 1: Run the Apply Guard (Pre-Implementation Security Check)
|
|
22
|
+
Before editing any implementation or test code, run the apply guard:
|
|
23
|
+
|
|
24
|
+
```powershell
|
|
25
|
+
asdlc apply <CHANGE_ID>
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
`asdlc apply` deterministically verifies four cryptographic preconditions:
|
|
29
|
+
1. **Target Branch Approved Commit (`approvedSha`)**: Confirms that a commit touching the locked paths (`proposal.md` and `specs/**`) is physically merged into the target branch (`main` or `origin/main`).
|
|
30
|
+
2. **Change State Machine (`ready_for_impl`)**: Confirms `.openspec.yaml` has been transitioned to `status: ready_for_impl` (via `asdlc approve <ID>`).
|
|
31
|
+
3. **Spec Fingerprint Integrity (`specSha`)**: Verifies that the declared `specSha` in `.openspec.yaml` exactly matches the `approvedSha` on the protected branch.
|
|
32
|
+
4. **Working Tree Tamper Defense**: Ensures that locked spec files (`proposal.md`, `specs/**`) have no uncommitted local modifications.
|
|
33
|
+
|
|
34
|
+
- If `asdlc apply` fails: **STOP immediately**. Follow the provided hint (e.g. merge Spec PR or run `asdlc approve`).
|
|
35
|
+
- If `asdlc apply` succeeds: Proceed to Step 2.
|
|
36
|
+
|
|
37
|
+
### Step 2: Read `tasks.md` and Ground Context
|
|
38
|
+
1. Open and read `openspec/changes/<CHANGE_ID>/tasks.md`.
|
|
39
|
+
2. Inspect the spec requirements in `openspec/changes/<CHANGE_ID>/specs/**/*.md` to understand the acceptance criteria (`AC<n>`) and required test mappings (`(test: <path>)`).
|
|
40
|
+
3. Identify the next unchecked task (`- [ ]`).
|
|
41
|
+
|
|
42
|
+
### Step 3: The Task-Level TDD Loop (Per Task)
|
|
43
|
+
|
|
44
|
+
For every task in `tasks.md`, execute this exact 5-phase loop:
|
|
45
|
+
|
|
46
|
+
#### Phase A: RED (Write the Failing Test)
|
|
47
|
+
1. Write or expand the unit/integration test in the target test file.
|
|
48
|
+
2. Run the repository test command (e.g., `npm test`, `pytest`, `go test`).
|
|
49
|
+
3. **Assert Failure:** Verify that the test fails for the *expected* reason (e.g., function not found, assertion mismatched).
|
|
50
|
+
4. If the test passes before implementation: the test is invalid or redundant. Fix the test until it accurately tests the unwritten feature.
|
|
51
|
+
|
|
52
|
+
#### Phase B: GREEN (Implement the Minimum Code)
|
|
53
|
+
1. Implement the minimal code required to satisfy the failing test.
|
|
54
|
+
2. Do not write anticipatory code or unrequested abstractions.
|
|
55
|
+
3. Run the test command again.
|
|
56
|
+
4. **Assert Pass:** Verify that the test now passes cleanly (`Exit Code: 0`).
|
|
57
|
+
|
|
58
|
+
#### Phase C: REFACTOR & CONVERGE
|
|
59
|
+
1. Clean up implementation, adhere to repo standards, remove dead code.
|
|
60
|
+
2. Re-run all existing tests to ensure no regressions.
|
|
61
|
+
3. **Converge Protocol:** If reality disagrees with the spec during implementation:
|
|
62
|
+
- **Type A (Implementation error):** Write reproducing test, append fix task, remain in PR.
|
|
63
|
+
- **Type B (Missing test):** Add missing test, remain in PR.
|
|
64
|
+
- **Type C (Spec gap/conflict):** **STOP**. Never silently edit locked spec files (`proposal.md`, `specs/**`). Report `SPEC_GAP` to the user and approver.
|
|
65
|
+
|
|
66
|
+
#### Phase D: Record Evidence & Check Box
|
|
67
|
+
1. Under the completed task in `tasks.md`, record the test run command and output:
|
|
68
|
+
```markdown
|
|
69
|
+
- [x] 1.1 [TEST] Add failing test for AC1 (`test/feature.test.js`)
|
|
70
|
+
- verify: `npm test` -> PASS (test/feature.test.js: 3 passed)
|
|
71
|
+
- [x] 1.2 [IMPL] Implement minimal code for AC1
|
|
72
|
+
- evidence: `npm test` -> PASS (all 35 passed)
|
|
73
|
+
```
|
|
74
|
+
2. Mark the checkbox `- [x]`.
|
|
75
|
+
|
|
76
|
+
---
|
|
77
|
+
|
|
78
|
+
### Special Guidance: Web & Mobile Applications (UI Design Tasks)
|
|
79
|
+
|
|
80
|
+
> [!IMPORTANT]
|
|
81
|
+
> **Is UI Design required or nice-to-have for Web/Mobile apps?**
|
|
82
|
+
> **Verdict: It is ESSENTIAL (Required in `tasks.md`), not a nice-to-have.**
|
|
83
|
+
|
|
84
|
+
When a change introduces or modifies user-facing interfaces (web, mobile, or desktop):
|
|
85
|
+
1. **Design Foundation Must Precede Logic**:
|
|
86
|
+
Never jump directly into business logic or raw HTML/JSX. Skipping UI design creates unstyled, disjointed MVPs that violate usability and require costly refactoring.
|
|
87
|
+
2. **Decompose UI Work into Explicit `tasks.md` Tasks**:
|
|
88
|
+
For any change touching frontend views, `tasks.md` should structure tasks into three progressive tiers:
|
|
89
|
+
- **Tier 1 · [UI/DESIGN] Visual & Token Scaffolding**:
|
|
90
|
+
Establish or update design tokens (colors, typography, spacing, CSS variables, dark/light theme), responsive layout containers, and navigation hierarchy.
|
|
91
|
+
- **Tier 2 · [UI/COMPONENTS] Interactive Component States**:
|
|
92
|
+
Build reusable components with all mandatory states: **Empty**, **Loading**, **Error**, and **Success/Data-bound**. Validate via component render tests or visual snapshots.
|
|
93
|
+
- **Tier 3 · [LOGIC/INTEGRATION] State & API Wiring**:
|
|
94
|
+
Wire state stores, API clients, forms, and business logic with unit & E2E integration tests fulfilling the spec's ACs.
|
|
95
|
+
|
|
96
|
+
---
|
|
97
|
+
|
|
98
|
+
### Step 4: Run Verification Gate
|
|
99
|
+
Once all tasks in `tasks.md` are checked and evidenced, run `asdlc verify`:
|
|
100
|
+
|
|
101
|
+
```powershell
|
|
102
|
+
asdlc verify <CHANGE_ID>
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
Verify that all checks pass:
|
|
106
|
+
- `approved-spec`
|
|
107
|
+
- `flow-state`
|
|
108
|
+
- `tasks-complete`
|
|
109
|
+
- `test-presence` (diff contains tests alongside source code)
|
|
110
|
+
- `tdd-evidence` (tasks have valid verification statements/evidence)
|
|
111
|
+
- `BDD + acceptance criteria`
|
|
112
|
+
- `openspec-validate`
|
|
113
|
+
|
|
114
|
+
---
|
|
115
|
+
|
|
116
|
+
### Step 5: Open Implementation PR
|
|
117
|
+
Once `asdlc verify <CHANGE_ID>` passes, execute `asdlc pr` to open the Implementation PR:
|
|
118
|
+
|
|
119
|
+
```powershell
|
|
120
|
+
asdlc pr <CHANGE_ID> <targetBranch>
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
`asdlc pr` will:
|
|
124
|
+
1. Automatically detect this is an **Implementation PR** (status is `ready_for_impl`, spec is approved, tasks are complete, and source changes exist).
|
|
125
|
+
2. Run `asdlc verify <CHANGE_ID>` as a pre-flight guard (requiring all 12 verification checks to pass).
|
|
126
|
+
3. Commit implementation code and test evidence, then push to origin.
|
|
127
|
+
4. Pre-provision and attach `asdlc:impl-review` and `impl` labels to trigger CI Code AI Review.
|
|
128
|
+
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: asdlc-approve
|
|
3
|
+
description: "Execute Stage 4 of Agentic SDLC: approve spec intent, lock specSha, and transition change to READY_FOR_IMPL across any enterprise Git workflow."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# /asdlc:approve - Spec Approval & Implementation Unlocking
|
|
7
|
+
|
|
8
|
+
This skill executes **Stage 4 (Approve)** of the Agentic SDLC. It transitions a change from approved intent into the implementation stage (`READY_FOR_IMPL`), locking the spec to a path-limited approved commit SHA (`specSha`).
|
|
9
|
+
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
## Core Concept: The Spec SHA Freeze Gate
|
|
13
|
+
|
|
14
|
+
`asdlc approve` is **branch-agnostic**. It does not enforce a rigid branching dogma, nor does it require selecting artificial "modes".
|
|
15
|
+
|
|
16
|
+
In enterprise environments (whether using `feature -> staging -> main`, trunk-based, or multi-level git flow), **Approve** represents a single cryptographic gate:
|
|
17
|
+
|
|
18
|
+
```text
|
|
19
|
+
[Stage 2: Grilling / Proposal]
|
|
20
|
+
↓
|
|
21
|
+
[Stage 3: Lint & Spec PR] ── asdlc lint <ID> / asdlc pr <ID> [target]
|
|
22
|
+
↓
|
|
23
|
+
[Stage 4: APPROVE GATE] ── asdlc approve <ID>
|
|
24
|
+
│ Locks: specSha = sha(proposal.md + specs/**)
|
|
25
|
+
│ Sets: status = ready_for_impl
|
|
26
|
+
│ Writes: review.md (verdict: APPROVE)
|
|
27
|
+
↓
|
|
28
|
+
[Stage 5: TDD Implementation] ── asdlc apply <ID>
|
|
29
|
+
↓
|
|
30
|
+
[Stage 6: CI Verification] ── asdlc verify <ID>
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
Whenever human stakeholders or Tech Leads agree on the spec:
|
|
34
|
+
1. `asdlc approve <CHANGE_ID>` calculates the exact Git commit SHA that touched `proposal.md` and `specs/**`.
|
|
35
|
+
2. Stamped into `.openspec.yaml` as `specSha: <sha>` and `status: ready_for_impl`.
|
|
36
|
+
3. Stamped into `review.md` with `## Verdict: APPROVE`.
|
|
37
|
+
4. Git commit automatically created for the approval stamp.
|
|
38
|
+
|
|
39
|
+
From this moment on, **Stage 5 (`asdlc apply`) is unlocked**, and **Stage 6 (`asdlc verify`) will fail if anyone or any AI tampers with the approved spec files during implementation**.
|
|
40
|
+
|
|
41
|
+
---
|
|
42
|
+
|
|
43
|
+
## Enterprise Workflows Supported
|
|
44
|
+
|
|
45
|
+
### 1. Unified Feature Branch Flow (Most Popular)
|
|
46
|
+
- Developer/AI authors spec on `feat/xxx` (or `spec/xxx`).
|
|
47
|
+
- Open Spec PR for early feedback: `asdlc pr <ID> staging` (or `main`, matching your pipeline).
|
|
48
|
+
- Tech Lead / Product Owner reviews:
|
|
49
|
+
- Run `asdlc approve <ID>` directly on the branch.
|
|
50
|
+
- Developer/AI runs `asdlc apply <ID>` and writes code + tests on the same branch.
|
|
51
|
+
- Final PR merges code + verified spec together into the target branch.
|
|
52
|
+
|
|
53
|
+
### 2. Spec-First Staged PR Flow (Multi-tier Enterprise Pipelines)
|
|
54
|
+
- Spec is submitted as an isolated Spec-only PR into `staging` or `main`.
|
|
55
|
+
- When the Spec PR merges, the `post-merge` hook or CI automatically runs `asdlc approve <ID>`.
|
|
56
|
+
- The implementation is then performed on an implementation branch branching from the approved merge commit.
|
|
57
|
+
|
|
58
|
+
### 3. Local / In-Place Fast Loop (Agile Squads)
|
|
59
|
+
- Tech Lead and developers collaborate locally or pair on a branch.
|
|
60
|
+
- Tech Lead reviews locally and executes `asdlc approve <ID>`.
|
|
61
|
+
- Unblocks `asdlc apply <ID>` immediately.
|
|
62
|
+
|
|
63
|
+
---
|
|
64
|
+
|
|
65
|
+
## Command Reference
|
|
66
|
+
|
|
67
|
+
### Opening the Spec PR
|
|
68
|
+
```powershell
|
|
69
|
+
asdlc pr <CHANGE_ID> [targetBranch]
|
|
70
|
+
```
|
|
71
|
+
- `targetBranch`: The base branch this PR will merge into (`staging`, `main`, `develop`, or parent feature branch). If omitted, defaults to the repository's upstream or default branch.
|
|
72
|
+
- Automatically lints the spec before pushing (fails fast if blocking findings).
|
|
73
|
+
- Automatically extracts the PR Title and Body from `proposal.md`.
|
|
74
|
+
- Automatically opens PR via `gh`/`glab` CLI, GitHub REST API, or 1-click web comparison link.
|
|
75
|
+
|
|
76
|
+
### Approving the Spec
|
|
77
|
+
```powershell
|
|
78
|
+
asdlc approve <CHANGE_ID>
|
|
79
|
+
```
|
|
80
|
+
Executes:
|
|
81
|
+
1. Identifies the path-limited `approvedSha` of the spec.
|
|
82
|
+
2. Updates `.openspec.yaml`: `specSha: <approvedSha>`, `status: ready_for_impl`.
|
|
83
|
+
3. Creates or updates `review.md` with `APPROVE` verdict and approval audit record.
|
|
84
|
+
4. Creates a Git commit with the approval stamp.
|
|
85
|
+
|
|
86
|
+
Expected output:
|
|
87
|
+
```text
|
|
88
|
+
✔ <SLUG>: APPROVED specSha=<shortSha> status=ready_for_impl
|
|
89
|
+
✔ <SLUG>: stamped review.md (verdict=APPROVE, specSha=<shortSha>)
|
|
90
|
+
✔ committed approval stamp
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
---
|
|
94
|
+
|
|
95
|
+
## Next Steps After Approval
|
|
96
|
+
|
|
97
|
+
1. Inspect `openspec/changes/<CHANGE_ID>/tasks.md` and confirm strict TDD task pairing:
|
|
98
|
+
```markdown
|
|
99
|
+
## 1. Implementation
|
|
100
|
+
- [ ] 1.1 [TEST] Add failing test for AC1 in `test/auth.test.js`
|
|
101
|
+
- [ ] 1.2 [IMPL] Implement authentication logic
|
|
102
|
+
```
|
|
103
|
+
2. Prompt developer / AI:
|
|
104
|
+
> "✅ Spec successfully approved!
|
|
105
|
+
> - `specSha` locked at `<shortSha>`.
|
|
106
|
+
> - Status stamped: `READY_FOR_IMPL`.
|
|
107
|
+
> Run `/asdlc:apply <CHANGE_ID>` to begin the task-level TDD implementation loop."
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: asdlc-archive
|
|
3
|
+
description: "Explicitly close and archive a verified change (Stage 7): confirm post-merge review, move change to archive, refresh code knowledge graph, and update AGENTS.md system status."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# /asdlc:archive - Deliberate Human Archive Gate
|
|
7
|
+
|
|
8
|
+
This skill executes **Stage 7 (Archive)** of the Agentic SDLC. Archiving is an explicit, human-confirmed milestone — never automatically triggered by verify — marking that post-merge testing and human validation are complete.
|
|
9
|
+
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
## Why Archive is an Explicit Gate
|
|
13
|
+
|
|
14
|
+
1. `asdlc verify` proves that code matches the approved spec on CI.
|
|
15
|
+
2. In production engineering, teams often perform staging regression runs, canary validations, or stakeholder demos after merge.
|
|
16
|
+
3. Therefore, **a human makes the call** to archive and close the change.
|
|
17
|
+
|
|
18
|
+
---
|
|
19
|
+
|
|
20
|
+
## Workflow Sequence
|
|
21
|
+
|
|
22
|
+
### Step 1: Human Confirmation Check
|
|
23
|
+
Confirm with the user:
|
|
24
|
+
> "Have post-merge verification, staging testing, and stakeholder reviews completed for change `<CHANGE_ID>`?"
|
|
25
|
+
|
|
26
|
+
Wait for human confirmation before proceeding.
|
|
27
|
+
|
|
28
|
+
### Step 2: Capture Durable Lessons Learned
|
|
29
|
+
Before archiving, check if this change introduced durable system knowledge (new conventions, commands, architectural patterns). If so, update the relevant section of `AGENTS.md` (while leaving the `<!-- asdlc:routing -->` blocks intact).
|
|
30
|
+
|
|
31
|
+
### Step 3: Execute `asdlc archive`
|
|
32
|
+
Run:
|
|
33
|
+
|
|
34
|
+
```powershell
|
|
35
|
+
asdlc archive <CHANGE_ID>
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
The CLI:
|
|
39
|
+
1. Moves `openspec/changes/<SLUG>/` into `openspec/changes/archive/<SLUG>/`.
|
|
40
|
+
2. Syncs living specs into `openspec/specs/` and records the capability in `README.md`.
|
|
41
|
+
3. Rebuilds the AST knowledge graph (`graphify-out/`) against the new HEAD commit.
|
|
42
|
+
4. Creates `AGENTS.md` (if missing) and regenerates its `system-status` block with newly calculated architectural hubs and god nodes.
|
|
43
|
+
|
|
44
|
+
### Step 4: Confirm Archive Completion
|
|
45
|
+
Summarize the result to the user:
|
|
46
|
+
> "✅ Change `<CHANGE_ID>` successfully archived!
|
|
47
|
+
> - The change artifacts are archived under `openspec/changes/archive/<SLUG>/`.
|
|
48
|
+
> - The code knowledge graph has been refreshed to reflect the updated codebase.
|
|
49
|
+
> - `AGENTS.md` is updated with fresh system status."
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: asdlc-doctor
|
|
3
|
+
description: "Diagnose repository health, toolchain integrity, and governance drift across Node, OpenSpec, Graphify AST, schemas, policy, and git hooks. Provide automated remediation."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# /asdlc:doctor - Repository Health & Governance Diagnostics
|
|
7
|
+
|
|
8
|
+
This skill executes health, environment, and configuration integrity checks for the Agentic SDLC toolchain. It provides structured diagnostics and automated remediation recipes when platform drift occurs.
|
|
9
|
+
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
## What this skill checks
|
|
13
|
+
|
|
14
|
+
`asdlc doctor` verifies 12 environmental and governance invariants:
|
|
15
|
+
|
|
16
|
+
| Check | Requirement | Failure Impact | Remediation |
|
|
17
|
+
|---|---|---|---|
|
|
18
|
+
| **`node >= 20.19`** | Node.js version >= 20.19.0 | CLI sub-processes fail | Upgrade Node via `nvm` or system installer |
|
|
19
|
+
| **`OpenSpec CLI`** | Pinned `openspec` binary installed | Schema validation fails | Run `asdlc init` or `npm install -D openspec` |
|
|
20
|
+
| **`Graphify`** | Graphify CLI installed | Cannot build code AST graph | Run `uv tool install graphifyy` or `pip install graphifyy` |
|
|
21
|
+
| **`OpenSpec project`** | `openspec/` directory exists | Cannot store changes | Run `asdlc init` |
|
|
22
|
+
| **`managed schema`** | `agentic-repo-change` v1 installed centrally | Cannot validate changes | Run `asdlc init` |
|
|
23
|
+
| **`schema override`** | No committed overrides in `openspec/schemas/` | Forbidden local fork | Delete tracked local schema file |
|
|
24
|
+
| **`repo config schema`**| `openspec/config.yaml` declares `schema: agentic-repo-change` | Schema mismatch | Run `asdlc init --force` |
|
|
25
|
+
| **`.sdlc/policy.yaml`** | Committed platform policy exists | Approval & gate policy unset | Run `asdlc init` |
|
|
26
|
+
| **`.githooks`** | `core.hooksPath` set to `.githooks` | Git push/merge guards inactive | Run `git config core.hooksPath .githooks` |
|
|
27
|
+
| **`AGENTS.md routing`** | `AGENTS.md` contains routing block | Agent lacks navigation rules | Run `asdlc init` |
|
|
28
|
+
| **`knowledge graph`** | `graphify-out/` is fresh vs `HEAD` | Graph queries stale | Run `asdlc init` or `graphify .` |
|
|
29
|
+
| **`graphify-out ignored`**| `graphify-out` present in `.gitignore` | Cache committed to repo | Add `graphify-out` to `.gitignore` |
|
|
30
|
+
|
|
31
|
+
---
|
|
32
|
+
|
|
33
|
+
## Workflow Sequence
|
|
34
|
+
|
|
35
|
+
### Step 1: Run Diagnostics
|
|
36
|
+
Run in the repository root:
|
|
37
|
+
|
|
38
|
+
```powershell
|
|
39
|
+
asdlc doctor
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
Inspect output summary:
|
|
43
|
+
- If all checks show `[PASS]`: Report that the repository is completely healthy and aligned with platform standards.
|
|
44
|
+
- If any check shows `[FAIL]` or `[WARN]`: Proceed to Step 2.
|
|
45
|
+
|
|
46
|
+
### Step 2: Automated Remediation Playbooks
|
|
47
|
+
|
|
48
|
+
#### Scenario A: Missing Governance or OpenSpec Project
|
|
49
|
+
If `OpenSpec project`, `managed schema`, or `.sdlc/policy.yaml` failed:
|
|
50
|
+
```powershell
|
|
51
|
+
asdlc init --force
|
|
52
|
+
```
|
|
53
|
+
This restores all core templates, policy files, and central schema pins.
|
|
54
|
+
|
|
55
|
+
#### Scenario B: Forbidden Schema Override
|
|
56
|
+
If `schema override` failed (e.g. `openspec/schemas/agentic-repo-change/schema.yaml COMMITTED (forbidden)`):
|
|
57
|
+
Platform governance forbids individual repository overrides of the enterprise schema.
|
|
58
|
+
Run:
|
|
59
|
+
```bash
|
|
60
|
+
git rm -f openspec/schemas/agentic-repo-change/schema.yaml
|
|
61
|
+
git commit -m "chore(governance): remove local schema override"
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
#### Scenario C: Missing Git Hooks
|
|
65
|
+
If `.githooks` is unset:
|
|
66
|
+
```bash
|
|
67
|
+
git config core.hooksPath .githooks
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
#### Scenario D: Stale Knowledge Graph
|
|
71
|
+
If `knowledge graph` is stale or missing:
|
|
72
|
+
Run:
|
|
73
|
+
```powershell
|
|
74
|
+
asdlc init
|
|
75
|
+
```
|
|
76
|
+
Or directly refresh the AST graph:
|
|
77
|
+
```bash
|
|
78
|
+
graphify .
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
### Step 3: Re-verify Health
|
|
82
|
+
Re-run `asdlc doctor` to confirm `doctor: ok (0 failed, 0 warnings)` before continuing work.
|