@antoneeo/kb-agentic-skill 1.35.1 → 1.37.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 CHANGED
@@ -3,7 +3,29 @@
3
3
  Every significant change to this skill is recorded here.
4
4
 
5
5
 
6
- ## [Unreleased]
6
+ ## [1.37.0] - 2026-11-12
7
+
8
+ ### What's new
9
+
10
+ **A guide that governs the work is now read whole before the agent edits.** Agents often read only the first part of a matching guide (a read with a line limit, `head`, a search inside it) and then applied only that part, missing the steps further down. The doctrine now says a matched guide is read from its first line to its last and applied whole; a rule that does not fit is proposed as a change to the guide, never skipped in silence, and the rest still binds. The per-prompt reminder says the same. On Claude Code, and on local Codex sessions where you trusted the installed hooks, the edit check enforces it: an edit is refused until the session's reads of every guide named in its router verdict cover the whole file. A search, `head`, `sed`, a partial read or a subagent brief that names the guide no longer counts as reading it (F-094).
11
+
12
+ #### What to do
13
+
14
+ Everyone who has this package installed: run `npm install -g @antoneeo/kb-agentic-skill@latest`, then `kb-agentic-install-skill`, and restart your agent sessions. The install step copies the updated doctrine and validator into your skills directory; sessions already open keep the old check until restarted. Expect one new refusal: if a session only searched or partly read a guide it named in its router verdict, its first edit is refused and the message names the guide. Read the guide whole, with no offset or limit (a guide longer than your client's read cap in consecutive chunks to the end), then edit again. To check it worked, run `npm ls -g @antoneeo/kb-agentic-skill` and look for 1.37.0.
15
+
16
+ ## [1.36.0] - 2026-11-08
17
+
18
+ ### What's new
19
+
20
+ **With several lenses of the family installed, the per-prompt reminder now names them.** A machine gets one reminder for the whole family, wired by whichever lens was installed first, so a knowledge or marketing task used to see the code lens's line. When other lenses are installed, the line now lists each one with its domain, for example `kb-agentic (knowledge)`, and asks the agent to load the one that governs the work. A single-lens install sees no change. To do this the reminder reads the installed skill names at each prompt (names only), and its length bound rises from 600 to 700 characters (F-093).
21
+
22
+ #### What to do
23
+
24
+ Everyone who has this package installed: run `npm install -g @antoneeo/kb-agentic-skill@latest`, then `kb-agentic-install-skill`, and restart your agent sessions. The install step copies the updated validator into your skills directory and wires the reminder if it is missing; sessions already open keep the old one until restarted. To check it worked, run `npm ls -g @antoneeo/kb-agentic-skill` and look for 1.36.0, then start a session: on a machine with more than one lens of the family installed, the one-line reminder shown at each prompt names the installed lenses with their domains.
25
+
26
+ ### Fixed
27
+
28
+ **Installing this package now wires the per-turn reminder its ENFORCEMENT.md promised.** Until now only the code lens (agentic-sdlc) installed it, so a machine with this lens alone never received the one-line reminder at each prompt. It is wired on Claude Code alongside the session orientation; if another lens of the family already wired its own reminder, that one stays and nothing is added, so a prompt carries one line. Removing the hook entry is still a standing opt-out, and uninstalling removes only this package's own entry (F-093).
7
29
 
8
30
  ## [1.35.1] - 2026-11-04
9
31
 
package/README.md CHANGED
@@ -6,13 +6,13 @@ The sibling of [`@antoneeo/agentic-sdlc-skill`](https://www.npmjs.com/package/@a
6
6
 
7
7
  <!-- whats-new:begin -->
8
8
  <!-- generated by scripts/whats_new.js from distributions/kb-agentic-skill/CHANGELOG.md: edit the CHANGELOG, then run node scripts/whats_new.js --write -->
9
- ## What's new in 1.35.1
9
+ ## What's new in 1.37.0
10
10
 
11
- **Codex hook checks can recognize the work the agent is doing.** The shared validator recognizes supported native Codex patches and transcript records, and gives more accurate orientation-hook diagnostics when definitions are disabled or cannot be verified. Existing hook setup and opt-outs are preserved.
11
+ **A guide that governs the work is now read whole before the agent edits.** Agents often read only the first part of a matching guide (a read with a line limit, `head`, a search inside it) and then applied only that part, missing the steps further down. The doctrine now says a matched guide is read from its first line to its last and applied whole; a rule that does not fit is proposed as a change to the guide, never skipped in silence, and the rest still binds. The per-prompt reminder says the same. On Claude Code, and on local Codex sessions where you trusted the installed hooks, the edit check enforces it: an edit is refused until the session's reads of every guide named in its router verdict cover the whole file. A search, `head`, `sed`, a partial read or a subagent brief that names the guide no longer counts as reading it (F-094).
12
12
 
13
13
  #### What to do
14
14
 
15
- Run `npm install -g @antoneeo/kb-agentic-skill@latest`, then `kb-agentic-install-skill`, and restart your agent sessions so they load the updated validator. Check that `npm ls -g @antoneeo/kb-agentic-skill` shows 1.35.1. Any configured Codex hooks still require their normal client trust review.
15
+ Everyone who has this package installed: run `npm install -g @antoneeo/kb-agentic-skill@latest`, then `kb-agentic-install-skill`, and restart your agent sessions. The install step copies the updated doctrine and validator into your skills directory; sessions already open keep the old check until restarted. Expect one new refusal: if a session only searched or partly read a guide it named in its router verdict, its first edit is refused and the message names the guide. Read the guide whole, with no offset or limit (a guide longer than your client's read cap in consecutive chunks to the end), then edit again. To check it worked, run `npm ls -g @antoneeo/kb-agentic-skill` and look for 1.37.0.
16
16
 
17
17
  Full history: [CHANGELOG](https://github.com/Antoneeo/agentic-sdlc-skill/blob/main/distributions/kb-agentic-skill/CHANGELOG.md)
18
18
  <!-- whats-new:end -->
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "kb-agentic-skill",
3
- "version": "1.35.1",
3
+ "version": "1.37.0",
4
4
  "description": "Knowledge-Base & Document-First protocol with risk triage, Vision governance, signal distillation and optional devPNT integration.",
5
5
  "author": "Antonio Pinto (https://github.com/Antoneeo)"
6
6
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@antoneeo/kb-agentic-skill",
3
- "version": "1.35.1",
3
+ "version": "1.37.0",
4
4
  "description": "Knowledge-Base & Document-First protocol for Claude Code, Gemini CLI, Google Antigravity and Codex with risk triage, Vision governance, signal distillation and optional devPNT integration.",
5
5
  "keywords": [
6
6
  "claude-code",
package/scripts/init.js CHANGED
@@ -196,16 +196,16 @@ in the skill's \`routing.md\`: it decides which lens's method and validation rul
196
196
  that unit. L1 never reaches it. Never refer to a document whose meaning differs by lens
197
197
  ("threat model", "vision", \`principles.md\`, \`handoff.md\`) by its bare name.
198
198
 
199
- Select the owning lens by the unit's purpose, then apply only its risk scale.
200
- The project's always-on pointer stays intact: consult the selected skill rather than
201
- merging multiple mandatory ladders. All lenses already carry shared project memory
202
- (\`memory.md\`); another installation is not needed for cross-domain recall.
199
+ Select the owning lens by the unit's purpose, then apply only its risk scale.
200
+ The project's always-on pointer stays intact: consult the selected skill rather than
201
+ merging multiple mandatory ladders. All lenses already carry shared project memory
202
+ (\`memory.md\`); another installation is not needed for cross-domain recall.
203
203
  This file is NOT auto-loaded by any client: it is a note for you, deliberately additive.
204
- Delete this note once the routing pointer is integrated.
204
+ Delete this note once the routing pointer is integrated.
205
205
  `, 'multi-lens routing note');
206
206
  if (wrote && protocolPreexisting) {
207
207
  console.log(' ⚠️ A protocol pointer already existed and was NOT overwritten.');
208
- console.log(' Integrate the routing pointer from AGENTIC_MULTI_LENS.md; keep one risk scale per unit.');
208
+ console.log(' Integrate the routing pointer from AGENTIC_MULTI_LENS.md; keep one risk scale per unit.');
209
209
  }
210
210
  }
211
211
 
package/scripts/lib.js CHANGED
@@ -562,10 +562,23 @@ function wireGlobalOrientHook(options) {
562
562
  // already removed the hook, the line stays and the opt-out survives uninstall,
563
563
  // reinstall, and sibling-lens uninstalls.
564
564
  function removeGlobalOrientHooks(removedRoots) {
565
+ return removeGlobalHookEntries(removedRoots, {
566
+ event: 'SessionStart',
567
+ re: / orient(\s|$)/,
568
+ markerTargets: orientMarkerTargets,
569
+ markerRemove: orientMarkerRemove,
570
+ });
571
+ }
572
+
573
+ // The pruning loop shared by every hook this installer wires: only the
574
+ // `spec.event` entries whose command matches `spec.re` AND whose validator
575
+ // token resolves INTO a removed root are ours; the marker line is cleared only
576
+ // when an entry was actually removed. Returns the targets touched.
577
+ function removeGlobalHookEntries(removedRoots, spec) {
565
578
  const targets = [];
566
579
  const claude = CLIENTS.find((c) => c.key === 'claude');
567
580
  if (claude) targets.push(path.join(claude.home, 'settings.json'));
568
- for (const t of orientMarkerTargets()) {
581
+ for (const t of spec.markerTargets()) {
569
582
  if (!targets.some((x) => pathsEqual(x, t))) targets.push(t);
570
583
  }
571
584
  const removedFrom = [];
@@ -574,17 +587,17 @@ function removeGlobalOrientHooks(removedRoots) {
574
587
  const state = orientSettingsState(target);
575
588
  if (!state.ok || !fs.existsSync(target)) continue;
576
589
  const hooks = state.settings.hooks;
577
- if (!hooks || !Array.isArray(hooks.SessionStart)) continue;
590
+ if (!hooks || !Array.isArray(hooks[spec.event])) continue;
578
591
  let removedHere = false;
579
592
  const ours = (h) => {
580
593
  const cmd = h && typeof h.command === 'string' ? h.command : '';
581
- if (!(ORIENT_ENTRY_POINTS.some((n) => cmd.includes(n)) && / orient(\s|$)/.test(cmd))) return false;
594
+ if (!(ORIENT_ENTRY_POINTS.some((n) => cmd.includes(n)) && spec.re.test(cmd))) return false;
582
595
  const tok = orientHookValidator(cmd);
583
596
  if (tok === null || !path.isAbsolute(tok)) return false; // cannot attribute: keep
584
597
  return removedRoots.some((root) => pathInside(tok, root));
585
598
  };
586
599
  const kept = [];
587
- for (const group of hooks.SessionStart) {
600
+ for (const group of hooks[spec.event]) {
588
601
  if (!group || typeof group !== 'object') { kept.push(group); continue; }
589
602
  if (Array.isArray(group.hooks)) {
590
603
  const inner = group.hooks.filter((h) => {
@@ -601,19 +614,122 @@ function removeGlobalOrientHooks(removedRoots) {
601
614
  }
602
615
  }
603
616
  if (!removedHere) continue;
604
- state.settings.hooks.SessionStart = kept;
605
- if (!kept.length) delete state.settings.hooks.SessionStart;
617
+ state.settings.hooks[spec.event] = kept;
618
+ if (!kept.length) delete state.settings.hooks[spec.event];
606
619
  if (state.settings.hooks && !Object.keys(state.settings.hooks).length) {
607
620
  delete state.settings.hooks;
608
621
  }
609
622
  fs.writeFileSync(target, JSON.stringify(state.settings, null, 2) + String.fromCharCode(10), 'utf8');
610
- orientMarkerRemove(target);
623
+ spec.markerRemove(target);
611
624
  removedFrom.push(target);
612
625
  } catch (e) { /* fail-open per target: never abort an uninstall */ }
613
626
  }
614
627
  return removedFrom;
615
628
  }
616
629
 
630
+ // --- Per-turn reminder hook (F-046, wired by this lens since F-093) ----------
631
+ // `orient` fires once and decays; this hook re-arms the lens's constant line
632
+ // every prompt. F-046 wired it from the code lens's installer only, while this
633
+ // lens's ENFORCEMENT.md promised it: a single-lens install got no reminder.
634
+ // Presence is recognized family-wide (any lens's `remind` counts), like the
635
+ // orientation hook, so a multi-lens machine keeps exactly one line per turn
636
+ // (rulings.md r19/r32 price one line). Its own marker: removal is a standing
637
+ // opt-out for this hook only, shared by the family.
638
+ const REMIND_HOOK = {
639
+ event: 'UserPromptSubmit', sub: 'remind', re: / remind(\s|$)/,
640
+ marker: 'remind-hook-wired', timeout: 5,
641
+ };
642
+
643
+ function markerPathOf(spec) {
644
+ const root = process.env.AGENTIC_SDLC_KB_ROOT
645
+ || path.join(os.homedir(), '.agentic-sdlc');
646
+ return path.join(root, spec.marker);
647
+ }
648
+ function markerTargetsOf(spec) {
649
+ try {
650
+ return fs.readFileSync(markerPathOf(spec), 'utf8')
651
+ .split(/\r?\n/).map((x) => x.trim()).filter(Boolean);
652
+ } catch (e) {
653
+ return [];
654
+ }
655
+ }
656
+ function markerHasOf(spec, target) {
657
+ return markerTargetsOf(spec).some((t) => pathsEqual(t, target));
658
+ }
659
+ function markerAddOf(spec, target) {
660
+ try {
661
+ if (markerHasOf(spec, target)) return;
662
+ fs.mkdirSync(path.dirname(markerPathOf(spec)), { recursive: true });
663
+ fs.appendFileSync(markerPathOf(spec), target + String.fromCharCode(10), 'utf8');
664
+ } catch (e) { /* fail-open */ }
665
+ }
666
+ function markerRemoveOf(spec, target) {
667
+ try {
668
+ const rest = markerTargetsOf(spec).filter((t) => !pathsEqual(t, target));
669
+ if (rest.length) {
670
+ fs.writeFileSync(markerPathOf(spec), rest.join(String.fromCharCode(10)) + String.fromCharCode(10), 'utf8');
671
+ } else {
672
+ fs.rmSync(markerPathOf(spec), { force: true });
673
+ }
674
+ } catch (e) { /* fail-open */ }
675
+ }
676
+
677
+ function findCommandHook(settings, spec) {
678
+ const groups = settings && settings.hooks && settings.hooks[spec.event];
679
+ if (!Array.isArray(groups)) return null;
680
+ for (const group of groups) {
681
+ if (!group || typeof group !== 'object') continue;
682
+ const inner = Array.isArray(group.hooks) ? group.hooks : [group];
683
+ for (const h of inner) {
684
+ const cmd = h && typeof h.command === 'string' ? h.command : '';
685
+ if (ORIENT_ENTRY_POINTS.some((n) => cmd.includes(n)) && spec.re.test(cmd)) return cmd;
686
+ }
687
+ }
688
+ return null;
689
+ }
690
+
691
+ // Present is `already`; only ABSENCE plus the marker means the user removed it.
692
+ // Returns a code, never throws: an installer must not die on a settings file.
693
+ function wireGlobalRemindHook(options) {
694
+ const spec = REMIND_HOOK;
695
+ const validator = path.join(skillTarget(options.client), 'scripts', ORIENT_ENTRY_POINT);
696
+ if (!fs.existsSync(validator)) return { code: 'no-validator', validator };
697
+ if (!options.python) return { code: 'no-python' };
698
+ if (ORIENT_UNSAFE_IN_PATH.test(validator)) return { code: 'unsafe-path', validator };
699
+ const target = path.join(options.client.home, 'settings.json');
700
+ const state = orientSettingsState(target);
701
+ if (!state.ok) return { code: 'malformed', target, why: state.why };
702
+ const settings = state.settings;
703
+ // Unrecognised means write nothing (orientSettingsState checks SessionStart only).
704
+ if (settings.hooks && settings.hooks[spec.event] !== undefined && !Array.isArray(settings.hooks[spec.event])) {
705
+ return { code: 'malformed', target, why: 'unexpected-hooks' };
706
+ }
707
+ const present = findCommandHook(settings, spec);
708
+ if (present) return { code: 'already', target, command: present };
709
+ if (markerHasOf(spec, target)) return { code: 'opted-out', target };
710
+ const command = options.python + ' "' + validator + '" ' + spec.sub;
711
+ if (!settings.hooks) settings.hooks = {};
712
+ if (!Array.isArray(settings.hooks[spec.event])) settings.hooks[spec.event] = [];
713
+ settings.hooks[spec.event].push({ hooks: [{ type: 'command', command, timeout: spec.timeout }] });
714
+ try {
715
+ fs.mkdirSync(path.dirname(target), { recursive: true });
716
+ fs.writeFileSync(target, JSON.stringify(settings, null, 2) + String.fromCharCode(10), 'utf8');
717
+ } catch (e) {
718
+ return { code: 'write-failed', target, command, error: e.message };
719
+ }
720
+ markerAddOf(spec, target);
721
+ return { code: 'wired', target, command };
722
+ }
723
+
724
+ function removeGlobalRemindHooks(removedRoots) {
725
+ return removeGlobalHookEntries(removedRoots, {
726
+ event: REMIND_HOOK.event,
727
+ re: REMIND_HOOK.re,
728
+ markerTargets: () => markerTargetsOf(REMIND_HOOK),
729
+ markerRemove: (target) => markerRemoveOf(REMIND_HOOK, target),
730
+ });
731
+ }
732
+
617
733
  module.exports = {
618
734
  PACKAGE_ROOT,
619
735
  SKILL_SOURCE,
@@ -626,6 +742,8 @@ module.exports = {
626
742
  wireOrientHook,
627
743
  wireGlobalOrientHook,
628
744
  removeGlobalOrientHooks,
745
+ wireGlobalRemindHook,
746
+ removeGlobalRemindHooks,
629
747
  detectPython,
630
748
  pathsEqual,
631
749
  orientHookCommand,
@@ -3,7 +3,7 @@
3
3
  const fs = require('fs');
4
4
  const {
5
5
  SKILL_SOURCE, CLIENTS, clientDetected, skillTarget, copyRecursive,
6
- wireGlobalOrientHook, detectPython,
6
+ wireGlobalOrientHook, wireGlobalRemindHook, detectPython,
7
7
  } = require('./lib');
8
8
 
9
9
  function installSkill(client) {
@@ -61,6 +61,18 @@ for (const client of CLIENTS) {
61
61
  // already / opted-out / unverifiable / no-validator: silent — an
62
62
  // install must not nag (the opt-out is the user's standing choice).
63
63
  } catch (e) { /* never fail the install for a convenience */ }
64
+ // F-046/F-093: the per-turn reminder, wired alongside and never instead of
65
+ // the session hook (ENFORCEMENT.md promises it). One line per prompt for
66
+ // the whole family: a sibling lens's reminder already counts. Owner-accepted
67
+ // per-turn cost: rulings.md r19/r32. Removal is a standing opt-out.
68
+ try {
69
+ const rr = wireGlobalRemindHook({ client, python: detectPython() });
70
+ if (rr.code === 'wired') {
71
+ console.log('🔗 Per-turn protocol reminder wired for every project on this machine');
72
+ console.log(` (${rr.target}). One constant line per prompt; remove that hook`);
73
+ console.log(' entry to opt out — it will not be re-added.');
74
+ }
75
+ } catch (e) { /* never fail the install for a convenience */ }
64
76
  }
65
77
  }
66
78
  }
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
 
3
3
  const fs = require('fs');
4
- const { CLIENTS, skillTarget, removeGlobalOrientHooks } = require('./lib');
4
+ const { CLIENTS, skillTarget, removeGlobalOrientHooks, removeGlobalRemindHooks } = require('./lib');
5
5
 
6
6
  function removeSkill(client) {
7
7
  const target = skillTarget(client);
@@ -26,5 +26,11 @@ try {
26
26
  console.log(`🧹 Removed the session-orientation hook entry (${target}).`);
27
27
  }
28
28
  } catch (e) { /* never abort an uninstall for a convenience */ }
29
+ // F-093: the per-turn reminder this lens may have wired, same attribution rule.
30
+ try {
31
+ for (const target of removeGlobalRemindHooks(CLIENTS.map(skillTarget))) {
32
+ console.log(`🧹 Removed the per-turn reminder hook entry (${target}).`);
33
+ }
34
+ } catch (e) { /* never abort an uninstall for a convenience */ }
29
35
 
30
36
  CLIENTS.forEach(removeSkill);
@@ -108,7 +108,7 @@ Semantics: exit code 2 + message on stderr ⇒ the write is blocked and the mess
108
108
 
109
109
  `sdlc_check.py verdict --hook` refuses an Edit, Write, MultiEdit or NotebookEdit when the
110
110
  session transcript shows no guide-router verdict (a line that opens with `router: …` or with the level, `Level: L2 · router: …`, `Level: Spike · router: …`; or one that opens with a level-1 declaration)
111
- or a guide the verdict names was never read; it is silent in projects without guides and
111
+ or a guide the verdict names was not read WHOLE: the session's reads of it (Read spans, a literal `cat`/`Get-Content`, `get_file_content`) must cover its first to its last line; Grep, `head`, `sed` or a brief naming it read nothing (F-094); it is silent in projects without guides and
112
112
  whenever it cannot tell. The code package (`agentic-sdlc`) wires it machine-wide on
113
113
  Claude Code; this package does not. To wire it by hand, add a `PreToolUse` entry with
114
114
  matcher `Edit|Write|MultiEdit|NotebookEdit` and command
@@ -237,9 +237,11 @@ Cost: 531 characters, ~89 tokens per prompt, paid on every turn including
237
237
  trivial ones. That is admissible only because the owner accepted it explicitly
238
238
  (`ai_docs/vision/rulings.md` r19, the "no ceremony ratchet" Non-Goal's second door) --
239
239
  and the acceptance was for a FLAT cost. Hence the contract, guarded by
240
- `scripts/test_remind.py`: the line is **constant and reads nothing** (so nothing repo-
240
+ `scripts/test_remind.py`: the line is **constant per machine and reads nothing repo- or session-controlled** (so nothing repo-
241
241
  or session-controlled rides into the agent's context through it, and the cost cannot
242
- grow with the session), it is **one line under 600 characters** (r32 raised r19's 500 to carry the lens choice), and it **can never
242
+ grow with the session), it is **one line under 600 characters** (r32 raised r19's 500 to carry the lens choice; **700** when sibling lenses are installed,
243
+ because it then names each installed lens and its domain, read each turn from the skills
244
+ directories -- names only, matched against `routing.md`'s table, r44), and it **can never
243
245
  break a prompt** (argv ignored whole, always exit 0). A trivial turn pays a yes/no
244
246
  judgement, never a load.
245
247
 
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: kb-agentic
3
- version: 1.35.1
3
+ version: 1.37.0
4
4
  description: Knowledge-Base & Document-First protocol with risk-proportional triage, Vision as a guide, Signal Distillation, a complete Standalone mode and optional symbiosis with devPNT. Use for user documentation, knowledge extraction, SOPs, research notes, decision logs, knowledge management — and for answering project questions from the claim ledger and topic graph.
5
5
  author: Antonio Pinto (https://github.com/Antoneeo)
6
6
  copyright: (c) 2026 Antonio Pinto
@@ -147,7 +147,7 @@ Use this mode when `devpnt_*` tools are available and point at the current proje
147
147
 
148
148
  ### 4. Knowledge Processing & Distillation
149
149
  - **Isolate the work (Branch/worktree hygiene).** Distillation rewrites existing notes — full re-read per `## Revision` — and does it on a branch or a worktree, never directly on the shared corpus, so a half-finished reconciliation is never what the next reader finds. Where a project does not isolate (one shared checkout), that is a departure from this rule, not a second mode: Rule Zero's step save commit and its declared residual apply. A session that may run while another session uses the same checkout works in its **own git worktree**, and never switches branch, stashes, resets or runs `index` in a checkout another session may be using. Parallel work also shares ids: choose a new unit's id **after fetching**, as the first id free on every branch and tag the checkout can see (`check` names a collision while the unit is open).
150
- - Before drafting (L2/L3; L1 exempt), **consult the guide router** for a guide covering the task and read it first (the consult trigger, `guides.md` §0). A targeted description match, not a blanket read. Its result is the router verdict already declared with the triage level (Rule Zero).
150
+ - Before drafting (L2/L3; L1 exempt), **consult the guide router** for a guide covering the task and read the match WHOLE first — every line, no offset or limit, no excerpt; past the client's read cap, in chunks to the end — and apply it WHOLE: a rule that does not fit is proposed as an amendment to the guide, never skipped in silence, and the rest still binds. The match is targeted (which guide), never partial (which lines) (the consult trigger, `guides.md` §0), not a blanket read. Its result is the router verdict already declared with the triage level (Rule Zero).
151
151
  - Execute knowledge extraction using **Signal Distillation** (`distillation.md`).
152
152
  - **Opt-in subagent execution**: for an L3 with an approved analysis, the work MAY be executed via subagents per `dispatch.md`; default stays same-session. `dispatch.md` also carries the family-wide **delegation boundary** (what may be delegated at all, and what never may) — that section is not gated by the opt-in trigger and applies at any level, dispatch or no dispatch.
153
153
  - Handle conflicting or outdated information via **Reconciliation** (`reconciliation.md`). Mark obsolete files `status: SUPERSEDED`.
@@ -169,7 +169,7 @@ Use this mode when `devpnt_*` tools are available and point at the current proje
169
169
 
170
170
  ## Operative Guides & Router
171
171
  Guides are consulted, created, and distilled per `guides.md`.
172
- - **Consult (before acting)**: check `ai_docs/reference/INDEX.md` — the guide router — and declare the verdict with the triage level.
172
+ - **Consult (before acting)**: check `ai_docs/reference/INDEX.md` — the guide router — and declare the verdict with the triage level; a matched guide is read whole and applied whole (`guides.md` §0).
173
173
  - **Propose proactively**: when the user hands over indications that will govern future work, propose distilling them into a guide. A proposal, never a silent write, and never from model knowledge — a guide's whole value is that every claim traces to what the user actually provided.
174
174
  - Distill from user instructions into `ai_docs/reference/GUIDE_[topic].md`.
175
175
 
@@ -41,8 +41,8 @@ without an E-ISP.
41
41
  consult trigger (`guides.md` §0) applied at plan-authoring time: the orchestrator
42
42
  runs the router lookup (project router `ai_docs/reference/INDEX.md` + the agent-KB
43
43
  router) when populating `guides`. A dispatched context-free subagent does **NOT**
44
- run its own router consult — it reads the guide pointers handed to it in the
45
- brief. The router verdict (Rule Zero) is therefore declared ONCE, by the
44
+ run its own router consult — it reads each guide handed to it in the brief
45
+ whole, every line, and applies it whole (`guides.md` §0). The router verdict (Rule Zero) is therefore declared ONCE, by the
46
46
  orchestrator, when it authors the plan; a dispatched subagent does not declare
47
47
  one. (Proactive guide-creation stays at closure — the same broad final pass
48
48
  below — so it needs no separate dispatch hook.)
@@ -34,12 +34,28 @@ already cover how to do this well?*
34
34
  - **Scan the router, not the guides.** Read the when-to-consult descriptions in
35
35
  the guide router `ai_docs/reference/INDEX.md` **and** the agent-KB router
36
36
  `~/.agentic-sdlc/ai_docs/reference/INDEX.md` (if present). Match by topic.
37
- - **On a match, read that guide's synthesis whole** before acting (the snapshot
38
- stays on demand via the section markers). No match → proceed normally.
39
- - **Targeted match, never blanket.** Open only the guide whose description fits
40
- the task — never load every guide, which would reintroduce the exact token
41
- cost the "point to them" model exists to avoid. The two-level model (compact
42
- synthesis / verbatim snapshot) already bounds a single guide's cost.
37
+ - **On a match, read the WHOLE guide before acting — every line, first to
38
+ last.** No offset that skips its start, no limit that stops before its end, no
39
+ `head`/`sed`/grep excerpt, no "the section that looks relevant". Where the
40
+ client caps one read (Claude Code's Read stops at 2000 lines), continue in
41
+ consecutive chunks until the last line. Only the snapshot (the book) is read
42
+ on demand, through the section markers. No match → proceed normally.
43
+ - **Apply the WHOLE guide.** Every rule it states binds the work it matched, not
44
+ the subset you recognized. A rule you judge wrong, outdated or inapplicable is
45
+ never skipped in silence: name it, say why, and propose amending the guide
46
+ (§6); until the amendment is accepted, the guide as written governs, and any
47
+ deviation you take is declared to the user with its reason. Even then the
48
+ guide is considered whole: the other rules still bind. Why: an agent that
49
+ reads part of a guide applies part of it, and the omitted rule is exactly the
50
+ one the guide was written to carry (F-094 field scan: 157 partial reads of
51
+ guides against 118 whole ones; a release ran on 130 of the 225 lines of its
52
+ runbook).
53
+ - **Targeted match, never blanket.** "Targeted" chooses WHICH guide, never which
54
+ part of it: open only the guide whose description fits the task — never load
55
+ every guide, which would reintroduce the exact token cost the "point to them"
56
+ model exists to avoid. The two-level model (compact synthesis / verbatim
57
+ snapshot) already bounds a single guide's cost, so a whole read is affordable
58
+ by construction.
43
59
  - **Declare the router verdict.** The lookup result travels with the triage
44
60
  level (`SKILL.md` Rule Zero) as one line — `router: no match`, or
45
61
  `router: GUIDE_x.md → read`. This is what makes the consult reliable: an
@@ -66,7 +82,8 @@ already cover how to do this well?*
66
82
  unit of work.
67
83
  - **Under subagent dispatch** the consult happens at plan-authoring time (the
68
84
  orchestrator populates each task's `guides` field); a context-free subagent
69
- reads the pointers it was handed and does not run its own router lookup. See
85
+ reads each guide it was handed whole, as above, and does not run its own
86
+ router lookup. See
70
87
  `dispatch.md`.
71
88
 
72
89
  ## 1. When to trigger
@@ -232,8 +249,9 @@ the component from partial understanding.
232
249
  comprehension repertoire — how it works / control & data flow / invariants / where
233
250
  it breaks), each with a fidelity marker.
234
251
  **Write for the two-level read**: the guide (synthesis) is small enough to
235
- be read WHOLE before acting; the snapshot (book) is where size lives and
236
- where readers grep/partial-read on demand, following the section markers.
252
+ be read WHOLE before acting, and every reader reads it whole (§0); the
253
+ snapshot (book) is where size lives and the only place readers grep or
254
+ partial-read on demand, following the section markers.
237
255
  Use the repertoire's stable, self-describing headings, keep one concern per
238
256
  `##` section, and make the frontmatter `description` the "should I open
239
257
  this file at all" answer. This is why one synthesis + one book beats
@@ -287,6 +305,12 @@ state it explicitly when handing off a newly created guide.
287
305
 
288
306
  ## 6. Maintenance
289
307
 
308
+ - **A rule that does not fit the work is a proposed amendment, never a silent
309
+ skip** (§0). Read the whole guide, name the rule and the reason, and propose
310
+ the change through this pipeline — a `document` guide changes only with the
311
+ user's confirmation and a new snapshot of the source that changed; a `code`
312
+ guide is corrected against the code. Until the amendment lands, the guide as
313
+ written governs, and every other rule in it still binds.
290
314
  - **Source changed**: new snapshot, regenerate the guide from it (new
291
315
  `source_hash`); a guide REPLACING another is `status: SUPERSEDED` on the old
292
316
  one. `sdlc_check.py stale` (also under `--hybrid`) reports `[stale]` when a
@@ -44,7 +44,8 @@ sdlc_core.set_profile(
44
44
  remind_line=(
45
45
  "first decide if this skill governs the work; if yes, LOAD it once -- an "
46
46
  "unread protocol cannot be applied. Triage: L1 quick fact, L2 propagation, "
47
- "L3 new knowledge unit, Spike; declare the level. On this project's "
47
+ "L3 new knowledge unit, Spike; declare the level. A matched guide is read "
48
+ "whole and applied whole. On this project's "
48
49
  "domain, read topics/INDEX.md first and cite claim ids, or state no "
49
50
  "coverage. Decisions today get recorded in the KB at close. Revising a "
50
51
  "document? Re-read it whole and rewrite to current state -- never append "