agentleFS
jimy-rjimy-r/agent-workspace-architecture/CLAUDE.md

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

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
  1. Very specific:

    Always branch: Never commit to main directly.

    line 13
  2. Distinctive:

    Every commit must be safe for a public audience.

    line 22
  3. Distinctive:

    When in doubt, generalise.

    line 32

≈ “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.

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

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 main directly. Branch protection blocks force-pushes and deletions and requires the redaction check 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 redaction CI 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 By field.
  • 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

  1. Scan the diff for the Privacy identifiers above. The automated scan runs in CI (redaction-check.yml).
  2. git diff, and eyeball every changed line.
  3. Conventional commit message.
  4. Run python scripts/gen_llms_full.py --check, and if the bundle is stale, regenerate it with python scripts/gen_llms_full.py and commit. Do the same with python scripts/gen_pattern_pages.py, which renders PATTERNS.md into the pages under docs/patterns/. Then run python scripts/check_freshness.py --fix and 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 only redaction is required, so --auto would merge past any of them red.
  5. Push your branch; open a PR using the template.
  6. 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 run gh pr merge <n> --auto --squash --delete-branch. --auto holds the merge until the required redaction check is green, so no PR lands before its scan has run. --author-email keeps 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 on main are blocked for everyone.
  7. 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.

  1. Merge the PR(s) first; tag the merged main.
  2. 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>".
  3. Versioning: minor bump for new content (a pattern, a module sync, a tour feature), patch for fixes, major only on repositioning.
  4. 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.
  5. CITATION.cff names the release it describes. Set its version and date-released in the PR that carries the release's CHANGELOG entry, before the tag is cut.
  6. 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.

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.