npx skills add ...
npx skills add somnio-software/somnio-ai-tools --skill nestjs-health-audit
Execute a comprehensive NestJS Project Health Audit. Analyzes tech stack, architecture, API design, data layer, testing, code quality, CI/CD, and documentation. Produces a shareable Markdown report with section scores and weighted overall score. Use when the user asks to audit a NestJS project, run a health check, evaluate backend quality, or assess technical debt. Triggers on: 'nestjs audit', 'health audit', 'backend audit', 'nestjs health', 'node audit', 'api audit', 'project quality check'.
npx skills add somnio-software/somnio-ai-tools --skill nestjs-health-audit
This plan executes the NestJS Project Health Audit through sequential, modular rules. Each step uses a specific rule that can be executed independently and produces output that feeds into the final report.
When running in-session (Claude Code, Cursor, or any agent that supports the Agent tool), this skill operates through a tiered multi-subagent topology coordinated by agents/orchestrator.md. The somnio run CLI path uses the Rule Execution Order below (sequential, single model per run).
Entry point (in-session): agents/orchestrator.md (model: mid)
Tier assignments:
| Tier | Role | Agents |
|---|---|---|
| cheap | Mechanical scanners — filesystem scans, key extraction, presence checklists | env-setup-agent, repo-analyzer, config-analyzer, docs-analyzer |
| mid | Reasoning analyzers — CI gate compliance, test quality judgment, code quality depth, REST convention compliance, N+1 detection, AI harness quality judgment; also the orchestrator | orchestrator, cicd-analyzer, testing-analyzer, code-quality-analyzer, api-design-analyzer, data-layer-analyzer, harness-analyzer |
| frontier | Report synthesis — cross-section score reconciliation, weighted overall score, narrative coherence, mandatory 15-section structure | report-writer-agent |
Role: NestJS Project Health Auditor
You are a master at:
Responsibilities:
Expected Behavior:
Critical Rules:
Execution Discipline (NON-NEGOTIABLE):
MANDATORY STEP 0: Before executing any NestJS project analysis, ALWAYS verify and align the Node.js version with the project's required version using nvm.
Rule to Execute: Read and follow the instructions in references/version-alignment.md
CRITICAL REQUIREMENT: This step MUST configure nvm to use the project's Node.js version. This is non-negotiable and must be executed successfully before any analysis can proceed.
This requirement applies to ANY NestJS project regardless of versions found and ensures accurate analysis by preventing version-related build failures.
Goal: Configure Node.js environment with MANDATORY nvm configuration and execute comprehensive dependency management with tests and coverage verification.
CRITICAL: This step MUST configure nvm to use project's Node.js version and install ALL dependencies (root, packages, apps). Execution stops if nvm configuration fails.
Rules to Execute:
references/tool-installer.md (MANDATORY: Installs Node.js, nvm, required
CLI tools)references/version-alignment.md (MANDATORY - stops if fails)references/version-validator.mdreferences/test-coverage.md (coverage generation)Execution Order:
references/tool-installer.md rule first (MANDATORY - stops if fails)references/version-alignment.md rule (MANDATORY - stops if fails)references/version-validator.md rule to verify nvm setup and
comprehensive dependency managementreferences/test-coverage.md rule to generate coverageComprehensive Dependency Management:
npm install or yarn install or pnpm installfind packages/ -name "package.json" -execdir npm install \;find apps/ -name "package.json" -execdir npm install \;npm list or yarn list or pnpm listnpm run build or yarn build or pnpm buildfind apps/ -name "package.json" -execdir npm run build \;Integration: Save all outputs from these rules for integration into the final audit report.
Failure Handling: If nvm configuration fails, STOP execution and provide resolution steps.
Steps 1-9 can be partially parallelized using the Agent tool to launch multiple analysis agents simultaneously. Use the following wave structure:
Wave 0 (Sequential - MANDATORY): Step 0 — Environment Setup Must complete fully before any analysis begins.
Wave 1 (Parallel): Steps 1 + 2 — Repository Inventory + Configuration Analysis Launch both as parallel agents. Both read from the filesystem independently.
Wave 2 (Parallel): Steps 3 + 4 + 5 + 9 — CI/CD + Testing + Code Quality + AI Harness & Adoption Launch all four as parallel agents. Independent read-only analyses; the harness analysis depends on no prior artifact, so it joins this wave.
Wave 3 (Parallel): Steps 6 + 7 — API Design + Data Layer Launch both as parallel agents. Independent framework-specific analyses.
Wave 4 (Sequential): Step 8 — Documentation Analysis Can run after all analysis waves complete.
Wave 5 (Sequential): Steps 10 + 11 — Report Generation + Export Must run last — requires ALL previous results.
Agent Launch Pattern: For each parallel wave, use the Agent tool to spawn one agent per step. Each agent MUST:
Example for Wave 1:
Goal: Detect repository structure, monorepo packages, module organization, and feature structure.
Rule to Execute: Read and follow the instructions in references/repository-inventory.md
Integration: Save repository structure findings for Architecture and Tech Stack sections.
Goal: Read and analyze NestJS/Node.js configuration files for version info, dependencies, TypeScript setup, and environment configuration.
Rule to Execute: Read and follow the instructions in references/config-analysis.md
Integration: Save configuration findings for Tech Stack and Code Quality sections.
Goal: Read all GitHub Actions workflows and related CI/CD configuration files including Docker setup.
Rule to Execute: Read and follow the instructions in references/cicd-analysis.md
Integration: Save CI/CD findings for CI/CD section scoring.
Goal: Find and classify all test files, identify coverage configuration and test types (unit, integration, e2e).
Rule to Execute: Read and follow the instructions in references/testing-analysis.md
Integration: Save testing findings for Testing section, integrate with coverage results from Step 0.
Goal: Analyze ESLint configuration, Prettier setup, TypeScript strict mode, and code quality enforcement.
Rule to Execute: Read and follow the instructions in references/code-quality.md
Integration: Save code quality findings for Code Quality section scoring.
Goal: Analyze REST/GraphQL API design, DTOs, validation patterns, OpenAPI/Swagger documentation, and API versioning.
Rule to Execute: Read and follow the instructions in references/api-design-analysis.md
Integration: Save API design findings for API Design section scoring.
Goal: Analyze ORM/database integration, repository patterns, migrations, and data access layer organization.
Rule to Execute: Read and follow the instructions in references/data-layer-analysis.md
Integration: Save data layer findings for Data Layer section scoring.
Goal: Review technical documentation, API documentation, build instructions, and environment setup.
Rule to Execute: Read and follow the instructions in references/documentation-analysis.md
Integration: Save documentation findings for Documentation & Operations section scoring.
Goal: Score the project's AI harness — CLAUDE.md, .claude/rules/,
settings.json permissions and hooks, .claude/agents/,
commands/skills, and the pre-push git hook — on the 10-dimension,
100-point rubric, judging quality, not just presence.
Rule to Execute: Read and follow the instructions in references/harness-analysis.md
Integration: Save the AI Harness & Adoption findings, score, and prioritised action list for the "AI Harness & Adoption" report section.
Goal: Generate the final NestJS Project Health Audit report by integrating all analysis results.
Rule to Execute: Read and follow the instructions in references/report-generator.md
Integration: This rule integrates all previous analysis results and generates the final report.
Report Sections:
> Test Coverage: line, the scoring legend, and the Overall Score
interpretation sentenceGoal: Save the final shareable Markdown report to the reports directory.
Action: Create the reports directory if it doesn't exist and save
the final NestJS Project Health Audit report to:
./reports/<YYYY-MM-DD>-<project>-nestjs-health-audit.md
Format: Markdown-formatted report (use proper Markdown syntax,
use # headings, bold markers, and backtick code references).
Command:
Note: For security analysis, run the standalone Security Audit (/somnio:security-audit).
Total Rules: 14 rules
Rule Execution Order:
references/tool-installer.md {model: cheap}references/version-alignment.md (MANDATORY - stops if nvm fails) {model: cheap}references/version-validator.md (verification of nvm setup) {model: cheap}references/test-coverage.md (coverage generation) {model: cheap}references/repository-inventory.md {model: cheap}references/config-analysis.md {model: cheap}references/cicd-analysis.md {model: mid}references/testing-analysis.md {model: mid}references/code-quality.md {model: mid}references/api-design-analysis.md {model: mid}references/data-layer-analysis.md {model: mid}references/documentation-analysis.md {model: cheap}references/harness-analysis.md {model: mid}references/report-generator.md {model: frontier}Wave-Based Parallel Execution:
Benefits of Modular Approach:
This section describes the in-session multi-agent path. The Rule Execution Order above remains the CLI (somnio run) path and is unchanged.
Entry point: agents/orchestrator.md (model: mid). The orchestrator dispatches all subagents via the Agent tool, validates artifacts between waves, and hands the artifact manifest to the report writer.
Wave plan:
| Wave | Mode | Subagent(s) | Tier | Reference(s) covered | Artifact(s) produced |
|---|---|---|---|---|---|
| 0 | Sequential (MANDATORY gate) | env-setup-agent | cheap | tool-installer, version-alignment, version-validator, test-coverage | step_00_env_setup.md, step_00_test_coverage.md |
| 1 | Parallel | repo-analyzer, config-analyzer | cheap, cheap | repository-inventory, config-analysis | step_01_repository_inventory.md, step_02_config_analysis.md |
| 2 | Parallel | cicd-analyzer, testing-analyzer, code-quality-analyzer, harness-analyzer | mid, mid, mid, mid | cicd-analysis, testing-analysis, code-quality, harness-analysis | step_03_cicd_analysis.md, step_04_testing_analysis.md, step_05_code_quality.md, step_09_harness_analysis.md |
| 3 | Parallel | api-design-analyzer, data-layer-analyzer | mid, mid | api-design-analysis, data-layer-analysis | step_06_api_design_analysis.md, step_07_data_layer_analysis.md |
| 4 | Sequential | docs-analyzer | cheap | documentation-analysis | step_08_documentation_analysis.md |
| 5 | Sequential | report-writer-agent | frontier | report-generator, report-format-enforcer, assets/report-template.md | reports/<YYYY-MM-DD>-<project>-nestjs-health-audit.md |
Orchestrator behavior:
env-setup-agent emits Result: FAILED, the orchestrator halts and surfaces resolution steps.Report writer behavior:
references/report-generator.md — that file is the single source of truth; do not restate the numbers here.references/report-format-enforcer.md.reports/<YYYY-MM-DD>-<project>-nestjs-health-audit.md and appends the metadata block.The report file name is always:
<YYYY-MM-DD> — the date of this run.<project> — the git repository name slugified to kebab-case: lowercase,
with spaces, _, . and / turned into -, every other character dropped,
and repeated - collapsed. The name comes from the origin remote URL, so
it is the same whatever the checkout directory, worktree or subdirectory is
called; without a remote it is the main checkout's directory name, and
outside a git repo the current directory name.Derive it once, before writing anything:
Everywhere this skill writes reports/<YYYY-MM-DD>-<project>-nestjs-health-audit.md, it
means that resolved path.
When run through somnio run, the CLI computes the full report path and
passes it in the prompt. Use the path it gives you verbatim — do not recompute
it, or the runner will not find the report and the step will fail.
Every generated report MUST include a metadata block at the very end. This is non-negotiable — never omit it.
Copy the Report Metadata table from the template as the last block of the report. Keep the Generated by row exactly as written in the template — never change, guess or omit the version. Fill the remaining rows as described.
Include this block at the very end of the report, as an unnumbered Markdown table (it follows the "Appendix: Scoring Methodology" block):
## Report Metadata
| Field | Value |
|-------|-------|
| Generated by | Somnio CLI v3.2.8 |
| Skill | nestjs-health-audit |
| Date | [YYYY-MM-DD] |
| Somnio AI Tools | https://github.com/somnio-software/somnio-ai-tools |