Skip to content

Commit c6c039d

Browse files
refine claude-code-doc-review 2.
1 parent 3ecf712 commit c6c039d

File tree

1 file changed

+33
-42
lines changed

1 file changed

+33
-42
lines changed

.github/workflows/claude-code-doc-review.yml

Lines changed: 33 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ permissions:
1010

1111
jobs:
1212
documentation-review:
13-
name: Review doc changes
13+
name: Review requirements impact
1414
runs-on: ubuntu-latest
1515

1616
steps:
@@ -25,56 +25,47 @@ jobs:
2525
github_token: ${{ secrets.GITHUB_TOKEN }}
2626
anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}
2727
prompt: |
28-
You are reviewing a pull request to ensure requirements and specifications documentation stays synchronized with code changes.
28+
**IMPORTANT: Your ONLY job is to analyze documentation impact in requirements/ and specifications/ directories. Do NOT review code quality, do NOT comment on implementation details.**
2929
30-
**Analysis Process:**
30+
**Task:**
31+
1. Run: git diff origin/${{ github.base_ref }}...HEAD
32+
2. Identify which modules changed (e.g., application, wsi, platform)
33+
3. Use Glob to find docs for those modules:
34+
- requirements/SHR-{MODULE}*.md
35+
- requirements/SWR-{MODULE}*.md
36+
- specifications/SPEC-{MODULE}*.md
37+
4. Read those docs and check if they describe the changed functionality
38+
5. Report ONLY documentation changes needed
3139
32-
1. Run `git diff origin/${{ github.base_ref }}...HEAD` to identify all changed files
33-
2. For each changed file, determine:
34-
- Which module/component it belongs to
35-
- What functionality was added, modified, or removed
36-
3. Read ALL existing files in:
37-
- `requirements/` (SHR-*.md for stakeholder requirements, SWR-*.md for software requirements)
38-
- `specifications/` (SPEC-*.md for software item specifications)
39-
4. Cross-reference code changes against documentation to identify:
40-
- Docs that describe changed functionality (needs update)
41-
- New functionality lacking documentation (needs new doc)
42-
- Documentation that remains accurate (no action needed)
40+
**RULES:**
41+
- DO NOT comment on code quality or bugs
42+
- DO NOT review implementation
43+
- ONLY report which .md files in requirements/ or specifications/ need updates
44+
- Skip files with "TEMPLATE" in name
45+
- If new docs are needed, specify the filename following existing naming patterns
4346
44-
**Requirements:**
45-
- Analyze ONLY `requirements/` and `specifications/` directories
46-
- Ignore template files (files with "TEMPLATE" in the name)
47-
- For new docs, follow existing naming conventions exactly
48-
- Be specific about WHY each doc needs updating (cite the code change)
47+
**Post this exact format:**
4948
50-
**Output Format:**
49+
## 📋 Requirements & Specifications Impact
5150
52-
Post a single PR comment using this exact structure:
51+
**Changed modules:** [comma-separated list]
5352
54-
## 📋 Requirements & Specifications Review
53+
### 📝 Existing Docs to Update
54+
- **requirements/SHR-APPLICATION-X.md**: [1 sentence why - cite specific code change]
55+
- **specifications/SPEC-PLATFORM-SERVICE.md**: [1 sentence why - cite specific code change]
5556
56-
### 🔍 Code Changes Summary
57-
**Modified files:** [list each file]
58-
**Affected modules:** [comma-separated list]
57+
### ➕ New Docs Needed
58+
- **requirements/SWR-MODULE-X-Y.md**: [what requirement this should document]
59+
- **specifications/SPEC-NEWMODULE-SERVICE.md**: [what spec this should cover]
5960
60-
### 📝 Documentation Updates Required
61-
62-
#### Files Needing Updates:
63-
- **`requirements/SHR-XXX.md`** - Reason: [specific code change that invalidates current doc]
64-
- **`specifications/SPEC-YYY.md`** - Reason: [specific code change that invalidates current doc]
61+
### ✅ Docs Already Accurate
62+
- requirements/SHR-BUCKET-1.md: Covers existing functionality, unchanged
63+
- specifications/SPEC-DATASET-SERVICE.md: Still accurate
6564
66-
#### New Documentation Needed:
67-
- **`requirements/SWR-[MODULE]-[FEATURE].md`** - Coverage: [what new requirement this addresses]
68-
- **`specifications/SPEC-[MODULE]-[SERVICE].md`** - Coverage: [what new implementation this describes]
65+
**If no doc changes needed, just say: "✅ All requirements and specifications are up to date."**
6966
70-
### ✅ Documentation Still Accurate
71-
- `requirements/SHR-ZZZ.md` - Covers [feature], unaffected by changes
72-
- `specifications/SPEC-AAA.md` - Covers [component], unaffected by changes
73-
74-
### 💡 Recommendations
75-
[If applicable: suggest priority order for updates or note if changes are traceability-critical]
76-
77-
**Note:** If no documentation changes are needed, state: "✅ All requirements and specifications remain accurate."
67+
Keep it SHORT - only list impacted documentation files.
7868
claude_args: >-
79-
--max-turns 20
69+
--max-turns 30
70+
--allowed-tools Read,Glob,Grep,Bash(git:*)
8071
--model claude-sonnet-4-5-20250929

0 commit comments

Comments
 (0)