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,533 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json.schemastore.org/claude-code-settings.json",
|
|
3
|
+
"hooks": {
|
|
4
|
+
"PreToolUse": [
|
|
5
|
+
{
|
|
6
|
+
"matcher": "tool == \"Write\" || tool == \"Edit\"",
|
|
7
|
+
"hooks": [
|
|
8
|
+
{
|
|
9
|
+
"type": "command",
|
|
10
|
+
"command": "bash .codex/hooks/scripts/stage-blocker.sh"
|
|
11
|
+
}
|
|
12
|
+
],
|
|
13
|
+
"description": "Block Write/Edit tools during plan/verify/compound stages — only allow in implement stage"
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
"matcher": "tool == \"Bash\" && tool_input.command matches \"(npm run dev|pnpm( run)? dev|yarn dev|bun run dev)\"",
|
|
17
|
+
"hooks": [
|
|
18
|
+
{
|
|
19
|
+
"type": "command",
|
|
20
|
+
"command": "#!/bin/bash\ninput=$(cat)\ncmd=$(echo \"$input\" | jq -r '.tool_input.command // \"\"')\n\n# Block dev servers that aren't run in tmux\necho '[Hook] BLOCKED: Dev server must run in tmux for log access' >&2\necho '[Hook] Use this command instead:' >&2\necho \"[Hook] tmux new-session -d -s dev 'npm run dev'\" >&2\necho '[Hook] Then: tmux attach -t dev' >&2\nexit 1"
|
|
21
|
+
}
|
|
22
|
+
],
|
|
23
|
+
"description": "Block dev servers outside tmux - ensures you can access logs"
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
"matcher": "tool == \"Bash\" && tool_input.command matches \"(npm (install|test)|pnpm (install|test)|yarn (install|test)|bun (install|test)|cargo build|make|docker|pytest|vitest|playwright)\"",
|
|
27
|
+
"hooks": [
|
|
28
|
+
{
|
|
29
|
+
"type": "command",
|
|
30
|
+
"command": "#!/bin/bash\ninput=$(cat)\nif [ -z \"$TMUX\" ]; then\n echo '[Hook] Consider running in tmux for session persistence' >&2\n echo '[Hook] tmux new -s dev | tmux attach -t dev' >&2\nfi\necho \"$input\""
|
|
31
|
+
}
|
|
32
|
+
],
|
|
33
|
+
"description": "Reminder to use tmux for long-running commands"
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
"matcher": "tool == \"Bash\" && tool_input.command matches \"git push\"",
|
|
37
|
+
"hooks": [
|
|
38
|
+
{
|
|
39
|
+
"type": "command",
|
|
40
|
+
"command": "#!/bin/bash\necho '[Hook] Review changes before push...' >&2\nif [ -t 0 ]; then echo '[Hook] Press Enter to continue or Ctrl+C to abort...' >&2; read -r; else echo '[Hook] Non-interactive mode, proceeding...' >&2; fi"
|
|
41
|
+
}
|
|
42
|
+
],
|
|
43
|
+
"description": "Pause before git push to review changes"
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
"matcher": "tool == \"Write\" && tool_input.file_path matches \"\\\\.(md|txt)$\" && !(tool_input.file_path matches \"README\\\\.md|CLAUDE\\\\.md|AGENT\\\\.md|SKILL\\\\.md\")",
|
|
47
|
+
"hooks": [
|
|
48
|
+
{
|
|
49
|
+
"type": "command",
|
|
50
|
+
"command": "#!/bin/bash\ninput=$(cat)\nfile_path=$(echo \"$input\" | jq -r '.tool_input.file_path // \"\"')\n\nif [[ \"$file_path\" =~ \\.(md|txt)$ ]] && [[ ! \"$file_path\" =~ (README|CLAUDE|AGENT|SKILL)\\.md$ ]]; then\n echo \"[Hook] BLOCKED: Unnecessary documentation file creation\" >&2\n echo \"[Hook] File: $file_path\" >&2\n echo \"[Hook] Use README.md or AGENT.md for documentation instead\" >&2\n exit 1\nfi\n\necho \"$input\""
|
|
51
|
+
}
|
|
52
|
+
],
|
|
53
|
+
"description": "Block creation of random .md files - keeps docs consolidated"
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
"matcher": "tool == \"Edit\" || tool == \"Write\"",
|
|
57
|
+
"hooks": [
|
|
58
|
+
{
|
|
59
|
+
"type": "command",
|
|
60
|
+
"command": "#!/bin/bash\nCOUNTER_FILE=\"/tmp/.codex-tool-count-$PPID\"\nTHRESHOLD=${COMPACT_THRESHOLD:-50}\nif [ -f \"$COUNTER_FILE\" ]; then COUNT=$(cat \"$COUNTER_FILE\"); COUNT=$((COUNT + 1)); else COUNT=1; fi\necho \"$COUNT\" > \"$COUNTER_FILE\"\nif [ \"$COUNT\" -eq \"$THRESHOLD\" ]; then echo '[StrategicCompact] Reached '$THRESHOLD' tool calls' >&2; echo '[StrategicCompact] Consider /compact if at a logical breakpoint' >&2; fi\nif [ \"$COUNT\" -gt \"$THRESHOLD\" ] && [ $(((COUNT - THRESHOLD) % 25)) -eq 0 ]; then echo \"[StrategicCompact] $COUNT tool calls - /compact reminder\" >&2; fi\ncat"
|
|
61
|
+
}
|
|
62
|
+
],
|
|
63
|
+
"description": "Suggest manual compaction at logical intervals"
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
"matcher": "tool == \"Edit\"",
|
|
67
|
+
"hooks": [
|
|
68
|
+
{
|
|
69
|
+
"type": "command",
|
|
70
|
+
"command": "bash .codex/hooks/scripts/content-hash-validator.sh"
|
|
71
|
+
}
|
|
72
|
+
],
|
|
73
|
+
"description": "Validate file content hash before Edit — advisory staleness warning"
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
"matcher": "tool == \"Write\" || tool == \"Edit\" || tool == \"Bash\"",
|
|
77
|
+
"hooks": [
|
|
78
|
+
{
|
|
79
|
+
"type": "command",
|
|
80
|
+
"command": "bash .codex/hooks/scripts/schema-validator.sh"
|
|
81
|
+
}
|
|
82
|
+
],
|
|
83
|
+
"description": "Schema-based tool input validation — Phase 1 advisory only"
|
|
84
|
+
},
|
|
85
|
+
{
|
|
86
|
+
"matcher": "tool == \"Bash\"",
|
|
87
|
+
"hooks": [
|
|
88
|
+
{
|
|
89
|
+
"type": "command",
|
|
90
|
+
"command": "bash .codex/hooks/scripts/rtk-intercept.sh"
|
|
91
|
+
}
|
|
92
|
+
],
|
|
93
|
+
"description": "RTK auto-intercept — transparently rewrites CLI commands through RTK proxy when available (R015 advisory)"
|
|
94
|
+
},
|
|
95
|
+
{
|
|
96
|
+
"matcher": "tool == \"Bash\" && tool_input.command matches \"(rm|git rm|mv|unlink|codex/rules)\"",
|
|
97
|
+
"hooks": [
|
|
98
|
+
{
|
|
99
|
+
"type": "command",
|
|
100
|
+
"command": "bash .codex/hooks/scripts/rule-deletion-guard.sh"
|
|
101
|
+
}
|
|
102
|
+
],
|
|
103
|
+
"description": "Block rule file deletion — requires individual user confirmation per rule (R001 safety)"
|
|
104
|
+
},
|
|
105
|
+
{
|
|
106
|
+
"matcher": "tool == \"Task\" || tool == \"Agent\"",
|
|
107
|
+
"hooks": [
|
|
108
|
+
{
|
|
109
|
+
"type": "command",
|
|
110
|
+
"command": "#!/bin/bash\ninput=$(cat)\nagent_type=$(echo \"$input\" | jq -r '.tool_input.subagent_type // \"unknown\"')\nmodel=$(echo \"$input\" | jq -r '.tool_input.model // \"inherit\"')\ndesc=$(echo \"$input\" | jq -r '.tool_input.description // \"\"' | head -c 40)\nresume=$(echo \"$input\" | jq -r '.tool_input.resume // empty')\nif [ -n \"$resume\" ]; then\n echo \"─── [Resume] ${agent_type}:${model} | ${desc} ───\" >&2\nelse\n echo \"─── [Spawn] ${agent_type}:${model} | ${desc} ───\" >&2\nfi\necho \"$input\""
|
|
111
|
+
},
|
|
112
|
+
{
|
|
113
|
+
"type": "command",
|
|
114
|
+
"command": "bash .codex/hooks/scripts/git-delegation-guard.sh"
|
|
115
|
+
},
|
|
116
|
+
{
|
|
117
|
+
"type": "command",
|
|
118
|
+
"command": "bash .codex/hooks/scripts/agent-teams-advisor.sh"
|
|
119
|
+
},
|
|
120
|
+
{
|
|
121
|
+
"type": "command",
|
|
122
|
+
"command": "bash .codex/hooks/scripts/model-escalation-advisor.sh"
|
|
123
|
+
}
|
|
124
|
+
],
|
|
125
|
+
"description": "HUD statusline + R010 git delegation guard + R018 Agent Teams advisor on Agent/Task spawn"
|
|
126
|
+
}
|
|
127
|
+
],
|
|
128
|
+
"SessionStart": [
|
|
129
|
+
{
|
|
130
|
+
"matcher": "*",
|
|
131
|
+
"hooks": [
|
|
132
|
+
{
|
|
133
|
+
"type": "command",
|
|
134
|
+
"command": ".codex/hooks/scripts/omcodex-auto-update.sh"
|
|
135
|
+
}
|
|
136
|
+
],
|
|
137
|
+
"description": "Interactive oh-my-customcodex update check at session start (#752)"
|
|
138
|
+
},
|
|
139
|
+
{
|
|
140
|
+
"matcher": "*",
|
|
141
|
+
"hooks": [
|
|
142
|
+
{
|
|
143
|
+
"type": "command",
|
|
144
|
+
"command": "bash .codex/hooks/scripts/session-env-check.sh"
|
|
145
|
+
}
|
|
146
|
+
],
|
|
147
|
+
"description": "Check codex CLI and Agent Teams availability at session start"
|
|
148
|
+
},
|
|
149
|
+
{
|
|
150
|
+
"matcher": "*",
|
|
151
|
+
"hooks": [
|
|
152
|
+
{
|
|
153
|
+
"type": "command",
|
|
154
|
+
"command": "bash .codex/hooks/scripts/stale-todo-scanner.sh"
|
|
155
|
+
}
|
|
156
|
+
],
|
|
157
|
+
"description": "Scan TODO.md files for stale items at session start"
|
|
158
|
+
},
|
|
159
|
+
{
|
|
160
|
+
"matcher": "*",
|
|
161
|
+
"hooks": [
|
|
162
|
+
{
|
|
163
|
+
"type": "command",
|
|
164
|
+
"command": "bash .codex/hooks/scripts/adaptive-harness-scan.sh"
|
|
165
|
+
}
|
|
166
|
+
],
|
|
167
|
+
"description": "Lightweight project profile staleness check for adaptive harness (#831)"
|
|
168
|
+
},
|
|
169
|
+
{
|
|
170
|
+
"matcher": "*",
|
|
171
|
+
"hooks": [
|
|
172
|
+
{
|
|
173
|
+
"type": "command",
|
|
174
|
+
"command": "bash .codex/hooks/scripts/session-autofix.sh"
|
|
175
|
+
}
|
|
176
|
+
],
|
|
177
|
+
"description": "Auto-detect and fix previous session issues at start (#838)"
|
|
178
|
+
}
|
|
179
|
+
],
|
|
180
|
+
"UserPromptSubmit": [
|
|
181
|
+
{
|
|
182
|
+
"matcher": "*",
|
|
183
|
+
"hooks": [
|
|
184
|
+
{
|
|
185
|
+
"type": "command",
|
|
186
|
+
"command": "bash .codex/hooks/scripts/user-prompt-preprocessor.sh"
|
|
187
|
+
}
|
|
188
|
+
],
|
|
189
|
+
"description": "Advisory pre-processing of user input — skill matching hints and intent analysis"
|
|
190
|
+
},
|
|
191
|
+
{
|
|
192
|
+
"matcher": "*",
|
|
193
|
+
"hooks": [
|
|
194
|
+
{
|
|
195
|
+
"type": "prompt",
|
|
196
|
+
"command": "bash .codex/hooks/scripts/session-autofix-prompt.sh"
|
|
197
|
+
}
|
|
198
|
+
],
|
|
199
|
+
"description": "Inject session auto-fix findings into first user prompt (#838)"
|
|
200
|
+
}
|
|
201
|
+
],
|
|
202
|
+
"SubagentStart": [
|
|
203
|
+
{
|
|
204
|
+
"matcher": "*",
|
|
205
|
+
"hooks": [
|
|
206
|
+
{
|
|
207
|
+
"type": "command",
|
|
208
|
+
"command": "#!/bin/bash\ninput=$(cat)\nagent_type=$(echo \"$input\" | jq -r '.agent_type // \"unknown\"')\nmodel=$(echo \"$input\" | jq -r '.model // \"inherit\"')\ndesc=$(echo \"$input\" | jq -r '.description // \"\"' | head -c 40)\necho \"─── [SubagentStart] ${agent_type}:${model} | ${desc} ───\" >&2\necho \"$input\""
|
|
209
|
+
},
|
|
210
|
+
{
|
|
211
|
+
"type": "command",
|
|
212
|
+
"command": "bash .codex/hooks/scripts/agent-start-recorder.sh"
|
|
213
|
+
}
|
|
214
|
+
],
|
|
215
|
+
"description": "HUD display + agent start time recording for stall detection (R009)"
|
|
216
|
+
}
|
|
217
|
+
],
|
|
218
|
+
"SubagentStop": [
|
|
219
|
+
{
|
|
220
|
+
"matcher": "*",
|
|
221
|
+
"hooks": [
|
|
222
|
+
{
|
|
223
|
+
"type": "command",
|
|
224
|
+
"command": "bash .codex/hooks/scripts/task-outcome-recorder.sh"
|
|
225
|
+
},
|
|
226
|
+
{
|
|
227
|
+
"type": "command",
|
|
228
|
+
"command": "bash .codex/hooks/scripts/stall-detection-advisor.sh"
|
|
229
|
+
},
|
|
230
|
+
{
|
|
231
|
+
"type": "command",
|
|
232
|
+
"command": "bash .codex/hooks/scripts/auto-continue-guard.sh"
|
|
233
|
+
},
|
|
234
|
+
{
|
|
235
|
+
"type": "prompt",
|
|
236
|
+
"prompt": "A background subagent just completed. Check if there are pending workflow steps that depend on this result. If the previous subagent FAILED, do NOT auto-continue — report the failure and wait for user input. If the previous step succeeded and there are pending steps, proceed automatically. If no pending steps, report results and wait. Safety: The file /tmp/.codex-loop-count-$PPID tracks auto-continue count. After 3 consecutive auto-continues without user interaction, pause and ask the user before proceeding."
|
|
237
|
+
}
|
|
238
|
+
],
|
|
239
|
+
"description": "Record agent outcomes + auto-continue workflow on subagent completion"
|
|
240
|
+
}
|
|
241
|
+
],
|
|
242
|
+
"CwdChanged": [
|
|
243
|
+
{
|
|
244
|
+
"matcher": "*",
|
|
245
|
+
"hooks": [
|
|
246
|
+
{
|
|
247
|
+
"type": "command",
|
|
248
|
+
"command": "bash .codex/hooks/scripts/cwd-change-detector.sh"
|
|
249
|
+
}
|
|
250
|
+
],
|
|
251
|
+
"description": "Auto-detect project type on working directory change (v2.1.83+)"
|
|
252
|
+
}
|
|
253
|
+
],
|
|
254
|
+
"FileChanged": [
|
|
255
|
+
{
|
|
256
|
+
"matcher": "*",
|
|
257
|
+
"hooks": [
|
|
258
|
+
{
|
|
259
|
+
"type": "command",
|
|
260
|
+
"command": "bash .codex/hooks/scripts/file-change-validator.sh"
|
|
261
|
+
}
|
|
262
|
+
],
|
|
263
|
+
"description": "Validate externally modified files — advisory staleness warning (v2.1.83+)"
|
|
264
|
+
}
|
|
265
|
+
],
|
|
266
|
+
"Notification": [
|
|
267
|
+
{
|
|
268
|
+
"matcher": "*",
|
|
269
|
+
"hooks": [
|
|
270
|
+
{
|
|
271
|
+
"type": "command",
|
|
272
|
+
"command": "#!/bin/bash\ninput=$(cat)\nmsg=$(echo \"$input\" | jq -r '.message // \"\"' 2>/dev/null)\nif [ -n \"$msg\" ]; then\n echo \"[Hook] Notification: $msg\" >&2\nfi\necho \"$input\""
|
|
273
|
+
}
|
|
274
|
+
],
|
|
275
|
+
"description": "Display notifications for long-running operation completions"
|
|
276
|
+
}
|
|
277
|
+
],
|
|
278
|
+
"TeammateIdle": [
|
|
279
|
+
{
|
|
280
|
+
"matcher": "*",
|
|
281
|
+
"hooks": [
|
|
282
|
+
{
|
|
283
|
+
"type": "command",
|
|
284
|
+
"command": "#!/bin/bash\ninput=$(cat)\nteammate=$(echo \"$input\" | jq -r '.teammate_id // \"unknown\"' 2>/dev/null)\necho \"[Hook] TeammateIdle: $teammate — available for reassignment\" >&2\necho \"$input\""
|
|
285
|
+
}
|
|
286
|
+
],
|
|
287
|
+
"description": "Track idle Agent Teams members for work reassignment"
|
|
288
|
+
}
|
|
289
|
+
],
|
|
290
|
+
"TaskCreated": [
|
|
291
|
+
{
|
|
292
|
+
"matcher": "*",
|
|
293
|
+
"hooks": [
|
|
294
|
+
{
|
|
295
|
+
"type": "command",
|
|
296
|
+
"command": "#!/bin/bash\ninput=$(cat)\ntask_id=$(echo \"$input\" | jq -r '.task_id // \"\"' 2>/dev/null)\ndesc=$(echo \"$input\" | jq -r '.description // \"\"' 2>/dev/null | head -c 60)\necho \"[Hook] TaskCreated: $task_id — $desc\" >&2\necho \"$input\""
|
|
297
|
+
}
|
|
298
|
+
],
|
|
299
|
+
"description": "Log task creation events for Agent Teams coordination"
|
|
300
|
+
}
|
|
301
|
+
],
|
|
302
|
+
"TaskCompleted": [
|
|
303
|
+
{
|
|
304
|
+
"matcher": "*",
|
|
305
|
+
"hooks": [
|
|
306
|
+
{
|
|
307
|
+
"type": "command",
|
|
308
|
+
"command": "#!/bin/bash\ninput=$(cat)\ntask_id=$(echo \"$input\" | jq -r '.task_id // \"\"' 2>/dev/null)\nresult=$(echo \"$input\" | jq -r '.result // \"\"' 2>/dev/null | head -c 60)\necho \"[Hook] TaskCompleted: $task_id — $result\" >&2\necho \"$input\""
|
|
309
|
+
}
|
|
310
|
+
],
|
|
311
|
+
"description": "Log task completion events for Agent Teams coordination"
|
|
312
|
+
}
|
|
313
|
+
],
|
|
314
|
+
"PreCompact": [
|
|
315
|
+
{
|
|
316
|
+
"matcher": "*",
|
|
317
|
+
"hooks": [
|
|
318
|
+
{
|
|
319
|
+
"type": "command",
|
|
320
|
+
"command": "bash .codex/hooks/scripts/task-state-precompact.sh"
|
|
321
|
+
}
|
|
322
|
+
],
|
|
323
|
+
"description": "Serialize active task state before compaction — pairs with PostCompact restore (#922)"
|
|
324
|
+
}
|
|
325
|
+
],
|
|
326
|
+
"PostCompact": [
|
|
327
|
+
{
|
|
328
|
+
"matcher": "*",
|
|
329
|
+
"hooks": [
|
|
330
|
+
{
|
|
331
|
+
"type": "prompt",
|
|
332
|
+
"prompt": "Context compacted. RULES ACTIVE.\n\nR007: next response MUST start with ┌─ Agent: codex (default) / └─ Task: {task}\nR008: before EVERY tool call → [claude][model] → Tool: Name / Target: path\nR010: write→delegate to subagent; orchestrator read-only (Read/Glob/Grep); git→mgr-gitnerd\nR009: 2+ independent tasks → parallel agents, same message\nR018: 3+ agents OR review cycle → Agent Teams\nR000: user communication in Korean (한국어); code/files in English — NON-NEGOTIABLE\nR001: prohibited actions (no secrets, no system files, no rm -rf); stop on violation → preserve state → report → wait\nR002: tool tiers (Read/Grep=free, Write/Edit=notify, Bash=approval); no writes outside project; no .env/.git/config\n\nAutonomous mode: if /tmp/.codex-autonomous-$PPID exists → simple git (add/commit/push) may run directly; Write/Edit still delegates.\nbypassPermissions does NOT persist across compaction — re-enable if tasks seem blocked.\n\nTask state restore: if /tmp/.codex-task-state-$PPID.json exists, read it to recover active pipeline, dev stage, and autonomous mode state. This was saved by PreCompact hook.\n\nRe-read AGENTS.md NOW."
|
|
333
|
+
}
|
|
334
|
+
],
|
|
335
|
+
"description": "Reinforce enforced rules after context compaction — prevents rule amnesia (v2.1.76+)"
|
|
336
|
+
}
|
|
337
|
+
],
|
|
338
|
+
"PostToolUse": [
|
|
339
|
+
{
|
|
340
|
+
"matcher": "tool == \"Bash\"",
|
|
341
|
+
"hooks": [
|
|
342
|
+
{
|
|
343
|
+
"type": "command",
|
|
344
|
+
"command": "#!/bin/bash\ninput=$(cat)\ncmd=$(echo \"$input\" | jq -r '.tool_input.command')\n\nif echo \"$cmd\" | grep -qE 'gh pr create'; then\n output=$(echo \"$input\" | jq -r '.tool_output.output // \"\"')\n pr_url=$(echo \"$output\" | grep -oE 'https://github.com/[^/]+/[^/]+/pull/[0-9]+')\n \n if [ -n \"$pr_url\" ]; then\n echo \"[Hook] PR created: $pr_url\" >&2\n echo \"[Hook] Checking GitHub Actions status...\" >&2\n repo=$(echo \"$pr_url\" | sed -E 's|https://github.com/([^/]+/[^/]+)/pull/[0-9]+|\\1|')\n pr_num=$(echo \"$pr_url\" | sed -E 's|.*/pull/([0-9]+)|\\1|')\n echo \"[Hook] To review PR: gh pr review $pr_num --repo $repo\" >&2\n fi\nfi\n\necho \"$input\""
|
|
345
|
+
}
|
|
346
|
+
],
|
|
347
|
+
"description": "Log PR URL and provide review command after PR creation"
|
|
348
|
+
},
|
|
349
|
+
{
|
|
350
|
+
"matcher": "tool == \"Edit\" && tool_input.file_path matches \"\\\\.(ts|tsx|js|jsx)$\"",
|
|
351
|
+
"hooks": [
|
|
352
|
+
{
|
|
353
|
+
"type": "command",
|
|
354
|
+
"command": "#!/bin/bash\ninput=$(cat)\nfile_path=$(echo \"$input\" | jq -r '.tool_input.file_path // \"\"')\n\nif [ -n \"$file_path\" ] && [ -f \"$file_path\" ]; then\n if command -v prettier >/dev/null 2>&1; then\n prettier --write \"$file_path\" 2>&1 | head -5 >&2\n fi\nfi\n\necho \"$input\""
|
|
355
|
+
}
|
|
356
|
+
],
|
|
357
|
+
"description": "Auto-format JS/TS files with Prettier after edits"
|
|
358
|
+
},
|
|
359
|
+
{
|
|
360
|
+
"matcher": "tool == \"Edit\" && tool_input.file_path matches \"\\\\.(ts|tsx)$\"",
|
|
361
|
+
"hooks": [
|
|
362
|
+
{
|
|
363
|
+
"type": "command",
|
|
364
|
+
"command": "#!/bin/bash\ninput=$(cat)\nfile_path=$(echo \"$input\" | jq -r '.tool_input.file_path // \"\"')\n\nif [ -n \"$file_path\" ] && [ -f \"$file_path\" ]; then\n dir=$(dirname \"$file_path\")\n project_root=\"$dir\"\n while [ \"$project_root\" != \"/\" ] && [ ! -f \"$project_root/package.json\" ]; do\n project_root=$(dirname \"$project_root\")\n done\n \n if [ -f \"$project_root/tsconfig.json\" ]; then\n cd \"$project_root\" && npx tsc --noEmit --pretty false 2>&1 | grep \"$file_path\" | head -10 >&2 || true\n fi\nfi\n\necho \"$input\""
|
|
365
|
+
}
|
|
366
|
+
],
|
|
367
|
+
"description": "TypeScript check after editing .ts/.tsx files"
|
|
368
|
+
},
|
|
369
|
+
{
|
|
370
|
+
"matcher": "tool == \"Edit\" && tool_input.file_path matches \"\\\\.(ts|tsx|js|jsx)$\"",
|
|
371
|
+
"hooks": [
|
|
372
|
+
{
|
|
373
|
+
"type": "command",
|
|
374
|
+
"command": "#!/bin/bash\ninput=$(cat)\nfile_path=$(echo \"$input\" | jq -r '.tool_input.file_path // \"\"')\n\nif [ -n \"$file_path\" ] && [ -f \"$file_path\" ]; then\n console_logs=$(grep -n \"console\\\\.log\" \"$file_path\" 2>/dev/null || true)\n \n if [ -n \"$console_logs\" ]; then\n echo \"[Hook] WARNING: console.log found in $file_path\" >&2\n echo \"$console_logs\" | head -5 >&2\n echo \"[Hook] Remove console.log before committing\" >&2\n fi\nfi\n\necho \"$input\""
|
|
375
|
+
}
|
|
376
|
+
],
|
|
377
|
+
"description": "Warn about console.log statements after edits"
|
|
378
|
+
},
|
|
379
|
+
{
|
|
380
|
+
"matcher": "tool == \"Edit\" && tool_input.file_path matches \"\\\\.(go)$\"",
|
|
381
|
+
"hooks": [
|
|
382
|
+
{
|
|
383
|
+
"type": "command",
|
|
384
|
+
"command": "#!/bin/bash\ninput=$(cat)\nfile_path=$(echo \"$input\" | jq -r '.tool_input.file_path // \"\"')\n\nif [ -n \"$file_path\" ] && [ -f \"$file_path\" ]; then\n if command -v gofmt >/dev/null 2>&1; then\n gofmt -w \"$file_path\" 2>&1 >&2\n fi\nfi\n\necho \"$input\""
|
|
385
|
+
}
|
|
386
|
+
],
|
|
387
|
+
"description": "Auto-format Go files with gofmt after edits"
|
|
388
|
+
},
|
|
389
|
+
{
|
|
390
|
+
"matcher": "tool == \"Edit\" && tool_input.file_path matches \"\\\\.(py)$\"",
|
|
391
|
+
"hooks": [
|
|
392
|
+
{
|
|
393
|
+
"type": "command",
|
|
394
|
+
"command": "#!/bin/bash\ninput=$(cat)\nfile_path=$(echo \"$input\" | jq -r '.tool_input.file_path // \"\"')\n\nif [ -n \"$file_path\" ] && [ -f \"$file_path\" ]; then\n # Format with ruff\n if command -v ruff >/dev/null 2>&1; then\n ruff format --quiet \"$file_path\" 2>&1 >&2\n ruff check --fix --quiet \"$file_path\" 2>&1 >&2 || true\n echo \"[Hook] Python formatted with ruff\" >&2\n fi\nfi\n\necho \"$input\""
|
|
395
|
+
}
|
|
396
|
+
],
|
|
397
|
+
"description": "Auto-format and lint Python files with ruff after edits"
|
|
398
|
+
},
|
|
399
|
+
{
|
|
400
|
+
"matcher": "tool == \"Edit\" && tool_input.file_path matches \"\\\\.(py)$\"",
|
|
401
|
+
"hooks": [
|
|
402
|
+
{
|
|
403
|
+
"type": "command",
|
|
404
|
+
"command": "#!/bin/bash\ninput=$(cat)\nfile_path=$(echo \"$input\" | jq -r '.tool_input.file_path // \"\"')\n\nif [ -n \"$file_path\" ] && [ -f \"$file_path\" ]; then\n # Type check with ty\n if command -v ty >/dev/null 2>&1; then\n dir=$(dirname \"$file_path\")\n project_root=\"$dir\"\n while [ \"$project_root\" != \"/\" ] && [ ! -f \"$project_root/pyproject.toml\" ]; do\n project_root=$(dirname \"$project_root\")\n done\n \n if [ -f \"$project_root/pyproject.toml\" ]; then\n cd \"$project_root\" && ty check \"$file_path\" 2>&1 | head -10 >&2 || true\n else\n ty check \"$file_path\" 2>&1 | head -10 >&2 || true\n fi\n fi\nfi\n\necho \"$input\""
|
|
405
|
+
}
|
|
406
|
+
],
|
|
407
|
+
"description": "Type check Python files with ty after edits"
|
|
408
|
+
},
|
|
409
|
+
{
|
|
410
|
+
"matcher": "tool == \"Edit\" || tool == \"Write\" || tool == \"Bash\" || tool == \"Task\" || tool == \"Agent\" || tool == \"Read\" || tool == \"Glob\" || tool == \"Grep\"",
|
|
411
|
+
"hooks": [
|
|
412
|
+
{
|
|
413
|
+
"type": "command",
|
|
414
|
+
"command": "bash .codex/hooks/scripts/context-budget-advisor.sh"
|
|
415
|
+
}
|
|
416
|
+
],
|
|
417
|
+
"description": "Context budget advisor — track tool usage patterns and advise ecomode activation"
|
|
418
|
+
},
|
|
419
|
+
{
|
|
420
|
+
"matcher": "tool == \"Edit\" || tool == \"Write\" || tool == \"Bash\" || tool == \"Task\" || tool == \"Agent\"",
|
|
421
|
+
"hooks": [
|
|
422
|
+
{
|
|
423
|
+
"type": "command",
|
|
424
|
+
"command": "bash .codex/hooks/scripts/stuck-detector.sh"
|
|
425
|
+
}
|
|
426
|
+
],
|
|
427
|
+
"description": "Detect repetitive failure loops and advise recovery strategies"
|
|
428
|
+
},
|
|
429
|
+
{
|
|
430
|
+
"matcher": "tool == \"Edit\" || tool == \"Write\" || tool == \"Bash\" || tool == \"Task\" || tool == \"Agent\"",
|
|
431
|
+
"hooks": [
|
|
432
|
+
{
|
|
433
|
+
"type": "command",
|
|
434
|
+
"command": "bash .codex/hooks/scripts/cost-cap-advisor.sh"
|
|
435
|
+
}
|
|
436
|
+
],
|
|
437
|
+
"description": "Advisory cost cap monitoring — warn when session cost approaches configurable limit"
|
|
438
|
+
},
|
|
439
|
+
{
|
|
440
|
+
"matcher": "tool == \"Read\"",
|
|
441
|
+
"hooks": [
|
|
442
|
+
{
|
|
443
|
+
"type": "command",
|
|
444
|
+
"command": "bash .codex/hooks/scripts/content-hash-validator.sh"
|
|
445
|
+
}
|
|
446
|
+
],
|
|
447
|
+
"description": "Store content hashes for Read operations — enables Edit staleness detection"
|
|
448
|
+
},
|
|
449
|
+
{
|
|
450
|
+
"matcher": "tool == \"Bash\" || tool == \"Read\" || tool == \"Grep\"",
|
|
451
|
+
"hooks": [
|
|
452
|
+
{
|
|
453
|
+
"type": "command",
|
|
454
|
+
"command": "bash .codex/hooks/scripts/secret-filter.sh"
|
|
455
|
+
}
|
|
456
|
+
],
|
|
457
|
+
"description": "Detect potential secrets in Bash/Read/Grep output — advisory warning only"
|
|
458
|
+
},
|
|
459
|
+
{
|
|
460
|
+
"matcher": "tool == \"Edit\" || tool == \"Write\" || tool == \"Bash\" || tool == \"Agent\"",
|
|
461
|
+
"hooks": [
|
|
462
|
+
{
|
|
463
|
+
"type": "command",
|
|
464
|
+
"command": "bash .codex/hooks/scripts/audit-log.sh"
|
|
465
|
+
}
|
|
466
|
+
],
|
|
467
|
+
"description": "Append-only audit log for state-changing tool operations"
|
|
468
|
+
},
|
|
469
|
+
{
|
|
470
|
+
"matcher": "tool == \"Write\" || tool == \"Edit\"",
|
|
471
|
+
"hooks": [
|
|
472
|
+
{
|
|
473
|
+
"type": "command",
|
|
474
|
+
"command": "bash .codex/hooks/skill-count-reminder.sh"
|
|
475
|
+
}
|
|
476
|
+
],
|
|
477
|
+
"description": "Advisory reminder to sync skill counts in 6 locations when a SKILL.md is created/modified (R021)"
|
|
478
|
+
}
|
|
479
|
+
],
|
|
480
|
+
"Stop": [
|
|
481
|
+
{
|
|
482
|
+
"matcher": "*",
|
|
483
|
+
"hooks": [
|
|
484
|
+
{
|
|
485
|
+
"type": "command",
|
|
486
|
+
"command": "bash .codex/hooks/scripts/stop-console-audit.sh"
|
|
487
|
+
}
|
|
488
|
+
],
|
|
489
|
+
"description": "Final console.log audit and session diagnostics before session ends"
|
|
490
|
+
},
|
|
491
|
+
{
|
|
492
|
+
"matcher": "*",
|
|
493
|
+
"hooks": [
|
|
494
|
+
{
|
|
495
|
+
"type": "command",
|
|
496
|
+
"command": "bash .codex/hooks/scripts/eval-core-batch-save.sh"
|
|
497
|
+
}
|
|
498
|
+
],
|
|
499
|
+
"description": "Batch-save agent outcomes to eval-core DB on session end (advisory, exit 0)"
|
|
500
|
+
},
|
|
501
|
+
{
|
|
502
|
+
"matcher": "*",
|
|
503
|
+
"hooks": [
|
|
504
|
+
{
|
|
505
|
+
"type": "command",
|
|
506
|
+
"command": "bash .codex/hooks/scripts/feedback-collector.sh"
|
|
507
|
+
}
|
|
508
|
+
],
|
|
509
|
+
"description": "Auto-extract failure patterns from session outcomes (advisory, exit 0)"
|
|
510
|
+
},
|
|
511
|
+
{
|
|
512
|
+
"matcher": "*",
|
|
513
|
+
"hooks": [
|
|
514
|
+
{
|
|
515
|
+
"type": "command",
|
|
516
|
+
"command": "bash .codex/hooks/scripts/skill-extractor-analyzer.sh"
|
|
517
|
+
}
|
|
518
|
+
],
|
|
519
|
+
"description": "Detect reusable skill candidates from session task outcomes (advisory, exit 0)"
|
|
520
|
+
},
|
|
521
|
+
{
|
|
522
|
+
"matcher": "*",
|
|
523
|
+
"hooks": [
|
|
524
|
+
{
|
|
525
|
+
"type": "prompt",
|
|
526
|
+
"prompt": "Session-end memory checkpoint (R011 enforcement). Check if the session-end memory save workflow was completed: 1) sys-memory-keeper was delegated to update MEMORY.md 2) omx-memory save was attempted via ToolSearch + mcp__plugin_omx-memory_mcp-search__save_memory. Note: episodic-memory auto-indexes after session — no manual action needed. Decision rules (evaluate in order): 1. If session had no explicit session-end signal (quick question, no memory work): APPROVE immediately. 2. If BOTH steps were already attempted (success or failure both count): APPROVE. 3. If MCP tools unavailable after ToolSearch attempt: APPROVE with note. 4. If steps were NOT yet performed: PERFORM THEM NOW (maximum 1 attempt each): a. Delegate to sys-memory-keeper to update MEMORY.md — call Agent tool with sys-memory-keeper. b. Attempt omx-memory save — ToolSearch for save_memory tool, then call it. c. After completion (success or failure), APPROVE stop. IMPORTANT: Do NOT block indefinitely. After 1 attempt per step, always APPROVE. IMPORTANT: Do NOT loop — if you already performed these steps in this same stop hook evaluation, APPROVE."
|
|
527
|
+
}
|
|
528
|
+
],
|
|
529
|
+
"description": "Enforce R011 session-end memory saves — auto-perform if not yet done (episodic-memory auto-indexes)"
|
|
530
|
+
}
|
|
531
|
+
]
|
|
532
|
+
}
|
|
533
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
# adaptive-harness-scan.sh — Lightweight project profile staleness check
|
|
3
|
+
# Runs at SessionStart. Must complete in <2s. Advisory only (never blocks).
|
|
4
|
+
|
|
5
|
+
set -euo pipefail
|
|
6
|
+
|
|
7
|
+
PROJECT_ROOT="$(git rev-parse --show-toplevel 2>/dev/null || pwd)"
|
|
8
|
+
PROFILE="$PROJECT_ROOT/.codex/project-profile.yaml"
|
|
9
|
+
|
|
10
|
+
# Skip if this IS the oh-my-customcodex project itself (meta-project)
|
|
11
|
+
if [ -f "$PROJECT_ROOT/.codex/skills/adaptive-harness/SKILL.md" ] && \
|
|
12
|
+
[ -f "$PROJECT_ROOT/AGENTS.md" ] && \
|
|
13
|
+
grep -q "oh-my-customcodex" "$PROJECT_ROOT/AGENTS.md" 2>/dev/null; then
|
|
14
|
+
# Only check if profile exists for the meta-project
|
|
15
|
+
if [ ! -f "$PROFILE" ]; then
|
|
16
|
+
echo "[adaptive-harness] No project profile found. Run /omcodex:adaptive-harness --scan to generate." >&2
|
|
17
|
+
fi
|
|
18
|
+
exit 0
|
|
19
|
+
fi
|
|
20
|
+
|
|
21
|
+
# For non-omcodex projects
|
|
22
|
+
if [ ! -f "$PROFILE" ]; then
|
|
23
|
+
echo "[adaptive-harness] No project profile found. Run /omcodex:adaptive-harness --scan to auto-configure harness." >&2
|
|
24
|
+
exit 0
|
|
25
|
+
fi
|
|
26
|
+
|
|
27
|
+
# Check staleness: if any key project files changed since last scan
|
|
28
|
+
PROFILE_MTIME=$(stat -f "%m" "$PROFILE" 2>/dev/null || stat -c "%Y" "$PROFILE" 2>/dev/null || echo "0")
|
|
29
|
+
STALE=false
|
|
30
|
+
|
|
31
|
+
for indicator in package.json go.mod Cargo.toml requirements.txt pyproject.toml build.gradle pom.xml; do
|
|
32
|
+
if [ -f "$PROJECT_ROOT/$indicator" ]; then
|
|
33
|
+
FILE_MTIME=$(stat -f "%m" "$PROJECT_ROOT/$indicator" 2>/dev/null || stat -c "%Y" "$PROJECT_ROOT/$indicator" 2>/dev/null || echo "0")
|
|
34
|
+
if [ "$FILE_MTIME" -gt "$PROFILE_MTIME" ] 2>/dev/null; then
|
|
35
|
+
STALE=true
|
|
36
|
+
break
|
|
37
|
+
fi
|
|
38
|
+
fi
|
|
39
|
+
done
|
|
40
|
+
|
|
41
|
+
if [ "$STALE" = true ]; then
|
|
42
|
+
echo "[adaptive-harness] Project profile may be stale. Consider running /omcodex:adaptive-harness --scan" >&2
|
|
43
|
+
fi
|
|
44
|
+
|
|
45
|
+
exit 0
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
set -euo pipefail
|
|
3
|
+
|
|
4
|
+
# Agent Start Recorder
|
|
5
|
+
# Trigger: SubagentStart
|
|
6
|
+
# Purpose: Record agent spawn time for stall detection duration calculations
|
|
7
|
+
# Protocol: stdin JSON -> record start time -> stdout pass-through, exit 0 always (R021 advisory)
|
|
8
|
+
|
|
9
|
+
command -v jq >/dev/null 2>&1 || { cat; exit 0; }
|
|
10
|
+
|
|
11
|
+
input=$(cat)
|
|
12
|
+
|
|
13
|
+
agent_type=$(echo "$input" | jq -r '.agent_type // "unknown"')
|
|
14
|
+
model=$(echo "$input" | jq -r '.model // "inherit"')
|
|
15
|
+
description=$(echo "$input" | jq -r '.description // ""' | head -c 80)
|
|
16
|
+
|
|
17
|
+
AGENT_START_FILE="/tmp/.codex-agent-starts-${PPID}"
|
|
18
|
+
|
|
19
|
+
timestamp=$(date +%s)
|
|
20
|
+
|
|
21
|
+
entry=$(jq -cn \
|
|
22
|
+
--arg ts "$timestamp" \
|
|
23
|
+
--arg agent "$agent_type" \
|
|
24
|
+
--arg model "$model" \
|
|
25
|
+
--arg desc "$description" \
|
|
26
|
+
'{start_epoch: $ts, agent_type: $agent, model: $model, description: $desc}')
|
|
27
|
+
|
|
28
|
+
echo "$entry" >> "$AGENT_START_FILE"
|
|
29
|
+
|
|
30
|
+
# Ring buffer: 50 max
|
|
31
|
+
if [ -f "$AGENT_START_FILE" ]; then
|
|
32
|
+
line_count=$(wc -l < "$AGENT_START_FILE" | tr -d ' ')
|
|
33
|
+
if [ "$line_count" -gt 50 ]; then
|
|
34
|
+
tail -50 "$AGENT_START_FILE" > "${AGENT_START_FILE}.tmp"
|
|
35
|
+
mv "${AGENT_START_FILE}.tmp" "$AGENT_START_FILE"
|
|
36
|
+
fi
|
|
37
|
+
fi
|
|
38
|
+
|
|
39
|
+
echo "$input"
|
|
40
|
+
exit 0
|