Ci workflow

From VilnaCRM-Org/user-service · View interactive version

Ci workflow is an AI agent skill from the GitHub repository VilnaCRM-Org/user-service. 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.

How to use this skill

Skill file

CI Workflow Skill

Context (Input)

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:

  1. Preflight (sequential): phpcsfixer → phpmd → phpinsights
  2. 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

Step 3: Fix Failures

Identify failing check from output and apply fix:

| Check | Command | Fix | Companion Skill |

| --------------- | ------------------ | ----------------------------------- | ---------------------------------------------------------- |

| Code style | make phpcsfixer | Apply auto-fixes | - |

| Static analysis | make psalm | Fix type errors | - |

| Quality metrics | make phpinsights | Reduce complexity, fix architecture | complexity-management |

| Architecture | make deptrac | Fix layer boundary violations | deptrac-fixer |

| Organization | make psalm | Fix naming, directory placement | code-organization |

| Tests | make unit-tests | Debug failing tests | testing-workflow |

| Mutations | make infection | Add missing test cases | testing-workflow |

Refactoring during fixes: If CI failures reveal structural issues (wrong directory, vague names, hardcoded config), consult the code-organization skill before applying fixes.

Step 4: Re-run

make ci

Repeat Steps 2-4 until success message appears.

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:

DO NOT:

Format (Output)

Required final output:

✅ CI checks successfully passed!

Verification Checklist

Rollback

If parallel execution causes issues:

  1. Use make ci-sequential for the original sequential behavior

Related Skills

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.