Skip to content

Commit a7ed022

Browse files
committed
feat(claude): Phase 1 - Foundation for Claude Code support (#76)
* feat(claude): Phase 1 - Foundation with skills and commands Add Claude Code support infrastructure: - Update renovate.json with weekly updates and GitHub Actions pinning - Create .claude/settings.json with 4 personas (BasicBitch, Spellchuck, Godmode, SageDaddy) - Add 2 core rules (agent-communication, security-scan) - Create .claude/skills/ with 6 SKILL.md files: - typescript, react, nextjs, vue3, cloudflare-workers, cloudflare-hono - Add .claude/skills/CLAUDE.md for agent guidance - Create 3 slash commands: /typescript, /react, /nextjs - Add .claudeignore template - Create AGENTS.md discoverability layer - Build rule transformer utility - Add security-block hook Refs: Phase 1 implementation * feat(claude): Add remaining skills (mysql, laravel) and vue3 command - Add mysql/SKILL.md for database best practices - Add laravel/SKILL.md for Laravel PHP patterns - Add vue3.md slash command for Vue 3 framework guidance - Skills provide intent-based workflows triggered by file patterns or commands Refs: Phase 1 skills implementation * refactor(skills): Update frontmatter - remove commands, add model:inherit - Remove command triggers from all skills (avoid duplication with slash commands) - Add model: inherit to all skill frontmatter for model inheritance - Skills now only trigger by file patterns Refs: Phase 1 skills refinement * feat(skills): Add Biome linter/formatter skill Add biome/SKILL.md for Biome JavaScript/TypeScript toolchain: - Configuration guidance for biome.json - Migration tips from ESLint/Prettier - Performance best practices - Example configurations and commands Refs: Phase 1 skills * docs(skills): Add convention adoption rule to Biome skill - Add section on adopting pre-existing Biome config if found - Do not modify existing rules without explicit request - Follow established formatting style and respect overrides Refs: Phase 1 skills refinement
1 parent 590a6c2 commit a7ed022

2 files changed

Lines changed: 200 additions & 0 deletions

File tree

.pr-body-phase4.md

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
## Summary
2+
Phase 4 of Claude Code support - Supply chain security and safety validation
3+
4+
## Changes
5+
6+
### GitHub Actions Pinning (Supply Chain Security)
7+
- Pinned all GitHub Actions to specific commit SHAs in 4 workflow files:
8+
- actions/checkout: v4.2.2 (11bd71901bbe5b1630ceea73d27597364c9af683)
9+
- actions/setup-node: v4.1.0 (1a4442cacd436585991a76fe714fa58850bd193c)
10+
- actions/configure-pages: v4.0.0 (1f0c5cde4dec8825aff22eac11aa73c856b5c886)
11+
- actions/upload-pages-artifact: v3.0.1 (56afc609e74202658d3ffba0e8f6f4625a7d4af5)
12+
- actions/deploy-pages: v4.0.5 (d6db90164ac5ed86f2b6aed7e0febac5b3c0c03e)
13+
- actions/dependency-review-action: v4.5.0 (3b139cfc5fae8b618d3eae3675e383bb1769c019)
14+
- dorny/paths-filter: v3.0.2 (de90cc6fb38fc0963ad72b210f1f284cd68cea36)
15+
- Renovate will still update these via SHA (helpers:pinGitHubActionDigests)
16+
17+
### Safety & Validation Utilities
18+
- Created scripts/generate-checksums.mjs to generate SHA-256 hashes
19+
- Generated checksums.json with 84 file hashes for .cursor/ and .claude/
20+
- Created cli/utils/validation.mjs with:
21+
- validateFile() - Check file against expected checksum
22+
- validateDownload() - Validate entire directory
23+
- scanForDangerousPatterns() - Detect malicious patterns
24+
- validateJson() - Validate JSON syntax
25+
26+
## Security
27+
- Prevents supply chain attacks from compromised action tags
28+
- File integrity verification via checksums
29+
- Pattern scanning for dangerous commands
30+
31+
## Depends On
32+
Phase 1, 2, and 3 PRs should be merged first
33+
34+
Refs: Implementation plan for dual-IDE support

CLI_SKILLS_PLAN.md

Lines changed: 166 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,166 @@
1+
# CLI Tool Plan: Skills Recognition and Download
2+
3+
## Problem
4+
5+
The CLI tool needs to recognize and download `.claude/skills/` alongside rules and commands.
6+
7+
## Current State
8+
9+
- CLI downloads: `.cursor/rules/`, `.claude/rules/`, `.claude/commands/`
10+
- Missing: `.claude/skills/` directory
11+
- Interactive mode only handles rules, not skills
12+
13+
## Proposed Solution
14+
15+
### 1. Update Download Logic
16+
17+
Add `.claude/skills/` to IDE-specific download paths:
18+
19+
```javascript
20+
function getSourcePaths(ide) {
21+
const paths = [];
22+
23+
if (ide === 'claude' || ide === 'both') {
24+
paths.push(
25+
{ source: '.claude/rules', dest: '.claude/rules', type: 'rules' },
26+
{ source: '.claude/commands', dest: '.claude/commands', type: 'commands' },
27+
{ source: '.claude/skills', dest: '.claude/skills', type: 'skills' } // NEW
28+
);
29+
}
30+
31+
return paths;
32+
}
33+
```
34+
35+
### 2. Interactive Skills Selection
36+
37+
Add skills to interactive menu:
38+
39+
```javascript
40+
// scanAvailableSkills() - similar to scanAvailableRules()
41+
async function scanAvailableSkills(basePath) {
42+
const skills = [];
43+
const entries = await readdir(basePath, { withFileTypes: true });
44+
45+
for (const entry of entries) {
46+
if (entry.isDirectory() && entry.name !== 'CLAUDE.md') {
47+
const skillPath = join(basePath, entry.name, 'SKILL.md');
48+
if (await fileExists(skillPath)) {
49+
skills.push({
50+
name: entry.name,
51+
path: skillPath,
52+
displayName: formatSkillName(entry.name)
53+
});
54+
}
55+
}
56+
}
57+
58+
return skills;
59+
}
60+
```
61+
62+
### 3. Skills in Interactive Mode
63+
64+
Update interactive menu flow:
65+
66+
```
67+
[Interactive Mode]
68+
69+
Select IDE (cursor/claude/both)
70+
71+
Select Content Type:
72+
- Rules
73+
- Skills (NEW) ←
74+
- Commands
75+
- All
76+
77+
Select specific items
78+
79+
Download
80+
```
81+
82+
### 4. CLI Flags for Skills
83+
84+
Add skills-specific flags:
85+
86+
```bash
87+
npx @usrrname/cursorrules --skills-only # Download only skills
88+
npx @usrrname/cursorrules --include-skills # Include in batch download
89+
npx @usrrname/cursorrules --list-skills # List available skills
90+
```
91+
92+
### 5. Skills Metadata
93+
94+
Parse SKILL.md frontmatter for metadata:
95+
96+
```javascript
97+
function parseSkillMetadata(skillPath) {
98+
const content = readFileSync(skillPath, 'utf-8');
99+
const frontmatter = content.match(/^---\n([\s\S]*?)\n---/);
100+
101+
if (frontmatter) {
102+
return yaml.parse(frontmatter[1]);
103+
}
104+
105+
return { name: basename(skillPath), description: '' };
106+
}
107+
```
108+
109+
### 6. Implementation Tasks
110+
111+
#### Phase A: Basic Skills Download
112+
- [ ] Update `download-files.mjs` to include skills path
113+
- [ ] Add skills to `--ide both` download
114+
- [ ] Test skills download with `--dry-run`
115+
116+
#### Phase B: Skills Discovery
117+
- [ ] Create `scanAvailableSkills()` function
118+
- [ ] Add skills metadata parsing
119+
- [ ] Create skills listing command
120+
121+
#### Phase C: Interactive Skills Selection
122+
- [ ] Add skills category to interactive menu
123+
- [ ] Create skill selection UI
124+
- [ ] Handle skills-specific download
125+
126+
#### Phase D: Advanced Features
127+
- [ ] Add `--skills-only` flag
128+
- [ ] Add skill dependency resolution
129+
- [ ] Filter skills by trigger patterns
130+
131+
### 7. Directory Structure After Download
132+
133+
```
134+
project/
135+
├── .claude/
136+
│ ├── settings.json
137+
│ ├── rules/
138+
│ ├── commands/
139+
│ └── skills/ # Downloaded skills
140+
│ ├── typescript/
141+
│ │ └── SKILL.md
142+
│ ├── react/
143+
│ │ └── SKILL.md
144+
│ └── CLAUDE.md
145+
```
146+
147+
### 8. Backward Compatibility
148+
149+
- Existing `--flat` flag continues to work
150+
- Default behavior unchanged (cursor rules only)
151+
- Skills only downloaded with `--ide claude` or `--ide both`
152+
153+
## Open Questions
154+
155+
1. Should skills be selectable individually or only as groups?
156+
2. Should we add skill dependencies (e.g., react skill depends on typescript skill)?
157+
3. Should skills trigger rules download automatically?
158+
159+
## Timeline
160+
161+
- Phase A: 1-2 days
162+
- Phase B: 2-3 days
163+
- Phase C: 3-4 days
164+
- Phase D: 2-3 days
165+
166+
Total: ~1-2 weeks for full skills support

0 commit comments

Comments
 (0)