Prompt file imported from buegelbeatz/tsp-quantum (
.github/prompts/roles-add.prompt.md). Copyright stays with the author.
/roles-add Prompt
Assign an existing non-generic agent to a generic role by adding it to the role's agents: list in YAML frontmatter.
/roles-add generic="<role>" agent="<agent-name>"
Example:
/roles-add generic="deliver" agent="data-scientist"
/roles-add generic="review" agent="security-expert"
/roles-add generic="expert" agent="mcp-expert"
Execution Contract
- Normalize
generic=value:- if value starts with
generic-, strip the prefix - else use the value as-is
- if value starts with
- Resolve
ROLE_FILE=.github/agents/roles/generic-<role>.agent.md. - Validate
ROLE_FILEexists — if not, emit error and stop:[ERROR] roles-add: generic role "generic-<role>" not found at <path> - Resolve
AGENT_FILE=.github/agents/<agent>.agent.md. - Validate
AGENT_FILEexists — if not, emit error and stop:[ERROR] roles-add: agent "<agent>" not found at <path> - Reject if
<agent>matchesgeneric-*pattern (cannot assign a generic role to another generic role). - Read current
agents:list fromROLE_FILEYAML frontmatter. - If
<agent>is already present in the list, report idempotent result and stop:[INFO] roles-add: "<agent>" is already assigned to "generic-<role>" — no change - Add
<agent>to theagents:list and maintain alphabetical order. - Write the updated frontmatter back to
ROLE_FILE. - Print confirmation summary:
[SUCCESS] roles-add: "<agent>" → "generic-<role>"
Updated: agents/roles/generic-.agent.md
```
12. Immediately run /roles and append the refreshed role tree and unassigned section to the output.
Documentation Contract
- No documentation files are updated by this prompt.
/rolesis executed automatically at the end for immediate visibility.- Changes to agent files are tracked by git; review with
git diff.
Verification
After assignment, confirm from the auto-appended /roles output that the agent appears under the correct role and is removed from the Unassigned Agents section.
Constraints
- Only non-generic agents (files NOT matching
generic-*.agent.md) can be assigned. - Each agent may be assigned to multiple roles (many-to-many allowed).
- Alphabetical order in the
agents:list is enforced on write. generic=accepts bothdeliverandgeneric-deliver(same forexpertandreview).agent=must match an existing agent file name exactly (e.g.,security-expert, notsecurity-expert.agent.md).
Available Generic Roles
| Role token | File |
|---|---|
deliver |
roles/generic-deliver.agent.md |
expert |
roles/generic-expert.agent.md |
review |
roles/generic-review.agent.md |