@antoneeo/kb-agentic-skill 1.0.0 → 1.0.1

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
@@ -1,6 +1,44 @@
1
- # Changelog - Agentic SDLC Skill
1
+ # Changelog - KB Agentic Skill
2
2
 
3
- Tutte le modifiche significative a questa skill saranno documentate in questo file.
3
+ Every significant change to this skill is recorded here.
4
+
5
+ ## [1.0.1] - 2026-08-02
6
+
7
+ ### Fixed
8
+ - **The multi-lens routing note announced this skill as the code lens.** `init.js` wrote
9
+ the row for the CURRENT lens as a hardcoded literal copied from the code distribution,
10
+ so a project initialised with `kb-agentic-init` listed `agentic-sdlc` twice and never
11
+ named `kb-agentic`. Both the self row and the sibling table are now derived from the
12
+ shared `routing.md` lens table; the guarding test asserts this lens is named and is
13
+ mutation-tested against the original defect. Found by a cold-agent field test.
14
+ - `review.md` (shared spine): a review verdict travels as the reviewer's final output,
15
+ stated on both the requester's and the reviewer's side.
16
+
17
+ ## [1.0.0] - 2026-08-01
18
+
19
+ First release of the knowledge lens as its own package: the same spine as
20
+ `@antoneeo/agentic-sdlc-skill`, with fidelity to **the documents you supply**.
21
+
22
+ ### Added
23
+ - **Content-addressed corpus.** Every source enters verbatim under `corpus/given/`,
24
+ digest-verified; a new version is appended with `supersedes:`, never overwritten.
25
+ Non-text files carry a stored canonical extraction, and locators address those bytes.
26
+ - **Claim ledger.** `id | claim | valid | qty | about | source | prov | state`, where the
27
+ id hashes location and quantity — never the text, so an LLM rephrasing mints no new
28
+ identity. Locator spans are verified against the extraction; validity scopes are
29
+ half-open; mixed quantity kinds refuse to sum.
30
+ - **Topic graph** with five placement verdicts, polyhierarchy, tombstones with
31
+ `redirect_to:`, cycles refused at write time, unreachable nodes an error.
32
+ - **Detect-and-hold reconciliation.** A conflict marks the whole set `CONTESTED`,
33
+ symmetrically — flipping one cell by hand fails the check. Only new information
34
+ resolves it: a later source, or the owner's ruling with a `basis:`.
35
+ - `graph`, `corpus` and `claim-id` in the validator, alongside the shared spine.
36
+
37
+ ---
38
+
39
+ Everything below predates this package: it is the shared spine's history, kept
40
+ because the knowledge lens inherits it. Version numbers in that section are the
41
+ code lens's.
4
42
 
5
43
  ## [1.19.0] - 2026-07-28 (Design Review Gate)
6
44
  ### Added
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "kb-agentic-skill",
3
- "version": "1.0.0",
3
+ "version": "1.0.1",
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.0.0",
3
+ "version": "1.0.1",
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
@@ -3,14 +3,7 @@
3
3
  const fs = require('fs');
4
4
  const path = require('path');
5
5
  const { execSync } = require('child_process');
6
- const { SKILL_SOURCE, CLIENTS, clientDetected, skillTarget, loadTemplates, templateFor } = require('./lib');
7
-
8
- // Sibling lenses of the same family: one shared core, one `ai_docs/` tree, a different
9
- // fidelity discipline each. Keyed by the installed skill directory name.
10
- const SIBLING_LENSES = {
11
- 'agentic-sdlc': 'code',
12
- 'mkt-agentic-sdlc': 'marketing',
13
- };
6
+ const { SKILL_SOURCE, INSTALLED_SKILL_NAME, SELF_LENS, SIBLING_LENSES, CLIENTS, clientDetected, skillTarget, loadTemplates, templateFor } = require('./lib');
14
7
 
15
8
  const cwd = process.cwd();
16
9
 
@@ -161,7 +154,7 @@ if (siblings.size > 0) {
161
154
  This project has more than one lens of the Agentic SDLC family installed:
162
155
 
163
156
  ${list}
164
- - \`agentic-sdlc\` — the **code** lens
157
+ - \`${INSTALLED_SKILL_NAME}\` — the **${SELF_LENS}** lens
165
158
 
166
159
  One \`ai_docs/\` tree, one project default (\`default_domain:\` in \`ai_docs/README.md\`),
167
160
  one lens per unit of work. Before acting on any L2, L3 or Spike, run the domain router
@@ -189,7 +182,7 @@ Delete it once the merge is done.
189
182
  `, 'multi-lens routing note');
190
183
  if (wrote && protocolPreexisting) {
191
184
  console.log(' ⚠️ A protocol pointer already existed and was NOT overwritten.');
192
- console.log(' Merge the code-lens ladder from AGENTIC_MULTI_LENS.md into it by hand.');
185
+ console.log(` Merge the ${SELF_LENS}-lens ladder from AGENTIC_MULTI_LENS.md into it by hand.`);
193
186
  }
194
187
  }
195
188
 
package/scripts/lib.js CHANGED
@@ -1,152 +1,202 @@
1
- // Shared helpers for the KB Agentic npm scripts (init / postinstall / preuninstall).
2
- // Single source for client detection and skill-target paths.
3
-
4
- const fs = require('fs');
5
- const path = require('path');
6
- const os = require('os');
7
- const { execSync } = require('child_process');
8
-
9
- const PACKAGE_ROOT = path.resolve(__dirname, '..');
10
- const SKILL_SOURCE = path.join(PACKAGE_ROOT, 'skills', 'kb-agentic-skill');
11
- const TEMPLATES_PATH = path.join(SKILL_SOURCE, 'templates.md');
12
- // The directory name each client loads the skill from. Derived from the manifest,
13
- // never hard-coded by a consumer: three distributions share these scripts, and a
14
- // literal here is how a copy-fork starts installing under its sibling's name.
15
- const INSTALLED_SKILL_NAME = (() => {
16
- const m = fs.readFileSync(path.join(SKILL_SOURCE, 'SKILL.md'), 'utf8').match(/^name:\s*(\S+)/m);
17
- if (!m) throw new Error(`SKILL.md carries no 'name:' field: ${SKILL_SOURCE}`);
18
- return m[1];
19
- })();
20
-
21
- // One entry per supported AI client. `home` may be overridden by an env var
22
- // (Claude Desktop / portable installs); presence of the home dir counts as
23
- // detection even when the CLI is not on PATH.
24
-
25
- const CLIENTS = [
26
- {
27
- key: 'claude',
28
- label: 'Claude Code',
29
- cmd: 'claude',
30
- home: process.env.CLAUDE_CONFIG_DIR || path.join(os.homedir(), '.claude'),
31
- envVar: 'CLAUDE_CONFIG_DIR',
32
- reload: 'Restart Claude Code to load it. Invoke via Skill tool as "kb-agentic".',
33
- },
34
- {
35
- key: 'gemini',
36
- label: 'Gemini CLI',
37
- cmd: 'gemini',
38
- home: process.env.GEMINI_HOME || path.join(os.homedir(), '.gemini'),
39
- envVar: 'GEMINI_HOME',
40
- reload: 'Run "gemini skills reload" or restart Gemini CLI to load it.',
41
- },
42
- {
43
- key: 'codex',
44
- label: 'Codex AI',
45
- cmd: 'codex',
46
- home: process.env.CODEX_HOME || path.join(os.homedir(), '.codex'),
47
- envVar: 'CODEX_HOME',
48
- reload: 'Restart Codex to load it. Invoke it as "$kb-agentic" or by asking for KB Agentic.',
49
- },
50
- {
51
- key: 'antigravity',
52
- label: 'Google Antigravity',
53
- cmd: 'agy',
54
- home: process.env.ANTIGRAVITY_HOME || path.join(os.homedir(), '.gemini'),
55
- envVar: 'ANTIGRAVITY_HOME',
56
- skillsSubdir: 'config/skills',
57
- homeMarker: path.join(
58
- process.env.ANTIGRAVITY_HOME || path.join(os.homedir(), '.gemini'),
59
- 'config',
60
- 'skills',
61
- ),
62
- reload: 'Restart Antigravity, or run "agy skills reload", to load it. Invoke by asking for KB Agentic.',
63
- },
64
- ];
65
-
66
- function commandExists(cmd) {
67
- try {
68
- execSync(`${cmd} --version`, { stdio: 'ignore' });
69
- return true;
70
- } catch (e) {
71
- return false;
72
- }
73
- }
74
-
75
- function clientDetected(client) {
76
- const homePathToCheck = client.homeMarker || client.home;
77
- return commandExists(client.cmd)
78
- || Boolean(process.env[client.envVar])
79
- || fs.existsSync(homePathToCheck);
80
- }
81
-
82
- function skillTarget(client) {
83
- const subdir = client.skillsSubdir ? client.skillsSubdir.split('/') : ['skills'];
84
- return path.join(client.home, ...subdir, INSTALLED_SKILL_NAME);
85
- }
86
-
87
- function copyRecursive(src, dest) {
88
- if (typeof fs.cpSync === 'function') {
89
- fs.cpSync(src, dest, { recursive: true, force: true });
90
- return;
91
- }
92
- if (!fs.existsSync(dest)) fs.mkdirSync(dest, { recursive: true });
93
- for (const entry of fs.readdirSync(src, { withFileTypes: true })) {
94
- const s = path.join(src, entry.name);
95
- const d = path.join(dest, entry.name);
96
- if (entry.isDirectory()) copyRecursive(s, d);
97
- else fs.copyFileSync(s, d);
98
- }
99
- }
100
-
101
- function loadTemplates() {
102
- const text = fs.readFileSync(TEMPLATES_PATH, 'utf8');
103
- const lines = text.split(/\r?\n/);
104
- const sections = {};
105
- let heading = null;
106
- let block = null;
107
- for (const line of lines) {
108
- const h = line.match(/^##\s+(.*)$/);
109
- if (h && block === null) {
110
- heading = h[1].trim();
111
- sections[heading] = sections[heading] || [];
112
- continue;
113
- }
114
- if (/^```/.test(line)) {
115
- if (block === null) {
116
- block = [];
117
- } else {
118
- if (heading) sections[heading].push(block.join('\n') + '\n');
119
- block = null;
120
- }
121
- continue;
122
- }
123
- if (block !== null) block.push(line);
124
- }
125
- return sections;
126
- }
127
-
128
- function templateFor(sections, needle, index = 0) {
129
- const heading = Object.keys(sections).find((h) => h.includes(needle));
130
- const blocks = heading ? sections[heading] : undefined;
131
- if (!blocks || !blocks[index]) {
132
- throw new Error(
133
- `Template section containing "${needle}" (block ${index}) not found in ${TEMPLATES_PATH}. ` +
134
- 'The package is corrupted or templates.md was restructured: fix templates.md, do not improvise content.'
135
- );
136
- }
137
- return blocks[index];
138
- }
139
-
140
- module.exports = {
141
- PACKAGE_ROOT,
142
- SKILL_SOURCE,
143
- INSTALLED_SKILL_NAME,
144
- TEMPLATES_PATH,
145
- CLIENTS,
146
- commandExists,
147
- clientDetected,
148
- skillTarget,
149
- copyRecursive,
150
- loadTemplates,
151
- templateFor,
152
- };
1
+ // Shared helpers for the KB Agentic npm scripts (init / postinstall / preuninstall).
2
+ // Single source for client detection and skill-target paths.
3
+
4
+ const fs = require('fs');
5
+ const path = require('path');
6
+ const os = require('os');
7
+ const { execSync } = require('child_process');
8
+
9
+ const PACKAGE_ROOT = path.resolve(__dirname, '..');
10
+ const SKILL_SOURCE = path.join(PACKAGE_ROOT, 'skills', 'kb-agentic-skill');
11
+ const TEMPLATES_PATH = path.join(SKILL_SOURCE, 'templates.md');
12
+ // The directory name each client loads the skill from. Derived from the manifest,
13
+ // never hard-coded by a consumer: three distributions share these scripts, and a
14
+ // literal here is how a copy-fork starts installing under its sibling's name.
15
+ const INSTALLED_SKILL_NAME = (() => {
16
+ const m = fs.readFileSync(path.join(SKILL_SOURCE, 'SKILL.md'), 'utf8').match(/^name:\s*(\S+)/m);
17
+ if (!m) throw new Error(`SKILL.md carries no 'name:' field: ${SKILL_SOURCE}`);
18
+ return m[1];
19
+ })();
20
+
21
+ // The family's lens table, read from the shared `routing.md` rather than restated
22
+ // here. Same reason as INSTALLED_SKILL_NAME above, and the same failure it prevents:
23
+ // BOTH the row for this lens and the rows for its siblings used to be literals copied
24
+ // between distributions, so kb and mkt wrote a multi-lens note announcing themselves
25
+ // as the code lens. routing.md is one of the byte-identical shared files, so this
26
+ // lookup cannot drift between distributions.
27
+ // Lazy on purpose: preuninstall.js needs INSTALLED_SKILL_NAME and nothing else, and
28
+ // must keep working on an installation damaged badly enough to have lost routing.md.
29
+ function lensTable() {
30
+ const routing = path.join(SKILL_SOURCE, 'routing.md');
31
+ if (!fs.existsSync(routing)) throw new Error(`routing.md missing from the skill: ${SKILL_SOURCE}`);
32
+ // Parsed as a table, not matched with a regex: a mis-escaped pattern matches the
33
+ // empty string and yields undefined instead of throwing, which is how this lookup
34
+ // failed the first time it was written.
35
+ const table = new Map();
36
+ for (const line of fs.readFileSync(routing, 'utf8').split(/\r?\n/)) {
37
+ const cells = line.split('|').map((cell) => cell.trim());
38
+ if (cells.length < 4) continue;
39
+ const [, lens, skill] = cells;
40
+ if (!/^[a-z]+$/.test(lens) || !/^`[a-z0-9-]+`$/.test(skill)) continue;
41
+ const name = skill.slice(1, -1);
42
+ // A duplicate row would otherwise be won silently by whichever came first, and a
43
+ // wrong routing.md propagates byte-identically to every distribution.
44
+ if (table.has(name)) throw new Error(`routing.md lists '${name}' more than once`);
45
+ table.set(name, lens);
46
+ }
47
+ if (!table.size) throw new Error(`routing.md carries no lens table: ${routing}`);
48
+ return table;
49
+ }
50
+
51
+ function selfLens() {
52
+ const lens = lensTable().get(INSTALLED_SKILL_NAME);
53
+ if (!lens) throw new Error(`routing.md has no lens row for '${INSTALLED_SKILL_NAME}'`);
54
+ return lens;
55
+ }
56
+
57
+ // Sibling lenses of the same family: one shared core, one docs tree, a different
58
+ // fidelity discipline each. Keyed by the installed skill directory name.
59
+ function siblingLenses() {
60
+ const table = lensTable();
61
+ selfLens(); // this lens must be in the table too
62
+ table.delete(INSTALLED_SKILL_NAME);
63
+ return Object.fromEntries(table);
64
+ }
65
+
66
+ // One entry per supported AI client. `home` may be overridden by an env var
67
+ // (Claude Desktop / portable installs); presence of the home dir counts as
68
+ // detection even when the CLI is not on PATH.
69
+
70
+ const CLIENTS = [
71
+ {
72
+ key: 'claude',
73
+ label: 'Claude Code',
74
+ cmd: 'claude',
75
+ home: process.env.CLAUDE_CONFIG_DIR || path.join(os.homedir(), '.claude'),
76
+ envVar: 'CLAUDE_CONFIG_DIR',
77
+ reload: 'Restart Claude Code to load it. Invoke via Skill tool as "kb-agentic".',
78
+ },
79
+ {
80
+ key: 'gemini',
81
+ label: 'Gemini CLI',
82
+ cmd: 'gemini',
83
+ home: process.env.GEMINI_HOME || path.join(os.homedir(), '.gemini'),
84
+ envVar: 'GEMINI_HOME',
85
+ reload: 'Run "gemini skills reload" or restart Gemini CLI to load it.',
86
+ },
87
+ {
88
+ key: 'codex',
89
+ label: 'Codex AI',
90
+ cmd: 'codex',
91
+ home: process.env.CODEX_HOME || path.join(os.homedir(), '.codex'),
92
+ envVar: 'CODEX_HOME',
93
+ reload: 'Restart Codex to load it. Invoke it as "$kb-agentic" or by asking for KB Agentic.',
94
+ },
95
+ {
96
+ key: 'antigravity',
97
+ label: 'Google Antigravity',
98
+ cmd: 'agy',
99
+ home: process.env.ANTIGRAVITY_HOME || path.join(os.homedir(), '.gemini'),
100
+ envVar: 'ANTIGRAVITY_HOME',
101
+ skillsSubdir: 'config/skills',
102
+ homeMarker: path.join(
103
+ process.env.ANTIGRAVITY_HOME || path.join(os.homedir(), '.gemini'),
104
+ 'config',
105
+ 'skills',
106
+ ),
107
+ reload: 'Restart Antigravity, or run "agy skills reload", to load it. Invoke by asking for KB Agentic.',
108
+ },
109
+ ];
110
+
111
+ function commandExists(cmd) {
112
+ try {
113
+ execSync(`${cmd} --version`, { stdio: 'ignore' });
114
+ return true;
115
+ } catch (e) {
116
+ return false;
117
+ }
118
+ }
119
+
120
+ function clientDetected(client) {
121
+ const homePathToCheck = client.homeMarker || client.home;
122
+ return commandExists(client.cmd)
123
+ || Boolean(process.env[client.envVar])
124
+ || fs.existsSync(homePathToCheck);
125
+ }
126
+
127
+ function skillTarget(client) {
128
+ const subdir = client.skillsSubdir ? client.skillsSubdir.split('/') : ['skills'];
129
+ return path.join(client.home, ...subdir, INSTALLED_SKILL_NAME);
130
+ }
131
+
132
+ function copyRecursive(src, dest) {
133
+ if (typeof fs.cpSync === 'function') {
134
+ fs.cpSync(src, dest, { recursive: true, force: true });
135
+ return;
136
+ }
137
+ if (!fs.existsSync(dest)) fs.mkdirSync(dest, { recursive: true });
138
+ for (const entry of fs.readdirSync(src, { withFileTypes: true })) {
139
+ const s = path.join(src, entry.name);
140
+ const d = path.join(dest, entry.name);
141
+ if (entry.isDirectory()) copyRecursive(s, d);
142
+ else fs.copyFileSync(s, d);
143
+ }
144
+ }
145
+
146
+ function loadTemplates() {
147
+ const text = fs.readFileSync(TEMPLATES_PATH, 'utf8');
148
+ const lines = text.split(/\r?\n/);
149
+ const sections = {};
150
+ let heading = null;
151
+ let block = null;
152
+ for (const line of lines) {
153
+ const h = line.match(/^##\s+(.*)$/);
154
+ if (h && block === null) {
155
+ heading = h[1].trim();
156
+ sections[heading] = sections[heading] || [];
157
+ continue;
158
+ }
159
+ if (/^```/.test(line)) {
160
+ if (block === null) {
161
+ block = [];
162
+ } else {
163
+ if (heading) sections[heading].push(block.join('\n') + '\n');
164
+ block = null;
165
+ }
166
+ continue;
167
+ }
168
+ if (block !== null) block.push(line);
169
+ }
170
+ return sections;
171
+ }
172
+
173
+ function templateFor(sections, needle, index = 0) {
174
+ const heading = Object.keys(sections).find((h) => h.includes(needle));
175
+ const blocks = heading ? sections[heading] : undefined;
176
+ if (!blocks || !blocks[index]) {
177
+ throw new Error(
178
+ `Template section containing "${needle}" (block ${index}) not found in ${TEMPLATES_PATH}. ` +
179
+ 'The package is corrupted or templates.md was restructured: fix templates.md, do not improvise content.'
180
+ );
181
+ }
182
+ return blocks[index];
183
+ }
184
+
185
+ module.exports = {
186
+ PACKAGE_ROOT,
187
+ SKILL_SOURCE,
188
+ INSTALLED_SKILL_NAME,
189
+ TEMPLATES_PATH,
190
+ CLIENTS,
191
+ commandExists,
192
+ clientDetected,
193
+ skillTarget,
194
+ copyRecursive,
195
+ loadTemplates,
196
+ templateFor,
197
+ };
198
+
199
+ // Lazy: reading routing.md is deferred to the consumer that actually asks.
200
+ Object.defineProperty(module.exports, 'SELF_LENS', { enumerable: true, get: selfLens });
201
+ Object.defineProperty(module.exports, 'SIBLING_LENSES', { enumerable: true, get: siblingLenses });
202
+
@@ -85,6 +85,14 @@ When you hand work to a reviewer (human or agent), give them:
85
85
  should have been. The design reviewer checks that every threat surface the change
86
86
  touches has a matching security requirement.
87
87
 
88
+ **The verdict travels back as the reviewer's own final output** — the text it
89
+ returns when it finishes, nothing else. A reviewer that tries to message the
90
+ requester mid-run depends on a delivery channel it cannot verify (a subagent
91
+ addressed by agent TYPE rather than by session gets no such channel, and the
92
+ attempt fails silently); a requester that waits for such a message stalls
93
+ holding a verdict that already exists. State the return form when you request
94
+ the review, and read the verdict where it actually arrives.
95
+
88
96
  Never ask a reviewer to "review my session" or "review what I just did"
89
97
  without the artifacts above — that forces them to reconstruct scope from
90
98
  conversation instead of reviewing the change itself. Say which finding
@@ -109,6 +117,10 @@ When you are the reviewer:
109
117
 
110
118
  - Verify claims against the real source, not against the diff's own
111
119
  description of itself.
120
+ - **Your verdict is your final output.** Deliver findings and verdict as the text
121
+ you return when you finish — never only through a message to the requester, a
122
+ channel you cannot verify and which fails silently when it is not there
123
+ (see `## Requesting`).
112
124
  - Cite evidence as `file:line` for every finding — a finding without a
113
125
  location is not actionable.
114
126
  - Keep severity honest: do not inflate a style preference to a blocker, and