RuleStack

Configs

Stacks

Compare

Diff

RuleStack

Configs

Stacks

Compare

Diff

Read API

RuleStack

Configs

Stacks

Compare

Diff

Read API

Configs/Cline rules/sosan/proxy-llms

Cline rules

.clinerules/routing-pattern.md
Cline rules

Quality

65/100

Scores the file, not the repository.

Length

232 words

6 headings · 1 code blocks

Repository

0

— · pushed 0 days ago

Last changed

2 days ago

First indexed 2 days ago.
sosan/proxy-llms/.clinerules/routing-pattern.mdRawGitHub
1# Routing Pattern
2 
3## Brief overview
4 
5Routes must be thin, declarative wrappers. All business logic lives in controllers.
6 
7## Rule: Thin Routes, Fat Controllers
8 
9- `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.
12 
13## Anti-patterns to avoid
14 
15- 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.
17 
18## Example
19 
20```typescript
21// routes/index.ts — 100% declarative
22import { handleChatCompletions } from '../controllers/chat'
23 
24export const registerRoutes = (app: any) => {
25 app.post('/:version/chat/completions', handleChatCompletions)
26}
27 
28// controllers/chat.ts — all business logic here
29export async function handleChatCompletions(c: Context) {
30 // ... provider resolution, streaming, error handling, metrics
31}
32```
33 
34## Pattern checks
35 
36- 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 

Sections

  • Routing Pattern
  • Brief overview
  • Rule: Thin Routes, Fat Controllers
  • Anti-patterns to avoid
  • Example
  • Pattern checks

What it covers

code-stylearchitecturedo-not

Stack — with the evidence

typescript

(1.00)

vitest

(1.00)

cloudflare

(1.00)

node

(0.70)

hono

(0.70)

javascript

(0.60)

monorepo

(0.60)

pnpm

(0.60)

github-actions

(0.60)

Format

Cline rules

A single file or a folder of files, all always-on. The folder form is the simplest way any format here lets you split rules into topics without also learning an activation model.

What the corpus says about it

Repository

Owner
sosan
Language
—
License
—
Archived
no

All configs in this repo

Also in sosan/proxy-llms

Diff this repo’s formats

One 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?

The other instruction files in this repository
RepositoryFormatStackCoversScoreChanged
sosan/proxy-llms.clinerules/development-workflow.md · 0Cline rulestypescriptvitest+7setuptestarchagent-behaviour78/1002 days ago
sosan/proxy-llms.clinerules/metrics.md · 0Cline rulestypescriptvitest+7archsecurity54/1002 days ago
sosan/proxy-llms.clinerules/project-overview.md · 0Cline rulestypescriptvitest+7testarch52/1002 days ago
sosan/proxy-llms.clinerules/security.md · 0Cline rulestypescriptvitest+7setupstylearchsecurity+180/1002 days ago
sosan/proxy-llms.clinerules/typescript.md · 0Cline rulestypescriptvitest+7stylearchtypesdo-not69/1002 days ago
sosan/proxy-llmsCLAUDE.md · 0CLAUDE.mdtypescriptvitest+7setupteststylesecurity+381/1002 days ago
Diff against .clinerules/development-workflow.md Diff against .clinerules/metrics.md Diff against .clinerules/project-overview.md Diff against .clinerules/security.md Diff against .clinerules/typescript.md Diff against CLAUDE.md

Similar configs

Same format, overlapping stack, ranked by quality.

Same format, overlapping stack, ranked by quality
RepositoryFormatStackCoversScoreChanged
bashdeban/fastmind.clinerules/.project-consistency-keeper2.md · 5Cline rulestypescriptnode+8setupbuildtestlint-format+11100/1003 days ago
JCodesMore/ai-website-cloner-template.clinerules · 31kCline rulestypescriptnode+7buildlint-formatstylearch+397/1002 days ago
u9401066/zotero-keeper.clinerules/50-pubmed-project.md · 6Cline rulespytestruff+6testlint-formatstylearch+194/1003 days ago
u9401066/zotero-keepervscode-extension/resources/repo-assets/pubmed-search-mcp/.clinerules/50-pubmed-project.md · 6Cline rulespytestruff+6testlint-formatstylearch+194/1003 days ago
VaillerTeeter/HoshimiNest.clinerules/project-identity.md · 1Cline rulestypescriptvite+4setuparchtypesdo-not93/100yesterday
blendsdk/codeops-mcp.clinerules/project.md · 0Cline rulestypescriptvitest+3buildteststylearch+791/1003 days ago
cline/cline.clinerules/general.md · 66kCline rulestypescriptnode+12setupbuildstylearch+286/1003 days ago
u9401066/zotero-keeper.clinerules/60-pubmed-python.md · 6Cline rulespytestruff+6setuptestlint-formatstyle+286/1003 days ago
RuleStack

Built by

Kynth Studio

Directory

Configs
Stacks
Compare formats
Diff two configs
Best AGENTS.md examples

Formats

AGENTS.md
CLAUDE.md
Cursor rules
Copilot instructions

Reference

Read API
Corpus health
Privacy Policy
Terms

RuleStack

RuleStack

Built by

Kynth Studio

Directory

Configs
Stacks
Compare formats
Diff two configs
Best AGENTS.md examples

Formats

AGENTS.md
CLAUDE.md
Cursor rules
Copilot instructions

Reference

Read API
Corpus health
Privacy Policy
Terms

RuleStack

RuleStack

Built by

Kynth Studio

Directory

Configs
Stacks
Compare formats
Diff two configs
Best AGENTS.md examples

Formats

AGENTS.md
CLAUDE.md
Cursor rules
Copilot instructions

Reference

Read API
Corpus health
Privacy Policy
Terms

RuleStack