with one click
pwrl-work-review
Review, simplify, and consolidate code after execution
Install with Codex or Claude Copy this prompt, paste it into Codex, Claude, or another assistant, and let it review the skill page and install it for you.
Menu
Review, simplify, and consolidate code after execution
Install with Codex or Claude Copy this prompt, paste it into Codex, Claude, or another assistant, and let it review the skill page and install it for you.
Based on SOC occupation classification
| name | pwrl-work-review |
| description | Review, simplify, and consolidate code after execution |
| argument-hint | [Executed tasks from pwrl-work-execute, design specs (optional)] |
ask_user_question, ask_user, ask_user_input, vscode/askQuestions or any available extension/tool for user interaction for all decisionsPurpose: Review code after execution to consolidate duplication, extract shared helpers, run system-wide consistency checks, compare UI implementations to design specs (when applicable), and determine readiness for shipping.
Accepts execution results from pwrl-work-execute:
mode: serial
taskCount: 5
tasksCompleted: 5
results:
- unit-id: S1
taskFile: docs/tasks/for-review/...
status: for-review
testsPassed: true
files: [src/utils.ts, src/api.ts]
Optional: design spec references for UI work (e.g., Figma links, docs/design/ files).
duplicationFound: true
duplicationsConsolidated: 3
helpersExtracted: 2
helperNames: [isValidEmail, parseUserInput]
LOCReduced: 120
systemChecks:
eventTriggering: pass
mockCoverage: warning
idempotency: pass
alternateEntryPoints: pass
designSpecDeltas: 0
refactoringScope: controlled
readyForShipping: true
recommendations:
- "Add 2 integration tests for mock coverage"
After every 2-3 related tasks:
files field in execution resultsgit diff against base branch: git diff --name-only <base>...HEADScan modified files for code duplication:
Approach:
For each modified file, look for:
Cross-file duplication:
For each candidate, show:
Example:
Found duplication between src/user.ts:45 and src/signup.ts:72:
Both validate email with same regex: /^[^@]+@[^@]+\.[^@]+$/
Proposed: Extract isValidEmail() to src/validation.ts
LOC reduction: 12 lines
Decision:
For confirmed candidates, extract shared logic:
When to extract:
When NOT to extract (YAGNI):
Extraction process:
Design helper:
Create helper file (or add to existing shared module):
src/utils.ts, src/validation.ts)Write tests for helper (test-first):
Replace call sites:
Run tests:
After simplifying, verify system consistency:
Check 1: Event/Observer/Callback Triggering
user.created after signup)Check 2: Mock vs. Real Interaction Balance
Check 3: Idempotency & Cleanup Safety
Check 4: Alternate Entry Points
Log results:
System Check Results:
[✓] Event triggering: POST /user fires 'user.created'
[⚠] Mock coverage: 8/10 tests use mocks → add 2 integration tests
[✓] Idempotency: DELETE /user safe to retry
[✓] Alternate entry points: API + CLI tested, consistent behavior
For tasks involving UI/component changes:
If design specs exist:
docs/design/ or linked Figma file| Severity | Meaning | Action |
|---|---|---|
| Minor | Within 2px, slightly different shade | Acceptable, note |
| Moderate | Wrong component variant, minor layout shift | Should fix |
| Critical | Completely wrong layout, broken responsive | Must fix |
If no design specs:
Golden Rule: Only simplify code that was changed by executed tasks.
Do:
Do NOT:
Enforcement:
duplicationFound: true
duplicationsConsolidated: 2
helpersExtracted: 1
helperNames: [isValidEmail]
LOCReduced: 34
systemChecks:
eventTriggering: pass
mockCoverage: warning
idempotency: pass
alternateEntryPoints: pass
refactoringScope: controlled
readyForShipping: true
recommendations:
- "Add 2 integration tests with real DB for user module"
If readyForShipping is true, work is ready for pull request creation.
For complex or high-risk changes, offer deep review:
/pwrl-work-review docs/tasks/for-review/ --deep
Deep review adds:
For detailed analysis, use the dedicated /pwrl-review skill.
| Scenario | Handling |
|---|---|
| No duplications found | Log "No duplications detected" (normal) |
| Git diff parsing fails | Log error, ask user to verify git state, retry |
| Design spec not found | Skip design comparison, continue |
| Tests fail after consolidation | Revert consolidation, mark as blocked, investigate |
| Unrelated changes in diff | Warn user, ask to remove or explain |
docs/analysis/2026-06-05-pwrl-work-structure-analysis.mdpwrl-work skill (Phase 3: Simplify & Review, lines 173-185)Extract, classify, deduplicate, structure, and save learnings from code, commits, tasks, and documentation
Create structured implementation plans with three tiers (Fast/Standard/Deep). Pure skill pipeline orchestrator—no agent routing.
Review code changes through 4-phase micro-skill pipeline (scope, prepare, analyze, report)
Execute implementation work efficiently through 4-phase micro-skill pipeline
Verify repository state and confirm session completion before committing.
Create a clear session commit with state and next steps. Orchestrates checkpoint and commit micro-skills, optionally chains to pwrl-learnings.