From tce
Pragmatic, in-depth code review of a ticket implementation or a custom scope; writes a review doc to thoughts/shared/reviews/.
How this command is triggered — by the user, by Claude, or both
Slash command
/tce:code_review [ticket-id] [optional focus, e.g. security]The summary Claude sees in its command listing — used to decide when to auto-load this command
# Code Review
You are tasked with conducting thorough, pragmatic code reviews that identify real issues while respecting trade-offs and project context.
## Project context
This command ships in the **tce** workflow plugin. Two project-specific things:
- **Ticket prefix:** Throughout this command, `[PREFIX]` stands for the project's
configured ticket prefix (in `.claude/tce/config`, e.g. `MYAPP`). Resolve the
real prefix by running `"${CLAUDE_PLUGIN_ROOT}/scripts/next-ticket.sh"` once (its
output is `<PREFIX>-NNNN`) or by reading `.claude/tce/config` directly.
- **Stack & conventio...You are tasked with conducting thorough, pragmatic code reviews that identify real issues while respecting trade-offs and project context.
This command ships in the tce workflow plugin. Two project-specific things:
[PREFIX] stands for the project's
configured ticket prefix (in .claude/tce/config, e.g. MYAPP). Resolve the
real prefix by running "${CLAUDE_PLUGIN_ROOT}/scripts/next-ticket.sh" once (its
output is <PREFIX>-NNNN) or by reading .claude/tce/config directly.${CLAUDE_PROJECT_DIR}/.claude/tce/profile.md for
the project's stack, conventions, and the commands used to run tests/lint — base
the "Review Standards" section on what you find there rather than assuming a stack.This command supports the development workflow by validating implementations:
| Step | Command | Purpose |
|---|---|---|
| 1 | /create_ticket | Capture business requirements (WHAT & WHY) |
| 2 | /research_codebase | Research codebase, find patterns & libraries |
| 3 | /create_plan | Clarify questions, create detailed implementation plan |
| 4 | /implement_plan | Execute implementation using all documents |
| ✓ | /review | Validate implementation quality and completeness |
Your role: Conduct an in-depth code review that evaluates implementation quality, completeness, and integration. Be pragmatic—identify real issues, not theoretical imperfections.
IMPORTANT: All review documents MUST be saved to thoughts/shared/reviews/.
Ask yourself before raising an issue:
When this command is invoked, you receive user input in $ARGUMENTS.
Ticket numbers have a specific format: the project's configured prefix ([PREFIX], e.g. MYAPP) followed by - and digits (e.g., [PREFIX]-0001, [PREFIX]-0042). If you don't already know the prefix, resolve it from .claude/tce/config (see Project context above) before classifying the input.
Parse $ARGUMENTS to determine:
[PREFIX]-\d+, using the resolved prefix)?Detection logic:
Input: "[PREFIX]-0042" → Ticket only
Input: "[PREFIX]-0042 focus on security" → Ticket + custom scope
Input: "Review the auth flow" → Custom scope only (no ticket pattern)
Input: "" → No input
CRITICAL: General descriptive text like "Review the backend codebase" or "Check security issues" is NOT a ticket number. Only strings matching the exact pattern [PREFIX]-XXXX (where X are digits) are ticket references.
If a ticket number was found (e.g., [PREFIX]-0001):
If only text input was provided (no ticket pattern):
If both ticket AND text were provided:
If no input was provided, respond with:
I'll help you conduct a code review. What would you like me to review?
Options:
- **Ticket review**: Provide a ticket number (e.g., `[PREFIX]-0001`) to review that implementation
- **Custom review**: Describe what you'd like reviewed (e.g., "Review the authentication flow", "Check the new API endpoints")
Tip: You can combine both: `/review [PREFIX]-0001 focus on security concerns`
Find all ticket-related documents using the ticket script:
"${CLAUDE_PLUGIN_ROOT}/scripts/ticket.sh" [PREFIX]-XXXX
Read all discovered documents FULLY:
thoughts/shared/tickets/[PREFIX]-XXXX-*.md)thoughts/shared/research/*[PREFIX]-XXXX*.md)thoughts/shared/plans/*[PREFIX]-XXXX*.md)Search for related documents using agents:
Gather git history for the ticket:
# Find commits related to the ticket
git log --oneline --all --grep="[PREFIX]-XXXX" --since="3 months ago"
# Get the full diff for ticket-related commits
git log -p --all --grep="[PREFIX]-XXXX" --since="3 months ago"
Identify all files changed for the ticket:
git log --name-only --all --grep="[PREFIX]-XXXX" --since="3 months ago" | grep -v "^$" | grep -v "^commit" | sort -u
Spawn parallel research agents to investigate:
Use codebase-analyzer to understand:
Use codebase-pattern-finder to check:
Use codebase-locator to find:
For ticket-based reviews, evaluate each of these questions:
Was everything from the ticket implemented?
How suitable was the implementation for the ticket requirements?
Have the code changes caused unwanted side-effects?
How well was the code integrated into the existing codebase?
Is anything left missing from the ticket?
How well do the created tests cover the ticket acceptance criteria?
If the ticket replaced an old mechanism, was it cleaned up?
Were security concerns handled correctly?
Did the implementation create duplicate code?
When reviewing without a ticket:
Base your review on ecosystem best practices while remaining pragmatic:
Remember: These are guidelines, not dogma. Pragmatism trumps purism.
date -u +"%Y-%m-%dT%H:%M:%SZ"
git rev-parse HEAD
git branch --show-current
YYYY-MM-DD-[PREFIX]-XXXX-review.md (for ticket reviews)YYYY-MM-DD-description-review.md (for custom reviews)thoughts/shared/reviews/---
date: [ISO timestamp]
git_commit: [commit hash]
branch: [branch name]
ticket: [[PREFIX]-XXXX or "N/A"]
review_scope: "[Brief description of what was reviewed]"
status: complete
---
# Code Review: [Ticket Title or Custom Scope]
**Date**: [Date]
**Reviewer**: Claude
**Ticket**: [[PREFIX]-XXXX or N/A]
**Branch**: [branch]
**Commit**: [hash]
## Review Scope
[What was reviewed and why]
## Executive Summary
[2-3 paragraph overview of findings]
### Priority Findings
#### Critical (Must Fix)
- [Issue with file:line reference and why it matters]
#### Important (Should Fix)
- [Issue with file:line reference and recommendation]
#### Minor (Consider Fixing)
- [Issue with file:line reference and suggestion]
#### Positive Observations
- [What was done well]
## Detailed Findings
### Completeness Assessment
[For ticket reviews: How well does the implementation match the ticket?]
### Code Quality
[Analysis of code structure, patterns, clarity]
### Integration
[How well does it fit with existing codebase?]
### Test Coverage
[Analysis of test quality and coverage]
### Security Review
[Security considerations and findings]
### Performance Considerations
[Any performance implications noted]
## Recommendations
### Immediate Actions
- [ ] [Specific actionable item]
### Future Considerations
- [ ] [Items for later consideration]
## Files Reviewed
- `path/to/file.ext` - [Brief note]
- `another/file.ext` - [Brief note]
## References
- Ticket: `thoughts/shared/tickets/[PREFIX]-XXXX-*.md`
- Plan: `thoughts/shared/plans/*[PREFIX]-XXXX*.md`
- Related: [Other relevant documents]
After writing the review document:
Present a concise summary organized by priority and area:
## Review Complete: [Ticket/Scope]
### Critical Issues (X found)
1. [Brief description] — `file:line`
### Important Issues (X found)
1. [Brief description] — `file:line`
### Minor Issues (X found)
1. [Brief description] — `file:line`
### Strengths Noted
- [Positive observation]
Full review saved to: `thoughts/shared/reviews/YYYY-MM-DD-description.md`
What would you like to do next?
1. **Dig deeper** — I can explain any finding in more detail
2. **Expand review** — Provide additional instructions to review more aspects
3. **Done** — Commit the review document and finish
Which topics would you like to explore further, or should we wrap up?
User: /review [PREFIX]-0042
Claude: Starting review for [PREFIX]-0042. Let me gather all the context...
[Runs ticket.sh, reads documents, gathers git history, spawns analysis agents]
[Produces ticket-focused review document]
User: /review Review the authentication flow in the backend for security issues
Claude: I'll conduct a security-focused review of the authentication flow.
[Uses codebase-locator to find auth-related files]
[Uses codebase-analyzer to understand the implementation]
[Produces custom-scope review document]
User: /review [PREFIX]-0042 focus on the API validation
Claude: Starting review for [PREFIX]-0042 with focus on API validation...
[Gathers ticket context, then focuses analysis on validation aspects]
npx claudepluginhub tobys/toby-plugins --plugin tce/code_reviewPerforms comprehensive code review on modified files, categorizing findings by severity (CRITICAL/HIGH/MEDIUM/LOW), scoring quality, and saving prioritized action plan to Markdown report.