Skip to content

Commit 62db2ef

Browse files
amondnetclaude
andauthored
Add Claude Code configuration files (#272)
- Add CLAUDE.md with project overview, commands, and architecture details - Add custom Claude commands for common workflows (commit-and-pr, fix-issue) - Provides guidance for future Claude Code instances working with this repository 🤖 Generated with [Claude Code](https://claude.ai/code) Co-authored-by: Claude <noreply@anthropic.com>
1 parent 16e87c0 commit 62db2ef

3 files changed

Lines changed: 81 additions & 0 deletions

File tree

.claude/commands/commit-and-pr.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Let's commit the changes. Run tests, typechecks, and format checks. Then commit, push, and create a pull request.

.claude/commands/fix-issue.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
Find and fix issue #$ARGUMENTS.
2+
Follow these steps:
3+
4+
1. Understand the issue described in the ticket
5+
2. Locate the relevant code in our codebase
6+
3. Implement a solution that addresses the root cause
7+
4. Add appropriate tests
8+
5. Prepare a concise PR description

CLAUDE.md

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
# CLAUDE.md
2+
3+
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
4+
5+
## Project Overview
6+
7+
This is a GitHub Action that deploys projects to Vercel. It's an npm package that integrates with GitHub workflows to automate deployments, providing more control than Vercel's native GitHub integration.
8+
9+
## Essential Commands
10+
11+
### Development
12+
```bash
13+
npm install # Install dependencies
14+
npm start # Run the action locally (node ./index.js)
15+
npm run lint # Run ESLint on index.js
16+
npm run format # Format code with Prettier
17+
npm run format-check # Check code formatting
18+
npm test # Run Jest tests
19+
npm run all # Run format, lint, package, and test in sequence
20+
```
21+
22+
### Building for Distribution
23+
```bash
24+
npm run package # Build the action with ncc (outputs to dist/)
25+
```
26+
27+
**Important**: The `dist/` folder must be committed when creating releases. This contains the bundled action code that GitHub Actions will execute.
28+
29+
## Architecture
30+
31+
### Core Components
32+
33+
1. **index.js**: Main entry point that:
34+
- Reads GitHub Action inputs (vercel-token, github-token, etc.)
35+
- Executes Vercel CLI commands for deployment
36+
- Comments on PRs/commits with deployment URLs
37+
- Handles alias domain assignment
38+
- Manages environment variables for Vercel org/project
39+
40+
2. **action.yml**: Defines the GitHub Action interface:
41+
- Input parameters configuration
42+
- Output values (preview-url, preview-name)
43+
- Runtime environment (Node.js 20)
44+
45+
### Key Dependencies
46+
- `@actions/core`: GitHub Actions toolkit for inputs/outputs
47+
- `@actions/exec`: Execute shell commands
48+
- `@actions/github`: GitHub API interactions
49+
- `vercel`: CLI for deployments
50+
- `axios`: HTTP requests for alias management
51+
52+
### Deployment Flow
53+
1. Action reads configuration from inputs and environment
54+
2. Sets up Vercel org/project IDs from `.vercel/` directory
55+
3. Executes `vercel` command with appropriate flags
56+
4. Parses deployment URL from output
57+
5. Optionally assigns alias domains
58+
6. Comments on GitHub PR/commit with deployment info
59+
60+
## Testing Approach
61+
62+
- Jest is configured but tests are minimal (index.test.js is empty)
63+
- Manual testing through example projects in `example/` directory
64+
- GitHub Actions workflows test different scenarios
65+
66+
## Important Conventions
67+
68+
1. **Vercel Configuration**: Projects must have `github.enabled: false` in vercel.json
69+
2. **Project Linking**: The `.vercel/` directory with org/project IDs must be committed
70+
3. **Build Process**: Builds should happen in GitHub Actions, not Vercel
71+
4. **Backward Compatibility**: Maintain support for deprecated "zeit-" prefixed inputs
72+
5. **Error Handling**: Use proper exit codes and clear error messages for CI/CD integration

0 commit comments

Comments
 (0)