@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.
Files changed (32) hide show
  1. package/{.claude → .plaited}/rules/accuracy.md +3 -10
  2. package/{.claude → .plaited}/rules/code-review.md +3 -10
  3. package/.plaited/rules/documentation.md +41 -0
  4. package/.plaited/rules/git-workflow.md +31 -0
  5. package/{.claude → .plaited}/rules/github.md +4 -4
  6. package/{.claude → .plaited}/rules/module-organization.md +0 -7
  7. package/{.claude → .plaited}/rules/testing.md +0 -5
  8. package/package.json +2 -2
  9. package/src/lsp-analyze.ts +1 -1
  10. package/src/lsp-find.ts +1 -1
  11. package/src/lsp-hover.ts +1 -1
  12. package/src/lsp-references.ts +1 -1
  13. package/src/lsp-symbols.ts +1 -1
  14. package/src/scaffold-rules.ts +146 -205
  15. package/src/tests/scaffold-rules.spec.ts +239 -110
  16. package/.claude/commands/lsp-analyze.md +0 -66
  17. package/.claude/commands/lsp-find.md +0 -74
  18. package/.claude/commands/lsp-hover.md +0 -57
  19. package/.claude/commands/lsp-refs.md +0 -64
  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 -104
  30. package/.claude/skills/typescript-lsp/SKILL.md +0 -249
  31. package/.claude/skills/validate-skill/SKILL.md +0 -105
  32. /package/{.claude → .plaited}/rules/bun-apis.md +0 -0
@@ -1,57 +0,0 @@
1
- ---
2
- description: Get TypeScript type signature + TSDoc documentation at a position
3
- allowed-tools: Bash
4
- ---
5
-
6
- # LSP Hover
7
-
8
- Get type signature and TSDoc documentation at a specific position in a TypeScript/JavaScript file.
9
-
10
- **Arguments:** $ARGUMENTS
11
-
12
- ## When to Use Each Tool
13
-
14
- | Tool | Purpose |
15
- |------|---------|
16
- | **Glob** | Find files by pattern |
17
- | **Grep** | Search text content |
18
- | **lsp-find** | Search TypeScript symbols |
19
- | **lsp-hover** | Get type info + TSDoc documentation |
20
-
21
- ## Usage
22
-
23
- ```
24
- /lsp-hover <file> <line> <char>
25
- ```
26
-
27
- - `file`: Path to TypeScript/JavaScript file (absolute, relative, or package export path)
28
- - `line`: Line number (0-indexed)
29
- - `char`: Character position (0-indexed)
30
-
31
- ## Instructions
32
-
33
- ### Step 1: Parse Arguments
34
-
35
- Extract file path, line, and character from `$ARGUMENTS`.
36
-
37
- If arguments are missing, show usage:
38
- ```
39
- Usage: /lsp-hover <file> <line> <char>
40
-
41
- Example: /lsp-hover src/utils/parser.ts 42 15
42
- ```
43
-
44
- ### Step 2: Run LSP Hover
45
-
46
- Execute the development-skills CLI command:
47
- ```bash
48
- bunx @plaited/development-skills lsp-hover <file> <line> <char>
49
- ```
50
-
51
- ### Step 3: Format Output
52
-
53
- Parse the JSON output and present the type information in a readable format:
54
-
55
- - Show the type signature in a code block
56
- - If documentation is present, show it below
57
- - If no hover info found, explain that no type information is available at that position
@@ -1,64 +0,0 @@
1
- ---
2
- description: Find all references to a TypeScript symbol across the codebase
3
- allowed-tools: Bash
4
- ---
5
-
6
- # LSP References
7
-
8
- Find all references to a symbol at a specific position. Use this before modifying or deleting exports to understand impact.
9
-
10
- **Arguments:** $ARGUMENTS
11
-
12
- ## When to Use Each Tool
13
-
14
- | Tool | Purpose |
15
- |------|---------|
16
- | **Glob** | Find files by pattern |
17
- | **Grep** | Search text content |
18
- | **lsp-find** | Search TypeScript symbols |
19
- | **lsp-refs** | Find all references to a symbol |
20
-
21
- ## Usage
22
-
23
- ```
24
- /lsp-refs <file> <line> <char>
25
- ```
26
-
27
- - `file`: Path to TypeScript/JavaScript file
28
- - `line`: Line number (0-indexed)
29
- - `char`: Character position (0-indexed)
30
-
31
- ## Instructions
32
-
33
- ### Step 1: Parse Arguments
34
-
35
- Extract file path, line, and character from `$ARGUMENTS`.
36
-
37
- If arguments are missing, show usage:
38
- ```
39
- Usage: /lsp-refs <file> <line> <char>
40
-
41
- Example: /lsp-refs src/utils/parser.ts 42 10
42
- ```
43
-
44
- ### Step 2: Run LSP References
45
-
46
- Execute the development-skills CLI command:
47
- ```bash
48
- bunx @plaited/development-skills lsp-refs <file> <line> <char>
49
- ```
50
-
51
- ### Step 3: Format Output
52
-
53
- Parse the JSON output and present references grouped by file:
54
-
55
- **Found X references:**
56
-
57
- `src/file1.ts`
58
- - Line 42: `const x = targetSymbol()`
59
- - Line 58: `import { targetSymbol } from...`
60
-
61
- `src/file2.ts`
62
- - Line 15: `targetSymbol.method()`
63
-
64
- If no references found, indicate that the symbol may be unused or only defined.
@@ -1,221 +0,0 @@
1
- ---
2
- description: Scaffold or merge development rules for your AI coding agent
3
- allowed-tools: Glob, Read, Write, Edit, AskUserQuestion
4
- ---
5
-
6
- # Scaffold Rules
7
-
8
- Generate development rules adapted to the user's AI coding agent environment.
9
-
10
- **Arguments:** $ARGUMENTS (optional: rule categories to scaffold)
11
-
12
- ## Instructions
13
-
14
- ### Step 1: Get Processed Templates from CLI
15
-
16
- Call the CLI to get rule templates with variables already processed:
17
-
18
- ```bash
19
- bunx @plaited/development-skills scaffold-rules --format=json
20
- ```
21
-
22
- The CLI will:
23
- - Read bundled rule templates from the package
24
- - Process template variables ({{LINK:*}}, {{#if}}, etc.)
25
- - Output JSON with processed content
26
-
27
- Parse the JSON output to get available templates. The output structure is:
28
- ```json
29
- {
30
- "templates": {
31
- "accuracy": {
32
- "filename": "accuracy.md",
33
- "content": "# Accuracy and Confidence Standards\n...",
34
- "description": "95% confidence threshold, verification protocols"
35
- },
36
- "testing": { ... },
37
- ...
38
- }
39
- }
40
- ```
41
-
42
- ### Step 2: Detect Agent & Scan Existing Rules
43
-
44
- The CLI supports 2 target formats:
45
-
46
- | Target | Rules Location | Use Case |
47
- |--------|----------------|----------|
48
- | `claude` | `.claude/rules/` | Claude Code (default) |
49
- | `agents-md` | `.plaited/rules/` + `AGENTS.md` | Universal format for Cursor, Factory, Copilot, Windsurf, Cline, Aider, and 60,000+ other projects |
50
-
51
- Check for existing configuration:
52
- ```
53
- .claude/ → Use --agent=claude (default)
54
- AGENTS.md → Use --agent=agents-md
55
- .plaited/rules/ → Use --agent=agents-md
56
- Any other agent → Use --agent=agents-md (universal)
57
- ```
58
-
59
- **Always scan for existing rules before writing.** Use Read tool to check what's already there.
60
-
61
- Analyze existing content to understand:
62
- - What conventions are already defined
63
- - What sections/topics are covered
64
- - The writing style and format used
65
-
66
- ### Step 3: Ask User Preferences
67
-
68
- Present available templates from CLI output and ask which to scaffold (if not provided in $ARGUMENTS):
69
-
70
- ```
71
- ? Select rule categories to scaffold:
72
- ◉ accuracy - 95% confidence threshold, verification protocols
73
- ◉ bun-apis - Prefer Bun over Node.js APIs
74
- ◉ git-workflow - Conventional commits, multi-line messages
75
- ◉ github - GitHub CLI patterns for PRs/issues
76
- ◉ code-review - TypeScript conventions, module organization
77
- ◉ testing - Bun test runner conventions
78
- ```
79
-
80
- ### Step 4: Propose Merges (If Existing Rules Found)
81
-
82
- If existing rules were found in Step 2, compare with CLI output:
83
-
84
- 1. **Identify overlaps**: Which templates already exist as files
85
- 2. **Show what would be added**: Preview the content from CLI
86
- 3. **Ask for approval**:
87
-
88
- ```
89
- ? Existing rules found. How would you like to proceed?
90
-
91
- For "git-workflow.md" (exists):
92
- ◯ Keep existing (skip)
93
- ◉ Merge (add missing sections)
94
- ◯ Replace entirely
95
-
96
- For "testing.md" (new):
97
- ◉ Add to rules
98
- ◯ Skip
99
- ```
100
-
101
- For merges:
102
- - Use Read to get existing content
103
- - Show diff of what would change
104
- - Get approval before writing
105
-
106
- ### Step 5: Write Rules
107
-
108
- After user approval, write the rules using the content from CLI output:
109
-
110
- - Use Write tool with `content` from CLI JSON
111
- - Create directories if needed (`.claude/rules/` or `.plaited/rules/`)
112
- - Write/merge files as approved
113
- - Report what was created/modified
114
-
115
- ### Rule Content Guidelines
116
-
117
- The CLI processes template variables automatically. The content in the JSON output is ready to write to files.
118
-
119
- **Template Processing:**
120
- The CLI handles:
121
- - Template variable substitution ({{LINK:*}}, {{AGENT_NAME}}, etc.)
122
- - Capability-based conditionals ({{#if has-sandbox}}, {{#if supports-slash-commands}})
123
- - Template header removal
124
- - Cross-reference formatting for detected agent
125
-
126
- **Available Rule Topics:**
127
-
128
- **Bun APIs:**
129
- - Prefer `Bun.file()` over `fs` APIs
130
- - Use `Bun.$` for shell commands
131
- - Use `Bun.write()` for file writes
132
- - Use `import.meta.dir` for current directory
133
-
134
- **Git Workflow:**
135
- - Conventional commit prefixes (feat, fix, refactor, docs, chore, test)
136
- - Multi-line commit message format
137
- - Sandbox workarounds (Claude Code only)
138
-
139
- **GitHub CLI:**
140
- - Prefer `gh` CLI over WebFetch for GitHub URLs
141
- - PR review patterns
142
- - Issue/PR JSON field references
143
-
144
- **TypeScript Conventions:**
145
- - Prefer `type` over `interface`
146
- - No `any` types (use `unknown` with guards)
147
- - Arrow functions preferred
148
- - Object parameter pattern for 2+ params
149
- - PascalCase for types, `PascalCaseSchema` for Zod schemas
150
-
151
- **Testing Patterns:**
152
- - Use `test()` instead of `it()`
153
- - `*.spec.ts` naming convention
154
- - No conditionals around assertions
155
- - Assert existence before checking values
156
-
157
- ### Step 6: Output Summary
158
-
159
- After completion, summarize what was done:
160
-
161
- ```
162
- ✅ Rules scaffolded for Claude Code:
163
-
164
- Created:
165
- • .claude/rules/testing.md - Bun test conventions
166
- • .claude/rules/bun-apis.md - Prefer Bun over Node.js
167
-
168
- Merged:
169
- • .claude/rules/git-workflow.md - Added commit message formats
170
-
171
- Skipped:
172
- • accuracy.md - Already exists, user chose to keep
173
-
174
- 💡 Review the generated rules at .claude/rules/ and customize as needed.
175
- ```
176
-
177
- ### CLI Usage
178
-
179
- The scaffold-rules CLI supports 2 target formats:
180
-
181
- ```bash
182
- # Default: outputs all rules for Claude Code
183
- bunx @plaited/development-skills scaffold-rules
184
-
185
- # Universal AGENTS.md format (works with Cursor, Factory, Copilot, Windsurf, Cline, Aider, etc.)
186
- bunx @plaited/development-skills scaffold-rules --agent=agents-md
187
-
188
- # Custom paths (for specific agent directories or monorepos)
189
- bunx @plaited/development-skills scaffold-rules --agent=agents-md --rules-dir=.cursor/rules
190
- bunx @plaited/development-skills scaffold-rules --agent=agents-md --agents-md-path=docs/AGENTS.md
191
-
192
- # Filter specific rules
193
- bunx @plaited/development-skills scaffold-rules --rules testing --rules bun-apis
194
- ```
195
-
196
- **Options:**
197
- - `--agent` / `-a`: Target format (`claude` or `agents-md`)
198
- - `--rules-dir` / `-d`: Custom rules directory path (overrides default)
199
- - `--agents-md-path` / `-m`: Custom AGENTS.md file path (default: `AGENTS.md`)
200
- - `--format` / `-f`: Output format (json)
201
- - `--rules` / `-r`: Specific rules to include (can be used multiple times)
202
-
203
- **Output Structure:**
204
- The JSON output includes metadata about the target:
205
- ```json
206
- {
207
- "agent": "agents-md",
208
- "rulesPath": ".plaited/rules",
209
- "agentsMdPath": "AGENTS.md",
210
- "format": "agents-md",
211
- "supportsAgentsMd": true,
212
- "agentsMdContent": "# AGENTS.md\n...",
213
- "templates": { ... }
214
- }
215
- ```
216
-
217
- For `agents-md` format, write:
218
- 1. Individual rule files to the path specified in `rulesPath`
219
- 2. The `agentsMdContent` to the path specified in `agentsMdPath`
220
-
221
- This provides maximum portability - rules work with any AGENTS.md-compatible agent (60,000+ projects support this format).
@@ -1,29 +0,0 @@
1
- ---
2
- description: Validate skill directories against AgentSkills spec
3
- allowed-tools: Bash, mcp__agent-skills-spec__*
4
- ---
5
-
6
- # Validate Skills
7
-
8
- Validate skill directories against the AgentSkills specification.
9
-
10
- **Paths to validate:** $ARGUMENTS (default: `.claude/skills/`)
11
-
12
- ## Instructions
13
-
14
- ### Step 1: Run Validation
15
-
16
- Execute the development-skills CLI command:
17
- ```bash
18
- bunx @plaited/development-skills validate-skill $ARGUMENTS
19
- ```
20
-
21
- If no arguments provided, defaults to `.claude/skills/`.
22
-
23
- ### Step 2: Report Results
24
-
25
- Show the CLI output to the user. If there are errors, use the `agent-skills-spec` MCP server to get the latest specification and explain how to fix them.
26
-
27
- ### Step 3: Query Spec (if needed)
28
-
29
- For clarification on validation rules, query the `agent-skills-spec` MCP server for the current specification.
@@ -1,66 +0,0 @@
1
- <!--
2
- RULE TEMPLATE - Distributed via /scaffold-rules
3
- Variables: {{#if has-sandbox}}, {{#if supports-slash-commands}}
4
- -->
5
-
6
- # Git Workflow
7
-
8
- ## Commit Message Format
9
-
10
- {{#if has-sandbox}}
11
- When creating commits with multi-line messages, use single-quoted strings instead of heredocs. The sandbox environment restricts temp file creation needed for heredocs.
12
- {{/if}}
13
- {{^if has-sandbox}}
14
- Use multi-line commit messages for detailed changes:
15
- {{/if}}
16
-
17
- {{#if has-sandbox}}
18
- ```bash
19
- # ✅ CORRECT: Single-quoted multi-line string
20
- git commit -m 'refactor: description here
21
-
22
- Additional context on second line.
23
-
24
- 🤖 Generated with [Claude Code](https://claude.com/claude-code)
25
-
26
- Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>'
27
-
28
- # ❌ WRONG: Heredoc syntax (fails in sandbox)
29
- git commit -m "$(cat <<'EOF'
30
- refactor: description here
31
- EOF
32
- )"
33
- ```
34
-
35
- The heredoc approach fails with:
36
- ```
37
- (eval):1: can't create temp file for here document: operation not permitted
38
- ```
39
- {{/if}}
40
- {{^if has-sandbox}}
41
- ```bash
42
- git commit -m "refactor: description here
43
-
44
- Additional context on second line."
45
- ```
46
- {{/if}}
47
-
48
- ## Pre-commit Hooks
49
-
50
- **Never use `--no-verify`** to bypass pre-commit hooks. If hooks fail, it indicates a real issue that must be fixed:
51
-
52
- 1. Investigate the error message
53
- 2. Fix the underlying issue (lint errors, format issues, test failures)
54
- 3. Re-run the commit
55
-
56
- Using `--no-verify` masks problems and defeats the purpose of automated quality checks.
57
-
58
- ## Commit Conventions
59
-
60
- Follow conventional commits format:
61
- - `feat:` - New features
62
- - `fix:` - Bug fixes
63
- - `refactor:` - Code changes that neither fix bugs nor add features
64
- - `docs:` - Documentation only changes
65
- - `chore:` - Maintenance tasks
66
- - `test:` - Adding or updating tests
@@ -1,47 +0,0 @@
1
- ---
2
- name: code-documentation
3
- description: TSDoc standards for TypeScript/JavaScript code. Automatically invoked when writing, reviewing, or editing any TSDoc comments, code documentation, or API documentation. (project)
4
- license: ISC
5
- compatibility: Requires bun
6
- ---
7
-
8
- # Code Documentation Skill
9
-
10
- ## Purpose
11
-
12
- This skill provides TSDoc format templates, type documentation guidelines, and maintenance workflows. Use this when:
13
- - Writing or editing TSDoc comments for any function, type, or module
14
- - Reviewing documentation quality
15
- - Creating comprehensive API documentation
16
- - Documenting complex type structures
17
- - Cleaning up non-compliant comments (performance notes, timestamps, inline explanations)
18
- - Synchronizing out-of-sync TSDoc with code changes
19
- - Removing orphaned documentation for deleted code
20
-
21
- **Key Standard**: No `@example` sections - tests and stories serve as living examples.
22
-
23
- ## Quick Reference
24
-
25
- - **Creating TSDoc**: See [workflow.md](references/workflow.md) for the generation workflow
26
- - **Maintaining TSDoc**: See [maintenance.md](references/maintenance.md) for cleanup and sync guidelines
27
-
28
- This skill contains detailed templates for:
29
- - Public API Functions
30
- - Internal Module Documentation
31
- - Public and Internal Types
32
- - Helper Functions
33
- - Behavioral Programming Functions
34
- - Special Annotations (Security, Performance, Deprecated)
35
- - Type Documentation (Complex Objects, Unions, Functions, Utilities, Branded Types, etc.)
36
-
37
- ## Navigation
38
-
39
- - [workflow.md](references/workflow.md) - TSDoc generation workflow (4 phases)
40
- - [maintenance.md](references/maintenance.md) - Comment policy, sync tasks, orphaned doc handling
41
- - [public-api-templates.md](references/public-api-templates.md) - Templates for public-facing APIs
42
- - [internal-templates.md](references/internal-templates.md) - Templates for internal code and modules
43
- - [type-documentation.md](references/type-documentation.md) - Comprehensive type documentation templates
44
-
45
- ## Related Skills
46
-
47
- - **typescript-lsp**: Use for type verification and discovery during documentation workflow. Essential for Phase 1 (type analysis) and Phase 2 (usage discovery) of the TSDoc generation process. Run `lsp-hover` to verify signatures, `lsp-references` to find usages, and `lsp-symbols` to understand file structure.
@@ -1,113 +0,0 @@
1
- # Internal Templates
2
-
3
- ## Internal Module Documentation
4
-
5
- ```typescript
6
- /**
7
- * @internal
8
- * @module module-name
9
- *
10
- * Purpose: Why this module exists in the codebase
11
- * Architecture: How it fits into the overall system design
12
- * Dependencies: What this module depends on (be specific)
13
- * Consumers: What parts of the system use this module
14
- *
15
- * Maintainer Notes:
16
- * - Key implementation details and design decisions
17
- * - Important invariants that must be maintained
18
- * - Tricky aspects of the implementation
19
- * - Performance-critical sections with complexity analysis
20
- *
21
- * Common modification scenarios:
22
- * - When you might need to modify this module
23
- * - How to extend functionality safely
24
- * - What to watch out for when making changes
25
- *
26
- * Performance considerations:
27
- * - Optimization strategies used
28
- * - Memory management concerns
29
- * - Computational complexity (Big-O notation)
30
- *
31
- * Known limitations:
32
- * - Current constraints or technical debt
33
- * - Planned improvements
34
- * - Workarounds for known issues
35
- */
36
- ```
37
-
38
- ## Internal Types
39
-
40
- ```typescript
41
- /**
42
- * @internal
43
- * What this type represents internally and why it exists.
44
- * How it's used in the implementation.
45
- *
46
- * @property propName - Internal property purpose
47
- *
48
- * @remarks
49
- * - Implementation-specific constraints
50
- * - Why this structure was chosen
51
- */
52
- type InternalType = {
53
- // Implementation-specific properties
54
- }
55
- ```
56
-
57
- ## Internal Helper Functions
58
-
59
- ```typescript
60
- /**
61
- * @internal
62
- * Brief description of what this internal function does.
63
- * Why it exists and how it's used within the module.
64
- *
65
- * @param paramName - Parameter purpose
66
- * @returns Return value meaning
67
- *
68
- * @remarks
69
- * - Algorithm details (e.g., "Fisher-Yates shuffle")
70
- * - Complexity: O(n) where n is...
71
- * - Why this approach was chosen
72
- */
73
- const internalHelper = () => { ... }
74
- ```
75
-
76
- ## Security-Sensitive Code
77
-
78
- ```typescript
79
- /**
80
- * @internal
81
- * SECURITY: This function handles [sensitive operation].
82
- *
83
- * Security considerations:
84
- * - Input sanitization approach
85
- * - XSS/injection prevention measures
86
- * - Authentication/authorization requirements
87
- */
88
- ```
89
-
90
- ## Performance-Critical Code
91
-
92
- ```typescript
93
- /**
94
- * @internal
95
- * PERFORMANCE: Hot path - called [frequency/context].
96
- *
97
- * Performance notes:
98
- * - Optimization strategy (e.g., "minimal allocations")
99
- * - Caching approach (e.g., "WeakMap cache")
100
- * - Complexity: O(1) lookup after initial computation
101
- */
102
- ```
103
-
104
- ## Required Elements for Internal Modules
105
-
106
- ### All Internal Modules Must Include
107
-
108
- - Purpose and architecture context
109
- - Dependencies and consumers
110
- - Maintainer notes
111
- - Modification scenarios
112
- - Performance considerations
113
- - Known limitations