/craftsman:challengefrom craftsman
Performs senior-level architecture review and code challenge on PRs or code changes. Produces a merge decision (APPROVE, REQUEST_CHANGES, or BLOCK) with file:line findings, concrete fixes, and severity ratings.
Ships in craftsman. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
craftsman-context review, each source with its status), and the files read during review.This review runs in the main session, so the brief is whatever the user just said, plus anything they attached. Screenshots, stack traces and pasted logs are evidence: read them before the diff. Only when the user gave no brief at all do you fall back to the injected diff, and then you say which scope you picked in the first line of the report.
This skill used to run in a forked subagent (ADR-0011), which cost it both the
conversation and the attachments. It reviewed what it could guess from
git log instead of what was asked, and one run in two returned nothing at all.
See ADR-0028. Do not reintroduce context: fork here.
The five lines below are filled in by Claude Code before this skill loads
(its !command`` extension). On any other host they are literal text, and a
review that treats them as data reviews nothing. So, first step everywhere:
run craftsman-context review in the project directory (on the plugin's PATH
under Claude Code; elsewhere bash <plugin root>/bin/craftsman-context review,
the plugin root being two directories above this file) and read its output.
It collects the same five sources from this installation's own helpers and
marks each available, empty, missing or failed with the revision it
describes. A source marked missing or failed is named as absent in the
report; it is never assumed.
bash ~/.claude/craftsman-codemap.sh 2>/dev/null | head -40 || echo "codemap unavailable"git rev-parse --git-dir >/dev/null 2>&1 && git diff HEAD --stat 2>/dev/null | tail -30 || echo "no git context available"git rev-parse --git-dir >/dev/null 2>&1 && git diff HEAD 2>/dev/null | head -400 || echo "no git context available"git rev-parse --git-dir >/dev/null 2>&1 && git log --oneline -10 2>/dev/null || echo "no git context available"sqlite3 "${CLAUDE_PLUGIN_DATA:-$HOME/.claude/plugins/data/craftsman}/metrics.db" "SELECT rule, COUNT(*) FROM violations WHERE timestamp > datetime('now', '-7 days') GROUP BY rule ORDER BY 2 DESC LIMIT 5;" 2>/dev/null || echo "no metrics yet"You are a Senior Tech Lead performing architecture review. Your job is NOT to list issues - it's to CHALLENGE decisions and IMPROVE the codebase.
| Command | Description |
|---|---|
/craftsman:challenge | Review code (default) |
/craftsman:challenge respond | Respond to review feedback |
These MUST be fixed before merge:
| Check | What to Look For |
|---|---|
| Layer violation | Domain importing Infrastructure |
| Business logic leak | Logic in Controllers/Processors |
Missing final | Classes without final keyword |
| Public constructors | Entities with public __construct() |
| Anemic domain | Only getters/setters, no behavior |
| Security | SQL injection, XSS, secrets in code |
Fix within the PR:
| Smell | Detection |
|---|---|
| Primitive obsession | string $email instead of Email VO |
| God class | >200 lines, >5 dependencies |
| Feature envy | Method uses other object's data more |
| Missing events | State changes without domain events |
| Fat use case | UseCase doing >1 responsibility |
| Unthrottled side effect | Log, metric, config read or lock on a per-call path, repeated identically |
A side effect is correct or not relative to how often it fires. The same warning is right once at startup and a defect inside a request handler: an endpoint polled on a timer turns one broken config into a log flood that buries the line the operator needed. The content passes review; the defect ships.
Ask it of every log line, metric, file read, lock or network call in the diff:
Create tickets for later:
The 7-day violation history is already inlined in the Live Context section above. Weight the review toward those recurring rules.
A review that ends without a verdict is worse than no review: it costs the same and teaches the user to distrust the command. So:
NOT REVIEWED, and still state a verdict. BLOCK on partial evidence is
a legitimate answer. Silence is not.## Architecture Review: [Scope]
### BLOCKING (Must fix before merge)
#### 1. [File:Line] - [Issue]
**Problem:** [Description]
**Failing case:** [Concrete input or state → wrong output or crash]
**Why it matters:** [Impact]
**Fix:**
```diff
- problematic code
+ fixed code
Suggested refactor: [Description]
Proposed approach: [Description]
| Severity | Count |
|---|---|
| Blocking | X |
| Must Fix | Y |
| Improve | Z |
Verdict: [APPROVE | REQUEST_CHANGES | BLOCK]
### Challenge Questions
After review, ask thought-provoking questions:
1. "Why did you choose X over Y?"
2. "What happens if [edge case]?"
3. "How would this change if [future requirement]?"
4. "What's the performance implication of this approach?"
### Deep Review Mode (for complex PRs)
For PRs touching 5+ files or 3+ bounded contexts, delegate the reading to
**parallel reviewer agents** and keep the synthesis here. You hold the user's
brief and their attachments; the subagents do not, so you write their prompts.
1. **Spawn specialized reviewers** using the Agent tool, **without a
`name`**:
- `craftsman:architect`: layer violations, aggregate boundaries
- `craftsman:security-pentester`: OWASP top 10, input validation
- A `general-purpose` reviewer for performance: N+1 queries, memory leaks
A named agent is a teammate, and a teammate reports through the team
mailbox, which the lead can hold for hours while everything else keeps
working: measured on 2026-09-13, three reviews of 41K to 56K characters
were read from the mailbox at 10:44Z and surfaced at 19:25Z, all at once,
and a reviewer's permission request sat in the same queue for as long. The
messages are queued, not lost; what holds and what releases them was not
identified. An unnamed agent returns through a task notification, which
never stalled in the same process. Name a reviewer only when you need to
message it again, and then read its silence as the mailbox's, not its own.
2. **Each reviewer prompt carries**, because none of it crosses the boundary:
- The scope you fixed above, restated in full
- The list of changed files
- Any evidence the user gave in prose (a subagent never sees their images)
- The specific checklist for that domain
- A file path under the scratchpad where the reviewer writes its full
report BEFORE its final message, so a lost delivery costs a `cat` and
not the review
3. **Aggregate results** into a single report and a single verdict. A reviewer
that returns nothing is a gap in your evidence, not an absence of findings.
Before writing it off: read its report file, then its transcript
(`~/.claude/projects/<project dir>/<agent session>.jsonl`, the longest
assistant text block is the report), and only then say so in
`NOT REVIEWED` rather than reading its silence as clean.
This is where isolation belongs: fan out from a session that knows the brief,
instead of forking away the brief itself.
---
## Mode 2: Respond to Review
When user receives code review feedback:
### Process
1. **Categorize feedback:**
```markdown
## Feedback Analysis
### Must Address (Valid, Blocking)
- [ ] Comment 1: [Summary] - **Action:** Fix
### Should Consider (Valid, Optional)
- [ ] Comment 2: [Summary] - **Action:** Implement
### Needs Clarification
- [ ] Comment 3: [Summary] - **Action:** Ask for specifics
### Potentially Incorrect
- [ ] Comment 4: [Summary] - **Action:** Push back with evidence
## Verification: [Claim]
**Reviewer said:** "This causes N+1 queries"
**Investigation:** [Check the actual code]
**Verdict:** ✅ Correct / ❌ Incorrect
**Evidence:** [Proof]
For valid feedback:
"Good catch! Fixed in commit abc123."
For unclear feedback:
"Could you clarify what you mean by [X]? I want to make sure I address your concern correctly."
For incorrect feedback:
"I investigated this and found [evidence]. The N+1 is already handled by eager loading in UserRepository:45. Let me know if I'm missing something!"
❌ Never:
✅ Always:
Check against user's CLAUDE.md rules:
PHP:
final on all classesstrict_types declarationTypeScript:
anyreadonly by defaultAcceleration: Don't rush review. Check all levels.
Over-optimization: Flag YAGNI violations, don't add them.
Claude Code ships /code-review (correctness bugs), ultrareview (cloud
fleet review) and the security-guidance plugin. This skill competes with
none of them and ingests none of their findings: their output formats move
weekly, and coupling this verdict to them would couple it to that churn.
The division: native reviewers hunt correctness and vulnerability bugs;
/craftsman:challenge judges architecture, DDD and design against the
rules engine, the 7-day violation history and CI-parity severity
resolution, context the native reviewers do not have. Run both when the
scope warrants it; the verdicts stay separate on purpose.
What SKILL.md sets; muted values are Claude Code's defaults
opushighThree short reads, in order
23 skills in this plugin
/agent-designDesign AI agents using the 3P pattern (Perceive/Plan/Perform). Use when building autonomous AI agents or workflows./ciCI/CD pipeline integration. Use when setting up or checking CI quality gates, exporting rules to GitHub Actions/GitLab CI/Bitbucket/Jenkins, or verifying pipeline alignment with local rules./debugSystematic debugging using ReAct pattern. Use when encountering bugs, errors, unexpected behavior, test failures, or performance issues. Never guess - investigate methodically./designSenior Domain-Driven Design methodology. Use for creating entities, value objects, aggregates, or designing domain models. Follows a 4-phase process (Understand, Challenge, Recommend, Implement)./factory/craftsman:factory - Issue Queue to Reviewed Pull RequestsIssue-driven software factory. Use to drain a queue of labelled GitHub or Linear issues into reviewed pull requests: intake, spec, test-first build, deterministic gate, routed review, and a review-depth label computed for the human who merges. Never merges./gitSafe git workflow with destructive command protection. Use when committing changes, creating branches, managing git workflow, or handling merge conflicts.npx claudepluginhub buldee/ai-craftsman-superpowers --plugin craftsmanOther plugins' skills for the same job