Skip to content

Commit 6e43d4e

Browse files
oozoofrogclaude
andcommitted
add Claude Code automations: hooks, skills, and subagent
- Hooks: auto build check on edit, protect test resource files - Skills: test-manglings, sync-with-swift - Subagent: file-size-checker for 500-line limit Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent f2aea50 commit 6e43d4e

4 files changed

Lines changed: 65 additions & 0 deletions

File tree

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# File Size Checker
2+
3+
Check all Swift source files in `Sources/` for the 500-line limit.
4+
5+
## Instructions
6+
7+
1. Count lines in all `.swift` files under `Sources/`
8+
2. Report any files exceeding 500 lines
9+
3. For each oversized file, suggest logical split points based on:
10+
- Protocol conformances
11+
- Extension boundaries
12+
- Logical groupings of related methods
13+
4. Focus on files that were recently modified (check `git diff --name-only`)

.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+
"command": "swift build 2>&1 | tail -20"
7+
}
8+
],
9+
"PreToolUse": [
10+
{
11+
"matcher": "Edit|Write",
12+
"command": "case \"$CLAUDE_FILE_PATH\" in */Resources/manglings*) echo 'BLOCKED: test resource file'; exit 1;; esac"
13+
}
14+
]
15+
}
16+
}
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
---
2+
name: sync-with-swift
3+
description: Guide for syncing with upstream Swift compiler demangling changes
4+
---
5+
6+
# sync-with-swift
7+
8+
This project is a pure Swift port of the Swift compiler's `swift-demangle`. When syncing with a new Swift version:
9+
10+
## Checklist
11+
12+
1. **Node.Kind**: Check for new enum cases in `Node.swift` `Kind` enum
13+
2. **Demangler**: Check for new operators in `demangleOperator()` in `Demangler.swift`
14+
3. **NodePrinter**: Add corresponding print rules in `printNode()` in `NodePrinter.swift`
15+
4. **DemangleOptions**: Check for new options in `DemangleOptions.swift`
16+
5. **Test data**: Update `Tests/SwiftDemangleTests/Resources/manglings.txt` with new test cases
17+
18+
## Reference
19+
20+
- Upstream source: https://github.com/swiftlang/swift/tree/main/lib/Demangling
21+
- Diff guide: `Diff.md` in project root tracks differences from upstream
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
---
2+
name: test-manglings
3+
description: Validate mangled symbols against expected demangled output
4+
disable-model-invocation: true
5+
---
6+
7+
# test-manglings
8+
9+
Given a mangled Swift symbol:
10+
11+
1. Check if it exists in `Tests/SwiftDemangleTests/Resources/manglings.txt`
12+
2. Run `swift test --filter testManglings` to verify demangling results
13+
3. Report pass/fail with the expected vs actual demangled output
14+
15+
If a new symbol pair is provided (mangled ---> demangled), add it to the appropriate resource file and run the test to confirm.

0 commit comments

Comments
 (0)