agentleFS
imMamdouhaboammarimMamdouhaboammar/agent-kernel/.claude/skills/architecture-guardian/SKILL.md

architecture-guardian

Skill5 starsChanged 4 months agoMITView on GitHub

Use in Claude Code before non-trivial features, refactors, cross-module fixes, new capabilities, dependencies, schema changes, public API changes, or contract-governed edits. Requires discovery, reuse-first search, reviewed scope, baseline-aware classification, and a final architecture check.

2 other projects use a version of this.

Adopted by

Most recently taken up by

The file

Show its rules and text

We split this skill into the rules it gives an agent

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

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈12

    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:

    Read CLAUDE.md, AGENTS.md, and the current architecture policy.

    line 15
  2. Distinctive:

    Search reuse candidates before creating a parallel capability.

    line 18
  3. Distinctive:

    Create or validate a change contract for non-trivial work.

    line 19
  4. Distinctive:

    Keep Write, Edit, and MultiEdit operations inside the reviewed scope.

    line 20
  5. Very specific:

    Run agent-kernel architecture check .

    line 21
  6. Distinctive:

    Use only scoped, owned, expiring exceptions.

    line 23
  7. Distinctive:

    Do not enable strict mode before policy, baseline, contract, and exception review.

    line 47
  8. Distinctive:

    Do not create a second source of truth without evidence.

    line 51
  9. Distinctive:

    Do not move business rules into UI, transport, persistence, provider, or framework layers.

    line 52
  10. Distinctive:

    Do not bypass a public interface to reach infrastructure.

    line 53
  11. Distinctive:

    Do not broaden a contract because implementation drifted.

    line 54
  12. Distinctive:

    Do not let a hook mutate policy, approve exceptions, or publish memory.

    line 55
  13. Distinctive:

    Do not treat baseline findings or expired exceptions as authorization for new violations.

    line 56
  14. Very specific:

    Read docs/ARCHITECTURE_GUARDIAN.md,

    line 58

≈ “Common” is an estimate: at least 1 in 5 of the 364,980 skill 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
SKILL.md

Architecture Guardian for Claude Code

The canonical workflow lives in skills/architecture-guardian/SKILL.md.

Required sequence

  1. Read CLAUDE.md, AGENTS.md, and the current architecture policy.
  2. Run agent-kernel architecture doctor . --json.
  3. Run agent-kernel architecture discover . --json.
  4. Search reuse candidates before creating a parallel capability.
  5. Create or validate a change contract for non-trivial work.
  6. Keep Write, Edit, and MultiEdit operations inside the reviewed scope.
  7. Run agent-kernel architecture check . --json before commit.
  8. Separate baseline debt from new regressions.
  9. Use only scoped, owned, expiring exceptions.
  10. Capture repeated architecture failures as Failure Lessons.
agent-kernel architecture reuse "<capability>" . --json
agent-kernel architecture contract init . \
  --task "<task>" \
  --owner "<owner>" \
  --allow "src/area/**,test/area/**" \
  --expect "src/area/file.ts,test/area/file.test.ts" \
  --tests "<behavior>"
agent-kernel architecture check . --json

Claude scope hook

Configure a narrow PreToolUse hook for Write|Edit|MultiEdit that calls agent-kernel-architecture-hook.

Review mode reports without denying. Strict mode is explicit:

AGENT_KERNEL_ARCHITECTURE_MODE=strict agent-kernel architecture check . --json

Do not enable strict mode before policy, baseline, contract, and exception review.

Hard boundaries

  • Do not create a second source of truth without evidence.
  • Do not move business rules into UI, transport, persistence, provider, or framework layers.
  • Do not bypass a public interface to reach infrastructure.
  • Do not broaden a contract because implementation drifted.
  • Do not let a hook mutate policy, approve exceptions, or publish memory.
  • Do not treat baseline findings or expired exceptions as authorization for new violations.

Read docs/ARCHITECTURE_GUARDIAN.md, docs/architecture-guardian/COMMAND_REFERENCE.md, and docs/hooks/CLAUDE_HOOKS_BEST_PRACTICES.md.

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.