software-design

v0.1.3
io.github.qwertymuzaffar/software-design Checked 2 days ago Published 4 months ago

SOLID/OOP/DRY, the 23 GoF patterns, pattern scaffolding, and heuristic code-smell detection.

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

list_catalog List design principles & patterns

List the catalog of software-design concepts, optionally filtered by kind. Returns each concept's slug, name, category, and one-line summary.

ParameterTypeDescription
kindstringFilter by kind. "principle" = all principles; "solid"/"oop" narrow to the SOLID five / the four OOP pillars; "pattern" = all GoF patterns. Default "all".

explain_concept Explain a principle or pattern

Return an authoritative explanation of one design principle or GoF pattern: intent, when to use it, trade-offs, participants, and related concepts. Accepts a slug, full name, or alias (e.g. "SRP", "factory").

ParameterTypeDescription
name *stringConcept to explain, e.g. "open-closed", "SRP", "observer".

scaffold_pattern Scaffold a GoF pattern

Generate a language-agnostic pseudo-code skeleton for a GoF pattern, showing its participants and how they collaborate. Optionally rename roles to your domain (e.g. Product -> Notification). Translate the result into your target language.

ParameterTypeDescription
pattern *stringPattern slug/name/alias, e.g. "observer", "factory-method".
namesobjectOptional role→name map, e.g. {"Product":"Notification","Creator":"Dispatcher"}.

check_smells Detect code smells (heuristic)

Scan a code snippet for heuristic design smells (long method, large class, long parameter list, deep nesting, duplication, large file). Each finding maps to the principle it hints at plus a suggested refactor. HEURISTICS ONLY — hints, never verdicts; a clean run does not certify good design.

ParameterTypeDescription
code *stringThe source snippet to analyze (one file's worth).
dupThresholdintegerDuplicate-line count (default 3).
largeClassMethodsintegerMax methods per class (default 12).
longMethodintegerMax method lines (default 40).
maxDepthintegerMax nesting depth (default 4).
maxFileLinesintegerMax file lines (default 400).
maxParamsintegerMax parameters (default 4).