| name | solid-generic |
| description | SOLID principles for generic TypeScript, Bun, and Node.js projects. Files < 100 lines, interfaces separated, JSDoc mandatory. Use for CLI tools, libraries, scripts, hooks, and non-framework TypeScript code. |
| version | 1.0.0 |
| user-invocable | true |
| references | references/solid-principles.md, references/single-responsibility.md, references/open-closed.md, references/liskov-substitution.md, references/interface-segregation.md, references/dependency-inversion.md, references/architecture-patterns.md, references/templates/module.md, references/templates/service.md, references/templates/interface.md, references/templates/validator.md, references/templates/factory.md, references/templates/error.md, references/templates/test.md |
| related-skills | solid-react, solid-nextjs, solid-php, solid-swift |
SOLID Generic - TypeScript / Bun / Node.js
Agent Workflow (MANDATORY)
Before ANY implementation, use TeamCreate to spawn 3 agents:
- fuse-ai-pilot:explore-codebase - Analyze project structure and existing patterns
- fuse-ai-pilot:research-expert - Verify latest TypeScript/Bun docs via Context7
- mcp__context7__query-docs - Check integration compatibility
After implementation, run fuse-ai-pilot:sniper for validation.
DRY - Reuse Before Creating (MANDATORY)
Before writing ANY new code:
- Grep the codebase for similar function names, patterns, or logic
- Check shared locations:
modules/cores/lib/, modules/cores/interfaces/, modules/cores/errors/
- If similar code exists -> extend/reuse instead of duplicate
- If code will be used by 2+ modules -> create in
modules/cores/
- Extract repeated logic (3+ occurrences) into shared helpers
Absolute Rules (MANDATORY)
1. Files < 100 lines
- Split at 90 lines - Never exceed 100
- Modules < 80 lines
- Services < 60 lines
- Validators < 40 lines
2. Interfaces Separated (Modular MANDATORY)
modules/[feature]/src/interfaces/ # Feature types
|- user.interface.ts
\- service.interface.ts
modules/cores/interfaces/ # Shared types
\- shared.interface.ts
NEVER put interfaces in implementation files.
NEVER use flat src/ structure - always modules/.
3. JSDoc Mandatory
export function parseConfig(filePath: string): Config
SOLID Principles (Detailed Guides)
See solid-principles.md for overview and architecture-patterns.md for project structure.
Code Templates
Forbidden
- Files > 100 lines
- Interfaces in implementation files
- Business logic in entry points
- Missing JSDoc on exports
any type
- Barrel exports (index.ts re-exports)
- Duplicating existing utility without Grep search first
- Copy-pasting logic blocks instead of extracting shared function
- Concrete dependencies without interface abstraction