Test-Rig Development
Project: Multi-agent testing orchestration platform (CLI + API server)
Location: ~/projects/test-rig/
Tech: TypeScript, Vitest, Playwright, Testcontainers
Repos: GitHub (eron1703/test-rig) + GitLab (flow-master/test-rig)
Version: 1.0.0 | 29 tests | Quality 7.2/10
Architecture
src/
├── cli/commands/ # CLI commands (setup, generate, run, coverage, analyze, doctor, serve)
├── core/ # Test execution (test-runner, project-detector, framework-installer, config-loader, component-analyzer, spec-generator, coverage-generator, health-checker)
├── agents/ # Multi-agent orchestration (orchestrator, test-generator)
├── server/ # Optional API server (Express + SSE streaming)
├── templates/ # Test templates with {{PLACEHOLDER}} syntax
└── utils/ # Environment detection (CI, Claude agents, non-TTY)
Key Source Files
| File |
Purpose |
| src/cli/index.ts |
CLI entry point (Commander.js) |
| src/cli/commands/run.ts |
Test execution command |
| src/core/test-runner.ts |
Vitest/Pytest/Playwright execution + JSON output parsing |
| src/agents/orchestrator.ts |
Parallel agent spawning, topological sort, result aggregation |
| src/agents/test-generator.ts |
Test file generation from templates |
| src/server/index.ts |
API server (POST /test/run, GET /test/stream, GET /health) |
| src/utils/environment.ts |
CI/agent detection (CLAUDE_CODE, GITHUB_ACTIONS, etc.) |
Development Workflow
# Edit src/ → build → test → lint
npm run build && npm test && npm run lint
# Watch mode for development
npm run test:watch
Agent Rules for This Project
- ALL test-rig commands MUST use
--headless, --yes, --non-interactive flags
- Environment auto-detection: CLAUDE_CODE=true, CI=true, non-TTY
- Templates in src/templates/ use {{COMPONENT_NAME}}, {{COMPONENT_PATH}} placeholders
- Component specs (YAML) define testable units with dependency ordering
- Orchestrator does topological sort for parallel execution without conflicts
Common Dev Tasks
Add new framework: framework-installer.ts → test-runner.ts → template → README
Add new template: src/templates/ → test-generator.ts → postbuild copy
Add CLI command: src/cli/commands/ → register in src/cli/index.ts
Add API endpoint: src/server/index.ts
Quality Gates (Strict on main)
- All 29 tests passing
- No linting errors
- Clean build (
npm run build)
- Push to BOTH remotes:
git push github main && git push gitlab main
1---2name: test-rig3description: Test-rig project development context - architecture, source structure, dev workflow (only for ~/projects/test-rig/)4---56# Test-Rig Development78**Project:** Multi-agent testing orchestration platform (CLI + API server)9**Location:** ~/projects/test-rig/10**Tech:** TypeScript, Vitest, Playwright, Testcontainers11**Repos:** GitHub (eron1703/test-rig) + GitLab (flow-master/test-rig)12**Version:** 1.0.0 | 29 tests | Quality 7.2/101314---1516## Architecture1718```19src/20├── cli/commands/ # CLI commands (setup, generate, run, coverage, analyze, doctor, serve)21├── core/ # Test execution (test-runner, project-detector, framework-installer, config-loader, component-analyzer, spec-generator, coverage-generator, health-checker)22├── agents/ # Multi-agent orchestration (orchestrator, test-generator)23├── server/ # Optional API server (Express + SSE streaming)24├── templates/ # Test templates with {{PLACEHOLDER}} syntax25└── utils/ # Environment detection (CI, Claude agents, non-TTY)26```2728## Key Source Files2930| File | Purpose |31|---|---|32| src/cli/index.ts | CLI entry point (Commander.js) |33| src/cli/commands/run.ts | Test execution command |34| src/core/test-runner.ts | Vitest/Pytest/Playwright execution + JSON output parsing |35| src/agents/orchestrator.ts | Parallel agent spawning, topological sort, result aggregation |36| src/agents/test-generator.ts | Test file generation from templates |37| src/server/index.ts | API server (POST /test/run, GET /test/stream, GET /health) |38| src/utils/environment.ts | CI/agent detection (CLAUDE_CODE, GITHUB_ACTIONS, etc.) |3940## Development Workflow4142```bash43# Edit src/ → build → test → lint44npm run build && npm test && npm run lint4546# Watch mode for development47npm run test:watch48```4950## Agent Rules for This Project5152- ALL test-rig commands MUST use `--headless`, `--yes`, `--non-interactive` flags53- Environment auto-detection: CLAUDE_CODE=true, CI=true, non-TTY54- Templates in src/templates/ use {{COMPONENT_NAME}}, {{COMPONENT_PATH}} placeholders55- Component specs (YAML) define testable units with dependency ordering56- Orchestrator does topological sort for parallel execution without conflicts5758## Common Dev Tasks5960**Add new framework:** framework-installer.ts → test-runner.ts → template → README61**Add new template:** src/templates/ → test-generator.ts → postbuild copy62**Add CLI command:** src/cli/commands/ → register in src/cli/index.ts63**Add API endpoint:** src/server/index.ts6465## Quality Gates (Strict on main)6667- All 29 tests passing68- No linting errors69- Clean build (`npm run build`)70- Push to BOTH remotes: `git push github main && git push gitlab main`