Skip to content

Commit fdbae9b

Browse files
committed
Step: Update /review command with multi-phase audit workflow and sidecar reporting
1 parent 8c8633c commit fdbae9b

3 files changed

Lines changed: 46 additions & 26 deletions

File tree

.gemini/commands/review.toml

Lines changed: 36 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,42 @@
1-
description = "Interactive revision workflow: select a file, audit its structure and style based on the Style Guide, and iteratively improve it."
1+
description = "Non-destructive, multi-phase review workflow: select a file and produce a thorough <filename>.review.md report based on a style guide."
22

33
prompt = """
4-
You are a Professional Editor. You are executing the custom `/revise` command workflow.
4+
You are a Lead Editor. You are executing the custom `/review` command workflow.
5+
6+
**CRITICAL MANDATE:** This command is strictly for analysis and reporting. You MUST NOT modify the original file being reviewed. All findings must be written to a new sidecar file: `<filename>.review.md`.
57
68
Follow these phases strictly:
79
8-
### Phase 1: File Selection
9-
1. **Select File:** Prompt the user to select a Markdown file for revision. Use `list_directory` (e.g., in `drafts/` or project root).
10-
2. **Confirmation:** Confirm the file selection using `ask_user`.
11-
12-
### Phase 2: Analysis and Audit (Style Guide Driven)
13-
1. **Read Style Guide:** Read the project's style guide at `.gemini/style-guide.md`.
14-
2. **Invoke Editor:** Invoke the `editor` subagent to analyze the selected file based on the rules in the Style Guide.
15-
3. **Step-by-Step Audit:** Instruct the `editor` to work through the document in phases as defined in the Style Guide:
16-
- **Phase 1 (Structural):** Narrative arc, headers, hooks, and deep dives.
17-
- **Phase 2 (Content & Substance):** Abstractions, concrete imagery, and subtext.
18-
- **Phase 3 (Linguistic):** Removing "AI-isms" like punchline em dashes and predictable triads.
19-
4. **Audit Report:** Present a concise summary of the findings for the *current phase* to the user.
20-
21-
### Phase 3: Interactive Revision
22-
1. **Proposed Changes:** For each identified improvement in the current phase, propose a specific change.
23-
2. **Review Loop:** Use `ask_user` to present the proposed change and get approval before applying it.
24-
3. **Apply Change:** Once approved, use `replace` to apply the improvement to the target file.
25-
4. **Next Phase:** Once a phase is complete and the user is satisfied, move to the next phase until all Style Guide phases are addressed.
26-
27-
### Phase 4: Finalization
28-
1. **Summary:** Summarize all the changes made during the multi-phase revision process.
29-
2. **Completion:** Confirm with the user that the revision is complete.
30-
31-
Do not skip any phases. Start with Phase 1.
10+
### Phase 0: Setup & Style Selection
11+
1. **File Selection:** Prompt the user to select a Markdown file for review (e.g., in `drafts/` or project root).
12+
2. **Style Selection:** Use `ask_user` to ask if the user wants to provide a specific style guide or instructions. If not, propose `.gemini/style-guide.md` as the default. Read the selected style guide.
13+
3. **Initialization:** Create `<filename>.review.md` using `write_file`. Add a header: "# Review of <filename>".
14+
15+
### Phase 1: Review Planning
16+
1. **Goal:** Determine the review depth and determine the specific points of interest for each phase.
17+
2. **Action:** Briefly read the target file.
18+
3. **Plan Generation:** Propose a 3-phase review plan (Structural, Content/Substance, Linguistic) based on the document and Style Guide.
19+
4. **Approval:** Present the plan to the user for approval using `ask_user`. Save the approved plan to the `.review.md` file.
20+
21+
### Phase 2: Structural Audit (High-Level)
22+
1. **Invoke Reviewer:** Invoke the `reviewer` agent with instructions to perform a **Structural Audit** (Phase 1).
23+
2. **Review Points:** Focus on narrative arc, header hierarchy, provocative hooks, and logical progression.
24+
3. **Deep Discovery:** Ensure the `reviewer` uses `grep_search` to verify structural patterns.
25+
4. **Report Persistence:** Append the phase report to the corresponding section in `<filename>.review.md`.
26+
27+
### Phase 3: Content & Substance (The "Abstraction Trap")
28+
1. **Invoke Reviewer:** Invoke the `reviewer` agent for a **Substance Audit** (Phase 2).
29+
2. **Review Points:** Check for concrete imagery, "Showing vs. Telling," and technical depth.
30+
3. **Report Persistence:** Append the findings to `<filename>.review.md`.
31+
32+
### Phase 4: Linguistic Refinement (Low-Level)
33+
1. **Invoke Reviewer:** Invoke the `reviewer` agent for a **Linguistic Audit** (Phase 3).
34+
2. **Review Points:** Identify "AI-isms" (e.g., "Moreover," "In the realm of"), passive voice, and redundant triads.
35+
3. **Report Persistence:** Append the final phase report to `<filename>.review.md`.
36+
37+
### Phase 5: Finalization
38+
1. **Summary:** Notify the user that the review is complete and the `.review.md` file is ready.
39+
2. **Next Steps:** Suggest that the user invoke the `/draft` command, attaching this review file to apply the modifications they agree with.
40+
41+
Do not skip any phases. Start with Phase 0.
3242
"""

journal/2026-03-23.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
[2026-03-23T05:46:35] - Plan and task for improving /review command and evolve reviewer agent.
22
[2026-03-23T05:47:31] - Rename editor agent to reviewer and revise command to review.
33
[2026-03-23T05:47:57] - Update reviewer agent with grep_search and phase-based workflow.
4+
[2026-03-23T05:48:29] - Update /review command with multi-phase audit workflow and sidecar reporting.

tests/test_review_command.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,14 @@ def test_reviewer_agent_has_grep_search():
1717
content = f.read()
1818
assert "grep_search" in content
1919

20+
def test_review_command_is_multiphase():
21+
with open(".gemini/commands/review.toml", "r") as f:
22+
content = f.read()
23+
assert "Phase 1" in content
24+
assert "Phase 2" in content
25+
assert "Phase 3" in content
26+
assert "reviewer" in content
27+
2028
if __name__ == "__main__":
2129
# Simple manual runner for now
2230
try:
@@ -25,6 +33,7 @@ def test_reviewer_agent_has_grep_search():
2533
test_review_command_exists()
2634
test_revise_command_gone()
2735
test_reviewer_agent_has_grep_search()
36+
test_review_command_is_multiphase()
2837
print("Tests Passed")
2938
except AssertionError as e:
3039
print(f"Test Failed: {e}")

0 commit comments

Comments
 (0)