@trieungoctam/vibekit 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 +85 -0
- package/agents/debugger.md +158 -0
- package/agents/docs-manager.md +220 -0
- package/agents/planner.md +129 -0
- package/agents/researcher.md +58 -0
- package/agents/reviewer.md +152 -0
- package/agents/tester.md +126 -0
- package/bin/vibekit.js +18 -0
- package/hooks/lib/ck-config-utils.cjs +831 -0
- package/hooks/lib/colors.cjs +95 -0
- package/hooks/lib/config-counter.cjs +103 -0
- package/hooks/lib/context-builder.cjs +616 -0
- package/hooks/lib/git-info-cache.cjs +143 -0
- package/hooks/lib/hook-logger.cjs +92 -0
- package/hooks/lib/privacy-checker.cjs +297 -0
- package/hooks/lib/project-detector.cjs +474 -0
- package/hooks/lib/scout-checker.cjs +263 -0
- package/hooks/lib/transcript-parser.cjs +181 -0
- package/hooks/post-edit-simplify-reminder.cjs +156 -0
- package/hooks/privacy-block.cjs +166 -0
- package/hooks/scout-block.cjs +147 -0
- package/hooks/session-init.cjs +360 -0
- package/package.json +41 -0
- package/rules/development-rules.md +52 -0
- package/rules/documentation-management.md +121 -0
- package/rules/orchestration-protocol.md +43 -0
- package/rules/primary-workflow.md +57 -0
- package/rules/team-coordination-rules.md +90 -0
- package/skills/ai/agent-browser/SKILL.md +294 -0
- package/skills/ai/agent-browser/references/.gitkeep +0 -0
- package/skills/ai/agent-browser/references/agent-browser-vs-chrome-devtools.md +112 -0
- package/skills/ai/agent-browser/references/browserbase-cloud-setup.md +161 -0
- package/skills/ai/ai-artist/SKILL.md +122 -0
- package/skills/ai/ai-artist/data/awesome-prompts.csv +3592 -0
- package/skills/ai/ai-artist/data/lighting.csv +19 -0
- package/skills/ai/ai-artist/data/nano-banana-templates.csv +17 -0
- package/skills/ai/ai-artist/data/platforms.csv +11 -0
- package/skills/ai/ai-artist/data/styles.csv +26 -0
- package/skills/ai/ai-artist/data/techniques.csv +19 -0
- package/skills/ai/ai-artist/data/use-cases.csv +16 -0
- package/skills/ai/ai-artist/references/advanced-techniques.md +184 -0
- package/skills/ai/ai-artist/references/awesome-nano-banana-pro-prompts.md +8575 -0
- package/skills/ai/ai-artist/references/domain-code.md +66 -0
- package/skills/ai/ai-artist/references/domain-data.md +72 -0
- package/skills/ai/ai-artist/references/domain-marketing.md +66 -0
- package/skills/ai/ai-artist/references/domain-patterns.md +33 -0
- package/skills/ai/ai-artist/references/domain-writing.md +68 -0
- package/skills/ai/ai-artist/references/image-prompting.md +141 -0
- package/skills/ai/ai-artist/references/llm-prompting.md +165 -0
- package/skills/ai/ai-artist/references/nano-banana.md +136 -0
- package/skills/ai/ai-artist/references/reasoning-techniques.md +201 -0
- package/skills/ai/ai-artist/references/validation-workflow.md +117 -0
- package/skills/ai/ai-artist/scripts/core.py +197 -0
- package/skills/ai/ai-artist/scripts/extract_prompts.py +102 -0
- package/skills/ai/ai-artist/scripts/generate.py +370 -0
- package/skills/ai/ai-artist/scripts/search.py +147 -0
- package/skills/ai/ai-multimodal/.env.example +204 -0
- package/skills/ai/ai-multimodal/SKILL.md +110 -0
- package/skills/ai/ai-multimodal/references/audio-processing.md +387 -0
- package/skills/ai/ai-multimodal/references/image-generation.md +939 -0
- package/skills/ai/ai-multimodal/references/music-generation.md +311 -0
- package/skills/ai/ai-multimodal/references/video-analysis.md +515 -0
- package/skills/ai/ai-multimodal/references/video-generation.md +457 -0
- package/skills/ai/ai-multimodal/references/vision-understanding.md +492 -0
- package/skills/ai/ai-multimodal/scripts/.coverage +0 -0
- package/skills/ai/ai-multimodal/scripts/check_setup.py +315 -0
- package/skills/ai/ai-multimodal/scripts/document_converter.py +395 -0
- package/skills/ai/ai-multimodal/scripts/gemini_batch_process.py +1185 -0
- package/skills/ai/ai-multimodal/scripts/media_optimizer.py +506 -0
- package/skills/ai/ai-multimodal/scripts/requirements.txt +26 -0
- package/skills/ai/ai-multimodal/scripts/tests/.coverage +0 -0
- package/skills/ai/ai-multimodal/scripts/tests/requirements.txt +20 -0
- package/skills/ai/ai-multimodal/scripts/tests/test_document_converter.py +74 -0
- package/skills/ai/ai-multimodal/scripts/tests/test_gemini_batch_process.py +362 -0
- package/skills/ai/ai-multimodal/scripts/tests/test_media_optimizer.py +373 -0
- package/skills/ai/mcp-management/README.md +219 -0
- package/skills/ai/mcp-management/SKILL.md +210 -0
- package/skills/ai/mcp-management/assets/tools.json +3146 -0
- package/skills/ai/mcp-management/references/configuration.md +114 -0
- package/skills/ai/mcp-management/references/gemini-cli-integration.md +221 -0
- package/skills/ai/mcp-management/references/mcp-protocol.md +116 -0
- package/skills/ai/mcp-management/scripts/.env.example +10 -0
- package/skills/ai/mcp-management/scripts/cli.ts +195 -0
- package/skills/ai/mcp-management/scripts/dist/analyze-tools.js +70 -0
- package/skills/ai/mcp-management/scripts/dist/cli.js +160 -0
- package/skills/ai/mcp-management/scripts/dist/mcp-client.js +183 -0
- package/skills/ai/mcp-management/scripts/mcp-client.ts +230 -0
- package/skills/ai/mcp-management/scripts/package.json +20 -0
- package/skills/ai/mcp-management/scripts/tsconfig.json +15 -0
- package/skills/core/brainstorm/SKILL.md +164 -0
- package/skills/core/brainstorm/scripts/frame-template.html +214 -0
- package/skills/core/brainstorm/scripts/helper.js +88 -0
- package/skills/core/brainstorm/scripts/server.cjs +338 -0
- package/skills/core/brainstorm/scripts/start-server.sh +153 -0
- package/skills/core/brainstorm/scripts/stop-server.sh +55 -0
- package/skills/core/brainstorm/spec-document-reviewer-prompt.md +49 -0
- package/skills/core/brainstorm/visual-companion.md +286 -0
- package/skills/core/code-review/SKILL.md +147 -0
- package/skills/core/code-review/references/code-review-reception.md +113 -0
- package/skills/core/code-review/references/codebase-scan-workflow.md +29 -0
- package/skills/core/code-review/references/edge-case-scouting.md +119 -0
- package/skills/core/code-review/references/parallel-review-workflow.md +69 -0
- package/skills/core/code-review/references/requesting-code-review.md +116 -0
- package/skills/core/code-review/references/task-management-reviews.md +140 -0
- package/skills/core/code-review/references/verification-before-completion.md +139 -0
- package/skills/core/cook/README.md +86 -0
- package/skills/core/cook/SKILL.md +113 -0
- package/skills/core/cook/references/intent-detection.md +101 -0
- package/skills/core/cook/references/review-cycle.md +75 -0
- package/skills/core/cook/references/subagent-patterns.md +75 -0
- package/skills/core/cook/references/workflow-steps.md +172 -0
- package/skills/core/debug/SKILL.md +121 -0
- package/skills/core/debug/references/defense-in-depth.md +124 -0
- package/skills/core/debug/references/frontend-verification.md +103 -0
- package/skills/core/debug/references/investigation-methodology.md +101 -0
- package/skills/core/debug/references/log-and-ci-analysis.md +97 -0
- package/skills/core/debug/references/performance-diagnostics.md +113 -0
- package/skills/core/debug/references/reporting-standards.md +122 -0
- package/skills/core/debug/references/root-cause-tracing.md +122 -0
- package/skills/core/debug/references/systematic-debugging.md +102 -0
- package/skills/core/debug/references/task-management-debugging.md +155 -0
- package/skills/core/debug/references/verification.md +123 -0
- package/skills/core/debug/scripts/find-polluter.sh +63 -0
- package/skills/core/debug/scripts/find-polluter.test.md +102 -0
- package/skills/core/execute/SKILL.md +70 -0
- package/skills/core/fix/SKILL.md +111 -0
- package/skills/core/fix/references/complexity-assessment.md +72 -0
- package/skills/core/fix/references/mode-selection.md +46 -0
- package/skills/core/fix/references/parallel-exploration.md +100 -0
- package/skills/core/fix/references/review-cycle.md +77 -0
- package/skills/core/fix/references/skill-activation-matrix.md +78 -0
- package/skills/core/fix/references/task-orchestration.md +103 -0
- package/skills/core/fix/references/workflow-ci.md +28 -0
- package/skills/core/fix/references/workflow-deep.md +122 -0
- package/skills/core/fix/references/workflow-logs.md +72 -0
- package/skills/core/fix/references/workflow-quick.md +59 -0
- package/skills/core/fix/references/workflow-standard.md +111 -0
- package/skills/core/fix/references/workflow-test.md +75 -0
- package/skills/core/fix/references/workflow-types.md +33 -0
- package/skills/core/fix/references/workflow-ui.md +75 -0
- package/skills/core/plan/SKILL.md +145 -0
- package/skills/core/plan/plan-document-reviewer-prompt.md +49 -0
- package/skills/core/subagent-dev/SKILL.md +277 -0
- package/skills/core/subagent-dev/code-quality-reviewer-prompt.md +26 -0
- package/skills/core/subagent-dev/implementer-prompt.md +113 -0
- package/skills/core/subagent-dev/spec-reviewer-prompt.md +61 -0
- package/skills/core/tdd/SKILL.md +371 -0
- package/skills/core/tdd/testing-anti-patterns.md +299 -0
- package/skills/core/test/SKILL.md +109 -0
- package/skills/core/test/references/report-format.md +58 -0
- package/skills/core/test/references/test-execution-workflow.md +103 -0
- package/skills/core/test/references/ui-testing-workflow.md +65 -0
- package/skills/core/verify/SKILL.md +139 -0
- package/skills/dev/backend-dev/SKILL.md +96 -0
- package/skills/dev/backend-dev/references/backend-api-design.md +495 -0
- package/skills/dev/backend-dev/references/backend-architecture.md +454 -0
- package/skills/dev/backend-dev/references/backend-authentication.md +338 -0
- package/skills/dev/backend-dev/references/backend-code-quality.md +659 -0
- package/skills/dev/backend-dev/references/backend-debugging.md +904 -0
- package/skills/dev/backend-dev/references/backend-devops.md +494 -0
- package/skills/dev/backend-dev/references/backend-mindset.md +387 -0
- package/skills/dev/backend-dev/references/backend-performance.md +397 -0
- package/skills/dev/backend-dev/references/backend-security.md +290 -0
- package/skills/dev/backend-dev/references/backend-technologies.md +256 -0
- package/skills/dev/backend-dev/references/backend-testing.md +429 -0
- package/skills/dev/context-engineering/SKILL.md +108 -0
- package/skills/dev/context-engineering/references/context-compression.md +84 -0
- package/skills/dev/context-engineering/references/context-degradation.md +93 -0
- package/skills/dev/context-engineering/references/context-fundamentals.md +75 -0
- package/skills/dev/context-engineering/references/context-optimization.md +82 -0
- package/skills/dev/context-engineering/references/evaluation.md +89 -0
- package/skills/dev/context-engineering/references/memory-systems.md +88 -0
- package/skills/dev/context-engineering/references/multi-agent-patterns.md +90 -0
- package/skills/dev/context-engineering/references/project-development.md +97 -0
- package/skills/dev/context-engineering/references/runtime-awareness.md +202 -0
- package/skills/dev/context-engineering/references/tool-design.md +86 -0
- package/skills/dev/context-engineering/scripts/compression_evaluator.py +349 -0
- package/skills/dev/context-engineering/scripts/context_analyzer.py +317 -0
- package/skills/dev/context-engineering/scripts/tests/test_edge_cases.py +246 -0
- package/skills/dev/databases/SKILL.md +84 -0
- package/skills/dev/databases/analytics.md +198 -0
- package/skills/dev/databases/db-design.md +188 -0
- package/skills/dev/databases/incremental-etl.md +213 -0
- package/skills/dev/databases/references/mongodb-aggregation.md +447 -0
- package/skills/dev/databases/references/mongodb-atlas.md +465 -0
- package/skills/dev/databases/references/mongodb-crud.md +408 -0
- package/skills/dev/databases/references/mongodb-indexing.md +442 -0
- package/skills/dev/databases/references/postgresql-administration.md +594 -0
- package/skills/dev/databases/references/postgresql-performance.md +527 -0
- package/skills/dev/databases/references/postgresql-psql-cli.md +467 -0
- package/skills/dev/databases/references/postgresql-queries.md +475 -0
- package/skills/dev/databases/scripts/.coverage +0 -0
- package/skills/dev/databases/scripts/db_backup.py +502 -0
- package/skills/dev/databases/scripts/db_migrate.py +426 -0
- package/skills/dev/databases/scripts/db_performance_check.py +457 -0
- package/skills/dev/databases/scripts/requirements.txt +20 -0
- package/skills/dev/databases/scripts/tests/coverage-db.json +1 -0
- package/skills/dev/databases/scripts/tests/requirements.txt +4 -0
- package/skills/dev/databases/scripts/tests/test_db_backup.py +340 -0
- package/skills/dev/databases/scripts/tests/test_db_migrate.py +277 -0
- package/skills/dev/databases/scripts/tests/test_db_performance_check.py +370 -0
- package/skills/dev/databases/stacks/bigquery.md +231 -0
- package/skills/dev/databases/stacks/d1_cloudflare.md +137 -0
- package/skills/dev/databases/stacks/mysql.md +216 -0
- package/skills/dev/databases/stacks/postgres.md +235 -0
- package/skills/dev/databases/stacks/sqlite.md +244 -0
- package/skills/dev/databases/transactional.md +176 -0
- package/skills/dev/devops/.env.example +76 -0
- package/skills/dev/devops/SKILL.md +97 -0
- package/skills/dev/devops/references/browser-rendering.md +305 -0
- package/skills/dev/devops/references/cloudflare-d1-kv.md +123 -0
- package/skills/dev/devops/references/cloudflare-platform.md +271 -0
- package/skills/dev/devops/references/cloudflare-r2-storage.md +280 -0
- package/skills/dev/devops/references/cloudflare-workers-advanced.md +312 -0
- package/skills/dev/devops/references/cloudflare-workers-apis.md +309 -0
- package/skills/dev/devops/references/cloudflare-workers-basics.md +418 -0
- package/skills/dev/devops/references/docker-basics.md +297 -0
- package/skills/dev/devops/references/docker-compose.md +292 -0
- package/skills/dev/devops/references/gcloud-platform.md +297 -0
- package/skills/dev/devops/references/gcloud-services.md +304 -0
- package/skills/dev/devops/references/kubernetes-basics.md +99 -0
- package/skills/dev/devops/references/kubernetes-helm-advanced.md +75 -0
- package/skills/dev/devops/references/kubernetes-helm.md +81 -0
- package/skills/dev/devops/references/kubernetes-kubectl.md +74 -0
- package/skills/dev/devops/references/kubernetes-security-advanced.md +98 -0
- package/skills/dev/devops/references/kubernetes-security.md +95 -0
- package/skills/dev/devops/references/kubernetes-troubleshooting-advanced.md +74 -0
- package/skills/dev/devops/references/kubernetes-troubleshooting.md +49 -0
- package/skills/dev/devops/references/kubernetes-workflows-advanced.md +75 -0
- package/skills/dev/devops/references/kubernetes-workflows.md +78 -0
- package/skills/dev/devops/scripts/cloudflare_deploy.py +269 -0
- package/skills/dev/devops/scripts/docker_optimize.py +332 -0
- package/skills/dev/devops/scripts/requirements.txt +20 -0
- package/skills/dev/devops/scripts/tests/requirements.txt +3 -0
- package/skills/dev/devops/scripts/tests/test_cloudflare_deploy.py +285 -0
- package/skills/dev/devops/scripts/tests/test_docker_optimize.py +436 -0
- package/skills/dev/frontend-design/SKILL.md +78 -0
- package/skills/dev/frontend-design/references/ai-multimodal-overview.md +165 -0
- package/skills/dev/frontend-design/references/analysis-best-practices.md +80 -0
- package/skills/dev/frontend-design/references/analysis-prompts.md +141 -0
- package/skills/dev/frontend-design/references/analysis-techniques.md +118 -0
- package/skills/dev/frontend-design/references/animejs.md +396 -0
- package/skills/dev/frontend-design/references/asset-generation.md +337 -0
- package/skills/dev/frontend-design/references/design-extraction-overview.md +71 -0
- package/skills/dev/frontend-design/references/extraction-best-practices.md +141 -0
- package/skills/dev/frontend-design/references/extraction-output-templates.md +162 -0
- package/skills/dev/frontend-design/references/extraction-prompts.md +127 -0
- package/skills/dev/frontend-design/references/technical-accessibility.md +119 -0
- package/skills/dev/frontend-design/references/technical-best-practices.md +97 -0
- package/skills/dev/frontend-design/references/technical-optimization.md +44 -0
- package/skills/dev/frontend-design/references/technical-overview.md +90 -0
- package/skills/dev/frontend-design/references/technical-workflows.md +150 -0
- package/skills/dev/frontend-design/references/visual-analysis-overview.md +95 -0
- package/skills/dev/frontend-design/references/workflow-3d.md +102 -0
- package/skills/dev/frontend-design/references/workflow-describe.md +87 -0
- package/skills/dev/frontend-design/references/workflow-immersive.md +87 -0
- package/skills/dev/frontend-design/references/workflow-quick.md +57 -0
- package/skills/dev/frontend-design/references/workflow-screenshot.md +63 -0
- package/skills/dev/frontend-design/references/workflow-video.md +74 -0
- package/skills/dev/frontend-dev/SKILL.md +400 -0
- package/skills/dev/frontend-dev/resources/common-patterns.md +331 -0
- package/skills/dev/frontend-dev/resources/complete-examples.md +872 -0
- package/skills/dev/frontend-dev/resources/component-patterns.md +502 -0
- package/skills/dev/frontend-dev/resources/data-fetching.md +767 -0
- package/skills/dev/frontend-dev/resources/file-organization.md +502 -0
- package/skills/dev/frontend-dev/resources/loading-and-error-states.md +501 -0
- package/skills/dev/frontend-dev/resources/performance.md +406 -0
- package/skills/dev/frontend-dev/resources/routing-guide.md +364 -0
- package/skills/dev/frontend-dev/resources/styling-guide.md +428 -0
- package/skills/dev/frontend-dev/resources/typescript-standards.md +418 -0
- package/skills/dev/git/SKILL.md +114 -0
- package/skills/dev/git/references/branch-management.md +88 -0
- package/skills/dev/git/references/commit-standards.md +46 -0
- package/skills/dev/git/references/gh-cli-guide.md +109 -0
- package/skills/dev/git/references/safety-protocols.md +69 -0
- package/skills/dev/git/references/workflow-commit.md +58 -0
- package/skills/dev/git/references/workflow-merge.md +48 -0
- package/skills/dev/git/references/workflow-pr.md +58 -0
- package/skills/dev/git/references/workflow-push.md +52 -0
- package/skills/dev/git-worktree/SKILL.md +218 -0
- package/skills/utils/ask/SKILL.md +58 -0
- package/skills/utils/bootstrap/SKILL.md +101 -0
- package/skills/utils/bootstrap/references/shared-phases.md +59 -0
- package/skills/utils/bootstrap/references/workflow-auto.md +52 -0
- package/skills/utils/bootstrap/references/workflow-fast.md +50 -0
- package/skills/utils/bootstrap/references/workflow-full.md +60 -0
- package/skills/utils/bootstrap/references/workflow-parallel.md +59 -0
- package/skills/utils/ck-help/SKILL.md +102 -0
- package/skills/utils/ck-help/scripts/ck-help.py +1321 -0
- package/skills/utils/ck-help/scripts/commands_data.yaml +3 -0
- package/skills/utils/ck-help/scripts/skills_data.yaml +593 -0
- package/skills/utils/copywriting/SKILL.md +94 -0
- package/skills/utils/copywriting/references/copy-formulas.md +150 -0
- package/skills/utils/copywriting/references/cta-patterns.md +168 -0
- package/skills/utils/copywriting/references/email-copy.md +193 -0
- package/skills/utils/copywriting/references/headline-templates.md +140 -0
- package/skills/utils/copywriting/references/landing-page-copy.md +175 -0
- package/skills/utils/copywriting/references/power-words.md +189 -0
- package/skills/utils/copywriting/references/social-media-copy.md +222 -0
- package/skills/utils/copywriting/references/workflow-cro.md +83 -0
- package/skills/utils/copywriting/references/workflow-enhance.md +32 -0
- package/skills/utils/copywriting/references/workflow-fast.md +29 -0
- package/skills/utils/copywriting/references/workflow-good.md +39 -0
- package/skills/utils/copywriting/references/writing-styles.md +247 -0
- package/skills/utils/copywriting/scripts/extract-writing-styles.py +308 -0
- package/skills/utils/copywriting/templates/copy-brief.md +49 -0
- package/skills/utils/docs/SKILL.md +55 -0
- package/skills/utils/docs/references/init-workflow.md +32 -0
- package/skills/utils/docs/references/summarize-workflow.md +18 -0
- package/skills/utils/docs/references/update-workflow.md +59 -0
- package/skills/utils/journal/SKILL.md +11 -0
- package/skills/utils/kanban/SKILL.md +99 -0
- package/skills/utils/preview/SKILL.md +75 -0
- package/skills/utils/preview/references/generation-modes.md +95 -0
- package/skills/utils/preview/references/view-mode.md +42 -0
- package/skills/utils/repomix/SKILL.md +248 -0
- package/skills/utils/repomix/references/configuration.md +211 -0
- package/skills/utils/repomix/references/usage-patterns.md +232 -0
- package/skills/utils/repomix/scripts/.coverage +0 -0
- package/skills/utils/repomix/scripts/README.md +179 -0
- package/skills/utils/repomix/scripts/repomix_batch.py +455 -0
- package/skills/utils/repomix/scripts/repos.example.json +15 -0
- package/skills/utils/repomix/scripts/requirements.txt +15 -0
- package/skills/utils/repomix/scripts/tests/test_repomix_batch.py +531 -0
- package/skills/utils/research/SKILL.md +171 -0
- package/skills/utils/scout/SKILL.md +89 -0
- package/skills/utils/scout/references/external-scouting.md +140 -0
- package/skills/utils/scout/references/internal-scouting.md +119 -0
- package/skills/utils/scout/references/task-management-scouting.md +125 -0
- package/skills/utils/sequential-thinking/.env.example +8 -0
- package/skills/utils/sequential-thinking/README.md +183 -0
- package/skills/utils/sequential-thinking/SKILL.md +95 -0
- package/skills/utils/sequential-thinking/package.json +31 -0
- package/skills/utils/sequential-thinking/references/advanced-strategies.md +79 -0
- package/skills/utils/sequential-thinking/references/advanced-techniques.md +76 -0
- package/skills/utils/sequential-thinking/references/core-patterns.md +95 -0
- package/skills/utils/sequential-thinking/references/examples-api.md +88 -0
- package/skills/utils/sequential-thinking/references/examples-architecture.md +94 -0
- package/skills/utils/sequential-thinking/references/examples-debug.md +90 -0
- package/skills/utils/sequential-thinking/scripts/format-thought.js +159 -0
- package/skills/utils/sequential-thinking/scripts/process-thought.js +236 -0
- package/skills/utils/sequential-thinking/tests/format-thought.test.js +133 -0
- package/skills/utils/sequential-thinking/tests/process-thought.test.js +215 -0
- package/skills/utils/write-skill/SKILL.md +655 -0
- package/skills/utils/write-skill/anthropic-best-practices.md +1150 -0
- package/skills/utils/write-skill/examples/CLAUDE_MD_TESTING.md +189 -0
- package/skills/utils/write-skill/graphviz-conventions.dot +172 -0
- package/skills/utils/write-skill/persuasion-principles.md +187 -0
- package/skills/utils/write-skill/render-graphs.js +168 -0
- package/skills/utils/write-skill/testing-skills-with-subagents.md +384 -0
- package/src/commands/init.js +238 -0
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
# Frontend Verification
|
|
2
|
+
|
|
3
|
+
Visual verification of frontend implementations using Chrome MCP (Claude Chrome Extension) or `ck:chrome-devtools` skill fallback.
|
|
4
|
+
|
|
5
|
+
## Applicability Check
|
|
6
|
+
|
|
7
|
+
**Skip entirely if task is NOT frontend-related.** Frontend indicators:
|
|
8
|
+
- Files modified: `*.tsx`, `*.jsx`, `*.vue`, `*.svelte`, `*.html`, `*.css`, `*.scss`
|
|
9
|
+
- Changes to: components, layouts, pages, styles, DOM structure, UI behavior
|
|
10
|
+
- Keywords: render, display, layout, responsive, animation, visual, UI, UX
|
|
11
|
+
|
|
12
|
+
If none match, skip this technique.
|
|
13
|
+
|
|
14
|
+
## Step 1: Detect Chrome MCP Availability
|
|
15
|
+
|
|
16
|
+
Check if Chrome MCP server is available via `ck:mcp-management` skill or `ListMcpResourcesTool`:
|
|
17
|
+
|
|
18
|
+
```
|
|
19
|
+
Use ListMcpResourcesTool to check for Chrome MCP tools.
|
|
20
|
+
Look for tools prefixed with "chrome__" (e.g., chrome__navigate, chrome__screenshot).
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
**Available** → Proceed to Step 2A (Chrome MCP)
|
|
24
|
+
**Not available** → Proceed to Step 2B (chrome-devtools fallback)
|
|
25
|
+
|
|
26
|
+
## Step 2A: Chrome MCP Available — Direct Verification
|
|
27
|
+
|
|
28
|
+
Use Chrome MCP tools to verify the implementation in the user's actual browser. Ensure dev server is running first.
|
|
29
|
+
|
|
30
|
+
### Navigate & Screenshot
|
|
31
|
+
|
|
32
|
+
```
|
|
33
|
+
1. chrome__navigate → http://localhost:3000 (or project dev URL)
|
|
34
|
+
2. chrome__screenshot → capture current page state
|
|
35
|
+
3. Read the screenshot with Read tool to visually inspect
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
### Visual Inspection Checklist
|
|
39
|
+
|
|
40
|
+
After capturing screenshot, verify:
|
|
41
|
+
1. **Layout** — Elements positioned correctly, no overflow/overlap
|
|
42
|
+
2. **Content** — Text, images, data rendered as expected
|
|
43
|
+
3. **Responsiveness** — Resize viewport if MCP supports it
|
|
44
|
+
4. **Interactions** — Use chrome__click / chrome__type to test interactive elements
|
|
45
|
+
5. **Console errors** — Use chrome__evaluate to check `console.error` output
|
|
46
|
+
|
|
47
|
+
### Console Error Check
|
|
48
|
+
|
|
49
|
+
```
|
|
50
|
+
chrome__evaluate → "JSON.stringify(window.__consoleErrors || [])"
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
Or navigate and observe any error output from Chrome MCP tool responses.
|
|
54
|
+
|
|
55
|
+
### Get Page Content
|
|
56
|
+
|
|
57
|
+
```
|
|
58
|
+
chrome__get_content → extract DOM/text to verify rendered output matches expectations
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
## Step 2B: Chrome MCP NOT Available — Fallback to chrome-devtools Skill
|
|
62
|
+
|
|
63
|
+
When Chrome MCP is not configured, use `ck:chrome-devtools` skill (Puppeteer with bundled Chromium):
|
|
64
|
+
|
|
65
|
+
```bash
|
|
66
|
+
SKILL_DIR="$HOME/.claude/skills/chrome-devtools/scripts"
|
|
67
|
+
|
|
68
|
+
# Install deps if first time
|
|
69
|
+
npm install --prefix "$SKILL_DIR" 2>/dev/null
|
|
70
|
+
|
|
71
|
+
# Screenshot + console error check
|
|
72
|
+
node "$SKILL_DIR/screenshot.js" --url http://localhost:3000 --output ./verification-screenshot.png
|
|
73
|
+
node "$SKILL_DIR/console.js" --url http://localhost:3000 --types error,pageerror --duration 5000
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
If `ck:chrome-devtools` skill is also unavailable, skip visual verification and note in report:
|
|
77
|
+
> "Visual verification skipped — no Chrome MCP or chrome-devtools available."
|
|
78
|
+
|
|
79
|
+
## Step 3: Analyze Results
|
|
80
|
+
|
|
81
|
+
After capture:
|
|
82
|
+
1. **Read screenshot** — Use Read tool on the PNG to visually inspect
|
|
83
|
+
2. **Check console output** — Zero errors = pass; errors = investigate before claiming done
|
|
84
|
+
3. **Compare with expected** — Match against design specs or user description
|
|
85
|
+
4. **Document findings** — Include screenshot path and any issues found in verification report
|
|
86
|
+
|
|
87
|
+
## Integration with Verification Protocol
|
|
88
|
+
|
|
89
|
+
This technique extends `verification.md`. After standard verification (tests pass, build succeeds), add frontend verification as final gate:
|
|
90
|
+
|
|
91
|
+
```
|
|
92
|
+
Standard verification → Tests pass → Build succeeds → Frontend visual verification → Claim complete
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
Report format:
|
|
96
|
+
```
|
|
97
|
+
## Frontend Verification
|
|
98
|
+
- Method: [Chrome MCP | chrome-devtools | skipped]
|
|
99
|
+
- Screenshot: ./verification-screenshot.png
|
|
100
|
+
- Console errors: [none | list]
|
|
101
|
+
- Visual check: [pass | issues found]
|
|
102
|
+
- Responsive: [checked at X viewports | skipped]
|
|
103
|
+
```
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
# Investigation Methodology
|
|
2
|
+
|
|
3
|
+
Five-step structured investigation for system-level issues, incidents, and multi-component failures.
|
|
4
|
+
|
|
5
|
+
## When to Use
|
|
6
|
+
|
|
7
|
+
- Server returning 500 errors or unexpected responses
|
|
8
|
+
- System behavior changed without obvious code changes
|
|
9
|
+
- Multi-component failures spanning services/databases/infrastructure
|
|
10
|
+
- Need to understand "what happened" before fixing
|
|
11
|
+
|
|
12
|
+
## Step 1: Initial Assessment
|
|
13
|
+
|
|
14
|
+
**Gather scope and impact before diving in.**
|
|
15
|
+
|
|
16
|
+
1. **Collect symptoms** - Error messages, affected endpoints, user reports
|
|
17
|
+
2. **Identify affected components** - Which services, databases, queues involved?
|
|
18
|
+
3. **Determine timeframe** - When did issue start? Correlate with deployments/changes
|
|
19
|
+
4. **Assess severity** - Users affected? Data at risk? Revenue impact?
|
|
20
|
+
5. **Check recent changes** - Git log, deployment history, config changes, dependency updates
|
|
21
|
+
|
|
22
|
+
```bash
|
|
23
|
+
# Recent deployments
|
|
24
|
+
gh run list --limit 10
|
|
25
|
+
# Recent commits
|
|
26
|
+
git log --oneline -20 --since="2 days ago"
|
|
27
|
+
# Config changes
|
|
28
|
+
git diff HEAD~5 -- '*.env*' '*.config*' '*.yml' '*.yaml' '*.json'
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
## Step 2: Data Collection
|
|
32
|
+
|
|
33
|
+
**Gather evidence systematically before analysis.**
|
|
34
|
+
|
|
35
|
+
1. **Server/application logs** - Filter by timeframe and affected components
|
|
36
|
+
2. **CI/CD pipeline logs** - Use `gh run view <run-id> --log-failed` for GitHub Actions
|
|
37
|
+
3. **Database state** - Query relevant tables, check recent migrations
|
|
38
|
+
4. **System metrics** - CPU, memory, disk, network utilization
|
|
39
|
+
5. **External dependencies** - Third-party API status, DNS, CDN
|
|
40
|
+
|
|
41
|
+
```bash
|
|
42
|
+
# GitHub Actions: list recent workflow runs
|
|
43
|
+
gh run list --workflow=<workflow> --limit 5
|
|
44
|
+
# View failed run logs
|
|
45
|
+
gh run view <run-id> --log-failed
|
|
46
|
+
# Download full logs
|
|
47
|
+
gh run view <run-id> --log > /tmp/ci-logs.txt
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
**For codebase understanding:**
|
|
51
|
+
- Read `docs/codebase-summary.md` if exists and up-to-date (<2 days old)
|
|
52
|
+
- Otherwise use `ck:repomix` to generate fresh codebase summary
|
|
53
|
+
- Use `/ck:scout` or `/ck:scout ext` to find relevant files
|
|
54
|
+
- Use `ck:docs-seeker` skill for package/plugin documentation
|
|
55
|
+
|
|
56
|
+
## Step 3: Analysis Process
|
|
57
|
+
|
|
58
|
+
**Correlate evidence across sources.**
|
|
59
|
+
|
|
60
|
+
1. **Timeline reconstruction** - Order events chronologically across all log sources
|
|
61
|
+
2. **Pattern identification** - Recurring errors, timing patterns, affected user segments
|
|
62
|
+
3. **Execution path tracing** - Follow request flow through system components
|
|
63
|
+
4. **Database analysis** - Query performance, table relationships, data integrity
|
|
64
|
+
5. **Dependency mapping** - Which components depend on the failing one?
|
|
65
|
+
|
|
66
|
+
**Key questions:**
|
|
67
|
+
- Does issue correlate with specific deployments or time windows?
|
|
68
|
+
- Is it intermittent or consistent?
|
|
69
|
+
- Does it affect all users or a subset?
|
|
70
|
+
- Are there related errors in upstream/downstream services?
|
|
71
|
+
|
|
72
|
+
## Step 4: Root Cause Identification
|
|
73
|
+
|
|
74
|
+
**Systematic elimination with evidence.**
|
|
75
|
+
|
|
76
|
+
1. **List hypotheses** ranked by evidence strength
|
|
77
|
+
2. **Test each** - Design smallest experiment to confirm/eliminate
|
|
78
|
+
3. **Validate with evidence** - Logs, metrics, reproduction steps
|
|
79
|
+
4. **Consider environmental factors** - Race conditions, resource limits, config drift
|
|
80
|
+
5. **Document the chain** - Full event sequence from trigger to symptom
|
|
81
|
+
|
|
82
|
+
**Avoid:** Fixing first hypothesis without testing alternatives. Multiple plausible causes require elimination.
|
|
83
|
+
|
|
84
|
+
## Step 5: Solution Development
|
|
85
|
+
|
|
86
|
+
**Design targeted, evidence-backed fixes.**
|
|
87
|
+
|
|
88
|
+
1. **Immediate fix** - Minimum change to restore service (hotfix, rollback, config change)
|
|
89
|
+
2. **Root cause fix** - Address underlying issue permanently
|
|
90
|
+
3. **Preventive measures** - Monitoring, alerting, validation to catch recurrence early
|
|
91
|
+
4. **Verification plan** - How to confirm fix works in production
|
|
92
|
+
|
|
93
|
+
**Prioritize:** Impact × urgency. Restore service first, then fix root cause, then prevent recurrence.
|
|
94
|
+
|
|
95
|
+
## Integration with Code-Level Debugging
|
|
96
|
+
|
|
97
|
+
When investigation narrows to specific code:
|
|
98
|
+
- Switch to `systematic-debugging.md` for the code-level fix
|
|
99
|
+
- Use `root-cause-tracing.md` if error is deep in call stack
|
|
100
|
+
- Apply `defense-in-depth.md` after fixing
|
|
101
|
+
- Always finish with `verification.md`
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
# Log & CI/CD Analysis
|
|
2
|
+
|
|
3
|
+
Collect and analyze logs from servers, CI/CD pipelines, and application layers to diagnose failures.
|
|
4
|
+
|
|
5
|
+
## GitHub Actions Analysis
|
|
6
|
+
|
|
7
|
+
### List and Inspect Runs
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
# List recent runs (all workflows)
|
|
11
|
+
gh run list --limit 10
|
|
12
|
+
|
|
13
|
+
# List runs for specific workflow
|
|
14
|
+
gh run list --workflow=ci.yml --limit 5
|
|
15
|
+
|
|
16
|
+
# View specific run details
|
|
17
|
+
gh run view <run-id>
|
|
18
|
+
|
|
19
|
+
# View failed job logs only
|
|
20
|
+
gh run view <run-id> --log-failed
|
|
21
|
+
|
|
22
|
+
# Download complete logs
|
|
23
|
+
gh run view <run-id> --log > /tmp/ci-full.txt
|
|
24
|
+
|
|
25
|
+
# Re-run failed jobs
|
|
26
|
+
gh run rerun <run-id> --failed
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
### Common CI/CD Failure Patterns
|
|
30
|
+
|
|
31
|
+
| Pattern | Likely Cause | Investigation |
|
|
32
|
+
|---------|-------------|---------------|
|
|
33
|
+
| Passes locally, fails CI | Environment diff | Check Node/Python version, OS, env vars |
|
|
34
|
+
| Intermittent failures | Race conditions, flaky tests | Run 3x, check timing, shared state |
|
|
35
|
+
| Timeout failures | Resource limits, infinite loops | Check resource usage, add timeouts |
|
|
36
|
+
| Permission errors | Token/secret misconfiguration | Verify `GITHUB_TOKEN`, secret names |
|
|
37
|
+
| Dependency install fails | Registry issues, version conflicts | Check lockfile, registry status |
|
|
38
|
+
| Build succeeds, tests fail | Test environment setup | Check test config, database setup, fixtures |
|
|
39
|
+
|
|
40
|
+
### Analyzing Failed Steps
|
|
41
|
+
|
|
42
|
+
1. **Identify which step failed** - `gh run view <id>` shows step-by-step status
|
|
43
|
+
2. **Get the logs** - `gh run view <id> --log-failed` for focused output
|
|
44
|
+
3. **Search for error patterns** - Look for `Error:`, `FAIL`, `exit code`, stack traces
|
|
45
|
+
4. **Check annotations** - `gh api repos/{owner}/{repo}/check-runs/{id}/annotations`
|
|
46
|
+
|
|
47
|
+
## Server Log Analysis
|
|
48
|
+
|
|
49
|
+
### Log Collection Strategy
|
|
50
|
+
|
|
51
|
+
1. **Identify log locations** - Application logs, system logs, web server logs
|
|
52
|
+
2. **Filter by timeframe** - Narrow to incident window
|
|
53
|
+
3. **Correlate request IDs** - Trace single request across services
|
|
54
|
+
4. **Look for patterns** - Repeated errors, error rate changes, unusual payloads
|
|
55
|
+
|
|
56
|
+
### Structured Log Queries
|
|
57
|
+
|
|
58
|
+
```bash
|
|
59
|
+
# Search application logs for errors (use Grep tool when possible)
|
|
60
|
+
# Pattern: timestamp, level, message
|
|
61
|
+
# Filter by time range and severity
|
|
62
|
+
|
|
63
|
+
# PostgreSQL slow query log
|
|
64
|
+
psql -c "SELECT query, calls, mean_exec_time FROM pg_stat_statements ORDER BY mean_exec_time DESC LIMIT 10;"
|
|
65
|
+
|
|
66
|
+
# Check database connections
|
|
67
|
+
psql -c "SELECT count(*), state FROM pg_stat_activity GROUP BY state;"
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
### Cross-Source Correlation
|
|
71
|
+
|
|
72
|
+
1. **Align timestamps** across all log sources (timezone awareness)
|
|
73
|
+
2. **Build timeline** - First error → propagation → user impact
|
|
74
|
+
3. **Identify trigger** - What changed immediately before first error?
|
|
75
|
+
4. **Map blast radius** - Which services/endpoints affected?
|
|
76
|
+
|
|
77
|
+
## Application Log Analysis
|
|
78
|
+
|
|
79
|
+
### Error Pattern Recognition
|
|
80
|
+
|
|
81
|
+
- **Sudden spike** → Deployment, config change, external dependency failure
|
|
82
|
+
- **Gradual increase** → Resource leak, data growth, degradation
|
|
83
|
+
- **Periodic failures** → Cron jobs, scheduled tasks, resource contention
|
|
84
|
+
- **Single endpoint** → Code bug, data issue, specific dependency
|
|
85
|
+
- **All endpoints** → Infrastructure, database, network issue
|
|
86
|
+
|
|
87
|
+
### Key Log Fields
|
|
88
|
+
|
|
89
|
+
Prioritize: timestamp, level, error message, stack trace, request ID, user ID, endpoint, response code, duration
|
|
90
|
+
|
|
91
|
+
### Evidence Preservation
|
|
92
|
+
|
|
93
|
+
Always capture relevant log excerpts for the diagnostic report. Include:
|
|
94
|
+
- Exact error messages and stack traces
|
|
95
|
+
- Timestamps and request IDs
|
|
96
|
+
- Before/after comparison (normal vs error state)
|
|
97
|
+
- Counts and frequencies
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
# Performance Diagnostics
|
|
2
|
+
|
|
3
|
+
Identify bottlenecks, analyze query performance, and develop optimization strategies.
|
|
4
|
+
|
|
5
|
+
## When to Use
|
|
6
|
+
|
|
7
|
+
- Response times increased significantly
|
|
8
|
+
- Application feels slow or unresponsive
|
|
9
|
+
- Database queries taking too long
|
|
10
|
+
- High CPU/memory/disk usage
|
|
11
|
+
- Resource exhaustion or OOM errors
|
|
12
|
+
|
|
13
|
+
## Diagnostic Process
|
|
14
|
+
|
|
15
|
+
### 1. Quantify the Problem
|
|
16
|
+
|
|
17
|
+
**Measure before optimizing.** Establish baseline and current state.
|
|
18
|
+
|
|
19
|
+
- What is the expected response time vs actual?
|
|
20
|
+
- When did degradation start? (correlate with changes)
|
|
21
|
+
- Which endpoints/operations are affected?
|
|
22
|
+
- Is it consistent or intermittent?
|
|
23
|
+
|
|
24
|
+
### 2. Identify the Bottleneck Layer
|
|
25
|
+
|
|
26
|
+
```
|
|
27
|
+
Request → Network → Web Server → Application → Database → Filesystem
|
|
28
|
+
↓
|
|
29
|
+
External APIs / Services
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
**Elimination approach:** Measure time at each layer to find where delay occurs.
|
|
33
|
+
|
|
34
|
+
| Layer | Check | Tool |
|
|
35
|
+
|-------|-------|------|
|
|
36
|
+
| Network | Latency, DNS, TLS | `curl -w` timing, network logs |
|
|
37
|
+
| Web server | Request queue, connections | Server metrics, access logs |
|
|
38
|
+
| Application | CPU profiling, memory | Profiler, APM, `process.memoryUsage()` |
|
|
39
|
+
| Database | Query time, connections | `EXPLAIN ANALYZE`, `pg_stat_statements` |
|
|
40
|
+
| Filesystem | I/O wait, disk usage | `iostat`, `df -h` |
|
|
41
|
+
| External APIs | Response time, timeouts | Request logging with durations |
|
|
42
|
+
|
|
43
|
+
### 3. Database Performance
|
|
44
|
+
|
|
45
|
+
#### PostgreSQL Diagnostics
|
|
46
|
+
|
|
47
|
+
```sql
|
|
48
|
+
-- Slow queries (requires pg_stat_statements extension)
|
|
49
|
+
SELECT query, calls, mean_exec_time, total_exec_time
|
|
50
|
+
FROM pg_stat_statements
|
|
51
|
+
ORDER BY mean_exec_time DESC LIMIT 20;
|
|
52
|
+
|
|
53
|
+
-- Active queries right now
|
|
54
|
+
SELECT pid, now() - pg_stat_activity.query_start AS duration, query, state
|
|
55
|
+
FROM pg_stat_activity
|
|
56
|
+
WHERE state != 'idle'
|
|
57
|
+
ORDER BY duration DESC;
|
|
58
|
+
|
|
59
|
+
-- Table sizes and bloat
|
|
60
|
+
SELECT relname, pg_size_pretty(pg_total_relation_size(relid))
|
|
61
|
+
FROM pg_catalog.pg_statio_user_tables
|
|
62
|
+
ORDER BY pg_total_relation_size(relid) DESC LIMIT 20;
|
|
63
|
+
|
|
64
|
+
-- Missing indexes (sequential scans on large tables)
|
|
65
|
+
SELECT relname, seq_scan, seq_tup_read, idx_scan
|
|
66
|
+
FROM pg_stat_user_tables
|
|
67
|
+
WHERE seq_scan > 100 AND seq_tup_read > 10000
|
|
68
|
+
ORDER BY seq_tup_read DESC;
|
|
69
|
+
|
|
70
|
+
-- Connection pool status
|
|
71
|
+
SELECT count(*), state FROM pg_stat_activity GROUP BY state;
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
#### Query Optimization
|
|
75
|
+
|
|
76
|
+
```sql
|
|
77
|
+
-- Analyze specific query execution plan
|
|
78
|
+
EXPLAIN (ANALYZE, BUFFERS, FORMAT TEXT) <your-query>;
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
**Look for:** Sequential scans on large tables, nested loops with high row counts, sorts without indexes, excessive buffer hits.
|
|
82
|
+
|
|
83
|
+
### 4. Application Performance
|
|
84
|
+
|
|
85
|
+
**Common bottlenecks:**
|
|
86
|
+
|
|
87
|
+
| Issue | Symptom | Fix |
|
|
88
|
+
|-------|---------|-----|
|
|
89
|
+
| N+1 queries | Many small DB calls per request | Eager loading, batch queries |
|
|
90
|
+
| Memory leaks | Growing memory over time | Profile heap, check event listeners |
|
|
91
|
+
| Blocking I/O | High response time, low CPU | Async operations, connection pooling |
|
|
92
|
+
| CPU-bound | High CPU, proportional to load | Optimize algorithms, caching |
|
|
93
|
+
| Connection exhaustion | Intermittent timeouts | Pool sizing, connection reuse |
|
|
94
|
+
| Large payloads | Slow transfers, high memory | Pagination, compression, streaming |
|
|
95
|
+
|
|
96
|
+
### 5. Optimization Strategy
|
|
97
|
+
|
|
98
|
+
**Priority order:**
|
|
99
|
+
1. **Quick wins** - Add missing index, fix N+1 query, enable caching
|
|
100
|
+
2. **Configuration** - Pool sizes, timeouts, buffer sizes, worker counts
|
|
101
|
+
3. **Code changes** - Algorithm optimization, data structure changes
|
|
102
|
+
4. **Architecture** - Caching layer, read replicas, async processing, CDN
|
|
103
|
+
|
|
104
|
+
**Always:** Measure after each change to verify improvement. One change at a time.
|
|
105
|
+
|
|
106
|
+
## Reporting Performance Issues
|
|
107
|
+
|
|
108
|
+
Include in diagnostic report:
|
|
109
|
+
- **Baseline vs current** metrics (with numbers)
|
|
110
|
+
- **Bottleneck identification** with evidence
|
|
111
|
+
- **Root cause** explanation
|
|
112
|
+
- **Recommended fixes** with expected impact
|
|
113
|
+
- **Verification plan** to confirm improvement
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
# Reporting Standards
|
|
2
|
+
|
|
3
|
+
Structured format for diagnostic and investigation reports. Sacrifice grammar for concision.
|
|
4
|
+
|
|
5
|
+
## When to Use
|
|
6
|
+
|
|
7
|
+
- After completing system investigation
|
|
8
|
+
- Summarizing debugging session findings
|
|
9
|
+
- Producing incident post-mortems
|
|
10
|
+
- Reporting performance analysis results
|
|
11
|
+
|
|
12
|
+
## Report Structure
|
|
13
|
+
|
|
14
|
+
### 1. Executive Summary (3-5 lines)
|
|
15
|
+
|
|
16
|
+
- **Issue:** One-line description
|
|
17
|
+
- **Impact:** Users/systems affected, severity
|
|
18
|
+
- **Root cause:** One-line explanation
|
|
19
|
+
- **Status:** Resolved / Mitigated / Under investigation
|
|
20
|
+
- **Fix:** What was done or recommended
|
|
21
|
+
|
|
22
|
+
### 2. Technical Analysis
|
|
23
|
+
|
|
24
|
+
**Timeline:**
|
|
25
|
+
```
|
|
26
|
+
HH:MM - Event description
|
|
27
|
+
HH:MM - Next event
|
|
28
|
+
...
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
**Evidence:**
|
|
32
|
+
- Relevant log excerpts (trimmed to essential lines)
|
|
33
|
+
- Query results with key metrics
|
|
34
|
+
- Error messages and stack traces
|
|
35
|
+
- Before/after comparisons
|
|
36
|
+
|
|
37
|
+
**Findings:**
|
|
38
|
+
- List each finding with supporting evidence
|
|
39
|
+
- Distinguish confirmed facts from hypotheses
|
|
40
|
+
- Note correlation vs causation
|
|
41
|
+
|
|
42
|
+
### 3. Actionable Recommendations
|
|
43
|
+
|
|
44
|
+
**Immediate (P0):**
|
|
45
|
+
- [ ] Critical fix with implementation steps
|
|
46
|
+
|
|
47
|
+
**Short-term (P1):**
|
|
48
|
+
- [ ] Follow-up improvements
|
|
49
|
+
|
|
50
|
+
**Long-term (P2):**
|
|
51
|
+
- [ ] Monitoring/alerting enhancements
|
|
52
|
+
- [ ] Architecture improvements
|
|
53
|
+
- [ ] Preventive measures
|
|
54
|
+
|
|
55
|
+
Each recommendation: what to do, why, expected impact, effort estimate (low/medium/high).
|
|
56
|
+
|
|
57
|
+
### 4. Supporting Evidence
|
|
58
|
+
|
|
59
|
+
- Relevant log excerpts
|
|
60
|
+
- Query results and execution plans
|
|
61
|
+
- Performance metrics
|
|
62
|
+
- Test results and error traces
|
|
63
|
+
- Screenshots or diagrams if applicable
|
|
64
|
+
|
|
65
|
+
### 5. Unresolved Questions
|
|
66
|
+
|
|
67
|
+
List anything that remains unclear:
|
|
68
|
+
- Items needing further investigation
|
|
69
|
+
- Questions for the team
|
|
70
|
+
- Assumptions that need validation
|
|
71
|
+
|
|
72
|
+
## Report File Naming
|
|
73
|
+
|
|
74
|
+
Use naming pattern from `## Naming` section injected by hooks. Pattern includes full path and computed date.
|
|
75
|
+
|
|
76
|
+
**Example:** `plans/reports/debugger-260205-2215-api-500-investigation.md`
|
|
77
|
+
|
|
78
|
+
## Writing Guidelines
|
|
79
|
+
|
|
80
|
+
- **Concise:** Facts and evidence, not narrative. Sacrifice grammar for brevity
|
|
81
|
+
- **Evidence-backed:** Every claim supported by logs, metrics, or reproduction steps
|
|
82
|
+
- **Actionable:** Recommendations are specific with clear next steps
|
|
83
|
+
- **Honest:** State unknowns explicitly. "Likely cause" vs "confirmed cause"
|
|
84
|
+
- **Structured:** Use headers, tables, and bullet points for scanability
|
|
85
|
+
|
|
86
|
+
## Template
|
|
87
|
+
|
|
88
|
+
```markdown
|
|
89
|
+
# [Issue Title] - Investigation Report
|
|
90
|
+
|
|
91
|
+
## Executive Summary
|
|
92
|
+
- **Issue:**
|
|
93
|
+
- **Impact:**
|
|
94
|
+
- **Root cause:**
|
|
95
|
+
- **Status:**
|
|
96
|
+
- **Fix:**
|
|
97
|
+
|
|
98
|
+
## Timeline
|
|
99
|
+
- HH:MM -
|
|
100
|
+
- HH:MM -
|
|
101
|
+
|
|
102
|
+
## Technical Analysis
|
|
103
|
+
### Findings
|
|
104
|
+
1.
|
|
105
|
+
2.
|
|
106
|
+
|
|
107
|
+
### Evidence
|
|
108
|
+
[logs, queries, metrics]
|
|
109
|
+
|
|
110
|
+
## Recommendations
|
|
111
|
+
### Immediate (P0)
|
|
112
|
+
- [ ]
|
|
113
|
+
|
|
114
|
+
### Short-term (P1)
|
|
115
|
+
- [ ]
|
|
116
|
+
|
|
117
|
+
### Long-term (P2)
|
|
118
|
+
- [ ]
|
|
119
|
+
|
|
120
|
+
## Unresolved Questions
|
|
121
|
+
-
|
|
122
|
+
```
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
# Root Cause Tracing
|
|
2
|
+
|
|
3
|
+
Systematically trace bugs backward through call stack to find original trigger.
|
|
4
|
+
|
|
5
|
+
## Core Principle
|
|
6
|
+
|
|
7
|
+
**Trace backward through call chain until finding original trigger, then fix at source.**
|
|
8
|
+
|
|
9
|
+
Bugs often manifest deep in call stack (git init in wrong directory, file created in wrong location). Instinct is to fix where error appears, but that's treating symptom.
|
|
10
|
+
|
|
11
|
+
## When to Use
|
|
12
|
+
|
|
13
|
+
**Use when:**
|
|
14
|
+
- Error happens deep in execution (not at entry point)
|
|
15
|
+
- Stack trace shows long call chain
|
|
16
|
+
- Unclear where invalid data originated
|
|
17
|
+
- Need to find which test/code triggers problem
|
|
18
|
+
|
|
19
|
+
## The Tracing Process
|
|
20
|
+
|
|
21
|
+
### 1. Observe the Symptom
|
|
22
|
+
```
|
|
23
|
+
Error: git init failed in /Users/jesse/project/packages/core
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
### 2. Find Immediate Cause
|
|
27
|
+
What code directly causes this?
|
|
28
|
+
```typescript
|
|
29
|
+
await execFileAsync('git', ['init'], { cwd: projectDir });
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
### 3. Ask: What Called This?
|
|
33
|
+
```typescript
|
|
34
|
+
WorktreeManager.createSessionWorktree(projectDir, sessionId)
|
|
35
|
+
→ called by Session.initializeWorkspace()
|
|
36
|
+
→ called by Session.create()
|
|
37
|
+
→ called by test at Project.create()
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
### 4. Keep Tracing Up
|
|
41
|
+
What value was passed?
|
|
42
|
+
- `projectDir = ''` (empty string!)
|
|
43
|
+
- Empty string as `cwd` resolves to `process.cwd()`
|
|
44
|
+
- That's the source code directory!
|
|
45
|
+
|
|
46
|
+
### 5. Find Original Trigger
|
|
47
|
+
Where did empty string come from?
|
|
48
|
+
```typescript
|
|
49
|
+
const context = setupCoreTest(); // Returns { tempDir: '' }
|
|
50
|
+
Project.create('name', context.tempDir); // Accessed before beforeEach!
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
## Adding Stack Traces
|
|
54
|
+
|
|
55
|
+
When can't trace manually, add instrumentation:
|
|
56
|
+
|
|
57
|
+
```typescript
|
|
58
|
+
async function gitInit(directory: string) {
|
|
59
|
+
const stack = new Error().stack;
|
|
60
|
+
console.error('DEBUG git init:', {
|
|
61
|
+
directory,
|
|
62
|
+
cwd: process.cwd(),
|
|
63
|
+
stack,
|
|
64
|
+
});
|
|
65
|
+
|
|
66
|
+
await execFileAsync('git', ['init'], { cwd: directory });
|
|
67
|
+
}
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
**Critical:** Use `console.error()` in tests (not logger - may not show)
|
|
71
|
+
|
|
72
|
+
**Run and capture:**
|
|
73
|
+
```bash
|
|
74
|
+
npm test 2>&1 | grep 'DEBUG git init'
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
**Analyze stack traces:**
|
|
78
|
+
- Look for test file names
|
|
79
|
+
- Find line number triggering call
|
|
80
|
+
- Identify pattern (same test? same parameter?)
|
|
81
|
+
|
|
82
|
+
## Finding Which Test Causes Pollution
|
|
83
|
+
|
|
84
|
+
If something appears during tests but don't know which test:
|
|
85
|
+
|
|
86
|
+
Use bisection script: `scripts/find-polluter.sh`
|
|
87
|
+
|
|
88
|
+
```bash
|
|
89
|
+
./scripts/find-polluter.sh '.git' 'src/**/*.test.ts'
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
Runs tests one-by-one, stops at first polluter.
|
|
93
|
+
|
|
94
|
+
## Key Principle
|
|
95
|
+
|
|
96
|
+
**NEVER fix just where error appears.** Trace back to find original trigger.
|
|
97
|
+
|
|
98
|
+
When found immediate cause:
|
|
99
|
+
- Can trace one level up? → Trace backwards
|
|
100
|
+
- Is this the source? → Fix at source
|
|
101
|
+
- Then add validation at each layer (see defense-in-depth.md)
|
|
102
|
+
|
|
103
|
+
## Real Example
|
|
104
|
+
|
|
105
|
+
**Symptom:** `.git` created in `packages/core/` (source code)
|
|
106
|
+
|
|
107
|
+
**Trace chain:**
|
|
108
|
+
1. `git init` runs in `process.cwd()` ← empty cwd parameter
|
|
109
|
+
2. WorktreeManager called with empty projectDir
|
|
110
|
+
3. Session.create() passed empty string
|
|
111
|
+
4. Test accessed `context.tempDir` before beforeEach
|
|
112
|
+
5. setupCoreTest() returns `{ tempDir: '' }` initially
|
|
113
|
+
|
|
114
|
+
**Root cause:** Top-level variable initialization accessing empty value
|
|
115
|
+
|
|
116
|
+
**Fix:** Made tempDir a getter that throws if accessed before beforeEach
|
|
117
|
+
|
|
118
|
+
**Also added defense-in-depth:**
|
|
119
|
+
- Layer 1: Project.create() validates directory
|
|
120
|
+
- Layer 2: WorkspaceManager validates not empty
|
|
121
|
+
- Layer 3: NODE_ENV guard refuses git init outside tmpdir
|
|
122
|
+
- Layer 4: Stack trace logging before git init
|