From session-orchestrator
Defines canonical commands for typecheck, test, and lint quality gates in 4 variants (Baseline, Incremental, Full Gate, Per-File) referenced by session orchestration skills.
npx claudepluginhub kanevry/session-orchestrator --plugin session-orchestratorThis skill uses the workspace's default tool permissions.
This skill defines the canonical quality check commands. Do NOT invoke this skill directly.
Guides strict Test-Driven Development (TDD): write failing tests first for features, bugfixes, refactors before any production code. Enforces red-green-refactor cycle.
Guides systematic root cause investigation for bugs, test failures, unexpected behavior, performance issues, and build failures before proposing fixes.
Guides A/B test setup with mandatory gates for hypothesis validation, metrics definition, sample size calculation, and execution readiness checks.
This skill defines the canonical quality check commands. Do NOT invoke this skill directly. Consuming skills (session-start, wave-executor, session-end, session-reviewer) reference the variant they need and execute the commands inline.
Quality-gate commands are resolved in this priority order:
.orchestrator/policy/quality-gates.json — canonical policy file (preferred). Schema: .orchestrator/policy/quality-gates.schema.json. Bootstrap writes a package-manager-aware default; hand-edit to customize.test-command / typecheck-command / lint-command in CLAUDE.md (Claude Code / Cursor) or AGENTS.md (Codex CLI) — fallback.pnpm test --run, tsgo --noEmit, pnpm lint.Loader: scripts/lib/quality-gates-policy.mjs exports loadQualityGatesPolicy(repoRoot) and resolveCommand(policy, key, fallback). The Bash-side runner scripts/run-quality-gate.sh performs the same resolution inline inside extract_command().
If any resolved command is set to the literal string skip, skip that check entirely.
Read these from the project's ## Session Config section when .orchestrator/policy/quality-gates.json is absent:
test-command — Custom test command.typecheck-command — Custom typecheck command.lint-command — Custom lint command.If a field is missing, use the hardcoded default.
Used by: session-start (Phase 3) Purpose: Quick health check at session start — non-blocking.
Commands:
{typecheck-command} 2>&1 | tail -5{test-command} 2>&1 | tail -5Behavior: Report results but do NOT block the session. Capture error counts and store them as the session baseline for later comparison.
Script output schema (Baseline):
{"variant": "baseline", "typecheck": {"status": "pass|fail|skip", "output": "string"}, "test": {"status": "pass|fail|skip", "output": "string"}}
Used by: wave-executor (after implementation waves) Purpose: Verify implementation waves did not break anything.
Commands:
{test-command} on changed files only (e.g., pnpm test -- <changed-test-files>).{typecheck-command}.Behavior: Report failures. If issues are found, add fix tasks to the next wave automatically. Do not block wave progression — let the next wave address regressions.
Metrics output (for consuming skills to capture):
{
"variant": "incremental",
"duration_seconds": null,
"typecheck": "pass|fail|skip",
"test": "pass|fail|skip",
"errors": []
}
Used by: session-end (Phase 2) Purpose: Final quality gate before commit — MUST pass.
Commands:
{typecheck-command} — must produce 0 errors.{test-command} — must pass (exit code 0).{lint-command} — must pass (warnings OK, errors NOT OK).console.log, debugger, TODO: remove.Behavior: BLOCKING. Do not commit if any check fails. Fix quick issues (<2 min) inline.
For anything longer, create a priority:high issue and proceed without committing the
affected files.
Metrics output (for consuming skills to capture):
{
"variant": "full-gate",
"duration_seconds": null,
"typecheck": {"status": "pass|fail|skip", "error_count": 0},
"test": {"status": "pass|fail|skip", "total": 0, "passed": 0},
"lint": {"status": "pass|fail|skip", "warnings": 0},
"debug_artifacts": []
}
Used by: session-reviewer agent Purpose: Targeted quality check on specific changed files.
Commands:
{test-command} on specific file paths passed by the reviewer.{typecheck-command}.Behavior: Report per-file pass/fail status. The reviewer uses these results to annotate its review output.
Script output schema (Per-File):
{"variant": "per-file", "typecheck": {"status": "pass|fail|skip"}, "test": {"status": "pass|fail|skip"}, "files": ["string"]}
Handle missing tools without failing the session:
{typecheck-command} fails with "command not found" → skip TypeScript checks, note "No TypeScript configured".{test-command} fails with "command not found" → skip tests, note "No test runner configured".{lint-command} fails with "command not found" → skip lint, note "No linter configured".typecheck-command: skip in Session Config.Always continue with the remaining checks — never abort a variant because one tool is missing.
When a consuming skill needs quality checks, include this directive:
Quality Reference: Run [Baseline|Incremental|Full Gate|Per-File] quality checks per the quality-gates skill. Read
test-command,typecheck-command, andlint-commandfrom Session Config (defaults:pnpm test --run,tsgo --noEmit,pnpm lint).
Replace the bracketed variant name with the specific variant required by that phase.
Prefer scripts/run-quality-gate.sh for deterministic execution with structured JSON output. The inline command approach is supported but produces unstructured output that downstream consumers cannot reliably parse.
# Baseline (session-start)
bash "${CLAUDE_PLUGIN_ROOT:-${CODEX_PLUGIN_ROOT:-$PLUGIN_ROOT}}/scripts/run-quality-gate.sh" --variant baseline --config "$CONFIG"
# Incremental (wave-executor)
bash "${CLAUDE_PLUGIN_ROOT:-${CODEX_PLUGIN_ROOT:-$PLUGIN_ROOT}}/scripts/run-quality-gate.sh" --variant incremental --config "$CONFIG" --files changed-file1.ts,changed-file2.ts
# Full Gate (session-end)
bash "${CLAUDE_PLUGIN_ROOT:-${CODEX_PLUGIN_ROOT:-$PLUGIN_ROOT}}/scripts/run-quality-gate.sh" --variant full-gate --config "$CONFIG" --session-start-ref "$SESSION_START_REF"
# Per-File (session-reviewer)
bash "${CLAUDE_PLUGIN_ROOT:-${CODEX_PLUGIN_ROOT:-$PLUGIN_ROOT}}/scripts/run-quality-gate.sh" --variant per-file --config "$CONFIG" --files specific-file.ts
The script handles graceful degradation (missing tools → skip), structured JSON output matching the schemas above, and proper exit codes (0=pass, 1=error, 2=gate-failed).