# Pipeline Scripts  -  Category Index

`pipeline/scripts/` holds the pipeline's shell and Node.js scripts in one flat directory. The layout stays flat because `package.json` globs, the installer's deploy logic, npm scripts, sibling script calls and every smoke's root resolution all address scripts by this path; subdirectories would change each of those with no change in behaviour.

This README is a curated category index of the key scripts, not an exhaustive listing. `ls pipeline/scripts` is the listing.

## Smoke scripts (`smoke-*.sh`)

Validate contracts. Each emits `══ <name> smoke: N passed, M failed ══` on completion (the `smoke-personal-data.sh` + `smoke-token-budget.sh` suites use `PASS:` / `warnings:` variants). Run via `npm test` (chained through `run-smokes.mjs`) or individually.

### Cross-CLI contract + parity
- `smoke-cross-cli-behavior.sh`  -  parent parity smoke, agent/skill deployment on both sides
- `smoke-commands-skills-parity.sh`  -  colon-form command ↔ dash-form skill directory parity
- `smoke-compliance-skills.sh`  -  store-compliance wiring contract

### Figma pipeline
- `smoke-figma-config-schema.sh`, `smoke-figma-dispatch.sh`

### Phase contracts
- `smoke-phase-0-multi-repo.sh`  -  Phase 0 multi-repo mode fetch + worktree atomicity
- `smoke-phase-6-multi.sh`  -  Phase 4 multi-repo commit/PR cross-linking
- `smoke-phase-banner.sh` + `smoke-phase-tracker.sh`  -  Phase UI output contracts
- `smoke-phase4-triage.sh`  -  Phase 3 reviewer → triage flow
- `smoke-verify-by-test.sh`  -  Phase 3 verify-by-test contract
- `smoke-handoff-contract.sh`  -  phase-boundary structured handoff + handoff-first resume
- `smoke-update-check.sh`  -  Phase 0 update check + required-floor contract
- `smoke-context-links.sh`  -  context-link-extractor classification contract, all types
- `smoke-graylog-environments.sh`  -  Graylog prod / test instance resolution + auto fallback

### Schema + state
- `smoke-schema-validation.sh`  -  all JSON schemas validate
- `smoke-migrate-state.sh`  -  `migrate-state.mjs` runner behavior
- `smoke-pref-migration.sh`  -  prefs migration chain
- `smoke-write-state.sh`  -  atomic state writer concurrency

### Quality + security
- `smoke-personal-data.sh`  -  guards against corporate hostname / private Jira key / personal domain leaks (the pattern catalog is in the script itself)
- `smoke-pat-audit.sh`  -  PAT lookup telemetry contract
- `smoke-token-budget.sh`  -  per-phase token budget enforcement, one ceiling per phase in `pipeline/schemas/token-budget.json`
- `smoke-skill-scan.sh`  -  skill security scanner tiered pattern catalog

### Command / Feature contracts
- `smoke-channels-flow.sh`  -  `/multi-agent:channels` multi-select + humanizer + Bitbucket PUT
- `smoke-wiki-integration.sh`  -  wiki Case A/B + adapter contract
- `smoke-add-detail.sh`  -  Bitbucket PUT reviewer preservation
- `smoke-issue-jira-triad.sh`  -  Issue → Jira → Wiki triad
- `smoke-url-enrichment.sh`  -  Phase 0 URL context parsing
- `smoke-plan-approval-gate.sh`  -  Phase 1 plan approval: clarification + free-text edit loop
- `smoke-push-retry.sh`  -  push retry policy + fail flow
- `smoke-identity-isolation.sh`  -  cross-identity PAT leak guard
- `smoke-sync-parity.sh`  -  `/multi-agent:sync` behavior

### Sub-systems
- `smoke-multi-repo-integration.sh`  -  integration build + learn-once registry
- `smoke-multi-repo-worktree.sh`  -  serial worktree creation with atomicity rollback
- `smoke-prefs-language.sh`  -  `prefs.global.promptLanguage` contract
- `smoke-terminal-language.sh`  -  every terminal surface renders in `prefs.global.outputLanguage`, English as the fallback
- `smoke-progress-contract.sh`  -  progress-line quiet/normal/verbose
- `smoke-search.sh`  -  `/multi-agent:search` log search + smart ranking
- `smoke-subagent-validators.sh`  -  Phase 1/2 validator schemas
- `smoke-telemetry.sh`  -  opt-in telemetry contract
- `smoke-learning-curve.sh`  -  `learning-curve.mjs` metrics-trend contract
- `smoke-validator-contradiction.sh`  -  Phase 3 approved/blocking contradiction detection
- `smoke-pre-commit.sh`  -  pre-commit hook integration

## Gate and hook scripts

- `pre-commit-check.sh`  -  secret scan over staged changes; also the owned-path gate on a commit
- `pre-push-check.sh`  -  the local gate before a push: runs the canonical `npm test` chain
- `output-quality-check.sh`  -  checks a task's commit message, PR body, Jira comment and reviewer / triage JSON (real newlines, no HTML entities, required sections)

## Runtime helpers
Shell scripts invoked during pipeline execution.

- `phase-banner.sh`  -  renders phase headers
- `phase-tracker.sh`  -  live tracker state + tokens accumulation + render
- `keychain-save.sh`  -  store PAT in macOS Keychain
- `audit-log.sh` + `audit-log-rotate.sh`  -  opt-in audit trail
- `log-metric.sh`  -  opt-in metric capture
- `search-logs.sh`  -  backs `/multi-agent:search`
- `scan-skills.sh`  -  backs `/multi-agent:scan`
- `benchmark-phase-0.sh`  -  Phase 0 perf harness
- `github-ssh-setup.sh`  -  first-run SSH key setup helper
- `update-check.sh`  -  cached registry read (`dist-tags.latest` + `dist-tags.required`); always exit 0
- `require-supported-version.sh`  -  turns the `force` signal into exit 3; fails open offline
- `release-notes.mjs`  -  every release between the installed and the new version, grouped by kind, plus each plugin the refresh moved; feeds the update summary
- `sync-parity-check.sh`  -  manual parity verification helper

## Node.js helpers (`*.mjs`)

- `aggregate-metrics.mjs`  -  collects telemetry aggregates
- `learning-curve.mjs`  -  time-bucketed trend over `metrics.jsonl` (first-pass clean rate, review cycles, rework/task, tokens/task, cache ratio); `--bucket`, `--since`, `--json`, `--markdown`
- `eval-triage.mjs`  -  runs the triage eval fixtures
- `eval-mine-corpus.mjs`  -  manual maintainer CLI: mines `~/.claude/memory/multi-agent/<repo-slug>/triage-corpus.jsonl` from real runs into new triage eval fixtures (dev-only, excluded from the npm package; not part of `npm test`)
- `gen-skills-index.mjs`  -  regenerates `pipeline/skills/shared/README.md` skill catalog
- `gen-facts.mjs`  -  derives `docs/facts.json`, the counts the docs and the website state; `gen-fact-marks.mjs` renders them into the docs
- `gen-office-command-matrix.mjs`  -  writes `pipeline/office/command-matrix.json`, how the office handles each command (start, window, or terminal-only with its reason); `--check` runs in `npm test`
- `migrate-prefs.mjs`  -  preference migration driver
- `migrate-state.mjs`  -  generic migration runner (reads `schemas/migrations/`)
- `token-budget-report.mjs`  -  per-phase token usage report
- `validate-analysis.mjs`, `validate-planning.mjs`, `validate-reviewer.mjs`, `validate-triage.mjs`  -  per-phase output validators
- `validate-schemas.mjs`  -  top-level schema validity gate (runs every schema through AJV)
- `lint-personas.mjs`  -  persona gate for `pipeline/agents/*.md`: frontmatter contract, `## Output Format` body heading, no `~/.claude` / `$HOME` in the body, byte-for-byte Codex TOML round-trip; runs in `npm test`, `test:quick`, ci-lite and release
- `lint-mcp-refs.mjs`  -  every `mcp__<server>__<tool>` reference is callable; with the toolkit's live `tools/list`, every served tool is reachable and has a stack and phase home in `multi-agent-refs/toolkit-tools.md`
- `write-state.mjs`  -  atomic state writer with concurrency safety
