Skip to main content

Backend Guidelines (reference)

The full file inventory for a backend module's overview/ guidelines — what the backend architect produces, who reads each file, and how the files come into being. For the overview, the override levers, and the content principles, see Project Guidelines.

Backend guidelines live per module at:

.swifter/specs/{module}/overview/

They are produced by swifter-backend-architect:create-guidelines — a thin command that invokes the update-architecture-guidelines skill, which is the real 10-step orchestrator. (The database architect, swifter-database-architect, has a parallel create-guidelines of the same shape.)

The 16-file set

create-guidelines produces 16 files: 8 core + CODING_GUIDELINES.md + 7 NFR files. The set is read by backend analyst, backend developer, and tester.

Every file shares a single hard limit of 200 lines (the SWFT copyright header on line 1 counts toward the budget). There is no per-file budget variation — the cap is uniform and is paired with dense-formatting rules (tables over prose, no blank rows, omit empty sections).

FileWhat it pinsRead byHand-edit
STACK.mdTechnology stackAnalyst · Developer · TesterEasy
STRUCTURE.mdDirectory layoutAnalyst · Developer · TesterEasy
ARCHITECTURE.mdArchitecture layersAnalyst · Developer · TesterEasy
CONVENTIONS.mdNaming, code conventionsAnalyst · Developer · TesterEasy
TESTING.mdTesting strategyAnalyst · Developer · TesterEasy
INTEGRATIONS.mdIntegration patternsAnalyst · Developer · TesterEasy
CONCERNS.mdCross-cutting concernsAnalyst · Developer · TesterEasy
PITFALLS.mdKnown pitfallsAnalyst · DeveloperEasy
CODING_GUIDELINES.md8-row capstone of binding coding rules, synthesised from the 8 core + 7 NFR filesAnalyst · DeveloperDerived — shape its inputs + the gate
nfr/NFR_PERFORMANCE.mdTimeouts, retry, cacheAnalyst · DeveloperGate — NFR-scope step
nfr/NFR_SCALABILITY.mdScaling, pooling, rate limitingAnalyst · DeveloperGate — NFR-scope step
nfr/NFR_SECURITY.mdAuth, authorization, PIIAnalyst · DeveloperGate — NFR-scope step
nfr/NFR_AVAILABILITY_RELIABILITY.mdHealth probes, circuit breakersAnalyst · DeveloperGate — NFR-scope step
nfr/NFR_USABILITY_ACCESSIBILITY.mdWCAG, i18n / l10nAnalyst · DeveloperGate — NFR-scope step
nfr/NFR_MAINTAINABILITY.mdObservability, error formatAnalyst · DeveloperGate — NFR-scope step
nfr/NFR_AUDITABILITY_LOGGING.mdAudit trail, structured loggingAnalyst · DeveloperGate — NFR-scope step

Which skill writes what

SkillWrites
generate-foundational-guidelinesSTACK.md, STRUCTURE.md
generate-core-guidelinesARCHITECTURE.md, CONVENTIONS.md, TESTING.md, INTEGRATIONS.md, CONCERNS.md, PITFALLS.md
generate-nfr-guidelinesthe 7 nfr/NFR_*.md files
generate-coding-guidelinesCODING_GUIDELINES.md (the 8-row capstone)

The 6-topic confirmation gate

Before generating on an amendment round, the orchestrator drives a blocking 6-topic confirmation gate:

  1. architecture (approach)
  2. locations (codebase locations)
  3. suggestions
  4. pitfalls (pitfall mitigations)
  5. nfr (NFR scope)
  6. principles (mandatory principles)

This is the primary place the team shapes backend content. On a fresh first run (no prior artifacts) the gate is skipped — there's nothing to refine yet.

Regeneration model

update-architecture-guidelines distinguishes three startup states:

  • Fresh round 1 (no archives) — generate all 16 from a codebase scan; no scope gate.
  • Mid-round resume (status: in_progress) — resume at the live current_step.
  • Amendment round (round archives present) — run the scope gate first, then refresh.

On every round the architect scans the codebase and the existing overview files and re-runs the generate-skills. There is no per-file "preserved vs overwritten" distinction — all 16 are (re)produced, with existing content fed back in as input. Practical consequences:

  • CODING_GUIDELINES.md is derived from the 8 core + 7 NFR docs — hand-edits are re-synthesised away. Edit its inputs instead.
  • NFR content is shaped through the NFR-scope gate step, not by hand-editing nfr/*.md.
  • Per-layer rule files at overview/coding-rules/{folder}.{artifact_type}.md are authored by the developer plugin (generate-coding-rules), not the architect. The architect's final step only edits them in place to eliminate drift and never creates new ones.
  • No module-type guard. Nothing validates the target module type before generating — create-guidelines will produce the 16-file set against whatever module it's pointed at, so run it on the module whose backend guidelines you actually want.

Reader matrix

File(s)Backend analystBackend developerTester
STACK, STRUCTURE, ARCHITECTURE, CONVENTIONS, TESTING, INTEGRATIONS, CONCERNS
PITFALLS
CODING_GUIDELINES
7 × NFR
  • The backend analyst reads every file in overview/ and overview/nfr/ (globs and reads all, no pre-filter).
  • The backend developer reads the core files it names plus all 7 NFR files when present.
  • The tester reads 7 of the 8 core (everything except PITFALLS) and none of the NFRs or CODING_GUIDELINES — see Tester Guidelines.