agentleFS
fernandoxavier02fernandoxavier02/engineering-context/skills/generate-rules/SKILL.md

generate-rules

Skill0 starsChanged 7 months agoMITView on GitHub

This skill should be used when the user asks to 'generate engineering rules', 'create architecture contract', 'write engineering principles', 'set up testing strategy', or 'create anti-pattern rules'. Generates 4 mandatory always-loaded engineering rules and vault cards adapted to the project's stack and architecture.

1 other project uses a version of this.

Adopted by

Most recently taken up by

  • Other versions1 project uses a version of this.

    Word for word · 0

    None found.

    Edited · 0

    None found.

    Wrote their own version · 1

    1. nurettincoban/ai-prd-workflow★ 317same name

    How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.

  • In this repository5 other files it gives its agents.

The file

We split this skill into the rules it gives an agent

6 rules. About 0 are common, 4 are distinctive, and 2 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈4

    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:

    Test type by layer table (adapted to project's test framework)

    line 44
  2. Distinctive:

    Test type by situation table (bug fix -> regression, new feature -> behavior, refactor -> existing suite)

    line 45
  3. Distinctive:

    Test directory structure (adapted to project)

    line 47
  4. Distinctive:

    NEVER use generic examples — use REAL names and paths from the codebase

    line 81
  5. Very specific:

    ALWAYS include ⛔ NUNCA section at top of each rule (compactation-safe)

    line 82
  6. Very specific:

    ALWAYS add vault triggers: SE [situation] -> vault:engineering/[card]

    line 83

≈ “Common” is an estimate: at least 1 in 5 of the 408,460 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

Generate Engineering Rules

Generate 4 mandatory always-loaded engineering rules and vault cards adapted to the project.

Prerequisites

  • PROJECT_PROFILE from detect-stack
  • ARCHITECTURE_MAP from map-architecture
  • Anti-pattern catalog from mine-anti-patterns

Rules to Generate

Rule 50: Architecture Contract

Create .claude/rules/50-architecture-contract.md:

  • ⛔ NUNCA section with forbidden imports (from ARCHITECTURE_MAP)
  • Layer diagram showing dependency direction
  • Dependency rules table (CAN import / CANNOT import)
  • Mandatory flows (from ARCHITECTURE_MAP)
  • Vault triggers: SE implementing [X] -> vault:engineering/adr-*

Rule 51: Engineering Principles

Create .claude/rules/51-engineering-principles.md:

  • ⛔ NUNCA section (no premature abstraction, no silenced exceptions, no YAGNI, no DRY violations)
  • SOLID table with REAL examples from the codebase (not generic)
  • DRY / YAGNI / KISS rules with concrete examples
  • Coupling detection rules
  • Error handling section (adapted to project's language)
  • Vault triggers for deep consultation

Rule 52: Testing Strategy

Create .claude/rules/52-testing-strategy.md:

  • ⛔ NUNCA section (no task without test, no silenced failures, no implementation-coupled tests, no continuing on regression failure)
  • Test type by layer table (adapted to project's test framework)
  • Test type by situation table (bug fix -> regression, new feature -> behavior, refactor -> existing suite)
  • Regression rules (THE MOST IMPORTANT — pytest/ equivalent after ANY change)
  • Test directory structure (adapted to project)
  • Vault triggers

Rule 53: Anti-Patterns

Create .claude/rules/53-anti-patterns.md:

  • ⛔ NUNCA table with anti-patterns found during scan
  • Evolution rule: when fixing bug without test -> MUST add entry + regression test + vault card
  • Vault triggers

Vault Cards

Generate in vault/engineering/:

CardContent
adr-001-[key-decision].mdMost important architectural decision
adr-002-[second-decision].mdSecond most important decision
layer-contract.mdDetailed import rules with code examples
pattern-srp-examples.md3 real SRP examples from codebase
testing-strategy-examples.mdExample of each test type in project's framework

Language Adaptation

Adapt code examples and patterns:

  • Python: pytest, pydantic, structlog, ValueError, ruff
  • TypeScript: jest/vitest, zod, typed error classes, eslint
  • Go: go test, stdlib, fmt.Errorf, sentinel errors, golangci-lint
  • Ruby: rspec, Rails conventions, custom exceptions, rubocop

Critical Rules

  1. NEVER use generic examples — use REAL names and paths from the codebase
  2. ALWAYS include ⛔ NUNCA section at top of each rule (compactation-safe)
  3. ALWAYS add vault triggers: SE [situation] -> vault:engineering/[card]

Detailed Templates

Rule templates with full examples are in references/templates.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.