codebyplan 1.13.46 → 1.13.49
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/dist/cli.js +33 -13
- package/package.json +1 -1
- package/templates/agents/cbp-cc-executor.md +0 -1
- package/templates/agents/cbp-database-agent.md +0 -1
- package/templates/agents/cbp-e2e-maestro.md +0 -1
- package/templates/agents/cbp-e2e-playwright.md +0 -1
- package/templates/agents/cbp-e2e-tauri.md +0 -1
- package/templates/agents/cbp-e2e-vscode.md +0 -1
- package/templates/agents/cbp-e2e-xcuitest.md +0 -1
- package/templates/agents/cbp-improve-claude.md +0 -1
- package/templates/agents/cbp-improve-round.md +0 -1
- package/templates/agents/cbp-map-architecture.md +0 -1
- package/templates/agents/cbp-mechanical-edits.md +0 -1
- package/templates/agents/cbp-research.md +0 -1
- package/templates/agents/cbp-round-executor.md +7 -1
- package/templates/agents/cbp-security-agent.md +0 -1
- package/templates/agents/cbp-stripe-agent.md +173 -0
- package/templates/agents/cbp-task-check.md +0 -1
- package/templates/agents/cbp-task-planner.md +0 -1
- package/templates/agents/cbp-testing-qa-agent.md +0 -1
- package/templates/hooks/cbp-auto-test-hooks.sh +0 -1
- package/templates/hooks/cbp-canonical-templates-nudge.sh +0 -1
- package/templates/hooks/cbp-context-window-notify.sh +0 -1
- package/templates/hooks/cbp-e2e-spec-patterns.sh +0 -1
- package/templates/hooks/cbp-lint-format-on-edit.sh +0 -1
- package/templates/hooks/cbp-maestro-yaml-validate.sh +0 -1
- package/templates/hooks/cbp-mcp-caller-worktree-inject.sh +0 -1
- package/templates/hooks/cbp-mcp-migration-guard.sh +0 -1
- package/templates/hooks/cbp-mcp-round-sync.sh +0 -1
- package/templates/hooks/cbp-plugin-dispatch.sh +0 -1
- package/templates/hooks/cbp-pre-commit-quality-gate.sh +0 -1
- package/templates/hooks/cbp-session-start-hook.sh +0 -1
- package/templates/hooks/cbp-statusline.mjs +0 -1
- package/templates/hooks/cbp-statusline.py +0 -1
- package/templates/hooks/cbp-statusline.sh +0 -1
- package/templates/hooks/cbp-subagent-statusline.mjs +0 -1
- package/templates/hooks/cbp-subagent-statusline.py +0 -1
- package/templates/hooks/cbp-subagent-statusline.sh +0 -1
- package/templates/hooks/cbp-test-coverage-gate.sh +0 -1
- package/templates/hooks/cbp-test-hooks.sh +0 -1
- package/templates/hooks/validate-context-usage.sh +0 -1
- package/templates/hooks/validate-git-commit.sh +57 -9
- package/templates/hooks/validate-git-stash-deny.sh +0 -1
- package/templates/hooks/validate-structure-lengths.sh +0 -1
- package/templates/hooks/validate-structure-lib.sh +17 -1
- package/templates/hooks/validate-structure-patterns.sh +0 -1
- package/templates/hooks/validate-structure-scope.sh +43 -11
- package/templates/hooks/validate-structure-smoke.sh +0 -1
- package/templates/hooks/validate-structure-templates.sh +0 -1
- package/templates/hooks/validate-structure.sh +0 -1
- package/templates/hooks/verify-parity.sh +0 -1
- package/templates/rules/agent-claim-verification.md +0 -1
- package/templates/rules/architecture-map.md +0 -4
- package/templates/rules/cbp-operating-gotchas.md +0 -4
- package/templates/rules/context-file-loading.md +0 -1
- package/templates/rules/e2e-mandatory.md +0 -4
- package/templates/rules/parallel-waves.md +0 -1
- package/templates/rules/scope-vocabulary.md +14 -10
- package/templates/rules/supabase-branch-lifecycle.md +0 -1
- package/templates/rules/todo-backend.md +0 -1
- package/templates/settings.project.base.json +13 -0
- package/templates/skills/cbp-build-cc-agent/SKILL.md +2 -3
- package/templates/skills/cbp-build-cc-agent/reference/cbp-quality.md +6 -8
- package/templates/skills/cbp-build-cc-agent/scripts/validate-agent.sh +10 -1
- package/templates/skills/cbp-build-cc-claude-file/SKILL.md +0 -1
- package/templates/skills/cbp-build-cc-claude-file/scripts/validate-claude-file.sh +0 -1
- package/templates/skills/cbp-build-cc-mode/SKILL.md +0 -1
- package/templates/skills/cbp-build-cc-rule/SKILL.md +18 -8
- package/templates/skills/cbp-build-cc-rule/scripts/validate-rule.sh +4 -5
- package/templates/skills/cbp-build-cc-settings/SKILL.md +0 -1
- package/templates/skills/cbp-build-cc-settings/reference/cbp-conventions.md +0 -4
- package/templates/skills/cbp-build-cc-settings/scripts/validate-settings.sh +0 -1
- package/templates/skills/cbp-build-cc-skill/SKILL.md +0 -1
- package/templates/skills/cbp-build-cc-skill/reference/cbp-quality.md +6 -8
- package/templates/skills/cbp-build-cc-skill/scripts/validate-skill.sh +10 -2
- package/templates/skills/cbp-checkpoint-check/SKILL.md +0 -1
- package/templates/skills/cbp-checkpoint-complete/SKILL.md +0 -1
- package/templates/skills/cbp-checkpoint-create/SKILL.md +10 -11
- package/templates/skills/cbp-checkpoint-end/SKILL.md +0 -1
- package/templates/skills/cbp-checkpoint-plan/SKILL.md +0 -1
- package/templates/skills/cbp-checkpoint-plan/reference/alternative-comparison-template.md +0 -4
- package/templates/skills/cbp-checkpoint-plan/reference/dep-decision-rubric.md +0 -4
- package/templates/skills/cbp-checkpoint-plan/reference/e2e-discovery-probe.md +0 -4
- package/templates/skills/cbp-checkpoint-plan/reference/gap-analysis-playbook.md +0 -4
- package/templates/skills/cbp-checkpoint-start/SKILL.md +0 -1
- package/templates/skills/cbp-checkpoint-update/SKILL.md +0 -1
- package/templates/skills/cbp-frontend-a11y/SKILL.md +0 -1
- package/templates/skills/cbp-frontend-design/SKILL.md +0 -1
- package/templates/skills/cbp-frontend-ui/SKILL.md +0 -1
- package/templates/skills/cbp-frontend-ux/SKILL.md +0 -1
- package/templates/skills/cbp-git-branch-feat-create/SKILL.md +0 -1
- package/templates/skills/cbp-git-commit/SKILL.md +0 -1
- package/templates/skills/cbp-git-worktree-create/SKILL.md +0 -1
- package/templates/skills/cbp-git-worktree-remove/SKILL.md +0 -1
- package/templates/skills/cbp-map-architecture/SKILL.md +0 -1
- package/templates/skills/cbp-merge-main/SKILL.md +0 -1
- package/templates/skills/cbp-refresh-arch-map/SKILL.md +0 -1
- package/templates/skills/cbp-round-check/SKILL.md +0 -1
- package/templates/skills/cbp-round-complete/SKILL.md +0 -1
- package/templates/skills/cbp-round-end/SKILL.md +0 -1
- package/templates/skills/cbp-round-execute/SKILL.md +9 -2
- package/templates/skills/cbp-round-execute/reference/inline-fallback.md +0 -4
- package/templates/skills/cbp-round-input/SKILL.md +0 -1
- package/templates/skills/cbp-round-start/SKILL.md +0 -1
- package/templates/skills/cbp-round-update/SKILL.md +0 -1
- package/templates/skills/cbp-session-end/SKILL.md +0 -1
- package/templates/skills/cbp-session-start/SKILL.md +0 -1
- package/templates/skills/cbp-session-start/qa-regression.md +0 -1
- package/templates/skills/cbp-setup-e2e/SKILL.md +0 -1
- package/templates/skills/cbp-setup-eslint/SKILL.md +0 -1
- package/templates/skills/cbp-ship/SKILL.md +0 -1
- package/templates/skills/cbp-ship-configure/SKILL.md +0 -1
- package/templates/skills/cbp-ship-main/SKILL.md +0 -1
- package/templates/skills/cbp-stripe/SKILL.md +116 -0
- package/templates/skills/cbp-stripe/reference/billing.md +106 -0
- package/templates/skills/cbp-stripe/reference/connect.md +105 -0
- package/templates/skills/cbp-stripe/reference/payments.md +107 -0
- package/templates/skills/cbp-stripe/reference/security.md +117 -0
- package/templates/skills/cbp-stripe/reference/stripe-mcp-setup.md +59 -0
- package/templates/skills/cbp-stripe/reference/tax.md +96 -0
- package/templates/skills/cbp-stripe/reference/treasury.md +87 -0
- package/templates/skills/cbp-supabase-branch-check/SKILL.md +0 -1
- package/templates/skills/cbp-supabase-branch-check/reference/dag-steps.md +0 -4
- package/templates/skills/cbp-supabase-migrate/SKILL.md +0 -1
- package/templates/skills/cbp-supabase-setup/SKILL.md +0 -1
- package/templates/skills/cbp-task-check/SKILL.md +0 -1
- package/templates/skills/cbp-task-complete/SKILL.md +0 -1
- package/templates/skills/cbp-task-create/SKILL.md +0 -1
- package/templates/skills/cbp-task-start/SKILL.md +0 -1
- package/templates/skills/cbp-task-testing/SKILL.md +0 -1
- package/templates/skills/cbp-todo/SKILL.md +0 -1
- package/templates/skills/cbp-todo/qa-regression.md +0 -1
- package/templates/skills/supabase/SKILL.md +0 -1
- package/templates/skills/supabase-postgres-best-practices/SKILL.md +0 -1
package/dist/cli.js
CHANGED
|
@@ -39,7 +39,7 @@ var VERSION, PACKAGE_NAME;
|
|
|
39
39
|
var init_version = __esm({
|
|
40
40
|
"src/lib/version.ts"() {
|
|
41
41
|
"use strict";
|
|
42
|
-
VERSION = "1.13.
|
|
42
|
+
VERSION = "1.13.49";
|
|
43
43
|
PACKAGE_NAME = "codebyplan";
|
|
44
44
|
}
|
|
45
45
|
});
|
|
@@ -35130,8 +35130,10 @@ function checkScopeMarkers(opts) {
|
|
|
35130
35130
|
const {
|
|
35131
35131
|
claudeDir,
|
|
35132
35132
|
scanDirs = SCAN_DIRS,
|
|
35133
|
-
allowlist = /* @__PURE__ */ new Set()
|
|
35133
|
+
allowlist = /* @__PURE__ */ new Set(),
|
|
35134
|
+
templatesDir
|
|
35134
35135
|
} = opts;
|
|
35136
|
+
const twinDetectionActive = templatesDir != null && fs11.existsSync(templatesDir);
|
|
35135
35137
|
const violations = [];
|
|
35136
35138
|
for (const scanDir of scanDirs) {
|
|
35137
35139
|
const baseDir = path12.join(claudeDir, scanDir);
|
|
@@ -35158,10 +35160,16 @@ function checkScopeMarkers(opts) {
|
|
|
35158
35160
|
});
|
|
35159
35161
|
continue;
|
|
35160
35162
|
}
|
|
35161
|
-
|
|
35162
|
-
|
|
35163
|
+
const scopeValue = isMd ? extractFrontmatterScope(content) : extractShScope(content);
|
|
35164
|
+
const managed = twinDetectionActive && fs11.existsSync(path12.join(templatesDir, relPath));
|
|
35165
|
+
if (managed) {
|
|
35163
35166
|
if (scopeValue === null) {
|
|
35164
|
-
|
|
35167
|
+
} else if (scopeValue === "org-shared") {
|
|
35168
|
+
violations.push({
|
|
35169
|
+
type: "redundant-scope",
|
|
35170
|
+
path: relPath,
|
|
35171
|
+
detail: "redundant org-shared marker \u2014 org-shared is the implicit default, remove the key"
|
|
35172
|
+
});
|
|
35165
35173
|
} else if (!isValidScope(scopeValue)) {
|
|
35166
35174
|
violations.push({
|
|
35167
35175
|
type: "invalid-scope",
|
|
@@ -35170,7 +35178,6 @@ function checkScopeMarkers(opts) {
|
|
|
35170
35178
|
});
|
|
35171
35179
|
}
|
|
35172
35180
|
} else {
|
|
35173
|
-
const scopeValue = extractShScope(content);
|
|
35174
35181
|
if (scopeValue === null) {
|
|
35175
35182
|
violations.push({ type: "missing-scope", path: relPath });
|
|
35176
35183
|
} else if (!isValidScope(scopeValue)) {
|
|
@@ -35187,14 +35194,20 @@ function checkScopeMarkers(opts) {
|
|
|
35187
35194
|
}
|
|
35188
35195
|
function runVerifyParity(opts) {
|
|
35189
35196
|
const { claudeDir, templatesDir, expectedOneSided } = opts;
|
|
35190
|
-
const
|
|
35191
|
-
|
|
35197
|
+
const allScopeItems = [];
|
|
35198
|
+
const parityItems = [];
|
|
35199
|
+
allScopeItems.push(...checkScopeMarkers({ claudeDir, templatesDir }));
|
|
35192
35200
|
if (templatesDir != null && fs11.existsSync(templatesDir)) {
|
|
35193
|
-
|
|
35201
|
+
parityItems.push(
|
|
35194
35202
|
...checkSiblingParity({ claudeDir, templatesDir, expectedOneSided })
|
|
35195
35203
|
);
|
|
35196
35204
|
}
|
|
35197
|
-
|
|
35205
|
+
const warnings = allScopeItems.filter((v) => v.type === "redundant-scope");
|
|
35206
|
+
const scopeViolations = allScopeItems.filter(
|
|
35207
|
+
(v) => v.type !== "redundant-scope"
|
|
35208
|
+
);
|
|
35209
|
+
const violations = [...scopeViolations, ...parityItems];
|
|
35210
|
+
return { violations, warnings };
|
|
35198
35211
|
}
|
|
35199
35212
|
function readdirRecursive(dir, rel = "", visited = /* @__PURE__ */ new Set()) {
|
|
35200
35213
|
const realDir = fs11.realpathSync(dir);
|
|
@@ -35258,7 +35271,7 @@ var init_verify_parity = __esm({
|
|
|
35258
35271
|
"hooks",
|
|
35259
35272
|
"rules"
|
|
35260
35273
|
];
|
|
35261
|
-
REPO_ONLY_RE = /^repo-only:[a-z0-9-]
|
|
35274
|
+
REPO_ONLY_RE = /^repo-only:[a-z0-9]([a-z0-9-]*[a-z0-9])?$/;
|
|
35262
35275
|
DEFAULT_EXPECTED_ONE_SIDED = /* @__PURE__ */ new Set([
|
|
35263
35276
|
"hooks/cbp-mcp-migration-guard.sh",
|
|
35264
35277
|
// repo-only:codebyplan — monorepo-only skill (references the in-repo
|
|
@@ -35312,12 +35325,19 @@ function verifyParity(args, deps = {}) {
|
|
|
35312
35325
|
);
|
|
35313
35326
|
return 2;
|
|
35314
35327
|
}
|
|
35315
|
-
const { violations } = result;
|
|
35328
|
+
const { violations, warnings } = result;
|
|
35316
35329
|
if (jsonMode) {
|
|
35317
|
-
process.stdout.write(
|
|
35330
|
+
process.stdout.write(
|
|
35331
|
+
JSON.stringify({ violations, warnings }, null, 2) + "\n"
|
|
35332
|
+
);
|
|
35318
35333
|
if (violations.length > 0 && !warnOnly) return 1;
|
|
35319
35334
|
return 0;
|
|
35320
35335
|
}
|
|
35336
|
+
for (const w of warnings) {
|
|
35337
|
+
const detail = w.detail ? `: ${w.detail}` : "";
|
|
35338
|
+
process.stderr.write(`verify-parity: WARN ${w.path}${detail}
|
|
35339
|
+
`);
|
|
35340
|
+
}
|
|
35321
35341
|
if (violations.length === 0) {
|
|
35322
35342
|
process.stdout.write("verify-parity: OK \u2014 no violations found.\n");
|
|
35323
35343
|
return 0;
|
package/package.json
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
---
|
|
2
|
-
scope: org-shared
|
|
3
2
|
name: cbp-cc-executor
|
|
4
3
|
description: Authoring executor for `.claude/` infrastructure. Applies approved changes across rules, skills, agents, context, CLAUDE.md, settings, and hooks — with update-first discipline, scope-marker enforcement, and length-limit awareness. Callable by the main conversation, `/cbp-checkpoint-end`, and `round-executor` (for in-scope `.claude/` infra deliverables).
|
|
5
4
|
tools: Read, Write, Edit, Glob, Grep, Skill, Task, AskUserQuestion, Bash(npx codebyplan task create *)
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
---
|
|
2
|
-
scope: org-shared
|
|
3
2
|
name: cbp-database-agent
|
|
4
3
|
description: Supabase database specialist. Handles migrations, RLS policies, type generation, and schema changes. Spawned as sub-executor by round-executor when plan includes DB work.
|
|
5
4
|
tools: Read, Write, Edit, Glob, Grep, Bash, mcp__supabase__apply_migration, mcp__supabase__execute_sql, mcp__supabase__list_tables, mcp__supabase__list_migrations, mcp__supabase__get_advisors, mcp__supabase__generate_typescript_types, mcp__supabase__search_docs
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
---
|
|
2
|
-
scope: org-shared
|
|
3
2
|
name: cbp-improve-claude
|
|
4
3
|
description: Broad analysis agent for retrospective task analysis. Analyzes full task history, conversation efficiency, patterns, root causes by domain, and proposes .claude/ infrastructure improvements.
|
|
5
4
|
tools: Read, Glob, Grep, Task, AskUserQuestion
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
---
|
|
2
|
-
scope: org-shared
|
|
3
2
|
name: cbp-map-architecture
|
|
4
3
|
description: Read-only agent that analyzes a repository module and produces a structured architecture map following the canonical spec. Invoke when generating or refreshing a module's .claude/architecture/<module>.md map file. Returns the full map content as text for the caller to write.
|
|
5
4
|
tools: Read, Glob, Grep
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
---
|
|
2
|
-
scope: org-shared
|
|
3
2
|
name: cbp-mechanical-edits
|
|
4
3
|
description: Cheap mechanical-edits subagent — performs renames, moves, string substitutions, frontmatter field edits, and free-form index/manifest regeneration. Spawned by the round-execute skill's Mechanical-Edits Delegation Gate when task-planner classifies a task as work_mode: mechanical. Never authors new code logic.
|
|
5
4
|
tools: Read, Write, Edit, Glob, Grep, Bash
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
---
|
|
2
|
-
scope: org-shared
|
|
3
2
|
name: cbp-round-executor
|
|
4
3
|
description: Execute approved plan. Receives pre-analyzed deliverables and files list. Focuses on quality implementation. Communicates with user when blocked or needs decisions.
|
|
5
4
|
tools: Read, Write, Edit, Glob, Grep, Bash, TaskUpdate, AskUserQuestion, Skill, Task
|
|
@@ -316,6 +315,7 @@ When the approved plan includes specialized work, delegate to sub-executor agent
|
|
|
316
315
|
| Work Type | Agent | When to Delegate |
|
|
317
316
|
|-----------|-------|-----------------|
|
|
318
317
|
| Supabase migrations, RLS, types | `cbp-database-agent` | Plan includes DB schema changes, RLS policies, or type generation |
|
|
318
|
+
| Stripe integration (Checkout, webhooks, subscriptions, customer portal) | `cbp-stripe-agent` | Plan includes Stripe work (files under `stripe/`, or steps referencing `payment`, `checkout`, `webhook`, `subscription`, or `approved_plan.stripe_work === true`) |
|
|
319
319
|
| Batch identical-structure file writes (≥4 files) | `general-purpose` (background) | Plan has 4+ independent files, no shared state, no ordered dependency |
|
|
320
320
|
| `.claude/` infrastructure deliverables | `cbp-cc-executor` | `files_to_modify[]` includes **≥2** `.claude/` files (rules, skills, agents, context, hooks, settings, CLAUDE.md). A single `.claude/` file edit stays on Step 0 Skill-tool routing |
|
|
321
321
|
|
|
@@ -325,6 +325,12 @@ When the approved plan includes specialized work, delegate to sub-executor agent
|
|
|
325
325
|
3. Wait for completion, merge files_changed into executor output
|
|
326
326
|
4. Continue with remaining non-DB steps
|
|
327
327
|
|
|
328
|
+
**How to delegate to `cbp-stripe-agent`:**
|
|
329
|
+
1. Collect all Stripe-related steps from the plan
|
|
330
|
+
2. Spawn `cbp-stripe-agent` via Agent tool with those steps and `files_changed_scope` set to the executor's current `files_to_modify[]` paths
|
|
331
|
+
3. Wait for completion, merge files_changed into executor output
|
|
332
|
+
4. Continue with remaining non-Stripe steps
|
|
333
|
+
|
|
328
334
|
**When NOT to delegate:**
|
|
329
335
|
- Simple Supabase queries in application code (executor handles these)
|
|
330
336
|
- Only delegate schema/migration/RLS/type generation work
|
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
---
|
|
2
|
+
scope: org-shared
|
|
3
|
+
name: cbp-stripe-agent
|
|
4
|
+
description: Stripe integration specialist. Writes Stripe code (Checkout, webhooks, subscriptions, customer portal) in the consuming app and optionally drives live Stripe via MCP. Spawned as sub-executor by round-executor when the plan includes Stripe work.
|
|
5
|
+
tools: Read, Write, Edit, Glob, Grep, Bash, AskUserQuestion
|
|
6
|
+
model: sonnet
|
|
7
|
+
effort: xhigh
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
# Stripe Agent
|
|
11
|
+
|
|
12
|
+
Stripe integration specialist for payments, billing, webhooks, Connect, Tax, and Treasury.
|
|
13
|
+
|
|
14
|
+
## Purpose
|
|
15
|
+
|
|
16
|
+
Handles Stripe integration work when a round's plan includes payment code. Spawned by
|
|
17
|
+
round-executor as a sub-executor, not directly by `/cbp-round-start`. Two operating modes:
|
|
18
|
+
|
|
19
|
+
- **Primary (always)** — writes/modifies Stripe integration code in the consuming app using
|
|
20
|
+
the current Stripe Node SDK, guided by the `cbp-stripe` skill's API-selection routing.
|
|
21
|
+
- **Optional (opt-in)** — when a Stripe MCP server is configured AND a restricted/test key is
|
|
22
|
+
present, scaffolds live test data (products, prices, payment links) via that server. Absent
|
|
23
|
+
either, it degrades silently to code-only — never a hard failure.
|
|
24
|
+
|
|
25
|
+
## Input Contract
|
|
26
|
+
|
|
27
|
+
```yaml
|
|
28
|
+
input:
|
|
29
|
+
stripe_tasks: [{step_number, description, type}] # Stripe-related plan steps
|
|
30
|
+
files_changed_scope: string[] # paths the round is allowed to touch
|
|
31
|
+
repo_id: string
|
|
32
|
+
context:
|
|
33
|
+
checkpoint_goal: string
|
|
34
|
+
task_requirements: string
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
## Output Contract
|
|
38
|
+
|
|
39
|
+
```yaml
|
|
40
|
+
output:
|
|
41
|
+
status: 'completed' | 'blocked' | 'failed'
|
|
42
|
+
live_path_used: boolean # true only when the optional MCP path ran
|
|
43
|
+
files_changed:
|
|
44
|
+
- path: string
|
|
45
|
+
action: 'created' | 'modified' | 'deleted'
|
|
46
|
+
stripe_resources_created: # populated only when live_path_used === true
|
|
47
|
+
- type: string # e.g. 'product' | 'price' | 'payment_link'
|
|
48
|
+
id: string
|
|
49
|
+
mode: 'test' # ALWAYS test — live mode is never scaffolded here
|
|
50
|
+
issues_encountered: string[]
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
## Workflow
|
|
54
|
+
|
|
55
|
+
### Pre-flight: Load Guidance + Resolve Live-Path Availability
|
|
56
|
+
|
|
57
|
+
Run both checks before writing any code:
|
|
58
|
+
|
|
59
|
+
1. **Load the `cbp-stripe` skill** for API-selection routing and security rules. Invoke the
|
|
60
|
+
`cbp-stripe` Skill (or Read `.claude/skills/cbp-stripe/SKILL.md` and the relevant
|
|
61
|
+
`reference/*.md` when Skill dispatch is unavailable). This is the source of truth for
|
|
62
|
+
which Stripe API to use per intent — do not select APIs from memory.
|
|
63
|
+
|
|
64
|
+
2. **Resolve live-path availability.** The optional MCP path runs ONLY when ALL hold:
|
|
65
|
+
- `STRIPE_SECRET_KEY` (or an equivalent restricted-key env var) is present AND is a
|
|
66
|
+
**test-mode** key. Check presence + prefix WITHOUT printing the secret (never `echo` or
|
|
67
|
+
`printenv` the raw value):
|
|
68
|
+
|
|
69
|
+
```bash
|
|
70
|
+
case "${STRIPE_SECRET_KEY:-}" in
|
|
71
|
+
sk_test_*|rk_test_*) echo "live path: eligible (test key)" ;;
|
|
72
|
+
sk_live_*|rk_live_*) echo "live path: refused (live-mode key)" ;;
|
|
73
|
+
"") echo "live path: skipped (no key)" ;;
|
|
74
|
+
*) echo "live path: refused (unknown prefix ${STRIPE_SECRET_KEY:0:8})" ;;
|
|
75
|
+
esac
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
Only `sk_test_`/`rk_test_` enable the live path; live-mode keys (`sk_live_`, `rk_live_`)
|
|
79
|
+
are refused so a dev round never scaffolds real Stripe data.
|
|
80
|
+
- A Stripe MCP server is reachable. Stripe MCP tools (`mcp__stripe__*`) are NOT listed in
|
|
81
|
+
this agent's frontmatter because the server is optional and absent by default; discover
|
|
82
|
+
them at runtime via `ToolSearch` (query `mcp__stripe`). Setup is documented in
|
|
83
|
+
`.claude/skills/cbp-stripe/reference/stripe-mcp-setup.md`.
|
|
84
|
+
|
|
85
|
+
If any condition fails, set `live_path_used = false` and proceed code-only. Record the
|
|
86
|
+
reason in `issues_encountered[]` (e.g. `live path skipped: no STRIPE_SECRET_KEY`). This is
|
|
87
|
+
a normal outcome, NOT a block.
|
|
88
|
+
|
|
89
|
+
### Step 1: Analyze Stripe Tasks
|
|
90
|
+
|
|
91
|
+
Read `stripe_tasks` and categorize by type, mapping each to the `cbp-stripe` routing table:
|
|
92
|
+
|
|
93
|
+
- **One-time payments** → Checkout Sessions (`reference/payments.md`)
|
|
94
|
+
- **Custom payment UI** → Checkout Sessions + Payment Element (`reference/payments.md`)
|
|
95
|
+
- **Saving a payment method** → Setup Intents (`reference/payments.md`)
|
|
96
|
+
- **Subscriptions / recurring billing** → Billing APIs + Checkout Sessions, Customer Portal
|
|
97
|
+
(`reference/billing.md`)
|
|
98
|
+
- **Webhooks** → signed event handler (`reference/security.md`)
|
|
99
|
+
- **Marketplace / platform** → Connect Accounts v2 (`reference/connect.md`)
|
|
100
|
+
- **Tax** → Stripe Tax (`reference/tax.md`); **embedded finance** → Treasury
|
|
101
|
+
(`reference/treasury.md`)
|
|
102
|
+
|
|
103
|
+
### Step 2: Write Stripe Integration Code (PRIMARY)
|
|
104
|
+
|
|
105
|
+
For each task, write or modify code in `files_changed_scope` using the current Stripe Node SDK:
|
|
106
|
+
|
|
107
|
+
1. **Honor the critical rules from the skill**: never pass `payment_method_types` except for
|
|
108
|
+
the documented Terminal and Treasury-bank-account exceptions; prefer dynamic payment
|
|
109
|
+
methods.
|
|
110
|
+
2. **Server-side key handling**: read the key from `process.env` only; never hardcode or log
|
|
111
|
+
it. Prefer a restricted key (`rk_`) over a secret key.
|
|
112
|
+
3. **Next.js API routes that import `stripe` MUST export `export const dynamic =
|
|
113
|
+
'force-dynamic'`** at the top of the file (the SDK reads a runtime env var; static analysis
|
|
114
|
+
at build time fails without it). Source: `.claude/skills/cbp-frontend-design/reference/nextjs-scss.md`
|
|
115
|
+
Rule 6.
|
|
116
|
+
4. **Webhook routes** must verify the signature with `stripe.webhooks.constructEvent(rawBody,
|
|
117
|
+
sig, secret)` against the raw (unparsed) body, and guard the `stripe-signature` header
|
|
118
|
+
(it is typed `string | string[] | undefined`) before use.
|
|
119
|
+
5. Match the consuming app's existing conventions (error handling, response shape, file
|
|
120
|
+
layout). Verify the installed `stripe` major version (`grep '"stripe"' package.json`) and
|
|
121
|
+
write code for that version — the skill notes the latest API version, but consumer repos
|
|
122
|
+
may pin an older SDK.
|
|
123
|
+
|
|
124
|
+
### Step 3: Scaffold Live Test Data (OPTIONAL — only when Pre-flight enabled the live path)
|
|
125
|
+
|
|
126
|
+
When `live_path_used` is eligible AND a task explicitly needs live test data (e.g. "create a
|
|
127
|
+
test product + price for the checkout demo"):
|
|
128
|
+
|
|
129
|
+
1. Re-confirm the key prefix is `sk_test_` or `rk_test_` immediately before the first call.
|
|
130
|
+
Abort the live path on any live-mode key (`sk_live_` or `rk_live_`).
|
|
131
|
+
2. Use the discovered Stripe MCP tools to create only what the task requires (products,
|
|
132
|
+
prices, payment links, test customers). Record each in `stripe_resources_created[]`.
|
|
133
|
+
3. On ANY MCP error (server unreachable, auth rejected, rate limit), fall back to code-only:
|
|
134
|
+
set `live_path_used = false`, record the error in `issues_encountered[]`, and continue —
|
|
135
|
+
never block the round on the optional path.
|
|
136
|
+
|
|
137
|
+
### Step 4: Verify
|
|
138
|
+
|
|
139
|
+
1. For each changed `.ts`/`.tsx` file, run a scoped `npx tsc --noEmit` (or the app's
|
|
140
|
+
typecheck) on the changed set and confirm no new type errors.
|
|
141
|
+
2. Confirm every API route importing `stripe` exports `dynamic = 'force-dynamic'`
|
|
142
|
+
(`grep -L "force-dynamic"` across the changed route files).
|
|
143
|
+
3. Confirm no secret was committed: `grep -rE 'sk_live_|rk_live_|sk_test_[A-Za-z0-9]{16,}|rk_test_[A-Za-z0-9]{16,}'`
|
|
144
|
+
over the changed files returns nothing real. Live-key prefixes (`sk_live_`, `rk_live_`)
|
|
145
|
+
match with no length floor — a committed live key is never acceptable; test-key prefixes
|
|
146
|
+
carry a `{16,}` floor so doc placeholders like `sk_test_…` don't false-positive.
|
|
147
|
+
|
|
148
|
+
### Step 5: Return Output
|
|
149
|
+
|
|
150
|
+
Populate all output-contract fields. Include every file changed. Report the live-path outcome
|
|
151
|
+
(used / skipped + reason) in `issues_encountered[]` for the audit trail.
|
|
152
|
+
|
|
153
|
+
## When NOT to Use This Agent
|
|
154
|
+
|
|
155
|
+
- Non-payment application code (round-executor handles these).
|
|
156
|
+
- Reading Stripe data for display only with no integration change.
|
|
157
|
+
- Designing the payment UX/visual layer — that is the frontend skills' job; this agent writes
|
|
158
|
+
the Stripe wiring beneath it.
|
|
159
|
+
- Production / live-mode Stripe operations (`sk_live_`, `rk_live_`) — this agent refuses
|
|
160
|
+
live-mode keys by design; only test-mode keys enable the optional live path.
|
|
161
|
+
|
|
162
|
+
## Integration
|
|
163
|
+
|
|
164
|
+
- **Spawned by**: `round-executor` (as sub-executor when the plan includes Stripe work — see
|
|
165
|
+
`cbp-round-executor` Step 3.5 and `/cbp-round-execute` Step 3b-stripe dispatch).
|
|
166
|
+
- **Returns to**: `round-executor` (merges `files_changed[]` into the round output).
|
|
167
|
+
- **Loads**: the `cbp-stripe` skill (`.claude/skills/cbp-stripe/SKILL.md` + `reference/*.md`)
|
|
168
|
+
for API selection and security rules.
|
|
169
|
+
- **Optional tools**: Stripe MCP (`mcp__stripe__*`) discovered at runtime via `ToolSearch`
|
|
170
|
+
when a server is configured per `.claude/skills/cbp-stripe/reference/stripe-mcp-setup.md` —
|
|
171
|
+
intentionally absent from frontmatter because the server is opt-in.
|
|
172
|
+
- **Rule**: never commit Stripe secrets; restricted/test keys only; degrade to code-only when
|
|
173
|
+
the live path is unavailable.
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
---
|
|
2
|
-
scope: org-shared
|
|
3
2
|
name: cbp-task-check
|
|
4
3
|
description: Task verification agent. Verifies requirements, checkpoint alignment, QA status, file approvals, code review, shippable gate, round outcome analysis, and user satisfaction discussion.
|
|
5
4
|
tools: Read, Glob, Grep, Bash, AskUserQuestion
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
---
|
|
2
|
-
scope: org-shared
|
|
3
2
|
name: cbp-task-planner
|
|
4
3
|
description: Analyze codebase and create implementation plan. Reads context from DB. Uses Explore subagent for fast analysis. Communicates with user for clarifications.
|
|
5
4
|
tools: Read, Glob, Grep, Task, TaskCreate, AskUserQuestion
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
---
|
|
2
|
-
scope: org-shared
|
|
3
2
|
name: cbp-testing-qa-agent
|
|
4
3
|
description: Combined testing, QA generation, and default checklists. Runs build/lint/types/unit-tests/audit, generates auto QA items, applies default production checklists. Does NOT consume e2e screenshots or frontend-ui findings.
|
|
5
4
|
tools: Read, Glob, Grep, Bash, AskUserQuestion
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
#!/bin/bash
|
|
2
|
-
# @scope: org-shared
|
|
3
2
|
# @hook: PreToolUse mcp__codebyplan__(update_checkpoint|complete_checkpoint|update_task|complete_task|add_round|update_round|complete_round|create_standalone_task|update_standalone_task|complete_standalone_task|add_standalone_round|update_standalone_round|complete_standalone_round|update_standalone_file_change)
|
|
4
3
|
# Hook: PreToolUse for MCP write tools
|
|
5
4
|
#
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
// @scope: org-shared
|
|
3
2
|
// @hook: NOT-A-HOOK (statusLine renderer, invoked via the cbp-statusline.sh dispatcher)
|
|
4
3
|
// Claude Code Status Line — node renderer (ESM; .mjs forces ESM regardless of the
|
|
5
4
|
// host repo's package.json "type", so the script is portable into any consumer).
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
#!/bin/bash
|
|
2
|
-
# @scope: org-shared
|
|
3
2
|
# @hook: NOT-A-HOOK (statusLine renderer, invoked by settings.json statusLine.command)
|
|
4
3
|
# Claude Code Status Line — multi-runtime dispatcher + bash renderer
|
|
5
4
|
# Purpose: Renders up to 6 structured lines of Claude Code status from stdin JSON.
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
// @scope: org-shared
|
|
3
2
|
// @hook: NOT-A-HOOK (subagentStatusLine renderer, invoked via the cbp-subagent-statusline.sh dispatcher)
|
|
4
3
|
// Claude Code Subagent Status Line — node renderer (ESM; .mjs forces ESM regardless
|
|
5
4
|
// of the host repo's package.json "type"). Byte-identical output to the bash renderer
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
#!/usr/bin/env python3
|
|
2
|
-
# @scope: org-shared
|
|
3
2
|
# @hook: NOT-A-HOOK (subagentStatusLine renderer, invoked via the cbp-subagent-statusline.sh dispatcher)
|
|
4
3
|
# Claude Code Subagent Status Line — python renderer. Byte-identical output to the
|
|
5
4
|
# bash renderer in cbp-subagent-statusline.sh and the node renderer in
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
#!/bin/bash
|
|
2
|
-
# @scope: org-shared
|
|
3
2
|
# Portability: bash 3.2+ (macOS default /bin/bash). UTF-8 multibyte chars in
|
|
4
3
|
# user-controlled fields are byte-iterated under 3.2 (over-counts visible width
|
|
5
4
|
# for non-ASCII content); acceptable safe-direction approximation — and the node
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
#!/bin/bash
|
|
2
|
-
# @scope: org-shared
|
|
3
2
|
# @hook: NOT-A-HOOK (test suite for plugin hooks; invoked by cbp-auto-test-hooks.sh)
|
|
4
3
|
# Purpose: Test suite for plugin's shipped hooks. Invoked by cbp-auto-test-hooks.sh whenever a
|
|
5
4
|
# plugin hook file is edited. Not a PreToolUse/PostToolUse/Notification hook itself —
|