arch-constraint-guard
Skill0 starsChanged 24 days agoMITView on GitHub
Block edits that violate known system boundaries, team rules, service contracts, or domain-layer separation. Reads rules from `<fd>/.codebase/CONSTRAINTS.md`.
In this repository32 other files it gives its agents.
- .claude/CLAUDE.mdCLAUDE.md
- api-designSkill
- backend-patternsSkill
- clean-architectureSkill
- codebase-mappingSkill
- context-budgetSkill
- cqrsSkill
- ddd-architectureSkill
- debug-flowSkill
- dependency-auditSkill
- django-patternsSkill
- django-tddSkill
- event-driven-architectureSkill
- fd-codenavSkill
- fd-mapSkill
- frontend-patternSkill
- git-releaseSkill
- git-workflowSkill
- golang-patternsSkill
- hexagonal-architectureSkill
- java-patternsSkill
- layered-architectureSkill
- performance-profilingSkill
- postgres-patternsSkill
- python-patternsSkill
- refactor-guideSkill
- research-firstSkill
- rust-patternsSkill
- saga-architectureSkill
- security-scanSkill
- tdd-workflowSkill
- test-gap-detectorSkill
The file
We split this skill into the rules it gives an agent
7 rules. About 0 are common, 1 is distinctive, and 6 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈1
Distinctive · estimate
This author's own choices. Worth a look.
6
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 11
Before writing any file, check if the edit violates architectural boundaries defined in <fd>/.codebase/CONSTRAINTS.md.
- Very specific: line 15
Create <fd>/.codebase/CONSTRAINTS.md to encode your team's architectural rules:
- Very specific: line 43
Check the target file path against ## Forbidden Paths
- Very specific: line 44
Check the import graph against ## Layer Rules
- Very specific: line 45
Check method signatures against ## Service Contract Rules
- Distinctive: line 46
If any violation is found: STOP, report the specific rule violated, and suggest a compliant alternative
- Very specific: line 50
If <fd>/.codebase/CONSTRAINTS.md does not exist:
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 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.
Files
<fd> is this project's FlowDeck directory, the one fd-state path prints (~/.fd-plan/<project>/, or <project>/.fd-plan/ when the storage setting is project).
Architectural Constraint Guard
Before writing any file, check if the edit violates architectural boundaries defined in <fd>/.codebase/CONSTRAINTS.md. If it does, stop and explain the violation.
CONSTRAINTS.md Format
Create <fd>/.codebase/CONSTRAINTS.md to encode your team's architectural rules:
## Forbidden Paths
- src/core/ # do not modify core — all changes via PR with 2 approvals
- src/generated/ # auto-generated, do not edit manually
- infra/secrets/ # managed by Terraform only
## Layer Rules
- UI components MUST NOT import from services/ directly — use hooks/ or context/
- services/ MUST NOT import from routes/ — services are framework-agnostic
- domain/ MUST NOT import from infra/ — keep domain pure
## Service Contract Rules
- PaymentService API is frozen — no method signature changes without RFC
- UserSchema is owned by auth-team — no schema changes without approval
## Naming Conventions
- React components: PascalCase only
- Database tables: snake_case only
- API endpoints: kebab-case onlyWorkflow
For every proposed write or edit:
- Read
<fd>/.codebase/CONSTRAINTS.md - Check the target file path against
## Forbidden Paths - Check the import graph against
## Layer Rules - Check method signatures against
## Service Contract Rules - If any violation is found: STOP, report the specific rule violated, and suggest a compliant alternative
When No CONSTRAINTS.md Exists
If <fd>/.codebase/CONSTRAINTS.md does not exist:
- Infer boundaries from ARCHITECTURE.md (layer names, service boundaries)
- Apply common-sense defaults: UI does not directly query DB, domain does not call HTTP
- Suggest creating CONSTRAINTS.md to codify the rules you discover
Violation Report Format
ARCH CONSTRAINT VIOLATION
Rule: [rule name from CONSTRAINTS.md]
File: [target file]
Violation: [what was attempted]
Compliant alternative: [what to do instead]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.

