mirror of
https://github.com/wesammustafa/opencode-primer.git
synced 2026-11-18 18:04:22 +00:00
This repo doubles as a fully-configured OpenCode project so readers can see real files instead of abstract format docs. Agents (.opencode/agents/, OpenCode YAML + markdown body): - code-reviewer.md — read-only subagent, glob-gated bash perms, Severity/Where/Why/Fix output format. Rewrites the pre-refactor file which used incorrect frontmatter shape (no YAML, claude-sonnet-4.6 as bare ID, made-up tool keys). - security-auditor.md — OWASP-focused review subagent, deny edit, ask bash, CWE-aware output template. Commands (.opencode/commands/): - review.md, pr.md, test.md, optimize.md — uses real placeholders ($ARGUMENTS, @file, !shell), points the right agent at each task. Plugins (.opencode/plugins/): - protect-secrets.js — blocks tool calls touching .env*, secrets/, credentials*, SSH keys, .npmrc, .pypirc. Pure JS, no deps. - audit-log.js — appends one JSON line per successful tool call to .opencode/audit.jsonl (also added to .gitignore). - README.md — how to install/disable, sample audit-log line, link to docs/plugins.md. Skills (.opencode/skills/git-release/SKILL.md): - Proper folder-with-SKILL.md format. Trigger-shaped description so the model actually loads it when the conversation touches release prep.
936 B
936 B
description, agent
| description | agent |
|---|---|
| Run a code review on changed files (or a path you pass) | plan |
Run a code review with these inputs:
- Scope:
$ARGUMENTSif provided, otherwise the current branch's diff vsmain. - Changed files (always check):
!git diff --name-only main...HEAD
For each changed file, evaluate (in this order):
- Correctness — bugs, race conditions, broken control flow.
- Security — input validation, auth, secrets, OWASP Top 10.
- Performance — N+1 queries, blocking I/O, unbounded loops.
- Maintainability — naming, duplication, missing tests.
Output one entry per finding using this format:
[Severity] <summary>
Where: <file:line>
Why: <one sentence>
Fix: <concrete snippet or instruction>
End with a one-line verdict: LGTM, Approve with comments, or Changes requested.
Do not edit any files in this command — leave the implementation to the developer.