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,194 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: skill-stocktake
|
|
3
|
+
description: "[ECC] Use when auditing Claude skills and commands for quality. Supports Quick Scan (changed skills only) and Full Stocktake modes with sequential subagent batch evaluation."
|
|
4
|
+
origin: ECC
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# skill-stocktake
|
|
8
|
+
|
|
9
|
+
Slash command (`/skill-stocktake`) that audits all Claude skills and commands using a quality checklist + AI holistic judgment. Supports two modes: Quick Scan for recently changed skills, and Full Stocktake for a complete review.
|
|
10
|
+
|
|
11
|
+
## Scope
|
|
12
|
+
|
|
13
|
+
The command targets the following paths **relative to the directory where it is invoked**:
|
|
14
|
+
|
|
15
|
+
| Path | Description |
|
|
16
|
+
|------|-------------|
|
|
17
|
+
| `~/.claude/skills/` | Global skills (all projects) |
|
|
18
|
+
| `{cwd}/.claude/skills/` | Project-level skills (if the directory exists) |
|
|
19
|
+
|
|
20
|
+
**At the start of Phase 1, the command explicitly lists which paths were found and scanned.**
|
|
21
|
+
|
|
22
|
+
### Targeting a specific project
|
|
23
|
+
|
|
24
|
+
To include project-level skills, run from that project's root directory:
|
|
25
|
+
|
|
26
|
+
```bash
|
|
27
|
+
cd ~/path/to/my-project
|
|
28
|
+
/skill-stocktake
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
If the project has no `.claude/skills/` directory, only global skills and commands are evaluated.
|
|
32
|
+
|
|
33
|
+
## Modes
|
|
34
|
+
|
|
35
|
+
| Mode | Trigger | Duration |
|
|
36
|
+
|------|---------|---------|
|
|
37
|
+
| Quick Scan | `results.json` exists (default) | 5–10 min |
|
|
38
|
+
| Full Stocktake | `results.json` absent, or `/skill-stocktake full` | 20–30 min |
|
|
39
|
+
|
|
40
|
+
**Results cache:** `~/.claude/skills/skill-stocktake/results.json`
|
|
41
|
+
|
|
42
|
+
## Quick Scan Flow
|
|
43
|
+
|
|
44
|
+
Re-evaluate only skills that have changed since the last run (5–10 min).
|
|
45
|
+
|
|
46
|
+
1. Read `~/.claude/skills/skill-stocktake/results.json`
|
|
47
|
+
2. Run: `bash ~/.claude/skills/skill-stocktake/scripts/quick-diff.sh \
|
|
48
|
+
~/.claude/skills/skill-stocktake/results.json`
|
|
49
|
+
(Project dir is auto-detected from `$PWD/.claude/skills`; pass it explicitly only if needed)
|
|
50
|
+
3. If output is `[]`: report "No changes since last run." and stop
|
|
51
|
+
4. Re-evaluate only those changed files using the same Phase 2 criteria
|
|
52
|
+
5. Carry forward unchanged skills from previous results
|
|
53
|
+
6. Output only the diff
|
|
54
|
+
7. Run: `bash ~/.claude/skills/skill-stocktake/scripts/save-results.sh \
|
|
55
|
+
~/.claude/skills/skill-stocktake/results.json <<< "$EVAL_RESULTS"`
|
|
56
|
+
|
|
57
|
+
## Full Stocktake Flow
|
|
58
|
+
|
|
59
|
+
### Phase 1 — Inventory
|
|
60
|
+
|
|
61
|
+
Run: `bash ~/.claude/skills/skill-stocktake/scripts/scan.sh`
|
|
62
|
+
|
|
63
|
+
The script enumerates skill files, extracts frontmatter, and collects UTC mtimes.
|
|
64
|
+
Project dir is auto-detected from `$PWD/.claude/skills`; pass it explicitly only if needed.
|
|
65
|
+
Present the scan summary and inventory table from the script output:
|
|
66
|
+
|
|
67
|
+
```
|
|
68
|
+
Scanning:
|
|
69
|
+
✓ ~/.claude/skills/ (17 files)
|
|
70
|
+
✗ {cwd}/.claude/skills/ (not found — global skills only)
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
| Skill | 7d use | 30d use | Description |
|
|
74
|
+
|-------|--------|---------|-------------|
|
|
75
|
+
|
|
76
|
+
### Phase 2 — Quality Evaluation
|
|
77
|
+
|
|
78
|
+
Launch an Agent tool subagent (**general-purpose agent**) with the full inventory and checklist:
|
|
79
|
+
|
|
80
|
+
```text
|
|
81
|
+
Agent(
|
|
82
|
+
subagent_type="general-purpose",
|
|
83
|
+
prompt="
|
|
84
|
+
Evaluate the following skill inventory against the checklist.
|
|
85
|
+
|
|
86
|
+
[INVENTORY]
|
|
87
|
+
|
|
88
|
+
[CHECKLIST]
|
|
89
|
+
|
|
90
|
+
Return JSON for each skill:
|
|
91
|
+
{ \"verdict\": \"Keep\"|\"Improve\"|\"Update\"|\"Retire\"|\"Merge into [X]\", \"reason\": \"...\" }
|
|
92
|
+
"
|
|
93
|
+
)
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
The subagent reads each skill, applies the checklist, and returns per-skill JSON:
|
|
97
|
+
|
|
98
|
+
`{ "verdict": "Keep"|"Improve"|"Update"|"Retire"|"Merge into [X]", "reason": "..." }`
|
|
99
|
+
|
|
100
|
+
**Chunk guidance:** Process ~20 skills per subagent invocation to keep context manageable. Save intermediate results to `results.json` (`status: "in_progress"`) after each chunk.
|
|
101
|
+
|
|
102
|
+
After all skills are evaluated: set `status: "completed"`, proceed to Phase 3.
|
|
103
|
+
|
|
104
|
+
**Resume detection:** If `status: "in_progress"` is found on startup, resume from the first unevaluated skill.
|
|
105
|
+
|
|
106
|
+
Each skill is evaluated against this checklist:
|
|
107
|
+
|
|
108
|
+
```
|
|
109
|
+
- [ ] Content overlap with other skills checked
|
|
110
|
+
- [ ] Overlap with MEMORY.md / CLAUDE.md checked
|
|
111
|
+
- [ ] Freshness of technical references verified (use WebSearch if tool names / CLI flags / APIs are present)
|
|
112
|
+
- [ ] Usage frequency considered
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
Verdict criteria:
|
|
116
|
+
|
|
117
|
+
| Verdict | Meaning |
|
|
118
|
+
|---------|---------|
|
|
119
|
+
| Keep | Useful and current |
|
|
120
|
+
| Improve | Worth keeping, but specific improvements needed |
|
|
121
|
+
| Update | Referenced technology is outdated (verify with WebSearch) |
|
|
122
|
+
| Retire | Low quality, stale, or cost-asymmetric |
|
|
123
|
+
| Merge into [X] | Substantial overlap with another skill; name the merge target |
|
|
124
|
+
|
|
125
|
+
Evaluation is **holistic AI judgment** — not a numeric rubric. Guiding dimensions:
|
|
126
|
+
- **Actionability**: code examples, commands, or steps that let you act immediately
|
|
127
|
+
- **Scope fit**: name, trigger, and content are aligned; not too broad or narrow
|
|
128
|
+
- **Uniqueness**: value not replaceable by MEMORY.md / CLAUDE.md / another skill
|
|
129
|
+
- **Currency**: technical references work in the current environment
|
|
130
|
+
|
|
131
|
+
**Reason quality requirements** — the `reason` field must be self-contained and decision-enabling:
|
|
132
|
+
- Do NOT write "unchanged" alone — always restate the core evidence
|
|
133
|
+
- For **Retire**: state (1) what specific defect was found, (2) what covers the same need instead
|
|
134
|
+
- Bad: `"Superseded"`
|
|
135
|
+
- Good: `"disable-model-invocation: true already set; superseded by continuous-learning-v2 which covers all the same patterns plus confidence scoring. No unique content remains."`
|
|
136
|
+
- For **Merge**: name the target and describe what content to integrate
|
|
137
|
+
- Bad: `"Overlaps with X"`
|
|
138
|
+
- Good: `"42-line thin content; Step 4 of chatlog-to-article already covers the same workflow. Integrate the 'article angle' tip as a note in that skill."`
|
|
139
|
+
- For **Improve**: describe the specific change needed (what section, what action, target size if relevant)
|
|
140
|
+
- Bad: `"Too long"`
|
|
141
|
+
- Good: `"276 lines; Section 'Framework Comparison' (L80–140) duplicates ai-era-architecture-principles; delete it to reach ~150 lines."`
|
|
142
|
+
- For **Keep** (mtime-only change in Quick Scan): restate the original verdict rationale, do not write "unchanged"
|
|
143
|
+
- Bad: `"Unchanged"`
|
|
144
|
+
- Good: `"mtime updated but content unchanged. Unique Python reference explicitly imported by rules/python/; no overlap found."`
|
|
145
|
+
|
|
146
|
+
### Phase 3 — Summary Table
|
|
147
|
+
|
|
148
|
+
| Skill | 7d use | Verdict | Reason |
|
|
149
|
+
|-------|--------|---------|--------|
|
|
150
|
+
|
|
151
|
+
### Phase 4 — Consolidation
|
|
152
|
+
|
|
153
|
+
1. **Retire / Merge**: present detailed justification per file before confirming with user:
|
|
154
|
+
- What specific problem was found (overlap, staleness, broken references, etc.)
|
|
155
|
+
- What alternative covers the same functionality (for Retire: which existing skill/rule; for Merge: the target file and what content to integrate)
|
|
156
|
+
- Impact of removal (any dependent skills, MEMORY.md references, or workflows affected)
|
|
157
|
+
2. **Improve**: present specific improvement suggestions with rationale:
|
|
158
|
+
- What to change and why (e.g., "trim 430→200 lines because sections X/Y duplicate python-patterns")
|
|
159
|
+
- User decides whether to act
|
|
160
|
+
3. **Update**: present updated content with sources checked
|
|
161
|
+
4. Check MEMORY.md line count; propose compression if >100 lines
|
|
162
|
+
|
|
163
|
+
## Results File Schema
|
|
164
|
+
|
|
165
|
+
`~/.claude/skills/skill-stocktake/results.json`:
|
|
166
|
+
|
|
167
|
+
**`evaluated_at`**: Must be set to the actual UTC time of evaluation completion.
|
|
168
|
+
Obtain via Bash: `date -u +%Y-%m-%dT%H:%M:%SZ`. Never use a date-only approximation like `T00:00:00Z`.
|
|
169
|
+
|
|
170
|
+
```json
|
|
171
|
+
{
|
|
172
|
+
"evaluated_at": "2026-02-21T10:00:00Z",
|
|
173
|
+
"mode": "full",
|
|
174
|
+
"batch_progress": {
|
|
175
|
+
"total": 80,
|
|
176
|
+
"evaluated": 80,
|
|
177
|
+
"status": "completed"
|
|
178
|
+
},
|
|
179
|
+
"skills": {
|
|
180
|
+
"skill-name": {
|
|
181
|
+
"path": "~/.claude/skills/skill-name/SKILL.md",
|
|
182
|
+
"verdict": "Keep",
|
|
183
|
+
"reason": "Concrete, actionable, unique value for X workflow",
|
|
184
|
+
"mtime": "2026-01-15T08:30:00Z"
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
```
|
|
189
|
+
|
|
190
|
+
## Notes
|
|
191
|
+
|
|
192
|
+
- Evaluation is blind: the same checklist applies to all skills regardless of origin (ECC, self-authored, auto-extracted)
|
|
193
|
+
- Archive / delete operations always require explicit user confirmation
|
|
194
|
+
- No verdict branching by skill origin
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
# quick-diff.sh — compare skill file mtimes against results.json evaluated_at
|
|
3
|
+
# Usage: quick-diff.sh RESULTS_JSON [CWD_SKILLS_DIR]
|
|
4
|
+
# Output: JSON array of changed/new files to stdout (empty [] if no changes)
|
|
5
|
+
#
|
|
6
|
+
# When CWD_SKILLS_DIR is omitted, defaults to $PWD/.claude/skills so the
|
|
7
|
+
# script always picks up project-level skills without relying on the caller.
|
|
8
|
+
#
|
|
9
|
+
# Environment:
|
|
10
|
+
# SKILL_STOCKTAKE_GLOBAL_DIR Override ~/.claude/skills (for testing only;
|
|
11
|
+
# do not set in production — intended for bats tests)
|
|
12
|
+
# SKILL_STOCKTAKE_PROJECT_DIR Override project dir detection (for testing only)
|
|
13
|
+
|
|
14
|
+
set -euo pipefail
|
|
15
|
+
|
|
16
|
+
RESULTS_JSON="${1:-}"
|
|
17
|
+
CWD_SKILLS_DIR="${SKILL_STOCKTAKE_PROJECT_DIR:-${2:-$PWD/.claude/skills}}"
|
|
18
|
+
GLOBAL_DIR="${SKILL_STOCKTAKE_GLOBAL_DIR:-$HOME/.claude/skills}"
|
|
19
|
+
|
|
20
|
+
if [[ -z "$RESULTS_JSON" || ! -f "$RESULTS_JSON" ]]; then
|
|
21
|
+
echo "Error: RESULTS_JSON not found: ${RESULTS_JSON:-<empty>}" >&2
|
|
22
|
+
exit 1
|
|
23
|
+
fi
|
|
24
|
+
|
|
25
|
+
# Validate CWD_SKILLS_DIR looks like a .claude/skills path (defense-in-depth).
|
|
26
|
+
# Only warn when the path exists — a nonexistent path poses no traversal risk.
|
|
27
|
+
if [[ -n "$CWD_SKILLS_DIR" && -d "$CWD_SKILLS_DIR" && "$CWD_SKILLS_DIR" != */.claude/skills* ]]; then
|
|
28
|
+
echo "Warning: CWD_SKILLS_DIR does not look like a .claude/skills path: $CWD_SKILLS_DIR" >&2
|
|
29
|
+
fi
|
|
30
|
+
|
|
31
|
+
evaluated_at=$(jq -r '.evaluated_at' "$RESULTS_JSON")
|
|
32
|
+
|
|
33
|
+
# Fail fast on a missing or malformed evaluated_at rather than producing
|
|
34
|
+
# unpredictable results from ISO 8601 string comparison against "null".
|
|
35
|
+
if [[ ! "$evaluated_at" =~ ^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}Z$ ]]; then
|
|
36
|
+
echo "Error: invalid or missing evaluated_at in $RESULTS_JSON: $evaluated_at" >&2
|
|
37
|
+
exit 1
|
|
38
|
+
fi
|
|
39
|
+
|
|
40
|
+
# Pre-extract known paths from results.json once (O(1) lookup per file instead of O(n*m))
|
|
41
|
+
known_paths=$(jq -r '.skills[].path' "$RESULTS_JSON" 2>/dev/null)
|
|
42
|
+
|
|
43
|
+
tmpdir=$(mktemp -d)
|
|
44
|
+
# Use a function to avoid embedding $tmpdir in a quoted string (prevents injection
|
|
45
|
+
# if TMPDIR were crafted to contain shell metacharacters).
|
|
46
|
+
_cleanup() { rm -rf "$tmpdir"; }
|
|
47
|
+
trap _cleanup EXIT
|
|
48
|
+
|
|
49
|
+
# Shared counter across process_dir calls — intentionally NOT local
|
|
50
|
+
i=0
|
|
51
|
+
|
|
52
|
+
process_dir() {
|
|
53
|
+
local dir="$1"
|
|
54
|
+
while IFS= read -r file; do
|
|
55
|
+
local mtime dp is_new
|
|
56
|
+
mtime=$(date -u -r "$file" +%Y-%m-%dT%H:%M:%SZ)
|
|
57
|
+
dp="${file/#$HOME/~}"
|
|
58
|
+
|
|
59
|
+
# Check if this file is known to results.json (exact whole-line match to
|
|
60
|
+
# avoid substring false-positives, e.g. "python-patterns" matching "python-patterns-v2").
|
|
61
|
+
if echo "$known_paths" | grep -qxF "$dp"; then
|
|
62
|
+
is_new="false"
|
|
63
|
+
# Known file: only emit if mtime changed (ISO 8601 string comparison is safe)
|
|
64
|
+
[[ "$mtime" > "$evaluated_at" ]] || continue
|
|
65
|
+
else
|
|
66
|
+
is_new="true"
|
|
67
|
+
# New file: always emit regardless of mtime
|
|
68
|
+
fi
|
|
69
|
+
|
|
70
|
+
jq -n \
|
|
71
|
+
--arg path "$dp" \
|
|
72
|
+
--arg mtime "$mtime" \
|
|
73
|
+
--argjson is_new "$is_new" \
|
|
74
|
+
'{path:$path,mtime:$mtime,is_new:$is_new}' \
|
|
75
|
+
> "$tmpdir/$i.json"
|
|
76
|
+
i=$((i+1))
|
|
77
|
+
done < <(find "$dir" -name "*.md" -type f 2>/dev/null | sort)
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
[[ -d "$GLOBAL_DIR" ]] && process_dir "$GLOBAL_DIR"
|
|
81
|
+
[[ -n "$CWD_SKILLS_DIR" && -d "$CWD_SKILLS_DIR" ]] && process_dir "$CWD_SKILLS_DIR"
|
|
82
|
+
|
|
83
|
+
if [[ $i -eq 0 ]]; then
|
|
84
|
+
echo "[]"
|
|
85
|
+
else
|
|
86
|
+
jq -s '.' "$tmpdir"/*.json
|
|
87
|
+
fi
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
# save-results.sh — merge evaluated skills into results.json with correct UTC timestamp
|
|
3
|
+
# Usage: save-results.sh RESULTS_JSON <<< "$EVAL_JSON"
|
|
4
|
+
#
|
|
5
|
+
# stdin format:
|
|
6
|
+
# { "skills": {...}, "mode"?: "full"|"quick", "batch_progress"?: {...} }
|
|
7
|
+
#
|
|
8
|
+
# Always sets evaluated_at to current UTC time via `date -u`.
|
|
9
|
+
# Merges stdin .skills into existing results.json (new entries override old).
|
|
10
|
+
# Optionally updates .mode and .batch_progress if present in stdin.
|
|
11
|
+
|
|
12
|
+
set -euo pipefail
|
|
13
|
+
|
|
14
|
+
RESULTS_JSON="${1:-}"
|
|
15
|
+
|
|
16
|
+
if [[ -z "$RESULTS_JSON" ]]; then
|
|
17
|
+
echo "Error: RESULTS_JSON argument required" >&2
|
|
18
|
+
echo "Usage: save-results.sh RESULTS_JSON <<< \"\$EVAL_JSON\"" >&2
|
|
19
|
+
exit 1
|
|
20
|
+
fi
|
|
21
|
+
|
|
22
|
+
EVALUATED_AT=$(date -u +%Y-%m-%dT%H:%M:%SZ)
|
|
23
|
+
|
|
24
|
+
# Read eval results from stdin and validate JSON before touching the results file
|
|
25
|
+
input_json=$(cat)
|
|
26
|
+
if ! echo "$input_json" | jq empty 2>/dev/null; then
|
|
27
|
+
echo "Error: stdin is not valid JSON" >&2
|
|
28
|
+
exit 1
|
|
29
|
+
fi
|
|
30
|
+
|
|
31
|
+
if [[ ! -f "$RESULTS_JSON" ]]; then
|
|
32
|
+
# Bootstrap: create new results.json from stdin JSON + current UTC timestamp
|
|
33
|
+
echo "$input_json" | jq --arg ea "$EVALUATED_AT" \
|
|
34
|
+
'. + { evaluated_at: $ea }' > "$RESULTS_JSON"
|
|
35
|
+
exit 0
|
|
36
|
+
fi
|
|
37
|
+
|
|
38
|
+
# Merge: new .skills override existing ones; old skills not in input_json are kept.
|
|
39
|
+
# Optionally update .mode and .batch_progress if provided.
|
|
40
|
+
#
|
|
41
|
+
# Use mktemp for a collision-safe temp file (concurrent runs on the same RESULTS_JSON
|
|
42
|
+
# would race on a predictable ".tmp" suffix; random suffix prevents silent overwrites).
|
|
43
|
+
tmp=$(mktemp "${RESULTS_JSON}.XXXXXX")
|
|
44
|
+
trap 'rm -f "$tmp"' EXIT
|
|
45
|
+
|
|
46
|
+
jq -s \
|
|
47
|
+
--arg ea "$EVALUATED_AT" \
|
|
48
|
+
'.[0] as $existing | .[1] as $new |
|
|
49
|
+
$existing |
|
|
50
|
+
.evaluated_at = $ea |
|
|
51
|
+
.skills = ($existing.skills + ($new.skills // {})) |
|
|
52
|
+
if ($new | has("mode")) then .mode = $new.mode else . end |
|
|
53
|
+
if ($new | has("batch_progress")) then .batch_progress = $new.batch_progress else . end' \
|
|
54
|
+
"$RESULTS_JSON" <(echo "$input_json") > "$tmp"
|
|
55
|
+
|
|
56
|
+
mv "$tmp" "$RESULTS_JSON"
|
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
# scan.sh — enumerate skill files, extract frontmatter and UTC mtime
|
|
3
|
+
# Usage: scan.sh [CWD_SKILLS_DIR]
|
|
4
|
+
# Output: JSON to stdout
|
|
5
|
+
#
|
|
6
|
+
# When CWD_SKILLS_DIR is omitted, defaults to $PWD/.claude/skills so the
|
|
7
|
+
# script always picks up project-level skills without relying on the caller.
|
|
8
|
+
#
|
|
9
|
+
# Environment:
|
|
10
|
+
# SKILL_STOCKTAKE_GLOBAL_DIR Override ~/.claude/skills (for testing only;
|
|
11
|
+
# do not set in production — intended for bats tests)
|
|
12
|
+
# SKILL_STOCKTAKE_PROJECT_DIR Override project dir detection (for testing only)
|
|
13
|
+
|
|
14
|
+
set -euo pipefail
|
|
15
|
+
|
|
16
|
+
GLOBAL_DIR="${SKILL_STOCKTAKE_GLOBAL_DIR:-$HOME/.claude/skills}"
|
|
17
|
+
CWD_SKILLS_DIR="${SKILL_STOCKTAKE_PROJECT_DIR:-${1:-$PWD/.claude/skills}}"
|
|
18
|
+
# Path to JSONL file containing tool-use observations (optional; used for usage frequency counts).
|
|
19
|
+
# Override via SKILL_STOCKTAKE_OBSERVATIONS env var if your setup uses a different path.
|
|
20
|
+
OBSERVATIONS="${SKILL_STOCKTAKE_OBSERVATIONS:-$HOME/.claude/observations.jsonl}"
|
|
21
|
+
|
|
22
|
+
# Validate CWD_SKILLS_DIR looks like a .claude/skills path (defense-in-depth).
|
|
23
|
+
# Only warn when the path exists — a nonexistent path poses no traversal risk.
|
|
24
|
+
if [[ -n "$CWD_SKILLS_DIR" && -d "$CWD_SKILLS_DIR" && "$CWD_SKILLS_DIR" != */.claude/skills* ]]; then
|
|
25
|
+
echo "Warning: CWD_SKILLS_DIR does not look like a .claude/skills path: $CWD_SKILLS_DIR" >&2
|
|
26
|
+
fi
|
|
27
|
+
|
|
28
|
+
# Extract a frontmatter field (handles both quoted and unquoted single-line values).
|
|
29
|
+
# Does NOT support multi-line YAML blocks (| or >) or nested YAML keys.
|
|
30
|
+
extract_field() {
|
|
31
|
+
local file="$1" field="$2"
|
|
32
|
+
awk -v f="$field" '
|
|
33
|
+
BEGIN { fm=0 }
|
|
34
|
+
/^---$/ { fm++; next }
|
|
35
|
+
fm==1 {
|
|
36
|
+
n = length(f) + 2
|
|
37
|
+
if (substr($0, 1, n) == f ": ") {
|
|
38
|
+
val = substr($0, n+1)
|
|
39
|
+
gsub(/^"/, "", val)
|
|
40
|
+
gsub(/"$/, "", val)
|
|
41
|
+
print val
|
|
42
|
+
exit
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
fm>=2 { exit }
|
|
46
|
+
' "$file"
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
# Get UTC timestamp N days ago (supports both macOS and GNU date)
|
|
50
|
+
date_ago() {
|
|
51
|
+
local n="$1"
|
|
52
|
+
date -u -v-"${n}d" +%Y-%m-%dT%H:%M:%SZ 2>/dev/null ||
|
|
53
|
+
date -u -d "${n} days ago" +%Y-%m-%dT%H:%M:%SZ
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
# Count observations matching a file path since a cutoff timestamp
|
|
57
|
+
count_obs() {
|
|
58
|
+
local file="$1" cutoff="$2"
|
|
59
|
+
if [[ ! -f "$OBSERVATIONS" ]]; then
|
|
60
|
+
echo 0
|
|
61
|
+
return
|
|
62
|
+
fi
|
|
63
|
+
jq -r --arg p "$file" --arg c "$cutoff" \
|
|
64
|
+
'select(.tool=="Read" and .path==$p and .timestamp>=$c) | 1' \
|
|
65
|
+
"$OBSERVATIONS" 2>/dev/null | wc -l | tr -d ' '
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
# Scan a directory and produce a JSON array of skill objects
|
|
69
|
+
scan_dir_to_json() {
|
|
70
|
+
local dir="$1"
|
|
71
|
+
local c7 c30
|
|
72
|
+
c7=$(date_ago 7)
|
|
73
|
+
c30=$(date_ago 30)
|
|
74
|
+
|
|
75
|
+
local tmpdir
|
|
76
|
+
tmpdir=$(mktemp -d)
|
|
77
|
+
# Use a function to avoid embedding $tmpdir in a quoted string (prevents injection
|
|
78
|
+
# if TMPDIR were crafted to contain shell metacharacters).
|
|
79
|
+
local _scan_tmpdir="$tmpdir"
|
|
80
|
+
_scan_cleanup() { rm -rf "$_scan_tmpdir"; }
|
|
81
|
+
trap _scan_cleanup RETURN
|
|
82
|
+
|
|
83
|
+
# Pre-aggregate observation counts in two passes (one per window) instead of
|
|
84
|
+
# calling jq per-file — reduces from O(n*m) to O(n+m) jq invocations.
|
|
85
|
+
local obs_7d_counts obs_30d_counts
|
|
86
|
+
obs_7d_counts=""
|
|
87
|
+
obs_30d_counts=""
|
|
88
|
+
if [[ -f "$OBSERVATIONS" ]]; then
|
|
89
|
+
obs_7d_counts=$(jq -r --arg c "$c7" \
|
|
90
|
+
'select(.tool=="Read" and .timestamp>=$c) | .path' \
|
|
91
|
+
"$OBSERVATIONS" 2>/dev/null | sort | uniq -c)
|
|
92
|
+
obs_30d_counts=$(jq -r --arg c "$c30" \
|
|
93
|
+
'select(.tool=="Read" and .timestamp>=$c) | .path' \
|
|
94
|
+
"$OBSERVATIONS" 2>/dev/null | sort | uniq -c)
|
|
95
|
+
fi
|
|
96
|
+
|
|
97
|
+
local i=0
|
|
98
|
+
while IFS= read -r file; do
|
|
99
|
+
local name desc mtime u7 u30 dp
|
|
100
|
+
name=$(extract_field "$file" "name")
|
|
101
|
+
desc=$(extract_field "$file" "description")
|
|
102
|
+
mtime=$(date -u -r "$file" +%Y-%m-%dT%H:%M:%SZ)
|
|
103
|
+
# Use awk exact field match to avoid substring false-positives from grep -F.
|
|
104
|
+
# uniq -c output format: " N /path/to/file" — path is always field 2.
|
|
105
|
+
u7=$(echo "$obs_7d_counts" | awk -v f="$file" '$2 == f {print $1}' | head -1)
|
|
106
|
+
u7="${u7:-0}"
|
|
107
|
+
u30=$(echo "$obs_30d_counts" | awk -v f="$file" '$2 == f {print $1}' | head -1)
|
|
108
|
+
u30="${u30:-0}"
|
|
109
|
+
dp="${file/#$HOME/~}"
|
|
110
|
+
|
|
111
|
+
jq -n \
|
|
112
|
+
--arg path "$dp" \
|
|
113
|
+
--arg name "$name" \
|
|
114
|
+
--arg description "$desc" \
|
|
115
|
+
--arg mtime "$mtime" \
|
|
116
|
+
--argjson use_7d "$u7" \
|
|
117
|
+
--argjson use_30d "$u30" \
|
|
118
|
+
'{path:$path,name:$name,description:$description,use_7d:$use_7d,use_30d:$use_30d,mtime:$mtime}' \
|
|
119
|
+
> "$tmpdir/$i.json"
|
|
120
|
+
i=$((i+1))
|
|
121
|
+
done < <(find "$dir" -name "*.md" -type f 2>/dev/null | sort)
|
|
122
|
+
|
|
123
|
+
if [[ $i -eq 0 ]]; then
|
|
124
|
+
echo "[]"
|
|
125
|
+
else
|
|
126
|
+
jq -s '.' "$tmpdir"/*.json
|
|
127
|
+
fi
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
# --- Main ---
|
|
131
|
+
|
|
132
|
+
global_found="false"
|
|
133
|
+
global_count=0
|
|
134
|
+
global_skills="[]"
|
|
135
|
+
|
|
136
|
+
if [[ -d "$GLOBAL_DIR" ]]; then
|
|
137
|
+
global_found="true"
|
|
138
|
+
global_skills=$(scan_dir_to_json "$GLOBAL_DIR")
|
|
139
|
+
global_count=$(echo "$global_skills" | jq 'length')
|
|
140
|
+
fi
|
|
141
|
+
|
|
142
|
+
project_found="false"
|
|
143
|
+
project_path=""
|
|
144
|
+
project_count=0
|
|
145
|
+
project_skills="[]"
|
|
146
|
+
|
|
147
|
+
if [[ -n "$CWD_SKILLS_DIR" && -d "$CWD_SKILLS_DIR" ]]; then
|
|
148
|
+
project_found="true"
|
|
149
|
+
project_path="$CWD_SKILLS_DIR"
|
|
150
|
+
project_skills=$(scan_dir_to_json "$CWD_SKILLS_DIR")
|
|
151
|
+
project_count=$(echo "$project_skills" | jq 'length')
|
|
152
|
+
fi
|
|
153
|
+
|
|
154
|
+
# Merge global + project skills into one array
|
|
155
|
+
all_skills=$(jq -s 'add' <(echo "$global_skills") <(echo "$project_skills"))
|
|
156
|
+
|
|
157
|
+
jq -n \
|
|
158
|
+
--arg global_found "$global_found" \
|
|
159
|
+
--argjson global_count "$global_count" \
|
|
160
|
+
--arg project_found "$project_found" \
|
|
161
|
+
--arg project_path "$project_path" \
|
|
162
|
+
--argjson project_count "$project_count" \
|
|
163
|
+
--argjson skills "$all_skills" \
|
|
164
|
+
'{
|
|
165
|
+
scan_summary: {
|
|
166
|
+
global: { found: ($global_found == "true"), count: $global_count },
|
|
167
|
+
project: { found: ($project_found == "true"), path: $project_path, count: $project_count }
|
|
168
|
+
},
|
|
169
|
+
skills: $skills
|
|
170
|
+
}'
|