@antoneeo/agentic-sdlc-skill 1.8.0 → 1.9.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/CHANGELOG.md +17 -0
- package/README.md +5 -1
- package/gemini-extension.json +1 -1
- package/package.json +5 -1
- package/skills/agentic-sdlc-skill/SKILL.md +8 -2
- package/skills/agentic-sdlc-skill/debugging.md +50 -0
- package/skills/agentic-sdlc-skill/elicitation.md +45 -0
- package/skills/agentic-sdlc-skill/guides.md +21 -4
- package/skills/agentic-sdlc-skill/review.md +57 -0
- package/skills/agentic-sdlc-skill/scripts/sdlc_check.py +42 -1
- package/skills/agentic-sdlc-skill/tdd.md +59 -0
- package/skills/agentic-sdlc-skill/templates.md +1 -0
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,23 @@
|
|
|
2
2
|
|
|
3
3
|
Tutte le modifiche significative a questa skill saranno documentate in questo file.
|
|
4
4
|
|
|
5
|
+
## [1.9.0] - 2026-07-03 (M2 execution disciplines + Feature B unit 2 agent KB)
|
|
6
|
+
### Added
|
|
7
|
+
- `tdd.md`: TDD discipline (RED/GREEN/REFACTOR, increment rule, AAA test shape, documented exemptions) — the L2/L3 default for implementation work.
|
|
8
|
+
- `debugging.md`: systematic debugging method (reproduce, isolate, root cause, fix, regression test, collateral check) with circuit-breaker integration.
|
|
9
|
+
- `elicitation.md`: spec elicitation round (goal/benefit, scope boundaries, non-goals, constraints, acceptance signals) run before drafting the analysis in phase 3.
|
|
10
|
+
- `review.md`: single definition of requesting, receiving, and performing code review, reused by the Hybrid review gates.
|
|
11
|
+
- `SKILL.md` wiring: pointers to the four new files added at phase 3 (elicitation), phase 4 (TDD, debugging, circuit breaker), and phase 5 (review).
|
|
12
|
+
- Agent-global KB (fixed root, project-wins precedence, `overrides:` with fail-closed confinement, collision warnings).
|
|
13
|
+
|
|
14
|
+
## [1.8.1] - 2026-07-02
|
|
15
|
+
### Fixed
|
|
16
|
+
- **Guide freshness hash is now line-ending independent**: `sha256_file` in `sdlc_check.py` normalizes CRLF → LF before hashing. Previously the raw-byte hash made a fresh Windows checkout with `core.autocrlf=true` rewrite `.sources/` snapshots and flag every guide `[stale]` (false positive). Backward compatible: recorded hashes were computed on LF content, and normalization maps CRLF copies back to the same digest. (Edge case: a hash recorded pre-1.8.1 on a snapshot that genuinely contained CRLF bytes will flag `[stale]` once — regenerate the hash.)
|
|
17
|
+
- `guides.md` step 3 now states the hash is computed over LF-normalized content and recommends the `ai_docs/reference/.sources/** -text` `.gitattributes` rule to consumer projects (defense in depth: keeps snapshots byte-verbatim).
|
|
18
|
+
|
|
19
|
+
### Test battery addition
|
|
20
|
+
- Scenario 10 (extends the unit-1 battery): snapshot checked out with CRLF endings + guide recording the LF-normalized hash → `stale` must NOT flag it; a genuine content edit must still flag `[stale]`.
|
|
21
|
+
|
|
5
22
|
## [1.8.0] - 2026-07-02 (Feature B unit 1: operative guides, project scope)
|
|
6
23
|
### Added
|
|
7
24
|
- **Operative guides** (`ai_docs/reference/GUIDE_[topic].md`): a durable, source-faithful layer distilled from USER-PROVIDED indications — the capability neither agentic-sdlc nor superpowers had. New support file `guides.md` (pipeline: topic decomposition → user confirmation → verbatim snapshot in `reference/.sources/` with SHA-256 → source-anchored extraction → per-section fidelity markers `[source: …]` / `[not covered by source]`); guide template with provenance frontmatter (`source`, `source_version`, `distilled_from`, `source_hash`) in `templates.md`; short "Operative Guides" section in `SKILL.md`.
|
package/README.md
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
- **Vision-guided governance**: Standalone projects use `ai_docs/vision/`; Hybrid projects use devPNT `M-VISION` as the milestone north star.
|
|
9
9
|
- **Standalone complete**: works fully with local `ai_docs/` without requiring devPNT.
|
|
10
10
|
- **devPNT symbiosis**: when devPNT is available, Master Plan, Action Plan, M-VISION, and governed artifacts become the authoritative planning layer.
|
|
11
|
-
- **Installed support files**: Claude, Codex, and Gemini receive the full skill folder, including `templates.md`, `guides.md`, `ENFORCEMENT.md`, and `scripts/sdlc_check.py
|
|
11
|
+
- **Installed support files**: Claude, Codex, and Gemini receive the full skill folder, including `templates.md`, `guides.md`, `tdd.md`, `debugging.md`, `elicitation.md`, `review.md`, `ENFORCEMENT.md`, and `scripts/sdlc_check.py`; an agent-global KB at `~/.agentic-sdlc` shares the same engine cross-project.
|
|
12
12
|
- **Mechanical checks**: optional validator for document structure, generated feature history, stale audit areas, and protected-path gates.
|
|
13
13
|
|
|
14
14
|
## Installation
|
|
@@ -45,6 +45,10 @@ skills/agentic-sdlc-skill/
|
|
|
45
45
|
├── SKILL.md
|
|
46
46
|
├── templates.md
|
|
47
47
|
├── guides.md
|
|
48
|
+
├── tdd.md
|
|
49
|
+
├── debugging.md
|
|
50
|
+
├── elicitation.md
|
|
51
|
+
├── review.md
|
|
48
52
|
├── ENFORCEMENT.md
|
|
49
53
|
└── scripts/
|
|
50
54
|
└── sdlc_check.py
|
package/gemini-extension.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@antoneeo/agentic-sdlc-skill",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.9.0",
|
|
4
4
|
"description": "Documentation-First SDLC protocol for Claude Code, Gemini CLI and Codex with risk triage, Vision governance, installed support files and optional devPNT integration.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"claude-code",
|
|
@@ -28,6 +28,10 @@
|
|
|
28
28
|
"skills/agentic-sdlc-skill/SKILL.md",
|
|
29
29
|
"skills/agentic-sdlc-skill/templates.md",
|
|
30
30
|
"skills/agentic-sdlc-skill/guides.md",
|
|
31
|
+
"skills/agentic-sdlc-skill/tdd.md",
|
|
32
|
+
"skills/agentic-sdlc-skill/debugging.md",
|
|
33
|
+
"skills/agentic-sdlc-skill/elicitation.md",
|
|
34
|
+
"skills/agentic-sdlc-skill/review.md",
|
|
31
35
|
"skills/agentic-sdlc-skill/ENFORCEMENT.md",
|
|
32
36
|
"skills/agentic-sdlc-skill/scripts/sdlc_check.py",
|
|
33
37
|
"gemini-extension.json",
|
|
@@ -176,6 +176,8 @@ Hybrid:
|
|
|
176
176
|
|
|
177
177
|
### 3. Request Analysis
|
|
178
178
|
|
|
179
|
+
For any L3, run the spec elicitation round in `elicitation.md` BEFORE drafting the analysis (skip path inside — one-line note when the spec is already complete).
|
|
180
|
+
|
|
179
181
|
Standalone L3:
|
|
180
182
|
- Before creating a new `ANALYSIS_[feature].md`, search `ai_docs/solutions/` with glob/grep for an existing analysis on the same topic: if there is one, update it instead of duplicating it.
|
|
181
183
|
- Create or update `ai_docs/solutions/ANALYSIS_[feature].md`.
|
|
@@ -191,14 +193,16 @@ Hybrid L3:
|
|
|
191
193
|
|
|
192
194
|
- Implement only after the documentation gate required by the level.
|
|
193
195
|
- Modify surgically, consistently with the plan.
|
|
194
|
-
-
|
|
196
|
+
- Implementation work follows the TDD discipline in `tdd.md` (RED/GREEN/REFACTOR — the L2/L3 default; record the reason when it does not apply).
|
|
195
197
|
- If the environment does not allow automated tests, declare the alternative verification and the reason.
|
|
196
|
-
-
|
|
198
|
+
- For bugs (L2/L3), follow the systematic debugging method in `debugging.md`.
|
|
199
|
+
- Circuit breaker: after 3 consecutive runs without progress on the tests, stop, switch to the systematic method in `debugging.md`, and ask for instructions if still stuck.
|
|
197
200
|
- Update the ANALYSIS Diary or the Action Plan when you complete milestones, hit blockers or change decisions.
|
|
198
201
|
|
|
199
202
|
### 5. Closure
|
|
200
203
|
|
|
201
204
|
- Run the relevant tests/lint/smoke checks.
|
|
205
|
+
- For the review itself follow `review.md` (requesting and receiving findings) — the single definition, intended for reuse by the Hybrid review gates (devPNT-side wiring out of this unit's scope).
|
|
202
206
|
- Verify alignment with the local Vision or the devPNT M-VISION.
|
|
203
207
|
- Update only the documents actually impacted.
|
|
204
208
|
- **Aligned indexes (Poka-Yoke)**: if you created, moved or removed canonical documents (`vision/`, `reference/`, `architecture/`, `functional/`, `strategic/`):
|
|
@@ -253,6 +257,8 @@ forbidden. Full pipeline, DRY rule, snapshotting and maintenance: `guides.md`.
|
|
|
253
257
|
`ai_docs/reference/INDEX.md` is generated (the guide router) — never edit by hand,
|
|
254
258
|
regenerate with `sdlc_check.py index`.
|
|
255
259
|
|
|
260
|
+
**Agent-global KB.** A second, cross-project guide root lives at the fixed path `~/.agentic-sdlc/` (same `ai_docs/` structure, same validator/router/freshness engine via `sdlc_check.py --root ~/.agentic-sdlc`). Project guides win on topic collision; a project guide that overrides a KB guide MUST declare `overrides: GUIDE_<topic>.md` — the validator warns on undeclared collisions (error under `--strict`) and fail-closes on an `overrides:` value that escapes the KB. Discovery is this paragraph: agents and subagents reach KB guides by path, exactly like project guides.
|
|
261
|
+
|
|
256
262
|
## Mechanical Enforcement
|
|
257
263
|
|
|
258
264
|
The prompt is not enforcement. When the project needs repeatable guarantees:
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
# Systematic Debugging
|
|
2
|
+
|
|
3
|
+
Applies to bugs classified L2 or L3. Entered either from phase 4
|
|
4
|
+
(Development and Testing) when a defect surfaces during implementation, or
|
|
5
|
+
from the circuit breaker in `SKILL.md` §4 after repeated no-progress runs.
|
|
6
|
+
|
|
7
|
+
## Method
|
|
8
|
+
|
|
9
|
+
Work the steps in order; do not skip ahead to a fix before step 3 names the
|
|
10
|
+
mechanism.
|
|
11
|
+
|
|
12
|
+
1. **Reproduce deterministically.** Find the smallest input or scenario that
|
|
13
|
+
triggers the bug every time. A bug you cannot reliably reproduce cannot be
|
|
14
|
+
verified as fixed.
|
|
15
|
+
2. **Isolate.** Narrow the failing case to its minimal form — strip
|
|
16
|
+
unrelated setup, unrelated data, unrelated code paths. Bisect (recent
|
|
17
|
+
commits, code paths, input ranges) when the boundary is unclear.
|
|
18
|
+
3. **Root cause — name the mechanism.** State in one sentence why the
|
|
19
|
+
observed behavior happens, tracing the actual execution path. **MUST NOT
|
|
20
|
+
patch a symptom without naming the mechanism; why: symptom patches recur
|
|
21
|
+
and stack** — the same underlying defect resurfaces elsewhere, and each
|
|
22
|
+
unexplained patch makes the next investigation harder, not easier.
|
|
23
|
+
4. **Fix at the cause**, not at the symptom identified in step 1.
|
|
24
|
+
5. **Write a regression test that FAILS on the old code** (verify this
|
|
25
|
+
before applying the fix, or by temporarily reverting it) and passes after.
|
|
26
|
+
A regression test that was never confirmed to fail proves nothing.
|
|
27
|
+
6. **Run the relevant suite for collateral.** A root-cause fix can change
|
|
28
|
+
behavior other callers depend on; check them before closing.
|
|
29
|
+
|
|
30
|
+
## Circuit breaker integration
|
|
31
|
+
|
|
32
|
+
After 3 consecutive runs without progress: STOP. Do not attempt a 4th
|
|
33
|
+
variation of the same guess. Audit your assumptions from step 1 — is the
|
|
34
|
+
reproduction actually deterministic, is the isolated case actually minimal,
|
|
35
|
+
is the "root cause" from step 3 actually confirmed or just plausible? Then
|
|
36
|
+
restart from step 1 with the corrected assumption.
|
|
37
|
+
|
|
38
|
+
If still stuck after the restart, ask the user for instructions, and hand
|
|
39
|
+
over the evidence gathered so far: the minimal reproduction, what was ruled
|
|
40
|
+
out, and the current best hypothesis.
|
|
41
|
+
|
|
42
|
+
## Anti-patterns
|
|
43
|
+
|
|
44
|
+
- **Shotgun debugging**: changing several things at once hoping one fixes it
|
|
45
|
+
— when it "works," you do not know which change mattered or why.
|
|
46
|
+
- **Stacking speculative fixes**: adding a second guess on top of an
|
|
47
|
+
unverified first one instead of confirming or discarding it first.
|
|
48
|
+
- **"Fixed but can't say why"**: closing the bug without a step-3 mechanism
|
|
49
|
+
statement. If you cannot name the mechanism, the fix is not confirmed —
|
|
50
|
+
it may just be masking the trigger.
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
# Spec Elicitation
|
|
2
|
+
|
|
3
|
+
Applies when an L3 request enters phase 3 (Request Analysis), BEFORE
|
|
4
|
+
drafting the ANALYSIS document (Standalone) or the D-UC/E-ISP (Hybrid).
|
|
5
|
+
|
|
6
|
+
Skip path: if the spec is already complete — an approved Vision or explicit
|
|
7
|
+
user requirements already answer goal, scope, and constraints — skip the
|
|
8
|
+
round and add a one-line note in the analysis stating why it was skipped.
|
|
9
|
+
Do not run the round as a formality when the answers are already on record.
|
|
10
|
+
|
|
11
|
+
## The round
|
|
12
|
+
|
|
13
|
+
Ask ONE structured set of questions, not a drip of follow-ups. Keep each
|
|
14
|
+
question short and numbered; offer concrete options where a real choice
|
|
15
|
+
exists (this narrows the reply and speeds up the round). Cover:
|
|
16
|
+
|
|
17
|
+
1. **Goal / benefit** — what problem this closes, for whom, and why now.
|
|
18
|
+
2. **Scope boundaries** — what is explicitly included in this unit of work.
|
|
19
|
+
3. **Non-goals** — what is explicitly excluded, so scope does not silently
|
|
20
|
+
creep in later.
|
|
21
|
+
4. **Constraints** — technical, compatibility, and security constraints that
|
|
22
|
+
bound the solution space.
|
|
23
|
+
5. **Acceptance signals** — how you and the user will both recognize the
|
|
24
|
+
work is done and correct.
|
|
25
|
+
|
|
26
|
+
## Reflect
|
|
27
|
+
|
|
28
|
+
Fold the answers into the ANALYSIS `## Objective` / `## Vision-Alignment`
|
|
29
|
+
sections (Standalone) or into the D-UC/E-ISP (Hybrid) — do not leave them
|
|
30
|
+
sitting only in the chat transcript. The written document, not the
|
|
31
|
+
conversation, is what the next session and the next reviewer will read.
|
|
32
|
+
|
|
33
|
+
Run a second round only when an answer opens a real fork in the design (a
|
|
34
|
+
genuinely new question the first round could not have anticipated). Do not
|
|
35
|
+
run a second round to double-check answers that were already clear.
|
|
36
|
+
|
|
37
|
+
## Anti-patterns
|
|
38
|
+
|
|
39
|
+
- **Interrogation**: an endless list of questions, or drip-feeding one
|
|
40
|
+
question at a time across many turns instead of one structured round.
|
|
41
|
+
- **Asking what the approved vision already answers**: re-asking goal or
|
|
42
|
+
non-goals that a `Status: APPROVED` Vision or M-VISION already states.
|
|
43
|
+
- **Collecting answers without folding them in**: getting replies in chat
|
|
44
|
+
and proceeding to design without writing them into the analysis document —
|
|
45
|
+
the next reader has no record of why the scope is what it is.
|
|
@@ -39,8 +39,11 @@ guide with no `distilled_from` is not this pipeline's output.
|
|
|
39
39
|
0. **Search before creating (DRY — one CURRENT guide per topic).** Before
|
|
40
40
|
proposing anything, read `ai_docs/reference/INDEX.md` and grep
|
|
41
41
|
`reference/GUIDE_*.md` for topic overlap with the new material. Never end
|
|
42
|
-
up with two CURRENT guides on the same topic.
|
|
43
|
-
|
|
42
|
+
up with two CURRENT guides on the same topic. Search BOTH routers: project
|
|
43
|
+
`ai_docs/reference/INDEX.md` AND the agent KB router
|
|
44
|
+
`~/.agentic-sdlc/ai_docs/reference/INDEX.md` (if present) — one CURRENT
|
|
45
|
+
guide per topic PER SCOPE; a project guide on a KB topic requires the
|
|
46
|
+
explicit `overrides:` declaration. On overlap, pick by provenance:
|
|
44
47
|
- **Same source, evolved** → UPDATE the existing guide in place: new
|
|
45
48
|
snapshot, new `source_hash`, same file (history lives in git).
|
|
46
49
|
- **Different source replacing the old one** → NEW guide + mark the old
|
|
@@ -75,14 +78,26 @@ guide with no `distilled_from` is not this pipeline's output.
|
|
|
75
78
|
- Heterogeneous sources (unrelated policies handed over together) are the
|
|
76
79
|
legitimate split case; a single coherent document about one subsystem
|
|
77
80
|
almost never is.
|
|
78
|
-
|
|
79
|
-
|
|
81
|
+
- **Also decide SCOPE per proposed guide**: project-scope
|
|
82
|
+
(`ai_docs/reference/`) or agent-scope (`~/.agentic-sdlc/ai_docs/reference/`,
|
|
83
|
+
governs the agent across ALL projects; origin+purpose test unchanged,
|
|
84
|
+
scope is a LOCATION decision by the user, never a content taxonomy; KB
|
|
85
|
+
created lazily with `.sources/` on the first agent-scope guide).
|
|
86
|
+
2. **User confirms** the topic decomposition — including the fragmentation-risk
|
|
87
|
+
assessment and scope decision — before any file is written.
|
|
80
88
|
3. **Snapshot each source verbatim** into
|
|
81
89
|
`ai_docs/reference/.sources/<slug>-<hash8>.md`:
|
|
82
90
|
- `slug` derives from the topic (lowercase, hyphenated).
|
|
83
91
|
- `hash8` = first 8 hex chars of the snapshot file's own SHA-256 (compute
|
|
84
92
|
the snapshot first, hash it, then name it — the hash is of the file you
|
|
85
93
|
just wrote, not of the original source).
|
|
94
|
+
- The hash is computed over LF-normalized content (CRLF → LF), exactly as
|
|
95
|
+
`sdlc_check.py` does in `sha256_file` — so recorded hashes survive
|
|
96
|
+
checkouts that rewrite line endings (e.g. Windows `core.autocrlf=true`).
|
|
97
|
+
- Recommended for consumer projects: add
|
|
98
|
+
`ai_docs/reference/.sources/** -text` to `.gitattributes` so git never
|
|
99
|
+
rewrites snapshot bytes at all (keeps snapshots byte-verbatim; the
|
|
100
|
+
normalized hash stays stable either way).
|
|
86
101
|
- The snapshot is verbatim: no paraphrasing, no reformatting beyond what is
|
|
87
102
|
needed to save it as markdown.
|
|
88
103
|
4. **Source-anchored SYNTHESIS (not restatement).** Select and compress what
|
|
@@ -151,3 +166,5 @@ state it explicitly when handing off a newly created guide.
|
|
|
151
166
|
compares each guide's recorded `source_hash` against the live snapshot file
|
|
152
167
|
and reports `[stale]` when they diverge — that is the signal to regenerate,
|
|
153
168
|
not a manual freshness check.
|
|
169
|
+
- **Agent-global KB guides** use the same pipeline and validator via
|
|
170
|
+
`--root ~/.agentic-sdlc`; freshness via the same `stale` engine.
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
# Code Review Discipline
|
|
2
|
+
|
|
3
|
+
Applies at closure of L2/L3 work, and to any independent review slot in this
|
|
4
|
+
skill or in a connected governance layer — devPNT's §4.5/§4.6 review gates,
|
|
5
|
+
and any future review step added to the workflow. This is the single
|
|
6
|
+
definition of how to request, receive, and perform a review; other places
|
|
7
|
+
that need review behavior point here instead of restating it (DRY).
|
|
8
|
+
|
|
9
|
+
## Requesting
|
|
10
|
+
|
|
11
|
+
When you hand work to a reviewer (human or agent), give them:
|
|
12
|
+
|
|
13
|
+
- **Scope**: what changed and why, in one or two lines.
|
|
14
|
+
- **The authoritative design artifact**: the ANALYSIS, E-TDD, or equivalent
|
|
15
|
+
the change was built against — not a paraphrase of it.
|
|
16
|
+
- **The actual diff**: the real changed files, not a description of them.
|
|
17
|
+
|
|
18
|
+
Never ask a reviewer to "review my session" or "review what I just did"
|
|
19
|
+
without the artifacts above — that forces them to reconstruct scope from
|
|
20
|
+
conversation instead of reviewing the change itself. Say which finding
|
|
21
|
+
classes you want covered (correctness, security, conformance to the design,
|
|
22
|
+
test coverage) if the default scope is not obvious.
|
|
23
|
+
|
|
24
|
+
## Receiving
|
|
25
|
+
|
|
26
|
+
**MUST answer findings one by one — fix, or justify with evidence; why:
|
|
27
|
+
silent drops turn review into theater** — a review whose findings are not
|
|
28
|
+
tracked to a resolution gives the appearance of quality control without its
|
|
29
|
+
substance.
|
|
30
|
+
|
|
31
|
+
If you disagree with a finding, say so explicitly with your reasoning; never
|
|
32
|
+
resolve a disagreement by rewording the finding until it goes away. When the
|
|
33
|
+
project keeps a `REVIEW_LOG` (or equivalent), log the outcome of each
|
|
34
|
+
finding there.
|
|
35
|
+
|
|
36
|
+
## Reviewing
|
|
37
|
+
|
|
38
|
+
When you are the reviewer:
|
|
39
|
+
|
|
40
|
+
- Verify claims against the real source, not against the diff's own
|
|
41
|
+
description of itself.
|
|
42
|
+
- Cite evidence as `file:line` for every finding — a finding without a
|
|
43
|
+
location is not actionable.
|
|
44
|
+
- Keep severity honest: do not inflate a style preference to a blocker, and
|
|
45
|
+
do not soften a real correctness or security issue to a nit.
|
|
46
|
+
- No praise padding. A review reports problems and their fixes, not a
|
|
47
|
+
summary of what looks fine.
|
|
48
|
+
|
|
49
|
+
## Anti-patterns
|
|
50
|
+
|
|
51
|
+
- **Batch-dismissal**: closing out a whole findings list with one blanket
|
|
52
|
+
reply instead of addressing each finding individually.
|
|
53
|
+
- **Rewording instead of addressing**: editing the finding's text to look
|
|
54
|
+
resolved without changing the code or providing evidence it is a
|
|
55
|
+
non-issue.
|
|
56
|
+
- **Scope-creep findings**: raising issues unrelated to the change under
|
|
57
|
+
review instead of filing them separately.
|
|
@@ -55,6 +55,10 @@ GUIDE_INDEX_HEADER = ("<!-- GENERATED by sdlc_check.py index - do not edit by ha
|
|
|
55
55
|
GUIDE_PROVENANCE_KEYS = ("source", "distilled_from", "source_hash") # source_version optional
|
|
56
56
|
# a guide section is "covered" when it carries a source marker or an explicit gap marker
|
|
57
57
|
GUIDE_MARKER_RE = re.compile(r"\[(?:source:[^\]]+|not covered by source)\]")
|
|
58
|
+
# Agent-global KB (Feature B unit 2): ONE client-agnostic root under home.
|
|
59
|
+
# AGENTIC_SDLC_KB_ROOT env var is a TEST/CI seam only (scenario battery must
|
|
60
|
+
# not touch the real user KB); the documented product path is fixed.
|
|
61
|
+
DEFAULT_KB_ROOT = Path(os.environ.get("AGENTIC_SDLC_KB_ROOT", "")) if os.environ.get("AGENTIC_SDLC_KB_ROOT") else Path.home() / ".agentic-sdlc"
|
|
58
62
|
|
|
59
63
|
# Deprecated Italian frontmatter keys, mapped to the canonical English ones.
|
|
60
64
|
LEGACY_KEYS = {"stato": "status", "livello": "level",
|
|
@@ -109,8 +113,12 @@ def read_text(path):
|
|
|
109
113
|
|
|
110
114
|
|
|
111
115
|
def sha256_file(path):
|
|
116
|
+
# CRLF->LF before hashing: a Windows checkout with core.autocrlf=true
|
|
117
|
+
# rewrites snapshot files, and a raw-byte hash would flag every guide
|
|
118
|
+
# [stale] on a fresh clone. Recorded hashes are LF-based, so normalizing
|
|
119
|
+
# maps CRLF copies back to the same digest.
|
|
112
120
|
h = hashlib.sha256()
|
|
113
|
-
h.update(path.read_bytes())
|
|
121
|
+
h.update(path.read_bytes().replace(b"\r\n", b"\n"))
|
|
114
122
|
return h.hexdigest()
|
|
115
123
|
|
|
116
124
|
|
|
@@ -383,6 +391,38 @@ def list_guides(root):
|
|
|
383
391
|
return out
|
|
384
392
|
|
|
385
393
|
|
|
394
|
+
def check_kb_collisions(root, project_guides, errors, warnings):
|
|
395
|
+
"""Cross-root awareness (unit 2): project-wins precedence, declared via 'overrides:'."""
|
|
396
|
+
kb_root = DEFAULT_KB_ROOT
|
|
397
|
+
kb_ref = (kb_root / "ai_docs" / "reference")
|
|
398
|
+
try:
|
|
399
|
+
if root.resolve() == kb_root.resolve():
|
|
400
|
+
return # validating the KB itself: no self-comparison
|
|
401
|
+
except OSError:
|
|
402
|
+
return
|
|
403
|
+
if not kb_ref.is_dir():
|
|
404
|
+
return # no KB on this machine: zero behavior change
|
|
405
|
+
kb_names = {p.name for _, p, _, _ in list_guides(kb_root)}
|
|
406
|
+
for rel, p, meta, _ in project_guides:
|
|
407
|
+
ov = (meta.get("overrides") or "").strip()
|
|
408
|
+
if ov:
|
|
409
|
+
# T6: untrusted cross-root pointer — distilled_from parity, fail closed
|
|
410
|
+
ovp = Path(ov)
|
|
411
|
+
if ovp.is_absolute() or ".." in ovp.parts:
|
|
412
|
+
errors.append(f"{rel}: overrides '{ov}' is absolute or contains '..' — rejected (fail closed)")
|
|
413
|
+
continue
|
|
414
|
+
try:
|
|
415
|
+
target = (kb_ref / ov).resolve()
|
|
416
|
+
target.relative_to(kb_ref.resolve())
|
|
417
|
+
except (ValueError, OSError):
|
|
418
|
+
errors.append(f"{rel}: overrides '{ov}' escapes the KB reference dir — rejected (fail closed)")
|
|
419
|
+
continue
|
|
420
|
+
if not target.is_file():
|
|
421
|
+
warnings.append(f"{rel}: overrides target '{ov}' not found in KB ({kb_ref})")
|
|
422
|
+
if p.name in kb_names and ov != p.name:
|
|
423
|
+
warnings.append(f"{rel}: undeclared collision with KB guide '{p.name}' (project wins) — declare overrides: {p.name}")
|
|
424
|
+
|
|
425
|
+
|
|
386
426
|
def build_guide_index(root):
|
|
387
427
|
lines = [GUIDE_INDEX_HEADER,
|
|
388
428
|
"# Operative guides (generated router)",
|
|
@@ -541,6 +581,7 @@ def cmd_validate(root, strict=False):
|
|
|
541
581
|
target.relative_to(root.resolve())
|
|
542
582
|
except ValueError:
|
|
543
583
|
errors.append(f"{rel}: distilled_from '{df}' resolves outside the project root: rejected")
|
|
584
|
+
check_kb_collisions(root, guides, errors, warnings)
|
|
544
585
|
# guide-router alignment (mirror of the root-manifest check)
|
|
545
586
|
gidx = root / "ai_docs" / "reference" / "INDEX.md"
|
|
546
587
|
if guides:
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
# TDD Discipline
|
|
2
|
+
|
|
3
|
+
Applies to L2/L3 implementation work. L1, doc-only changes, and Spikes are
|
|
4
|
+
exempt (a Spike records its outcome note only, per `SPIKE_[topic].md`).
|
|
5
|
+
|
|
6
|
+
## The loop
|
|
7
|
+
|
|
8
|
+
RED, GREEN, REFACTOR, in that order, every time.
|
|
9
|
+
|
|
10
|
+
- **RED**: write ONE failing test first, run it, and watch it fail. **MUST:
|
|
11
|
+
no implementation code before the failing test exists; why: a test written
|
|
12
|
+
after the code passes vacuously and proves nothing** — it cannot
|
|
13
|
+
distinguish a correct implementation from a broken one, because it was
|
|
14
|
+
shaped to match whatever the code already does.
|
|
15
|
+
- **GREEN**: write the minimum code needed to make that test pass. Resist
|
|
16
|
+
adding behavior the test does not require yet — that belongs to the next
|
|
17
|
+
loop.
|
|
18
|
+
- **REFACTOR**: clean up implementation and test code while the suite stays
|
|
19
|
+
green. Re-run the tests after every refactor step, not just at the end.
|
|
20
|
+
|
|
21
|
+
## Increment rule
|
|
22
|
+
|
|
23
|
+
One behavior per loop. If you notice the failing test actually covers two
|
|
24
|
+
behaviors, split it before writing implementation code — a test that asserts
|
|
25
|
+
two unrelated things fails ambiguously and slows down the next RED step.
|
|
26
|
+
|
|
27
|
+
## Test shape
|
|
28
|
+
|
|
29
|
+
Unit tests follow AAA — arrange, act, assert:
|
|
30
|
+
|
|
31
|
+
- **Arrange**: set up inputs, fixtures, and collaborators.
|
|
32
|
+
- **Act**: invoke the one behavior under test.
|
|
33
|
+
- **Assert**: check the outcome, and only that outcome.
|
|
34
|
+
|
|
35
|
+
Keep the three parts visually separable (blank line or comment) so a reader
|
|
36
|
+
can tell what is setup, what is the trigger, and what is being checked
|
|
37
|
+
without tracing the whole test body. This is the single home of the AAA
|
|
38
|
+
guidance — do not restate it elsewhere in the skill.
|
|
39
|
+
|
|
40
|
+
## When TDD does not apply
|
|
41
|
+
|
|
42
|
+
Legitimate exemptions: no test harness exists for the target environment,
|
|
43
|
+
the change is pure documentation, or the work is a time-boxed Spike.
|
|
44
|
+
|
|
45
|
+
**MUST record the explicit reason in the ANALYSIS Diary or Action Plan node;
|
|
46
|
+
why: an unrecorded exemption is indistinguishable from forgetting** — a
|
|
47
|
+
reviewer (or a future you) cannot tell "skipped on purpose, here is why" from
|
|
48
|
+
"skipped by accident" unless the reason is written down at the time.
|
|
49
|
+
|
|
50
|
+
## Anti-patterns
|
|
51
|
+
|
|
52
|
+
- **Tests-after as the unexplained default**: writing implementation first
|
|
53
|
+
and tests afterward without an entry under "When TDD does not apply" above.
|
|
54
|
+
- **Testing implementation details**: asserting on private state or call
|
|
55
|
+
internals instead of observable behavior — the test breaks on refactors
|
|
56
|
+
that change nothing externally.
|
|
57
|
+
- **One giant test covering everything**: a single test that exercises
|
|
58
|
+
multiple behaviors is slow to diagnose when it fails and violates the
|
|
59
|
+
Increment rule above.
|
|
@@ -40,6 +40,7 @@ source: Human-readable name of what the user provided.
|
|
|
40
40
|
source_version: v1.2 # optional — only when the origin is versioned
|
|
41
41
|
distilled_from: ai_docs/reference/.sources/topic-a1b2c3d4.md
|
|
42
42
|
source_hash: <sha256 of the snapshot file>
|
|
43
|
+
overrides: GUIDE_topic.md # optional — only for a project guide overriding an agent-KB guide
|
|
43
44
|
---
|
|
44
45
|
# Guide: [Topic]
|
|
45
46
|
|