@leing2021/super-pi 0.23.3 → 0.23.5

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/README.md CHANGED
@@ -89,7 +89,7 @@ New conversation overhead: **~2,600 tokens** (1.3% of 200K context).
89
89
 
90
90
  Progressive loading: only needed skills loaded on-demand.
91
91
 
92
- Full evaluation → [`docs/token-cost-evaluation.md`](docs/token-cost-evaluation.md)
92
+ Full evaluation → see Token Cost section above.
93
93
 
94
94
  ---
95
95
 
@@ -332,6 +332,7 @@ const contextHandoffParams = Type.Object({
332
332
  openDecisions: Type.Optional(Type.Array(Type.String(), { description: "Pending decisions that affect next steps" })),
333
333
  recentlyAccessedFiles: Type.Optional(Type.Array(Type.String(), { description: "Files recently read or edited (defaults to activeFiles)" })),
334
334
  compressionRisk: Type.Optional(Type.Array(Type.String(), { description: "Context compression risks to watch for" })),
335
+ activeRules: Type.Optional(Type.Array(Type.String(), { description: "1-5 must-know rules for continuation (TDD gates, constraints, do-not-repeat)" })),
335
336
  })
336
337
 
337
338
  const patternExtractorParams = Type.Object({
@@ -772,6 +773,7 @@ export default function ceCoreExtension(pi: ExtensionAPI) {
772
773
  openDecisions: params.openDecisions,
773
774
  recentlyAccessedFiles: params.recentlyAccessedFiles,
774
775
  compressionRisk: params.compressionRisk,
776
+ activeRules: params.activeRules,
775
777
  })
776
778
 
777
779
  return {
@@ -891,4 +893,4 @@ export {
891
893
  export { normalizeSlug } from "./utils/name-utils"
892
894
  export { filterBashOutput } from "./tools/bash-output-filter"
893
895
  export { filterReadOutput } from "./tools/read-output-filter"
894
- export { COMPACTION_FOCUS_INSTRUCTIONS, TURN_PREFIX_FOCUS_INSTRUCTIONS } from "./tools/compaction-optimizer"
896
+ export { COMPACTION_FOCUS_INSTRUCTIONS } from "./tools/compaction-optimizer"
@@ -27,12 +27,4 @@ export const COMPACTION_FOCUS_INSTRUCTIONS = `Additional focus for this summary:
27
27
  6. If any tests were run, summarize results by: file, pass/fail count, and specific failure messages
28
28
  7. Note any blocked items and their exact error state`
29
29
 
30
- /**
31
- * Additional instructions for turn-prefix summaries (split turns).
32
- * These are more concise since the turn suffix is retained.
33
- */
34
- export const TURN_PREFIX_FOCUS_INSTRUCTIONS = `Focus the turn-prefix summary on:
35
- - What the user originally asked for
36
- - Key decisions made in the prefix
37
- - Exact file paths and identifiers needed to understand the retained suffix
38
- Skip reasoning details — only keep actionable context.`
30
+
@@ -37,6 +37,7 @@ export interface ContextHandoffInput {
37
37
  openDecisions?: string[]
38
38
  recentlyAccessedFiles?: string[]
39
39
  compressionRisk?: string[]
40
+ activeRules?: string[]
40
41
  }
41
42
 
42
43
  export interface ContextStateEntry {
@@ -54,6 +55,7 @@ export interface ContextStateEntry {
54
55
  openDecisions: string[]
55
56
  recentlyAccessedFiles: string[]
56
57
  compressionRisk: string[]
58
+ activeRules: string[]
57
59
  recommendNewSession: boolean
58
60
  updatedAt: string
59
61
  }
@@ -77,6 +79,7 @@ export interface ContextHandoffResult {
77
79
  openDecisions?: string[]
78
80
  recentlyAccessedFiles?: string[]
79
81
  compressionRisk?: string[]
82
+ activeRules?: string[]
80
83
  updatedAt?: string
81
84
  // Validation fields
82
85
  ok?: boolean
@@ -154,6 +157,7 @@ function buildDefaultHandoffMarkdown(input: {
154
157
  openDecisions: string[]
155
158
  recentlyAccessedFiles: string[]
156
159
  compressionRisk: string[]
160
+ activeRules: string[]
157
161
  }): string {
158
162
  const currentTask = input.nextStage
159
163
  ? `Continue from ${input.currentStage} to ${input.nextStage}.`
@@ -194,6 +198,9 @@ function buildDefaultHandoffMarkdown(input: {
194
198
  "## Active Files",
195
199
  activeFiles,
196
200
  "",
201
+ "## Active Rules",
202
+ formatBullets(input.activeRules),
203
+ "",
197
204
  "## Recently Accessed Files",
198
205
  formatBullets(input.recentlyAccessedFiles),
199
206
  "",
@@ -245,6 +252,7 @@ function normalizeStateEntry(raw: unknown): ContextStateEntry | null {
245
252
  ? toStringArray(state.recentlyAccessedFiles)
246
253
  : activeFiles.slice(0, 5),
247
254
  compressionRisk: toStringArray(state.compressionRisk),
255
+ activeRules: toStringArray(state.activeRules),
248
256
  recommendNewSession: typeof state.recommendNewSession === "boolean" ? state.recommendNewSession : false,
249
257
  updatedAt: typeof state.updatedAt === "string" ? state.updatedAt : new Date(0).toISOString(),
250
258
  }
@@ -314,6 +322,7 @@ async function save(input: ContextHandoffInput): Promise<ContextHandoffResult> {
314
322
  ? input.recentlyAccessedFiles
315
323
  : activeFiles.slice(0, 5)
316
324
  const compressionRisk = input.compressionRisk ?? []
325
+ const activeRules = input.activeRules ?? []
317
326
 
318
327
  const handoffMarkdown = input.handoffMarkdown?.trim().length
319
328
  ? input.handoffMarkdown
@@ -329,6 +338,7 @@ async function save(input: ContextHandoffInput): Promise<ContextHandoffResult> {
329
338
  openDecisions,
330
339
  recentlyAccessedFiles,
331
340
  compressionRisk,
341
+ activeRules,
332
342
  })
333
343
 
334
344
  const recommendNewSession = computeRecommendNewSession(currentStage, nextStage, contextHealth)
@@ -356,6 +366,7 @@ async function save(input: ContextHandoffInput): Promise<ContextHandoffResult> {
356
366
  openDecisions,
357
367
  recentlyAccessedFiles,
358
368
  compressionRisk,
369
+ activeRules,
359
370
  recommendNewSession,
360
371
  updatedAt: new Date().toISOString(),
361
372
  }
@@ -379,6 +390,7 @@ async function save(input: ContextHandoffInput): Promise<ContextHandoffResult> {
379
390
  openDecisions,
380
391
  recentlyAccessedFiles,
381
392
  compressionRisk,
393
+ activeRules,
382
394
  recommendNewSession,
383
395
  updatedAt: state.updatedAt,
384
396
  }
@@ -419,6 +431,7 @@ async function load(input: ContextHandoffInput): Promise<ContextHandoffResult> {
419
431
  openDecisions: state.openDecisions,
420
432
  recentlyAccessedFiles: state.recentlyAccessedFiles,
421
433
  compressionRisk: state.compressionRisk,
434
+ activeRules: state.activeRules,
422
435
  recommendNewSession: state.recommendNewSession,
423
436
  handoffMarkdown: markdown,
424
437
  updatedAt: state.updatedAt,
@@ -453,6 +466,7 @@ async function latest(input: ContextHandoffInput): Promise<ContextHandoffResult>
453
466
  openDecisions: state.openDecisions,
454
467
  recentlyAccessedFiles: state.recentlyAccessedFiles,
455
468
  compressionRisk: state.compressionRisk,
469
+ activeRules: state.activeRules,
456
470
  recommendNewSession: state.recommendNewSession,
457
471
  updatedAt: state.updatedAt,
458
472
  }
@@ -755,6 +769,7 @@ async function status(input: ContextHandoffInput): Promise<ContextHandoffResult>
755
769
  openDecisions: state.openDecisions,
756
770
  recentlyAccessedFiles: state.recentlyAccessedFiles,
757
771
  compressionRisk: state.compressionRisk,
772
+ activeRules: state.activeRules,
758
773
  recommendNewSession: state.recommendNewSession,
759
774
  updatedAt: state.updatedAt,
760
775
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@leing2021/super-pi",
3
- "version": "0.23.3",
3
+ "version": "0.23.5",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "description": "Pi-native Compound Engineering package for iterative development workflows",
@@ -13,6 +13,7 @@ The Feature Implementation Workflow describes the development pipeline: research
13
13
  - **Check package registries:** Search npm, PyPI, crates.io, and other registries before writing utility code. Prefer battle-tested libraries over hand-rolled solutions.
14
14
  - **Search for adaptable implementations:** Look for open-source projects that solve 80%+ of the problem and can be forked, ported, or wrapped.
15
15
  - Prefer adopting or porting a proven approach over writing net-new code when it meets the requirement.
16
+ - **Source-driven trigger:** When implementation depends on a framework/library API, version-specific behavior, or a recommended pattern, verify against official documentation and cite key sources in the output. Pure logic, renaming, or in-project pattern reuse does not require external citation.
16
17
 
17
18
  1. **Plan First**
18
19
  - Use **planner** agent to create implementation plan
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: 01-brainstorm
3
- description: "Brainstorm requirements with three modes: CE discovery, Startup Diagnostic, Builder Mode."
3
+ description: "Discover requirements through structured multi-round dialog. Use when the request is ambiguous, needs discovery, or describes a new idea/product."
4
4
  ---
5
5
 
6
6
  # Brainstorm
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: 02-plan
3
- description: "Turn requirements into a plan. Optional CEO-style strategic review after."
3
+ description: "Turn requirements into an execution-ready plan with TDD-gated implementation units. Use when a brainstorm artifact exists and is ready for planning."
4
4
  ---
5
5
 
6
6
  # Plan
@@ -39,13 +39,15 @@ Every unit follows **RED → GREEN → REFACTOR**:
39
39
 
40
40
  ## Planning flow
41
41
 
42
- 1. Read relevant brainstorm from `docs/brainstorms/`
43
- 2. Run solution search (keywords → grep frontmatter → read top 3)
44
- 3. Gather repository context
45
- 4. If plan exists: use `plan_diff` `compare` → review with user → `patch`
46
- 5. If no plan: write new plan under `docs/plans/` using `references/plan-template.md`
47
- 6. Structure work using `references/implementation-unit-template.md`
48
- 7. Verify every unit follows TDD gates
42
+ 1. **Load context**: consume latest handoff before any broad file reads — `context_handoff load` or read `.context/compound-engineering/handoffs/latest.md`. If found, use `activeFiles` and `blocker` as starting point. If not found, proceed normally (new project).
43
+ 2. Read relevant brainstorm from `docs/brainstorms/`
44
+ 3. Run solution search (keywords → grep frontmatter → read top 3)
45
+ 4. Gather repository context
46
+ 5. **Source-driven check:** For each unit that involves framework/library APIs, add a note: "Verify against official docs before implementing."
47
+ 6. If plan exists: use `plan_diff` `compare` → review with user → `patch`
48
+ 6. If no plan: write new plan under `docs/plans/` using `references/plan-template.md`
49
+ 7. Structure work using `references/implementation-unit-template.md`
50
+ 8. Verify every unit follows TDD gates
49
51
 
50
52
  ## Optional: CEO Review
51
53
 
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: 03-work
3
- description: Execute plan-driven work in a controlled Phase 1 workflow.
3
+ description: "Execute plan units with parallel subagents, TDD enforcement, and checkpoint resume. Use when a plan path is ready for implementation."
4
4
  ---
5
5
 
6
6
  # Work
@@ -39,18 +39,39 @@ Every step follows **RED → GREEN → REFACTOR**:
39
39
  - Missing evidence test passed after implementation
40
40
  - Tests added only after code
41
41
 
42
+ ## Stop-the-line rule (Hard gate)
43
+
44
+ When any unexpected failure occurs during execution:
45
+
46
+ 1. **STOP** adding features or making changes
47
+ 2. **PRESERVE** evidence (error output, repro steps)
48
+ 3. **DIAGNOSE** root cause — reproduce, localize, reduce
49
+ 4. **FIX** the root cause, not the symptom
50
+ 5. **GUARD** with a regression test
51
+ 6. **RESUME** only after verification passes
52
+
53
+ Anti-rationalization — when a gate fails or evidence is missing:
54
+ - Do not rationalize, downgrade, or explain away the failure.
55
+ - Stop, report the blocker with evidence, and either fix the root cause or ask for direction.
56
+ - Do not continue unrelated implementation after failed verification.
57
+
58
+ This is a hard gate — do not push past a failing test or broken build to continue implementation. Errors compound.
59
+
42
60
  ## Workflow
43
61
 
44
- 1. Detect input type (plan path vs bare prompt)
45
- 2. Read implementation units if plan path
46
- 3. Load `session_checkpoint` to skip completed units
47
- 4. Use `task_splitter` for dependency analysis
48
- 5. Execute: **inline mode** by default, `ce_parallel_subagent` for independent units
49
- 6. Follow TDD per unit: RED minimal code GREEN refactor → unit-level **verification**
50
- 7. Record progress via `references/progress-update-format.md`
51
- 8. Save `session_checkpoint` after each unit
52
- 9. On failure: `session_checkpoint` `fail` → `retry` → follow strategy
53
- 10. Provide completion report (see `references/completion-report.md`)
54
- 11. Handoff to `04-review` using `references/handoff.md`
62
+ 1. **Load context**: consume latest handoff before any broad file reads — `context_handoff load` or read `.context/compound-engineering/handoffs/latest.md`. If found, use `activeFiles`, `blocker`, `verification`, `activeRules` as starting point. If not found, proceed normally.
63
+ 2. Detect input type (plan path vs bare prompt)
64
+ 3. Read implementation units if plan path
65
+ 4. Load `session_checkpoint` to skip completed units
66
+ 5. Use `task_splitter` for dependency analysis
67
+ 6. Execute: **inline mode** by default, `ce_parallel_subagent` for independent units
68
+ 7. Follow TDD per unit: RED → minimal code → GREEN → refactor → unit-level **verification**
69
+ 8. **Source-driven gate:** Before implementing framework/library-specific code, verify the API or pattern against official documentation. Flag unverified patterns as UNVERIFIED in output.
70
+ 9. Record progress via `references/progress-update-format.md`
71
+ 9. Save `session_checkpoint` after each unit
72
+ 10. On failure: `session_checkpoint` `fail` `retry` → follow strategy
73
+ 11. Provide completion report (see `references/completion-report.md`)
74
+ 12. **Save handoff**: `context_handoff save` with current stage, next stage, activeFiles, blocker, verification, activeRules
75
+ 13. Handoff to `04-review` using `references/handoff.md`
55
76
 
56
77
  Before finishing this skill, apply the completion checklist in [shared pipeline instructions](../references/pipeline-config.md).
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: 04-review
3
- description: "Review code with structured findings. Optional browser QA and regression tests."
3
+ description: "Review code changes across five axes with evidence-first findings. Use after implementation is complete and before committing."
4
4
  ---
5
5
 
6
6
  # Review
@@ -46,14 +46,15 @@ Code review is **technical evaluation**, not social performance:
46
46
 
47
47
  ## Workflow
48
48
 
49
- 1. Determine diff scope from branch or explicit target
50
- 2. Collect stats (files, insertions, deletions) call `review_router`
51
- 3. Read matching plan artifact
52
- 4. Run solution search
53
- 5. Apply each reviewer persona from `review_router`
54
- 6. Merge into structured findings
55
- 7. Verify each finding against codebase
56
- 8. Apply autofixes, re-run tests, re-review if needed
49
+ 1. **Load context**: consume latest handoff before any broad file reads — `context_handoff load` or read `.context/compound-engineering/handoffs/latest.md`. If found, use `activeFiles`, `artifacts.plan` as starting point. If not found, proceed normally.
50
+ 2. Determine diff scope from branch or explicit target
51
+ 3. Collect stats (files, insertions, deletions) → call `review_router`
52
+ 4. Read matching plan artifact
53
+ 5. Run solution search
54
+ 6. Apply each reviewer persona from `review_router`
55
+ 7. Merge into structured findings
56
+ 8. Verify each finding against codebase
57
+ 9. Apply autofixes, re-run tests, re-review if needed
57
58
 
58
59
  ## Optional: QA Test Mode
59
60
 
@@ -10,6 +10,8 @@ Use the `review_router` tool to determine which reviewers to apply based on diff
10
10
 
11
11
  ## Reviewer personas
12
12
 
13
+ All reviewers evaluate changes across five axes: correctness, readability, architecture, security, performance. Base reviewers cover axes 1–3 by default; conditional reviewers add depth on specific axes.
14
+
13
15
  ### Base reviewers (always active)
14
16
 
15
17
  - **correctness-reviewer**: Logical correctness, intended behavior, edge cases.
@@ -19,6 +21,6 @@ Use the `review_router` tool to determine which reviewers to apply based on diff
19
21
  ### Conditional reviewers (routed by `review_router`)
20
22
 
21
23
  - **security-reviewer**: Triggered when auth, permissions, tokens, sessions, or crypto files change. Reviews for injection, auth bypass, credential leakage.
22
- - **performan04-reviewer**: Triggered when query, cache, database, or streaming files change. Reviews for N+1, unnecessary allocation, missing indexes.
24
+ - **performance-reviewer**: Triggered when query, cache, database, or streaming files change. Reviews for N+1, unnecessary allocation, missing indexes.
23
25
  - **integration-reviewer**: Triggered when CI/CD, Docker, package.json, or config files change. Reviews for dependency conflicts, build breakage, deployment issues.
24
26
  - **thoroughness-reviewer**: Triggered for large diffs (5+ files or 300+ lines). Reviews for incomplete refactors, missed callers, inconsistent changes.
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: 05-learn
3
- description: Capture solved problems as reusable solution artifacts.
3
+ description: "Capture solved problems as searchable solution artifacts. Use after a workflow loop completes or a non-trivial problem is solved."
4
4
  ---
5
5
 
6
6
  # Learn
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: 06-next
3
- description: "Inspect workflow state and recommend the single best next Compound Engineering skill. Use --verbose for a full status report."
3
+ description: "Inspect workflow artifacts and recommend the single best next skill. Use when unsure what to run next."
4
4
  ---
5
5
 
6
6
  # Next
@@ -22,8 +22,9 @@ Use this skill when the user wants to know what to run next in the Compound Engi
22
22
  When the user asks "what should I do next?", "continue", or runs `/skill:06-next`:
23
23
 
24
24
  1. Call `workflow_state` with the repo root
25
- 2. Apply recommendation logic from `references/recommendation-logic.md`
26
- 3. Return: skill name, reason (1-2 lines), brief workflow state summary
25
+ 2. Inspect `workflow_state.context` first — apply **context-first priority chain** from `references/recommendation-logic.md` (health → blocker → recommendNewSession → nextStage → mismatch → fallback)
26
+ 3. If no context signals trigger, fall back to artifact-count rules
27
+ 4. Return: skill name, reason (1-2 lines), brief workflow state summary
27
28
 
28
29
  ### Verbose mode: "full status"
29
30
 
@@ -31,7 +32,8 @@ When the user asks "show status", "what's the current state", or uses `--verbose
31
32
 
32
33
  1. Call `workflow_state` with the repo root
33
34
  2. Call `session_history` with `latest` operation
34
- 3. Return: latest artifacts (path + summary), status of each phase, recommended next step
35
+ 3. Include context health assessment from `workflow_state.context` in the status report
36
+ 4. Return: latest artifacts (path + summary), status of each phase, context health, recommended next step
35
37
 
36
38
  ## Artifact locations
37
39
 
@@ -1,6 +1,51 @@
1
1
  # Recommendation logic
2
2
 
3
- Apply these rules in order. Return the first match.
3
+ Apply these rules in strict priority order. Return the first match.
4
+
5
+ ## Context-first priority chain
6
+
7
+ `06-next` must call `workflow_state` and inspect `workflow_state.context` **before** applying artifact-count rules. Context health and runtime state override stale artifact counts.
8
+
9
+ Field mapping: the requirement uses `context.health` as a conceptual alias. Use the actual field name `workflow_state.context.contextHealth`.
10
+
11
+ ### Priority 1: Critical context health
12
+
13
+ If `context.contextHealth` is `"critical"`:
14
+ - Recommend: save a `context_handoff` with full handoff-lite template, then open a **new session**.
15
+ - Reason: Current session context is critically inflated. Continuing will degrade decision quality and waste tokens.
16
+ - Output: handoff-save guidance + copyable new-session prompt with repo path and artifact references.
17
+
18
+ ### Priority 2: Active blocker
19
+
20
+ If `context.blocker` exists and is not `"N/A"` or a placeholder:
21
+ - Recommend: return to the current stage (`context.currentStage`) and resolve the blocker before advancing.
22
+ - Reason: A known blocker exists in the current pipeline stage.
23
+ - Output: `/skill:<currentStage>` with blocker description.
24
+
25
+ ### Priority 3: New session recommended
26
+
27
+ If `context.recommendNewSession === true`:
28
+ - Recommend: open a new Pi session.
29
+ - Reason: The previous stage determined that context health + phase transition warrant a fresh session.
30
+ - Output: copyable new-session prompt referencing `context.latestHandoffPath`, artifacts, and next stage.
31
+
32
+ ### Priority 4: Explicit next stage
33
+
34
+ If `context.nextStage` exists, is meaningful, and differs from `context.currentStage`:
35
+ - Recommend: `/skill:<context.nextStage>`.
36
+ - Reason: The previous stage explicitly requested this transition.
37
+ - Output: recommended skill command.
38
+
39
+ ### Priority 5: Stage mismatch detection
40
+
41
+ If `context.currentStage` does not match the most recent artifact state (e.g. a plan exists but context says `"01-brainstorm"`):
42
+ - Recommend: the skill that matches the most recent artifact, or ask the user to clarify.
43
+ - Reason: Runtime context and artifact state are out of sync.
44
+ - Output: suggested correction with explanation of the mismatch.
45
+
46
+ ### Priority 6: Fallback — artifact-count rules
47
+
48
+ If none of the above context rules triggered, fall back to the artifact-count rules below.
4
49
 
5
50
  ## Rule 1: No brainstorm artifacts
6
51
 
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: 07-worktree
3
- description: Create and manage git worktrees for isolated feature development.
3
+ description: "Create and manage git worktrees for isolated feature development. Use when starting a feature that needs branch isolation."
4
4
  ---
5
5
 
6
6
  # Worktree
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: 08-help
3
- description: Explain when to use each Compound Engineering Phase 1 skill and how they connect.
3
+ description: "Explain Phase 1 skills and their connections. Use when learning the workflow or deciding which skill applies."
4
4
  ---
5
5
 
6
6
  # Help
@@ -18,7 +18,34 @@ Supported `modelStrategy` formats in `.pi/settings.json`:
18
18
  - Full reference: `"02-plan": "anthropic/claude-opus-4-1"`
19
19
  - Bare model id (reuses current provider): `"02-plan": "claude-opus-4-1"`
20
20
 
21
- ## End of skill: status + context
21
+ ## Start of skill: context loading
22
+
23
+ Before reading any project files or running repository-wide scans, load the most recent handoff:
24
+
25
+ 1. Try `context_handoff load` or `context_handoff latest` first.
26
+ 2. Fallback: `read .context/compound-engineering/handoffs/latest.md` if tool is unavailable.
27
+ 3. **Handoff found?** Consume its `activeFiles`, `blocker`, `verification`, `currentTruth`, `activeRules` before any broad project reads.
28
+ 4. **No handoff?** Proceed normally — this is a new project or first run. Do not block.
29
+
30
+ Core principle: **consume handoff before broad project file reads** — a single handoff read (~500 tokens) avoids 5-10 project file scans (~5K-10K tokens).
31
+
32
+ ## End of skill: save handoff + status + context
33
+
34
+ Every Phase 1 skill (02-plan through 05-learn) must save context handoff at completion:
35
+
36
+ ```
37
+ context_handoff save
38
+ currentStage: <stageKey>
39
+ nextStage: <next stage>
40
+ contextHealth: good | watch | heavy | critical
41
+ activeFiles: [1-5 currently active paths]
42
+ blocker: <blocker or N/A>
43
+ verification: <latest command + result>
44
+ activeRules: [1-5 rules critical for continuation]
45
+ currentTruth: [validated truths]
46
+ ```
47
+
48
+ If `context_handoff` is unavailable, manually write the Handoff-lite template to `.context/compound-engineering/handoffs/latest.md`.
22
49
 
23
50
  Before final completion, always output these blocks (replace placeholders with real values, never output angle-bracket placeholders literally):
24
51