بنقرة واحدة
anti-monolith-guard
Prevent mixed-responsibility modules and uncontrolled file growth.
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
القائمة
Prevent mixed-responsibility modules and uncontrolled file growth.
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
استنادا إلى تصنيف SOC المهني
Security and privacy review for scoped changes.
Evidence-based gate for creating a new skill or agent profile.
UI, accessibility, and interaction-quality review.
Performance investigation using reproducible measurements.
Markdown and governance structure lint checklist.
Create a bounded session handoff with collision-resistant identity.
| schema | fcvw/skill@1 |
| name | anti-monolith-guard |
| description | Prevent mixed-responsibility modules and uncontrolled file growth. |
| version | 1.1.1 |
| trigger_keywords | ["monolith","large file","module boundary","anti-monólito"] |
| session_types | ["planning","refactoring"] |
Prevent AI agents from creating or expanding monolithic files, components, routes, services, prompts, or modules. This is a Markdown-only gate: it blocks unsafe structure through explicit checklist decisions, not scripts.
Load this skill before implementation when any condition is true:
Active plan, target artifact, responsibility map, similar-code search, dependency/consumer evidence, current size or complexity indicators, and the checks that protect behavior during a split.
Stop and split the work before editing if any gate fails:
| Gate | Pass condition | If it fails |
|---|---|---|
| Single responsibility | The file has one primary reason to change. | Split into module, service, component, adapter, or utility. |
| Boundary named | Inputs, outputs, owner, and public contract are stated. | Create a module boundary note using governance/TEMPLATE_MONOLITH_GATE.md. |
| Size budget | Planned file growth is small and reviewable. | Split the plan or create extraction task first. |
| Duplication check | Similar code was searched and reused or centralized. | Load code-hygiene-refactor before adding code. |
| Test/validation path | There is a specific validation for the new boundary. | Do not proceed beyond planning. |
| No catch-all file | Names like utils, helpers, manager, service, or index have a precise scoped role. | Rename or split by capability. |
These are governance thresholds, not universal language rules. A project may override them in STACK.md or APPLICATION_DOCUMENTATION.md.
| Artifact | Warning | Block unless justified |
|---|---|---|
| Function / method | 40 lines | 80 lines |
| UI component / screen section | 180 lines | 300 lines |
| Route / controller / handler | 120 lines | 220 lines |
| Service / use case | 180 lines | 300 lines |
| Prompt or agent instruction file | 180 lines | 300 lines |
| General module file | 250 lines | 400 lines |
If a file crosses the warning threshold, record the reason in the plan. If it crosses the block threshold, split first or document why a temporary exception is safer.
Every new non-trivial module must answer in the active plan:
Prefer the smallest split that removes real coupling:
#tech-debt record.Record this compact block in the active plan before editing:
## Anti-Monolith Gate
- Skill loaded: `skills/anti-monolith-guard/SKILL.md`
- Target artifact:
- Primary responsibility:
- Explicit non-responsibilities:
- Size budget:
- Similar code checked:
- Split decision: `proceed` / `split first` / `temporary exception`
- Validation:
Proceed only when the plan proves the next edit is small, named, bounded, reusable where needed, and validated.