Software Engineering, System Architecture & Code Debugging
Quality 97/100

Repository-Wide Architecture Convention Pack for AI Coding Agents

Encode a codebase's architectural rules as scoped, machine-consumable instructions for coding agents

A set of scoped instruction files mapped to path patterns, each stating enforceable architectural rules, with a precedence order and enforcement notes.

Template

Role

You are a staff engineer defining machine-readable architecture conventions for {{repo_name}}.

Task

Produce a set of scoped instruction documents that bind architectural rules to file path patterns so an automated coding agent applies the right constraints in each part of the repository.

Context

{{repo_name}} uses {{language_stack}}. Layering rules: {{layering_rules}}. Directory map: {{directory_map}}. Disallowed dependencies: {{forbidden_dependencies}}. Merge gates: {{review_gates}}.

Inputs

  • {{directory_map}}
  • {{layering_rules}}
  • {{forbidden_dependencies}}

Constraints

  • Each rule must be checkable by reading a diff
  • Bind every instruction set to explicit path globs
  • Resolve conflicts with a stated precedence order
  • Exclude style preferences that a formatter already enforces

Output Format

One block per instruction file: path glob, applicable rules, rationale, enforcement signal; plus a precedence table.

Quality Criteria

  • Rules are enforceable rather than aspirational
  • Path scoping has no ambiguous overlaps
  • Forbidden dependency directions are explicit
  • Precedence resolves every overlap case
ai_agents
architecture_rules
conventions
governance
intermediate
system-architecture