Skip to content

Commit a986f58

Browse files
improvement(skills): gate /ship cleanup on UI changes; default migration base to staging
- /ship runs /cleanup only when the diff touches UI code (.tsx or apps/sim/components|hooks|stores); the six passes are React-only. - /ship runs check:migrations against origin/staging (the PR base). - check:migrations default baseRef is now origin/staging instead of origin/main. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent be6d0bc commit a986f58

2 files changed

Lines changed: 5 additions & 5 deletions

File tree

.agents/skills/ship/SKILL.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,11 @@ When the user runs `/ship`:
1616
- Types: `fix`, `feat`, `improvement`, `chore`
1717
- Scope: short identifier (e.g., `undo-redo`, `api`, `ui`)
1818
- Keep it concise
19-
3. **Run the cleanup pass** on the current changes before anything else: `/cleanup`
20-
- This runs the six code-quality skills (effects, memo, callbacks, state, React Query, emcn) and applies fixes, so they land in this commit.
19+
3. **Run the cleanup pass** — only if the diff modifies UI code (any `.tsx` file, or anything under `apps/sim/components/`, `apps/sim/hooks/`, or `apps/sim/stores/`): `/cleanup`
20+
- The six code-quality skills (effects, memo, callbacks, state, React Query, emcn) only apply to React code, so skip this step entirely when no UI was touched. When it runs, it applies fixes so they land in this commit.
2121
4. **Run migration safety** — only if the diff touches `packages/db/migrations/**` or `packages/db/schema.ts`:
2222
- Run `/db-migrate` to review the migration for zero-downtime safety (expand/contract phasing, backward-compatibility with the deployed app version).
23-
- `bun run check:migrations` must pass. Do not silence a flagged statement with a `-- migration-safe:` annotation unless `/db-migrate` confirmed the old code no longer depends on it; otherwise split the destructive change into a later deploy.
23+
- `bun run check:migrations origin/staging` must pass (staging is the PR base). Do not silence a flagged statement with a `-- migration-safe:` annotation unless `/db-migrate` confirmed the old code no longer depends on it; otherwise split the destructive change into a later deploy.
2424
5. **Run pre-ship checks** from the repo root before staging:
2525
- `bun run lint` to fix formatting issues
2626
- `bun run check:api-validation:strict` to catch boundary contract failures before CI

scripts/check-migrations-safety.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
*
2121
* Scope is new migration files only (git diff vs base); the existing corpus is
2222
* grandfathered. Usage:
23-
* bun run scripts/check-migrations-safety.ts [baseRef]
23+
* bun run scripts/check-migrations-safety.ts [baseRef] # base defaults to origin/staging
2424
* bun run scripts/check-migrations-safety.ts --all # whole corpus
2525
* bun run scripts/check-migrations-safety.ts --dir <path> # a directory
2626
*/
@@ -438,7 +438,7 @@ async function resolveFiles(argv: string[]): Promise<string[] | null> {
438438
if (!dir) throw new Error('--dir requires a path')
439439
return (await listSqlFiles(path.resolve(dir))).map((f) => path.relative(ROOT, f))
440440
}
441-
const baseRef = argv.find((a) => !a.startsWith('--')) ?? 'origin/main'
441+
const baseRef = argv.find((a) => !a.startsWith('--')) ?? 'origin/staging'
442442
const files = changedMigrationFiles(baseRef)
443443
if (files.length === 0 && git(['rev-parse', 'HEAD']) === null) {
444444
console.warn('⚠ git unavailable — skipping migration safety check.')

0 commit comments

Comments
 (0)