claude-mpm 4.15.6__py3-none-any.whl → 4.21.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of claude-mpm might be problematic. Click here for more details.

Files changed (194) hide show
  1. claude_mpm/VERSION +1 -1
  2. claude_mpm/agents/BASE_ENGINEER.md +286 -0
  3. claude_mpm/agents/BASE_PM.md +272 -23
  4. claude_mpm/agents/PM_INSTRUCTIONS.md +49 -0
  5. claude_mpm/agents/agent_loader.py +4 -4
  6. claude_mpm/agents/templates/engineer.json +5 -1
  7. claude_mpm/agents/templates/php-engineer.json +10 -4
  8. claude_mpm/agents/templates/python_engineer.json +8 -3
  9. claude_mpm/agents/templates/rust_engineer.json +12 -7
  10. claude_mpm/agents/templates/svelte-engineer.json +225 -0
  11. claude_mpm/cli/commands/__init__.py +2 -0
  12. claude_mpm/cli/commands/mpm_init/__init__.py +73 -0
  13. claude_mpm/cli/commands/mpm_init/core.py +525 -0
  14. claude_mpm/cli/commands/mpm_init/display.py +341 -0
  15. claude_mpm/cli/commands/mpm_init/git_activity.py +427 -0
  16. claude_mpm/cli/commands/mpm_init/modes.py +397 -0
  17. claude_mpm/cli/commands/mpm_init/prompts.py +442 -0
  18. claude_mpm/cli/commands/mpm_init_cli.py +396 -0
  19. claude_mpm/cli/commands/mpm_init_handler.py +67 -1
  20. claude_mpm/cli/commands/skills.py +488 -0
  21. claude_mpm/cli/executor.py +2 -0
  22. claude_mpm/cli/parsers/base_parser.py +7 -0
  23. claude_mpm/cli/parsers/mpm_init_parser.py +42 -0
  24. claude_mpm/cli/parsers/skills_parser.py +137 -0
  25. claude_mpm/cli/startup.py +57 -0
  26. claude_mpm/commands/mpm-auto-configure.md +52 -0
  27. claude_mpm/commands/mpm-help.md +3 -0
  28. claude_mpm/commands/mpm-init.md +112 -6
  29. claude_mpm/commands/mpm-version.md +113 -0
  30. claude_mpm/commands/mpm.md +1 -0
  31. claude_mpm/config/agent_config.py +2 -2
  32. claude_mpm/constants.py +12 -0
  33. claude_mpm/core/config.py +42 -0
  34. claude_mpm/core/factories.py +1 -1
  35. claude_mpm/core/interfaces.py +56 -1
  36. claude_mpm/core/optimized_agent_loader.py +3 -3
  37. claude_mpm/hooks/__init__.py +8 -0
  38. claude_mpm/hooks/claude_hooks/response_tracking.py +35 -1
  39. claude_mpm/hooks/session_resume_hook.py +121 -0
  40. claude_mpm/models/resume_log.py +340 -0
  41. claude_mpm/services/agents/auto_config_manager.py +1 -1
  42. claude_mpm/services/agents/deployment/agent_configuration_manager.py +1 -1
  43. claude_mpm/services/agents/deployment/agent_record_service.py +1 -1
  44. claude_mpm/services/agents/deployment/agent_validator.py +17 -1
  45. claude_mpm/services/agents/deployment/async_agent_deployment.py +1 -1
  46. claude_mpm/services/agents/deployment/local_template_deployment.py +1 -1
  47. claude_mpm/services/agents/local_template_manager.py +1 -1
  48. claude_mpm/services/agents/recommender.py +47 -0
  49. claude_mpm/services/cli/resume_service.py +617 -0
  50. claude_mpm/services/cli/session_manager.py +87 -0
  51. claude_mpm/services/cli/session_pause_manager.py +504 -0
  52. claude_mpm/services/cli/session_resume_helper.py +372 -0
  53. claude_mpm/services/core/interfaces.py +56 -1
  54. claude_mpm/services/core/models/agent_config.py +3 -0
  55. claude_mpm/services/core/models/process.py +4 -0
  56. claude_mpm/services/core/path_resolver.py +1 -1
  57. claude_mpm/services/diagnostics/models.py +21 -0
  58. claude_mpm/services/infrastructure/resume_log_generator.py +439 -0
  59. claude_mpm/services/local_ops/__init__.py +2 -0
  60. claude_mpm/services/mcp_config_manager.py +7 -131
  61. claude_mpm/services/mcp_gateway/auto_configure.py +31 -25
  62. claude_mpm/services/mcp_gateway/core/process_pool.py +19 -10
  63. claude_mpm/services/mcp_gateway/tools/external_mcp_services.py +26 -21
  64. claude_mpm/services/session_manager.py +205 -1
  65. claude_mpm/services/unified/deployment_strategies/local.py +1 -1
  66. claude_mpm/services/version_service.py +104 -1
  67. claude_mpm/skills/__init__.py +21 -0
  68. claude_mpm/skills/agent_skills_injector.py +324 -0
  69. claude_mpm/skills/bundled/LICENSE_ATTRIBUTIONS.md +79 -0
  70. claude_mpm/skills/bundled/api-documentation.md +393 -0
  71. claude_mpm/skills/bundled/async-testing.md +571 -0
  72. claude_mpm/skills/bundled/code-review.md +143 -0
  73. claude_mpm/skills/bundled/collaboration/brainstorming/SKILL.md +79 -0
  74. claude_mpm/skills/bundled/collaboration/dispatching-parallel-agents/SKILL.md +178 -0
  75. claude_mpm/skills/bundled/collaboration/dispatching-parallel-agents/references/agent-prompts.md +577 -0
  76. claude_mpm/skills/bundled/collaboration/dispatching-parallel-agents/references/coordination-patterns.md +467 -0
  77. claude_mpm/skills/bundled/collaboration/dispatching-parallel-agents/references/examples.md +537 -0
  78. claude_mpm/skills/bundled/collaboration/dispatching-parallel-agents/references/troubleshooting.md +730 -0
  79. claude_mpm/skills/bundled/collaboration/requesting-code-review/SKILL.md +112 -0
  80. claude_mpm/skills/bundled/collaboration/requesting-code-review/references/code-reviewer-template.md +146 -0
  81. claude_mpm/skills/bundled/collaboration/requesting-code-review/references/review-examples.md +412 -0
  82. claude_mpm/skills/bundled/collaboration/writing-plans/SKILL.md +81 -0
  83. claude_mpm/skills/bundled/collaboration/writing-plans/references/best-practices.md +362 -0
  84. claude_mpm/skills/bundled/collaboration/writing-plans/references/plan-structure-templates.md +312 -0
  85. claude_mpm/skills/bundled/database-migration.md +199 -0
  86. claude_mpm/skills/bundled/debugging/root-cause-tracing/SKILL.md +152 -0
  87. claude_mpm/skills/bundled/debugging/root-cause-tracing/references/advanced-techniques.md +668 -0
  88. claude_mpm/skills/bundled/debugging/root-cause-tracing/references/examples.md +587 -0
  89. claude_mpm/skills/bundled/debugging/root-cause-tracing/references/integration.md +438 -0
  90. claude_mpm/skills/bundled/debugging/root-cause-tracing/references/tracing-techniques.md +391 -0
  91. claude_mpm/skills/bundled/debugging/systematic-debugging/CREATION-LOG.md +119 -0
  92. claude_mpm/skills/bundled/debugging/systematic-debugging/SKILL.md +148 -0
  93. claude_mpm/skills/bundled/debugging/systematic-debugging/references/anti-patterns.md +483 -0
  94. claude_mpm/skills/bundled/debugging/systematic-debugging/references/examples.md +452 -0
  95. claude_mpm/skills/bundled/debugging/systematic-debugging/references/troubleshooting.md +449 -0
  96. claude_mpm/skills/bundled/debugging/systematic-debugging/references/workflow.md +411 -0
  97. claude_mpm/skills/bundled/debugging/systematic-debugging/test-academic.md +14 -0
  98. claude_mpm/skills/bundled/debugging/systematic-debugging/test-pressure-1.md +58 -0
  99. claude_mpm/skills/bundled/debugging/systematic-debugging/test-pressure-2.md +68 -0
  100. claude_mpm/skills/bundled/debugging/systematic-debugging/test-pressure-3.md +69 -0
  101. claude_mpm/skills/bundled/debugging/verification-before-completion/SKILL.md +131 -0
  102. claude_mpm/skills/bundled/debugging/verification-before-completion/references/gate-function.md +325 -0
  103. claude_mpm/skills/bundled/debugging/verification-before-completion/references/integration-and-workflows.md +490 -0
  104. claude_mpm/skills/bundled/debugging/verification-before-completion/references/red-flags-and-failures.md +425 -0
  105. claude_mpm/skills/bundled/debugging/verification-before-completion/references/verification-patterns.md +499 -0
  106. claude_mpm/skills/bundled/docker-containerization.md +194 -0
  107. claude_mpm/skills/bundled/express-local-dev.md +1429 -0
  108. claude_mpm/skills/bundled/fastapi-local-dev.md +1199 -0
  109. claude_mpm/skills/bundled/git-workflow.md +414 -0
  110. claude_mpm/skills/bundled/imagemagick.md +204 -0
  111. claude_mpm/skills/bundled/json-data-handling.md +223 -0
  112. claude_mpm/skills/bundled/main/artifacts-builder/SKILL.md +86 -0
  113. claude_mpm/skills/bundled/main/internal-comms/SKILL.md +43 -0
  114. claude_mpm/skills/bundled/main/internal-comms/examples/3p-updates.md +47 -0
  115. claude_mpm/skills/bundled/main/internal-comms/examples/company-newsletter.md +65 -0
  116. claude_mpm/skills/bundled/main/internal-comms/examples/faq-answers.md +30 -0
  117. claude_mpm/skills/bundled/main/internal-comms/examples/general-comms.md +16 -0
  118. claude_mpm/skills/bundled/main/mcp-builder/SKILL.md +160 -0
  119. claude_mpm/skills/bundled/main/mcp-builder/reference/design_principles.md +412 -0
  120. claude_mpm/skills/bundled/main/mcp-builder/reference/evaluation.md +602 -0
  121. claude_mpm/skills/bundled/main/mcp-builder/reference/mcp_best_practices.md +915 -0
  122. claude_mpm/skills/bundled/main/mcp-builder/reference/node_mcp_server.md +916 -0
  123. claude_mpm/skills/bundled/main/mcp-builder/reference/python_mcp_server.md +752 -0
  124. claude_mpm/skills/bundled/main/mcp-builder/reference/workflow.md +1237 -0
  125. claude_mpm/skills/bundled/main/mcp-builder/scripts/connections.py +157 -0
  126. claude_mpm/skills/bundled/main/mcp-builder/scripts/evaluation.py +425 -0
  127. claude_mpm/skills/bundled/main/skill-creator/SKILL.md +189 -0
  128. claude_mpm/skills/bundled/main/skill-creator/references/best-practices.md +500 -0
  129. claude_mpm/skills/bundled/main/skill-creator/references/creation-workflow.md +464 -0
  130. claude_mpm/skills/bundled/main/skill-creator/references/examples.md +619 -0
  131. claude_mpm/skills/bundled/main/skill-creator/references/progressive-disclosure.md +437 -0
  132. claude_mpm/skills/bundled/main/skill-creator/references/skill-structure.md +231 -0
  133. claude_mpm/skills/bundled/main/skill-creator/scripts/init_skill.py +303 -0
  134. claude_mpm/skills/bundled/main/skill-creator/scripts/package_skill.py +113 -0
  135. claude_mpm/skills/bundled/main/skill-creator/scripts/quick_validate.py +72 -0
  136. claude_mpm/skills/bundled/nextjs-local-dev.md +807 -0
  137. claude_mpm/skills/bundled/pdf.md +141 -0
  138. claude_mpm/skills/bundled/performance-profiling.md +567 -0
  139. claude_mpm/skills/bundled/php/espocrm-development/SKILL.md +170 -0
  140. claude_mpm/skills/bundled/php/espocrm-development/references/architecture.md +602 -0
  141. claude_mpm/skills/bundled/php/espocrm-development/references/common-tasks.md +821 -0
  142. claude_mpm/skills/bundled/php/espocrm-development/references/development-workflow.md +742 -0
  143. claude_mpm/skills/bundled/php/espocrm-development/references/frontend-customization.md +726 -0
  144. claude_mpm/skills/bundled/php/espocrm-development/references/hooks-and-services.md +764 -0
  145. claude_mpm/skills/bundled/php/espocrm-development/references/testing-debugging.md +831 -0
  146. claude_mpm/skills/bundled/refactoring-patterns.md +180 -0
  147. claude_mpm/skills/bundled/rust/desktop-applications/SKILL.md +226 -0
  148. claude_mpm/skills/bundled/rust/desktop-applications/references/architecture-patterns.md +901 -0
  149. claude_mpm/skills/bundled/rust/desktop-applications/references/native-gui-frameworks.md +901 -0
  150. claude_mpm/skills/bundled/rust/desktop-applications/references/platform-integration.md +775 -0
  151. claude_mpm/skills/bundled/rust/desktop-applications/references/state-management.md +937 -0
  152. claude_mpm/skills/bundled/rust/desktop-applications/references/tauri-framework.md +770 -0
  153. claude_mpm/skills/bundled/rust/desktop-applications/references/testing-deployment.md +961 -0
  154. claude_mpm/skills/bundled/security-scanning.md +327 -0
  155. claude_mpm/skills/bundled/systematic-debugging.md +473 -0
  156. claude_mpm/skills/bundled/test-driven-development.md +378 -0
  157. claude_mpm/skills/bundled/testing/condition-based-waiting/SKILL.md +119 -0
  158. claude_mpm/skills/bundled/testing/condition-based-waiting/references/patterns-and-implementation.md +253 -0
  159. claude_mpm/skills/bundled/testing/test-driven-development/SKILL.md +145 -0
  160. claude_mpm/skills/bundled/testing/test-driven-development/references/anti-patterns.md +543 -0
  161. claude_mpm/skills/bundled/testing/test-driven-development/references/examples.md +741 -0
  162. claude_mpm/skills/bundled/testing/test-driven-development/references/integration.md +470 -0
  163. claude_mpm/skills/bundled/testing/test-driven-development/references/philosophy.md +458 -0
  164. claude_mpm/skills/bundled/testing/test-driven-development/references/workflow.md +639 -0
  165. claude_mpm/skills/bundled/testing/testing-anti-patterns/SKILL.md +140 -0
  166. claude_mpm/skills/bundled/testing/testing-anti-patterns/references/completeness-anti-patterns.md +572 -0
  167. claude_mpm/skills/bundled/testing/testing-anti-patterns/references/core-anti-patterns.md +411 -0
  168. claude_mpm/skills/bundled/testing/testing-anti-patterns/references/detection-guide.md +569 -0
  169. claude_mpm/skills/bundled/testing/testing-anti-patterns/references/tdd-connection.md +695 -0
  170. claude_mpm/skills/bundled/testing/webapp-testing/SKILL.md +184 -0
  171. claude_mpm/skills/bundled/testing/webapp-testing/decision-tree.md +459 -0
  172. claude_mpm/skills/bundled/testing/webapp-testing/examples/console_logging.py +35 -0
  173. claude_mpm/skills/bundled/testing/webapp-testing/examples/element_discovery.py +44 -0
  174. claude_mpm/skills/bundled/testing/webapp-testing/examples/static_html_automation.py +34 -0
  175. claude_mpm/skills/bundled/testing/webapp-testing/playwright-patterns.md +479 -0
  176. claude_mpm/skills/bundled/testing/webapp-testing/reconnaissance-pattern.md +687 -0
  177. claude_mpm/skills/bundled/testing/webapp-testing/scripts/with_server.py +129 -0
  178. claude_mpm/skills/bundled/testing/webapp-testing/server-management.md +758 -0
  179. claude_mpm/skills/bundled/testing/webapp-testing/troubleshooting.md +868 -0
  180. claude_mpm/skills/bundled/vite-local-dev.md +1061 -0
  181. claude_mpm/skills/bundled/web-performance-optimization.md +2305 -0
  182. claude_mpm/skills/bundled/xlsx.md +157 -0
  183. claude_mpm/skills/registry.py +97 -9
  184. claude_mpm/skills/skills_registry.py +348 -0
  185. claude_mpm/skills/skills_service.py +739 -0
  186. claude_mpm/utils/agent_dependency_loader.py +2 -2
  187. {claude_mpm-4.15.6.dist-info → claude_mpm-4.21.0.dist-info}/METADATA +211 -33
  188. {claude_mpm-4.15.6.dist-info → claude_mpm-4.21.0.dist-info}/RECORD +192 -60
  189. claude_mpm/agents/INSTRUCTIONS_OLD_DEPRECATED.md +0 -602
  190. claude_mpm/cli/commands/mpm_init.py +0 -2008
  191. {claude_mpm-4.15.6.dist-info → claude_mpm-4.21.0.dist-info}/WHEEL +0 -0
  192. {claude_mpm-4.15.6.dist-info → claude_mpm-4.21.0.dist-info}/entry_points.txt +0 -0
  193. {claude_mpm-4.15.6.dist-info → claude_mpm-4.21.0.dist-info}/licenses/LICENSE +0 -0
  194. {claude_mpm-4.15.6.dist-info → claude_mpm-4.21.0.dist-info}/top_level.txt +0 -0
@@ -0,0 +1,112 @@
1
+ ---
2
+ name: Requesting Code Review
3
+ description: Dispatch code-reviewer subagent to review implementation against plan or requirements before proceeding
4
+ when_to_use: when completing tasks, implementing major features, or before merging, to verify work meets requirements
5
+ version: 1.2.0
6
+ progressive_disclosure:
7
+ level: 1
8
+ references:
9
+ - path: references/code-reviewer-template.md
10
+ title: Code Reviewer Template
11
+ description: Complete subagent template with placeholders and review checklist
12
+ - path: references/review-examples.md
13
+ title: Review Examples & Workflows
14
+ description: Good vs bad reviews, severity guidelines, complete workflow examples
15
+ ---
16
+
17
+ # Requesting Code Review
18
+
19
+ Dispatch code-reviewer subagent to catch issues before they cascade.
20
+
21
+ **Core principle:** Review early, review often.
22
+
23
+ ## When to Request Review
24
+
25
+ **Mandatory:**
26
+ - After each task in subagent-driven development
27
+ - After completing major feature
28
+ - Before merge to main
29
+
30
+ **Optional but valuable:**
31
+ - When stuck (fresh perspective)
32
+ - Before refactoring (baseline check)
33
+ - After fixing complex bug
34
+
35
+ ## Quick Start
36
+
37
+ **1. Get git SHAs:**
38
+ ```bash
39
+ BASE_SHA=$(git rev-parse HEAD~1) # or origin/main
40
+ HEAD_SHA=$(git rev-parse HEAD)
41
+ ```
42
+
43
+ **2. Dispatch code-reviewer subagent:**
44
+
45
+ Use Task tool with code-reviewer type, fill template at [Code Reviewer Template](references/code-reviewer-template.md)
46
+
47
+ **Required placeholders:**
48
+ - `{WHAT_WAS_IMPLEMENTED}` - What you just built
49
+ - `{PLAN_OR_REQUIREMENTS}` - What it should do
50
+ - `{BASE_SHA}` - Starting commit
51
+ - `{HEAD_SHA}` - Ending commit
52
+ - `{DESCRIPTION}` - Brief summary
53
+
54
+ **3. Act on feedback:**
55
+
56
+ | Severity | Action |
57
+ |----------|--------|
58
+ | **Critical** | Fix immediately, don't proceed |
59
+ | **Important** | Fix before next major task |
60
+ | **Minor** | Note for later, can proceed |
61
+
62
+ See [severity guidelines](references/review-examples.md#severity-guidelines) for details.
63
+
64
+ ## Integration with Workflows
65
+
66
+ **Subagent-Driven Development:**
67
+ - Review after EACH task
68
+ - Catch issues before they compound
69
+ - Fix before moving to next task
70
+
71
+ **Executing Plans:**
72
+ - Review after each batch (3 tasks)
73
+ - Get feedback, apply, continue
74
+
75
+ **Ad-Hoc Development:**
76
+ - Review before merge
77
+ - Review when stuck
78
+
79
+ ## Pushing Back on Reviews
80
+
81
+ **If reviewer wrong:**
82
+ - Push back with technical reasoning
83
+ - Show code/tests that prove it works
84
+ - Reference plan requirements
85
+ - Request clarification
86
+
87
+ See [pushing back examples](references/review-examples.md#pushing-back-on-reviews)
88
+
89
+ ## Common Mistakes
90
+
91
+ **Never:**
92
+ - Skip review because "it's simple"
93
+ - Ignore Critical issues
94
+ - Proceed with unfixed Important issues
95
+ - Argue without technical justification
96
+
97
+ **Always:**
98
+ - Provide full context in review request
99
+ - Fix Critical issues immediately
100
+ - Document why you disagree (if you do)
101
+ - Re-review after fixing Critical issues
102
+
103
+ ## Examples
104
+
105
+ **Need examples?** See [Review Examples & Workflows](references/review-examples.md) for:
106
+ - Complete review output examples
107
+ - Good vs bad review requests
108
+ - Review workflows for different scenarios
109
+ - How to act on different severity levels
110
+ - When and how to push back
111
+
112
+ **Need template?** See [Code Reviewer Template](references/code-reviewer-template.md) for the complete subagent dispatch template.
@@ -0,0 +1,146 @@
1
+ # Code Review Agent
2
+
3
+ You are reviewing code changes for production readiness.
4
+
5
+ **Your task:**
6
+ 1. Review {WHAT_WAS_IMPLEMENTED}
7
+ 2. Compare against {PLAN_OR_REQUIREMENTS}
8
+ 3. Check code quality, architecture, testing
9
+ 4. Categorize issues by severity
10
+ 5. Assess production readiness
11
+
12
+ ## What Was Implemented
13
+
14
+ {DESCRIPTION}
15
+
16
+ ## Requirements/Plan
17
+
18
+ {PLAN_REFERENCE}
19
+
20
+ ## Git Range to Review
21
+
22
+ **Base:** {BASE_SHA}
23
+ **Head:** {HEAD_SHA}
24
+
25
+ ```bash
26
+ git diff --stat {BASE_SHA}..{HEAD_SHA}
27
+ git diff {BASE_SHA}..{HEAD_SHA}
28
+ ```
29
+
30
+ ## Review Checklist
31
+
32
+ **Code Quality:**
33
+ - Clean separation of concerns?
34
+ - Proper error handling?
35
+ - Type safety (if applicable)?
36
+ - DRY principle followed?
37
+ - Edge cases handled?
38
+
39
+ **Architecture:**
40
+ - Sound design decisions?
41
+ - Scalability considerations?
42
+ - Performance implications?
43
+ - Security concerns?
44
+
45
+ **Testing:**
46
+ - Tests actually test logic (not mocks)?
47
+ - Edge cases covered?
48
+ - Integration tests where needed?
49
+ - All tests passing?
50
+
51
+ **Requirements:**
52
+ - All plan requirements met?
53
+ - Implementation matches spec?
54
+ - No scope creep?
55
+ - Breaking changes documented?
56
+
57
+ **Production Readiness:**
58
+ - Migration strategy (if schema changes)?
59
+ - Backward compatibility considered?
60
+ - Documentation complete?
61
+ - No obvious bugs?
62
+
63
+ ## Output Format
64
+
65
+ ### Strengths
66
+ [What's well done? Be specific.]
67
+
68
+ ### Issues
69
+
70
+ #### Critical (Must Fix)
71
+ [Bugs, security issues, data loss risks, broken functionality]
72
+
73
+ #### Important (Should Fix)
74
+ [Architecture problems, missing features, poor error handling, test gaps]
75
+
76
+ #### Minor (Nice to Have)
77
+ [Code style, optimization opportunities, documentation improvements]
78
+
79
+ **For each issue:**
80
+ - File:line reference
81
+ - What's wrong
82
+ - Why it matters
83
+ - How to fix (if not obvious)
84
+
85
+ ### Recommendations
86
+ [Improvements for code quality, architecture, or process]
87
+
88
+ ### Assessment
89
+
90
+ **Ready to merge?** [Yes/No/With fixes]
91
+
92
+ **Reasoning:** [Technical assessment in 1-2 sentences]
93
+
94
+ ## Critical Rules
95
+
96
+ **DO:**
97
+ - Categorize by actual severity (not everything is Critical)
98
+ - Be specific (file:line, not vague)
99
+ - Explain WHY issues matter
100
+ - Acknowledge strengths
101
+ - Give clear verdict
102
+
103
+ **DON'T:**
104
+ - Say "looks good" without checking
105
+ - Mark nitpicks as Critical
106
+ - Give feedback on code you didn't review
107
+ - Be vague ("improve error handling")
108
+ - Avoid giving a clear verdict
109
+
110
+ ## Example Output
111
+
112
+ ```
113
+ ### Strengths
114
+ - Clean database schema with proper migrations (db.ts:15-42)
115
+ - Comprehensive test coverage (18 tests, all edge cases)
116
+ - Good error handling with fallbacks (summarizer.ts:85-92)
117
+
118
+ ### Issues
119
+
120
+ #### Important
121
+ 1. **Missing help text in CLI wrapper**
122
+ - File: index-conversations:1-31
123
+ - Issue: No --help flag, users won't discover --concurrency
124
+ - Fix: Add --help case with usage examples
125
+
126
+ 2. **Date validation missing**
127
+ - File: search.ts:25-27
128
+ - Issue: Invalid dates silently return no results
129
+ - Fix: Validate ISO format, throw error with example
130
+
131
+ #### Minor
132
+ 1. **Progress indicators**
133
+ - File: indexer.ts:130
134
+ - Issue: No "X of Y" counter for long operations
135
+ - Impact: Users don't know how long to wait
136
+
137
+ ### Recommendations
138
+ - Add progress reporting for user experience
139
+ - Consider config file for excluded projects (portability)
140
+
141
+ ### Assessment
142
+
143
+ **Ready to merge: With fixes**
144
+
145
+ **Reasoning:** Core implementation is solid with good architecture and tests. Important issues (help text, date validation) are easily fixed and don't affect core functionality.
146
+ ```
@@ -0,0 +1,412 @@
1
+ # Code Review Examples
2
+
3
+ ## Complete Review Example
4
+
5
+ ### Context
6
+ Task 2 completed: Added verification and repair functions for conversation index
7
+
8
+ **Git range:** `a7981ec..3df7661`
9
+
10
+ **What was implemented:** Verification and repair functions for conversation index
11
+
12
+ **Plan reference:** Task 2 from docs/plans/deployment-plan.md
13
+
14
+ ### Good Review Output
15
+
16
+ ```markdown
17
+ ### Strengths
18
+ - Clean database schema with proper migrations (db.ts:15-42)
19
+ - Comprehensive test coverage (18 tests, all edge cases)
20
+ - Good error handling with fallbacks (summarizer.ts:85-92)
21
+ - Real integration tests, not just mocks (test-integration.ts)
22
+ - Clear separation of concerns (verification vs repair logic)
23
+
24
+ ### Issues
25
+
26
+ #### Important (Should Fix)
27
+ 1. **Missing help text in CLI wrapper**
28
+ - File: index-conversations:1-31
29
+ - Issue: No --help flag, users won't discover --concurrency
30
+ - Why it matters: Poor user experience, hidden features
31
+ - Fix: Add --help case with usage examples showing all options
32
+
33
+ 2. **Date validation missing**
34
+ - File: search.ts:25-27
35
+ - Issue: Invalid dates silently return no results
36
+ - Why it matters: Silent failures confuse users
37
+ - Fix: Validate ISO format, throw error with example format
38
+
39
+ 3. **Progress indicators missing**
40
+ - File: indexer.ts:130
41
+ - Issue: No "X of Y" counter for long operations
42
+ - Why it matters: Users don't know how long to wait
43
+ - Fix: Add `console.log(\`Processing \${i+1}/\${total}\`)` in loop
44
+
45
+ #### Minor (Nice to Have)
46
+ 1. **Magic number for reporting interval**
47
+ - File: indexer.ts:145
48
+ - Issue: Hardcoded 100 for progress reporting
49
+ - Impact: Low, but config would be cleaner
50
+ - Fix: Extract to constant `PROGRESS_INTERVAL = 100`
51
+
52
+ ### Recommendations
53
+ - Add progress reporting for better user experience
54
+ - Consider config file for excluded projects (improves portability)
55
+ - Documentation looks good, but add troubleshooting section
56
+
57
+ ### Assessment
58
+
59
+ **Ready to merge: With fixes**
60
+
61
+ **Reasoning:** Core implementation is solid with good architecture and comprehensive tests. Important issues (help text, date validation, progress indicators) are easily fixed in 10-15 minutes and don't affect core functionality. Minor issues can be addressed later.
62
+ ```
63
+
64
+ ### Acting on This Review
65
+
66
+ **Fix Important issues:**
67
+ ```bash
68
+ # Fix 1: Add help text
69
+ # Edit index-conversations, add help flag
70
+
71
+ # Fix 2: Add date validation
72
+ # Edit search.ts:25-27, add format check
73
+
74
+ # Fix 3: Add progress indicators
75
+ # Edit indexer.ts:130, add counter
76
+
77
+ # Test fixes
78
+ pytest tests/ -v
79
+
80
+ # Commit
81
+ git add .
82
+ git commit -m "fix: add help text, date validation, and progress indicators"
83
+ ```
84
+
85
+ **Continue to next task** after fixes verified.
86
+
87
+ ## Good vs Bad Review Requests
88
+
89
+ ### ❌ Bad Request: Vague
90
+
91
+ ```
92
+ Can you review my code?
93
+
94
+ BASE_SHA: abc123
95
+ HEAD_SHA: def456
96
+ ```
97
+
98
+ **Problems:**
99
+ - No context on what was implemented
100
+ - No requirements to check against
101
+ - No description of changes
102
+ - Reviewer has to reverse-engineer everything
103
+
104
+ ### ✅ Good Request: Specific
105
+
106
+ ```
107
+ Review Task 3: User Authentication Implementation
108
+
109
+ WHAT_WAS_IMPLEMENTED:
110
+ - JWT-based authentication middleware
111
+ - Login/logout endpoints
112
+ - Password hashing with bcrypt
113
+ - Session management
114
+
115
+ PLAN_OR_REQUIREMENTS:
116
+ See Task 3 in docs/plans/2025-01-15-user-auth.md
117
+ Key requirements:
118
+ - Secure password storage (bcrypt)
119
+ - JWT tokens with 24hr expiration
120
+ - Logout invalidates token
121
+ - All endpoints require auth except /login
122
+
123
+ BASE_SHA: a7981ec
124
+ HEAD_SHA: 3df7661
125
+
126
+ DESCRIPTION:
127
+ Added authentication system with JWT tokens. Implemented password hashing,
128
+ login/logout endpoints, and auth middleware. All tests passing.
129
+ ```
130
+
131
+ **Why it's good:**
132
+ - Clear context on what was built
133
+ - Specific requirements to verify
134
+ - Git range for diff
135
+ - Brief summary of changes
136
+
137
+ ## Review Workflow Examples
138
+
139
+ ### Example 1: Subagent-Driven Development (After Each Task)
140
+
141
+ ```
142
+ [Task 2 completed: Email validation]
143
+
144
+ PM: Let me request code review before proceeding.
145
+
146
+ BASE_SHA=$(git log --oneline | grep "Task 1" | head -1 | awk '{print $1}')
147
+ HEAD_SHA=$(git rev-parse HEAD)
148
+
149
+ [Dispatch code-reviewer subagent]
150
+ WHAT_WAS_IMPLEMENTED: Email validation in User model
151
+ PLAN_OR_REQUIREMENTS: Task 2 from docs/plans/user-system-plan.md
152
+ BASE_SHA: abc123
153
+ HEAD_SHA: def456
154
+ DESCRIPTION: Added validate_email() utility and integrated into User model
155
+
156
+ [Subagent returns]:
157
+ Strengths: Clean validator, good tests
158
+ Issues:
159
+ Important: Missing edge case for emails with + signs
160
+ Minor: Could extract regex to constant
161
+ Assessment: Fix + sign handling, then proceed
162
+
163
+ PM: [Fix + sign edge case]
164
+ [Add test for alice+spam@example.com]
165
+ [Verify all tests pass]
166
+ [Commit fix]
167
+
168
+ PM: Ready to proceed to Task 3
169
+ ```
170
+
171
+ ### Example 2: Before Merging Major Feature
172
+
173
+ ```
174
+ [Feature branch: user-authentication complete]
175
+
176
+ PM: Let me get a final review before merging to main.
177
+
178
+ BASE_SHA=$(git merge-base origin/main HEAD)
179
+ HEAD_SHA=$(git rev-parse HEAD)
180
+
181
+ [Dispatch code-reviewer subagent]
182
+ WHAT_WAS_IMPLEMENTED: Complete user authentication system
183
+ PLAN_OR_REQUIREMENTS: docs/plans/2025-01-15-user-auth.md (all tasks)
184
+ BASE_SHA: a7981ec (merge-base with main)
185
+ HEAD_SHA: 3df7661
186
+ DESCRIPTION: Full auth system: registration, login, JWT, password hashing, session management
187
+
188
+ [Subagent returns]:
189
+ Strengths: Complete implementation, excellent test coverage, secure
190
+ Issues:
191
+ Critical: JWT secret in code, should use environment variable
192
+ Important: No rate limiting on login endpoint
193
+ Minor: Could add password strength requirements
194
+ Assessment: NOT ready to merge - fix Critical immediately
195
+
196
+ PM: [Move JWT secret to environment variable]
197
+ [Add .env.example with JWT_SECRET]
198
+ [Update config to read from env]
199
+ [Verify tests still pass]
200
+ [Commit: "fix: move JWT secret to environment variable"]
201
+
202
+ PM: Rate limiting is Important but can be separate task.
203
+ PM: Password strength can be future enhancement.
204
+
205
+ [Request review again with fix]
206
+ Issues: None
207
+ Assessment: Ready to merge
208
+
209
+ PM: [Merge to main]
210
+ ```
211
+
212
+ ### Example 3: When Stuck (Fresh Perspective)
213
+
214
+ ```
215
+ [Debugging weird test failure for 2 hours]
216
+
217
+ PM: I'm stuck. Let me get a code review for fresh eyes.
218
+
219
+ BASE_SHA=$(git rev-parse HEAD~3) # Before I started debugging
220
+ HEAD_SHA=$(git rev-parse HEAD)
221
+
222
+ [Dispatch code-reviewer subagent]
223
+ WHAT_WAS_IMPLEMENTED: Attempted fix for test_user_creation flakiness
224
+ PLAN_OR_REQUIREMENTS: Test should pass consistently
225
+ BASE_SHA: abc123
226
+ HEAD_SHA: def456
227
+ DESCRIPTION: Test fails intermittently, added logging, tried various fixes
228
+
229
+ [Subagent returns]:
230
+ Issue found: test_user_creation:15 - race condition
231
+ The test creates user and immediately queries, but database write is async
232
+ Fix: Add await or use synchronous test database
233
+
234
+ PM: Ah! That's it. The async write wasn't flushing.
235
+ [Add await db.flush() before query]
236
+ [Test passes consistently]
237
+ ```
238
+
239
+ ## Common Review Scenarios
240
+
241
+ ### Scenario: All Critical Issues
242
+
243
+ ```markdown
244
+ ### Issues
245
+
246
+ #### Critical (Must Fix)
247
+ 1. **SQL injection vulnerability**
248
+ - File: users.py:45
249
+ - Issue: Raw string interpolation in query
250
+ - Fix: Use parameterized query
251
+
252
+ 2. **Plaintext password storage**
253
+ - File: models.py:23
254
+ - Issue: Passwords stored without hashing
255
+ - Fix: Use bcrypt before saving
256
+
257
+ ### Assessment
258
+
259
+ **Ready to merge: NO**
260
+
261
+ **Reasoning:** Critical security issues must be fixed before any deployment.
262
+ ```
263
+
264
+ **Action:** Fix immediately, don't proceed.
265
+
266
+ ### Scenario: Mix of Severities
267
+
268
+ ```markdown
269
+ ### Issues
270
+
271
+ #### Important (Should Fix)
272
+ 1. **Missing error handling**
273
+ - File: api.py:67
274
+ - Issue: Network call can throw, not caught
275
+ - Fix: Wrap in try/except, return 500
276
+
277
+ #### Minor (Nice to Have)
278
+ 1. **Magic number**
279
+ - File: config.py:12
280
+ - Issue: Hardcoded timeout value
281
+ - Fix: Extract to named constant
282
+
283
+ ### Assessment
284
+
285
+ **Ready to merge: With fixes**
286
+
287
+ **Reasoning:** Error handling is important but localized fix. Magic number can be addressed later.
288
+ ```
289
+
290
+ **Action:** Fix Important, note Minor for future, proceed.
291
+
292
+ ### Scenario: Clean Implementation
293
+
294
+ ```markdown
295
+ ### Strengths
296
+ - Excellent test coverage (95%)
297
+ - Clean separation of concerns
298
+ - Good error handling throughout
299
+ - Well-documented edge cases
300
+
301
+ ### Issues
302
+
303
+ #### Minor (Nice to Have)
304
+ 1. **Could add type hints**
305
+ - File: helpers.py
306
+ - Impact: Very low, code is clear
307
+ - Fix: Add -> str type hints
308
+
309
+ ### Recommendations
310
+ - Consider adding performance tests for large datasets
311
+ - Documentation is great, maybe add architecture diagram
312
+
313
+ ### Assessment
314
+
315
+ **Ready to merge: YES**
316
+
317
+ **Reasoning:** Implementation is production-ready. Minor improvements can be separate tasks.
318
+ ```
319
+
320
+ **Action:** Merge, create tickets for nice-to-haves.
321
+
322
+ ## Severity Guidelines
323
+
324
+ ### Critical (Must Fix)
325
+ - Security vulnerabilities
326
+ - Data loss risks
327
+ - Broken core functionality
328
+ - Production crashes
329
+ - Memory leaks
330
+
331
+ **Action:** Stop everything, fix immediately, re-review.
332
+
333
+ ### Important (Should Fix)
334
+ - Missing features from requirements
335
+ - Poor error handling
336
+ - Architectural issues
337
+ - Test coverage gaps
338
+ - Performance problems
339
+
340
+ **Action:** Fix before proceeding to next major task.
341
+
342
+ ### Minor (Nice to Have)
343
+ - Code style inconsistencies
344
+ - Optimization opportunities
345
+ - Documentation improvements
346
+ - Magic numbers
347
+ - Variable naming
348
+
349
+ **Action:** Note for later, proceed if time-constrained.
350
+
351
+ ## Pushing Back on Reviews
352
+
353
+ Sometimes reviewers are wrong. Push back with **technical reasoning**:
354
+
355
+ ### Example: Reviewer Wrong About Performance
356
+
357
+ ```
358
+ Reviewer: "This loop is inefficient, use map() instead"
359
+
360
+ Your response:
361
+ "I tested both approaches with 10k items:
362
+ - Current loop: 45ms
363
+ - Map approach: 43ms (2ms faster)
364
+
365
+ The readability gain of explicit loop outweighs 2ms difference.
366
+ Performance requirement is <100ms, we're at 45ms.
367
+ Keeping current implementation."
368
+ ```
369
+
370
+ ### Example: Reviewer Misunderstood Requirements
371
+
372
+ ```
373
+ Reviewer: "Missing validation for phone numbers"
374
+
375
+ Your response:
376
+ "Plan requirement (docs/plans/user-plan.md:45):
377
+ 'Phone number is optional and will be validated in Phase 2'
378
+
379
+ Current task only requires email validation.
380
+ Phone validation is tracked in Task 7."
381
+ ```
382
+
383
+ ### Example: Reviewer Right, You Missed Something
384
+
385
+ ```
386
+ Reviewer: "No test for empty email"
387
+
388
+ Your response:
389
+ "You're right, I missed that edge case.
390
+ Adding test now:
391
+
392
+ def test_create_user_empty_email():
393
+ with pytest.raises(ValueError, match="Email required"):
394
+ create_user("alice", "")
395
+
396
+ Fixed and committed."
397
+ ```
398
+
399
+ ## Red Flags in Your Own Code
400
+
401
+ Before requesting review, self-check:
402
+
403
+ - [ ] All tests passing locally
404
+ - [ ] No commented-out code
405
+ - [ ] No debug print statements
406
+ - [ ] No hardcoded secrets or credentials
407
+ - [ ] All requirements from plan implemented
408
+ - [ ] Error handling in place
409
+ - [ ] Edge cases tested
410
+ - [ ] Commit messages clear
411
+
412
+ If any ❌, fix before requesting review.