Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx agentmods add rules/yerdaulet-damir/vibe-coding-rules/decompositiongit clone --depth 1 https://github.com/yerdaulet-damir/vibe-coding-rulesWhat it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5 | $0.01408 | $0.01408 |
| Opus 5 | $0.00704 | $0.00704 |
| Sonnet 5 | $0.00282 | $0.00282 |
| Haiku 4.5 | $0.00141 | $0.00141 |
Grade A, and why
decomposition scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 184 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Decomposition Rules
Files grow. Without a rule, they grow until grep is the only navigation tool. These rules tell you exactly when to split, and how to split safely.
File Size Limits
| LOC range | State | Action required |
|---|---|---|
| 0–400 | Green | None. |
| 400–600 | Yellow | Plan a split. Add # TODO(decompose): A1 — split by ... header. |
| 600+ | Red | Block the merge. Decompose first. |
CI runs python scripts/check_loc.py app/ and fails on any file > 600 LOC.
When to Convert a File into a Package
Convert <file>.py into <file>/ when any is true:
- Crosses 400 LOC and the next change would push it past 500.
- Contains 2+ disjoint sub-domains (image vs video, user vs admin).
- Mixes HTTP handlers with worker handlers.
- Mixes Pydantic schemas + auth deps + route handlers.
- Has 2+ callers each importing only one symbol — the split lines are obvious.
How to Split Safely (Atomic PR Pattern)
-
Create the package.
<file>/__init__.pyis empty for now. -
Move disjoint pieces to sub-files (
a.py,b.py,c.py). -
Re-export old public names from
__init__.py:# services/wallet/__init__.py from .user import WalletUserService from .admin import WalletAdminService # backwards-compat alias for old imports WalletService = WalletUserService __all__ = ["WalletUserService", "WalletAdminService", "WalletService"] -
Run tests — they must pass without changes.
-
Open a follow-up PR to migrate callers off the legacy alias. Once it lands, delete the alias.
Static Data Separation
Static data goes in app/data/ (project-wide) or <domain>/registry.py (domain-local). Never inline:
# ❌ BAD — pricing constants tangled into service file
class AIService:
PRICING = {
"gpt-4o": Decimal("0.005"),
"claude-3-5": Decimal("0.003"),
# ... 80 more lines ...
}
async def generate(self, ...): ...
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 2d ago First seen · 184 lines · 1,408 tokens per session scan A 5fa0f6aa26ba
decomposition is a cursor rule published in the GitHub repository yerdaulet-damir/vibe-coding-rules (10 stars, last pushed 3mo ago), licensed MIT. It adds 1,408 tokens to every session, about $0.0070 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.
Other cursor rules, from other repositories
hedgehog
Hedgehog build discipline — how to work in this repo.
cursorrules
Cursor rule "cursorrules" from syf2211/ruledoctor, covering 订单服务项目规则(demo) and 硬性规则.
kotlin
Android finance precision, RTL/i18n, and Kotlin AI skill rules.
modern-android
Modern Android rules: edge-to-edge, predictive back, splash screen, WorkManager, lifecycle, coroutines.
architecture
Android architecture rules: layered architecture, UDF, Repository pattern, ViewModel, UseCases.
performance
Performance rules: Compose recomposition, lazy layouts, app startup, memory, benchmarking.