Cline rules
.clinerules/routing-pattern.mdCline rules
Quality
65/100
Scores the file, not the repository.Length
232 words
6 headings · 1 code blocksRepository
0
— · pushed 0 days agoLast changed
2 days ago
First indexed 2 days ago.1# Routing Pattern23## Brief overview45Routes must be thin, declarative wrappers. All business logic lives in controllers.67## Rule: Thin Routes, Fat Controllers89- `routes/*.ts` export only thin handler functions — each handler is an `async (c: Context) => Response` function that delegates immediately to the corresponding controller in `controllers/`.10- `routes/index.ts` is 100% declarative — it imports all handlers and registers routes with `app.post('/', handler)` or `app.get('/', handler)` inside `registerRoutes(app)`. No business logic, no conditionals, no validation in the routing layer.11- No business logic, no conditionals, no validation in routes.1213## Anti-patterns to avoid1415- Do NOT add logic in route handlers — if you find yourself adding logic in a route handler, extract it to the corresponding controller.16- Do NOT put business logic in `routes/index.ts` — route registration should only import handlers and attach them to paths.1718## Example1920```typescript21// routes/index.ts — 100% declarative22import { handleChatCompletions } from '../controllers/chat'2324export const registerRoutes = (app: any) => {25 app.post('/:version/chat/completions', handleChatCompletions)26}2728// controllers/chat.ts — all business logic here29export async function handleChatCompletions(c: Context) {30 // ... provider resolution, streaming, error handling, metrics31}32```3334## Pattern checks3536- If `routes/index.ts` contains anything other than route registration (conditionals, validation, business logic), the routing pattern is violated.37- If a handler in `routes/*.ts` contains more than a single call to a controller, the separation of concerns is violated.38
Also in sosan/proxy-llms
Diff this repo’s formatsOne repository carrying more than one format is the comparison this product exists for: does anyone actually write different content in each file, or is one a copy of the other?
| Repository | Format | Stack | Covers | Score | Changed |
|---|---|---|---|---|---|
| sosan/proxy-llms.clinerules/development-workflow.md · 0 | Cline rules | setuptestarchagent-behaviour | 78/100 | 2 days ago | |
| sosan/proxy-llms.clinerules/metrics.md · 0 | Cline rules | archsecurity | 54/100 | 2 days ago | |
| sosan/proxy-llms.clinerules/project-overview.md · 0 | Cline rules | testarch | 52/100 | 2 days ago | |
| sosan/proxy-llms.clinerules/security.md · 0 | Cline rules | setupstylearchsecurity+1 | 80/100 | 2 days ago | |
| sosan/proxy-llms.clinerules/typescript.md · 0 | Cline rules | stylearchtypesdo-not | 69/100 | 2 days ago | |
| sosan/proxy-llmsCLAUDE.md · 0 | CLAUDE.md | setupteststylesecurity+3 | 81/100 | 2 days ago |
Similar configs
Same format, overlapping stack, ranked by quality.
| Repository | Format | Stack | Covers | Score | Changed |
|---|---|---|---|---|---|
| bashdeban/fastmind.clinerules/.project-consistency-keeper2.md · 5 | Cline rules | setupbuildtestlint-format+11 | 100/100 | 3 days ago | |
| JCodesMore/ai-website-cloner-template.clinerules · 31k | Cline rules | buildlint-formatstylearch+3 | 97/100 | 2 days ago | |
| u9401066/zotero-keeper.clinerules/50-pubmed-project.md · 6 | Cline rules | testlint-formatstylearch+1 | 94/100 | 3 days ago | |
| u9401066/zotero-keepervscode-extension/resources/repo-assets/pubmed-search-mcp/.clinerules/50-pubmed-project.md · 6 | Cline rules | testlint-formatstylearch+1 | 94/100 | 3 days ago | |
| VaillerTeeter/HoshimiNest.clinerules/project-identity.md · 1 | Cline rules | setuparchtypesdo-not | 93/100 | yesterday | |
| blendsdk/codeops-mcp.clinerules/project.md · 0 | Cline rules | buildteststylearch+7 | 91/100 | 3 days ago | |
| cline/cline.clinerules/general.md · 66k | Cline rules | setupbuildstylearch+2 | 86/100 | 3 days ago | |
| u9401066/zotero-keeper.clinerules/60-pubmed-python.md · 6 | Cline rules | setuptestlint-formatstyle+2 | 86/100 | 3 days ago |
