@yandy-r/ycc-opencode 0.0.0-stage → 6.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/AGENTS.md +39 -0
- package/LICENSE +21 -0
- package/README.md +50 -2
- package/agents/ansible-automation-expert.md +115 -0
- package/agents/api-docs-expert.md +146 -0
- package/agents/api-documenter.md +105 -0
- package/agents/architect.md +264 -0
- package/agents/architecture-analyst.md +99 -0
- package/agents/backport-conflict-resolver.md +476 -0
- package/agents/cloudflare-architect.md +85 -0
- package/agents/cloudflare-developer.md +196 -0
- package/agents/code-architect.md +101 -0
- package/agents/code-documenter.md +114 -0
- package/agents/code-explorer.md +99 -0
- package/agents/code-finder.md +83 -0
- package/agents/code-researcher.md +102 -0
- package/agents/code-reviewer.md +268 -0
- package/agents/code-simplifier.md +77 -0
- package/agents/codebase-advisor.md +130 -0
- package/agents/db-modifier.md +577 -0
- package/agents/docs-git-committer.md +220 -0
- package/agents/documentation-writer.md +92 -0
- package/agents/feature-researcher.md +121 -0
- package/agents/feature-writer.md +89 -0
- package/agents/frontend-ui-developer.md +98 -0
- package/agents/git-cleanup.md +174 -0
- package/agents/go-api-architect.md +172 -0
- package/agents/go-expert-architect.md +147 -0
- package/agents/implementor.md +167 -0
- package/agents/library-docs-writer.md +128 -0
- package/agents/nextjs-ux-ui-expert.md +127 -0
- package/agents/nodejs-backend-architect.md +112 -0
- package/agents/nodejs-backend-developer.md +184 -0
- package/agents/planner.md +257 -0
- package/agents/pr-comment-fixer.md +626 -0
- package/agents/practices-researcher.md +80 -0
- package/agents/project-file-cleaner.md +140 -0
- package/agents/prp-researcher.md +231 -0
- package/agents/python-developer.md +171 -0
- package/agents/python-expert-architect.md +188 -0
- package/agents/readme-generator.md +100 -0
- package/agents/release-fix-applier.md +558 -0
- package/agents/releaser.md +147 -0
- package/agents/research-specialist.md +106 -0
- package/agents/reverse-proxy-architect.md +131 -0
- package/agents/review-fixer.md +609 -0
- package/agents/root-cause-analyzer.md +105 -0
- package/agents/rust-build-resolver.md +183 -0
- package/agents/rust-expert-architect.md +149 -0
- package/agents/rust-reviewer.md +126 -0
- package/agents/sql-database-developer.md +195 -0
- package/agents/systems-engineering-expert.md +203 -0
- package/agents/terraform-architect.md +109 -0
- package/agents/terraform-developer.md +229 -0
- package/agents/test-strategy-planner.md +126 -0
- package/agents/turso-database-architect.md +139 -0
- package/agents/typescript-developer.md +170 -0
- package/agents/typescript-expert-architect.md +167 -0
- package/index.js +523 -0
- package/package.json +36 -4
- package/registration.json +7259 -0
- package/shared/references/agent-native-setup.md +121 -0
- package/shared/references/branch-prep.md +31 -0
- package/shared/references/branching-model.md +162 -0
- package/shared/references/ci-monitoring.md +455 -0
- package/shared/references/forge-detection.md +162 -0
- package/shared/references/goal-pairing.md +55 -0
- package/shared/references/pr-base-and-backport.md +143 -0
- package/shared/references/question-policy.md +99 -0
- package/shared/references/review-artifact-format.md +141 -0
- package/shared/references/review-checklist.md +161 -0
- package/shared/references/review-dispatch.md +73 -0
- package/shared/references/session-state.md +159 -0
- package/shared/references/standalone-dispatch.md +300 -0
- package/shared/references/target-capability-matrix.md +516 -0
- package/shared/references/visual-mode.md +155 -0
- package/shared/references/worktree-strategy.md +326 -0
- package/shared/scripts/backport-audit.sh +283 -0
- package/shared/scripts/ci-monitor.sh +637 -0
- package/shared/scripts/lib/backport-lib.sh +47 -0
- package/shared/scripts/lib/ci-classify.sh +103 -0
- package/shared/scripts/lib/forge.sh +264 -0
- package/shared/scripts/lib/release-state-lib.sh +300 -0
- package/shared/scripts/list-worktrees.sh +178 -0
- package/shared/scripts/merge-children.sh +82 -0
- package/shared/scripts/move-plan-to-worktree.sh +231 -0
- package/shared/scripts/pr-guard.sh +283 -0
- package/shared/scripts/prepare-feature-branch.sh +326 -0
- package/shared/scripts/release-ci-monitor.sh +671 -0
- package/shared/scripts/release-state-update.sh +216 -0
- package/shared/scripts/release-state.sh +178 -0
- package/shared/scripts/report-bundle-drift.sh +343 -0
- package/shared/scripts/require-python.sh +17 -0
- package/shared/scripts/resolve-plans-dir.sh +262 -0
- package/shared/scripts/rules-pointer.sh +20 -0
- package/shared/scripts/rules_pointer.py +267 -0
- package/shared/scripts/setup-worktree.sh +288 -0
- package/shared/scripts/validate-file-paths.sh +249 -0
- package/shared/scripts/visual-egress-guard.sh +303 -0
- package/shared/scripts/visual-recap-collect.sh +247 -0
- package/shared/scripts/worktree-paths.sh +91 -0
- package/skills/backport/SKILL.md +293 -0
- package/skills/backport/scripts/cherry-pick-pr.sh +232 -0
- package/skills/backport/scripts/find-pending.sh +199 -0
- package/skills/blueprint/SKILL.md +412 -0
- package/skills/blueprint/references/bootstrap-mapping.md +87 -0
- package/skills/bundle-author/SKILL.md +121 -0
- package/skills/bundle-author/references/surface-map.md +128 -0
- package/skills/bundle-author/references/templates/agent-template.md +21 -0
- package/skills/bundle-author/references/templates/skill-template.md +36 -0
- package/skills/bundle-author/references/when-not-to-scaffold.md +85 -0
- package/skills/bundle-author/scripts/scaffold-skill.sh +156 -0
- package/skills/bundle-release/SKILL.md +192 -0
- package/skills/bundle-release/references/release-checklist.md +196 -0
- package/skills/bundle-release/references/release-notes-template.md +48 -0
- package/skills/bundle-release/references/version-policy.md +156 -0
- package/skills/bundle-release/scripts/bump-version.sh +99 -0
- package/skills/bundle-release/scripts/draft-notes.sh +222 -0
- package/skills/bundle-release/scripts/preflight.sh +165 -0
- package/skills/bundle-release/scripts/release_versions.py +375 -0
- package/skills/clean/SKILL.md +109 -0
- package/skills/clean/references/agent-prompts.md +199 -0
- package/skills/clean/references/safety-config.md +125 -0
- package/skills/clean/scripts/detect-project-type.sh +423 -0
- package/skills/clean/scripts/generate-report.sh +245 -0
- package/skills/clean/scripts/validate-safety.sh +401 -0
- package/skills/code-report/SKILL.md +377 -0
- package/skills/code-report/scripts/check-prerequisites.sh +65 -0
- package/skills/code-report/templates/report-structure.md +202 -0
- package/skills/code-review/SKILL.md +155 -0
- package/skills/code-review/references/pr-procedure.md +311 -0
- package/skills/compatibility-audit/SKILL.md +229 -0
- package/skills/compatibility-audit/references/reading-the-report.md +162 -0
- package/skills/compatibility-audit/scripts/audit-install-assumptions.sh +431 -0
- package/skills/compatibility-audit/scripts/audit-target-features.sh +596 -0
- package/skills/deep-research/SKILL.md +251 -0
- package/skills/deep-research/references/analysis-prompts.md +702 -0
- package/skills/deep-research/references/completion-summary-template.md +66 -0
- package/skills/deep-research/references/persona-analogical.md +159 -0
- package/skills/deep-research/references/persona-archaeological.md +69 -0
- package/skills/deep-research/references/persona-contrarian.md +155 -0
- package/skills/deep-research/references/persona-futurist.md +70 -0
- package/skills/deep-research/references/persona-historical.md +142 -0
- package/skills/deep-research/references/persona-journalistic.md +69 -0
- package/skills/deep-research/references/persona-negative-space.md +70 -0
- package/skills/deep-research/references/persona-systems.md +69 -0
- package/skills/deep-research/references/synthesis-template.md +569 -0
- package/skills/deep-research/references/verification-log-template.md +32 -0
- package/skills/deep-research/scripts/check-prerequisites.sh +153 -0
- package/skills/deep-research/scripts/validate-research.sh +244 -0
- package/skills/feature-research/SKILL.md +294 -0
- package/skills/feature-research/scripts/validate-research.sh +159 -0
- package/skills/feature-research/scripts/validate-spec.sh +270 -0
- package/skills/feature-research/templates/research-agents.md +569 -0
- package/skills/feature-research/templates/spec-structure.md +437 -0
- package/skills/formatters/SKILL.md +209 -0
- package/skills/formatters/references/best-practices.md +78 -0
- package/skills/formatters/references/flag-reference.md +178 -0
- package/skills/formatters/references/stack-detection.md +119 -0
- package/skills/formatters/references/templates/husky-pre-commit.tmpl +13 -0
- package/skills/formatters/references/templates/justfile-snippet.just.tmpl +31 -0
- package/skills/formatters/references/templates/lefthook.yml.tmpl +22 -0
- package/skills/formatters/references/templates/lint-autofix.yml.tmpl +94 -0
- package/skills/formatters/references/templates/lint.yml.tmpl +85 -0
- package/skills/formatters/references/templates/makefile-snippet.mk.tmpl +34 -0
- package/skills/formatters/references/templates/package-json-scripts.json.tmpl +14 -0
- package/skills/formatters/references/templates/readme-section.md.tmpl +118 -0
- package/skills/formatters/scripts/apply-aliases.sh +245 -0
- package/skills/formatters/scripts/apply-ci.sh +136 -0
- package/skills/formatters/scripts/apply-docs.sh +187 -0
- package/skills/formatters/scripts/apply-hooks.sh +261 -0
- package/skills/formatters/scripts/bundle/format.sh +15 -0
- package/skills/formatters/scripts/bundle/go-tools.sh +119 -0
- package/skills/formatters/scripts/bundle/init-formatters.sh +517 -0
- package/skills/formatters/scripts/bundle/install-shellcheck.sh +85 -0
- package/skills/formatters/scripts/bundle/lib/excludes.sh +179 -0
- package/skills/formatters/scripts/bundle/lib/modified-files.sh +222 -0
- package/skills/formatters/scripts/bundle/lib/shellcheck-resolve.sh +81 -0
- package/skills/formatters/scripts/bundle/lib/shellcheck-version.sh +5 -0
- package/skills/formatters/scripts/bundle/lint.sh +15 -0
- package/skills/formatters/scripts/bundle/style.sh +1410 -0
- package/skills/formatters/scripts/bundle/templates/biome.json +81 -0
- package/skills/formatters/scripts/bundle/templates/clippy.toml +2 -0
- package/skills/formatters/scripts/bundle/templates/markdownlint.json +14 -0
- package/skills/formatters/scripts/bundle/templates/markdownlintignore +38 -0
- package/skills/formatters/scripts/bundle/templates/prettierignore +45 -0
- package/skills/formatters/scripts/bundle/templates/prettierrc.json +11 -0
- package/skills/formatters/scripts/bundle/templates/python-pyproject.toml +80 -0
- package/skills/formatters/scripts/bundle/templates/rustfmt.toml +41 -0
- package/skills/formatters/scripts/bundle/templates/tsconfig.json +21 -0
- package/skills/formatters/scripts/profile-style.sh +264 -0
- package/skills/frontend-design/SKILL.md +151 -0
- package/skills/frontend-patterns/SKILL.md +66 -0
- package/skills/frontend-patterns/references/animation.md +21 -0
- package/skills/frontend-patterns/references/components-and-state.md +40 -0
- package/skills/frontend-patterns/references/data-and-performance.md +34 -0
- package/skills/frontend-patterns/references/forms-errors-a11y.md +35 -0
- package/skills/git-cleanup/SKILL.md +300 -0
- package/skills/git-cleanup/references/active-code-rules.md +323 -0
- package/skills/git-cleanup/references/host-detection.md +217 -0
- package/skills/git-workflow/SKILL.md +132 -0
- package/skills/git-workflow/references/ci-monitoring-phase.md +130 -0
- package/skills/git-workflow/references/commit-phases.md +247 -0
- package/skills/git-workflow/references/examples-and-troubleshooting.md +47 -0
- package/skills/git-workflow/references/goal-pairing.md +23 -0
- package/skills/git-workflow/references/pr-creation.md +269 -0
- package/skills/git-workflow/scripts/analyze-changes.sh +266 -0
- package/skills/git-workflow/scripts/create-pr.sh +464 -0
- package/skills/git-workflow/scripts/validate-commit.sh +235 -0
- package/skills/git-workflow/templates/agent-prompts.md +518 -0
- package/skills/git-workflow/templates/commit-types.md +504 -0
- package/skills/git-workflow/templates/documentation-decision.md +509 -0
- package/skills/git-workflow/templates/pr-template.md +772 -0
- package/skills/go-patterns/SKILL.md +89 -0
- package/skills/go-patterns/references/design-and-tooling.md +336 -0
- package/skills/go-patterns/references/errors-and-concurrency.md +292 -0
- package/skills/go-testing/SKILL.md +133 -0
- package/skills/go-testing/references/advanced-testing.md +349 -0
- package/skills/go-testing/references/test-structure.md +277 -0
- package/skills/hooks-workflow/SKILL.md +232 -0
- package/skills/hooks-workflow/references/support-notes.md +134 -0
- package/skills/hooks-workflow/references/templates/claude-settings.json.tmpl +13 -0
- package/skills/hooks-workflow/references/templates/codex-config-fragment.toml.tmpl +9 -0
- package/skills/hooks-workflow/references/templates/cursor-rule-fragment.mdc.tmpl +16 -0
- package/skills/hooks-workflow/scripts/build-hook-config.sh +487 -0
- package/skills/hooks-workflow/scripts/verify-hooks.sh +257 -0
- package/skills/implement-plan/SKILL.md +223 -0
- package/skills/implement-plan/references/agent-task-prompt.md +214 -0
- package/skills/implement-plan/references/output-formats.md +150 -0
- package/skills/implement-plan/references/plan-inputs.md +126 -0
- package/skills/implement-plan/scripts/check-prerequisites.sh +78 -0
- package/skills/implement-plan/scripts/parse-dependencies.sh +206 -0
- package/skills/init/SKILL.md +274 -0
- package/skills/init/references/conventional-commits.md +114 -0
- package/skills/init/references/flag-reference.md +236 -0
- package/skills/init/references/label-taxonomy.md +115 -0
- package/skills/init/references/project-profile-heuristics.md +156 -0
- package/skills/init/references/template-library.md +129 -0
- package/skills/init/scripts/count-source-files.sh +60 -0
- package/skills/init/scripts/generate-agent-catalog.sh +193 -0
- package/skills/init/scripts/generate-mcp-catalog.sh +214 -0
- package/skills/init/scripts/migrate-rules.py +459 -0
- package/skills/init/scripts/migrate-rules.sh +26 -0
- package/skills/init/scripts/profile-project.sh +453 -0
- package/skills/init/scripts/render-template.py +226 -0
- package/skills/init/scripts/render-template.sh +25 -0
- package/skills/init/scripts/rules-report.sh +31 -0
- package/skills/init/scripts/rules_file_lib.py +41 -0
- package/skills/init/templates/AGENTS.md.tmpl +38 -0
- package/skills/init/templates/CLAUDE.md.tmpl +7 -0
- package/skills/init/templates/ai-rule.md.tmpl +3 -0
- package/skills/init/templates/cursor-rule.mdc.tmpl +7 -0
- package/skills/init/templates/git/commitlint.config.cjs.tmpl +40 -0
- package/skills/init/templates/git/gitignore.tmpl +121 -0
- package/skills/init/templates/git/gitmessage.tmpl +27 -0
- package/skills/init/templates/git/install-lefthook.sh.tmpl +131 -0
- package/skills/init/templates/git/lefthook-usage.md.tmpl +101 -0
- package/skills/init/templates/git/lefthook.yml.tmpl +64 -0
- package/skills/init/templates/github/bug_report.yml.tmpl +78 -0
- package/skills/init/templates/github/config.yml.tmpl +5 -0
- package/skills/init/templates/github/copilot-instructions.md.tmpl +24 -0
- package/skills/init/templates/github/docs_request.yml.tmpl +41 -0
- package/skills/init/templates/github/feature_request.yml.tmpl +59 -0
- package/skills/init/templates/github/labels.md.tmpl +75 -0
- package/skills/init/templates/github/pull_request_template.md.tmpl +66 -0
- package/skills/init/templates/github/workflows/pr-title-autofix.yml.tmpl +101 -0
- package/skills/init/templates/github/workflows/pr-title.yml.tmpl +55 -0
- package/skills/init/templates/workspace-report.md +83 -0
- package/skills/orchestrate/SKILL.md +165 -0
- package/skills/orchestrate/references/agent-catalog.md +601 -0
- package/skills/orchestrate/references/agent-prompts.md +495 -0
- package/skills/orchestrate/references/dispatch-playbook.md +333 -0
- package/skills/orchestrate/references/task-breakdown.md +410 -0
- package/skills/orchestrate/scripts/analyze-task.sh +139 -0
- package/skills/orchestrate/scripts/summarize-results.sh +160 -0
- package/skills/orchestrate/scripts/validate-agents.sh +92 -0
- package/skills/parallel-plan/SKILL.md +124 -0
- package/skills/plan/SKILL.md +136 -0
- package/skills/plan/references/enhanced-personas.md +131 -0
- package/skills/plan/references/personas-and-merge.md +77 -0
- package/skills/plan/references/plan-validation.md +65 -0
- package/skills/plan/references/planner-prompts.md +68 -0
- package/skills/plan/references/planning-tracks.md +73 -0
- package/skills/plan-workflow/SKILL.md +409 -0
- package/skills/plan-workflow/references/checkpoint-messages.md +370 -0
- package/skills/plan-workflow/references/plan-structure.md +238 -0
- package/skills/plan-workflow/references/planning-agents.md +511 -0
- package/skills/plan-workflow/references/research-agents-optimized.md +348 -0
- package/skills/plan-workflow/references/research-agents.md +436 -0
- package/skills/plan-workflow/references/shared-structure.md +152 -0
- package/skills/plan-workflow/references/validation-agents.md +363 -0
- package/skills/plan-workflow/scripts/check-prerequisites.sh +65 -0
- package/skills/plan-workflow/scripts/check-state.sh +190 -0
- package/skills/plan-workflow/scripts/persist-or-fail.sh +135 -0
- package/skills/plan-workflow/scripts/validate-analysis-artifacts.sh +216 -0
- package/skills/plan-workflow/scripts/validate-research-artifacts.sh +225 -0
- package/skills/plan-workflow/scripts/validate-shared.sh +229 -0
- package/skills/plan-workflow/scripts/validate-workflow-plan.sh +256 -0
- package/skills/pr-autofix/SKILL.md +309 -0
- package/skills/pr-autofix/references/ci-loop.md +64 -0
- package/skills/pr-autofix/references/comment-sources.md +197 -0
- package/skills/pr-autofix/references/data-shapes.md +87 -0
- package/skills/pr-autofix/references/goal-example.md +30 -0
- package/skills/pr-autofix/references/output-templates.md +162 -0
- package/skills/pr-autofix/references/prompt-injection-safety.md +165 -0
- package/skills/pr-autofix/references/related-skills.md +11 -0
- package/skills/pr-autofix/references/severity-mapping.md +146 -0
- package/skills/pr-autofix/scripts/fetch-pr-comments.sh +364 -0
- package/skills/pr-autofix/scripts/post-summary.sh +226 -0
- package/skills/pr-autofix/scripts/resolve-thread.sh +251 -0
- package/skills/prp-commit/SKILL.md +128 -0
- package/skills/prp-implement/SKILL.md +179 -0
- package/skills/prp-implement/references/agent-task-prompt.md +36 -0
- package/skills/prp-implement/references/detection.md +49 -0
- package/skills/prp-implement/references/dry-run.md +0 -0
- package/skills/prp-implement/references/report-output.md +204 -0
- package/skills/prp-implement/references/validation-and-failures.md +118 -0
- package/skills/prp-plan/SKILL.md +323 -0
- package/skills/prp-plan/references/enhanced-researchers.md +425 -0
- package/skills/prp-plan/references/parallel-additions.md +56 -0
- package/skills/prp-plan/references/plan-template.md +264 -0
- package/skills/prp-plan/references/synthesis-map.md +25 -0
- package/skills/prp-plan/scripts/validate-prp-plan.sh +368 -0
- package/skills/prp-pr/SKILL.md +404 -0
- package/skills/prp-prd/SKILL.md +444 -0
- package/skills/prp-spec/SKILL.md +276 -0
- package/skills/python-patterns/SKILL.md +103 -0
- package/skills/python-patterns/references/core-idioms.md +304 -0
- package/skills/python-patterns/references/design-and-tooling.md +407 -0
- package/skills/python-testing/SKILL.md +114 -0
- package/skills/python-testing/references/mocking-and-integration.md +395 -0
- package/skills/python-testing/references/pytest-core.md +366 -0
- package/skills/quick-fix/SKILL.md +246 -0
- package/skills/quick-review/SKILL.md +306 -0
- package/skills/release-model/SKILL.md +233 -0
- package/skills/release-model/references/pointer-and-labels.md +83 -0
- package/skills/release-model/references/signals-and-proposal.md +68 -0
- package/skills/release-model/references/template-placeholders.md +42 -0
- package/skills/release-model/references/upgrade-and-audit.md +131 -0
- package/skills/release-model/scripts/collect-signals.sh +459 -0
- package/skills/release-model/scripts/pointer-targets.sh +29 -0
- package/skills/release-model/templates/RELEASING.md.tmpl +151 -0
- package/skills/releaser/SKILL.md +253 -0
- package/skills/releaser/references/ci-optimization-checklist.md +149 -0
- package/skills/releaser/references/ci-templates/docker-release.yml +88 -0
- package/skills/releaser/references/ci-templates/generic-release.yml +69 -0
- package/skills/releaser/references/ci-templates/go-release.yml +50 -0
- package/skills/releaser/references/ci-templates/node-release.yml +126 -0
- package/skills/releaser/references/ci-templates/python-release.yml +95 -0
- package/skills/releaser/references/ci-templates/rust-release.yml +128 -0
- package/skills/releaser/references/ci-workflow-modes.md +42 -0
- package/skills/releaser/references/goal-pairing.md +37 -0
- package/skills/releaser/references/output-templates.md +143 -0
- package/skills/releaser/references/project-type-matrix.md +144 -0
- package/skills/releaser/references/release-branches.md +138 -0
- package/skills/releaser/references/release-ci-loop.md +249 -0
- package/skills/releaser/references/release-notes-template.md +42 -0
- package/skills/releaser/references/release-preparation.md +210 -0
- package/skills/releaser/scripts/check-release-branch.sh +235 -0
- package/skills/releaser/scripts/detect-project.sh +234 -0
- package/skills/releaser/scripts/draft-changelog.sh +387 -0
- package/skills/releaser/scripts/publish-release.sh +302 -0
- package/skills/research-to-issues/SKILL.md +287 -0
- package/skills/research-to-issues/references/label-taxonomy.md +48 -0
- package/skills/research-to-issues/references/parse-deep-research.md +86 -0
- package/skills/research-to-issues/references/parse-feature-spec.md +143 -0
- package/skills/research-to-issues/references/parse-parallel-plan.md +124 -0
- package/skills/research-to-issues/references/parse-prd.md +184 -0
- package/skills/research-to-issues/references/parse-prp-plan.md +237 -0
- package/skills/research-to-issues/references/plan-display-format.md +136 -0
- package/skills/research-to-issues/scripts/validate-prerequisites.sh +312 -0
- package/skills/research-to-issues/templates/feature-issue.md +131 -0
- package/skills/research-to-issues/templates/task-issue.md +104 -0
- package/skills/research-to-issues/templates/tracking-issue.md +126 -0
- package/skills/resume-session/SKILL.md +154 -0
- package/skills/review-fix/SKILL.md +231 -0
- package/skills/review-fix/references/fix-report.md +121 -0
- package/skills/review-fix/references/fixer-dispatch.md +79 -0
- package/skills/review-fix/references/plan.md +119 -0
- package/skills/rust-patterns/SKILL.md +85 -0
- package/skills/rust-patterns/references/concurrency-unsafe-modules.md +243 -0
- package/skills/rust-patterns/references/ownership-errors-types.md +262 -0
- package/skills/rust-testing/SKILL.md +99 -0
- package/skills/rust-testing/references/advanced-testing.md +247 -0
- package/skills/rust-testing/references/unit-and-integration.md +193 -0
- package/skills/save-session/SKILL.md +161 -0
- package/skills/shared-context/SKILL.md +101 -0
- package/skills/ts-patterns/SKILL.md +159 -0
- package/skills/ts-patterns/references/async-runtimes-tooling.md +375 -0
- package/skills/ts-patterns/references/types-errors-modules.md +336 -0
- package/skills/ts-testing/SKILL.md +151 -0
- package/skills/ts-testing/references/advanced-testing.md +350 -0
- package/skills/ts-testing/references/vitest-core.md +318 -0
- package/skills/visual-plan/SKILL.md +221 -0
- package/skills/visual-plan/references/canvas.md +132 -0
- package/skills/visual-plan/references/document-quality.md +178 -0
- package/skills/visual-plan/references/exemplar.md +120 -0
- package/skills/visual-plan/references/wireframe.md +212 -0
- package/skills/visual-plan/scripts/derive-visual-dir.sh +77 -0
- package/skills/visual-recap/SKILL.md +238 -0
- package/skills/visual-recap/references/wireframe.md +237 -0
- package/skills/write-docs/SKILL.md +354 -0
- package/skills/write-docs/scripts/audit-documentation.sh +190 -0
- package/skills/write-docs/scripts/generate-doc-index.sh +125 -0
- package/skills/write-docs/scripts/verify-links.sh +81 -0
- package/skills/write-docs/templates/docs-readme.md +34 -0
- package/skills/write-docs/templates/documentation-strategy.md +91 -0
- package/ycc-sensitive-guard/index.js +621 -0
- package/ycc-sensitive-guard/package.json +7 -0
- package/ycc-sensitive-guard/policy.json +40 -0
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
# render-template.sh — thin Bash 3.2-compatible wrapper around render-template.py.
|
|
3
|
+
# Renders a bundled init template to stdout from profile-project.sh output.
|
|
4
|
+
# Never writes files. Requires Python 3.11+ (guarded up front; readable error,
|
|
5
|
+
# no partial output). See render-template.py for flags, blocks and exit codes.
|
|
6
|
+
set -euo pipefail
|
|
7
|
+
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
8
|
+
_SHARED_SEG="/_shared/scripts"; _SHARED_SEG_FLAT="/shared/scripts"; _SHARED_SEG_AGENTS="/ycc-shared/scripts"
|
|
9
|
+
_guard_found=false
|
|
10
|
+
for _guard in "${SCRIPT_DIR}/../..${_SHARED_SEG}/require-python.sh" \
|
|
11
|
+
"${SCRIPT_DIR}/../../..${_SHARED_SEG_FLAT}/require-python.sh" \
|
|
12
|
+
"${SCRIPT_DIR}/../../..${_SHARED_SEG_AGENTS}/require-python.sh"; do
|
|
13
|
+
if [[ -f "$_guard" ]]; then
|
|
14
|
+
# shellcheck source=/dev/null
|
|
15
|
+
. "$_guard"
|
|
16
|
+
_guard_found=true
|
|
17
|
+
break
|
|
18
|
+
fi
|
|
19
|
+
done
|
|
20
|
+
if [[ "$_guard_found" != true ]]; then
|
|
21
|
+
echo "render-template: shared require-python.sh not found (broken ycc install)" >&2
|
|
22
|
+
exit 1
|
|
23
|
+
fi
|
|
24
|
+
export PYTHONDONTWRITEBYTECODE=1
|
|
25
|
+
exec python3 "${SCRIPT_DIR}/render-template.py" "$@"
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
# rules-report.sh [--repo DIR]
|
|
3
|
+
# Print the line count of every rules file that exists (AGENTS.md, CLAUDE.md,
|
|
4
|
+
# .github/copilot-instructions.md, .cursor/rules/*.mdc) and warn above 200
|
|
5
|
+
# lines. Bash 3.2-compatible. Read-only. Exit code is always 0; the warning is
|
|
6
|
+
# informational so init never fails on file size.
|
|
7
|
+
set -euo pipefail
|
|
8
|
+
repo="$PWD"
|
|
9
|
+
if [[ "${1:-}" == "--repo" ]]; then
|
|
10
|
+
repo="${2:?--repo requires a directory}"
|
|
11
|
+
fi
|
|
12
|
+
[[ -d "$repo" ]] || { echo "rules-report: directory not found: $repo" >&2; exit 1; }
|
|
13
|
+
found=0
|
|
14
|
+
report() {
|
|
15
|
+
local rel="$1" lines
|
|
16
|
+
[[ -f "$repo/$rel" ]] || return 0
|
|
17
|
+
found=1
|
|
18
|
+
lines="$(wc -l <"$repo/$rel" | tr -d ' ')"
|
|
19
|
+
if [[ "$lines" -gt 200 ]]; then
|
|
20
|
+
printf '%s: %s lines WARNING: over 200 lines (long rules files lose adherence; trim or run --migrate-rules)\n' "$rel" "$lines"
|
|
21
|
+
else
|
|
22
|
+
printf '%s: %s lines\n' "$rel" "$lines"
|
|
23
|
+
fi
|
|
24
|
+
}
|
|
25
|
+
report AGENTS.md
|
|
26
|
+
report CLAUDE.md
|
|
27
|
+
report .github/copilot-instructions.md
|
|
28
|
+
for f in "$repo"/.cursor/rules/*.mdc; do
|
|
29
|
+
[[ -e "$f" ]] && report ".cursor/rules/$(basename "$f")"
|
|
30
|
+
done
|
|
31
|
+
[[ "$found" -eq 1 ]] || echo "no rules files found"
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
"""Compatibility imports from the shared canonical rules-pointer implementation."""
|
|
3
|
+
|
|
4
|
+
from __future__ import annotations
|
|
5
|
+
|
|
6
|
+
import sys
|
|
7
|
+
from pathlib import Path
|
|
8
|
+
|
|
9
|
+
_HERE = Path(__file__).resolve().parent
|
|
10
|
+
_CANDIDATES = (
|
|
11
|
+
_HERE.parent.parent / ("_shared") / "scripts",
|
|
12
|
+
_HERE.parent.parent.parent / "shared" / "scripts",
|
|
13
|
+
_HERE.parent.parent.parent / "ycc-shared" / "scripts",
|
|
14
|
+
)
|
|
15
|
+
for _directory in _CANDIDATES:
|
|
16
|
+
if (_directory / "rules_pointer.py").is_file():
|
|
17
|
+
sys.path.insert(0, str(_directory))
|
|
18
|
+
break
|
|
19
|
+
else:
|
|
20
|
+
print("rules_file_lib: shared rules_pointer.py not found (broken ycc install)", file=sys.stderr)
|
|
21
|
+
raise SystemExit(1)
|
|
22
|
+
|
|
23
|
+
from rules_pointer import ( # noqa: E402, F401
|
|
24
|
+
CLAUDE_SHIM_LINE,
|
|
25
|
+
detect_agents_import,
|
|
26
|
+
detect_eol,
|
|
27
|
+
heading_of,
|
|
28
|
+
is_legacy_agents_pointer,
|
|
29
|
+
read_text_relaxed,
|
|
30
|
+
split_sections,
|
|
31
|
+
)
|
|
32
|
+
|
|
33
|
+
__all__ = [
|
|
34
|
+
"CLAUDE_SHIM_LINE",
|
|
35
|
+
"detect_agents_import",
|
|
36
|
+
"detect_eol",
|
|
37
|
+
"heading_of",
|
|
38
|
+
"is_legacy_agents_pointer",
|
|
39
|
+
"read_text_relaxed",
|
|
40
|
+
"split_sections",
|
|
41
|
+
]
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
# {{PROJECT_NAME}} — Agent Rules
|
|
2
|
+
|
|
3
|
+
{{PROJECT_PURPOSE}}
|
|
4
|
+
|
|
5
|
+
This is the canonical, tool-neutral repository policy.
|
|
6
|
+
|
|
7
|
+
## Commands
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
{{TEST_CMD}}
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
{{LINT_CMD}}
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
{{BUILD_CMD}}
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
## Project conventions
|
|
22
|
+
|
|
23
|
+
{{PROJECT_CONVENTIONS}}
|
|
24
|
+
|
|
25
|
+
## MUST / MUST NOT
|
|
26
|
+
|
|
27
|
+
- **Never** commit secrets: `.env`, tokens, API keys, credentials.
|
|
28
|
+
- **Commits**: Conventional Commits 1.0.0 — `feat|fix|docs|refactor|perf|test|build|ci|chore(scope): description`. Use `docs(internal): …` for internal plans or research docs.
|
|
29
|
+
- **Issues**: use `.github/ISSUE_TEMPLATE/` forms when present; never open title-only issues.
|
|
30
|
+
- **Pull requests**: follow `.github/pull_request_template.md` when present; link the issue (`Closes #…`).
|
|
31
|
+
- Follow [CONTRIBUTING.md](CONTRIBUTING.md) and the label taxonomy in [`.github/labels.md`](.github/labels.md) when present.
|
|
32
|
+
- **Modularity**: small, cohesive units with minimal coupling; extract shared logic instead of copy-pasting.
|
|
33
|
+
{{#IF_RELEASE_MODEL}}
|
|
34
|
+
|
|
35
|
+
## Branching & releases
|
|
36
|
+
|
|
37
|
+
Read [`RELEASING.md`](RELEASING.md) before branching, opening a PR, or releasing. It is the source of truth for trunk, maintenance branches, and backports. Never merge one long-lived branch into another to sync it.
|
|
38
|
+
{{/IF_RELEASE_MODEL}}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
// commitlint.config.cjs — Conventional Commits 1.0.0 for {{PROJECT_NAME}}
|
|
2
|
+
//
|
|
3
|
+
// Install dependencies:
|
|
4
|
+
// {{PACKAGE_MANAGER}} add -D @commitlint/cli @commitlint/config-conventional
|
|
5
|
+
//
|
|
6
|
+
// Wire into husky:
|
|
7
|
+
// npx husky add .husky/commit-msg 'npx --no -- commitlint --edit "$1"'
|
|
8
|
+
//
|
|
9
|
+
// Wire into lefthook (lefthook.yml):
|
|
10
|
+
// commit-msg:
|
|
11
|
+
// commands:
|
|
12
|
+
// commitlint:
|
|
13
|
+
// run: npx commitlint --edit {1}
|
|
14
|
+
|
|
15
|
+
/** @type {import('@commitlint/types').UserConfig} */
|
|
16
|
+
module.exports = {
|
|
17
|
+
extends: ['@commitlint/config-conventional'],
|
|
18
|
+
rules: {
|
|
19
|
+
'type-enum': [
|
|
20
|
+
2,
|
|
21
|
+
'always',
|
|
22
|
+
[
|
|
23
|
+
'feat',
|
|
24
|
+
'fix',
|
|
25
|
+
'docs',
|
|
26
|
+
'refactor',
|
|
27
|
+
'perf',
|
|
28
|
+
'test',
|
|
29
|
+
'build',
|
|
30
|
+
'ci',
|
|
31
|
+
'chore',
|
|
32
|
+
'style',
|
|
33
|
+
'revert',
|
|
34
|
+
],
|
|
35
|
+
],
|
|
36
|
+
'subject-case': [2, 'never', ['pascal-case', 'upper-case']],
|
|
37
|
+
'header-max-length': [2, 'always', 100],
|
|
38
|
+
'body-max-line-length': [0],
|
|
39
|
+
},
|
|
40
|
+
};
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
# .gitignore — generated by init for {{PROJECT_NAME}}
|
|
2
|
+
#
|
|
3
|
+
# Tune this file after generation: add project-specific scratch dirs, generated
|
|
4
|
+
# assets, and local secrets. Sections below are driven by detected profile
|
|
5
|
+
# (primary_language + secondary_languages); mixed-stack repos receive every
|
|
6
|
+
# matching block.
|
|
7
|
+
|
|
8
|
+
# ==============================================================================
|
|
9
|
+
# OS / editor / tooling (universal)
|
|
10
|
+
# ==============================================================================
|
|
11
|
+
.DS_Store
|
|
12
|
+
Thumbs.db
|
|
13
|
+
*.swp
|
|
14
|
+
*.swo
|
|
15
|
+
.idea/
|
|
16
|
+
.vscode/*
|
|
17
|
+
!.vscode/extensions.json
|
|
18
|
+
!.vscode/settings.json
|
|
19
|
+
.cursor/*
|
|
20
|
+
!.cursor/rules/
|
|
21
|
+
!.cursor/rules/**
|
|
22
|
+
.zed/
|
|
23
|
+
|
|
24
|
+
# ==============================================================================
|
|
25
|
+
# Environment / secrets — NEVER commit these
|
|
26
|
+
# ==============================================================================
|
|
27
|
+
.env
|
|
28
|
+
.env.*
|
|
29
|
+
!.env.example
|
|
30
|
+
!.env.*.example
|
|
31
|
+
*.pem
|
|
32
|
+
*.key
|
|
33
|
+
*.p12
|
|
34
|
+
|
|
35
|
+
# ==============================================================================
|
|
36
|
+
# AI coding agents — managed repo-local git worktrees
|
|
37
|
+
# ==============================================================================
|
|
38
|
+
.claude/worktrees/
|
|
39
|
+
.opencode/worktrees/
|
|
40
|
+
.codex/worktrees/
|
|
41
|
+
.cursor/worktrees/
|
|
42
|
+
.omp/worktrees/
|
|
43
|
+
.agents/worktrees/
|
|
44
|
+
|
|
45
|
+
# ==============================================================================
|
|
46
|
+
# Claude Code / agent scratch
|
|
47
|
+
# ==============================================================================
|
|
48
|
+
.claude/session-data/
|
|
49
|
+
.claude/plans/
|
|
50
|
+
|
|
51
|
+
{{#IF_RUST}}
|
|
52
|
+
# ==============================================================================
|
|
53
|
+
# Rust
|
|
54
|
+
# ==============================================================================
|
|
55
|
+
/target/
|
|
56
|
+
**/*.rs.bk
|
|
57
|
+
# Uncomment the next line for libraries (binaries should commit Cargo.lock):
|
|
58
|
+
# Cargo.lock
|
|
59
|
+
{{/IF_RUST}}
|
|
60
|
+
{{#IF_GO}}
|
|
61
|
+
# ==============================================================================
|
|
62
|
+
# Go
|
|
63
|
+
# ==============================================================================
|
|
64
|
+
/bin/
|
|
65
|
+
/dist/
|
|
66
|
+
*.exe
|
|
67
|
+
*.test
|
|
68
|
+
*.out
|
|
69
|
+
vendor/
|
|
70
|
+
{{/IF_GO}}
|
|
71
|
+
{{#IF_PYTHON}}
|
|
72
|
+
# ==============================================================================
|
|
73
|
+
# Python
|
|
74
|
+
# ==============================================================================
|
|
75
|
+
__pycache__/
|
|
76
|
+
*.py[cod]
|
|
77
|
+
*$py.class
|
|
78
|
+
*.egg-info/
|
|
79
|
+
.pytest_cache/
|
|
80
|
+
.mypy_cache/
|
|
81
|
+
.ruff_cache/
|
|
82
|
+
.tox/
|
|
83
|
+
.coverage
|
|
84
|
+
htmlcov/
|
|
85
|
+
dist/
|
|
86
|
+
build/
|
|
87
|
+
.venv/
|
|
88
|
+
venv/
|
|
89
|
+
{{/IF_PYTHON}}
|
|
90
|
+
{{#IF_TS}}
|
|
91
|
+
# ==============================================================================
|
|
92
|
+
# Node / TypeScript
|
|
93
|
+
# ==============================================================================
|
|
94
|
+
node_modules/
|
|
95
|
+
dist/
|
|
96
|
+
build/
|
|
97
|
+
.next/
|
|
98
|
+
.turbo/
|
|
99
|
+
.cache/
|
|
100
|
+
*.tsbuildinfo
|
|
101
|
+
npm-debug.log*
|
|
102
|
+
pnpm-debug.log*
|
|
103
|
+
yarn-debug.log*
|
|
104
|
+
yarn-error.log*
|
|
105
|
+
{{/IF_TS}}
|
|
106
|
+
{{#IF_TERRAFORM}}
|
|
107
|
+
# ==============================================================================
|
|
108
|
+
# Terraform
|
|
109
|
+
# ==============================================================================
|
|
110
|
+
.terraform/
|
|
111
|
+
*.tfstate
|
|
112
|
+
*.tfstate.*
|
|
113
|
+
*.tfvars
|
|
114
|
+
!*.tfvars.example
|
|
115
|
+
crash.log
|
|
116
|
+
crash.*.log
|
|
117
|
+
override.tf
|
|
118
|
+
override.tf.json
|
|
119
|
+
*_override.tf
|
|
120
|
+
*_override.tf.json
|
|
121
|
+
{{/IF_TERRAFORM}}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
# <type>(<scope>): <short summary> (≤ 72 chars)
|
|
2
|
+
|
|
3
|
+
# <body — what changed and why, wrap at 72 chars>
|
|
4
|
+
|
|
5
|
+
# <footer>
|
|
6
|
+
# - BREAKING CHANGE: <description> (if applicable)
|
|
7
|
+
# - Closes #<issue>
|
|
8
|
+
#
|
|
9
|
+
# ─────────────────────────────────────────────────────────────────────────────
|
|
10
|
+
# Types (Conventional Commits 1.0.0):
|
|
11
|
+
# feat new user-facing feature (minor version bump)
|
|
12
|
+
# fix user-facing bug fix (patch version bump)
|
|
13
|
+
# docs documentation changes
|
|
14
|
+
# refactor code change that neither fixes a bug nor adds a feature
|
|
15
|
+
# perf performance improvement
|
|
16
|
+
# test test additions or corrections
|
|
17
|
+
# build build system / external dependencies
|
|
18
|
+
# ci CI config / scripts
|
|
19
|
+
# chore housekeeping (no production code change)
|
|
20
|
+
# style cosmetic changes (formatting, whitespace)
|
|
21
|
+
# revert reverts a previous commit
|
|
22
|
+
#
|
|
23
|
+
# Scope: lowercase area/module, e.g. feat(auth): …
|
|
24
|
+
# Breaking change: append `!` after type OR add `BREAKING CHANGE:` footer.
|
|
25
|
+
# Internal docs (not for release notes): use `docs(internal): …`.
|
|
26
|
+
#
|
|
27
|
+
# {{PROJECT_NAME}} • generated by the init workflow
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
# install-lefthook.sh — idempotent lefthook bootstrap for {{PROJECT_NAME}}
|
|
3
|
+
#
|
|
4
|
+
# Ensures the `lefthook` binary is installed and activates hooks via `lefthook install`.
|
|
5
|
+
# Safe to re-run on every checkout. Supports macOS, Linux, and Git Bash on Windows.
|
|
6
|
+
# Native Windows PowerShell is not supported — use WSL or Git Bash.
|
|
7
|
+
|
|
8
|
+
set -euo pipefail
|
|
9
|
+
|
|
10
|
+
log() { printf '[install-lefthook] %s\n' "$*"; }
|
|
11
|
+
warn() { printf '[install-lefthook] WARN: %s\n' "$*" >&2; }
|
|
12
|
+
die() { printf '[install-lefthook] ERROR: %s\n' "$*" >&2; exit 1; }
|
|
13
|
+
|
|
14
|
+
command_exists() { command -v "$1" >/dev/null 2>&1; }
|
|
15
|
+
|
|
16
|
+
repo_root() {
|
|
17
|
+
if command_exists git && git rev-parse --show-toplevel >/dev/null 2>&1; then
|
|
18
|
+
git rev-parse --show-toplevel
|
|
19
|
+
else
|
|
20
|
+
pwd
|
|
21
|
+
fi
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
REPO_ROOT="$(repo_root)"
|
|
25
|
+
cd "$REPO_ROOT"
|
|
26
|
+
|
|
27
|
+
if [[ ! -f "$REPO_ROOT/lefthook.yml" && ! -f "$REPO_ROOT/lefthook.yaml" ]]; then
|
|
28
|
+
die "no lefthook.yml / lefthook.yaml found at $REPO_ROOT. Run this from a repo scaffolded with 'init --git'."
|
|
29
|
+
fi
|
|
30
|
+
|
|
31
|
+
# -----------------------------------------------------------------------------
|
|
32
|
+
# Pre-flight: warn on foreign hook manager
|
|
33
|
+
# -----------------------------------------------------------------------------
|
|
34
|
+
if [[ -f "$REPO_ROOT/.pre-commit-config.yaml" ]]; then
|
|
35
|
+
warn ".pre-commit-config.yaml detected — this repo may still be wired to the pre-commit framework."
|
|
36
|
+
warn "Run 'pre-commit uninstall' (and optionally delete .pre-commit-config.yaml) before continuing."
|
|
37
|
+
fi
|
|
38
|
+
if [[ -d "$REPO_ROOT/.husky" ]]; then
|
|
39
|
+
warn ".husky/ directory detected — husky may still be wired. Remove it if you're migrating to lefthook."
|
|
40
|
+
fi
|
|
41
|
+
|
|
42
|
+
# -----------------------------------------------------------------------------
|
|
43
|
+
# Ensure lefthook binary is available
|
|
44
|
+
# -----------------------------------------------------------------------------
|
|
45
|
+
install_lefthook_binary() {
|
|
46
|
+
# Prefer the project's own package manager if it can install lefthook.
|
|
47
|
+
# {{PACKAGE_MANAGER}} was detected at init time.
|
|
48
|
+
if [[ -f "$REPO_ROOT/package.json" ]]; then
|
|
49
|
+
log "package.json present — running '{{PACKAGE_MANAGER}} install' to pull devDependencies."
|
|
50
|
+
local pm="{{PACKAGE_MANAGER}}"
|
|
51
|
+
case "$pm" in
|
|
52
|
+
pnpm) pnpm install ;;
|
|
53
|
+
yarn) yarn install ;;
|
|
54
|
+
bun) bun install ;;
|
|
55
|
+
*) npm install ;;
|
|
56
|
+
esac
|
|
57
|
+
if command_exists lefthook || [[ -x "$REPO_ROOT/node_modules/.bin/lefthook" ]]; then
|
|
58
|
+
return 0
|
|
59
|
+
fi
|
|
60
|
+
fi
|
|
61
|
+
|
|
62
|
+
if command_exists lefthook; then
|
|
63
|
+
return 0
|
|
64
|
+
fi
|
|
65
|
+
|
|
66
|
+
log "lefthook not on PATH — attempting system install."
|
|
67
|
+
|
|
68
|
+
local uname_s
|
|
69
|
+
uname_s="$(uname -s 2>/dev/null || echo unknown)"
|
|
70
|
+
case "$uname_s" in
|
|
71
|
+
Darwin)
|
|
72
|
+
if command_exists brew; then
|
|
73
|
+
log "installing via Homebrew"
|
|
74
|
+
brew install lefthook
|
|
75
|
+
return 0
|
|
76
|
+
fi
|
|
77
|
+
;;
|
|
78
|
+
Linux|MSYS*|MINGW*|CYGWIN*)
|
|
79
|
+
if command_exists brew; then
|
|
80
|
+
log "installing via Homebrew"
|
|
81
|
+
brew install lefthook
|
|
82
|
+
return 0
|
|
83
|
+
fi
|
|
84
|
+
;;
|
|
85
|
+
esac
|
|
86
|
+
|
|
87
|
+
if command_exists go; then
|
|
88
|
+
log "installing via 'go install'"
|
|
89
|
+
GO111MODULE=on go install github.com/evilmartians/lefthook@latest
|
|
90
|
+
return 0
|
|
91
|
+
fi
|
|
92
|
+
|
|
93
|
+
if command_exists cargo; then
|
|
94
|
+
log "installing via 'cargo install'"
|
|
95
|
+
cargo install lefthook
|
|
96
|
+
return 0
|
|
97
|
+
fi
|
|
98
|
+
|
|
99
|
+
if command_exists pipx; then
|
|
100
|
+
log "installing via pipx"
|
|
101
|
+
pipx install lefthook
|
|
102
|
+
return 0
|
|
103
|
+
fi
|
|
104
|
+
|
|
105
|
+
die "could not auto-install lefthook. Install it manually: https://github.com/evilmartians/lefthook#installation"
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
install_lefthook_binary
|
|
109
|
+
|
|
110
|
+
# -----------------------------------------------------------------------------
|
|
111
|
+
# Resolve the binary path (project-local node_modules wins over global)
|
|
112
|
+
# -----------------------------------------------------------------------------
|
|
113
|
+
LEFTHOOK_BIN=""
|
|
114
|
+
if [[ -x "$REPO_ROOT/node_modules/.bin/lefthook" ]]; then
|
|
115
|
+
LEFTHOOK_BIN="$REPO_ROOT/node_modules/.bin/lefthook"
|
|
116
|
+
elif command_exists lefthook; then
|
|
117
|
+
LEFTHOOK_BIN="$(command -v lefthook)"
|
|
118
|
+
else
|
|
119
|
+
die "lefthook binary still not found after install attempts."
|
|
120
|
+
fi
|
|
121
|
+
|
|
122
|
+
log "using lefthook at: $LEFTHOOK_BIN"
|
|
123
|
+
|
|
124
|
+
# -----------------------------------------------------------------------------
|
|
125
|
+
# Activate hooks
|
|
126
|
+
# -----------------------------------------------------------------------------
|
|
127
|
+
"$LEFTHOOK_BIN" install
|
|
128
|
+
|
|
129
|
+
log "done. Hooks wired at $REPO_ROOT/.git/hooks/."
|
|
130
|
+
log "verify with: $LEFTHOOK_BIN dump"
|
|
131
|
+
log "bypass once with: git commit --no-verify"
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
# Lefthook — Git Hooks for {{PROJECT_NAME}}
|
|
2
|
+
|
|
3
|
+
This project uses [lefthook](https://github.com/evilmartians/lefthook) — a fast,
|
|
4
|
+
cross-platform git hook manager — to run linters, formatters, and validation
|
|
5
|
+
automatically around git operations.
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## First-time setup
|
|
10
|
+
|
|
11
|
+
Run the bootstrap once per checkout:
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
./scripts/install-lefthook.sh
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
The script installs the `lefthook` binary (prefers the project's package manager,
|
|
18
|
+
falls back to Homebrew, Go, Cargo, or pipx) and wires hooks via `lefthook install`.
|
|
19
|
+
It is safe to re-run.
|
|
20
|
+
|
|
21
|
+
{{#IF_TS}}
|
|
22
|
+
For Node/TypeScript projects, `npm install` alone is often enough — a `prepare`
|
|
23
|
+
hook in `package.json` can run `lefthook install` automatically.
|
|
24
|
+
{{/IF_TS}}
|
|
25
|
+
|
|
26
|
+
---
|
|
27
|
+
|
|
28
|
+
## What the hooks do
|
|
29
|
+
|
|
30
|
+
| Stage | Purpose | When it fires |
|
|
31
|
+
| ------------ | -------------------------------------------------- | ---------------------------- |
|
|
32
|
+
| `pre-commit` | Lint + format staged files (stack-specific) | Before each `git commit` |
|
|
33
|
+
{{#IF_TEST_CMD}}
|
|
34
|
+
| `pre-push` | Run the test suite (`{{TEST_CMD}}`) | Before each `git push` |
|
|
35
|
+
{{/IF_TEST_CMD}}
|
|
36
|
+
{{#IF_NO_TEST_CMD}}
|
|
37
|
+
| `pre-push` | Not configured (no test command detected) | — |
|
|
38
|
+
{{/IF_NO_TEST_CMD}}
|
|
39
|
+
{{#IF_TS}}
|
|
40
|
+
| `commit-msg` | Validate commit message against Conventional Commits via commitlint | On each `git commit` |
|
|
41
|
+
{{/IF_TS}}
|
|
42
|
+
|
|
43
|
+
Pre-commit commands receive `{staged_files}` from lefthook so they only touch
|
|
44
|
+
files in the git index — fast, focused feedback. Files auto-fixed by the linter
|
|
45
|
+
are re-staged via `stage_fixed: true`.
|
|
46
|
+
|
|
47
|
+
---
|
|
48
|
+
|
|
49
|
+
## Bypassing hooks
|
|
50
|
+
|
|
51
|
+
- **One commit**: `git commit --no-verify`
|
|
52
|
+
- **One push**: `git push --no-verify`
|
|
53
|
+
- **In CI**: lefthook checks the `CI=true` env var and skips hooks automatically.
|
|
54
|
+
No special config is needed for GitHub Actions or similar platforms.
|
|
55
|
+
|
|
56
|
+
---
|
|
57
|
+
|
|
58
|
+
## Extending the config
|
|
59
|
+
|
|
60
|
+
Edit `lefthook.yml` at the project root. Common additions:
|
|
61
|
+
|
|
62
|
+
```yaml
|
|
63
|
+
pre-commit:
|
|
64
|
+
commands:
|
|
65
|
+
custom-check:
|
|
66
|
+
run: <your command>
|
|
67
|
+
glob: "*.<extension>"
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
See the [lefthook documentation](https://github.com/evilmartians/lefthook/blob/master/docs/configuration.md)
|
|
71
|
+
for the full schema, placeholders (`{staged_files}`, `{all_files}`, `{1}`, etc.),
|
|
72
|
+
and available lifecycle stages (`pre-commit`, `commit-msg`, `pre-push`,
|
|
73
|
+
`post-checkout`, `post-merge`, …).
|
|
74
|
+
|
|
75
|
+
---
|
|
76
|
+
|
|
77
|
+
## Troubleshooting
|
|
78
|
+
|
|
79
|
+
- **Hook didn't fire**: run `lefthook dump` to confirm the config is loaded, then
|
|
80
|
+
`ls -la .git/hooks/` to confirm the hook files are present.
|
|
81
|
+
- **Hook fires but fails immediately**: the binary may not be on `$PATH`. The
|
|
82
|
+
install script sets up a local `node_modules/.bin/lefthook` for Node projects
|
|
83
|
+
or installs globally otherwise. Re-run `./scripts/install-lefthook.sh`.
|
|
84
|
+
- **Need to skip a specific file**: add an `exclude:` glob under the command in
|
|
85
|
+
`lefthook.yml`. See the docs linked above.
|
|
86
|
+
|
|
87
|
+
---
|
|
88
|
+
|
|
89
|
+
## Migrating from another hook manager
|
|
90
|
+
|
|
91
|
+
If contributors previously used `pre-commit` (the Python framework) or `husky`:
|
|
92
|
+
|
|
93
|
+
```bash
|
|
94
|
+
# pre-commit framework
|
|
95
|
+
pre-commit uninstall
|
|
96
|
+
|
|
97
|
+
# husky
|
|
98
|
+
rm -rf .husky
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
Then run `./scripts/install-lefthook.sh` to rewrite `.git/hooks/` cleanly.
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
# lefthook.yml — git hook manager for {{PROJECT_NAME}}
|
|
2
|
+
#
|
|
3
|
+
# Install with ./scripts/install-lefthook.sh (bootstraps the binary and runs
|
|
4
|
+
# `lefthook install` to wire .git/hooks). See docs/lefthook-usage.md for details.
|
|
5
|
+
#
|
|
6
|
+
# Bypass a hook once: git commit --no-verify / git push --no-verify
|
|
7
|
+
# Skip in CI: lefthook checks CI=true automatically; no config needed.
|
|
8
|
+
|
|
9
|
+
pre-commit:
|
|
10
|
+
parallel: true
|
|
11
|
+
commands:
|
|
12
|
+
{{#IF_RUST}}
|
|
13
|
+
fmt:
|
|
14
|
+
run: cargo fmt --check
|
|
15
|
+
glob: "*.rs"
|
|
16
|
+
clippy:
|
|
17
|
+
run: cargo clippy --all-targets -- -D warnings
|
|
18
|
+
glob: "*.rs"
|
|
19
|
+
{{/IF_RUST}}
|
|
20
|
+
{{#IF_GO}}
|
|
21
|
+
gofmt:
|
|
22
|
+
run: gofmt -l {staged_files} | (! grep .)
|
|
23
|
+
glob: "*.go"
|
|
24
|
+
vet:
|
|
25
|
+
run: go vet ./...
|
|
26
|
+
glob: "*.go"
|
|
27
|
+
{{/IF_GO}}
|
|
28
|
+
{{#IF_PYTHON}}
|
|
29
|
+
ruff:
|
|
30
|
+
run: ruff check --fix {staged_files}
|
|
31
|
+
glob: "*.{py,pyi}"
|
|
32
|
+
stage_fixed: true
|
|
33
|
+
black:
|
|
34
|
+
run: black {staged_files}
|
|
35
|
+
glob: "*.{py,pyi}"
|
|
36
|
+
stage_fixed: true
|
|
37
|
+
{{/IF_PYTHON}}
|
|
38
|
+
{{#IF_TS}}
|
|
39
|
+
biome:
|
|
40
|
+
run: npx --no -- biome check --write --no-errors-on-unmatched {staged_files}
|
|
41
|
+
glob: "*.{ts,tsx,js,jsx,mjs,cjs,mts,cts,json,jsonc,css}"
|
|
42
|
+
stage_fixed: true
|
|
43
|
+
typecheck:
|
|
44
|
+
run: npx --no -- tsc --noEmit
|
|
45
|
+
glob: "*.{ts,tsx,mts,cts}"
|
|
46
|
+
{{/IF_TS}}
|
|
47
|
+
|
|
48
|
+
{{#IF_TEST_CMD}}
|
|
49
|
+
pre-push:
|
|
50
|
+
commands:
|
|
51
|
+
test:
|
|
52
|
+
run: {{TEST_CMD}}
|
|
53
|
+
{{/IF_TEST_CMD}}
|
|
54
|
+
{{#IF_NO_TEST_CMD}}
|
|
55
|
+
# No test command was detected, so no pre-push hook is configured.
|
|
56
|
+
# Add `pre-push: commands: test: run: <your test command>` when one exists.
|
|
57
|
+
{{/IF_NO_TEST_CMD}}
|
|
58
|
+
|
|
59
|
+
{{#IF_TS}}
|
|
60
|
+
commit-msg:
|
|
61
|
+
commands:
|
|
62
|
+
commitlint:
|
|
63
|
+
run: npx --no -- commitlint --edit {1}
|
|
64
|
+
{{/IF_TS}}
|