agentleFS
troskatertroskater/flowdeck-claude/skills/arch-constraint-guard/SKILL.md

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`.

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

    Before writing any file, check if the edit violates architectural boundaries defined in <fd>/.codebase/CONSTRAINTS.md.

    line 11
  2. Very specific:

    Create <fd>/.codebase/CONSTRAINTS.md to encode your team's architectural rules:

    line 15
  3. Very specific:

    Check the target file path against ## Forbidden Paths

    line 43
  4. Very specific:

    Check the import graph against ## Layer Rules

    line 44
  5. Very specific:

    Check method signatures against ## Service Contract Rules

    line 45
  6. Distinctive:

    If any violation is found: STOP, report the specific rule violated, and suggest a compliant alternative

    line 46
  7. Very specific:

    If <fd>/.codebase/CONSTRAINTS.md does not exist:

    line 50

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

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

<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 only

Workflow

For every proposed write or edit:

  1. Read <fd>/.codebase/CONSTRAINTS.md
  2. Check the target file path against ## Forbidden Paths
  3. Check the import graph against ## Layer Rules
  4. Check method signatures against ## Service Contract Rules
  5. 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:

  1. Infer boundaries from ARCHITECTURE.md (layer names, service boundaries)
  2. Apply common-sense defaults: UI does not directly query DB, domain does not call HTTP
  3. 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]

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.