diff --git a/.github/copilot-instructions.md b/.github/copilot-instructions.md index ffc98b4..ffcdc09 100644 --- a/.github/copilot-instructions.md +++ b/.github/copilot-instructions.md @@ -4,7 +4,7 @@ You are an expert GitHub Agentic Workflow generator. You help users create produ ## Your Knowledge -Use the committed pattern library as the source of truth: `patterns/manifest.json` plus `patterns/archetypes/*.json` generated on 2026-08-31 from 223 source repos, 175 active workflows, and 671 total workflows scanned. The current wizard manifest lists 29 user-facing archetypes; the `custom` archetype exists as a supporting pattern file and is intentionally not exposed as a HOW-step archetype. +Use the committed pattern library as the source of truth: `patterns/manifest.json` plus `patterns/archetypes/*.json` generated on 2026-08-31 from 223 source repos, 175 active workflows, and 671 total workflows scanned. The current wizard manifest lists 30 user-facing archetypes; the `custom` archetype exists as a supporting pattern file and is intentionally not exposed as a HOW-step archetype. ### Key Data Points @@ -23,7 +23,7 @@ Use the committed pattern library as the source of truth: `patterns/manifest.jso - `custom` is hidden from the wizard archetype cards but retained for matching and profile data. Best observed custom profiles are schedule + create-pull-request + noop at 95.2% (n=21), schedule + create-issue + noop + threat-detection at 83.9%, and schedule + create-issue + noop at 80.0%. **Curated archetypes without empirical runs yet (`count: 0`):** -- accessibility-expert, agent-cost-tracker, batched-ci-doctor, ci-failure-triage, code-health-auditor, community-digest, contribution-guidelines-checker, issue-hierarchy-manager, link-checker, linter-applier, linter-miner, linter-refiner, linter-workflows, nitpick-reviewer, performance-nut, pr-iteration-loop, repo-qa-assistant, security-scanner, skill-pr-reviewer, user-simulator. +- accessibility-expert, agent-cost-tracker, batched-ci-doctor, ci-failure-triage, code-health-auditor, community-digest, contribution-guidelines-checker, issue-hierarchy-manager, link-checker, linter-applier, linter-miner, linter-refiner, linter-workflows, nitpick-reviewer, performance-nut, pr-fix-assistant, pr-iteration-loop, repo-qa-assistant, security-scanner, skill-pr-reviewer, user-simulator. - Keep these archetypes available. They are newer curated patterns and should not be removed simply because they have no measured success rate. **Trigger combo risk:** diff --git a/patterns/archetypes/pr-fix-assistant.json b/patterns/archetypes/pr-fix-assistant.json new file mode 100644 index 0000000..4fde4d9 --- /dev/null +++ b/patterns/archetypes/pr-fix-assistant.json @@ -0,0 +1,40 @@ +{ + "id": "pr-fix-assistant", + "label": "PR Fix Assistant", + "description": "Fix a failing pull request on demand via slash command by pushing corrections directly to its branch", + "success_rate": null, + "count": 0, + "recommended_triggers": [ + { + "type": "slash_command", + "config": {} + }, + { + "type": "reaction", + "config": {} + } + ], + "recommended_safe_outputs": [ + "pull-requests" + ], + "recommended_tools": [ + "push-to-pull-request-branch" + ], + "timeout_minutes": 20, + "prompt_style": "role-steps", + "size_range_bytes": [ + 2000, + 6000 + ], + "top_repos": [], + "tips": [ + "Use push-to-pull-request-branch instead of create-pull-request \u2014 the fix belongs on the existing PR branch, not a new one", + "Set required-title-prefix or required-labels on push-to-pull-request-branch so pushes are restricted to PRs this workflow is meant to touch", + "Analyze failing CI logs to identify the root cause before making any change; run tests and formatters locally to verify the fix before pushing", + "Add a comment summarizing the change and reason once the fix is pushed, so reviewers can see what happened without re-reading the diff", + "Use tools.github.min-integrity: none since a maintainer-invoked slash command already establishes trust for the triggering PR", + "Pair with reaction: \"eyes\" so the requester gets immediate acknowledgement while the agent works", + "Do NOT open a second pull request or push to unrelated branches \u2014 scope every change to the triggering PR only" + ], + "anti_patterns": [] +} diff --git a/patterns/manifest.json b/patterns/manifest.json index deb5014..66fc20f 100644 --- a/patterns/manifest.json +++ b/patterns/manifest.json @@ -34,7 +34,8 @@ "contribution-guidelines-checker", "link-checker", "repo-qa-assistant", - "nitpick-reviewer" + "nitpick-reviewer", + "pr-fix-assistant" ], "workflow_generation": "workflow-generation.json", "anti_patterns": [ diff --git a/patterns/workflow-generation.json b/patterns/workflow-generation.json index 5e013e2..b1e04b4 100644 --- a/patterns/workflow-generation.json +++ b/patterns/workflow-generation.json @@ -1172,6 +1172,52 @@ "- **DO NOT** retry links already recorded as unfixable in cache memory without new evidence." ] }, + "pr-fix-assistant": { + "icon": "git-pull-request", + "capabilities": { + "bash": true, + "github_toolsets": true + }, + "permissions": [ + "contents", + "pull-requests" + ], + "github_toolsets": [ + "repos", + "pull_requests", + "actions" + ], + "instructions": [ + "safe-outputs-management.md" + ], + "trigger_overrides": { + "slash_command": { + "yaml": "slash_command:\n name: {{name}}\n events: [pull_request_comment]", + "description": "on a slash command left as a pull request comment" + } + }, + "body": [ + "# {{label}}", + "", + "You are an **on-demand pull request fixer** for this repository, invoked by a slash command.", + "", + "## Process", + "", + "1. Read the pull request, the invoking comment, and the logs from any failing check runs", + "2. Identify the root cause of the failure or the requested change", + "3. Check out the pull request branch and implement the fix", + "4. Run the repository's tests and formatters to verify the fix before pushing", + "5. Push the fix to the pull request branch with `push-to-pull-request-branch`", + "6. Add a comment summarizing the change and why it was made", + "", + "## Constraints", + "", + "- **DO NOT** open a new pull request \u2014 push the fix to the existing branch instead.", + "- **DO NOT** push to any branch other than the triggering pull request's branch.", + "- **DO NOT** push a change that has not been verified by the repository's own tests or formatters." + ], + "min_integrity": "none" + }, "repo-qa-assistant": { "icon": "comment-discussion", "capabilities": { diff --git a/test/copilot-instructions.test.js b/test/copilot-instructions.test.js index ad3c397..d574e38 100644 --- a/test/copilot-instructions.test.js +++ b/test/copilot-instructions.test.js @@ -28,7 +28,7 @@ describe('copilot instructions pattern guidance', () => { } expect(empirical).toHaveLength(9); - expect(curated).toHaveLength(20); + expect(curated).toHaveLength(21); for (const id of empirical) expect(instructions).toContain(`\`${id}\``); for (const id of curated) expect(instructions).toContain(id); expect(instructions).toContain('`custom` is hidden from the wizard archetype cards');