Code Quality Improvement
Systematic code quality improvement using Kaizen methodology with PDCA cycles and multi-perspective analysis.
For root cause analysis of bugs and incidents, use the Debugging and Root Cause Analysis workflow.
When to Use
Performance optimization of existing code
Technical debt reduction and cleanup
Process bottleneck identification
Codebase-wide quality audits
Continuous improvement initiatives
Plugins needed for this workflow
Workflow
How It Works
1. Analyze target area
Use the /kaizen:analyse command to intelligently analyze your target area for improvement opportunities. The command auto-selects the best analysis method: Gemba Walk (code exploration), Value Stream Mapping (workflow/process), or Muda Analysis (waste identification).
After LLM completes, review the analysis findings including identified waste, bottlenecks, or gaps between documentation and reality. The output provides actionable insights categorized by priority.
2. Get multi-perspective critique
Use the /reflexion:critique command to get comprehensive feedback from multiple specialized perspectives. This surfaces issues that might be missed by a single analysis approach.
After LLM completes, review the structured feedback from multiple judges covering different aspects like security, performance, maintainability, and design. Note the consensus points and any areas of disagreement.
3. Plan improvements with PDCA cycle
Use the /kaizen:plan-do-check-act command to create a structured improvement plan with measurable success criteria. This ensures changes are systematic and results can be verified.
After LLM completes, review the PDCA plan which includes:
Plan: Problem definition, baseline metrics, hypothesis, and success criteria
Do: Specific changes to implement
Check: How to measure results
Act: What to do based on outcomes
You can adjust the plan before proceeding to implementation.
4. Implement the improvements
Apply the identified improvements to your codebase. Focus on small, incremental changes that can be measured against your success criteria.
After LLM completes, the changes are applied to your local working directory. The LLM documents what was actually done, including any deviations from the original plan and unexpected observations.
5. Review local changes
Use the /code-review:review-local-changes command to verify the quality of implemented changes before committing.
After LLM completes, review the findings from multiple specialized agents (Bug Hunter, Security Auditor, Code Quality Reviewer, etc.). Address any critical or high-priority issues before proceeding. If the review identifies significant problems, iterate back to step 4.
6. Preserve learnings
Use the /reflexion:memorize command to capture valuable insights from this improvement cycle for future reference.
After LLM completes, the insights are added to your project's CLAUDE.md file. This builds a knowledge base of patterns, pitfalls, and solutions that improve future development.
7. Create conventional commit
Use the /git:commit command to create a well-formatted commit message following conventional commit standards.
After LLM completes, review the generated commit message which describes the improvement, its rationale, and measurable impact. The commit is ready to push to your repository.
Alternative Analysis Commands
Depending on your improvement goal, you may want to use specialized Kaizen commands:
For comprehensive problem documentation
Use /kaizen:analyse-problem when you need a structured A3 one-page analysis with background, root cause, countermeasures, and implementation plan.
For iterative root cause investigation
Use /kaizen:why (Five Whys) when you need to drill from symptoms to fundamental causes through iterative questioning.
For systematic cause exploration
Use /kaizen:cause-and-effect (Fishbone analysis) when exploring causes across multiple categories: People, Process, Technology, Methods, Environment, and Materials.
Tips for Effective Quality Improvement
Small iterations: Make incremental changes that can be individually verified
Document findings: Use A3 format for significant issues to maintain organizational learning
Iterate PDCA cycles: Multiple cycles are normal; each cycle builds on previous learnings
Involve the right perspective: Use
/reflexion:critiquefor important decisionsPreserve knowledge: Always memorize significant insights to improve future work
Last updated