Skip to content

Commit 7285dd9

Browse files
sjnimsclaude
andcommitted
chore: improve CI workflows with Node.js setup and linting tools
- Add .nvmrc for consistent Node.js version across workflows - Pre-install markdownlint-cli2 and prettier with npm caching - Enhance PR template with testing section, version checklist, chore type - Add track_progress and more allowed tools to @claude workflow - Improve review instructions with structured steps and inline comments Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent 625b65a commit 7285dd9

4 files changed

Lines changed: 107 additions & 36 deletions

File tree

.github/pull_request_template.md

Lines changed: 32 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,14 @@
44

55
## Type of Change
66

7-
<!-- Mark the relevant option with an "x" -->
7+
<!-- Labels are applied automatically by our semantic labeler. Mark the option that best describes your change: -->
88

99
- [ ] Bug fix (non-breaking change that fixes an issue)
1010
- [ ] New feature (non-breaking change that adds functionality)
1111
- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
1212
- [ ] Documentation update (improvements to README, CLAUDE.md, or component docs)
1313
- [ ] Refactoring (code change that neither fixes a bug nor adds a feature)
14+
- [ ] Chore (maintenance tasks: dependencies, CI, tooling)
1415
- [ ] Test (adding or updating tests)
1516
- [ ] Configuration change (changes to .markdownlint.json, plugin.json, etc.)
1617

@@ -31,13 +32,13 @@
3132
## Motivation and Context
3233

3334
<!-- Why is this change required? What problem does it solve? -->
34-
<!-- If it fixes an open issue, please link to the issue here using one of these formats: -->
35+
<!-- If it fixes an open issue, link to the issue using one of these formats: -->
3536
<!-- Fixes #123 - closes issue when PR merges -->
3637
<!-- Closes #123 - same as Fixes -->
3738
<!-- Resolves #123 - same as Fixes -->
3839
<!-- Related to #123 - links without closing -->
3940

40-
Fixes # (issue)
41+
Fixes #
4142

4243
## How Has This Been Tested?
4344

@@ -46,7 +47,7 @@ Fixes # (issue)
4647
**Test Configuration**:
4748

4849
- Claude Code version:
49-
- GitHub CLI version: `gh --version`
50+
- GitHub CLI version:
5051
- OS:
5152
- Testing repository: <!-- public repo you tested with, if applicable -->
5253

@@ -84,7 +85,22 @@ Fixes # (issue)
8485
- [ ] Scripts are executable (`chmod +x`)
8586
- [ ] Scripts use `${CLAUDE_PLUGIN_ROOT}` for portable paths
8687

87-
### Component-Specific Checks
88+
### Testing
89+
90+
- [ ] I have tested the plugin locally with `claude --plugin-dir plugins/plugin-dev`
91+
- [ ] I have tested the full workflow (if applicable)
92+
- [ ] I have verified GitHub CLI integration works (if applicable)
93+
- [ ] I have tested in a clean repository (not my development repo)
94+
- [ ] I have run relevant validation scripts (validate-agent.sh, validate-command.sh, validate-hook-schema.sh, etc.)
95+
96+
### Version Management (if applicable)
97+
98+
- [ ] I have updated `plugins/plugin-dev/.claude-plugin/plugin.json` (source of truth)
99+
- [ ] I have updated `.claude-plugin/marketplace.json` (metadata.version AND plugins[0].version)
100+
- [ ] I have updated `CLAUDE.md` (Quick Reference section)
101+
- [ ] I have updated CHANGELOG.md with relevant changes
102+
103+
## Component-Specific Checks
88104

89105
<!-- Only relevant if you modified commands, skills, agents, or hooks -->
90106

@@ -123,33 +139,25 @@ Fixes # (issue)
123139
<details>
124140
<summary><strong>Hooks</strong> (click to expand)</summary>
125141

126-
- [ ] Hook uses correct event type (PreToolUse, PostToolUse, Stop, SubagentStop, SessionStart, SessionEnd, UserPromptSubmit, PreCompact, Notification)
142+
- [ ] Hook uses correct event type (PreToolUse, PermissionRequest, PostToolUse, Stop, SubagentStop, SessionStart, SessionEnd, UserPromptSubmit, PreCompact, Notification)
127143
- [ ] Matchers are properly configured for tool filtering
128144
- [ ] Hook type is appropriate (prompt for LLM-driven, command for scripts)
129145
- [ ] Prompt-based hooks have clear, focused instructions
130146
- [ ] Command-based hooks handle errors gracefully
131147

132148
</details>
133149

134-
### Testing
135-
136-
- [ ] I have tested the plugin locally with `claude --plugin-dir plugins/plugin-dev`
137-
- [ ] I have tested the full workflow (if applicable)
138-
- [ ] I have verified GitHub CLI integration works (if applicable)
139-
- [ ] I have tested in a clean repository (not my development repo)
140-
- [ ] I have run relevant validation scripts (validate-agent.sh, validate-command.sh, validate-hook-schema.sh, etc.)
150+
## Example Output (if applicable)
141151

142-
### Version Management (if applicable)
152+
<!-- Add example CLI output, command results, or JSON to demonstrate your changes -->
143153

144-
- [ ] I have updated version numbers in all version files:
145-
- [ ] `plugins/plugin-dev/.claude-plugin/plugin.json` (source of truth)
146-
- [ ] `.claude-plugin/marketplace.json` (metadata.version AND plugins[0].version)
147-
- [ ] `CLAUDE.md` (Quick Reference section)
148-
- [ ] I have updated CHANGELOG.md with relevant changes
154+
```text
155+
# Example: paste relevant output here
156+
```
149157

150158
## Screenshots (if applicable)
151159

152-
<!-- Add screenshots to help explain your changes -->
160+
<!-- Before/after screenshots or GIFs showing UI changes or visual differences -->
153161

154162
## Additional Notes
155163

@@ -179,3 +187,7 @@ Fixes # (issue)
179187
- [ ] Labels are appropriate for the change type
180188
- [ ] Version numbers are updated in all version files (if applicable)
181189
- [ ] CHANGELOG.md is updated (if applicable)
190+
191+
---
192+
193+
<!-- TIP: Use draft PRs for work-in-progress changes that need early feedback -->

.github/workflows/claude-pr-review.yml

Lines changed: 55 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,22 @@ jobs:
3434
fetch-depth: 1
3535
persist-credentials: false
3636

37+
- name: Setup Node.js
38+
uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6.2.0
39+
with:
40+
node-version-file: ".nvmrc"
41+
42+
- name: Cache npm tools
43+
uses: actions/cache@8b402f58fbc84540c8b491a91e594a4576fec3d7 # v5.0.2
44+
id: claude-pr-review-npm-tools-cache
45+
with:
46+
path: ~/.npm
47+
key: ${{ runner.os }}-npm-lint-tools-v1
48+
49+
- name: Install linting tools
50+
if: steps.claude-pr-review-npm-tools-cache.outputs.cache-hit != 'true'
51+
run: npm install -g markdownlint-cli2 prettier
52+
3753
- name: Review PR with Claude
3854
uses: anthropics/claude-code-action@f64219702d7454cf29fe32a74104be6ed43dc637 # v1.0.34
3955
with:
@@ -47,12 +63,34 @@ jobs:
4763
- PR #${{ github.event.pull_request.number }}: ${{ github.event.pull_request.title }}
4864
- Author: ${{ github.event.pull_request.user.login }}
4965
- Base: ${{ github.event.pull_request.base.ref }}
66+
- Dependencies: markdownlint-cli2 and prettier are pre-installed globally
67+
68+
> **Note**: The `component-validation` workflow runs in parallel and validates plugin component
69+
> structure (frontmatter fields, JSON schema, etc.). Focus your review on content quality,
70+
> best practices, and issues beyond structural validation.
5071
5172
## Instructions
52-
1. Get the PR diff to understand what changed
53-
2. If any `.md` files were changed, run `npx markdownlint-cli2 <files>` to check for style issues
54-
3. Review the changes against the criteria below
55-
4. Post a summary comment with your findings
73+
74+
### Step 1: Run Quality Checks
75+
Run these checks and note any failures:
76+
- `markdownlint-cli2 <changed-md-files>` - Markdown style issues
77+
- `prettier --check <changed-md-files>` - Formatting issues
78+
- `shellcheck plugins/plugin-dev/skills/*/scripts/*.sh` - Shell script issues (if scripts changed)
79+
80+
### Step 2: Review the Diff
81+
Run `gh pr diff ${{ github.event.pull_request.number }}` to see all changes.
82+
83+
### Step 3: Provide Feedback
84+
85+
**For specific line-level issues**, use inline comments. Target:
86+
- Missing or invalid YAML frontmatter fields
87+
- Imperative voice violations in commands ("You should" instead of "Do")
88+
- Missing trigger phrases in skill descriptions
89+
- `<example>` block formatting issues in agents
90+
- Shell script issues (shellcheck findings)
91+
- Security concerns
92+
93+
**For general observations**, post a summary comment.
5694
5795
## Review Criteria
5896
@@ -62,25 +100,28 @@ jobs:
62100
- **Agents** (`agents/*.md`): Verify <example> blocks for triggering, appropriate tool restrictions.
63101
- **Hooks** (`hooks/hooks.json`): Validate event types and matcher patterns.
64102
65-
### Markdown Quality (run prettier and markdownlint-cli2)
66-
Run `npx prettier` and `npx markdownlint-cli2` on changed `.md` files. Key markdown rules enforced:
103+
### Shell Scripts (if changed)
104+
- Run shellcheck on any changed `.sh` files in `plugins/plugin-dev/skills/*/scripts/`
105+
- Flag any shellcheck errors or warnings
106+
107+
### Markdown Quality
108+
Key markdown rules enforced:
67109
- ATX-style headers (`#` not underlines)
68110
- Dash-style lists (`-` not `*` or `+`)
69111
- 2-space indentation for nested lists
70112
- Fenced code blocks (not indented)
71-
Include any lint errors in your review under a "Markdown Linting" section.
72113
73114
### Documentation
74115
- README.md updates if user-facing changes
75116
- CLAUDE.md updates if development process changes
76117
77118
## Output Format
78-
Post a PR comment with your review. Structure it as:
79-
1. **Summary**: One-line assessment (looks good / needs changes / has concerns)
80-
2. **What's Good**: Positive aspects of the PR
81-
3. **Suggestions**: Improvements or issues found (if any)
82-
4. **Checklist Verification**: Confirm key items are addressed
119+
1. Post inline comments for specific issues found in the diff
120+
2. Post a summary comment with:
121+
- **Verdict**: ✅ Looks good / ⚠️ Needs changes / 🔍 Has concerns
122+
- **Quality Checks**: Results from markdownlint, prettier, shellcheck (pass/fail with details)
123+
- **What's Good**: Positive aspects of the PR
124+
- **Suggestions**: General improvements (not covered by inline comments)
83125
84126
Be constructive and helpful. Focus on significant issues, not nitpicks.
85-
If the PR looks good, say so briefly - don't invent problems.
86-
claude_args: '--model claude-opus-4-5-20251101 --allowedTools "mcp__github_inline_comment__create_inline_comment,Bash(gh pr diff:*),Bash(gh pr view:*),Bash(gh pr comment:*),Bash(npx markdownlint-cli2:*),Bash(npx prettier:*),Read,Glob,Grep"'
127+
claude_args: '--model claude-opus-4-5-20251101 --allowedTools "mcp__github_inline_comment__create_inline_comment,Bash(gh pr diff:*),Bash(gh pr view:*),Bash(gh pr comment:*),Bash(markdownlint-cli2:*),Bash(prettier:*),Bash(shellcheck:*),Read,Glob,Grep"'

.github/workflows/claude.yml

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,22 +50,39 @@ jobs:
5050
contents: write # Write access for pushing branches
5151
pull-requests: write
5252
issues: write
53-
id-token: write
5453
actions: read # Required by claude-code-action to access workflow run data
54+
id-token: write
5555
steps:
5656
- name: Checkout repository
5757
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
5858
with:
5959
fetch-depth: 20
6060

61+
- name: Setup Node.js
62+
uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6.2.0
63+
with:
64+
node-version-file: ".nvmrc"
65+
66+
- name: Cache npm tools
67+
uses: actions/cache@8b402f58fbc84540c8b491a91e594a4576fec3d7 # v5.0.2
68+
id: at-claude-npm-tools-cache
69+
with:
70+
path: ~/.npm
71+
key: ${{ runner.os }}-npm-lint-tools-v1
72+
73+
- name: Install linting tools
74+
if: steps.at-claude-npm-tools-cache.outputs.cache-hit != 'true'
75+
run: npm install -g markdownlint-cli2 prettier
76+
6177
- name: Run Claude Code
6278
id: claude
6379
uses: anthropics/claude-code-action@f64219702d7454cf29fe32a74104be6ed43dc637 # v1.0.34
6480
with:
6581
claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }}
6682
use_commit_signing: true
83+
track_progress: true
6784
additional_permissions: |
6885
actions: read
6986
claude_args: |
7087
--model claude-opus-4-5-20251101
71-
--allowedTools "Read,Glob,Grep,Task,Bash(gh pr:*),Bash(gh issue:*),Bash(gh run:*),mcp__github_inline_comment__create_inline_comment,mcp__github_ci__get_ci_status,mcp__github_ci__download_job_log"
88+
--allowedTools "Read,Edit,Write,Glob,Grep,Task,Bash(gh pr:*),Bash(gh issue:*),Bash(gh run:*),Bash(gh release:*),Bash(markdownlint-cli2:*),Bash(prettier:*),Bash(shellcheck:*),mcp__github_inline_comment__create_inline_comment,mcp__github_ci__get_ci_status,mcp__github_ci__download_job_log"

.nvmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
25.3.0

0 commit comments

Comments
 (0)