CI Workflow Skill
Context (Input)
- Code changes exist in the working directory
- Ready to validate code quality before commit/PR
- Need to ensure all quality standards are met
Task (Function)
Execute make ci and ensure ALL quality checks pass with success message.
Success Criteria: Output ends with "✅ CI checks successfully passed!"
Parallel Execution
The CI command uses Make's built-in parallelism (make -j4 --output-sync=target) for concurrent execution. No external tools are required beyond GNU Make.
Checks run in two stages:
- Preflight (sequential):
phpcsfixer → phpmd → phpinsights
- Parallel stage: static analysis, deptrac, tests+openapi, mutation
Parallel stage groups:
| Group |
Tasks |
Dependency |
| Static Analysis |
composer-validate, check-requirements, check-security, psalm, psalm-security |
None (fully parallel) |
| Architecture |
deptrac |
None |
| Tests + OpenAPI |
unit-tests, integration-tests, behat, openapi-diff, spectral, schemathesis |
setup-test-db first |
| Mutation |
infection |
None |
AI-Friendly Output
Make's --output-sync=target flag groups each target's output together after completion, preventing interleaved output from parallel tasks.
Execution Steps
Step 1: Run CI
make ci
Step 2: Check Result
- ✅ Success: "✅ CI checks successfully passed!" → Task complete
- ❌ Failure: Task fails with error output → Go to Step 3
Step 3: Fix Failures
Identify failing check from output and apply fix:
| Check |
Command |
Fix |
| Code style |
make phpcsfixer |
Apply auto-fixes |
| Static analysis |
make psalm |
Fix type errors |
| Quality metrics |
make phpinsights |
Reduce complexity, fix architecture |
| Tests |
make unit-tests |
Debug failing tests |
| Mutations |
make infection |
Add missing test cases |
| Config drift |
make validate-configuration |
Revert locked-file edits, or use exception workflow below |
Step 4: Re-run
make ci
Repeat Steps 2-4 until success message appears.
Locked Configuration Exception Workflow
If CI fails with Modification of locked configuration file is not allowed:
- Check whether the user explicitly requested a locked-config change (for example
deptrac.yaml).
- If no, treat it as accidental drift:
- Revert locked-file edits.
- Re-run
make ci.
- If yes, follow exception handling:
- Keep changes in a dedicated config-governance PR (no unrelated code changes).
- Report the failing command output as expected evidence.
- Escalate for human approval to merge; autonomous agents must not self-approve or self-merge failed CI.
- Include rationale: reason for change, impact on quality gates, rollback plan.
Do not normalize red CI merges as routine behavior.
Alternative Commands
| Command |
Description |
make ci |
Run parallel CI (default, faster) |
make ci-sequential |
Run sequential CI (fallback) |
make ci-preflight |
Run mutating preflight checks only |
Constraints (Parameters)
NEVER decrease these thresholds:
- min-quality: 100%
- min-complexity: 93%
- min-architecture: 100%
- min-style: 100%
- mutation MSI: 100%
- test coverage: 100%
DO NOT:
- Lower quality thresholds
- Skip failing checks
- Commit without "✅ CI checks successfully passed!" message
- Run commands outside Docker container (use
make or docker compose exec php)
- Edit locked quality config files unless the task explicitly requires a governed config change
- Present a failed CI run as "complete" without marking it as a human exception
Format (Output)
Required final output:
✅ CI checks successfully passed!
Verification Checklist
Rollback
If parallel execution causes issues:
- Use
make ci-sequential for the original sequential behavior
1---2name: ci-workflow-43description: Run comprehensive CI checks before committing changes. Use when the user asks to run CI, run quality checks, validate code quality, or before finishing any task that involves code changes.4---5
6# CI Workflow Skill
7
8## Context (Input)
9
10- Code changes exist in the working directory
11- Ready to validate code quality before commit/PR
12- Need to ensure all quality standards are met
13
14## Task (Function)
15
16Execute `make ci` and ensure ALL quality checks pass with success message.
17
18**Success Criteria**: Output ends with "✅ CI checks successfully passed!"
19
20## Parallel Execution
21
22The CI command uses Make's built-in parallelism (`make -j4 --output-sync=target`) for concurrent execution. No external tools are required beyond GNU Make.
23
24Checks run in two stages:
25
261. **Preflight (sequential)**: `phpcsfixer → phpmd → phpinsights`
272. **Parallel stage**: static analysis, deptrac, tests+openapi, mutation
28
29Parallel stage groups:
30
31| Group | Tasks | Dependency |
32| ------------------- | ---------------------------------------------------------------------------- | --------------------- |
33| **Static Analysis** | composer-validate, check-requirements, check-security, psalm, psalm-security | None (fully parallel) |
34| **Architecture** | deptrac | None |
35| **Tests + OpenAPI** | unit-tests, integration-tests, behat, openapi-diff, spectral, schemathesis | setup-test-db first |
36| **Mutation** | infection | None |
37
38### AI-Friendly Output
39
40Make's `--output-sync=target` flag groups each target's output together after completion, preventing interleaved output from parallel tasks.
41
42## Execution Steps
43
44### Step 1: Run CI
45
46```bash
47make ci
48```
49
50### Step 2: Check Result
51
52- ✅ **Success**: "✅ CI checks successfully passed!" → Task complete
53- ❌ **Failure**: Task fails with error output → Go to Step 3
54
55### Step 3: Fix Failures
56
57Identify failing check from output and apply fix:
58
59| Check | Command | Fix |
60| --------------- | ----------------------------- | --------------------------------------------------------- |
61| Code style | `make phpcsfixer` | Apply auto-fixes |
62| Static analysis | `make psalm` | Fix type errors |
63| Quality metrics | `make phpinsights` | Reduce complexity, fix architecture |
64| Tests | `make unit-tests` | Debug failing tests |
65| Mutations | `make infection` | Add missing test cases |
66| Config drift | `make validate-configuration` | Revert locked-file edits, or use exception workflow below |
67
68### Step 4: Re-run
69
70```bash
71make ci
72```
73
74Repeat Steps 2-4 until success message appears.
75
76### Locked Configuration Exception Workflow
77
78If CI fails with `Modification of locked configuration file is not allowed`:
79
801. Check whether the user explicitly requested a locked-config change (for example `deptrac.yaml`).
812. If **no**, treat it as accidental drift:
82 - Revert locked-file edits.
83 - Re-run `make ci`.
843. If **yes**, follow exception handling:
85 - Keep changes in a dedicated config-governance PR (no unrelated code changes).
86 - Report the failing command output as expected evidence.
87 - Escalate for human approval to merge; autonomous agents must not self-approve or self-merge failed CI.
88 - Include rationale: reason for change, impact on quality gates, rollback plan.
89
90Do not normalize red CI merges as routine behavior.
91
92## Alternative Commands
93
94| Command | Description |
95| -------------------- | ---------------------------------- |
96| `make ci` | Run parallel CI (default, faster) |
97| `make ci-sequential` | Run sequential CI (fallback) |
98| `make ci-preflight` | Run mutating preflight checks only |
99
100## Constraints (Parameters)
101
102**NEVER decrease these thresholds**:
103
104- min-quality: 100%
105- min-complexity: 93%
106- min-architecture: 100%
107- min-style: 100%
108- mutation MSI: 100%
109- test coverage: 100%
110
111**DO NOT**:
112
113- Lower quality thresholds
114- Skip failing checks
115- Commit without "✅ CI checks successfully passed!" message
116- Run commands outside Docker container (use `make` or `docker compose exec php`)
117- Edit locked quality config files unless the task explicitly requires a governed config change
118- Present a failed CI run as "complete" without marking it as a human exception
119
120## Format (Output)
121
122**Required final output**:
123
124```text
125✅ CI checks successfully passed!
126```
127
128## Verification Checklist
129
130- [ ] `make ci` executed
131- [ ] All checks passed (composer, security, style, psalm, tests, mutations)
132- [ ] Output shows "✅ CI checks successfully passed!"
133- [ ] Zero test failures
134- [ ] Zero escaped mutants
135- [ ] No quality threshold decreased
136- [ ] Locked config files unchanged, or human exception path explicitly documented
137
138## Rollback
139
140If parallel execution causes issues:
141
1421. Use `make ci-sequential` for the original sequential behavior