@antoneeo/agentic-sdlc-skill 1.6.0 → 1.8.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 +35 -0
- package/README.md +82 -81
- package/gemini-extension.json +2 -2
- package/package.json +3 -4
- package/scripts/init.js +125 -176
- package/scripts/lib.js +138 -0
- package/scripts/postinstall.js +17 -113
- package/scripts/preuninstall.js +5 -14
- package/skills/agentic-sdlc-skill/ENFORCEMENT.md +56 -55
- package/skills/agentic-sdlc-skill/SKILL.md +263 -172
- package/skills/agentic-sdlc-skill/guides.md +153 -0
- package/skills/agentic-sdlc-skill/scripts/sdlc_check.py +817 -621
- package/skills/agentic-sdlc-skill/templates.md +250 -192
- package/references/analysis_template.md +0 -44
- package/references/architecture_template.md +0 -23
- package/references/existing_features_template.md +0 -8
- package/references/feature_vision_template.md +0 -21
- package/references/features_history_template.md +0 -5
- package/references/principles_template.md +0 -13
- package/references/project_vision_template.md +0 -26
- package/references/roadmap_template.md +0 -9
|
@@ -1,172 +1,263 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: agentic-sdlc
|
|
3
|
-
description:
|
|
4
|
-
author: Antonio Pinto (https://github.com/Antoneeo)
|
|
5
|
-
copyright: (c) 2026 Antonio Pinto
|
|
6
|
-
---
|
|
7
|
-
|
|
8
|
-
# Agentic SDLC
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
- `templates.md`:
|
|
14
|
-
- `
|
|
15
|
-
- `
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
- **
|
|
23
|
-
- **
|
|
24
|
-
- **
|
|
25
|
-
- **
|
|
26
|
-
- **
|
|
27
|
-
- **
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
| **
|
|
39
|
-
| **
|
|
40
|
-
| **
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
-
|
|
44
|
-
-
|
|
45
|
-
-
|
|
46
|
-
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
-
|
|
57
|
-
-
|
|
58
|
-
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
-
|
|
76
|
-
-
|
|
77
|
-
-
|
|
78
|
-
-
|
|
79
|
-
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
In
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
-
|
|
169
|
-
-
|
|
170
|
-
-
|
|
171
|
-
|
|
172
|
-
|
|
1
|
+
---
|
|
2
|
+
name: agentic-sdlc
|
|
3
|
+
description: Documentation-First SDLC protocol with risk-proportional triage, Vision as a guide, a complete Standalone mode and optional symbiosis with devPNT. Use for features, significant bugs, refactors, audits and documented maintenance.
|
|
4
|
+
author: Antonio Pinto (https://github.com/Antoneeo)
|
|
5
|
+
copyright: (c) 2026 Antonio Pinto
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# Agentic SDLC
|
|
9
|
+
|
|
10
|
+
This skill guides software development with a Documentation-First process proportional to risk. It must work fully even without devPNT. When devPNT is available and configured for the current project, the skill works in symbiosis with its governance: M-VISION, Master Plan, Action Plan and versioned artifacts become the authoritative frame for milestones and implementation.
|
|
11
|
+
|
|
12
|
+
Support files in the skill directory:
|
|
13
|
+
- `templates.md`: templates for Vision, ANALYSIS, Spike, audit plan and handoff.
|
|
14
|
+
- `guides.md`: pipeline for distilling user-provided indications into `ai_docs/reference/GUIDE_[topic].md`.
|
|
15
|
+
- `scripts/sdlc_check.py`: mechanical validator for `ai_docs/` (`check`, `validate`, `index`, `stale`, `mark`, `gate`).
|
|
16
|
+
- `ENFORCEMENT.md`: optional setup for CI and hooks.
|
|
17
|
+
|
|
18
|
+
Read these files only when needed. `SKILL.md` is the operating contract; the support files are progressive resources.
|
|
19
|
+
|
|
20
|
+
## Technical Values
|
|
21
|
+
|
|
22
|
+
- **Understand before acting:** do not modify code without understanding root cause, constraints and current shape.
|
|
23
|
+
- **Preserve architectural coherence:** respect existing layers, responsibilities, naming, patterns and conventions.
|
|
24
|
+
- **Apply DRY and simplicity:** do not duplicate logic or knowledge; abstract only when it reduces real complexity.
|
|
25
|
+
- **Preserve quality:** every change must maintain or improve stability, testability and maintainability.
|
|
26
|
+
- **Verify technically:** close implementation work with tests, lint, smoke checks or an explicit reason.
|
|
27
|
+
- **Keep useful memory:** document relevant decisions and operational state, not filler text.
|
|
28
|
+
- **Protect the Vision:** every decision must stay aligned with expected benefits, users, non-goals and success signals.
|
|
29
|
+
|
|
30
|
+
If a patch looks easy but you do not understand why the current code is shaped the way it is, investigate first.
|
|
31
|
+
|
|
32
|
+
## Rule Zero: Triage
|
|
33
|
+
|
|
34
|
+
Always classify the request before choosing the process. Declare the chosen level to the user when you start operational work.
|
|
35
|
+
|
|
36
|
+
| Level | Criteria | Required process |
|
|
37
|
+
|---|---|---|
|
|
38
|
+
| **L1 - Trivial** | About 10 lines in 1-2 files; no API, dependency or new-behavior change; typos or fixes restoring already-expected behavior | Implement. Run relevant existing tests. No new documents. |
|
|
39
|
+
| **L2 - Small** | Clear root cause; at most 3 files; no new dependency or public API; low risk | Mini-analysis in the message: objective, impact, security, tests. Tests mandatory. No new document, except updating an existing analysis/handoff if useful. |
|
|
40
|
+
| **L3 - Significant** | More than 3 files, APIs/contracts, new dependency, user-visible behavior, security-sensitive area, architectural change or non-obvious design | Full workflow: Vision Gate, analysis, plan, implementation, tests, closure. |
|
|
41
|
+
| **Spike** | Time-boxed exploration to reduce uncertainty | Code not mergeable into main. Outcome in `ai_docs/solutions/SPIKE_[topic].md`. For production, reclassify as L2 or L3. |
|
|
42
|
+
|
|
43
|
+
Cross-cutting rules:
|
|
44
|
+
- Parsing of external input, authN/authZ, cryptography, networking, personal data and filesystem access are security-sensitive: never L1.
|
|
45
|
+
- If a bigger impact emerges during L1/L2 work, stop, reclassify and declare it.
|
|
46
|
+
- When in doubt, pick the higher level.
|
|
47
|
+
- The full audit does not start for L1/L2 unless explicitly requested.
|
|
48
|
+
|
|
49
|
+
## Operating Modes
|
|
50
|
+
|
|
51
|
+
### Full Standalone
|
|
52
|
+
|
|
53
|
+
Use this mode when devPNT is unavailable, not configured for the current project, or the user explicitly asks for a filesystem-only workflow.
|
|
54
|
+
|
|
55
|
+
Source of truth:
|
|
56
|
+
- Vision: `ai_docs/vision/project_vision.md`, `roadmap.md`, `principles.md`.
|
|
57
|
+
- Features/analyses: `ai_docs/solutions/ANALYSIS_[feature].md`.
|
|
58
|
+
- Audit/handoff: `ai_docs/audit/`.
|
|
59
|
+
- Feature history: `ai_docs/strategic/features_history.md`, manual or generated by the validator, depending on the structure the project adopts.
|
|
60
|
+
|
|
61
|
+
Standalone mode is not reduced: it must handle audits, features, significant bugs, tests, handoffs and closure without devPNT.
|
|
62
|
+
|
|
63
|
+
### Hybrid in symbiosis with devPNT
|
|
64
|
+
|
|
65
|
+
Use this mode when the `devpnt_*` tools are available and point at the current project.
|
|
66
|
+
|
|
67
|
+
Authoritative hierarchy:
|
|
68
|
+
1. **devPNT M-VISION**: strategic beacon of the milestone. Before design or code, read it and verify benefits, success signals, scope-in and non-goals.
|
|
69
|
+
2. **devPNT Master Plan**: strategic roadmap and milestones.
|
|
70
|
+
3. **devPNT Action Plan**: current tactical work for the active goal.
|
|
71
|
+
4. **devPNT governed artifacts**: `D-UC`, `P-TM`, `E-ISP`, `E-TDD`, `E-TP`, ADR.
|
|
72
|
+
5. **Local `ai_docs/`**: readable context, Standalone fallback, local handoff or shadow/mirror when useful.
|
|
73
|
+
|
|
74
|
+
Hybrid rules:
|
|
75
|
+
- devPNT is the governed source for plans and artifacts; do not create a second truth in `ai_docs/`.
|
|
76
|
+
- The skill stays autonomous: if devPNT is not there, switch to Standalone without losing capability.
|
|
77
|
+
- If the user request, the local Vision and the M-VISION diverge, stop and make the conflict explicit.
|
|
78
|
+
- Do not create or modify milestones without respecting the M-VISION.
|
|
79
|
+
- Never auto-accept devPNT proposals: present the preview and wait for explicit confirmation.
|
|
80
|
+
- If the local devPNT protocol imposes stricter bootstrap, plans or gates, follow them.
|
|
81
|
+
|
|
82
|
+
## Coexistence with devPNT (the Hybrid seam)
|
|
83
|
+
|
|
84
|
+
This section is the single authoritative answer to "who owns what" when both the
|
|
85
|
+
skill and devPNT are active. The skill owns the **process** (triage, phases, Vision
|
|
86
|
+
Gate, lifecycle); devPNT owns the **machinery** (governed storage, versioned
|
|
87
|
+
proposals, semantic analysis, independent reviewers). devPNT strengthens the
|
|
88
|
+
process; it never replaces it.
|
|
89
|
+
|
|
90
|
+
### Ownership matrix
|
|
91
|
+
|
|
92
|
+
| Artifact | Standalone master | Hybrid master | Mirror rule |
|
|
93
|
+
|---|---|---|---|
|
|
94
|
+
| Product vision | `vision/project_vision.md` | `vision/project_vision.md` (product scope) | devPNT KL vision is regenerated from it, never edited independently |
|
|
95
|
+
| Milestone vision | `vision/roadmap.md` milestones | devPNT M-VISION | `roadmap.md` may reference the M-VISION key; it never restates its content |
|
|
96
|
+
| Feature design | `solutions/ANALYSIS_[feature].md` | devPNT E-ISP/E-TDD (+ D-UC/P-TM) | shadow exported from the ACCEPTED DB version as `SHADOW_[doc_key]_vX.Y.md`; on divergence the DB wins and the shadow is regenerated |
|
|
97
|
+
| Plans | `## Action Plan` inside the ANALYSIS | devPNT Master/Action Plan | none |
|
|
98
|
+
| Feature state | ANALYSIS frontmatter `status` | Action Plan node status | mapping table below; at closure both must move together |
|
|
99
|
+
| ADR | `architecture/` (canonical dir) | devPNT DB (`adr_YYYY-MM-DD_slug`) | optional filesystem shadow `SHADOW_adr_*` exported at closure for grep-ability |
|
|
100
|
+
| Audit / freshness | `audit/audit_plan.md` + `stale`/`mark` | devPNT KL coverage + summary status | run `check --hybrid` (skips audit-plan staleness) |
|
|
101
|
+
| Operative guides | `ai_docs/reference/` | `ai_docs/reference/` — **filesystem-first even in Hybrid** | devPNT bootstrap may point at their index; it never copies their content |
|
|
102
|
+
| Handoff | `audit/handoff.md` | `audit/handoff.md` | always filesystem |
|
|
103
|
+
|
|
104
|
+
### Triage equivalence (one threshold, two vocabularies)
|
|
105
|
+
|
|
106
|
+
devPNT's "significance threshold" and the skill's triage are the SAME test. Do not
|
|
107
|
+
run two classifications:
|
|
108
|
+
|
|
109
|
+
| Skill triage | devPNT equivalent | Governed artifacts |
|
|
110
|
+
|---|---|---|
|
|
111
|
+
| L1 Trivial | trivial exempt | none |
|
|
112
|
+
| L2 Small | localized obvious edit | none — but see escalation |
|
|
113
|
+
| L3 Significant | governed unit of change | D-UC/P-TM/E-ISP/E-TDD per the devPNT trigger policy |
|
|
114
|
+
| Spike | exempt (non-mergeable) | `SPIKE_[topic].md` only |
|
|
115
|
+
|
|
116
|
+
Escalation triggers (any one of these makes it L3, in BOTH vocabularies): touches
|
|
117
|
+
more than one module, changes a public API/contract/message format, changes a data
|
|
118
|
+
model or state machine, has a security surface, risks duplicating existing logic,
|
|
119
|
+
or the design choice is non-obvious. An L2 that trips one of these is not an L2.
|
|
120
|
+
|
|
121
|
+
### Feature state mapping
|
|
122
|
+
|
|
123
|
+
| ANALYSIS frontmatter | devPNT plan node |
|
|
124
|
+
|---|---|
|
|
125
|
+
| PLANNED | READY (or BLOCKED / ON_HOLD while waiting) |
|
|
126
|
+
| IN_PROGRESS | PROGRESS |
|
|
127
|
+
| COMPLETED | DONE |
|
|
128
|
+
| CANCELLED | CANCELLED |
|
|
129
|
+
|
|
130
|
+
Closure discipline: never mark the node DONE while the shadow/ANALYSIS still says
|
|
131
|
+
IN_PROGRESS, or vice versa. They move in the same closure step.
|
|
132
|
+
|
|
133
|
+
### Shadow discipline (Hybrid)
|
|
134
|
+
|
|
135
|
+
- Shadow filename: `SHADOW_[doc_key]_vX.Y.md`, first line
|
|
136
|
+
`<!-- SHADOW generated from devPNT (doc_key vX.Y) - do not edit by hand -->`.
|
|
137
|
+
Never save a shadow under an `ANALYSIS_*` name: that name means "authoritative
|
|
138
|
+
Standalone document" and the validator treats it as such.
|
|
139
|
+
- **Export the approved E-TDD shadow BEFORE implementation** (not only at closure).
|
|
140
|
+
It gives context-free subagents their design input, unlocks `gate --hybrid`, and
|
|
141
|
+
guarantees the filesystem fallback if devPNT becomes unavailable mid-feature.
|
|
142
|
+
- At closure, refresh all shadows from the accepted DB versions.
|
|
143
|
+
|
|
144
|
+
### Validator in Hybrid
|
|
145
|
+
|
|
146
|
+
Pass `--hybrid` explicitly (never auto-detected — an explicit flag beats a guessed
|
|
147
|
+
mode): `check --hybrid` and `stale --hybrid` skip audit-plan staleness (mapping is
|
|
148
|
+
delegated to devPNT/KL) — guide-drift checking still runs (`ai_docs/reference/`
|
|
149
|
+
is filesystem-first even in Hybrid, see the ownership matrix above); `gate --hybrid`
|
|
150
|
+
also unlocks on the presence of an E-TDD shadow in `solutions/` (the Hybrid design
|
|
151
|
+
gate) instead of requiring an IN_PROGRESS ANALYSIS.
|
|
152
|
+
|
|
153
|
+
## L3 Workflow
|
|
154
|
+
|
|
155
|
+
### 1. Audit and Alignment
|
|
156
|
+
|
|
157
|
+
- Read `ai_docs/audit/handoff.md` if it exists; if its Date/Branch are inconsistent, treat it as history.
|
|
158
|
+
- Read `ai_docs/README.md` (curated must-reads) and `ai_docs/INDEX.md` (generated manifest of all canonical docs) to know what exists before exploring the code. `solutions/` and `audit/` are not indexed per file: search them with glob/grep.
|
|
159
|
+
- If `ai_docs/` is missing or incomplete, create the structure and minimal documents by analyzing the project in batches.
|
|
160
|
+
- In Standalone use `ai_docs/audit/audit_plan.md` for mapping and state.
|
|
161
|
+
- In Hybrid prefer the devPNT/KL mapping when available; do not duplicate plan governance.
|
|
162
|
+
- For detailed templates use `templates.md`.
|
|
163
|
+
|
|
164
|
+
### 2. Vision Gate
|
|
165
|
+
|
|
166
|
+
Standalone:
|
|
167
|
+
- Read `project_vision.md`, `roadmap.md`, `principles.md`.
|
|
168
|
+
- If a document declares `Status: DRAFT`, treat it as a hypothesis: flag conflicts, but do not block an explicit user request.
|
|
169
|
+
- If it declares `Status: APPROVED` and the request conflicts, stop and ask for a choice: update the Vision or modify/reject the request.
|
|
170
|
+
- Never promote a Vision to `APPROVED` without the user's confirmation.
|
|
171
|
+
|
|
172
|
+
Hybrid:
|
|
173
|
+
- Read the milestone's M-VISION, or ask for/create the step required by the devPNT protocol.
|
|
174
|
+
- Verify that the request serves a benefit or success signal of the M-VISION.
|
|
175
|
+
- If the request adds unauthorized scope, treat it as a Vision divergence.
|
|
176
|
+
|
|
177
|
+
### 3. Request Analysis
|
|
178
|
+
|
|
179
|
+
Standalone L3:
|
|
180
|
+
- 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
|
+
- Create or update `ai_docs/solutions/ANALYSIS_[feature].md`.
|
|
182
|
+
- Minimum sections: Objective, Feature Vision (or Vision Alignment), Impact, Security and Threat Model, Action Plan, Test Strategy, Diary/Current State.
|
|
183
|
+
- For features spanning multiple milestones or multiple analyses, also create `ai_docs/vision/features/VISION_[feature].md`.
|
|
184
|
+
|
|
185
|
+
Hybrid L3:
|
|
186
|
+
- Restore the Master Plan, Action Plan and linked documents.
|
|
187
|
+
- Use devPNT for plans and governed artifacts.
|
|
188
|
+
- Use `ai_docs/solutions/SHADOW_[doc_key]_vX.Y.md` only as a readable shadow when needed; on divergence devPNT wins.
|
|
189
|
+
|
|
190
|
+
### 4. Development and Testing
|
|
191
|
+
|
|
192
|
+
- Implement only after the documentation gate required by the level.
|
|
193
|
+
- Modify surgically, consistently with the plan.
|
|
194
|
+
- Write or update relevant automated tests; use AAA for unit tests when applicable.
|
|
195
|
+
- If the environment does not allow automated tests, declare the alternative verification and the reason.
|
|
196
|
+
- Circuit breaker: after 3 consecutive runs without progress on the tests, stop and ask for instructions.
|
|
197
|
+
- Update the ANALYSIS Diary or the Action Plan when you complete milestones, hit blockers or change decisions.
|
|
198
|
+
|
|
199
|
+
### 5. Closure
|
|
200
|
+
|
|
201
|
+
- Run the relevant tests/lint/smoke checks.
|
|
202
|
+
- Verify alignment with the local Vision or the devPNT M-VISION.
|
|
203
|
+
- Update only the documents actually impacted.
|
|
204
|
+
- **Aligned indexes (Poka-Yoke)**: if you created, moved or removed canonical documents (`vision/`, `reference/`, `architecture/`, `functional/`, `strategic/`):
|
|
205
|
+
- regenerate the manifest with `sdlc_check.py index` (writes `ai_docs/INDEX.md`) — never write it by hand;
|
|
206
|
+
- if the document is a must-read, add/update its line in the curated `README.md`;
|
|
207
|
+
- if the document replaces another, mark the old one `status: SUPERSEDED` and declare `supersedes:` in the new one;
|
|
208
|
+
- if you created a new canonical subdirectory, give it a purpose in `README.md`.
|
|
209
|
+
A canonical doc that is unindexed or lacks `status` = dirty closure (`sdlc_check.py check` fails/warns). Do not declare DONE until it is clean. Details: section "ai_docs documents".
|
|
210
|
+
- guides created or changed: `sdlc_check.py index` regenerates BOTH manifests (`ai_docs/INDEX.md` and the guide router `ai_docs/reference/INDEX.md`) in one run.
|
|
211
|
+
- In Hybrid propose ADR/KL updates when there were architectural decisions.
|
|
212
|
+
- In Standalone, if the project adopts `sdlc_check.py`, run `python <skill_dir>/scripts/sdlc_check.py check --root <project_root>` or the equivalent local copy.
|
|
213
|
+
- Updated documents must travel in the same commit/PR as the code they describe.
|
|
214
|
+
|
|
215
|
+
## ai_docs documents: two indexes + lifecycle
|
|
216
|
+
|
|
217
|
+
Documents in `ai_docs/` play two roles served by two distinct indexes — do not confuse them:
|
|
218
|
+
|
|
219
|
+
- **`ai_docs/README.md` (curated, by hand):** the reading priority. Few lines, only canonical must-reads, changes rarely. Human judgement on "what to read first".
|
|
220
|
+
- **`ai_docs/INDEX.md` (generated, `sdlc_check.py index`):** the complete manifest of every canonical doc (`vision/`, `reference/`, `architecture/`, `functional/`, `strategic/`) with description and status. Never by hand: it is regenerated, so it does not drift.
|
|
221
|
+
- **`strategic/features_history.md` (generated):** the ANALYSIS history, from their frontmatter.
|
|
222
|
+
- `audit/` and `solutions/` are discovery-by-grep: they do not enter the manifest.
|
|
223
|
+
|
|
224
|
+
**Canonical document header (lifecycle).** Every doc in those directories should open with a minimal frontmatter, so the manifest generates itself and an agent knows immediately whether to trust it:
|
|
225
|
+
|
|
226
|
+
```markdown
|
|
227
|
+
---
|
|
228
|
+
description: One line — what it is and when to read it.
|
|
229
|
+
status: CURRENT # CURRENT | SUPERSEDED | DRAFT | DEPRECATED
|
|
230
|
+
supersedes: old_doc.md # only if it replaces another doc
|
|
231
|
+
---
|
|
232
|
+
```
|
|
233
|
+
|
|
234
|
+
As a fallback (no frontmatter) the manifest derives the title from the first `# H1` and the description from the first prose line or blockquote; but without `status` a doc carries no freshness signal. A missing `status`, an invalid value, or a superseded doc still marked `CURRENT` = warning in `validate`. A `SUPERSEDED` doc stays on the filesystem as history, but its state declares it dead: no more greps leading back to obsolete guidance.
|
|
235
|
+
|
|
236
|
+
Without Python/hooks (minimal environments) the indexes and headers remain a prose discipline: update `README.md` and mark the `status` by hand; the validator is only the backstop where it is adopted.
|
|
237
|
+
|
|
238
|
+
Legacy note: the validator also accepts the deprecated Italian frontmatter keys (`stato`, `livello`, `data_inizio`, `data_fine`) and Italian section headings in existing projects. New documents must use the English forms.
|
|
239
|
+
|
|
240
|
+
## Operative Guides
|
|
241
|
+
|
|
242
|
+
Trigger test: the user hands over indications to follow (origin = user, not model
|
|
243
|
+
knowledge) meant to govern how the agent operates (purpose = operative), not just
|
|
244
|
+
inform an answer. Both hold → distill into `ai_docs/reference/GUIDE_[topic].md`.
|
|
245
|
+
|
|
246
|
+
A guide TRAINS the agent, two levels: the guide is the **synthesis** a trained
|
|
247
|
+
agent carries (compact — read whole before acting); the verbatim snapshot in
|
|
248
|
+
`.sources/` is the **book**, reached on demand via the section markers. Fidelity
|
|
249
|
+
constraint: only what the source supports; gaps marked `[not covered by source]`,
|
|
250
|
+
never filled from general knowledge; selection and compression expected, addition
|
|
251
|
+
forbidden. Full pipeline, DRY rule, snapshotting and maintenance: `guides.md`.
|
|
252
|
+
|
|
253
|
+
`ai_docs/reference/INDEX.md` is generated (the guide router) — never edit by hand,
|
|
254
|
+
regenerate with `sdlc_check.py index`.
|
|
255
|
+
|
|
256
|
+
## Mechanical Enforcement
|
|
257
|
+
|
|
258
|
+
The prompt is not enforcement. When the project needs repeatable guarantees:
|
|
259
|
+
- read `ENFORCEMENT.md`;
|
|
260
|
+
- use `scripts/sdlc_check.py validate --strict` in CI;
|
|
261
|
+
- use `scripts/sdlc_check.py gate` only for security-critical directories, not for the whole repository.
|
|
262
|
+
|
|
263
|
+
The validator is a support, not a universal prerequisite: the skill must stay usable in environments without Python or hooks, declaring what it cannot verify automatically.
|
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
# Operative Guides — pipeline
|
|
2
|
+
|
|
3
|
+
Support file for `ai_docs/reference/GUIDE_[topic].md`. Read this only when the
|
|
4
|
+
trigger below fires; the template lives in `templates.md`.
|
|
5
|
+
|
|
6
|
+
**The training model (what a guide IS).** A guide TRAINS the agent on a topic
|
|
7
|
+
the user cares about, the way training works for a person: you study the
|
|
8
|
+
material once, you carry a SYNTHESIS in your head, and you go back to the book
|
|
9
|
+
when a task needs detail. Two levels, both produced by this pipeline:
|
|
10
|
+
- **The guide = the synthesis** — compact and dense: core principles, decision
|
|
11
|
+
rules, the map of what exists, where people go wrong. Small enough that a
|
|
12
|
+
reader takes it in WHOLE before acting (that is the "preparation").
|
|
13
|
+
- **The snapshot = the book** (`.sources/`, verbatim) — the details live here,
|
|
14
|
+
reachable on demand.
|
|
15
|
+
- **The fidelity markers are the bridge**: `[source: <snapshot>#anchor]` both
|
|
16
|
+
proves provenance AND tells the reader where in the book the full detail is.
|
|
17
|
+
A guide that restates the source at length is as wrong as a fragmented one:
|
|
18
|
+
completeness is guaranteed by the book level, economy by the synthesis level.
|
|
19
|
+
|
|
20
|
+
## 1. When to trigger
|
|
21
|
+
|
|
22
|
+
Trigger test is origin + purpose, not content taxonomy (no "is this technical
|
|
23
|
+
enough" judgement call):
|
|
24
|
+
- **Origin**: the user hands you indications to follow — a document to adhere
|
|
25
|
+
to, a pasted policy, "do it this way", a style guide, a runbook.
|
|
26
|
+
- **Purpose**: the material is meant to GOVERN how the agent operates, not
|
|
27
|
+
just inform a one-off answer.
|
|
28
|
+
|
|
29
|
+
Both hold → this is guide material. Either is missing (e.g. the user pastes
|
|
30
|
+
background context with no operative intent, or asks a one-off question) →
|
|
31
|
+
this is not a guide; answer normally, do not create a file.
|
|
32
|
+
|
|
33
|
+
Never manufacture a guide from model knowledge. If the user asks for "a guide
|
|
34
|
+
on X" without handing over source material, ask for the source first — a
|
|
35
|
+
guide with no `distilled_from` is not this pipeline's output.
|
|
36
|
+
|
|
37
|
+
## 2. Pipeline
|
|
38
|
+
|
|
39
|
+
0. **Search before creating (DRY — one CURRENT guide per topic).** Before
|
|
40
|
+
proposing anything, read `ai_docs/reference/INDEX.md` and grep
|
|
41
|
+
`reference/GUIDE_*.md` for topic overlap with the new material. Never end
|
|
42
|
+
up with two CURRENT guides on the same topic. On overlap, pick by
|
|
43
|
+
provenance:
|
|
44
|
+
- **Same source, evolved** → UPDATE the existing guide in place: new
|
|
45
|
+
snapshot, new `source_hash`, same file (history lives in git).
|
|
46
|
+
- **Different source replacing the old one** → NEW guide + mark the old
|
|
47
|
+
one `status: SUPERSEDED` (its provenance chain must stay honest — do not
|
|
48
|
+
graft a new source onto a guide distilled from another).
|
|
49
|
+
- **Different source, partial overlap** → flag it to the user explicitly:
|
|
50
|
+
the current frontmatter binds ONE source per guide (`distilled_from`/
|
|
51
|
+
`source_hash` are singular), so a clean multi-source merge is not yet
|
|
52
|
+
supported — regenerate from the prevailing source and mark what the
|
|
53
|
+
merge drops, or keep the topics separate if they truly are.
|
|
54
|
+
Semantic overlap is NOT mechanically detectable: this step is agent
|
|
55
|
+
discipline plus the human reviewing the router — say what you found.
|
|
56
|
+
**Also verify the handed SOURCE itself is current**: check its lifecycle
|
|
57
|
+
(status/supersedes headers) and search the project for a newer version of
|
|
58
|
+
the same document before snapshotting. A user may hand you a path that a
|
|
59
|
+
migrated copy has since superseded — distilling from it produces a guide
|
|
60
|
+
that is born stale. If you find a newer version, surface it and distill
|
|
61
|
+
from that one. (Learned the hard way on first field use, 2026-07-02.)
|
|
62
|
+
1. **Decompose into PREPARATION units — and weigh the fragmentation risk.**
|
|
63
|
+
A guide's goal is to PREPARE an agent for a situation: everything that
|
|
64
|
+
situation needs must arrive in ONE guide. The risk is asymmetric — extra
|
|
65
|
+
context injected costs tokens (cheap, recoverable); missing context makes
|
|
66
|
+
the agent invent or fail (the exact failure this pipeline exists to
|
|
67
|
+
prevent). Every split is a bet that no future task will cross the cut.
|
|
68
|
+
Therefore:
|
|
69
|
+
- **Default = one guide per source/domain.** Split ONLY when the resulting
|
|
70
|
+
guides would be consulted in DISJOINT situations — no plausible task
|
|
71
|
+
needs two of them at once.
|
|
72
|
+
- **Run the split test per proposed fragment and DECLARE it** in the
|
|
73
|
+
proposal: "which tasks consult this fragment, and would any of those
|
|
74
|
+
tasks also need another fragment?" Any overlap → merge, do not split.
|
|
75
|
+
- Heterogeneous sources (unrelated policies handed over together) are the
|
|
76
|
+
legitimate split case; a single coherent document about one subsystem
|
|
77
|
+
almost never is.
|
|
78
|
+
2. **User confirms** the topic decomposition — including the declared
|
|
79
|
+
fragmentation-risk assessment — before any file is written.
|
|
80
|
+
3. **Snapshot each source verbatim** into
|
|
81
|
+
`ai_docs/reference/.sources/<slug>-<hash8>.md`:
|
|
82
|
+
- `slug` derives from the topic (lowercase, hyphenated).
|
|
83
|
+
- `hash8` = first 8 hex chars of the snapshot file's own SHA-256 (compute
|
|
84
|
+
the snapshot first, hash it, then name it — the hash is of the file you
|
|
85
|
+
just wrote, not of the original source).
|
|
86
|
+
- The snapshot is verbatim: no paraphrasing, no reformatting beyond what is
|
|
87
|
+
needed to save it as markdown.
|
|
88
|
+
4. **Source-anchored SYNTHESIS (not restatement).** Select and compress what
|
|
89
|
+
the source says into the operative essence — decision rules, invariants,
|
|
90
|
+
the "where people go wrong" list — and POINT INTO the snapshot for the
|
|
91
|
+
detail (`[source: <snapshot>#anchor]` doubles as the detail-lookup
|
|
92
|
+
pointer: "full checklist → snapshot §7"). Every claim must still trace to
|
|
93
|
+
a specific point in the snapshot; do not extract from memory of the
|
|
94
|
+
conversation — re-read the snapshot while writing each section. Selection
|
|
95
|
+
and compression are allowed and expected; ADDITION is not (that stays
|
|
96
|
+
summarize-and-expand, forbidden). A guide approaching the source's own
|
|
97
|
+
length is a paraphrase, not a synthesis — wrong output.
|
|
98
|
+
5. **Render per template** (`templates.md` → `## ai_docs/reference/GUIDE_[topic].md`):
|
|
99
|
+
frontmatter with `source`, `distilled_from`, `source_hash` (the snapshot's
|
|
100
|
+
SHA-256, matching what you just computed), optional `source_version`; body
|
|
101
|
+
sections chosen from the repertoire, each with a fidelity marker.
|
|
102
|
+
**Write for the two-level read**: the guide (synthesis) is small enough to
|
|
103
|
+
be read WHOLE before acting; the snapshot (book) is where size lives and
|
|
104
|
+
where readers grep/partial-read on demand, following the section markers.
|
|
105
|
+
Use the repertoire's stable, self-describing headings, keep one concern per
|
|
106
|
+
`##` section, and make the frontmatter `description` the "should I open
|
|
107
|
+
this file at all" answer. This is why one synthesis + one book beats
|
|
108
|
+
several fragments: the synthesis guarantees the whole picture, the book
|
|
109
|
+
guarantees the details, the markers connect them.
|
|
110
|
+
6. **Run `sdlc_check.py index`** so both `ai_docs/INDEX.md` and
|
|
111
|
+
`ai_docs/reference/INDEX.md` (the guide router) regenerate.
|
|
112
|
+
|
|
113
|
+
## 3. Fidelity rules (mandatory, the D5 constraint)
|
|
114
|
+
|
|
115
|
+
- Only what the source supports goes in the guide. If the source is silent on
|
|
116
|
+
something a reader might expect, mark the section `[not covered by source]`
|
|
117
|
+
— never fill the gap from general knowledge.
|
|
118
|
+
- Every `##` section body carries exactly one kind of marker: `[source:
|
|
119
|
+
<snapshot>#<anchor-or-line>]` for content traceable to the snapshot, or the
|
|
120
|
+
literal `[not covered by source]` for an acknowledged gap. A section with
|
|
121
|
+
neither is a validator warning.
|
|
122
|
+
- `summarize-and-expand` is forbidden: do not take a short source note and
|
|
123
|
+
"helpfully" expand it into a longer procedure using inferred steps. If the
|
|
124
|
+
source says one sentence, the guide section says that one sentence
|
|
125
|
+
(source-anchored), not an elaborated version of it.
|
|
126
|
+
- When in doubt about whether something is "supported" by the source, treat it
|
|
127
|
+
as not covered rather than stretching the marker to fit.
|
|
128
|
+
|
|
129
|
+
## 4. Ingestion bound (T9)
|
|
130
|
+
|
|
131
|
+
If a source document exceeds roughly 2000 lines, do not silently truncate or
|
|
132
|
+
skim it. Stop and ask the user to either split it into smaller documents or
|
|
133
|
+
select the specific sections relevant to the guide being built. Silent
|
|
134
|
+
truncation produces a guide that looks complete but is missing unreviewed
|
|
135
|
+
material — worse than asking.
|
|
136
|
+
|
|
137
|
+
## 5. Review
|
|
138
|
+
|
|
139
|
+
Before the guide is used operatively for the first time, recommend an
|
|
140
|
+
independent guide-vs-source review (a fresh pass comparing the rendered guide
|
|
141
|
+
against the snapshot, checking every marker) — process control per the
|
|
142
|
+
threat model (P-TM). This is a recommendation to the user, not a hard gate:
|
|
143
|
+
state it explicitly when handing off a newly created guide.
|
|
144
|
+
|
|
145
|
+
## 6. Maintenance
|
|
146
|
+
|
|
147
|
+
- **Source changed**: create a new snapshot (new hash), regenerate the guide
|
|
148
|
+
from it (new `source_hash`), and if the guide is replacing a prior guide
|
|
149
|
+
rather than updating in place, mark the old one `status: SUPERSEDED`.
|
|
150
|
+
- **`stale` flags hash drift**: `sdlc_check.py stale` (also under `--hybrid`)
|
|
151
|
+
compares each guide's recorded `source_hash` against the live snapshot file
|
|
152
|
+
and reports `[stale]` when they diverge — that is the signal to regenerate,
|
|
153
|
+
not a manual freshness check.
|