Repo Bootstrap
Create and maintain a .harness/ workspace in the repository root so future turns keep stable project memory, structured plan state, and reviewable execution artifacts.
This skill now uses .harness/state.json as a local machine-readable source of truth. The five markdown files are rendered from that state so the agent can keep updating them without losing prior knowledge.
When To Use It
- First-time repository bootstrap
- Ongoing work where the agent should persist memory across turns
- Non-trivial implementation that needs plan/checklist tracking
- Periodic repo-wiki refresh after architecture or workflow discovery
- Long-running sessions where prompt history and decisions should survive context-window loss
Core Model
The durable memory model has two layers:
.harness/state.json- structured source of truth for current memory, prompt log, repo facts, plan, and checklist state
- preserves rolling history and allows deterministic markdown regeneration
- Rendered markdown views
.harness/memory.md.harness/prompt.md.harness/repowiki.md.harness/plan.md.harness/checklist.md
/.harness/ must remain gitignored.
Quick Start
- Resolve repository root.
- Run a bootstrap or sync command:
Claude Code:
bashpython3 ~/.claude/skills/repo-bootstrap/scripts/init_docs.py \ --repo-root <repo-root> \ --latest-prompt "Summarize and improve this repo bootstrap skill." \ --intent "Persist durable repo memory and update the harness docs." \ --objective "Upgrade repo-bootstrap to support rolling updates." \ --workstream "skill enhancement" \ --work-summary "Synced harness state for the current task." \ --next-action "Run verification"
Codex:
bashpython3 "$CODEX_HOME/skills/repo-bootstrap/scripts/init_docs.py" \ --repo-root <repo-root> \ --latest-prompt "Summarize and improve this repo bootstrap skill." \ --intent "Persist durable repo memory and update the harness docs." \ --objective "Upgrade repo-bootstrap to support rolling updates." \ --workstream "skill enhancement" \ --work-summary "Synced harness state for the current task." \ --next-action "Run verification"
- For richer updates, write a JSON payload and pass
--context-file:
Claude Code:
bashpython3 ~/.claude/skills/repo-bootstrap/scripts/init_docs.py \ --repo-root <repo-root> \ --context-file /tmp/harness-context.json
Codex:
bashpython3 "$CODEX_HOME/skills/repo-bootstrap/scripts/init_docs.py" \ --repo-root <repo-root> \ --context-file /tmp/harness-context.json
- Confirm these files exist:
.harness/state.json.harness/memory.md.harness/prompt.md.harness/repowiki.md.harness/plan.md.harness/checklist.md
- Confirm
.gitignorecontains/.harness/.
Required Turn Workflow
Apply this workflow every time the skill is invoked.
- Read
.harness/memory.mdand.harness/prompt.mdbefore analysis. - For code or architecture tasks, also read
.harness/repowiki.mdbefore planning. - Before finishing the turn, sync the latest task context back into
.harness/state.json. - Let the script re-render the five markdown files from state.
- If facts changed, update
repowiki.mdthrough the structured state instead of editing only the markdown view.
The skill is only doing its job if the state is refreshed continuously. Bootstrap alone is not enough.
Non-Negotiable Rules
.harness/state.jsonis the canonical local memory store.memory.mdandprompt.mdmust be refreshed on every invocation.repowiki.mdmust be refreshed whenever repository facts evolve, or at minimum receive a review entry.plan.mdandchecklist.mdmust stay aligned through shared step IDs or explicit mapping./.harness/must stay ignored in.gitignore.- Do not wipe history just to keep docs tidy; summarize or trim old entries instead.
- Do not rely on placeholder-only content after bootstrap.
First-Run Baseline Expectations
The first run should produce useful baseline content automatically:
- repo name and summary from README when available
- stack/toolchain guesses from manifests and lockfiles
- detected run/build/test/lint commands
- top-level directory map placeholders with concrete paths
- initial memory objective, risks, next actions, and decisions
- initial prompt record even when no explicit prompt was supplied
Unknown facts are allowed, but they must be framed as explicit gaps or discovery actions, not empty stubs.
Structured Update Payload
The script accepts structured context through --context-file or --context-json.
Supported top-level fields:
latest_promptprompt_summaryintentconstraintssuccess_criteriarequested_output_formatobjectivedefinition_of_doneworkstreamwhy_nowwork_summaryrepo_factsassumptionsdecisionsblockersrisksopen_questionsnext_actionsrepo_namerepo_summaryrepo_purposestakeholdersnon_goalsdirectory_maparchitecturedata_flowrequired_env_varstest_strategydeployment_notesobservability_notessecurity_notesknown_gapsrepowiki_reviewplanchecklist
Recommended shapes:
decisions: array of{summary, reason, tradeoff}blockers: array of{item, owner, next_action}risks: array of{item, impact, mitigation}open_questions: array of{question, discovery_action, expected_source}plan.steps: array of{id, step, why, owner, status}plan.files: array of{path, change_type, purpose, linked_step}checklist.plan_mapping: array of{plan_step, item, status, evidence}checklist.files: array of{path, purpose, linked_step, status}checklist.validation_results: array of{check, result, notes}
If plan is present and checklist is omitted, the script auto-derives a checklist skeleton from the plan.
Five-Document Responsibility Contract
| File | Primary responsibility | Minimum useful content | Update trigger |
|---|---|---|---|
memory.md | Durable working memory across turns/sessions | current objective, decisions, blockers, risks, open questions, next actions, change log | every interaction |
prompt.md | Prompt and intent history | latest prompt, interpretation, constraints, success criteria, prompt timeline | every interaction |
repowiki.md | Repository operational wiki | repo purpose, stack, commands, directory map, repo facts, known gaps | whenever facts are learned or reviewed |
plan.md | Execution design for non-trivial work | request scope, assumptions, steps, file plan, validation, rollback | when planning is requested or work is non-trivial |
checklist.md | Execution ledger and validation status | plan mapping, file ledger, validation results, post-implementation status | when code change is planned or executed |
RepoWiki Depth Standard
.harness/repowiki.md must remain a practical wiki, not a summary paragraph. It should stay useful for future sessions by including:
- repository purpose and non-goals
- architecture notes and control/data-flow hints
- module or directory responsibility map
- local development commands
- runtime/config notes
- test strategy and quality gates
- operational/security notes when they become known
- known gaps and explicit discovery actions
Plan and Checklist Contract
When plan.md is active:
- record assumptions, dependencies, risks, mitigations, and rollback intent
- include explicit file-level change plans
- define validation before implementation
When checklist.md is active:
- track execution progress honestly
- include every modified file and one-line purpose
- record validation outcomes as
pass,fail,skip, orpending - stay aligned with plan step IDs
Migration Behavior
If legacy markdown files exist (from either .harness/ or the older codex/ directory) but .harness/state.json does not, the script captures those markdown files into state archives before rendering the new state-backed versions. This prevents silent knowledge loss during upgrade.
Anti-Patterns
- Running bootstrap once and never syncing again
- Editing markdown views while ignoring
state.json - Letting
memory.mdorprompt.mdgo stale - Allowing
plan.mdandchecklist.mdto drift apart - Replacing explicit unknowns with generic TODO-only stubs
- Removing historical context without a summary
Resources
scripts/
scripts/init_docs.py: bootstraps and continuously syncs.harness/state.jsonplus the rendered markdown files.


