Mission 02 Mission 02 Code Review Lab Guide
📥 Lab input
- •
day6_meeting_notes.md(meeting notes)
💾 Lab output
- •
day6_code_review.md
1. Story and lab background
Ask Codex, acting as a professional Code Reviewer, to fully audit the final source code you wrote somewhat hastily while building the dashboard booking control logic, then fully apply its recommendations and submit a high-quality refactored version.
2. Learning goals
- Get your finished code strictly diagnosed against objective AI measures (readability, duplication, encapsulation, etc.).
- Understand concerns about global namespace pollution and computational complexity.
- Update the source code into an encapsulated module based on feedback, and build review notes.
🛠️ Follow-along lab guide
- Create the lab file: press the download button below and save
day6_meeting_notes.mdin theautomation/folder. - Ask for a multi-angle code review: send the source code to Codex Client and ask for a review of variable name readability, duplicate logic and global pollution prevention.
- Save the encapsulated source: write and keep a code review feedback report (`day6_code_review.md`) with the final modular version improved from AI's notes.
Download lab materials
Codex request prompt
Mission 02 Prompt
Review the provided dashboard state control code from many angles against Code Quality measures, looking for exposed global variables and messy branching, and return a final refactoring summary (Code Review).
4. Example output
Codex analyzes the meeting notes and outputs a normalized data entity mapping and Mermaid ERD script like below.
| File | Item | Issue found | Fix |
|---|---|---|---|
| day6_code_review.md | Code usability and quality audit | Overuse of global variables and messy nested ternary branches | Encapsulate in an IIFE and turn states into a map object |
5. AI use points
- Variable scope audit: identifies careless global variable references in the code and looks for ways to improve memory safety and block conflicts.
- Alternative module design: suggests simplifying render code full of complex ternary operators into a mapping matrix.