Skip to content

Commit 47bce13

Browse files
philoserfclaude
andcommitted
feat: add Claude Code automations for project
Add project-level hook and skills: - Auto-test hook: runs matching .test.ts when source files are edited - /release skill: orchestrates version bump through tag creation - /deploy-test skill: build + test + deploy to notes vault Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 32728a4 commit 47bce13

File tree

3 files changed

+51
-0
lines changed

3 files changed

+51
-0
lines changed

.claude/settings.json

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"hooks": {
3+
"PostToolUse": [
4+
{
5+
"matcher": "Edit|Write",
6+
"hooks": [
7+
{
8+
"type": "command",
9+
"command": "f=$(echo \"$CLAUDE_TOOL_INPUT\" | grep -o '\"file_path\":\"[^\"]*\"' | head -1 | sed 's/\"file_path\":\"//;s/\"//'); if echo \"$f\" | grep -q 'src/.*\\.ts$' && ! echo \"$f\" | grep -q '\\.test\\.ts$'; then t=\"${f%.ts}.test.ts\"; [ -f \"$t\" ] && bun test \"$t\" 2>&1 | tail -5; fi",
10+
"timeout": 15
11+
}
12+
]
13+
}
14+
]
15+
}
16+
}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# Deploy Test
2+
3+
Build and deploy the plugin to the test vault.
4+
5+
## Steps
6+
7+
1. Run `bun run build` (includes typecheck + lint)
8+
2. Run `bun test`
9+
3. Run `bun run deploy` to copy to notes vault
10+
4. Remind user to reload Obsidian (Cmd+R)
11+
12+
## Rules
13+
14+
- Abort if build or tests fail
15+
- Report any new lint warnings

.claude/skills/release/SKILL.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Release
2+
3+
Orchestrate the Metadator release process.
4+
5+
## Steps
6+
7+
1. Ask for the new version (or accept as argument)
8+
2. Update version in package.json
9+
3. Run `bun run version` to sync manifest.json and versions.json
10+
4. Run `bun run validate` to confirm everything passes
11+
5. Run `bun test` to confirm tests pass
12+
6. Stage and commit: `chore: bump version to X.Y.Z`
13+
7. Create git tag: `X.Y.Z`
14+
8. **Stop and confirm** before pushing — remind user that push triggers GitHub Actions release
15+
16+
## Rules
17+
18+
- Never push without explicit approval
19+
- Abort if validate or tests fail
20+
- Use semantic versioning

0 commit comments

Comments
 (0)