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,165 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: worker-reviewer-pipeline
|
|
3
|
+
description: Worker-Reviewer iterative pipeline for quality-critical code with review cycles
|
|
4
|
+
scope: core
|
|
5
|
+
context: fork
|
|
6
|
+
user-invocable: false
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# Worker-Reviewer Pipeline Skill
|
|
10
|
+
|
|
11
|
+
Defines an iterative Worker→Reviewer pipeline where one agent implements changes and another reviews them. The cycle repeats until quality criteria are met or max iterations reached.
|
|
12
|
+
|
|
13
|
+
**Orchestrator-only** — only the main conversation activates this pipeline (R010). Worker and Reviewer are subagents.
|
|
14
|
+
|
|
15
|
+
## When to Activate
|
|
16
|
+
|
|
17
|
+
| Condition | Activate? |
|
|
18
|
+
|-----------|-----------|
|
|
19
|
+
| Quality-critical code changes (auth, security, payments) | Yes |
|
|
20
|
+
| Complex refactoring touching 5+ files | Yes |
|
|
21
|
+
| User explicitly requests review cycle | Yes |
|
|
22
|
+
| Simple file edits, config changes | No |
|
|
23
|
+
| Documentation-only changes | No |
|
|
24
|
+
|
|
25
|
+
## Pipeline Spec Format
|
|
26
|
+
|
|
27
|
+
```yaml
|
|
28
|
+
pipeline:
|
|
29
|
+
name: feature-review
|
|
30
|
+
description: Implement and review a feature
|
|
31
|
+
|
|
32
|
+
worker:
|
|
33
|
+
agent: lang-typescript-expert # or appropriate specialist
|
|
34
|
+
model: sonnet
|
|
35
|
+
prompt: "Implement the feature based on requirements"
|
|
36
|
+
|
|
37
|
+
reviewer:
|
|
38
|
+
agent: lang-typescript-expert # can be same or different specialist
|
|
39
|
+
model: opus # often higher model for review
|
|
40
|
+
prompt: "Review implementation for correctness, security, performance"
|
|
41
|
+
|
|
42
|
+
config:
|
|
43
|
+
max_iterations: 3 # Max review cycles (default: 3)
|
|
44
|
+
quality_gate: all_pass # all_pass | majority_pass | custom
|
|
45
|
+
auto_commit: false # Auto-commit on quality pass (via mgr-gitnerd)
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
## Execution Flow
|
|
49
|
+
|
|
50
|
+
```
|
|
51
|
+
1. Orchestrator activates pipeline
|
|
52
|
+
2. Worker agent implements changes
|
|
53
|
+
3. Reviewer agent reviews Worker's output
|
|
54
|
+
4. Reviewer produces verdict:
|
|
55
|
+
- PASS → Pipeline complete, proceed to next step
|
|
56
|
+
- FAIL(issues) → Worker receives feedback, re-implements
|
|
57
|
+
5. Repeat 3-4 until PASS or max_iterations reached
|
|
58
|
+
6. If max_iterations reached without PASS:
|
|
59
|
+
- Report partial results to user
|
|
60
|
+
- Recommend manual review
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
## Review Verdict Format
|
|
64
|
+
|
|
65
|
+
Reviewer MUST output a structured verdict:
|
|
66
|
+
|
|
67
|
+
```
|
|
68
|
+
[Review Verdict]
|
|
69
|
+
├── Status: PASS | FAIL
|
|
70
|
+
├── Iteration: {n}/{max}
|
|
71
|
+
├── Issues Found: {count}
|
|
72
|
+
│ ├── [Critical] {description} — {file:line}
|
|
73
|
+
│ ├── [Major] {description} — {file:line}
|
|
74
|
+
│ └── [Minor] {description} — {file:line}
|
|
75
|
+
└── Summary: {one-line}
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
## Quality Gates
|
|
79
|
+
|
|
80
|
+
| Gate | Criteria |
|
|
81
|
+
|------|----------|
|
|
82
|
+
| `all_pass` | Zero Critical or Major issues (default) |
|
|
83
|
+
| `majority_pass` | Zero Critical, ≤2 Minor issues allowed |
|
|
84
|
+
| `custom` | User-defined in pipeline spec |
|
|
85
|
+
|
|
86
|
+
## Integration with Agent Teams (R018)
|
|
87
|
+
|
|
88
|
+
When Agent Teams is enabled, the pipeline SHOULD use Agent Teams:
|
|
89
|
+
|
|
90
|
+
```
|
|
91
|
+
TeamCreate("review-pipeline")
|
|
92
|
+
Worker (team member) ←→ Reviewer (team member)
|
|
93
|
+
SendMessage for feedback exchange
|
|
94
|
+
Shared TaskList for tracking issues
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
When Agent Teams is NOT available, falls back to sequential Agent tool calls:
|
|
98
|
+
```
|
|
99
|
+
Agent(worker) → result → Agent(reviewer) → verdict → Agent(worker) → ...
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
## Stopping Criteria Display
|
|
103
|
+
|
|
104
|
+
Before execution, display:
|
|
105
|
+
```
|
|
106
|
+
[Worker-Reviewer Pipeline]
|
|
107
|
+
├── Max iterations: {max_iterations} (default: 3, hard cap: 5)
|
|
108
|
+
├── Quality gate: {pass_threshold}% approval required
|
|
109
|
+
└── Early stop: All reviewers approve → stop immediately
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
## Display Format
|
|
113
|
+
|
|
114
|
+
```
|
|
115
|
+
[Pipeline] feature-review — Worker: lang-typescript-expert, Reviewer: lang-typescript-expert
|
|
116
|
+
[Iteration 1/3] Worker implementing...
|
|
117
|
+
[Iteration 1/3] Reviewer reviewing...
|
|
118
|
+
[Review] FAIL — 2 issues (1 Major, 1 Minor)
|
|
119
|
+
[Iteration 2/3] Worker fixing issues...
|
|
120
|
+
[Iteration 2/3] Reviewer re-reviewing...
|
|
121
|
+
[Review] PASS — 0 issues
|
|
122
|
+
[Pipeline Complete] 2 iterations, quality gate passed
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
## Common Pipeline Templates
|
|
126
|
+
|
|
127
|
+
### Security-Critical Feature
|
|
128
|
+
```yaml
|
|
129
|
+
worker: {agent: lang-typescript-expert, model: sonnet}
|
|
130
|
+
reviewer: {agent: lang-typescript-expert, model: opus}
|
|
131
|
+
config: {max_iterations: 3, quality_gate: all_pass}
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
### Cross-Language Integration
|
|
135
|
+
```yaml
|
|
136
|
+
worker: {agent: lang-golang-expert, model: sonnet}
|
|
137
|
+
reviewer: {agent: be-go-backend-expert, model: opus}
|
|
138
|
+
config: {max_iterations: 2, quality_gate: all_pass}
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
### Quick Review
|
|
142
|
+
```yaml
|
|
143
|
+
worker: {agent: lang-python-expert, model: sonnet}
|
|
144
|
+
reviewer: {agent: lang-python-expert, model: sonnet}
|
|
145
|
+
config: {max_iterations: 1, quality_gate: majority_pass}
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
## Integration
|
|
149
|
+
|
|
150
|
+
| Rule | Integration |
|
|
151
|
+
|------|-------------|
|
|
152
|
+
| R009 | Worker and Reviewer can run in parallel with other pipelines |
|
|
153
|
+
| R010 | Pipeline orchestration runs only in main conversation |
|
|
154
|
+
| R015 | Display pipeline plan and review verdicts transparently |
|
|
155
|
+
| R018 | Agent Teams preferred when available for Worker↔Reviewer messaging |
|
|
156
|
+
| pipeline-guards | Max iterations and timeout enforced by pipeline-guards |
|
|
157
|
+
| model-escalation | Worker failures feed into escalation tracking |
|
|
158
|
+
| stuck-recovery | Repeated FAIL verdicts trigger stuck detection advisory |
|
|
159
|
+
|
|
160
|
+
## Limitations
|
|
161
|
+
|
|
162
|
+
- Max 3 iterations by default (configurable, hard cap at 5 via pipeline-guards)
|
|
163
|
+
- Worker and Reviewer must be different agent instances (same type allowed)
|
|
164
|
+
- Nested pipelines not supported (use dag-orchestration for complex flows)
|
|
165
|
+
- Pipeline does not auto-commit; orchestrator decides post-pipeline actions
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: writing-clearly-and-concisely
|
|
3
|
+
description: Apply Strunk's timeless writing rules to ANY prose humans will read—documentation, commit messages, error messages, explanations, reports, or UI text. Makes your writing clearer, stronger, and more professional.
|
|
4
|
+
scope: core
|
|
5
|
+
user-invocable: false
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# Writing Clearly and Concisely
|
|
9
|
+
|
|
10
|
+
## Overview
|
|
11
|
+
|
|
12
|
+
William Strunk Jr.'s *The Elements of Style* (1918) teaches you to write clearly and cut ruthlessly.
|
|
13
|
+
|
|
14
|
+
**Source**: Internalized from `elements-of-style` plugin (superpowers-marketplace v1.0.0)
|
|
15
|
+
|
|
16
|
+
**WARNING:** The full reference (`templates/guides/elements-of-style/elements-of-style.html`) consumes ~12,000 tokens. Read it only when writing or editing prose.
|
|
17
|
+
|
|
18
|
+
## When to Use This Skill
|
|
19
|
+
|
|
20
|
+
Use this skill whenever you write prose for humans:
|
|
21
|
+
|
|
22
|
+
- Documentation, README files, technical explanations
|
|
23
|
+
- Commit messages, pull request descriptions
|
|
24
|
+
- Error messages, UI copy, help text, comments
|
|
25
|
+
- Reports, summaries, or any explanation
|
|
26
|
+
- Editing to improve clarity
|
|
27
|
+
|
|
28
|
+
**If you're writing sentences for a human to read, use this skill.**
|
|
29
|
+
|
|
30
|
+
## Limited Context Strategy
|
|
31
|
+
|
|
32
|
+
When context is tight:
|
|
33
|
+
1. Write your draft using judgment
|
|
34
|
+
2. Dispatch a subagent with your draft and the reference guide
|
|
35
|
+
3. Have the subagent copyedit and return the revision
|
|
36
|
+
|
|
37
|
+
## All Rules
|
|
38
|
+
|
|
39
|
+
### Elementary Rules of Usage (Grammar/Punctuation)
|
|
40
|
+
1. Form possessive singular by adding 's
|
|
41
|
+
2. Use comma after each term in series except last
|
|
42
|
+
3. Enclose parenthetic expressions between commas
|
|
43
|
+
4. Comma before conjunction introducing co-ordinate clause
|
|
44
|
+
5. Don't join independent clauses by comma
|
|
45
|
+
6. Don't break sentences in two
|
|
46
|
+
7. Participial phrase at beginning refers to grammatical subject
|
|
47
|
+
|
|
48
|
+
### Elementary Principles of Composition
|
|
49
|
+
8. One paragraph per topic
|
|
50
|
+
9. Begin paragraph with topic sentence
|
|
51
|
+
10. **Use active voice**
|
|
52
|
+
11. **Put statements in positive form**
|
|
53
|
+
12. **Use definite, specific, concrete language**
|
|
54
|
+
13. **Omit needless words**
|
|
55
|
+
14. Avoid succession of loose sentences
|
|
56
|
+
15. Express co-ordinate ideas in similar form
|
|
57
|
+
16. **Keep related words together**
|
|
58
|
+
17. Keep to one tense in summaries
|
|
59
|
+
18. **Place emphatic words at end of sentence**
|
|
60
|
+
|
|
61
|
+
### Section V: Words and Expressions Commonly Misused
|
|
62
|
+
Alphabetical reference for usage questions — see `templates/guides/elements-of-style/elements-of-style.html`
|
|
63
|
+
|
|
64
|
+
## Bottom Line
|
|
65
|
+
|
|
66
|
+
Writing for humans? Read the reference guide and apply the rules. Low on tokens? Dispatch a subagent to copyedit with the guide.
|
|
@@ -0,0 +1,380 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
# statusline.sh — Claude Code statusline renderer
|
|
3
|
+
#
|
|
4
|
+
# Reads JSON from stdin (Claude Code statusline API, ~300ms intervals)
|
|
5
|
+
# and outputs a formatted status line, e.g.:
|
|
6
|
+
#
|
|
7
|
+
# $0.05 | my-project | develop | PR #160 | CTX:42%
|
|
8
|
+
#
|
|
9
|
+
# JSON input structure:
|
|
10
|
+
# {
|
|
11
|
+
# "model": { "display_name": "claude-opus-4-6" },
|
|
12
|
+
# "workspace": { "current_dir": "/path/to/project" },
|
|
13
|
+
# "context_window": { "used_percentage": 42, "context_window_size": 200000 },
|
|
14
|
+
# "cost": { "total_cost_usd": 0.05 },
|
|
15
|
+
# "rate_limits": { (v2.1.80+, optional)
|
|
16
|
+
# "five_hour": { "used_percentage": 10, "resets_at": 1773979200 },
|
|
17
|
+
# "seven_day": { "used_percentage": 90, "resets_at": 1773979200 }
|
|
18
|
+
# }
|
|
19
|
+
# }
|
|
20
|
+
|
|
21
|
+
# ---------------------------------------------------------------------------
|
|
22
|
+
# 1. Color detection
|
|
23
|
+
# ---------------------------------------------------------------------------
|
|
24
|
+
if [[ -n "${NO_COLOR}" || "${TERM}" == "dumb" ]]; then
|
|
25
|
+
# Colors disabled
|
|
26
|
+
COLOR_RESET=""
|
|
27
|
+
COLOR_OPUS=""
|
|
28
|
+
COLOR_SONNET=""
|
|
29
|
+
COLOR_HAIKU=""
|
|
30
|
+
COLOR_CTX_OK=""
|
|
31
|
+
COLOR_CTX_WARN=""
|
|
32
|
+
COLOR_CTX_CRIT=""
|
|
33
|
+
else
|
|
34
|
+
COLOR_RESET=$'\033[0m'
|
|
35
|
+
COLOR_OPUS=$'\033[1;35m' # Magenta bold
|
|
36
|
+
COLOR_SONNET=$'\033[0;36m' # Cyan
|
|
37
|
+
COLOR_HAIKU=$'\033[0;32m' # Green
|
|
38
|
+
COLOR_CTX_OK=$'\033[0;32m' # Green (< 60%)
|
|
39
|
+
COLOR_CTX_WARN=$'\033[0;33m' # Yellow (60-79%)
|
|
40
|
+
COLOR_CTX_CRIT=$'\033[0;31m' # Red (>= 80%)
|
|
41
|
+
fi
|
|
42
|
+
|
|
43
|
+
# ---------------------------------------------------------------------------
|
|
44
|
+
# 2. jq availability check
|
|
45
|
+
# ---------------------------------------------------------------------------
|
|
46
|
+
if ! command -v jq >/dev/null 2>&1; then
|
|
47
|
+
echo "statusline: jq required"
|
|
48
|
+
exit 0
|
|
49
|
+
fi
|
|
50
|
+
|
|
51
|
+
# ---------------------------------------------------------------------------
|
|
52
|
+
# 3. Read stdin into variable
|
|
53
|
+
# ---------------------------------------------------------------------------
|
|
54
|
+
json="$(cat)"
|
|
55
|
+
|
|
56
|
+
# Guard against empty input
|
|
57
|
+
if [[ -z "$json" ]]; then
|
|
58
|
+
echo "statusline: no input"
|
|
59
|
+
exit 0
|
|
60
|
+
fi
|
|
61
|
+
|
|
62
|
+
# Debug logging for CTX investigation
|
|
63
|
+
if [[ -n "${STATUSLINE_DEBUG}" ]]; then
|
|
64
|
+
printf '%s\n' "$json" >> "/tmp/.claude-statusline-debug-${PPID}.jsonl"
|
|
65
|
+
fi
|
|
66
|
+
|
|
67
|
+
# ---------------------------------------------------------------------------
|
|
68
|
+
# 4. Single jq call — extract all fields as TSV
|
|
69
|
+
# Fields: model_name, project_dir, ctx_pct, ctx_size, cost_usd, rl_5h_pct, rl_7d_pct, rl_5h_resets, rl_7d_resets
|
|
70
|
+
# ---------------------------------------------------------------------------
|
|
71
|
+
IFS=$'\t' read -r model_name project_dir ctx_pct ctx_size cost_usd rl_5h_pct rl_7d_pct rl_5h_resets rl_7d_resets <<< "$(
|
|
72
|
+
printf '%s' "$json" | jq -r '[
|
|
73
|
+
(.model.display_name // "unknown"),
|
|
74
|
+
(.workspace.current_dir // ""),
|
|
75
|
+
(if .context_window.used != null and .context_window.total != null and .context_window.total > 0 then (.context_window.used / .context_window.total * 100) elif .context_window.used_percentage != null then .context_window.used_percentage else 0 end),
|
|
76
|
+
(.context_window.context_window_size // 0),
|
|
77
|
+
(.cost.total_cost_usd // 0),
|
|
78
|
+
(.rate_limits.five_hour.used_percentage // -1),
|
|
79
|
+
(.rate_limits.seven_day.used_percentage // -1),
|
|
80
|
+
(.rate_limits.five_hour.resets_at // -1),
|
|
81
|
+
(.rate_limits.seven_day.resets_at // -1)
|
|
82
|
+
] | @tsv'
|
|
83
|
+
)"
|
|
84
|
+
|
|
85
|
+
# ---------------------------------------------------------------------------
|
|
86
|
+
# 4b. Cost & context data bridge — write to temp file for hooks
|
|
87
|
+
# ---------------------------------------------------------------------------
|
|
88
|
+
COST_BRIDGE_FILE="/tmp/.claude-cost-${PPID}"
|
|
89
|
+
_tmp="${COST_BRIDGE_FILE}.tmp.$$"
|
|
90
|
+
printf '%s\t%s\t%s\t%s\t%s\t%s\t%s\n' "$cost_usd" "$ctx_pct" "$(date +%s)" "$rl_5h_pct" "$rl_7d_pct" "$rl_5h_resets" "$rl_7d_resets" > "$_tmp" 2>/dev/null && mv -f "$_tmp" "$COST_BRIDGE_FILE" 2>/dev/null || true
|
|
91
|
+
|
|
92
|
+
# ---------------------------------------------------------------------------
|
|
93
|
+
# 4c. Countdown helper — converts resets_at epoch to human-readable duration
|
|
94
|
+
# ---------------------------------------------------------------------------
|
|
95
|
+
_countdown() {
|
|
96
|
+
local resets_at="$1"
|
|
97
|
+
if [[ "$resets_at" =~ ^[0-9]+$ ]] && [[ "$resets_at" -gt 0 ]]; then
|
|
98
|
+
local now
|
|
99
|
+
now=$(date +%s)
|
|
100
|
+
local remaining=$((resets_at - now))
|
|
101
|
+
if [[ "$remaining" -gt 0 ]]; then
|
|
102
|
+
local days=$((remaining / 86400))
|
|
103
|
+
local hours=$(( (remaining % 86400) / 3600 ))
|
|
104
|
+
if [[ "$days" -gt 0 ]]; then
|
|
105
|
+
printf '%dd%dh' "$days" "$hours"
|
|
106
|
+
elif [[ "$hours" -gt 0 ]]; then
|
|
107
|
+
local mins=$(( (remaining % 3600) / 60 ))
|
|
108
|
+
printf '%dh%dm' "$hours" "$mins"
|
|
109
|
+
else
|
|
110
|
+
local mins=$((remaining / 60))
|
|
111
|
+
printf '%dm' "$mins"
|
|
112
|
+
fi
|
|
113
|
+
fi
|
|
114
|
+
fi
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
# ---------------------------------------------------------------------------
|
|
118
|
+
# 5. Model display name + color (bash 3.2 compatible case pattern matching)
|
|
119
|
+
# Model detection (kept for internal reference, not displayed in statusline)
|
|
120
|
+
# ---------------------------------------------------------------------------
|
|
121
|
+
case "$model_name" in
|
|
122
|
+
*[Oo]pus*) model_display="Opus"; model_color="${COLOR_OPUS}" ;;
|
|
123
|
+
*[Ss]onnet*) model_display="Sonnet"; model_color="${COLOR_SONNET}" ;;
|
|
124
|
+
*[Hh]aiku*) model_display="Haiku"; model_color="${COLOR_HAIKU}" ;;
|
|
125
|
+
*) model_display="$model_name"; model_color="${COLOR_RESET}" ;;
|
|
126
|
+
esac
|
|
127
|
+
|
|
128
|
+
# ---------------------------------------------------------------------------
|
|
129
|
+
# 5b. Cost display — format and colorize session API cost
|
|
130
|
+
# ---------------------------------------------------------------------------
|
|
131
|
+
# Ensure cost_usd is a valid number (fallback to 0)
|
|
132
|
+
if [[ -z "$cost_usd" ]] || ! printf '%f' "$cost_usd" >/dev/null 2>&1; then
|
|
133
|
+
cost_usd="0"
|
|
134
|
+
fi
|
|
135
|
+
|
|
136
|
+
cost_display=$(printf '$%.2f' "$cost_usd")
|
|
137
|
+
|
|
138
|
+
# Color by cost threshold (cents for integer comparison)
|
|
139
|
+
cost_cents=$(printf '%.0f' "$(echo "$cost_usd * 100" | bc 2>/dev/null || echo 0)")
|
|
140
|
+
if ! [[ "$cost_cents" =~ ^[0-9]+$ ]]; then
|
|
141
|
+
cost_cents=0
|
|
142
|
+
fi
|
|
143
|
+
|
|
144
|
+
if [[ "$cost_cents" -ge 500 ]]; then
|
|
145
|
+
cost_color="${COLOR_CTX_CRIT}" # Red (>= $5.00)
|
|
146
|
+
elif [[ "$cost_cents" -ge 100 ]]; then
|
|
147
|
+
cost_color="${COLOR_CTX_WARN}" # Yellow ($1.00 - $4.99)
|
|
148
|
+
else
|
|
149
|
+
cost_color="${COLOR_CTX_OK}" # Green (< $1.00)
|
|
150
|
+
fi
|
|
151
|
+
|
|
152
|
+
# ---------------------------------------------------------------------------
|
|
153
|
+
# 6. Project name — basename of workspace current_dir
|
|
154
|
+
# ---------------------------------------------------------------------------
|
|
155
|
+
if [[ -n "$project_dir" ]]; then
|
|
156
|
+
project_name="${project_dir##*/}"
|
|
157
|
+
else
|
|
158
|
+
project_name="unknown"
|
|
159
|
+
fi
|
|
160
|
+
|
|
161
|
+
# ---------------------------------------------------------------------------
|
|
162
|
+
# 7. Git branch — read .git/HEAD directly (no subprocess, fast)
|
|
163
|
+
# ---------------------------------------------------------------------------
|
|
164
|
+
git_head_file="${project_dir}/.git/HEAD"
|
|
165
|
+
git_branch=""
|
|
166
|
+
if [[ -f "$git_head_file" ]]; then
|
|
167
|
+
git_head="$(cat "$git_head_file")"
|
|
168
|
+
case "$git_head" in
|
|
169
|
+
"ref: refs/heads/"*)
|
|
170
|
+
# Normal branch: strip the prefix
|
|
171
|
+
git_branch="${git_head#ref: refs/heads/}"
|
|
172
|
+
;;
|
|
173
|
+
*)
|
|
174
|
+
# Detached HEAD: show first 7 chars of commit hash
|
|
175
|
+
git_branch="${git_head:0:7}"
|
|
176
|
+
;;
|
|
177
|
+
esac
|
|
178
|
+
fi
|
|
179
|
+
|
|
180
|
+
# ---------------------------------------------------------------------------
|
|
181
|
+
# 7b. Branch URL — for OSC 8 clickable link
|
|
182
|
+
# ---------------------------------------------------------------------------
|
|
183
|
+
branch_url=""
|
|
184
|
+
if [[ -n "$git_branch" && -n "$project_dir" ]]; then
|
|
185
|
+
# Get remote URL from git config
|
|
186
|
+
git_config="${project_dir}/.git/config"
|
|
187
|
+
if [[ -f "$git_config" ]]; then
|
|
188
|
+
# Extract remote origin URL from git config (no subprocess)
|
|
189
|
+
remote_url=""
|
|
190
|
+
in_remote_origin=false
|
|
191
|
+
while IFS= read -r line; do
|
|
192
|
+
case "$line" in
|
|
193
|
+
'[remote "origin"]')
|
|
194
|
+
in_remote_origin=true
|
|
195
|
+
;;
|
|
196
|
+
'['*)
|
|
197
|
+
in_remote_origin=false
|
|
198
|
+
;;
|
|
199
|
+
*)
|
|
200
|
+
if $in_remote_origin; then
|
|
201
|
+
case "$line" in
|
|
202
|
+
*url\ =*)
|
|
203
|
+
remote_url="${line#*url = }"
|
|
204
|
+
;;
|
|
205
|
+
esac
|
|
206
|
+
fi
|
|
207
|
+
;;
|
|
208
|
+
esac
|
|
209
|
+
done < "$git_config"
|
|
210
|
+
|
|
211
|
+
# Convert remote URL to HTTPS browse URL
|
|
212
|
+
if [[ -n "$remote_url" ]]; then
|
|
213
|
+
case "$remote_url" in
|
|
214
|
+
git@github.com:*)
|
|
215
|
+
# git@github.com:owner/repo.git → https://github.com/owner/repo
|
|
216
|
+
repo_path="${remote_url#git@github.com:}"
|
|
217
|
+
repo_path="${repo_path%.git}"
|
|
218
|
+
branch_url="https://github.com/${repo_path}/tree/${git_branch}"
|
|
219
|
+
;;
|
|
220
|
+
https://github.com/*)
|
|
221
|
+
# https://github.com/owner/repo.git → https://github.com/owner/repo
|
|
222
|
+
repo_path="${remote_url#https://github.com/}"
|
|
223
|
+
repo_path="${repo_path%.git}"
|
|
224
|
+
branch_url="https://github.com/${repo_path}/tree/${git_branch}"
|
|
225
|
+
;;
|
|
226
|
+
esac
|
|
227
|
+
fi
|
|
228
|
+
fi
|
|
229
|
+
fi
|
|
230
|
+
|
|
231
|
+
# ---------------------------------------------------------------------------
|
|
232
|
+
# 8. PR number — cached by branch to avoid gh call on every refresh
|
|
233
|
+
# ---------------------------------------------------------------------------
|
|
234
|
+
pr_display=""
|
|
235
|
+
if [[ -n "$git_branch" ]] && command -v gh >/dev/null 2>&1; then
|
|
236
|
+
cache_file="/tmp/statusline-pr-${project_name}"
|
|
237
|
+
cached_branch=""
|
|
238
|
+
cached_pr=""
|
|
239
|
+
|
|
240
|
+
if [[ -f "$cache_file" ]]; then
|
|
241
|
+
IFS=$'\t' read -r cached_branch cached_pr < "$cache_file"
|
|
242
|
+
fi
|
|
243
|
+
|
|
244
|
+
if [[ "$cached_branch" == "$git_branch" ]]; then
|
|
245
|
+
# Cache hit — use cached PR number
|
|
246
|
+
pr_number="$cached_pr"
|
|
247
|
+
else
|
|
248
|
+
# Cache miss — query gh and update cache
|
|
249
|
+
pr_number="$(gh pr view --json number -q .number 2>/dev/null || echo "")"
|
|
250
|
+
printf '%s\t%s\n' "$git_branch" "$pr_number" > "$cache_file"
|
|
251
|
+
fi
|
|
252
|
+
|
|
253
|
+
if [[ -n "$pr_number" ]]; then
|
|
254
|
+
pr_display="PR #${pr_number}"
|
|
255
|
+
fi
|
|
256
|
+
fi
|
|
257
|
+
|
|
258
|
+
# ---------------------------------------------------------------------------
|
|
259
|
+
# 9. Context percentage with color
|
|
260
|
+
# ---------------------------------------------------------------------------
|
|
261
|
+
# ctx_pct may arrive as a float (e.g. 42.5); truncate to integer for comparison
|
|
262
|
+
ctx_int="${ctx_pct%%.*}"
|
|
263
|
+
# Ensure it's a valid integer (fallback to 0)
|
|
264
|
+
if ! [[ "$ctx_int" =~ ^[0-9]+$ ]]; then
|
|
265
|
+
ctx_int=0
|
|
266
|
+
fi
|
|
267
|
+
|
|
268
|
+
if [[ "$ctx_int" -ge 80 ]]; then
|
|
269
|
+
ctx_color="${COLOR_CTX_CRIT}"
|
|
270
|
+
elif [[ "$ctx_int" -ge 60 ]]; then
|
|
271
|
+
ctx_color="${COLOR_CTX_WARN}"
|
|
272
|
+
else
|
|
273
|
+
ctx_color="${COLOR_CTX_OK}"
|
|
274
|
+
fi
|
|
275
|
+
|
|
276
|
+
ctx_display="CTX:${ctx_int}%"
|
|
277
|
+
|
|
278
|
+
# ---------------------------------------------------------------------------
|
|
279
|
+
# 9b. Rate limit percentage with color (v2.1.80+, optional)
|
|
280
|
+
# ---------------------------------------------------------------------------
|
|
281
|
+
rl_display=""
|
|
282
|
+
rl_color=""
|
|
283
|
+
# rl_5h_pct is -1 when rate_limits field is absent (pre-v2.1.80 compatibility)
|
|
284
|
+
rl_5h_int="${rl_5h_pct%%.*}"
|
|
285
|
+
# Ensure it's a valid integer (fallback to -1)
|
|
286
|
+
if ! [[ "$rl_5h_int" =~ ^-?[0-9]+$ ]]; then
|
|
287
|
+
rl_5h_int=-1
|
|
288
|
+
fi
|
|
289
|
+
|
|
290
|
+
if [[ "$rl_5h_int" -ge 0 ]]; then
|
|
291
|
+
rl_display="RL:${rl_5h_int}%"
|
|
292
|
+
if [[ "$rl_5h_int" -ge 80 ]]; then
|
|
293
|
+
rl_color="${COLOR_CTX_CRIT}" # Red (>= 80%)
|
|
294
|
+
elif [[ "$rl_5h_int" -ge 50 ]]; then
|
|
295
|
+
rl_color="${COLOR_CTX_WARN}" # Yellow (50-79%)
|
|
296
|
+
else
|
|
297
|
+
rl_color="${COLOR_CTX_OK}" # Green (< 50%)
|
|
298
|
+
fi
|
|
299
|
+
fi
|
|
300
|
+
|
|
301
|
+
# Append countdown to RL display if available
|
|
302
|
+
rl_countdown="$(_countdown "$rl_5h_resets")"
|
|
303
|
+
if [[ -n "$rl_countdown" && -n "$rl_display" ]]; then
|
|
304
|
+
rl_display="${rl_display} ${rl_countdown}"
|
|
305
|
+
fi
|
|
306
|
+
|
|
307
|
+
# ---------------------------------------------------------------------------
|
|
308
|
+
# 9c. Weekly rate limit percentage with color (v2.1.80+, optional)
|
|
309
|
+
# ---------------------------------------------------------------------------
|
|
310
|
+
wl_display=""
|
|
311
|
+
wl_color=""
|
|
312
|
+
wl_7d_int="${rl_7d_pct%%.*}"
|
|
313
|
+
if ! [[ "$wl_7d_int" =~ ^-?[0-9]+$ ]]; then
|
|
314
|
+
wl_7d_int=-1
|
|
315
|
+
fi
|
|
316
|
+
|
|
317
|
+
if [[ "$wl_7d_int" -ge 0 ]]; then
|
|
318
|
+
wl_display="WL:${wl_7d_int}%"
|
|
319
|
+
if [[ "$wl_7d_int" -ge 80 ]]; then
|
|
320
|
+
wl_color="${COLOR_CTX_CRIT}" # Red (>= 80%)
|
|
321
|
+
elif [[ "$wl_7d_int" -ge 50 ]]; then
|
|
322
|
+
wl_color="${COLOR_CTX_WARN}" # Yellow (50-79%)
|
|
323
|
+
else
|
|
324
|
+
wl_color="${COLOR_CTX_OK}" # Green (< 50%)
|
|
325
|
+
fi
|
|
326
|
+
fi
|
|
327
|
+
|
|
328
|
+
# Append countdown to WL display if available
|
|
329
|
+
wl_countdown="$(_countdown "$rl_7d_resets")"
|
|
330
|
+
if [[ -n "$wl_countdown" && -n "$wl_display" ]]; then
|
|
331
|
+
wl_display="${wl_display} ${wl_countdown}"
|
|
332
|
+
fi
|
|
333
|
+
|
|
334
|
+
# ---------------------------------------------------------------------------
|
|
335
|
+
# 10. Assemble and output the status line
|
|
336
|
+
# ---------------------------------------------------------------------------
|
|
337
|
+
# Format branch with optional OSC 8 hyperlink
|
|
338
|
+
if [[ -n "$branch_url" && -n "${COLOR_RESET}" ]]; then
|
|
339
|
+
# OSC 8 hyperlink: ESC]8;;URL BEL visible-text ESC]8;; BEL
|
|
340
|
+
branch_display=$'\033]8;;'"${branch_url}"$'\a'"${git_branch}"$'\033]8;;\a'
|
|
341
|
+
else
|
|
342
|
+
branch_display="$git_branch"
|
|
343
|
+
fi
|
|
344
|
+
|
|
345
|
+
# Build the PR segment (with separator) if present
|
|
346
|
+
pr_segment=""
|
|
347
|
+
if [[ -n "$pr_display" ]]; then
|
|
348
|
+
pr_segment=" | ${pr_display}"
|
|
349
|
+
fi
|
|
350
|
+
|
|
351
|
+
# Build the RL segment (with separator) if present
|
|
352
|
+
rl_segment=""
|
|
353
|
+
if [[ -n "$rl_display" ]]; then
|
|
354
|
+
rl_segment=" | ${rl_color}${rl_display}${COLOR_RESET}"
|
|
355
|
+
fi
|
|
356
|
+
|
|
357
|
+
# Build the WL segment (with separator) if present
|
|
358
|
+
wl_segment=""
|
|
359
|
+
if [[ -n "$wl_display" ]]; then
|
|
360
|
+
wl_segment=" | ${wl_color}${wl_display}${COLOR_RESET}"
|
|
361
|
+
fi
|
|
362
|
+
|
|
363
|
+
if [[ -n "$git_branch" ]]; then
|
|
364
|
+
printf "${cost_color}%s${COLOR_RESET} | %s | %s%s%s%s | ${ctx_color}%s${COLOR_RESET}\n" \
|
|
365
|
+
"$cost_display" \
|
|
366
|
+
"$project_name" \
|
|
367
|
+
"$branch_display" \
|
|
368
|
+
"$pr_segment" \
|
|
369
|
+
"$rl_segment" \
|
|
370
|
+
"$wl_segment" \
|
|
371
|
+
"$ctx_display"
|
|
372
|
+
else
|
|
373
|
+
printf "${cost_color}%s${COLOR_RESET} | %s%s%s%s | ${ctx_color}%s${COLOR_RESET}\n" \
|
|
374
|
+
"$cost_display" \
|
|
375
|
+
"$project_name" \
|
|
376
|
+
"$pr_segment" \
|
|
377
|
+
"$rl_segment" \
|
|
378
|
+
"$wl_segment" \
|
|
379
|
+
"$ctx_display"
|
|
380
|
+
fi
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
# Claude Code Hooks & Contexts Uninstaller
|
|
3
|
+
# Removes hooks installed by install-hooks.sh
|
|
4
|
+
|
|
5
|
+
set -e
|
|
6
|
+
|
|
7
|
+
CLAUDE_HOME="${HOME}/.claude"
|
|
8
|
+
SETTINGS_FILE="${CLAUDE_HOME}/settings.json"
|
|
9
|
+
|
|
10
|
+
echo "┌─────────────────────────────────────────────┐"
|
|
11
|
+
echo "│ Claude Code Hooks Uninstaller │"
|
|
12
|
+
echo "└─────────────────────────────────────────────┘"
|
|
13
|
+
echo ""
|
|
14
|
+
|
|
15
|
+
read -p "This will remove hooks from ~/.claude/. Continue? [y/N] " -n 1 -r
|
|
16
|
+
echo ""
|
|
17
|
+
|
|
18
|
+
if [[ ! $REPLY =~ ^[Yy]$ ]]; then
|
|
19
|
+
echo "Cancelled."
|
|
20
|
+
exit 0
|
|
21
|
+
fi
|
|
22
|
+
|
|
23
|
+
echo ""
|
|
24
|
+
echo "[1/3] Removing hook scripts..."
|
|
25
|
+
rm -rf "${CLAUDE_HOME}/hooks/memory-persistence"
|
|
26
|
+
rm -rf "${CLAUDE_HOME}/hooks/strategic-compact"
|
|
27
|
+
echo " ✓ Hook scripts removed"
|
|
28
|
+
|
|
29
|
+
echo "[2/3] Removing context files..."
|
|
30
|
+
rm -f "${CLAUDE_HOME}/contexts/dev.md"
|
|
31
|
+
rm -f "${CLAUDE_HOME}/contexts/review.md"
|
|
32
|
+
rm -f "${CLAUDE_HOME}/contexts/research.md"
|
|
33
|
+
echo " ✓ Context files removed"
|
|
34
|
+
|
|
35
|
+
echo "[3/3] Cleaning settings.json..."
|
|
36
|
+
if [ -f "$SETTINGS_FILE" ] && command -v jq &> /dev/null; then
|
|
37
|
+
TEMP_FILE=$(mktemp)
|
|
38
|
+
jq 'del(.hooks)' "$SETTINGS_FILE" > "$TEMP_FILE"
|
|
39
|
+
mv "$TEMP_FILE" "$SETTINGS_FILE"
|
|
40
|
+
echo " ✓ Hooks removed from settings.json"
|
|
41
|
+
else
|
|
42
|
+
echo " ⚠ Please manually remove 'hooks' from settings.json"
|
|
43
|
+
fi
|
|
44
|
+
|
|
45
|
+
echo ""
|
|
46
|
+
echo "┌─────────────────────────────────────────────┐"
|
|
47
|
+
echo "│ Uninstall Complete! │"
|
|
48
|
+
echo "└─────────────────────────────────────────────┘"
|
|
49
|
+
echo ""
|
|
50
|
+
echo "Note: sessions/ and skills/ directories preserved."
|
|
51
|
+
echo "Remove manually if needed: rm -rf ~/.claude/sessions ~/.claude/skills"
|
|
52
|
+
echo ""
|