Repo Structure
This page explains the initial file contract of a generated project repo and the checkpoints around bootstrap.
When goingninja-os/scripts/bootstrap-project.sh runs, it creates a goingninja-project-<slug> repo with the contract below.
This generated repo is the intended active baseline for a new product. The platform repos define the contract first, and the concrete product work continues from this generated starting point.
1. Generated Project Skeleton
The generated project starts with this minimum structure:
goingninja-project-<slug>/
├── README.md
├── PRODUCT_BRIEF.json
├── PRODUCT_BRIEF.md # rendered once by bootstrap, then maintained by CI on `main`
├── REQUIREMENTS.json
├── REQUIREMENTS.md # rendered once by bootstrap, then maintained by CI on `main`
├── ARCHITECTURE_REQUIREMENTS.json
├── ARCHITECTURE_REQUIREMENTS.md # rendered once by bootstrap, then maintained by CI on `main`
├── READINESS_GATE.json
├── READINESS_GATE.md # rendered once by bootstrap, then maintained by CI on `main`
├── AUDIT_STATE.json
├── AUDIT_STATE.md # rendered once by bootstrap, then maintained by CI on `main`
├── AGENTS.md
├── CLAUDE.md
├── GEMINI.md
├── PLAN.md
├── INVARIANTS.md
├── DECISIONS.md
├── STATE.json
├── DELTA.json
├── RISKS.json
├── STATE.md # rendered once by bootstrap, then maintained by CI on `main`
├── DELTA.md # rendered once by bootstrap, then maintained by CI on `main`
├── RISKS.md # rendered once by bootstrap, then maintained by CI on `main`
├── .claude/settings.json
├── .gemini/settings.json
├── .execution/bootstrap.state.json
├── .execution/credential-registry.json
├── scripts/check-project-state.mjs
├── scripts/render-state-views.mjs
└── .github/workflows/
├── pr-audit.yml
└── post-merge-state.yml
The contract is intentionally small:
- enough files to keep state and rules explicit
- not so many files that the template creates maintenance burden without adding real constraint clarity
2. What Each File Is For
| File | What belongs inside | What does not belong inside |
|---|---|---|
README.md |
short entry point for humans | internal reasoning dumps |
PRODUCT_BRIEF.json |
confirmed product brief and launch boundary | guessed scope or chat residue |
REQUIREMENTS.json |
explicit requirement set for the first launch slice, including blockers and exclusions | fuzzy or implied scope |
ARCHITECTURE_REQUIREMENTS.json |
derived runtime, auth, provider, deployment, and verification requirements | guessed architecture or drift from historical repos |
READINESS_GATE.json |
binary check whether the repo may leave briefing and enter planning |
prose-only comfort statements |
AUDIT_STATE.json |
current audit lane, scope class, frozen snapshot ref, and round counters | free-form audit notes |
AGENTS.md |
canonical shared repo contract | secrets or transient task notes |
CLAUDE.md, GEMINI.md |
thin vendor adapters that point back to shared repo truth | copied policy manuals |
PLAN.md |
intended scope, current active block, definition of done | audit findings or secrets |
INVARIANTS.md |
hard rules that must not drift | temporary debug notes |
DECISIONS.md |
durable technical decision log | chat history |
STATE.json |
current real state | prose explanation |
DELTA.json |
difference between intent and reality | free-form commentary |
RISKS.json |
explicit unresolved risks and contradictions | implementation code |
PRODUCT_BRIEF.md, REQUIREMENTS.md, ARCHITECTURE_REQUIREMENTS.md, READINESS_GATE.md, AUDIT_STATE.md, STATE.md, DELTA.md, RISKS.md |
rendered human views | machine-authoritative truth |
.claude/settings.json |
Claude-specific permission and tool policy | shared product policy |
.gemini/settings.json |
Gemini-specific context loading and behavior | shared product policy |
.execution/bootstrap.state.json |
resumable setup checkpoints | secrets |
.execution/credential-registry.json |
names, scopes, backends, and validation status of required credentials | token values |
scripts/check-project-state.mjs |
deterministic pre-merge validation of required JSON files and keys | product logic or renderer behavior |
scripts/render-state-views.mjs |
deterministic Markdown rendering from JSON state | product logic or external provisioning |
.github/workflows/pr-audit.yml |
pre-merge checks | post-merge publishing |
.github/workflows/post-merge-state.yml |
post-merge rendering on main |
feature-branch mutation |
Instruction adapter files and vendor settings surfaces are covered in Instruction Files.
Writer authority is defined in Tool Roles and Branches And Continuity. Local agents must not commit direct edits to rendered Markdown state views.
Minimal STATE.json shape today:
{
"updated_at": "2026-04-16T05:10:00+02:00",
"project": {
"name": "<PROJECT_NAME>",
"slug": "<PROJECT_SLUG>",
"github_repo": "<GITHUB_REPO>"
},
"phase": "briefing",
"status": "active",
"default_branch": "main",
"stack": {
"app": "sveltekit",
"deploy": "vercel",
"database": "neon"
},
"linked_resources": {
"vercel_project": "<VERCEL_PROJECT>",
"neon_project": "<NEON_PROJECT>",
"database_name": "<DATABASE_NAME>"
},
"deterministic_status": [
"repo_bootstrapped",
"instruction_contract_present",
"initial_commit_created",
"product_brief_pending",
"requirements_pending",
"architecture_requirements_pending",
"readiness_gate_pending"
]
}
3. Briefing Before Planning
Bootstrap does not mean the product is already defined.
The generated repo starts in briefing phase.
That phase exists to prevent one specific failure mode:
- filling product goal and scope from memory or from a historical repo instead of from an explicit brief
Only after PRODUCT_BRIEF.json is confirmed, REQUIREMENTS.json is confirmed, ARCHITECTURE_REQUIREMENTS.json is confirmed, and READINESS_GATE.json passes should the repo move into product-specific planning.
3a. Canonical Readiness Gate Inventory
The readiness gate IDs are fixed and shared:
| Gate ID | Meaning |
|---|---|
RG1 |
product brief confirmed |
RG2 |
requirements confirmed |
RG3 |
architecture requirements confirmed |
RG4 |
first launch slice explicit |
RG5 |
global rule gaps closed |
RG6 |
critical vendor assumptions verified |
RG7 |
preview and access contract explicit |
4. Bootstrap Phases
The bootstrap script in goingninja-os/scripts/bootstrap-project.sh is resumable.
| Phase | What happens | Checkpoint written |
|---|---|---|
| template copy | starter template is copied into the target path | template_copied |
| placeholder replacement | project name and slug placeholders are resolved | placeholders_replaced |
| repo initialization | git is initialized and state views are rendered once | git_initialized, state_rendered, initial_commit_created |
| GitHub wiring | optional remote creation and origin wiring |
github_repo_created, github_remote_configured |
| Vercel setup | optional project creation and local linking | vercel_project_created, vercel_linked |
| Neon setup | optional project and database creation | neon_project_created, neon_database_created |
Current checkpoint shape:
{
"template_copied": true,
"placeholders_replaced": true,
"state_rendered": true,
"git_initialized": true,
"initial_commit_created": true,
"github_repo_created": false,
"github_remote_configured": false,
"vercel_project_created": false,
"vercel_linked": false,
"neon_project_created": false,
"neon_database_created": false
}
5. Genesis Writer Vs Maintenance Writer
Two writing moments exist and they should not be confused.
- bootstrap is the genesis writer: it copies the template, renders the first Markdown state once, and records continuity in
.execution/bootstrap.state.json - branch work updates code, decisions, and JSON state
- CI on
mainis the maintenance writer for rendered Markdown state only
That means:
- bootstrap may create
PRODUCT_BRIEF.md,STATE.md,DELTA.md, andRISKS.mdonce - branch work should not hand-edit those files
- CI on
mainmay rewrite those files after merge
The canonical branch and continuity model lives in Branches And Continuity. The current proof boundary lives in Workflow And Proof.
5a. Audit State After Verification
After a slice is verified, the repo does not enter audit by memory or chat alone.
The audit path becomes explicit in AUDIT_STATE.json:
- the lane is named
- the scope class is declared
- the frozen snapshot ref is recorded
- normal, closure, and confirm rounds are counted
That file is what lets the audit-exit path stay mechanical instead of rhetorical.
6. Sources
Notes
- Implementation.
goingninja-os/templates/project-repo/andgoingninja-os/scripts/bootstrap-project.sh. - Implementation.
goingninja-os/templates/project-repo/STATE.json. - Implementation.
goingninja-os/scripts/bootstrap-project.shand the generated.execution/bootstrap.state.json.