agentsclimarketplace

C ship

Skill the-collective-dev/the_collective_hooks/skills/c-ship

The per-change SDLC loop for this repo — worktree → TDD → collective_pr_review → harden → CI → promote-gate → deploy → verify-live → capture. Encodes the discipline that shipped the assess platform (PRs #283–#298). Use for ANY non-trivial code change you intend to land in production. Bounded by four explicit STOP conditions. Args: <short description of the change> [plan/spec ref].From its SKILL.md

Install
npx -y skills add the-collective-dev/the_collective_hooks --skill c-ship

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

2 things to look at

  • no licenseNo license file was found in the repository. Code published without one is not open source by default, so using it at work is a question for whoever answers licensing questions where you are.
  • 0 stars0 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.

SKILL.md

15.0 KB, as published. Nobody here has run it

Ship one cohesive change all the way to verified-in-production, the way we shipped assess Phase 4 (collective_assess_live, PR #298 → v2.380.0) — used as the worked example throughout. The value is the rails: TDD before code, structural review, the promote gate, and live verification. The loop is mechanical on purpose so your judgment goes to the hard parts (what to build, triaging review findings, recognizing a prod gap), not the choreography.

This skill is house-specific — don't copy it verbatim into another project. It is The Collective's instantiation of a portable, tool-agnostic loop, filled in with our tooling (collective_pr_review, Railway, our promote gate). What transfers is the structure, and it is all present below: the four STOP conditions, the risk tiers, the ordered loop, and the principles. To run this discipline elsewhere, keep that structure and substitute your own tools in each slot — your reviewer for collective_pr_review, your deploy path for ours, your live-verification command for step 12. What must NOT be substituted away: TDD-red-first, an independent reviewer (builder ≠ reviewer), a gate between merge and prod, and verification against the running system rather than the diff.

STOP conditions (the autonomy boundary — non-negotiable)

Run the loop autonomously except when you hit one of these. Then STOP and ask the operator:

  1. Prod-infra mutation — changing env vars / scaling / DNS / a Railway service config on a live service. (Phase 4 needed Temporal env on collective-mcp — that required explicit authorization; the classifier correctly blocked it on a generic "keep going".)
  2. Dual-use / live-security action against a real target — running probes, load, or auth tests against a running instance. Build the capability behind a consent:true + SSRF/intensity gate; do not fire it at a target without the operator's go + a named target.
  3. Scope / strategy fork — when the next step is a genuinely new investment (a new phase, a sibling tool, a rewrite-vs-fix call), not the obvious continuation. State your default and let the operator redirect.
  4. A finding in a mandatory-stop category — regardless of your confidence. These triggers are objective, not self-assessed (don't rely on agent self-calibration — it's the thing models are worst at): (a) any finding tagged security / auth / access-control / data-integrity; (b) any finding in a PHI/PII path (any HIPAA-gated client repo); (c) any silent-swallow catch (catch {} / .catch(() => {}) with no log or rethrow); (d) any disagreement between your disposition and an independent reviewer; (e) any blocking finding you genuinely can't resolve. Fix it or get explicit operator deferral — never self-clear a category (a)–(d) finding on your own confidence.

Everything else — pure-logic features, read-only work, behind-the-gate deploys — loops without a checkpoint.

The loop

  1. Pick + scope. One cohesive change from the plan / a gap / a found bug. If it's large or LLM-heavy, split (e.g. Phase 4 = pure liveHarness.ts core + the I/O tool, not one blob). Right-size the PR; isolate the risky/big part. Classify the risk tier (when unsure, round up): T0 docs/comments/pure-refactor (full auto, TDD step N/A) · T1 isolated pure-logic / read-only feature (full auto, standard loop) · T2 service behavior / new write path / route (full auto through the gate, exercise it at step 12) · T3 auth / access-control / PHI-PII / money / data-integrity / any schema migration / infra → mandatory STOP, human in the loop, stage exposure before full prod when available. Higher tier → more rigor + earlier human checkpoint. T3 intersects STOP #1 (infra) and STOP #4 (security/PHI/data findings) by design.

    Migrations are T3, additive included — no exceptions on a repo you don't own. Two taxonomies have to agree here: this skill tiers the change, the method corpus tiers an actor's write scope — and the corpus puts migrations in the canonical zone (gate-3-build: "safety rules, migrations, CI config, protected paths → human-only"). The "additive is safe" reasoning holds for a repo whose data you own and can restore; it does not survive contact with someone else's production database, where you cannot see the load, the replicas, the locks, or the blast radius. An unattended ALTER TABLE on a client's prod DB is not a tier judgment, it's a trust boundary. When the target repo is client-owned, treat every migration as T3 and stop.

  2. Isolate. From the repo root (REPO=$(git rev-parse --show-toplevel)): git worktree add "$REPO/../thecollective-<slug>" origin/main → ln -s "$REPO/backend/node_modules" "$REPO/../thecollective-<slug>/backend/node_modules" → git -C "$REPO/../thecollective-<slug>" checkout -b feat/<slug>. Always a worktree — parallel Claude windows share the working dir and will collide (this session lost a branch to it). Never push main.

  3. TDD — failing test first. Write the unit test on the pure-logic core, run it, watch it go red, then implement to green. Keep the bug-risk surface pure; I/O is thin glue around it. (Phase 4: summarizeLoad/interpretLoad/safeLoadConfig/interpretIdor/isSafeLiveTarget were pure + 15 tests; the fetch loops were ~20 lines of glue.) No "I'll backfill." A behavior bug — even in I/O glue — ships with a regression test that fails before the fix (extract/export the glue + drive it with a mock; the testing-policy "glue/rename" escape hatch does NOT cover behavior bugs). This run's load-probe rate bug proved it: a fake-fetch test asserting the per-second floor caught the class. RED-PROOF is the hard gate: the regression test MUST fail against the pre-fix code — run it red before you implement; a test that passes pre-fix proves nothing. Reproducing the production symptom in the red state (a client engagement retro: the backstop test failed by hanging to timeout — the literal prod symptom) is stronger when achievable but is NOT required — don't fabricate a weak symptom-repro to claim it.

  4. Verify locally. cd backend && npx tsc --noEmit (exit 0) + npx jest tests/unit/<area> (all green).

  5. Bump + changelog. backend/package.json version + a backend/releases.json entry. The pre-commit hook enforces both when you touch mcp-server/**, routes, or generators. Follow-up commits on the same unreleased PR may use --no-verify (version already bumped) — say so in the message. Edit releases.json with a targeted text-insert of the new entry at the top — NEVER reserialize the whole file (json.dump / jq -S rewrites every existing entry → a thousands-line noisy diff; this run made that mistake and reverted).

  6. Commit → push → PR. Descriptive body, a DISCIPLINE: line on review-driven fixes, Co-Authored-By. gh pr create.

  7. Review — collective_pr_review with includeMercury: true. NEVER the built-in /review skill. Scale review BREADTH to risk, not the boundary (a client engagement retro: 7 finder angles on a +33/−11 T2 diff — 3 returned empty, the reuse/simplification/efficiency angles produced pre-existing micro-noise; all the value came from one angle, altitude):

    • Breadth by tier×size: T0/T1 trivial → self-review only; T2 small (≲50 LOC, 1–2 files) → three lenses (line-scan · altitude · cross-file); T3 or multi-file → full panel + crossVerify: true. (This split is a DEFAULT off one PR — the lens-hit log below is what calibrates it.)
    • Risk overlay is ADDITIVE (union, not escalate-to-full-panel): when the diff touches a RARE high-stakes signal — migrations / auth / access-control / money / payment / raw concurrency primitives (lock·mutex·semaphore) — ADD crossVerify: true (the independent cross-vendor gpt-4.1 skeptic, builder-≠-reviewer per STOP #4(d), same primitive as assess Phase 3e) + the one lens matching that risk class. Do NOT drag the whole panel onto a small diff. Keep the signal list rare: a DB call / webhook / await is in nearly every diff and would re-inflate every review — NOT triggers. (That bug was a DB call in a webhook; altitude, not a keyword, is what caught it.)
    • ALTITUDE IS MANDATORY ON EVERY BUGFIX / HARDENING PR (any tier): "is this the instance or the class?" — does the fix cover the bug CLASS (the next sibling await/call/branch protected by default, e.g. an outer backstop) or just the lines someone flagged? That retro: the first cut wrapped exactly the two awaits Mercury cited and one analog — answering the comments, not auditing the class; review found two more unguarded awaits in the same handler → fixed with an outer backstop. A fix that patches cited lines but not the class looks done and is worse than one obviously unfinished.
    • Triage every finding: Real → fix it (TDD the new case). False positive → disregard with a stated reason (a crossVerify flag is evidence, not a substitute for your own check). Blocking → must fix before merge. Converged advisories (multiple reviewers + Mercury agree) are almost always real.
    • LENS-HIT LOG (don't skip): one line per run — which lens produced each outcome-changing finding, which returned empty. This is the data that calibrates the breadth table above; without it it never improves.
    • Field data #2 (a day-one 4-PR set on a client engagement) — validates the table + the additive overlay: the outcome-changing finding came from the MATCHING risk lens every time — concurrency lens on lock code → run-lock wired into only 1 of 3 crons (instance-vs-class, same shape as #6); security lens on a SECURITY DEFINER migration → default PUBLIC EXECUTE grant; cross-file on a cron-auth diff → scheduler POSTs but route only exported GET — a prod bug in adjacent unchanged code (the "read the enclosing function + callers" rule paying for itself). Full 7-lens panel on the one T3 multi-file PR: 4 lenses carried all 8 confirmed findings, 3 produced noise — full panel stays correct for T3 multi-file; expect ~half the lenses to carry it. Reviewer-side corollary (spec/persona reviews): 3-bucket every finding set (genuine / refuted-with-a-stated-reason / already-tracked) and grep-verify every code-citing claim before accepting — the same session's 5 ADR reviews ran 53 findings at ~50% refutable, and the 2026-06-05 SPEC-092 review confabulated a changeRiskClassifier.ts that exists nowhere in the tree.
  8. Harden. Apply the fixes, re-test, push, and note the hardening in the changelog entry. Re-run the review only if the change was substantial.

  9. CI to green. Background-poll the PR's Integration Verification run to success before merging.

  10. Merge. gh pr merge <#> --squash --delete-branch — only when CI is green and the promote gate is idle (a running gate will get cancelled by your push; rapid parallel merges cause cancellation churn).

  11. Deploy via the gate. The squash-merge to main auto-fires the SPEC-069 promote.yml gate (staging → smoke → prod → smoke). Do not push main directly. Background-monitor prod until the version flips. Railway's control plane flakes — the gate's widened retry (5×, ~300s) rides through most of it; if a gate run fails on backboard.railway.com it's infra, not you — re-trigger when it recovers.

  12. Verify live. Confirm curl …/health/live + /mcp-health show the new version. For behavior changes, actually exercise it end-to-end — this is the step that matters most. (Running assess runServerSide for real is what exposed the collective-mcp ↔ Temporal prod bug that all 181 unit tests missed. Unit-green ≠ works-in-prod.) MCP-staleness caveat: your in-session MCP client won't see tools deployed this session (anthropics/claude-code#27142) — hit the deployed server's /mcp HTTP endpoint directly, or restart. 12b. If verify-live fails — roll back, don't push forward. Green-in-CI-but-wrong-in-prod is the dangerous case; the response is structural, not a judgment call: (1) restore service first — re-fire the gate to the last-SUCCESS version, or Railway dashboard → service → most recent SUCCESS → "Redeploy this version" (fastest); during an active outage use the CLAUDE.md Path A skip-staging gate. (2) confirm recovery — curl https://api.thecollectiveai.dev/health/live 200 on the prior version. (3) emit an incident artifact — docs/postmortems/<date>-<name>.md or a tracked status-report: what shipped, what verify-live caught, the rollback. (4) THEN diagnose on a fresh branch — never "re-fix in place" on main. A failed verify-live is itself a STOP — surface it to the operator before re-attempting. (Mechanism already exists — CLAUDE.md "Outage Response"; this just makes it the loop's defined failure path.)

  13. Capture. Mark the plan item done; write a one-file memory for any hard-won operational knowledge (Phase 4 era: the collective-mcp Temporal-env gap got a memory so it's never re-learned).

  14. Clean up + loop. git worktree remove <wt> --force; pick the next unit.

Cross-cutting principles (apply at every step)

  • Verify, don't assume. Read SCHEMA-LIVE.md (not schema.prisma) for DB truth; introspect before destructive SQL; git branch --show-current before committing after stash/checkout; re-grep doc claims against HEAD.
  • Enforce structurally, not by instruction. Prefer a gate/hook/test that can't be skipped over a reminder. (Phase 4's anti-DoS is a hard safeLoadConfig clamp, not a "please don't flood" note.)
  • Report honestly. Don't overclaim "done" — state what you verified, what you skipped and why, and what you couldn't do (e.g. the live e2e you can't run from a stale MCP session). Tests failing? Say so with the output.
  • Right-sized, isolated PRs. One cohesive change; group only when genuinely cohesive; give the big/risky thing its own PR.

Worked example — assess Phase 4 (collective_assess_live, PR #298 → v2.380.0)

Pick: the last ENG-PLAN phase (live security/scale harnesses) · Isolate: thecollective-p4 worktree off origin/main · TDD: 15 tests on the pure liveHarness.ts (verdict math + anti-DoS clamps + SSRF guard) before the tool · Safety (STOP #2): built behind consent:true + https-non-internal target + rps≤20 × dur≤30s clamp — capability built, not fired at any target · Review: Mercury + 2 personas, 2 blocking clearTimeout/finally findings + readOnlyHint contract fix → hardened · Gate: CI green → squash-merge → promote.yml → 2.380.0 live on api + mcp · Verify: confirmed both health endpoints · Capture: plan marked done. One pass through this skill.

Keep looking

Skills are one crate of 607,721. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.