Skip to content

System Architecture Overview

The architecture section is not the site's primary narrative. It is the proof layer behind the rule atlas: root .mdc files are the source of truth, scripts validate and generate catalog assets, and Pages explains those rules to readers.

Core Design Principles

1. Root .mdc Files are the Product

The .mdc files in the repository root are the public contract. Filenames and paths are part of the contract, so they remain flat and are not moved to subdirectories.

Currently 26 rules covering 6 categories:

CategoryCountRule Files
General3clean-code, codequality, gitflow
Languages8python, java, go, cpp, csharp-dotnet, php, ruby, typescript
Backend3node-express, spring, fastapi
Frontend6react, vue, svelte, nextjs, tailwind, medusa
Mobile4android, ios, wechat-miniprogram, nativescript
Engineering2database, docker

2. Generative Architecture

The documentation site is a projection of the rule files, not an independently maintained content copy:

  • scripts/validate-rules.mjs validates .mdc structure
  • scripts/lib/rule-processor.mjs parses, validates, and normalizes rules into catalog entries
  • scripts/build-rule-catalog.mjs generates rules.json, categories.json, and localized rule pages

3. Presentation Layer Separation

  • docs/.vitepress/ provides VitePress site configuration and theme
  • docs/public/assets/catalog.js (~570 lines) handles rule catalog display and interaction (vanilla JavaScript)
  • GitHub Pages is responsible for explanation, navigation, and search

Data Flow Architecture

Rule Activation Flow

When a developer opens a file in Cursor IDE, the rule activation flow is:

Design Constraints

ConstraintDescription
README doesn't maintain rule listOnly serves as entry point, avoids duplication
Pages doesn't maintain hand-written rule dataOnly consumes generated artifacts, ensures consistency
OpenSpec only records boundariesDoesn't repeat README content, maintains information density

Layered Rule Design

This repository uses layered rule design, where multiple rules matching the same file is expected behavior:

File TypeLanguage LayerFramework LayerUI Layer
*.tsxtypescript.mdcreact.mdc / nextjs.mdctailwind.mdc
*.pypython.mdcfastapi.mdc-
*.javajava.mdcspring.mdc-

This design allows rules to be combined as needed, rather than forcing single matching.

Further Reading

26 curated .mdc rules for better AI coding assistance.