π―π΅ ζ₯ζ¬θͺη: README.ja.md
A scaffold for long-lived agents running on Claude Code / the Anthropic SDK. Machinery, structural templates, and a revision culture live in one base; each derived agent is spun up with
init-new-agent.shand shares improvements through two-way sync.
- An agent is persona + its own projects + machinery. The machinery is factored into this base; persona and projects stay in the derived repo β so machinery improvements are shared by every agent.
- A continuous self-reinforcement loop. Machinery quality is swept mechanically (
docs-check.sh/detect-duplicates.py/detect-stale-rules.sh); the agent only reacts to the output, spending no context on re-derivation. - Built to be published. Personal and workplace identifiers are blocked mechanically at the commit / push boundary by the machine-resident guard-dispatcher (a separate repo).
- Minimal constraints on derivations. The base owns only the machinery, the required rule file, and the structural templates; everything else is the derivation's free territory.
agent-template/
βββ LICENSE # Apache 2.0
βββ README.md / README.ja.md # this file + Japanese version
βββ .gitignore # the template repo's own gitignore
βββ .githooks/pre-commit # branch guard (anon scanning is delegated to guard-dispatcher)
βββ .tooling/local-ci/ # the template repo's own docs lint
β βββ docs-lint.sh
β βββ docs-check-ignore.txt
β βββ setup-lib.sh
βββ .tooling/ # template operation scripts
β βββ init-new-agent.sh # spin up a derivation
β βββ sync-from-base.sh # base β derivation (pull down)
β βββ promote-to-base.sh # derivation β base (promote up)
βββ .synced-paths.txt # the paths shipped down to derivations
βββ src/ # β
what a derived agent receives
βββ CLAUDE.template.md # becomes the derivation's CLAUDE.md (persona)
βββ .gitignore.template # expands to the derivation's .gitignore
βββ .tooling/ # machinery scripts (the truth that runs in derivations)
β βββ docs-check.sh # multi-axis docs verification
β βββ detect-duplicates.py # section-level duplicate detection
β βββ detect-stale-rules.sh # 7-day-stale rule detection
β βββ extract-artifact-index.sh # for a SessionEnd hook
β βββ first-prompt-pull.sh # multi-machine sync (optional)
β βββ precommit-conflict-check.sh
β βββ setup-hooks.sh # hook install
β βββ startup-status.sh # run at session boot
β βββ _README.md
βββ rules/
β βββ always.md # β
required: capacity management + revision culture + the loop
β βββ lazy/
β βββ _template.md # scaffold for new lazy rules
β βββ automation-machinery.md
βββ projects/_template-project/ # project scaffold (nested subprojects included)
βββ journal/ # session log structure
βββ todos/ # cross-cutting tasks
βββ plans/ # cross-cutting plans
βββ research/ # cross-cutting research
βββ profile/ # user profile structure
βββ profile-core.template.md
Everything under src/ is the derived agent's content; everything at the root operates the template itself. init-new-agent.sh rsyncs src/ into the derivation root and expands every *.template into a real file.
git clone git@github.com:synforger/agent-template.git
cd agent-template
./.tooling/init-new-agent.sh ~/path/to/<new-agent>Then, inside the derivation:
- Edit
CLAUDE.md(persona / user relationship / agent constellation) - Edit
profile/profile-core.md(your primary user's core + judgement axes) - Add your private vocabulary to the machine-side guard-dispatcher word list (
~/.config/anon-words/) - Add derivation-specific rules to
rules/always.md(git conventions, prohibitions, and so on) git remote add origin <your-repo>and push
When a derivation wants the latest base:
cd ~/path/to/<your-agent>
./.tooling/sync-from-base.shOnly the paths listed in .synced-paths.txt are overwritten with the base version; derivation-specific files are never touched. Review with git diff, then commit.
When a derivation discovers a machinery improvement worth sharing:
cd ~/path/to/<your-agent>
./.tooling/promote-to-base.sh "feat: add a new docs-check step"This cuts a feature branch on the base, pushes it, and the change lands via a pull request. Files outside .synced-paths.txt are rejected.
- Always run
sync-from-base.shbefore promoting (resolve conflicts on the derivation side). - If a derivation wants to override a base file permanently, the policy is the derivation's choice: keep a differently-named local file, propose the change upstream via PR, or edit its local
.synced-paths.txtto exclude the path.
The template ships only these; below this floor the machinery stops working.
rules/always.md Β§ metaβ capacity management, revision culture, and the self-reinforcement loop (single-file form)rules/lazy/_template.mdβ scaffold for new lazy rulesrules/lazy/automation-machinery.mdβ operational truth for.tooling/*
Derivation-specific rules (git conventions, prohibitions, subagent discipline, anything else) go freely into the derivation's rules/always.md / rules/lazy/*.md; rule content is not synced.
Run at session end; any FAIL must be fixed within the same session. Verification axes (the script's own step output is the truth):
- frontmatter
- capacity (self-declared per file)
- index consistency (
_README.mdβ sibling .md files) - dead links
- leftover placeholders (unfilled scaffolds)
- dynamic-search-pattern residue
- project folder consistency
- synced-paths consistency (derivations only, diffed against base)
Compares every rule at H2/H3 section granularity via longest-common-substring and reports consolidation candidates for split truths. Pairs judged as intentional shared references go into .tooling/duplicates-allowlist.txt for permanent suppression β no re-judging every session.
No update for 7 days = retirement candidate. Files with frontmatter stable: true and _README.md files are excluded mechanically, so only genuine dead-rule candidates are reported.
Observe the same weakness twice, mechanise it immediately:
- Assess whether it is machine-detectable (grep / awk / python)
- If so, add a step to
docs-check.shor sharpen adetect-*script - If not, write it into
rules/always.md Β§ metaas discipline
The bar for "add a detector" is kept deliberately low β quality holds because the agent only has to react to machine output.
The base ships with zero concrete agent names or operator identifiers. Scanning itself lives in the machine-resident guard-dispatcher (a separate repo) and is enforced for every repo at the commit / push boundary; the word list lives in machine config (~/.config/anon-words/) and is never committed.
- Synforger β the organisation this template ships from
- Claude Code (Anthropic) β the harness this scaffold targets