thanh-kit 2.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +252 -0
- package/bin/ak.js +2 -0
- package/dist/index.js +3829 -0
- package/dist/index.js.map +1 -0
- package/package.json +75 -0
- package/templates/AGENTS.md +104 -0
- package/templates/README.md +241 -0
- package/templates/agents/README.md +172 -0
- package/templates/agents/brainstormer.md +108 -0
- package/templates/agents/code-reviewer.md +172 -0
- package/templates/agents/code-simplifier.md +104 -0
- package/templates/agents/copywriter.md +113 -0
- package/templates/agents/database-admin.md +97 -0
- package/templates/agents/debugger.md +142 -0
- package/templates/agents/docs-manager.md +158 -0
- package/templates/agents/fullstack-developer.md +95 -0
- package/templates/agents/git-manager.md +394 -0
- package/templates/agents/journal-writer.md +119 -0
- package/templates/agents/mcp-manager.md +93 -0
- package/templates/agents/planner.md +113 -0
- package/templates/agents/project-manager.md +129 -0
- package/templates/agents/researcher.md +43 -0
- package/templates/agents/scout-external.md +146 -0
- package/templates/agents/scout.md +260 -0
- package/templates/agents/tester.md +110 -0
- package/templates/agents/ui-ux-designer.md +238 -0
- package/templates/commands/README.md +251 -0
- package/templates/commands/ask.md +56 -0
- package/templates/commands/bootstrap/auto/fast.md +111 -0
- package/templates/commands/bootstrap/auto/parallel.md +66 -0
- package/templates/commands/bootstrap/auto.md +115 -0
- package/templates/commands/bootstrap.md +137 -0
- package/templates/commands/brainstorm.md +74 -0
- package/templates/commands/build.md +39 -0
- package/templates/commands/checkpoint.md +156 -0
- package/templates/commands/ck-help.md +113 -0
- package/templates/commands/code/auto.md +170 -0
- package/templates/commands/code/no-test.md +158 -0
- package/templates/commands/code/parallel.md +55 -0
- package/templates/commands/code-simplifier.md +71 -0
- package/templates/commands/code.md +176 -0
- package/templates/commands/coding-level.md +48 -0
- package/templates/commands/compact.md +57 -0
- package/templates/commands/content/cro.md +43 -0
- package/templates/commands/content/enhance.md +14 -0
- package/templates/commands/content/fast.md +13 -0
- package/templates/commands/content/good.md +16 -0
- package/templates/commands/context.md +48 -0
- package/templates/commands/cook/auto/fast.md +26 -0
- package/templates/commands/cook/auto/parallel.md +49 -0
- package/templates/commands/cook/auto.md +15 -0
- package/templates/commands/cook/fast.md +47 -0
- package/templates/commands/cook/hard.md +80 -0
- package/templates/commands/cook/parallel.md +90 -0
- package/templates/commands/cook.md +105 -0
- package/templates/commands/create-feature.md +48 -0
- package/templates/commands/db-migrate.md +52 -0
- package/templates/commands/debug.md +13 -0
- package/templates/commands/design/3d.md +83 -0
- package/templates/commands/design/describe.md +23 -0
- package/templates/commands/design/fast.md +31 -0
- package/templates/commands/design/good.md +35 -0
- package/templates/commands/design/screenshot.md +34 -0
- package/templates/commands/design/video.md +34 -0
- package/templates/commands/docs/init.md +39 -0
- package/templates/commands/docs/summarize.md +31 -0
- package/templates/commands/docs/update.md +57 -0
- package/templates/commands/feature.md +62 -0
- package/templates/commands/fix/ci.md +17 -0
- package/templates/commands/fix/fast.md +19 -0
- package/templates/commands/fix/hard.md +39 -0
- package/templates/commands/fix/logs.md +26 -0
- package/templates/commands/fix/parallel.md +54 -0
- package/templates/commands/fix/test.md +20 -0
- package/templates/commands/fix/types.md +9 -0
- package/templates/commands/fix/ui.md +48 -0
- package/templates/commands/fix-issue.md +177 -0
- package/templates/commands/fix.md +43 -0
- package/templates/commands/generate-dto.md +67 -0
- package/templates/commands/git/cm.md +5 -0
- package/templates/commands/git/cp.md +4 -0
- package/templates/commands/git/merge.md +40 -0
- package/templates/commands/git/pr.md +48 -0
- package/templates/commands/integrate/polar.md +28 -0
- package/templates/commands/integrate/sepay.md +28 -0
- package/templates/commands/investigate.md +324 -0
- package/templates/commands/journal.md +7 -0
- package/templates/commands/kanban.md +101 -0
- package/templates/commands/lint.md +47 -0
- package/templates/commands/migration.md +111 -0
- package/templates/commands/performance.md +110 -0
- package/templates/commands/plan/archive.md +57 -0
- package/templates/commands/plan/ci.md +33 -0
- package/templates/commands/plan/cro.md +69 -0
- package/templates/commands/plan/fast.md +86 -0
- package/templates/commands/plan/hard.md +103 -0
- package/templates/commands/plan/parallel.md +152 -0
- package/templates/commands/plan/preview.md +40 -0
- package/templates/commands/plan/two.md +52 -0
- package/templates/commands/plan/validate.md +132 -0
- package/templates/commands/plan.md +36 -0
- package/templates/commands/pr.md +49 -0
- package/templates/commands/preview.md +87 -0
- package/templates/commands/release-notes.md +144 -0
- package/templates/commands/review/codebase.md +49 -0
- package/templates/commands/review/post-task.md +157 -0
- package/templates/commands/review-changes.md +46 -0
- package/templates/commands/review.md +56 -0
- package/templates/commands/scout/ext.md +35 -0
- package/templates/commands/scout.md +283 -0
- package/templates/commands/security.md +119 -0
- package/templates/commands/skill/add.md +36 -0
- package/templates/commands/skill/create.md +29 -0
- package/templates/commands/skill/fix-logs.md +22 -0
- package/templates/commands/skill/optimize/auto.md +25 -0
- package/templates/commands/skill/optimize.md +34 -0
- package/templates/commands/skill/plan.md +45 -0
- package/templates/commands/test/ui.md +92 -0
- package/templates/commands/test.md +8 -0
- package/templates/commands/use-mcp.md +34 -0
- package/templates/commands/watzup.md +8 -0
- package/templates/commands/worktree.md +126 -0
- package/templates/discord/README.md +274 -0
- package/templates/discord/config.json5 +87 -0
- package/templates/discord/skills/auto-intent-router/SKILL.md +195 -0
- package/templates/discord/skills/train-prompt/SKILL.md +306 -0
- package/templates/discord/start-bot.sh +47 -0
- package/templates/gemini/settings.json +12 -0
- package/templates/hooks/.python-cache.json +1 -0
- package/templates/hooks/README.md +246 -0
- package/templates/hooks/backend-csharp-context.cjs +223 -0
- package/templates/hooks/design-system-context.cjs +185 -0
- package/templates/hooks/dev-rules-reminder.cjs +249 -0
- package/templates/hooks/docs/README.md +179 -0
- package/templates/hooks/frontend-typescript-context.cjs +233 -0
- package/templates/hooks/lib/__tests__/ck-config-utils.test.cjs +169 -0
- package/templates/hooks/lib/ck-config-utils.cjs +706 -0
- package/templates/hooks/lib/ck-paths.cjs +110 -0
- package/templates/hooks/lib/context-tracker.cjs +335 -0
- package/templates/hooks/notifications/.env.example +21 -0
- package/templates/hooks/notifications/discord_notify.sh +221 -0
- package/templates/hooks/notifications/docs/discord-hook-setup.md +445 -0
- package/templates/hooks/notifications/docs/slack-hook-setup.md +118 -0
- package/templates/hooks/notifications/docs/telegram-hook-setup.md +795 -0
- package/templates/hooks/notifications/lib/env-loader.cjs +105 -0
- package/templates/hooks/notifications/lib/sender.cjs +128 -0
- package/templates/hooks/notifications/notify.cjs +156 -0
- package/templates/hooks/notifications/providers/discord.cjs +197 -0
- package/templates/hooks/notifications/providers/slack.cjs +111 -0
- package/templates/hooks/notifications/providers/telegram.cjs +109 -0
- package/templates/hooks/notifications/send-discord.sh +75 -0
- package/templates/hooks/notifications/telegram_notify.sh +124 -0
- package/templates/hooks/notify-waiting.js +117 -0
- package/templates/hooks/post-edit-prettier.cjs +189 -0
- package/templates/hooks/post-task-review.cjs +142 -0
- package/templates/hooks/privacy-block.cjs +257 -0
- package/templates/hooks/scout-block/broad-pattern-detector.cjs +266 -0
- package/templates/hooks/scout-block/error-formatter.cjs +156 -0
- package/templates/hooks/scout-block/path-extractor.cjs +238 -0
- package/templates/hooks/scout-block/pattern-matcher.cjs +184 -0
- package/templates/hooks/scout-block/tests/test-broad-pattern-detector.js +225 -0
- package/templates/hooks/scout-block/tests/test-build-command-allowlist.js +137 -0
- package/templates/hooks/scout-block/tests/test-error-formatter.js +109 -0
- package/templates/hooks/scout-block/tests/test-full-flow-edge-cases.js +75 -0
- package/templates/hooks/scout-block/tests/test-monorepo-scenarios.js +225 -0
- package/templates/hooks/scout-block/tests/test-path-extractor.js +138 -0
- package/templates/hooks/scout-block/tests/test-pattern-matcher.js +64 -0
- package/templates/hooks/scout-block/vendor/ignore.js +627 -0
- package/templates/hooks/scout-block.cjs +134 -0
- package/templates/hooks/scss-styling-context.cjs +213 -0
- package/templates/hooks/session-end.cjs +35 -0
- package/templates/hooks/session-init.cjs +493 -0
- package/templates/hooks/subagent-init.cjs +150 -0
- package/templates/hooks/tests/test-ckignore.js +194 -0
- package/templates/hooks/tests/test-context-tracker.cjs +454 -0
- package/templates/hooks/tests/test-modularization-hook.js +126 -0
- package/templates/hooks/tests/test-privacy-block.js +298 -0
- package/templates/hooks/tests/test-scout-block.js +163 -0
- package/templates/hooks/workflow-router.cjs +326 -0
- package/templates/hooks/write-compact-marker.cjs +159 -0
- package/templates/memory/session-log.md +186 -0
- package/templates/output-styles/coding-level-0-eli5.md +103 -0
- package/templates/output-styles/coding-level-1-junior.md +124 -0
- package/templates/output-styles/coding-level-2-mid.md +146 -0
- package/templates/output-styles/coding-level-3-senior.md +148 -0
- package/templates/output-styles/coding-level-4-lead.md +159 -0
- package/templates/output-styles/coding-level-5-god.md +91 -0
- package/templates/router/README.md +294 -0
- package/templates/router/agents-guide.md +38 -0
- package/templates/router/commands-guide.md +122 -0
- package/templates/router/decision-flow.md +92 -0
- package/templates/router/skills-guide.md +127 -0
- package/templates/router/workflows-guide.md +68 -0
- package/templates/scripts/README.md +254 -0
- package/templates/scripts/__pycache__/win_compat.cpython-312.pyc +0 -0
- package/templates/scripts/ck-help.py +869 -0
- package/templates/scripts/commands_data.yaml +621 -0
- package/templates/scripts/generate_catalogs.py +168 -0
- package/templates/scripts/plan-preview.cjs +921 -0
- package/templates/scripts/requirements.txt +1 -0
- package/templates/scripts/resolve_env.py +329 -0
- package/templates/scripts/scan_commands.py +107 -0
- package/templates/scripts/scan_skills.py +197 -0
- package/templates/scripts/set-active-plan.cjs +45 -0
- package/templates/scripts/skills_data.yaml +596 -0
- package/templates/scripts/win_compat.py +57 -0
- package/templates/scripts/worktree.cjs +657 -0
- package/templates/scripts/worktree.test.cjs +334 -0
- package/templates/settings.json +242 -0
- package/templates/skills/.env.example +100 -0
- package/templates/skills/INSTALLATION.md +360 -0
- package/templates/skills/README.md +309 -0
- package/templates/skills/agent_skills_spec.md +55 -0
- package/templates/skills/ai-artist/SKILL.md +75 -0
- package/templates/skills/ai-artist/references/advanced-techniques.md +184 -0
- package/templates/skills/ai-artist/references/domain-code.md +66 -0
- package/templates/skills/ai-artist/references/domain-data.md +72 -0
- package/templates/skills/ai-artist/references/domain-marketing.md +66 -0
- package/templates/skills/ai-artist/references/domain-patterns.md +33 -0
- package/templates/skills/ai-artist/references/domain-writing.md +68 -0
- package/templates/skills/ai-artist/references/image-prompting.md +141 -0
- package/templates/skills/ai-artist/references/llm-prompting.md +165 -0
- package/templates/skills/ai-artist/references/nano-banana.md +59 -0
- package/templates/skills/ai-artist/references/reasoning-techniques.md +201 -0
- package/templates/skills/ai-multimodal/.env.example +204 -0
- package/templates/skills/ai-multimodal/SKILL.md +109 -0
- package/templates/skills/ai-multimodal/references/audio-processing.md +387 -0
- package/templates/skills/ai-multimodal/references/image-generation.md +939 -0
- package/templates/skills/ai-multimodal/references/music-generation.md +311 -0
- package/templates/skills/ai-multimodal/references/video-analysis.md +515 -0
- package/templates/skills/ai-multimodal/references/video-generation.md +457 -0
- package/templates/skills/ai-multimodal/references/vision-understanding.md +492 -0
- package/templates/skills/ai-multimodal/scripts/.coverage +0 -0
- package/templates/skills/ai-multimodal/scripts/check_setup.py +305 -0
- package/templates/skills/ai-multimodal/scripts/document_converter.py +395 -0
- package/templates/skills/ai-multimodal/scripts/gemini_batch_process.py +1184 -0
- package/templates/skills/ai-multimodal/scripts/media_optimizer.py +506 -0
- package/templates/skills/ai-multimodal/scripts/requirements.txt +26 -0
- package/templates/skills/ai-multimodal/scripts/tests/.coverage +0 -0
- package/templates/skills/ai-multimodal/scripts/tests/requirements.txt +20 -0
- package/templates/skills/ai-multimodal/scripts/tests/test_document_converter.py +74 -0
- package/templates/skills/ai-multimodal/scripts/tests/test_gemini_batch_process.py +362 -0
- package/templates/skills/ai-multimodal/scripts/tests/test_media_optimizer.py +373 -0
- package/templates/skills/arch-cross-service-integration/SKILL.md +48 -0
- package/templates/skills/arch-performance-optimization/SKILL.md +306 -0
- package/templates/skills/arch-security-review/SKILL.md +344 -0
- package/templates/skills/backend-development/SKILL.md +95 -0
- package/templates/skills/backend-development/references/backend-api-design.md +495 -0
- package/templates/skills/backend-development/references/backend-architecture.md +454 -0
- package/templates/skills/backend-development/references/backend-authentication.md +338 -0
- package/templates/skills/backend-development/references/backend-code-quality.md +659 -0
- package/templates/skills/backend-development/references/backend-debugging.md +904 -0
- package/templates/skills/backend-development/references/backend-devops.md +494 -0
- package/templates/skills/backend-development/references/backend-mindset.md +387 -0
- package/templates/skills/backend-development/references/backend-performance.md +397 -0
- package/templates/skills/backend-development/references/backend-security.md +290 -0
- package/templates/skills/backend-development/references/backend-technologies.md +256 -0
- package/templates/skills/backend-development/references/backend-testing.md +429 -0
- package/templates/skills/better-auth/SKILL.md +204 -0
- package/templates/skills/better-auth/references/advanced-features.md +553 -0
- package/templates/skills/better-auth/references/database-integration.md +577 -0
- package/templates/skills/better-auth/references/email-password-auth.md +416 -0
- package/templates/skills/better-auth/references/oauth-providers.md +430 -0
- package/templates/skills/better-auth/scripts/.coverage +0 -0
- package/templates/skills/better-auth/scripts/better_auth_init.py +521 -0
- package/templates/skills/better-auth/scripts/requirements.txt +15 -0
- package/templates/skills/better-auth/scripts/tests/.coverage +0 -0
- package/templates/skills/better-auth/scripts/tests/test_better_auth_init.py +421 -0
- package/templates/skills/branch-comparison/SKILL.md +150 -0
- package/templates/skills/bug-diagnosis/SKILL.md +309 -0
- package/templates/skills/chrome-devtools/SKILL.md +472 -0
- package/templates/skills/chrome-devtools/references/cdp-domains.md +694 -0
- package/templates/skills/chrome-devtools/references/performance-guide.md +940 -0
- package/templates/skills/chrome-devtools/references/puppeteer-reference.md +953 -0
- package/templates/skills/chrome-devtools/scripts/README.md +272 -0
- package/templates/skills/chrome-devtools/scripts/__tests__/selector.test.js +210 -0
- package/templates/skills/chrome-devtools/scripts/aria-snapshot.js +362 -0
- package/templates/skills/chrome-devtools/scripts/click.js +83 -0
- package/templates/skills/chrome-devtools/scripts/console.js +79 -0
- package/templates/skills/chrome-devtools/scripts/evaluate.js +53 -0
- package/templates/skills/chrome-devtools/scripts/fill.js +76 -0
- package/templates/skills/chrome-devtools/scripts/inject-auth.js +229 -0
- package/templates/skills/chrome-devtools/scripts/install-deps.sh +181 -0
- package/templates/skills/chrome-devtools/scripts/install.sh +83 -0
- package/templates/skills/chrome-devtools/scripts/lib/browser.js +318 -0
- package/templates/skills/chrome-devtools/scripts/lib/selector.js +178 -0
- package/templates/skills/chrome-devtools/scripts/navigate.js +54 -0
- package/templates/skills/chrome-devtools/scripts/network.js +106 -0
- package/templates/skills/chrome-devtools/scripts/package.json +16 -0
- package/templates/skills/chrome-devtools/scripts/performance.js +149 -0
- package/templates/skills/chrome-devtools/scripts/screenshot.js +198 -0
- package/templates/skills/chrome-devtools/scripts/select-ref.js +131 -0
- package/templates/skills/chrome-devtools/scripts/snapshot.js +135 -0
- package/templates/skills/claude-code/references/advanced-features.md +399 -0
- package/templates/skills/claude-code/references/agent-skills.md +399 -0
- package/templates/skills/claude-code/references/api-reference.md +498 -0
- package/templates/skills/claude-code/references/best-practices.md +447 -0
- package/templates/skills/claude-code/references/cicd-integration.md +428 -0
- package/templates/skills/claude-code/references/common-workflows.md +119 -0
- package/templates/skills/claude-code/references/configuration.md +480 -0
- package/templates/skills/claude-code/references/enterprise-features.md +472 -0
- package/templates/skills/claude-code/references/getting-started.md +252 -0
- package/templates/skills/claude-code/references/hooks-and-plugins.md +444 -0
- package/templates/skills/claude-code/references/hooks-comprehensive.md +622 -0
- package/templates/skills/claude-code/references/ide-integration.md +316 -0
- package/templates/skills/claude-code/references/mcp-integration.md +386 -0
- package/templates/skills/claude-code/references/slash-commands.md +489 -0
- package/templates/skills/claude-code/references/troubleshooting.md +456 -0
- package/templates/skills/claude-code/skill.md +60 -0
- package/templates/skills/code-review/SKILL.md +143 -0
- package/templates/skills/code-review/references/code-review-reception.md +209 -0
- package/templates/skills/code-review/references/requesting-code-review.md +105 -0
- package/templates/skills/code-review/references/verification-before-completion.md +139 -0
- package/templates/skills/databases/SKILL.md +232 -0
- package/templates/skills/databases/references/mongodb-aggregation.md +447 -0
- package/templates/skills/databases/references/mongodb-atlas.md +465 -0
- package/templates/skills/databases/references/mongodb-crud.md +408 -0
- package/templates/skills/databases/references/mongodb-indexing.md +442 -0
- package/templates/skills/databases/references/postgresql-administration.md +594 -0
- package/templates/skills/databases/references/postgresql-performance.md +527 -0
- package/templates/skills/databases/references/postgresql-psql-cli.md +467 -0
- package/templates/skills/databases/references/postgresql-queries.md +475 -0
- package/templates/skills/databases/scripts/.coverage +0 -0
- package/templates/skills/databases/scripts/db_backup.py +502 -0
- package/templates/skills/databases/scripts/db_migrate.py +425 -0
- package/templates/skills/databases/scripts/db_performance_check.py +456 -0
- package/templates/skills/databases/scripts/requirements.txt +20 -0
- package/templates/skills/databases/scripts/tests/coverage-db.json +1 -0
- package/templates/skills/databases/scripts/tests/requirements.txt +4 -0
- package/templates/skills/databases/scripts/tests/test_db_backup.py +340 -0
- package/templates/skills/databases/scripts/tests/test_db_migrate.py +277 -0
- package/templates/skills/databases/scripts/tests/test_db_performance_check.py +370 -0
- package/templates/skills/debugging/SKILL.md +84 -0
- package/templates/skills/debugging/references/defense-in-depth.md +124 -0
- package/templates/skills/debugging/references/root-cause-tracing.md +122 -0
- package/templates/skills/debugging/references/systematic-debugging.md +102 -0
- package/templates/skills/debugging/references/verification.md +123 -0
- package/templates/skills/debugging/scripts/find-polluter.sh +63 -0
- package/templates/skills/debugging/scripts/find-polluter.test.md +102 -0
- package/templates/skills/developer-growth-analysis/SKILL.md +322 -0
- package/templates/skills/devops/.env.example +76 -0
- package/templates/skills/devops/SKILL.md +285 -0
- package/templates/skills/devops/references/browser-rendering.md +305 -0
- package/templates/skills/devops/references/cloudflare-d1-kv.md +123 -0
- package/templates/skills/devops/references/cloudflare-platform.md +271 -0
- package/templates/skills/devops/references/cloudflare-r2-storage.md +280 -0
- package/templates/skills/devops/references/cloudflare-workers-advanced.md +312 -0
- package/templates/skills/devops/references/cloudflare-workers-apis.md +309 -0
- package/templates/skills/devops/references/cloudflare-workers-basics.md +418 -0
- package/templates/skills/devops/references/docker-basics.md +297 -0
- package/templates/skills/devops/references/docker-compose.md +292 -0
- package/templates/skills/devops/references/gcloud-platform.md +297 -0
- package/templates/skills/devops/references/gcloud-services.md +304 -0
- package/templates/skills/devops/scripts/cloudflare_deploy.py +269 -0
- package/templates/skills/devops/scripts/docker_optimize.py +331 -0
- package/templates/skills/devops/scripts/requirements.txt +20 -0
- package/templates/skills/devops/scripts/tests/requirements.txt +3 -0
- package/templates/skills/devops/scripts/tests/test_cloudflare_deploy.py +285 -0
- package/templates/skills/devops/scripts/tests/test_docker_optimize.py +436 -0
- package/templates/skills/docs-seeker/.env.example +15 -0
- package/templates/skills/docs-seeker/SKILL.md +97 -0
- package/templates/skills/docs-seeker/package.json +25 -0
- package/templates/skills/docs-seeker/references/advanced.md +79 -0
- package/templates/skills/docs-seeker/references/context7-patterns.md +68 -0
- package/templates/skills/docs-seeker/references/errors.md +68 -0
- package/templates/skills/docs-seeker/scripts/analyze-llms-txt.js +211 -0
- package/templates/skills/docs-seeker/scripts/detect-topic.js +172 -0
- package/templates/skills/docs-seeker/scripts/fetch-docs.js +213 -0
- package/templates/skills/docs-seeker/scripts/tests/run-tests.js +72 -0
- package/templates/skills/docs-seeker/scripts/tests/test-analyze-llms.js +119 -0
- package/templates/skills/docs-seeker/scripts/tests/test-detect-topic.js +112 -0
- package/templates/skills/docs-seeker/scripts/tests/test-fetch-docs.js +84 -0
- package/templates/skills/docs-seeker/scripts/utils/env-loader.js +94 -0
- package/templates/skills/docs-seeker/workflows/library-search.md +87 -0
- package/templates/skills/docs-seeker/workflows/repo-analysis.md +91 -0
- package/templates/skills/docs-seeker/workflows/topic-search.md +77 -0
- package/templates/skills/document-skills/docx/LICENSE.txt +30 -0
- package/templates/skills/document-skills/docx/SKILL.md +197 -0
- package/templates/skills/document-skills/docx/docx-js.md +350 -0
- package/templates/skills/document-skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/dml-chart.xsd +1499 -0
- package/templates/skills/document-skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/dml-chartDrawing.xsd +146 -0
- package/templates/skills/document-skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/dml-diagram.xsd +1085 -0
- package/templates/skills/document-skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/dml-lockedCanvas.xsd +11 -0
- package/templates/skills/document-skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/dml-main.xsd +3081 -0
- package/templates/skills/document-skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/dml-picture.xsd +23 -0
- package/templates/skills/document-skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/dml-spreadsheetDrawing.xsd +185 -0
- package/templates/skills/document-skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/dml-wordprocessingDrawing.xsd +287 -0
- package/templates/skills/document-skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/pml.xsd +1676 -0
- package/templates/skills/document-skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/shared-additionalCharacteristics.xsd +28 -0
- package/templates/skills/document-skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/shared-bibliography.xsd +144 -0
- package/templates/skills/document-skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/shared-commonSimpleTypes.xsd +174 -0
- package/templates/skills/document-skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/shared-customXmlDataProperties.xsd +25 -0
- package/templates/skills/document-skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/shared-customXmlSchemaProperties.xsd +18 -0
- package/templates/skills/document-skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesCustom.xsd +59 -0
- package/templates/skills/document-skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesExtended.xsd +56 -0
- package/templates/skills/document-skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesVariantTypes.xsd +195 -0
- package/templates/skills/document-skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/shared-math.xsd +582 -0
- package/templates/skills/document-skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/shared-relationshipReference.xsd +25 -0
- package/templates/skills/document-skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/sml.xsd +4439 -0
- package/templates/skills/document-skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/vml-main.xsd +570 -0
- package/templates/skills/document-skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/vml-officeDrawing.xsd +509 -0
- package/templates/skills/document-skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/vml-presentationDrawing.xsd +12 -0
- package/templates/skills/document-skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/vml-spreadsheetDrawing.xsd +108 -0
- package/templates/skills/document-skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/vml-wordprocessingDrawing.xsd +96 -0
- package/templates/skills/document-skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/wml.xsd +3646 -0
- package/templates/skills/document-skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/xml.xsd +116 -0
- package/templates/skills/document-skills/docx/ooxml/schemas/ecma/fouth-edition/opc-contentTypes.xsd +42 -0
- package/templates/skills/document-skills/docx/ooxml/schemas/ecma/fouth-edition/opc-coreProperties.xsd +50 -0
- package/templates/skills/document-skills/docx/ooxml/schemas/ecma/fouth-edition/opc-digSig.xsd +49 -0
- package/templates/skills/document-skills/docx/ooxml/schemas/ecma/fouth-edition/opc-relationships.xsd +33 -0
- package/templates/skills/document-skills/docx/ooxml/schemas/mce/mc.xsd +75 -0
- package/templates/skills/document-skills/docx/ooxml/schemas/microsoft/wml-2010.xsd +560 -0
- package/templates/skills/document-skills/docx/ooxml/schemas/microsoft/wml-2012.xsd +67 -0
- package/templates/skills/document-skills/docx/ooxml/schemas/microsoft/wml-2018.xsd +14 -0
- package/templates/skills/document-skills/docx/ooxml/schemas/microsoft/wml-cex-2018.xsd +20 -0
- package/templates/skills/document-skills/docx/ooxml/schemas/microsoft/wml-cid-2016.xsd +13 -0
- package/templates/skills/document-skills/docx/ooxml/schemas/microsoft/wml-sdtdatahash-2020.xsd +4 -0
- package/templates/skills/document-skills/docx/ooxml/schemas/microsoft/wml-symex-2015.xsd +8 -0
- package/templates/skills/document-skills/docx/ooxml/scripts/pack.py +159 -0
- package/templates/skills/document-skills/docx/ooxml/scripts/unpack.py +29 -0
- package/templates/skills/document-skills/docx/ooxml/scripts/validate.py +69 -0
- package/templates/skills/document-skills/docx/ooxml/scripts/validation/__init__.py +15 -0
- package/templates/skills/document-skills/docx/ooxml/scripts/validation/base.py +951 -0
- package/templates/skills/document-skills/docx/ooxml/scripts/validation/docx.py +274 -0
- package/templates/skills/document-skills/docx/ooxml/scripts/validation/pptx.py +315 -0
- package/templates/skills/document-skills/docx/ooxml/scripts/validation/redlining.py +279 -0
- package/templates/skills/document-skills/docx/ooxml.md +610 -0
- package/templates/skills/document-skills/docx/scripts/__init__.py +1 -0
- package/templates/skills/document-skills/docx/scripts/document.py +1276 -0
- package/templates/skills/document-skills/docx/scripts/templates/comments.xml +3 -0
- package/templates/skills/document-skills/docx/scripts/templates/commentsExtended.xml +3 -0
- package/templates/skills/document-skills/docx/scripts/templates/commentsExtensible.xml +3 -0
- package/templates/skills/document-skills/docx/scripts/templates/commentsIds.xml +3 -0
- package/templates/skills/document-skills/docx/scripts/templates/people.xml +3 -0
- package/templates/skills/document-skills/docx/scripts/utilities.py +374 -0
- package/templates/skills/document-skills/pdf/LICENSE.txt +30 -0
- package/templates/skills/document-skills/pdf/SKILL.md +294 -0
- package/templates/skills/document-skills/pdf/forms.md +205 -0
- package/templates/skills/document-skills/pdf/reference.md +612 -0
- package/templates/skills/document-skills/pdf/scripts/check_bounding_boxes.py +70 -0
- package/templates/skills/document-skills/pdf/scripts/check_bounding_boxes_test.py +226 -0
- package/templates/skills/document-skills/pdf/scripts/check_fillable_fields.py +12 -0
- package/templates/skills/document-skills/pdf/scripts/convert_pdf_to_images.py +35 -0
- package/templates/skills/document-skills/pdf/scripts/create_validation_image.py +41 -0
- package/templates/skills/document-skills/pdf/scripts/extract_form_field_info.py +152 -0
- package/templates/skills/document-skills/pdf/scripts/fill_fillable_fields.py +114 -0
- package/templates/skills/document-skills/pdf/scripts/fill_pdf_form_with_annotations.py +108 -0
- package/templates/skills/document-skills/pptx/LICENSE.txt +30 -0
- package/templates/skills/document-skills/pptx/SKILL.md +484 -0
- package/templates/skills/document-skills/pptx/html2pptx.md +625 -0
- package/templates/skills/document-skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/dml-chart.xsd +1499 -0
- package/templates/skills/document-skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/dml-chartDrawing.xsd +146 -0
- package/templates/skills/document-skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/dml-diagram.xsd +1085 -0
- package/templates/skills/document-skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/dml-lockedCanvas.xsd +11 -0
- package/templates/skills/document-skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/dml-main.xsd +3081 -0
- package/templates/skills/document-skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/dml-picture.xsd +23 -0
- package/templates/skills/document-skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/dml-spreadsheetDrawing.xsd +185 -0
- package/templates/skills/document-skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/dml-wordprocessingDrawing.xsd +287 -0
- package/templates/skills/document-skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/pml.xsd +1676 -0
- package/templates/skills/document-skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/shared-additionalCharacteristics.xsd +28 -0
- package/templates/skills/document-skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/shared-bibliography.xsd +144 -0
- package/templates/skills/document-skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/shared-commonSimpleTypes.xsd +174 -0
- package/templates/skills/document-skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/shared-customXmlDataProperties.xsd +25 -0
- package/templates/skills/document-skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/shared-customXmlSchemaProperties.xsd +18 -0
- package/templates/skills/document-skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesCustom.xsd +59 -0
- package/templates/skills/document-skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesExtended.xsd +56 -0
- package/templates/skills/document-skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesVariantTypes.xsd +195 -0
- package/templates/skills/document-skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/shared-math.xsd +582 -0
- package/templates/skills/document-skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/shared-relationshipReference.xsd +25 -0
- package/templates/skills/document-skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/sml.xsd +4439 -0
- package/templates/skills/document-skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/vml-main.xsd +570 -0
- package/templates/skills/document-skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/vml-officeDrawing.xsd +509 -0
- package/templates/skills/document-skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/vml-presentationDrawing.xsd +12 -0
- package/templates/skills/document-skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/vml-spreadsheetDrawing.xsd +108 -0
- package/templates/skills/document-skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/vml-wordprocessingDrawing.xsd +96 -0
- package/templates/skills/document-skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/wml.xsd +3646 -0
- package/templates/skills/document-skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/xml.xsd +116 -0
- package/templates/skills/document-skills/pptx/ooxml/schemas/ecma/fouth-edition/opc-contentTypes.xsd +42 -0
- package/templates/skills/document-skills/pptx/ooxml/schemas/ecma/fouth-edition/opc-coreProperties.xsd +50 -0
- package/templates/skills/document-skills/pptx/ooxml/schemas/ecma/fouth-edition/opc-digSig.xsd +49 -0
- package/templates/skills/document-skills/pptx/ooxml/schemas/ecma/fouth-edition/opc-relationships.xsd +33 -0
- package/templates/skills/document-skills/pptx/ooxml/schemas/mce/mc.xsd +75 -0
- package/templates/skills/document-skills/pptx/ooxml/schemas/microsoft/wml-2010.xsd +560 -0
- package/templates/skills/document-skills/pptx/ooxml/schemas/microsoft/wml-2012.xsd +67 -0
- package/templates/skills/document-skills/pptx/ooxml/schemas/microsoft/wml-2018.xsd +14 -0
- package/templates/skills/document-skills/pptx/ooxml/schemas/microsoft/wml-cex-2018.xsd +20 -0
- package/templates/skills/document-skills/pptx/ooxml/schemas/microsoft/wml-cid-2016.xsd +13 -0
- package/templates/skills/document-skills/pptx/ooxml/schemas/microsoft/wml-sdtdatahash-2020.xsd +4 -0
- package/templates/skills/document-skills/pptx/ooxml/schemas/microsoft/wml-symex-2015.xsd +8 -0
- package/templates/skills/document-skills/pptx/ooxml/scripts/pack.py +159 -0
- package/templates/skills/document-skills/pptx/ooxml/scripts/unpack.py +29 -0
- package/templates/skills/document-skills/pptx/ooxml/scripts/validate.py +69 -0
- package/templates/skills/document-skills/pptx/ooxml/scripts/validation/__init__.py +15 -0
- package/templates/skills/document-skills/pptx/ooxml/scripts/validation/base.py +951 -0
- package/templates/skills/document-skills/pptx/ooxml/scripts/validation/docx.py +274 -0
- package/templates/skills/document-skills/pptx/ooxml/scripts/validation/pptx.py +315 -0
- package/templates/skills/document-skills/pptx/ooxml/scripts/validation/redlining.py +279 -0
- package/templates/skills/document-skills/pptx/ooxml.md +427 -0
- package/templates/skills/document-skills/pptx/scripts/html2pptx.js +979 -0
- package/templates/skills/document-skills/pptx/scripts/inventory.py +1020 -0
- package/templates/skills/document-skills/pptx/scripts/rearrange.py +231 -0
- package/templates/skills/document-skills/pptx/scripts/replace.py +385 -0
- package/templates/skills/document-skills/pptx/scripts/thumbnail.py +450 -0
- package/templates/skills/document-skills/xlsx/LICENSE.txt +30 -0
- package/templates/skills/document-skills/xlsx/SKILL.md +289 -0
- package/templates/skills/document-skills/xlsx/recalc.py +190 -0
- package/templates/skills/documentation/SKILL.md +134 -0
- package/templates/skills/domain-name-brainstormer/SKILL.md +212 -0
- package/templates/skills/dual-pass-review/SKILL.md +249 -0
- package/templates/skills/feature-docs/SKILL.md +294 -0
- package/templates/skills/feature-implementation/SKILL.md +262 -0
- package/templates/skills/feature-investigation/SKILL.md +346 -0
- package/templates/skills/frontend-design/SKILL.md +91 -0
- package/templates/skills/frontend-design/references/ai-multimodal-overview.md +165 -0
- package/templates/skills/frontend-design/references/analysis-best-practices.md +80 -0
- package/templates/skills/frontend-design/references/analysis-prompts.md +141 -0
- package/templates/skills/frontend-design/references/analysis-techniques.md +118 -0
- package/templates/skills/frontend-design/references/animejs.md +396 -0
- package/templates/skills/frontend-design/references/asset-generation.md +337 -0
- package/templates/skills/frontend-design/references/design-extraction-overview.md +71 -0
- package/templates/skills/frontend-design/references/extraction-best-practices.md +141 -0
- package/templates/skills/frontend-design/references/extraction-output-templates.md +162 -0
- package/templates/skills/frontend-design/references/extraction-prompts.md +127 -0
- package/templates/skills/frontend-design/references/technical-accessibility.md +119 -0
- package/templates/skills/frontend-design/references/technical-best-practices.md +97 -0
- package/templates/skills/frontend-design/references/technical-optimization.md +44 -0
- package/templates/skills/frontend-design/references/technical-overview.md +90 -0
- package/templates/skills/frontend-design/references/technical-workflows.md +150 -0
- package/templates/skills/frontend-design/references/visual-analysis-overview.md +95 -0
- package/templates/skills/frontend-design-pro/SKILL.md +58 -0
- package/templates/skills/frontend-development/SKILL.md +399 -0
- package/templates/skills/frontend-development/resources/common-patterns.md +331 -0
- package/templates/skills/frontend-development/resources/complete-examples.md +872 -0
- package/templates/skills/frontend-development/resources/component-patterns.md +502 -0
- package/templates/skills/frontend-development/resources/data-fetching.md +767 -0
- package/templates/skills/frontend-development/resources/file-organization.md +502 -0
- package/templates/skills/frontend-development/resources/loading-and-error-states.md +501 -0
- package/templates/skills/frontend-development/resources/performance.md +406 -0
- package/templates/skills/frontend-development/resources/routing-guide.md +364 -0
- package/templates/skills/frontend-development/resources/styling-guide.md +428 -0
- package/templates/skills/frontend-development/resources/typescript-standards.md +418 -0
- package/templates/skills/google-adk-python/SKILL.md +237 -0
- package/templates/skills/install.ps1 +1220 -0
- package/templates/skills/install.sh +1032 -0
- package/templates/skills/mcp-builder/LICENSE.txt +202 -0
- package/templates/skills/mcp-builder/SKILL.md +328 -0
- package/templates/skills/mcp-builder/reference/evaluation.md +602 -0
- package/templates/skills/mcp-builder/reference/mcp_best_practices.md +915 -0
- package/templates/skills/mcp-builder/reference/node_mcp_server.md +916 -0
- package/templates/skills/mcp-builder/reference/python_mcp_server.md +752 -0
- package/templates/skills/mcp-builder/scripts/connections.py +151 -0
- package/templates/skills/mcp-builder/scripts/evaluation.py +373 -0
- package/templates/skills/mcp-builder/scripts/example_evaluation.xml +22 -0
- package/templates/skills/mcp-builder/scripts/requirements.txt +2 -0
- package/templates/skills/mcp-management/README.md +219 -0
- package/templates/skills/mcp-management/SKILL.md +209 -0
- package/templates/skills/mcp-management/assets/tools.json +3146 -0
- package/templates/skills/mcp-management/references/configuration.md +114 -0
- package/templates/skills/mcp-management/references/gemini-cli-integration.md +215 -0
- package/templates/skills/mcp-management/references/mcp-protocol.md +116 -0
- package/templates/skills/mcp-management/scripts/.env.example +10 -0
- package/templates/skills/mcp-management/scripts/cli.ts +195 -0
- package/templates/skills/mcp-management/scripts/dist/analyze-tools.js +70 -0
- package/templates/skills/mcp-management/scripts/dist/cli.js +160 -0
- package/templates/skills/mcp-management/scripts/dist/mcp-client.js +183 -0
- package/templates/skills/mcp-management/scripts/mcp-client.ts +230 -0
- package/templates/skills/mcp-management/scripts/package.json +20 -0
- package/templates/skills/mcp-management/scripts/tsconfig.json +15 -0
- package/templates/skills/media-processing/SKILL.md +91 -0
- package/templates/skills/media-processing/references/common-workflows.md +132 -0
- package/templates/skills/media-processing/references/ffmpeg-encoding.md +358 -0
- package/templates/skills/media-processing/references/ffmpeg-filters.md +503 -0
- package/templates/skills/media-processing/references/ffmpeg-streaming.md +403 -0
- package/templates/skills/media-processing/references/format-compatibility.md +375 -0
- package/templates/skills/media-processing/references/imagemagick-batch.md +612 -0
- package/templates/skills/media-processing/references/imagemagick-editing.md +623 -0
- package/templates/skills/media-processing/references/rmbg-background-removal.md +66 -0
- package/templates/skills/media-processing/references/troubleshooting.md +109 -0
- package/templates/skills/media-processing/scripts/README.md +111 -0
- package/templates/skills/media-processing/scripts/batch-remove-background.sh +124 -0
- package/templates/skills/media-processing/scripts/batch_resize.py +342 -0
- package/templates/skills/media-processing/scripts/media_convert.py +311 -0
- package/templates/skills/media-processing/scripts/remove-background.sh +96 -0
- package/templates/skills/media-processing/scripts/remove-bg-node.js +158 -0
- package/templates/skills/media-processing/scripts/requirements.txt +24 -0
- package/templates/skills/media-processing/scripts/tests/.coverage +0 -0
- package/templates/skills/media-processing/scripts/tests/requirements.txt +2 -0
- package/templates/skills/media-processing/scripts/tests/test_batch_resize.py +372 -0
- package/templates/skills/media-processing/scripts/tests/test_media_convert.py +259 -0
- package/templates/skills/media-processing/scripts/tests/test_video_optimize.py +397 -0
- package/templates/skills/media-processing/scripts/video_optimize.py +414 -0
- package/templates/skills/mobile-development/SKILL.md +212 -0
- package/templates/skills/mobile-development/references/mobile-android.md +604 -0
- package/templates/skills/mobile-development/references/mobile-best-practices.md +545 -0
- package/templates/skills/mobile-development/references/mobile-debugging.md +1089 -0
- package/templates/skills/mobile-development/references/mobile-frameworks.md +465 -0
- package/templates/skills/mobile-development/references/mobile-ios.md +496 -0
- package/templates/skills/mobile-development/references/mobile-mindset.md +544 -0
- package/templates/skills/package-upgrade/SKILL.md +189 -0
- package/templates/skills/payment-integration/README.md +185 -0
- package/templates/skills/payment-integration/SKILL.md +118 -0
- package/templates/skills/payment-integration/references/polar/benefits.md +396 -0
- package/templates/skills/payment-integration/references/polar/best-practices.md +482 -0
- package/templates/skills/payment-integration/references/polar/checkouts.md +266 -0
- package/templates/skills/payment-integration/references/polar/overview.md +184 -0
- package/templates/skills/payment-integration/references/polar/products.md +244 -0
- package/templates/skills/payment-integration/references/polar/sdk.md +436 -0
- package/templates/skills/payment-integration/references/polar/subscriptions.md +340 -0
- package/templates/skills/payment-integration/references/polar/webhooks.md +405 -0
- package/templates/skills/payment-integration/references/sepay/api.md +140 -0
- package/templates/skills/payment-integration/references/sepay/best-practices.md +337 -0
- package/templates/skills/payment-integration/references/sepay/overview.md +138 -0
- package/templates/skills/payment-integration/references/sepay/qr-codes.md +228 -0
- package/templates/skills/payment-integration/references/sepay/sdk.md +213 -0
- package/templates/skills/payment-integration/references/sepay/webhooks.md +208 -0
- package/templates/skills/payment-integration/scripts/.env.example +20 -0
- package/templates/skills/payment-integration/scripts/checkout-helper.js +244 -0
- package/templates/skills/payment-integration/scripts/package.json +17 -0
- package/templates/skills/payment-integration/scripts/polar-webhook-verify.js +202 -0
- package/templates/skills/payment-integration/scripts/sepay-webhook-verify.js +193 -0
- package/templates/skills/payment-integration/scripts/test-scripts.js +237 -0
- package/templates/skills/plan-analysis/SKILL.md +191 -0
- package/templates/skills/planning/SKILL.md +115 -0
- package/templates/skills/planning/references/codebase-understanding.md +62 -0
- package/templates/skills/planning/references/output-standards.md +127 -0
- package/templates/skills/planning/references/plan-organization.md +150 -0
- package/templates/skills/planning/references/research-phase.md +49 -0
- package/templates/skills/planning/references/solution-design.md +63 -0
- package/templates/skills/planning-with-files/SKILL.md +160 -0
- package/templates/skills/planning-with-files/examples.md +202 -0
- package/templates/skills/planning-with-files/reference.md +110 -0
- package/templates/skills/problem-solving/SKILL.md +96 -0
- package/templates/skills/problem-solving/references/attribution.md +69 -0
- package/templates/skills/problem-solving/references/collision-zone-thinking.md +79 -0
- package/templates/skills/problem-solving/references/inversion-exercise.md +91 -0
- package/templates/skills/problem-solving/references/meta-pattern-recognition.md +87 -0
- package/templates/skills/problem-solving/references/scale-game.md +95 -0
- package/templates/skills/problem-solving/references/simplification-cascades.md +80 -0
- package/templates/skills/problem-solving/references/when-stuck.md +72 -0
- package/templates/skills/project-index/SKILL.md +97 -0
- package/templates/skills/project-index/scripts/scan-structure.js +417 -0
- package/templates/skills/project-index/scripts/scan_structure.py +450 -0
- package/templates/skills/readme-improvement/SKILL.md +177 -0
- package/templates/skills/repomix/SKILL.md +247 -0
- package/templates/skills/repomix/references/configuration.md +211 -0
- package/templates/skills/repomix/references/usage-patterns.md +232 -0
- package/templates/skills/repomix/scripts/.coverage +0 -0
- package/templates/skills/repomix/scripts/README.md +179 -0
- package/templates/skills/repomix/scripts/repomix_batch.py +455 -0
- package/templates/skills/repomix/scripts/repos.example.json +15 -0
- package/templates/skills/repomix/scripts/requirements.txt +15 -0
- package/templates/skills/repomix/scripts/tests/test_repomix_batch.py +531 -0
- package/templates/skills/research/SKILL.md +168 -0
- package/templates/skills/sequential-thinking/.env.example +8 -0
- package/templates/skills/sequential-thinking/README.md +183 -0
- package/templates/skills/sequential-thinking/SKILL.md +94 -0
- package/templates/skills/sequential-thinking/package.json +31 -0
- package/templates/skills/sequential-thinking/references/advanced-strategies.md +79 -0
- package/templates/skills/sequential-thinking/references/advanced-techniques.md +76 -0
- package/templates/skills/sequential-thinking/references/core-patterns.md +95 -0
- package/templates/skills/sequential-thinking/references/examples-api.md +88 -0
- package/templates/skills/sequential-thinking/references/examples-architecture.md +94 -0
- package/templates/skills/sequential-thinking/references/examples-debug.md +90 -0
- package/templates/skills/sequential-thinking/scripts/format-thought.js +159 -0
- package/templates/skills/sequential-thinking/scripts/process-thought.js +236 -0
- package/templates/skills/sequential-thinking/tests/format-thought.test.js +133 -0
- package/templates/skills/sequential-thinking/tests/process-thought.test.js +215 -0
- package/templates/skills/shopify/README.md +66 -0
- package/templates/skills/shopify/SKILL.md +319 -0
- package/templates/skills/shopify/references/app-development.md +470 -0
- package/templates/skills/shopify/references/extensions.md +493 -0
- package/templates/skills/shopify/references/themes.md +498 -0
- package/templates/skills/shopify/scripts/.coverage +0 -0
- package/templates/skills/shopify/scripts/requirements.txt +19 -0
- package/templates/skills/shopify/scripts/shopify_init.py +423 -0
- package/templates/skills/shopify/scripts/tests/.coverage +0 -0
- package/templates/skills/shopify/scripts/tests/test_shopify_init.py +385 -0
- package/templates/skills/skill-creator/LICENSE.txt +202 -0
- package/templates/skills/skill-creator/SKILL.md +266 -0
- package/templates/skills/skill-creator/scripts/init_skill.py +303 -0
- package/templates/skills/skill-creator/scripts/package_skill.py +110 -0
- package/templates/skills/skill-creator/scripts/quick_validate.py +65 -0
- package/templates/skills/skill-share/SKILL.md +80 -0
- package/templates/skills/tasks-code-review/SKILL.md +298 -0
- package/templates/skills/tasks-documentation/SKILL.md +328 -0
- package/templates/skills/tasks-spec-update/SKILL.md +318 -0
- package/templates/skills/tasks-test-generation/SKILL.md +433 -0
- package/templates/skills/template-skill/SKILL.md +6 -0
- package/templates/skills/test-generation/SKILL.md +203 -0
- package/templates/skills/threejs/SKILL.md +89 -0
- package/templates/skills/threejs/references/01-getting-started.md +177 -0
- package/templates/skills/threejs/references/02-loaders.md +169 -0
- package/templates/skills/threejs/references/03-textures.md +170 -0
- package/templates/skills/threejs/references/04-cameras.md +195 -0
- package/templates/skills/threejs/references/05-lights.md +183 -0
- package/templates/skills/threejs/references/06-animations.md +214 -0
- package/templates/skills/threejs/references/07-math.md +260 -0
- package/templates/skills/threejs/references/08-interaction.md +267 -0
- package/templates/skills/threejs/references/09-postprocessing.md +240 -0
- package/templates/skills/threejs/references/10-controls.md +259 -0
- package/templates/skills/threejs/references/11-materials-advanced.md +270 -0
- package/templates/skills/threejs/references/12-performance.md +269 -0
- package/templates/skills/threejs/references/13-node-materials.md +298 -0
- package/templates/skills/threejs/references/14-physics-vr.md +304 -0
- package/templates/skills/threejs/references/15-specialized-loaders.md +333 -0
- package/templates/skills/threejs/references/16-webgpu.md +302 -0
- package/templates/skills/ui-styling/LICENSE.txt +202 -0
- package/templates/skills/ui-styling/SKILL.md +321 -0
- package/templates/skills/ui-styling/canvas-fonts/ArsenalSC-OFL.txt +93 -0
- package/templates/skills/ui-styling/canvas-fonts/ArsenalSC-Regular.ttf +0 -0
- package/templates/skills/ui-styling/canvas-fonts/BigShoulders-Bold.ttf +0 -0
- package/templates/skills/ui-styling/canvas-fonts/BigShoulders-OFL.txt +93 -0
- package/templates/skills/ui-styling/canvas-fonts/BigShoulders-Regular.ttf +0 -0
- package/templates/skills/ui-styling/canvas-fonts/Boldonse-OFL.txt +93 -0
- package/templates/skills/ui-styling/canvas-fonts/Boldonse-Regular.ttf +0 -0
- package/templates/skills/ui-styling/canvas-fonts/BricolageGrotesque-Bold.ttf +0 -0
- package/templates/skills/ui-styling/canvas-fonts/BricolageGrotesque-OFL.txt +93 -0
- package/templates/skills/ui-styling/canvas-fonts/BricolageGrotesque-Regular.ttf +0 -0
- package/templates/skills/ui-styling/canvas-fonts/CrimsonPro-Bold.ttf +0 -0
- package/templates/skills/ui-styling/canvas-fonts/CrimsonPro-Italic.ttf +0 -0
- package/templates/skills/ui-styling/canvas-fonts/CrimsonPro-OFL.txt +93 -0
- package/templates/skills/ui-styling/canvas-fonts/CrimsonPro-Regular.ttf +0 -0
- package/templates/skills/ui-styling/canvas-fonts/DMMono-OFL.txt +93 -0
- package/templates/skills/ui-styling/canvas-fonts/DMMono-Regular.ttf +0 -0
- package/templates/skills/ui-styling/canvas-fonts/EricaOne-OFL.txt +94 -0
- package/templates/skills/ui-styling/canvas-fonts/EricaOne-Regular.ttf +0 -0
- package/templates/skills/ui-styling/canvas-fonts/GeistMono-Bold.ttf +0 -0
- package/templates/skills/ui-styling/canvas-fonts/GeistMono-OFL.txt +93 -0
- package/templates/skills/ui-styling/canvas-fonts/GeistMono-Regular.ttf +0 -0
- package/templates/skills/ui-styling/canvas-fonts/Gloock-OFL.txt +93 -0
- package/templates/skills/ui-styling/canvas-fonts/Gloock-Regular.ttf +0 -0
- package/templates/skills/ui-styling/canvas-fonts/IBMPlexMono-Bold.ttf +0 -0
- package/templates/skills/ui-styling/canvas-fonts/IBMPlexMono-OFL.txt +93 -0
- package/templates/skills/ui-styling/canvas-fonts/IBMPlexMono-Regular.ttf +0 -0
- package/templates/skills/ui-styling/canvas-fonts/IBMPlexSerif-Bold.ttf +0 -0
- package/templates/skills/ui-styling/canvas-fonts/IBMPlexSerif-BoldItalic.ttf +0 -0
- package/templates/skills/ui-styling/canvas-fonts/IBMPlexSerif-Italic.ttf +0 -0
- package/templates/skills/ui-styling/canvas-fonts/IBMPlexSerif-Regular.ttf +0 -0
- package/templates/skills/ui-styling/canvas-fonts/InstrumentSans-Bold.ttf +0 -0
- package/templates/skills/ui-styling/canvas-fonts/InstrumentSans-BoldItalic.ttf +0 -0
- package/templates/skills/ui-styling/canvas-fonts/InstrumentSans-Italic.ttf +0 -0
- package/templates/skills/ui-styling/canvas-fonts/InstrumentSans-OFL.txt +93 -0
- package/templates/skills/ui-styling/canvas-fonts/InstrumentSans-Regular.ttf +0 -0
- package/templates/skills/ui-styling/canvas-fonts/InstrumentSerif-Italic.ttf +0 -0
- package/templates/skills/ui-styling/canvas-fonts/InstrumentSerif-Regular.ttf +0 -0
- package/templates/skills/ui-styling/canvas-fonts/Italiana-OFL.txt +93 -0
- package/templates/skills/ui-styling/canvas-fonts/Italiana-Regular.ttf +0 -0
- package/templates/skills/ui-styling/canvas-fonts/JetBrainsMono-Bold.ttf +0 -0
- package/templates/skills/ui-styling/canvas-fonts/JetBrainsMono-OFL.txt +93 -0
- package/templates/skills/ui-styling/canvas-fonts/JetBrainsMono-Regular.ttf +0 -0
- package/templates/skills/ui-styling/canvas-fonts/Jura-Light.ttf +0 -0
- package/templates/skills/ui-styling/canvas-fonts/Jura-Medium.ttf +0 -0
- package/templates/skills/ui-styling/canvas-fonts/Jura-OFL.txt +93 -0
- package/templates/skills/ui-styling/canvas-fonts/LibreBaskerville-OFL.txt +93 -0
- package/templates/skills/ui-styling/canvas-fonts/LibreBaskerville-Regular.ttf +0 -0
- package/templates/skills/ui-styling/canvas-fonts/Lora-Bold.ttf +0 -0
- package/templates/skills/ui-styling/canvas-fonts/Lora-BoldItalic.ttf +0 -0
- package/templates/skills/ui-styling/canvas-fonts/Lora-Italic.ttf +0 -0
- package/templates/skills/ui-styling/canvas-fonts/Lora-OFL.txt +93 -0
- package/templates/skills/ui-styling/canvas-fonts/Lora-Regular.ttf +0 -0
- package/templates/skills/ui-styling/canvas-fonts/NationalPark-Bold.ttf +0 -0
- package/templates/skills/ui-styling/canvas-fonts/NationalPark-OFL.txt +93 -0
- package/templates/skills/ui-styling/canvas-fonts/NationalPark-Regular.ttf +0 -0
- package/templates/skills/ui-styling/canvas-fonts/NothingYouCouldDo-OFL.txt +93 -0
- package/templates/skills/ui-styling/canvas-fonts/NothingYouCouldDo-Regular.ttf +0 -0
- package/templates/skills/ui-styling/canvas-fonts/Outfit-Bold.ttf +0 -0
- package/templates/skills/ui-styling/canvas-fonts/Outfit-OFL.txt +93 -0
- package/templates/skills/ui-styling/canvas-fonts/Outfit-Regular.ttf +0 -0
- package/templates/skills/ui-styling/canvas-fonts/PixelifySans-Medium.ttf +0 -0
- package/templates/skills/ui-styling/canvas-fonts/PixelifySans-OFL.txt +93 -0
- package/templates/skills/ui-styling/canvas-fonts/PoiretOne-OFL.txt +93 -0
- package/templates/skills/ui-styling/canvas-fonts/PoiretOne-Regular.ttf +0 -0
- package/templates/skills/ui-styling/canvas-fonts/RedHatMono-Bold.ttf +0 -0
- package/templates/skills/ui-styling/canvas-fonts/RedHatMono-OFL.txt +93 -0
- package/templates/skills/ui-styling/canvas-fonts/RedHatMono-Regular.ttf +0 -0
- package/templates/skills/ui-styling/canvas-fonts/Silkscreen-OFL.txt +93 -0
- package/templates/skills/ui-styling/canvas-fonts/Silkscreen-Regular.ttf +0 -0
- package/templates/skills/ui-styling/canvas-fonts/SmoochSans-Medium.ttf +0 -0
- package/templates/skills/ui-styling/canvas-fonts/SmoochSans-OFL.txt +93 -0
- package/templates/skills/ui-styling/canvas-fonts/Tektur-Medium.ttf +0 -0
- package/templates/skills/ui-styling/canvas-fonts/Tektur-OFL.txt +93 -0
- package/templates/skills/ui-styling/canvas-fonts/Tektur-Regular.ttf +0 -0
- package/templates/skills/ui-styling/canvas-fonts/WorkSans-Bold.ttf +0 -0
- package/templates/skills/ui-styling/canvas-fonts/WorkSans-BoldItalic.ttf +0 -0
- package/templates/skills/ui-styling/canvas-fonts/WorkSans-Italic.ttf +0 -0
- package/templates/skills/ui-styling/canvas-fonts/WorkSans-OFL.txt +93 -0
- package/templates/skills/ui-styling/canvas-fonts/WorkSans-Regular.ttf +0 -0
- package/templates/skills/ui-styling/canvas-fonts/YoungSerif-OFL.txt +93 -0
- package/templates/skills/ui-styling/canvas-fonts/YoungSerif-Regular.ttf +0 -0
- package/templates/skills/ui-styling/references/canvas-design-system.md +320 -0
- package/templates/skills/ui-styling/references/shadcn-accessibility.md +471 -0
- package/templates/skills/ui-styling/references/shadcn-components.md +424 -0
- package/templates/skills/ui-styling/references/shadcn-theming.md +373 -0
- package/templates/skills/ui-styling/references/tailwind-customization.md +483 -0
- package/templates/skills/ui-styling/references/tailwind-responsive.md +382 -0
- package/templates/skills/ui-styling/references/tailwind-utilities.md +455 -0
- package/templates/skills/ui-styling/scripts/.coverage +0 -0
- package/templates/skills/ui-styling/scripts/requirements.txt +17 -0
- package/templates/skills/ui-styling/scripts/shadcn_add.py +292 -0
- package/templates/skills/ui-styling/scripts/tailwind_config_gen.py +456 -0
- package/templates/skills/ui-styling/scripts/tests/coverage-ui.json +1 -0
- package/templates/skills/ui-styling/scripts/tests/requirements.txt +3 -0
- package/templates/skills/ui-styling/scripts/tests/test_shadcn_add.py +266 -0
- package/templates/skills/ui-styling/scripts/tests/test_tailwind_config_gen.py +336 -0
- package/templates/skills/ui-ux-pro-max/SKILL.md +315 -0
- package/templates/skills/ui-ux-pro-max/data/charts.csv +26 -0
- package/templates/skills/ui-ux-pro-max/data/colors.csv +97 -0
- package/templates/skills/ui-ux-pro-max/data/icons.csv +101 -0
- package/templates/skills/ui-ux-pro-max/data/landing.csv +31 -0
- package/templates/skills/ui-ux-pro-max/data/products.csv +97 -0
- package/templates/skills/ui-ux-pro-max/data/prompts.csv +24 -0
- package/templates/skills/ui-ux-pro-max/data/react-performance.csv +45 -0
- package/templates/skills/ui-ux-pro-max/data/stacks/flutter.csv +53 -0
- package/templates/skills/ui-ux-pro-max/data/stacks/html-tailwind.csv +56 -0
- package/templates/skills/ui-ux-pro-max/data/stacks/nextjs.csv +53 -0
- package/templates/skills/ui-ux-pro-max/data/stacks/nuxt-ui.csv +51 -0
- package/templates/skills/ui-ux-pro-max/data/stacks/nuxtjs.csv +59 -0
- package/templates/skills/ui-ux-pro-max/data/stacks/react-native.csv +52 -0
- package/templates/skills/ui-ux-pro-max/data/stacks/react.csv +54 -0
- package/templates/skills/ui-ux-pro-max/data/stacks/shadcn.csv +61 -0
- package/templates/skills/ui-ux-pro-max/data/stacks/svelte.csv +54 -0
- package/templates/skills/ui-ux-pro-max/data/stacks/swiftui.csv +51 -0
- package/templates/skills/ui-ux-pro-max/data/stacks/vue.csv +50 -0
- package/templates/skills/ui-ux-pro-max/data/styles.csv +59 -0
- package/templates/skills/ui-ux-pro-max/data/typography.csv +58 -0
- package/templates/skills/ui-ux-pro-max/data/ux-guidelines.csv +100 -0
- package/templates/skills/ui-ux-pro-max/data/web-interface.csv +31 -0
- package/templates/skills/ui-ux-pro-max/scripts/core.py +257 -0
- package/templates/skills/ui-ux-pro-max/scripts/search.py +61 -0
- package/templates/skills/web-frameworks/SKILL.md +324 -0
- package/templates/skills/web-frameworks/references/nextjs-app-router.md +465 -0
- package/templates/skills/web-frameworks/references/nextjs-data-fetching.md +459 -0
- package/templates/skills/web-frameworks/references/nextjs-optimization.md +511 -0
- package/templates/skills/web-frameworks/references/nextjs-server-components.md +495 -0
- package/templates/skills/web-frameworks/references/remix-icon-integration.md +603 -0
- package/templates/skills/web-frameworks/references/turborepo-caching.md +551 -0
- package/templates/skills/web-frameworks/references/turborepo-pipelines.md +517 -0
- package/templates/skills/web-frameworks/references/turborepo-setup.md +542 -0
- package/templates/skills/web-frameworks/scripts/.coverage +0 -0
- package/templates/skills/web-frameworks/scripts/__init__.py +0 -0
- package/templates/skills/web-frameworks/scripts/nextjs_init.py +547 -0
- package/templates/skills/web-frameworks/scripts/requirements.txt +16 -0
- package/templates/skills/web-frameworks/scripts/tests/coverage-web.json +1 -0
- package/templates/skills/web-frameworks/scripts/tests/requirements.txt +3 -0
- package/templates/skills/web-frameworks/scripts/tests/test_nextjs_init.py +319 -0
- package/templates/skills/web-frameworks/scripts/tests/test_turborepo_migrate.py +374 -0
- package/templates/skills/web-frameworks/scripts/turborepo_migrate.py +394 -0
- package/templates/skills/webapp-testing/LICENSE.txt +202 -0
- package/templates/skills/webapp-testing/SKILL.md +96 -0
- package/templates/skills/webapp-testing/examples/console_logging.py +35 -0
- package/templates/skills/webapp-testing/examples/element_discovery.py +40 -0
- package/templates/skills/webapp-testing/examples/static_html_automation.py +33 -0
- package/templates/skills/webapp-testing/scripts/with_server.py +106 -0
- package/templates/statusline.cjs +306 -0
- package/templates/statusline.ps1 +308 -0
- package/templates/statusline.sh +238 -0
- package/templates/workflows/README.md +241 -0
- package/templates/workflows/development-rules.md +93 -0
- package/templates/workflows/documentation-management.md +121 -0
- package/templates/workflows/orchestration-protocol.md +16 -0
- package/templates/workflows/primary-workflow.md +45 -0
|
@@ -0,0 +1,493 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* SessionStart Hook - Initializes session environment with project detection
|
|
4
|
+
*
|
|
5
|
+
* Fires: Once per session (startup, resume, clear, compact)
|
|
6
|
+
* Purpose: Load config, detect project info, persist to env vars, output context
|
|
7
|
+
*
|
|
8
|
+
* Exit Codes:
|
|
9
|
+
* 0 - Success (non-blocking, allows continuation)
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
const fs = require('fs');
|
|
13
|
+
const path = require('path');
|
|
14
|
+
const os = require('os');
|
|
15
|
+
const { execSync, execFileSync } = require('child_process');
|
|
16
|
+
const {
|
|
17
|
+
loadConfig,
|
|
18
|
+
writeEnv,
|
|
19
|
+
writeSessionState,
|
|
20
|
+
resolvePlanPath,
|
|
21
|
+
getReportsPath,
|
|
22
|
+
resolveNamingPattern
|
|
23
|
+
} = require('./lib/ck-config-utils.cjs');
|
|
24
|
+
const { writeResetMarker } = require('./lib/context-tracker.cjs');
|
|
25
|
+
|
|
26
|
+
// Python version cache configuration
|
|
27
|
+
const PYTHON_CACHE_FILE = path.join(__dirname, '.python-cache.json');
|
|
28
|
+
const PYTHON_CACHE_TTL = 86400000; // 24 hours in milliseconds
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* Safely execute shell command with optional timeout
|
|
32
|
+
* @param {string} cmd - Command to execute
|
|
33
|
+
* @param {number} timeoutMs - Timeout in milliseconds (default: 5000)
|
|
34
|
+
*/
|
|
35
|
+
function execSafe(cmd, timeoutMs = 5000) {
|
|
36
|
+
try {
|
|
37
|
+
return execSync(cmd, {
|
|
38
|
+
encoding: 'utf8',
|
|
39
|
+
timeout: timeoutMs,
|
|
40
|
+
stdio: ['pipe', 'pipe', 'pipe']
|
|
41
|
+
}).trim();
|
|
42
|
+
} catch (e) {
|
|
43
|
+
return null;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* Safely execute a binary with arguments (no shell interpolation)
|
|
49
|
+
* Prevents command injection and handles paths with spaces correctly
|
|
50
|
+
* @param {string} binary - Path to the executable
|
|
51
|
+
* @param {string[]} args - Arguments array
|
|
52
|
+
* @param {number} timeoutMs - Timeout in milliseconds (default: 2000)
|
|
53
|
+
*/
|
|
54
|
+
function execFileSafe(binary, args, timeoutMs = 2000) {
|
|
55
|
+
try {
|
|
56
|
+
return execFileSync(binary, args, {
|
|
57
|
+
encoding: 'utf8',
|
|
58
|
+
timeout: timeoutMs,
|
|
59
|
+
stdio: ['pipe', 'pipe', 'pipe']
|
|
60
|
+
}).trim();
|
|
61
|
+
} catch (e) {
|
|
62
|
+
return null;
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
/**
|
|
67
|
+
* Validate that a path is a file (not directory) and doesn't contain shell metacharacters
|
|
68
|
+
* @param {string} p - Path to validate
|
|
69
|
+
*/
|
|
70
|
+
function isValidPythonPath(p) {
|
|
71
|
+
if (!p || typeof p !== 'string') return false;
|
|
72
|
+
// Reject paths with shell metacharacters that could indicate injection attempts
|
|
73
|
+
if (/[;&|`$(){}[\]<>!#*?]/.test(p)) return false;
|
|
74
|
+
try {
|
|
75
|
+
const stat = fs.statSync(p);
|
|
76
|
+
return stat.isFile();
|
|
77
|
+
} catch (e) {
|
|
78
|
+
return false;
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
/**
|
|
83
|
+
* Build platform-specific Python paths for fast filesystem check
|
|
84
|
+
* Avoids slow shell initialization (pyenv, conda) by checking paths directly
|
|
85
|
+
*/
|
|
86
|
+
function getPythonPaths() {
|
|
87
|
+
const paths = [];
|
|
88
|
+
|
|
89
|
+
// User override takes priority
|
|
90
|
+
if (process.env.PYTHON_PATH) {
|
|
91
|
+
paths.push(process.env.PYTHON_PATH);
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
if (process.platform === 'win32') {
|
|
95
|
+
// Windows paths
|
|
96
|
+
const localAppData = process.env.LOCALAPPDATA;
|
|
97
|
+
const programFiles = process.env.ProgramFiles || 'C:\\Program Files';
|
|
98
|
+
const programFilesX86 = process.env['ProgramFiles(x86)'] || 'C:\\Program Files (x86)';
|
|
99
|
+
|
|
100
|
+
// Microsoft Store Python (most common on modern Windows)
|
|
101
|
+
if (localAppData) {
|
|
102
|
+
paths.push(path.join(localAppData, 'Microsoft', 'WindowsApps', 'python.exe'));
|
|
103
|
+
paths.push(path.join(localAppData, 'Microsoft', 'WindowsApps', 'python3.exe'));
|
|
104
|
+
// User-installed Python (common versions)
|
|
105
|
+
for (const ver of ['313', '312', '311', '310', '39']) {
|
|
106
|
+
paths.push(path.join(localAppData, 'Programs', 'Python', `Python${ver}`, 'python.exe'));
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
// System-wide Python installations
|
|
111
|
+
for (const ver of ['313', '312', '311', '310', '39']) {
|
|
112
|
+
paths.push(path.join(programFiles, `Python${ver}`, 'python.exe'));
|
|
113
|
+
paths.push(path.join(programFilesX86, `Python${ver}`, 'python.exe'));
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
// Legacy paths
|
|
117
|
+
paths.push('C:\\Python313\\python.exe');
|
|
118
|
+
paths.push('C:\\Python312\\python.exe');
|
|
119
|
+
paths.push('C:\\Python311\\python.exe');
|
|
120
|
+
paths.push('C:\\Python310\\python.exe');
|
|
121
|
+
paths.push('C:\\Python39\\python.exe');
|
|
122
|
+
} else {
|
|
123
|
+
// Unix-like paths (Linux, macOS)
|
|
124
|
+
paths.push('/usr/bin/python3');
|
|
125
|
+
paths.push('/usr/local/bin/python3');
|
|
126
|
+
paths.push('/opt/homebrew/bin/python3'); // macOS ARM (Homebrew)
|
|
127
|
+
paths.push('/opt/homebrew/bin/python'); // macOS ARM fallback
|
|
128
|
+
paths.push('/usr/bin/python');
|
|
129
|
+
paths.push('/usr/local/bin/python');
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
return paths;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
/**
|
|
136
|
+
* Find Python binary using fast filesystem check
|
|
137
|
+
* Returns first existing valid file path, avoiding slow shell spawns
|
|
138
|
+
*/
|
|
139
|
+
function findPythonBinary() {
|
|
140
|
+
const paths = getPythonPaths();
|
|
141
|
+
for (const p of paths) {
|
|
142
|
+
if (isValidPythonPath(p)) return p;
|
|
143
|
+
}
|
|
144
|
+
return null;
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
/**
|
|
148
|
+
* Get Python version with optimized detection
|
|
149
|
+
* Layer 0: Fast path pre-check (instant fs lookup)
|
|
150
|
+
* Layer 1: Timeout protection (2s max per command)
|
|
151
|
+
* Layer 2: Graceful degradation (returns null on failure)
|
|
152
|
+
*/
|
|
153
|
+
function getPythonVersion() {
|
|
154
|
+
// Layer 0: Fast path pre-check - instant filesystem lookup
|
|
155
|
+
const pythonPath = findPythonBinary();
|
|
156
|
+
if (pythonPath) {
|
|
157
|
+
// Use execFileSafe to prevent command injection and handle paths with spaces
|
|
158
|
+
// Direct binary execution bypasses shell initialization (pyenv, conda)
|
|
159
|
+
const result = execFileSafe(pythonPath, ['--version']);
|
|
160
|
+
if (result) return result;
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
// Fallback: Try shell resolution with strict timeout
|
|
164
|
+
// This catches non-standard installations but caps at 2s
|
|
165
|
+
// Note: Shell fallback still needed for pyenv/asdf where binary isn't in standard paths
|
|
166
|
+
const commands = ['python3', 'python'];
|
|
167
|
+
for (const cmd of commands) {
|
|
168
|
+
const result = execFileSafe(cmd, ['--version']);
|
|
169
|
+
if (result) return result;
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
return null;
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
/**
|
|
176
|
+
* Get Python version with caching to avoid repeated detection
|
|
177
|
+
* Caches result for 24 hours to speed up session startup
|
|
178
|
+
*/
|
|
179
|
+
function getPythonVersionCached() {
|
|
180
|
+
try {
|
|
181
|
+
if (fs.existsSync(PYTHON_CACHE_FILE)) {
|
|
182
|
+
const cache = JSON.parse(fs.readFileSync(PYTHON_CACHE_FILE, 'utf8'));
|
|
183
|
+
if (cache && Date.now() - cache.timestamp < PYTHON_CACHE_TTL) {
|
|
184
|
+
return cache.version;
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
} catch (e) {
|
|
188
|
+
// Cache read failed, proceed with fresh detection
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
const version = getPythonVersion();
|
|
192
|
+
|
|
193
|
+
try {
|
|
194
|
+
fs.writeFileSync(PYTHON_CACHE_FILE, JSON.stringify({
|
|
195
|
+
version,
|
|
196
|
+
timestamp: Date.now()
|
|
197
|
+
}));
|
|
198
|
+
} catch (e) {
|
|
199
|
+
// Cache write failed, non-critical
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
return version;
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
/**
|
|
206
|
+
* Get git remote URL
|
|
207
|
+
*/
|
|
208
|
+
function getGitRemoteUrl() {
|
|
209
|
+
return execSafe('git config --get remote.origin.url');
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
/**
|
|
213
|
+
* Get current git branch
|
|
214
|
+
*/
|
|
215
|
+
function getGitBranch() {
|
|
216
|
+
return execSafe('git branch --show-current');
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
/**
|
|
220
|
+
* Detect project type based on workspace indicators
|
|
221
|
+
*/
|
|
222
|
+
function detectProjectType(configOverride) {
|
|
223
|
+
if (configOverride && configOverride !== 'auto') return configOverride;
|
|
224
|
+
|
|
225
|
+
if (fs.existsSync('pnpm-workspace.yaml')) return 'monorepo';
|
|
226
|
+
if (fs.existsSync('lerna.json')) return 'monorepo';
|
|
227
|
+
|
|
228
|
+
if (fs.existsSync('package.json')) {
|
|
229
|
+
try {
|
|
230
|
+
const pkg = JSON.parse(fs.readFileSync('package.json', 'utf8'));
|
|
231
|
+
if (pkg.workspaces) return 'monorepo';
|
|
232
|
+
if (pkg.main || pkg.exports) return 'library';
|
|
233
|
+
} catch (e) { /* ignore */ }
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
return 'single-repo';
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
/**
|
|
240
|
+
* Detect package manager from lock files
|
|
241
|
+
*/
|
|
242
|
+
function detectPackageManager(configOverride) {
|
|
243
|
+
if (configOverride && configOverride !== 'auto') return configOverride;
|
|
244
|
+
|
|
245
|
+
if (fs.existsSync('bun.lockb')) return 'bun';
|
|
246
|
+
if (fs.existsSync('pnpm-lock.yaml')) return 'pnpm';
|
|
247
|
+
if (fs.existsSync('yarn.lock')) return 'yarn';
|
|
248
|
+
if (fs.existsSync('package-lock.json')) return 'npm';
|
|
249
|
+
|
|
250
|
+
return null;
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
/**
|
|
254
|
+
* Detect framework from package.json dependencies
|
|
255
|
+
*/
|
|
256
|
+
function detectFramework(configOverride) {
|
|
257
|
+
if (configOverride && configOverride !== 'auto') return configOverride;
|
|
258
|
+
if (!fs.existsSync('package.json')) return null;
|
|
259
|
+
|
|
260
|
+
try {
|
|
261
|
+
const pkg = JSON.parse(fs.readFileSync('package.json', 'utf8'));
|
|
262
|
+
const deps = { ...pkg.dependencies, ...pkg.devDependencies };
|
|
263
|
+
|
|
264
|
+
if (deps['next']) return 'next';
|
|
265
|
+
if (deps['nuxt']) return 'nuxt';
|
|
266
|
+
if (deps['astro']) return 'astro';
|
|
267
|
+
if (deps['@remix-run/node'] || deps['@remix-run/react']) return 'remix';
|
|
268
|
+
if (deps['svelte'] || deps['@sveltejs/kit']) return 'svelte';
|
|
269
|
+
if (deps['vue']) return 'vue';
|
|
270
|
+
if (deps['react']) return 'react';
|
|
271
|
+
if (deps['express']) return 'express';
|
|
272
|
+
if (deps['fastify']) return 'fastify';
|
|
273
|
+
if (deps['hono']) return 'hono';
|
|
274
|
+
if (deps['elysia']) return 'elysia';
|
|
275
|
+
|
|
276
|
+
return null;
|
|
277
|
+
} catch (e) {
|
|
278
|
+
return null;
|
|
279
|
+
}
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
/**
|
|
283
|
+
* Get coding level style name mapping
|
|
284
|
+
* @param {number} level - Coding level (0-5)
|
|
285
|
+
* @returns {string} Style name for /output-style command
|
|
286
|
+
*/
|
|
287
|
+
function getCodingLevelStyleName(level) {
|
|
288
|
+
const styleMap = {
|
|
289
|
+
0: 'coding-level-0-eli5',
|
|
290
|
+
1: 'coding-level-1-junior',
|
|
291
|
+
2: 'coding-level-2-mid',
|
|
292
|
+
3: 'coding-level-3-senior',
|
|
293
|
+
4: 'coding-level-4-lead',
|
|
294
|
+
5: 'coding-level-5-god'
|
|
295
|
+
};
|
|
296
|
+
return styleMap[level] || 'coding-level-5-god';
|
|
297
|
+
}
|
|
298
|
+
|
|
299
|
+
/**
|
|
300
|
+
* Get coding level guidelines by reading from output-styles .md files
|
|
301
|
+
* This ensures single source of truth - users can customize the .md files directly
|
|
302
|
+
* @param {number} level - Coding level (-1 to 5)
|
|
303
|
+
* @returns {string|null} Guidelines text (frontmatter stripped) or null if disabled
|
|
304
|
+
*/
|
|
305
|
+
function getCodingLevelGuidelines(level) {
|
|
306
|
+
// -1 = disabled (no injection, saves tokens)
|
|
307
|
+
// 5 = god mode (still injects minimal guidelines)
|
|
308
|
+
if (level === -1 || level === null || level === undefined) return null;
|
|
309
|
+
|
|
310
|
+
const styleName = getCodingLevelStyleName(level);
|
|
311
|
+
const stylePath = path.join(__dirname, '..', 'output-styles', `${styleName}.md`);
|
|
312
|
+
|
|
313
|
+
try {
|
|
314
|
+
if (!fs.existsSync(stylePath)) return null;
|
|
315
|
+
|
|
316
|
+
const content = fs.readFileSync(stylePath, 'utf8');
|
|
317
|
+
// Strip YAML frontmatter (between --- markers at start of file)
|
|
318
|
+
const withoutFrontmatter = content.replace(/^---[\s\S]*?---\n*/, '').trim();
|
|
319
|
+
return withoutFrontmatter;
|
|
320
|
+
} catch (e) {
|
|
321
|
+
return null;
|
|
322
|
+
}
|
|
323
|
+
}
|
|
324
|
+
|
|
325
|
+
/**
|
|
326
|
+
* Build context summary for output (compact, single line)
|
|
327
|
+
* @param {Object} config - Loaded config
|
|
328
|
+
* @param {Object} detections - Project detections
|
|
329
|
+
* @param {{ path: string|null, resolvedBy: string|null }} resolved - Plan resolution result
|
|
330
|
+
*/
|
|
331
|
+
function buildContextOutput(config, detections, resolved) {
|
|
332
|
+
const lines = [`Project: ${detections.type || 'unknown'}`];
|
|
333
|
+
if (detections.pm) lines.push(`PM: ${detections.pm}`);
|
|
334
|
+
lines.push(`Plan naming: ${config.plan.namingFormat}`);
|
|
335
|
+
|
|
336
|
+
// Show plan status with resolution context
|
|
337
|
+
if (resolved.path) {
|
|
338
|
+
if (resolved.resolvedBy === 'session') {
|
|
339
|
+
lines.push(`Plan: ${resolved.path}`);
|
|
340
|
+
} else {
|
|
341
|
+
lines.push(`Suggested: ${resolved.path}`);
|
|
342
|
+
}
|
|
343
|
+
}
|
|
344
|
+
|
|
345
|
+
return lines.join(' | ');
|
|
346
|
+
}
|
|
347
|
+
|
|
348
|
+
/**
|
|
349
|
+
* Main hook execution
|
|
350
|
+
*/
|
|
351
|
+
async function main() {
|
|
352
|
+
try {
|
|
353
|
+
const stdin = fs.readFileSync(0, 'utf-8').trim();
|
|
354
|
+
const data = stdin ? JSON.parse(stdin) : {};
|
|
355
|
+
const envFile = process.env.CLAUDE_ENV_FILE;
|
|
356
|
+
const source = data.source || 'unknown';
|
|
357
|
+
const sessionId = data.session_id || null;
|
|
358
|
+
|
|
359
|
+
const config = loadConfig();
|
|
360
|
+
|
|
361
|
+
// Layer 3: Write reset marker on /clear to signal statusline to reset baseline
|
|
362
|
+
// This ensures context window percentage resets to 0% on fresh sessions
|
|
363
|
+
if (source === 'clear' && sessionId) {
|
|
364
|
+
writeResetMarker(sessionId, 'clear');
|
|
365
|
+
}
|
|
366
|
+
|
|
367
|
+
const detections = {
|
|
368
|
+
type: detectProjectType(config.project?.type),
|
|
369
|
+
pm: detectPackageManager(config.project?.packageManager),
|
|
370
|
+
framework: detectFramework(config.project?.framework)
|
|
371
|
+
};
|
|
372
|
+
|
|
373
|
+
// Resolve plan - now returns { path, resolvedBy }
|
|
374
|
+
const resolved = resolvePlanPath(null, config);
|
|
375
|
+
|
|
376
|
+
// CRITICAL FIX: Only persist explicitly-set plans to session state
|
|
377
|
+
// Branch-matched plans are "suggested" - stored separately, not as activePlan
|
|
378
|
+
// This prevents stale plan pollution on fresh sessions
|
|
379
|
+
if (sessionId) {
|
|
380
|
+
writeSessionState(sessionId, {
|
|
381
|
+
sessionOrigin: process.cwd(),
|
|
382
|
+
// Only session-resolved plans are truly "active"
|
|
383
|
+
activePlan: resolved.resolvedBy === 'session' ? resolved.path : null,
|
|
384
|
+
// Track suggested plan separately (for UI hints, not for report paths)
|
|
385
|
+
suggestedPlan: resolved.resolvedBy === 'branch' ? resolved.path : null,
|
|
386
|
+
timestamp: Date.now(),
|
|
387
|
+
source
|
|
388
|
+
});
|
|
389
|
+
}
|
|
390
|
+
|
|
391
|
+
// Reports path only uses active plans, not suggested ones
|
|
392
|
+
const reportsPath = getReportsPath(resolved.path, resolved.resolvedBy, config.plan, config.paths);
|
|
393
|
+
|
|
394
|
+
// Collect static environment info (computed once per session)
|
|
395
|
+
const staticEnv = {
|
|
396
|
+
nodeVersion: process.version,
|
|
397
|
+
pythonVersion: getPythonVersionCached(),
|
|
398
|
+
osPlatform: process.platform,
|
|
399
|
+
gitUrl: getGitRemoteUrl(),
|
|
400
|
+
gitBranch: getGitBranch(),
|
|
401
|
+
user: process.env.USERNAME || process.env.USER || process.env.LOGNAME || os.userInfo().username,
|
|
402
|
+
locale: process.env.LANG || '',
|
|
403
|
+
timezone: Intl.DateTimeFormat().resolvedOptions().timeZone,
|
|
404
|
+
claudeSettingsDir: path.resolve(__dirname, '..')
|
|
405
|
+
};
|
|
406
|
+
|
|
407
|
+
// Compute resolved naming pattern (date + issue resolved, {slug} kept as placeholder)
|
|
408
|
+
const namePattern = resolveNamingPattern(config.plan, staticEnv.gitBranch);
|
|
409
|
+
|
|
410
|
+
if (envFile) {
|
|
411
|
+
// Session & plan config
|
|
412
|
+
writeEnv(envFile, 'CK_SESSION_ID', sessionId || '');
|
|
413
|
+
writeEnv(envFile, 'CK_PLAN_NAMING_FORMAT', config.plan.namingFormat);
|
|
414
|
+
writeEnv(envFile, 'CK_PLAN_DATE_FORMAT', config.plan.dateFormat);
|
|
415
|
+
writeEnv(envFile, 'CK_PLAN_ISSUE_PREFIX', config.plan.issuePrefix || '');
|
|
416
|
+
writeEnv(envFile, 'CK_PLAN_REPORTS_DIR', config.plan.reportsDir);
|
|
417
|
+
|
|
418
|
+
// NEW: Resolved naming pattern for DRY file naming in agents
|
|
419
|
+
// Example: "251212-1830-GH-88-{slug}" or "251212-1830-{slug}"
|
|
420
|
+
// Agents use: `{agent-type}-$CK_NAME_PATTERN.md` and substitute {slug}
|
|
421
|
+
writeEnv(envFile, 'CK_NAME_PATTERN', namePattern);
|
|
422
|
+
|
|
423
|
+
// Plan resolution
|
|
424
|
+
writeEnv(envFile, 'CK_ACTIVE_PLAN', resolved.resolvedBy === 'session' ? resolved.path : '');
|
|
425
|
+
writeEnv(envFile, 'CK_SUGGESTED_PLAN', resolved.resolvedBy === 'branch' ? resolved.path : '');
|
|
426
|
+
writeEnv(envFile, 'CK_REPORTS_PATH', reportsPath);
|
|
427
|
+
|
|
428
|
+
// Paths
|
|
429
|
+
writeEnv(envFile, 'CK_DOCS_PATH', config.paths.docs);
|
|
430
|
+
writeEnv(envFile, 'CK_PLANS_PATH', config.paths.plans);
|
|
431
|
+
writeEnv(envFile, 'CK_PROJECT_ROOT', process.cwd());
|
|
432
|
+
|
|
433
|
+
// Project detection
|
|
434
|
+
writeEnv(envFile, 'CK_PROJECT_TYPE', detections.type || '');
|
|
435
|
+
writeEnv(envFile, 'CK_PACKAGE_MANAGER', detections.pm || '');
|
|
436
|
+
writeEnv(envFile, 'CK_FRAMEWORK', detections.framework || '');
|
|
437
|
+
|
|
438
|
+
// NEW: Static environment info (so other hooks don't need to recompute)
|
|
439
|
+
writeEnv(envFile, 'CK_NODE_VERSION', staticEnv.nodeVersion);
|
|
440
|
+
writeEnv(envFile, 'CK_PYTHON_VERSION', staticEnv.pythonVersion || '');
|
|
441
|
+
writeEnv(envFile, 'CK_OS_PLATFORM', staticEnv.osPlatform);
|
|
442
|
+
writeEnv(envFile, 'CK_GIT_URL', staticEnv.gitUrl || '');
|
|
443
|
+
writeEnv(envFile, 'CK_GIT_BRANCH', staticEnv.gitBranch || '');
|
|
444
|
+
writeEnv(envFile, 'CK_USER', staticEnv.user);
|
|
445
|
+
writeEnv(envFile, 'CK_LOCALE', staticEnv.locale);
|
|
446
|
+
writeEnv(envFile, 'CK_TIMEZONE', staticEnv.timezone);
|
|
447
|
+
writeEnv(envFile, 'CK_CLAUDE_SETTINGS_DIR', staticEnv.claudeSettingsDir);
|
|
448
|
+
|
|
449
|
+
// Locale config
|
|
450
|
+
if (config.locale?.thinkingLanguage) {
|
|
451
|
+
writeEnv(envFile, 'CK_THINKING_LANGUAGE', config.locale.thinkingLanguage);
|
|
452
|
+
}
|
|
453
|
+
if (config.locale?.responseLanguage) {
|
|
454
|
+
writeEnv(envFile, 'CK_RESPONSE_LANGUAGE', config.locale.responseLanguage);
|
|
455
|
+
}
|
|
456
|
+
|
|
457
|
+
// Plan validation config (for /plan:validate, /plan:hard, /plan:parallel)
|
|
458
|
+
const validation = config.plan?.validation || {};
|
|
459
|
+
writeEnv(envFile, 'CK_VALIDATION_MODE', validation.mode || 'prompt');
|
|
460
|
+
writeEnv(envFile, 'CK_VALIDATION_MIN_QUESTIONS', validation.minQuestions || 3);
|
|
461
|
+
writeEnv(envFile, 'CK_VALIDATION_MAX_QUESTIONS', validation.maxQuestions || 8);
|
|
462
|
+
writeEnv(envFile, 'CK_VALIDATION_FOCUS_AREAS', (validation.focusAreas || ['assumptions', 'risks', 'tradeoffs', 'architecture']).join(','));
|
|
463
|
+
|
|
464
|
+
// Coding level config (for output style selection)
|
|
465
|
+
const codingLevel = config.codingLevel ?? 5;
|
|
466
|
+
writeEnv(envFile, 'CK_CODING_LEVEL', codingLevel);
|
|
467
|
+
writeEnv(envFile, 'CK_CODING_LEVEL_STYLE', getCodingLevelStyleName(codingLevel));
|
|
468
|
+
}
|
|
469
|
+
|
|
470
|
+
console.log(`Session ${source}. ${buildContextOutput(config, detections, resolved)}`);
|
|
471
|
+
|
|
472
|
+
// Auto-inject coding level guidelines (if not disabled)
|
|
473
|
+
const codingLevel = config.codingLevel ?? -1;
|
|
474
|
+
const guidelines = getCodingLevelGuidelines(codingLevel);
|
|
475
|
+
if (guidelines) {
|
|
476
|
+
console.log(`\n${guidelines}`);
|
|
477
|
+
}
|
|
478
|
+
|
|
479
|
+
if (config.assertions?.length > 0) {
|
|
480
|
+
console.log(`\nUser Assertions:`);
|
|
481
|
+
config.assertions.forEach((assertion, i) => {
|
|
482
|
+
console.log(` ${i + 1}. ${assertion}`);
|
|
483
|
+
});
|
|
484
|
+
}
|
|
485
|
+
|
|
486
|
+
process.exit(0);
|
|
487
|
+
} catch (error) {
|
|
488
|
+
console.error(`SessionStart hook error: ${error.message}`);
|
|
489
|
+
process.exit(0);
|
|
490
|
+
}
|
|
491
|
+
}
|
|
492
|
+
|
|
493
|
+
main();
|
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* SubagentStart Hook - Injects context to subagents (Optimized)
|
|
4
|
+
*
|
|
5
|
+
* Fires: When a subagent (Task tool call) is started
|
|
6
|
+
* Purpose: Inject minimal context using env vars from SessionStart
|
|
7
|
+
* Target: ~200 tokens (down from ~350)
|
|
8
|
+
*
|
|
9
|
+
* Exit Codes:
|
|
10
|
+
* 0 - Success (non-blocking, allows continuation)
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
const fs = require('fs');
|
|
14
|
+
const {
|
|
15
|
+
loadConfig,
|
|
16
|
+
resolveNamingPattern,
|
|
17
|
+
getGitBranch,
|
|
18
|
+
resolvePlanPath,
|
|
19
|
+
getReportsPath,
|
|
20
|
+
normalizePath
|
|
21
|
+
} = require('./lib/ck-config-utils.cjs');
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* Get agent-specific context from config
|
|
25
|
+
*/
|
|
26
|
+
function getAgentContext(agentType, config) {
|
|
27
|
+
const agentConfig = config.subagent?.agents?.[agentType];
|
|
28
|
+
if (!agentConfig?.contextPrefix) return null;
|
|
29
|
+
return agentConfig.contextPrefix;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* Build trust verification section if enabled
|
|
34
|
+
*/
|
|
35
|
+
function buildTrustVerification(config) {
|
|
36
|
+
if (!config.trust?.enabled || !config.trust?.passphrase) return [];
|
|
37
|
+
return [
|
|
38
|
+
``,
|
|
39
|
+
`## Trust Verification`,
|
|
40
|
+
`Passphrase: "${config.trust.passphrase}"`
|
|
41
|
+
];
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* Main hook execution
|
|
46
|
+
*/
|
|
47
|
+
async function main() {
|
|
48
|
+
try {
|
|
49
|
+
const stdin = fs.readFileSync(0, 'utf-8').trim();
|
|
50
|
+
if (!stdin) process.exit(0);
|
|
51
|
+
|
|
52
|
+
const payload = JSON.parse(stdin);
|
|
53
|
+
const agentType = payload.agent_type || 'unknown';
|
|
54
|
+
const agentId = payload.agent_id || 'unknown';
|
|
55
|
+
|
|
56
|
+
// Load config for trust verification, naming, and agent-specific context
|
|
57
|
+
const config = loadConfig({ includeProject: false, includeAssertions: false });
|
|
58
|
+
|
|
59
|
+
// Compute naming pattern directly (don't rely on env vars which may not propagate)
|
|
60
|
+
const gitBranch = getGitBranch();
|
|
61
|
+
const namePattern = resolveNamingPattern(config.plan, gitBranch);
|
|
62
|
+
|
|
63
|
+
// Resolve plan and reports path
|
|
64
|
+
const resolved = resolvePlanPath(null, config);
|
|
65
|
+
const reportsPath = getReportsPath(resolved.path, resolved.resolvedBy, config.plan, config.paths);
|
|
66
|
+
const activePlan = resolved.resolvedBy === 'session' ? resolved.path : '';
|
|
67
|
+
const suggestedPlan = resolved.resolvedBy === 'branch' ? resolved.path : '';
|
|
68
|
+
const plansPath = normalizePath(config.paths?.plans) || 'plans';
|
|
69
|
+
const docsPath = normalizePath(config.paths?.docs) || 'docs';
|
|
70
|
+
const thinkingLanguage = config.locale?.thinkingLanguage || '';
|
|
71
|
+
const responseLanguage = config.locale?.responseLanguage || '';
|
|
72
|
+
// Auto-default thinkingLanguage to 'en' when only responseLanguage is set
|
|
73
|
+
const effectiveThinking = thinkingLanguage || (responseLanguage ? 'en' : '');
|
|
74
|
+
|
|
75
|
+
// Build compact context (~200 tokens)
|
|
76
|
+
const lines = [];
|
|
77
|
+
|
|
78
|
+
// Subagent identification
|
|
79
|
+
lines.push(`## Subagent: ${agentType}`);
|
|
80
|
+
lines.push(`ID: ${agentId} | CWD: ${payload.cwd || process.cwd()}`);
|
|
81
|
+
lines.push(``);
|
|
82
|
+
|
|
83
|
+
// Plan context (from env vars)
|
|
84
|
+
lines.push(`## Context`);
|
|
85
|
+
if (activePlan) {
|
|
86
|
+
lines.push(`- Plan: ${activePlan}`);
|
|
87
|
+
} else if (suggestedPlan) {
|
|
88
|
+
lines.push(`- Plan: none | Suggested: ${suggestedPlan}`);
|
|
89
|
+
} else {
|
|
90
|
+
lines.push(`- Plan: none`);
|
|
91
|
+
}
|
|
92
|
+
lines.push(`- Reports: ${reportsPath}`);
|
|
93
|
+
lines.push(`- Paths: ${plansPath}/ | ${docsPath}/`);
|
|
94
|
+
lines.push(``);
|
|
95
|
+
|
|
96
|
+
// Language (thinking + response, if configured)
|
|
97
|
+
const hasThinking = effectiveThinking && effectiveThinking !== responseLanguage;
|
|
98
|
+
if (hasThinking || responseLanguage) {
|
|
99
|
+
lines.push(`## Language`);
|
|
100
|
+
if (hasThinking) {
|
|
101
|
+
lines.push(`- Thinking: Use ${effectiveThinking} for reasoning (logic, precision).`);
|
|
102
|
+
}
|
|
103
|
+
if (responseLanguage) {
|
|
104
|
+
lines.push(`- Response: Respond in ${responseLanguage} (natural, fluent).`);
|
|
105
|
+
}
|
|
106
|
+
lines.push(``);
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
// Core rules (minimal)
|
|
110
|
+
lines.push(`## Rules`);
|
|
111
|
+
lines.push(`- Follow: .claude/workflows/development-rules.md`);
|
|
112
|
+
lines.push(`- Reports → ${reportsPath}`);
|
|
113
|
+
lines.push(`- YAGNI / KISS / DRY`);
|
|
114
|
+
lines.push(`- **Class Responsibility:** Logic in LOWEST layer (Model > Service > Component). Mapping → Command/DTO. Constants → Model.`);
|
|
115
|
+
lines.push(`- Concise, list unresolved Qs at end`);
|
|
116
|
+
|
|
117
|
+
// Naming templates (computed directly for reliable injection)
|
|
118
|
+
lines.push(``);
|
|
119
|
+
lines.push(`## Naming`);
|
|
120
|
+
lines.push(`- Report: ${reportsPath}${agentType}-${namePattern}.md`);
|
|
121
|
+
lines.push(`- Plan dir: ${plansPath}/${namePattern}/`);
|
|
122
|
+
|
|
123
|
+
// Trust verification (if enabled)
|
|
124
|
+
lines.push(...buildTrustVerification(config));
|
|
125
|
+
|
|
126
|
+
// Agent-specific context (if configured)
|
|
127
|
+
const agentContext = getAgentContext(agentType, config);
|
|
128
|
+
if (agentContext) {
|
|
129
|
+
lines.push(``);
|
|
130
|
+
lines.push(`## Agent Instructions`);
|
|
131
|
+
lines.push(agentContext);
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
// CRITICAL: SubagentStart requires hookSpecificOutput.additionalContext format
|
|
135
|
+
const output = {
|
|
136
|
+
hookSpecificOutput: {
|
|
137
|
+
hookEventName: "SubagentStart",
|
|
138
|
+
additionalContext: lines.join('\n')
|
|
139
|
+
}
|
|
140
|
+
};
|
|
141
|
+
|
|
142
|
+
console.log(JSON.stringify(output));
|
|
143
|
+
process.exit(0);
|
|
144
|
+
} catch (error) {
|
|
145
|
+
console.error(`SubagentStart hook error: ${error.message}`);
|
|
146
|
+
process.exit(0); // Fail-open
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
main();
|