@yandy-r/ycc-opencode 0.0.0-stage → 6.0.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 +38 -0
- package/LICENSE +21 -0
- package/README.md +41 -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 +134 -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 +235 -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 +173 -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 +284 -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 +194 -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 +264 -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 +260 -0
- package/package.json +35 -4
- package/registration.json +4384 -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 +445 -0
- package/shared/references/forge-detection.md +162 -0
- package/shared/references/goal-pairing.md +53 -0
- package/shared/references/pr-base-and-backport.md +143 -0
- package/shared/references/review-artifact-format.md +141 -0
- package/shared/references/review-checklist.md +161 -0
- package/shared/references/review-dispatch.md +71 -0
- package/shared/references/session-state.md +159 -0
- package/shared/references/standalone-dispatch.md +298 -0
- package/shared/references/target-capability-matrix.md +325 -0
- package/shared/references/visual-mode.md +155 -0
- package/shared/references/worktree-strategy.md +310 -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 +86 -0
- package/skills/backport/SKILL.md +291 -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 +410 -0
- package/skills/blueprint/references/bootstrap-mapping.md +87 -0
- package/skills/bundle-author/SKILL.md +119 -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 +188 -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 +150 -0
- package/skills/bundle-release/scripts/bump-version.sh +97 -0
- package/skills/bundle-release/scripts/draft-notes.sh +222 -0
- package/skills/bundle-release/scripts/preflight.sh +164 -0
- package/skills/bundle-release/scripts/release_versions.py +361 -0
- package/skills/clean/SKILL.md +107 -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 +375 -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 +153 -0
- package/skills/code-review/references/pr-procedure.md +311 -0
- package/skills/compatibility-audit/SKILL.md +226 -0
- package/skills/compatibility-audit/references/reading-the-report.md +159 -0
- package/skills/compatibility-audit/scripts/audit-install-assumptions.sh +372 -0
- package/skills/compatibility-audit/scripts/audit-target-features.sh +558 -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 +292 -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 +207 -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 +286 -0
- package/skills/git-cleanup/references/active-code-rules.md +318 -0
- package/skills/git-cleanup/references/host-detection.md +217 -0
- package/skills/git-workflow/SKILL.md +130 -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 +221 -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 +272 -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 +120 -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 +134 -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 +406 -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 +307 -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 +177 -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/preflight-enhanced-agents.sh +111 -0
- package/skills/prp-plan/scripts/validate-prp-plan.sh +368 -0
- package/skills/prp-pr/SKILL.md +402 -0
- package/skills/prp-prd/SKILL.md +442 -0
- package/skills/prp-spec/SKILL.md +274 -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 +304 -0
- package/skills/release-model/SKILL.md +231 -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 +251 -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 +285 -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 +152 -0
- package/skills/review-fix/SKILL.md +229 -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 +159 -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
|
@@ -0,0 +1,318 @@
|
|
|
1
|
+
# Active-Code Rules
|
|
2
|
+
|
|
3
|
+
## Contents
|
|
4
|
+
|
|
5
|
+
- R1 — Recent tip commit
|
|
6
|
+
- R2 — Unpushed commits
|
|
7
|
+
- R3 — Dirty worktree or attached stash
|
|
8
|
+
- R4 — Head or base of an open PR
|
|
9
|
+
- R5 — Referenced in tracked files
|
|
10
|
+
- R6 — Linked to an active issue
|
|
11
|
+
- R7 — Protected name
|
|
12
|
+
- R8 — Recent reflog activity
|
|
13
|
+
- R9 — Retired maintenance branch (release model only)
|
|
14
|
+
- R10 — Sync-merge anti-pattern (release model only, informational)
|
|
15
|
+
- Decision Matrix
|
|
16
|
+
- Worktree-specific notes
|
|
17
|
+
- PR / Issue–specific notes
|
|
18
|
+
|
|
19
|
+
Reference for the Phase 2 gate in `{{package-root}}/skills/git-cleanup/SKILL.md`. Each rule
|
|
20
|
+
below flags a candidate as **active** (must be excluded from the "Stale" list).
|
|
21
|
+
A candidate becomes **Stale** only when it matches **none** of these rules.
|
|
22
|
+
Candidates with conflicting signals land in **Ambiguous** and are surfaced to
|
|
23
|
+
the user per-item.
|
|
24
|
+
|
|
25
|
+
The rules are ordered by specificity. Evaluate them all — multiple matches
|
|
26
|
+
strengthen confidence in the classification.
|
|
27
|
+
|
|
28
|
+
R9 and R10 apply only when the repo has a `RELEASING.md`
|
|
29
|
+
(`{{package-root}}/shared/scripts/release-state.sh get` prints
|
|
30
|
+
`present=1`). Without one, R1–R8 are the whole rule set. A malformed state block
|
|
31
|
+
(exit 2) stops the audit before any rule runs: show the parse error and point at
|
|
32
|
+
`/ycc:release-model --audit`.
|
|
33
|
+
|
|
34
|
+
---
|
|
35
|
+
|
|
36
|
+
## R1 — Recent tip commit
|
|
37
|
+
|
|
38
|
+
**Signal:** The branch's tip commit date is newer than `stale-days` (default 90).
|
|
39
|
+
|
|
40
|
+
**How to check:**
|
|
41
|
+
|
|
42
|
+
```
|
|
43
|
+
git for-each-ref refs/heads/<name> --format='%(committerdate:unix)'
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
**Rationale:** Recent commits mean the branch was worked on; even without an
|
|
47
|
+
upstream it is probably WIP. Do not pressure-delete someone's fresh work.
|
|
48
|
+
|
|
49
|
+
**Edge case:** A rebase or `commit --amend` resets committer date. Prefer
|
|
50
|
+
`committerdate` over `authordate` — amend recency is the relevant signal.
|
|
51
|
+
|
|
52
|
+
---
|
|
53
|
+
|
|
54
|
+
## R2 — Unpushed commits
|
|
55
|
+
|
|
56
|
+
**Signal:** The local branch has commits that are not in its upstream, or no
|
|
57
|
+
upstream is configured **and** the branch has commits not in the default
|
|
58
|
+
branch.
|
|
59
|
+
|
|
60
|
+
**How to check:**
|
|
61
|
+
|
|
62
|
+
```
|
|
63
|
+
# With upstream:
|
|
64
|
+
git rev-list --count @{u}..HEAD
|
|
65
|
+
|
|
66
|
+
# Without upstream:
|
|
67
|
+
git rev-list --count <default-branch>..<name>
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
**Rationale:** Losing unpushed work is unrecoverable once the ref is gone
|
|
71
|
+
(modulo reflog, which is fragile and expires). Unpushed = active by default.
|
|
72
|
+
|
|
73
|
+
**Override:** An explicit user-confirmed Ambiguous decision may allow
|
|
74
|
+
deletion — but never auto-skip this rule.
|
|
75
|
+
|
|
76
|
+
---
|
|
77
|
+
|
|
78
|
+
## R3 — Dirty worktree or attached stash
|
|
79
|
+
|
|
80
|
+
**Signal:** For a worktree — `git -C <worktree> status --porcelain` returns
|
|
81
|
+
any line. OR: a stash entry lists the branch in its message.
|
|
82
|
+
|
|
83
|
+
**How to check:**
|
|
84
|
+
|
|
85
|
+
```
|
|
86
|
+
git -C <worktree-path> status --porcelain
|
|
87
|
+
git stash list --format='%gd %s' | grep -Fw "<branch-name>"
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
**Rationale:** Destroying a dirty worktree drops uncommitted edits — the
|
|
91
|
+
most common way tooling silently loses hours of work.
|
|
92
|
+
|
|
93
|
+
---
|
|
94
|
+
|
|
95
|
+
## R4 — Head or base of an open PR
|
|
96
|
+
|
|
97
|
+
**Signal:** The branch is the `headRef` of any open PR (the PR's source
|
|
98
|
+
branch), OR the `baseRef` of any open PR (the target branch — doubly
|
|
99
|
+
protected).
|
|
100
|
+
|
|
101
|
+
**How to check (GitHub):**
|
|
102
|
+
|
|
103
|
+
```
|
|
104
|
+
gh pr list --state=open --json number,headRefName,baseRefName \
|
|
105
|
+
--jq '.[] | [.headRefName, .baseRefName] | @tsv'
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
**Rationale:** Deleting a head-ref closes the PR as-if-merged and loses the
|
|
109
|
+
branch's distinct history on the server. Deleting a base-ref orphans all PRs
|
|
110
|
+
targeting it. Base-refs are **never** eligible even when the user insists —
|
|
111
|
+
surface as Protected, not Ambiguous.
|
|
112
|
+
|
|
113
|
+
---
|
|
114
|
+
|
|
115
|
+
## R5 — Referenced in tracked files
|
|
116
|
+
|
|
117
|
+
**Signal:** `git grep -l -w <branch-name>` finds at least one match in the
|
|
118
|
+
tracked working tree (CI config, release notes, issue templates, docs, code
|
|
119
|
+
comments).
|
|
120
|
+
|
|
121
|
+
**How to check:**
|
|
122
|
+
|
|
123
|
+
```
|
|
124
|
+
git grep -l -w "<branch-name>" -- \
|
|
125
|
+
':!*.lock' ':!*.min.*' ':!dist/' ':!build/'
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
**Rationale:** A textual mention in tracked files means the branch is
|
|
129
|
+
load-bearing — CI pins a release branch, a migration guide references a
|
|
130
|
+
feature branch, etc. Deleting it breaks something off-site.
|
|
131
|
+
|
|
132
|
+
**Tuning:** Exclude generated output to avoid false positives. The default
|
|
133
|
+
excludes above are a safe starting point; repos with unusual build output
|
|
134
|
+
directories should extend via `.gitattributes` or per-repo overrides.
|
|
135
|
+
|
|
136
|
+
---
|
|
137
|
+
|
|
138
|
+
## R6 — Linked to an active issue
|
|
139
|
+
|
|
140
|
+
**Signal:** A PR or branch body references an open issue updated within
|
|
141
|
+
`stale-days`, OR carries a repo label like `status:in-progress` /
|
|
142
|
+
`status:needs-info`.
|
|
143
|
+
|
|
144
|
+
**How to check (GitHub):**
|
|
145
|
+
|
|
146
|
+
```
|
|
147
|
+
gh pr view <n> --json body,labels,closingIssuesReferences
|
|
148
|
+
gh issue list --state=open --label='status:in-progress' --json number
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
**Rationale:** A branch tied to active triage work is not stale, even if its
|
|
152
|
+
last commit is old — the issue owner may be waiting on external input.
|
|
153
|
+
|
|
154
|
+
**Label taxonomy:** Use only labels that exist in the repo. Do not invent
|
|
155
|
+
`stale` or `wontfix` labels; fall back to a plain comment if no matching
|
|
156
|
+
label exists.
|
|
157
|
+
|
|
158
|
+
---
|
|
159
|
+
|
|
160
|
+
## R7 — Protected name
|
|
161
|
+
|
|
162
|
+
**Signal:** The branch name matches `main`, `master`, `develop`, the
|
|
163
|
+
repository's default branch, or any user-supplied `--protect=<pattern>`. With a
|
|
164
|
+
`RELEASING.md`, the state's `trunk` and every branch in its `maintenance` list
|
|
165
|
+
(local or remote) also match.
|
|
166
|
+
|
|
167
|
+
**How to check:**
|
|
168
|
+
|
|
169
|
+
```
|
|
170
|
+
git symbolic-ref refs/remotes/origin/HEAD # default branch
|
|
171
|
+
# User-supplied patterns from --protect flags
|
|
172
|
+
{{package-root}}/shared/scripts/release-state.sh get
|
|
173
|
+
# present=1 → protect `trunk` and each entry of `maintenance`
|
|
174
|
+
```
|
|
175
|
+
|
|
176
|
+
**Rationale:** Nothing good comes from deleting `main`. This rule is the
|
|
177
|
+
fail-closed backstop; it fires even if every other rule returns "stale".
|
|
178
|
+
|
|
179
|
+
**Always protected (hardcoded):** `main`, `master`, `develop`, and the
|
|
180
|
+
`origin/HEAD` symbolic ref. With a `RELEASING.md`, the state's `trunk` and
|
|
181
|
+
`maintenance` branches join this set. Patterns from `--protect` combine with
|
|
182
|
+
these, never replace them.
|
|
183
|
+
|
|
184
|
+
---
|
|
185
|
+
|
|
186
|
+
## R8 — Recent reflog activity
|
|
187
|
+
|
|
188
|
+
**Signal:** `git reflog show <branch>` shows a reflog entry newer than
|
|
189
|
+
`stale-days`.
|
|
190
|
+
|
|
191
|
+
**How to check:**
|
|
192
|
+
|
|
193
|
+
```
|
|
194
|
+
git reflog show --date=unix <branch> | head -1 | awk '{print $NF}'
|
|
195
|
+
```
|
|
196
|
+
|
|
197
|
+
**Rationale:** The reflog captures local-only motion — checkouts, rebases,
|
|
198
|
+
resets — that Phase 1 collection commands miss. A branch with no new commits
|
|
199
|
+
but active reflog motion is probably mid-rebase.
|
|
200
|
+
|
|
201
|
+
**Caveat:** Reflog expires per `gc.reflogExpire` (default 90d). Treat missing
|
|
202
|
+
reflog as "no signal", not "inactive".
|
|
203
|
+
|
|
204
|
+
---
|
|
205
|
+
|
|
206
|
+
## R9 — Retired maintenance branch (release model only)
|
|
207
|
+
|
|
208
|
+
**Signal:** `RELEASING.md` is present and a local or remote `release/*` branch
|
|
209
|
+
is not in the state's `maintenance` list, and R4 (base-ref) and R7 did not
|
|
210
|
+
protect it. Branches in the state's `frozen` list match too and are flagged
|
|
211
|
+
"frozen by RELEASING.md".
|
|
212
|
+
|
|
213
|
+
**How to check:**
|
|
214
|
+
|
|
215
|
+
```
|
|
216
|
+
{{package-root}}/shared/scripts/release-state.sh get # maintenance=, frozen=
|
|
217
|
+
git for-each-ref refs/heads/release/ --format='%(refname:short)'
|
|
218
|
+
git for-each-ref refs/remotes/ --format='%(refname:short)' | grep -E '^[^/]+/release/'
|
|
219
|
+
```
|
|
220
|
+
|
|
221
|
+
**Rationale:** Under the release model a `release/X.Y` branch outside the
|
|
222
|
+
support window receives no more patches, so it is cleanup material — but it is
|
|
223
|
+
also the only branch pointing at that line's last patch. Deleting it without a
|
|
224
|
+
tag loses an easy way back.
|
|
225
|
+
|
|
226
|
+
**Classification:** **Retired maintenance branch** — its own report category,
|
|
227
|
+
never Stale and never part of a bulk apply. R9 takes precedence over R1–R3,
|
|
228
|
+
R5, R6 and R8: `RELEASING.md` itself names frozen branches, so R5 would
|
|
229
|
+
otherwise mark every one of them active. The report suggests
|
|
230
|
+
`git tag archive/<branch> <branch>` (and pushing that tag for a remote branch)
|
|
231
|
+
before deletion, and each deletion requires explicit per-item confirmation.
|
|
232
|
+
|
|
233
|
+
---
|
|
234
|
+
|
|
235
|
+
## R10 — Sync-merge anti-pattern (release model only, informational)
|
|
236
|
+
|
|
237
|
+
**Signal:** `RELEASING.md` is present and either
|
|
238
|
+
|
|
239
|
+
- a local or remote branch other than the trunk has a name containing `sync`,
|
|
240
|
+
or
|
|
241
|
+
- a merge commit newer than `stale-days` that is not on the trunk, on any
|
|
242
|
+
branch other than the trunk, has a subject matching
|
|
243
|
+
`^Merge (remote-tracking )?branch '?([A-Za-z0-9._-]+/)?(main|master|trunk|develop|<trunk>)'? into`.
|
|
244
|
+
|
|
245
|
+
**How to check:**
|
|
246
|
+
|
|
247
|
+
```
|
|
248
|
+
git log --merges --since="<stale-days> days ago" --format='%h|%s' -E \
|
|
249
|
+
--grep="^Merge (remote-tracking )?branch '?([A-Za-z0-9._-]+/)?(main|master|trunk|develop|<trunk>)'? into" \
|
|
250
|
+
"origin/<trunk>..<branch>"
|
|
251
|
+
```
|
|
252
|
+
|
|
253
|
+
The optional `<remote>/` prefix catches `Merge remote-tracking branch
|
|
254
|
+
'origin/main' into …`, and the GitHub "Update branch" button's
|
|
255
|
+
`Merge branch 'main' into …`.
|
|
256
|
+
|
|
257
|
+
**Rationale:** The branching model forbids merging one long-lived branch into
|
|
258
|
+
another to "sync" it; code moves between the trunk and maintenance branches
|
|
259
|
+
only by cherry-pick. Sync merges tangle history, drag unreleased trunk work
|
|
260
|
+
into maintenance lines, and make backports unreviewable.
|
|
261
|
+
|
|
262
|
+
**Classification:** Reported under **Anti-patterns (informational)** with the
|
|
263
|
+
branch, commit hash and subject. It never changes a candidate's
|
|
264
|
+
classification, never blocks a deletion, and never produces a cleanup
|
|
265
|
+
command. The suggested fix is to rebase topic branches onto
|
|
266
|
+
`origin/<trunk>` and to move fixes between lines with `/ycc:backport`.
|
|
267
|
+
|
|
268
|
+
---
|
|
269
|
+
|
|
270
|
+
## Decision Matrix
|
|
271
|
+
|
|
272
|
+
| R1 recent | R2 unpushed | R3 dirty | R4 open-PR | R5 ref'd | R6 issue | R7 protected | R8 reflog | R9 retired | Classification |
|
|
273
|
+
| --------- | ----------- | -------- | ---------- | -------- | -------- | ------------ | --------- | ---------- | -------------------------- |
|
|
274
|
+
| any | any | any | any | any | any | ✓ | any | any | Protected |
|
|
275
|
+
| any | any | any | base-ref | any | any | — | any | any | Protected |
|
|
276
|
+
| any | any | any | head-ref | any | any | — | any | ✓ | Retired maintenance branch |
|
|
277
|
+
| any | any | any | — | any | any | — | any | ✓ | Retired maintenance branch |
|
|
278
|
+
| ✓ | any | any | any | any | any | — | any | — | Active |
|
|
279
|
+
| any | ✓ | any | any | any | any | — | any | — | Active |
|
|
280
|
+
| any | any | ✓ | any | any | any | — | any | — | Active |
|
|
281
|
+
| any | any | any | head-ref | any | any | — | any | — | Active |
|
|
282
|
+
| any | any | any | any | ✓ | any | — | any | — | Active |
|
|
283
|
+
| any | any | any | any | any | ✓ | — | any | — | Active |
|
|
284
|
+
| — | — | — | — | — | — | — | ✓ | — | Ambiguous |
|
|
285
|
+
| — | — | — | — | — | — | — | — | — | **Stale** |
|
|
286
|
+
|
|
287
|
+
Empty row = rule returned no signal. "any" = value doesn't affect outcome once
|
|
288
|
+
a higher-priority rule has matched. Classification is the first match reading
|
|
289
|
+
top-down. R9 only fires with a `RELEASING.md` and sits directly below the
|
|
290
|
+
protected rows, so a retired maintenance branch is never reported as Active or
|
|
291
|
+
Stale; one that heads an open PR is still retired, and the report notes the PR. R10 is informational and does not
|
|
292
|
+
appear in the matrix.
|
|
293
|
+
|
|
294
|
+
## Worktree-specific notes
|
|
295
|
+
|
|
296
|
+
Worktrees attach to branches, so R1–R8 apply transitively via the attached
|
|
297
|
+
branch. Additionally, a worktree is **active** if any of:
|
|
298
|
+
|
|
299
|
+
- The directory path no longer exists on disk (prune candidate — report, but
|
|
300
|
+
prune is a safe cleanup, not a destructive action).
|
|
301
|
+
- The attached branch is `[gone]` — upstream deleted. Surface as Ambiguous:
|
|
302
|
+
safe to remove IF R2 (unpushed commits) does not fire.
|
|
303
|
+
- The worktree sits under the legacy global ycc root (`~/.claude-worktrees/`)
|
|
304
|
+
instead of the preferred repo-local parent
|
|
305
|
+
(`<repo-root>/.opencode/worktrees/`). Report and offer relocation; do not delete
|
|
306
|
+
without explicit approval.
|
|
307
|
+
|
|
308
|
+
## PR / Issue–specific notes
|
|
309
|
+
|
|
310
|
+
For remote-domain candidates (PRs and issues), use the equivalent signals:
|
|
311
|
+
|
|
312
|
+
- R1 recent → `updatedAt` within `stale-days`.
|
|
313
|
+
- R4 open-PR → the PR is open (self-reference) OR its branch is the base of
|
|
314
|
+
another open PR.
|
|
315
|
+
- R6 linked issues → `closingIssuesReferences` + referenced issues' status.
|
|
316
|
+
- R7 protected → never auto-close a PR or issue whose body contains a
|
|
317
|
+
user-supplied `--protect=<pattern>` match or has the repo's default
|
|
318
|
+
"pinned" / "tracking" label family.
|
|
@@ -0,0 +1,217 @@
|
|
|
1
|
+
# Host Detection and Client Selection
|
|
2
|
+
|
|
3
|
+
## Contents
|
|
4
|
+
|
|
5
|
+
- Selection priority
|
|
6
|
+
- Host inference from `origin`
|
|
7
|
+
- Detecting MCP availability
|
|
8
|
+
- CLI availability probes
|
|
9
|
+
- Read operations used in Phase 1
|
|
10
|
+
- Write operations (only with `--apply` + user approval)
|
|
11
|
+
- Rate-limit awareness
|
|
12
|
+
- Logging
|
|
13
|
+
|
|
14
|
+
> **Canonical source of truth:** the bundle-wide forge-detection contract lives at
|
|
15
|
+
> `{{package-root}}/shared/references/forge-detection.md`
|
|
16
|
+
> (provider values `github` / `forgejo` / `gitea` / `gitlab` / `unknown`; CLIs
|
|
17
|
+
> `gh` / `tea` / `glab`; the `forge_detect_provider`, `forge_cli`, `forge_auth_ok`
|
|
18
|
+
> detection law implemented in `_shared/scripts/lib/forge.sh`). Prefer that document
|
|
19
|
+
> and library for detection. This file is the **git-cleanup-specific supplement**:
|
|
20
|
+
> it maps the resolved provider to the concrete read/write cleanup operations this
|
|
21
|
+
> skill performs. When the two disagree on detection, the canonical reference wins.
|
|
22
|
+
|
|
23
|
+
Reference for Phase 0 of `{{package-root}}/skills/git-cleanup/SKILL.md`. Given a repository,
|
|
24
|
+
determine (1) which remote host the audit should query and (2) which client
|
|
25
|
+
library / CLI / MCP server to use for each operation.
|
|
26
|
+
|
|
27
|
+
## Selection priority
|
|
28
|
+
|
|
29
|
+
For GitHub repositories, pick the first available:
|
|
30
|
+
|
|
31
|
+
1. **MCP GitHub tools** (`mcp__github__*`) — loaded into the current session.
|
|
32
|
+
2. **`gh` CLI** — authenticated (`gh auth status` returns 0).
|
|
33
|
+
3. **Local-only mode** — skip `--prs` and `--issues` with a loud notice.
|
|
34
|
+
|
|
35
|
+
For GitLab repositories, pick the first available:
|
|
36
|
+
|
|
37
|
+
1. **`glab` CLI** — authenticated (`glab auth status` returns 0).
|
|
38
|
+
2. **Local-only mode** — skip `--prs` and `--issues` with a loud notice.
|
|
39
|
+
|
|
40
|
+
For Forgejo / Gitea repositories (provider `forgejo` or `gitea` — same tooling
|
|
41
|
+
family, both driven by `tea`), pick the first available:
|
|
42
|
+
|
|
43
|
+
1. **`tea` CLI** — a configured login (`tea login list` shows a `://` entry).
|
|
44
|
+
2. **Local-only mode** — skip `--prs` and `--issues` with a loud notice.
|
|
45
|
+
|
|
46
|
+
Never mix clients within a single audit. Decide once in Phase 0 and log the
|
|
47
|
+
decision in `.git-cleanup/report.md` under "Host-API notes".
|
|
48
|
+
|
|
49
|
+
## Host inference from `origin`
|
|
50
|
+
|
|
51
|
+
When `--host=auto` (default), parse `git remote get-url origin`:
|
|
52
|
+
|
|
53
|
+
| Pattern match | Inferred host |
|
|
54
|
+
| --------------------------------------------- | --------------- |
|
|
55
|
+
| `github.com:`, `github.com/`, `*.github.com/` | GitHub |
|
|
56
|
+
| `gitlab.com:`, `gitlab.com/`, `/api/v4/` | GitLab |
|
|
57
|
+
| Self-hosted GitHub Enterprise (`GHE_HOST`) | GitHub |
|
|
58
|
+
| Self-hosted GitLab | GitLab |
|
|
59
|
+
| Self-hosted Forgejo / Gitea | Forgejo / Gitea |
|
|
60
|
+
| Anything else | Unknown |
|
|
61
|
+
|
|
62
|
+
Accept SSH, HTTPS, and `git://` URLs. Strip any `.git` suffix before matching.
|
|
63
|
+
|
|
64
|
+
**Self-hosted GitHub Enterprise:** look for `GH_HOST` / `GITHUB_HOST` in the
|
|
65
|
+
user's environment, or a match in `~/.config/gh/hosts.yml`. If found, treat
|
|
66
|
+
as GitHub and route `gh` calls to that host.
|
|
67
|
+
|
|
68
|
+
**Self-hosted GitLab:** `glab` reads its host list from `~/.config/glab-cli/`.
|
|
69
|
+
If the `origin` host matches one of its configured hosts, treat as GitLab.
|
|
70
|
+
|
|
71
|
+
**Self-hosted Forgejo / Gitea:** `tea` reads its login list from
|
|
72
|
+
`~/.config/tea/`. If the `origin` host matches a configured `tea login list`
|
|
73
|
+
entry, treat as the Gitea family and route `tea` calls to that host. The two are
|
|
74
|
+
the same tooling family (`forge_cli` maps both to `tea`); the canonical reference
|
|
75
|
+
distinguishes `forgejo` from `gitea` only for messaging.
|
|
76
|
+
|
|
77
|
+
## Detecting MCP availability
|
|
78
|
+
|
|
79
|
+
MCP tools are exposed through the session's tool list, not via shell commands.
|
|
80
|
+
Look for any tool whose name starts with `mcp__github__`. If found, prefer
|
|
81
|
+
those over `gh` — they avoid subprocess spawn cost and sidestep shell-quoting
|
|
82
|
+
hazards.
|
|
83
|
+
|
|
84
|
+
Representative MCP tools for this skill:
|
|
85
|
+
|
|
86
|
+
- `mcp__github__list_pull_requests` / `mcp__github__pull_request_read`
|
|
87
|
+
- `mcp__github__list_issues` / `mcp__github__issue_read`
|
|
88
|
+
- `mcp__github__issue_write` (for closing stale issues in Phase 5)
|
|
89
|
+
|
|
90
|
+
When MCP tools are unavailable (standalone execution, alternate harness),
|
|
91
|
+
fall back to `gh` without warning — both are equally valid.
|
|
92
|
+
|
|
93
|
+
## CLI availability probes
|
|
94
|
+
|
|
95
|
+
Run probes once in Phase 0 and cache the result for the rest of the audit:
|
|
96
|
+
|
|
97
|
+
```bash
|
|
98
|
+
command -v gh >/dev/null && gh auth status >/dev/null 2>&1 && echo "gh: ok" || echo "gh: unavailable"
|
|
99
|
+
command -v glab >/dev/null && glab auth status >/dev/null 2>&1 && echo "glab: ok" || echo "glab: unavailable"
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
**Do not call the host API during probing.** `auth status` is a local check
|
|
103
|
+
and does not burn rate-limit budget.
|
|
104
|
+
|
|
105
|
+
## Read operations used in Phase 1
|
|
106
|
+
|
|
107
|
+
### GitHub (`gh` fallbacks)
|
|
108
|
+
|
|
109
|
+
```bash
|
|
110
|
+
# Stale open PRs authored by current user
|
|
111
|
+
gh pr list --state=open --author=@me \
|
|
112
|
+
--json number,title,state,headRefName,baseRefName,updatedAt,isDraft
|
|
113
|
+
|
|
114
|
+
# Merged PRs whose local branch still exists
|
|
115
|
+
gh pr list --state=merged --author=@me \
|
|
116
|
+
--json number,headRefName,mergedAt --limit 200
|
|
117
|
+
|
|
118
|
+
# Stale open issues
|
|
119
|
+
gh issue list --state=open --author=@me \
|
|
120
|
+
--json number,title,updatedAt,labels
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
Use `--limit` to bound output; GitHub defaults to 30 which is too small for
|
|
124
|
+
long-lived accounts. 200 is a reasonable upper bound for per-user queries.
|
|
125
|
+
|
|
126
|
+
### GitLab (`glab` fallbacks)
|
|
127
|
+
|
|
128
|
+
```bash
|
|
129
|
+
glab mr list --state=opened --assignee=@me --per-page=100
|
|
130
|
+
glab issue list --state=opened --assignee=@me --per-page=100
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
GitLab's "Merge Request" maps to GitHub's "Pull Request" one-for-one for this
|
|
134
|
+
skill's purposes. Both concepts share the same R-rules (see
|
|
135
|
+
`active-code-rules.md`).
|
|
136
|
+
|
|
137
|
+
### Forgejo / Gitea (`tea` fallbacks)
|
|
138
|
+
|
|
139
|
+
```bash
|
|
140
|
+
# Open PRs ("pulls") for the current repo
|
|
141
|
+
tea pull list --state open
|
|
142
|
+
|
|
143
|
+
# Merged/closed PRs (filter the list output for merged state)
|
|
144
|
+
tea pull list --state closed
|
|
145
|
+
|
|
146
|
+
# Open issues
|
|
147
|
+
tea issues list --state open
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
`tea` operates on the repo bound to the current directory's `origin` remote (it
|
|
151
|
+
reads `.git/config`); pass `--repo owner/name` only when overriding. Forgejo's
|
|
152
|
+
"Pull Request" maps to GitHub's one-for-one and shares the same R-rules (see
|
|
153
|
+
`active-code-rules.md`). `tea` paginates with `--limit` (alias for page size);
|
|
154
|
+
bound large lists the same way `--limit` bounds `gh` output.
|
|
155
|
+
|
|
156
|
+
## Write operations (only with `--apply` + user approval)
|
|
157
|
+
|
|
158
|
+
### GitHub
|
|
159
|
+
|
|
160
|
+
| Action | MCP tool | `gh` fallback |
|
|
161
|
+
| ---------------------- | ------------------------------------------------------------------- | ----------------------------------- |
|
|
162
|
+
| Close a PR | `mcp__github__pull_request_review_write` (dismiss) or `issue_write` | `gh pr close <n>` |
|
|
163
|
+
| Close an issue | `mcp__github__issue_write` | `gh issue close <n>` |
|
|
164
|
+
| Add a label | `mcp__github__issue_write` | `gh issue edit <n> --add-label ...` |
|
|
165
|
+
| Delete a remote branch | (n/a — use git) | `git push origin --delete <name>` |
|
|
166
|
+
|
|
167
|
+
### GitLab
|
|
168
|
+
|
|
169
|
+
| Action | `glab` command |
|
|
170
|
+
| -------------- | ------------------------------------- |
|
|
171
|
+
| Close an MR | `glab mr close <iid>` |
|
|
172
|
+
| Close an issue | `glab issue close <iid>` |
|
|
173
|
+
| Add a label | `glab issue update <iid> --label ...` |
|
|
174
|
+
|
|
175
|
+
### Forgejo / Gitea
|
|
176
|
+
|
|
177
|
+
| Action | `tea` command |
|
|
178
|
+
| ---------------------- | ------------------------------------------------- |
|
|
179
|
+
| Close a PR | `tea pull close <n>` |
|
|
180
|
+
| Close an issue | `tea issues close <n>` |
|
|
181
|
+
| Add a label | `tea issues edit <n> --add-labels ...` |
|
|
182
|
+
| Delete a remote branch | (n/a — use git) `git push origin --delete <name>` |
|
|
183
|
+
|
|
184
|
+
## Rate-limit awareness
|
|
185
|
+
|
|
186
|
+
Both GitHub (5,000 req/hr authenticated) and GitLab (600 req/min default for
|
|
187
|
+
Cloud) have generous budgets for a cleanup audit, but list calls can balloon
|
|
188
|
+
fast if `--limit` is omitted. The audit should:
|
|
189
|
+
|
|
190
|
+
- Page responses rather than repeat unfiltered list calls.
|
|
191
|
+
- Reuse fetched data across R-rules — fetch PRs once, evaluate R4 / R6 against
|
|
192
|
+
the cached result.
|
|
193
|
+
- Respect `x-ratelimit-remaining` when close to zero: surface a notice and
|
|
194
|
+
pause rather than fail mid-audit.
|
|
195
|
+
|
|
196
|
+
`gh` exposes the remaining budget via `gh api rate_limit`. Check before the
|
|
197
|
+
first list call in a large repo.
|
|
198
|
+
|
|
199
|
+
## Logging
|
|
200
|
+
|
|
201
|
+
Record host decisions in `.git-cleanup/report.md` under **Host-API notes**:
|
|
202
|
+
|
|
203
|
+
```
|
|
204
|
+
host: github
|
|
205
|
+
client: mcp__github__ (preferred)
|
|
206
|
+
fallback: gh (available, unused)
|
|
207
|
+
pr-limit: 4,812 / 5,000 remaining
|
|
208
|
+
skipped: none
|
|
209
|
+
```
|
|
210
|
+
|
|
211
|
+
If the host was unknown or both clients were unavailable:
|
|
212
|
+
|
|
213
|
+
```
|
|
214
|
+
host: unknown (origin = git@example.com:me/repo.git)
|
|
215
|
+
client: none
|
|
216
|
+
skipped: --prs, --issues (no compatible CLI found)
|
|
217
|
+
```
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: git-workflow
|
|
3
|
+
description: Orchestrates commits, documentation updates, pushes, and PRs. Use when
|
|
4
|
+
finishing a feature with docs, coordinating multiple commits, or shipping changes
|
|
5
|
+
through a full Git workflow.
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# Git Workflow Manager
|
|
9
|
+
|
|
10
|
+
Analyzes changes, writes Conventional Commit messages, coordinates documentation updates (parallel agents when the change is large), and optionally pushes, opens a PR, and monitors CI.
|
|
11
|
+
|
|
12
|
+
## Current Task
|
|
13
|
+
|
|
14
|
+
**Managing git workflow for**: `$ARGUMENTS`
|
|
15
|
+
|
|
16
|
+
## Hard Rules (survive compaction)
|
|
17
|
+
|
|
18
|
+
- Push and PR are never implicit. Push only when `push ∈ actions`; create a PR only when `pr ∈ actions`; the action set comes from explicit flags or the Phase 0.5 menu reply.
|
|
19
|
+
- Every commit must be a Conventional Commit: `<type>(<scope>): <subject>`. Types: `feat fix docs style refactor test chore perf ci build revert`. Subject imperative, lowercase start, no trailing period, ≤50 chars (≤72 max); scope lowercase alphanumeric with hyphens; breaking change via `!` and/or `BREAKING CHANGE:` footer; body wrapped at 72. Enforced by `scripts/validate-commit.sh`.
|
|
20
|
+
- Validate before committing (direct commits), after agents finish (agent commits; amend non-conformant ones), and for PR titles. Do not leave Phase 3b until all agent commits pass.
|
|
21
|
+
- Read `templates/commit-types.md` before writing any commit message.
|
|
22
|
+
- NEVER `git push --force`, NEVER `--no-verify`, anywhere including the CI loop. CI-loop pushes go only to the PR head branch; refuse if head equals the default branch.
|
|
23
|
+
- Stage and commit in a single operation. Agents never push; this skill pushes.
|
|
24
|
+
- `--dry-run` makes no changes: STOP after the Phase 1 dry-run report.
|
|
25
|
+
- Lack of MCP tools never blocks the workflow; on any MCP failure fall back to `gh`.
|
|
26
|
+
- Never update the root `AGENTS.md`.
|
|
27
|
+
|
|
28
|
+
## Arguments
|
|
29
|
+
|
|
30
|
+
At least one action flag is required in normal use; with none, resolve interactively in Phase 0.5. Bare `--ci` is valid on its own (monitor CI on the existing PR for this branch). Flag order does not matter.
|
|
31
|
+
|
|
32
|
+
**Action flags** (cumulative ladder `--commit` < `--push` < `--pr`; each implies the lower ones):
|
|
33
|
+
|
|
34
|
+
- **--commit**: commit only
|
|
35
|
+
- **--push**: commit and push
|
|
36
|
+
- **--pr**: commit, push, create PR
|
|
37
|
+
|
|
38
|
+
**Modifier flags** (do not satisfy the action requirement):
|
|
39
|
+
|
|
40
|
+
- **--dry-run**: show analysis and plan, change nothing
|
|
41
|
+
- **--no-docs**: skip documentation updates
|
|
42
|
+
- **--draft**: create PR as draft (requires `--pr`)
|
|
43
|
+
- **--base <branch>**: PR base branch (requires `--pr`); overrides the base from `RELEASING.md` or the forge default (Step 22b)
|
|
44
|
+
- **--ci**: monitor CI on the current branch's PR and auto-fix until green or a bail. Works with `--pr` (create-then-monitor), `--push` (push-then-monitor), or bare (monitor only: no commit, no push). An open PR for the branch must exist when Phase 6 starts. Incompatible with `--dry-run` and with `--commit`-only.
|
|
45
|
+
- **--ci-max-pushes=N** (default 5), **--ci-max-same-failure=N** (default 3), **--ci-timeout-min=N** (default 30, from first iteration), **--ci-yes** (skip the one-time auth prompt)
|
|
46
|
+
|
|
47
|
+
## Tool Preference (before Phase 0)
|
|
48
|
+
|
|
49
|
+
If tools matching `mcp__github__*` exist, use MCP for GitHub operations (PR create/view/list); otherwise use `gh` via Bash. `git` operations, the skill scripts, and file reading always use Bash and the Read/Grep/Glob tools regardless.
|
|
50
|
+
|
|
51
|
+
## Phase Checklist
|
|
52
|
+
|
|
53
|
+
- [ ] Phase 0 Analyze (Steps 1–3): `git status`/diff, `scripts/analyze-changes.sh`, group changes.
|
|
54
|
+
- [ ] Phase 0.5 Resolve action set (Step 3.5): below.
|
|
55
|
+
- [ ] Phase 1 Strategy (Steps 4–5): small (1–3 files, single feature) → direct; large (4+ files, multiple features, breaking/API changes) → agents; `--dry-run` report then STOP.
|
|
56
|
+
- [ ] Phase 2 Documentation decision (Steps 6–7): skip if `--no-docs`, internal refactor, test-only, docs-only, or trivial.
|
|
57
|
+
- [ ] Phase 3a Direct commit (Steps 8–12) or Phase 3b Agent deployment (Steps 13–18), gated on `commit ∈ actions`.
|
|
58
|
+
- [ ] Phase 4 Summary and push (Steps 19–21), push gated on `push ∈ actions`.
|
|
59
|
+
- [ ] Phase 5 PR (Steps 22–31), gated on `pr ∈ actions`.
|
|
60
|
+
- [ ] Phase 6 CI monitoring (Steps 32–37), gated on `--ci`.
|
|
61
|
+
|
|
62
|
+
## Phase 0.5: Resolve Action Set (Step 3.5)
|
|
63
|
+
|
|
64
|
+
Every later phase keys off the action set.
|
|
65
|
+
|
|
66
|
+
1. Start `actions` from explicit flags (`commit`, `push`, `pr`).
|
|
67
|
+
2. Apply implications: `pr` adds `push` and `commit`; `push` adds `commit`.
|
|
68
|
+
3. If empty:
|
|
69
|
+
- `--ci ∈ flags`: leave empty, skip the menu (bare `--ci`: only Phase 6 runs; Phases 3, 4, 5 skip).
|
|
70
|
+
- Otherwise show this menu and wait; reject other replies and re-prompt. Map `1 → {commit}`, `2 → {commit, push}`, `3 → {commit, push, pr}`:
|
|
71
|
+
|
|
72
|
+
```
|
|
73
|
+
No action flag provided. What do you want to do?
|
|
74
|
+
|
|
75
|
+
1) Commit only
|
|
76
|
+
2) Commit and push
|
|
77
|
+
3) Commit, push, and create PR
|
|
78
|
+
|
|
79
|
+
Reply with 1, 2, or 3 (or pass --commit / --push / --pr next time).
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
4. Validate:
|
|
83
|
+
- `--draft` without `pr`: stop with "`--draft` requires `--pr`. Re-run with `--pr --draft`, or omit `--draft`."
|
|
84
|
+
- `--base <branch>` without `pr`: stop with "`--base` requires `--pr`."
|
|
85
|
+
- `--ci` with `actions == {commit}`: hard-stop with `--ci requires --push or --pr (CI runs on the remote, so local-only commits can't be monitored). Pass --ci alone to skip commits and monitor an existing PR.`
|
|
86
|
+
- `--ci` with `--dry-run`: hard-stop with `--ci is incompatible with --dry-run; the loop performs real pushes.`
|
|
87
|
+
5. Record the set. `--dry-run` and `--no-docs` apply regardless of the set.
|
|
88
|
+
|
|
89
|
+
## Phases 0–4 (commit flow)
|
|
90
|
+
|
|
91
|
+
Read `references/commit-phases.md` before Phase 0 for exact commands, the dry-run report template, the documentation rules, the commit-message steps, the `docs-git-committer` agent prompt, agent-result validation (including the `git rebase -x` check), and the summary template. Key decisions:
|
|
92
|
+
|
|
93
|
+
- Strategy: direct commit vs parallel agents (single message, multiple Agent calls, one `docs-git-committer` per scope; todos per agent).
|
|
94
|
+
- Read `templates/documentation-decision.md` (Step 6), `templates/commit-types.md` (Step 8), `templates/agent-prompts.md` (Step 14) when the step is reached.
|
|
95
|
+
- Documentation: feature docs only for new user-facing features, significant API changes, complex flows, breaking changes; directory-level `AGENTS.md` only for critical directory-specific patterns.
|
|
96
|
+
- Step 12/21: `git push` only when `push ∈ actions`.
|
|
97
|
+
|
|
98
|
+
## Phase 5: Pull Request (Steps 22–31)
|
|
99
|
+
|
|
100
|
+
Only when `pr ∈ actions`. Read `references/pr-creation.md` before Step 22. Decision points:
|
|
101
|
+
|
|
102
|
+
- Step 22a: existing PR → with `--ci`, ask whether to skip creation and run Phase 6 against it (`no` exits cleanly, no Phase 6); without `--ci`, stop with the "PR already exists" message.
|
|
103
|
+
- Step 22b: resolve `$BASE`, run the sync-check guard (exit 3: no PR, stop), offer backport, per `{{package-root}}/shared/references/pr-base-and-backport.md`. Exit 2 (malformed `RELEASING.md`) stops with the parse error and `/ycc:release-model --audit`.
|
|
104
|
+
- Step 23: read `templates/pr-template.md`.
|
|
105
|
+
- Step 25: PR title must be Conventional Commit format and pass `validate-commit.sh`.
|
|
106
|
+
- Step 28: MCP `mcp__github__create_pull_request` first, `gh pr create` fallback; forge routing via `{{package-root}}/shared/references/forge-detection.md` (`tea` for forgejo/gitea).
|
|
107
|
+
- Step 27: draft when work is incomplete or feedback is wanted; honor `--draft`.
|
|
108
|
+
|
|
109
|
+
## Phase 6: CI Monitoring (Steps 32–37)
|
|
110
|
+
|
|
111
|
+
Only when `--ci ∈ flags`. Read `references/ci-monitoring-phase.md` before Step 32, and `{{package-root}}/shared/references/ci-monitoring.md` (authoritative policy: classification, termination, audit log, loop protocol) at Step 33. GitHub-only: `RESULT=unsupported-provider` is reported and skipped without error. No PR number: hard-stop. Authorization prompt unless `--ci-yes`. Branch on `RESULT=`: `green` → report; `handoff` → fix, validate, commit, push head branch, loop; `rerun-pending` → `sleep 30`, loop, no fix; `bail-*` → diagnosis, end; `pr-not-found` / `refused-default-branch` → surface, no retry. Print the Goal Signals block verbatim as the last lines of the run (`PR_IN_SCOPE`, `PR_URL_PRINTED`, `CI_GREEN`, `CI_BAIL_VISIBLE`); criteria are in that reference.
|
|
112
|
+
|
|
113
|
+
## /goal Pairing
|
|
114
|
+
|
|
115
|
+
Pair `/goal` only in `--ci` mode. Read `references/goal-pairing.md` for keep-looping/done/stop semantics and the condition template, and `{{package-root}}/shared/references/goal-pairing.md` before relying on a `/goal` loop.
|
|
116
|
+
|
|
117
|
+
## Quality, Examples, Troubleshooting
|
|
118
|
+
|
|
119
|
+
Read `references/examples-and-troubleshooting.md` for the commit/docs/agent/PR/overall checklists, eight worked examples, and failure fixes (validation failures, MCP fallback, `gh` install/auth, no upstream, existing PR, draft-to-ready). Key reminders: small changes direct, large changes agents; atomic commits; draft PRs for WIP; PR creation needs MCP or authenticated `gh`.
|
|
120
|
+
|
|
121
|
+
## Reference Map
|
|
122
|
+
|
|
123
|
+
- `references/commit-phases.md` — read before Phase 0.
|
|
124
|
+
- `references/pr-creation.md` — read before Step 22.
|
|
125
|
+
- `references/ci-monitoring-phase.md` — read before Step 32.
|
|
126
|
+
- `references/goal-pairing.md` — read when pairing with `/goal`.
|
|
127
|
+
- `references/examples-and-troubleshooting.md` — read for checklists, examples, or when a step fails.
|
|
128
|
+
- `templates/commit-types.md`, `templates/documentation-decision.md`, `templates/agent-prompts.md`, `templates/pr-template.md` — read at Steps 8, 6, 14, 23.
|
|
129
|
+
- `scripts/analyze-changes.sh` (Step 2), `scripts/validate-commit.sh` (Steps 10, 18, 25, 36), `scripts/create-pr.sh` (Step 24; `--analyze --base "$BASE"`; defensive existing-PR check).
|
|
130
|
+
- Shared: `{{package-root}}/shared/references/{forge-detection,pr-base-and-backport,ci-monitoring,goal-pairing}.md`, `{{package-root}}/shared/scripts/{pr-guard,ci-monitor}.sh`. `branch-prep.md` does not apply: this skill never creates branches.
|