| author | date | version | sources | |||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
Coty Beasley |
dec-2025 |
1.5.0 |
|
This document describes how to bootstrap a Claude Code–optimized project that integrates knowledge management, agentic workflows, and development practices, while supporting multiple encapsulated git worktrees running in parallel. The root repository acts as a stable template and shared knowledge spine. Each worktree owns its own plans, progress logs, and session handoffs, so branches can be created, updated, resumed, and cleaned up without collisions.
It also defines how to handle Architecture Decision Records (ADRs), research/plan/implement structures, and design decisions so that short-lived branch context can be promoted into long-lived project knowledge.
The default clone (main worktree) contains:
- Global, long-lived project instructions:
CLAUDE.md– how Claude should work in this repo.README.md– human overview and setup.
- Shared, relatively stable structures:
knowledge-base/**– domain ontologies and research.guides/**– methodology and standards.workflows/**– reusable process definitions.mcp-servers/**– shared tooling.schemas/**– validation contracts.manifest.toon– master registry..claude/**– agent tooling, hooks, and commands.docs/**– ADRs and cross-cutting design decisions (see below).
These are not used as per-branch scratchpads.
Every feature/task/report branch lives in its own worktree directory and carries:
PLAN.local.md– branch-specific plan.IMPLEMENTATION.local.md– branch-specific implementation details.SESSION.md– current session/handoff document..session/**– internal, branch-only state (notes, timeline, snapshots).active-project/**– if the branch represents a “project” with status/tasks/decisions.active-project/decisions.log– branch-level design decisions.active-project/research.md– branch-level research summary (optional).
This avoids collisions when multiple worktrees are edited simultaneously.
TOON manifests (*.toon) provide a semantic index for:
- Domains (
knowledge-base/domains/domain-manifest.toon). - Research (
knowledge-base/research/research-manifest.toon). - Guides (
guides/guides-manifest.toon). - Workflows (
workflows/workflows-manifest.toon). - Reports (
reports/reports-manifest.toon). - ADRs and design docs (
docs/docs-manifest.toon, see below).
Agents rely on manifests for discovery before loading full documents.
Domain knowledge is modeled using GraphQL SDL:
- Types, fields, and relationships live in
schema.graphqlfiles per domain. - Documentation files describe semantics, examples, and integration patterns.
- This gives LLMs a formal structure to reason over, beyond freeform docs.
Worktrees allow multiple branches to coexist on disk. Each worktree:
- Owns its local planning and session state files.
- Reads from the shared knowledge + templates.
- Promotes only stable artifacts (e.g. domain schemas, reports, workflows, ADRs) back into the root repo via PRs.
The .claude directory provides centralized agent configuration, lifecycle hooks, and command automation without storing per-branch state:
- Configuration files define agent defaults and worktree policies.
- Hooks automate worktree creation, resumption, and cleanup.
- Commands provide CLI entrypoints for common operations.
- Prompts store reusable prompt fragments for agent operations.
Design decisions follow a two-level model:
- Branch-level: Quick decisions logged in
active-project/decisions.loginside each worktree. - Project-level ADRs: Stable, cross-cutting decisions promoted into
docs/adr/ADR-XXXX-*.mdonce accepted.
Research/plan/implement structures exist both as:
- Global methods: Documented in
guides/and codified inworkflows/. - Per-branch execution: Implemented via
PLAN.local.md,IMPLEMENTATION.local.md,.session/**, andactive-project/**in each worktree.
Use these standard statuses:
-
Proposed
Drafted and under review. Not yet binding. -
Accepted
Approved and considered the current source of truth. New work should follow this decision. -
Rejected
Considered but explicitly not adopted. Kept for historical context. -
Superseded
Replaced by a newer ADR. The newer ADR must be linked.
Each ADR must declare its status near the top of the document.
Create an ADR for decisions that are:
- Cross-cutting (affecting multiple domains, systems, or teams).
- Hard to reverse or high-impact (e.g., storage formats, ontology strategy).
- Changing repo-wide conventions (manifests, worktree workflow, naming).
Local, low-impact decisions can stay in:
active-project/decisions.logIMPLEMENTATION.local.md
When a decision is changed:
- Create a new ADR describing the new decision.
- In the new ADR, add a Supersedes section linking to the old ADR.
- In the old ADR:
- Update
StatustoSuperseded. - Add a Superseded by link to the new ADR.
- Update
- Update any affected:
- Schemas (
*.schema.graphql) - Guides (e.g.,
ontology-design.md,worktree-workflow.md) - Workflows (
workflows/**)
- Schemas (
This keeps decision history linear, searchable, and machine-discoverable.
Use this example structure for reference:
project-root/
├── CLAUDE.md
├── README.md
├── manifest.toon
│
├── .claude/
│ ├── config/
│ ├── hooks/
│ ├── prompts/
│ ├── commands/
│ └── state/
│
├── templates/
│ ├── PLAN.template.md
│ ├── IMPLEMENTATION.template.md
│ ├── SESSION.template.md
│ ├── WORKFLOW.template.md
│ └── REPORT.template.md
│
├── docs/
│ ├── docs-manifest.toon # Registry for ADRs & design docs
│ ├── adr/
│ │ ├── ADR-0001-init-structure.md
│ │ ├── ADR-0002-use-toon-manifests.md
│ │ └── ADR-0003-use-graphql-sdl.md
│ └── design-decisions/
│ ├── knowledge-architecture.md
│ └── worktree-strategy.md
│
├── knowledge-base/
│ ├── domains/
│ │ └── design-systems/
│ │ ├── design-system.schema.graphql
│ │ ├── documentation.md
│ │ └── examples.json
│ └── research/
│ ├── research-manifest.toon
│ └── ...
│
├── guides/
│ ├── guides-manifest.toon
│ ├── research-methods.md
│ ├── data-analysis-patterns.md
│ ├── document-generation.md
│ ├── code-standards.md
│ ├── ontology-design.md
│ └── adr-process.md # How to write and promote ADRs
│
├── workflows/
│ ├── workflows-manifest.toon
│ ├── domain-onboarding.md
│ ├── add-new-report.md
│ └── record-design-decision.md # Workflow: when/how to create ADRs
│
├── mcp-servers/
├── reports/
│ ├── reports-manifest.toon
│ └── assets/figures/
│
├── schemas/
│ ├── manifest-schema.json
│ ├── workflow-schema.json
│ ├── project-plan-schema.json
│ ├── domain-extensions.schema.graphql
│ └── graphql-directives.schema.graphq
├── .gitignore
└── .git/
Each worktree, created for a feature/report/domain, contains:
proj-my-task/
├── SESSION.md # Current session & handoff
├── PLAN.local.md # Plan for this branch only
├── IMPLEMENTATION.local.md # Implementation details
├── CLAUDE.local.md # Optional branch-specific overrides
│
├── .session/
│ ├── meta.json
│ ├── timeline.md
│ ├── notes/
│ └── snapshots/
│
├── active-project/
│ ├── status.md
│ ├── tasks.md
│ ├── decisions.log # Branch-level design decisions
│ └── research.md # Branch-level research summary (optional)
│
├── knowledge-base/ # WIP domain changes (if any)
├── reports/ # WIP reports (if any)
├── src/ or app/ # Code, if this is a software project
└── (other project files on this branch)
The research/plan/implement pattern is:
- Research →
active-project/research.md,.session/notes/**. - Plan →
PLAN.local.md. - Implement →
IMPLEMENTATION.local.md,active-project/status.md,tasks.md, code changes.
ADRs live in project-root/docs/adr/ and follow a consistent template:
# ADR-0003: Use GraphQL SDL for Domain Ontologies
## Status
Accepted
## Context
[What problem this solves; alternatives considered]
## Decision
[Short description of the chosen approach]
## Consequences
- [Positive consequence]
- [Negative consequence]
- [Open questions]
## Related
- [Link to relevant branches/PRs]
- [Link to domain schemas or docs]
Within a worktree:
- Log decisions as they happen in
active-project/decisions.log:
# Decisions
## 2025-12-10 – Choose TOON for manifests
Context: [brief]
Decision: [brief]
Alternatives: [brief]
Impact: [brief]
When a decision is clearly cross-cutting and stable:
- Draft an ADR under
active-project/adr-drafts/ADR-XXXX-*.md(optional). - On merge, promote that file into
project-root/docs/adr/. - Update
docs/docs-manifest.toonwith a new ADR entry. - Reference the ADR from:
- Relevant domain docs in
knowledge-base/domains/**/documentation.md. guides/adr-process.mdif it affects decision practices.docs/design-decisions/*.mdfor higher-level narratives.
- Relevant domain docs in
Register ADRs and other design docs:
version: "1.0"
docs{id, title, type, path, status, tags}:[1]
adr-0001-init-structure
"Initialize Project Structure"
adr
./docs/adr/ADR-0001-init-structure.md
accepted
[architecture, repo, worktrees]
---
adr-0002-use-toon-manifests
"Use TOON for Manifests"
adr
./docs/adr/ADR-0002-use-toon-manifests.md
accepted
[manifests, storage, tokens]
---
knowledge-architecture
"Knowledge Architecture Overview"
design-doc
./docs/design-decisions/knowledge-architecture.md
informative
[knowledge-base, domains, manifests]
You can then add a docs-registry section to manifest.toon pointing at docs/docs-manifest.toon.
Global how-to lives in guides/:
guides/research-methods.md– how to run and synthesize research.guides/adr-process.md– when to write an ADR vs. keep a local decision.guides/document-generation.md– how to write high-quality reports.guides/worktree-workflow.md– how to use worktrees and local structures.
Branch-level execution lives in each worktree:
active-project/research.md– specific research done for that branch.PLAN.local.md– concrete plan for this branch.IMPLEMENTATION.local.md– implementation details and trade-offs.active-project/decisions.log– design decisions made while implementing.
This separation lets agents use global guides as instructions and local files as current state.
ADRs live in docs/adr/ and use the standard statuses (Proposed, Accepted, Rejected, Superseded) defined in guides/adr-process.md. That guide is the single source of truth for when to write an ADR, how to structure it, and how to promote local decisions into project-level records.
Ontology modeling, schema versioning, and deprecation rules are defined in guides/ontology-design.md. All *.schema.graphql files must follow those rules for semantic versioning, deprecation via @deprecated, and ADR-backed breaking changes.
Add a workflow workflows/record-design-decision.md to define when a decision should become an ADR:
# Workflow: Record Design Decision
## Purpose
Ensure important design decisions are captured, discoverable, and promoted when appropriate.
## Steps
### 1. Log Local Decision (Always)
- [ ] Add an entry to `active-project/decisions.log`:
- Date
- Context
- Decision
- Alternatives
- Impact
### 2. Evaluate for ADR (When Significant)
Decision deserves an ADR if:
- It affects multiple domains or systems.
- It changes how future worktrees should operate.
- It is hard to reverse or has large impact.
If **yes**:
- [ ] Draft ADR in `active-project/adr-drafts/ADR-XXXX-*.md` using ADR template.
- [ ] Reference relevant branches, PRs, and domain docs.
### 3. Promote ADR on Merge
Once the branch is merged:
- [ ] Copy ADR draft to `docs/adr/` and assign final ADR number.
- [ ] Update `docs/docs-manifest.toon`.
- [ ] Link ADR from:
- Relevant `knowledge-base/domains/**/documentation.md`
- `docs/design-decisions/*.md` if needed.
### 4. Update Global References (If Needed)
- [ ] Update `CLAUDE.md` if ADR changes how Claude should behave.
- [ ] Update guides or workflows impacted by the decision.
Add a docs registry to manifest.toon:
version: "1.0"
last_updated: "[TODAY'S DATE]"
description: "Master knowledge registry for [PROJECT NAME]"
registries{id, title, description, path, type}:[2]
domains-registry
"Domain Knowledge Manifest"
"GraphQL schemas and documentation for domain ontologies"
./knowledge-base/domains/domain-manifest.toon
domains
---
research-registry
"Research Manifest"
"Consolidated research findings and evaluations"
./knowledge-base/research/research-manifest.toon
research
---
guides-registry
"Guides Manifest"
"Methodology and how-to documentation"
./guides/guides-manifest.toon
guides
---
workflows-registry
"Workflows Manifest"
"Reusable workflow checklists"
./workflows/workflows-manifest.toon
workflows
---
docs-registry
"Docs & ADR Manifest"
"Architecture Decision Records and design documents"
./docs/docs-manifest.toon
docs
mcp_servers{id, name, description, manifest_path}:[3]
knowledge-access
"Knowledge Access"
"Domain schema querying and manifest parsing"
./mcp-servers/knowledge-access/manifest.json
-
Knowledge steward
Ownsknowledge-base/**, domain schemas, and research manifests. Reviews and approves changes to domain ontologies and research syntheses. -
Workflow steward
Ownsworkflows/**andguides/**. Approves changes to core workflows, conventions, and process documentation. -
Architecture steward
Ownsdocs/adr/**anddocs/design-decisions/**. Facilitates ADR proposals, approves status changes (e.g., Proposed → Accepted), and ensures ADRs are reflected in schemas/guides.
- Changes to:
manifest.toon,docs/docs-manifest.toon, and other registries require review from the knowledge or architecture steward.knowledge-base/domains/**schemas require knowledge steward review.guides/**andworkflows/**require workflow steward review.
- All such changes should be tied to:
- A worktree branch.
- At least one ADR (if impact is cross-cutting).
- A short rationale in the PR description.
- Create worktree for a feature/report/domain.
- Do research/plan/implement using:
active-project/research.md,PLAN.local.md,IMPLEMENTATION.local.md.active-project/decisions.logfor decisions.
- Draft ADRs in
active-project/adr-drafts/when decisions are cross-cutting. - Promote artifacts back to root on merge:
- Domain schemas/docs →
knowledge-base/domains/**. - Reports →
reports/**. - ADRs →
docs/adr/**anddocs/docs-manifest.toon. - Any global workflow/guide updates →
workflows/**,guides/**.
- Domain schemas/docs →
- Clean up worktree after promotion; local session state stays in branch history.
- Stewards: Assign owners for domains (
knowledge-base/**), workflows/guides, and ADRs/docs to review impactful changes. - Schema versioning: Each
*.schema.graphqlrecordsversionandlastUpdatedin a top-level comment and follows the semantic versioning and deprecation rules inguides/ontology-design.md. Breaking changes require an ADR and a major version bump. - ADR lifecycle: Use standard statuses (
Proposed,Accepted,Superseded,Rejected) and manage promotion/supersession viaguides/adr-process.md. Cross-cutting decisions must have ADR coverage, and superseding ADRs must link bidirectionally.