@paulduvall/claude-dev-toolkit 0.0.1-alpha.12 โ 0.0.1-alpha.14
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/LICENSE +21 -0
- package/README.md +16 -16
- package/bin/claude-commands +72 -9
- package/commands/active/xcontinue.md +92 -0
- package/commands/active/xexplore.md +94 -0
- package/commands/active/xverify.md +80 -0
- package/commands/experiments/xdevcontainer.md +238 -0
- package/commands/experiments/xnew.md +5 -0
- package/hooks/README.md +32 -0
- package/hooks/file-logger.sh +4 -2
- package/hooks/lib/argument-parser.sh +7 -2
- package/hooks/lib/config-constants.sh +4 -4
- package/hooks/lib/context-manager.sh +19 -8
- package/hooks/lib/error-handler.sh +21 -10
- package/hooks/lib/execution-engine.sh +11 -194
- package/hooks/lib/execution-results.sh +113 -0
- package/hooks/lib/execution-simulation.sh +114 -0
- package/hooks/lib/field-validators.sh +104 -0
- package/hooks/lib/file-utils.sh +49 -26
- package/hooks/lib/subagent-discovery.sh +9 -6
- package/hooks/lib/subagent-validator.sh +19 -209
- package/hooks/lib/validation-reporter.sh +134 -0
- package/hooks/on-error-debug.sh +16 -11
- package/hooks/pre-commit-test-runner.sh +132 -0
- package/hooks/pre-write-security.sh +14 -6
- package/hooks/prevent-credential-exposure.sh +55 -45
- package/hooks/subagent-trigger-simple.sh +17 -8
- package/hooks/verify-before-edit.sh +135 -0
- package/lib/setup-wizard.js +155 -262
- package/lib/uninstall-command.js +100 -0
- package/package.json +2 -2
- package/scripts/postinstall.js +168 -171
- package/subagents/debug-specialist.md +6 -0
- package/templates/README.md +15 -0
- package/templates/basic-settings.json +33 -19
- package/templates/comprehensive-settings.json +68 -171
- package/templates/global-claude.md +344 -0
- package/templates/security-focused-settings.json +58 -41
- package/lib/installation-instruction-generator-backup.js +0 -579
- package/lib/package-manager-service.js +0 -270
- package/subagents/debug-context.md +0 -197
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2024 Paul Duvall
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Claude Dev Toolkit
|
|
2
2
|
|
|
3
|
-
**Transform Claude Code into a complete development platform** with
|
|
3
|
+
**Transform Claude Code into a complete development platform** with 62 AI-powered custom commands that automate your entire software development workflow.
|
|
4
4
|
|
|
5
5
|
## ๐ Quick Installation
|
|
6
6
|
|
|
@@ -15,12 +15,12 @@ claude
|
|
|
15
15
|
|
|
16
16
|
## ๐ฆ What's Included
|
|
17
17
|
|
|
18
|
-
- **
|
|
19
|
-
- **
|
|
18
|
+
- **16 Active Commands**: Production-ready commands for immediate use
|
|
19
|
+
- **46 Experimental Commands**: Cutting-edge features for early adopters
|
|
20
20
|
- **Security Hooks**: Automated security validation and governance
|
|
21
21
|
- **Configuration Templates**: Pre-configured settings for different workflows
|
|
22
22
|
- **Interactive Setup Wizard**: Guided installation with customization options
|
|
23
|
-
- **JavaScript Test Suite**:
|
|
23
|
+
- **JavaScript Test Suite**: 25 test suites validating package structure, commands, and integration
|
|
24
24
|
|
|
25
25
|
## ๐ฏ Quick Start
|
|
26
26
|
|
|
@@ -33,9 +33,9 @@ npm install -g @paulduvall/claude-dev-toolkit
|
|
|
33
33
|
### Option 2: Manual Command Installation
|
|
34
34
|
```bash
|
|
35
35
|
# Install specific command sets
|
|
36
|
-
claude-commands install --active # Install
|
|
37
|
-
claude-commands install --experiments # Install
|
|
38
|
-
claude-commands install --all # Install all
|
|
36
|
+
claude-commands install --active # Install 16 production commands
|
|
37
|
+
claude-commands install --experiments # Install 46 experimental commands
|
|
38
|
+
claude-commands install --all # Install all 62 commands
|
|
39
39
|
```
|
|
40
40
|
|
|
41
41
|
### Option 3: Custom Installation
|
|
@@ -68,7 +68,7 @@ claude-commands oidc --help # Configure GitHub Actions OIDC with AWS
|
|
|
68
68
|
- **`/xconfig`** - Configuration management
|
|
69
69
|
- **`/xtdd`** - Test-driven development automation
|
|
70
70
|
|
|
71
|
-
### ๐งช **Experimental Commands** (
|
|
71
|
+
### ๐งช **Experimental Commands** (46 Additional)
|
|
72
72
|
Advanced commands for specialized workflows:
|
|
73
73
|
- **Planning & Analytics**: `/xplanning`, `/xanalytics`, `/xmetrics`
|
|
74
74
|
- **Infrastructure**: `/xinfra`, `/xmonitoring`, `/xaws`
|
|
@@ -166,11 +166,11 @@ npm run lint # Code linting
|
|
|
166
166
|
```
|
|
167
167
|
|
|
168
168
|
### Test Coverage
|
|
169
|
-
- **
|
|
170
|
-
- **Command Validation**: All
|
|
171
|
-
- **Security Tests**:
|
|
172
|
-
- **Integration Tests**:
|
|
173
|
-
- **
|
|
169
|
+
- **25 Test Suites**: Package structure, CLI, and command validation
|
|
170
|
+
- **Command Validation**: All commands validated for structure and naming
|
|
171
|
+
- **Security Tests**: Credential exposure and placeholder detection
|
|
172
|
+
- **Integration Tests**: Hook and subagent workflow testing
|
|
173
|
+
- **Shell Tests**: 8 bash test suites for hooks and lib modules
|
|
174
174
|
|
|
175
175
|
### Architecture
|
|
176
176
|
- **Self-Contained Package**: No dependencies on repository cloning
|
|
@@ -271,7 +271,7 @@ npm test
|
|
|
271
271
|
- โ
**Dependency Validation**: AWS CLI, Git, and GitHub CLI availability checking
|
|
272
272
|
|
|
273
273
|
### Version 0.0.1-alpha.8
|
|
274
|
-
- โ
**Documentation Consistency**: Fixed command counts
|
|
274
|
+
- โ
**Documentation Consistency**: Fixed command counts and subagent counts
|
|
275
275
|
- โ
**Test Infrastructure**: Enhanced test-results directory handling
|
|
276
276
|
- โ
**Repository Cleanup**: Removed outdated documentation and test artifacts
|
|
277
277
|
- โ
**Validation Logic**: Improved scenario-aware test validation
|
|
@@ -288,8 +288,8 @@ npm test
|
|
|
288
288
|
- โ
**Symlink Consolidation**: Eliminated duplicate directories
|
|
289
289
|
- โ
**JavaScript Migration**: Complete test suite migration from Python
|
|
290
290
|
- โ
**Enhanced Templates**: Fixed configuration template issues
|
|
291
|
-
- โ
**
|
|
292
|
-
- โ
**
|
|
291
|
+
- โ
**Test Suites**: Package structure and command validation
|
|
292
|
+
- โ
**62 Total Commands**: 16 active + 46 experimental commands
|
|
293
293
|
- โ
**Security Enhancements**: Comprehensive security hook system
|
|
294
294
|
|
|
295
295
|
## ๐ License
|
package/bin/claude-commands
CHANGED
|
@@ -19,36 +19,75 @@ program
|
|
|
19
19
|
program
|
|
20
20
|
.command('list')
|
|
21
21
|
.description('List all available commands')
|
|
22
|
+
.addHelpText('after', `
|
|
23
|
+
Examples:
|
|
24
|
+
$ claude-commands list # List all installed commands
|
|
25
|
+
$ claude-commands list --active # Show only production commands
|
|
26
|
+
$ claude-commands list --experiments # Show only experimental commands`)
|
|
22
27
|
.option('-a, --active', 'Show only active commands')
|
|
23
28
|
.option('-e, --experiments', 'Show only experimental commands')
|
|
24
29
|
.action((options) => {
|
|
25
30
|
const claudeDir = path.join(os.homedir(), '.claude', 'commands');
|
|
26
|
-
|
|
31
|
+
const pkgDir = path.join(__dirname, '..', 'commands');
|
|
32
|
+
|
|
27
33
|
console.log('๐ฆ Claude Custom Commands\n');
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
34
|
+
|
|
35
|
+
// Determine source: installed commands or package commands
|
|
36
|
+
const sourceDir = fs.existsSync(claudeDir) ? claudeDir : null;
|
|
37
|
+
|
|
38
|
+
if (sourceDir) {
|
|
39
|
+
let allCommands = fs.readdirSync(sourceDir)
|
|
31
40
|
.filter(f => f.endsWith('.md'))
|
|
32
41
|
.map(f => f.replace('.md', ''))
|
|
33
42
|
.sort();
|
|
34
|
-
|
|
43
|
+
|
|
44
|
+
// Apply --active/--experiments filters using package source dirs
|
|
45
|
+
if (options.active || options.experiments) {
|
|
46
|
+
const activeDir = path.join(pkgDir, 'active');
|
|
47
|
+
const expDir = path.join(pkgDir, 'experiments');
|
|
48
|
+
const activeSet = new Set();
|
|
49
|
+
const expSet = new Set();
|
|
50
|
+
|
|
51
|
+
if (fs.existsSync(activeDir)) {
|
|
52
|
+
fs.readdirSync(activeDir)
|
|
53
|
+
.filter(f => f.endsWith('.md'))
|
|
54
|
+
.forEach(f => activeSet.add(f.replace('.md', '')));
|
|
55
|
+
}
|
|
56
|
+
if (fs.existsSync(expDir)) {
|
|
57
|
+
fs.readdirSync(expDir)
|
|
58
|
+
.filter(f => f.endsWith('.md'))
|
|
59
|
+
.forEach(f => expSet.add(f.replace('.md', '')));
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
if (options.active) {
|
|
63
|
+
allCommands = allCommands.filter(cmd => activeSet.has(cmd));
|
|
64
|
+
} else if (options.experiments) {
|
|
65
|
+
allCommands = allCommands.filter(cmd => expSet.has(cmd));
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
|
|
35
69
|
if (allCommands.length > 0) {
|
|
36
|
-
|
|
70
|
+
const label = options.active ? 'Active' : options.experiments ? 'Experimental' : 'Available';
|
|
71
|
+
console.log(`๐ ${label} Commands:`);
|
|
37
72
|
allCommands.forEach(cmd => console.log(` /${cmd}`));
|
|
38
73
|
console.log(`\n๐ Total: ${allCommands.length} commands`);
|
|
39
74
|
} else {
|
|
40
|
-
console.log(' No commands found');
|
|
75
|
+
console.log(' No commands found matching filter');
|
|
41
76
|
}
|
|
42
77
|
} else {
|
|
43
78
|
console.log(' Commands directory not found');
|
|
79
|
+
console.log(' Run: claude-commands install');
|
|
44
80
|
}
|
|
45
|
-
|
|
46
|
-
console.log('\n๐ก Usage: Try /xhelp in Claude Code to see all commands');
|
|
47
81
|
});
|
|
48
82
|
|
|
49
83
|
program
|
|
50
84
|
.command('install')
|
|
51
85
|
.description('Install command sets to ~/.claude/commands/')
|
|
86
|
+
.addHelpText('after', `
|
|
87
|
+
Examples:
|
|
88
|
+
$ claude-commands install # Install active commands (default)
|
|
89
|
+
$ claude-commands install --all # Install all commands
|
|
90
|
+
$ claude-commands install --dry-run # Preview without changes`)
|
|
52
91
|
.option('--active', 'Install production-ready commands (default)')
|
|
53
92
|
.option('--experiments', 'Install experimental commands only')
|
|
54
93
|
.option('--all', 'Install both active and experimental')
|
|
@@ -153,6 +192,11 @@ program
|
|
|
153
192
|
program
|
|
154
193
|
.command('setup')
|
|
155
194
|
.description('Setup the Claude Dev Toolkit with custom commands and configuration')
|
|
195
|
+
.addHelpText('after', `
|
|
196
|
+
Examples:
|
|
197
|
+
$ claude-commands setup # Interactive setup
|
|
198
|
+
$ claude-commands setup --type basic --commands all # Basic config, all commands
|
|
199
|
+
$ claude-commands setup --dry-run # Preview setup actions`)
|
|
156
200
|
.option('--type <template>', 'Configuration template to apply (basic, comprehensive, security-focused)')
|
|
157
201
|
.option('--commands <set>', 'Command set to install (active, experiments, all, none)')
|
|
158
202
|
.option('--skip-configure', 'Skip configuration step')
|
|
@@ -328,4 +372,23 @@ program
|
|
|
328
372
|
}
|
|
329
373
|
});
|
|
330
374
|
|
|
375
|
+
program
|
|
376
|
+
.command('uninstall')
|
|
377
|
+
.description('Remove all installed commands, hooks, and subagents')
|
|
378
|
+
.addHelpText('after', `
|
|
379
|
+
Examples:
|
|
380
|
+
$ claude-commands uninstall # Remove all installed files
|
|
381
|
+
$ claude-commands uninstall --dry-run # Preview what would be removed`)
|
|
382
|
+
.option('--dry-run', 'Preview what would be removed without deleting')
|
|
383
|
+
.option('--keep-settings', 'Keep settings.json intact')
|
|
384
|
+
.action((options) => {
|
|
385
|
+
const uninstaller = require('../lib/uninstall-command');
|
|
386
|
+
try {
|
|
387
|
+
uninstaller.execute(options);
|
|
388
|
+
} catch (error) {
|
|
389
|
+
console.error(`Uninstall failed: ${error.message}`);
|
|
390
|
+
process.exit(1);
|
|
391
|
+
}
|
|
392
|
+
});
|
|
393
|
+
|
|
331
394
|
program.parse(process.argv);
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Continue an execution plan from where it left off across sessions
|
|
3
|
+
tags: [workflow, execution-plan, session-continuity, automation]
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Execution Plan Continuation
|
|
7
|
+
|
|
8
|
+
Resume a multi-step execution plan, picking up at the next incomplete task.
|
|
9
|
+
|
|
10
|
+
## Usage Examples
|
|
11
|
+
|
|
12
|
+
**Resume the current plan:**
|
|
13
|
+
```
|
|
14
|
+
/xcontinue
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
**Help and options:**
|
|
18
|
+
```
|
|
19
|
+
/xcontinue help
|
|
20
|
+
/xcontinue --help
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
## Implementation
|
|
24
|
+
|
|
25
|
+
If $ARGUMENTS contains "help" or "--help":
|
|
26
|
+
Display this usage information and exit.
|
|
27
|
+
|
|
28
|
+
### Step 1: Find the Execution Plan
|
|
29
|
+
|
|
30
|
+
Search for execution plan files in the current directory:
|
|
31
|
+
|
|
32
|
+
```bash
|
|
33
|
+
find . -maxdepth 2 -iname "*plan*" -name "*.md" ! -path "*/node_modules/*" ! -path "*/.git/*" 2>/dev/null
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
- Common names: `EXECUTION_PLAN.md`, `PLAN.md`, `execution-plan.md`
|
|
37
|
+
|
|
38
|
+
If no plan file is found:
|
|
39
|
+
- Tell the user: "No execution plan found in this directory."
|
|
40
|
+
- Suggest creating one with a basic template:
|
|
41
|
+
|
|
42
|
+
```markdown
|
|
43
|
+
# Execution Plan
|
|
44
|
+
|
|
45
|
+
| # | Task | Status | Notes |
|
|
46
|
+
|---|------|--------|-------|
|
|
47
|
+
| 1 | [First task] | [ ] pending | |
|
|
48
|
+
| 2 | [Second task] | [ ] pending | |
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
Stop and wait for user input.
|
|
52
|
+
|
|
53
|
+
### Step 2: Parse Plan Progress
|
|
54
|
+
|
|
55
|
+
Read the plan file and identify:
|
|
56
|
+
- **Completed tasks**: Lines with `[x]`, `done`, or checkmarks
|
|
57
|
+
- **Pending tasks**: Lines with `[ ]`, `pending`, or unchecked items
|
|
58
|
+
- **In-progress tasks**: Lines with `in-progress` or `in progress`
|
|
59
|
+
|
|
60
|
+
Display a progress summary:
|
|
61
|
+
```
|
|
62
|
+
Progress: X of Y tasks complete
|
|
63
|
+
Next task: [description of next pending task]
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
If all tasks are complete:
|
|
67
|
+
- Congratulate the user
|
|
68
|
+
- Summarize what was accomplished
|
|
69
|
+
- Suggest cleanup: "Consider deleting the plan file if work is done."
|
|
70
|
+
- Stop execution.
|
|
71
|
+
|
|
72
|
+
### Step 3: Execute Next Task
|
|
73
|
+
|
|
74
|
+
Pick the first task with status `pending` or `[ ]`:
|
|
75
|
+
1. Read the task description and any acceptance criteria
|
|
76
|
+
2. Implement the task fully
|
|
77
|
+
3. Run validation if applicable (tests, lint, build)
|
|
78
|
+
4. Verify acceptance criteria pass
|
|
79
|
+
|
|
80
|
+
### Step 4: Update Plan and Handoff
|
|
81
|
+
|
|
82
|
+
After completing the task:
|
|
83
|
+
1. Update the plan file โ mark the task as `[x] done` with a timestamp
|
|
84
|
+
2. Update any counters (Done/Remaining) in the plan header
|
|
85
|
+
3. Tell the user:
|
|
86
|
+
|
|
87
|
+
```
|
|
88
|
+
Task #N complete: [brief summary]
|
|
89
|
+
Run /clear then /xcontinue to proceed to the next task.
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
This handoff protocol ensures context stays fresh across sessions.
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Explore a codebase topic before making changes (read-only)
|
|
3
|
+
tags: [exploration, codebase, discovery, read-only]
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Codebase Exploration
|
|
7
|
+
|
|
8
|
+
Comprehensively search the codebase for a topic before making any changes. Read-only โ no files are modified.
|
|
9
|
+
|
|
10
|
+
## Usage Examples
|
|
11
|
+
|
|
12
|
+
**Explore a topic:**
|
|
13
|
+
```
|
|
14
|
+
/xexplore authentication
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
**Explore a specific area:**
|
|
18
|
+
```
|
|
19
|
+
/xexplore database migrations
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
**Help and options:**
|
|
23
|
+
```
|
|
24
|
+
/xexplore help
|
|
25
|
+
/xexplore --help
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
## Implementation
|
|
29
|
+
|
|
30
|
+
If $ARGUMENTS contains "help" or "--help":
|
|
31
|
+
Display this usage information and exit.
|
|
32
|
+
|
|
33
|
+
If $ARGUMENTS is empty:
|
|
34
|
+
Tell the user: "Please provide a topic to explore. Example: /xexplore authentication"
|
|
35
|
+
Stop and wait for input.
|
|
36
|
+
|
|
37
|
+
### Step 1: Search by File Name
|
|
38
|
+
|
|
39
|
+
Find files whose names match the topic:
|
|
40
|
+
|
|
41
|
+
```bash
|
|
42
|
+
find . -iname "*$ARGUMENTS*" ! -path "*/node_modules/*" ! -path "*/.git/*" ! -path "*/vendor/*" 2>/dev/null | head -30
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
### Step 2: Search by Content
|
|
46
|
+
|
|
47
|
+
Grep the codebase for the topic keyword:
|
|
48
|
+
- Search all source files for content matching $ARGUMENTS
|
|
49
|
+
- Capture file paths and line numbers for key matches
|
|
50
|
+
- Limit to first 20 matches per file to avoid flooding
|
|
51
|
+
|
|
52
|
+
### Step 3: Search Configuration
|
|
53
|
+
|
|
54
|
+
Check config files specifically:
|
|
55
|
+
- `*.json`, `*.yaml`, `*.yml`, `*.toml`, `*.env*`, `*.ini`
|
|
56
|
+
- Look for the topic in config values, keys, and comments
|
|
57
|
+
|
|
58
|
+
### Step 4: Search Tests
|
|
59
|
+
|
|
60
|
+
Find test files related to the topic:
|
|
61
|
+
- Patterns: `*test*`, `*spec*`, `__tests__/`
|
|
62
|
+
- Check both file names and file content
|
|
63
|
+
|
|
64
|
+
### Step 5: Search Documentation
|
|
65
|
+
|
|
66
|
+
Check docs for the topic:
|
|
67
|
+
- `*.md` files, `docs/` directory, `README*`
|
|
68
|
+
- Wiki or guide references
|
|
69
|
+
|
|
70
|
+
### Step 6: Report
|
|
71
|
+
|
|
72
|
+
Present findings in a structured inventory:
|
|
73
|
+
|
|
74
|
+
```
|
|
75
|
+
## Exploration Report: [topic]
|
|
76
|
+
|
|
77
|
+
### Source Files (N found)
|
|
78
|
+
- path/to/file.ts:42 โ [matching line preview]
|
|
79
|
+
|
|
80
|
+
### Tests (N found)
|
|
81
|
+
- tests/path/to/test.ts:15 โ [matching line preview]
|
|
82
|
+
|
|
83
|
+
### Configuration (N found)
|
|
84
|
+
- config/settings.json:8 โ [matching line preview]
|
|
85
|
+
|
|
86
|
+
### Documentation (N found)
|
|
87
|
+
- docs/guide.md:23 โ [matching line preview]
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
If nothing is found:
|
|
91
|
+
- Tell the user: "No matches found for '[topic]'."
|
|
92
|
+
- Suggest broadening the search or trying alternate terms.
|
|
93
|
+
|
|
94
|
+
**Do NOT make any changes to any files. This command is read-only.**
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: "Verify references before taking action โ catch fabricated URLs, placeholder IDs, and unverified claims"
|
|
3
|
+
tags: ["verification", "quality", "safety", "pre-action"]
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Pre-Action Verification
|
|
7
|
+
|
|
8
|
+
Scan proposed changes, generated content, or referenced artifacts for fabricated URLs, placeholder IDs, nonexistent file paths, and unverified references. Run this before committing, publishing, or acting on generated content.
|
|
9
|
+
|
|
10
|
+
## Usage Examples
|
|
11
|
+
|
|
12
|
+
**Verify current staged changes:**
|
|
13
|
+
```
|
|
14
|
+
/xverify
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
**Verify a specific file:**
|
|
18
|
+
```
|
|
19
|
+
/xverify README.md
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
**Verify generated documentation:**
|
|
23
|
+
```
|
|
24
|
+
/xverify docs/
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
## What Gets Checked
|
|
28
|
+
|
|
29
|
+
### URLs and Endpoints
|
|
30
|
+
- HTTP/HTTPS URLs: attempt to confirm they are plausible (check format, known domains)
|
|
31
|
+
- API endpoints: verify they match project routes or documented APIs
|
|
32
|
+
- Flag common fabrication patterns: `example.com` placeholders, sequential IDs, lorem ipsum domains
|
|
33
|
+
|
|
34
|
+
### File Paths and References
|
|
35
|
+
- Verify referenced file paths exist on disk
|
|
36
|
+
- Check import/require statements resolve to real modules
|
|
37
|
+
- Flag references to deleted or renamed files
|
|
38
|
+
|
|
39
|
+
### IDs and Tokens
|
|
40
|
+
- Flag placeholder patterns: `xxx`, `TODO`, `FIXME`, `your-*-here`, `placeholder`
|
|
41
|
+
- Check for hardcoded test IDs that may not be valid in production
|
|
42
|
+
- Flag UUIDs or IDs that appear fabricated (all zeros, sequential)
|
|
43
|
+
|
|
44
|
+
### Claims and Assertions
|
|
45
|
+
- Cross-check version numbers against package.json or lock files
|
|
46
|
+
- Verify command names match actual available commands
|
|
47
|
+
- Check that referenced environment variables are documented
|
|
48
|
+
|
|
49
|
+
## Output Format
|
|
50
|
+
|
|
51
|
+
For each issue found, report:
|
|
52
|
+
1. **File and line** where the reference appears
|
|
53
|
+
2. **What was found** (the suspicious reference)
|
|
54
|
+
3. **Why it's suspicious** (pattern match or verification failure)
|
|
55
|
+
4. **Suggested fix** (if determinable)
|
|
56
|
+
|
|
57
|
+
## Implementation
|
|
58
|
+
|
|
59
|
+
When invoked:
|
|
60
|
+
|
|
61
|
+
1. **Determine scope**: If a file or directory argument is provided, scan that. Otherwise scan staged git changes (`git diff --cached`), or if nothing is staged, scan recent modifications.
|
|
62
|
+
|
|
63
|
+
2. **Extract references**: Parse the scoped content for:
|
|
64
|
+
- URLs (http/https links)
|
|
65
|
+
- File paths (relative and absolute)
|
|
66
|
+
- Import/require statements
|
|
67
|
+
- Version strings
|
|
68
|
+
- Environment variable references
|
|
69
|
+
- Command names with `/x` prefix
|
|
70
|
+
|
|
71
|
+
3. **Verify each reference**:
|
|
72
|
+
- File paths: check `fs.existsSync` or equivalent
|
|
73
|
+
- URLs: validate format, flag known placeholder domains
|
|
74
|
+
- Versions: cross-check against package.json
|
|
75
|
+
- Commands: cross-check against slash-commands/active/ and experiments/
|
|
76
|
+
- Env vars: check against .env.example or documentation
|
|
77
|
+
|
|
78
|
+
4. **Report findings**: Group by severity (error, warning, info) and output a summary table.
|
|
79
|
+
|
|
80
|
+
5. **Exit cleanly**: This is a read-only verification. No files are modified.
|