claude-code-pilot 3.1.1 → 3.3.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.
- package/CHANGELOG.md +57 -0
- package/README.md +16 -11
- package/bin/install.js +127 -11
- package/manifest.json +20 -1
- package/package.json +4 -3
- package/src/agents/a11y-architect.md +141 -0
- package/src/agents/code-architect.md +71 -0
- package/src/agents/code-explorer.md +69 -0
- package/src/agents/code-simplifier.md +47 -0
- package/src/agents/comment-analyzer.md +45 -0
- package/src/agents/csharp-reviewer.md +101 -0
- package/src/agents/dart-build-resolver.md +201 -0
- package/src/agents/django-build-resolver.md +252 -0
- package/src/agents/django-reviewer.md +169 -0
- package/src/agents/fastapi-reviewer.md +79 -0
- package/src/agents/fsharp-reviewer.md +109 -0
- package/src/agents/pr-test-analyzer.md +45 -0
- package/src/agents/silent-failure-hunter.md +50 -0
- package/src/agents/swift-build-resolver.md +170 -0
- package/src/agents/swift-reviewer.md +116 -0
- package/src/agents/type-design-analyzer.md +41 -0
- package/src/available-rules/README.md +3 -1
- package/src/available-rules/dart/coding-style.md +159 -0
- package/src/available-rules/dart/hooks.md +66 -0
- package/src/available-rules/dart/patterns.md +261 -0
- package/src/available-rules/dart/security.md +135 -0
- package/src/available-rules/dart/testing.md +215 -0
- package/src/available-rules/web/coding-style.md +105 -0
- package/src/available-rules/web/design-quality.md +72 -0
- package/src/available-rules/web/hooks.md +129 -0
- package/src/available-rules/web/patterns.md +88 -0
- package/src/available-rules/web/performance.md +73 -0
- package/src/available-rules/web/security.md +66 -0
- package/src/available-rules/web/testing.md +64 -0
- package/src/commands/ccp/ai-integration-phase.md +36 -0
- package/src/commands/ccp/audit-fix.md +33 -0
- package/src/commands/ccp/code-review-fix.md +52 -0
- package/src/commands/ccp/cost-report.md +107 -0
- package/src/commands/ccp/eval-review.md +32 -0
- package/src/commands/ccp/extract_learnings.md +22 -0
- package/src/commands/ccp/import.md +37 -0
- package/src/commands/ccp/ingest-docs.md +42 -0
- package/src/commands/ccp/intel.md +179 -0
- package/src/commands/ccp/mvp-phase.md +45 -0
- package/src/commands/ccp/plan-prd.md +160 -0
- package/src/commands/ccp/plan-review-convergence.md +58 -0
- package/src/commands/ccp/pr-ecc.md +184 -0
- package/src/commands/ccp/scan.md +26 -0
- package/src/commands/ccp/security-scan.md +74 -0
- package/src/commands/ccp/sketch-wrap-up.md +31 -0
- package/src/commands/ccp/sketch.md +54 -0
- package/src/commands/ccp/spec-phase.md +62 -0
- package/src/commands/ccp/spike-wrap-up.md +31 -0
- package/src/commands/ccp/spike.md +51 -0
- package/src/commands/ccp/ultraplan-phase.md +33 -0
- package/src/hooks/ccp-bash-hook-dispatcher.js +96 -0
- package/src/hooks/ccp-context-monitor.js +23 -0
- package/src/hooks/ccp-doc-file-warning.js +93 -0
- package/src/hooks/ccp-pre-bash-dispatcher.js +24 -0
- package/src/hooks/ccp-read-injection-scanner.js +152 -0
- package/src/hooks/ccp-write-gateguard.js +868 -0
- package/src/hooks/kit-check-update.js +59 -7
- package/src/hooks/run-with-flags-shell.sh +1 -0
- package/src/hooks/run-with-flags.js +48 -1
- package/src/hooks/session-end.js +88 -1
- package/src/lib/hook-flags.js +14 -0
- package/src/lib/project-detect.js +0 -2
- package/src/lib/shell-substitution.js +499 -0
- package/src/pilot/references/agent-contracts.md +79 -0
- package/src/pilot/references/ai-evals.md +156 -0
- package/src/pilot/references/ai-frameworks.md +186 -0
- package/src/pilot/references/doc-conflict-engine.md +91 -0
- package/src/pilot/references/execute-mvp-tdd.md +81 -0
- package/src/pilot/references/gate-prompts.md +100 -0
- package/src/pilot/references/gates.md +70 -0
- package/src/pilot/references/mandatory-initial-read.md +2 -0
- package/src/pilot/references/mvp-concepts.md +49 -0
- package/src/pilot/references/planner-graphify-auto-update.md +67 -0
- package/src/pilot/references/planner-human-verify-mode.md +57 -0
- package/src/pilot/references/planner-mvp-mode.md +53 -0
- package/src/pilot/references/project-skills-discovery.md +19 -0
- package/src/pilot/references/revision-loop.md +97 -0
- package/src/pilot/references/skeleton-template.md +48 -0
- package/src/pilot/references/sketch-interactivity.md +41 -0
- package/src/pilot/references/sketch-theme-system.md +94 -0
- package/src/pilot/references/sketch-tooling.md +45 -0
- package/src/pilot/references/sketch-variant-patterns.md +81 -0
- package/src/pilot/references/spidr-splitting.md +69 -0
- package/src/pilot/references/thinking-models-debug.md +44 -0
- package/src/pilot/references/thinking-models-execution.md +50 -0
- package/src/pilot/references/thinking-models-planning.md +62 -0
- package/src/pilot/references/thinking-models-research.md +50 -0
- package/src/pilot/references/thinking-models-verification.md +55 -0
- package/src/pilot/references/user-story-template.md +58 -0
- package/src/pilot/references/verify-mvp-mode.md +85 -0
- package/src/pilot/references/worktree-path-safety.md +89 -0
- package/src/pilot/templates/AI-SPEC.md +246 -0
- package/src/pilot/templates/spec.md +307 -0
- package/src/pilot/workflows/ai-integration-phase.md +284 -0
- package/src/pilot/workflows/audit-fix.md +175 -0
- package/src/pilot/workflows/code-review-fix.md +497 -0
- package/src/pilot/workflows/eval-review.md +155 -0
- package/src/pilot/workflows/extract_learnings.md +242 -0
- package/src/pilot/workflows/help.md +5 -0
- package/src/pilot/workflows/import.md +246 -0
- package/src/pilot/workflows/ingest-docs.md +328 -0
- package/src/pilot/workflows/mvp-phase.md +199 -0
- package/src/pilot/workflows/plan-review-convergence.md +329 -0
- package/src/pilot/workflows/scan.md +102 -0
- package/src/pilot/workflows/sketch-wrap-up.md +285 -0
- package/src/pilot/workflows/sketch.md +360 -0
- package/src/pilot/workflows/spec-phase.md +262 -0
- package/src/pilot/workflows/spike-wrap-up.md +306 -0
- package/src/pilot/workflows/spike.md +452 -0
- package/src/pilot/workflows/ultraplan-phase.md +189 -0
- package/src/skills/accessibility/SKILL.md +146 -0
- package/src/skills/agent-architecture-audit/SKILL.md +256 -0
- package/src/skills/agent-eval/SKILL.md +145 -0
- package/src/skills/agent-harness-design/SKILL.md +73 -0
- package/src/skills/agent-introspection-debugging/SKILL.md +153 -0
- package/src/skills/android-clean-architecture/SKILL.md +339 -0
- package/src/skills/angular-developer/SKILL.md +154 -0
- package/src/skills/angular-developer/references/angular-animations.md +160 -0
- package/src/skills/angular-developer/references/angular-aria.md +410 -0
- package/src/skills/angular-developer/references/cli.md +86 -0
- package/src/skills/angular-developer/references/component-harnesses.md +59 -0
- package/src/skills/angular-developer/references/component-styling.md +91 -0
- package/src/skills/angular-developer/references/components.md +117 -0
- package/src/skills/angular-developer/references/creating-services.md +97 -0
- package/src/skills/angular-developer/references/data-resolvers.md +69 -0
- package/src/skills/angular-developer/references/define-routes.md +67 -0
- package/src/skills/angular-developer/references/defining-providers.md +72 -0
- package/src/skills/angular-developer/references/di-fundamentals.md +120 -0
- package/src/skills/angular-developer/references/e2e-testing.md +56 -0
- package/src/skills/angular-developer/references/effects.md +83 -0
- package/src/skills/angular-developer/references/hierarchical-injectors.md +43 -0
- package/src/skills/angular-developer/references/host-elements.md +80 -0
- package/src/skills/angular-developer/references/injection-context.md +63 -0
- package/src/skills/angular-developer/references/inputs.md +101 -0
- package/src/skills/angular-developer/references/linked-signal.md +59 -0
- package/src/skills/angular-developer/references/loading-strategies.md +61 -0
- package/src/skills/angular-developer/references/mcp.md +108 -0
- package/src/skills/angular-developer/references/navigate-to-routes.md +69 -0
- package/src/skills/angular-developer/references/outputs.md +86 -0
- package/src/skills/angular-developer/references/reactive-forms.md +122 -0
- package/src/skills/angular-developer/references/rendering-strategies.md +44 -0
- package/src/skills/angular-developer/references/resource.md +77 -0
- package/src/skills/angular-developer/references/route-animations.md +56 -0
- package/src/skills/angular-developer/references/route-guards.md +52 -0
- package/src/skills/angular-developer/references/router-lifecycle.md +45 -0
- package/src/skills/angular-developer/references/router-testing.md +87 -0
- package/src/skills/angular-developer/references/show-routes-with-outlets.md +68 -0
- package/src/skills/angular-developer/references/signal-forms.md +795 -0
- package/src/skills/angular-developer/references/signals-overview.md +94 -0
- package/src/skills/angular-developer/references/tailwind-css.md +69 -0
- package/src/skills/angular-developer/references/template-driven-forms.md +114 -0
- package/src/skills/angular-developer/references/testing-fundamentals.md +65 -0
- package/src/skills/api-connector-builder/SKILL.md +120 -0
- package/src/skills/code-tour/SKILL.md +236 -0
- package/src/skills/compose-multiplatform-patterns/SKILL.md +299 -0
- package/src/skills/csharp-testing/SKILL.md +321 -0
- package/src/skills/dart-flutter-patterns/SKILL.md +563 -0
- package/src/skills/dashboard-builder/SKILL.md +108 -0
- package/src/skills/dotnet-patterns/SKILL.md +321 -0
- package/src/skills/error-handling/SKILL.md +376 -0
- package/src/skills/fastapi-patterns/SKILL.md +327 -0
- package/src/skills/flox-environments/SKILL.md +496 -0
- package/src/skills/frontend-design/SKILL.md +145 -0
- package/src/skills/frontend-slides/SKILL.md +184 -0
- package/src/skills/frontend-slides/STYLE_PRESETS.md +330 -0
- package/src/skills/fsharp-testing/SKILL.md +280 -0
- package/src/skills/gateguard/SKILL.md +121 -0
- package/src/skills/github-ops/SKILL.md +144 -0
- package/src/skills/hookify-rules/SKILL.md +128 -0
- package/src/skills/ios-icon-gen/SKILL.md +157 -0
- package/src/skills/ios-icon-gen/scripts/generate_icons.swift +258 -0
- package/src/skills/ios-icon-gen/scripts/iconify_gen.sh +235 -0
- package/src/skills/knowledge-ops/SKILL.md +154 -0
- package/src/skills/liquid-glass-design/SKILL.md +279 -0
- package/src/skills/make-interfaces-feel-better/SKILL.md +151 -0
- package/src/skills/mysql-patterns/SKILL.md +412 -0
- package/src/skills/nestjs-patterns/SKILL.md +230 -0
- package/src/skills/plan-orchestrate/SKILL.md +220 -0
- package/src/skills/prisma-patterns/SKILL.md +371 -0
- package/src/skills/production-audit/SKILL.md +206 -0
- package/src/skills/security-bounty-hunter/SKILL.md +99 -0
- package/src/skills/security-scan/references/agentshield-policy-exception/candidate-playbook.md +49 -0
- package/src/skills/security-scan/references/agentshield-policy-exception/report.json +35 -0
- package/src/skills/security-scan/references/agentshield-policy-exception/scenario.json +62 -0
- package/src/skills/security-scan/references/agentshield-policy-exception/trace.json +45 -0
- package/src/skills/security-scan/references/agentshield-policy-exception/verifier-result.json +35 -0
- package/src/skills/swift-actor-persistence/SKILL.md +143 -0
- package/src/skills/swift-protocol-di-testing/SKILL.md +190 -0
- package/src/skills/swiftui-patterns/SKILL.md +259 -0
- package/src/skills/terminal-ops/SKILL.md +109 -0
- package/src/skills/ui-demo/SKILL.md +465 -0
- package/src/skills/vite-patterns/SKILL.md +449 -0
- package/src/skills/windows-desktop-e2e/SKILL.md +887 -0
|
@@ -0,0 +1,184 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: "Create a GitHub PR from current branch with unpushed commits — discovers templates, analyzes changes, pushes"
|
|
3
|
+
argument-hint: "[base-branch] (default: main)"
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Create Pull Request
|
|
7
|
+
|
|
8
|
+
**Input**: `$ARGUMENTS` — optional, may contain a base branch name and/or flags (e.g., `--draft`).
|
|
9
|
+
|
|
10
|
+
**Parse `$ARGUMENTS`**:
|
|
11
|
+
- Extract any recognized flags (`--draft`)
|
|
12
|
+
- Treat remaining non-flag text as the base branch name
|
|
13
|
+
- Default base branch to `main` if none specified
|
|
14
|
+
|
|
15
|
+
---
|
|
16
|
+
|
|
17
|
+
## Phase 1 — VALIDATE
|
|
18
|
+
|
|
19
|
+
Check preconditions:
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
git branch --show-current
|
|
23
|
+
git status --short
|
|
24
|
+
git log origin/<base>..HEAD --oneline
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
| Check | Condition | Action if Failed |
|
|
28
|
+
|---|---|---|
|
|
29
|
+
| Not on base branch | Current branch ≠ base | Stop: "Switch to a feature branch first." |
|
|
30
|
+
| Clean working directory | No uncommitted changes | Warn: "You have uncommitted changes. Commit or stash first." |
|
|
31
|
+
| Has commits ahead | `git log origin/<base>..HEAD` not empty | Stop: "No commits ahead of `<base>`. Nothing to PR." |
|
|
32
|
+
| No existing PR | `gh pr list --head <branch> --json number` is empty | Stop: "PR already exists: #<number>. Use `gh pr view <number> --web` to open it." |
|
|
33
|
+
|
|
34
|
+
If all checks pass, proceed.
|
|
35
|
+
|
|
36
|
+
---
|
|
37
|
+
|
|
38
|
+
## Phase 2 — DISCOVER
|
|
39
|
+
|
|
40
|
+
### PR Template
|
|
41
|
+
|
|
42
|
+
Search for PR template in order:
|
|
43
|
+
|
|
44
|
+
1. `.github/PULL_REQUEST_TEMPLATE/` directory — if exists, list files and let user choose (or use `default.md`)
|
|
45
|
+
2. `.github/PULL_REQUEST_TEMPLATE.md`
|
|
46
|
+
3. `.github/pull_request_template.md`
|
|
47
|
+
4. `docs/pull_request_template.md`
|
|
48
|
+
|
|
49
|
+
If found, read it and use its structure for the PR body.
|
|
50
|
+
|
|
51
|
+
### Commit Analysis
|
|
52
|
+
|
|
53
|
+
```bash
|
|
54
|
+
git log origin/<base>..HEAD --format="%h %s" --reverse
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
Analyze commits to determine:
|
|
58
|
+
- **PR title**: Use conventional commit format with type prefix — `feat: ...`, `fix: ...`, etc.
|
|
59
|
+
- If multiple types, use the dominant one
|
|
60
|
+
- If single commit, use its message as-is
|
|
61
|
+
- **Change summary**: Group commits by type/area
|
|
62
|
+
|
|
63
|
+
### File Analysis
|
|
64
|
+
|
|
65
|
+
```bash
|
|
66
|
+
git diff origin/<base>..HEAD --stat
|
|
67
|
+
git diff origin/<base>..HEAD --name-only
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
Categorize changed files: source, tests, docs, config, migrations.
|
|
71
|
+
|
|
72
|
+
### Planning Artifacts
|
|
73
|
+
|
|
74
|
+
Check for related artifacts produced by `/plan-prd`, `/plan`, or the legacy PRP workflow:
|
|
75
|
+
- `.claude/prds/` — PRDs this PR implements a milestone of
|
|
76
|
+
- `.claude/plans/` — Plans executed by this PR
|
|
77
|
+
- `.claude/PRPs/prds/` — legacy PRP PRDs
|
|
78
|
+
- `.claude/PRPs/plans/` — legacy PRP implementation plans
|
|
79
|
+
- `.claude/PRPs/reports/` — legacy PRP implementation reports
|
|
80
|
+
|
|
81
|
+
Reference these in the PR body if they exist.
|
|
82
|
+
|
|
83
|
+
---
|
|
84
|
+
|
|
85
|
+
## Phase 3 — PUSH
|
|
86
|
+
|
|
87
|
+
```bash
|
|
88
|
+
git push -u origin HEAD
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
If push fails due to divergence:
|
|
92
|
+
```bash
|
|
93
|
+
git fetch origin
|
|
94
|
+
git rebase origin/<base>
|
|
95
|
+
git push -u origin HEAD
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
If rebase conflicts occur, stop and inform the user.
|
|
99
|
+
|
|
100
|
+
---
|
|
101
|
+
|
|
102
|
+
## Phase 4 — CREATE
|
|
103
|
+
|
|
104
|
+
### With Template
|
|
105
|
+
|
|
106
|
+
If a PR template was found in Phase 2, fill in each section using the commit and file analysis. Preserve all template sections — leave sections as "N/A" if not applicable rather than removing them.
|
|
107
|
+
|
|
108
|
+
### Without Template
|
|
109
|
+
|
|
110
|
+
Use this default format:
|
|
111
|
+
|
|
112
|
+
```markdown
|
|
113
|
+
## Summary
|
|
114
|
+
|
|
115
|
+
<1-2 sentence description of what this PR does and why>
|
|
116
|
+
|
|
117
|
+
## Changes
|
|
118
|
+
|
|
119
|
+
<bulleted list of changes grouped by area>
|
|
120
|
+
|
|
121
|
+
## Files Changed
|
|
122
|
+
|
|
123
|
+
<table or list of changed files with change type: Added/Modified/Deleted>
|
|
124
|
+
|
|
125
|
+
## Testing
|
|
126
|
+
|
|
127
|
+
<description of how changes were tested, or "Needs testing">
|
|
128
|
+
|
|
129
|
+
## Related Issues
|
|
130
|
+
|
|
131
|
+
<linked issues with Closes/Fixes/Relates to #N, or "None">
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
### Create the PR
|
|
135
|
+
|
|
136
|
+
```bash
|
|
137
|
+
gh pr create \
|
|
138
|
+
--title "<PR title>" \
|
|
139
|
+
--base <base-branch> \
|
|
140
|
+
--body "<PR body>"
|
|
141
|
+
# Add --draft if the --draft flag was parsed from $ARGUMENTS
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
---
|
|
145
|
+
|
|
146
|
+
## Phase 5 — VERIFY
|
|
147
|
+
|
|
148
|
+
```bash
|
|
149
|
+
gh pr view --json number,url,title,state,baseRefName,headRefName,additions,deletions,changedFiles
|
|
150
|
+
gh pr checks --json name,status,conclusion 2>/dev/null || true
|
|
151
|
+
```
|
|
152
|
+
|
|
153
|
+
---
|
|
154
|
+
|
|
155
|
+
## Phase 6 — OUTPUT
|
|
156
|
+
|
|
157
|
+
Report to user:
|
|
158
|
+
|
|
159
|
+
```
|
|
160
|
+
PR #<number>: <title>
|
|
161
|
+
URL: <url>
|
|
162
|
+
Branch: <head> → <base>
|
|
163
|
+
Changes: +<additions> -<deletions> across <changedFiles> files
|
|
164
|
+
|
|
165
|
+
CI Checks: <status summary or "pending" or "none configured">
|
|
166
|
+
|
|
167
|
+
Artifacts referenced:
|
|
168
|
+
- <any PRDs/plans linked in PR body>
|
|
169
|
+
|
|
170
|
+
Next steps:
|
|
171
|
+
- gh pr view <number> --web → open in browser
|
|
172
|
+
- /code-review <number> → review the PR
|
|
173
|
+
- gh pr merge <number> → merge when ready
|
|
174
|
+
```
|
|
175
|
+
|
|
176
|
+
---
|
|
177
|
+
|
|
178
|
+
## Edge Cases
|
|
179
|
+
|
|
180
|
+
- **No `gh` CLI**: Stop with: "GitHub CLI (`gh`) is required. Install: <https://cli.github.com/>"
|
|
181
|
+
- **Not authenticated**: Stop with: "Run `gh auth login` first."
|
|
182
|
+
- **Force push needed**: If remote has diverged and rebase was done, use `git push --force-with-lease` (never `--force`).
|
|
183
|
+
- **Multiple PR templates**: If `.github/PULL_REQUEST_TEMPLATE/` has multiple files, list them and ask user to choose.
|
|
184
|
+
- **Large PR (>20 files)**: Warn about PR size. Suggest splitting if changes are logically separable.
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: ccp:scan
|
|
3
|
+
description: Rapid codebase assessment — lightweight alternative to /ccp:map-codebase
|
|
4
|
+
allowed-tools:
|
|
5
|
+
- Read
|
|
6
|
+
- Write
|
|
7
|
+
- Bash
|
|
8
|
+
- Grep
|
|
9
|
+
- Glob
|
|
10
|
+
- Agent
|
|
11
|
+
- AskUserQuestion
|
|
12
|
+
---
|
|
13
|
+
<objective>
|
|
14
|
+
Run a focused codebase scan for a single area, producing targeted documents in `.planning/codebase/`.
|
|
15
|
+
Accepts an optional `--focus` flag: `tech`, `arch`, `quality`, `concerns`, or `tech+arch` (default).
|
|
16
|
+
|
|
17
|
+
Lightweight alternative to `/ccp:map-codebase` — spawns one mapper agent instead of four parallel ones.
|
|
18
|
+
</objective>
|
|
19
|
+
|
|
20
|
+
<execution_context>
|
|
21
|
+
@~/.claude/pilot/workflows/scan.md
|
|
22
|
+
</execution_context>
|
|
23
|
+
|
|
24
|
+
<process>
|
|
25
|
+
Execute the scan workflow from @~/.claude/pilot/workflows/scan.md end-to-end.
|
|
26
|
+
</process>
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Scan your .claude/ configuration for security issues via AgentShield (external, opt-in via npx).
|
|
3
|
+
argument-hint: [path] [--format json|markdown|html] [--min-severity low|medium|high|critical] [--fix]
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Security Scan
|
|
7
|
+
|
|
8
|
+
Scan a project (agents, hooks, MCP servers, permissions, and secrets) for
|
|
9
|
+
security issues. This command is a thin wrapper around the external
|
|
10
|
+
`ecc-agentshield` scanner: nothing is installed at CCP install time — you opt in
|
|
11
|
+
at run time via `npx`, so the scanner is fetched on demand and never vendored.
|
|
12
|
+
|
|
13
|
+
## Usage
|
|
14
|
+
|
|
15
|
+
`/ccp:security-scan [path] [--format json|markdown|html] [--min-severity low|medium|high|critical] [--fix]`
|
|
16
|
+
|
|
17
|
+
- `path` (optional): defaults to the current project. Use a `.claude/` path, a
|
|
18
|
+
repo root, or a checked-in template directory.
|
|
19
|
+
- `--format`: output format. Use `json` for CI, `markdown` for handoffs, `html`
|
|
20
|
+
for standalone review reports.
|
|
21
|
+
- `--min-severity`: filters lower-priority findings.
|
|
22
|
+
- `--fix`: applies only fixes the scanner explicitly marks safe and auto-fixable.
|
|
23
|
+
|
|
24
|
+
## Deterministic Engine
|
|
25
|
+
|
|
26
|
+
Run the external scanner against the target path:
|
|
27
|
+
|
|
28
|
+
```bash
|
|
29
|
+
npx ecc-agentshield scan --path "${TARGET_PATH:-.}"
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
For a plain-text report instead of the default output:
|
|
33
|
+
|
|
34
|
+
```bash
|
|
35
|
+
npx ecc-agentshield scan --path "${TARGET_PATH:-.}" --format text
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
Use AgentShield output as the source of truth; do not invent findings. Keep
|
|
39
|
+
scanner facts separate from your follow-up judgment.
|
|
40
|
+
|
|
41
|
+
## Remediation
|
|
42
|
+
|
|
43
|
+
For each critical or high finding, return:
|
|
44
|
+
|
|
45
|
+
- file path
|
|
46
|
+
- severity
|
|
47
|
+
- why it matters
|
|
48
|
+
- the exact fix
|
|
49
|
+
- whether `--fix` is safe to apply
|
|
50
|
+
|
|
51
|
+
If `--fix` is requested, state the planned edits before applying them, then
|
|
52
|
+
re-scan and report the before/after grade.
|
|
53
|
+
|
|
54
|
+
## Full Reference
|
|
55
|
+
|
|
56
|
+
The complete CLI surface, output formats, severity grades, and the policy schema
|
|
57
|
+
live in the skill — read it for anything beyond the invocation above:
|
|
58
|
+
|
|
59
|
+
@.claude/skills/security-scan/SKILL.md
|
|
60
|
+
|
|
61
|
+
The policy schema and example documents are under
|
|
62
|
+
`references/agentshield-policy-exception/` within that skill.
|
|
63
|
+
|
|
64
|
+
## Arguments
|
|
65
|
+
|
|
66
|
+
$ARGUMENTS:
|
|
67
|
+
- optional target path
|
|
68
|
+
- optional AgentShield flags (`--format`, `--min-severity`, `--fix`)
|
|
69
|
+
|
|
70
|
+
## Source
|
|
71
|
+
|
|
72
|
+
Thin wrapper for AgentShield (https://github.com/affaan-m/agentshield);
|
|
73
|
+
external, not vendored. Pinned in `manifest.json` under
|
|
74
|
+
`external.agentshield` (1.4.0).
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: ccp:sketch-wrap-up
|
|
3
|
+
description: Package sketch design findings into a persistent project skill for future build conversations
|
|
4
|
+
allowed-tools:
|
|
5
|
+
- Read
|
|
6
|
+
- Write
|
|
7
|
+
- Edit
|
|
8
|
+
- Bash
|
|
9
|
+
- Grep
|
|
10
|
+
- Glob
|
|
11
|
+
- AskUserQuestion
|
|
12
|
+
---
|
|
13
|
+
<objective>
|
|
14
|
+
Curate sketch design findings and package them into a persistent project skill that Claude
|
|
15
|
+
auto-loads when building the real UI. Also writes a summary to `.planning/sketches/` for
|
|
16
|
+
project history. Output skill goes to `./.claude/skills/sketch-findings-[project]/` (project-local).
|
|
17
|
+
</objective>
|
|
18
|
+
|
|
19
|
+
<execution_context>
|
|
20
|
+
@~/.claude/pilot/workflows/sketch-wrap-up.md
|
|
21
|
+
@~/.claude/pilot/references/ui-brand.md
|
|
22
|
+
</execution_context>
|
|
23
|
+
|
|
24
|
+
<runtime_note>
|
|
25
|
+
**Copilot (VS Code):** Use `vscode_askquestions` wherever this workflow calls `AskUserQuestion`.
|
|
26
|
+
</runtime_note>
|
|
27
|
+
|
|
28
|
+
<process>
|
|
29
|
+
Execute the sketch-wrap-up workflow from @~/.claude/pilot/workflows/sketch-wrap-up.md end-to-end.
|
|
30
|
+
Preserve all curation gates (per-sketch review, grouping approval, CLAUDE.md routing line).
|
|
31
|
+
</process>
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: ccp:sketch
|
|
3
|
+
description: Sketch UI/design ideas with throwaway HTML mockups, or propose what to sketch next (frontier mode)
|
|
4
|
+
argument-hint: "[design idea to explore] [--quick] [--text] or [frontier]"
|
|
5
|
+
allowed-tools:
|
|
6
|
+
- Read
|
|
7
|
+
- Write
|
|
8
|
+
- Edit
|
|
9
|
+
- Bash
|
|
10
|
+
- Grep
|
|
11
|
+
- Glob
|
|
12
|
+
- AskUserQuestion
|
|
13
|
+
- WebSearch
|
|
14
|
+
- WebFetch
|
|
15
|
+
- mcp__context7__resolve-library-id
|
|
16
|
+
- mcp__context7__query-docs
|
|
17
|
+
---
|
|
18
|
+
<objective>
|
|
19
|
+
Explore design directions through throwaway HTML mockups before committing to implementation.
|
|
20
|
+
Each sketch produces 2-3 variants for comparison. Sketches live in `.planning/sketches/` and
|
|
21
|
+
integrate with GSD commit patterns, state tracking, and handoff workflows. Loads spike
|
|
22
|
+
findings to ground mockups in real data shapes and validated interaction patterns.
|
|
23
|
+
|
|
24
|
+
Two modes:
|
|
25
|
+
- **Idea mode** (default) — describe a design idea to sketch
|
|
26
|
+
- **Frontier mode** (no argument or "frontier") — analyzes existing sketch landscape and proposes consistency and frontier sketches
|
|
27
|
+
|
|
28
|
+
Does not require `/ccp:new-project` — auto-creates `.planning/sketches/` if needed.
|
|
29
|
+
</objective>
|
|
30
|
+
|
|
31
|
+
<execution_context>
|
|
32
|
+
@~/.claude/pilot/workflows/sketch.md
|
|
33
|
+
@~/.claude/pilot/references/ui-brand.md
|
|
34
|
+
@~/.claude/pilot/references/sketch-theme-system.md
|
|
35
|
+
@~/.claude/pilot/references/sketch-interactivity.md
|
|
36
|
+
@~/.claude/pilot/references/sketch-tooling.md
|
|
37
|
+
@~/.claude/pilot/references/sketch-variant-patterns.md
|
|
38
|
+
</execution_context>
|
|
39
|
+
|
|
40
|
+
<runtime_note>
|
|
41
|
+
**Copilot (VS Code):** Use `vscode_askquestions` wherever this workflow calls `AskUserQuestion`.
|
|
42
|
+
</runtime_note>
|
|
43
|
+
|
|
44
|
+
<context>
|
|
45
|
+
Design idea: $ARGUMENTS
|
|
46
|
+
|
|
47
|
+
**Available flags:**
|
|
48
|
+
- `--quick` — Skip mood/direction intake, jump straight to decomposition and building. Use when the design direction is already clear.
|
|
49
|
+
</context>
|
|
50
|
+
|
|
51
|
+
<process>
|
|
52
|
+
Execute the sketch workflow from @~/.claude/pilot/workflows/sketch.md end-to-end.
|
|
53
|
+
Preserve all workflow gates (intake, decomposition, target stack research, variant evaluation, MANIFEST updates, commit patterns).
|
|
54
|
+
</process>
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: ccp:spec-phase
|
|
3
|
+
description: Socratic spec refinement — clarify WHAT a phase delivers with ambiguity scoring before discuss-phase. Produces a SPEC.md with falsifiable requirements locked before implementation decisions begin.
|
|
4
|
+
argument-hint: "<phase> [--auto] [--text]"
|
|
5
|
+
allowed-tools:
|
|
6
|
+
- Read
|
|
7
|
+
- Write
|
|
8
|
+
- Bash
|
|
9
|
+
- Glob
|
|
10
|
+
- Grep
|
|
11
|
+
- AskUserQuestion
|
|
12
|
+
---
|
|
13
|
+
|
|
14
|
+
<objective>
|
|
15
|
+
Clarify phase requirements through structured Socratic questioning with quantitative ambiguity scoring.
|
|
16
|
+
|
|
17
|
+
**Position in workflow:** `spec-phase → discuss-phase → plan-phase → execute-phase → verify`
|
|
18
|
+
|
|
19
|
+
**How it works:**
|
|
20
|
+
1. Load phase context (PROJECT.md, REQUIREMENTS.md, ROADMAP.md, STATE.md)
|
|
21
|
+
2. Scout the codebase — understand current state before asking questions
|
|
22
|
+
3. Run Socratic interview loop (up to 6 rounds, rotating perspectives)
|
|
23
|
+
4. Score ambiguity across 4 weighted dimensions after each round
|
|
24
|
+
5. Gate: ambiguity ≤ 0.20 AND all dimensions meet minimums → write SPEC.md
|
|
25
|
+
6. Commit SPEC.md — discuss-phase picks it up automatically on next run
|
|
26
|
+
|
|
27
|
+
**Output:** `{phase_dir}/{padded_phase}-SPEC.md` — falsifiable requirements that lock "what/why" before discuss-phase handles "how"
|
|
28
|
+
</objective>
|
|
29
|
+
|
|
30
|
+
<execution_context>
|
|
31
|
+
@~/.claude/pilot/workflows/spec-phase.md
|
|
32
|
+
@~/.claude/pilot/templates/spec.md
|
|
33
|
+
</execution_context>
|
|
34
|
+
|
|
35
|
+
<runtime_note>
|
|
36
|
+
**Copilot (VS Code):** Use `vscode_askquestions` wherever this workflow calls `AskUserQuestion`. They are equivalent.
|
|
37
|
+
</runtime_note>
|
|
38
|
+
|
|
39
|
+
<context>
|
|
40
|
+
Phase number: $ARGUMENTS (required)
|
|
41
|
+
|
|
42
|
+
**Flags:**
|
|
43
|
+
- `--auto` — Skip interactive questions; Claude selects recommended defaults and writes SPEC.md
|
|
44
|
+
- `--text` — Use plain-text numbered lists instead of TUI menus (required for `/rc` remote sessions)
|
|
45
|
+
|
|
46
|
+
Context files are resolved in-workflow using `init phase-op`.
|
|
47
|
+
</context>
|
|
48
|
+
|
|
49
|
+
<process>
|
|
50
|
+
Execute the spec-phase workflow from @~/.claude/pilot/workflows/spec-phase.md end-to-end.
|
|
51
|
+
|
|
52
|
+
**MANDATORY:** Read the workflow file BEFORE taking any action. The workflow contains the complete step-by-step process including the Socratic interview loop, ambiguity scoring gate, and SPEC.md generation. Do not improvise from the objective summary above.
|
|
53
|
+
</process>
|
|
54
|
+
|
|
55
|
+
<success_criteria>
|
|
56
|
+
- Codebase scouted for current state before questioning begins
|
|
57
|
+
- All 4 ambiguity dimensions scored after each interview round
|
|
58
|
+
- Gate passed: ambiguity ≤ 0.20 AND all dimension minimums met
|
|
59
|
+
- SPEC.md written with falsifiable requirements, explicit boundaries, and acceptance criteria
|
|
60
|
+
- SPEC.md committed atomically
|
|
61
|
+
- User knows they can now run /ccp:discuss-phase which will load SPEC.md automatically
|
|
62
|
+
</success_criteria>
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: ccp:spike-wrap-up
|
|
3
|
+
description: Package spike findings into a persistent project skill for future build conversations
|
|
4
|
+
allowed-tools:
|
|
5
|
+
- Read
|
|
6
|
+
- Write
|
|
7
|
+
- Edit
|
|
8
|
+
- Bash
|
|
9
|
+
- Grep
|
|
10
|
+
- Glob
|
|
11
|
+
- AskUserQuestion
|
|
12
|
+
---
|
|
13
|
+
<objective>
|
|
14
|
+
Curate spike experiment findings and package them into a persistent project skill that Claude
|
|
15
|
+
auto-loads in future build conversations. Also writes a summary to `.planning/spikes/` for
|
|
16
|
+
project history. Output skill goes to `./.claude/skills/spike-findings-[project]/` (project-local).
|
|
17
|
+
</objective>
|
|
18
|
+
|
|
19
|
+
<execution_context>
|
|
20
|
+
@~/.claude/pilot/workflows/spike-wrap-up.md
|
|
21
|
+
@~/.claude/pilot/references/ui-brand.md
|
|
22
|
+
</execution_context>
|
|
23
|
+
|
|
24
|
+
<runtime_note>
|
|
25
|
+
**Copilot (VS Code):** Use `vscode_askquestions` wherever this workflow calls `AskUserQuestion`.
|
|
26
|
+
</runtime_note>
|
|
27
|
+
|
|
28
|
+
<process>
|
|
29
|
+
Execute the spike-wrap-up workflow from @~/.claude/pilot/workflows/spike-wrap-up.md end-to-end.
|
|
30
|
+
Preserve all workflow gates (auto-include, feature-area grouping, skill synthesis, CLAUDE.md routing line, intelligent next-step routing).
|
|
31
|
+
</process>
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: ccp:spike
|
|
3
|
+
description: Spike an idea through experiential exploration, or propose what to spike next (frontier mode)
|
|
4
|
+
argument-hint: "[idea to validate] [--quick] [--text] or [frontier]"
|
|
5
|
+
allowed-tools:
|
|
6
|
+
- Read
|
|
7
|
+
- Write
|
|
8
|
+
- Edit
|
|
9
|
+
- Bash
|
|
10
|
+
- Grep
|
|
11
|
+
- Glob
|
|
12
|
+
- AskUserQuestion
|
|
13
|
+
- WebSearch
|
|
14
|
+
- WebFetch
|
|
15
|
+
- mcp__context7__resolve-library-id
|
|
16
|
+
- mcp__context7__query-docs
|
|
17
|
+
---
|
|
18
|
+
<objective>
|
|
19
|
+
Spike an idea through experiential exploration — build focused experiments to feel the pieces
|
|
20
|
+
of a future app, validate feasibility, and produce verified knowledge for the real build.
|
|
21
|
+
Spikes live in `.planning/spikes/` and integrate with GSD commit patterns, state tracking,
|
|
22
|
+
and handoff workflows.
|
|
23
|
+
|
|
24
|
+
Two modes:
|
|
25
|
+
- **Idea mode** (default) — describe an idea to spike
|
|
26
|
+
- **Frontier mode** (no argument or "frontier") — analyzes existing spike landscape and proposes integration and frontier spikes
|
|
27
|
+
|
|
28
|
+
Does not require `/ccp:new-project` — auto-creates `.planning/spikes/` if needed.
|
|
29
|
+
</objective>
|
|
30
|
+
|
|
31
|
+
<execution_context>
|
|
32
|
+
@~/.claude/pilot/workflows/spike.md
|
|
33
|
+
@~/.claude/pilot/references/ui-brand.md
|
|
34
|
+
</execution_context>
|
|
35
|
+
|
|
36
|
+
<runtime_note>
|
|
37
|
+
**Copilot (VS Code):** Use `vscode_askquestions` wherever this workflow calls `AskUserQuestion`.
|
|
38
|
+
</runtime_note>
|
|
39
|
+
|
|
40
|
+
<context>
|
|
41
|
+
Idea: $ARGUMENTS
|
|
42
|
+
|
|
43
|
+
**Available flags:**
|
|
44
|
+
- `--quick` — Skip decomposition/alignment, jump straight to building. Use when you already know what to spike.
|
|
45
|
+
- `--text` — Use plain-text numbered lists instead of AskUserQuestion (for non-Claude runtimes).
|
|
46
|
+
</context>
|
|
47
|
+
|
|
48
|
+
<process>
|
|
49
|
+
Execute the spike workflow from @~/.claude/pilot/workflows/spike.md end-to-end.
|
|
50
|
+
Preserve all workflow gates (prior spike check, decomposition, research, risk ordering, observability assessment, verification, MANIFEST updates, commit patterns).
|
|
51
|
+
</process>
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: ccp:ultraplan-phase
|
|
3
|
+
description: "[BETA] Offload plan phase to Claude Code's ultraplan cloud — drafts remotely while terminal stays free, review in browser with inline comments, import back via /ccp:import. Claude Code only."
|
|
4
|
+
argument-hint: "[phase-number]"
|
|
5
|
+
allowed-tools:
|
|
6
|
+
- Read
|
|
7
|
+
- Bash
|
|
8
|
+
- Glob
|
|
9
|
+
- Grep
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
<objective>
|
|
13
|
+
Offload GSD's plan phase to Claude Code's ultraplan cloud infrastructure.
|
|
14
|
+
|
|
15
|
+
Ultraplan drafts the plan in a remote cloud session while your terminal stays free.
|
|
16
|
+
Review and comment on the plan in your browser, then import it back via /ccp:import --from.
|
|
17
|
+
|
|
18
|
+
⚠ BETA: ultraplan is in research preview. Use /ccp:plan-phase for stable local planning.
|
|
19
|
+
Requirements: Claude Code v2.1.91+, claude.ai account, GitHub repository.
|
|
20
|
+
</objective>
|
|
21
|
+
|
|
22
|
+
<execution_context>
|
|
23
|
+
@~/.claude/pilot/workflows/ultraplan-phase.md
|
|
24
|
+
@~/.claude/pilot/references/ui-brand.md
|
|
25
|
+
</execution_context>
|
|
26
|
+
|
|
27
|
+
<context>
|
|
28
|
+
$ARGUMENTS
|
|
29
|
+
</context>
|
|
30
|
+
|
|
31
|
+
<process>
|
|
32
|
+
Execute the ultraplan-phase workflow end-to-end.
|
|
33
|
+
</process>
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
const { isHookEnabled } = require('../lib/hook-flags');
|
|
5
|
+
|
|
6
|
+
const MAX_STDIN = 1024 * 1024;
|
|
7
|
+
|
|
8
|
+
// GateGuard is the sole pre-bash chain member in CCP's minimal dispatcher.
|
|
9
|
+
// It is lazy-required so this file does NOT hard-depend on the GateGuard hook
|
|
10
|
+
// (ccp-write-gateguard, delivered by Plan 04) landing first. If the module is
|
|
11
|
+
// absent, the member is a no-op that returns rawInput unchanged.
|
|
12
|
+
//
|
|
13
|
+
// NOTE: The upstream tmux / git-push / commit-quality / auto-tmux /
|
|
14
|
+
// block-no-verify members are intentionally NOT ported. Those are external
|
|
15
|
+
// workflow opinions; CCP ships a minimal, profile-gated dispatcher whose only
|
|
16
|
+
// job is the GateGuard Bash branch. The runHooks loop below is preserved as an
|
|
17
|
+
// extensible scaffold so future members can be appended to PRE_BASH_HOOKS.
|
|
18
|
+
let _gateguardRun = null;
|
|
19
|
+
try {
|
|
20
|
+
_gateguardRun = require('./ccp-write-gateguard').run;
|
|
21
|
+
} catch (_) {
|
|
22
|
+
_gateguardRun = null;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
const PRE_BASH_HOOKS = [
|
|
26
|
+
{
|
|
27
|
+
id: 'pre:bash:gateguard-fact-force',
|
|
28
|
+
profiles: 'standard,strict',
|
|
29
|
+
run: rawInput => (_gateguardRun ? _gateguardRun(rawInput) : rawInput),
|
|
30
|
+
},
|
|
31
|
+
];
|
|
32
|
+
|
|
33
|
+
function normalizeHookResult(previousRaw, output) {
|
|
34
|
+
if (typeof output === 'string' || Buffer.isBuffer(output)) {
|
|
35
|
+
return {
|
|
36
|
+
raw: String(output),
|
|
37
|
+
stderr: '',
|
|
38
|
+
exitCode: 0,
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
if (output && typeof output === 'object') {
|
|
43
|
+
const nextRaw = Object.prototype.hasOwnProperty.call(output, 'stdout')
|
|
44
|
+
? String(output.stdout ?? '')
|
|
45
|
+
: !Number.isInteger(output.exitCode) || output.exitCode === 0
|
|
46
|
+
? previousRaw
|
|
47
|
+
: '';
|
|
48
|
+
|
|
49
|
+
return {
|
|
50
|
+
raw: nextRaw,
|
|
51
|
+
stderr: typeof output.stderr === 'string' ? output.stderr : '',
|
|
52
|
+
exitCode: Number.isInteger(output.exitCode) ? output.exitCode : 0,
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
return {
|
|
57
|
+
raw: previousRaw,
|
|
58
|
+
stderr: '',
|
|
59
|
+
exitCode: 0,
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
function runHooks(rawInput, hooks) {
|
|
64
|
+
let currentRaw = rawInput;
|
|
65
|
+
let stderr = '';
|
|
66
|
+
|
|
67
|
+
for (const hook of hooks) {
|
|
68
|
+
if (!isHookEnabled(hook.id, { profiles: hook.profiles })) {
|
|
69
|
+
continue;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
try {
|
|
73
|
+
const result = normalizeHookResult(currentRaw, hook.run(currentRaw));
|
|
74
|
+
currentRaw = result.raw;
|
|
75
|
+
if (result.stderr) {
|
|
76
|
+
stderr += result.stderr.endsWith('\n') ? result.stderr : `${result.stderr}\n`;
|
|
77
|
+
}
|
|
78
|
+
if (result.exitCode !== 0) {
|
|
79
|
+
return { output: currentRaw, stderr, exitCode: result.exitCode };
|
|
80
|
+
}
|
|
81
|
+
} catch (error) {
|
|
82
|
+
stderr += `[Hook] ${hook.id} failed: ${error.message}\n`;
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
return { output: currentRaw, stderr, exitCode: 0 };
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
function runPreBash(rawInput) {
|
|
90
|
+
return runHooks(rawInput, PRE_BASH_HOOKS);
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
module.exports = { PRE_BASH_HOOKS, runPreBash };
|
|
94
|
+
|
|
95
|
+
// MAX_STDIN is exported indirectly for parity with the entrypoint cap.
|
|
96
|
+
module.exports.MAX_STDIN = MAX_STDIN;
|
|
@@ -26,6 +26,21 @@ const CRITICAL_THRESHOLD = 25; // remaining_percentage <= 25%
|
|
|
26
26
|
const STALE_SECONDS = 60; // ignore metrics older than 60s
|
|
27
27
|
const DEBOUNCE_CALLS = 5; // min tool uses between warnings
|
|
28
28
|
|
|
29
|
+
// Cost-warning opt-out (backport of ECC b47dfa95, re-expressed for CCP).
|
|
30
|
+
// Set CCP_CONTEXT_MONITOR_COST_WARNINGS=0 (or false/off/no/disabled) to suppress
|
|
31
|
+
// cost-warning emission. Default ON. CCP's monitor currently emits context
|
|
32
|
+
// warnings only; this gate future-proofs any cost-warning emission point.
|
|
33
|
+
function isEnabledEnv(value, defaultValue = true) {
|
|
34
|
+
if (value == null || String(value).trim() === '') return defaultValue;
|
|
35
|
+
const n = String(value).trim().toLowerCase();
|
|
36
|
+
if (['0', 'false', 'no', 'off', 'disabled'].includes(n)) return false;
|
|
37
|
+
if (['1', 'true', 'yes', 'on', 'enabled'].includes(n)) return true;
|
|
38
|
+
return defaultValue;
|
|
39
|
+
}
|
|
40
|
+
function costWarningsEnabled(env = process.env) {
|
|
41
|
+
return isEnabledEnv(env.CCP_CONTEXT_MONITOR_COST_WARNINGS, true); // CCP-branded rename of the upstream cost-warning opt-out (b47dfa95)
|
|
42
|
+
}
|
|
43
|
+
|
|
29
44
|
let input = '';
|
|
30
45
|
// Timeout guard: if stdin doesn't close within 3s (e.g. pipe issues on
|
|
31
46
|
// Windows/Git Bash), exit silently instead of hanging until Claude Code
|
|
@@ -134,6 +149,14 @@ process.stdin.on('end', () => {
|
|
|
134
149
|
};
|
|
135
150
|
|
|
136
151
|
process.stdout.write(JSON.stringify(output));
|
|
152
|
+
|
|
153
|
+
// --- Cost-warning emission point (gated by CCP_CONTEXT_MONITOR_COST_WARNINGS) ---
|
|
154
|
+
// CCP's statusline bridge does not currently surface per-session cost data, so
|
|
155
|
+
// this branch is a no-op today. When metrics.cost_* becomes available, emit the
|
|
156
|
+
// cost advisory HERE, guarded by the opt-out so users can suppress it.
|
|
157
|
+
if (costWarningsEnabled() && metrics && metrics.cost_warning) {
|
|
158
|
+
// (future) emit cost advisory via hookSpecificOutput.additionalContext
|
|
159
|
+
}
|
|
137
160
|
} catch (e) {
|
|
138
161
|
// Silent fail -- never block tool execution
|
|
139
162
|
process.exit(0);
|