Incorporate PR review feedback into any nmblr document. Use when a document PR has review comments that need to be addressed. Works with any document type: RFC, PRD, PD, ADR, TD, AD, PPD, TP, TC.
<skill_info> <name>nmblr:revise</name>
<summary>Incorporate PR review feedback into any nmblr document. Fetches PR review comments, presents them grouped by document section, lets the author accept/discuss/defer/dismiss each comment, applies edits, updates the changelog, and pushes to the existing PR branch. No dedicated agent -- the skill defines the workflow directly.</summary> <agent>none (self-contained workflow)</agent> <config_file>.claude/nmblr/config.yaml</config_file> </skill_info> <usage> <syntax>nmblr:revise <DOC-ID></syntax> </usage> <arguments> <argument name="doc-id" required="true"> <description>Document ID (e.g., RFC-0004, PRD-0001, PD-0003, ADR-0002, TD-0005)</description> </argument> </arguments> <prerequisites> <item>Document must have `github_pr` set in its YAML frontmatter (synced via `/nmblr:sync-github`)</item> <item>The PR must be open (not merged or closed)</item> <item>`gh` CLI must be authenticated</item> </prerequisites><execution_instructions> When this skill is invoked, follow these 8 steps:
Step 1: Read project configuration
.claude/nmblr/config.yamldocuments section for path resolutiongithub.owner and github.repo for API callsStep 2: Parse document ID
RFC-0004, PRD-0001, PD-0003, ADR-0002, TD-0005, AD-0001, PPD-0001, TP-0001, TC-0001RFC), number (e.g., 0004)<document_resolution> section)Step 3: Resolve document file path
documents paths from config.yaml to find the base directory for the document type{base_dir}/{number}-*.mdStep 4: Read document and extract github_pr
github_pr fieldgithub_pr is empty or not set, fail with: "No PR found for {DOC-ID}. Run /nmblr:sync-github {DOC-ID} first to create a PR."gh pr view {pr_number} --json state --jq '.state'
Step 5: Fetch PR review comments
gh CLI:
gh api repos/{owner}/{repo}/pulls/{pr_number}/comments --jq '.[] | {id, path, line, body, user: .user.login, created_at, in_reply_to_id}'
gh pr view {pr_number} --json reviews --jq '.reviews[] | select(.state != "APPROVED") | {author: .author.login, body: .body, state: .state}'
Step 6: Group comments by document section
line number from the comment to map to the nearest markdown section heading (## or ###)## Review Comments for {DOC-ID}
### Section: {section_name}
**Comment 1** by @{reviewer} ({type}):
> {comment_body}
Action: [Accept / Discuss / Defer / Dismiss]
**Comment 2** by @{reviewer} ({type}):
> {comment_body}
Action: [Accept / Discuss / Defer / Dismiss]
### Section: General
...
For each comment, identify the type:
Step 7: Process each comment based on author's choice
<comment_handling> section)Step 8: Finalize changes
version field in frontmatter to matchupdated field in frontmatter to today's dategit add {document_file}
git commit -m "docs: Revise {DOC-ID} -- address review feedback"
git push
gh api graphql -f query='mutation { minimizeComment(input: {subjectId: "{node_id}", classifier: RESOLVED}) { minimizedComment { isMinimized } } }'
gh api repos/{owner}/{repo}/pulls/{pr_number}/comments/{comment_id}/replies -f body="{reply_text}"
<comment_handling>
| Action | Behavior | Git/GitHub Effect |
|---|---|---|
| Accept | Edit the document section to incorporate the feedback. Ask the author what change to make, or suggest an edit based on the comment. | Document modified, thread resolved after push |
| Discuss | Compose a reply to the PR comment thread. Author provides the response text. | Reply posted to PR thread, thread left open |
| Defer | Add the feedback to the document's "Open Questions" section as a new item. | Document modified (Open Questions section), reply posted noting deferral |
| Dismiss | Author provides a brief explanation for why the feedback is not applicable. Reply to thread with explanation. | Reply posted to PR thread, thread resolved |
For each Accept action:
For each Defer action:
- [ ] {summary of feedback} (from PR review by @{reviewer})For each Discuss action:
For each Dismiss action:
<document_resolution> To resolve a document ID to a file path:
Parse the ID: Split on - to get type and number
RFC-0004 -> type=RFC, number=0004PRD-0001 -> type=PRD, number=0001Map type to config path:
| Type | Config Key | Default Path |
|---|---|---|
| RFC | documents.rfcs | docs/engineering/RFCs |
| ADR | documents.adrs | docs/architecture/ADRs |
| TD | documents.tds | docs/engineering/TDs |
| AD | documents.ads | docs/architecture/ADs |
| PRD | documents.prds | docs/product/PRDs |
| PD | documents.pds | docs/project/PDs |
| PPD | documents.ppds | docs/product/PPDs |
| TP | documents.tps | docs/engineering/TPs |
| TC | documents.tcs | docs/engineering/TCs |
Find the file: Use Glob with pattern {path}/{number}-*.md
docs/engineering/RFCs/0004-*.mdValidate: If no file matches, report error with the path searched </document_resolution>
<git_operations> Commit message format: