feat(guardrails): add remaining 5 CC agent definitions#117
Conversation
…r, database-administrator, mobile-developer, refactor-cleaner, security-reviewer) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
Adds the final missing Claude Code–parity agent definitions to the packages/guardrails profile so they can be loaded as OpenCode agents (bringing the profile to the stated full agent set).
Changes:
- Added new read-only review agents:
code-reviewerandsecurity-reviewer - Added a read-only diagnostic
database-administratoragent with a DB CLI bash allowlist - Added write-capable agents
mobile-developerandrefactor-cleaner(with permission constraints)
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/guardrails/profile/agents/security-reviewer.md | Adds a read-only security-focused reviewer agent definition. |
| packages/guardrails/profile/agents/refactor-cleaner.md | Adds a refactor/cleanup agent definition, including bash allowlist and ask-gated edits. |
| packages/guardrails/profile/agents/mobile-developer.md | Adds a mobile-focused implementation agent definition with implement-like bash deny rules. |
| packages/guardrails/profile/agents/database-administrator.md | Adds a read-only DBA agent definition with DB CLI diagnostic command allowlist. |
| packages/guardrails/profile/agents/code-reviewer.md | Adds a read-only code quality reviewer agent definition. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| "npx knip*": allow | ||
| "npx depcheck*": allow | ||
| "npx ts-prune*": allow | ||
| "npx eslint*": allow | ||
| "bun run *": allow | ||
| "bun test*": allow | ||
| "npm run*": allow |
There was a problem hiding this comment.
The bash allowlist here is broader than the PR description/issue requirement (“scoped bash … knip/depcheck/ts-prune only”). Allowing bun run *, npm run*, and npx eslint* can execute arbitrary project scripts/binaries (including destructive ones) despite the intent of a narrowly-scoped refactor-cleaner. Tighten the bash allowlist to only the intended analysis commands (and any strictly necessary read-only helpers like git diff/status/log, ls, pwd, which).
| "psql --version*": allow | ||
| "psql -c 'EXPLAIN *": allow | ||
| "psql -c 'SELECT *": allow | ||
| "psql -c '\\d*": allow |
There was a problem hiding this comment.
Allowing arbitrary psql -c 'SELECT ...' is very broad for a “read-only diagnostic” agent: it can easily result in large data dumps/exfiltration and expensive queries (and Postgres also supports mutating forms like SELECT INTO). Consider narrowing the allowlist to safer diagnostics (e.g., EXPLAIN/catalog \d queries) or enforce constraints like requiring LIMIT / explicit schema-qualified tables.
| "mysql --version*": allow | ||
| "mysql -e 'EXPLAIN *": allow | ||
| "mysql -e 'SHOW *": allow | ||
| "mysql -e 'SELECT *": allow |
There was a problem hiding this comment.
Similarly, allowing mysql -e 'SELECT ...' is broad for a diagnostic-only DBA agent and can lead to full-table reads or expensive queries. Consider restricting to EXPLAIN/SHOW-only patterns (or requiring SELECT statements to include LIMIT) to better align with the agent’s read-only diagnostic intent.
| "mysql -e 'SELECT *": allow |
06fcb0b to
0a50eec
Compare
Issue for this PR
Closes #110
Type of change
What does this PR do?
Adds the final 5 Claude Code agent definitions that were missing from the OpenCode guardrails profile, bringing agent parity to 100% (31 agents total, covering all 26 CC agents + 5 OC originals).
New agents:
code-reviewerdatabase-administratormobile-developerrefactor-cleanersecurity-reviewerSecurity: findLast pitfall avoided — No agent-level
read:orgrep:blocks are set. All agents inherit profile-level secret file deny rules (.env,.pem,.key,credentials, etc.) via the profile'sopencode.jsonpermission config. This follows the established pattern ofreview.md,investigate.md, andsecurity.md.How did you verify your code works?
bun turbo typecheck— 13/13 passbun run --filter opencode build— smoke test passopencode --versionoutputs correctlyChecklist