agent-workspace-architecture
CLAUDE.md16 starsChanged 29 days agoMITView on GitHub
This file is auto-loaded when a Claude Code session opens in this repo. It's intentionally short; the full standards live in CONTRIBUTING.md. A curated reference for agent workspaces, with a worked example built in Claude Code: a redacted snapshot of one person's working setup, published so others can fork the patterns. The Claude-Code file conventions (CLAUDE.md, .claude/skills/, MCP config) are the substrate; the architectural patterns generalise to any agent system. Maintained solo and best-effort. Issues for corrections and concrete proposals,…
- Commits and pushes
In this repository3 other files it gives its agents.
- AGENTS.mdAGENTS.md
- docs/llms-full.txtllms.txt
- docs/llms.txtllms.txt
The file
We split this CLAUDE.md into the rules it gives an agent
3 rules. About 0 are common, 2 are distinctive, and 1 is 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.
1
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 13
Always branch: Never commit to main directly.
- Distinctive: line 22
Every commit must be safe for a public audience.
- Distinctive: line 32
When in doubt, generalise.
≈ “Common” is an estimate: at least 1 in 5 of the 29,248 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.
Files
CLAUDE.md — local context for contributors
This file is auto-loaded when a Claude Code session opens in this repo. It's intentionally short; the full standards live in CONTRIBUTING.md.
What this repo is
A curated reference for agent workspaces, with a worked example built in Claude Code: a redacted snapshot of one person's working setup, published so others can fork the patterns. The Claude-Code file conventions (CLAUDE.md, .claude/skills/, MCP config) are the substrate; the architectural patterns generalise to any agent system.
Maintained solo and best-effort. Issues for corrections and concrete proposals, PRs for changes. See PATTERNS.md for the reasoning behind the architecture.
Working principles
- Always branch. Never commit to
maindirectly. Branch protection blocks force-pushes and deletions and requires theredactioncheck to pass on PRs. The rules apply to admins as well, so no one can merge ahead of the check. - One focused change per PR.
- Conventional Commits.
feat:,fix:,docs:,refactor:,chore:. - Include a
Co-Authored-By:trailer for Claude-assisted commits. - Scan every changed file before you commit for the identifiers in the Privacy section below. The required
redactionCI check runs the automated scan on the PR (AGENTS.md, Hard rule: redaction). - Teardown pages pass the style bar before every commit. Anything under
teardowns/gets the full STYLE_GUIDE.md editing pass before commit — dash and compound-adjective density included. A teardown analyses someone else's published work, so its prose carries the repo's reputation harder than any other page.
Privacy — hard rule
Every commit must be safe for a public audience. Before git add, scrub every changed file for:
- Personal identifiers. Real names, emails, usernames tied to identity, home or workplace locations. The owner's byline in the README, changelog, style guide, site pages and teardown pages is the one deliberate exception, public by choice. On a teardown page it sits in the header's
Byfield. - Business / product specifics. Company names, product names, customer details tied to a real entity.
- Credentials, tokens, API keys. Ever, even as placeholders.
- Health, financial, or legal data. Ever.
- Absolute paths that reveal a user's machine layout.
Use generic placeholders: <workspace>, <home>, <project>, <workspace-id>, "the user", "a commercial password manager", "<PaaS>", "<cloud-provider>".
When in doubt, generalise. If Claude drafts content with identifying info, stop and rewrite before staging.
Follow the existing shape
- Roles. Schema in
samples/roles/_template.md(Identity / Directives / Constraints / Method / Output / Red Flags / Rationalization Table). - Skills. CSO-style description plus procedure. See
samples/.claude/skills/orient/SKILL.md. - Project context files. See
samples/CONTEXT.md.example. - Keep entity facts out of roles. Roles are pure; entity facts live in CONTEXT.md.
Scope boundaries
Some files need Issue agreement before a PR; see the Scope boundaries section in CONTRIBUTING.md. Everything else is fair game for direct PRs.
Before you push
- Scan the diff for the Privacy identifiers above. The automated scan runs in CI (
redaction-check.yml). git diff, and eyeball every changed line.- Conventional commit message.
- Run
python scripts/gen_llms_full.py --check, and if the bundle is stale, regenerate it withpython scripts/gen_llms_full.pyand commit. Do the same withpython scripts/gen_pattern_pages.py, which rendersPATTERNS.mdinto the pages underdocs/patterns/. Then runpython scripts/check_freshness.py --fixand commit any stamp it rewrites. The order matters, because a regenerated bundle or page needs a new stamp. These checks run on the PR, but onlyredactionis required, so--autowould merge past any of them red. - Push your branch; open a PR using the template.
- Queue the merge so it lands only after the checks pass. For the maintainer's own PRs:
gh pr merge <n> --auto --squash --delete-branch --author-email 4570080+jimy-r@users.noreply.github.com. Contributor PRs, once the maintainer has reviewed and approved them, drop the author flag and rungh pr merge <n> --auto --squash --delete-branch.--autoholds the merge until the requiredredactioncheck is green, so no PR lands before its scan has run.--author-emailkeeps the maintainer's squash commits on the GitHub noreply address, while a contributor's squash commit already carries the contributor as author. Force-pushes and deletions onmainare blocked for everyone. - Open the merged commit on GitHub and verify Mermaid / markdown rendered correctly. Any leak or render bug after merge means a follow-up commit; amending never fully erases a public mistake.
Releases — the ongoing ritual
Cut a tagged release after every milestone batch (roughly: any merge that earns its own dated CHANGELOG entry). Releases reach watchers' feeds and give the changelog stable anchors; an active Releases tab signals the repo is alive.
- Merge the PR(s) first; tag the merged
main. gh release create vX.Y.Z --title "vX.Y.Z — <short handle>" --notes "<3-6 lines: what changed and why it matters, pointing at the CHANGELOG entry>".- Versioning: minor bump for new content (a pattern, a module sync, a tour feature), patch for fixes, major only on repositioning.
- Release notes are public content. Same redaction bar and writing rules as files. Write them for a reader who has never seen the workspace, with a handle in the title and no internal audit or finding IDs in the body.
CITATION.cffnames the release it describes. Set itsversionanddate-releasedin the PR that carries the release's CHANGELOG entry, before the tag is cut.- A release's CHANGELOG heading links
compare/vPREV...vNEW, and that link is a 404 until the tag is cut. The link check on a PR skips this repo's compare links for that reason. The scheduled Monday run checks them once the tag exists.
Tone
Terse, structural, opinionated. No performative politeness. Disagreement welcome; keep it focused on the work.
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.

