diff --git a/patterns/archetypes/contribution-guidelines-checker.json b/patterns/archetypes/contribution-guidelines-checker.json new file mode 100644 index 0000000..dc92218 --- /dev/null +++ b/patterns/archetypes/contribution-guidelines-checker.json @@ -0,0 +1,35 @@ +{ + "id": "contribution-guidelines-checker", + "label": "Contribution Guidelines Checker", + "description": "Check pull requests against CONTRIBUTING.md and label them ready or needing work", + "success_rate": null, + "count": 0, + "recommended_triggers": [ + { + "type": "pull_request", + "config": {} + } + ], + "recommended_safe_outputs": [ + "pull-requests" + ], + "recommended_tools": [ + "add-labels", + "add-comment" + ], + "timeout_minutes": 10, + "prompt_style": "role-steps", + "size_range_bytes": [ + 3000, + 8000 + ], + "top_repos": [], + "tips": [ + "Search CONTRIBUTING.md, .github/CONTRIBUTING.md, docs/CONTRIBUTING.md, and README contribution sections in order before falling back to general best practices", + "Label the pull request ready when it complies and leave one constructive comment when it does not — never both", + "Use a small model since this runs on every pull request open/synchronize event and cost adds up", + "For high-volume repositories, pre-filter and fetch PR data in a steps: block, then dispatch each PR to an inline sub-agent for evaluation so the parent workflow only compiles results", + "Use DO NOT constraints to avoid merging, approving, or closing contributions — label and comment only" + ], + "anti_patterns": [] +} diff --git a/patterns/manifest.json b/patterns/manifest.json index 8d5bfa0..c27cec8 100644 --- a/patterns/manifest.json +++ b/patterns/manifest.json @@ -29,7 +29,8 @@ "code-health-auditor", "ci-failure-triage", "community-digest", - "agent-cost-tracker" + "agent-cost-tracker", + "contribution-guidelines-checker" ], "workflow_generation": "workflow-generation.json", "anti_patterns": [ diff --git a/patterns/workflow-generation.json b/patterns/workflow-generation.json index b794a5a..329e7d8 100644 --- a/patterns/workflow-generation.json +++ b/patterns/workflow-generation.json @@ -1015,6 +1015,43 @@ "- **DO NOT** create an issue or comment when the token-usage log is missing or empty.", "- **DO NOT** let cost reports accumulate — cap and deduplicate created issues." ] + }, + "contribution-guidelines-checker": { + "icon": "checklist", + "capabilities": { + "bash": true, + "github_toolsets": true + }, + "permissions": [ + "contents", + "issues", + "pull-requests" + ], + "github_toolsets": [ + "repos", + "issues", + "pull_requests" + ], + "body": [ + "# {{label}}", + "", + "You are a **contribution guidelines checker** for this repository.", + "", + "Your job is to verify pull request #${{ github.event.pull_request.number }} complies with the repository's contribution guidelines.", + "", + "## Process", + "", + "1. Find the contribution guidelines: check `CONTRIBUTING.md`, `.github/CONTRIBUTING.md`, `docs/CONTRIBUTING.md`, then contribution sections in `README.md`. Fall back to general best practices if none exist.", + "2. Read the pull request title, description, changed files, and commit messages", + "3. Compare the pull request against the guidelines (scope, tests, documentation, commit style)", + "4. If it complies, apply the `contribution-ready` label. Otherwise, leave one constructive comment describing what needs to change.", + "", + "## Constraints", + "", + "- **DO NOT** merge, approve, or close contributions.", + "- **DO NOT** post more than one comment per run.", + "- **DO NOT** apply the ready label and post a needs-work comment in the same run — pick one outcome." + ] } } }