一键导入
run-pipeline
Multi-project pipeline orchestrator — triage, execute, PR, review, deploy with safety gates
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Multi-project pipeline orchestrator — triage, execute, PR, review, deploy with safety gates
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Run an HQ-issued Slack bot — arm a per-bot @-mention watcher that spawns an autonomous Claude worker per mention. Pass the bot's slug (e.g. `hassaan`), a scope flag (`-c <company-slug>` or `--personal`), and optionally a workspace (`-w <slack-team-domain>`; auto-derived for `--personal` from SLACK_CREDENTIALS_JSON). The watcher resolves scope/workspace before personUid, using the sole local cache entry or an exact selected-vault bot-token namespace match; pass `-u <prs_…>` to override. It verifies and injects scoped `ANTHROPIC_API_KEY` into detached workers, handles the one-time bypass-permissions gate, resolves `<personUid>/HQ_SLACK_BOT_TOKEN_<NAME>_<WORKSPACE>`, infers the creator's Slack user_id (used as a DM gate), enumerates channels, and dispatches workers. Workers respond in-thread, ignore DMs from non-creators, and never call AskUserQuestion.
Surface architectural friction and propose deepening opportunities — turn shallow modules into deep ones for better testability and AI-navigability. Output: ranked candidate list with deletion-test outcome, leverage/locality scoring, file refs. Never edits code directly; presents candidates and walks the user through grilling-style design decisions for picked candidates. Use when the codebase is hard to change, when /diagnose hands off "no good test seam," or when planning a refactor wave.
Shared vocabulary and discipline for designing deep modules (a lot of behaviour behind a small interface, at a clean seam). Use when designing module boundaries or interfaces, or when another skill needs the deep-module vocabulary. Triggers on "deep module", "interface design", "design it twice".
Disciplined diagnosis loop for hard bugs, performance regressions, and intermittent failures. Build a deterministic feedback loop FIRST, then reproduce → hypothesise (3-5 ranked) → instrument (one variable at a time, tagged probes) → fix at the correct seam → cleanup + post-mortem. Use when the dominant problem is "I cannot reliably reproduce or measure this." For bugs that reproduce reliably with unknown root cause, use /investigate instead.
Actively build and sharpen a project's domain model — challenge fuzzy or overloaded terms against a glossary, stress-test with edge cases, and maintain CONTEXT.md as the source of truth for a ubiquitous language. Use when the user wants to pin down domain terminology, resolve a naming conflict, define a ubiquitous language, or when another skill needs to produce or sharpen the domain model. Triggers on "what should we call this", "domain model", "ubiquitous language", "define these terms", "update CONTEXT.md".
Enforce test-driven development with RED→GREEN→REFACTOR cycle and coverage validation
| name | run-pipeline |
| description | Multi-project pipeline orchestrator — triage, execute, PR, review, deploy with safety gates |
| allowed-tools | Bash, Read, Write, Glob, Grep, Edit, AskUserQuestion |
Orchestrate multiple PRD projects through the full lifecycle: triage, build, PR, review, merge, deploy, canary, done. Wraps core/scripts/run-pipeline.sh — the bash backbone does all heavy lifting. This command provides the intelligent UI: triage presentation, gate interaction, progress display, and dynamic reordering.
Arguments: $ARGUMENTS
Parse $ARGUMENTS into:
company — company slug (first positional arg)prd_paths — one or more PRD paths (remaining positional args)--dry-run, --resume <id>, --status, plus any passthrough flagsRouting:
Usage: /run-pipeline <company> <prd1> [prd2...] [flags]
/run-pipeline --resume <pipeline-id>
/run-pipeline --status
Flags: --dry-run, --model MODEL, --timeout N, --verbose,
--auto-merge-all, --gate-all-merges, --skip-canary,
--skip-failed-projects, --auto-sst-deploy
--status → jump to Status Display (below)--resume <id> → jump to Step 9 — ResumeStandard policy loading protocol:
companies/{company}/policies/ (skip example-policy.md)core/policies/Display: Loaded N policies (H hard, S soft)
Run triage via the bash script in dry-run mode:
cd /Users/{your-name}/Documents/HQ && bash core/scripts/run-pipeline.sh {company} {prd1} [prd2...] --dry-run
Display the triage table output to the user. This shows: project sequence, risk levels, story counts, repo grouping, dependency order.
Ask user to confirm or reorder the sequence using AskUserQuestion:
If --dry-run was in the original args: stop after showing triage (do not launch).
Run the bash script in background:
cd /Users/{your-name}/Documents/HQ && \
nohup bash core/scripts/run-pipeline.sh {company} {prd1} [prd2...] {passthrough_flags} \
> workspace/orchestrator/_pipeline/{pipeline_id}/claude-session.log 2>&1 &
echo "PID:$!"
Note: The script creates the pipeline ID and state dir itself. To get the ID after launch:
workspace/orchestrator/_pipeline/ matching the company slugpipeline-state.json from that dir to confirm pipeline_id and PIDDisplay:
Pipeline launched: {pipeline_id} (PID: {pid}) Monitoring progress... (poll every 30s)
Poll workspace/orchestrator/_pipeline/{pipeline_id}/pipeline-state.json every 30 seconds.
Each poll iteration:
jq '.' pipeline-state.jsonkill -0 {pid} 2>/dev/null && echo "ALIVE" || echo "DEAD"Pipeline Progress: {pipeline_id}
project-a ████████████████ done
project-b ██████████░░░░░░ reviewing (PR #42)
project-c ░░░░░░░░░░░░░░░░ queued
Progress: 1/3 done | 1 in progress | 1 queued
Phase-to-bar mapping (16 chars):
queued = all emptybuilding = 4 filledpr_open / ci_wait = 6 filledcodex_review / reviewing = 8 filledmerging = 10 filleddeploying / canary = 12 filleddone = 16 filledfailed = show X markerpending_gate is non-null → Step 6 — Gate Handlingcompleted or failed → Step 8 — CompletionPoll ceiling: After 4 hours (480 cycles), warn user and offer to detach. Script keeps running — reattach with /run-pipeline --status.
When pending_gate is detected in pipeline-state.json:
Display gate details:
SAFETY GATE: {gate_name}
Project: {project}
Message: {message}
Requested at: {requested_at}
Present options via AskUserQuestion with choices:
Write resolution to pipeline-state.json:
cd /Users/{your-name}/Documents/HQ && \
jq '.pending_gate.resolution = "{choice}"' \
workspace/orchestrator/_pipeline/{pipeline_id}/pipeline-state.json > /tmp/ps-tmp.json && \
mv /tmp/ps-tmp.json workspace/orchestrator/_pipeline/{pipeline_id}/pipeline-state.json
Where {choice} is approve, reject, or skip.
Resume poll loop (Step 5). The bash script detects the resolution and continues.
After each project completes (phase transitions to done or failed), check if multiple projects remain queued. If so:
.sequence[].order values in pipeline-state.json via jq, then continue pollingOnly offer reorder when 2+ projects remain. Skip for single remaining project.
When pipeline status is completed or failed:
Pipeline Complete: {pipeline_id}
Duration: {duration}
Project Phase PR Status
─────────────────────────────────────────────
project-a done #41 deployed
project-b done #42 deployed
project-c failed — build error
Summary: 2 done | 1 failed | 0 skipped
error fieldworkspace/orchestrator/_pipeline/{pipeline_id}/When --resume <pipeline_id> is provided:
workspace/orchestrator/_pipeline/{pipeline_id}/pipeline-state.jsoncompletedin_progress → offer to relaunch:
cd /Users/{your-name}/Documents/HQ && \
nohup bash core/scripts/run-pipeline.sh --resume {pipeline_id} \
> workspace/orchestrator/_pipeline/{pipeline_id}/claude-session.log 2>&1 &
paused/failed → display error context, ask user for next actionWhen --status is provided:
cd /Users/{your-name}/Documents/HQ && bash core/scripts/run-pipeline.sh --status
Display the formatted output and stop.
pending_gate.resolution and sequence[].orderpre_deploy_prod and canary_failure gates are always gated — cannot be overridden even in autonomous modecore/scripts/run-pipeline.sh verbatimcore/settings/pipeline.yaml controls gate defaults, polling intervals, deploy behavior. The bash script reads it; this command does not need to parse it directlyworkspace/orchestrator/_pipeline/{pipeline_id}/ contains pipeline-state.json and logs