name: "spartan-ci-parity" description: "Reproduce Spartan Hub CI checks locally with command parity and deterministic reporting. Use when a user asks to run the same checks as GitHub Actions, investigate CI-only failures, or verify readiness before push/PR."
Scope
Primary CI reference:
spartan-hub/.github/workflows/ci.yml
Secondary PR hardening reference (when requested):
spartan-hub/.github/workflows/pr-automated-checks.yml
Always state which workflow(s) you are mirroring.
Baseline parity flow (ci.yml)
Run in this order:
- Frontend deps and tests
cd spartan-hub
npm ci
npm run test:components
- Backend deps and tests
cd spartan-hub/backend
npm ci
npm test
- Lint + type-check (frontend)
cd spartan-hub
npm run lint
npm run type-check
- Build validation
cd spartan-hub
npm run build:all
- Build outputs existence
cd spartan-hub
if (!(Test-Path dist)) { throw 'dist missing' }
if (!(Test-Path backend/dist)) { throw 'backend/dist missing' }
Environment parity notes
- CI uses Node 18.x.
- If local Node differs, report version mismatch explicitly before results.
- If command fails due sandbox/process restrictions (
spawn EPERM), rerun with escalation and markescalated.
Optional PR-hardening flow (pr-automated-checks.yml)
Only run when user asks for full PR parity:
- backend security audit:
cd spartan-hub/backend; npm audit --audit-level high - backend lint:
cd spartan-hub/backend; npx eslint . --ext .ts,.tsx --max-warnings 0 - backend tsc:
cd spartan-hub/backend; npx tsc --noEmit - backend unit tests:
cd spartan-hub/backend; npm test - static grep validations for rate-limit and zod patterns.
Output format
CI Parity Summary
- workflow: <ci.yml | ci.yml + pr-automated-checks.yml>
- node: <local version> (match|mismatch)
- frontend-tests: PASS|FAIL
- backend-tests: PASS|FAIL
- lint-typecheck: PASS|FAIL
- build-validation: PASS|FAIL
- artifacts-check: PASS|FAIL
- overall: PASS|FAIL
Failures
- <first actionable error per failed stage>
Rules
- Do not skip failed stages silently.
- Keep command order aligned with selected workflow.
- If a stage is intentionally skipped, mark it
SKIPPEDand explain why. - Do not commit or push unless user explicitly requests it.