agim-cli 1.2.147 → 1.2.149
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/CHANGELOG.md +158 -0
- package/dist/core/skills/builtin/ECC_LICENSE +21 -0
- package/dist/core/skills/builtin/ECC_NOTICE.md +28 -0
- package/dist/core/skills/builtin/accessibility/SKILL.md +146 -0
- package/dist/core/skills/builtin/agent-eval/SKILL.md +145 -0
- package/dist/core/skills/builtin/agent-harness-construction/SKILL.md +73 -0
- package/dist/core/skills/builtin/agent-introspection-debugging/SKILL.md +153 -0
- package/dist/core/skills/builtin/agentic-engineering/SKILL.md +63 -0
- package/dist/core/skills/builtin/ai-first-engineering/SKILL.md +51 -0
- package/dist/core/skills/builtin/ai-regression-testing/SKILL.md +385 -0
- package/dist/core/skills/builtin/android-clean-architecture/SKILL.md +339 -0
- package/dist/core/skills/builtin/angular-developer/SKILL.md +154 -0
- package/dist/core/skills/builtin/angular-developer/references/angular-animations.md +160 -0
- package/dist/core/skills/builtin/angular-developer/references/angular-aria.md +410 -0
- package/dist/core/skills/builtin/angular-developer/references/cli.md +86 -0
- package/dist/core/skills/builtin/angular-developer/references/component-harnesses.md +59 -0
- package/dist/core/skills/builtin/angular-developer/references/component-styling.md +91 -0
- package/dist/core/skills/builtin/angular-developer/references/components.md +117 -0
- package/dist/core/skills/builtin/angular-developer/references/creating-services.md +97 -0
- package/dist/core/skills/builtin/angular-developer/references/data-resolvers.md +69 -0
- package/dist/core/skills/builtin/angular-developer/references/define-routes.md +67 -0
- package/dist/core/skills/builtin/angular-developer/references/defining-providers.md +72 -0
- package/dist/core/skills/builtin/angular-developer/references/di-fundamentals.md +120 -0
- package/dist/core/skills/builtin/angular-developer/references/e2e-testing.md +56 -0
- package/dist/core/skills/builtin/angular-developer/references/effects.md +83 -0
- package/dist/core/skills/builtin/angular-developer/references/hierarchical-injectors.md +43 -0
- package/dist/core/skills/builtin/angular-developer/references/host-elements.md +80 -0
- package/dist/core/skills/builtin/angular-developer/references/injection-context.md +63 -0
- package/dist/core/skills/builtin/angular-developer/references/inputs.md +101 -0
- package/dist/core/skills/builtin/angular-developer/references/linked-signal.md +59 -0
- package/dist/core/skills/builtin/angular-developer/references/loading-strategies.md +61 -0
- package/dist/core/skills/builtin/angular-developer/references/mcp.md +108 -0
- package/dist/core/skills/builtin/angular-developer/references/navigate-to-routes.md +69 -0
- package/dist/core/skills/builtin/angular-developer/references/outputs.md +86 -0
- package/dist/core/skills/builtin/angular-developer/references/reactive-forms.md +122 -0
- package/dist/core/skills/builtin/angular-developer/references/rendering-strategies.md +44 -0
- package/dist/core/skills/builtin/angular-developer/references/resource.md +77 -0
- package/dist/core/skills/builtin/angular-developer/references/route-animations.md +56 -0
- package/dist/core/skills/builtin/angular-developer/references/route-guards.md +52 -0
- package/dist/core/skills/builtin/angular-developer/references/router-lifecycle.md +45 -0
- package/dist/core/skills/builtin/angular-developer/references/router-testing.md +87 -0
- package/dist/core/skills/builtin/angular-developer/references/show-routes-with-outlets.md +68 -0
- package/dist/core/skills/builtin/angular-developer/references/signal-forms.md +795 -0
- package/dist/core/skills/builtin/angular-developer/references/signals-overview.md +94 -0
- package/dist/core/skills/builtin/angular-developer/references/tailwind-css.md +69 -0
- package/dist/core/skills/builtin/angular-developer/references/template-driven-forms.md +114 -0
- package/dist/core/skills/builtin/angular-developer/references/testing-fundamentals.md +65 -0
- package/dist/core/skills/builtin/api-connector-builder/SKILL.md +120 -0
- package/dist/core/skills/builtin/api-design/SKILL.md +523 -0
- package/dist/core/skills/builtin/architecture-decision-records/SKILL.md +179 -0
- package/dist/core/skills/builtin/article-writing/SKILL.md +79 -0
- package/dist/core/skills/builtin/automation-audit-ops/SKILL.md +142 -0
- package/dist/core/skills/builtin/autonomous-agent-harness/SKILL.md +273 -0
- package/dist/core/skills/builtin/autonomous-loops/SKILL.md +610 -0
- package/dist/core/skills/builtin/backend-patterns/SKILL.md +561 -0
- package/dist/core/skills/builtin/benchmark/SKILL.md +93 -0
- package/dist/core/skills/builtin/benchmark-optimization-loop/SKILL.md +69 -0
- package/dist/core/skills/builtin/blueprint/SKILL.md +105 -0
- package/dist/core/skills/builtin/browser-qa/SKILL.md +87 -0
- package/dist/core/skills/builtin/bun-runtime/SKILL.md +84 -0
- package/dist/core/skills/builtin/cisco-ios-patterns/SKILL.md +163 -0
- package/dist/core/skills/builtin/claude-devfleet/SKILL.md +111 -0
- package/dist/core/skills/builtin/click-path-audit/SKILL.md +244 -0
- package/dist/core/skills/builtin/clickhouse-io/SKILL.md +439 -0
- package/dist/core/skills/builtin/code-tour/SKILL.md +236 -0
- package/dist/core/skills/builtin/codebase-onboarding/SKILL.md +233 -0
- package/dist/core/skills/builtin/codehealth-mcp/SKILL.md +166 -0
- package/dist/core/skills/builtin/coding-standards/SKILL.md +550 -0
- package/dist/core/skills/builtin/compose-multiplatform-patterns/SKILL.md +299 -0
- package/dist/core/skills/builtin/config-gc/SKILL.md +119 -0
- package/dist/core/skills/builtin/content-engine/SKILL.md +131 -0
- package/dist/core/skills/builtin/content-hash-cache-pattern/SKILL.md +161 -0
- package/dist/core/skills/builtin/context-budget/SKILL.md +135 -0
- package/dist/core/skills/builtin/continuous-agent-loop/SKILL.md +45 -0
- package/dist/core/skills/builtin/continuous-learning/SKILL.md +131 -0
- package/dist/core/skills/builtin/continuous-learning/config.json +18 -0
- package/dist/core/skills/builtin/continuous-learning/evaluate-session.sh +69 -0
- package/dist/core/skills/builtin/continuous-learning-v2/SKILL.md +360 -0
- package/dist/core/skills/builtin/continuous-learning-v2/agents/observer-loop.sh +335 -0
- package/dist/core/skills/builtin/continuous-learning-v2/agents/observer.md +198 -0
- package/dist/core/skills/builtin/continuous-learning-v2/agents/session-guardian.sh +150 -0
- package/dist/core/skills/builtin/continuous-learning-v2/agents/start-observer.sh +248 -0
- package/dist/core/skills/builtin/continuous-learning-v2/config.json +8 -0
- package/dist/core/skills/builtin/continuous-learning-v2/hooks/observe.sh +498 -0
- package/dist/core/skills/builtin/continuous-learning-v2/scripts/detect-project.sh +322 -0
- package/dist/core/skills/builtin/continuous-learning-v2/scripts/instinct-cli.py +1914 -0
- package/dist/core/skills/builtin/continuous-learning-v2/scripts/lib/homunculus-dir.sh +31 -0
- package/dist/core/skills/builtin/continuous-learning-v2/scripts/migrate-homunculus.sh +62 -0
- package/dist/core/skills/builtin/continuous-learning-v2/scripts/test_parse_instinct.py +1045 -0
- package/dist/core/skills/builtin/cost-aware-llm-pipeline/SKILL.md +183 -0
- package/dist/core/skills/builtin/cost-tracking/SKILL.md +147 -0
- package/dist/core/skills/builtin/council/SKILL.md +203 -0
- package/dist/core/skills/builtin/cpp-coding-standards/SKILL.md +723 -0
- package/dist/core/skills/builtin/cpp-testing/SKILL.md +324 -0
- package/dist/core/skills/builtin/crosspost/SKILL.md +111 -0
- package/dist/core/skills/builtin/csharp-testing/SKILL.md +321 -0
- package/dist/core/skills/builtin/customs-trade-compliance/SKILL.md +263 -0
- package/dist/core/skills/builtin/dart-flutter-patterns/SKILL.md +563 -0
- package/dist/core/skills/builtin/dashboard-builder/SKILL.md +108 -0
- package/dist/core/skills/builtin/data-scraper-agent/SKILL.md +764 -0
- package/dist/core/skills/builtin/data-throughput-accelerator/SKILL.md +72 -0
- package/dist/core/skills/builtin/database-migrations/SKILL.md +429 -0
- package/dist/core/skills/builtin/deep-research/SKILL.md +159 -0
- package/dist/core/skills/builtin/defi-amm-security/SKILL.md +166 -0
- package/dist/core/skills/builtin/deployment-patterns/SKILL.md +427 -0
- package/dist/core/skills/builtin/design-system/SKILL.md +82 -0
- package/dist/core/skills/builtin/django-celery/SKILL.md +457 -0
- package/dist/core/skills/builtin/django-patterns/SKILL.md +734 -0
- package/dist/core/skills/builtin/django-security/SKILL.md +593 -0
- package/dist/core/skills/builtin/django-tdd/SKILL.md +729 -0
- package/dist/core/skills/builtin/django-verification/SKILL.md +469 -0
- package/dist/core/skills/builtin/dmux-workflows/SKILL.md +191 -0
- package/dist/core/skills/builtin/docker-patterns/SKILL.md +364 -0
- package/dist/core/skills/builtin/documentation-lookup/SKILL.md +90 -0
- package/dist/core/skills/builtin/dotnet-patterns/SKILL.md +321 -0
- package/dist/core/skills/builtin/dynamic-workflow-mode/SKILL.md +123 -0
- package/dist/core/skills/builtin/e2e-testing/SKILL.md +326 -0
- package/dist/core/skills/builtin/email-ops/SKILL.md +121 -0
- package/dist/core/skills/builtin/energy-procurement/SKILL.md +228 -0
- package/dist/core/skills/builtin/enterprise-agent-ops/SKILL.md +50 -0
- package/dist/core/skills/builtin/error-handling/SKILL.md +376 -0
- package/dist/core/skills/builtin/eval-harness/SKILL.md +270 -0
- package/dist/core/skills/builtin/evm-token-decimals/SKILL.md +130 -0
- package/dist/core/skills/builtin/exa-search/SKILL.md +107 -0
- package/dist/core/skills/builtin/fal-ai-media/SKILL.md +288 -0
- package/dist/core/skills/builtin/fastapi-patterns/SKILL.md +513 -0
- package/dist/core/skills/builtin/finance-billing-ops/SKILL.md +127 -0
- package/dist/core/skills/builtin/flox-environments/SKILL.md +496 -0
- package/dist/core/skills/builtin/flutter-dart-code-review/SKILL.md +435 -0
- package/dist/core/skills/builtin/foundation-models-on-device/SKILL.md +243 -0
- package/dist/core/skills/builtin/frontend-a11y/SKILL.md +445 -0
- package/dist/core/skills/builtin/frontend-design-direction/SKILL.md +92 -0
- package/dist/core/skills/builtin/frontend-patterns/SKILL.md +656 -0
- package/dist/core/skills/builtin/frontend-slides/SKILL.md +184 -0
- package/dist/core/skills/builtin/frontend-slides/STYLE_PRESETS.md +330 -0
- package/dist/core/skills/builtin/frontend-slides/animation-patterns.md +122 -0
- package/dist/core/skills/builtin/frontend-slides/html-template.md +419 -0
- package/dist/core/skills/builtin/frontend-slides/scripts/export-pdf.sh +418 -0
- package/dist/core/skills/builtin/frontend-slides/scripts/extract-pptx.py +96 -0
- package/dist/core/skills/builtin/frontend-slides/viewport-base.css +153 -0
- package/dist/core/skills/builtin/fsharp-testing/SKILL.md +280 -0
- package/dist/core/skills/builtin/gan-style-harness/SKILL.md +278 -0
- package/dist/core/skills/builtin/gateguard/SKILL.md +132 -0
- package/dist/core/skills/builtin/git-workflow/SKILL.md +715 -0
- package/dist/core/skills/builtin/github-ops/SKILL.md +144 -0
- package/dist/core/skills/builtin/golang-patterns/SKILL.md +674 -0
- package/dist/core/skills/builtin/golang-testing/SKILL.md +720 -0
- package/dist/core/skills/builtin/healthcare-cdss-patterns/SKILL.md +245 -0
- package/dist/core/skills/builtin/healthcare-emr-patterns/SKILL.md +159 -0
- package/dist/core/skills/builtin/healthcare-eval-harness/SKILL.md +207 -0
- package/dist/core/skills/builtin/healthcare-phi-compliance/SKILL.md +145 -0
- package/dist/core/skills/builtin/hermes-imports/SKILL.md +88 -0
- package/dist/core/skills/builtin/hexagonal-architecture/SKILL.md +276 -0
- package/dist/core/skills/builtin/hipaa-compliance/SKILL.md +78 -0
- package/dist/core/skills/builtin/hookify-rules/SKILL.md +128 -0
- package/dist/core/skills/builtin/inherit-legacy-style/SKILL.md +156 -0
- package/dist/core/skills/builtin/intent-driven-development/SKILL.md +360 -0
- package/dist/core/skills/builtin/inventory-demand-planning/SKILL.md +247 -0
- package/dist/core/skills/builtin/ios-icon-gen/SKILL.md +157 -0
- package/dist/core/skills/builtin/ios-icon-gen/scripts/generate_icons.swift +258 -0
- package/dist/core/skills/builtin/ios-icon-gen/scripts/iconify_gen.sh +235 -0
- package/dist/core/skills/builtin/iterative-retrieval/SKILL.md +211 -0
- package/dist/core/skills/builtin/java-coding-standards/SKILL.md +383 -0
- package/dist/core/skills/builtin/jira-integration/SKILL.md +302 -0
- package/dist/core/skills/builtin/jpa-patterns/SKILL.md +151 -0
- package/dist/core/skills/builtin/knowledge-ops/SKILL.md +154 -0
- package/dist/core/skills/builtin/kotlin-coroutines-flows/SKILL.md +284 -0
- package/dist/core/skills/builtin/kotlin-exposed-patterns/SKILL.md +719 -0
- package/dist/core/skills/builtin/kotlin-ktor-patterns/SKILL.md +689 -0
- package/dist/core/skills/builtin/kotlin-patterns/SKILL.md +711 -0
- package/dist/core/skills/builtin/kotlin-testing/SKILL.md +824 -0
- package/dist/core/skills/builtin/kubernetes-patterns/SKILL.md +755 -0
- package/dist/core/skills/builtin/laravel-patterns/SKILL.md +415 -0
- package/dist/core/skills/builtin/laravel-plugin-discovery/SKILL.md +229 -0
- package/dist/core/skills/builtin/laravel-security/SKILL.md +947 -0
- package/dist/core/skills/builtin/laravel-tdd/SKILL.md +674 -0
- package/dist/core/skills/builtin/laravel-verification/SKILL.md +179 -0
- package/dist/core/skills/builtin/latency-critical-systems/SKILL.md +73 -0
- package/dist/core/skills/builtin/lead-intelligence/SKILL.md +321 -0
- package/dist/core/skills/builtin/lead-intelligence/agents/enrichment-agent.md +85 -0
- package/dist/core/skills/builtin/lead-intelligence/agents/mutual-mapper.md +75 -0
- package/dist/core/skills/builtin/lead-intelligence/agents/outreach-drafter.md +98 -0
- package/dist/core/skills/builtin/lead-intelligence/agents/signal-scorer.md +60 -0
- package/dist/core/skills/builtin/liquid-glass-design/SKILL.md +279 -0
- package/dist/core/skills/builtin/llm-trading-agent-security/SKILL.md +146 -0
- package/dist/core/skills/builtin/logistics-exception-management/SKILL.md +222 -0
- package/dist/core/skills/builtin/make-interfaces-feel-better/SKILL.md +151 -0
- package/dist/core/skills/builtin/market-research/SKILL.md +75 -0
- package/dist/core/skills/builtin/marketing-campaign/SKILL.md +113 -0
- package/dist/core/skills/builtin/mcp-server-patterns/SKILL.md +69 -0
- package/dist/core/skills/builtin/messages-ops/SKILL.md +104 -0
- package/dist/core/skills/builtin/mle-workflow/SKILL.md +346 -0
- package/dist/core/skills/builtin/motion-advanced/SKILL.md +596 -0
- package/dist/core/skills/builtin/motion-foundations/SKILL.md +299 -0
- package/dist/core/skills/builtin/motion-patterns/SKILL.md +434 -0
- package/dist/core/skills/builtin/motion-ui/SKILL.md +575 -0
- package/dist/core/skills/builtin/mysql-patterns/SKILL.md +412 -0
- package/dist/core/skills/builtin/nanoclaw-repl/SKILL.md +33 -0
- package/dist/core/skills/builtin/nestjs-patterns/SKILL.md +230 -0
- package/dist/core/skills/builtin/netmiko-ssh-automation/SKILL.md +173 -0
- package/dist/core/skills/builtin/network-bgp-diagnostics/SKILL.md +167 -0
- package/dist/core/skills/builtin/network-config-validation/SKILL.md +210 -0
- package/dist/core/skills/builtin/network-interface-health/SKILL.md +152 -0
- package/dist/core/skills/builtin/nextjs-turbopack/SKILL.md +57 -0
- package/dist/core/skills/builtin/nodejs-keccak256/SKILL.md +102 -0
- package/dist/core/skills/builtin/nutrient-document-processing/SKILL.md +167 -0
- package/dist/core/skills/builtin/nuxt4-patterns/SKILL.md +100 -0
- package/dist/core/skills/builtin/openclaw-persona-forge/SKILL.md +288 -0
- package/dist/core/skills/builtin/openclaw-persona-forge/gacha.py +224 -0
- package/dist/core/skills/builtin/openclaw-persona-forge/gacha.sh +5 -0
- package/dist/core/skills/builtin/openclaw-persona-forge/references/avatar-style.md +124 -0
- package/dist/core/skills/builtin/openclaw-persona-forge/references/boundary-rules.md +53 -0
- package/dist/core/skills/builtin/openclaw-persona-forge/references/error-handling.md +53 -0
- package/dist/core/skills/builtin/openclaw-persona-forge/references/identity-tension.md +48 -0
- package/dist/core/skills/builtin/openclaw-persona-forge/references/naming-system.md +39 -0
- package/dist/core/skills/builtin/openclaw-persona-forge/references/output-template.md +166 -0
- package/dist/core/skills/builtin/opensource-pipeline/SKILL.md +255 -0
- package/dist/core/skills/builtin/orch-add-feature/SKILL.md +44 -0
- package/dist/core/skills/builtin/orch-build-mvp/SKILL.md +48 -0
- package/dist/core/skills/builtin/orch-change-feature/SKILL.md +42 -0
- package/dist/core/skills/builtin/orch-fix-defect/SKILL.md +42 -0
- package/dist/core/skills/builtin/orch-pipeline/SKILL.md +120 -0
- package/dist/core/skills/builtin/orch-refine-code/SKILL.md +43 -0
- package/dist/core/skills/builtin/parallel-execution-optimizer/SKILL.md +72 -0
- package/dist/core/skills/builtin/perl-patterns/SKILL.md +504 -0
- package/dist/core/skills/builtin/perl-security/SKILL.md +503 -0
- package/dist/core/skills/builtin/perl-testing/SKILL.md +475 -0
- package/dist/core/skills/builtin/plan-orchestrate/SKILL.md +262 -0
- package/dist/core/skills/builtin/plankton-code-quality/SKILL.md +236 -0
- package/dist/core/skills/builtin/postgres-patterns/SKILL.md +147 -0
- package/dist/core/skills/builtin/prediction-market-oracle-research/SKILL.md +63 -0
- package/dist/core/skills/builtin/prediction-market-risk-review/SKILL.md +60 -0
- package/dist/core/skills/builtin/prisma-patterns/SKILL.md +371 -0
- package/dist/core/skills/builtin/product-capability/SKILL.md +141 -0
- package/dist/core/skills/builtin/product-lens/SKILL.md +92 -0
- package/dist/core/skills/builtin/production-audit/SKILL.md +206 -0
- package/dist/core/skills/builtin/production-scheduling/SKILL.md +238 -0
- package/dist/core/skills/builtin/prompt-optimizer/SKILL.md +398 -0
- package/dist/core/skills/builtin/python-patterns/SKILL.md +750 -0
- package/dist/core/skills/builtin/python-testing/SKILL.md +816 -0
- package/dist/core/skills/builtin/pytorch-patterns/SKILL.md +396 -0
- package/dist/core/skills/builtin/quality-nonconformance/SKILL.md +260 -0
- package/dist/core/skills/builtin/quarkus-patterns/SKILL.md +722 -0
- package/dist/core/skills/builtin/quarkus-security/SKILL.md +467 -0
- package/dist/core/skills/builtin/quarkus-tdd/SKILL.md +811 -0
- package/dist/core/skills/builtin/quarkus-verification/SKILL.md +479 -0
- package/dist/core/skills/builtin/ralphinho-rfc-pipeline/SKILL.md +67 -0
- package/dist/core/skills/builtin/react-patterns/SKILL.md +341 -0
- package/dist/core/skills/builtin/react-performance/SKILL.md +574 -0
- package/dist/core/skills/builtin/react-testing/SKILL.md +423 -0
- package/dist/core/skills/builtin/recsys-pipeline-architect/SKILL.md +114 -0
- package/dist/core/skills/builtin/recursive-decision-ledger/SKILL.md +79 -0
- package/dist/core/skills/builtin/redis-patterns/SKILL.md +403 -0
- package/dist/core/skills/builtin/regex-vs-llm-structured-text/SKILL.md +220 -0
- package/dist/core/skills/builtin/repo-scan/SKILL.md +78 -0
- package/dist/core/skills/builtin/research-ops/SKILL.md +112 -0
- package/dist/core/skills/builtin/returns-reverse-logistics/SKILL.md +240 -0
- package/dist/core/skills/builtin/rules-distill/SKILL.md +264 -0
- package/dist/core/skills/builtin/rules-distill/scripts/scan-rules.sh +58 -0
- package/dist/core/skills/builtin/rules-distill/scripts/scan-skills.sh +129 -0
- package/dist/core/skills/builtin/rust-patterns/SKILL.md +499 -0
- package/dist/core/skills/builtin/rust-testing/SKILL.md +500 -0
- package/dist/core/skills/builtin/safety-guard/SKILL.md +75 -0
- package/dist/core/skills/builtin/santa-method/SKILL.md +306 -0
- package/dist/core/skills/builtin/scientific-db-pubmed-database/SKILL.md +175 -0
- package/dist/core/skills/builtin/scientific-db-uspto-database/SKILL.md +177 -0
- package/dist/core/skills/builtin/scientific-pkg-gget/SKILL.md +166 -0
- package/dist/core/skills/builtin/scientific-thinking-literature-review/SKILL.md +192 -0
- package/dist/core/skills/builtin/scientific-thinking-scholar-evaluation/SKILL.md +160 -0
- package/dist/core/skills/builtin/search-first/SKILL.md +182 -0
- package/dist/core/skills/builtin/security-bounty-hunter/SKILL.md +99 -0
- package/dist/core/skills/builtin/security-review/SKILL.md +503 -0
- package/dist/core/skills/builtin/security-review/cloud-infrastructure-security.md +361 -0
- package/dist/core/skills/builtin/security-scan/SKILL.md +165 -0
- package/dist/core/skills/builtin/seo/SKILL.md +154 -0
- package/dist/core/skills/builtin/skill-comply/SKILL.md +58 -0
- package/dist/core/skills/builtin/skill-comply/fixtures/compliant_trace.jsonl +5 -0
- package/dist/core/skills/builtin/skill-comply/fixtures/noncompliant_trace.jsonl +3 -0
- package/dist/core/skills/builtin/skill-comply/fixtures/tdd_spec.yaml +44 -0
- package/dist/core/skills/builtin/skill-comply/prompts/classifier.md +24 -0
- package/dist/core/skills/builtin/skill-comply/prompts/scenario_generator.md +62 -0
- package/dist/core/skills/builtin/skill-comply/prompts/spec_generator.md +42 -0
- package/dist/core/skills/builtin/skill-comply/pyproject.toml +15 -0
- package/dist/core/skills/builtin/skill-comply/scripts/__init__.py +0 -0
- package/dist/core/skills/builtin/skill-comply/scripts/classifier.py +85 -0
- package/dist/core/skills/builtin/skill-comply/scripts/grader.py +124 -0
- package/dist/core/skills/builtin/skill-comply/scripts/parser.py +107 -0
- package/dist/core/skills/builtin/skill-comply/scripts/report.py +170 -0
- package/dist/core/skills/builtin/skill-comply/scripts/run.py +127 -0
- package/dist/core/skills/builtin/skill-comply/scripts/runner.py +186 -0
- package/dist/core/skills/builtin/skill-comply/scripts/scenario_generator.py +70 -0
- package/dist/core/skills/builtin/skill-comply/scripts/spec_generator.py +72 -0
- package/dist/core/skills/builtin/skill-comply/scripts/utils.py +13 -0
- package/dist/core/skills/builtin/skill-comply/tests/test_grader.py +197 -0
- package/dist/core/skills/builtin/skill-comply/tests/test_parser.py +90 -0
- package/dist/core/skills/builtin/skill-comply/tests/test_runner.py +172 -0
- package/dist/core/skills/builtin/skill-scout/SKILL.md +140 -0
- package/dist/core/skills/builtin/skill-stocktake/SKILL.md +194 -0
- package/dist/core/skills/builtin/skill-stocktake/scripts/quick-diff.sh +87 -0
- package/dist/core/skills/builtin/skill-stocktake/scripts/save-results.sh +56 -0
- package/dist/core/skills/builtin/skill-stocktake/scripts/scan.sh +170 -0
- package/dist/core/skills/builtin/springboot-patterns/SKILL.md +314 -0
- package/dist/core/skills/builtin/springboot-security/SKILL.md +272 -0
- package/dist/core/skills/builtin/springboot-tdd/SKILL.md +158 -0
- package/dist/core/skills/builtin/springboot-verification/SKILL.md +231 -0
- package/dist/core/skills/builtin/strategic-compact/SKILL.md +135 -0
- package/dist/core/skills/builtin/swift-actor-persistence/SKILL.md +143 -0
- package/dist/core/skills/builtin/swift-concurrency-6-2/SKILL.md +216 -0
- package/dist/core/skills/builtin/swift-protocol-di-testing/SKILL.md +190 -0
- package/dist/core/skills/builtin/swiftui-patterns/SKILL.md +259 -0
- package/dist/core/skills/builtin/tdd-workflow/SKILL.md +463 -0
- package/dist/core/skills/builtin/team-agent-orchestration/SKILL.md +110 -0
- package/dist/core/skills/builtin/team-builder/SKILL.md +168 -0
- package/dist/core/skills/builtin/terminal-ops/SKILL.md +109 -0
- package/dist/core/skills/builtin/tinystruct-patterns/SKILL.md +203 -0
- package/dist/core/skills/builtin/tinystruct-patterns/references/architecture.md +90 -0
- package/dist/core/skills/builtin/tinystruct-patterns/references/data-handling.md +60 -0
- package/dist/core/skills/builtin/tinystruct-patterns/references/database.md +99 -0
- package/dist/core/skills/builtin/tinystruct-patterns/references/routing.md +64 -0
- package/dist/core/skills/builtin/tinystruct-patterns/references/system-usage.md +97 -0
- package/dist/core/skills/builtin/tinystruct-patterns/references/testing.md +72 -0
- package/dist/core/skills/builtin/token-budget-advisor/SKILL.md +133 -0
- package/dist/core/skills/builtin/ui-demo/SKILL.md +465 -0
- package/dist/core/skills/builtin/ui-to-vue/SKILL.md +134 -0
- package/dist/core/skills/builtin/uncloud/SKILL.md +343 -0
- package/dist/core/skills/builtin/unified-notifications-ops/SKILL.md +187 -0
- package/dist/core/skills/builtin/verification-loop/SKILL.md +126 -0
- package/dist/core/skills/builtin/video-editing/SKILL.md +310 -0
- package/dist/core/skills/builtin/videodb/SKILL.md +374 -0
- package/dist/core/skills/builtin/videodb/reference/api-reference.md +550 -0
- package/dist/core/skills/builtin/videodb/reference/capture-reference.md +407 -0
- package/dist/core/skills/builtin/videodb/reference/capture.md +101 -0
- package/dist/core/skills/builtin/videodb/reference/editor.md +443 -0
- package/dist/core/skills/builtin/videodb/reference/generative.md +331 -0
- package/dist/core/skills/builtin/videodb/reference/rtstream-reference.md +564 -0
- package/dist/core/skills/builtin/videodb/reference/rtstream.md +65 -0
- package/dist/core/skills/builtin/videodb/reference/search.md +230 -0
- package/dist/core/skills/builtin/videodb/reference/streaming.md +406 -0
- package/dist/core/skills/builtin/videodb/reference/use-cases.md +118 -0
- package/dist/core/skills/builtin/videodb/scripts/ws_listener.py +282 -0
- package/dist/core/skills/builtin/visa-doc-translate/README.md +86 -0
- package/dist/core/skills/builtin/visa-doc-translate/SKILL.md +117 -0
- package/dist/core/skills/builtin/vite-patterns/SKILL.md +449 -0
- package/dist/core/skills/builtin/windows-desktop-e2e/SKILL.md +887 -0
- package/dist/core/skills/builtin/x-api/SKILL.md +234 -0
- package/dist/core/skills/loader.d.ts +23 -12
- package/dist/core/skills/loader.d.ts.map +1 -1
- package/dist/core/skills/loader.js +105 -2
- package/dist/core/skills/loader.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: agent-introspection-debugging
|
|
3
|
+
description: [ECC] Structured self-debugging workflow for AI agent failures using capture, diagnosis, contained recovery, and introspection reports.
|
|
4
|
+
origin: ECC
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Agent Introspection Debugging
|
|
8
|
+
|
|
9
|
+
Use this skill when an agent run is failing repeatedly, consuming tokens without progress, looping on the same tools, or drifting away from the intended task.
|
|
10
|
+
|
|
11
|
+
This is a workflow skill, not a hidden runtime. It teaches the agent to debug itself systematically before escalating to a human.
|
|
12
|
+
|
|
13
|
+
## When to Activate
|
|
14
|
+
|
|
15
|
+
- Maximum tool call / loop-limit failures
|
|
16
|
+
- Repeated retries with no forward progress
|
|
17
|
+
- Context growth or prompt drift that starts degrading output quality
|
|
18
|
+
- File-system or environment state mismatch between expectation and reality
|
|
19
|
+
- Tool failures that are likely recoverable with diagnosis and a smaller corrective action
|
|
20
|
+
|
|
21
|
+
## Scope Boundaries
|
|
22
|
+
|
|
23
|
+
Activate this skill for:
|
|
24
|
+
- capturing failure state before retrying blindly
|
|
25
|
+
- diagnosing common agent-specific failure patterns
|
|
26
|
+
- applying contained recovery actions
|
|
27
|
+
- producing a structured human-readable debug report
|
|
28
|
+
|
|
29
|
+
Do not use this skill as the primary source for:
|
|
30
|
+
- feature verification after code changes; use `verification-loop`
|
|
31
|
+
- framework-specific debugging when a narrower ECC skill already exists
|
|
32
|
+
- runtime promises the current harness cannot enforce automatically
|
|
33
|
+
|
|
34
|
+
## Four-Phase Loop
|
|
35
|
+
|
|
36
|
+
### Phase 1: Failure Capture
|
|
37
|
+
|
|
38
|
+
Before trying to recover, record the failure precisely.
|
|
39
|
+
|
|
40
|
+
Capture:
|
|
41
|
+
- error type, message, and stack trace when available
|
|
42
|
+
- last meaningful tool call sequence
|
|
43
|
+
- what the agent was trying to do
|
|
44
|
+
- current context pressure: repeated prompts, oversized pasted logs, duplicated plans, or runaway notes
|
|
45
|
+
- current environment assumptions: cwd, branch, relevant service state, expected files
|
|
46
|
+
|
|
47
|
+
Minimum capture template:
|
|
48
|
+
|
|
49
|
+
```markdown
|
|
50
|
+
## Failure Capture
|
|
51
|
+
- Session / task:
|
|
52
|
+
- Goal in progress:
|
|
53
|
+
- Error:
|
|
54
|
+
- Last successful step:
|
|
55
|
+
- Last failed tool / command:
|
|
56
|
+
- Repeated pattern seen:
|
|
57
|
+
- Environment assumptions to verify:
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
### Phase 2: Root-Cause Diagnosis
|
|
61
|
+
|
|
62
|
+
Match the failure to a known pattern before changing anything.
|
|
63
|
+
|
|
64
|
+
| Pattern | Likely Cause | Check |
|
|
65
|
+
| --- | --- | --- |
|
|
66
|
+
| Maximum tool calls / repeated same command | loop or no-exit observer path | inspect the last N tool calls for repetition |
|
|
67
|
+
| Context overflow / degraded reasoning | unbounded notes, repeated plans, oversized logs | inspect recent context for duplication and low-signal bulk |
|
|
68
|
+
| `ECONNREFUSED` / timeout | service unavailable or wrong port | verify service health, URL, and port assumptions |
|
|
69
|
+
| `429` / quota exhaustion | retry storm or missing backoff | count repeated calls and inspect retry spacing |
|
|
70
|
+
| file missing after write / stale diff | race, wrong cwd, or branch drift | re-check path, cwd, git status, and actual file existence |
|
|
71
|
+
| tests still failing after “fix” | wrong hypothesis | isolate the exact failing test and re-derive the bug |
|
|
72
|
+
|
|
73
|
+
Diagnosis questions:
|
|
74
|
+
- is this a logic failure, state failure, environment failure, or policy failure?
|
|
75
|
+
- did the agent lose the real objective and start optimizing the wrong subtask?
|
|
76
|
+
- is the failure deterministic or transient?
|
|
77
|
+
- what is the smallest reversible action that would validate the diagnosis?
|
|
78
|
+
|
|
79
|
+
### Phase 3: Contained Recovery
|
|
80
|
+
|
|
81
|
+
Recover with the smallest action that changes the diagnosis surface.
|
|
82
|
+
|
|
83
|
+
Safe recovery actions:
|
|
84
|
+
- stop repeated retries and restate the hypothesis
|
|
85
|
+
- trim low-signal context and keep only the active goal, blockers, and evidence
|
|
86
|
+
- re-check the actual filesystem / branch / process state
|
|
87
|
+
- narrow the task to one failing command, one file, or one test
|
|
88
|
+
- switch from speculative reasoning to direct observation
|
|
89
|
+
- escalate to a human when the failure is high-risk or externally blocked
|
|
90
|
+
|
|
91
|
+
Do not claim unsupported auto-healing actions like “reset agent state” or “update harness config” unless you are actually doing them through real tools in the current environment.
|
|
92
|
+
|
|
93
|
+
Contained recovery checklist:
|
|
94
|
+
|
|
95
|
+
```markdown
|
|
96
|
+
## Recovery Action
|
|
97
|
+
- Diagnosis chosen:
|
|
98
|
+
- Smallest action taken:
|
|
99
|
+
- Why this is safe:
|
|
100
|
+
- What evidence would prove the fix worked:
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
### Phase 4: Introspection Report
|
|
104
|
+
|
|
105
|
+
End with a report that makes the recovery legible to the next agent or human.
|
|
106
|
+
|
|
107
|
+
```markdown
|
|
108
|
+
## Agent Self-Debug Report
|
|
109
|
+
- Session / task:
|
|
110
|
+
- Failure:
|
|
111
|
+
- Root cause:
|
|
112
|
+
- Recovery action:
|
|
113
|
+
- Result: success | partial | blocked
|
|
114
|
+
- Token / time burn risk:
|
|
115
|
+
- Follow-up needed:
|
|
116
|
+
- Preventive change to encode later:
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
## Recovery Heuristics
|
|
120
|
+
|
|
121
|
+
Prefer these interventions in order:
|
|
122
|
+
|
|
123
|
+
1. Restate the real objective in one sentence.
|
|
124
|
+
2. Verify the world state instead of trusting memory.
|
|
125
|
+
3. Shrink the failing scope.
|
|
126
|
+
4. Run one discriminating check.
|
|
127
|
+
5. Only then retry.
|
|
128
|
+
|
|
129
|
+
Bad pattern:
|
|
130
|
+
- retrying the same action three times with slightly different wording
|
|
131
|
+
|
|
132
|
+
Good pattern:
|
|
133
|
+
- capture failure
|
|
134
|
+
- classify the pattern
|
|
135
|
+
- run one direct check
|
|
136
|
+
- change the plan only if the check supports it
|
|
137
|
+
|
|
138
|
+
## Integration with ECC
|
|
139
|
+
|
|
140
|
+
- Use `verification-loop` after recovery if code was changed.
|
|
141
|
+
- Use `continuous-learning-v2` when the failure pattern is worth turning into an instinct or later skill.
|
|
142
|
+
- Use `council` when the issue is not technical failure but decision ambiguity.
|
|
143
|
+
- Use `workspace-surface-audit` if the failure came from conflicting local state or repo drift.
|
|
144
|
+
|
|
145
|
+
## Output Standard
|
|
146
|
+
|
|
147
|
+
When this skill is active, do not end with “I fixed it” alone.
|
|
148
|
+
|
|
149
|
+
Always provide:
|
|
150
|
+
- the failure pattern
|
|
151
|
+
- the root-cause hypothesis
|
|
152
|
+
- the recovery action
|
|
153
|
+
- the evidence that the situation is now better or still blocked
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: agentic-engineering
|
|
3
|
+
description: [ECC] Operate as an agentic engineer using eval-first execution, decomposition, and cost-aware model routing.
|
|
4
|
+
origin: ECC
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Agentic Engineering
|
|
8
|
+
|
|
9
|
+
Use this skill for engineering workflows where AI agents perform most implementation work and humans enforce quality and risk controls.
|
|
10
|
+
|
|
11
|
+
## Operating Principles
|
|
12
|
+
|
|
13
|
+
1. Define completion criteria before execution.
|
|
14
|
+
2. Decompose work into agent-sized units.
|
|
15
|
+
3. Route model tiers by task complexity.
|
|
16
|
+
4. Measure with evals and regression checks.
|
|
17
|
+
|
|
18
|
+
## Eval-First Loop
|
|
19
|
+
|
|
20
|
+
1. Define capability eval and regression eval.
|
|
21
|
+
2. Run baseline and capture failure signatures.
|
|
22
|
+
3. Execute implementation.
|
|
23
|
+
4. Re-run evals and compare deltas.
|
|
24
|
+
|
|
25
|
+
## Task Decomposition
|
|
26
|
+
|
|
27
|
+
Apply the 15-minute unit rule:
|
|
28
|
+
- each unit should be independently verifiable
|
|
29
|
+
- each unit should have a single dominant risk
|
|
30
|
+
- each unit should expose a clear done condition
|
|
31
|
+
|
|
32
|
+
## Model Routing
|
|
33
|
+
|
|
34
|
+
- Haiku: classification, boilerplate transforms, narrow edits
|
|
35
|
+
- Sonnet: implementation and refactors
|
|
36
|
+
- Opus: architecture, root-cause analysis, multi-file invariants
|
|
37
|
+
|
|
38
|
+
## Session Strategy
|
|
39
|
+
|
|
40
|
+
- Continue session for closely-coupled units.
|
|
41
|
+
- Start fresh session after major phase transitions.
|
|
42
|
+
- Compact after milestone completion, not during active debugging.
|
|
43
|
+
|
|
44
|
+
## Review Focus for AI-Generated Code
|
|
45
|
+
|
|
46
|
+
Prioritize:
|
|
47
|
+
- invariants and edge cases
|
|
48
|
+
- error boundaries
|
|
49
|
+
- security and auth assumptions
|
|
50
|
+
- hidden coupling and rollout risk
|
|
51
|
+
|
|
52
|
+
Do not waste review cycles on style-only disagreements when automated format/lint already enforce style.
|
|
53
|
+
|
|
54
|
+
## Cost Discipline
|
|
55
|
+
|
|
56
|
+
Track per task:
|
|
57
|
+
- model
|
|
58
|
+
- token estimate
|
|
59
|
+
- retries
|
|
60
|
+
- wall-clock time
|
|
61
|
+
- success/failure
|
|
62
|
+
|
|
63
|
+
Escalate model tier only when lower tier fails with a clear reasoning gap.
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: ai-first-engineering
|
|
3
|
+
description: [ECC] Engineering operating model for teams where AI agents generate a large share of implementation output.
|
|
4
|
+
origin: ECC
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# AI-First Engineering
|
|
8
|
+
|
|
9
|
+
Use this skill when designing process, reviews, and architecture for teams shipping with AI-assisted code generation.
|
|
10
|
+
|
|
11
|
+
## Process Shifts
|
|
12
|
+
|
|
13
|
+
1. Planning quality matters more than typing speed.
|
|
14
|
+
2. Eval coverage matters more than anecdotal confidence.
|
|
15
|
+
3. Review focus shifts from syntax to system behavior.
|
|
16
|
+
|
|
17
|
+
## Architecture Requirements
|
|
18
|
+
|
|
19
|
+
Prefer architectures that are agent-friendly:
|
|
20
|
+
- explicit boundaries
|
|
21
|
+
- stable contracts
|
|
22
|
+
- typed interfaces
|
|
23
|
+
- deterministic tests
|
|
24
|
+
|
|
25
|
+
Avoid implicit behavior spread across hidden conventions.
|
|
26
|
+
|
|
27
|
+
## Code Review in AI-First Teams
|
|
28
|
+
|
|
29
|
+
Review for:
|
|
30
|
+
- behavior regressions
|
|
31
|
+
- security assumptions
|
|
32
|
+
- data integrity
|
|
33
|
+
- failure handling
|
|
34
|
+
- rollout safety
|
|
35
|
+
|
|
36
|
+
Minimize time spent on style issues already covered by automation.
|
|
37
|
+
|
|
38
|
+
## Hiring and Evaluation Signals
|
|
39
|
+
|
|
40
|
+
Strong AI-first engineers:
|
|
41
|
+
- decompose ambiguous work cleanly
|
|
42
|
+
- define measurable acceptance criteria
|
|
43
|
+
- produce high-signal prompts and evals
|
|
44
|
+
- enforce risk controls under delivery pressure
|
|
45
|
+
|
|
46
|
+
## Testing Standard
|
|
47
|
+
|
|
48
|
+
Raise testing bar for generated code:
|
|
49
|
+
- required regression coverage for touched domains
|
|
50
|
+
- explicit edge-case assertions
|
|
51
|
+
- integration checks for interface boundaries
|
|
@@ -0,0 +1,385 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: ai-regression-testing
|
|
3
|
+
description: [ECC] Regression testing strategies for AI-assisted development. Sandbox-mode API testing without database dependencies, automated bug-check workflows, and patterns to catch AI blind spots where the same model writes and reviews code.
|
|
4
|
+
origin: ECC
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# AI Regression Testing
|
|
8
|
+
|
|
9
|
+
Testing patterns specifically designed for AI-assisted development, where the same model writes code and reviews it — creating systematic blind spots that only automated tests can catch.
|
|
10
|
+
|
|
11
|
+
## When to Activate
|
|
12
|
+
|
|
13
|
+
- AI agent (Claude Code, Cursor, Codex) has modified API routes or backend logic
|
|
14
|
+
- A bug was found and fixed — need to prevent re-introduction
|
|
15
|
+
- Project has a sandbox/mock mode that can be leveraged for DB-free testing
|
|
16
|
+
- Running `/bug-check` or similar review commands after code changes
|
|
17
|
+
- Multiple code paths exist (sandbox vs production, feature flags, etc.)
|
|
18
|
+
|
|
19
|
+
## The Core Problem
|
|
20
|
+
|
|
21
|
+
When an AI writes code and then reviews its own work, it carries the same assumptions into both steps. This creates a predictable failure pattern:
|
|
22
|
+
|
|
23
|
+
```
|
|
24
|
+
AI writes fix → AI reviews fix → AI says "looks correct" → Bug still exists
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
**Real-world example** (observed in production):
|
|
28
|
+
|
|
29
|
+
```
|
|
30
|
+
Fix 1: Added notification_settings to API response
|
|
31
|
+
→ Forgot to add it to the SELECT query
|
|
32
|
+
→ AI reviewed and missed it (same blind spot)
|
|
33
|
+
|
|
34
|
+
Fix 2: Added it to SELECT query
|
|
35
|
+
→ TypeScript build error (column not in generated types)
|
|
36
|
+
→ AI reviewed Fix 1 but didn't catch the SELECT issue
|
|
37
|
+
|
|
38
|
+
Fix 3: Changed to SELECT *
|
|
39
|
+
→ Fixed production path, forgot sandbox path
|
|
40
|
+
→ AI reviewed and missed it AGAIN (4th occurrence)
|
|
41
|
+
|
|
42
|
+
Fix 4: Test caught it instantly on first run PASS:
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
The pattern: **sandbox/production path inconsistency** is the #1 AI-introduced regression.
|
|
46
|
+
|
|
47
|
+
## Sandbox-Mode API Testing
|
|
48
|
+
|
|
49
|
+
Most projects with AI-friendly architecture have a sandbox/mock mode. This is the key to fast, DB-free API testing.
|
|
50
|
+
|
|
51
|
+
### Setup (Vitest + Next.js App Router)
|
|
52
|
+
|
|
53
|
+
```typescript
|
|
54
|
+
// vitest.config.ts
|
|
55
|
+
import { defineConfig } from "vitest/config";
|
|
56
|
+
import path from "path";
|
|
57
|
+
|
|
58
|
+
export default defineConfig({
|
|
59
|
+
test: {
|
|
60
|
+
environment: "node",
|
|
61
|
+
globals: true,
|
|
62
|
+
include: ["__tests__/**/*.test.ts"],
|
|
63
|
+
setupFiles: ["__tests__/setup.ts"],
|
|
64
|
+
},
|
|
65
|
+
resolve: {
|
|
66
|
+
alias: {
|
|
67
|
+
"@": path.resolve(__dirname, "."),
|
|
68
|
+
},
|
|
69
|
+
},
|
|
70
|
+
});
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
```typescript
|
|
74
|
+
// __tests__/setup.ts
|
|
75
|
+
// Force sandbox mode — no database needed
|
|
76
|
+
process.env.SANDBOX_MODE = "true";
|
|
77
|
+
process.env.NEXT_PUBLIC_SUPABASE_URL = "";
|
|
78
|
+
process.env.NEXT_PUBLIC_SUPABASE_ANON_KEY = "";
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
### Test Helper for Next.js API Routes
|
|
82
|
+
|
|
83
|
+
```typescript
|
|
84
|
+
// __tests__/helpers.ts
|
|
85
|
+
import { NextRequest } from "next/server";
|
|
86
|
+
|
|
87
|
+
export function createTestRequest(
|
|
88
|
+
url: string,
|
|
89
|
+
options?: {
|
|
90
|
+
method?: string;
|
|
91
|
+
body?: Record<string, unknown>;
|
|
92
|
+
headers?: Record<string, string>;
|
|
93
|
+
sandboxUserId?: string;
|
|
94
|
+
},
|
|
95
|
+
): NextRequest {
|
|
96
|
+
const { method = "GET", body, headers = {}, sandboxUserId } = options || {};
|
|
97
|
+
const fullUrl = url.startsWith("http") ? url : `http://localhost:3000${url}`;
|
|
98
|
+
const reqHeaders: Record<string, string> = { ...headers };
|
|
99
|
+
|
|
100
|
+
if (sandboxUserId) {
|
|
101
|
+
reqHeaders["x-sandbox-user-id"] = sandboxUserId;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
const init: { method: string; headers: Record<string, string>; body?: string } = {
|
|
105
|
+
method,
|
|
106
|
+
headers: reqHeaders,
|
|
107
|
+
};
|
|
108
|
+
|
|
109
|
+
if (body) {
|
|
110
|
+
init.body = JSON.stringify(body);
|
|
111
|
+
reqHeaders["content-type"] = "application/json";
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
return new NextRequest(fullUrl, init);
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
export async function parseResponse(response: Response) {
|
|
118
|
+
const json = await response.json();
|
|
119
|
+
return { status: response.status, json };
|
|
120
|
+
}
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
### Writing Regression Tests
|
|
124
|
+
|
|
125
|
+
The key principle: **write tests for bugs that were found, not for code that works**.
|
|
126
|
+
|
|
127
|
+
```typescript
|
|
128
|
+
// __tests__/api/user/profile.test.ts
|
|
129
|
+
import { describe, it, expect } from "vitest";
|
|
130
|
+
import { createTestRequest, parseResponse } from "../../helpers";
|
|
131
|
+
import { GET, PATCH } from "@/app/api/user/profile/route";
|
|
132
|
+
|
|
133
|
+
// Define the contract — what fields MUST be in the response
|
|
134
|
+
const REQUIRED_FIELDS = [
|
|
135
|
+
"id",
|
|
136
|
+
"email",
|
|
137
|
+
"full_name",
|
|
138
|
+
"phone",
|
|
139
|
+
"role",
|
|
140
|
+
"created_at",
|
|
141
|
+
"avatar_url",
|
|
142
|
+
"notification_settings", // ← Added after bug found it missing
|
|
143
|
+
];
|
|
144
|
+
|
|
145
|
+
describe("GET /api/user/profile", () => {
|
|
146
|
+
it("returns all required fields", async () => {
|
|
147
|
+
const req = createTestRequest("/api/user/profile");
|
|
148
|
+
const res = await GET(req);
|
|
149
|
+
const { status, json } = await parseResponse(res);
|
|
150
|
+
|
|
151
|
+
expect(status).toBe(200);
|
|
152
|
+
for (const field of REQUIRED_FIELDS) {
|
|
153
|
+
expect(json.data).toHaveProperty(field);
|
|
154
|
+
}
|
|
155
|
+
});
|
|
156
|
+
|
|
157
|
+
// Regression test — this exact bug was introduced by AI 4 times
|
|
158
|
+
it("notification_settings is not undefined (BUG-R1 regression)", async () => {
|
|
159
|
+
const req = createTestRequest("/api/user/profile");
|
|
160
|
+
const res = await GET(req);
|
|
161
|
+
const { json } = await parseResponse(res);
|
|
162
|
+
|
|
163
|
+
expect("notification_settings" in json.data).toBe(true);
|
|
164
|
+
const ns = json.data.notification_settings;
|
|
165
|
+
expect(ns === null || typeof ns === "object").toBe(true);
|
|
166
|
+
});
|
|
167
|
+
});
|
|
168
|
+
```
|
|
169
|
+
|
|
170
|
+
### Testing Sandbox/Production Parity
|
|
171
|
+
|
|
172
|
+
The most common AI regression: fixing production path but forgetting sandbox path (or vice versa).
|
|
173
|
+
|
|
174
|
+
```typescript
|
|
175
|
+
// Test that sandbox responses match the expected contract
|
|
176
|
+
describe("GET /api/user/messages (conversation list)", () => {
|
|
177
|
+
it("includes partner_name in sandbox mode", async () => {
|
|
178
|
+
const req = createTestRequest("/api/user/messages", {
|
|
179
|
+
sandboxUserId: "user-001",
|
|
180
|
+
});
|
|
181
|
+
const res = await GET(req);
|
|
182
|
+
const { json } = await parseResponse(res);
|
|
183
|
+
|
|
184
|
+
// This caught a bug where partner_name was added
|
|
185
|
+
// to production path but not sandbox path
|
|
186
|
+
if (json.data.length > 0) {
|
|
187
|
+
for (const conv of json.data) {
|
|
188
|
+
expect("partner_name" in conv).toBe(true);
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
});
|
|
192
|
+
});
|
|
193
|
+
```
|
|
194
|
+
|
|
195
|
+
## Integrating Tests into Bug-Check Workflow
|
|
196
|
+
|
|
197
|
+
### Custom Command Definition
|
|
198
|
+
|
|
199
|
+
```markdown
|
|
200
|
+
<!-- .claude/commands/bug-check.md -->
|
|
201
|
+
# Bug Check
|
|
202
|
+
|
|
203
|
+
## Step 1: Automated Tests (mandatory, cannot skip)
|
|
204
|
+
|
|
205
|
+
Run these commands FIRST before any code review:
|
|
206
|
+
|
|
207
|
+
npm run test # Vitest test suite
|
|
208
|
+
npm run build # TypeScript type check + build
|
|
209
|
+
|
|
210
|
+
- If tests fail → report as highest priority bug
|
|
211
|
+
- If build fails → report type errors as highest priority
|
|
212
|
+
- Only proceed to Step 2 if both pass
|
|
213
|
+
|
|
214
|
+
## Step 2: Code Review (AI review)
|
|
215
|
+
|
|
216
|
+
1. Sandbox / production path consistency
|
|
217
|
+
2. API response shape matches frontend expectations
|
|
218
|
+
3. SELECT clause completeness
|
|
219
|
+
4. Error handling with rollback
|
|
220
|
+
5. Optimistic update race conditions
|
|
221
|
+
|
|
222
|
+
## Step 3: For each bug fixed, propose a regression test
|
|
223
|
+
```
|
|
224
|
+
|
|
225
|
+
### The Workflow
|
|
226
|
+
|
|
227
|
+
```
|
|
228
|
+
User: "バグチェックして" (or "/bug-check")
|
|
229
|
+
│
|
|
230
|
+
├─ Step 1: npm run test
|
|
231
|
+
│ ├─ FAIL → Bug found mechanically (no AI judgment needed)
|
|
232
|
+
│ └─ PASS → Continue
|
|
233
|
+
│
|
|
234
|
+
├─ Step 2: npm run build
|
|
235
|
+
│ ├─ FAIL → Type error found mechanically
|
|
236
|
+
│ └─ PASS → Continue
|
|
237
|
+
│
|
|
238
|
+
├─ Step 3: AI code review (with known blind spots in mind)
|
|
239
|
+
│ └─ Findings reported
|
|
240
|
+
│
|
|
241
|
+
└─ Step 4: For each fix, write a regression test
|
|
242
|
+
└─ Next bug-check catches if fix breaks
|
|
243
|
+
```
|
|
244
|
+
|
|
245
|
+
## Common AI Regression Patterns
|
|
246
|
+
|
|
247
|
+
### Pattern 1: Sandbox/Production Path Mismatch
|
|
248
|
+
|
|
249
|
+
**Frequency**: Most common (observed in 3 out of 4 regressions)
|
|
250
|
+
|
|
251
|
+
```typescript
|
|
252
|
+
// FAIL: AI adds field to production path only
|
|
253
|
+
if (isSandboxMode()) {
|
|
254
|
+
return { data: { id, email, name } }; // Missing new field
|
|
255
|
+
}
|
|
256
|
+
// Production path
|
|
257
|
+
return { data: { id, email, name, notification_settings } };
|
|
258
|
+
|
|
259
|
+
// PASS: Both paths must return the same shape
|
|
260
|
+
if (isSandboxMode()) {
|
|
261
|
+
return { data: { id, email, name, notification_settings: null } };
|
|
262
|
+
}
|
|
263
|
+
return { data: { id, email, name, notification_settings } };
|
|
264
|
+
```
|
|
265
|
+
|
|
266
|
+
**Test to catch it**:
|
|
267
|
+
|
|
268
|
+
```typescript
|
|
269
|
+
it("sandbox and production return same fields", async () => {
|
|
270
|
+
// In test env, sandbox mode is forced ON
|
|
271
|
+
const res = await GET(createTestRequest("/api/user/profile"));
|
|
272
|
+
const { json } = await parseResponse(res);
|
|
273
|
+
|
|
274
|
+
for (const field of REQUIRED_FIELDS) {
|
|
275
|
+
expect(json.data).toHaveProperty(field);
|
|
276
|
+
}
|
|
277
|
+
});
|
|
278
|
+
```
|
|
279
|
+
|
|
280
|
+
### Pattern 2: SELECT Clause Omission
|
|
281
|
+
|
|
282
|
+
**Frequency**: Common with Supabase/Prisma when adding new columns
|
|
283
|
+
|
|
284
|
+
```typescript
|
|
285
|
+
// FAIL: New column added to response but not to SELECT
|
|
286
|
+
const { data } = await supabase
|
|
287
|
+
.from("users")
|
|
288
|
+
.select("id, email, name") // notification_settings not here
|
|
289
|
+
.single();
|
|
290
|
+
|
|
291
|
+
return { data: { ...data, notification_settings: data.notification_settings } };
|
|
292
|
+
// → notification_settings is always undefined
|
|
293
|
+
|
|
294
|
+
// PASS: Use SELECT * or explicitly include new columns
|
|
295
|
+
const { data } = await supabase
|
|
296
|
+
.from("users")
|
|
297
|
+
.select("*")
|
|
298
|
+
.single();
|
|
299
|
+
```
|
|
300
|
+
|
|
301
|
+
### Pattern 3: Error State Leakage
|
|
302
|
+
|
|
303
|
+
**Frequency**: Moderate — when adding error handling to existing components
|
|
304
|
+
|
|
305
|
+
```typescript
|
|
306
|
+
// FAIL: Error state set but old data not cleared
|
|
307
|
+
catch (err) {
|
|
308
|
+
setError("Failed to load");
|
|
309
|
+
// reservations still shows data from previous tab!
|
|
310
|
+
}
|
|
311
|
+
|
|
312
|
+
// PASS: Clear related state on error
|
|
313
|
+
catch (err) {
|
|
314
|
+
setReservations([]); // Clear stale data
|
|
315
|
+
setError("Failed to load");
|
|
316
|
+
}
|
|
317
|
+
```
|
|
318
|
+
|
|
319
|
+
### Pattern 4: Optimistic Update Without Proper Rollback
|
|
320
|
+
|
|
321
|
+
```typescript
|
|
322
|
+
// FAIL: No rollback on failure
|
|
323
|
+
const handleRemove = async (id: string) => {
|
|
324
|
+
setItems(prev => prev.filter(i => i.id !== id));
|
|
325
|
+
await fetch(`/api/items/${id}`, { method: "DELETE" });
|
|
326
|
+
// If API fails, item is gone from UI but still in DB
|
|
327
|
+
};
|
|
328
|
+
|
|
329
|
+
// PASS: Capture previous state and rollback on failure
|
|
330
|
+
const handleRemove = async (id: string) => {
|
|
331
|
+
const prevItems = [...items];
|
|
332
|
+
setItems(prev => prev.filter(i => i.id !== id));
|
|
333
|
+
try {
|
|
334
|
+
const res = await fetch(`/api/items/${id}`, { method: "DELETE" });
|
|
335
|
+
if (!res.ok) throw new Error("API error");
|
|
336
|
+
} catch {
|
|
337
|
+
setItems(prevItems); // Rollback
|
|
338
|
+
alert("削除に失敗しました");
|
|
339
|
+
}
|
|
340
|
+
};
|
|
341
|
+
```
|
|
342
|
+
|
|
343
|
+
## Strategy: Test Where Bugs Were Found
|
|
344
|
+
|
|
345
|
+
Don't aim for 100% coverage. Instead:
|
|
346
|
+
|
|
347
|
+
```
|
|
348
|
+
Bug found in /api/user/profile → Write test for profile API
|
|
349
|
+
Bug found in /api/user/messages → Write test for messages API
|
|
350
|
+
Bug found in /api/user/favorites → Write test for favorites API
|
|
351
|
+
No bug in /api/user/notifications → Don't write test (yet)
|
|
352
|
+
```
|
|
353
|
+
|
|
354
|
+
**Why this works with AI development:**
|
|
355
|
+
|
|
356
|
+
1. AI tends to make the **same category of mistake** repeatedly
|
|
357
|
+
2. Bugs cluster in complex areas (auth, multi-path logic, state management)
|
|
358
|
+
3. Once tested, that exact regression **cannot happen again**
|
|
359
|
+
4. Test count grows organically with bug fixes — no wasted effort
|
|
360
|
+
|
|
361
|
+
## Quick Reference
|
|
362
|
+
|
|
363
|
+
| AI Regression Pattern | Test Strategy | Priority |
|
|
364
|
+
|---|---|---|
|
|
365
|
+
| Sandbox/production mismatch | Assert same response shape in sandbox mode | High |
|
|
366
|
+
| SELECT clause omission | Assert all required fields in response | High |
|
|
367
|
+
| Error state leakage | Assert state cleanup on error | Medium |
|
|
368
|
+
| Missing rollback | Assert state restored on API failure | Medium |
|
|
369
|
+
| Type cast masking null | Assert field is not undefined | Medium |
|
|
370
|
+
|
|
371
|
+
## DO / DON'T
|
|
372
|
+
|
|
373
|
+
**DO:**
|
|
374
|
+
- Write tests immediately after finding a bug (before fixing it if possible)
|
|
375
|
+
- Test the API response shape, not the implementation
|
|
376
|
+
- Run tests as the first step of every bug-check
|
|
377
|
+
- Keep tests fast (< 1 second total with sandbox mode)
|
|
378
|
+
- Name tests after the bug they prevent (e.g., "BUG-R1 regression")
|
|
379
|
+
|
|
380
|
+
**DON'T:**
|
|
381
|
+
- Write tests for code that has never had a bug
|
|
382
|
+
- Trust AI self-review as a substitute for automated tests
|
|
383
|
+
- Skip sandbox path testing because "it's just mock data"
|
|
384
|
+
- Write integration tests when unit tests suffice
|
|
385
|
+
- Aim for coverage percentage — aim for regression prevention
|