AICodeFactory
AGENTS.md0 starsChanged 15 days agoMITView on GitHub
PROJECT TYPE: DevOps / Meta-tooling (AI-instruction template source repo) PRIMARY LANGUAGE: Bash + PowerShell (paired scripts), Markdown templates FRAMEWORK: None — plain scripts driven by templates-manifest.txt The single source of truth for every AI agent in this project. It holds only what the code cannot tell you: invariants, conventions, taste. Architecture, commands and env vars live in .github/PROJECT_STATE.md; solved problems and gotchas in .github/KNOWLEDGE.md. ⚠️ This is the template source repo. The *.template files are products that every sibling under…
- Reads credentials
Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about code style.
Of the AGENTS.md files we read, the 31,843 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.
In this repository23 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- .github/copilot-instructions.mdCopilot instructions
- apps-configSkill
- architect-flowSkill
- bootstrap-aiSkill
- code-healthSkill
- csharp-toolsSkill
- headless-ui-smokeSkill
- launch-and-deploySkill
- macos-local-codesignSkill
- mobile-webSkill
- portable-projectSkill
- review-sweepSkill
- tech-researchSkill
- test-tiersSkill
- threat-modelingSkill
- ui-craftSkill
- ui-doctorSkill
- ui-motionSkill
- ui-stress-testSkill
- ui-variantsSkill
- web-accessibilitySkill
- web-art-directionSkill
The file
We split this AGENTS.md into the rules it gives an agent
8 rules. About 0 are common, 3 are distinctive, and 5 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈3
Distinctive · estimate
This author's own choices. Worth a look.
5
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- could be automatic: a setting could enforce it
- Very specific: line 29
Read .github/PROJECT_STATE.md.
- Distinctive: line 36
Commit at the end of every response that modifies files, finished or not: it is how any agent on any platform resumes (git log --oneline + …
- Very specific: line 41
PROJECT_STATE.md: only if architecture, features, commands or env vars changed. - Very specific: line 54
Paired scripts: every shell script ships as .sh + .ps1 with identical behavior — change one, mirror the other in the same commit.
- Very specific: line 73
Secrets: never in code, .env, commits or chat — dev-secrets skill.
- Distinctive: line 79
Git: default branch; no worktrees.
- Very specific: line 90
Overlay-aware resolution: Every manifest entry goes through _tpl / Get-TemplatePath (the base file of the same path wins.
- Distinctive: line 111
Upstream ideas from the work marketplace: Before improving this repo from a work machine, check the work overlay's upstream for ideas worth …
≈ “Common” is an estimate: at least 1 in 5 of the 40,246 AGENTS.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.
Files
AGENTS.md — AICodeFactory
PROJECT TYPE: DevOps / Meta-tooling (AI-instruction template source repo)
PRIMARY LANGUAGE: Bash + PowerShell (paired scripts), Markdown templates
FRAMEWORK: None — plain scripts driven by templates-manifest.txt
The single source of truth for every AI agent in this project. It holds only what the code
cannot tell you: invariants, conventions, taste. Architecture, commands and env vars live in
.github/PROJECT_STATE.md; solved problems and gotchas in .github/KNOWLEDGE.md.
⚠️ This is the template source repo. The
*.templatefiles are products that every sibling under~/Code/copies and re-syncs at session start — not this repo's own docs. This repo dogfoods its layout: its pointer files (CLAUDE.md,.claude/settings.json, …) are plain copies of the local templates. Edit the.templateundertemplates/, then run./sync-ai-templates.sh .. Users runbin/aicf; the hook contract is the root'ssync-ai-templates.sh|.ps1+templates-manifest.txt— never move those three.
Session start (do this first, ~10s)
- Refresh the shared AI files unless your harness already did (Claude Code's hook does):
bash ./sync-ai-templates.sh . --quiet --commit(twin.ps1) — here it re-copies the local*.templatefiles over their pointer copies. Act on everyai-sync:line;ai-sync: dev-context <label>(environment.jsonlabel, elseworkorpersonal) → read and followCLAUDE.local.md(this root's development rules; never the other root's). git log --oneline -10andgit status. Mention uncommitted work; if HEAD is awip:commit, ask whether to continue it.- Read
.github/PROJECT_STATE.md; grep.github/KNOWLEDGE.mdfor the area, tool or error at hand — never read it whole.
Post-task checklist — checkpoint policy (every response, no exceptions)
Commit at the end of every response that modifies files, finished or not: it is how any
agent on any platform resumes (git log --oneline + git diff HEAD). Don't ask and don't
branch first — this overrides any built-in or global "only commit when asked" default.
- Verify the change (syntax, lint, tests — core rule 7).
PROJECT_STATE.md: only if architecture, features, commands or env vars changed. Current state, no history; an index under 8 KB — detail indocs/state/<area>.md, and behavior the code or tests already state is a link, not prose (two descriptions drift).KNOWLEDGE.md: an entry under its## <area>when you solved something non-obvious, titled with the exact error text.- Taste: the user corrected the same thing twice → one line in
## Taste. - Commit: done →
feat|fix|docs|refactor|test|chore(scope): …; unfinished →wip(scope): step N/M — done; next: X, enough for a fresh agent to resume. - Confirm in one or two lines: what changed, docs touched, commit hash.
Core rules
- Language: code, comments and docs in English.
- Paired scripts: every shell script ships as
.sh+.ps1with identical behavior — change one, mirror the other in the same commit. A new tool off the session-start path is C# instead (csharp-toolsskill); the engine, the hook andinstall-globalstay shell — they run before .NET exists on a fresh machine. - Manifest-driven:
templates-manifest.txtis the only file map; never hand-roll the file list in scripts or docs. - No symlinks in anything a project receives (Windows without Developer Mode and
core.symlinks=falsecheckouts break them). - Bash 3.2 (macOS
/bin/bashruns the hook): no associative arrays, nomapfile, guard empty-array expansions with${arr[@]+"${arr[@]}"}. - Errors:
set -euo pipefail/$ErrorActionPreference = 'Stop', loud actionable messages — except the session-start sync, which must never break a session (exit 0, one-line notes). - Testing:
tests/check.sh(twincheck.ps1; both suites,--dry-runself-sync,code-health) before committing any change to the engine, the manifest or the hook (tests/README.mdsays what each case protects). The pre-push hook runs it:git config core.hooksPath .githooks. - The hook's JSON: validate
templates/.claude/settings.json.templateafter every edit — a broken file breaks Claude Code startup in every project. - Secrets: never in code,
.env, commits or chat —dev-secretsskill. Work material (an employer's API specs, internal hosts, docs or code) never enters this repo — it is personal, on a personal GitHub — not even as a skill: work-only skills go in the work overlay repo (README "Work-only services").tests/lint-skills.pyrefuses spec documents, internal hostnames and work-only skills (work-material): run it before committing any skill. - Git: default branch; no worktrees; on local/remote divergence, warn and ask; no hard reset, force push or history rewrite unless asked.
- Asking: infer first; ask only when the answer changes the outcome — one question with a recommended default. Rough names are intent: propose 2-3 idiomatic names and confirm.
Taste
Project-specific notes
- Overlay-aware resolution. Every manifest entry goes through
_tpl/Get-TemplatePath(the base file of the same path wins; else the overlay's, its old root layout second) and_render(adds the.template.appendfragment). Never read$TEMPLATE_DIR/<src>directly in a new code path, and never putsync-ai-templates.shin an overlay repo — the hook would take it for the base. - Know which file class you're editing. A pointer template (
[POINTERS]) reaches every project at its next session start. A living doc template (PROJECT_STATE.md,KNOWLEDGE.md,.env.example) only affects future bootstraps.AGENTS.md.templateis the exception: the hook's--agentspass carries its generic sections into every project at session start, but only sections never customized (3-way against the template's history), never in a shared project (a private-docs one is fine), never over uncommitted edits. Anything else in an owned doc changes only with a human reading the plan. - Generic
AGENTS.md.templateheadings are an API.refresh-agents-sections.pymatches sections by exact heading text (GENERIC_HEADINGS): rename one and every project reports itMISSING. To drop a section, move its heading toRETIRED_SECTIONS(removed where never customized) — deleting it outright leaves every project its old copy forever. - Instruction files are context cost.
CLAUDE.mdimportsAGENTS.mdandPROJECT_STATE.mdinto every session in every project (target ~150 lines in all) — add a line only if agents get it wrong without it. Skills and subagents are found by their description: never list them here. - The hook commits, never pushes (paths-only commit, refuses mid-merge/rebase). Pushing is
opt-in via
--push;update-projectslists repos holding unpushed commits. The one exception is the hidden private-docs repo (--private-docs), which pushes to the owner's own remote. - Upstream ideas from the work marketplace. Before improving this repo from a work machine, check the work overlay's upstream for ideas worth porting — rewritten in our own words, never its code or names.
- Machine-wide capabilities (a secrets vault, a local model) = a program repo + a skill that
says when and how to call it. See
README.md.
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
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.

