diff --git a/patterns/archetypes/repo-qa-assistant.json b/patterns/archetypes/repo-qa-assistant.json new file mode 100644 index 0000000..1d8206a --- /dev/null +++ b/patterns/archetypes/repo-qa-assistant.json @@ -0,0 +1,34 @@ +{ + "id": "repo-qa-assistant", + "label": "Repo Q&A Assistant", + "description": "Answer ad hoc questions about the repository via a slash command, posting the result as a comment", + "success_rate": null, + "count": 0, + "recommended_triggers": [ + { + "type": "slash_command", + "config": {} + } + ], + "recommended_safe_outputs": [ + "add-comment" + ], + "recommended_tools": [ + "add-comment" + ], + "timeout_minutes": 20, + "prompt_style": "role-steps", + "size_range_bytes": [ + 1500, + 5000 + ], + "top_repos": [], + "tips": [ + "Use a reaction (e.g. eyes) alongside slash_command so requesters get immediate acknowledgement while the agent works", + "Grant read-only permissions and rely on bash/web-fetch tools for investigation instead of write access", + "Set tools.github.min-integrity: none so the assistant can read any issue or pull request context regardless of author trust, since it only answers questions", + "Cap add-comment at max: 1 so a single consolidated answer is posted instead of a running commentary", + "Keep answers scoped to the triggering issue/PR content and repository inspection — avoid speculative external claims" + ], + "anti_patterns": [] +} diff --git a/patterns/manifest.json b/patterns/manifest.json index 44faef7..14a9f46 100644 --- a/patterns/manifest.json +++ b/patterns/manifest.json @@ -31,7 +31,8 @@ "community-digest", "agent-cost-tracker", "contribution-guidelines-checker", - "link-checker" + "link-checker", + "repo-qa-assistant" ], "workflow_generation": "workflow-generation.json", "anti_patterns": [ diff --git a/patterns/workflow-generation.json b/patterns/workflow-generation.json index 1d4710f..53d4d4b 100644 --- a/patterns/workflow-generation.json +++ b/patterns/workflow-generation.json @@ -1084,6 +1084,40 @@ "- **DO NOT** modify relative links or anchors — only HTTP(S) links.", "- **DO NOT** retry links already recorded as unfixable in cache memory without new evidence." ] + }, + "repo-qa-assistant": { + "icon": "comment-discussion", + "capabilities": { + "bash": true, + "web_fetch": true, + "github_toolsets": true + }, + "permissions": [ + "contents", + "issues", + "pull-requests" + ], + "github_toolsets": [ + "default" + ], + "body": [ + "# {{label}}", + "", + "You are a **repository question-answering assistant** invoked via a slash command in an issue or pull request comment.", + "", + "## Process", + "", + "1. Read the triggering comment and the surrounding issue/PR context", + "2. Investigate the repository (code, docs, history) using bash and web-fetch as needed to answer accurately", + "3. Compose a single, concise, accurate answer grounded in what you found", + "4. Post the answer as one comment on the triggering thread", + "", + "## Constraints", + "", + "- **DO NOT** make repository changes — this workflow only answers questions.", + "- **DO NOT** post more than one comment per invocation.", + "- **DO NOT** assert claims you could not verify from the repository or trusted sources." + ] } } }