generate-context-health.ts
23 lines · scripts/resolvers/preamble/generate-context-health.ts at 3f79d81
1import type { TemplateContext } from '../types';
3export function generateContextHealth(ctx?: TemplateContext): string {
4 if (ctx?.explainLevel === 'terse') return '';
5 return `## Context Health (soft directive)
7During long-running skill sessions, when you finish a phase or change direction, tell the user in a sentence or two what is done, what is next, and anything surprising.
9If you are looping on the same diagnostic, same file, or failed fix variants, STOP and reassess. Consider escalation or /context-save. Progress summaries must NEVER mutate git state.`;
10}
12// Preamble Composition (tier → sections)
13// ─────────────────────────────────────────────
14// T1: core + upgrade + lake + telemetry + voice(trimmed) + completion
15// T2: T1 + voice(full) + ask + completeness + context-recovery
16// T3: T2 + repo-mode + search
17// T4: (same as T3 — TEST_FAILURE_TRIAGE is a separate {{}} placeholder, not preamble)
18//
19// Skills by tier:
20// T1: browse, setup-cookies, benchmark
21// T2: investigate, cso, retro, doc-release, setup-deploy, canary, checkpoint, health
22// T3: autoplan, codex, design-consult, office-hours, ceo/design/eng-review
23// T4: ship, review, qa, qa-only, design-review, land-deploy