codebyplan 1.5.1 → 1.9.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/dist/cli.js +4462 -748
- package/package.json +5 -1
- package/templates/.gitkeep +0 -0
- package/templates/README.md +20 -0
- package/templates/agents/cbp-cc-executor.md +213 -0
- package/templates/agents/cbp-database-agent.md +229 -0
- package/templates/agents/cbp-improve-claude.md +245 -0
- package/templates/agents/cbp-improve-round.md +284 -0
- package/templates/agents/cbp-mechanical-edits.md +111 -0
- package/templates/agents/cbp-research.md +282 -0
- package/templates/agents/cbp-round-executor.md +604 -0
- package/templates/agents/cbp-security-agent.md +134 -0
- package/templates/agents/cbp-task-check.md +213 -0
- package/templates/agents/cbp-task-planner.md +582 -0
- package/templates/agents/cbp-test-e2e-agent.md +363 -0
- package/templates/agents/cbp-testing-qa-agent.md +400 -0
- package/templates/context/mcp-docs.md +139 -0
- package/templates/hooks/README.md +236 -0
- package/templates/hooks/cbp-auto-test-hooks.sh +44 -0
- package/templates/hooks/cbp-lint-format-on-edit.sh +159 -0
- package/templates/hooks/cbp-maestro-yaml-validate.sh +100 -0
- package/templates/hooks/cbp-mcp-migration-guard.sh +32 -0
- package/templates/hooks/cbp-mcp-round-sync.sh +79 -0
- package/templates/hooks/cbp-mcp-worktree-inject.sh +76 -0
- package/templates/hooks/cbp-notify.sh +68 -0
- package/templates/hooks/cbp-plugin-dispatch.sh +29 -0
- package/templates/hooks/cbp-pre-commit-quality-gate.sh +204 -0
- package/templates/hooks/cbp-statusline.sh +347 -0
- package/templates/hooks/cbp-subagent-statusline.sh +182 -0
- package/templates/hooks/cbp-test-coverage-gate.sh +144 -0
- package/templates/hooks/cbp-test-hooks.sh +320 -0
- package/templates/hooks/hooks.json +85 -0
- package/templates/hooks/validate-context-usage.sh +59 -0
- package/templates/hooks/validate-git-commit.sh +78 -0
- package/templates/hooks/validate-git-stash-deny.sh +32 -0
- package/templates/hooks/validate-structure-lengths.sh +57 -0
- package/templates/hooks/validate-structure-lib.sh +104 -0
- package/templates/hooks/validate-structure-patterns.sh +54 -0
- package/templates/hooks/validate-structure-scope.sh +33 -0
- package/templates/hooks/validate-structure-smoke.sh +95 -0
- package/templates/hooks/validate-structure-templates.sh +34 -0
- package/templates/hooks/validate-structure.sh +69 -0
- package/templates/rules/.gitkeep +0 -0
- package/templates/rules/README.md +47 -0
- package/templates/rules/context-file-loading.md +52 -0
- package/templates/rules/scope-vocabulary.md +64 -0
- package/templates/rules/todo-backend.md +109 -0
- package/templates/settings.project.base.json +55 -0
- package/templates/settings.user.base.json +25 -0
- package/templates/skills/cbp-build-cc-agent/SKILL.md +139 -0
- package/templates/skills/cbp-build-cc-agent/examples/read-only-reviewer.md +32 -0
- package/templates/skills/cbp-build-cc-agent/examples/with-hooks.md +41 -0
- package/templates/skills/cbp-build-cc-agent/examples/with-skills-preload.md +25 -0
- package/templates/skills/cbp-build-cc-agent/reference/cbp-quality.md +153 -0
- package/templates/skills/cbp-build-cc-agent/reference/frontmatter-fields.md +37 -0
- package/templates/skills/cbp-build-cc-agent/reference/permission-modes.md +18 -0
- package/templates/skills/cbp-build-cc-agent/scripts/validate-agent.sh +67 -0
- package/templates/skills/cbp-build-cc-agent/templates/agent.md +66 -0
- package/templates/skills/cbp-build-cc-claude-file/SKILL.md +178 -0
- package/templates/skills/cbp-build-cc-claude-file/examples/minimal-project.md +33 -0
- package/templates/skills/cbp-build-cc-claude-file/examples/monorepo-with-imports.md +39 -0
- package/templates/skills/cbp-build-cc-claude-file/reference/imports.md +72 -0
- package/templates/skills/cbp-build-cc-claude-file/reference/what-belongs.md +39 -0
- package/templates/skills/cbp-build-cc-claude-file/templates/project-claude-md.md +48 -0
- package/templates/skills/cbp-build-cc-claude-file/templates/user-claude-md.md +22 -0
- package/templates/skills/cbp-build-cc-memory/SKILL.md +201 -0
- package/templates/skills/cbp-build-cc-memory/examples/feedback-memory.md +11 -0
- package/templates/skills/cbp-build-cc-memory/examples/project-memory.md +11 -0
- package/templates/skills/cbp-build-cc-memory/examples/reference-memory.md +13 -0
- package/templates/skills/cbp-build-cc-memory/examples/user-memory.md +14 -0
- package/templates/skills/cbp-build-cc-memory/reference/memory-types.md +59 -0
- package/templates/skills/cbp-build-cc-memory/reference/when-to-save.md +62 -0
- package/templates/skills/cbp-build-cc-memory/templates/MEMORY-index.md +4 -0
- package/templates/skills/cbp-build-cc-memory/templates/memory-entry.md +15 -0
- package/templates/skills/cbp-build-cc-mode/SKILL.md +99 -0
- package/templates/skills/cbp-build-cc-rule/SKILL.md +176 -0
- package/templates/skills/cbp-build-cc-rule/examples/global-rule.md +19 -0
- package/templates/skills/cbp-build-cc-rule/examples/scoped-rule.md +41 -0
- package/templates/skills/cbp-build-cc-rule/reference/paths-patterns.md +48 -0
- package/templates/skills/cbp-build-cc-rule/templates/rule.md +32 -0
- package/templates/skills/cbp-build-cc-settings/SKILL.md +220 -0
- package/templates/skills/cbp-build-cc-settings/examples/hooks-config.json +64 -0
- package/templates/skills/cbp-build-cc-settings/examples/permissions-config.json +34 -0
- package/templates/skills/cbp-build-cc-settings/examples/sandbox-config.json +42 -0
- package/templates/skills/cbp-build-cc-settings/reference/cbp-conventions.md +104 -0
- package/templates/skills/cbp-build-cc-settings/reference/permission-rules.md +61 -0
- package/templates/skills/cbp-build-cc-settings/reference/scope-precedence.md +73 -0
- package/templates/skills/cbp-build-cc-settings/reference/settings-fields.md +166 -0
- package/templates/skills/cbp-build-cc-settings/templates/settings.json +23 -0
- package/templates/skills/cbp-build-cc-settings/templates/settings.local.json +10 -0
- package/templates/skills/cbp-build-cc-skill/SKILL.md +154 -0
- package/templates/skills/cbp-build-cc-skill/examples/dynamic-context.md +31 -0
- package/templates/skills/cbp-build-cc-skill/examples/fork-skill.md +22 -0
- package/templates/skills/cbp-build-cc-skill/examples/knowledge-skill.md +25 -0
- package/templates/skills/cbp-build-cc-skill/examples/task-skill.md +29 -0
- package/templates/skills/cbp-build-cc-skill/reference/cbp-quality.md +157 -0
- package/templates/skills/cbp-build-cc-skill/reference/frontmatter-fields.md +35 -0
- package/templates/skills/cbp-build-cc-skill/reference/string-substitutions.md +60 -0
- package/templates/skills/cbp-build-cc-skill/scripts/validate-skill.sh +90 -0
- package/templates/skills/cbp-build-cc-skill/templates/skill.md +51 -0
- package/templates/skills/cbp-checkpoint-check/SKILL.md +156 -0
- package/templates/skills/cbp-checkpoint-complete/SKILL.md +109 -0
- package/templates/skills/cbp-checkpoint-create/SKILL.md +116 -0
- package/templates/skills/cbp-checkpoint-end/SKILL.md +241 -0
- package/templates/skills/cbp-checkpoint-plan/SKILL.md +137 -0
- package/templates/skills/cbp-checkpoint-plan/reference/alternative-comparison-template.md +54 -0
- package/templates/skills/cbp-checkpoint-plan/reference/dep-decision-rubric.md +50 -0
- package/templates/skills/cbp-checkpoint-plan/reference/e2e-discovery-probe.md +57 -0
- package/templates/skills/cbp-checkpoint-plan/reference/gap-analysis-playbook.md +47 -0
- package/templates/skills/cbp-checkpoint-start/SKILL.md +84 -0
- package/templates/skills/cbp-checkpoint-update/SKILL.md +115 -0
- package/templates/skills/cbp-frontend-a11y/SKILL.md +109 -0
- package/templates/skills/cbp-frontend-a11y/reference/aria-roles-states.md +130 -0
- package/templates/skills/cbp-frontend-a11y/reference/contrast-visual.md +122 -0
- package/templates/skills/cbp-frontend-a11y/reference/keyboard-patterns.md +154 -0
- package/templates/skills/cbp-frontend-a11y/reference/semantic-html.md +111 -0
- package/templates/skills/cbp-frontend-design/SKILL.md +145 -0
- package/templates/skills/cbp-frontend-design/reference/nextjs-scss.md +118 -0
- package/templates/skills/cbp-frontend-design/reference/rn-expo.md +101 -0
- package/templates/skills/cbp-frontend-design/reference/tauri-react.md +82 -0
- package/templates/skills/cbp-frontend-ui/SKILL.md +262 -0
- package/templates/skills/cbp-frontend-ui/reference/ui-label-maps.md +42 -0
- package/templates/skills/cbp-frontend-ui/reference/ui-layout-patterns.md +105 -0
- package/templates/skills/cbp-frontend-ui/reference/variant-defaults.md +149 -0
- package/templates/skills/cbp-frontend-ux/SKILL.md +181 -0
- package/templates/skills/cbp-git-branch-feat-create/SKILL.md +115 -0
- package/templates/skills/cbp-git-commit/SKILL.md +278 -0
- package/templates/skills/cbp-git-worktree-create/SKILL.md +226 -0
- package/templates/skills/cbp-git-worktree-remove/SKILL.md +145 -0
- package/templates/skills/cbp-merge-main/SKILL.md +228 -0
- package/templates/skills/cbp-round-check/SKILL.md +104 -0
- package/templates/skills/cbp-round-end/SKILL.md +183 -0
- package/templates/skills/cbp-round-end/reference/findings-presentation.md +44 -0
- package/templates/skills/cbp-round-end/reference/inline-fallback.md +35 -0
- package/templates/skills/cbp-round-execute/SKILL.md +211 -0
- package/templates/skills/cbp-round-execute/reference/inline-fallback.md +59 -0
- package/templates/skills/cbp-round-input/SKILL.md +165 -0
- package/templates/skills/cbp-round-start/SKILL.md +222 -0
- package/templates/skills/cbp-round-update/SKILL.md +163 -0
- package/templates/skills/cbp-session-end/SKILL.md +187 -0
- package/templates/skills/cbp-session-start/SKILL.md +155 -0
- package/templates/skills/cbp-ship/SKILL.md +332 -0
- package/templates/skills/cbp-ship/reference/changesets-overview.md +120 -0
- package/templates/skills/cbp-ship/reference/eas-cli-overview.md +60 -0
- package/templates/skills/cbp-ship/reference/gh-cli-overview.md +135 -0
- package/templates/skills/cbp-ship/reference/gh-cli-shipment-commands.md +283 -0
- package/templates/skills/cbp-ship/reference/npm-publish-monorepo.md +252 -0
- package/templates/skills/cbp-ship/reference/npm-publish-oidc-trusted.md +157 -0
- package/templates/skills/cbp-ship/reference/npm-publish-overview.md +171 -0
- package/templates/skills/cbp-ship/reference/preflight-checklist.md +88 -0
- package/templates/skills/cbp-ship/reference/railway-nestjs-deployment.md +169 -0
- package/templates/skills/cbp-ship/reference/railway-overview.md +120 -0
- package/templates/skills/cbp-ship/reference/railway-troubleshooting.md +168 -0
- package/templates/skills/cbp-ship/reference/release-please-overview.md +99 -0
- package/templates/skills/cbp-ship/reference/surface-expo-eas.md +155 -0
- package/templates/skills/cbp-ship/reference/surface-npm.md +180 -0
- package/templates/skills/cbp-ship/reference/surface-railway.md +152 -0
- package/templates/skills/cbp-ship/reference/surface-supabase.md +178 -0
- package/templates/skills/cbp-ship/reference/surface-tauri.md +138 -0
- package/templates/skills/cbp-ship/reference/surface-vercel.md +124 -0
- package/templates/skills/cbp-ship/reference/surface-vscode-ext.md +144 -0
- package/templates/skills/cbp-ship/reference/surfaces.md +60 -0
- package/templates/skills/cbp-ship/reference/testflight-automation.md +215 -0
- package/templates/skills/cbp-ship/reference/testflight-internal-vs-external.md +69 -0
- package/templates/skills/cbp-ship/reference/testflight-overview.md +98 -0
- package/templates/skills/cbp-ship/reference/versioning.md +116 -0
- package/templates/skills/cbp-ship/scripts/detect-surfaces.sh +217 -0
- package/templates/skills/cbp-ship/scripts/verify-expo-eas.sh +35 -0
- package/templates/skills/cbp-ship/scripts/verify-npm.sh +21 -0
- package/templates/skills/cbp-ship/scripts/verify-railway.sh +41 -0
- package/templates/skills/cbp-ship/scripts/verify-supabase.sh +19 -0
- package/templates/skills/cbp-ship/scripts/verify-tauri.sh +24 -0
- package/templates/skills/cbp-ship/scripts/verify-vercel.sh +32 -0
- package/templates/skills/cbp-ship/scripts/verify-vscode-ext.sh +25 -0
- package/templates/skills/cbp-ship/templates/eas.json +66 -0
- package/templates/skills/cbp-ship/templates/railway.toml +15 -0
- package/templates/skills/cbp-ship/templates/release-please-config.json +17 -0
- package/templates/skills/cbp-ship/templates/vercel.json +19 -0
- package/templates/skills/cbp-ship/templates/vscodeignore +21 -0
- package/templates/skills/cbp-ship/templates/workflow-changesets.yml +41 -0
- package/templates/skills/cbp-ship/templates/workflow-eas-submit.yml +53 -0
- package/templates/skills/cbp-ship/templates/workflow-npm-publish.yml +36 -0
- package/templates/skills/cbp-ship/templates/workflow-release-please.yml +21 -0
- package/templates/skills/cbp-ship/templates/workflow-tauri-release.yml +69 -0
- package/templates/skills/cbp-ship/templates/workflow-vsce-publish.yml +31 -0
- package/templates/skills/cbp-ship-configure/SKILL.md +296 -0
- package/templates/skills/cbp-ship-configure/reference/expo-mobile.md +204 -0
- package/templates/skills/cbp-ship-configure/reference/npm-package.md +165 -0
- package/templates/skills/cbp-ship-configure/reference/railway-backend.md +199 -0
- package/templates/skills/cbp-ship-configure/reference/supabase.md +200 -0
- package/templates/skills/cbp-ship-configure/reference/tauri-desktop.md +181 -0
- package/templates/skills/cbp-ship-configure/reference/vercel.md +117 -0
- package/templates/skills/cbp-ship-configure/reference/vscode-ext.md +155 -0
- package/templates/skills/cbp-ship-main/SKILL.md +65 -0
- package/templates/skills/cbp-supabase-branch-check/SKILL.md +337 -0
- package/templates/skills/cbp-supabase-branch-check/reference/dag-steps.md +29 -0
- package/templates/skills/cbp-supabase-migrate/SKILL.md +314 -0
- package/templates/skills/cbp-supabase-migrate/reference/advisor-triage.md +70 -0
- package/templates/skills/cbp-supabase-migrate/reference/cli-fallback.md +87 -0
- package/templates/skills/cbp-supabase-migrate/reference/preflight-dry-run.md +58 -0
- package/templates/skills/cbp-supabase-setup/SKILL.md +239 -0
- package/templates/skills/cbp-supabase-setup/reference/branching-setup.md +121 -0
- package/templates/skills/cbp-supabase-setup/reference/cli-fallback.md +109 -0
- package/templates/skills/cbp-task-check/SKILL.md +166 -0
- package/templates/skills/cbp-task-complete/SKILL.md +206 -0
- package/templates/skills/cbp-task-complete/reference/checkpoint-done-branching.md +48 -0
- package/templates/skills/cbp-task-complete/reference/next-step-heuristic.md +56 -0
- package/templates/skills/cbp-task-create/SKILL.md +167 -0
- package/templates/skills/cbp-task-start/SKILL.md +239 -0
- package/templates/skills/cbp-task-testing/SKILL.md +277 -0
- package/templates/skills/cbp-todo/SKILL.md +111 -0
|
@@ -0,0 +1,332 @@
|
|
|
1
|
+
---
|
|
2
|
+
scope: org-shared
|
|
3
|
+
name: cbp-ship
|
|
4
|
+
description: Orchestrate runtime deployment for a checkpoint — Vercel web, EAS mobile (Expo Go dev build / TestFlight preview), Tauri desktop, npm package publish, VS Code extension, Railway backend, Supabase migrations. Detects configured surfaces, walks the user through what to deploy, executes per-surface deploy steps, verifies each landed.
|
|
5
|
+
effort: xhigh
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# Ship Command
|
|
9
|
+
|
|
10
|
+
Single orchestrator for deploying a checkpoint to every runtime it has — web (Vercel), mobile (EAS / TestFlight), desktop (Tauri), npm packages, VS Code extension, backend (Railway), database migrations (Supabase).
|
|
11
|
+
|
|
12
|
+
Step 1 of `/cbp-checkpoint-end` handles branch promotion to main via `/cbp-ship-main` (which runs `codebyplan ship`). Runtime deployment happens here, after the branch is already merged.
|
|
13
|
+
|
|
14
|
+
## When to Use
|
|
15
|
+
|
|
16
|
+
- Auto-called by `/cbp-checkpoint-end` after branch promotion to main completes
|
|
17
|
+
- User-invokable directly when re-running shipment after a fix (e.g., "Vercel deploy failed, fix the env var, re-run `/cbp-ship`")
|
|
18
|
+
- NOT for mid-checkpoint dev iteration — local development uses `npx expo start` / `pnpm dev` etc., not this skill
|
|
19
|
+
|
|
20
|
+
## Inputs
|
|
21
|
+
|
|
22
|
+
| Source | What's read |
|
|
23
|
+
| ----------------------------- | ----------------------------------------------------------------------------------------- |
|
|
24
|
+
| MCP `get_current_task` | Active checkpoint (for context.shipment write-back) |
|
|
25
|
+
| `.codebyplan/git.json` + `.codebyplan/shipment.json` | `branch_config`, `shipment` section if present (per `ship-configure`) |
|
|
26
|
+
| Repo scan | Detect surfaces from filesystem (vercel.json, eas.json, package.json publishConfig, etc.) |
|
|
27
|
+
| `checkpoint.context.shipment` | Last shipment record (timestamp, surfaces, results) |
|
|
28
|
+
|
|
29
|
+
## Instructions
|
|
30
|
+
|
|
31
|
+
### Step 1 — Detect applicable surfaces
|
|
32
|
+
|
|
33
|
+
Run the detection script:
|
|
34
|
+
|
|
35
|
+
```bash
|
|
36
|
+
bash "${CLAUDE_SKILL_DIR}/scripts/detect-surfaces.sh"
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
It emits JSON of the form:
|
|
40
|
+
|
|
41
|
+
```json
|
|
42
|
+
{
|
|
43
|
+
"surfaces": [
|
|
44
|
+
{
|
|
45
|
+
"id": "vercel-web",
|
|
46
|
+
"app_path": "apps/web",
|
|
47
|
+
"configured": true,
|
|
48
|
+
"reason": "vercel.json + .vercel/project.json present"
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
"id": "expo-mobile",
|
|
52
|
+
"app_path": "apps/mobile",
|
|
53
|
+
"configured": false,
|
|
54
|
+
"reason": "app.json present but eas.json missing"
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
"id": "tauri-desktop",
|
|
58
|
+
"app_path": "apps/desktop",
|
|
59
|
+
"configured": true,
|
|
60
|
+
"reason": "src-tauri/ + .github/workflows/release-desktop.yml present"
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
"id": "npm-package",
|
|
64
|
+
"app_path": "packages/codebyplan-package",
|
|
65
|
+
"configured": true,
|
|
66
|
+
"reason": "publishConfig.access set"
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
"id": "vscode-ext",
|
|
70
|
+
"app_path": "apps/vscode",
|
|
71
|
+
"configured": false,
|
|
72
|
+
"reason": "package.json contributes block missing publisher"
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
"id": "railway-backend",
|
|
76
|
+
"app_path": "apps/backend",
|
|
77
|
+
"configured": false,
|
|
78
|
+
"reason": "Dockerfile missing + railway.toml absent"
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
"id": "supabase",
|
|
82
|
+
"migrations_pending": 4,
|
|
83
|
+
"configured": true,
|
|
84
|
+
"reason": "supabase/migrations/ has 4 entries newer than last shipment"
|
|
85
|
+
}
|
|
86
|
+
]
|
|
87
|
+
}
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
Each surface is one of: `configured: true` (ready to ship), `configured: false` (detected but missing setup), or absent from the array (not detected at all — e.g., a repo with no mobile app).
|
|
91
|
+
|
|
92
|
+
Surface catalog reference: [reference/surfaces.md](reference/surfaces.md).
|
|
93
|
+
|
|
94
|
+
### Step 2 — Handle gaps for early-stage repos
|
|
95
|
+
|
|
96
|
+
For each surface with `configured: false`, present the gap to the user:
|
|
97
|
+
|
|
98
|
+
```
|
|
99
|
+
[surface-id] detected at [app_path] but not configured for shipment.
|
|
100
|
+
Reason: [reason]
|
|
101
|
+
|
|
102
|
+
Options:
|
|
103
|
+
A) Configure now via /cbp-ship-configure --surface=[id]
|
|
104
|
+
B) Skip this surface for this checkpoint
|
|
105
|
+
C) Mark "not shipping yet" — record in .codebyplan/shipment.json `disabled[]` (no future prompts)
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
Use AskUserQuestion. Skip is the safe default for first-stage repos — a Next.js app that's never been Vercel-linked shouldn't block checkpoint shipment. Choice C writes `{"disabled":["vercel-web"]}` to `.codebyplan/shipment.json` so subsequent checkpoints don't re-ask.
|
|
109
|
+
|
|
110
|
+
If ALL detected surfaces are unconfigured AND the user picks Skip/Mark for all, exit with `## No deployable surfaces configured. Branch promotion already completed; runtime deploy skipped.` Do NOT treat this as failure.
|
|
111
|
+
|
|
112
|
+
### Step 3 — Build the shipment plan
|
|
113
|
+
|
|
114
|
+
For each surface with `configured: true`, determine the deploy variant:
|
|
115
|
+
|
|
116
|
+
| Surface | Variants |
|
|
117
|
+
| ----------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
118
|
+
| `vercel-web` | `production` (when shipping to PRODUCTION branch — Vercel auto-deploys), `preview` (Vercel auto-creates per-PR), `manual` (force redeploy via `vercel --prod`) |
|
|
119
|
+
| `expo-mobile` | `expo-go` (dev build via `npx expo start`, no shipment — informational only), `eas-internal` (EAS build + TestFlight internal group), `eas-external` (TestFlight external — review-gated, opt-in only) |
|
|
120
|
+
| `tauri-desktop` | `tag-and-release` (push `v*.*.*` tag, GH Actions builds + signs) — variant matters only when version bumped this checkpoint |
|
|
121
|
+
| `npm-package` | `publish` (only when `package.json` version bumped or release-please PR merged this checkpoint) |
|
|
122
|
+
| `vscode-ext` | `vsce-publish` (only when version bumped) |
|
|
123
|
+
| `railway-backend` | `deploy` (Railway redeploys on integration push if linked; manual `railway up` otherwise) |
|
|
124
|
+
| `supabase` | `push-migrations` (only when pending count > 0) — interactive, walks user through diff/review/push |
|
|
125
|
+
|
|
126
|
+
For mobile: ask the user via AskUserQuestion which variant for THIS checkpoint:
|
|
127
|
+
|
|
128
|
+
```
|
|
129
|
+
Mobile shipment for this checkpoint:
|
|
130
|
+
A) Skip — local dev only this checkpoint
|
|
131
|
+
B) EAS build + TestFlight internal (preview to internal testers)
|
|
132
|
+
C) EAS build + TestFlight external (review-gated, public-facing beta)
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
For all other surfaces, default to the variant that matches the branch the checkpoint just shipped to (`production` for main, `preview` for staging/integration). Don't ask unless the inferred variant is ambiguous (e.g., mobile, or version-gated surfaces where no version bump happened).
|
|
136
|
+
|
|
137
|
+
### Step 4 — Confirm the shipment plan
|
|
138
|
+
|
|
139
|
+
Present the plan in one block, ask for confirmation:
|
|
140
|
+
|
|
141
|
+
```
|
|
142
|
+
## Shipment Plan — Checkpoint CHK-NNN [title]
|
|
143
|
+
|
|
144
|
+
Will deploy:
|
|
145
|
+
- vercel-web (apps/web) → production (auto-deploy on main merge)
|
|
146
|
+
- expo-mobile (apps/mobile) → eas-internal (TestFlight internal group)
|
|
147
|
+
- supabase → push 4 pending migrations (interactive review)
|
|
148
|
+
|
|
149
|
+
Will skip:
|
|
150
|
+
- tauri-desktop → no version bump this checkpoint
|
|
151
|
+
- npm-package → no version bump this checkpoint
|
|
152
|
+
- vscode-ext → not configured (run /cbp-ship-configure when ready)
|
|
153
|
+
|
|
154
|
+
Confirm shipment? [yes / change / abort]
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
Use AskUserQuestion. On `change`, re-enter Step 3 with prior answers as defaults. On `abort`, write `checkpoint.context.shipment.aborted_at` and stop — caller (`/cbp-checkpoint-end`) treats abort as "do not call `/cbp-checkpoint-complete`."
|
|
158
|
+
|
|
159
|
+
### Step 5 — Execute per-surface deploys
|
|
160
|
+
|
|
161
|
+
For each confirmed surface, load the surface reference file and execute its deploy procedure:
|
|
162
|
+
|
|
163
|
+
| Surface | Reference |
|
|
164
|
+
| ----------------- | ------------------------------------------------------------------ |
|
|
165
|
+
| `vercel-web` | [reference/surface-vercel.md](reference/surface-vercel.md) |
|
|
166
|
+
| `expo-mobile` | [reference/surface-expo-eas.md](reference/surface-expo-eas.md) |
|
|
167
|
+
| `tauri-desktop` | [reference/surface-tauri.md](reference/surface-tauri.md) |
|
|
168
|
+
| `npm-package` | [reference/surface-npm.md](reference/surface-npm.md) |
|
|
169
|
+
| `vscode-ext` | [reference/surface-vscode-ext.md](reference/surface-vscode-ext.md) |
|
|
170
|
+
| `railway-backend` | [reference/surface-railway.md](reference/surface-railway.md) |
|
|
171
|
+
| `supabase` | [reference/surface-supabase.md](reference/surface-supabase.md) |
|
|
172
|
+
|
|
173
|
+
Each reference file has a `## STEPS` section the orchestrator follows literally. When a step needs user input (npm OTP, TestFlight credentials, Supabase migration approval), use AskUserQuestion inline — do NOT batch user input upfront, because a user may need to abort after seeing one surface's prompt.
|
|
174
|
+
|
|
175
|
+
Run surfaces sequentially in the order: `supabase` → `vercel-web` → `railway-backend` → `expo-mobile` → `tauri-desktop` → `vscode-ext` → `npm-package`. Database migrations first (web/backend depend on schema). Mobile/desktop/extension/npm later (independent tails).
|
|
176
|
+
|
|
177
|
+
If a surface fails:
|
|
178
|
+
|
|
179
|
+
- Capture the error in `shipment_results[surface_id]`
|
|
180
|
+
- Continue with subsequent surfaces (don't block the whole shipment on one failure)
|
|
181
|
+
- Surface the failure in the final report with a clear remediation hint
|
|
182
|
+
|
|
183
|
+
EXCEPTION: `supabase` migration push failure halts the rest. Schema mismatch downstream is worse than partial shipment.
|
|
184
|
+
|
|
185
|
+
### Step 6 — Verify each surface landed
|
|
186
|
+
|
|
187
|
+
After each surface deploys, run its verification:
|
|
188
|
+
|
|
189
|
+
```bash
|
|
190
|
+
bash "${CLAUDE_SKILL_DIR}/scripts/verify-vercel.sh" "$VERCEL_DEPLOYMENT_ID"
|
|
191
|
+
bash "${CLAUDE_SKILL_DIR}/scripts/verify-expo-eas.sh" "$EAS_BUILD_ID"
|
|
192
|
+
bash "${CLAUDE_SKILL_DIR}/scripts/verify-railway.sh" "$RAILWAY_PROJECT_ID"
|
|
193
|
+
bash "${CLAUDE_SKILL_DIR}/scripts/verify-supabase.sh" "$MIGRATION_VERSION"
|
|
194
|
+
```
|
|
195
|
+
|
|
196
|
+
Verification timeouts are conservative (Vercel: 5min, EAS: 30min, TestFlight processing: 15min). On timeout, mark `verification_pending` (not failure) — the deploy may still complete async.
|
|
197
|
+
|
|
198
|
+
### Step 7 — Persist shipment record
|
|
199
|
+
|
|
200
|
+
Write to `checkpoint.context.shipment` via MCP `update_checkpoint`:
|
|
201
|
+
|
|
202
|
+
```json
|
|
203
|
+
{
|
|
204
|
+
"shipment": {
|
|
205
|
+
"timestamp": "2026-04-29T14:32:00Z",
|
|
206
|
+
"surfaces": [
|
|
207
|
+
{
|
|
208
|
+
"id": "vercel-web",
|
|
209
|
+
"variant": "production",
|
|
210
|
+
"status": "verified",
|
|
211
|
+
"url": "https://codebyplan.com",
|
|
212
|
+
"deployment_id": "dpl_xyz"
|
|
213
|
+
},
|
|
214
|
+
{
|
|
215
|
+
"id": "expo-mobile",
|
|
216
|
+
"variant": "eas-internal",
|
|
217
|
+
"status": "verified",
|
|
218
|
+
"build_id": "abc123",
|
|
219
|
+
"testflight_group": "internal"
|
|
220
|
+
},
|
|
221
|
+
{
|
|
222
|
+
"id": "supabase",
|
|
223
|
+
"variant": "push-migrations",
|
|
224
|
+
"status": "verified",
|
|
225
|
+
"migrations_applied": [
|
|
226
|
+
"0083_add_x",
|
|
227
|
+
"0084_index_y",
|
|
228
|
+
"0085_rls_z",
|
|
229
|
+
"0086_view_w"
|
|
230
|
+
]
|
|
231
|
+
}
|
|
232
|
+
],
|
|
233
|
+
"skipped": [
|
|
234
|
+
{ "id": "tauri-desktop", "reason": "no version bump" },
|
|
235
|
+
{ "id": "vscode-ext", "reason": "not configured" }
|
|
236
|
+
],
|
|
237
|
+
"aborted_at": null
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
```
|
|
241
|
+
|
|
242
|
+
### Step 8 — Report
|
|
243
|
+
|
|
244
|
+
```
|
|
245
|
+
## Shipment Complete — CHK-NNN
|
|
246
|
+
|
|
247
|
+
| Surface | Variant | Status | URL/ID |
|
|
248
|
+
|---|---|---|---|
|
|
249
|
+
| vercel-web | production | ✓ verified | https://codebyplan.com (dpl_xyz) |
|
|
250
|
+
| expo-mobile | eas-internal | ✓ verified | TestFlight build #42 |
|
|
251
|
+
| supabase | push-migrations | ✓ verified | 4 migrations applied |
|
|
252
|
+
| tauri-desktop | — | ⊘ skipped | no version bump |
|
|
253
|
+
| vscode-ext | — | ⊘ skipped | not configured |
|
|
254
|
+
|
|
255
|
+
All shipments succeeded. Returning control to /cbp-checkpoint-end.
|
|
256
|
+
```
|
|
257
|
+
|
|
258
|
+
If any surface failed, the report leads with the failures and offers re-run paths:
|
|
259
|
+
|
|
260
|
+
```
|
|
261
|
+
## Shipment Partial — CHK-NNN
|
|
262
|
+
|
|
263
|
+
✓ vercel-web (production) → https://codebyplan.com
|
|
264
|
+
✗ expo-mobile (eas-internal) → BUILD FAILED: missing APPLE_TEAM_ID
|
|
265
|
+
Fix: /cbp-ship-configure --surface=expo-mobile, then re-run /cbp-ship
|
|
266
|
+
⊘ tauri-desktop → skipped (no version bump)
|
|
267
|
+
|
|
268
|
+
Checkpoint shipment is incomplete. /cbp-checkpoint-end will hold; resolve and re-run.
|
|
269
|
+
```
|
|
270
|
+
|
|
271
|
+
## Shipment Manifest in `.codebyplan/shipment.json` (optional)
|
|
272
|
+
|
|
273
|
+
Repos can override default detection by adding entries to `.codebyplan/shipment.json`:
|
|
274
|
+
|
|
275
|
+
```json
|
|
276
|
+
{
|
|
277
|
+
"disabled": ["vscode-ext"],
|
|
278
|
+
"surfaces": {
|
|
279
|
+
"vercel-web": { "project_id": "prj_abc", "team_id": "team_xyz" },
|
|
280
|
+
"railway-backend": {
|
|
281
|
+
"project_id": "rl_123",
|
|
282
|
+
"service_id": "svc_456",
|
|
283
|
+
"platform": "railway"
|
|
284
|
+
},
|
|
285
|
+
"expo-mobile": {
|
|
286
|
+
"eas_project_id": "ea_789",
|
|
287
|
+
"default_testflight_group": "internal"
|
|
288
|
+
},
|
|
289
|
+
"supabase": { "project_ref": "abcdefgh", "skip_seed": true }
|
|
290
|
+
}
|
|
291
|
+
}
|
|
292
|
+
```
|
|
293
|
+
|
|
294
|
+
When present, this overrides scan results. `ship-configure` writes here.
|
|
295
|
+
|
|
296
|
+
## Key Rules
|
|
297
|
+
|
|
298
|
+
- **Branch promotion happens BEFORE this skill** — `/cbp-checkpoint-end` calls `/cbp-ship-main` first (which runs `codebyplan ship`); this skill handles runtime deployment only, never branch promotion
|
|
299
|
+
- **Sequential, not parallel** — surfaces deploy in defined order; supabase first
|
|
300
|
+
- **One verification per surface** — never claim shipment without running the verify script
|
|
301
|
+
- **AskUserQuestion inline, not batched** — user can abort mid-shipment
|
|
302
|
+
- **Skip ≠ fail** — unconfigured surfaces are normal for early-stage repos; never block on them
|
|
303
|
+
- **No mid-checkpoint invocation for dev builds** — local dev uses `npx expo start` / `pnpm dev`; this skill is end-of-checkpoint only
|
|
304
|
+
- **Credentials never live in `.claude/`** — Apple keys, npm tokens, supabase access tokens stay in CLI session / keychain / GH secrets; this skill checks they're reachable, never stores them
|
|
305
|
+
- **Read all platform names from config** — never hardcode "production"/"main"/"development"
|
|
306
|
+
|
|
307
|
+
## Error Recovery
|
|
308
|
+
|
|
309
|
+
| Failure | Action |
|
|
310
|
+
| ----------------------------- | --------------------------------------------------------------------------- |
|
|
311
|
+
| Vercel deploy timeout | Mark `verification_pending`, continue — Vercel async-deploys |
|
|
312
|
+
| EAS build failed (credential) | Stop mobile surface, surface error, continue other surfaces |
|
|
313
|
+
| Supabase migration error | HALT shipment — schema mismatch is worse than partial deploy |
|
|
314
|
+
| npm publish 2FA reject | Stop npm surface, ask user to re-run with fresh OTP |
|
|
315
|
+
| Railway deploy failed | Continue, mark failed — backend can be re-deployed independently |
|
|
316
|
+
| All surfaces failed | Write `shipment.aborted_at`, return failure to `/cbp-checkpoint-end` |
|
|
317
|
+
|
|
318
|
+
## Additional resources
|
|
319
|
+
|
|
320
|
+
- Surface catalog: [reference/surfaces.md](reference/surfaces.md)
|
|
321
|
+
- Versioning rules: [reference/versioning.md](reference/versioning.md)
|
|
322
|
+
- Pre-flight checklist: [reference/preflight-checklist.md](reference/preflight-checklist.md)
|
|
323
|
+
- Configure setup: `/cbp-ship-configure`
|
|
324
|
+
- Detection script: [scripts/detect-surfaces.sh](scripts/detect-surfaces.sh)
|
|
325
|
+
|
|
326
|
+
## Integration
|
|
327
|
+
|
|
328
|
+
- **Triggered by**: `/cbp-checkpoint-end` (auto, after branch promotion to main via `/cbp-ship-main`); user direct invocation for re-runs
|
|
329
|
+
- **Reads**: MCP `get_current_task`, `.codebyplan/git.json` + `.codebyplan/shipment.json` (`branch_config` + `shipment`), filesystem scan
|
|
330
|
+
- **Writes**: MCP `update_checkpoint` (context.shipment)
|
|
331
|
+
- **Calls**: per-surface deploy via reference files (vercel CLI, eas CLI, supabase CLI, npm, vsce, railway CLI, gh release)
|
|
332
|
+
- **Triggers**: returns control to caller — does NOT auto-trigger `/cbp-checkpoint-complete` (that's the caller's job)
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
# Changesets — Overview
|
|
2
|
+
|
|
3
|
+
`@changesets/cli` is a versioning + changelog tool optimized for monorepos with many published packages. Devs add a `.changeset/*.md` entry alongside their feature work describing which packages bump and how (major/minor/patch). An aggregator GH Action (`changesets/action`) opens a "Version Packages" PR that consolidates pending changesets into version bumps + CHANGELOG entries; merging that PR triggers `changeset publish` to npm.
|
|
4
|
+
|
|
5
|
+
Used by the `npm-package` surface in `/cbp-ship` as one of three versioning modes — recommended for monorepos with 3+ published packages.
|
|
6
|
+
|
|
7
|
+
Upstream: https://github.com/changesets/changesets
|
|
8
|
+
|
|
9
|
+
## How `/cbp-ship` uses it
|
|
10
|
+
|
|
11
|
+
The `npm-package` surface ([surface-npm.md](./surface-npm.md)) offers changesets as one of three versioning modes. When a repo opts in via `/cbp-ship-configure`:
|
|
12
|
+
|
|
13
|
+
1. Configure runs `pnpm add -Dw @changesets/cli` + `npx changeset init` + scaffolds the workflow from `templates/workflow-changesets.yml`
|
|
14
|
+
2. Devs run `pnpm changeset` after each feature, committing the resulting `.changeset/*.md` file
|
|
15
|
+
3. The `changesets/action` workflow opens a "Version Packages" PR (or updates the existing one)
|
|
16
|
+
4. Maintainer reviews + merges
|
|
17
|
+
5. The action runs `pnpm changeset publish` which calls `pnpm publish -r` for every bumped package, with OIDC `--provenance`
|
|
18
|
+
|
|
19
|
+
A pre-merge gate (`changeset status` in CI) prevents merges without an accompanying changeset for changes to published packages.
|
|
20
|
+
|
|
21
|
+
## Changeset file format
|
|
22
|
+
|
|
23
|
+
```markdown
|
|
24
|
+
---
|
|
25
|
+
"@codebyplan/cli": minor
|
|
26
|
+
"@codebyplan/auth": patch
|
|
27
|
+
---
|
|
28
|
+
|
|
29
|
+
Add new export `foo` and fix bug in `bar`.
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
The frontmatter lists affected packages with bump types. The body becomes the changelog entry. Filenames are auto-generated (e.g. `funky-tigers-dance.md`) — random words to avoid merge conflicts when multiple devs add changesets in parallel.
|
|
33
|
+
|
|
34
|
+
## Config
|
|
35
|
+
|
|
36
|
+
`.changeset/config.json` essentials:
|
|
37
|
+
|
|
38
|
+
```json
|
|
39
|
+
{
|
|
40
|
+
"$schema": "https://unpkg.com/@changesets/config@3.0.0/schema.json",
|
|
41
|
+
"changelog": "@changesets/cli/changelog",
|
|
42
|
+
"commit": false,
|
|
43
|
+
"fixed": [],
|
|
44
|
+
"linked": [],
|
|
45
|
+
"access": "public",
|
|
46
|
+
"baseBranch": "main",
|
|
47
|
+
"updateInternalDependencies": "patch",
|
|
48
|
+
"ignore": ["@codebyplan/web", "@codebyplan/backend"]
|
|
49
|
+
}
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
| Field | Purpose |
|
|
53
|
+
|---|---|
|
|
54
|
+
| `access` | npm publish access (`public` for scoped public packages) |
|
|
55
|
+
| `baseBranch` | Branch the aggregator PR is opened against |
|
|
56
|
+
| `commit` | If `true`, commits version bumps directly; CBP keeps `false` for PR-based review |
|
|
57
|
+
| `fixed` | Arrays of package names that always bump together as one unit (same version) |
|
|
58
|
+
| `linked` | Arrays of packages that bump together but keep independent versions |
|
|
59
|
+
| `updateInternalDependencies` | When pkg A depends on pkg B and B bumps, what version range update A gets |
|
|
60
|
+
| `ignore` | Packages excluded from version-PR consideration (apps, internal-only) |
|
|
61
|
+
|
|
62
|
+
## Workflow shape
|
|
63
|
+
|
|
64
|
+
`templates/workflow-changesets.yml`:
|
|
65
|
+
|
|
66
|
+
```yaml
|
|
67
|
+
name: changesets
|
|
68
|
+
on:
|
|
69
|
+
push:
|
|
70
|
+
branches: [main]
|
|
71
|
+
|
|
72
|
+
permissions:
|
|
73
|
+
contents: write
|
|
74
|
+
pull-requests: write
|
|
75
|
+
id-token: write # for npm OIDC trusted publishing
|
|
76
|
+
|
|
77
|
+
jobs:
|
|
78
|
+
release:
|
|
79
|
+
runs-on: ubuntu-latest
|
|
80
|
+
steps:
|
|
81
|
+
- uses: actions/checkout@v4
|
|
82
|
+
with: { fetch-depth: 0 }
|
|
83
|
+
- uses: pnpm/action-setup@v4
|
|
84
|
+
- uses: actions/setup-node@v4
|
|
85
|
+
with:
|
|
86
|
+
node-version: '20'
|
|
87
|
+
registry-url: https://registry.npmjs.org
|
|
88
|
+
- run: pnpm install --frozen-lockfile
|
|
89
|
+
- uses: changesets/action@v1
|
|
90
|
+
with:
|
|
91
|
+
version: pnpm changeset version
|
|
92
|
+
publish: pnpm changeset publish
|
|
93
|
+
commit: 'chore(release): version packages'
|
|
94
|
+
title: 'chore(release): version packages'
|
|
95
|
+
env:
|
|
96
|
+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
97
|
+
NPM_CONFIG_PROVENANCE: 'true'
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
Note `NPM_CONFIG_PROVENANCE: 'true'` — equivalent to `--provenance` on every publish. Combined with `id-token: write` and trusted publishing, no NPM_TOKEN is needed.
|
|
101
|
+
|
|
102
|
+
## Common gotchas
|
|
103
|
+
|
|
104
|
+
| Symptom | Cause | Fix |
|
|
105
|
+
|---|---|---|
|
|
106
|
+
| Forgotten changesets | Dev merged a PR without `pnpm changeset` | Add `changeset status` step in CI to fail PRs that touch published packages without a changeset |
|
|
107
|
+
| Version PR conflicts | Two parallel branches both have changesets that bump the same package | Last-merged wins; the `changeset version` command consumes existing changesets, so the next aggregator run is clean |
|
|
108
|
+
| Accidental publish of internal package | Forgot `"private": true` on an internal package | `npm unpublish` within 72h, OR `npm deprecate` after; add `"private": true` and ship |
|
|
109
|
+
| `workspace:*` strings in tarball | Used `npm publish` instead of `pnpm publish` | Always use pnpm publish for workspace packages — it rewrites the protocol at pack time |
|
|
110
|
+
|
|
111
|
+
## Comparison vs release-please
|
|
112
|
+
|
|
113
|
+
See [versioning.md](./versioning.md) and [npm-publish-monorepo.md](./npm-publish-monorepo.md) for the full decision. Short version: changesets is the default for monorepos with many independent packages and mixed-contributor PRs; release-please is simpler when Conventional Commits are already enforced and there's a single (or few) tightly-coupled packages.
|
|
114
|
+
|
|
115
|
+
## Pairs With
|
|
116
|
+
|
|
117
|
+
- [surface-npm.md](./surface-npm.md) — npm publish surface that consumes bumped versions
|
|
118
|
+
- [versioning.md](./versioning.md) — when changesets is the right pick
|
|
119
|
+
- [npm-publish-monorepo.md](./npm-publish-monorepo.md) — pnpm-monorepo-specific config and pre-publish gates
|
|
120
|
+
- `templates/workflow-changesets.yml` — workflow scaffold dropped by the configure skill
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
# EAS CLI — Overview
|
|
2
|
+
|
|
3
|
+
`eas-cli` (latest stable: 16.21.0 family) is the command-line tool for Expo Application Services. It builds Expo / React Native apps in the cloud (`eas build`), submits them to TestFlight / Play Console (`eas submit`), pushes runtime updates over-the-air (`eas update`), and manages credentials (`eas credentials`). Required for any mobile shipment via the `expo-mobile` surface in `/cbp-ship`.
|
|
4
|
+
|
|
5
|
+
Upstream docs: https://docs.expo.dev/eas/
|
|
6
|
+
|
|
7
|
+
## Commands `/cbp-ship` actually calls
|
|
8
|
+
|
|
9
|
+
The `expo-mobile` surface ([surface-expo-eas.md](./surface-expo-eas.md)) calls these:
|
|
10
|
+
|
|
11
|
+
| Command | Purpose |
|
|
12
|
+
|---|---|
|
|
13
|
+
| `eas build --profile <name> --platform <p> --non-interactive --no-wait` | Kick off a cloud build; returns build IDs immediately |
|
|
14
|
+
| `eas build:wait --build-id <id>` | Block until build reaches FINISHED state |
|
|
15
|
+
| `eas build:view <id> --json` | Inspect build status (used by `verify-expo-eas.sh`) |
|
|
16
|
+
| `eas submit --platform <p> --id <build-id> --non-interactive` | Upload finished build to TestFlight (iOS) / Play (Android) |
|
|
17
|
+
| `eas submit:list --status finished --json` | Verify submission completed |
|
|
18
|
+
| `eas credentials` | Interactive — Apple Distribution Certificate, Provisioning Profile, Push Notification Key, Android keystore |
|
|
19
|
+
| `eas init` | Initialise EAS project (one-time, configure setup only) |
|
|
20
|
+
| `eas whoami` | Probe — verify CLI auth |
|
|
21
|
+
|
|
22
|
+
## Build profiles used
|
|
23
|
+
|
|
24
|
+
Per `templates/eas.json` in this skill:
|
|
25
|
+
|
|
26
|
+
| Profile | Distribution | Auto-increment | Use |
|
|
27
|
+
|---|---|---|---|
|
|
28
|
+
| `development` | internal (dev client) | none | Local dev iteration |
|
|
29
|
+
| `preview` | internal | buildNumber | TestFlight internal group, fast feedback |
|
|
30
|
+
| `production` | store | buildNumber | TestFlight external review → App Store |
|
|
31
|
+
|
|
32
|
+
## Auth model
|
|
33
|
+
|
|
34
|
+
EAS auth is a CLI session bound to an Expo account:
|
|
35
|
+
|
|
36
|
+
- `eas login` — interactive browser auth, stores token at `~/.expo/state.json`
|
|
37
|
+
- `EXPO_TOKEN` env var — for CI; bypasses interactive login
|
|
38
|
+
- `eas whoami` — probe that auth is alive
|
|
39
|
+
|
|
40
|
+
Unlike many CLIs, there is no "key file" — the session token IS the credential. Apple/Google credentials are stored separately, encrypted, on Expo's servers (managed via `eas credentials`).
|
|
41
|
+
|
|
42
|
+
## Auto-increment behaviour
|
|
43
|
+
|
|
44
|
+
When `eas.json` build profile sets `autoIncrement: "buildNumber"` (iOS) or `"versionCode"` (Android), EAS bumps the value remotely on each build. The bumped value is the source of truth — local `app.json` may show stale values until `eas build:configure` syncs them down. This is why CBP's mobile shipment never has the user manually bump build numbers; semver `expo.version` stays manual.
|
|
45
|
+
|
|
46
|
+
## Common failure modes
|
|
47
|
+
|
|
48
|
+
| Error | Cause | Fix |
|
|
49
|
+
|---|---|---|
|
|
50
|
+
| `Provisioning profile not found` | Apple credential drift | `eas credentials` → Apple → resync |
|
|
51
|
+
| `EAS Build worker not available` | Quota or platform incident | Check https://status.expo.dev; wait + retry |
|
|
52
|
+
| `Build failed: Native module link error` | Native module added to package.json without prebuild | `npx expo prebuild --clean`, commit, retry |
|
|
53
|
+
| `eas submit` errors with "Invalid bundle" | `app.json` `bundleIdentifier` doesn't match ASC record | Verify ASC app record; bundle IDs are immutable once published |
|
|
54
|
+
|
|
55
|
+
## Pairs With
|
|
56
|
+
|
|
57
|
+
- [surface-expo-eas.md](./surface-expo-eas.md) — operational deploy steps (variants: expo-go-only / eas-internal / eas-external)
|
|
58
|
+
- [testflight-overview.md](./testflight-overview.md) — what happens AFTER `eas submit` lands on App Store Connect
|
|
59
|
+
- [testflight-automation.md](./testflight-automation.md) — ASC API key setup that EAS Submit consumes
|
|
60
|
+
- `templates/eas.json` — canonical eas.json shape for CBP mobile apps
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
# GitHub CLI (`gh`) — Overview
|
|
2
|
+
|
|
3
|
+
Reference for the `/cbp-ship` orchestrator and other shipment-surface skills. Authoritative manual: <https://cli.github.com/manual>.
|
|
4
|
+
|
|
5
|
+
## What `gh` Is
|
|
6
|
+
|
|
7
|
+
`gh` is GitHub's official command-line interface. It wraps the REST + GraphQL APIs in ergonomic subcommands (`gh pr`, `gh release`, `gh run`, `gh secret`, `gh api`) and authenticates against `github.com` or a GitHub Enterprise host.
|
|
8
|
+
|
|
9
|
+
For CodeByPlan we use it for: PR creation/merge, release creation, secret management, watching workflow runs, and (for non-Vercel platforms) hitting the Deployments API.
|
|
10
|
+
|
|
11
|
+
## Install
|
|
12
|
+
|
|
13
|
+
| Platform | Command |
|
|
14
|
+
|----------|---------|
|
|
15
|
+
| macOS (Homebrew) | `brew install gh` |
|
|
16
|
+
| macOS (MacPorts) | `sudo port install gh` |
|
|
17
|
+
| Linux (apt) | `sudo apt install gh` (after adding the repo per <https://github.com/cli/cli/blob/trunk/docs/install_linux.md>) |
|
|
18
|
+
| Windows (winget) | `winget install --id GitHub.cli` |
|
|
19
|
+
| Direct | <https://github.com/cli/cli/releases> |
|
|
20
|
+
|
|
21
|
+
Verify: `gh --version` (this worktree's pipelines target the latest stable; v2.x is the supported major).
|
|
22
|
+
|
|
23
|
+
## Auth Flow
|
|
24
|
+
|
|
25
|
+
### Initial login
|
|
26
|
+
|
|
27
|
+
```bash
|
|
28
|
+
gh auth login
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
Interactive prompts cover: hostname (`github.com` vs Enterprise), git protocol (HTTPS vs SSH), credential storage, browser-based vs token-based. The default path is web flow against `github.com` with HTTPS git protocol.
|
|
32
|
+
|
|
33
|
+
### Headless / CI
|
|
34
|
+
|
|
35
|
+
```bash
|
|
36
|
+
echo "$GITHUB_TOKEN" | gh auth login --with-token
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
Or rely on env vars — `gh` honours `GITHUB_TOKEN` / `GH_TOKEN` automatically and skips the credential store entirely. Useful inside GitHub Actions where `${{ secrets.GITHUB_TOKEN }}` is already in scope.
|
|
40
|
+
|
|
41
|
+
### Scopes
|
|
42
|
+
|
|
43
|
+
Minimum scopes for the `gh` default flow: `repo`, `read:org`, `gist`. Shipment work additionally needs:
|
|
44
|
+
|
|
45
|
+
| Scope | Why |
|
|
46
|
+
|-------|-----|
|
|
47
|
+
| `repo` | PR create/merge, release create, secret set (repo-level) |
|
|
48
|
+
| `workflow` | Trigger / re-run workflows via `gh workflow run` |
|
|
49
|
+
| `admin:org` | Org-level secrets via `gh secret set --org` |
|
|
50
|
+
| `admin:public_key` | SSH key upload during `gh auth login` (skipped with `--skip-ssh-key`) |
|
|
51
|
+
| `read:packages` / `write:packages` | Container/release asset interactions touching GHCR |
|
|
52
|
+
|
|
53
|
+
Bump scopes on an existing login with:
|
|
54
|
+
|
|
55
|
+
```bash
|
|
56
|
+
gh auth refresh --scopes workflow,admin:org
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
### Status & switching
|
|
60
|
+
|
|
61
|
+
```bash
|
|
62
|
+
gh auth status # which host(s), which user, where token is stored
|
|
63
|
+
gh auth switch --user <login> # multi-account
|
|
64
|
+
gh auth logout --hostname github.com
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
## Config Locations
|
|
68
|
+
|
|
69
|
+
| Path | Purpose |
|
|
70
|
+
|------|---------|
|
|
71
|
+
| `~/.config/gh/config.yml` | Global preferences (editor, git_protocol, prompt) |
|
|
72
|
+
| `~/.config/gh/hosts.yml` | Per-host auth state (token if insecure storage; otherwise pointer into OS keychain) |
|
|
73
|
+
| `$XDG_CONFIG_HOME/gh/...` | Honoured if `XDG_CONFIG_HOME` is set |
|
|
74
|
+
| OS keychain (macOS Keychain / Windows Credential Manager / `secret-tool` on Linux) | Default secure token storage |
|
|
75
|
+
|
|
76
|
+
Inspect or override with `gh config get/set <key>`.
|
|
77
|
+
|
|
78
|
+
## SSH vs HTTPS
|
|
79
|
+
|
|
80
|
+
`gh auth login --git-protocol ssh|https` controls which URL form is written into git remotes. SSH requires either an existing key or `gh` generating one (it'll offer to upload it via the `admin:public_key` scope). HTTPS is simpler for headless contexts because git push reuses the `gh` token via the credential helper.
|
|
81
|
+
|
|
82
|
+
The token used for `gh api` calls is independent of the git protocol — flipping between SSH and HTTPS does not re-auth the API.
|
|
83
|
+
|
|
84
|
+
## GitHub Enterprise
|
|
85
|
+
|
|
86
|
+
`gh` supports Enterprise Server out of the box:
|
|
87
|
+
|
|
88
|
+
```bash
|
|
89
|
+
gh auth login --hostname ghe.example.com
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
After login, every command honours an explicit `--hostname` flag or the `GH_HOST` env var. Repository references can be qualified inline:
|
|
93
|
+
|
|
94
|
+
```bash
|
|
95
|
+
gh pr list --repo ghe.example.com/team/repo
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
CodeByPlan production targets `github.com`; the Enterprise path is documented for completeness in case downstream consumers fork the pipeline.
|
|
99
|
+
|
|
100
|
+
## Common Flags (Cross-Cutting)
|
|
101
|
+
|
|
102
|
+
| Flag | Behaviour |
|
|
103
|
+
|------|-----------|
|
|
104
|
+
| `--repo <[HOST/]OWNER/REPO>` (`-R`) | Override the inferred repo. Required when running outside a checkout, or against a different repo than `origin`. |
|
|
105
|
+
| `--json <fields>` | Switch a list/view command to JSON output. Field list is command-specific (`gh pr view --json` differs from `gh run view --json`). Pass `--json` with no value to discover available fields. |
|
|
106
|
+
| `--jq <expr>` | Apply a `jq` expression to the JSON output server-side (in-process, no `jq` binary needed). |
|
|
107
|
+
| `--template <go-tmpl>` | Apply a Go text/template instead of JSON output. |
|
|
108
|
+
| `--web` | Open the browser to the equivalent UI page rather than performing the API action. |
|
|
109
|
+
|
|
110
|
+
JSON + jq is the canonical pattern for scripting:
|
|
111
|
+
|
|
112
|
+
```bash
|
|
113
|
+
gh pr view 123 --json state,mergeable --jq '.state'
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
## The `gh api` Escape Hatch
|
|
117
|
+
|
|
118
|
+
Anything not covered by a dedicated subcommand falls back to `gh api`:
|
|
119
|
+
|
|
120
|
+
```bash
|
|
121
|
+
gh api repos/{owner}/{repo}/deployments --method POST -f ref=main -f environment=production
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
`gh api` reuses the authenticated token, handles pagination (`--paginate`), supports both REST and GraphQL (`graphql` as the path), and accepts typed (`-F`) or raw (`-f`) fields. See [gh-cli-shipment-commands.md](./gh-cli-shipment-commands.md) for the deployment-specific invocation.
|
|
125
|
+
|
|
126
|
+
## Where to Look Next
|
|
127
|
+
|
|
128
|
+
- [gh-cli-shipment-commands.md](./gh-cli-shipment-commands.md) — exact shipment commands `/cbp-ship` runs, with flags, JSON shapes, and error modes
|
|
129
|
+
- <https://cli.github.com/manual> — authoritative per-command reference (always reflects the latest release)
|
|
130
|
+
- `gh <command> --help` — the same content, offline, pinned to your installed version
|
|
131
|
+
|
|
132
|
+
## Pairs With
|
|
133
|
+
|
|
134
|
+
- `/cbp-ship` skill (orchestrator that wraps these commands)
|
|
135
|
+
- `.claude/rules/git-workflow.md` — branch / commit conventions that `gh pr create` must respect
|