oh-my-customcodex 0.1.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 +327 -0
- package/dist/cli/index.js +32054 -0
- package/dist/index.js +5469 -0
- package/package.json +89 -0
- package/templates/.claude/agents/arch-documenter.md +38 -0
- package/templates/.claude/agents/arch-speckit-agent.md +66 -0
- package/templates/.claude/agents/be-django-expert.md +47 -0
- package/templates/.claude/agents/be-express-expert.md +31 -0
- package/templates/.claude/agents/be-fastapi-expert.md +45 -0
- package/templates/.claude/agents/be-go-backend-expert.md +45 -0
- package/templates/.claude/agents/be-nestjs-expert.md +29 -0
- package/templates/.claude/agents/be-springboot-expert.md +42 -0
- package/templates/.claude/agents/db-alembic-expert.md +73 -0
- package/templates/.claude/agents/db-postgres-expert.md +38 -0
- package/templates/.claude/agents/db-redis-expert.md +38 -0
- package/templates/.claude/agents/db-supabase-expert.md +37 -0
- package/templates/.claude/agents/de-airflow-expert.md +48 -0
- package/templates/.claude/agents/de-dbt-expert.md +36 -0
- package/templates/.claude/agents/de-kafka-expert.md +83 -0
- package/templates/.claude/agents/de-pipeline-expert.md +34 -0
- package/templates/.claude/agents/de-snowflake-expert.md +38 -0
- package/templates/.claude/agents/de-spark-expert.md +38 -0
- package/templates/.claude/agents/fe-design-expert.md +120 -0
- package/templates/.claude/agents/fe-flutter-agent.md +48 -0
- package/templates/.claude/agents/fe-svelte-agent.md +33 -0
- package/templates/.claude/agents/fe-vercel-agent.md +40 -0
- package/templates/.claude/agents/fe-vuejs-agent.md +34 -0
- package/templates/.claude/agents/infra-aws-expert.md +49 -0
- package/templates/.claude/agents/infra-docker-expert.md +49 -0
- package/templates/.claude/agents/lang-golang-expert.md +46 -0
- package/templates/.claude/agents/lang-java21-expert.md +42 -0
- package/templates/.claude/agents/lang-kotlin-expert.md +45 -0
- package/templates/.claude/agents/lang-python-expert.md +45 -0
- package/templates/.claude/agents/lang-rust-expert.md +45 -0
- package/templates/.claude/agents/lang-typescript-expert.md +45 -0
- package/templates/.claude/agents/mgr-claude-code-bible.md +62 -0
- package/templates/.claude/agents/mgr-creator.md +57 -0
- package/templates/.claude/agents/mgr-gitnerd.md +50 -0
- package/templates/.claude/agents/mgr-sauron.md +163 -0
- package/templates/.claude/agents/mgr-supplier.md +39 -0
- package/templates/.claude/agents/mgr-updater.md +40 -0
- package/templates/.claude/agents/qa-engineer.md +36 -0
- package/templates/.claude/agents/qa-planner.md +78 -0
- package/templates/.claude/agents/qa-writer.md +32 -0
- package/templates/.claude/agents/sec-codeql-expert.md +56 -0
- package/templates/.claude/agents/slack-cli-expert.md +98 -0
- package/templates/.claude/agents/souls/lang-golang-expert.soul.md +21 -0
- package/templates/.claude/agents/sys-memory-keeper.md +123 -0
- package/templates/.claude/agents/sys-naggy.md +76 -0
- package/templates/.claude/agents/tool-bun-expert.md +26 -0
- package/templates/.claude/agents/tool-npm-expert.md +31 -0
- package/templates/.claude/agents/tool-optimizer.md +37 -0
- package/templates/.claude/agents/wiki-curator.md +72 -0
- package/templates/.claude/config/required-plugins.json +30 -0
- package/templates/.claude/contexts/dev.md +20 -0
- package/templates/.claude/contexts/ecomode.md +110 -0
- package/templates/.claude/contexts/index.yaml +41 -0
- package/templates/.claude/contexts/research.md +28 -0
- package/templates/.claude/contexts/review.md +23 -0
- package/templates/.claude/hooks/hooks.json +533 -0
- package/templates/.claude/hooks/scripts/adaptive-harness-scan.sh +45 -0
- package/templates/.claude/hooks/scripts/agent-start-recorder.sh +40 -0
- package/templates/.claude/hooks/scripts/agent-teams-advisor.sh +76 -0
- package/templates/.claude/hooks/scripts/audit-log.sh +64 -0
- package/templates/.claude/hooks/scripts/auto-continue-guard.sh +33 -0
- package/templates/.claude/hooks/scripts/content-hash-validator.sh +75 -0
- package/templates/.claude/hooks/scripts/context-budget-advisor.sh +107 -0
- package/templates/.claude/hooks/scripts/cost-cap-advisor.sh +71 -0
- package/templates/.claude/hooks/scripts/cwd-change-detector.sh +36 -0
- package/templates/.claude/hooks/scripts/eval-core-batch-save.sh +46 -0
- package/templates/.claude/hooks/scripts/feedback-collector.sh +92 -0
- package/templates/.claude/hooks/scripts/file-change-validator.sh +26 -0
- package/templates/.claude/hooks/scripts/git-delegation-guard.sh +57 -0
- package/templates/.claude/hooks/scripts/model-escalation-advisor.sh +106 -0
- package/templates/.claude/hooks/scripts/omcodex-auto-update.sh +4 -0
- package/templates/.claude/hooks/scripts/omcustom-auto-update.sh +177 -0
- package/templates/.claude/hooks/scripts/rtk-intercept.sh +77 -0
- package/templates/.claude/hooks/scripts/rule-deletion-guard.sh +60 -0
- package/templates/.claude/hooks/scripts/schema-validator.sh +106 -0
- package/templates/.claude/hooks/scripts/secret-filter.sh +100 -0
- package/templates/.claude/hooks/scripts/session-autofix-prompt.sh +34 -0
- package/templates/.claude/hooks/scripts/session-autofix.sh +146 -0
- package/templates/.claude/hooks/scripts/session-env-check.sh +254 -0
- package/templates/.claude/hooks/scripts/skill-extractor-analyzer.sh +49 -0
- package/templates/.claude/hooks/scripts/stage-blocker.sh +16 -0
- package/templates/.claude/hooks/scripts/stale-todo-scanner.sh +91 -0
- package/templates/.claude/hooks/scripts/stall-detection-advisor.sh +112 -0
- package/templates/.claude/hooks/scripts/stop-console-audit.sh +46 -0
- package/templates/.claude/hooks/scripts/stuck-detector.sh +199 -0
- package/templates/.claude/hooks/scripts/task-outcome-recorder.sh +119 -0
- package/templates/.claude/hooks/scripts/task-state-precompact.sh +58 -0
- package/templates/.claude/hooks/scripts/user-prompt-preprocessor.sh +32 -0
- package/templates/.claude/hooks/skill-count-reminder.sh +34 -0
- package/templates/.claude/install-hooks.sh +100 -0
- package/templates/.claude/ontology/agents.yaml +546 -0
- package/templates/.claude/ontology/graphs/agent-skill.json +102 -0
- package/templates/.claude/ontology/graphs/full-graph.json +629 -0
- package/templates/.claude/ontology/graphs/routing.json +112 -0
- package/templates/.claude/ontology/graphs/skill-rule.json +78 -0
- package/templates/.claude/ontology/rules.yaml +251 -0
- package/templates/.claude/ontology/schema.yaml +144 -0
- package/templates/.claude/ontology/skills.yaml +575 -0
- package/templates/.claude/rules/MAY-optimization.md +42 -0
- package/templates/.claude/rules/MUST-agent-design.md +340 -0
- package/templates/.claude/rules/MUST-agent-identification.md +77 -0
- package/templates/.claude/rules/MUST-agent-teams.md +293 -0
- package/templates/.claude/rules/MUST-completion-verification.md +112 -0
- package/templates/.claude/rules/MUST-continuous-improvement.md +69 -0
- package/templates/.claude/rules/MUST-enforcement-policy.md +50 -0
- package/templates/.claude/rules/MUST-intent-transparency.md +74 -0
- package/templates/.claude/rules/MUST-language-policy.md +28 -0
- package/templates/.claude/rules/MUST-orchestrator-coordination.md +399 -0
- package/templates/.claude/rules/MUST-parallel-execution.md +184 -0
- package/templates/.claude/rules/MUST-permissions.md +32 -0
- package/templates/.claude/rules/MUST-safety.md +23 -0
- package/templates/.claude/rules/MUST-sync-verification.md +145 -0
- package/templates/.claude/rules/MUST-tool-identification.md +97 -0
- package/templates/.claude/rules/SHOULD-ecomode.md +123 -0
- package/templates/.claude/rules/SHOULD-error-handling.md +33 -0
- package/templates/.claude/rules/SHOULD-hud-statusline.md +51 -0
- package/templates/.claude/rules/SHOULD-interaction.md +77 -0
- package/templates/.claude/rules/SHOULD-memory-integration.md +371 -0
- package/templates/.claude/rules/SHOULD-ontology-rag-routing.md +49 -0
- package/templates/.claude/rules/SHOULD-wiki-sync.md +73 -0
- package/templates/.claude/rules/index.yaml +141 -0
- package/templates/.claude/schemas/tool-inputs.json +62 -0
- package/templates/.claude/skills/action-validator/SKILL.md +89 -0
- package/templates/.claude/skills/adaptive-harness/SKILL.md +335 -0
- package/templates/.claude/skills/adversarial-review/SKILL.md +80 -0
- package/templates/.claude/skills/agora/SKILL.md +194 -0
- package/templates/.claude/skills/airflow-best-practices/SKILL.md +94 -0
- package/templates/.claude/skills/alembic-best-practices/SKILL.md +295 -0
- package/templates/.claude/skills/ambiguity-gate/SKILL.md +94 -0
- package/templates/.claude/skills/analysis/SKILL.md +223 -0
- package/templates/.claude/skills/audit-agents/SKILL.md +118 -0
- package/templates/.claude/skills/aws-best-practices/SKILL.md +281 -0
- package/templates/.claude/skills/claude-code-bible/SKILL.md +93 -0
- package/templates/.claude/skills/claude-code-bible/scripts/fetch-docs.js +244 -0
- package/templates/.claude/skills/claude-native/SKILL.md +215 -0
- package/templates/.claude/skills/codex-exec/SKILL.md +206 -0
- package/templates/.claude/skills/codex-exec/scripts/codex-wrapper.cjs +430 -0
- package/templates/.claude/skills/create-agent/SKILL.md +94 -0
- package/templates/.claude/skills/cve-triage/SKILL.md +91 -0
- package/templates/.claude/skills/dag-orchestration/SKILL.md +201 -0
- package/templates/.claude/skills/dbt-best-practices/SKILL.md +55 -0
- package/templates/.claude/skills/de-lead-routing/SKILL.md +230 -0
- package/templates/.claude/skills/deep-plan/SKILL.md +344 -0
- package/templates/.claude/skills/deep-verify/SKILL.md +111 -0
- package/templates/.claude/skills/dev-lead-routing/SKILL.md +161 -0
- package/templates/.claude/skills/dev-refactor/SKILL.md +234 -0
- package/templates/.claude/skills/dev-review/SKILL.md +172 -0
- package/templates/.claude/skills/django-best-practices/SKILL.md +334 -0
- package/templates/.claude/skills/docker-best-practices/SKILL.md +276 -0
- package/templates/.claude/skills/evaluator-optimizer/SKILL.md +421 -0
- package/templates/.claude/skills/fastapi-best-practices/SKILL.md +271 -0
- package/templates/.claude/skills/fix-refs/SKILL.md +109 -0
- package/templates/.claude/skills/flutter-best-practices/SKILL.md +325 -0
- package/templates/.claude/skills/gemini-exec/SKILL.md +215 -0
- package/templates/.claude/skills/gemini-exec/scripts/gemini-wrapper.cjs +485 -0
- package/templates/.claude/skills/go-backend-best-practices/SKILL.md +135 -0
- package/templates/.claude/skills/go-best-practices/SKILL.md +204 -0
- package/templates/.claude/skills/hada-scout/SKILL.md +92 -0
- package/templates/.claude/skills/harness-eval/SKILL.md +95 -0
- package/templates/.claude/skills/harness-synthesizer/SKILL.md +145 -0
- package/templates/.claude/skills/help/SKILL.md +127 -0
- package/templates/.claude/skills/idea/SKILL.md +88 -0
- package/templates/.claude/skills/impeccable-design/SKILL.md +173 -0
- package/templates/.claude/skills/intent-detection/SKILL.md +293 -0
- package/templates/.claude/skills/intent-detection/patterns/agent-triggers.yaml +438 -0
- package/templates/.claude/skills/java21-best-practices/SKILL.md +190 -0
- package/templates/.claude/skills/jinja2-prompts/SKILL.md +86 -0
- package/templates/.claude/skills/kafka-best-practices/SKILL.md +53 -0
- package/templates/.claude/skills/kotlin-best-practices/SKILL.md +257 -0
- package/templates/.claude/skills/lists/SKILL.md +80 -0
- package/templates/.claude/skills/memory-management/SKILL.md +196 -0
- package/templates/.claude/skills/memory-recall/SKILL.md +172 -0
- package/templates/.claude/skills/memory-save/SKILL.md +128 -0
- package/templates/.claude/skills/model-escalation/SKILL.md +62 -0
- package/templates/.claude/skills/monitoring-setup/SKILL.md +215 -0
- package/templates/.claude/skills/multi-model-verification/SKILL.md +130 -0
- package/templates/.claude/skills/npm-audit/SKILL.md +74 -0
- package/templates/.claude/skills/npm-publish/SKILL.md +65 -0
- package/templates/.claude/skills/npm-version/SKILL.md +104 -0
- package/templates/.claude/skills/omcodex-auto-improve/SKILL.md +136 -0
- package/templates/.claude/skills/omcodex-feedback/SKILL.md +205 -0
- package/templates/.claude/skills/omcodex-improve-report/SKILL.md +65 -0
- package/templates/.claude/skills/omcodex-loop/SKILL.md +45 -0
- package/templates/.claude/skills/omcodex-release-notes/SKILL.md +117 -0
- package/templates/.claude/skills/omcodex-takeover/SKILL.md +115 -0
- package/templates/.claude/skills/omcodex-web/SKILL.md +95 -0
- package/templates/.claude/skills/optimize-analyze/SKILL.md +57 -0
- package/templates/.claude/skills/optimize-bundle/SKILL.md +69 -0
- package/templates/.claude/skills/optimize-report/SKILL.md +76 -0
- package/templates/.claude/skills/peer-messaging/SKILL.md +59 -0
- package/templates/.claude/skills/pipeline/SKILL.md +103 -0
- package/templates/.claude/skills/pipeline-architecture-patterns/SKILL.md +84 -0
- package/templates/.claude/skills/pipeline-guards/SKILL.md +173 -0
- package/templates/.claude/skills/post-release-followup/SKILL.md +134 -0
- package/templates/.claude/skills/postgres-best-practices/SKILL.md +67 -0
- package/templates/.claude/skills/pr-auto-improve/SKILL.md +129 -0
- package/templates/.claude/skills/professor-triage/SKILL.md +321 -0
- package/templates/.claude/skills/python-best-practices/SKILL.md +223 -0
- package/templates/.claude/skills/qa-lead-routing/SKILL.md +104 -0
- package/templates/.claude/skills/react-best-practices/SKILL.md +102 -0
- package/templates/.claude/skills/reasoning-sandwich/SKILL.md +64 -0
- package/templates/.claude/skills/redis-best-practices/SKILL.md +84 -0
- package/templates/.claude/skills/release-plan/SKILL.md +207 -0
- package/templates/.claude/skills/research/SKILL.md +493 -0
- package/templates/.claude/skills/result-aggregation/SKILL.md +165 -0
- package/templates/.claude/skills/rtk-exec/SKILL.md +199 -0
- package/templates/.claude/skills/rtk-exec/scripts/rtk-wrapper.cjs +377 -0
- package/templates/.claude/skills/rust-best-practices/SKILL.md +268 -0
- package/templates/.claude/skills/sauron-watch/SKILL.md +239 -0
- package/templates/.claude/skills/scout/SKILL.md +250 -0
- package/templates/.claude/skills/sdd/SKILL.md +24 -0
- package/templates/.claude/skills/sdd-dev/SKILL.md +257 -0
- package/templates/.claude/skills/sdd-development/SKILL.md +24 -0
- package/templates/.claude/skills/secretary-routing/SKILL.md +132 -0
- package/templates/.claude/skills/skill-extractor/SKILL.md +155 -0
- package/templates/.claude/skills/skills-sh-search/SKILL.md +210 -0
- package/templates/.claude/skills/snowflake-best-practices/SKILL.md +66 -0
- package/templates/.claude/skills/spark-best-practices/SKILL.md +53 -0
- package/templates/.claude/skills/springboot-best-practices/SKILL.md +74 -0
- package/templates/.claude/skills/springboot-best-practices/examples/config-properties-example.java +22 -0
- package/templates/.claude/skills/springboot-best-practices/examples/controller-example.java +28 -0
- package/templates/.claude/skills/springboot-best-practices/examples/controller-test-example.java +33 -0
- package/templates/.claude/skills/springboot-best-practices/examples/entity-example.java +22 -0
- package/templates/.claude/skills/springboot-best-practices/examples/exception-handler-example.java +30 -0
- package/templates/.claude/skills/springboot-best-practices/examples/repository-example.java +17 -0
- package/templates/.claude/skills/springboot-best-practices/examples/repository-test-example.java +23 -0
- package/templates/.claude/skills/springboot-best-practices/examples/security-config-example.java +27 -0
- package/templates/.claude/skills/springboot-best-practices/examples/service-example.java +33 -0
- package/templates/.claude/skills/status/SKILL.md +155 -0
- package/templates/.claude/skills/structured-dev-cycle/SKILL.md +200 -0
- package/templates/.claude/skills/stuck-recovery/SKILL.md +80 -0
- package/templates/.claude/skills/supabase-postgres-best-practices/SKILL.md +100 -0
- package/templates/.claude/skills/systematic-debugging/SKILL.md +288 -0
- package/templates/.claude/skills/systematic-debugging/condition-based-waiting-example.ts +278 -0
- package/templates/.claude/skills/systematic-debugging/condition-based-waiting.md +240 -0
- package/templates/.claude/skills/systematic-debugging/defense-in-depth.md +252 -0
- package/templates/.claude/skills/systematic-debugging/find-polluter.sh +147 -0
- package/templates/.claude/skills/systematic-debugging/root-cause-tracing.md +87 -0
- package/templates/.claude/skills/task-decomposition/SKILL.md +197 -0
- package/templates/.claude/skills/typescript-best-practices/SKILL.md +322 -0
- package/templates/.claude/skills/update-docs/SKILL.md +142 -0
- package/templates/.claude/skills/update-external/SKILL.md +169 -0
- package/templates/.claude/skills/vercel-deploy/SKILL.md +75 -0
- package/templates/.claude/skills/web-design-guidelines/SKILL.md +119 -0
- package/templates/.claude/skills/wiki/SKILL.md +426 -0
- package/templates/.claude/skills/wiki-rag/SKILL.md +154 -0
- package/templates/.claude/skills/worker-reviewer-pipeline/SKILL.md +165 -0
- package/templates/.claude/skills/writing-clearly-and-concisely/SKILL.md +66 -0
- package/templates/.claude/statusline.sh +380 -0
- package/templates/.claude/uninstall-hooks.sh +52 -0
- package/templates/.github/workflows/wiki-sync.yml +132 -0
- package/templates/AGENTS.md.en +255 -0
- package/templates/AGENTS.md.ko +255 -0
- package/templates/CLAUDE.md +263 -0
- package/templates/CLAUDE.md.en +256 -0
- package/templates/CLAUDE.md.ko +256 -0
- package/templates/deprecated-files.json +10 -0
- package/templates/guides/agents-md-quality/README.md +110 -0
- package/templates/guides/airflow/README.md +47 -0
- package/templates/guides/alembic/README.md +438 -0
- package/templates/guides/aws/common-patterns.md +169 -0
- package/templates/guides/aws/index.yaml +26 -0
- package/templates/guides/aws/well-architected.md +143 -0
- package/templates/guides/cc-token-saver/README.md +97 -0
- package/templates/guides/claude-code/01-overview.md +42 -0
- package/templates/guides/claude-code/03-tools.md +107 -0
- package/templates/guides/claude-code/04-agent-skills.md +90 -0
- package/templates/guides/claude-code/05-agent-sdk.md +129 -0
- package/templates/guides/claude-code/06-mcp.md +165 -0
- package/templates/guides/claude-code/07-prompt-engineering.md +100 -0
- package/templates/guides/claude-code/08-testing.md +56 -0
- package/templates/guides/claude-code/09-guardrails.md +78 -0
- package/templates/guides/claude-code/10-monitoring.md +87 -0
- package/templates/guides/claude-code/11-sub-agents.md +159 -0
- package/templates/guides/claude-code/12-workflow-patterns.md +182 -0
- package/templates/guides/claude-code/13-cli-flags.md +151 -0
- package/templates/guides/claude-code/index.yaml +61 -0
- package/templates/guides/dbt/README.md +32 -0
- package/templates/guides/django-best-practices/README.md +476 -0
- package/templates/guides/docker/compose-best-practices.md +284 -0
- package/templates/guides/docker/dockerfile-best-practices.md +262 -0
- package/templates/guides/docker/index.yaml +26 -0
- package/templates/guides/drizzle-orm/README.md +69 -0
- package/templates/guides/elements-of-style/elements-of-style.html +2609 -0
- package/templates/guides/fastapi/best-practices.md +232 -0
- package/templates/guides/fastapi/index.yaml +21 -0
- package/templates/guides/flutter/architecture.md +141 -0
- package/templates/guides/flutter/fundamentals.md +119 -0
- package/templates/guides/flutter/index.yaml +44 -0
- package/templates/guides/flutter/performance.md +119 -0
- package/templates/guides/flutter/security.md +120 -0
- package/templates/guides/flutter/state-management.md +144 -0
- package/templates/guides/flutter/testing.md +155 -0
- package/templates/guides/git-worktree-workflow/README.md +138 -0
- package/templates/guides/go-backend/index.yaml +26 -0
- package/templates/guides/go-backend/project-layout.md +243 -0
- package/templates/guides/go-backend/uber-style.md +212 -0
- package/templates/guides/golang/concurrency.md +282 -0
- package/templates/guides/golang/effective-go.md +309 -0
- package/templates/guides/golang/error-handling.md +250 -0
- package/templates/guides/golang/index.yaml +27 -0
- package/templates/guides/hook-data-flow/README.md +135 -0
- package/templates/guides/iceberg/README.md +49 -0
- package/templates/guides/impeccable-design/color-and-contrast.md +278 -0
- package/templates/guides/impeccable-design/index.yaml +12 -0
- package/templates/guides/impeccable-design/motion-design.md +390 -0
- package/templates/guides/impeccable-design/typography.md +386 -0
- package/templates/guides/impeccable-design/ux-writing.md +400 -0
- package/templates/guides/index.yaml +265 -0
- package/templates/guides/java21/index.yaml +29 -0
- package/templates/guides/java21/java-style-guide.md +248 -0
- package/templates/guides/java21/modern-java21.md +303 -0
- package/templates/guides/kafka/README.md +32 -0
- package/templates/guides/kotlin/coding-conventions.md +247 -0
- package/templates/guides/kotlin/idioms.md +234 -0
- package/templates/guides/kotlin/index.yaml +26 -0
- package/templates/guides/multi-model-routing/README.md +101 -0
- package/templates/guides/multi-provider-exec/README.md +83 -0
- package/templates/guides/postgres/README.md +58 -0
- package/templates/guides/python/index.yaml +26 -0
- package/templates/guides/python/pep8-style-guide.md +202 -0
- package/templates/guides/python/zen-of-python.md +79 -0
- package/templates/guides/redis/README.md +50 -0
- package/templates/guides/rust/error-handling.md +262 -0
- package/templates/guides/rust/index.yaml +26 -0
- package/templates/guides/rust/ownership.md +180 -0
- package/templates/guides/skill-bundle-design/README.md +106 -0
- package/templates/guides/slack-cli/README.md +145 -0
- package/templates/guides/snowflake/README.md +32 -0
- package/templates/guides/spark/README.md +32 -0
- package/templates/guides/springboot/best-practices.md +361 -0
- package/templates/guides/springboot/index.yaml +22 -0
- package/templates/guides/supabase-postgres/README.md +32 -0
- package/templates/guides/supabase-postgres/index.yaml +19 -0
- package/templates/guides/typescript/advanced-types.md +225 -0
- package/templates/guides/typescript/index.yaml +26 -0
- package/templates/guides/typescript/type-system.md +219 -0
- package/templates/guides/web-design/accessibility.md +66 -0
- package/templates/guides/web-design/index.yaml +20 -0
- package/templates/guides/web-design/performance.md +102 -0
- package/templates/guides/web-scraping/README.md +926 -0
- package/templates/guides/web-scraping/index.yaml +19 -0
- package/templates/guides/worktree-lifecycle/README.md +104 -0
- package/templates/index.yaml +18 -0
- package/templates/manifest.json +49 -0
- package/templates/workflows/auto-dev.yaml +46 -0
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: airflow-best-practices
|
|
3
|
+
description: Apache Airflow best practices for DAG authoring, testing, and production deployment
|
|
4
|
+
scope: core
|
|
5
|
+
user-invocable: false
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# Apache Airflow Best Practices (3.1.8)
|
|
9
|
+
|
|
10
|
+
## DAG Authoring
|
|
11
|
+
|
|
12
|
+
### Imports (Airflow 3.x)
|
|
13
|
+
- Use `from airflow.sdk import DAG, task, Asset` — the stable public API
|
|
14
|
+
- Legacy `from airflow.models import DAG` and `from airflow.decorators import task` are deprecated
|
|
15
|
+
|
|
16
|
+
### Top-Level Code (CRITICAL)
|
|
17
|
+
- Avoid heavy computation at module level (executed on every DAG parse)
|
|
18
|
+
- Minimize imports at module level — lazy-load inside `@task` functions
|
|
19
|
+
- Never call APIs, query databases, or access Variables at top level
|
|
20
|
+
- If Variables needed at top level, enable experimental cache with TTL
|
|
21
|
+
|
|
22
|
+
### TaskFlow API (Default Pattern)
|
|
23
|
+
- Use `@task` decorator for all Python tasks (preferred over classic operators)
|
|
24
|
+
- XCom serialization is automatic — return values become XCom
|
|
25
|
+
- Use `@task.branch` for branching logic
|
|
26
|
+
- Use `@task.sensor` for sensor tasks
|
|
27
|
+
|
|
28
|
+
### Dynamic Task Mapping
|
|
29
|
+
- Use `task.expand()` for runtime-determined task instances
|
|
30
|
+
- Combine with `.partial()` for fixed kwargs
|
|
31
|
+
- Map over lists, dicts, or XCom outputs from upstream tasks
|
|
32
|
+
|
|
33
|
+
### Scheduling
|
|
34
|
+
- Use cron expressions or timetables for `schedule` parameter
|
|
35
|
+
- Set `catchup=False` for most DAGs
|
|
36
|
+
- Use data-aware scheduling with `Asset` (replaces `Dataset`) for dependencies
|
|
37
|
+
- Configure SLA monitoring
|
|
38
|
+
|
|
39
|
+
### Task Dependencies
|
|
40
|
+
- Use `>>` / `<<` operators for clarity
|
|
41
|
+
- Group related tasks with `TaskGroup`
|
|
42
|
+
- Avoid deep nesting (max 3 levels)
|
|
43
|
+
|
|
44
|
+
## Testing
|
|
45
|
+
|
|
46
|
+
### Local Testing
|
|
47
|
+
- Use `dag.test()` in `if __name__ == "__main__":` block for IDE debugging
|
|
48
|
+
- Runs all tasks in single serialized process without executor
|
|
49
|
+
|
|
50
|
+
### Unit Tests
|
|
51
|
+
- Test DAG import without errors
|
|
52
|
+
- Detect cycles in dependencies
|
|
53
|
+
- Mock external connections
|
|
54
|
+
- Test task logic independently
|
|
55
|
+
|
|
56
|
+
### Integration Tests
|
|
57
|
+
- Use Airflow test mode
|
|
58
|
+
- Validate end-to-end workflows
|
|
59
|
+
- Test with sample data
|
|
60
|
+
|
|
61
|
+
## Production Deployment
|
|
62
|
+
|
|
63
|
+
### Performance
|
|
64
|
+
- Lazy-load heavy libraries inside `@task` functions
|
|
65
|
+
- Use connection pooling
|
|
66
|
+
- Minimize DAG parse time (target < 30s for all DAGs)
|
|
67
|
+
- Enable parallelism appropriately
|
|
68
|
+
|
|
69
|
+
### Reliability
|
|
70
|
+
- Set appropriate `retries` and `retry_delay`
|
|
71
|
+
- Use SLA callbacks for monitoring
|
|
72
|
+
- Implement proper error handling with `on_failure_callback`
|
|
73
|
+
- Log important events
|
|
74
|
+
|
|
75
|
+
## Migration: 2.x → 3.x
|
|
76
|
+
|
|
77
|
+
### Deprecated (Remove or Replace)
|
|
78
|
+
| Deprecated | Replacement |
|
|
79
|
+
|-----------|-------------|
|
|
80
|
+
| `from airflow.models import DAG` | `from airflow.sdk import DAG` |
|
|
81
|
+
| `from airflow.decorators import task` | `from airflow.sdk import task` |
|
|
82
|
+
| `Dataset` | `Asset` |
|
|
83
|
+
| `execution_date` in context | `dag_run.logical_date` |
|
|
84
|
+
| `conf` in task context | Removed — use Variables or params |
|
|
85
|
+
|
|
86
|
+
### Architecture Changes
|
|
87
|
+
- **AIP-72**: Task Execution Interface — tasks run in isolated subprocesses via Execution API Server
|
|
88
|
+
- **AIP-44**: Internal API — components communicate via API, not direct DB access
|
|
89
|
+
- **New UI**: React-based web interface (replaces Flask-based UI)
|
|
90
|
+
|
|
91
|
+
## References
|
|
92
|
+
- [Airflow 3.1.8 Best Practices](https://airflow.apache.org/docs/apache-airflow/3.1.8/best-practices.html)
|
|
93
|
+
- [Airflow SDK (Task SDK)](https://airflow.apache.org/docs/apache-airflow/3.1.8/authoring-and-scheduling/index.html)
|
|
94
|
+
- [Migration Guide 2.x → 3.x](https://airflow.apache.org/docs/apache-airflow/3.1.8/migration-guide.html)
|
|
@@ -0,0 +1,295 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: alembic-best-practices
|
|
3
|
+
description: Alembic migration patterns for naming conventions, safety checks, expand-contract, env.py configuration, and CI integration
|
|
4
|
+
scope: core
|
|
5
|
+
version: 1.0.0
|
|
6
|
+
user-invocable: false
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# Alembic Best Practices
|
|
10
|
+
|
|
11
|
+
Reference patterns for safe, maintainable Alembic database migrations.
|
|
12
|
+
|
|
13
|
+
## 1. Naming Convention
|
|
14
|
+
|
|
15
|
+
Always set `naming_convention` on `MetaData` before autogenerate runs. Without it, constraint names are database-generated and differ across engines, causing migration drift.
|
|
16
|
+
|
|
17
|
+
```python
|
|
18
|
+
from sqlalchemy import MetaData
|
|
19
|
+
|
|
20
|
+
convention = {
|
|
21
|
+
"ix": "ix_%(column_0_label)s",
|
|
22
|
+
"uq": "uq_%(table_name)s_%(column_0_N_name)s",
|
|
23
|
+
"ck": "ck_%(table_name)s_%(constraint_name)s",
|
|
24
|
+
"fk": "fk_%(table_name)s_%(column_0_name)s_%(referred_table_name)s",
|
|
25
|
+
"pk": "pk_%(table_name)s",
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
metadata = MetaData(naming_convention=convention)
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
Set `file_template` in `alembic.ini` for timestamp-prefixed filenames:
|
|
32
|
+
|
|
33
|
+
```ini
|
|
34
|
+
file_template = %%(year)d%%(month).2d%%(day).2d_%%(hour).2d%%(minute).2d_%%(rev)s_%%(slug)s
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
## 2. Credential Management
|
|
38
|
+
|
|
39
|
+
**NEVER** store database credentials in `alembic.ini` or commit them to version control.
|
|
40
|
+
|
|
41
|
+
Override `sqlalchemy.url` in `env.py` from environment variables:
|
|
42
|
+
|
|
43
|
+
```python
|
|
44
|
+
# env.py — override alembic.ini URL with environment variable
|
|
45
|
+
import os
|
|
46
|
+
from alembic import context
|
|
47
|
+
|
|
48
|
+
config = context.config
|
|
49
|
+
db_url = os.environ.get("DATABASE_URL")
|
|
50
|
+
if db_url:
|
|
51
|
+
config.set_main_option("sqlalchemy.url", db_url)
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
For PostgreSQL + asyncpg, ensure the sync URL uses `postgresql+psycopg2` (or `postgresql`) for offline/sync contexts and `postgresql+asyncpg` only for async contexts.
|
|
55
|
+
|
|
56
|
+
## 3. Autogenerate Trust Matrix
|
|
57
|
+
|
|
58
|
+
Autogenerate is a starting point, not a final answer. Always review generated scripts.
|
|
59
|
+
|
|
60
|
+
| Object / Change | Autogenerate Detects | Notes |
|
|
61
|
+
|-----------------|----------------------|-------|
|
|
62
|
+
| Table add/drop | Yes | Reliable |
|
|
63
|
+
| Column add/drop | Yes | Reliable |
|
|
64
|
+
| Column type change | Partial | Type equivalence varies by backend |
|
|
65
|
+
| Column rename | **Never** | Generates drop+add — will destroy data |
|
|
66
|
+
| Index add/drop | Yes | Only if reflected or declared |
|
|
67
|
+
| Named constraint add/drop | Yes | Requires `naming_convention` on MetaData |
|
|
68
|
+
| Anonymous constraint | **No** | No name = no detection |
|
|
69
|
+
| Default value change | Partial | Server defaults vs client defaults differ |
|
|
70
|
+
| PostgreSQL views / functions | **No** | Use alembic-utils |
|
|
71
|
+
| PostgreSQL enum add value | Partial | Requires `alembic-postgresql-enum` |
|
|
72
|
+
| Sequence changes | No | Manual op required |
|
|
73
|
+
|
|
74
|
+
## 4. Dangerous Pattern Detection
|
|
75
|
+
|
|
76
|
+
Review every generated migration against this checklist before committing:
|
|
77
|
+
|
|
78
|
+
**CRITICAL — Review Required:**
|
|
79
|
+
|
|
80
|
+
- [ ] `op.drop_column` + `op.add_column` on the same column name → likely unintended rename; confirm with user
|
|
81
|
+
- [ ] `op.create_foreign_key(None, ...)` → anonymous FK; must have an explicit name
|
|
82
|
+
- [ ] `op.add_column` with `nullable=False` and no `server_default` on a non-empty table → full-table rewrite, lock risk
|
|
83
|
+
- [ ] `op.create_index` without `postgresql_concurrently=True` on a large table → table-level lock
|
|
84
|
+
- [ ] `op.drop_table` or `op.drop_column` → confirm there are no application references
|
|
85
|
+
- [ ] Empty `def downgrade(): pass` → document justification or implement rollback
|
|
86
|
+
- [ ] `op.alter_column` type change across incompatible types (e.g., `VARCHAR` → `INTEGER`) → data loss risk
|
|
87
|
+
|
|
88
|
+
**WARNING — Verify Intent:**
|
|
89
|
+
|
|
90
|
+
- [ ] Multiple heads detected (`alembic heads` shows 2+) → merge before deploying
|
|
91
|
+
- [ ] `batch_alter_table` missing for SQLite → required for constraint modifications on SQLite
|
|
92
|
+
- [ ] `render_as_batch=True` not set in `env.py` for SQLite projects
|
|
93
|
+
|
|
94
|
+
## 5. Expand-Contract Pattern
|
|
95
|
+
|
|
96
|
+
For zero-downtime schema changes on live tables, use three separate migration phases:
|
|
97
|
+
|
|
98
|
+
**Phase 1 — Expand** (deploy without application changes):
|
|
99
|
+
```python
|
|
100
|
+
def upgrade():
|
|
101
|
+
op.add_column("users", sa.Column("email_new", sa.String(255), nullable=True))
|
|
102
|
+
|
|
103
|
+
def downgrade():
|
|
104
|
+
op.drop_column("users", "email_new")
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
**Phase 2 — Migrate** (data backfill, can run during deploy):
|
|
108
|
+
```python
|
|
109
|
+
def upgrade():
|
|
110
|
+
op.execute("""
|
|
111
|
+
UPDATE users SET email_new = email WHERE email_new IS NULL
|
|
112
|
+
""")
|
|
113
|
+
|
|
114
|
+
def downgrade():
|
|
115
|
+
pass # Data loss acceptable; backfill was additive
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
**Phase 3 — Contract** (after all application nodes use new column):
|
|
119
|
+
```python
|
|
120
|
+
def upgrade():
|
|
121
|
+
with op.batch_alter_table("users") as batch_op:
|
|
122
|
+
batch_op.alter_column("email_new", nullable=False)
|
|
123
|
+
op.drop_column("users", "email")
|
|
124
|
+
op.alter_column("users", "email_new", new_column_name="email")
|
|
125
|
+
|
|
126
|
+
def downgrade():
|
|
127
|
+
op.add_column("users", sa.Column("email", sa.String(255), nullable=True))
|
|
128
|
+
op.execute("UPDATE users SET email = email_new WHERE email IS NULL")
|
|
129
|
+
op.drop_column("users", "email_new")
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
## 6. Async env.py
|
|
133
|
+
|
|
134
|
+
Canonical pattern for async SQLAlchemy (asyncpg) with Alembic:
|
|
135
|
+
|
|
136
|
+
```python
|
|
137
|
+
# env.py — async configuration
|
|
138
|
+
import asyncio
|
|
139
|
+
from logging.config import fileConfig
|
|
140
|
+
|
|
141
|
+
from sqlalchemy import pool
|
|
142
|
+
from sqlalchemy.ext.asyncio import async_engine_from_config
|
|
143
|
+
|
|
144
|
+
from alembic import context
|
|
145
|
+
from myapp.models import Base # Import all models here
|
|
146
|
+
|
|
147
|
+
config = context.config
|
|
148
|
+
fileConfig(config.config_file_name)
|
|
149
|
+
target_metadata = Base.metadata
|
|
150
|
+
|
|
151
|
+
|
|
152
|
+
def run_migrations_offline() -> None:
|
|
153
|
+
url = config.get_main_option("sqlalchemy.url")
|
|
154
|
+
context.configure(
|
|
155
|
+
url=url,
|
|
156
|
+
target_metadata=target_metadata,
|
|
157
|
+
literal_binds=True,
|
|
158
|
+
dialect_opts={"paramstyle": "named"},
|
|
159
|
+
)
|
|
160
|
+
with context.begin_transaction():
|
|
161
|
+
context.run_migrations()
|
|
162
|
+
|
|
163
|
+
|
|
164
|
+
def do_run_migrations(connection):
|
|
165
|
+
context.configure(connection=connection, target_metadata=target_metadata)
|
|
166
|
+
with context.begin_transaction():
|
|
167
|
+
context.run_migrations()
|
|
168
|
+
|
|
169
|
+
|
|
170
|
+
async def run_migrations_online() -> None:
|
|
171
|
+
connectable = async_engine_from_config(
|
|
172
|
+
config.get_section(config.config_ini_section, {}),
|
|
173
|
+
prefix="sqlalchemy.",
|
|
174
|
+
poolclass=pool.NullPool, # Required: avoids pool issues during migration
|
|
175
|
+
)
|
|
176
|
+
async with connectable.connect() as connection:
|
|
177
|
+
await connection.run_sync(do_run_migrations)
|
|
178
|
+
await connectable.dispose()
|
|
179
|
+
|
|
180
|
+
|
|
181
|
+
if context.is_offline_mode():
|
|
182
|
+
run_migrations_offline()
|
|
183
|
+
else:
|
|
184
|
+
asyncio.run(run_migrations_online())
|
|
185
|
+
```
|
|
186
|
+
|
|
187
|
+
Key points:
|
|
188
|
+
- Use `NullPool` — migration scripts are one-shot; pooling causes connection leaks
|
|
189
|
+
- Import ALL models in `env.py` (directly or via a central `models/__init__.py`) so autogenerate sees every table
|
|
190
|
+
- `run_sync` bridges the async connection back to Alembic's sync API
|
|
191
|
+
|
|
192
|
+
## 7. Testing with pytest-alembic
|
|
193
|
+
|
|
194
|
+
Install: `pip install pytest-alembic`
|
|
195
|
+
|
|
196
|
+
Built-in tests (all enabled by default):
|
|
197
|
+
|
|
198
|
+
```python
|
|
199
|
+
# conftest.py
|
|
200
|
+
import pytest
|
|
201
|
+
from sqlalchemy import create_engine
|
|
202
|
+
from alembic.config import Config
|
|
203
|
+
|
|
204
|
+
@pytest.fixture
|
|
205
|
+
def alembic_config():
|
|
206
|
+
return Config("alembic.ini")
|
|
207
|
+
|
|
208
|
+
@pytest.fixture
|
|
209
|
+
def alembic_engine():
|
|
210
|
+
return create_engine("postgresql://test_user:test_pass@localhost/test_db")
|
|
211
|
+
```
|
|
212
|
+
|
|
213
|
+
Built-in test assertions:
|
|
214
|
+
- `test_single_head_revision` — exactly one head revision exists
|
|
215
|
+
- `test_upgrade` — all upgrades apply without error
|
|
216
|
+
- `test_model_definitions_match_ddl` — SQLAlchemy models match the migrated schema
|
|
217
|
+
- `test_up_down_consistency` — every upgrade can be cleanly downgraded
|
|
218
|
+
|
|
219
|
+
Custom data migration test:
|
|
220
|
+
```python
|
|
221
|
+
@pytest.mark.alembic
|
|
222
|
+
def test_user_email_backfill(alembic_runner):
|
|
223
|
+
# Insert data before migration
|
|
224
|
+
alembic_runner.migrate_up_before("abc123def456")
|
|
225
|
+
alembic_runner.insert_into("users", [{"id": 1, "email": "test@example.com"}])
|
|
226
|
+
|
|
227
|
+
# Apply the migration
|
|
228
|
+
alembic_runner.migrate_up_one()
|
|
229
|
+
|
|
230
|
+
# Assert post-migration state
|
|
231
|
+
result = alembic_runner.execute("SELECT email_new FROM users WHERE id = 1")
|
|
232
|
+
assert result.scalar() == "test@example.com"
|
|
233
|
+
```
|
|
234
|
+
|
|
235
|
+
## 8. CI Integration
|
|
236
|
+
|
|
237
|
+
**Detect uncommitted migrations** — fail CI if models changed but no migration was generated:
|
|
238
|
+
|
|
239
|
+
```yaml
|
|
240
|
+
# .github/workflows/migrations.yml
|
|
241
|
+
- name: Check for pending migrations
|
|
242
|
+
run: alembic check
|
|
243
|
+
env:
|
|
244
|
+
DATABASE_URL: ${{ secrets.TEST_DATABASE_URL }}
|
|
245
|
+
```
|
|
246
|
+
|
|
247
|
+
**Squawk** — static analysis for lock-risk DDL (no live DB required):
|
|
248
|
+
|
|
249
|
+
```yaml
|
|
250
|
+
- name: Install Squawk
|
|
251
|
+
run: pip install squawk-cli # or: brew install squawk
|
|
252
|
+
|
|
253
|
+
- name: Lint migrations for lock risks
|
|
254
|
+
run: |
|
|
255
|
+
alembic upgrade head --sql > migration.sql
|
|
256
|
+
squawk migration.sql
|
|
257
|
+
```
|
|
258
|
+
|
|
259
|
+
Squawk detects: non-concurrent index creation, adding NOT NULL without default, renaming columns, dropping constraints without cascade, and other patterns that cause long locks.
|
|
260
|
+
|
|
261
|
+
## 9. Extensions
|
|
262
|
+
|
|
263
|
+
| Package | Purpose | Install |
|
|
264
|
+
|---------|---------|---------|
|
|
265
|
+
| `alembic-utils` | Replaceable PG objects: views, functions, triggers, RLS policies | `pip install alembic-utils` |
|
|
266
|
+
| `alembic-postgresql-enum` | Safe enum value additions without full table rewrites | `pip install alembic-postgresql-enum` |
|
|
267
|
+
| `audit-alembic` | Attach migration metadata to audit log tables | `pip install audit-alembic` |
|
|
268
|
+
| `sqla-utils` | Additional SQLAlchemy model utilities complementing alembic-utils | `pip install sqla-utils` |
|
|
269
|
+
|
|
270
|
+
### alembic-utils example (PostgreSQL view):
|
|
271
|
+
|
|
272
|
+
```python
|
|
273
|
+
from alembic_utils.pg_view import PGView
|
|
274
|
+
|
|
275
|
+
user_summary_view = PGView(
|
|
276
|
+
schema="public",
|
|
277
|
+
signature="user_summary",
|
|
278
|
+
definition="SELECT id, email, created_at FROM users WHERE active = true",
|
|
279
|
+
)
|
|
280
|
+
|
|
281
|
+
# In env.py — register with autogenerate
|
|
282
|
+
from alembic_utils.replaceable_entity import register_entities
|
|
283
|
+
register_entities([user_summary_view])
|
|
284
|
+
```
|
|
285
|
+
|
|
286
|
+
## 10. Common Pitfalls
|
|
287
|
+
|
|
288
|
+
| Pitfall | Symptom | Fix |
|
|
289
|
+
|---------|---------|-----|
|
|
290
|
+
| Empty `target_metadata` | Autogenerate produces empty migration | Import all models in `env.py` before `Base.metadata` is referenced |
|
|
291
|
+
| Multiple heads | `alembic upgrade head` fails with merge conflict error | Run `alembic merge heads -m "merge"` |
|
|
292
|
+
| SQLite constraint modification | `NotImplementedError` on `op.alter_column` | Use `op.batch_alter_table` context manager |
|
|
293
|
+
| asyncpg URL in offline mode | `Can't load plugin: sqlalchemy.dialects:postgresql+asyncpg` | Use sync URL (`postgresql://`) for offline mode; override only for async online mode |
|
|
294
|
+
| Missing model imports | Tables not detected by autogenerate | Add `from myapp import models` to `env.py` (not just `Base`) |
|
|
295
|
+
| `server_default` vs `default` | `server_default` needed for NOT NULL on existing rows | Use `server_default=sa.text("''")`; remove it in the Contract phase |
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: ambiguity-gate
|
|
3
|
+
description: Pre-routing ambiguity analysis — scores request clarity and asks clarifying questions when needed (inspired by ouroboros)
|
|
4
|
+
scope: core
|
|
5
|
+
user-invocable: true
|
|
6
|
+
argument-hint: "[request to analyze for ambiguity]"
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# Ambiguity Gate
|
|
10
|
+
|
|
11
|
+
## Purpose
|
|
12
|
+
|
|
13
|
+
Analyze a user request for ambiguity before routing to implementation. Inspired by the [ouroboros](https://github.com/Q00/ouroboros) Socratic interviewer pattern, this skill measures request clarity on a 0.0–1.0 scale and asks targeted clarifying questions when needed.
|
|
14
|
+
|
|
15
|
+
## Ambiguity Scoring
|
|
16
|
+
|
|
17
|
+
| Score Range | Verdict | Action |
|
|
18
|
+
|-------------|---------|--------|
|
|
19
|
+
| ≤ 0.2 | Clear | Proceed with implementation |
|
|
20
|
+
| 0.2–0.5 | Moderate | Suggest clarifications but allow proceeding |
|
|
21
|
+
| > 0.5 | High | Require clarification before proceeding |
|
|
22
|
+
|
|
23
|
+
## Scoring Factors
|
|
24
|
+
|
|
25
|
+
| Factor | Weight | Description |
|
|
26
|
+
|--------|--------|-------------|
|
|
27
|
+
| Scope clarity | 30% | Is the scope of work well-defined? |
|
|
28
|
+
| Technical specificity | 25% | Are technical requirements clear? |
|
|
29
|
+
| Acceptance criteria | 20% | Can we determine when the task is done? |
|
|
30
|
+
| Constraint clarity | 15% | Are constraints and limitations specified? |
|
|
31
|
+
| Context sufficiency | 10% | Is there enough context to proceed? |
|
|
32
|
+
|
|
33
|
+
**Composite score** = weighted sum of individual factor scores (each 0.0–1.0, inverted: 0.0 = clear, 1.0 = ambiguous).
|
|
34
|
+
|
|
35
|
+
## Output Format
|
|
36
|
+
|
|
37
|
+
```
|
|
38
|
+
[Ambiguity Analysis]
|
|
39
|
+
├── Score: {0.0-1.0}
|
|
40
|
+
├── Verdict: {Clear | Moderate | High}
|
|
41
|
+
├── Breakdown:
|
|
42
|
+
│ ├── Scope: {score} — {reason}
|
|
43
|
+
│ ├── Technical: {score} — {reason}
|
|
44
|
+
│ ├── Acceptance: {score} — {reason}
|
|
45
|
+
│ ├── Constraints: {score} — {reason}
|
|
46
|
+
│ └── Context: {score} — {reason}
|
|
47
|
+
└── Suggestions: {clarifying questions if score > 0.2}
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
## Workflow
|
|
51
|
+
|
|
52
|
+
1. Receive the request to analyze (from `$ARGUMENTS` or conversation context)
|
|
53
|
+
2. Score each factor independently
|
|
54
|
+
3. Compute weighted composite score
|
|
55
|
+
4. Determine verdict based on threshold
|
|
56
|
+
5. If score > 0.2: generate targeted clarifying questions (max 3, prioritized by highest-weight ambiguous factors)
|
|
57
|
+
6. If score > 0.5: do NOT proceed to implementation; present analysis and wait for clarification
|
|
58
|
+
7. If score ≤ 0.2: output analysis and proceed
|
|
59
|
+
|
|
60
|
+
## Clarifying Question Guidelines
|
|
61
|
+
|
|
62
|
+
- Ask **one question per ambiguous factor** (max 3 total)
|
|
63
|
+
- Order by factor weight (scope → technical → acceptance criteria)
|
|
64
|
+
- Make questions specific and answerable
|
|
65
|
+
- Avoid yes/no questions; prefer open-ended with examples
|
|
66
|
+
|
|
67
|
+
**Example questions:**
|
|
68
|
+
- Scope: "Should this change affect all environments or only development?"
|
|
69
|
+
- Technical: "What language/framework should this be implemented in?"
|
|
70
|
+
- Acceptance: "What would a passing test look like for this feature?"
|
|
71
|
+
- Constraints: "Are there performance or memory constraints to consider?"
|
|
72
|
+
- Context: "Is this a new feature or modifying existing behavior?"
|
|
73
|
+
|
|
74
|
+
## Integration
|
|
75
|
+
|
|
76
|
+
This skill can be:
|
|
77
|
+
- **Invoked manually**: `/ambiguity-gate [request]` — analyze a specific request
|
|
78
|
+
- **Integrated into routing skills**: Insert as a pre-check step before agent delegation when request complexity warrants it
|
|
79
|
+
|
|
80
|
+
Routing skill integration example:
|
|
81
|
+
```
|
|
82
|
+
1. Run ambiguity-gate on user request
|
|
83
|
+
2. If score > 0.5: surface questions, wait for response, re-run gate
|
|
84
|
+
3. If score ≤ 0.5: proceed with normal routing
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
## When NOT to Use
|
|
88
|
+
|
|
89
|
+
Skip this skill for:
|
|
90
|
+
- Simple, one-line questions ("What does X do?")
|
|
91
|
+
- One-line fixes with clear scope ("Fix the typo in line 42")
|
|
92
|
+
- Well-defined bug reports with reproduction steps and expected behavior
|
|
93
|
+
- Requests with explicit acceptance criteria already stated
|
|
94
|
+
- Follow-up requests that clarify a previous ambiguous request
|