toga-ai 1.0.573 → 1.0.574

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/CLAUDE.md CHANGED
@@ -42,10 +42,12 @@ bloating and tripping compaction mid-session — the exact problem this design s
42
42
  Treat your own context as a scarce budget; spend it on decisions, not on raw file
43
43
  contents.
44
44
 
45
- - **`/kickoff` delegates all knowledge-doc reading** to the `context-primer` subagent
46
- (Step 4). It reads the architecture, feature, standard, and client docs and returns a
47
- small distilled briefing plus a **"Doc map"** for just-in-time deep dives later. The
48
- main thread keeps roughly ~2k tokens of primed context instead of ~8k of raw docs.
45
+ - **`/kickoff` primes the knowledge base in the MAIN session** (Step 4) — the developer
46
+ reads the resolved architecture, feature, standard, and client docs directly, in this
47
+ thread, **synchronously**. Priming is **not** delegated to a subagent, and **no subagent
48
+ starts until priming is complete** (enforced by the `kickoff-gate` hook; released only by
49
+ `knowledge.js kickoff-primed`). This is a deliberate exception to the delegate-heavy-reading
50
+ principle: the team requires the primed knowledge to live in the developer's own context.
49
51
  - **`/capture` delegates the whole search/classify/draft/write/publish pipeline** to the
50
52
  `session-capture` subagent. The main thread only distills a compact **"changeset
51
53
  digest"** — the one thing a subagent cannot see, the live conversation — and handles
@@ -62,7 +64,7 @@ contents.
62
64
 
63
65
  These install into a project's `.claude/agents/toga/` via `npx toga-ai`:
64
66
 
65
- - **context-primer** — kickoff doc distiller; reads knowledge docs, returns briefing + Doc map.
67
+ - **context-primer** — DEPRECATED (2026-08-13); kickoff now primes in the main session, not via this agent.
66
68
  - **session-capture** — capture write pipeline; search → classify → draft → write → publish.
67
69
  - **planner** — TOGA-aware phased planning (via `ecc:planner`).
68
70
  - **php-reviewer** — reviews PHP changes for framework standards and correctness.
@@ -1,12 +1,18 @@
1
1
  ---
2
2
  name: context-primer
3
- description: TOGA kickoff context loader — reads the full knowledge docs resolved by kickoff-preflight (architecture, features, standards, client docs) in its OWN context and returns a compact, distilled session primer plus a doc-map for just-in-time deep dives. Keeps the main conversation thread lean so it never trips compaction. Spawned by the /kickoff skill at Step 4, after preflight has run.
3
+ description: DEPRECATED (2026-08-13) — no longer used by /kickoff. Team policy now requires kickoff priming to happen IN THE MAIN SESSION (the developer reads the resolved knowledge docs directly, synchronously, and no subagent runs until priming is complete). This agent formerly did that reading in its own context; it is kept only for reference and must not be spawned during kickoff (the kickoff-gate hook blocks it). Do not use.
4
4
  model: sonnet
5
5
  tools: Read, Bash, Grep, Glob
6
6
  ---
7
7
 
8
8
  # TOGA Context Primer
9
9
 
10
+ > **⚠ DEPRECATED — 2026-08-13.** Kickoff no longer delegates knowledge-base reading to a
11
+ > subagent. Team policy is that priming runs **in the main session**, synchronously, with **no
12
+ > subagent** starting until priming is complete (see `skills/kickoff/SKILL.md` Step 4 and the
13
+ > `session-priming` standard). The `kickoff-gate` hook now **blocks** spawning this agent during
14
+ > a kickoff. This file is retained for history only; the workflow below is no longer invoked.
15
+
10
16
  Your job is to do the **heavy reading** of the team knowledge base so the main
11
17
  conversation does not have to. You read the full docs in *your* context window and
12
18
  return a small, high-signal briefing. The main thread keeps only your briefing — not
@@ -0,0 +1,75 @@
1
+ ---
2
+ title: Session priming — prime the team KB in the main session, never a subagent
3
+ framework: "standalone"
4
+ repo: claude
5
+ project: Claude Harness
6
+ client: shared
7
+ type: standard
8
+ status: active
9
+ updated: 2026-08-13
10
+ owners: ["jcardinal"]
11
+ files:
12
+ - skills/kickoff/SKILL.md
13
+ - scripts/hooks/kickoff-gate.js
14
+ - knowledge.js
15
+ related:
16
+ - standalone/apps/claude/workflows/mcp-tool-usage.md
17
+ ---
18
+
19
+ # Session priming — prime the team KB in the main session, never a subagent
20
+
21
+ When `/kickoff` runs, priming the team knowledge base — reading the resolved architecture,
22
+ feature, standard, and client docs — **must happen in the main session.** Claude reads those
23
+ docs **itself, directly, in the main conversation.** It must **not** hand the reading to a
24
+ subagent, and **no other subagent may start** until priming is finished.
25
+
26
+ This is a team directive. It applies to every session, both frameworks, every repo and client.
27
+
28
+ ## The rules
29
+
30
+ 1. **Priming runs in the main session.** After the interview and `kickoff-preflight`, read the
31
+ resolved `reads[]` docs yourself, in this thread. Do not spawn a subagent (the old
32
+ `context-primer`, now **deprecated**) to read them for you.
33
+ 2. **Priming is first, and synchronous.** It happens before any other research — before you
34
+ read a single repo file, grep the source, edit, or write. Read the docs one after another;
35
+ do not race other work alongside them.
36
+ 3. **No parallel subagents until priming is complete.** No `Agent`/`Task` of any kind may begin
37
+ until priming is done. This is the hard rule the developer asked for: nothing fans out early.
38
+ 4. **Signal completion explicitly.** When you have read **every** resolved doc, run
39
+ `node "<TEAM_REPO>/knowledge.js" kickoff-primed`. Only then may you read repo code, edit,
40
+ write, or spawn agents.
41
+ 5. **Ordering is unchanged.** The team KB stays the **first** source, ahead of all other
42
+ research — that part was already correct and stays.
43
+
44
+ ## How it is enforced
45
+
46
+ The `kickoff-gate` hook (`scripts/hooks/kickoff-gate.js`) enforces this mechanically in two
47
+ stages. Stage 2 ("primer"), entered after `kickoff-preflight`:
48
+
49
+ - **allows** reading/searching docs under `knowledge/`, repo-path memory reads, and the
50
+ `knowledge.js` priming commands;
51
+ - **blocks** repo-code `Read`/`Grep`/`Glob`, `Edit`, `Write`, and **every** `Agent`/`Task`
52
+ spawn (including the deprecated `context-primer`);
53
+ - **releases only** on the `node knowledge.js kickoff-primed` sentinel.
54
+
55
+ Emergency override: `KICKOFF_GATE_DISABLED=1`.
56
+
57
+ ## Why
58
+
59
+ Two reasons. First, the team wants the primed knowledge to live in the **developer's own
60
+ context**, not summarized-and-lost inside a subagent that returns only a digest — the raw
61
+ docs stay available in-session for the whole task. Second, letting subagents fan out before
62
+ priming is complete lets work start against un-primed context, which is exactly the mistake
63
+ kickoff exists to prevent. Reading in the main session, synchronously, with no early
64
+ subagents, removes both failure modes.
65
+
66
+ Trade-off, accepted knowingly: reading every doc inline uses more of the main thread's context
67
+ than the old subagent approach did. Mitigate by not re-reading absorbed docs and by reading
68
+ only the needed section of a large spec — but priming in the main session is the requirement.
69
+
70
+ ## Change history
71
+ - 2026-08-13 — Standard recorded. Kickoff priming must run in the main session, synchronously,
72
+ and no subagent may start until priming is complete; released by the new
73
+ `knowledge.js kickoff-primed` sentinel. Retired the `context-primer` subagent from the
74
+ kickoff flow; rewired `kickoff-gate.js` Stage 2 accordingly; updated `skills/kickoff/SKILL.md`
75
+ Step 4 and the ticket skills. (jcardinal)
package/knowledge.js CHANGED
@@ -978,6 +978,22 @@ function cmdSkills(args) {
978
978
  /* dispatch */
979
979
  /* ------------------------------------------------------------------ */
980
980
 
981
+ /*
982
+ * kickoff-primed — the explicit "team-KB priming is COMPLETE" sentinel.
983
+ *
984
+ * During /kickoff, the developer primes the team knowledge base by reading the resolved
985
+ * docs DIRECTLY IN THE MAIN SESSION (never via a subagent). The kickoff-gate hook holds
986
+ * the session in its "primer" stage — blocking all repo research, edits, and every
987
+ * subagent spawn — until this command runs. The model runs it only after it has read
988
+ * every resolved knowledge doc in the main session; the gate detects it and releases.
989
+ *
990
+ * This command intentionally does nothing but confirm — the gate keys off the command
991
+ * itself, so no shared state is needed here.
992
+ */
993
+ function cmdKickoffPrimed() {
994
+ console.log('Team knowledge base primed in the main session — kickoff gate released. Priming was synchronous; no subagents ran during it.');
995
+ }
996
+
981
997
  function main() {
982
998
  const [, , cmd, ...rest] = process.argv;
983
999
  const args = parseArgs(rest);
@@ -989,6 +1005,7 @@ function main() {
989
1005
  case 'validate': return cmdValidate();
990
1006
  case 'manifest': return cmdManifest();
991
1007
  case 'kickoff-preflight': return cmdPreflight(args);
1008
+ case 'kickoff-primed': return cmdKickoffPrimed();
992
1009
  case 'publish': return cmdPublish(args);
993
1010
  case 'session-save': return cmdSessionSave(args);
994
1011
  case 'session-list': return cmdSessionList(args);
@@ -996,7 +1013,7 @@ function main() {
996
1013
  case 'session-delete': return cmdSessionDelete(args);
997
1014
  case 'skills': return cmdSkills(args);
998
1015
  default:
999
- console.log('Usage: node knowledge.js <search|index|deps|validate|manifest|kickoff-preflight|publish|session-save|session-list|session-show|session-delete|skills> [--flags]');
1016
+ console.log('Usage: node knowledge.js <search|index|deps|validate|manifest|kickoff-preflight|kickoff-primed|publish|session-save|session-list|session-show|session-delete|skills> [--flags]');
1000
1017
  process.exitCode = 1;
1001
1018
  }
1002
1019
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "toga-ai",
3
- "version": "1.0.573",
3
+ "version": "1.0.574",
4
4
  "description": "TOGA Technology Team Claude Knowledge System — shared AI coding harness with skills, knowledge base CLI, and project installer for Claude Code.",
5
5
  "keywords": [
6
6
  "claude",
@@ -13,8 +13,8 @@
13
13
  * primed, treating the knowledge base as a side-channel instead of the first source.
14
14
  *
15
15
  * The team knowledge base is the whole point of kickoff — it is the distilled, shared
16
- * gold the team maintains, and it must be primed FIRST, via the `context-primer`
17
- * subagent, before ANY other research. This hook now enforces that in TWO stages:
16
+ * gold the team maintains, and it must be primed FIRST, IN THE MAIN SESSION (never via a
17
+ * subagent), before ANY other research. This hook enforces that in TWO stages:
18
18
  *
19
19
  * Stage 1 ARMED (set by /kickoff) — allow ONLY the read-only priming steps
20
20
  * (version check, team-repo probe, manifest, interview) and
@@ -23,16 +23,23 @@
23
23
  * releases it.
24
24
  *
25
25
  * Stage 2 PRIMER (set by preflight) — the load-set is known but the team KB is not
26
- * yet primed. Block all repo research (Read/Grep/Glob of code, Edit,
27
- * Write, and every non-primer agent) until the `context-primer`
28
- * subagent is spawned IN THE FOREGROUND (run_in_background: false),
29
- * so the model actually waits for the briefing. Spawning it releases
30
- * the gate. Reading repo-path MEMORY files and asking the developer
31
- * remain allowed (they are part of priming).
26
+ * yet primed. The developer must read the resolved knowledge docs
27
+ * DIRECTLY IN THE MAIN SESSION. In this stage:
28
+ * • team-KB reads/searches (paths under `knowledge/`) and the
29
+ * knowledge.js priming commands are ALLOWED — this IS the priming;
30
+ * • repo code (Read/Grep/Glob), Edit, Write are BLOCKED;
31
+ * • EVERY subagent spawn (Agent/Task) is BLOCKED — no parallel agent
32
+ * may begin until priming is complete. This is the hard guarantee.
33
+ * The gate releases ONLY when the main session runs the explicit
34
+ * completion sentinel `node knowledge.js kickoff-primed`, which the
35
+ * model runs after it has read every resolved doc in the main session.
36
+ * Reading repo-path MEMORY files and asking the developer remain
37
+ * allowed (they are part of priming).
32
38
  *
33
39
  * Net effect: after the interview, the model literally cannot read a single repo file,
34
- * grep the code, or spawn any other agent until it has primed from the team KB via the
35
- * context-primer subagent. KB-first, via subagent, without exception.
40
+ * grep the code, edit anything, or spawn ANY subagent until it has primed the team KB
41
+ * itself, in the main session, and signalled completion. KB-first, main-session,
42
+ * synchronous, no subagents until done — without exception.
36
43
  *
37
44
  * Registered for UserPromptSubmit (arm) + PreToolUse (enforce). A defensive
38
45
  * PostToolUse branch is a no-op — release is spawn-time in PreToolUse, so the gate can
@@ -116,9 +123,27 @@ function isMemoryReadPath(p) {
116
123
  return /\.claude\/projects\/.+\/memory\//i.test(norm);
117
124
  }
118
125
 
119
- /* The subagent that primes the team knowledge base. It — and only it — may run in the
120
- * primer stage. */
121
- const PRIMER_SUBAGENT = 'context-primer';
126
+ /* The explicit "team-KB priming is COMPLETE" sentinel. Running `knowledge.js kickoff-primed`
127
+ * in the main session is the ONLY thing that releases the primer stage — the model runs it
128
+ * after reading every resolved knowledge doc itself, in the main session. */
129
+ function isPrimedSentinelBash(command) {
130
+ return typeof command === 'string' && /knowledge\.js["']?\s+kickoff-primed/i.test(command);
131
+ }
132
+
133
+ /* A path that lives inside the team knowledge base (`knowledge/…*.md`). Reading one is the
134
+ * priming act — allowed in the primer stage. Repo code paths do not match. */
135
+ function isTeamKbPath(p) {
136
+ if (typeof p !== 'string' || !p) return false;
137
+ const norm = p.replace(/\\/g, '/');
138
+ return /(^|\/)knowledge\/.+\.md$/i.test(norm);
139
+ }
140
+
141
+ /* A Grep/Glob whose search root is inside the team knowledge base — the on-demand way to
142
+ * locate a doc while priming. Anything without a `knowledge/` root is repo research. */
143
+ function isTeamKbSearch(toolInput) {
144
+ const p = (toolInput && (toolInput.path || toolInput.glob)) || '';
145
+ return typeof p === 'string' && /(^|[\/\\])knowledge([\/\\]|$)/i.test(p);
146
+ }
122
147
 
123
148
  /* Tools that constitute touching the task — blocked while the gate is armed. Both the
124
149
  * classic `Task` tool and this harness's `Agent` tool are included. */
@@ -152,28 +177,21 @@ function primerMessage() {
152
177
  '🛑 KICKOFF GATE (stage 2 of 2) — the TEAM KNOWLEDGE BASE has not been primed yet.',
153
178
  '',
154
179
  'kickoff-preflight resolved the load-set, but the team KB is the FIRST source you must',
155
- 'prime from — before ANY other research. Do NOT read repo code, grep/glob the source,',
156
- 'edit, or spawn any other agent yet — not even files named in the /kickoff sentence.',
180
+ 'prime from — before ANY other research. Prime it YOURSELF, IN THE MAIN SESSION — do',
181
+ 'NOT spawn a subagent to do it. No subagent (Agent/Task) may run until priming is done.',
157
182
  '',
158
- 'Do this now (Step 4): spawn the context-primer subagent to read the resolved knowledge',
159
- 'docs and return the briefing —',
160
- ' Agent tool · subagent_type: "context-primer" · run_in_background: false',
161
- ' pass it: TEAM_REPO, the full kickoff-preflight JSON, and the task description.',
162
- 'Wait for its briefing. THEN read repo code and start the work.',
183
+ 'Do this now (Step 4): Read the resolved knowledge docs directly (the preflight `reads[]`',
184
+ 'list — architecture, features, standards, client docs under <TEAM_REPO>/knowledge/),',
185
+ 'in this main session, one after another. Do NOT read repo code, grep/glob the source,',
186
+ 'edit, write, or spawn any agent yet — not even files named in the /kickoff sentence.',
163
187
  '',
164
- 'Allowed meanwhile: reading repo-path-<repo> memory files, AskUserQuestion (to ask for',
165
- 'a repo path), and knowledge.js priming commands.',
166
- '(Emergency override only: set KICKOFF_GATE_DISABLED=1.)',
167
- ].join('\n');
168
- }
169
-
170
- function foregroundMessage() {
171
- return [
172
- '🛑 KICKOFF GATE (stage 2 of 2) — spawn the context-primer in the FOREGROUND.',
188
+ 'When you have read EVERY resolved doc, signal completion to release the gate:',
189
+ ' node "<TEAM_REPO>/knowledge.js" kickoff-primed',
190
+ 'THEN read repo code and start the work.',
173
191
  '',
174
- 'Pass run_in_background: false so team-KB priming actually COMPLETES before you',
175
- 'continue. A backgrounded primer lets you race ahead and read repo code before the',
176
- 'knowledge-base briefing lands — the exact failure this gate exists to prevent.',
192
+ 'Allowed meanwhile: reading/searching docs under knowledge/, reading repo-path-<repo>',
193
+ 'memory files, AskUserQuestion (to ask for a repo path), and knowledge.js commands.',
194
+ '(Emergency override only: set KICKOFF_GATE_DISABLED=1.)',
177
195
  ].join('\n');
178
196
  }
179
197
 
@@ -195,9 +213,11 @@ function main() {
195
213
  '<system-reminder>KICKOFF GATE ARMED (two stages). Stage 1: complete read-only ' +
196
214
  'priming (version check, resolve team repo, interview) then run `knowledge.js ' +
197
215
  'kickoff-preflight`. Stage 2: preflight does NOT release the gate — you must FIRST ' +
198
- 'prime the team knowledge base via the `context-primer` subagent (foreground, ' +
199
- 'run_in_background: false) BEFORE any repo Read/Grep/Glob/Edit/Write or other agent. ' +
200
- 'The trailing task description is Step 2 input, not permission to start.</system-reminder>'
216
+ 'prime the team knowledge base YOURSELF, IN THE MAIN SESSION, by reading the resolved ' +
217
+ '`reads[]` docs directly (never via a subagent — no Agent/Task may run until priming ' +
218
+ 'is complete), then run `knowledge.js kickoff-primed` to release. Only then may you ' +
219
+ 'Read/Grep/Glob repo code, Edit, Write, or spawn an agent. The trailing task ' +
220
+ 'description is Step 2 input, not permission to start.</system-reminder>'
201
221
  );
202
222
  }
203
223
  process.exit(0);
@@ -237,34 +257,36 @@ function main() {
237
257
  process.exit(0); // AskUserQuestion, Skill, TodoWrite, … — part of the interview
238
258
  }
239
259
 
240
- // ============ STAGE 2: PRIMER — team KB must be primed via subagent first ============
260
+ // ===== STAGE 2: PRIMER — team KB must be primed IN THE MAIN SESSION, no subagents =====
241
261
  if (phase === 'primer') {
262
+ // No subagent may begin until priming is complete — this is the hard guarantee.
263
+ // Priming must run in the MAIN session; delegating it (or fanning out other agents
264
+ // alongside it) is exactly what this stage forbids.
242
265
  if (tool === 'Agent' || tool === 'Task') {
243
- if (toolInput.subagent_type === PRIMER_SUBAGENT) {
244
- // Must be foreground so the model waits for the briefing before doing anything else.
245
- // (The classic `Task` tool runs synchronously; only the async `Agent` tool needs the
246
- // explicit run_in_background: false.)
247
- if (tool === 'Agent' && toolInput.run_in_background !== false) {
248
- console.log(foregroundMessage());
249
- process.exit(2);
250
- }
251
- clearLock(); // team-KB priming is underway in the foreground — release the gate
252
- process.exit(0);
253
- }
254
- console.log(primerMessage()); // any other agent must wait until the KB is primed
255
- process.exit(2);
256
- }
257
- if (tool === 'Read') {
258
- if (isMemoryReadPath(toolInput.file_path || toolInput.path)) process.exit(0); // repo-path lookup
259
266
  console.log(primerMessage());
260
267
  process.exit(2);
261
268
  }
262
269
  if (tool === 'Bash') {
263
- if (isPrimingBash(command)) process.exit(0);
270
+ // The explicit completion sentinel is the ONLY release — the model runs it after it
271
+ // has read every resolved doc itself, in the main session.
272
+ if (isPrimedSentinelBash(command)) { clearLock(); process.exit(0); }
273
+ if (isPrimingBash(command)) process.exit(0); // knowledge.js search/get, version check, …
264
274
  console.log(primerMessage());
265
275
  process.exit(2);
266
276
  }
267
- if (BLOCKED_TOOLS.has(tool)) { console.log(primerMessage()); process.exit(2); } // Grep/Glob/Edit/Write/…
277
+ if (tool === 'Read') {
278
+ const p = toolInput.file_path || toolInput.path;
279
+ if (isMemoryReadPath(p)) process.exit(0); // repo-path lookup
280
+ if (isTeamKbPath(p)) process.exit(0); // reading a team-KB doc IS the priming
281
+ console.log(primerMessage()); // repo code — blocked until primed
282
+ process.exit(2);
283
+ }
284
+ if (tool === 'Grep' || tool === 'Glob') {
285
+ if (isTeamKbSearch(toolInput)) process.exit(0); // locating a doc inside knowledge/
286
+ console.log(primerMessage()); // searching repo code — blocked
287
+ process.exit(2);
288
+ }
289
+ if (BLOCKED_TOOLS.has(tool)) { console.log(primerMessage()); process.exit(2); } // Edit/Write/…
268
290
  process.exit(0); // AskUserQuestion (ask for a repo path), Skill, … — allowed
269
291
  }
270
292
 
@@ -33,13 +33,18 @@ description: Start-of-session context loader for TOGA Technology projects. Run t
33
33
  > are permitted. Running **preflight (Step 3) does NOT release the gate — it advances it to
34
34
  > stage 2.**
35
35
  > - **Stage 2 (primer):** the load-set is resolved but the **team knowledge base is not yet
36
- > primed.** Everything stays blocked until you spawn the **`context-primer` subagent in the
37
- > foreground** (Step 4) — priming the team KB via that subagent is **what releases the gate.**
38
- > Reading `repo-path-<repo>` memories and asking the developer stay allowed.
36
+ > primed.** You must prime it **yourself, in this main session** — reading the resolved
37
+ > knowledge docs directly (Step 4). **No subagent may run** (`Agent`/`Task` are blocked),
38
+ > and repo code/`Edit`/`Write` stay blocked, **until priming is complete**. The gate
39
+ > releases **only** when you run the completion sentinel `node "<TEAM_REPO>/knowledge.js"
40
+ > kickoff-primed`. Reading `repo-path-<repo>` memories, reading/searching under
41
+ > `knowledge/`, and asking the developer stay allowed.
39
42
  >
40
43
  > So the correct response to a block message is never to fight it: run Steps 0–3, then
41
- > **prime the team KB via the foreground `context-primer` subagent (Step 4) BEFORE any other
42
- > research** — before you open a single repo file, even one named in the `/kickoff` sentence.
44
+ > **read the resolved team-KB docs yourself in the main session (Step 4) BEFORE any other
45
+ > research** — before you open a single repo file, even one named in the `/kickoff` sentence —
46
+ > and run `knowledge.js kickoff-primed` when done to release the gate. **Do not spawn a
47
+ > subagent to do the reading, and do not start any other agent until priming is complete.**
43
48
  > (Emergency override only: `KICKOFF_GATE_DISABLED=1`.)
44
49
 
45
50
  ## Session permission policy — auto-accept local file I/O, ALWAYS confirm dangerous execution
@@ -266,43 +271,53 @@ source — this is the one thing preflight can't know):
266
271
 
267
272
  Never ask for a repo not in `loadSet`.
268
273
 
269
- ## Step 4 — Prime the team knowledge base FIRST, via the `context-primer` subagent
274
+ ## Step 4 — Prime the team knowledge base FIRST, in the MAIN SESSION (no subagent)
270
275
 
271
276
  > 🛑 **THIS IS THE FIRST RESEARCH YOU DO — NOT OPTIONAL, NOT PARALLELIZABLE.**
272
277
  > After the interview, the team knowledge base is the **first source you prime from, before
273
- > ANY other research.** You may **not** read repo code, `Grep`/`Glob` the source, spawn any
274
- > other agent, or open a file **named in the `/kickoff` sentence** until the `context-primer`
275
- > subagent has **returned its briefing.** Preflight (Step 3) did **not** release the gate — it
276
- > advanced it to stage 2, and **spawning the foreground `context-primer` is what releases it.**
277
- > The team KB is the team's distilled, shared gold: skipping it, or side-channeling it (running
278
- > the primer in the background while you read code in parallel), is the exact failure this gate
279
- > exists to prevent — do neither.
280
-
281
- **This is also the token-discipline core of kickoff.** Reading every architecture + feature +
282
- standard + client doc *into this conversation* bloats the thread and trips compaction later. So
283
- you do **not** read those docs here — you **delegate the heavy reading to the `context-primer`
284
- subagent**, which reads them in *its own* context and returns a small distilled briefing.
285
-
286
- Spawn it with the `Agent` tool and **wait for it**:
287
- - `subagent_type: context-primer`,
288
- - **`run_in_background: false`** — foreground, so you MUST wait for the briefing before doing
289
- anything else; a backgrounded primer running while you read code is precisely the violation,
290
- - pass it: `TEAM_REPO` (the resolved path), the **full `kickoff-preflight` JSON** from Step 3
291
- (`reads[]`, `clientScope`, `standards`, `client`, `estimate`), and the developer's one-line
292
- task description.
293
-
294
- The primer returns a `## Primer` block (critical rules, task-relevant knowledge + gotchas,
295
- client variations, gaps) plus a `## Doc map`. **Keep only that briefing as your context for
296
- the session — do not re-read the underlying docs.** The `reads[]` order/precedence and
297
- `1.0`/`2.0` union are already handled inside the primer; do not run `search`/`deps` here.
298
-
299
- **Just-in-time deep dives.** When a *specific* task later needs the full internals of one
300
- doc (a full architecture, a long feature spec), open just that one `path` from the Doc map
301
- at that moment — or, for anything large, spawn a focused reader/implementer subagent that
302
- reads it in its context. Never bulk-load the Doc map back into this thread "to be safe."
303
-
304
- **`exists:false` entries** appear in the primer's *Gaps* section — note them in Step 5 as
305
- "no knowledge captured yet."
278
+ > ANY other research** — and you prime it **yourself, in this main session.** You may **not**
279
+ > read repo code, `Grep`/`Glob` the source, edit, write, or **spawn any subagent** (not the
280
+ > reading, and not any other agent running alongside it), or open a file **named in the
281
+ > `/kickoff` sentence**, until you have finished priming and run the completion sentinel.
282
+ > Preflight (Step 3) did **not** release the gate — it advanced it to stage 2. **Reading the
283
+ > resolved docs in the main session and then running `knowledge.js kickoff-primed` is what
284
+ > releases it.** The team KB is the team's distilled, shared gold: skipping it, or
285
+ > side-channeling it (delegating the reading to a subagent, or fanning out parallel agents
286
+ > before priming is done), is the exact failure this gate exists to prevent.
287
+
288
+ **Priming is synchronous and runs here, in the main thread — never a subagent.** A previous
289
+ design delegated the reading to a `context-primer` subagent to keep this thread lean; that is
290
+ **no longer done**. The team's requirement is that priming happens in the main session, so the
291
+ developer's own context holds the primed knowledge, and **no parallel agent begins until
292
+ priming is complete.**
293
+
294
+ Do this now:
295
+ 1. Walk the preflight **`reads[]`** list **in order** and `Read` each entry directly, in this
296
+ session:
297
+ - **`lazy: true` (label `architecture-summary`)** — do **not** open the file; the entry
298
+ already carries an inline `summary`. Absorb its **Critical rules** from that summary.
299
+ - **Any other entry** with `exists: true` (`repo-architecture`, `feature`, `standard`,
300
+ `client-profile`, `client-doc`) — `Read` the `path` resolved against
301
+ `<TEAM_REPO>/knowledge/`.
302
+ - **`exists: false`** — skip; note it as "no knowledge captured yet" for Step 5.
303
+ The `reads[]` order/precedence and the `1.0`/`2.0` union are already resolved by preflight —
304
+ do **not** run `search`/`deps` again.
305
+ 2. As you read, hold the **load-bearing facts** you'll code against: the critical rules
306
+ (naming prefixes, DB-access layer, dispatch pattern, response envelope, migration filename
307
+ rules), the task-relevant feature entry points and **gotchas**, and any client variations.
308
+ 3. When you have read **every** resolved doc, run the completion sentinel to release the gate:
309
+ ```bash
310
+ node "<TEAM_REPO>/knowledge.js" kickoff-primed
311
+ ```
312
+ Only after this may you read repo code, edit, write, or spawn any agent.
313
+
314
+ **Token discipline (still matters).** Reading every doc inline is heavier than the old
315
+ subagent approach — so be selective *after* the required reads: don't re-read a doc you've
316
+ already absorbed, and for a large architecture/feature spec you only need part of, read the
317
+ relevant section rather than the whole file. Keep a mental **doc map** (path → one line) so
318
+ you can reopen a specific doc just-in-time later instead of holding it all at once.
319
+
320
+ **`exists:false` entries** are *Gaps* — note them in Step 5 as "no knowledge captured yet."
306
321
 
307
322
  **Do NOT create or modify any `CLAUDE.md` stub** — kickoff only reads. A blank session is a
308
323
  valid choice; this skill is opt-in.
@@ -392,7 +407,7 @@ loaded here.
392
407
 
393
408
  ## Step 6 — Propose a workflow plan (multi-agent by default for non-trivial work)
394
409
 
395
- After the primer, analyze what the developer is building and **propose a concrete plan
410
+ After priming, analyze what the developer is building and **propose a concrete plan
396
411
  before writing code**. The plan's *shape* depends on size — and the default for anything
397
412
  non-trivial is to **orchestrate specialist subagents**, not to do everything in this
398
413
  thread. This keeps the main conversation as the orchestrator (light, durable) while the
@@ -410,9 +425,9 @@ Frame everything in plain terms: "Here's my plan."
410
425
  right." Drive it as **explore → implement → verify**, delegating each stage to a subagent
411
426
  so this thread stays the conductor:
412
427
  1. **Explore/plan** — spawn `planner` (TOGA-aware) to produce a phased plan grounded in
413
- the primer. It reads deep docs in its own context; you keep the plan.
428
+ your priming notes. It reads deep docs in its own context; you keep the plan.
414
429
  2. **Implement** — for each phase, an implementer subagent writes the code (it can open
415
- the full architecture/feature docs from the primer's Doc map as needed). For work that
430
+ the full architecture/feature docs from your doc map as needed). For work that
416
431
  spans **independent files in parallel**, give each implementer **`isolation: worktree`**
417
432
  so they cannot collide on the same checkout.
418
433
  3. **Verify** — run the specialist reviewers (`php-reviewer`, `sql-reviewer`,
@@ -478,7 +493,8 @@ needed for those.
478
493
 
479
494
  Spawn specialists via the `Agent` tool. Grant only the tools the agent needs. Inject the
480
495
  TOGA context prefix (see `.claude/agents/toga/planner.md`, `php-reviewer.md`) — but you can
481
- now pass the **Step 4 primer** as that context instead of re-reading docs.
496
+ now pass your **Step 4 priming notes** (the facts you absorbed reading the KB in the main
497
+ session) as that context instead of re-reading docs.
482
498
 
483
499
  | Work type | Agent | Tools |
484
500
  |-----------|-------|-------|
@@ -515,7 +531,7 @@ decides when it's done.
515
531
 
516
532
  ```
517
533
  ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
518
- Context: <repo> · Framework <fw> · Client: <client> (primed via context-primer)
534
+ Context: <repo> · Framework <fw> · Client: <client> (primed in main session)
519
535
  Specialists on standby: planner, php-reviewer, sql-reviewer, security-reviewer
520
536
  Bigger/iterative work → /toga-loop
521
537
  ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
@@ -99,7 +99,7 @@ it goes straight to preflight + priming, e.g.:
99
99
  **Only stop to ask the developer if a gate answer is genuinely ambiguous** after all three
100
100
  inputs (e.g. the code spans both frameworks and neither ticket nor Talos says which is in
101
101
  scope). Otherwise let kickoff run unattended — it checks for harness updates, resolves the
102
- load-set, and returns the `context-primer` briefing.
102
+ load-set, and primes the team knowledge base in the main session (kickoff Step 4).
103
103
 
104
104
  **Carry the primer briefing into synthesis.** The framework rules, gotchas, and client
105
105
  variations it surfaces directly inform the plan — fold them into the **Architecture decision**
@@ -96,7 +96,7 @@ plan's `Repos:` header (map repos → framework/layer/client), passing the chang
96
96
  /kickoff <framework> <layer>, repos: <repos>, client: <client> — rework <TICKET> <title>: <one-line change summary>
97
97
  ```
98
98
 
99
- Carry the `context-primer` briefing into Step 5. Only stop to ask if a kickoff gate answer is
99
+ Carry the kickoff priming notes (read in the main session per kickoff Step 4) into Step 5. Only stop to ask if a kickoff gate answer is
100
100
  genuinely ambiguous.
101
101
 
102
102
  ## Step 4 — Check out each EXISTING branch (fetch first; do NOT create a new branch)
@@ -64,8 +64,8 @@ Pass them as the trailing argument so kickoff goes straight to preflight + primi
64
64
  /kickoff <framework> <layer>, repos: <repos>, client: <client> — execute <TICKET> <title>
65
65
  ```
66
66
 
67
- Carry the `context-primer` briefing (framework rules, gotchas, client variations) into Step 4 —
68
- it directly informs how each phase is implemented. Only stop to ask the developer if a kickoff
67
+ Carry the kickoff priming notes (framework rules, gotchas, client variations — read in the main
68
+ session per kickoff Step 4) into Step 4 — they directly inform how each phase is implemented. Only stop to ask the developer if a kickoff
69
69
  gate answer is genuinely ambiguous after reading the plan header.
70
70
 
71
71
  ## Step 3 — Per repo: create & checkout the ticket branch BEFORE any edits