Skip to content
Back to skills

Collection

ASecurity

๐Ÿ”„ PHP-QA-CI TOOL ORCHESTRATOR - Automatic runโ†’fixโ†’run cycling for php-qa-ci tools. **ONLY for php-qa-ci pipeline tools** (./bin/qa -t toolname) NOT for ad-hoc tool execution outside php-qa-ci. Use when user requests QA tools via php-qa-ci: - "run phpstan", "use stan skills" - "run tests", "run phpunit" - "run rector", "run cs fixer" - "run allStatic", "run allCS" **CRITICAL**: MUST cycle automatically until tool reports clean OR escalation needed. DO NOT stop after one fix to ask "what ne...

  • 24 stars
  • 0 votes
  • 0 copies
  • 4 views
  • Added September 8, 2026
code-qualitygophpbashtestingrefactoringdocumentation

Works with

  • cli

Security analysis

A100/100

Pro scans all 21 files and shows the line behind each finding

Scanned September 8, 2026

npx -y skills add mattnigh/skills_collection --skill collection --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Collection?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Collection
[![Security: A โ€” Skills Directory](https://www.skillsdirectory.com/api/skills/mattnigh-collection-c289fd95/badge)](https://www.skillsdirectory.com/skills/mattnigh-collection-c289fd95)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: qa
description: |
  ๐Ÿ”„ PHP-QA-CI TOOL ORCHESTRATOR - Automatic runโ†’fixโ†’run cycling for php-qa-ci tools.

  **ONLY for php-qa-ci pipeline tools** (./bin/qa -t toolname)
  NOT for ad-hoc tool execution outside php-qa-ci.

  Use when user requests QA tools via php-qa-ci:
  - "run phpstan", "use stan skills"
  - "run tests", "run phpunit"
  - "run rector", "run cs fixer"
  - "run allStatic", "run allCS"

  **CRITICAL**: MUST cycle automatically until tool reports clean OR escalation needed.
  DO NOT stop after one fix to ask "what next?" - KEEP CYCLING.

  Supports all php-qa-ci tools via ./bin/qa -t {toolname}:
  - phpstan (static analysis) - has fixer agent
  - phpunit (tests) - has fixer agent
  - rector (refactoring) - self-fixing, re-run until clean
  - fixer (code style) - self-fixing, re-run until clean
  - infection (mutation testing) - no auto-fix
  - allStatic/allCs/allTests - meta groups

  Automatically detects which tools have fixers and invokes them.

  **PERFORMS PREFLIGHT CHECK**: Invokes docs-conflict-checker agent to ensure
  project documentation doesn't conflict with skills/agents system requirements.
allowed-tools: Skill, Task
---

# PHP-QA-CI Tool Orchestrator Skill

**THIS SKILL IS EXCLUSIVELY FOR PHP-QA-CI PIPELINE TOOLS**

All tool execution MUST use: `./bin/qa -t {toolname}`
This ensures proper configuration, caching, and log rotation.

## โš ๏ธ STEP 0: PREFLIGHT CHECK - MUST RUN FIRST

**BEFORE doing anything else, check for documentation conflicts**

Launch the docs-conflict-checker agent:

```
[Task tool]
  description: "Check docs for conflicts"
  subagent_type: "php-qa-ci_docs-conflict-checker"
  prompt: "Check project documentation for php-qa-ci agent restrictions"
```

**Parse checker output:**

If checker reports `โŒ CONFLICTS DETECTED`:
- Display the full conflict report to user
- Show the suggested fix
- **STOP** - Do not proceed with QA workflow
- Offer to provide complete replacement text if user wants it

If checker reports `โœ… NO CONFLICTS DETECTED`:
- Proceed to Step 1 (Tool Detection)

## PHP-QA-CI Pipeline Context

**What is php-qa-ci?**
- A comprehensive QA pipeline for PHP projects
- Installed as vendor package: `lts/php-qa-ci`
- Provides unified command: `./bin/qa`
- Orchestrates multiple tools with proper config/caching/logging

**All commands in this skill use php-qa-ci:**
- โœ… `export CI=true && ./bin/qa -t phpstan`
- โœ… `export CI=true && ./bin/qa -t unit`
- โœ… `export CI=true && ./bin/qa -t allStatic`
- โŒ `vendor/bin/phpstan analyse` (bypasses pipeline)
- โŒ `vendor/bin/phpunit` (bypasses pipeline)

**Why use php-qa-ci instead of tools directly?**
- Consistent configuration across projects
- Automatic log rotation (keeps last 10 runs)
- Proper caching and temp directories
- Integration with project config in `qaConfig/`
- Parallel processing where supported

## ๐Ÿšจ CRITICAL INSTRUCTION - READ FIRST

**YOU MUST CYCLE AUTOMATICALLY WITHOUT STOPPING**

This skill runs php-qa-ci tools and automatically fixes issues until clean.

**Forbidden Actions**:
- โŒ Running once, fixing once, then asking "Should I run again?"
- โŒ Stopping to report status between iterations
- โŒ Waiting for user permission between cycles
- โŒ **CRITICAL**: Using Bash tool to run commands (burns main context tokens!)

**Required Actions**:
- โœ… Detect which tool user wants from their request
- โœ… **Invoke runner SKILLS** (phpstan-runner, phpunit-runner) NOT Bash
- โœ… Runner skills launch cheap agents to execute tools
- โœ… Keep cycling: run skill โ†’ fixer skill โ†’ run skill...
- โœ… Report final summary only when done

**TOKEN EFFICIENCY - CRITICAL**:
- This skill ONLY invokes other skills via Skill tool
- Runner skills (phpstan-runner, phpunit-runner) launch cheap haiku agents
- Agents run Bash commands in cheap agent context
- This keeps expensive tool output OUT of main context

## Tool Detection

Parse user request to identify tool:

| User Says | Tool Name | Has Fixer? | Fixer Skill/Agent |
|-----------|-----------|------------|-------------------|
| "run phpstan", "use stan skills" | `phpstan` | โœ… | phpstan-fixer |
| "run tests", "run phpunit" | `phpunit` | โœ… | phpunit-fixer |
| "run rector" | `rector` | โœ… Self-fixing | N/A - just re-run |
| "run cs fixer", "run fixer" | `fixer` | โœ… Self-fixing | N/A - just re-run |
| "run infection" | `infection` | โŒ | N/A - report only |
| "run allStatic" | `allStatic` | โœ… Mixed | Use component fixers |
| "run allCS" | `allCs` | โœ… Self-fixing | N/A - just re-run |
| "run allTests" | `allTests` | โœ… | phpunit-fixer |

## Universal Iteration Loop

```
INITIALIZE:
  - iteration = 0
  - max_iterations = 5
  - previous_errors = []
  - tool = detect_tool_from_user_request()

LOOP:
  1. Run tool via appropriate runner SKILL (NOT Bash!):
     [Skill] Invoke phpstan-runner OR phpunit-runner skill
     - Runner skill launches cheap haiku agent
     - Agent runs: export CI=true && ./bin/qa -t {tool} [-p {path}]
     - Agent parses logs and returns summary
  2. Parse runner skill output:
     - CLEAN? โ†’ Report success, EXIT
     - CRASH? โ†’ Escalate, EXIT
     - ERRORS/FAILURES? โ†’ Continue to step 3
  3. Check escalation:
     - iteration >= max_iterations? โ†’ Escalate, EXIT
     - errors == previous_errors? โ†’ Escalate, EXIT
  4. Apply fix:
     - If tool has dedicated fixer โ†’ Invoke fixer SKILL
     - Fixer skill launches cheap sonnet agent to implement fixes
     - If no fixer available โ†’ Report and ask user
  5. iteration++, previous_errors = current_errors
  6. IMMEDIATELY goto LOOP (no pause, no questions)
END

**KEY**: NEVER use Bash tool in this skill - ALWAYS invoke runner skills
```

## ๐Ÿ“Š Step Summaries - CRITICAL

**After EVERY step, provide a clear summary to the user:**

### After Runner Execution
```markdown
## ๐Ÿ”„ Iteration X - Runner Results

**Tool**: PHPStan/PHPUnit/etc
**Exit Code**: X
**Status**: โœ… Clean | โš ๏ธ Errors Found | โŒ Crashed

**Quick Stats**:
- Total Errors/Failures: XX
- Files Affected: YY
- Most Common Pattern: [pattern name] (ZZ occurrences)

**Next Action**: Launching fixer | Re-running | Complete
```

### After Fixer Execution
```markdown
## ๐Ÿ”ง Iteration X - Fixer Results

**Fixes Applied**: XX
**Files Modified**: YY
**Patterns Fixed**:
- Pattern A: X fixes
- Pattern B: Y fixes

**Next Action**: Re-running tool to verify fixes
```

### Final Summary (When Clean)
```markdown
## โœ… QA Pipeline Complete

**Tool**: [toolname]
**Total Iterations**: X
**Total Fixes Applied**: YY
**Final Status**: All checks passing

**Log File**: `var/qa/{tool}_logs/{tool}.TIMESTAMP.log`

Pipeline succeeded! ๐ŸŽ‰
```

### Escalation Summary (When Stuck)
```markdown
## โš ๏ธ Escalation Needed

**Tool**: [toolname]
**Iterations Attempted**: X
**Remaining Errors**: YY
**Issue**: Same errors persisting | Max iterations reached | Manual intervention required

**Remaining Error Patterns**:
- Pattern A: X occurrences (requires architecture changes)
- Pattern B: Y occurrences (business logic questions)

**Recommendation**: Human review required for remaining issues
```

## Tool-Specific Strategies

### PHPStan (Static Analysis)
```
[Skill] Invoke phpstan-runner skill
  โ†’ Runner skill launches haiku agent
  โ†’ Agent runs: export CI=true && ./bin/qa -t stan [-p path]
  โ†’ Agent parses: var/qa/phpstan_logs/phpstan.log
  โ†’ Returns summary to main context
[Skill] If errors โ†’ Invoke phpstan-fixer skill
  โ†’ Fixer skill launches sonnet agent
  โ†’ Agent implements fixes
Clean: "No errors" in output
```

### PHPUnit (Tests)
```
[Skill] Invoke phpunit-runner skill
  โ†’ Runner skill launches haiku agent
  โ†’ Agent runs: export CI=true && ./bin/qa -t unit [-p path]
  โ†’ Agent parses: var/qa/phpunit_logs/phpunit.junit.xml
  โ†’ Returns summary to main context
[Skill] If failures โ†’ Invoke phpunit-fixer skill
  โ†’ Fixer skill launches sonnet agent
  โ†’ Agent implements fixes
Clean: "OK (X tests, Y assertions)" or "Tests: X, Failures: 0, Errors: 0"
```

### Rector (Refactoring)
```
Run: export CI=true && ./bin/qa -t rector
Log: stdout only
Self-fixing: Yes - re-run automatically applies fixes
Clean: "[OK] Rector is done!" or no files changed
Strategy: Just keep re-running until no changes
```

### PHP CS Fixer (Code Style)
```
Run: export CI=true && ./bin/qa -t fixer
Log: stdout only
Self-fixing: Yes - automatically fixes on each run
Clean: "Fixed all files" or exit code 0
Strategy: Just keep re-running until no changes
```

### Infection (Mutation Testing)
```
Run: export CI=true && ./bin/qa -t infection
Log: var/qa/infection/log.txt
No fixer: Cannot auto-fix mutations
Strategy: Run once, report MSI, ask user for next steps
```

### AllStatic (PHPStan + other static tools)
```
Run: export CI=true && ./bin/qa -t allStatic
Fixers: PHPStan has fixer, others report-only
Strategy: Cycle on PHPStan errors, report others
```

### AllCS (Rector + CS Fixer + linters)
```
Run: export CI=true && ./bin/qa -t allCs
Self-fixing: Yes - Rector and CS Fixer auto-fix
Strategy: Keep re-running until no changes
```

## Implementation Template

```
1. Detect tool from user request
   - Extract tool name (phpstan, phpunit, etc.)
   - Extract optional path (-p flag)

2. Invoke appropriate runner SKILL (NOT Bash!):
   [Skill] phpstan-runner OR phpunit-runner
   - Pass context about path if specified
   - Runner skill launches cheap haiku agent
   - Agent executes tool and parses results
   - Returns summary to main context

3. Parse runner skill output:
   - Check for clean completion
   - Count errors/failures
   - Extract error patterns

4. If not clean:
   - Check if fixer available
   - [Skill] Invoke fixer skill (phpstan-fixer, phpunit-fixer)
   - Fixer skill launches cheap sonnet agent
   - IMMEDIATELY goto step 2

5. If clean:
   - Report success with summary
   - EXIT
```

## Example: PHPStan Workflow

```
User: "run phpstan"

Iteration 1:
  [Skill] Invoke phpstan-runner skill
    โ†’ Runner launches haiku agent (cheap!)
    โ†’ Agent runs: export CI=true && ./bin/qa -t stan
    โ†’ Agent parses log, returns summary
  [Result] 45 errors across 12 files
  [Skill] Invoke phpstan-fixer skill
    โ†’ Fixer launches sonnet agent (cheap!)
    โ†’ Agent implements fixes
  [Result] Fixed 40 errors
  [AUTO-CONTINUE - NO PAUSE]

Iteration 2:
  [Skill] Invoke phpstan-runner skill
    โ†’ Agent runs analysis again
  [Result] 5 errors across 3 files
  [Skill] Invoke phpstan-fixer skill
    โ†’ Agent implements fixes
  [Result] Fixed 3 errors
  [AUTO-CONTINUE - NO PAUSE]

Iteration 3:
  [Skill] Invoke phpstan-runner skill
    โ†’ Agent runs analysis again
  [Result] 2 errors in 1 file
  [Skill] Invoke phpstan-fixer skill
    โ†’ Agent implements fixes
  [Result] Fixed 2 errors
  [AUTO-CONTINUE - NO PAUSE]

Iteration 4:
  [Skill] Invoke phpstan-runner skill
    โ†’ Agent runs analysis again
  [Result] No errors - CLEAN
  [DONE]

Report:
"โœ… PHPStan analysis CLEAN after 4 iterations
  - Total errors fixed: 45
  - Final status: No errors
  - All tool execution in cheap agent context (saved main context tokens!)
  - Log: var/qa/phpstan_logs/phpstan.TIMESTAMP.log"
```

## Example: Rector Workflow

```
User: "run rector"

Iteration 1:
  [Bash] export CI=true && ./bin/qa -t rector
  [Exit code 0, but files changed]
  [Result] Modified 23 files
  [Self-fixing tool - AUTO-CONTINUE]

Iteration 2:
  [Bash] export CI=true && ./bin/qa -t stan
  [Exit code 0, but files changed]
  [Result] Modified 5 files
  [Self-fixing tool - AUTO-CONTINUE]

Iteration 3:
  [Bash] export CI=true && ./bin/qa -t rector
  [Exit code 0, no files changed]
  [DONE]

Report:
"โœ… Rector complete after 3 iterations
  - Total files modified: 28
  - Final status: No changes needed"
```

## Escalation Triggers

Stop cycling and ask user when:
1. **Max iterations reached (5)** - Tool keeps finding issues
2. **Same errors persist 2+ iterations** - Fixer can't resolve
3. **Tool crashes repeatedly** - Configuration issue
4. **No fixer available** - Manual intervention needed (e.g., infection mutations)
5. **Runtime estimation >5min** - Need user approval (PHPUnit)

## Log Locations

All tools write logs to `var/qa/{tool}_logs/`:
- PHPStan: `var/qa/phpstan_logs/phpstan.log`
- PHPUnit: `var/qa/phpunit_logs/phpunit.junit.xml`
- Infection: `var/qa/infection/log.txt`
- Others: Check stdout/stderr

Use log rotation - each run creates timestamped copy, keeps last 10.

## Fixer Skills Reference

This skill can invoke:
- `phpstan-fixer` skill โ†’ launches php-qa-ci_phpstan-fixer agent
- `phpunit-fixer` skill โ†’ launches php-qa-ci_phpunit-fixer agent

Both skills are in `.claude/skills/` directory.

## Important Notes

1. **This is THE primary QA skill** - Use it for all QA tool requests
2. **Always cycle automatically** - Never stop to ask between iterations
3. **Track iterations** - Prevent infinite loops
4. **Use CI mode** - Always set `export CI=true` to prevent interactive prompts
5. **Path support** - Allow `-p path` for targeted runs
6. **Report only when done** - No interim questions

## Tool Command Reference

Quick reference for all php-qa-ci tools:

```bash
# Static Analysis
./bin/qa -t stan [-p path]        # PHPStan
./bin/qa -t allStatic             # All static tools

# Testing
./bin/qa -t unit [-p path]        # PHPUnit
./bin/qa -t infection             # Mutation testing
./bin/qa -t allTests              # All test tools

# Code Standards
./bin/qa -t rector                # Rector refactoring
./bin/qa -t fixer                 # PHP CS Fixer
./bin/qa -t allCs                 # All CS tools

# Meta
./bin/qa                          # Full pipeline (all tools)
```

Files in this skill

  • 0Chan-smc__claude-code-workflow-lab__claude__skills__frontend-dev-guidelines__SKILL.md15.1 KB
  • 17hz__nextjs-template__claude__skills__example-skill__SKILL.md316 B
  • 1ambda__dataops-platform__claude__skills__context-synthesis__SKILL.md3.5 KB
  • 1natsu172__dotfiles__claude__skills__git-analysis__SKILL.md5.4 KB
  • 1natsu172__dotfiles__claude__skills__github-pr-best-practices__SKILL.md7.7 KB
  • 23Maestro__prospect-pipeline__claude__skills__npid-fastapi-skill.md26.1 KB
  • 360AYA25__ClaudeN8N__claude__skills__n8n-code-javascript__SKILL.md15.7 KB
  • 360AYA25__ClaudeN8N__claude__skills__n8n-code-python__SKILL.md17.5 KB
  • 360AYA25__ClaudeN8N__claude__skills__n8n-expression-syntax__SKILL.md9.4 KB
  • 360AYA25__ClaudeN8N__claude__skills__n8n-mcp-tools-expert__SKILL.md12.5 KB
  • 360AYA25__ClaudeN8N__claude__skills__n8n-node-configuration__SKILL.md16.6 KB
  • 360AYA25__ClaudeN8N__claude__skills__n8n-workflow-patterns__SKILL.md11.2 KB
  • 3x-Projetos__claude-memory-framework__claude__skills__scientist__SKILL.md14.8 KB
  • 5MinFutures__futures-arena__claude__skills__migration-tracker__SKILL.md16.2 KB
  • 5MinFutures__futures-arena__claude__skills__planning-guidelines__SKILL.md11.8 KB
  • 92Bilal26__TaskPilotAI__claude__skills__assessment-builder__SKILL.md17.5 KB
  • 92Bilal26__TaskPilotAI__claude__skills__book-scaffolding__SKILL.md19.1 KB
  • 92Bilal26__TaskPilotAI__claude__skills__code-validation-sandbox__SKILL.md6.2 KB
  • 92Bilal26__TaskPilotAI__claude__skills__exercise-designer__SKILL.md18.1 KB
  • 92Bilal26__TaskPilotAI__claude__skills__learning-objectives__SKILL.md24.5 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in code-quality โ†’

Comments

Loading commentsโ€ฆ

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.