Skip to content

Commit 40ef603

Browse files
committed
chore: add Claude Code configuration
Add AI assistant configuration for consistent development: - CLAUDE.md: project overview and workflow - rules/coding.md: YAML, bash, security, and documentation standards - rules/dutch-communication.md: language preferences and commit conventions - skills/: lint, release, and validate-action commands
1 parent c13cebc commit 40ef603

7 files changed

Lines changed: 125 additions & 0 deletions

File tree

.claude/CLAUDE.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# ZAD Actions
2+
3+
GitHub Actions for deploying to ZAD (Zelfservice voor Applicatie Deployment) at Rijks ICT Gilde.
4+
5+
## Tech Stack
6+
7+
- **GitHub Actions**: Composite actions (`runs.using: composite`)
8+
- **Bash**: Scripts in action steps
9+
- **curl**: ZAD API calls
10+
- **gh CLI**: GitHub API interactions
11+
12+
## Workflow
13+
14+
1. Edit `action.yml` files
15+
2. Run `pre-commit run --all-files`
16+
3. Update README.md if inputs/outputs changed
17+
4. Update CHANGELOG.md
18+
5. Create PR with conventional commit
19+
20+
## Versioning
21+
22+
- `v1.0.0` - exact version
23+
- `v1` - major tag (users reference this)

.claude/rules/coding.md

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
# Coding Rules
2+
3+
## YAML (action.yml)
4+
5+
- 2-space indentation
6+
- Quote strings in `with:` blocks
7+
- Use `|` for multi-line bash
8+
- Always set `required: true/false` and `description` for inputs/outputs
9+
10+
## Bash
11+
12+
Validate inputs BEFORE logging (prevents injection):
13+
```bash
14+
if ! echo "$INPUT" | grep -qE '^[a-zA-Z0-9._-]+$'; then
15+
echo "Error: invalid characters"; exit 1
16+
fi
17+
echo "Processing: $INPUT"
18+
```
19+
20+
Best-effort pattern (don't fail entire action on one step):
21+
```bash
22+
if some_command; then
23+
echo "deleted=true" >> "$GITHUB_OUTPUT"
24+
else
25+
echo "::warning::Step failed but continuing"
26+
echo "deleted=false" >> "$GITHUB_OUTPUT"
27+
fi
28+
```
29+
30+
HTTP response handling:
31+
```bash
32+
RESPONSE=$(curl -s -w "\n%{http_code}" --max-time 60 "$URL")
33+
HTTP_CODE=$(echo "$RESPONSE" | tail -n1)
34+
BODY=$(echo "$RESPONSE" | sed '$d')
35+
```
36+
37+
## Security
38+
39+
- Never log secrets
40+
- Use env vars for sensitive data, not args
41+
- Always `--max-time` on curl
42+
- Quote all `"$VAR"` expansions
43+
44+
## Commits
45+
46+
Before committing, always update CHANGELOG.md under [Unreleased].
47+
48+
## Documentation
49+
50+
When changing action.yml inputs/outputs, update the README.md tables:
51+
- Inputs: Name | Required | Default | Description
52+
- Outputs: Name | Description
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# Communication
2+
3+
Respond in Dutch when user writes Dutch. Code/commits stay English.
4+
5+
## Commits
6+
7+
Conventional commits in English:
8+
```
9+
feat(cleanup): add PR comment deletion
10+
11+
Context explaining the why, not the what.
12+
```
13+
14+
Prefixes: `feat:` `fix:` `docs:` `chore:` `refactor:` `test:`
15+
16+
**Never add `Co-Authored-By: Claude` or any AI attribution to commits.**

.claude/skills/lint.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# /lint
2+
3+
Run `pre-commit run --all-files`
4+
5+
If not installed:
6+
```bash
7+
uv tool install pre-commit
8+
pre-commit install
9+
```

.claude/skills/release.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# /release <version>
2+
3+
1. Verify CHANGELOG.md has entry for version
4+
2. Extract release notes from CHANGELOG.md (section for this version)
5+
3. Create and push tags:
6+
```bash
7+
git tag -a v<version> -m "Release v<version>"
8+
git push origin v<version>
9+
git tag -fa v<major> -m "Update v<major> to v<version>"
10+
git push origin v<major> --force
11+
```
12+
4. Create release with notes from changelog:
13+
```bash
14+
gh release create v<version> --title "v<version>" --notes "<notes from changelog>"
15+
```

.claude/skills/validate-action.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# /validate-action <action>
2+
3+
Validate `deploy` or `cleanup` action.yml:
4+
5+
1. Check required fields: name, description, branding, input/output descriptions
6+
2. Verify `${{ inputs.* }}` references exist
7+
3. Verify output values reference valid step IDs
8+
4. Check README.md matches action.yml
9+
5. Report issues with line numbers

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1111
- `.editorconfig` for consistent editor formatting
1212
- `.github/dependabot.yml` for automated GitHub Actions updates
1313
- `.gitignore` for local settings and Claude plans
14+
- `.claude/` configuration for AI assistant (coding rules, skills, workflow)
1415
- **deploy** action: PR commenting feature
1516
- Automatically post/update a comment on PRs with the deployment URL
1617
- New inputs: `comment-on-pr`, `github-token`, `comment-header`

0 commit comments

Comments
 (0)