@plaited/development-skills 0.5.0 → 0.6.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/{.claude → .plaited}/rules/accuracy.md +3 -10
- package/{.claude → .plaited}/rules/code-review.md +3 -10
- package/.plaited/rules/documentation.md +41 -0
- package/.plaited/rules/git-workflow.md +31 -0
- package/{.claude → .plaited}/rules/github.md +4 -4
- package/{.claude → .plaited}/rules/module-organization.md +0 -7
- package/{.claude → .plaited}/rules/testing.md +0 -5
- package/package.json +2 -2
- package/src/lsp-analyze.ts +1 -1
- package/src/lsp-find.ts +1 -1
- package/src/lsp-hover.ts +1 -1
- package/src/lsp-references.ts +1 -1
- package/src/lsp-symbols.ts +1 -1
- package/src/scaffold-rules.ts +146 -205
- package/src/tests/scaffold-rules.spec.ts +239 -110
- package/.claude/commands/lsp-analyze.md +0 -66
- package/.claude/commands/lsp-find.md +0 -74
- package/.claude/commands/lsp-hover.md +0 -57
- package/.claude/commands/lsp-refs.md +0 -64
- package/.claude/commands/scaffold-rules.md +0 -221
- package/.claude/commands/validate-skill.md +0 -29
- package/.claude/rules/git-workflow.md +0 -66
- package/.claude/skills/code-documentation/SKILL.md +0 -47
- package/.claude/skills/code-documentation/references/internal-templates.md +0 -113
- package/.claude/skills/code-documentation/references/maintenance.md +0 -164
- package/.claude/skills/code-documentation/references/public-api-templates.md +0 -100
- package/.claude/skills/code-documentation/references/type-documentation.md +0 -116
- package/.claude/skills/code-documentation/references/workflow.md +0 -60
- package/.claude/skills/scaffold-rules/SKILL.md +0 -104
- package/.claude/skills/typescript-lsp/SKILL.md +0 -249
- package/.claude/skills/validate-skill/SKILL.md +0 -105
- /package/{.claude → .plaited}/rules/bun-apis.md +0 -0
|
@@ -1,249 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: typescript-lsp
|
|
3
|
-
description: Search TypeScript SYMBOLS (functions, types, classes) - NOT text. Use Glob to find files, Grep for text search, LSP for symbol search. Provides type-aware results that understand imports, exports, and relationships.
|
|
4
|
-
license: ISC
|
|
5
|
-
compatibility: Requires bun
|
|
6
|
-
allowed-tools: Bash
|
|
7
|
-
metadata:
|
|
8
|
-
file-triggers: "*.ts,*.tsx,*.js,*.jsx"
|
|
9
|
-
---
|
|
10
|
-
|
|
11
|
-
# TypeScript LSP Skill
|
|
12
|
-
|
|
13
|
-
## Purpose
|
|
14
|
-
|
|
15
|
-
This skill provides TypeScript Language Server Protocol integration for **exploring and understanding** TypeScript/JavaScript codebases.
|
|
16
|
-
|
|
17
|
-
**IMPORTANT**: Prefer LSP tools over Grep/Glob when working with `*.ts`, `*.tsx`, `*.js`, `*.jsx` files. LSP provides type-aware results that understand imports, exports, and symbol relationships.
|
|
18
|
-
|
|
19
|
-
Use these tools to:
|
|
20
|
-
- **Explore codebases** - Find symbols, understand module structure, discover implementations
|
|
21
|
-
- **Find references** - Type-aware search across the entire codebase (better than grep for symbols)
|
|
22
|
-
- **Understand types** - Get full type signatures, generics, and documentation
|
|
23
|
-
- **Verify before editing** - Check all usages before modifying or deleting exports
|
|
24
|
-
- **Navigate code** - Jump to definitions, find implementations
|
|
25
|
-
|
|
26
|
-
## When to Use Each Tool
|
|
27
|
-
|
|
28
|
-
| Tool | Purpose |
|
|
29
|
-
|------|---------|
|
|
30
|
-
| **Glob** | Find files by pattern |
|
|
31
|
-
| **Grep** | Search text content |
|
|
32
|
-
| **lsp-find** | Search TypeScript symbols |
|
|
33
|
-
| **lsp-hover** | Get type info + TSDoc documentation |
|
|
34
|
-
| **lsp-refs** | Find all references to a symbol |
|
|
35
|
-
| **lsp-analyze** | Batch analysis of file structure |
|
|
36
|
-
|
|
37
|
-
### LSP vs Grep/Glob
|
|
38
|
-
|
|
39
|
-
| Task | Use LSP | Use Grep/Glob |
|
|
40
|
-
|------|---------|---------------|
|
|
41
|
-
| Find all usages of a function/type | ✅ `lsp-refs` | ❌ Misses re-exports, aliases |
|
|
42
|
-
| Search for a symbol by name | ✅ `lsp-find` | ❌ Matches strings, comments |
|
|
43
|
-
| Get type signature + TSDoc | ✅ `lsp-hover` | ❌ Not possible |
|
|
44
|
-
| Understand file exports | ✅ `lsp-analyze --exports` | ❌ Doesn't resolve re-exports |
|
|
45
|
-
| Find files by pattern | ❌ | ✅ `Glob` |
|
|
46
|
-
| Search non-TS files (md, json) | ❌ | ✅ `Grep` |
|
|
47
|
-
| Search for text in comments/strings | ❌ | ✅ `Grep` |
|
|
48
|
-
|
|
49
|
-
## When to Use
|
|
50
|
-
|
|
51
|
-
**Exploring code (prefer LSP):**
|
|
52
|
-
- Run `lsp-find` to search for symbols across the workspace
|
|
53
|
-
- Run `lsp-symbols` to get an overview of file structure
|
|
54
|
-
- Run `lsp-analyze --exports` to see what a module provides
|
|
55
|
-
|
|
56
|
-
**Before editing code:**
|
|
57
|
-
- Run `lsp-references` to find all usages of a symbol you plan to modify
|
|
58
|
-
- Run `lsp-hover` to verify current type signatures
|
|
59
|
-
|
|
60
|
-
**Before writing code:**
|
|
61
|
-
- Run `lsp-find` to search for similar patterns or related symbols
|
|
62
|
-
- Run `lsp-hover` on APIs you plan to use
|
|
63
|
-
|
|
64
|
-
## Path Resolution
|
|
65
|
-
|
|
66
|
-
All scripts accept three types of file paths:
|
|
67
|
-
- **Absolute paths**: `/Users/name/project/src/file.ts`
|
|
68
|
-
- **Relative paths**: `./src/file.ts` or `../other/file.ts`
|
|
69
|
-
- **Package export paths**: `my-package/src/module.ts` (resolved via `Bun.resolve()`)
|
|
70
|
-
|
|
71
|
-
Package export paths are recommended for portability and consistency with the package's exports field.
|
|
72
|
-
|
|
73
|
-
## Scripts
|
|
74
|
-
|
|
75
|
-
### Individual Scripts
|
|
76
|
-
|
|
77
|
-
#### lsp-hover
|
|
78
|
-
Get type information at a specific position.
|
|
79
|
-
|
|
80
|
-
```bash
|
|
81
|
-
bunx @plaited/development-skills lsp-hover <file> <line> <char>
|
|
82
|
-
```
|
|
83
|
-
|
|
84
|
-
**Arguments:**
|
|
85
|
-
- `file`: Path to TypeScript/JavaScript file
|
|
86
|
-
- `line`: Line number (0-indexed)
|
|
87
|
-
- `char`: Character position (0-indexed)
|
|
88
|
-
|
|
89
|
-
**Example:**
|
|
90
|
-
```bash
|
|
91
|
-
bunx @plaited/development-skills lsp-hover src/utils/parser.ts 42 10
|
|
92
|
-
```
|
|
93
|
-
|
|
94
|
-
#### lsp-symbols
|
|
95
|
-
List all symbols in a file.
|
|
96
|
-
|
|
97
|
-
```bash
|
|
98
|
-
bunx @plaited/development-skills lsp-symbols <file>
|
|
99
|
-
```
|
|
100
|
-
|
|
101
|
-
**Example:**
|
|
102
|
-
```bash
|
|
103
|
-
bunx @plaited/development-skills lsp-symbols src/utils/parser.ts
|
|
104
|
-
```
|
|
105
|
-
|
|
106
|
-
#### lsp-references
|
|
107
|
-
Find all references to a symbol.
|
|
108
|
-
|
|
109
|
-
```bash
|
|
110
|
-
bunx @plaited/development-skills lsp-refs <file> <line> <char>
|
|
111
|
-
```
|
|
112
|
-
|
|
113
|
-
**Example:**
|
|
114
|
-
```bash
|
|
115
|
-
bunx @plaited/development-skills lsp-refs src/utils/parser.ts 42 10
|
|
116
|
-
```
|
|
117
|
-
|
|
118
|
-
#### lsp-find
|
|
119
|
-
Search for symbols across the workspace.
|
|
120
|
-
|
|
121
|
-
```bash
|
|
122
|
-
bunx @plaited/development-skills lsp-find <query> [context-file]
|
|
123
|
-
```
|
|
124
|
-
|
|
125
|
-
**Arguments:**
|
|
126
|
-
- `query`: Symbol name or partial name
|
|
127
|
-
- `context-file`: Optional file to open for project context
|
|
128
|
-
|
|
129
|
-
**Example:**
|
|
130
|
-
```bash
|
|
131
|
-
bunx @plaited/development-skills lsp-find parseConfig
|
|
132
|
-
bunx @plaited/development-skills lsp-find validateInput src/lib/validator.ts
|
|
133
|
-
```
|
|
134
|
-
|
|
135
|
-
### Batch Script
|
|
136
|
-
|
|
137
|
-
#### lsp-analyze
|
|
138
|
-
Perform multiple analyses in a single session for efficiency.
|
|
139
|
-
|
|
140
|
-
```bash
|
|
141
|
-
bunx @plaited/development-skills lsp-analyze <file> [options]
|
|
142
|
-
```
|
|
143
|
-
|
|
144
|
-
**Options:**
|
|
145
|
-
- `--symbols, -s`: List all symbols
|
|
146
|
-
- `--exports, -e`: List only exported symbols
|
|
147
|
-
- `--hover <line:char>`: Get type info (repeatable)
|
|
148
|
-
- `--refs <line:char>`: Find references (repeatable)
|
|
149
|
-
- `--all`: Run symbols + exports analysis
|
|
150
|
-
|
|
151
|
-
**Examples:**
|
|
152
|
-
```bash
|
|
153
|
-
# Get file overview
|
|
154
|
-
bunx @plaited/development-skills lsp-analyze src/utils/parser.ts --all
|
|
155
|
-
|
|
156
|
-
# Check multiple positions
|
|
157
|
-
bunx @plaited/development-skills lsp-analyze src/utils/parser.ts --hover 50:10 --hover 75:5
|
|
158
|
-
|
|
159
|
-
# Before refactoring: find all references
|
|
160
|
-
bunx @plaited/development-skills lsp-analyze src/utils/parser.ts --refs 42:10
|
|
161
|
-
```
|
|
162
|
-
|
|
163
|
-
## Common Workflows
|
|
164
|
-
|
|
165
|
-
### Understanding a File
|
|
166
|
-
|
|
167
|
-
```bash
|
|
168
|
-
# 1. Get exports overview
|
|
169
|
-
bunx @plaited/development-skills lsp-analyze path/to/file.ts --exports
|
|
170
|
-
|
|
171
|
-
# 2. For specific type info, hover on interesting symbols
|
|
172
|
-
bunx @plaited/development-skills lsp-hover path/to/file.ts <line> <char>
|
|
173
|
-
```
|
|
174
|
-
|
|
175
|
-
### Before Modifying an Export
|
|
176
|
-
|
|
177
|
-
```bash
|
|
178
|
-
# 1. Find all references first
|
|
179
|
-
bunx @plaited/development-skills lsp-refs path/to/file.ts <line> <char>
|
|
180
|
-
|
|
181
|
-
# 2. Check what depends on it
|
|
182
|
-
# Review the output to understand impact
|
|
183
|
-
```
|
|
184
|
-
|
|
185
|
-
### Finding Patterns
|
|
186
|
-
|
|
187
|
-
```bash
|
|
188
|
-
# Search for similar implementations
|
|
189
|
-
bunx @plaited/development-skills lsp-find handleRequest
|
|
190
|
-
bunx @plaited/development-skills lsp-find parseConfig
|
|
191
|
-
```
|
|
192
|
-
|
|
193
|
-
### Pre-Implementation Verification
|
|
194
|
-
|
|
195
|
-
```bash
|
|
196
|
-
# Before writing code that uses an API, verify its signature
|
|
197
|
-
bunx @plaited/development-skills lsp-hover path/to/api.ts <line> <char>
|
|
198
|
-
```
|
|
199
|
-
|
|
200
|
-
## Output Format
|
|
201
|
-
|
|
202
|
-
All scripts output JSON to stdout. Errors go to stderr.
|
|
203
|
-
|
|
204
|
-
**Hover output:**
|
|
205
|
-
```json
|
|
206
|
-
{
|
|
207
|
-
"contents": {
|
|
208
|
-
"kind": "markdown",
|
|
209
|
-
"value": "```typescript\nconst parseConfig: (options: Options) => Config\n```"
|
|
210
|
-
},
|
|
211
|
-
"range": { "start": {...}, "end": {...} }
|
|
212
|
-
}
|
|
213
|
-
```
|
|
214
|
-
|
|
215
|
-
**Symbols output:**
|
|
216
|
-
```json
|
|
217
|
-
[
|
|
218
|
-
{
|
|
219
|
-
"name": "symbolName",
|
|
220
|
-
"kind": 13,
|
|
221
|
-
"range": { "start": {...}, "end": {...} }
|
|
222
|
-
}
|
|
223
|
-
]
|
|
224
|
-
```
|
|
225
|
-
|
|
226
|
-
**Analyze output:**
|
|
227
|
-
```json
|
|
228
|
-
{
|
|
229
|
-
"file": "path/to/file.ts",
|
|
230
|
-
"exports": [
|
|
231
|
-
{ "name": "exportName", "kind": "Constant", "line": 139 }
|
|
232
|
-
]
|
|
233
|
-
}
|
|
234
|
-
```
|
|
235
|
-
|
|
236
|
-
## Performance
|
|
237
|
-
|
|
238
|
-
Each script invocation:
|
|
239
|
-
1. Starts TypeScript Language Server (~300-500ms)
|
|
240
|
-
2. Initializes LSP connection
|
|
241
|
-
3. Opens document
|
|
242
|
-
4. Performs query
|
|
243
|
-
5. Closes and stops
|
|
244
|
-
|
|
245
|
-
For multiple queries on the same file, use `lsp-analyze` to batch operations in a single session.
|
|
246
|
-
|
|
247
|
-
## Related Skills
|
|
248
|
-
|
|
249
|
-
- **code-documentation**: TSDoc standards for documentation
|
|
@@ -1,105 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: validate-skill
|
|
3
|
-
description: Validate skill directories against AgentSkills spec
|
|
4
|
-
license: ISC
|
|
5
|
-
compatibility: Requires bun
|
|
6
|
-
allowed-tools: Bash
|
|
7
|
-
---
|
|
8
|
-
|
|
9
|
-
# Validate Skill
|
|
10
|
-
|
|
11
|
-
## Purpose
|
|
12
|
-
|
|
13
|
-
This skill validates skill directories against the [AgentSkills specification](https://agentskills.io/specification). Use it to ensure your skills have proper frontmatter, required fields, and follow naming conventions.
|
|
14
|
-
|
|
15
|
-
**Use when:**
|
|
16
|
-
- Creating new skills in `.claude/skills/`
|
|
17
|
-
- Reviewing PRs that modify skills
|
|
18
|
-
- Validating skill structure before publishing
|
|
19
|
-
|
|
20
|
-
## Scripts
|
|
21
|
-
|
|
22
|
-
### validate-skill.ts
|
|
23
|
-
|
|
24
|
-
Validate one or more skill directories.
|
|
25
|
-
|
|
26
|
-
```bash
|
|
27
|
-
bunx @plaited/development-skills validate-skill [paths...]
|
|
28
|
-
```
|
|
29
|
-
|
|
30
|
-
**Arguments:**
|
|
31
|
-
- `paths`: Optional paths to validate (default: `.claude/skills/`)
|
|
32
|
-
|
|
33
|
-
**Options:**
|
|
34
|
-
- `--json`: Output results as JSON
|
|
35
|
-
|
|
36
|
-
**Examples:**
|
|
37
|
-
|
|
38
|
-
```bash
|
|
39
|
-
# Validate all skills in .claude/skills/
|
|
40
|
-
bunx @plaited/development-skills validate-skill
|
|
41
|
-
|
|
42
|
-
# Validate a specific skill
|
|
43
|
-
bunx @plaited/development-skills validate-skill .claude/skills/typescript-lsp
|
|
44
|
-
|
|
45
|
-
# Validate multiple paths with JSON output
|
|
46
|
-
bunx @plaited/development-skills validate-skill .claude/skills/typescript-lsp .claude/skills/code-documentation --json
|
|
47
|
-
```
|
|
48
|
-
|
|
49
|
-
## Validation Rules
|
|
50
|
-
|
|
51
|
-
### Required Fields
|
|
52
|
-
|
|
53
|
-
- `name`: Skill name (lowercase, alphanumeric with hyphens)
|
|
54
|
-
- `description`: Brief description of the skill
|
|
55
|
-
|
|
56
|
-
### Naming Conventions
|
|
57
|
-
|
|
58
|
-
- Name must be lowercase
|
|
59
|
-
- Only alphanumeric characters and hyphens allowed
|
|
60
|
-
- Cannot start or end with hyphen
|
|
61
|
-
- Cannot contain consecutive hyphens
|
|
62
|
-
- Maximum 64 characters
|
|
63
|
-
- Directory name must match skill name
|
|
64
|
-
|
|
65
|
-
### Optional Fields
|
|
66
|
-
|
|
67
|
-
- `license`: License identifier
|
|
68
|
-
- `compatibility`: Runtime requirements
|
|
69
|
-
- `allowed-tools`: Comma-separated list of allowed tools
|
|
70
|
-
- `metadata`: Key-value pairs for additional metadata
|
|
71
|
-
|
|
72
|
-
## Output Format
|
|
73
|
-
|
|
74
|
-
### Human-Readable (default)
|
|
75
|
-
|
|
76
|
-
```
|
|
77
|
-
✓ .claude/skills/typescript-lsp
|
|
78
|
-
✓ .claude/skills/code-documentation
|
|
79
|
-
✗ .claude/skills/invalid-skill
|
|
80
|
-
ERROR: Missing required field in frontmatter: 'description'
|
|
81
|
-
|
|
82
|
-
2/3 skills valid
|
|
83
|
-
```
|
|
84
|
-
|
|
85
|
-
### JSON (--json)
|
|
86
|
-
|
|
87
|
-
```json
|
|
88
|
-
[
|
|
89
|
-
{
|
|
90
|
-
"valid": true,
|
|
91
|
-
"path": ".claude/skills/typescript-lsp",
|
|
92
|
-
"errors": [],
|
|
93
|
-
"warnings": [],
|
|
94
|
-
"properties": {
|
|
95
|
-
"name": "typescript-lsp",
|
|
96
|
-
"description": "..."
|
|
97
|
-
}
|
|
98
|
-
}
|
|
99
|
-
]
|
|
100
|
-
```
|
|
101
|
-
|
|
102
|
-
## Related Skills
|
|
103
|
-
|
|
104
|
-
- **typescript-lsp** - Example of a well-structured skill with scripts
|
|
105
|
-
- **code-documentation** - TSDoc standards for TypeScript/JavaScript code
|
|
File without changes
|