@antoneeo/agentic-sdlc-skill 1.6.0 → 1.7.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,244 @@
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
+ - `scripts/sdlc_check.py`: mechanical validator for `ai_docs/` (`check`, `validate`, `index`, `stale`, `mark`, `gate`).
15
+ - `ENFORCEMENT.md`: optional setup for CI and hooks.
16
+
17
+ Read these files only when needed. `SKILL.md` is the operating contract; the support files are progressive resources.
18
+
19
+ ## Technical Values
20
+
21
+ - **Understand before acting:** do not modify code without understanding root cause, constraints and current shape.
22
+ - **Preserve architectural coherence:** respect existing layers, responsibilities, naming, patterns and conventions.
23
+ - **Apply DRY and simplicity:** do not duplicate logic or knowledge; abstract only when it reduces real complexity.
24
+ - **Preserve quality:** every change must maintain or improve stability, testability and maintainability.
25
+ - **Verify technically:** close implementation work with tests, lint, smoke checks or an explicit reason.
26
+ - **Keep useful memory:** document relevant decisions and operational state, not filler text.
27
+ - **Protect the Vision:** every decision must stay aligned with expected benefits, users, non-goals and success signals.
28
+
29
+ If a patch looks easy but you do not understand why the current code is shaped the way it is, investigate first.
30
+
31
+ ## Rule Zero: Triage
32
+
33
+ Always classify the request before choosing the process. Declare the chosen level to the user when you start operational work.
34
+
35
+ | Level | Criteria | Required process |
36
+ |---|---|---|
37
+ | **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. |
38
+ | **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. |
39
+ | **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. |
40
+ | **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. |
41
+
42
+ Cross-cutting rules:
43
+ - Parsing of external input, authN/authZ, cryptography, networking, personal data and filesystem access are security-sensitive: never L1.
44
+ - If a bigger impact emerges during L1/L2 work, stop, reclassify and declare it.
45
+ - When in doubt, pick the higher level.
46
+ - The full audit does not start for L1/L2 unless explicitly requested.
47
+
48
+ ## Operating Modes
49
+
50
+ ### Full Standalone
51
+
52
+ Use this mode when devPNT is unavailable, not configured for the current project, or the user explicitly asks for a filesystem-only workflow.
53
+
54
+ Source of truth:
55
+ - Vision: `ai_docs/vision/project_vision.md`, `roadmap.md`, `principles.md`.
56
+ - Features/analyses: `ai_docs/solutions/ANALYSIS_[feature].md`.
57
+ - Audit/handoff: `ai_docs/audit/`.
58
+ - Feature history: `ai_docs/strategic/features_history.md`, manual or generated by the validator, depending on the structure the project adopts.
59
+
60
+ Standalone mode is not reduced: it must handle audits, features, significant bugs, tests, handoffs and closure without devPNT.
61
+
62
+ ### Hybrid in symbiosis with devPNT
63
+
64
+ Use this mode when the `devpnt_*` tools are available and point at the current project.
65
+
66
+ Authoritative hierarchy:
67
+ 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.
68
+ 2. **devPNT Master Plan**: strategic roadmap and milestones.
69
+ 3. **devPNT Action Plan**: current tactical work for the active goal.
70
+ 4. **devPNT governed artifacts**: `D-UC`, `P-TM`, `E-ISP`, `E-TDD`, `E-TP`, ADR.
71
+ 5. **Local `ai_docs/`**: readable context, Standalone fallback, local handoff or shadow/mirror when useful.
72
+
73
+ Hybrid rules:
74
+ - devPNT is the governed source for plans and artifacts; do not create a second truth in `ai_docs/`.
75
+ - The skill stays autonomous: if devPNT is not there, switch to Standalone without losing capability.
76
+ - If the user request, the local Vision and the M-VISION diverge, stop and make the conflict explicit.
77
+ - Do not create or modify milestones without respecting the M-VISION.
78
+ - Never auto-accept devPNT proposals: present the preview and wait for explicit confirmation.
79
+ - If the local devPNT protocol imposes stricter bootstrap, plans or gates, follow them.
80
+
81
+ ## Coexistence with devPNT (the Hybrid seam)
82
+
83
+ This section is the single authoritative answer to "who owns what" when both the
84
+ skill and devPNT are active. The skill owns the **process** (triage, phases, Vision
85
+ Gate, lifecycle); devPNT owns the **machinery** (governed storage, versioned
86
+ proposals, semantic analysis, independent reviewers). devPNT strengthens the
87
+ process; it never replaces it.
88
+
89
+ ### Ownership matrix
90
+
91
+ | Artifact | Standalone master | Hybrid master | Mirror rule |
92
+ |---|---|---|---|
93
+ | Product vision | `vision/project_vision.md` | `vision/project_vision.md` (product scope) | devPNT KL vision is regenerated from it, never edited independently |
94
+ | Milestone vision | `vision/roadmap.md` milestones | devPNT M-VISION | `roadmap.md` may reference the M-VISION key; it never restates its content |
95
+ | 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 |
96
+ | Plans | `## Action Plan` inside the ANALYSIS | devPNT Master/Action Plan | none |
97
+ | Feature state | ANALYSIS frontmatter `status` | Action Plan node status | mapping table below; at closure both must move together |
98
+ | ADR | `architecture/` (canonical dir) | devPNT DB (`adr_YYYY-MM-DD_slug`) | optional filesystem shadow `SHADOW_adr_*` exported at closure for grep-ability |
99
+ | Audit / freshness | `audit/audit_plan.md` + `stale`/`mark` | devPNT KL coverage + summary status | run `check --hybrid` (skips audit-plan staleness) |
100
+ | 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 |
101
+ | Handoff | `audit/handoff.md` | `audit/handoff.md` | always filesystem |
102
+
103
+ ### Triage equivalence (one threshold, two vocabularies)
104
+
105
+ devPNT's "significance threshold" and the skill's triage are the SAME test. Do not
106
+ run two classifications:
107
+
108
+ | Skill triage | devPNT equivalent | Governed artifacts |
109
+ |---|---|---|
110
+ | L1 Trivial | trivial exempt | none |
111
+ | L2 Small | localized obvious edit | none but see escalation |
112
+ | L3 Significant | governed unit of change | D-UC/P-TM/E-ISP/E-TDD per the devPNT trigger policy |
113
+ | Spike | exempt (non-mergeable) | `SPIKE_[topic].md` only |
114
+
115
+ Escalation triggers (any one of these makes it L3, in BOTH vocabularies): touches
116
+ more than one module, changes a public API/contract/message format, changes a data
117
+ model or state machine, has a security surface, risks duplicating existing logic,
118
+ or the design choice is non-obvious. An L2 that trips one of these is not an L2.
119
+
120
+ ### Feature state mapping
121
+
122
+ | ANALYSIS frontmatter | devPNT plan node |
123
+ |---|---|
124
+ | PLANNED | READY (or BLOCKED / ON_HOLD while waiting) |
125
+ | IN_PROGRESS | PROGRESS |
126
+ | COMPLETED | DONE |
127
+ | CANCELLED | CANCELLED |
128
+
129
+ Closure discipline: never mark the node DONE while the shadow/ANALYSIS still says
130
+ IN_PROGRESS, or vice versa. They move in the same closure step.
131
+
132
+ ### Shadow discipline (Hybrid)
133
+
134
+ - Shadow filename: `SHADOW_[doc_key]_vX.Y.md`, first line
135
+ `<!-- SHADOW generated from devPNT (doc_key vX.Y) - do not edit by hand -->`.
136
+ Never save a shadow under an `ANALYSIS_*` name: that name means "authoritative
137
+ Standalone document" and the validator treats it as such.
138
+ - **Export the approved E-TDD shadow BEFORE implementation** (not only at closure).
139
+ It gives context-free subagents their design input, unlocks `gate --hybrid`, and
140
+ guarantees the filesystem fallback if devPNT becomes unavailable mid-feature.
141
+ - At closure, refresh all shadows from the accepted DB versions.
142
+
143
+ ### Validator in Hybrid
144
+
145
+ Pass `--hybrid` explicitly (never auto-detected — an explicit flag beats a guessed
146
+ mode): `check --hybrid` and `stale --hybrid` skip audit-plan staleness (mapping is
147
+ delegated to devPNT/KL); `gate --hybrid` also unlocks on the presence of an E-TDD
148
+ shadow in `solutions/` (the Hybrid design gate) instead of requiring an IN_PROGRESS
149
+ ANALYSIS.
150
+
151
+ ## L3 Workflow
152
+
153
+ ### 1. Audit and Alignment
154
+
155
+ - Read `ai_docs/audit/handoff.md` if it exists; if its Date/Branch are inconsistent, treat it as history.
156
+ - 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.
157
+ - If `ai_docs/` is missing or incomplete, create the structure and minimal documents by analyzing the project in batches.
158
+ - In Standalone use `ai_docs/audit/audit_plan.md` for mapping and state.
159
+ - In Hybrid prefer the devPNT/KL mapping when available; do not duplicate plan governance.
160
+ - For detailed templates use `templates.md`.
161
+
162
+ ### 2. Vision Gate
163
+
164
+ Standalone:
165
+ - Read `project_vision.md`, `roadmap.md`, `principles.md`.
166
+ - If a document declares `Status: DRAFT`, treat it as a hypothesis: flag conflicts, but do not block an explicit user request.
167
+ - If it declares `Status: APPROVED` and the request conflicts, stop and ask for a choice: update the Vision or modify/reject the request.
168
+ - Never promote a Vision to `APPROVED` without the user's confirmation.
169
+
170
+ Hybrid:
171
+ - Read the milestone's M-VISION, or ask for/create the step required by the devPNT protocol.
172
+ - Verify that the request serves a benefit or success signal of the M-VISION.
173
+ - If the request adds unauthorized scope, treat it as a Vision divergence.
174
+
175
+ ### 3. Request Analysis
176
+
177
+ Standalone L3:
178
+ - 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.
179
+ - Create or update `ai_docs/solutions/ANALYSIS_[feature].md`.
180
+ - Minimum sections: Objective, Feature Vision (or Vision Alignment), Impact, Security and Threat Model, Action Plan, Test Strategy, Diary/Current State.
181
+ - For features spanning multiple milestones or multiple analyses, also create `ai_docs/vision/features/VISION_[feature].md`.
182
+
183
+ Hybrid L3:
184
+ - Restore the Master Plan, Action Plan and linked documents.
185
+ - Use devPNT for plans and governed artifacts.
186
+ - Use `ai_docs/solutions/SHADOW_[doc_key]_vX.Y.md` only as a readable shadow when needed; on divergence devPNT wins.
187
+
188
+ ### 4. Development and Testing
189
+
190
+ - Implement only after the documentation gate required by the level.
191
+ - Modify surgically, consistently with the plan.
192
+ - Write or update relevant automated tests; use AAA for unit tests when applicable.
193
+ - If the environment does not allow automated tests, declare the alternative verification and the reason.
194
+ - Circuit breaker: after 3 consecutive runs without progress on the tests, stop and ask for instructions.
195
+ - Update the ANALYSIS Diary or the Action Plan when you complete milestones, hit blockers or change decisions.
196
+
197
+ ### 5. Closure
198
+
199
+ - Run the relevant tests/lint/smoke checks.
200
+ - Verify alignment with the local Vision or the devPNT M-VISION.
201
+ - Update only the documents actually impacted.
202
+ - **Aligned indexes (Poka-Yoke)**: if you created, moved or removed canonical documents (`vision/`, `reference/`, `architecture/`, `functional/`, `strategic/`):
203
+ - regenerate the manifest with `sdlc_check.py index` (writes `ai_docs/INDEX.md`) — never write it by hand;
204
+ - if the document is a must-read, add/update its line in the curated `README.md`;
205
+ - if the document replaces another, mark the old one `status: SUPERSEDED` and declare `supersedes:` in the new one;
206
+ - if you created a new canonical subdirectory, give it a purpose in `README.md`.
207
+ 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".
208
+ - In Hybrid propose ADR/KL updates when there were architectural decisions.
209
+ - 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.
210
+ - Updated documents must travel in the same commit/PR as the code they describe.
211
+
212
+ ## ai_docs documents: two indexes + lifecycle
213
+
214
+ Documents in `ai_docs/` play two roles served by two distinct indexes — do not confuse them:
215
+
216
+ - **`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".
217
+ - **`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.
218
+ - **`strategic/features_history.md` (generated):** the ANALYSIS history, from their frontmatter.
219
+ - `audit/` and `solutions/` are discovery-by-grep: they do not enter the manifest.
220
+
221
+ **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:
222
+
223
+ ```markdown
224
+ ---
225
+ description: One line — what it is and when to read it.
226
+ status: CURRENT # CURRENT | SUPERSEDED | DRAFT | DEPRECATED
227
+ supersedes: old_doc.md # only if it replaces another doc
228
+ ---
229
+ ```
230
+
231
+ 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.
232
+
233
+ 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.
234
+
235
+ 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.
236
+
237
+ ## Mechanical Enforcement
238
+
239
+ The prompt is not enforcement. When the project needs repeatable guarantees:
240
+ - read `ENFORCEMENT.md`;
241
+ - use `scripts/sdlc_check.py validate --strict` in CI;
242
+ - use `scripts/sdlc_check.py gate` only for security-critical directories, not for the whole repository.
243
+
244
+ 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.