AGENT SKILL

ship

Takes a feature from idea to release (PRD, RFC, code, QA, launch assets), pausing at each quality gate for your review. Use to build and ship something end to end.

License 许可
MIT
所属仓库
vibbs/company-os
最近更新
2026-10-21
Stars
★ 6
Forks
2

01 前言 Front Matter

name
ship
runtimes
{ "claude": { "argument-hint": "<what you want to build>", "user-invocable": true } }
description
Takes a feature from idea to release (PRD, RFC, code, QA, launch assets), pausing at each quality gate for your review. Use to build and ship something end to end.

02 资源文件 6

03 SKILL.md 正文

Ship

The primary entry point for the canonical ship flow. Takes an objective from idea through PRD, RFC, implementation, QA, and release -- with quality gates enforced at every stage transition.

At a Glance

  • You give it: one sentence describing what to build.
  • You get: a PRD (product requirements document), an RFC (technical design), working code, a QA report and launch assets, each saved under artifacts/.
  • You stay in control: the flow pauses at every quality gate (a check that must pass before the next stage). Nothing moves on until you approve.
  • Order: plan (steps 1 to 4), then build one stage at a time with a pause after each (step 5), then try it yourself with seed data (5.8), then release check and summary (6 to 8).
  • Optional steps (labelled below) run only when they apply, such as discovery for novel features or dogfooding.
  • Time: a small feature takes one session. Larger ones can be resumed; finished artifacts are never redone.
  • Need it faster? Use /rapid-prototype. Need market proof first? Use /gtm-sprint.

When to Use

  • User wants to build a new feature end-to-end
  • User wants to ship an improvement or enhancement
  • User wants the full orchestrated pipeline with quality gates

Alternative: For time-boxed proofs-of-concept or investor demos, use /rapid-prototype instead. It skips RFC, security, QA, and growth stages for maximum speed.

Reference

  • ID: S-ORG-08
  • Category: Orchestration
  • Inputs: objective description, company.config.yaml, existing artifacts
  • Outputs: Full artifact chain (PRD -> RFC -> QA Report -> Launch Brief) with stage gate verification
  • Used by: User (directly), Orchestrator Agent
  • Tool scripts: ./tools/artifact/validate.sh, ./tools/artifact/check-gate.sh, ./tools/artifact/promote.sh, ./tools/artifact/link.sh, ./tools/ci/run-tests.sh, ./tools/ci/lint-format.sh, ./tools/security/dependency-scan.sh

What You Will See

After you confirm the plan, the flow pauses at the end of each stage with a prompt like this:

Stage complete: PRD
  Artifact: PRD-0007 "Team invitations"  (artifacts/prds/PRD-0007-team-invitations.md)
  Status:   review
  Gate prd-to-rfc: PASS (acceptance criteria present, success metrics present)

Review the artifact and approve to continue, or request changes?
  • To continue, reply approve (or looks good). The artifact becomes approved and the next stage starts.
  • To change something, reply with what to fix (for example add an export-to-CSV requirement). The same stage reruns and the gate is checked again.
  • To stop, reply stop. Everything produced so far stays in artifacts/. Run /ship again later and it resumes from the next missing stage.

Procedure

Step 1: Load Configuration

Read company.config.yaml and extract:

  • company.stage (idea | mvp | growth | scale) -- affects gate strictness
  • tech_stack.* -- language, framework, runtime, database, ORM, hosting, CI
  • conventions.* -- test_framework, linter, formatter, branching, commit_style
  • api.* -- style, spec_format, error_format, auth, pagination
  • architecture.* -- multi_tenant, tenant_isolation, deployment_model
  • observability.* -- logging, metrics, tracing, error_tracking
  • personas.* -- custom agent names (if configured, use them in delegation messages)

If the config is empty or missing, redirect to /setup before proceeding.

Step 2: Inventory Existing Artifacts

Scan artifacts/ for any artifacts related to this objective:

  • Check artifacts/prds/ for existing PRDs
  • Check artifacts/rfcs/ for existing RFCs
  • Check artifacts/test-plans/ for existing test plans
  • Check artifacts/qa-reports/ for existing QA reports
  • Check artifacts/security-reviews/ for existing security reviews
  • Check artifacts/launch-briefs/ for existing launch briefs

If related artifacts exist, resume the flow from the next missing stage. Do not re-produce artifacts that already exist and are approved.

Step 2.5: Discovery Validation (Optional, New Features Only)

For objectives classified as New Feature, run the Discovery Validation skill (via Product Agent) before proceeding to PRD:

  1. The skill's smart filter classifies the objective as COMMON PATTERN or NOVEL CONCEPT
  2. COMMON PATTERN (auth, CRUD, notifications, file uploads, search, pagination, etc.): Skip discovery, proceed directly to PRD
  3. NOVEL CONCEPT (new business model, new UX paradigm, AI/ML, marketplace, etc.): Run full validation — lean canvas, competitive scan, risk assessment
  4. Discovery output is embedded in the PRD (not a separate artifact)

Skip this step entirely for Bug Fix, Improvement, and Research/Spike types.

Step 3: Classify Objective

Determine the type of work (reuse workflow-router classification):

Type Description Flow
New Feature Building something that does not exist Full pipeline (PRD -> RFC -> Build -> Test -> Release)
Bug Fix Something is broken Expedited (Triage -> Fix -> Test -> Release)
Improvement Enhancing existing functionality Mini-PRD -> RFC (optional) -> Build -> Test -> Release
Research/Spike Understanding before deciding Research -> Decision Memo

For Bug Fix and Research/Spike types, use the abbreviated flows described above rather than the full pipeline.

Step 4: Build Execution Plan

Based on the objective type and existing artifacts, build a stage-by-stage plan.

For each missing artifact, assign:

Artifact Agent Primary Skill Tool Dependencies
PRD Product Agent prd-writer --
RFC Engineering Agent architecture-draft tech_stack., architecture. from config
API Contract Engineering Agent api-contract-designer api.* from config
Threat Model Ops & Risk Agent threat-modeling --
Implementation Engineering Agent implementation-decomposer conventions., tech_stack. from config
Test Plan QA Agent test-plan-generator conventions.test_framework from config
QA Report QA Agent release-readiness-gate --
Launch Brief Growth Agent positioning-messaging --

Present the execution plan to the user for confirmation before starting. Include:

  1. The stages that will be executed (in order)
  2. Which stages already have artifacts (will be skipped)
  3. Estimated scope of work

Wait for user approval before proceeding.

Step 5: Execute Stage-by-Stage (Pause at Gates)

For each stage in the execution plan:

a. Delegate to the assigned agent with full tech stack context from Step 1. Pass all relevant configuration values so the agent can make informed decisions. If personas.* are configured, use persona names when announcing delegation (e.g., "Handing off to Morgan (Engineering) for RFC..." instead of "Handing off to Engineering Agent for RFC...").

b. Validate the artifact when the agent produces output:

  • Run ./tools/artifact/validate.sh <artifact> to verify frontmatter is correct
  • Run ./tools/artifact/link.sh if parent/child relationships need establishing
  • Promote artifact to review: ./tools/artifact/promote.sh <artifact> review

c. Run the appropriate gate check:

  • After PRD: ./tools/artifact/check-gate.sh prd-to-rfc <prd-file>
  • After RFC: ./tools/artifact/check-gate.sh rfc-to-impl <rfc-file>
  • After implementation + test plan: ./tools/artifact/check-gate.sh impl-to-qa <rfc-file>
  • Before release: ./tools/artifact/check-gate.sh release <prd-file>

d. PAUSE -- Present gate results to the user:

  • Show what was produced (artifact ID, title, location)
  • Show gate pass/fail status with details
  • Ask: "Review the artifact and approve to continue, or request changes?"

e. On user approval: promote artifact to approved via ./tools/artifact/promote.sh <artifact> approved, then proceed to next stage.

f. On user rejection: iterate on the current stage. Re-delegate to the agent with the user's feedback incorporated. Repeat validation and gate check.

Step 5.7: User Documentation & Guided Tours

After implementation is complete, delegate to the Engineering Agent with the User Docs skill to produce:

  1. User-facing feature documentation — what the feature does, how to use it, step-by-step guide
  2. In-app tour specification — target elements (using data-tour-step attributes), copy, positioning, sequence
  3. Changelog entry — user-facing description of what changed and why
  4. API documentation updates — if the feature introduces or modifies API endpoints

This step runs after implementation but before dogfooding/QA, so tours and docs can be validated during testing.

Step 5.8: Seed & Verify

After implementation completes and impl-to-qa gate passes, help the developer test what was built before handing off to QA:

Preflight: Verify tools/dev/start.sh exists. If not, instruct Engineering Agent to run /dev-environment first to generate development infrastructure scripts. The Seed & Verify step requires a running application.

1. Detect new domain entities

Scan the implementation diff (against the base branch) for new or modified schema files, migration files, model definitions, or entity classes. Look for patterns like: prisma/schema.prisma, migrations/*.sql, **/models.py, **/model.go, **/schema.ts, **/entities/*.ts.

  • If new entities found → check for a seed data catalog artifact in artifacts/test-data/ linked to this PRD or RFC.
  • If no seed catalog exists → delegate to the Backend Engineer to run /seed-data with the PRD ID. Wait for seed files to be generated in seeds/ before continuing.
  • If no new entities → skip to step 3 (still present the start & seed guide).

2. Resolve service URLs

Read .env (or .env.example if .env does not exist) for service port variables:

  • PORT — for fullstack frameworks (Next.js, SvelteKit) running a single process
  • API_PORT — for backend-only frameworks (FastAPI, Express, Django, Gin, etc.)
  • WEB_PORT — for separate web frontends
  • EXPO_PORT — for mobile dev servers

If no .env or .env.example exists, look up tech_stack.framework in the framework defaults table (dev-environment skill) to determine the default port and start command.

Build the URL for each detected service: http://localhost:{port}

3. Present the "Start & Seed" guide

Display this to the developer (adapt based on detected services):

## Ready to verify? Start your app and load test data.

1. Start infrastructure (if not running):
   bash tools/dev/start.sh

2. Start your services:
   {start_command_1}  → http://localhost:{port_1}
   {start_command_2}  → http://localhost:{port_2}
   (one line per detected service)

3. Verify health:
   curl http://localhost:{port}{health_path}
   Expected: HTTP 200

4. Load seed data:
   ./tools/db/seed.sh nominal

5. Your app is running at:
   {list each service URL}

Key test flows (from PRD acceptance criteria):
  - {AC-001 from the PRD}
  - {AC-002}
  - {AC-003}
  (list up to 5 acceptance criteria as manual test scenarios)

4. Wait for user confirmation

Ask: "Is your app running and verified? Type 'yes' to proceed to QA, or 'skip' to continue without manual verification."

  • On yes: proceed to Step 5.9 (Dogfooding) or Step 6 (QA/Release Gate)
  • On skip: note in the QA handoff that manual verification was skipped

Step 5.9: Dogfooding (Optional)

After implementation and test execution, optionally dogfood the running product:

  1. Check if the app is running — if a local or staging URL is available, proceed
  2. Seed realistic data — run ./tools/db/seed.sh nominal to populate the app with realistic state
  3. Run pre-flight — execute ./tools/qa/dogfood.sh <url> to validate readiness
  4. Execute dogfood procedure — delegate to the QA Agent with the Dogfood skill to:
    • Extract user journeys from the PRD acceptance criteria
    • Execute each journey against the running app
    • Produce a dogfood report in artifacts/qa-reports/
  5. Review results — present the dogfood summary to the user
    • If CRITICAL issues found: pause and address before proceeding to release gate
    • If no critical issues: proceed to release gate (dogfood report feeds into optional Bar 7)

This step is recommended but not required. Skip it when:

  • The product is API-only and contract tests already cover the flows
  • No running environment is available
  • The user explicitly opts to skip dogfooding

Step 5.95: Experiment Review (Optional)

If the feature is behind an experiment-type feature flag, verify experiment readiness:

  1. Check for experiment flag -- look in the RFC or feature flag specs for any flag classified as experiment type
  2. If experiment flag exists, check that an experiment spec exists in artifacts/experiments/:
    • Hypothesis is documented
    • Sample size is calculated (or justified as "traffic-limited")
    • Primary metric is defined
    • Guardrail metrics are defined (metrics that must NOT degrade)
    • Experiment duration is estimated
  3. If experiment spec is missing -- surface a warning:
    Warning: Feature has an experiment flag but no experiment spec.
    Consider creating one with the Experiment Framework skill before launch.
    This is advisory -- it does not block release.
    
  4. If experiment spec exists -- link it to the PRD and RFC via ./tools/artifact/link.sh

This step is advisory only -- it does not block the release gate. It surfaces awareness that experimentation infrastructure should be in place for features behind experiment flags.

Step 6: Release Gate (Final Verification)

Before approving release, run the full tool chain:

  1. ./tools/ci/run-tests.sh -- uses conventions.test_framework from config
  2. ./tools/ci/lint-format.sh -- uses conventions.linter and conventions.formatter from config
  3. ./tools/security/dependency-scan.sh -- scans for known vulnerabilities
  4. ./tools/deploy/pre-deploy.sh -- validates deployment readiness (git state, env vars, migrations, version)
  5. ./tools/artifact/check-gate.sh release <prd-file> -- verifies all artifacts exist and are approved
  6. Version bump -- determine and apply the app version bump: a. Read the current app version (auto-detect from package.json, pyproject.toml, or VERSION file) b. Determine bump type from shipped artifacts:
    • PRD describes a bug fix or performance improvement → PATCH
    • PRD describes a new feature or enhancement → MINOR
    • RFC explicitly flags breaking API changes or migration requirements → MAJOR c. Read company.stage — if idea or mvp, cap version at v0.x.x (MAJOR becomes MINOR per standard v0 semver). If growth/scale and version is still 0.x.x, recommend transitioning to v1.0.0 d. Present recommendation to the user: "[current] → [proposed] ([reason])" e. On user approval: run ./tools/versioning/version-bump.sh <type> f. If user wants a different bump type, accept their override g. Commit the version bump (version file + CHANGELOG.md + .previous-version)

Recommended: If an incident runbook exists at standards/ops/incident-runbook.md, verify it covers the deployment rollback procedure for this feature.

Report results for each tool. All checks must pass for release approval. If any check fails, report the failure details and work with the user to resolve before retrying.

Step 7: Release Summary

Present a final summary:

  • Version -- previous version → new version (git tag: v[new])
  • Artifacts produced -- list all artifacts with IDs, types, and statuses
  • Gates passed -- list each gate transition and its result
  • Tool chain results -- tests, lint, security scan outcomes
  • Recommended next actions -- deploy, announce, monitor, or any follow-up items

Step 7.5: Token Cost Logging (Advisory)

After the release summary, if ai.cost_tracking_enabled is true (or ai.cost_budget_monthly is set) in company.config.yaml, suggest logging the session cost:

## Log Session Cost?

This ship flow built [PRD-ID] ([Feature Name]).
Consider logging the token cost for COGS tracking:

  ./tools/ops/token-ledger.sh log \
    --feature [PRD-ID] \
    --category ship-flow \
    --model [primary-model-used] \
    --input-tokens [N] \
    --output-tokens [N] \
    --agent [primary-agent] \
    --notes "Ship flow for [feature name]"

View feature cost history:
  ./tools/ops/token-ledger.sh feature-cost [PRD-ID]

Rules:

  • This step is non-blocking and informational only
  • It does NOT pause or gate the flow
  • Auto-populate the --feature flag with the PRD ID from the ship flow
  • Skip this suggestion if ai.cost_tracking_enabled is explicitly false
  • If the user says "yes" or "log it", help them fill in the entry

Step 8: What's Next

After the release summary, surface actionable suggestions for what to build next. This step is informational only — no artifacts, no gates, no blocking.

Sources to scan (in this order of priority):

  1. The PRD's ## Out of Scope section — features explicitly deferred during planning
  2. RFC's ## Future Considerations / ## Tech Debt sections — technical follow-ups noted during architecture
  3. Decision memos in artifacts/decision-memos/ linked to this feature — deferred alternatives and open questions
  4. TODO and FIXME comments added during implementation — grep the codebase for recent additions related to this feature
  5. tasks/lessons.md — patterns that suggest systemic improvements

Output format (conversational, not an artifact):

## What's Next?

Based on what we just shipped, here are natural next moves:

1. **[Title]** — [one-liner description]
   _Source: PRD out-of-scope_

2. **[Title]** — [one-liner description]
   _Source: RFC tech debt_

3. **[Title]** — [one-liner description]
   _Source: TODO in src/auth/handler.ts:42_

Pick one and say "build that" to kick off a new cycle.

Rules:

  • Maximum 5 suggestions, minimum 1
  • Rank by: direct user value > tech debt reduction > nice-to-haves
  • If no sources yield suggestions: "No obvious next steps found. Check your roadmap or run /status to see what's in progress."
  • This output is ephemeral — it lives only in the conversation, not as an artifact

Parallel Work Optimization

Some stages can run concurrently to reduce total flow time:

Sequential (must be in order):
  PRD -> RFC -> Implementation -> QA Report -> Release

Parallel branches (can run alongside the sequential path):
  RFC -> Threat Model (Ops & Risk)       [parallel with implementation planning]
  PRD -> Launch Brief (Growth)            [parallel once PRD is approved]
  RFC -> Test Plan (QA)                   [parallel once RFC is approved]

Identify and execute parallel work where possible. When delegating parallel tasks, track each independently and merge results at the appropriate gate.

Quality Checklist

  • [ ] company.config.yaml was read and tech stack context passed to all agents
  • [ ] Every artifact was validated with validate.sh before promotion
  • [ ] Every stage transition was gated with check-gate.sh
  • [ ] User reviewed and approved at each gate pause point
  • [ ] Release gate ran full tool chain (tests, lint, security scan)
  • [ ] All artifacts are linked with proper parent/children relationships

04 同仓库更多 Skills