Skip to content

Commit 3ecf712

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

File tree

1 file changed

+40
-28
lines changed

1 file changed

+40
-28
lines changed

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

Lines changed: 40 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -25,44 +25,56 @@ jobs:
2525
github_token: ${{ secrets.GITHUB_TOKEN }}
2626
anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}
2727
prompt: |
28-
Review this PR and analyze impact on requirements and specifications documentation.
28+
You are reviewing a pull request to ensure requirements and specifications documentation stays synchronized with code changes.
2929
30-
**Your task:**
30+
**Analysis Process:**
3131
32-
1. Run git diff to see what code changed
33-
2. Identify which modules were affected (application, platform, wsi, bucket, dataset, etc.)
34-
3. Read relevant files from:
35-
- requirements/ directory (SHR-*.md and SWR-*.md files)
36-
- specifications/ directory (SPEC-*.md files)
37-
4. Analyze if existing docs need updates OR if new docs need to be created
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)
3843
39-
**IMPORTANT Rules:**
40-
- ONLY analyze files in requirements/ and specifications/ directories
41-
- SKIP template files like SPEC-MODULE-SERVICE-TEMPLATE.md
42-
- SKIP any other documentation outside these directories
43-
- If new documentation is needed, specify what file should be created following the existing naming pattern
44-
- Follow the same structure/format as existing files in those directories
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)
4549
46-
**Post a PR comment with this format:**
50+
**Output Format:**
51+
52+
Post a single PR comment using this exact structure:
4753
4854
## 📋 Requirements & Specifications Review
4955
50-
### Changed Code
51-
- List changed files
52-
- Affected modules: [list]
56+
### 🔍 Code Changes Summary
57+
**Modified files:** [list each file]
58+
**Affected modules:** [comma-separated list]
59+
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]
5365
54-
### 📝 Existing Docs to Update
55-
- `requirements/SHR-MODULE-X.md`: [1-sentence why it needs updating]
56-
- `specifications/SPEC-MODULE-SERVICE.md`: [1-sentence why it needs updating]
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]
5769
58-
### ➕ New Docs Needed
59-
- **`requirements/SWR-MODULE-X-Y.md`**: [1-sentence describing what this new requirement should cover]
60-
- **`specifications/SPEC-NEWMODULE-SERVICE.md`**: [1-sentence describing what this new spec should cover]
70+
### ✅ Documentation Still Accurate
71+
- `requirements/SHR-ZZZ.md` - Covers [feature], unaffected by changes
72+
- `specifications/SPEC-AAA.md` - Covers [component], unaffected by changes
6173
62-
### ✅ Docs Still Accurate
63-
- List requirements/specs that don't need changes
74+
### 💡 Recommendations
75+
[If applicable: suggest priority order for updates or note if changes are traceability-critical]
6476
65-
Keep it concise and actionable.
77+
**Note:** If no documentation changes are needed, state: "✅ All requirements and specifications remain accurate."
6678
claude_args: >-
6779
--max-turns 20
68-
--model claude-sonnet-4-5-20250929
80+
--model claude-sonnet-4-5-20250929

0 commit comments

Comments
 (0)