| name | test-log-centralizer |
| description | Centralize test-run logs under <project>/.test-runs/<UTC-timestamp>/ so every other testing skill (auto-test, unit-test-runner, browser-test, integration-test-runner, flaky-detector, coverage-reporter) writes into a single shared run folder. Use ONLY as a dependency invoked by another testing skill โ it is not user-facing on its own. Trigger when another skill needs to (a) start a new run folder via `scripts/init-run.sh`, (b) append per-layer log lines via `scripts/append-log.sh`, or (c) finalize a run via `scripts/finalize-run.sh`. Do NOT trigger on user phrases like "show me the logs", "tail the logs", "check what tests printed" โ those should call `auto-test` (which internally uses this skill) or read `<project>/.test-runs/latest/run.log` directly with the Read tool. Do NOT use this skill for non-test logging (application logs, build output, lint output) โ those belong to other tools. |
| allowed-tools | Bash, Read |
test-log-centralizer
Singleton dependency for all testing skills in this repo. Provides a uniform path
convention and three small bash entrypoints under scripts/ so every test layer
(unit, integration, browser, orchestrator, skill, setup, teardown) writes into the
same <project>/.test-runs/<run-id>/ folder. Output structure is documented in
docs/ARCHITECTURE.md ยง(b).
When to use
Activate only when invoked as a sub-step of another testing skill โ typically
auto-test, unit-test-runner, browser-test, integration-test-runner,
flaky-detector, or coverage-reporter. Concretely:
- A caller skill needs to start a fresh run โ run
scripts/init-run.sh.
- A caller skill needs to append stdout/stderr to a per-layer stream โ run
scripts/append-log.sh. Each emitted line is prefixed with an ISO-8601 UTC
timestamp (ms-precision when python3 is available, second-precision otherwise).
- A caller skill needs to finalize the run (merge streams โ
run.log,
emit summary.json (final form) + manifest.json + run.json, re-point
latest) โ run scripts/finalize-run.sh.
Do not activate when the user message is about reading or tailing existing
logs โ that is a plain Read / Grep of <project>/.test-runs/latest/run.log
and does not need this skill.
Do not activate for non-test logging (general application logs, build output,
lint output, deployment output). Those belong elsewhere.
How to use
SKILL_DIR="$(dirname "$0")/.."
RUN=$("$SKILL_DIR/scripts/init-run.sh" "<project-root>" "<runner>" "<command>")
"$SKILL_DIR/scripts/append-log.sh" "$RUN" unit "starting suite tests/auth"
bun test 2>&1 | "$SKILL_DIR/scripts/append-log.sh" "$RUN" unit
"$SKILL_DIR/scripts/finalize-run.sh" "$RUN" "$EXIT_CODE" "$TOTAL" "$PASSED" "$FAILED" "$SKIPPED"
"$SKILL_DIR/scripts/retain.sh" "<project-root>/.test-runs"
The <runner> and <command> arguments to init-run.sh are optional โ when
omitted, meta.runner defaults to "tbd" and meta.command to the empty
string. They are filled later by the caller skill once framework detection
has run. See references/schema.md for the full JSON shape contract that
downstream skills + agents can rely on.
Examples
User says: "run the unit tests" โ Claude invokes auto-test, which calls
unit-test-runner, which calls this skill's init-run.sh to scaffold the run
folder before spawning the framework.
User says: "show me the latest test log" โ Claude does not invoke this skill;
it calls Read on <project>/.test-runs/latest/run.log directly.
Files
scripts/
init-run.sh โ T-1.1: scaffold run folder + meta.json + summary.json placeholder
append-log.sh โ T-1.2: per-layer stream append with ISO-8601 UTC ts prefix
finalize-run.sh โ T-1.2: merge streams โ run.log, write summary/manifest/run.json,
re-point .test-runs/latest atomically; optional retain hook (T-1.6)
retain.sh โ T-1.6: count-based retention sweep (10 plain + 2 gz + prune)
references/
schema.md โ T-1.2: contract for meta.json, summary.json, manifest.json, run.json
tests/
test-init-run.sh โ T-1.1 acceptance (35 assertions)
test-append-log.sh โ T-1.2 acceptance (36 assertions)
test-finalize-run.sh โ T-1.2 acceptance (55 assertions, incl. golden compare)
test-retention.sh โ T-1.6 acceptance (71 assertions, incl. 12-/14-/5-run scenarios + idempotency + finalize wiring)
goldens/
manifest.golden.json โ normalized golden for finalize-run shape stability
run-all.sh โ convenience runner; bash run-all.sh exits 0 when everything green
See also
docs/ARCHITECTURE.md ยง(b) โ folder layout, retention policy, latest symlink.
docs/ARCHITECTURE.md ยง(f) โ TestRun data-model (run.json schema).
spike/code/log-centralizer/ โ Phase 0 prototype (frozen reference).