agentleFS
shivae372shivae372/claude-bootstrap/CLAUDE.md

claude-bootstrap

CLAUDE.md1 starsChanged 7 months agoApache-2.0View on GitHub

Context for Claude (and humans) working inside this repository. If you're an end user who ran the installer in your own project, this file isn't yours — your generated CLAUDE.md is. CI (.github/workflows/ci.yml) runs the suite on Linux + macOS for every push and PR.

  • Pipes a download into a shell

The file

We split this CLAUDE.md into the rules it gives an agent

4 rules. About 0 are common, 2 are distinctive, and 2 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈2

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 2

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Never gate PreCompact logic on a tool name.

    line 30
  2. Very specific:

    Write paths differ: Write→content, Edit→new_string, MultiEdit→edits[].new_string.

    line 32
  3. Very specific:

    Every skill directory has a SKILL.md with name + description.

    line 36
  4. Distinctive:

    Prefer a hook over a CLAUDE.md "NEVER" rule — hooks are 100% reliable, prose ~70%.

    line 40

≈ “Common” is an estimate: at least 1 in 5 of the 26,980 CLAUDE.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
CLAUDE.md

claude-bootstrap — Repo Guide

Context for Claude (and humans) working inside this repository. If you're an end user who ran the installer in your own project, this file isn't yours — your generated CLAUDE.md is.

What this project is

A tool that installs a professional Claude Code setup into any project. Philosophy: deterministic core, AI for judgment. A real installer does the reliable work; the LLM is only used for optional, interactive tailoring (the /bootstrap command).

Architecture

  • install.sh — the entry point. Detects stack, resolves tier, backs up, copies components, renders CLAUDE.md, writes SESSION_STATE.md + .claude/.bootstrap.json, validates. Runs via curl | bash (self-downloads the library) or from a clone. Zero LLM calls.
  • scripts/render.py — pure substitution: tier template + detected facts → final CLAUDE.md.
  • scripts/validate.sh — verifies a setup (agents/skills/commands/hooks/JSON); --quiet/--json.
  • scripts/format.sh — manual multi-language formatter. scripts/bootstrap.sh — shim → install.sh.
  • .claude/ is the component library that gets copied into user projects:
    • agents/ one job each, read-only unless they must write.
    • skills/ every dir MUST contain SKILL.md (a skill without it does not load).
    • commands/ slash commands (/plan, /review, /ship, …).
    • hooks/ shell guardrails (see contracts below).
    • settings.json wires hooks to events.
  • docs/stacks/* per-stack reference; docs/templates/<tier>/ tier templates; docs/FORMATS.md specs.

Hook contracts (get these exactly right — past bugs lived here)

  • Hooks receive JSON on stdin, never positional args.
  • PreToolUse blocks with exit 2 and the reason on stderr (Claude reads stderr on block).
  • PreCompact payloads contain trigger/custom_instructions — no tool_name/tool_input. Never gate PreCompact logic on a tool name.
  • SessionStart injects context via JSON hookSpecificOutput.additionalContext.
  • Write paths differ: Write→content, Edit→new_string, MultiEdit→edits[].new_string.

Hard rules

  • One agent = one job; scope its tools; route read-only work to Haiku.
  • Every skill directory has a SKILL.md with name + description.
  • CLAUDE.md (this one and generated ones) stays ≤150 lines.
  • Single source of truth for the repo URL: REPO_OWNER/REPO_NAME in install.sh (owner is shivae372 — a wrong owner is what made the old installer 404).
  • Prefer a hook over a CLAUDE.md "NEVER" rule — hooks are 100% reliable, prose ~70%.

Testing (always before committing)

bash tests/run.sh          # full suite: syntax, hooks, detection, install e2e, regressions
bash scripts/validate.sh   # validate this repo's own .claude/

CI (.github/workflows/ci.yml) runs the suite on Linux + macOS for every push and PR.

Conventions

  • Bash: #!/usr/bin/env bash, set -uo pipefail, GNU/BSD-portable sed, no /dev/fd process substitution (some sandboxes lack it — use temp files).
  • Commits: conventional (feat:, fix:, docs:…). Keep VERSION and CHANGELOG.md in sync on release.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.