@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,210 @@
|
|
|
1
|
+
# Release Preparation: Preflight through Manifest Review
|
|
2
|
+
|
|
3
|
+
## Contents
|
|
4
|
+
|
|
5
|
+
- Phase 0: Preflight
|
|
6
|
+
- Phase 1: Detect project
|
|
7
|
+
- Phase 2: Propose version and compute bump
|
|
8
|
+
- Branch check
|
|
9
|
+
- Backport gate (patch under release-branches)
|
|
10
|
+
- Phase 3: Resolve release target matrix
|
|
11
|
+
- Phase 4: Draft changelog and release notes
|
|
12
|
+
- Internal vs. user-facing commits
|
|
13
|
+
- Phase 5: Bump version in manifests
|
|
14
|
+
|
|
15
|
+
## Phase 0: Preflight
|
|
16
|
+
|
|
17
|
+
Before anything else, verify:
|
|
18
|
+
|
|
19
|
+
1. Working directory is a git repo: `git rev-parse --show-toplevel` succeeds.
|
|
20
|
+
2. Working tree is clean: `git status --porcelain` is empty. If dirty, STOP and ask
|
|
21
|
+
whether to stash or abort — never silently move forward with uncommitted changes.
|
|
22
|
+
3. `gh` is installed and authenticated when `--ci-config` is absent but the user
|
|
23
|
+
asked for a GitHub release. Also required when `--ci` is set, since the
|
|
24
|
+
auto-fix loop calls `gh run list`, `gh workflow run`, and `gh release` under
|
|
25
|
+
the hood. Surface install/login hints if missing.
|
|
26
|
+
4. If `version` was provided, it matches the regex
|
|
27
|
+
`^v?[0-9]+\.[0-9]+\.[0-9]+(-[A-Za-z0-9.-]+)?(\+[A-Za-z0-9.-]+)?$`. Reject malformed
|
|
28
|
+
input with a clear error.
|
|
29
|
+
5. Read the project's release model:
|
|
30
|
+
|
|
31
|
+
```
|
|
32
|
+
{{package-root}}/shared/scripts/release-state.sh get
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
- `present=0` (no `RELEASING.md`): say so once and offer to run `/ycc:release-model`
|
|
36
|
+
first. If the user declines, continue exactly as this skill always has.
|
|
37
|
+
- Exit 2 (malformed state block): STOP. Show the parse error and point at
|
|
38
|
+
`/ycc:release-model --audit`. Never guess a trunk from a broken block.
|
|
39
|
+
- `present=1`: keep `model` and `trunk`. The model's rules are in
|
|
40
|
+
`{{package-root}}/shared/references/branching-model.md`; how this skill
|
|
41
|
+
applies them is in
|
|
42
|
+
`{{package-root}}/skills/releaser/references/release-branches.md`.
|
|
43
|
+
|
|
44
|
+
If any check fails, STOP and surface a specific remediation — do not continue past
|
|
45
|
+
Phase 0 with known-bad preconditions.
|
|
46
|
+
|
|
47
|
+
## Phase 1: Detect project
|
|
48
|
+
|
|
49
|
+
Run:
|
|
50
|
+
|
|
51
|
+
```
|
|
52
|
+
{{package-root}}/skills/releaser/scripts/detect-project.sh
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
The helper emits a single JSON document to stdout describing:
|
|
56
|
+
|
|
57
|
+
- `language` — primary language (`node`, `python`, `go`, `rust`, `docker`, `mixed`,
|
|
58
|
+
`generic`).
|
|
59
|
+
- `build_system` — `npm` / `pnpm` / `yarn` / `poetry` / `uv` / `hatch` / `setuptools` /
|
|
60
|
+
`cargo` / `go-modules` / `docker` / `none`.
|
|
61
|
+
- `manifest_files` — list of version-bearing files.
|
|
62
|
+
- `default_os` and `default_arch` — sensible defaults for that language.
|
|
63
|
+
- `existing_ci` — list of `.github/workflows/*.yml` files already present.
|
|
64
|
+
- `current_version` — extracted from the manifest, or `null` if not found.
|
|
65
|
+
- `latest_tag` — output of `git describe --tags --abbrev=0 2>/dev/null` or `null`.
|
|
66
|
+
|
|
67
|
+
If `--platform` was passed, override the detected `language` field before continuing.
|
|
68
|
+
|
|
69
|
+
`latest_tag` is the nearest tag reachable from `HEAD`. Under release-branches that is
|
|
70
|
+
the latest `vX.Y.*` tag on `release/X.Y`, but the previous minor's `.0` tag (or a
|
|
71
|
+
pre-release tag) on the trunk, because patch tags are not reachable from the trunk. See
|
|
72
|
+
"Previous tag and changelog range" in `references/release-branches.md` for when to pass
|
|
73
|
+
an explicit from-ref instead.
|
|
74
|
+
|
|
75
|
+
See `references/project-type-matrix.md` for the full language → toolchain → default
|
|
76
|
+
matrix.
|
|
77
|
+
|
|
78
|
+
## Phase 2: Propose version and compute bump
|
|
79
|
+
|
|
80
|
+
If the user did NOT supply a version:
|
|
81
|
+
|
|
82
|
+
1. Collect commits since `latest_tag` (or the last 50 if no tag exists):
|
|
83
|
+
`git log <latest_tag>..HEAD --format="%s"`.
|
|
84
|
+
2. Classify each commit against conventional-commit types. Determine the bump:
|
|
85
|
+
- Any `!` marker, `BREAKING CHANGE` footer, or `major:` → major.
|
|
86
|
+
- Any `feat:` → minor.
|
|
87
|
+
- Otherwise → patch.
|
|
88
|
+
3. Propose the next semver and ASK for confirmation before writing anything.
|
|
89
|
+
|
|
90
|
+
If the user DID supply a version, sanity-check the bump magnitude against commit
|
|
91
|
+
history. Surface a concern if they are mismatched (e.g. `feat:` commits but a patch
|
|
92
|
+
bump) and require explicit confirmation before continuing.
|
|
93
|
+
|
|
94
|
+
The release model (from `release-state.sh get`) decides how commit types map to the bump:
|
|
95
|
+
|
|
96
|
+
- **No RELEASING.md, or trunk-only:** the rules above apply as written. Every release is
|
|
97
|
+
cut from the trunk, so `feat:` commits mean the next release is a minor; a patch
|
|
98
|
+
requested over `feat:` commits gets the mismatch concern.
|
|
99
|
+
- **release-branches, on `release/X.Y`:** the branch bounds the bump to the next
|
|
100
|
+
`X.Y.Z` patch. Everything on the branch is a deliberate backport, so a `feat:`
|
|
101
|
+
cherry-pick is expected and does NOT raise the mismatch concern or make it a minor.
|
|
102
|
+
Only a breaking change (`!` / `BREAKING CHANGE`) on the branch gets a warning: it
|
|
103
|
+
should not have been backported. The patch is still the only valid version there.
|
|
104
|
+
- **release-branches, on the trunk:** propose only a minor or major. A fixes-only trunk
|
|
105
|
+
still ships as the next minor; patches come from `release/X.Y`.
|
|
106
|
+
|
|
107
|
+
### Branch check
|
|
108
|
+
|
|
109
|
+
Once the version is confirmed, run:
|
|
110
|
+
|
|
111
|
+
```
|
|
112
|
+
{{package-root}}/skills/releaser/scripts/check-release-branch.sh <new-version>
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
- Exit 0: keep its `kind`, `branch`, `creates_maintenance`, `backport_label` and
|
|
116
|
+
`forward_port` output for Phases 5, 7 and 8. With `present=0` it only prints a note
|
|
117
|
+
on stderr that repeats Phase 0's; do not show it a second time.
|
|
118
|
+
- Exit 1: STOP. Show its stderr verbatim; it names the right branch and the exact fix
|
|
119
|
+
commands (e.g. `git switch release/0.5`, or `git switch <trunk>`). Do not switch
|
|
120
|
+
branches for the user.
|
|
121
|
+
- Exit 2: STOP with the parse error, as in Phase 0.
|
|
122
|
+
|
|
123
|
+
### Backport gate (patch under release-branches)
|
|
124
|
+
|
|
125
|
+
When the branch check reports `model=release-branches` and `kind=patch`, confirm that
|
|
126
|
+
every fix meant for the line reached it **before** writing any file:
|
|
127
|
+
|
|
128
|
+
```
|
|
129
|
+
{{package-root}}/shared/scripts/backport-audit.sh release/X.Y
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
Follow "Backport gate" in `references/release-branches.md`: `missing` and `in-review`
|
|
133
|
+
rows STOP the release, `unlabelled` rows need the user's decision, and a gate that cannot
|
|
134
|
+
run (`gh` unavailable) fails closed. Never skip it, and never answer its questions for the
|
|
135
|
+
user, including under `/goal` or `--dry-run` (which reports the result without asking).
|
|
136
|
+
|
|
137
|
+
## Phase 3: Resolve release target matrix
|
|
138
|
+
|
|
139
|
+
Build the final `{os × arch}` matrix:
|
|
140
|
+
|
|
141
|
+
1. Start with `default_os` / `default_arch` from Phase 1.
|
|
142
|
+
2. If `--os` or `--arch` was passed, replace the corresponding axis entirely.
|
|
143
|
+
3. Reject combinations with no known build recipe (e.g. `windows × arm` for languages
|
|
144
|
+
where cross-compilation is unsupported) — list the invalid combos and ask whether to
|
|
145
|
+
drop or abort.
|
|
146
|
+
|
|
147
|
+
Store the matrix for Phases 5, 6, and 7.
|
|
148
|
+
|
|
149
|
+
## Phase 4: Draft changelog and release notes
|
|
150
|
+
|
|
151
|
+
Unless `--skip-notes` was passed:
|
|
152
|
+
|
|
153
|
+
1. Invoke the changelog helper and capture its stdout:
|
|
154
|
+
|
|
155
|
+
```
|
|
156
|
+
{{package-root}}/skills/releaser/scripts/draft-changelog.sh [--exclude-internal] [--template <path>] <new-version> [<from-ref>]
|
|
157
|
+
```
|
|
158
|
+
|
|
159
|
+
Pass an explicit `<from-ref>` when the default (`git describe --tags --abbrev=0`)
|
|
160
|
+
picks the wrong previous tag — on `release/X.Y`, or for a final `X.Y.0` after trunk
|
|
161
|
+
pre-releases; see `references/release-branches.md`.
|
|
162
|
+
Pass `--exclude-internal` if the user requested it. Pass `--template <path>` if the
|
|
163
|
+
user supplied a custom template path. The helper fills the template placeholders
|
|
164
|
+
(`{{VERSION}}`, `{{DATE}}`, `{{HIGHLIGHTS}}`, `{{BREAKING}}`, `{{FEATURES}}`,
|
|
165
|
+
`{{FIXES}}`, `{{INTERNAL}}`, `{{COMMITS}}`, `{{COMPARE_URL}}`, `{{PREVIOUS_TAG}}`)
|
|
166
|
+
from git history and writes the complete rendered document to stdout.
|
|
167
|
+
|
|
168
|
+
2. Write the captured stdout to `docs/releases/<new-version>.md` (or
|
|
169
|
+
`.github/releases/<version>.md` if the repo already uses that path). This is the
|
|
170
|
+
notes file that the `gh release create` command consumes.
|
|
171
|
+
|
|
172
|
+
3. Update `CHANGELOG.md` by prepending a slim version of the same content — Summary and
|
|
173
|
+
per-category sections only, no `<details>` blocks — above any `## [Unreleased]`
|
|
174
|
+
marker. If no `CHANGELOG.md` exists, create one using the template seeded from
|
|
175
|
+
`{{package-root}}/skills/releaser/references/release-notes-template.md`.
|
|
176
|
+
|
|
177
|
+
Ask the user to review the drafted Summary and Upgrade Notes sections before moving on.
|
|
178
|
+
|
|
179
|
+
### Internal vs. user-facing commits
|
|
180
|
+
|
|
181
|
+
Commits typed `docs`, `chore`, `test`, `build`, `ci`, `style`, and `refactor` are
|
|
182
|
+
classified as Maintenance. The helper surfaces them in a collapsible `<details>` block
|
|
183
|
+
so they are visible but not dominant. Pass `--exclude-internal` to drop the Maintenance
|
|
184
|
+
section entirely — use this only when the release genuinely contains no internal-only
|
|
185
|
+
churn worth surfacing; otherwise keep the section so reviewers have full context.
|
|
186
|
+
|
|
187
|
+
## Phase 5: Bump version in manifests
|
|
188
|
+
|
|
189
|
+
Edit only the files named in `manifest_files` from Phase 1. Common targets:
|
|
190
|
+
|
|
191
|
+
- `package.json` → `version` field.
|
|
192
|
+
- `pyproject.toml` → `[project].version` or `[tool.poetry].version`.
|
|
193
|
+
- `Cargo.toml` → `[package].version`.
|
|
194
|
+
- `go.mod` does not carry a version; the tag IS the version. Skip the bump step.
|
|
195
|
+
- `Dockerfile` or `docker-compose.yml` labels → update if the repo uses
|
|
196
|
+
`org.opencontainers.image.version`.
|
|
197
|
+
|
|
198
|
+
NEVER edit files outside that list — with one exception: when the Phase 2 branch check
|
|
199
|
+
printed a non-empty `creates_maintenance=release/X.Y`, also record the new maintenance
|
|
200
|
+
branch so the state change lands in the release commit:
|
|
201
|
+
|
|
202
|
+
```
|
|
203
|
+
{{package-root}}/shared/scripts/release-state-update.sh --add-maintenance release/X.Y
|
|
204
|
+
```
|
|
205
|
+
|
|
206
|
+
It edits only `RELEASING.md` (and may move a branch past the support window to
|
|
207
|
+
`frozen`); it never commits. Include `RELEASING.md` in the diff summary. Under
|
|
208
|
+
`--dry-run`, add `--dry-run` so it prints the diff instead of writing.
|
|
209
|
+
|
|
210
|
+
After edits, emit a diff summary and STOP for user review before continuing.
|
|
@@ -0,0 +1,235 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
# check-release-branch.sh — verify that a version is being released from the
|
|
3
|
+
# branch the repo's RELEASING.md names for it.
|
|
4
|
+
#
|
|
5
|
+
# Usage:
|
|
6
|
+
# check-release-branch.sh <version> [--repo DIR] [--branch NAME]
|
|
7
|
+
#
|
|
8
|
+
# Arguments:
|
|
9
|
+
# version X.Y.Z or X.Y.Z-pre (a leading "v" and "+build" are accepted)
|
|
10
|
+
#
|
|
11
|
+
# Options:
|
|
12
|
+
# --repo DIR repository to check (default: current directory)
|
|
13
|
+
# --branch NAME branch being released (default: git rev-parse --abbrev-ref HEAD)
|
|
14
|
+
#
|
|
15
|
+
# Rules (see the shared branching-model reference, "Models"):
|
|
16
|
+
# no RELEASING.md no check; a note on stderr suggests /release-model
|
|
17
|
+
# trunk-only every release is cut from the trunk
|
|
18
|
+
# release-branches X.Y.0 (minor/major, incl. pre-releases) from the trunk;
|
|
19
|
+
# X.Y.Z with Z > 0 from release/X.Y, which must be listed
|
|
20
|
+
# under maintenance (a frozen branch gets no patches)
|
|
21
|
+
#
|
|
22
|
+
# Output (stdout, key=value) on success:
|
|
23
|
+
# present model version kind branch trunk creates_maintenance
|
|
24
|
+
# backport_label forward_port
|
|
25
|
+
# kind is major (Y=0 and Z=0), minor (Z=0) or patch (Z>0).
|
|
26
|
+
# creates_maintenance is release/X.Y for a final X.Y.0 under release-branches.
|
|
27
|
+
# forward_port=1 for a patch under release-branches.
|
|
28
|
+
#
|
|
29
|
+
# Exit codes:
|
|
30
|
+
# 0 the branch is right for this version (or there is no RELEASING.md)
|
|
31
|
+
# 1 usage error, or wrong branch (fix commands printed on stderr)
|
|
32
|
+
# 2 RELEASING.md exists but its state block is malformed
|
|
33
|
+
|
|
34
|
+
set -euo pipefail
|
|
35
|
+
|
|
36
|
+
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
37
|
+
SHARED_SCRIPTS="${SCRIPT_DIR}/../../../shared/scripts"
|
|
38
|
+
STATE_SCRIPT="${SHARED_SCRIPTS}/release-state.sh"
|
|
39
|
+
|
|
40
|
+
usage() {
|
|
41
|
+
sed -n '2,32p' "${BASH_SOURCE[0]}" | sed 's/^# \{0,1\}//' >&2
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
_error() {
|
|
45
|
+
echo "check-release-branch: $*" >&2
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
REPO_DIR="."
|
|
49
|
+
BRANCH=""
|
|
50
|
+
VERSION=""
|
|
51
|
+
|
|
52
|
+
while [[ $# -gt 0 ]]; do
|
|
53
|
+
case "$1" in
|
|
54
|
+
--repo)
|
|
55
|
+
[[ $# -lt 2 ]] && { _error "--repo requires a directory"; exit 1; }
|
|
56
|
+
REPO_DIR="$2"
|
|
57
|
+
shift 2
|
|
58
|
+
;;
|
|
59
|
+
--branch)
|
|
60
|
+
[[ $# -lt 2 ]] && { _error "--branch requires a name"; exit 1; }
|
|
61
|
+
BRANCH="$2"
|
|
62
|
+
shift 2
|
|
63
|
+
;;
|
|
64
|
+
-h | --help)
|
|
65
|
+
usage
|
|
66
|
+
exit 0
|
|
67
|
+
;;
|
|
68
|
+
-*)
|
|
69
|
+
_error "unknown option: $1"
|
|
70
|
+
usage
|
|
71
|
+
exit 1
|
|
72
|
+
;;
|
|
73
|
+
*)
|
|
74
|
+
if [[ -n "$VERSION" ]]; then
|
|
75
|
+
_error "unexpected argument: $1"
|
|
76
|
+
exit 1
|
|
77
|
+
fi
|
|
78
|
+
VERSION="$1"
|
|
79
|
+
shift
|
|
80
|
+
;;
|
|
81
|
+
esac
|
|
82
|
+
done
|
|
83
|
+
|
|
84
|
+
if [[ -z "$VERSION" ]]; then
|
|
85
|
+
_error "a version is required"
|
|
86
|
+
usage
|
|
87
|
+
exit 1
|
|
88
|
+
fi
|
|
89
|
+
if [[ ! -d "$REPO_DIR" ]]; then
|
|
90
|
+
_error "no such directory: $REPO_DIR"
|
|
91
|
+
exit 1
|
|
92
|
+
fi
|
|
93
|
+
if [[ ! -f "$STATE_SCRIPT" ]]; then
|
|
94
|
+
_error "release-state.sh not found at ${STATE_SCRIPT}"
|
|
95
|
+
exit 1
|
|
96
|
+
fi
|
|
97
|
+
UPDATE_SCRIPT="$(cd "$SHARED_SCRIPTS" && pwd)/release-state-update.sh"
|
|
98
|
+
# Single-quoted: the Codex generator rewrites this to its own skill syntax, which
|
|
99
|
+
# must stay literal rather than expand as a shell variable.
|
|
100
|
+
RELEASE_MODEL_CMD='/release-model'
|
|
101
|
+
|
|
102
|
+
VERSION_RE='^v?([0-9]+)\.([0-9]+)\.([0-9]+)(-[0-9A-Za-z.-]+)?(\+[0-9A-Za-z.-]+)?$'
|
|
103
|
+
if [[ ! "$VERSION" =~ $VERSION_RE ]]; then
|
|
104
|
+
_error "'$VERSION' is not a semver version (X.Y.Z or X.Y.Z-pre)"
|
|
105
|
+
exit 1
|
|
106
|
+
fi
|
|
107
|
+
MAJOR="${BASH_REMATCH[1]}"
|
|
108
|
+
MINOR="${BASH_REMATCH[2]}"
|
|
109
|
+
PATCH="${BASH_REMATCH[3]}"
|
|
110
|
+
PRERELEASE="${BASH_REMATCH[4]}"
|
|
111
|
+
VERSION="${VERSION#v}"
|
|
112
|
+
LINE="${MAJOR}.${MINOR}"
|
|
113
|
+
LINE_BRANCH="release/${LINE}"
|
|
114
|
+
|
|
115
|
+
# Semver numbers compare numerically: 0.05.1 is 0.5.1.
|
|
116
|
+
if ((10#$PATCH > 0)); then
|
|
117
|
+
KIND="patch"
|
|
118
|
+
elif ((10#$MINOR == 0)); then
|
|
119
|
+
KIND="major"
|
|
120
|
+
else
|
|
121
|
+
KIND="minor"
|
|
122
|
+
fi
|
|
123
|
+
|
|
124
|
+
if [[ -z "$BRANCH" ]]; then
|
|
125
|
+
if ! BRANCH="$(git -C "$REPO_DIR" rev-parse --abbrev-ref HEAD 2>/dev/null)"; then
|
|
126
|
+
_error "cannot read the current branch in ${REPO_DIR} (not a git repo, or no commits)"
|
|
127
|
+
exit 1
|
|
128
|
+
fi
|
|
129
|
+
fi
|
|
130
|
+
|
|
131
|
+
STATE_RC=0
|
|
132
|
+
STATE="$(bash "$STATE_SCRIPT" --repo "$REPO_DIR" get)" || STATE_RC=$?
|
|
133
|
+
if [[ "$STATE_RC" -ne 0 ]]; then
|
|
134
|
+
# release-state.sh already printed the parse error on stderr.
|
|
135
|
+
[[ "$STATE_RC" -eq 2 ]] && _error "fix RELEASING.md before releasing (${RELEASE_MODEL_CMD} --audit)"
|
|
136
|
+
exit "$STATE_RC"
|
|
137
|
+
fi
|
|
138
|
+
|
|
139
|
+
# state_value <key> — value of key=value in the release-state output.
|
|
140
|
+
state_value() {
|
|
141
|
+
printf '%s\n' "$STATE" | sed -n "s/^$1=//p"
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
# in_list <comma-list> <item> — true when item is an entry of the list.
|
|
145
|
+
in_list() {
|
|
146
|
+
case ",$1," in
|
|
147
|
+
*",$2,"*) return 0 ;;
|
|
148
|
+
*) return 1 ;;
|
|
149
|
+
esac
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
# emit <model> <trunk> <creates_maintenance> <backport_label> <forward_port>
|
|
153
|
+
emit() {
|
|
154
|
+
echo "present=$([[ -n "$1" ]] && echo 1 || echo 0)"
|
|
155
|
+
echo "model=$1"
|
|
156
|
+
echo "version=${VERSION}"
|
|
157
|
+
echo "kind=${KIND}"
|
|
158
|
+
echo "branch=${BRANCH}"
|
|
159
|
+
echo "trunk=$2"
|
|
160
|
+
echo "creates_maintenance=$3"
|
|
161
|
+
echo "backport_label=$4"
|
|
162
|
+
echo "forward_port=$5"
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
# refuse <reason> <fix-command>... — print the reason and the fix, exit 1.
|
|
166
|
+
refuse() {
|
|
167
|
+
local reason="$1"
|
|
168
|
+
shift
|
|
169
|
+
_error "$reason"
|
|
170
|
+
if [[ $# -gt 0 ]]; then
|
|
171
|
+
echo "Fix:" >&2
|
|
172
|
+
printf ' %s\n' "$@" >&2
|
|
173
|
+
fi
|
|
174
|
+
exit 1
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
if [[ "$(state_value present)" != "1" ]]; then
|
|
178
|
+
echo "check-release-branch: no RELEASING.md; releasing from '${BRANCH}' without a branch check. Run ${RELEASE_MODEL_CMD} to record the release model." >&2
|
|
179
|
+
emit "" "" "" "" 0
|
|
180
|
+
exit 0
|
|
181
|
+
fi
|
|
182
|
+
|
|
183
|
+
MODEL="$(state_value model)"
|
|
184
|
+
TRUNK="$(state_value trunk)"
|
|
185
|
+
MAINTENANCE="$(state_value maintenance)"
|
|
186
|
+
FROZEN="$(state_value frozen)"
|
|
187
|
+
LABEL_TEMPLATE="$(state_value backport_label)"
|
|
188
|
+
|
|
189
|
+
if [[ "$MODEL" == "trunk-only" ]]; then
|
|
190
|
+
if [[ "$BRANCH" != "$TRUNK" ]]; then
|
|
191
|
+
refuse "trunk-only: every release is cut from '${TRUNK}', but the branch is '${BRANCH}'" \
|
|
192
|
+
"git switch ${TRUNK}" \
|
|
193
|
+
"git pull --ff-only origin ${TRUNK}"
|
|
194
|
+
fi
|
|
195
|
+
emit "$MODEL" "$TRUNK" "" "" 0
|
|
196
|
+
exit 0
|
|
197
|
+
fi
|
|
198
|
+
|
|
199
|
+
# release-branches
|
|
200
|
+
LABEL="${LABEL_TEMPLATE//\{X.Y\}/$LINE}"
|
|
201
|
+
|
|
202
|
+
if [[ "$KIND" != "patch" ]]; then
|
|
203
|
+
if [[ "$BRANCH" != "$TRUNK" ]]; then
|
|
204
|
+
refuse "release-branches: ${KIND} release ${VERSION} is cut from the trunk '${TRUNK}', not '${BRANCH}'" \
|
|
205
|
+
"git switch ${TRUNK}" \
|
|
206
|
+
"git pull --ff-only origin ${TRUNK}"
|
|
207
|
+
fi
|
|
208
|
+
CREATES=""
|
|
209
|
+
if [[ -z "$PRERELEASE" ]]; then
|
|
210
|
+
if in_list "$MAINTENANCE" "$LINE_BRANCH" || in_list "$FROZEN" "$LINE_BRANCH"; then
|
|
211
|
+
refuse "${LINE_BRANCH} is already recorded in RELEASING.md, so ${LINE}.0 has shipped; a fix for ${LINE} is a patch ${LINE}.<n> cut from ${LINE_BRANCH}"
|
|
212
|
+
fi
|
|
213
|
+
CREATES="$LINE_BRANCH"
|
|
214
|
+
fi
|
|
215
|
+
emit "$MODEL" "$TRUNK" "$CREATES" "$LABEL" 0
|
|
216
|
+
exit 0
|
|
217
|
+
fi
|
|
218
|
+
|
|
219
|
+
# release-branches patch: must come from a maintained release/X.Y.
|
|
220
|
+
if in_list "$FROZEN" "$LINE_BRANCH"; then
|
|
221
|
+
refuse "${LINE_BRANCH} is frozen (outside the support window in RELEASING.md); it receives no patches. Ship the fix in the next release from '${TRUNK}', or re-open the branch deliberately with ${UPDATE_SCRIPT} --add-maintenance ${LINE_BRANCH} (reviewed, in its own PR)."
|
|
222
|
+
fi
|
|
223
|
+
if ! in_list "$MAINTENANCE" "$LINE_BRANCH"; then
|
|
224
|
+
refuse "${LINE_BRANCH} is not a maintenance branch in RELEASING.md (maintenance: ${MAINTENANCE:-none}). If ${LINE}.0 shipped before the repo adopted release-branches, create the branch from its tag and record it (in a reviewed PR):" \
|
|
225
|
+
"git push origin v${LINE}.0^{commit}:refs/heads/${LINE_BRANCH}" \
|
|
226
|
+
"${UPDATE_SCRIPT} --add-maintenance ${LINE_BRANCH}"
|
|
227
|
+
fi
|
|
228
|
+
if [[ "$BRANCH" != "$LINE_BRANCH" ]]; then
|
|
229
|
+
refuse "release-branches: patch ${VERSION} is cut from '${LINE_BRANCH}', not '${BRANCH}'" \
|
|
230
|
+
"git fetch origin" \
|
|
231
|
+
"git switch ${LINE_BRANCH}" \
|
|
232
|
+
"git pull --ff-only origin ${LINE_BRANCH}"
|
|
233
|
+
fi
|
|
234
|
+
|
|
235
|
+
emit "$MODEL" "$TRUNK" "" "$LABEL" 1
|
|
@@ -0,0 +1,234 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
# detect-project.sh — Emit a single JSON document describing the release-relevant
|
|
3
|
+
# facts about the current repo: language, build system, version-bearing manifests,
|
|
4
|
+
# default OS/arch matrix, existing release-ish workflows, current version, and the
|
|
5
|
+
# latest git tag.
|
|
6
|
+
#
|
|
7
|
+
# Output goes to stdout. Diagnostics go to stderr. Exit 0 on success even when
|
|
8
|
+
# fields are null (the skill handles missing data); exit 1 only for hard failures
|
|
9
|
+
# (not inside a git repo, no jq-compatible printing possible).
|
|
10
|
+
#
|
|
11
|
+
# Usage:
|
|
12
|
+
# detect-project.sh
|
|
13
|
+
#
|
|
14
|
+
# No arguments. Runs in the current working directory; must be inside a git repo.
|
|
15
|
+
|
|
16
|
+
set -euo pipefail
|
|
17
|
+
|
|
18
|
+
# 1. Must be inside a git repo
|
|
19
|
+
if ! git rev-parse --show-toplevel >/dev/null 2>&1; then
|
|
20
|
+
echo "detect-project.sh: not inside a git repository" >&2
|
|
21
|
+
exit 1
|
|
22
|
+
fi
|
|
23
|
+
|
|
24
|
+
REPO_ROOT="$(git rev-parse --show-toplevel)"
|
|
25
|
+
cd "${REPO_ROOT}"
|
|
26
|
+
|
|
27
|
+
# 2. Helpers: JSON-safe string emitter (basic, sufficient for paths + versions)
|
|
28
|
+
json_str() {
|
|
29
|
+
# Escape backslashes and double-quotes, wrap in quotes. Pass `null` to emit null.
|
|
30
|
+
if [[ "$1" == "__NULL__" ]]; then
|
|
31
|
+
printf 'null'
|
|
32
|
+
return
|
|
33
|
+
fi
|
|
34
|
+
local s="$1"
|
|
35
|
+
s="${s//\\/\\\\}"
|
|
36
|
+
s="${s//\"/\\\"}"
|
|
37
|
+
printf '"%s"' "$s"
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
json_str_array() {
|
|
41
|
+
# $@ are array elements. Emits ["a","b"].
|
|
42
|
+
local first=1
|
|
43
|
+
printf '['
|
|
44
|
+
for el in "$@"; do
|
|
45
|
+
[[ ${first} -eq 1 ]] || printf ','
|
|
46
|
+
first=0
|
|
47
|
+
json_str "${el}"
|
|
48
|
+
done
|
|
49
|
+
printf ']'
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
# 3. Detect language
|
|
53
|
+
LANGUAGE="generic"
|
|
54
|
+
BUILD_SYSTEM="none"
|
|
55
|
+
MANIFEST_FILES=()
|
|
56
|
+
|
|
57
|
+
# Order matters: more specific signals first. Mark "mixed" if several match.
|
|
58
|
+
matches=0
|
|
59
|
+
|
|
60
|
+
if [[ -f "Cargo.toml" ]]; then
|
|
61
|
+
LANGUAGE="rust"
|
|
62
|
+
MANIFEST_FILES+=("Cargo.toml")
|
|
63
|
+
if [[ -f "dist-workspace.toml" ]] || grep -q '\[workspace.metadata.dist\]' Cargo.toml 2>/dev/null; then
|
|
64
|
+
BUILD_SYSTEM="cargo-dist"
|
|
65
|
+
else
|
|
66
|
+
BUILD_SYSTEM="cargo"
|
|
67
|
+
fi
|
|
68
|
+
matches=$((matches + 1))
|
|
69
|
+
fi
|
|
70
|
+
|
|
71
|
+
if [[ -f "go.mod" ]]; then
|
|
72
|
+
[[ ${matches} -gt 0 ]] && LANGUAGE="mixed" || LANGUAGE="go"
|
|
73
|
+
BUILD_SYSTEM="go-modules"
|
|
74
|
+
if [[ -f ".goreleaser.yml" ]] || [[ -f ".goreleaser.yaml" ]]; then
|
|
75
|
+
BUILD_SYSTEM="goreleaser"
|
|
76
|
+
fi
|
|
77
|
+
matches=$((matches + 1))
|
|
78
|
+
fi
|
|
79
|
+
|
|
80
|
+
if [[ -f "package.json" ]]; then
|
|
81
|
+
[[ ${matches} -gt 0 ]] && LANGUAGE="mixed" || LANGUAGE="node"
|
|
82
|
+
MANIFEST_FILES+=("package.json")
|
|
83
|
+
if [[ -f "pnpm-lock.yaml" ]]; then
|
|
84
|
+
BUILD_SYSTEM="pnpm"
|
|
85
|
+
elif [[ -f "yarn.lock" ]]; then
|
|
86
|
+
BUILD_SYSTEM="yarn"
|
|
87
|
+
elif [[ -f "bun.lockb" ]]; then
|
|
88
|
+
BUILD_SYSTEM="bun"
|
|
89
|
+
else
|
|
90
|
+
BUILD_SYSTEM="npm"
|
|
91
|
+
fi
|
|
92
|
+
matches=$((matches + 1))
|
|
93
|
+
fi
|
|
94
|
+
|
|
95
|
+
if [[ -f "pyproject.toml" ]] || [[ -f "setup.py" ]] || [[ -f "setup.cfg" ]]; then
|
|
96
|
+
[[ ${matches} -gt 0 ]] && LANGUAGE="mixed" || LANGUAGE="python"
|
|
97
|
+
[[ -f "pyproject.toml" ]] && MANIFEST_FILES+=("pyproject.toml")
|
|
98
|
+
[[ -f "setup.py" ]] && MANIFEST_FILES+=("setup.py")
|
|
99
|
+
[[ -f "setup.cfg" ]] && MANIFEST_FILES+=("setup.cfg")
|
|
100
|
+
if [[ -f "uv.lock" ]]; then
|
|
101
|
+
BUILD_SYSTEM="uv"
|
|
102
|
+
elif [[ -f "pyproject.toml" ]] && grep -q '\[tool.poetry\]' pyproject.toml 2>/dev/null; then
|
|
103
|
+
BUILD_SYSTEM="poetry"
|
|
104
|
+
elif [[ -f "pyproject.toml" ]] && grep -q '\[tool.hatch\]' pyproject.toml 2>/dev/null; then
|
|
105
|
+
BUILD_SYSTEM="hatch"
|
|
106
|
+
else
|
|
107
|
+
BUILD_SYSTEM="setuptools"
|
|
108
|
+
fi
|
|
109
|
+
matches=$((matches + 1))
|
|
110
|
+
fi
|
|
111
|
+
|
|
112
|
+
# Docker fallback — only if nothing else matched
|
|
113
|
+
if [[ ${matches} -eq 0 ]] && [[ -f "Dockerfile" ]]; then
|
|
114
|
+
LANGUAGE="docker"
|
|
115
|
+
BUILD_SYSTEM="docker"
|
|
116
|
+
matches=1
|
|
117
|
+
fi
|
|
118
|
+
|
|
119
|
+
# 4. Default OS / arch by language
|
|
120
|
+
case "${LANGUAGE}" in
|
|
121
|
+
node)
|
|
122
|
+
DEFAULT_OS="linux,darwin,windows"
|
|
123
|
+
DEFAULT_ARCH="amd64,arm64"
|
|
124
|
+
;;
|
|
125
|
+
python)
|
|
126
|
+
DEFAULT_OS="linux"
|
|
127
|
+
DEFAULT_ARCH="amd64"
|
|
128
|
+
;;
|
|
129
|
+
go|rust)
|
|
130
|
+
DEFAULT_OS="linux,darwin,windows"
|
|
131
|
+
DEFAULT_ARCH="amd64,arm64"
|
|
132
|
+
;;
|
|
133
|
+
docker)
|
|
134
|
+
DEFAULT_OS="linux"
|
|
135
|
+
DEFAULT_ARCH="amd64,arm64"
|
|
136
|
+
;;
|
|
137
|
+
mixed|generic|*)
|
|
138
|
+
DEFAULT_OS="linux"
|
|
139
|
+
DEFAULT_ARCH="amd64"
|
|
140
|
+
;;
|
|
141
|
+
esac
|
|
142
|
+
|
|
143
|
+
# 5. Existing CI workflows (any .yml / .yaml under .github/workflows)
|
|
144
|
+
EXISTING_CI=()
|
|
145
|
+
if [[ -d ".github/workflows" ]]; then
|
|
146
|
+
while IFS= read -r -d '' wf; do
|
|
147
|
+
EXISTING_CI+=("${wf#./}")
|
|
148
|
+
done < <(find ./.github/workflows -maxdepth 1 -type f \( -name '*.yml' -o -name '*.yaml' \) -print0 2>/dev/null)
|
|
149
|
+
fi
|
|
150
|
+
|
|
151
|
+
# 6. Current version — extracted from the first manifest that carries one
|
|
152
|
+
CURRENT_VERSION="__NULL__"
|
|
153
|
+
extract_version_from() {
|
|
154
|
+
local f="$1"
|
|
155
|
+
case "$f" in
|
|
156
|
+
package.json)
|
|
157
|
+
# Grep-based (avoids adding jq dependency). Match "version": "1.2.3".
|
|
158
|
+
grep -E '^\s*"version"\s*:' "$f" | head -n1 \
|
|
159
|
+
| sed -E 's/.*"version"\s*:\s*"([^"]+)".*/\1/'
|
|
160
|
+
;;
|
|
161
|
+
pyproject.toml)
|
|
162
|
+
# Match `version = "1.2.3"` in either [project] or [tool.poetry].
|
|
163
|
+
awk '
|
|
164
|
+
/^\[project\]/ { section="project"; next }
|
|
165
|
+
/^\[tool\.poetry\]/ { section="poetry"; next }
|
|
166
|
+
/^\[/ { section=""; next }
|
|
167
|
+
(section=="project" || section=="poetry") && /^version[[:space:]]*=/ {
|
|
168
|
+
gsub(/.*=[[:space:]]*"/, "");
|
|
169
|
+
gsub(/".*/, "");
|
|
170
|
+
print; exit
|
|
171
|
+
}
|
|
172
|
+
' "$f"
|
|
173
|
+
;;
|
|
174
|
+
Cargo.toml)
|
|
175
|
+
awk '
|
|
176
|
+
/^\[package\]/ { section="package"; next }
|
|
177
|
+
/^\[workspace\.package\]/ { section="workspace"; next }
|
|
178
|
+
/^\[/ { section=""; next }
|
|
179
|
+
(section=="package" || section=="workspace") && /^version[[:space:]]*=/ {
|
|
180
|
+
gsub(/.*=[[:space:]]*"/, "");
|
|
181
|
+
gsub(/".*/, "");
|
|
182
|
+
print; exit
|
|
183
|
+
}
|
|
184
|
+
' "$f"
|
|
185
|
+
;;
|
|
186
|
+
setup.py)
|
|
187
|
+
grep -E 'version\s*=' "$f" | head -n1 \
|
|
188
|
+
| sed -E "s/.*version\s*=\s*['\"]([^'\"]+)['\"].*/\1/"
|
|
189
|
+
;;
|
|
190
|
+
setup.cfg)
|
|
191
|
+
awk '/^\[metadata\]/ { s=1; next } /^\[/ { s=0 } s && /^version[[:space:]]*=/ { sub(/^version[[:space:]]*=[[:space:]]*/, ""); print; exit }' "$f"
|
|
192
|
+
;;
|
|
193
|
+
esac
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
for mf in "${MANIFEST_FILES[@]}"; do
|
|
197
|
+
v=$(extract_version_from "$mf" || true)
|
|
198
|
+
if [[ -n "${v:-}" ]]; then
|
|
199
|
+
CURRENT_VERSION="${v}"
|
|
200
|
+
break
|
|
201
|
+
fi
|
|
202
|
+
done
|
|
203
|
+
|
|
204
|
+
# 7. Latest git tag (if any)
|
|
205
|
+
LATEST_TAG="$(git describe --tags --abbrev=0 2>/dev/null || true)"
|
|
206
|
+
[[ -z "${LATEST_TAG}" ]] && LATEST_TAG="__NULL__"
|
|
207
|
+
|
|
208
|
+
# 8. Emit JSON
|
|
209
|
+
{
|
|
210
|
+
printf '{\n'
|
|
211
|
+
printf ' "language": '; json_str "${LANGUAGE}"; printf ',\n'
|
|
212
|
+
printf ' "build_system": '; json_str "${BUILD_SYSTEM}"; printf ',\n'
|
|
213
|
+
printf ' "manifest_files": '
|
|
214
|
+
if [[ ${#MANIFEST_FILES[@]} -eq 0 ]]; then
|
|
215
|
+
printf '[]'
|
|
216
|
+
else
|
|
217
|
+
json_str_array "${MANIFEST_FILES[@]}"
|
|
218
|
+
fi
|
|
219
|
+
printf ',\n'
|
|
220
|
+
printf ' "default_os": '; json_str "${DEFAULT_OS}"; printf ',\n'
|
|
221
|
+
printf ' "default_arch": '; json_str "${DEFAULT_ARCH}"; printf ',\n'
|
|
222
|
+
printf ' "existing_ci": '
|
|
223
|
+
if [[ ${#EXISTING_CI[@]} -eq 0 ]]; then
|
|
224
|
+
printf '[]'
|
|
225
|
+
else
|
|
226
|
+
json_str_array "${EXISTING_CI[@]}"
|
|
227
|
+
fi
|
|
228
|
+
printf ',\n'
|
|
229
|
+
printf ' "current_version": '; json_str "${CURRENT_VERSION}"; printf ',\n'
|
|
230
|
+
printf ' "latest_tag": '; json_str "${LATEST_TAG}"; printf '\n'
|
|
231
|
+
printf '}\n'
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
exit 0
|