claude-cli-advanced-starter-pack 1.1.0 → 1.8.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 (56) hide show
  1. package/OVERVIEW.md +5 -1
  2. package/README.md +241 -132
  3. package/bin/gtask.js +53 -0
  4. package/package.json +1 -1
  5. package/src/cli/menu.js +27 -0
  6. package/src/commands/explore-mcp/mcp-registry.js +99 -0
  7. package/src/commands/init.js +339 -351
  8. package/src/commands/install-panel-hook.js +108 -0
  9. package/src/commands/install-scripts.js +232 -0
  10. package/src/commands/install-skill.js +220 -0
  11. package/src/commands/panel.js +297 -0
  12. package/src/commands/setup-wizard.js +4 -3
  13. package/src/commands/test-setup.js +4 -5
  14. package/src/data/releases.json +164 -0
  15. package/src/panel/queue.js +188 -0
  16. package/templates/commands/ask-claude.template.md +118 -0
  17. package/templates/commands/ccasp-panel.template.md +72 -0
  18. package/templates/commands/ccasp-setup.template.md +470 -79
  19. package/templates/commands/create-smoke-test.template.md +186 -0
  20. package/templates/commands/project-impl.template.md +9 -113
  21. package/templates/commands/refactor-check.template.md +112 -0
  22. package/templates/commands/refactor-cleanup.template.md +144 -0
  23. package/templates/commands/refactor-prep.template.md +192 -0
  24. package/templates/docs/AI_ARCHITECTURE_CONSTITUTION.template.md +198 -0
  25. package/templates/docs/DETAILED_GOTCHAS.template.md +347 -0
  26. package/templates/docs/PHASE-DEV-CHECKLIST.template.md +241 -0
  27. package/templates/docs/PROGRESS_JSON_TEMPLATE.json +117 -0
  28. package/templates/docs/background-agent.template.md +264 -0
  29. package/templates/hooks/autonomous-decision-logger.template.js +207 -0
  30. package/templates/hooks/branch-merge-checker.template.js +272 -0
  31. package/templates/hooks/git-commit-tracker.template.js +267 -0
  32. package/templates/hooks/issue-completion-detector.template.js +205 -0
  33. package/templates/hooks/panel-queue-reader.template.js +83 -0
  34. package/templates/hooks/phase-validation-gates.template.js +307 -0
  35. package/templates/hooks/session-id-generator.template.js +236 -0
  36. package/templates/hooks/token-usage-monitor.template.js +193 -0
  37. package/templates/patterns/README.md +129 -0
  38. package/templates/patterns/l1-l2-orchestration.md +189 -0
  39. package/templates/patterns/multi-phase-orchestration.md +258 -0
  40. package/templates/patterns/two-tier-query-pipeline.md +192 -0
  41. package/templates/scripts/README.md +109 -0
  42. package/templates/scripts/analyze-delegation-log.js +299 -0
  43. package/templates/scripts/autonomous-decision-logger.js +277 -0
  44. package/templates/scripts/git-history-analyzer.py +269 -0
  45. package/templates/scripts/phase-validation-gates.js +307 -0
  46. package/templates/scripts/poll-deployment-status.js +260 -0
  47. package/templates/scripts/roadmap-scanner.js +263 -0
  48. package/templates/scripts/validate-deployment.js +293 -0
  49. package/templates/skills/agent-creator/skill.json +18 -0
  50. package/templates/skills/agent-creator/skill.md +335 -0
  51. package/templates/skills/hook-creator/skill.json +18 -0
  52. package/templates/skills/hook-creator/skill.md +318 -0
  53. package/templates/skills/panel/skill.json +18 -0
  54. package/templates/skills/panel/skill.md +90 -0
  55. package/templates/skills/rag-agent-creator/skill.json +18 -0
  56. package/templates/skills/rag-agent-creator/skill.md +307 -0
@@ -0,0 +1,318 @@
1
+ ---
2
+ name: hook-creator
3
+ description: Create Claude Code CLI hooks following best practices - proper JSON schema, event types, matchers, error handling, and file organization
4
+ ---
5
+
6
+ # Hook Creator Skill
7
+
8
+ Expert-level Claude Code hook creation following official Anthropic best practices.
9
+
10
+ ## When to Use This Skill
11
+
12
+ This skill is automatically invoked when:
13
+
14
+ - Creating new hooks for Claude Code CLI
15
+ - Modifying existing hook configurations
16
+ - Writing hook scripts (JS, Python, PowerShell)
17
+ - Configuring hook matchers and event types
18
+
19
+ ## Hook Architecture Overview
20
+
21
+ ### Configuration Files (Priority Order)
22
+
23
+ 1. `~/.claude/settings.json` - Global user settings (all projects)
24
+ 2. `.claude/settings.json` - Project settings (checked into git)
25
+ 3. `.claude/settings.local.json` - Local overrides (gitignored)
26
+
27
+ ### Hook Directory Structure
28
+
29
+ ```
30
+ .claude/
31
+ settings.local.json # Hook configurations (JSON)
32
+ hooks/
33
+ README.md # Hook system documentation
34
+ lifecycle/ # SessionStart, SessionEnd, Stop hooks
35
+ README.md
36
+ session-start.js
37
+ tools/ # PreToolUse, PostToolUse hooks
38
+ README.md
39
+ validate-files.js
40
+ notifications/ # Notification hooks
41
+ README.md
42
+ alert-handler.js
43
+ security/ # Security-focused hooks
44
+ README.md
45
+ block-dangerous-ops.js
46
+ ```
47
+
48
+ ## Supported Hook Events
49
+
50
+ | Event | Trigger | Can Block | Primary Use Cases |
51
+ |-------|---------|-----------|-------------------|
52
+ | `SessionStart` | Session begins | No | Setup, notifications, load context |
53
+ | `SessionEnd` | Session ends | No | Cleanup, save state |
54
+ | `Stop` | Claude stops responding | No | Notifications, state saving |
55
+ | `PreToolUse` | Before tool executes | **Yes** | Security gates, input validation |
56
+ | `PostToolUse` | After tool completes | No | Logging, validation, sync |
57
+ | `Notification` | Attention needed | No | Custom alerts, sounds |
58
+ | `UserPromptSubmit` | Before prompt processes | **Yes** | Input validation |
59
+ | `SubagentStop` | Subagent completes | No | Aggregate results |
60
+ | `PreCompact` | Before transcript compaction | No | Archive, cleanup |
61
+ | `PermissionRequest` | Permission dialog shown | No | Custom handling |
62
+
63
+ ## JSON Configuration Schema
64
+
65
+ ### Basic Hook Configuration
66
+
67
+ ```json
68
+ {
69
+ "hooks": {
70
+ "EventType": [
71
+ {
72
+ "matcher": "pattern",
73
+ "hooks": [
74
+ {
75
+ "type": "command",
76
+ "command": "your-command-here",
77
+ "timeout": 60
78
+ }
79
+ ]
80
+ }
81
+ ]
82
+ }
83
+ }
84
+ ```
85
+
86
+ ### Configuration Fields
87
+
88
+ | Field | Required | Type | Description |
89
+ |-------|----------|------|-------------|
90
+ | `matcher` | No | string (regex) | Filter which tools/events trigger hook |
91
+ | `hooks` | Yes | array | List of hook commands to execute |
92
+ | `type` | Yes | `"command"` or `"prompt"` | Hook execution type |
93
+ | `command` | For type:command | string | Shell command to execute |
94
+ | `timeout` | No | number | Seconds before timeout (default: 60) |
95
+
96
+ ### Matcher Patterns
97
+
98
+ ```json
99
+ // Single tool
100
+ "matcher": "Write"
101
+
102
+ // Multiple tools (regex OR)
103
+ "matcher": "Write|Edit|MultiEdit"
104
+
105
+ // MCP namespace
106
+ "matcher": "mcp__browserbase__.*"
107
+
108
+ // Specific MCP tool
109
+ "matcher": "mcp__browserbase__browserbase_stagehand_act"
110
+
111
+ // No matcher = all tools
112
+ // Just omit the matcher field
113
+ ```
114
+
115
+ ## Hook Input/Output
116
+
117
+ ### Environment Variables (Available to Hooks)
118
+
119
+ | Variable | Description |
120
+ |----------|-------------|
121
+ | `CLAUDE_HOOK_INPUT` | JSON string of tool input |
122
+ | `CLAUDE_TOOL_NAME` | Name of tool being called |
123
+ | `CLAUDE_SESSION_ID` | Unique session identifier |
124
+ | `CLAUDE_PROJECT_PATH` | Path to project root |
125
+ | `CLAUDE_PERMISSION_MODE` | Current permission mode |
126
+
127
+ ### Hook Output Format
128
+
129
+ ```json
130
+ {
131
+ "decision": "approve", // "approve", "block", or "ask"
132
+ "reason": "Optional explanation",
133
+ "systemMessage": "Warning to show user",
134
+ "updatedInput": {} // Modified tool input
135
+ }
136
+ ```
137
+
138
+ ### Exit Codes
139
+
140
+ | Code | Meaning | Behavior |
141
+ |------|---------|----------|
142
+ | 0 | Success | Allow action to proceed |
143
+ | 2 | Blocking error | Block action, show stderr to Claude |
144
+ | Other | Non-blocking error | Show stderr to user, allow action |
145
+ | Timeout | >60s (default) | Kill process, use default behavior |
146
+
147
+ ## Hook Templates
148
+
149
+ ### Template: JavaScript Tool Hook
150
+
151
+ ```javascript
152
+ #!/usr/bin/env node
153
+
154
+ /**
155
+ * Hook Name: [Description]
156
+ * Event: PreToolUse | PostToolUse
157
+ * Trigger: When [condition]
158
+ * Purpose: [What this hook accomplishes]
159
+ */
160
+
161
+ const fs = require('fs');
162
+ const path = require('path');
163
+
164
+ // Parse hook input from environment
165
+ const hookInput = JSON.parse(process.env.CLAUDE_HOOK_INPUT || '{}');
166
+ const toolName = process.env.CLAUDE_TOOL_NAME || '';
167
+ const projectPath = process.env.CLAUDE_PROJECT_PATH || process.cwd();
168
+
169
+ async function main() {
170
+ try {
171
+ // Your validation/processing logic here
172
+ const shouldBlock = false; // Set based on your logic
173
+
174
+ if (shouldBlock) {
175
+ console.error('Blocked: [reason]');
176
+ process.exit(2); // Exit code 2 = blocking error
177
+ }
178
+
179
+ // Success - allow action
180
+ console.log(JSON.stringify({
181
+ decision: 'approve',
182
+ reason: 'Validation passed'
183
+ }));
184
+ process.exit(0);
185
+
186
+ } catch (error) {
187
+ // CRITICAL: Always default to allowing on error
188
+ console.error('Hook error:', error.message);
189
+ console.log(JSON.stringify({
190
+ decision: 'approve',
191
+ reason: `Error in hook: ${error.message}`
192
+ }));
193
+ process.exit(0);
194
+ }
195
+ }
196
+
197
+ main();
198
+ ```
199
+
200
+ ### Template: Python Security Hook
201
+
202
+ ```python
203
+ #!/usr/bin/env python3
204
+ """
205
+ Hook Name: [Description]
206
+ Event: PreToolUse
207
+ Trigger: Write|Edit|Bash
208
+ Purpose: Block dangerous operations
209
+ """
210
+
211
+ import json
212
+ import os
213
+ import sys
214
+
215
+ # Parse hook input
216
+ try:
217
+ hook_input = json.loads(os.environ.get('CLAUDE_HOOK_INPUT', '{}'))
218
+ tool_name = os.environ.get('CLAUDE_TOOL_NAME', '')
219
+ project_path = os.environ.get('CLAUDE_PROJECT_PATH', os.getcwd())
220
+ except json.JSONDecodeError:
221
+ hook_input = {}
222
+ tool_name = ''
223
+ project_path = os.getcwd()
224
+
225
+ # Dangerous patterns to block
226
+ DANGEROUS_PATTERNS = [
227
+ '.env',
228
+ 'secrets/',
229
+ 'credentials',
230
+ 'private_key',
231
+ ]
232
+
233
+ def is_dangerous(file_path: str) -> bool:
234
+ """Check if file path matches dangerous patterns."""
235
+ return any(pattern in file_path.lower() for pattern in DANGEROUS_PATTERNS)
236
+
237
+ def main():
238
+ try:
239
+ file_path = hook_input.get('file_path', '')
240
+
241
+ if is_dangerous(file_path):
242
+ sys.stderr.write(f"Blocked: Dangerous file pattern detected: {file_path}\n")
243
+ sys.exit(2) # Exit 2 = blocking error
244
+
245
+ print(json.dumps({
246
+ 'decision': 'approve',
247
+ 'reason': 'File path validated'
248
+ }))
249
+ sys.exit(0)
250
+
251
+ except Exception as e:
252
+ # CRITICAL: Default to allowing on error
253
+ sys.stderr.write(f"Hook error: {str(e)}\n")
254
+ print(json.dumps({
255
+ 'decision': 'approve',
256
+ 'reason': f'Error in hook: {str(e)}'
257
+ }))
258
+ sys.exit(0)
259
+
260
+ if __name__ == '__main__':
261
+ main()
262
+ ```
263
+
264
+ ## Best Practices
265
+
266
+ ### Performance
267
+
268
+ 1. **Keep hooks fast** - Target <5 seconds execution
269
+ 2. **Use timeouts** - Set appropriate timeouts for longer operations
270
+ 3. **Async when possible** - Background non-critical work
271
+ 4. **Minimize I/O** - Cache frequently accessed data
272
+
273
+ ### Security
274
+
275
+ 1. **Quote variables** - Prevent command injection
276
+ 2. **Validate inputs** - Never trust hook input blindly
277
+ 3. **Scope credentials** - Hooks run with your full environment
278
+ 4. **Block sensitive files** - Use PreToolUse to protect secrets
279
+
280
+ ### Error Handling
281
+
282
+ 1. **Always default to `approve`** - Don't block on hook errors
283
+ 2. **Log errors** - Write to stderr for debugging
284
+ 3. **Graceful degradation** - Hooks should fail safely
285
+ 4. **Test locally** - Verify hooks before deploying
286
+
287
+ ### Organization
288
+
289
+ 1. **Use subdirectories** - Group hooks by purpose
290
+ 2. **Document everything** - README.md in each directory
291
+ 3. **Consistent naming** - `{purpose}-{action}-hook.{ext}`
292
+ 4. **Version control** - Track hook changes in git
293
+
294
+ ## Workflows
295
+
296
+ ### Creating a New Hook
297
+
298
+ 1. **Determine event type** - Which lifecycle event triggers your hook?
299
+ 2. **Design matcher** - What tools/actions should trigger it?
300
+ 3. **Choose language** - JS for complex logic, Python for security
301
+ 4. **Write hook script** - Use templates above
302
+ 5. **Configure in settings** - Add to `.claude/settings.local.json`
303
+ 6. **Document** - Update README.md in appropriate directory
304
+ 7. **Test locally** - Run hook manually before enabling
305
+
306
+ ### Modifying Existing Hooks
307
+
308
+ 1. **Review current config** - Check `.claude/settings.local.json`
309
+ 2. **Understand impact** - What tools/events are affected?
310
+ 3. **Make changes** - Update configuration or hook script
311
+ 4. **Test thoroughly** - Verify both success and error paths
312
+ 5. **Update documentation** - Keep README.md current
313
+
314
+ ## References
315
+
316
+ - Official Docs: https://docs.anthropic.com/en/docs/claude-code/hooks
317
+ - Project Hooks: `.claude/hooks/README.md`
318
+ - Settings: `.claude/settings.local.json`
@@ -0,0 +1,18 @@
1
+ {
2
+ "name": "panel",
3
+ "version": "1.0.0",
4
+ "description": "Launch CCASP Control Panel in a new terminal window",
5
+ "category": "utility",
6
+ "portability": 100,
7
+ "features": [
8
+ "Launch control panel in separate terminal",
9
+ "Cross-platform support (Windows/macOS/Linux)",
10
+ "Queue-based command injection",
11
+ "Single-key command selection"
12
+ ],
13
+ "entryPoint": "skill.md",
14
+ "context": [],
15
+ "workflows": [],
16
+ "requiredTools": ["Bash"],
17
+ "suggestedModel": "haiku"
18
+ }
@@ -0,0 +1,90 @@
1
+ # CCASP Control Panel
2
+
3
+ Launch the CCASP Control Panel in a new terminal window for persistent command access.
4
+
5
+ ## Instructions for Claude
6
+
7
+ **EXECUTE IMMEDIATELY**: Launch the panel in a new terminal window using the appropriate command for the detected platform.
8
+
9
+ ### Platform Detection
10
+
11
+ Check the platform and run the appropriate command:
12
+
13
+ **Windows** (default - check for `COMSPEC` or `windir` environment variable):
14
+ ```bash
15
+ start powershell -NoExit -Command "ccasp panel"
16
+ ```
17
+
18
+ **macOS** (check for `TERM_PROGRAM=Apple_Terminal` or Darwin):
19
+ ```bash
20
+ osascript -e 'tell application "Terminal" to do script "ccasp panel"'
21
+ ```
22
+
23
+ **Linux** (gnome-terminal):
24
+ ```bash
25
+ gnome-terminal -- ccasp panel &
26
+ ```
27
+
28
+ ### After Launch
29
+
30
+ Display this confirmation:
31
+
32
+ ```
33
+ ✅ CCASP Control Panel launched in a new terminal window!
34
+
35
+ ┌─────────────────────────────────────────────────────────────────┐
36
+ │ CCASP Control Panel (NEW WINDOW) │
37
+ ├─────────────────────────────────────────────────────────────────┤
38
+ │ │
39
+ │ Agents & Skills: │
40
+ │ [A] Create Agent [H] Create Hook [S] Create Skill │
41
+ │ [M] Explore MCP [C] Claude Audit [E] Explore Code │
42
+ │ │
43
+ │ Quick Actions: │
44
+ │ [P] Phase Dev Plan [G] GitHub Task [T] Run E2E Tests │
45
+ │ [U] Update Check │
46
+ │ │
47
+ │ Controls: │
48
+ │ [Q] Quit [R] Refresh [X] Clear Queue [?] Help │
49
+ │ │
50
+ └─────────────────────────────────────────────────────────────────┘
51
+
52
+ How to use:
53
+ 1. Switch to the new terminal window with the panel
54
+ 2. Press a single key to select a command (e.g., 'A' for Create Agent)
55
+ 3. Return to this Claude Code session
56
+ 4. Press Enter on an empty prompt - the command will execute automatically
57
+
58
+ Note: If commands don't auto-execute, run: ccasp install-panel-hook --global
59
+ ```
60
+
61
+ ### First-Time Setup
62
+
63
+ If the user hasn't used the panel before, also mention:
64
+
65
+ ```
66
+ First time using the panel? Install the hook for auto-execution:
67
+ ccasp install-panel-hook --global
68
+
69
+ Then restart Claude Code CLI for the hook to take effect.
70
+ ```
71
+
72
+ ## How It Works
73
+
74
+ ```
75
+ ┌─────────────────────────────────────────────────────────────────┐
76
+ │ Panel (NEW terminal) │ Claude Code (THIS terminal) │
77
+ ├───────────────────────────────┼─────────────────────────────────┤
78
+ │ User presses 'A' │ │
79
+ │ ↓ │ │
80
+ │ Queue: /create-agent │ │
81
+ │ ↓ │ │
82
+ │ │ User presses Enter │
83
+ │ │ ↓ │
84
+ │ │ Hook reads queue │
85
+ │ │ ↓ │
86
+ │ │ Executes /create-agent │
87
+ └───────────────────────────────┴─────────────────────────────────┘
88
+
89
+ Queue file: ~/.claude/ccasp-panel/command-queue.json
90
+ ```
@@ -0,0 +1,18 @@
1
+ {
2
+ "name": "rag-agent-creator",
3
+ "version": "1.0.0",
4
+ "description": "Create RAG-enhanced Claude Code agents with knowledge bases",
5
+ "category": "development",
6
+ "portability": 100,
7
+ "features": [
8
+ "Knowledge base design",
9
+ "Retrieval strategies",
10
+ "Context organization",
11
+ "Protocol-based workflows"
12
+ ],
13
+ "entryPoint": "skill.md",
14
+ "context": [],
15
+ "workflows": [],
16
+ "requiredTools": ["Read", "Write", "Glob", "Grep"],
17
+ "suggestedModel": "sonnet"
18
+ }