mcpField
S
solid-generic

solid-generic

github.com/fusengineDevelopment3440 installsUpdated 2w ago
Repository

About solid-generic

solid-generic is a development skill for plain TypeScript, Bun, and Node.js projects. It guides agents to organize modular code around SOLID principles, reuse, and documented exports, with references and templates.

Key features

  1. 01SOLID principle guides
  2. 02Modular file and interface rules
  3. 03DRY reuse checks
  4. 04JSDoc requirements for exports
  5. 05Templates for modules and tests

Use cases

  1. 01Structuring a new TypeScript module
  2. 02Reviewing code for duplicated logic
  3. 03Separating interfaces from implementations

Install

Copy the command and run it in a terminal.

$npx skills add https://github.com/fusengine/claude-plugins --skill solid-generic

After installing, type/solid-genericin Claude Code to confirm it loaded.

Details

From the project README
SOLID Generic enforces a modular architecture for plain TypeScript/Bun/Node.js code with no framework (CLI tools, libraries, scripts, hooks): interfaces live in `modules/[feature]/src/interfaces/` or `modules/cores/interfaces/` for shared types, never in implementation files; files stay within `FUSE_SOLID_MAX_LINES`, one responsibility each; every export carries JSDoc.

Before writing any new code it requires a DRY check across modules/cores/lib, modules/cores/interfaces, and modules/cores/errors, extracting anything repeated 3+ times into a shared helper. Each of the 5 SOLID principles has its own detailed reference (single-responsibility.md through dependency-inversion.md), plus copy-paste-ready templates for modules, services, interfaces, validators, factories, errors, and tests.

SOLID Generic - TypeScript / Bun / Node.js

Agent Workflow (MANDATORY)

Before ANY implementation, spawn 3 agents in parallel, one Agent call each with a name:

  1. fuse-ai-pilot:explore-codebase - Analyze project structure and existing patterns
  2. fuse-ai-pilot:research-expert - Verify latest TypeScript/Bun docs via Context7
  3. 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:

  1. Grep the codebase for similar function names, patterns, or logic
  2. Check shared locations: modules/cores/lib/, modules/cores/interfaces/, modules/cores/errors/
  3. If similar code exists -> extend/reuse instead of duplicate
  4. If code will be used by 2+ modules -> create in modules/cores/
  5. Extract repeated logic (3+ occurrences) into shared helpers

Absolute Rules (MANDATORY)

1. Files within FUSE_SOLID_MAX_LINES
  • Split mixed responsibilities before the hook ceiling is reached
  • One purpose per module, service and validator
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
/**
 * Parse configuration from file path.
 *
 * @param filePath - Absolute path to config file
 * @returns Parsed configuration object
 * @throws ConfigError if file is invalid
 */
export function parseConfig(filePath: string): Config

SOLID Principles (Detailed Guides)

#PrincipleReferenceKey Rule
SSingle Responsibilitysingle-responsibility.mdOne file = one reason to change
OOpen/Closedopen-closed.mdExtend via composition, not modification
LLiskov Substitutionliskov-substitution.mdImplementations honor interface contracts
IInterface Segregationinterface-segregation.mdMany focused interfaces > one fat interface
DDependency Inversiondependency-inversion.mdDepend on abstractions, inject dependencies

See solid-principles.md for overview and architecture-patterns.md for project structure.


Code Templates

TemplateUsage
module.mdTypeScript/Bun module
service.mdService with DI
interface.mdTypeScript interfaces
validator.mdZod validation schemas
factory.mdFactory pattern
error.mdCustom error classes
test.mdBun test / Vitest

Forbidden

  • Files over FUSE_SOLID_MAX_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

Comments

Markdown supported