Context Init
Use this only when a repository has no context-harness layout and should get a
fresh AGENTS.md, CONTEXT.md, NOW.md, and optional PLAN.md.
If a repository already has partial, stale, or custom context-harness files, use
explicit context-upgrade instead. Init does not repair existing layouts.
Goal
Create the smallest durable context layer that lets future agents catch up:
AGENTS.mdas the automatic Context ContractCONTEXT.mdfor project facts, operating constraints, language, relationships, and lessonsNOW.mdfor the current focusPLAN.mdonly when there is an active multi-step task
Generated AGENTS.md and CONTEXT.md must include
<!-- context-harness:schema v3 --> so future skill versions can detect the
layout.
Init Flow
Run the generator:
node scripts/context-gen.jsIf running from an installed companion skill directory, use:
node ../scripts/context-gen.jsPresent the generated
## Suggested Operating Constraintsand## Suggested Workflowas a starting point.Ask the user to keep only project-specific constraints a future agent would not infer from code or docs, and confirm workflow verification commands.
Write
CONTEXT.md,NOW.md, andAGENTS.mdfrom the templates in the rootcontext-harnessskill.Install context-harness runtime scripts into the target repo:
node <context-harness-skill-dir>/scripts/install-project.jsRun
node scripts/context-index.js updatesoAGENTS.mdhas a generated high-level index and.context-harness/has retrieval cards.Ask whether there is a multi-step task. If yes, create
PLAN.md.
Guardrails
- Use
PLAN.mdDone Criteria andCONTEXT.mdWorkflow Verification instead of durable project-wide objectives. - Do not repair existing layouts here; route partial, stale, or custom
context-harness files to explicit
context-upgrade. - Keep generated files short enough to be read every session.
- Keep
AGENTS.mdsmall: contract plus generatedCONTEXT.mdindex and a pointer tohydrate. - Runtime scripts are project-local after init, so
AGENTS.mdcan refer tonode scripts/context-index.js updateandhydrate. - Do not create ADRs unless the target project already has an ADR workflow.