@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.
@@ -1,172 +1,263 @@
1
- ---
2
- name: agentic-sdlc
3
- description: Protocollo SDLC Documentation-First con triage proporzionale, Vision come guida, modalita Standalone completa e simbiosi opzionale con devPNT. Usare per feature, bug significativi, refactor, audit e manutenzione documentata.
4
- author: Antonio Pinto (https://github.com/Antoneeo)
5
- copyright: (c) 2026 Antonio Pinto
6
- ---
7
-
8
- # Agentic SDLC
9
-
10
- Questa skill guida lo sviluppo software con un processo Documentation-First proporzionale al rischio. Deve funzionare pienamente anche senza devPNT. Quando devPNT e' disponibile e configurato per il progetto corrente, la skill lavora in simbiosi con la sua governance: M-VISION, Master Plan, Action Plan e artefatti versionati diventano il quadro autorevole per milestone e implementazione.
11
-
12
- File di supporto nella directory della skill:
13
- - `templates.md`: template per Vision, ANALYSIS, Spike, audit plan e handoff.
14
- - `scripts/sdlc_check.py`: validatore meccanico per `ai_docs/` (`check`, `validate`, `index`, `stale`, `mark`, `gate`).
15
- - `ENFORCEMENT.md`: setup opzionale per CI e hook.
16
-
17
- Leggi questi file solo quando servono. `SKILL.md` e' il contratto operativo; i support file sono risorse progressive.
18
-
19
- ## Valori Tecnici
20
-
21
- - **Comprendi prima di agire:** non modificare codice senza capire root cause, vincoli e forma attuale.
22
- - **Mantieni coerenza architetturale:** rispetta layer, responsabilita, naming, pattern e convenzioni esistenti.
23
- - **Applica DRY e semplicita:** non duplicare logica o conoscenza; astrai solo se riduce complessita reale.
24
- - **Preserva qualita:** ogni modifica deve mantenere o migliorare stabilita, testabilita e manutenibilita.
25
- - **Verifica tecnicamente:** chiudi lavoro implementativo con test, lint, smoke check o motivo esplicito.
26
- - **Mantieni memoria utile:** documenta decisioni e stato operativo rilevanti, non testo riempitivo.
27
- - **Proteggi la Vision:** ogni decisione deve restare allineata a benefici attesi, utenti, non-obiettivi e segnali di successo.
28
-
29
- Se una patch sembra facile ma non capisci perche il codice attuale e' fatto cosi, indaga prima.
30
-
31
- ## Regola Zero: Triage
32
-
33
- Classifica sempre la richiesta prima di scegliere il processo. Dichiara il livello scelto all'utente quando inizi il lavoro operativo.
34
-
35
- | Livello | Criteri | Processo richiesto |
36
- |---|---|---|
37
- | **L1 - Triviale** | Circa 10 righe in 1-2 file; nessun cambio API, dipendenza o comportamento nuovo; refusi o fix che ripristinano comportamento gia atteso | Implementa. Esegui test pertinenti se esistono. Nessun nuovo documento. |
38
- | **L2 - Piccolo** | Root cause chiara; massimo 3 file; nessuna nuova dipendenza o API pubblica; rischio basso | Mini-analisi nel messaggio: obiettivo, impatto, sicurezza, test. Test obbligatori. Nessun nuovo documento salvo aggiornare analisi/handoff esistenti se utile. |
39
- | **L3 - Significativo** | Oltre 3 file, API/contratti, nuova dipendenza, comportamento visibile, area security-sensitive, cambio architetturale o design non ovvio | Workflow completo: Vision Gate, analisi, piano, implementazione, test, chiusura. |
40
- | **Spike** | Esplorazione time-boxed per ridurre incertezza | Codice non mergiabile in main. Esito in `ai_docs/solutions/SPIKE_[tema].md`. Per produzione riclassifica come L2 o L3. |
41
-
42
- Regole trasversali:
43
- - Parsing input esterni, authN/authZ, crittografia, rete, dati personali e filesystem sono security-sensitive: mai L1.
44
- - Se durante L1/L2 emerge impatto maggiore, fermati, riclassifica e dichiaralo.
45
- - Nel dubbio scegli il livello piu alto.
46
- - L'audit completo non parte per L1/L2 salvo richiesta esplicita.
47
-
48
- ## Modalita Operative
49
-
50
- ### Standalone completa
51
-
52
- Usa questa modalita quando devPNT non e' disponibile, non e' configurato per il progetto corrente o l'utente chiede esplicitamente un workflow solo filesystem.
53
-
54
- Fonte di verita:
55
- - Vision: `ai_docs/vision/project_vision.md`, `roadmap.md`, `principles.md`.
56
- - Feature/analisi: `ai_docs/solutions/ANALYSIS_[feature].md`.
57
- - Audit/handoff: `ai_docs/audit/`.
58
- - Storico feature: `ai_docs/strategic/features_history.md` manuale o generato dal validatore, in base alla struttura adottata dal progetto.
59
-
60
- La modalita Standalone non e' ridotta: deve poter gestire audit, feature, bug significativi, test, handoff e chiusura senza devPNT.
61
-
62
- ### Hybrid in simbiosi con devPNT
63
-
64
- Usa questa modalita quando i tool `devpnt_*` sono disponibili e puntano al progetto corrente.
65
-
66
- Gerarchia autorevole:
67
- 1. **M-VISION devPNT**: faro strategico della milestone. Prima di design o codice, leggila e verifica benefici, success signals, scope-in e non-goals.
68
- 2. **Master Plan devPNT**: roadmap strategica e milestone.
69
- 3. **Action Plan devPNT**: lavoro tattico corrente per il goal attivo.
70
- 4. **Artefatti governati devPNT**: `D-UC`, `P-TM`, `E-ISP`, `E-TDD`, `E-TP`, ADR.
71
- 5. **`ai_docs/` locale**: contesto leggibile, fallback Standalone, handoff locale o shadow/mirror quando utile.
72
-
73
- Regole Hybrid:
74
- - devPNT e' la fonte governata per piani e artefatti; non creare una seconda verita in `ai_docs/`.
75
- - La skill resta autonoma: se devPNT non c'e', passa a Standalone senza perdere capacita.
76
- - Se richiesta utente, Vision locale e M-VISION divergono, fermati e rendi esplicito il conflitto.
77
- - Non creare o modificare milestone senza rispettare la M-VISION.
78
- - Non accettare automaticamente proposte devPNT: presenta la preview e attendi conferma esplicita.
79
- - Se il protocollo devPNT locale impone bootstrap, piani o gate piu severi, seguili.
80
-
81
- ## Workflow L3
82
-
83
- ### 1. Audit e Allineamento
84
-
85
- - Leggi `ai_docs/audit/handoff.md` se esiste; se ha Data/Branch non coerenti, trattalo come storico.
86
- - Leggi `ai_docs/README.md` (must-read curati) e `ai_docs/INDEX.md` (manifest generato di tutti i doc canonici) per sapere cosa esiste prima di esplorare il codice. `solutions/` e `audit/` non sono indicizzate per file: cercale con glob/grep.
87
- - Se `ai_docs/` manca o e' incompleta, crea struttura e documenti minimi analizzando il progetto a lotti.
88
- - In Standalone usa `ai_docs/audit/audit_plan.md` per mappatura e stato.
89
- - In Hybrid preferisci la mappatura devPNT/KL quando disponibile; non duplicare la governance dei piani.
90
- - Per template dettagliati usa `templates.md`.
91
-
92
- ### 2. Vision Gate
93
-
94
- Standalone:
95
- - Leggi `project_vision.md`, `roadmap.md`, `principles.md`.
96
- - Se un documento dichiara `Stato: DRAFT`, trattalo come ipotesi: segnala conflitti, ma non bloccare una richiesta esplicita dell'utente.
97
- - Se dichiara `Stato: APPROVED`, e la richiesta confligge, fermati e chiedi scelta: aggiornare Vision o modificare/rifiutare la richiesta.
98
- - Non promuovere mai una Vision a `APPROVED` senza conferma dell'utente.
99
-
100
- Hybrid:
101
- - Leggi la M-VISION della milestone o chiedi/crea il passaggio richiesto dal protocollo devPNT.
102
- - Verifica che la richiesta serva un beneficio o success signal della M-VISION.
103
- - Se la richiesta aggiunge scope non autorizzato, trattala come divergenza di Vision.
104
-
105
- ### 3. Analisi della Richiesta
106
-
107
- Standalone L3:
108
- - Prima di creare un nuovo `ANALYSIS_[feature].md`, cerca con glob/grep in `ai_docs/solutions/` un'analisi gia' esistente sullo stesso tema: se c'e', aggiornala invece di duplicarla.
109
- - Crea o aggiorna `ai_docs/solutions/ANALYSIS_[feature].md`.
110
- - Sezioni minime: Obiettivo, Vision della Feature o Allineamento alla Vision, Impatto, Sicurezza e Threat Model, Piano d'Azione, Strategia di Test, Diario/Stato Corrente.
111
- - Per feature che attraversano piu milestone o piu analisi, crea anche `ai_docs/vision/features/VISION_[feature].md`.
112
-
113
- Hybrid L3:
114
- - Ripristina Master Plan, Action Plan e documenti collegati.
115
- - Usa devPNT per piani e artefatti governati.
116
- - Usa `ai_docs/solutions/SHADOW_[doc_key]_vX.Y.md` solo come shadow leggibile quando serve; in divergenza vince devPNT.
117
-
118
- ### 4. Sviluppo e Test
119
-
120
- - Implementa solo dopo il gate documentale richiesto dal livello.
121
- - Modifica in modo chirurgico, coerente con il piano.
122
- - Scrivi o aggiorna test automatici pertinenti; usa AAA per unit test quando applicabile.
123
- - Se l'ambiente non permette test automatici, dichiara verifica alternativa e motivo.
124
- - Circuit breaker: dopo 3 esecuzioni consecutive senza progresso sui test, fermati e chiedi istruzioni.
125
- - Aggiorna il Diario dell'ANALYSIS o l'Action Plan quando completi milestone, incontri blocchi o cambi decisione.
126
-
127
- ### 5. Chiusura
128
-
129
- - Esegui test/lint/smoke check pertinenti.
130
- - Verifica allineamento con Vision locale o M-VISION devPNT.
131
- - Aggiorna solo i documenti effettivamente impattati.
132
- - **Indici allineati (Poka-Yoke)**: se hai creato, spostato o rimosso documenti canonici (`vision/`, `reference/`, `architecture/`, `functional/`, `strategic/`):
133
- - rigenera il manifest con `sdlc_check.py index` (scrive `ai_docs/INDEX.md`) — non scriverlo a mano;
134
- - se il documento e' must-read, aggiungi/aggiorna la sua riga nel `README.md` curato;
135
- - se il documento ne sostituisce un altro, marca il vecchio `status: SUPERSEDED` e dichiara `supersedes:` nel nuovo;
136
- - se hai creato una nuova sottodirectory canonica, dalle uno scopo nel `README.md`.
137
- Doc canonico non indicizzato o senza `status` = chiusura sporca (`sdlc_check.py check` fallisce/avvisa). Non dichiarare DONE finche' non e' pulito. Dettagli: sezione "Documenti ai_docs".
138
- - In Hybrid proponi ADR/KL quando ci sono decisioni architetturali.
139
- - In Standalone, se il progetto adotta `sdlc_check.py`, esegui `python <skill_dir>/scripts/sdlc_check.py check --root <project_root>` o la copia locale equivalente.
140
- - I documenti aggiornati devono viaggiare nello stesso commit/PR del codice che descrivono.
141
-
142
- ## Documenti ai_docs: due indici + lifecycle
143
-
144
- I documenti in `ai_docs/` hanno due ruoli serviti da due indici distinti — non confonderli:
145
-
146
- - **`ai_docs/README.md` (curato, a mano):** la priorita' di lettura. Poche righe, solo must-read canonici, cambia di rado. Giudizio umano su "cosa leggere prima".
147
- - **`ai_docs/INDEX.md` (generato, `sdlc_check.py index`):** il manifest completo di ogni doc canonico (`vision/`, `reference/`, `architecture/`, `functional/`, `strategic/`) con descrizione e stato. Mai a mano: si rigenera, cosi' non drifta.
148
- - **`strategic/features_history.md` (generato):** lo storico delle ANALYSIS, dai loro frontmatter.
149
- - `audit/` e `solutions/` sono discovery-by-grep: non entrano nel manifest.
150
-
151
- **Header dei documenti canonici (lifecycle).** Ogni doc in quelle directory dovrebbe aprirsi con un frontmatter minimo, cosi' il manifest si genera da solo e un agente sa subito se fidarsi:
152
-
153
- ```markdown
154
- ---
155
- description: Una riga cos'e' e quando leggerlo.
156
- status: CURRENT # CURRENT | SUPERSEDED | DRAFT | DEPRECATED
157
- supersedes: vecchio_doc.md # solo se rimpiazza un altro doc
158
- ---
159
- ```
160
-
161
- In fallback (nessun frontmatter) il manifest deduce il titolo dal primo `# H1` e la descrizione dalla prima riga di prosa o blockquote; ma senza `status` un doc non porta segnale di freschezza. `status` mancante, valore non valido, o doc superseduto ancora `CURRENT` = avviso in `validate`. Un doc `SUPERSEDED` resta sul filesystem come storico, ma il suo stato lo dichiara morto: niente piu' grep che riportano a guide obsolete.
162
-
163
- Senza Python/hook (ambienti minimali) gli indici e gli header restano una disciplina di prosa: aggiorna `README.md` e marca lo `status` a mano; il validatore e' solo il backstop dove e' adottato.
164
-
165
- ## Enforcement Meccanico
166
-
167
- Il prompt non e' enforcement. Quando il progetto richiede garanzie ripetibili:
168
- - leggi `ENFORCEMENT.md`;
169
- - usa `scripts/sdlc_check.py validate` in CI;
170
- - usa `scripts/sdlc_check.py gate` solo per directory security-critical, non per tutto il repository.
171
-
172
- Il validatore e' un supporto, non un prerequisito universale: la skill deve restare usabile anche in ambienti senza Python o senza hook, dichiarando cosa non puo' verificare automaticamente.
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.