nemonix-cli 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +186 -0
- package/dist/cli.js +6870 -0
- package/package.json +48 -0
- package/src/config/claude-code-config/.claude/commands/setup-tmux.md +0 -0
- package/src/config/claude-code-config/CHANGELOG.md +261 -0
- package/src/config/claude-code-config/README.md +1 -0
- package/src/config/claude-code-config/agents/action.md +36 -0
- package/src/config/claude-code-config/agents/clean-code-runner.md +61 -0
- package/src/config/claude-code-config/agents/code-reviewer.md +172 -0
- package/src/config/claude-code-config/agents/code-simplifier.md +49 -0
- package/src/config/claude-code-config/agents/explore-codebase.md +65 -0
- package/src/config/claude-code-config/agents/explore-docs.md +65 -0
- package/src/config/claude-code-config/agents/explore-fast.md +22 -0
- package/src/config/claude-code-config/agents/implementer.md +181 -0
- package/src/config/claude-code-config/agents/snipper.md +36 -0
- package/src/config/claude-code-config/agents/websearch.md +42 -0
- package/src/config/claude-code-config/commands/prompts/create-vitejs-app.md +272 -0
- package/src/config/claude-code-config/commands/prompts/nextjs-add-prisma-db.md +136 -0
- package/src/config/claude-code-config/commands/prompts/nextjs-setup-better-auth.md +173 -0
- package/src/config/claude-code-config/commands/prompts/nextjs-setup-project.md +200 -0
- package/src/config/claude-code-config/commands/prompts/prompt.md +55 -0
- package/src/config/claude-code-config/commands/prompts/saas-challenge-idea.md +135 -0
- package/src/config/claude-code-config/commands/prompts/saas-create-architecture.md +242 -0
- package/src/config/claude-code-config/commands/prompts/saas-create-headline.md +132 -0
- package/src/config/claude-code-config/commands/prompts/saas-create-landing-copywritting.md +267 -0
- package/src/config/claude-code-config/commands/prompts/saas-create-legals-docs.md +176 -0
- package/src/config/claude-code-config/commands/prompts/saas-create-logos.md +240 -0
- package/src/config/claude-code-config/commands/prompts/saas-create-prd.md +195 -0
- package/src/config/claude-code-config/commands/prompts/saas-create-tasks.md +240 -0
- package/src/config/claude-code-config/commands/prompts/saas-define-pricing.md +293 -0
- package/src/config/claude-code-config/commands/prompts/saas-find-domain-name.md +190 -0
- package/src/config/claude-code-config/commands/prompts/saas-implement-landing-page.md +257 -0
- package/src/config/claude-code-config/commands/prompts/setup-tmux.md +160 -0
- package/src/config/claude-code-config/commands/prompts/tools.md +148 -0
- package/src/config/claude-code-config/hooks/hook-post-file.ts +162 -0
- package/src/config/claude-code-config/scripts/.claude/skills/fix-on-my-computer/SKILL.md +81 -0
- package/src/config/claude-code-config/scripts/CLAUDE.md +50 -0
- package/src/config/claude-code-config/scripts/auto-rename-session/CLAUDE.md +59 -0
- package/src/config/claude-code-config/scripts/auto-rename-session/__tests__/shared.test.ts +185 -0
- package/src/config/claude-code-config/scripts/auto-rename-session/__tests__/title-generation.test.ts +44 -0
- package/src/config/claude-code-config/scripts/auto-rename-session/fixtures/sample-transcript.jsonl +3 -0
- package/src/config/claude-code-config/scripts/auto-rename-session/fixtures/transcript-short-message.jsonl +2 -0
- package/src/config/claude-code-config/scripts/auto-rename-session/fixtures/transcript-with-title.jsonl +3 -0
- package/src/config/claude-code-config/scripts/auto-rename-session/src/index.ts +113 -0
- package/src/config/claude-code-config/scripts/auto-rename-session/src/rename-all.ts +148 -0
- package/src/config/claude-code-config/scripts/auto-rename-session/src/shared.ts +157 -0
- package/src/config/claude-code-config/scripts/auto-rename-session/src/worker.ts +58 -0
- package/src/config/claude-code-config/scripts/biome.json +37 -0
- package/src/config/claude-code-config/scripts/claude-code-ai/CLAUDE.md +84 -0
- package/src/config/claude-code-config/scripts/claude-code-ai/__tests__/claude.test.ts +19 -0
- package/src/config/claude-code-config/scripts/claude-code-ai/__tests__/paths.test.ts +68 -0
- package/src/config/claude-code-config/scripts/claude-code-ai/claude.ts +56 -0
- package/src/config/claude-code-config/scripts/claude-code-ai/cli.ts +46 -0
- package/src/config/claude-code-config/scripts/claude-code-ai/helper/credentials.ts +76 -0
- package/src/config/claude-code-config/scripts/claude-code-ai/helper/index.ts +9 -0
- package/src/config/claude-code-config/scripts/claude-code-ai/helper/paths.ts +51 -0
- package/src/config/claude-code-config/scripts/command-validator/CLAUDE.md +112 -0
- package/src/config/claude-code-config/scripts/command-validator/README.md +147 -0
- package/src/config/claude-code-config/scripts/command-validator/src/__tests__/validator.test.ts +99 -0
- package/src/config/claude-code-config/scripts/command-validator/src/cli.ts +121 -0
- package/src/config/claude-code-config/scripts/command-validator/src/lib/security-rules.ts +174 -0
- package/src/config/claude-code-config/scripts/command-validator/src/lib/types.ts +34 -0
- package/src/config/claude-code-config/scripts/command-validator/src/lib/validator.ts +90 -0
- package/src/config/claude-code-config/scripts/package.json +43 -0
- package/src/config/claude-code-config/scripts/statusline/CLAUDE.md +205 -0
- package/src/config/claude-code-config/scripts/statusline/README.md +193 -0
- package/src/config/claude-code-config/scripts/statusline/__tests__/context.test.ts +229 -0
- package/src/config/claude-code-config/scripts/statusline/__tests__/formatters.test.ts +108 -0
- package/src/config/claude-code-config/scripts/statusline/__tests__/statusline.test.ts +309 -0
- package/src/config/claude-code-config/scripts/statusline/data/.gitkeep +0 -0
- package/src/config/claude-code-config/scripts/statusline/defaults.json +82 -0
- package/src/config/claude-code-config/scripts/statusline/docs/ARCHITECTURE.md +166 -0
- package/src/config/claude-code-config/scripts/statusline/fixtures/mock-transcript.jsonl +4 -0
- package/src/config/claude-code-config/scripts/statusline/fixtures/test-input.json +35 -0
- package/src/config/claude-code-config/scripts/statusline/src/analyze-daily-usage.ts +151 -0
- package/src/config/claude-code-config/scripts/statusline/src/commands/interactive-config.ts +515 -0
- package/src/config/claude-code-config/scripts/statusline/src/debug-payloads.ts +195 -0
- package/src/config/claude-code-config/scripts/statusline/src/index.ts +224 -0
- package/src/config/claude-code-config/scripts/statusline/src/lib/config-types.ts +110 -0
- package/src/config/claude-code-config/scripts/statusline/src/lib/config.ts +21 -0
- package/src/config/claude-code-config/scripts/statusline/src/lib/context.ts +103 -0
- package/src/config/claude-code-config/scripts/statusline/src/lib/features/limits/commands/weekly-analysis.ts +108 -0
- package/src/config/claude-code-config/scripts/statusline/src/lib/features/limits/index.ts +111 -0
- package/src/config/claude-code-config/scripts/statusline/src/lib/features/limits/types.ts +15 -0
- package/src/config/claude-code-config/scripts/statusline/src/lib/features/spend/commands/migrate-to-sqlite.ts +136 -0
- package/src/config/claude-code-config/scripts/statusline/src/lib/features/spend/commands/spend-day.ts +79 -0
- package/src/config/claude-code-config/scripts/statusline/src/lib/features/spend/commands/spend-month.ts +66 -0
- package/src/config/claude-code-config/scripts/statusline/src/lib/features/spend/commands/spend-project.ts +85 -0
- package/src/config/claude-code-config/scripts/statusline/src/lib/features/spend/database.ts +395 -0
- package/src/config/claude-code-config/scripts/statusline/src/lib/features/spend/index.ts +178 -0
- package/src/config/claude-code-config/scripts/statusline/src/lib/features/spend/payload-logger.ts +161 -0
- package/src/config/claude-code-config/scripts/statusline/src/lib/features/spend/types.ts +37 -0
- package/src/config/claude-code-config/scripts/statusline/src/lib/formatters.ts +426 -0
- package/src/config/claude-code-config/scripts/statusline/src/lib/git.ts +100 -0
- package/src/config/claude-code-config/scripts/statusline/src/lib/menu-factories.ts +224 -0
- package/src/config/claude-code-config/scripts/statusline/src/lib/presets.ts +177 -0
- package/src/config/claude-code-config/scripts/statusline/src/lib/render-pure.ts +516 -0
- package/src/config/claude-code-config/scripts/statusline/src/lib/types.ts +36 -0
- package/src/config/claude-code-config/scripts/statusline/src/lib/utils.ts +15 -0
- package/src/config/claude-code-config/scripts/statusline/src/stats.ts +119 -0
- package/src/config/claude-code-config/scripts/statusline/src/tests/spend-v2.test.ts +377 -0
- package/src/config/claude-code-config/scripts/statusline/src/tools/fixed-cost-calc.ts +317 -0
- package/src/config/claude-code-config/scripts/statusline/statusline.config.free.json +79 -0
- package/src/config/claude-code-config/scripts/statusline/statusline.config.json +100 -0
- package/src/config/claude-code-config/scripts/statusline/test-with-fixtures.ts +37 -0
- package/src/config/claude-code-config/scripts/statusline/test.ts +20 -0
- package/src/config/claude-code-config/scripts/statusline/tsconfig.json +27 -0
- package/src/config/claude-code-config/scripts/tsconfig.json +27 -0
- package/src/config/claude-code-config/settings.json +92 -0
- package/src/config/claude-code-config/skills/aibuilder-create-saas/SKILL.md +176 -0
- package/src/config/claude-code-config/skills/aibuilder-create-saas/references/architecture-template.md +436 -0
- package/src/config/claude-code-config/skills/aibuilder-create-saas/references/challenge-framework.md +289 -0
- package/src/config/claude-code-config/skills/aibuilder-create-saas/references/discovery-framework.md +338 -0
- package/src/config/claude-code-config/skills/aibuilder-create-saas/references/prd-template.md +452 -0
- package/src/config/claude-code-config/skills/aibuilder-create-saas/references/task-template.md +263 -0
- package/src/config/claude-code-config/skills/aibuilder-create-saas/references/tools.md +132 -0
- package/src/config/claude-code-config/skills/aibuilder-create-saas/scripts/rename-project.sh +42 -0
- package/src/config/claude-code-config/skills/aibuilder-create-saas/scripts/setup.sh +104 -0
- package/src/config/claude-code-config/skills/aibuilder-create-saas/steps/step-00-init.md +174 -0
- package/src/config/claude-code-config/skills/aibuilder-create-saas/steps/step-01-discovery.md +342 -0
- package/src/config/claude-code-config/skills/aibuilder-create-saas/steps/step-02-brainstorm.md +230 -0
- package/src/config/claude-code-config/skills/aibuilder-create-saas/steps/step-03-validate.md +372 -0
- package/src/config/claude-code-config/skills/aibuilder-create-saas/steps/step-04-prd.md +364 -0
- package/src/config/claude-code-config/skills/aibuilder-create-saas/steps/step-05-architecture.md +904 -0
- package/src/config/claude-code-config/skills/aibuilder-create-saas/steps/step-06-tasks.md +446 -0
- package/src/config/claude-code-config/skills/explore/SKILL.md +119 -0
- package/src/config/claude-code-config/skills/frontend-design/LICENSE.txt +177 -0
- package/src/config/claude-code-config/skills/frontend-design/SKILL.md +42 -0
- package/src/config/claude-code-config/skills/git-commit/SKILL.md +42 -0
- package/src/config/claude-code-config/skills/git-create-pr/SKILL.md +53 -0
- package/src/config/claude-code-config/skills/git-fix-pr-comments/SKILL.md +51 -0
- package/src/config/claude-code-config/skills/git-merge/SKILL.md +68 -0
- package/src/config/claude-code-config/skills/marketing-copywriting/SKILL.md +72 -0
- package/src/config/claude-code-config/skills/meta-claude-memory/SKILL.md +694 -0
- package/src/config/claude-code-config/skills/meta-claude-memory/references/comprehensive-example.md +175 -0
- package/src/config/claude-code-config/skills/meta-claude-memory/references/project-patterns.md +334 -0
- package/src/config/claude-code-config/skills/meta-claude-memory/references/prompting-techniques.md +411 -0
- package/src/config/claude-code-config/skills/meta-claude-memory/references/rules-directory-guide.md +298 -0
- package/src/config/claude-code-config/skills/meta-claude-memory/references/section-templates.md +347 -0
- package/src/config/claude-code-config/skills/meta-hooks-creator/SKILL.md +357 -0
- package/src/config/claude-code-config/skills/meta-hooks-creator/references/command-vs-prompt.md +287 -0
- package/src/config/claude-code-config/skills/meta-hooks-creator/references/examples.md +689 -0
- package/src/config/claude-code-config/skills/meta-hooks-creator/references/hook-types.md +495 -0
- package/src/config/claude-code-config/skills/meta-hooks-creator/references/input-output-schemas.md +503 -0
- package/src/config/claude-code-config/skills/meta-hooks-creator/references/matchers.md +517 -0
- package/src/config/claude-code-config/skills/meta-hooks-creator/references/troubleshooting.md +653 -0
- package/src/config/claude-code-config/skills/meta-prompt-creator/SKILL.md +285 -0
- package/src/config/claude-code-config/skills/meta-prompt-creator/references/anthropic-best-practices.md +126 -0
- package/src/config/claude-code-config/skills/meta-prompt-creator/references/anti-patterns.md +57 -0
- package/src/config/claude-code-config/skills/meta-prompt-creator/references/clarity-principles.md +54 -0
- package/src/config/claude-code-config/skills/meta-prompt-creator/references/context-management.md +389 -0
- package/src/config/claude-code-config/skills/meta-prompt-creator/references/few-shot-patterns.md +47 -0
- package/src/config/claude-code-config/skills/meta-prompt-creator/references/openai-best-practices.md +50 -0
- package/src/config/claude-code-config/skills/meta-prompt-creator/references/prompt-templates.md +110 -0
- package/src/config/claude-code-config/skills/meta-prompt-creator/references/reasoning-techniques.md +52 -0
- package/src/config/claude-code-config/skills/meta-prompt-creator/references/system-prompt-patterns.md +48 -0
- package/src/config/claude-code-config/skills/meta-prompt-creator/references/xml-structure.md +36 -0
- package/src/config/claude-code-config/skills/meta-skill-creator/LICENSE.txt +202 -0
- package/src/config/claude-code-config/skills/meta-skill-creator/SKILL.md +421 -0
- package/src/config/claude-code-config/skills/meta-skill-creator/package.json +5 -0
- package/src/config/claude-code-config/skills/meta-skill-creator/references/output-patterns.md +82 -0
- package/src/config/claude-code-config/skills/meta-skill-creator/references/progressive-disclosure-patterns.md +374 -0
- package/src/config/claude-code-config/skills/meta-skill-creator/references/prompting-integration.md +363 -0
- package/src/config/claude-code-config/skills/meta-skill-creator/references/real-world-examples.md +513 -0
- package/src/config/claude-code-config/skills/meta-skill-creator/references/script-patterns.md +385 -0
- package/src/config/claude-code-config/skills/meta-skill-creator/references/workflows.md +28 -0
- package/src/config/claude-code-config/skills/meta-skill-creator/references/xml-tag-guide.md +606 -0
- package/src/config/claude-code-config/skills/meta-skill-creator/scripts/init-skill.ts +214 -0
- package/src/config/claude-code-config/skills/meta-skill-creator/scripts/package-skill.ts +146 -0
- package/src/config/claude-code-config/skills/meta-skill-creator/scripts/validate.ts +138 -0
- package/src/config/claude-code-config/skills/meta-skill-workflow-creator/SKILL.md +390 -0
- package/src/config/claude-code-config/skills/meta-skill-workflow-creator/references/ask-patterns.md +225 -0
- package/src/config/claude-code-config/skills/meta-skill-workflow-creator/references/prompt-engineering.md +377 -0
- package/src/config/claude-code-config/skills/meta-skill-workflow-creator/references/state-management.md +275 -0
- package/src/config/claude-code-config/skills/meta-skill-workflow-creator/references/step-template.md +334 -0
- package/src/config/claude-code-config/skills/meta-skill-workflow-creator/references/workflow-patterns.md +300 -0
- package/src/config/claude-code-config/skills/meta-subagent-creator/SKILL.md +451 -0
- package/src/config/claude-code-config/skills/meta-subagent-creator/references/context-management.md +567 -0
- package/src/config/claude-code-config/skills/meta-subagent-creator/references/debugging-agents.md +714 -0
- package/src/config/claude-code-config/skills/meta-subagent-creator/references/error-handling-and-recovery.md +502 -0
- package/src/config/claude-code-config/skills/meta-subagent-creator/references/evaluation-and-testing.md +374 -0
- package/src/config/claude-code-config/skills/meta-subagent-creator/references/orchestration-patterns.md +591 -0
- package/src/config/claude-code-config/skills/meta-subagent-creator/references/subagents.md +599 -0
- package/src/config/claude-code-config/skills/meta-subagent-creator/references/writing-subagent-prompts.md +513 -0
- package/src/config/claude-code-config/skills/ralph-loop/SKILL.md +117 -0
- package/src/config/claude-code-config/skills/ralph-loop/scripts/setup.sh +278 -0
- package/src/config/claude-code-config/skills/ralph-loop/steps/step-00-init.md +215 -0
- package/src/config/claude-code-config/skills/ralph-loop/steps/step-01-interactive-prd.md +366 -0
- package/src/config/claude-code-config/skills/ralph-loop/steps/step-02-create-stories.md +273 -0
- package/src/config/claude-code-config/skills/ralph-loop/steps/step-03-finish.md +245 -0
- package/src/config/claude-code-config/skills/ralph-tasks/SKILL.md +88 -0
- package/src/config/claude-code-config/skills/ralph-tasks/scripts/add-task.sh +36 -0
- package/src/config/claude-code-config/skills/ralph-tasks/scripts/list-tasks.sh +66 -0
- package/src/config/claude-code-config/skills/ralph-tasks/scripts/remove-task.sh +47 -0
- package/src/config/claude-code-config/skills/ralph-tasks/scripts/setup.sh +201 -0
- package/src/config/claude-code-config/skills/ralph-tasks/steps/action-add-search.md +131 -0
- package/src/config/claude-code-config/skills/ralph-tasks/steps/action-add.md +46 -0
- package/src/config/claude-code-config/skills/ralph-tasks/steps/action-init.md +123 -0
- package/src/config/claude-code-config/skills/ralph-tasks/steps/action-list.md +58 -0
- package/src/config/claude-code-config/skills/ralph-tasks/steps/action-remove.md +48 -0
- package/src/config/claude-code-config/skills/ralph-tasks/steps/action-setup.md +46 -0
- package/src/config/claude-code-config/skills/ralph-tasks/steps/action-wake-up.md +62 -0
- package/src/config/claude-code-config/skills/utils-fix-errors/SKILL.md +61 -0
- package/src/config/claude-code-config/skills/utils-fix-grammar/SKILL.md +59 -0
- package/src/config/claude-code-config/skills/utils-oneshot/SKILL.md +56 -0
- package/src/config/claude-code-config/skills/utils-refactor/SKILL.md +89 -0
- package/src/config/claude-code-config/skills/utils-save-docs/SKILL.md +74 -0
- package/src/config/claude-code-config/skills/utils-ultrathink/SKILL.md +42 -0
- package/src/config/claude-code-config/skills/workflow-apex/SKILL.md +116 -0
- package/src/config/claude-code-config/skills/workflow-apex/scripts/setup-templates.sh +144 -0
- package/src/config/claude-code-config/skills/workflow-apex/scripts/update-progress.sh +80 -0
- package/src/config/claude-code-config/skills/workflow-apex/steps/step-00-init.md +273 -0
- package/src/config/claude-code-config/skills/workflow-apex/steps/step-00b-branch.md +126 -0
- package/src/config/claude-code-config/skills/workflow-apex/steps/step-00b-economy.md +244 -0
- package/src/config/claude-code-config/skills/workflow-apex/steps/step-00b-interactive.md +165 -0
- package/src/config/claude-code-config/skills/workflow-apex/steps/step-00b-save.md +123 -0
- package/src/config/claude-code-config/skills/workflow-apex/steps/step-01-analyze.md +361 -0
- package/src/config/claude-code-config/skills/workflow-apex/steps/step-02-plan.md +422 -0
- package/src/config/claude-code-config/skills/workflow-apex/steps/step-02b-tasks.md +301 -0
- package/src/config/claude-code-config/skills/workflow-apex/steps/step-03-execute-teams.md +297 -0
- package/src/config/claude-code-config/skills/workflow-apex/steps/step-03-execute.md +239 -0
- package/src/config/claude-code-config/skills/workflow-apex/steps/step-04-validate.md +264 -0
- package/src/config/claude-code-config/skills/workflow-apex/steps/step-05-examine.md +294 -0
- package/src/config/claude-code-config/skills/workflow-apex/steps/step-06-resolve.md +237 -0
- package/src/config/claude-code-config/skills/workflow-apex/steps/step-07-tests.md +250 -0
- package/src/config/claude-code-config/skills/workflow-apex/steps/step-08-run-tests.md +308 -0
- package/src/config/claude-code-config/skills/workflow-apex/steps/step-09-finish.md +193 -0
- package/src/config/claude-code-config/skills/workflow-apex/templates/00-context.md +53 -0
- package/src/config/claude-code-config/skills/workflow-apex/templates/01-analyze.md +10 -0
- package/src/config/claude-code-config/skills/workflow-apex/templates/02-plan.md +10 -0
- package/src/config/claude-code-config/skills/workflow-apex/templates/03-execute.md +10 -0
- package/src/config/claude-code-config/skills/workflow-apex/templates/04-validate.md +10 -0
- package/src/config/claude-code-config/skills/workflow-apex/templates/05-examine.md +10 -0
- package/src/config/claude-code-config/skills/workflow-apex/templates/06-resolve.md +10 -0
- package/src/config/claude-code-config/skills/workflow-apex/templates/07-tests.md +10 -0
- package/src/config/claude-code-config/skills/workflow-apex/templates/08-run-tests.md +10 -0
- package/src/config/claude-code-config/skills/workflow-apex/templates/09-finish.md +10 -0
- package/src/config/claude-code-config/skills/workflow-apex/templates/README.md +195 -0
- package/src/config/claude-code-config/skills/workflow-apex/templates/step-complete.md +7 -0
- package/src/config/claude-code-config/skills/workflow-brainstorm/SKILL.md +127 -0
- package/src/config/claude-code-config/skills/workflow-brainstorm/steps/step-01-explore.md +230 -0
- package/src/config/claude-code-config/skills/workflow-brainstorm/steps/step-02-challenge.md +238 -0
- package/src/config/claude-code-config/skills/workflow-brainstorm/steps/step-03-synthesize.md +337 -0
- package/src/config/claude-code-config/skills/workflow-brainstorm/steps/step-04-action.md +285 -0
- package/src/config/claude-code-config/skills/workflow-ci-fixer/SKILL.md +150 -0
- package/src/config/claude-code-config/skills/workflow-ci-fixer/references/cli-commands.md +122 -0
- package/src/config/claude-code-config/skills/workflow-ci-fixer/references/github-cli.md +243 -0
- package/src/config/claude-code-config/skills/workflow-ci-fixer/references/troubleshooting.md +362 -0
- package/src/config/claude-code-config/skills/workflow-ci-fixer/references/vercel-cli.md +192 -0
- package/src/config/claude-code-config/skills/workflow-ci-fixer/steps/step-00-init.md +157 -0
- package/src/config/claude-code-config/skills/workflow-ci-fixer/steps/step-01-watch-ci.md +192 -0
- package/src/config/claude-code-config/skills/workflow-ci-fixer/steps/step-02-analyze-errors.md +263 -0
- package/src/config/claude-code-config/skills/workflow-ci-fixer/steps/step-03-fix-locally.md +312 -0
- package/src/config/claude-code-config/skills/workflow-ci-fixer/steps/step-04-commit-push.md +206 -0
- package/src/config/claude-code-config/skills/workflow-ci-fixer/steps/step-05-cleanup.md +196 -0
- package/src/config/claude-code-config/skills/workflow-clean-code/SKILL.md +129 -0
- package/src/config/claude-code-config/skills/workflow-clean-code/references/general-clean-code.md +347 -0
- package/src/config/claude-code-config/skills/workflow-clean-code/references/nextjs-clean-code.md +458 -0
- package/src/config/claude-code-config/skills/workflow-clean-code/references/react-clean-code.md +406 -0
- package/src/config/claude-code-config/skills/workflow-clean-code/references/tanstack-query-best-practices.md +516 -0
- package/src/config/claude-code-config/skills/workflow-clean-code/references/zustand-best-practices.md +491 -0
- package/src/config/claude-code-config/skills/workflow-clean-code/steps/step-01-scan.md +137 -0
- package/src/config/claude-code-config/skills/workflow-clean-code/steps/step-02-apply.md +152 -0
- package/src/config/claude-code-config/skills/workflow-clean-code/steps/step-03-verify.md +143 -0
- package/src/config/claude-code-config/skills/workflow-debug/SKILL.md +126 -0
- package/src/config/claude-code-config/skills/workflow-debug/references/log-technique.md +285 -0
- package/src/config/claude-code-config/skills/workflow-debug/steps/step-00-init.md +94 -0
- package/src/config/claude-code-config/skills/workflow-debug/steps/step-01-analyze.md +180 -0
- package/src/config/claude-code-config/skills/workflow-debug/steps/step-01b-log-instrumentation.md +271 -0
- package/src/config/claude-code-config/skills/workflow-debug/steps/step-02-find-solutions.md +141 -0
- package/src/config/claude-code-config/skills/workflow-debug/steps/step-03-propose.md +142 -0
- package/src/config/claude-code-config/skills/workflow-debug/steps/step-04-fix.md +176 -0
- package/src/config/claude-code-config/skills/workflow-debug/steps/step-05-verify.md +279 -0
- package/src/config/claude-code-config/skills/workflow-review-code/SKILL.md +219 -0
- package/src/config/claude-code-config/skills/workflow-review-code/references/clean-code-principles.md +140 -0
- package/src/config/claude-code-config/skills/workflow-review-code/references/code-quality-metrics.md +174 -0
- package/src/config/claude-code-config/skills/workflow-review-code/references/feedback-patterns.md +149 -0
- package/src/config/claude-code-config/skills/workflow-review-code/references/security-checklist.md +127 -0
- package/src/config/claude-code-config/song/finish.mp3 +0 -0
- package/src/config/claude-code-config/song/need-human.mp3 +0 -0
|
@@ -0,0 +1,219 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: review-code
|
|
3
|
+
description: This skill should be used when the user asks to "review code", "review this PR", "code review", "audit this code", or mentions reviewing pull requests, security checks, or code quality. Covers security (OWASP), clean code (SOLID), code smells, complexity metrics, and high-value feedback patterns. Focuses on impactful issues, not nitpicks.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
<objective>
|
|
7
|
+
Provide expert-level code review guidance that focuses on high-impact issues: security vulnerabilities, logic errors, maintainability problems, and architectural concerns. Skip nitpicks and style issues that should be automated.
|
|
8
|
+
|
|
9
|
+
Based on research from Google, Microsoft, OWASP, and academic studies on code review effectiveness.
|
|
10
|
+
</objective>
|
|
11
|
+
|
|
12
|
+
<quick_start>
|
|
13
|
+
<review_priority>
|
|
14
|
+
**Priority order**: Security > Correctness > Maintainability > Performance
|
|
15
|
+
|
|
16
|
+
**High-value feedback** (36-43% implementation rate):
|
|
17
|
+
- Bug fixes and logic errors
|
|
18
|
+
- Security vulnerabilities
|
|
19
|
+
- Readability/maintainability issues
|
|
20
|
+
- Missing error handling
|
|
21
|
+
|
|
22
|
+
**Skip these** (automate instead):
|
|
23
|
+
- Formatting/whitespace
|
|
24
|
+
- Simple naming conventions
|
|
25
|
+
- Linting violations
|
|
26
|
+
</review_priority>
|
|
27
|
+
|
|
28
|
+
<essential_checks>
|
|
29
|
+
1. **Security**: Input validation, auth checks, secrets exposure
|
|
30
|
+
2. **Logic**: Edge cases, error handling, null checks
|
|
31
|
+
3. **Architecture**: Single responsibility, proper abstractions
|
|
32
|
+
4. **Tests**: Coverage for new functionality
|
|
33
|
+
</essential_checks>
|
|
34
|
+
</quick_start>
|
|
35
|
+
|
|
36
|
+
<review_categories>
|
|
37
|
+
<category name="security" priority="critical">
|
|
38
|
+
**Must check in every review:**
|
|
39
|
+
- No hardcoded credentials (search: `password.*=.*['"]`, `api[_-]?key.*=`)
|
|
40
|
+
- Input validation on all user data
|
|
41
|
+
- Parameterized queries (no string concatenation for SQL)
|
|
42
|
+
- Authorization checks on every endpoint
|
|
43
|
+
- No `eval()`, `exec()`, dangerous functions
|
|
44
|
+
|
|
45
|
+
See [references/security-checklist.md](references/security-checklist.md) for OWASP Top 10 patterns.
|
|
46
|
+
</category>
|
|
47
|
+
|
|
48
|
+
<category name="logic" priority="critical">
|
|
49
|
+
**Verify correctness:**
|
|
50
|
+
- Business logic matches requirements
|
|
51
|
+
- Edge cases handled (null, empty, boundary values)
|
|
52
|
+
- Error handling present and appropriate
|
|
53
|
+
- Race conditions in async code
|
|
54
|
+
- Resource cleanup (connections, file handles)
|
|
55
|
+
</category>
|
|
56
|
+
|
|
57
|
+
<category name="clean_code" priority="high">
|
|
58
|
+
**Check for code smells:**
|
|
59
|
+
- Large functions (>50 lines) - violate Single Responsibility
|
|
60
|
+
- Deep nesting (>3 levels) - extract to functions
|
|
61
|
+
- Long parameter lists (>3 params) - use objects
|
|
62
|
+
- Duplicated code - extract to shared functions
|
|
63
|
+
- Magic numbers/strings - use named constants
|
|
64
|
+
|
|
65
|
+
See [references/clean-code-principles.md](references/clean-code-principles.md) for SOLID principles and code smells.
|
|
66
|
+
</category>
|
|
67
|
+
|
|
68
|
+
<category name="maintainability" priority="medium">
|
|
69
|
+
**Assess long-term health:**
|
|
70
|
+
- Cognitive complexity <15 per function
|
|
71
|
+
- Clear naming that reveals intent
|
|
72
|
+
- Appropriate abstractions (not over-engineered)
|
|
73
|
+
- Test coverage for critical paths
|
|
74
|
+
</category>
|
|
75
|
+
</review_categories>
|
|
76
|
+
|
|
77
|
+
<feedback_guidelines>
|
|
78
|
+
<valuable_feedback>
|
|
79
|
+
**Structure**: What + Why + How
|
|
80
|
+
|
|
81
|
+
✓ "This function is 80 lines with 5 responsibilities. Consider extracting the validation logic (lines 20-45) into `validateUserInput()` for testability."
|
|
82
|
+
|
|
83
|
+
✓ "SQL query uses string concatenation (line 34). Use parameterized queries to prevent injection: `db.query('SELECT * FROM users WHERE id = ?', [userId])`"
|
|
84
|
+
|
|
85
|
+
✓ "Missing null check on `user.profile` (line 52). This will throw if user hasn't completed onboarding. Add: `if (!user.profile) return defaultProfile;`"
|
|
86
|
+
</valuable_feedback>
|
|
87
|
+
|
|
88
|
+
<wasteful_feedback>
|
|
89
|
+
✗ "This could be cleaner" (vague)
|
|
90
|
+
✗ "Rename this variable" (nitpick - use linter)
|
|
91
|
+
✗ "Add a comment here" (if code is clear, no comment needed)
|
|
92
|
+
✗ "I would do this differently" (subjective without reason)
|
|
93
|
+
</wasteful_feedback>
|
|
94
|
+
|
|
95
|
+
<priority_labels>
|
|
96
|
+
Use clear labels to distinguish severity:
|
|
97
|
+
- **[BLOCKING]**: Must fix before merge (security, bugs)
|
|
98
|
+
- **[SUGGESTION]**: Would improve code but not required
|
|
99
|
+
- **[NIT]**: Minor preference (mark clearly or skip entirely)
|
|
100
|
+
</priority_labels>
|
|
101
|
+
|
|
102
|
+
See [references/feedback-patterns.md](references/feedback-patterns.md) for communication strategies.
|
|
103
|
+
</feedback_guidelines>
|
|
104
|
+
|
|
105
|
+
<code_quality_metrics>
|
|
106
|
+
<metric name="cognitive_complexity">
|
|
107
|
+
- Target: <15 per function, <50 per module
|
|
108
|
+
- Each nesting level adds complexity
|
|
109
|
+
- Prefer early returns over deep nesting
|
|
110
|
+
</metric>
|
|
111
|
+
|
|
112
|
+
<metric name="function_size">
|
|
113
|
+
- Target: <50 lines, ideally <20
|
|
114
|
+
- Should fit on one screen
|
|
115
|
+
- One function = one responsibility
|
|
116
|
+
</metric>
|
|
117
|
+
|
|
118
|
+
<metric name="cyclomatic_complexity">
|
|
119
|
+
- Target: <10 per function
|
|
120
|
+
- Count: 1 + (if + while + for + case + catch + && + ||)
|
|
121
|
+
- High complexity = hard to test
|
|
122
|
+
</metric>
|
|
123
|
+
|
|
124
|
+
See [references/code-quality-metrics.md](references/code-quality-metrics.md) for detailed calculations.
|
|
125
|
+
</code_quality_metrics>
|
|
126
|
+
|
|
127
|
+
<anti_patterns>
|
|
128
|
+
<pattern name="nitpicking">
|
|
129
|
+
**Problem**: Excessive minor comments bury critical issues
|
|
130
|
+
**Impact**: Developers become defensive, stop reading feedback
|
|
131
|
+
**Solution**: Automate style with linters; focus humans on logic/security
|
|
132
|
+
</pattern>
|
|
133
|
+
|
|
134
|
+
<pattern name="vague_criticism">
|
|
135
|
+
**Problem**: "This is wrong" without explanation
|
|
136
|
+
**Impact**: Developer doesn't know how to fix; creates friction
|
|
137
|
+
**Solution**: Always include What + Why + How
|
|
138
|
+
</pattern>
|
|
139
|
+
|
|
140
|
+
<pattern name="blocking_on_preferences">
|
|
141
|
+
**Problem**: Blocking merge for subjective style preferences
|
|
142
|
+
**Impact**: Delays delivery; damages team trust
|
|
143
|
+
**Solution**: Reserve blocking for security/correctness only
|
|
144
|
+
</pattern>
|
|
145
|
+
|
|
146
|
+
<pattern name="reviewing_unchanged_code">
|
|
147
|
+
**Problem**: Commenting on code outside the PR diff
|
|
148
|
+
**Impact**: Scope creep; unfair to author
|
|
149
|
+
**Solution**: Focus only on changed lines; file separate issues for existing problems
|
|
150
|
+
</pattern>
|
|
151
|
+
</anti_patterns>
|
|
152
|
+
|
|
153
|
+
<react_nextjs_review>
|
|
154
|
+
## React/Next.js Codebase Detection
|
|
155
|
+
|
|
156
|
+
**When reviewing a React or Next.js project**, launch an additional parallel agent for Vercel React best practices.
|
|
157
|
+
|
|
158
|
+
<detection>
|
|
159
|
+
**Detect React/Next.js codebase by checking:**
|
|
160
|
+
- `package.json` contains `"next"` or `"react"` dependencies
|
|
161
|
+
- Files with `.tsx`, `.jsx` extensions in changes
|
|
162
|
+
- `next.config.js` or `next.config.ts` exists
|
|
163
|
+
- `app/` or `pages/` directory structure (Next.js)
|
|
164
|
+
</detection>
|
|
165
|
+
|
|
166
|
+
<parallel_agent>
|
|
167
|
+
**If React/Next.js detected, launch parallel agent:**
|
|
168
|
+
|
|
169
|
+
```yaml
|
|
170
|
+
agent:
|
|
171
|
+
type: code-reviewer
|
|
172
|
+
focus: "vercel-react-best-practices"
|
|
173
|
+
task: |
|
|
174
|
+
Review the recent code changes using Vercel React best practices.
|
|
175
|
+
Focus on:
|
|
176
|
+
- Eliminating waterfalls (async patterns, Promise.all)
|
|
177
|
+
- Bundle size optimization (dynamic imports, barrel files)
|
|
178
|
+
- Server-side performance (caching, serialization)
|
|
179
|
+
- Re-render optimization (memoization, state management)
|
|
180
|
+
- Rendering performance patterns
|
|
181
|
+
|
|
182
|
+
Use the /vercel-react-best-practices skill as reference.
|
|
183
|
+
Report findings with [BLOCKING], [SUGGESTION], or [NIT] labels.
|
|
184
|
+
```
|
|
185
|
+
|
|
186
|
+
**Execution:**
|
|
187
|
+
1. Check for React/Next.js in `package.json`
|
|
188
|
+
2. If detected, use Task tool to launch parallel agent:
|
|
189
|
+
```
|
|
190
|
+
Task tool with subagent_type="code-reviewer":
|
|
191
|
+
"Review recent changes against Vercel React best practices from /vercel-react-best-practices skill.
|
|
192
|
+
Focus on: async patterns, bundle optimization, server performance, re-renders.
|
|
193
|
+
Check changed files for violations of rules like async-parallel, bundle-barrel-imports,
|
|
194
|
+
server-cache-react, rerender-memo. Report with priority labels."
|
|
195
|
+
```
|
|
196
|
+
3. Merge findings into main review output
|
|
197
|
+
</parallel_agent>
|
|
198
|
+
</react_nextjs_review>
|
|
199
|
+
|
|
200
|
+
<success_criteria>
|
|
201
|
+
A good code review:
|
|
202
|
+
- Identifies security vulnerabilities (if any)
|
|
203
|
+
- Catches logic errors and edge cases
|
|
204
|
+
- Flags maintainability issues with specific fixes
|
|
205
|
+
- Uses priority labels ([BLOCKING] vs [SUGGESTION])
|
|
206
|
+
- Provides actionable feedback (What + Why + How)
|
|
207
|
+
- Avoids nitpicks on style/formatting
|
|
208
|
+
- Completes in reasonable time (<4 hours for small PRs)
|
|
209
|
+
- **[React/Next.js]** Includes Vercel best practices review when applicable
|
|
210
|
+
</success_criteria>
|
|
211
|
+
|
|
212
|
+
<reference_guides>
|
|
213
|
+
For detailed guidance and patterns:
|
|
214
|
+
|
|
215
|
+
- **`references/security-checklist.md`** - OWASP Top 10, authentication patterns, input validation, common vulnerabilities
|
|
216
|
+
- **`references/clean-code-principles.md`** - SOLID principles, naming conventions, function design, code smell detection
|
|
217
|
+
- **`references/feedback-patterns.md`** - Valuable vs wasteful feedback patterns, communication strategies, priority labeling
|
|
218
|
+
- **`references/code-quality-metrics.md`** - Complexity calculations, maintainability index, measurement techniques
|
|
219
|
+
</reference_guides>
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
<overview>
|
|
2
|
+
Clean code principles based on Robert Martin's Clean Code and industry research. SOLID principles, naming conventions, and code smell detection.
|
|
3
|
+
</overview>
|
|
4
|
+
|
|
5
|
+
<solid_principles>
|
|
6
|
+
| Principle | Rule | Violation Sign |
|
|
7
|
+
|-----------|------|----------------|
|
|
8
|
+
| **S**ingle Responsibility | One reason to change | Class/function does multiple things |
|
|
9
|
+
| **O**pen/Closed | Open for extension, closed for modification | Adding features requires changing existing code |
|
|
10
|
+
| **L**iskov Substitution | Subtypes must be substitutable | Subclass breaks when used as parent |
|
|
11
|
+
| **I**nterface Segregation | No forced dependencies | Implementing unused interface methods |
|
|
12
|
+
| **D**ependency Inversion | Depend on abstractions | Direct instantiation of dependencies |
|
|
13
|
+
</solid_principles>
|
|
14
|
+
|
|
15
|
+
<function_guidelines>
|
|
16
|
+
<size_and_scope>
|
|
17
|
+
Function size targets:
|
|
18
|
+
|
|
19
|
+
- Maximum 50 lines (ideally <20)
|
|
20
|
+
- Do ONE thing well
|
|
21
|
+
- Single level of abstraction
|
|
22
|
+
- Fit on one screen without scrolling
|
|
23
|
+
</size_and_scope>
|
|
24
|
+
|
|
25
|
+
<parameters>
|
|
26
|
+
Parameter limits:
|
|
27
|
+
|
|
28
|
+
- Maximum 3 parameters
|
|
29
|
+
- Avoid flag arguments (split into separate methods)
|
|
30
|
+
- Use objects for related parameters
|
|
31
|
+
</parameters>
|
|
32
|
+
|
|
33
|
+
<naming>
|
|
34
|
+
Function naming patterns:
|
|
35
|
+
|
|
36
|
+
- Verbs for functions: `getUserById()`, `calculateTotal()`
|
|
37
|
+
- Reveals intent without reading body
|
|
38
|
+
- No abbreviations: `getTransaction()` not `getTx()`
|
|
39
|
+
</naming>
|
|
40
|
+
</function_guidelines>
|
|
41
|
+
|
|
42
|
+
<naming_conventions>
|
|
43
|
+
General naming rules:
|
|
44
|
+
|
|
45
|
+
✓ Descriptive, unambiguous names
|
|
46
|
+
✓ Pronounceable and searchable
|
|
47
|
+
✓ Class names: nouns (User, PaymentProcessor)
|
|
48
|
+
✓ Method names: verbs (validate, calculate, fetch)
|
|
49
|
+
✗ Single letter variables (except loop counters)
|
|
50
|
+
✗ Hungarian notation (strName, intCount)
|
|
51
|
+
✗ Abbreviations (usr, txn, cfg)
|
|
52
|
+
</naming_conventions>
|
|
53
|
+
|
|
54
|
+
<code_smells>
|
|
55
|
+
<critical_smells>
|
|
56
|
+
Flag these in review:
|
|
57
|
+
|
|
58
|
+
| Smell | Detection | Fix |
|
|
59
|
+
|-------|-----------|-----|
|
|
60
|
+
| **Duplicated Code** | Same logic in 2+ places | Extract to shared function |
|
|
61
|
+
| **Large Class/Method** | >50 lines, multiple responsibilities | Split by responsibility |
|
|
62
|
+
| **Long Parameter List** | >3 parameters | Use parameter object |
|
|
63
|
+
| **Feature Envy** | Method uses another class's data more | Move method to that class |
|
|
64
|
+
| **God Object** | One class controls everything | Split into focused classes |
|
|
65
|
+
</critical_smells>
|
|
66
|
+
|
|
67
|
+
<medium_smells>
|
|
68
|
+
Suggest these fixes:
|
|
69
|
+
|
|
70
|
+
| Smell | Detection | Fix |
|
|
71
|
+
|-------|-----------|-----|
|
|
72
|
+
| **Deep Nesting** | >3 levels of indentation | Guard clauses, early returns |
|
|
73
|
+
| **Magic Numbers** | Unexplained literals | Named constants |
|
|
74
|
+
| **Dead Code** | Commented-out or unreachable code | Delete it |
|
|
75
|
+
| **Shotgun Surgery** | Small change touches many files | Consolidate related code |
|
|
76
|
+
</medium_smells>
|
|
77
|
+
</code_smells>
|
|
78
|
+
|
|
79
|
+
<complexity_reduction>
|
|
80
|
+
<example_before>
|
|
81
|
+
Complex nested conditions:
|
|
82
|
+
|
|
83
|
+
```javascript
|
|
84
|
+
function process(user) {
|
|
85
|
+
if (user) {
|
|
86
|
+
if (user.isActive) {
|
|
87
|
+
if (user.hasPermission) {
|
|
88
|
+
// actual logic here
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
```
|
|
94
|
+
</example_before>
|
|
95
|
+
|
|
96
|
+
<example_after>
|
|
97
|
+
Simplified with guard clauses:
|
|
98
|
+
|
|
99
|
+
```javascript
|
|
100
|
+
function process(user) {
|
|
101
|
+
if (!user) return;
|
|
102
|
+
if (!user.isActive) return;
|
|
103
|
+
if (!user.hasPermission) return;
|
|
104
|
+
|
|
105
|
+
// actual logic here
|
|
106
|
+
}
|
|
107
|
+
```
|
|
108
|
+
</example_after>
|
|
109
|
+
</complexity_reduction>
|
|
110
|
+
|
|
111
|
+
<comments_best_practices>
|
|
112
|
+
<good_comments>
|
|
113
|
+
Valuable comments explain:
|
|
114
|
+
|
|
115
|
+
- Explain WHY (intent), not WHAT (code does that)
|
|
116
|
+
- Warn of consequences
|
|
117
|
+
- TODO with ticket number
|
|
118
|
+
</good_comments>
|
|
119
|
+
|
|
120
|
+
<bad_comments>
|
|
121
|
+
Avoid these comment types:
|
|
122
|
+
|
|
123
|
+
- Redundant (restates the code)
|
|
124
|
+
- Commented-out code (delete it)
|
|
125
|
+
- Closing brace comments (`} // end if`)
|
|
126
|
+
- Journal comments (use git history)
|
|
127
|
+
</bad_comments>
|
|
128
|
+
</comments_best_practices>
|
|
129
|
+
|
|
130
|
+
<boy_scout_rule>
|
|
131
|
+
> Leave code cleaner than you found it.
|
|
132
|
+
|
|
133
|
+
**Important**: In PRs, only clean code already being changed. Don't expand scope.
|
|
134
|
+
</boy_scout_rule>
|
|
135
|
+
|
|
136
|
+
<sources>
|
|
137
|
+
- Clean Code by Robert C. Martin
|
|
138
|
+
- [Google Engineering Practices](https://google.github.io/eng-practices/)
|
|
139
|
+
- [Microsoft Code Review Guide](https://microsoft.github.io/code-with-engineering-playbook/)
|
|
140
|
+
</sources>
|
package/src/config/claude-code-config/skills/workflow-review-code/references/code-quality-metrics.md
ADDED
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
<overview>
|
|
2
|
+
Quantitative code quality metrics for informed review decisions. Includes cognitive complexity, cyclomatic complexity, maintainability index, and technical debt indicators.
|
|
3
|
+
</overview>
|
|
4
|
+
|
|
5
|
+
<cognitive_complexity>
|
|
6
|
+
<definition>
|
|
7
|
+
**What it measures**: Mental effort required to understand code
|
|
8
|
+
</definition>
|
|
9
|
+
|
|
10
|
+
<targets>
|
|
11
|
+
Target complexity levels:
|
|
12
|
+
|
|
13
|
+
- Per function: <15 (ideal <10)
|
|
14
|
+
- Per module: <50
|
|
15
|
+
- Per file: <100
|
|
16
|
+
</targets>
|
|
17
|
+
|
|
18
|
+
<complexity_factors>
|
|
19
|
+
Factors that increase complexity:
|
|
20
|
+
|
|
21
|
+
- Each nesting level (+1 per level)
|
|
22
|
+
- Logical operators (&&, ||)
|
|
23
|
+
- Recursion
|
|
24
|
+
- Breaks in linear flow (break, continue, goto)
|
|
25
|
+
</complexity_factors>
|
|
26
|
+
|
|
27
|
+
<reduction_example>
|
|
28
|
+
Reducing cognitive complexity:
|
|
29
|
+
|
|
30
|
+
```javascript
|
|
31
|
+
// HIGH COMPLEXITY (nested conditionals)
|
|
32
|
+
function process(data) {
|
|
33
|
+
if (data) {
|
|
34
|
+
if (data.valid) {
|
|
35
|
+
if (data.items.length > 0) {
|
|
36
|
+
for (const item of data.items) {
|
|
37
|
+
if (item.active) {
|
|
38
|
+
// process
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
// LOW COMPLEXITY (guard clauses + extraction)
|
|
47
|
+
function process(data) {
|
|
48
|
+
if (!data?.valid) return;
|
|
49
|
+
if (!data.items?.length) return;
|
|
50
|
+
|
|
51
|
+
processActiveItems(data.items);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
function processActiveItems(items) {
|
|
55
|
+
const active = items.filter(item => item.active);
|
|
56
|
+
active.forEach(processItem);
|
|
57
|
+
}
|
|
58
|
+
```
|
|
59
|
+
</reduction_example>
|
|
60
|
+
</cognitive_complexity>
|
|
61
|
+
|
|
62
|
+
<cyclomatic_complexity>
|
|
63
|
+
<definition>
|
|
64
|
+
**What it measures**: Number of independent paths through code
|
|
65
|
+
</definition>
|
|
66
|
+
|
|
67
|
+
<formula>
|
|
68
|
+
**Formula**: 1 + (if + while + for + case + catch + && + ||)
|
|
69
|
+
</formula>
|
|
70
|
+
|
|
71
|
+
<targets>
|
|
72
|
+
| Score | Risk | Action |
|
|
73
|
+
|-------|------|--------|
|
|
74
|
+
| 1-4 | Low | Good |
|
|
75
|
+
| 5-7 | Moderate | Consider simplifying |
|
|
76
|
+
| 8-10 | High | Refactor recommended |
|
|
77
|
+
| >10 | Very High | Must refactor |
|
|
78
|
+
</targets>
|
|
79
|
+
</cyclomatic_complexity>
|
|
80
|
+
|
|
81
|
+
<function_size_metrics>
|
|
82
|
+
| Metric | Target | Warning | Critical |
|
|
83
|
+
|--------|--------|---------|----------|
|
|
84
|
+
| Lines | <20 | >30 | >50 |
|
|
85
|
+
| Parameters | ≤3 | 4 | >5 |
|
|
86
|
+
| Nesting depth | ≤2 | 3 | >3 |
|
|
87
|
+
| Return statements | 1-2 | 3-4 | >4 |
|
|
88
|
+
</function_size_metrics>
|
|
89
|
+
|
|
90
|
+
<maintainability_index>
|
|
91
|
+
<formula>
|
|
92
|
+
Microsoft's formula:
|
|
93
|
+
|
|
94
|
+
```
|
|
95
|
+
MI = MAX(0, (171 - 5.2*ln(HalsteadVolume) - 0.23*CC - 16.2*ln(LOC)) * 100/171)
|
|
96
|
+
```
|
|
97
|
+
</formula>
|
|
98
|
+
|
|
99
|
+
<interpretation>
|
|
100
|
+
| Score | Maintainability |
|
|
101
|
+
|-------|-----------------|
|
|
102
|
+
| 80-100 | High - easy to maintain |
|
|
103
|
+
| 60-79 | Moderate - some concerns |
|
|
104
|
+
| 40-59 | Low - refactoring recommended |
|
|
105
|
+
| <40 | Very Low - significant refactoring needed |
|
|
106
|
+
</interpretation>
|
|
107
|
+
</maintainability_index>
|
|
108
|
+
|
|
109
|
+
<technical_debt_indicators>
|
|
110
|
+
| Indicator | Healthy | Warning |
|
|
111
|
+
|-----------|---------|---------|
|
|
112
|
+
| Code duplication | <5% | >10% |
|
|
113
|
+
| Test coverage | >80% | <60% |
|
|
114
|
+
| Cyclomatic complexity avg | <5 | >8 |
|
|
115
|
+
| TODO/FIXME count | Stable | Growing |
|
|
116
|
+
| Dependency age | <6 months | >12 months |
|
|
117
|
+
</technical_debt_indicators>
|
|
118
|
+
|
|
119
|
+
<code_churn>
|
|
120
|
+
<definition>
|
|
121
|
+
**What it measures**: Frequency of code changes
|
|
122
|
+
</definition>
|
|
123
|
+
|
|
124
|
+
<warning_signs>
|
|
125
|
+
Signs of problematic churn:
|
|
126
|
+
|
|
127
|
+
- Same file changed in >50% of recent commits
|
|
128
|
+
- High churn + low test coverage = risk
|
|
129
|
+
- Late-project churn indicates instability
|
|
130
|
+
</warning_signs>
|
|
131
|
+
</code_churn>
|
|
132
|
+
|
|
133
|
+
<review_thresholds>
|
|
134
|
+
<must_comment>
|
|
135
|
+
Always comment on:
|
|
136
|
+
|
|
137
|
+
- Function complexity >15
|
|
138
|
+
- Nesting >3 levels
|
|
139
|
+
- Function >50 lines
|
|
140
|
+
- >3 parameters without object
|
|
141
|
+
</must_comment>
|
|
142
|
+
|
|
143
|
+
<consider_commenting>
|
|
144
|
+
Consider commenting on:
|
|
145
|
+
|
|
146
|
+
- Duplicated blocks >10 lines
|
|
147
|
+
- Method doing multiple things
|
|
148
|
+
- Unclear naming
|
|
149
|
+
</consider_commenting>
|
|
150
|
+
|
|
151
|
+
<dont_comment>
|
|
152
|
+
Skip commenting on:
|
|
153
|
+
|
|
154
|
+
- Slightly suboptimal but working code
|
|
155
|
+
- Style preferences
|
|
156
|
+
- Minor naming improvements
|
|
157
|
+
</dont_comment>
|
|
158
|
+
</review_thresholds>
|
|
159
|
+
|
|
160
|
+
<measurement_tools>
|
|
161
|
+
| Language | Tool |
|
|
162
|
+
|----------|------|
|
|
163
|
+
| JavaScript/TypeScript | ESLint (complexity rules), SonarQube |
|
|
164
|
+
| Python | Radon, Pylint |
|
|
165
|
+
| Java | SonarQube, PMD |
|
|
166
|
+
| Go | gocyclo, golangci-lint |
|
|
167
|
+
| General | SonarQube, CodeClimate |
|
|
168
|
+
</measurement_tools>
|
|
169
|
+
|
|
170
|
+
<sources>
|
|
171
|
+
- [SonarQube Cognitive Complexity](https://www.sonarsource.com/docs/CognitiveComplexity.pdf)
|
|
172
|
+
- [Microsoft Maintainability Index](https://learn.microsoft.com/en-us/visualstudio/code-quality/code-metrics-maintainability-index-range-and-meaning)
|
|
173
|
+
- [Cyclomatic Complexity](https://en.wikipedia.org/wiki/Cyclomatic_complexity)
|
|
174
|
+
</sources>
|
package/src/config/claude-code-config/skills/workflow-review-code/references/feedback-patterns.md
ADDED
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
<overview>
|
|
2
|
+
Code review feedback patterns based on research from Google, Microsoft, and academic studies on effective code review communication.
|
|
3
|
+
</overview>
|
|
4
|
+
|
|
5
|
+
<what_why_how_pattern>
|
|
6
|
+
Every valuable comment includes three components:
|
|
7
|
+
|
|
8
|
+
1. **What**: The specific issue
|
|
9
|
+
2. **Why**: Why it matters
|
|
10
|
+
3. **How**: Concrete fix or direction
|
|
11
|
+
|
|
12
|
+
<good_example>
|
|
13
|
+
```
|
|
14
|
+
[BLOCKING] SQL injection vulnerability at line 34.
|
|
15
|
+
The query uses string concatenation with user input, allowing attackers to modify the query.
|
|
16
|
+
Fix: Use parameterized query: db.query('SELECT * FROM users WHERE id = ?', [userId])
|
|
17
|
+
```
|
|
18
|
+
</good_example>
|
|
19
|
+
|
|
20
|
+
<bad_example>
|
|
21
|
+
```
|
|
22
|
+
This query looks unsafe.
|
|
23
|
+
```
|
|
24
|
+
</bad_example>
|
|
25
|
+
</what_why_how_pattern>
|
|
26
|
+
|
|
27
|
+
<priority_labels>
|
|
28
|
+
Use consistent labels so authors know severity:
|
|
29
|
+
|
|
30
|
+
| Label | Meaning | Merge? |
|
|
31
|
+
|-------|---------|--------|
|
|
32
|
+
| `[BLOCKING]` | Must fix - security, bugs, missing requirements | No |
|
|
33
|
+
| `[CRITICAL]` | Strongly recommended - architecture, major issues | Discuss |
|
|
34
|
+
| `[SUGGESTION]` | Would improve code - not required | Yes |
|
|
35
|
+
| `[NIT]` | Minor preference - skip if busy | Yes |
|
|
36
|
+
| `[QUESTION]` | Need clarification - not blocking | Yes |
|
|
37
|
+
</priority_labels>
|
|
38
|
+
|
|
39
|
+
<feedback_value>
|
|
40
|
+
<high_value>
|
|
41
|
+
High-value feedback (36-43% implementation rate):
|
|
42
|
+
|
|
43
|
+
- Security vulnerabilities with exploit scenario
|
|
44
|
+
- Logic errors with failing test case
|
|
45
|
+
- Missing error handling with consequences
|
|
46
|
+
- Performance issues with measurements
|
|
47
|
+
</high_value>
|
|
48
|
+
|
|
49
|
+
<wasteful>
|
|
50
|
+
Wasteful feedback (damages team dynamics):
|
|
51
|
+
|
|
52
|
+
- Style preferences covered by linters
|
|
53
|
+
- Renaming suggestions without clear benefit
|
|
54
|
+
- "I would do it differently" without why
|
|
55
|
+
- Comments on code outside the diff
|
|
56
|
+
</wasteful>
|
|
57
|
+
</feedback_value>
|
|
58
|
+
|
|
59
|
+
<communication_patterns>
|
|
60
|
+
<collaborative_framing>
|
|
61
|
+
Use collaborative, question-based framing:
|
|
62
|
+
|
|
63
|
+
```
|
|
64
|
+
✓ "Have you considered using a Map here for O(1) lookup?"
|
|
65
|
+
✓ "This could throw if user is null - should we add a check?"
|
|
66
|
+
✓ "I'm not sure I understand this logic - could you explain?"
|
|
67
|
+
|
|
68
|
+
✗ "You need to fix this."
|
|
69
|
+
✗ "This is wrong."
|
|
70
|
+
✗ "Obviously this should be..."
|
|
71
|
+
```
|
|
72
|
+
</collaborative_framing>
|
|
73
|
+
|
|
74
|
+
<avoid_belittling>
|
|
75
|
+
Remove belittling words: "just", "simply", "obviously", "easy", "only"
|
|
76
|
+
|
|
77
|
+
```
|
|
78
|
+
✗ "Just add a null check"
|
|
79
|
+
✗ "This is obviously wrong"
|
|
80
|
+
✓ "Add a null check for user.profile"
|
|
81
|
+
```
|
|
82
|
+
</avoid_belittling>
|
|
83
|
+
</communication_patterns>
|
|
84
|
+
|
|
85
|
+
<merge_decisions>
|
|
86
|
+
<block_merge>
|
|
87
|
+
Block merge for:
|
|
88
|
+
|
|
89
|
+
- Security vulnerabilities (any severity)
|
|
90
|
+
- Logic bugs that affect functionality
|
|
91
|
+
- Missing required tests
|
|
92
|
+
- Breaking API changes without migration
|
|
93
|
+
</block_merge>
|
|
94
|
+
|
|
95
|
+
<approve_with_comments>
|
|
96
|
+
Approve with comments for:
|
|
97
|
+
|
|
98
|
+
- Suggestions for future improvement
|
|
99
|
+
- Minor refactoring opportunities
|
|
100
|
+
- Documentation improvements
|
|
101
|
+
- Style preferences (should be in linter)
|
|
102
|
+
</approve_with_comments>
|
|
103
|
+
|
|
104
|
+
<approve_clean>
|
|
105
|
+
Approve cleanly when:
|
|
106
|
+
|
|
107
|
+
- Code meets requirements
|
|
108
|
+
- Tests pass
|
|
109
|
+
- No security issues
|
|
110
|
+
- Follows project conventions
|
|
111
|
+
</approve_clean>
|
|
112
|
+
</merge_decisions>
|
|
113
|
+
|
|
114
|
+
<avoiding_nitpick_culture>
|
|
115
|
+
**Research finding**: Nitpicking damages team relationships more than it improves code quality. Developers become defensive and less receptive to legitimate feedback.
|
|
116
|
+
|
|
117
|
+
<solution>
|
|
118
|
+
1. Automate style enforcement (linters, formatters)
|
|
119
|
+
2. Block CI on lint failures, not PR comments
|
|
120
|
+
3. Reserve human review for logic and design
|
|
121
|
+
4. Mark true nitpicks with `[NIT]` prefix
|
|
122
|
+
5. Limit to 3-5 critical items per review
|
|
123
|
+
</solution>
|
|
124
|
+
</avoiding_nitpick_culture>
|
|
125
|
+
|
|
126
|
+
<review_efficiency>
|
|
127
|
+
<google_data>
|
|
128
|
+
Google's review data shows:
|
|
129
|
+
|
|
130
|
+
- 90% of reviews: <10 files changed
|
|
131
|
+
- Average turnaround: 4 hours
|
|
132
|
+
- 75% need only one reviewer
|
|
133
|
+
</google_data>
|
|
134
|
+
|
|
135
|
+
<best_practices>
|
|
136
|
+
Efficiency best practices:
|
|
137
|
+
|
|
138
|
+
- Small PRs get better feedback
|
|
139
|
+
- Review within 4 hours if possible
|
|
140
|
+
- Focus on changed code only
|
|
141
|
+
- One pass, thorough, then done
|
|
142
|
+
</best_practices>
|
|
143
|
+
</review_efficiency>
|
|
144
|
+
|
|
145
|
+
<sources>
|
|
146
|
+
- [Google Code Review Guide](https://google.github.io/eng-practices/review/)
|
|
147
|
+
- [Microsoft Reviewer Guidance](https://microsoft.github.io/code-with-engineering-playbook/code-reviews/)
|
|
148
|
+
- [Conventional Comments](https://conventionalcomments.org/)
|
|
149
|
+
</sources>
|