@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,364 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
# fetch-pr-comments.sh — Fetch all actionable PR comments via GitHub GraphQL
|
|
3
|
+
#
|
|
4
|
+
# GitHub-only. Forgejo/Gitea are unsupported: they expose no GraphQL API, so
|
|
5
|
+
# review-thread harvesting cannot be replicated. On a non-GitHub remote this
|
|
6
|
+
# script emits a uniform unsupported notice and exits 2.
|
|
7
|
+
#
|
|
8
|
+
# Purpose:
|
|
9
|
+
# Single-source fetcher used by pr-autofix. Pulls every actionable
|
|
10
|
+
# comment surface on a PR — review threads (file/line anchored) and
|
|
11
|
+
# top-level issue conversation comments — and emits one JSONL record per
|
|
12
|
+
# comment-of-interest.
|
|
13
|
+
#
|
|
14
|
+
# Output schema (one JSON object per line):
|
|
15
|
+
# {
|
|
16
|
+
# "source": "review_thread" | "issue_comment",
|
|
17
|
+
# "thread_id": "PRRT_..." | null, # GraphQL Node ID (for resolveReviewThread mutation)
|
|
18
|
+
# "is_resolved": bool, # always false for issue_comment
|
|
19
|
+
# "is_outdated": bool, # always false for issue_comment
|
|
20
|
+
# "comment_id": <int>, # REST databaseId
|
|
21
|
+
# "comment_node_id": "PRRC_..." | "...", # GraphQL Node ID (for reactions, replies)
|
|
22
|
+
# "author_login": "string",
|
|
23
|
+
# "is_bot": bool,
|
|
24
|
+
# "path": "string" | null,
|
|
25
|
+
# "line": <int> | null,
|
|
26
|
+
# "start_line": <int> | null,
|
|
27
|
+
# "original_line": <int> | null,
|
|
28
|
+
# "body": "string",
|
|
29
|
+
# "created_at": "ISO 8601"
|
|
30
|
+
# }
|
|
31
|
+
#
|
|
32
|
+
# Exit codes:
|
|
33
|
+
# 0 = success (records written to --out file; may be empty if no comments)
|
|
34
|
+
# 1 = arg/usage error
|
|
35
|
+
# 2 = gh auth failure or PR not found
|
|
36
|
+
# 3 = GraphQL error
|
|
37
|
+
|
|
38
|
+
set -euo pipefail
|
|
39
|
+
IFS=$'\n\t'
|
|
40
|
+
|
|
41
|
+
VERSION="1.0.0"
|
|
42
|
+
|
|
43
|
+
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]:-$0}")" && pwd)"
|
|
44
|
+
FORGE_LIB="${SCRIPT_DIR}/../../../shared/scripts/lib/forge.sh"
|
|
45
|
+
[[ -f "$FORGE_LIB" ]] || FORGE_LIB="${SCRIPT_DIR}/../../../shared/scripts/lib/forge.sh"
|
|
46
|
+
# shellcheck source=/dev/null
|
|
47
|
+
source "$FORGE_LIB"
|
|
48
|
+
|
|
49
|
+
usage() {
|
|
50
|
+
cat <<'EOF'
|
|
51
|
+
Usage:
|
|
52
|
+
fetch-pr-comments.sh --pr <number> --out <file> [--owner <owner>] [--repo <repo>]
|
|
53
|
+
fetch-pr-comments.sh --help
|
|
54
|
+
fetch-pr-comments.sh --version
|
|
55
|
+
|
|
56
|
+
GitHub-only. Forgejo/Gitea are unsupported (no GraphQL API); on a non-GitHub
|
|
57
|
+
remote this script prints an unsupported notice and exits 2.
|
|
58
|
+
|
|
59
|
+
Options:
|
|
60
|
+
--pr <number> PR number to fetch comments for (required)
|
|
61
|
+
--out <file> JSONL output path (required)
|
|
62
|
+
--owner <owner> Repo owner (default: resolved via `gh repo view`)
|
|
63
|
+
--repo <repo> Repo name (default: resolved via `gh repo view`)
|
|
64
|
+
|
|
65
|
+
Exit codes:
|
|
66
|
+
0 success
|
|
67
|
+
1 arg/usage error
|
|
68
|
+
2 gh auth failure or PR not found
|
|
69
|
+
3 GraphQL error
|
|
70
|
+
EOF
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
require_arg() {
|
|
74
|
+
local flag="$1"
|
|
75
|
+
local value="$2"
|
|
76
|
+
if [[ -z "$value" ]]; then
|
|
77
|
+
printf 'fetch-pr-comments.sh: missing required arg: %s\n' "$flag" >&2
|
|
78
|
+
usage >&2
|
|
79
|
+
exit 1
|
|
80
|
+
fi
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
# ---------------------------------------------------------------------------
|
|
84
|
+
# Argument parsing
|
|
85
|
+
# ---------------------------------------------------------------------------
|
|
86
|
+
|
|
87
|
+
PR=""
|
|
88
|
+
OUT=""
|
|
89
|
+
OWNER=""
|
|
90
|
+
REPO=""
|
|
91
|
+
|
|
92
|
+
while [[ $# -gt 0 ]]; do
|
|
93
|
+
case "$1" in
|
|
94
|
+
--pr)
|
|
95
|
+
PR="${2:-}"
|
|
96
|
+
shift 2
|
|
97
|
+
;;
|
|
98
|
+
--out)
|
|
99
|
+
OUT="${2:-}"
|
|
100
|
+
shift 2
|
|
101
|
+
;;
|
|
102
|
+
--owner)
|
|
103
|
+
OWNER="${2:-}"
|
|
104
|
+
shift 2
|
|
105
|
+
;;
|
|
106
|
+
--repo)
|
|
107
|
+
REPO="${2:-}"
|
|
108
|
+
shift 2
|
|
109
|
+
;;
|
|
110
|
+
--help|-h)
|
|
111
|
+
usage
|
|
112
|
+
exit 0
|
|
113
|
+
;;
|
|
114
|
+
--version)
|
|
115
|
+
printf 'fetch-pr-comments.sh %s\n' "$VERSION"
|
|
116
|
+
exit 0
|
|
117
|
+
;;
|
|
118
|
+
-*)
|
|
119
|
+
printf 'fetch-pr-comments.sh: unknown flag: %s\n' "$1" >&2
|
|
120
|
+
usage >&2
|
|
121
|
+
exit 1
|
|
122
|
+
;;
|
|
123
|
+
*)
|
|
124
|
+
printf 'fetch-pr-comments.sh: unexpected argument: %s\n' "$1" >&2
|
|
125
|
+
usage >&2
|
|
126
|
+
exit 1
|
|
127
|
+
;;
|
|
128
|
+
esac
|
|
129
|
+
done
|
|
130
|
+
|
|
131
|
+
require_arg "--pr" "$PR"
|
|
132
|
+
require_arg "--out" "$OUT"
|
|
133
|
+
|
|
134
|
+
if ! printf '%s' "$PR" | grep -qE '^[0-9]+$'; then
|
|
135
|
+
printf 'fetch-pr-comments.sh: --pr must be a positive integer, got: %s\n' "$PR" >&2
|
|
136
|
+
exit 1
|
|
137
|
+
fi
|
|
138
|
+
|
|
139
|
+
# ---------------------------------------------------------------------------
|
|
140
|
+
# Dependencies
|
|
141
|
+
# ---------------------------------------------------------------------------
|
|
142
|
+
|
|
143
|
+
for dep in gh jq; do
|
|
144
|
+
if ! command -v "$dep" >/dev/null 2>&1; then
|
|
145
|
+
printf 'fetch-pr-comments.sh: required dependency missing: %s\n' "$dep" >&2
|
|
146
|
+
exit 1
|
|
147
|
+
fi
|
|
148
|
+
done
|
|
149
|
+
|
|
150
|
+
# ---------------------------------------------------------------------------
|
|
151
|
+
# Forge provider gate (GitHub-only feature)
|
|
152
|
+
# ---------------------------------------------------------------------------
|
|
153
|
+
# Review-thread harvesting uses the GitHub GraphQL API. Forgejo/Gitea have no
|
|
154
|
+
# GraphQL API, so detect the provider before any gh call and degrade gracefully.
|
|
155
|
+
|
|
156
|
+
PROVIDER="$(forge_detect_provider origin)"
|
|
157
|
+
if [[ "$PROVIDER" != "github" ]]; then
|
|
158
|
+
forge_unsupported_notice "$PROVIDER" "PR review-comment harvesting"
|
|
159
|
+
exit 2
|
|
160
|
+
fi
|
|
161
|
+
|
|
162
|
+
if ! gh auth status >/dev/null 2>&1; then
|
|
163
|
+
printf 'fetch-pr-comments.sh: gh not authenticated. Run `gh auth login`.\n' >&2
|
|
164
|
+
exit 2
|
|
165
|
+
fi
|
|
166
|
+
|
|
167
|
+
# ---------------------------------------------------------------------------
|
|
168
|
+
# Resolve owner/repo if not provided
|
|
169
|
+
# ---------------------------------------------------------------------------
|
|
170
|
+
|
|
171
|
+
if [[ -z "$OWNER" ]]; then
|
|
172
|
+
OWNER=$(gh repo view --json owner --jq '.owner.login' 2>/dev/null || true)
|
|
173
|
+
fi
|
|
174
|
+
if [[ -z "$REPO" ]]; then
|
|
175
|
+
REPO=$(gh repo view --json name --jq '.name' 2>/dev/null || true)
|
|
176
|
+
fi
|
|
177
|
+
|
|
178
|
+
if [[ -z "$OWNER" || -z "$REPO" ]]; then
|
|
179
|
+
printf 'fetch-pr-comments.sh: could not resolve owner/repo (not in a GitHub repo, or `gh repo view` failed).\n' >&2
|
|
180
|
+
exit 2
|
|
181
|
+
fi
|
|
182
|
+
|
|
183
|
+
# Confirm PR exists
|
|
184
|
+
if ! gh pr view "$PR" --json number >/dev/null 2>&1; then
|
|
185
|
+
printf 'fetch-pr-comments.sh: PR #%s not found in %s/%s\n' "$PR" "$OWNER" "$REPO" >&2
|
|
186
|
+
exit 2
|
|
187
|
+
fi
|
|
188
|
+
|
|
189
|
+
# ---------------------------------------------------------------------------
|
|
190
|
+
# Prepare output (truncate)
|
|
191
|
+
# ---------------------------------------------------------------------------
|
|
192
|
+
|
|
193
|
+
: > "$OUT"
|
|
194
|
+
|
|
195
|
+
# ---------------------------------------------------------------------------
|
|
196
|
+
# Helper — detect "bot" accounts.
|
|
197
|
+
# Returns "true" if the login matches a bot pattern, else "false".
|
|
198
|
+
# ---------------------------------------------------------------------------
|
|
199
|
+
|
|
200
|
+
is_bot_login() {
|
|
201
|
+
local login="$1"
|
|
202
|
+
if [[ "$login" == *"[bot]" ]]; then
|
|
203
|
+
printf 'true'
|
|
204
|
+
return
|
|
205
|
+
fi
|
|
206
|
+
# Known bot logins lacking the [bot] suffix
|
|
207
|
+
case "$login" in
|
|
208
|
+
coderabbitai|sonarcloud|codacy-production|deepsource-autofix|sonarqubecloud)
|
|
209
|
+
printf 'true'
|
|
210
|
+
;;
|
|
211
|
+
*)
|
|
212
|
+
printf 'false'
|
|
213
|
+
;;
|
|
214
|
+
esac
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
# ---------------------------------------------------------------------------
|
|
218
|
+
# Section 1 — review threads (with cursor pagination)
|
|
219
|
+
# ---------------------------------------------------------------------------
|
|
220
|
+
|
|
221
|
+
cursor=""
|
|
222
|
+
while :; do
|
|
223
|
+
# Build args array
|
|
224
|
+
args=(-F owner="$OWNER" -F repo="$REPO" -F pr="$PR")
|
|
225
|
+
if [[ -n "$cursor" ]]; then
|
|
226
|
+
args+=(-F cursor="$cursor")
|
|
227
|
+
fi
|
|
228
|
+
|
|
229
|
+
response=$(gh api graphql "${args[@]}" -f query='
|
|
230
|
+
query($owner:String!, $repo:String!, $pr:Int!, $cursor:String) {
|
|
231
|
+
repository(owner:$owner, name:$repo) {
|
|
232
|
+
pullRequest(number:$pr) {
|
|
233
|
+
reviewThreads(first:50, after:$cursor) {
|
|
234
|
+
pageInfo { hasNextPage endCursor }
|
|
235
|
+
nodes {
|
|
236
|
+
id
|
|
237
|
+
isResolved
|
|
238
|
+
isOutdated
|
|
239
|
+
comments(first:1) {
|
|
240
|
+
nodes {
|
|
241
|
+
databaseId
|
|
242
|
+
id
|
|
243
|
+
body
|
|
244
|
+
path
|
|
245
|
+
line
|
|
246
|
+
startLine
|
|
247
|
+
originalLine
|
|
248
|
+
createdAt
|
|
249
|
+
author { login }
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
}
|
|
255
|
+
}
|
|
256
|
+
}') || {
|
|
257
|
+
printf 'fetch-pr-comments.sh: GraphQL error fetching review threads.\n' >&2
|
|
258
|
+
exit 3
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
# Emit one record per thread root comment
|
|
262
|
+
printf '%s\n' "$response" | jq -c --arg src "review_thread" '
|
|
263
|
+
.data.repository.pullRequest.reviewThreads.nodes[]
|
|
264
|
+
| . as $thread
|
|
265
|
+
| $thread.comments.nodes[0]
|
|
266
|
+
| select(. != null)
|
|
267
|
+
| {
|
|
268
|
+
source: $src,
|
|
269
|
+
thread_id: $thread.id,
|
|
270
|
+
is_resolved: $thread.isResolved,
|
|
271
|
+
is_outdated: $thread.isOutdated,
|
|
272
|
+
comment_id: (.databaseId // 0),
|
|
273
|
+
comment_node_id: .id,
|
|
274
|
+
author_login: (.author.login // ""),
|
|
275
|
+
path: .path,
|
|
276
|
+
line: .line,
|
|
277
|
+
start_line: .startLine,
|
|
278
|
+
original_line: .originalLine,
|
|
279
|
+
body: (.body // ""),
|
|
280
|
+
created_at: (.createdAt // "")
|
|
281
|
+
}
|
|
282
|
+
' | while IFS= read -r record; do
|
|
283
|
+
login=$(printf '%s' "$record" | jq -r '.author_login')
|
|
284
|
+
is_bot=$(is_bot_login "$login")
|
|
285
|
+
printf '%s' "$record" | jq -c --argjson is_bot "$is_bot" '. + {is_bot: $is_bot}' >> "$OUT"
|
|
286
|
+
done
|
|
287
|
+
|
|
288
|
+
has_next=$(printf '%s' "$response" | jq -r '.data.repository.pullRequest.reviewThreads.pageInfo.hasNextPage')
|
|
289
|
+
cursor=$(printf '%s' "$response" | jq -r '.data.repository.pullRequest.reviewThreads.pageInfo.endCursor // empty')
|
|
290
|
+
if [[ "$has_next" != "true" ]]; then
|
|
291
|
+
break
|
|
292
|
+
fi
|
|
293
|
+
done
|
|
294
|
+
|
|
295
|
+
# ---------------------------------------------------------------------------
|
|
296
|
+
# Section 2 — top-level issue comments (with cursor pagination)
|
|
297
|
+
# ---------------------------------------------------------------------------
|
|
298
|
+
|
|
299
|
+
cursor=""
|
|
300
|
+
while :; do
|
|
301
|
+
args=(-F owner="$OWNER" -F repo="$REPO" -F pr="$PR")
|
|
302
|
+
if [[ -n "$cursor" ]]; then
|
|
303
|
+
args+=(-F cursor="$cursor")
|
|
304
|
+
fi
|
|
305
|
+
|
|
306
|
+
response=$(gh api graphql "${args[@]}" -f query='
|
|
307
|
+
query($owner:String!, $repo:String!, $pr:Int!, $cursor:String) {
|
|
308
|
+
repository(owner:$owner, name:$repo) {
|
|
309
|
+
pullRequest(number:$pr) {
|
|
310
|
+
comments(first:50, after:$cursor) {
|
|
311
|
+
pageInfo { hasNextPage endCursor }
|
|
312
|
+
nodes {
|
|
313
|
+
databaseId
|
|
314
|
+
id
|
|
315
|
+
body
|
|
316
|
+
createdAt
|
|
317
|
+
author { login }
|
|
318
|
+
}
|
|
319
|
+
}
|
|
320
|
+
}
|
|
321
|
+
}
|
|
322
|
+
}') || {
|
|
323
|
+
printf 'fetch-pr-comments.sh: GraphQL error fetching issue comments.\n' >&2
|
|
324
|
+
exit 3
|
|
325
|
+
}
|
|
326
|
+
|
|
327
|
+
printf '%s\n' "$response" | jq -c --arg src "issue_comment" '
|
|
328
|
+
.data.repository.pullRequest.comments.nodes[]
|
|
329
|
+
| select(. != null)
|
|
330
|
+
| {
|
|
331
|
+
source: $src,
|
|
332
|
+
thread_id: null,
|
|
333
|
+
is_resolved: false,
|
|
334
|
+
is_outdated: false,
|
|
335
|
+
comment_id: (.databaseId // 0),
|
|
336
|
+
comment_node_id: .id,
|
|
337
|
+
author_login: (.author.login // ""),
|
|
338
|
+
path: null,
|
|
339
|
+
line: null,
|
|
340
|
+
start_line: null,
|
|
341
|
+
original_line: null,
|
|
342
|
+
body: (.body // ""),
|
|
343
|
+
created_at: (.createdAt // "")
|
|
344
|
+
}
|
|
345
|
+
' | while IFS= read -r record; do
|
|
346
|
+
login=$(printf '%s' "$record" | jq -r '.author_login')
|
|
347
|
+
is_bot=$(is_bot_login "$login")
|
|
348
|
+
printf '%s' "$record" | jq -c --argjson is_bot "$is_bot" '. + {is_bot: $is_bot}' >> "$OUT"
|
|
349
|
+
done
|
|
350
|
+
|
|
351
|
+
has_next=$(printf '%s' "$response" | jq -r '.data.repository.pullRequest.comments.pageInfo.hasNextPage')
|
|
352
|
+
cursor=$(printf '%s' "$response" | jq -r '.data.repository.pullRequest.comments.pageInfo.endCursor // empty')
|
|
353
|
+
if [[ "$has_next" != "true" ]]; then
|
|
354
|
+
break
|
|
355
|
+
fi
|
|
356
|
+
done
|
|
357
|
+
|
|
358
|
+
# ---------------------------------------------------------------------------
|
|
359
|
+
# Done
|
|
360
|
+
# ---------------------------------------------------------------------------
|
|
361
|
+
|
|
362
|
+
record_count=$(wc -l < "$OUT" | tr -d ' ')
|
|
363
|
+
printf 'fetch-pr-comments.sh: wrote %s records to %s\n' "$record_count" "$OUT" >&2
|
|
364
|
+
exit 0
|
|
@@ -0,0 +1,226 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
# post-summary.sh — Post a single consolidated summary comment on a PR
|
|
3
|
+
#
|
|
4
|
+
# GitHub-only. Forgejo/Gitea are unsupported: this script is part of the
|
|
5
|
+
# GraphQL-driven pr-autofix flow and posts via `gh`. On a non-GitHub remote it
|
|
6
|
+
# emits a uniform unsupported notice and exits 2 (the --dry-run render still
|
|
7
|
+
# works on any provider).
|
|
8
|
+
#
|
|
9
|
+
# Purpose:
|
|
10
|
+
# At the end of a pr-autofix run, render and post one summary comment to
|
|
11
|
+
# the PR conversation. Built only from local counters — never echoes raw
|
|
12
|
+
# reviewer text back into the comment.
|
|
13
|
+
#
|
|
14
|
+
# Usage:
|
|
15
|
+
# post-summary.sh \
|
|
16
|
+
# --pr <number> \
|
|
17
|
+
# --fixed <N> \
|
|
18
|
+
# --failed <N> \
|
|
19
|
+
# --skipped <N> \
|
|
20
|
+
# --deferred <N> \
|
|
21
|
+
# --commit-sha <sha> \
|
|
22
|
+
# --branch <name> \
|
|
23
|
+
# [--ci-result <green|bail-...|not-run>] \
|
|
24
|
+
# [--ci-iterations <N>] \
|
|
25
|
+
# [--ci-pushes <N>] \
|
|
26
|
+
# [--dry-run]
|
|
27
|
+
#
|
|
28
|
+
# Behavior:
|
|
29
|
+
# - If all counters except --deferred are zero, no comment is posted (nothing useful to say).
|
|
30
|
+
# - With --dry-run, prints the rendered comment to stdout and exits without posting.
|
|
31
|
+
#
|
|
32
|
+
# Exit codes:
|
|
33
|
+
# 0 = success (comment posted or skipped as no-op)
|
|
34
|
+
# 1 = arg/usage error
|
|
35
|
+
# 2 = gh auth or API failure
|
|
36
|
+
|
|
37
|
+
set -euo pipefail
|
|
38
|
+
IFS=$'\n\t'
|
|
39
|
+
|
|
40
|
+
VERSION="1.0.0"
|
|
41
|
+
|
|
42
|
+
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]:-$0}")" && pwd)"
|
|
43
|
+
FORGE_LIB="${SCRIPT_DIR}/../../../shared/scripts/lib/forge.sh"
|
|
44
|
+
[[ -f "$FORGE_LIB" ]] || FORGE_LIB="${SCRIPT_DIR}/../../../shared/scripts/lib/forge.sh"
|
|
45
|
+
# shellcheck source=/dev/null
|
|
46
|
+
source "$FORGE_LIB"
|
|
47
|
+
|
|
48
|
+
usage() {
|
|
49
|
+
cat <<'EOF'
|
|
50
|
+
Usage:
|
|
51
|
+
post-summary.sh --pr <number> --fixed <N> --failed <N> --skipped <N> --deferred <N> \
|
|
52
|
+
--commit-sha <sha> --branch <name> \
|
|
53
|
+
[--ci-result <value>] [--ci-iterations <N>] [--ci-pushes <N>] [--dry-run]
|
|
54
|
+
|
|
55
|
+
GitHub-only. Forgejo/Gitea are unsupported (part of the GraphQL-driven autofix
|
|
56
|
+
flow); on a non-GitHub remote this script prints an unsupported notice and exits
|
|
57
|
+
2. The --dry-run render works on any provider.
|
|
58
|
+
|
|
59
|
+
Exit codes:
|
|
60
|
+
0 success (or skipped as no-op)
|
|
61
|
+
1 arg/usage error
|
|
62
|
+
2 gh auth or API failure
|
|
63
|
+
EOF
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
require_arg() {
|
|
67
|
+
local flag="$1"
|
|
68
|
+
local value="$2"
|
|
69
|
+
if [[ -z "$value" ]]; then
|
|
70
|
+
printf 'post-summary.sh: missing required arg: %s\n' "$flag" >&2
|
|
71
|
+
usage >&2
|
|
72
|
+
exit 1
|
|
73
|
+
fi
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
# ---------------------------------------------------------------------------
|
|
77
|
+
# Argument parsing
|
|
78
|
+
# ---------------------------------------------------------------------------
|
|
79
|
+
|
|
80
|
+
PR=""
|
|
81
|
+
FIXED=""
|
|
82
|
+
FAILED=""
|
|
83
|
+
SKIPPED=""
|
|
84
|
+
DEFERRED=""
|
|
85
|
+
COMMIT_SHA=""
|
|
86
|
+
BRANCH=""
|
|
87
|
+
CI_RESULT="not-run"
|
|
88
|
+
CI_ITERATIONS="0"
|
|
89
|
+
CI_PUSHES="0"
|
|
90
|
+
DRY_RUN="false"
|
|
91
|
+
|
|
92
|
+
while [[ $# -gt 0 ]]; do
|
|
93
|
+
case "$1" in
|
|
94
|
+
--pr) PR="${2:-}"; shift 2 ;;
|
|
95
|
+
--fixed) FIXED="${2:-}"; shift 2 ;;
|
|
96
|
+
--failed) FAILED="${2:-}"; shift 2 ;;
|
|
97
|
+
--skipped) SKIPPED="${2:-}"; shift 2 ;;
|
|
98
|
+
--deferred) DEFERRED="${2:-}"; shift 2 ;;
|
|
99
|
+
--commit-sha) COMMIT_SHA="${2:-}"; shift 2 ;;
|
|
100
|
+
--branch) BRANCH="${2:-}"; shift 2 ;;
|
|
101
|
+
--ci-result) CI_RESULT="${2:-}"; shift 2 ;;
|
|
102
|
+
--ci-iterations) CI_ITERATIONS="${2:-}"; shift 2 ;;
|
|
103
|
+
--ci-pushes) CI_PUSHES="${2:-}"; shift 2 ;;
|
|
104
|
+
--dry-run) DRY_RUN="true"; shift ;;
|
|
105
|
+
--help|-h) usage; exit 0 ;;
|
|
106
|
+
--version) printf 'post-summary.sh %s\n' "$VERSION"; exit 0 ;;
|
|
107
|
+
-*)
|
|
108
|
+
printf 'post-summary.sh: unknown flag: %s\n' "$1" >&2
|
|
109
|
+
usage >&2
|
|
110
|
+
exit 1
|
|
111
|
+
;;
|
|
112
|
+
*)
|
|
113
|
+
printf 'post-summary.sh: unexpected argument: %s\n' "$1" >&2
|
|
114
|
+
usage >&2
|
|
115
|
+
exit 1
|
|
116
|
+
;;
|
|
117
|
+
esac
|
|
118
|
+
done
|
|
119
|
+
|
|
120
|
+
require_arg "--pr" "$PR"
|
|
121
|
+
require_arg "--fixed" "$FIXED"
|
|
122
|
+
require_arg "--failed" "$FAILED"
|
|
123
|
+
require_arg "--skipped" "$SKIPPED"
|
|
124
|
+
require_arg "--deferred" "$DEFERRED"
|
|
125
|
+
require_arg "--commit-sha" "$COMMIT_SHA"
|
|
126
|
+
require_arg "--branch" "$BRANCH"
|
|
127
|
+
|
|
128
|
+
for pair in "pr:$PR" "fixed:$FIXED" "failed:$FAILED" "skipped:$SKIPPED" "deferred:$DEFERRED" \
|
|
129
|
+
"ci-iterations:$CI_ITERATIONS" "ci-pushes:$CI_PUSHES"; do
|
|
130
|
+
label="${pair%%:*}"
|
|
131
|
+
value="${pair#*:}"
|
|
132
|
+
if ! printf '%s' "$value" | grep -qE '^[0-9]+$'; then
|
|
133
|
+
printf 'post-summary.sh: --%s must be a non-negative integer, got: %s\n' "$label" "$value" >&2
|
|
134
|
+
exit 1
|
|
135
|
+
fi
|
|
136
|
+
done
|
|
137
|
+
|
|
138
|
+
# ---------------------------------------------------------------------------
|
|
139
|
+
# No-op short-circuit
|
|
140
|
+
# ---------------------------------------------------------------------------
|
|
141
|
+
|
|
142
|
+
# If everything is deferred (or zero), there's nothing meaningful to say.
|
|
143
|
+
if [[ "$FIXED" -eq 0 && "$FAILED" -eq 0 && "$SKIPPED" -eq 0 ]]; then
|
|
144
|
+
printf 'post-summary.sh: no fixes/failures/skips to report (deferred=%s); skipping summary comment.\n' "$DEFERRED" >&2
|
|
145
|
+
exit 0
|
|
146
|
+
fi
|
|
147
|
+
|
|
148
|
+
# ---------------------------------------------------------------------------
|
|
149
|
+
# Render summary body
|
|
150
|
+
# ---------------------------------------------------------------------------
|
|
151
|
+
|
|
152
|
+
ci_section=""
|
|
153
|
+
if [[ "$CI_RESULT" != "not-run" ]]; then
|
|
154
|
+
ci_section=$(cat <<EOF
|
|
155
|
+
|
|
156
|
+
**CI auto-fix loop**:
|
|
157
|
+
- Result: \`${CI_RESULT}\`
|
|
158
|
+
- Iterations: ${CI_ITERATIONS}
|
|
159
|
+
- Auto-pushes: ${CI_PUSHES}
|
|
160
|
+
EOF
|
|
161
|
+
)
|
|
162
|
+
fi
|
|
163
|
+
|
|
164
|
+
body_header=$(cat <<EOF
|
|
165
|
+
## PR Autofix Summary
|
|
166
|
+
|
|
167
|
+
Applied **${FIXED}** fix(es), encountered **${FAILED}** failure(s), skipped **${SKIPPED}** comment(s), deferred **${DEFERRED}** comment(s).
|
|
168
|
+
|
|
169
|
+
**Branch**: \`${BRANCH}\`
|
|
170
|
+
**Latest commit**: \`${COMMIT_SHA}\`${ci_section}
|
|
171
|
+
EOF
|
|
172
|
+
)
|
|
173
|
+
|
|
174
|
+
# Static footer uses a quoted heredoc so the skill marker on the final line
|
|
175
|
+
# stays literal across every bundle target. Without the quote, the Codex bundle
|
|
176
|
+
# (which renders skill references as $skill-name) would crash under set -u.
|
|
177
|
+
body_footer=$(cat <<'EOF'
|
|
178
|
+
|
|
179
|
+
Thread state:
|
|
180
|
+
- Threads resolved on Fixed: yes (unless `--no-resolve` was set on the run)
|
|
181
|
+
- Threads with Failed fixes left open with a reply explaining the blocker
|
|
182
|
+
- Skipped threads replied-then-resolved with the user's reason
|
|
183
|
+
|
|
184
|
+
This summary was built from local run state only — reviewer prompts and suggestion blocks were treated as untrusted input and are not echoed back here.
|
|
185
|
+
|
|
186
|
+
— posted by /pr-autofix
|
|
187
|
+
EOF
|
|
188
|
+
)
|
|
189
|
+
|
|
190
|
+
BODY="${body_header}
|
|
191
|
+
${body_footer}"
|
|
192
|
+
|
|
193
|
+
# ---------------------------------------------------------------------------
|
|
194
|
+
# Post (or dry-run)
|
|
195
|
+
# ---------------------------------------------------------------------------
|
|
196
|
+
|
|
197
|
+
if [[ "$DRY_RUN" == "true" ]]; then
|
|
198
|
+
printf '%s\n' "$BODY"
|
|
199
|
+
exit 0
|
|
200
|
+
fi
|
|
201
|
+
|
|
202
|
+
# ---------------------------------------------------------------------------
|
|
203
|
+
# Forge provider gate (GitHub-only feature)
|
|
204
|
+
# ---------------------------------------------------------------------------
|
|
205
|
+
# This script posts via `gh` as part of the GraphQL-driven pr-autofix flow.
|
|
206
|
+
# Detect the provider before the gh-auth check so a non-GitHub remote gets the
|
|
207
|
+
# honest "GitHub-only" message instead of a confusing auth error.
|
|
208
|
+
|
|
209
|
+
PROVIDER="$(forge_detect_provider origin)"
|
|
210
|
+
if [[ "$PROVIDER" != "github" ]]; then
|
|
211
|
+
forge_unsupported_notice "$PROVIDER" "PR summary posting"
|
|
212
|
+
exit 2
|
|
213
|
+
fi
|
|
214
|
+
|
|
215
|
+
if ! command -v gh >/dev/null 2>&1; then
|
|
216
|
+
printf 'post-summary.sh: gh is required.\n' >&2
|
|
217
|
+
exit 1
|
|
218
|
+
fi
|
|
219
|
+
if ! gh auth status >/dev/null 2>&1; then
|
|
220
|
+
printf 'post-summary.sh: gh not authenticated. Run `gh auth login`.\n' >&2
|
|
221
|
+
exit 2
|
|
222
|
+
fi
|
|
223
|
+
|
|
224
|
+
gh pr comment "$PR" --body "$BODY" >/dev/null
|
|
225
|
+
printf 'post-summary.sh: posted summary comment on PR #%s\n' "$PR" >&2
|
|
226
|
+
exit 0
|