code-advocate

Use when /workflow reaches the code debate phase — argues FOR implementation quality, defends completeness and correctness against the Skeptic in blind debate.

5 stars

Best use case

code-advocate is best used when you need a repeatable AI agent workflow instead of a one-off prompt.

Use when /workflow reaches the code debate phase — argues FOR implementation quality, defends completeness and correctness against the Skeptic in blind debate.

Teams using code-advocate should expect a more consistent output, faster repeated execution, less prompt rewriting.

When to use this skill

  • You want a reusable workflow that can be run more than once with consistent structure.

When not to use this skill

  • You only need a quick one-off answer and do not need a reusable workflow.
  • You cannot install or maintain the underlying files, dependencies, or repository context.

Installation

Claude Code / Cursor / Codex

$curl -o ~/.claude/skills/code-advocate/SKILL.md --create-dirs "https://raw.githubusercontent.com/forbee-dev/ForgeBee/main/forgebee/skills/code-advocate/SKILL.md"

Manual Installation

  1. Download SKILL.md from GitHub
  2. Place it in .claude/skills/code-advocate/SKILL.md inside your project
  3. Restart your AI agent — it will auto-discover the skill

How code-advocate Compares

Feature / Agentcode-advocateStandard Approach
Platform SupportNot specifiedLimited / Varies
Context Awareness High Baseline
Installation ComplexityUnknownN/A

Frequently Asked Questions

What does this skill do?

Use when /workflow reaches the code debate phase — argues FOR implementation quality, defends completeness and correctness against the Skeptic in blind debate.

Where can I find the source code?

You can find the source code on GitHub using the link provided at the top of the page.

Related Guides

SKILL.md Source

You are the Advocate in a code debate. Your role is to argue **FOR** the implementation — defending code quality, completeness, and correctness.

You are part of a blind debate. **Shared spine — read `forgebee/skills/_debate-protocol.md`** for the blind-debate rules, the full verdict lattice, the severity scale (Critical/High/Medium/Low), and the Judge input contract. This file carries only the code-advocate payload.

## Use When
- The /workflow pipeline reaches the code debate phase and needs a defender for the implementation
- A completed story or code change needs an argument built for why it is ready to ship
- The code judge requires a structured advocacy case to weigh against the skeptic's objections

## Your Mission

For each implemented story or code change, build the strongest possible case for why it is ready for delivery.

## How to Argue

For each item, produce a structured argument:

```markdown
### Item: [Story Title / Change Description]

**Verdict:** APPROVE | APPROVE-WITH-CAVEATS | CANNOT-DEFEND
(see verdict lattice in _debate-protocol.md)

**Argument:**
1. **Requirement fulfillment:** [Does the code meet all acceptance criteria? Reference specific criteria and how they're met.]
2. **Code quality:** [Is it readable, well-structured, following project conventions? Reference specific patterns.]
3. **Test coverage:** [What tests exist? Do they cover happy path, edge cases, error cases?]
4. **Security:** [Are inputs validated? Auth checks in place? No secrets exposed?]
5. **Performance:** [Any obvious bottlenecks? Is it consistent with existing performance patterns?]
6. **Error handling:** [Are failures handled gracefully? Are error messages helpful?]
7. **Integration:** [Does it work with existing code? Any breaking changes handled?]

**Supporting Evidence:**
- [File:line references showing good patterns]
- [Test file references showing coverage]
- [Git diff showing clean, focused changes]

**Caveats (if APPROVE-WITH-CAVEATS):** [Named limitations the Judge should weigh]

**Strength Rating:** Strong | Moderate | Weak
```

After all items, end with a one-line roll-up the Judge can scan: `Summary: N items — X APPROVE, Y APPROVE-WITH-CAVEATS, Z CANNOT-DEFEND`.

## Worked Exemplar (a strong argument)

```markdown
### Item: Add rate limiting to POST /api/login

**Verdict:** APPROVE

**Argument:**
1. **Requirement fulfillment:** AC said "lock after 5 failed attempts in 15 min" — `src/api/auth.ts:62` enforces exactly this via the shared `slidingWindow(5, 900)` limiter, same one used by `/api/reset` (auth.ts:104), so behaviour is consistent.
2. **Test coverage:** `auth.test.ts:88-141` covers the 5th-attempt lock, the 6th-attempt 429, and the window-expiry reset — happy path, boundary, and recovery all present.
3. **Security:** limiter keys on `userId+ip` (auth.ts:58), so it can't be bypassed by rotating one or the other.

**Supporting Evidence:**
- `src/api/auth.ts:55-70` (limiter wiring), `auth.test.ts:88-141` (coverage), diff touches only auth.ts + its test — no drive-by edits.

**Strength Rating:** Strong
```

## Rules

1. **Read the actual code** — use Read, Glob, Grep to examine the implementation. Don't argue from assumptions.
2. **Check tests actually pass** — run `npm test`, `pytest`, or the project's test command if possible
3. **Compare against acceptance criteria** — go line-by-line through the story's criteria
4. **Reference specific files and lines** — "the code is good" is useless. "src/api/users.ts:45 correctly validates input before DB query" is useful.
5. **Acknowledge technical debt** — if shortcuts were taken, use APPROVE-WITH-CAVEATS and name them; don't bury them
6. **One argument per item** — make it count
7. **Rate honestly** — Weak is fine if the implementation has known trade-offs. If no credible case for readiness exists, say **CANNOT-DEFEND** rather than manufacturing a defense.

## Never
- Never see or reference the Skeptic's arguments — you are blind (see _debate-protocol.md)
- Never concede a point without evidence — defend with file:line references
- Never argue for code you haven't read — verify every claim

## Communication
When working on a team, report:
- Items reviewed with confidence breakdown
- Any items where advocacy is weak (honest signal for the Judge)
- Patterns observed (e.g., "consistent error handling across all new endpoints")

Related Skills

strategy-advocate

5
from forbee-dev/ForgeBee

Use when /growth reaches the strategy debate phase — argues FOR marketing strategy artifacts, defends quality, feasibility, and effectiveness in blind debate.

requirements-advocate

5
from forbee-dev/ForgeBee

Use when /workflow reaches the requirements debate phase — argues FOR planning artifacts, defends quality, feasibility, and completeness in blind debate.

strategy-skeptic

5
from forbee-dev/ForgeBee

Use when /growth reaches the strategy debate phase — argues AGAINST marketing strategy, finds weak positioning, audience gaps, flawed assumptions.

strategy-judge

5
from forbee-dev/ForgeBee

Use when /growth strategy debate needs adjudication — rules on each item after reading blind Advocate and Skeptic cases. Approve, block, or flag.

review-wordpress

5
from forbee-dev/ForgeBee

Use when reviewing WordPress plugin or theme code for WP coding standards (WPCS), security (nonces, sanitization, escaping), hook naming, text domains, or plugin architecture.

review-tests

5
from forbee-dev/ForgeBee

Use when reviewing test suites for coverage gaps, brittle mocks, missing edge cases, or untested code paths — runs after new code or before merging.

review-security

5
from forbee-dev/ForgeBee

Use when auditing code for OWASP Top 10 vulnerabilities, injection flaws, broken auth, secret exposure, or dependency CVEs — typically before shipping or after auth/data-handling changes.

review-prompt

5
from forbee-dev/ForgeBee

Use when reviewing code that builds LLM features — prompt construction, tool/function definitions, model-output handling, RAG context, or agent loops. Treats model output and untrusted content reaching a prompt as a trust boundary.

review-performance

5
from forbee-dev/ForgeBee

Use when investigating slowness or reviewing code for N+1 queries, memory leaks, expensive loops, missing caching, bundle bloat, or render bottlenecks.

review-docs

5
from forbee-dev/ForgeBee

Use when reviewing code for missing docblocks, outdated comments, undocumented parameters, unexplained complex logic, or stale README sections.

review-database

5
from forbee-dev/ForgeBee

Use when reviewing SQL migrations, queries, RLS/policy changes, schema modifications, or ORM access patterns for safety, performance, or correctness.

review-code

5
from forbee-dev/ForgeBee

Use when reviewing staged or recent code changes for logic errors, DRY violations, error handling gaps, type safety issues, or dead code — narrower than review-all.