@plaited/development-skills 0.4.1 → 0.6.0

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