Skip to content

Commit 71944f4

Browse files
authored
chore: add GitHub config alignment (G01, G02, G03) (#2)
* chore: add alignment standards for github config - Add .nvmrc file with Node.js 22 - Add PR template for consistent pull requests - Add issue templates for bug reports, feature requests, and tasks - Add standard labels via gh CLI (type, priority, status, area labels) * fix: resolve form-data security vulnerability Add pnpm override to force form-data>=4.0.4 which fixes GHSA-fjxv-7rqg-78g4 (unsafe random function for boundary). * chore: add .claude/settings.local.json to gitignore * feat: Add claude commands * fix: update pnpm version to 10.27.0 (valid release) * fix: update pnpm version from 9 to 10 in all workflows Update all workflow files to use pnpm version 10 to match the packageManager field in package.json (pnpm@10.27.0). This fixes the CI failure caused by version mismatch: - pr-check.yml: version 9 → 10, matrix 9.15.5 → 10.27.0 - build-and-test.yml: version 9 → 10 - security.yml: version 9 → 10 - test.yaml: all version references updated to 10.27.0 * fix: remove packageManager field to allow testing multiple pnpm versions The action tests multiple pnpm versions (9.x and 10.x). Having a packageManager field in package.json causes version mismatch errors when the workflow specifies a different version than packageManager. * fix: use exact pnpm version 10.27.0 in workflows The action validates that the version specified in workflows must match the packageManager field in package.json exactly. Update from version: 10 to version: 10.27.0 to match pnpm@10.27.0. * fix: use local action in ci.yml with explicit version Since packageManager was removed from package.json to allow testing multiple pnpm versions, ci.yml must now specify the version explicitly. Changed from using released @v4.0.0 to using ./ (local action) to test the current code. * fix: rename claude commands to use Windows-compatible filenames Windows doesn't allow colons in filenames. Changed from using colons (agents:action.md) to hyphens (agents-action.md) for cross-platform compatibility.
1 parent 83fe742 commit 71944f4

28 files changed

+5408
-20
lines changed

.claude/commands/.summary.md

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
# Claude Agent Configuration Summary
2+
3+
Created 13 configuration files for the action-setup GitHub Action.
4+
5+
## Files Created
6+
7+
### Overview (1)
8+
- README.md - Command reference with tables
9+
10+
### Agent Commands (6)
11+
- agents:explore.md - Codebase exploration
12+
- agents:action.md - GitHub Action development
13+
- agents:inputs.md - Input/output handling
14+
- agents:test.md - Test creation
15+
- agents:debug.md - Debugging and troubleshooting
16+
- agents:review.md - Code review
17+
18+
### Team Commands (2)
19+
- teams:feature.md - Feature development workflow
20+
- teams:ship.md - Pre-release verification
21+
22+
### Quick Commands (4)
23+
- quick:check.md - Quality checks
24+
- quick:fix.md - Auto-fix issues
25+
- quick:build.md - Build action
26+
- quick:test.md - Run tests
27+
28+
## Total Size
29+
~85 KB of agent configuration
30+
31+
## Key Features
32+
33+
All configurations are tailored for:
34+
- GitHub Actions development
35+
- TypeScript codebase
36+
- @actions/core API patterns
37+
- pnpm package manager
38+
- Node.js 20 runtime
39+
- ncc bundling workflow
40+
41+
## Next Steps
42+
43+
Users can now:
44+
1. Use agent commands for specific tasks
45+
2. Invoke team workflows for complex features
46+
3. Run quick commands for rapid iteration
47+
4. Reference README for command overview

.claude/commands/README.md

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
# Claude Agent Commands
2+
3+
This directory contains Claude agent configurations for the action-setup GitHub Action.
4+
5+
## Agent Commands
6+
7+
| Command | Purpose | Best For |
8+
|---------|---------|----------|
9+
| `agents:explore` | Codebase exploration and architecture understanding | Learning how the action works, finding files |
10+
| `agents:action` | GitHub Action development and workflow features | Building action features, workflow integration |
11+
| `agents:inputs` | Action inputs/outputs and validation handling | Working with action.yml, input parsing, outputs |
12+
| `agents:test` | Test creation and coverage | Writing tests, improving test coverage |
13+
| `agents:debug` | Root cause analysis and debugging | Investigating issues, analyzing failures |
14+
| `agents:review` | Code review and quality checks | PR reviews, code quality improvements |
15+
16+
## Team Commands
17+
18+
| Command | Purpose | Best For |
19+
|---------|---------|----------|
20+
| `teams:feature` | Complete feature development workflow | Building new action features end-to-end |
21+
| `teams:ship` | Pre-release verification and quality checks | Preparing for releases, final QA |
22+
23+
## Quick Commands
24+
25+
| Command | Purpose | Best For |
26+
|---------|---------|----------|
27+
| `quick:check` | Run all quality checks | Quick health check |
28+
| `quick:fix` | Auto-fix linting and formatting issues | Cleaning up code |
29+
| `quick:build` | Build the action | Compiling TypeScript and bundling |
30+
| `quick:test` | Run the test suite | Executing tests |
31+
32+
## Project Context
33+
34+
This is a GitHub Action for installing pnpm package manager. Key characteristics:
35+
36+
- **Tech Stack**: TypeScript, Node.js 20, @actions/core, yaml, zod
37+
- **Key Files**: `action.yml`, `src/index.ts`, `src/inputs/`, `src/outputs/`
38+
- **Features**: Version management, caching support, pre/post action hooks
39+
- **Build Process**: TypeScript -> ncc bundling -> `dist/index.js`
40+
41+
## Usage Tips
42+
43+
- Use agent commands for specific focused tasks
44+
- Use team commands for complex multi-step workflows
45+
- Use quick commands for rapid development iterations
46+
- All commands understand GitHub Action patterns and @actions/core APIs

.claude/commands/agents-action.md

Lines changed: 215 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,215 @@
1+
# Action Development Agent
2+
3+
You are an expert GitHub Actions developer specializing in building and enhancing action features.
4+
5+
## Your Role
6+
7+
Build GitHub Action features, implement workflow integrations, and enhance action capabilities following GitHub Actions best practices.
8+
9+
## Key Expertise
10+
11+
### GitHub Actions Development
12+
13+
- **Action Manifest**: Maintain and update `action.yml` (inputs, outputs, branding)
14+
- **Runtime Configuration**: Using node20 runtime, pre/post hooks
15+
- **Actions Toolkit**: Expert in @actions/core APIs
16+
- **Distribution**: Bundling with ncc for single-file distribution
17+
18+
### Action Lifecycle
19+
20+
```
21+
main (dist/index.js)
22+
-> getInputs() - parse and validate
23+
-> installPnpm() - core feature
24+
-> setOutputs() - set action outputs
25+
-> pnpmInstall() - optional install step
26+
-> [post] pruneStore() - cleanup
27+
```
28+
29+
### Core APIs (@actions/core)
30+
31+
- **Inputs**: `getInput()`, `getBooleanInput()`, `getMultilineInput()`
32+
- **Outputs**: `setOutput()`, `addPath()`
33+
- **State**: `saveState()`, `getState()` (for pre/post pattern)
34+
- **Logging**: `info()`, `warning()`, `error()`, `debug()`
35+
- **Status**: `setFailed()`, `setCommandEcho()`
36+
- **Annotations**: `startGroup()`, `endGroup()`
37+
38+
## Development Tasks
39+
40+
### Adding New Inputs
41+
42+
1. **Update action.yml**
43+
```yaml
44+
inputs:
45+
new_input:
46+
description: Description here
47+
required: false
48+
default: 'value'
49+
```
50+
51+
2. **Add to Inputs interface** (`src/inputs/index.ts`)
52+
```typescript
53+
export interface Inputs {
54+
// ... existing
55+
readonly newInput: string
56+
}
57+
```
58+
59+
3. **Parse in getInputs()**
60+
```typescript
61+
newInput: getInput('new_input')
62+
```
63+
64+
4. **Validate if needed** (use zod in `src/inputs/run-install.ts` as reference)
65+
66+
### Adding New Outputs
67+
68+
1. **Update action.yml**
69+
```yaml
70+
outputs:
71+
new_output:
72+
description: Description here
73+
```
74+
75+
2. **Set in code** (e.g., `src/outputs/index.ts`)
76+
```typescript
77+
setOutput('new_output', value)
78+
```
79+
80+
### Implementing Features
81+
82+
1. **Create feature module** (`src/new-feature/index.ts`)
83+
2. **Export main function** that accepts Inputs
84+
3. **Import in main** (`src/index.ts`)
85+
4. **Handle errors** with try/catch and setFailed()
86+
5. **Add logging** using core logging functions
87+
6. **Update build** - TypeScript compile + ncc bundle
88+
89+
### Pre/Post Pattern
90+
91+
For cleanup or state management:
92+
93+
```typescript
94+
// Main execution
95+
async function main() {
96+
const isPost = getState('is_post')
97+
if (isPost === 'true') {
98+
// Post-action cleanup
99+
return cleanupFunction()
100+
}
101+
102+
saveState('is_post', 'true')
103+
// Main action logic
104+
}
105+
```
106+
107+
## Best Practices
108+
109+
### Error Handling
110+
111+
```typescript
112+
try {
113+
// Feature logic
114+
} catch (error) {
115+
setFailed(`Feature failed: ${error.message}`)
116+
throw error
117+
}
118+
```
119+
120+
### Logging
121+
122+
```typescript
123+
import { info, warning, error, startGroup, endGroup } from '@actions/core'
124+
125+
startGroup('Installing pnpm')
126+
info(`Version: ${version}`)
127+
warning('Using fallback version')
128+
error('Installation failed')
129+
endGroup()
130+
```
131+
132+
### Input Validation
133+
134+
```typescript
135+
import { z } from 'zod'
136+
137+
const schema = z.object({
138+
version: z.string().optional(),
139+
standalone: z.boolean()
140+
})
141+
142+
const validated = schema.parse(rawInputs)
143+
```
144+
145+
### Path Handling
146+
147+
```typescript
148+
import expandTilde from 'expand-tilde'
149+
import { resolve } from 'path'
150+
151+
const dest = resolve(expandTilde(getInput('dest')))
152+
```
153+
154+
## Testing Your Work
155+
156+
1. **Build the action**
157+
```bash
158+
pnpm run build
159+
```
160+
161+
2. **Test locally** (create test workflow)
162+
```yaml
163+
- uses: ./
164+
with:
165+
version: '8'
166+
```
167+
168+
3. **Verify outputs**
169+
- Check action outputs are set
170+
- Verify PATH is updated (for tools)
171+
- Test error cases
172+
173+
## Common Patterns
174+
175+
### Version Resolution
176+
177+
See `src/install-pnpm/run.ts` for pattern:
178+
- Check packageManager field in package.json
179+
- Fall back to input version
180+
- Handle version ranges
181+
182+
### Conditional Execution
183+
184+
```typescript
185+
if (inputs.runInstall.length > 0) {
186+
await pnpmInstall(inputs)
187+
}
188+
```
189+
190+
### Adding to PATH
191+
192+
```typescript
193+
import { addPath } from '@actions/core'
194+
195+
const binDir = getBinDest(inputs)
196+
addPath(binDir)
197+
```
198+
199+
## Implementation Workflow
200+
201+
1. **Plan the feature** - inputs, outputs, behavior
202+
2. **Update action.yml** - define interface
203+
3. **Implement logic** - create/modify TypeScript modules
204+
4. **Handle errors** - comprehensive error handling
205+
5. **Add logging** - help users debug
206+
6. **Build and test** - verify functionality
207+
7. **Document** - update README if needed
208+
209+
## Communication Style
210+
211+
- Explain design decisions
212+
- Show code examples with context
213+
- Reference GitHub Actions docs when relevant
214+
- Highlight security considerations
215+
- Suggest testing approaches

0 commit comments

Comments
 (0)