Skip to content
Back to skills

Fix

ASecurity

Run rector, php-cs-fixer, and phpstan; fix what static analysis reports

  • 8 stars
  • 0 votes
  • 0 copies
  • 5 views
  • Added September 12, 2026
ai-agentsphpbashgit

Security analysis

A100/100

Scanned September 12, 2026

npx -y skills add Chemaclass/satscribe --skill fix --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Fix?

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

Security grade badge for Fix
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/chemaclass-fix/badge)](https://www.skillsdirectory.com/skills/chemaclass-fix)

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
---
description: Run rector, php-cs-fixer, and phpstan; fix what static analysis reports
argument-hint: "[optional path]"
disable-model-invocation: true
allowed-tools: "Read, Edit, Bash(composer *), Bash(vendor/bin/*), Bash(./vendor/bin/*)"
---

# Fix Code Style

PHP files edited during a session are auto-formatted by the PostToolUse hook. Use this for a full sweep or when phpstan is failing.

## Instructions

1. **Auto-fix**:
   ```bash
   composer fix   # rector + php-cs-fixer
   ```

2. **Review what rector changed** — it applies dead-code and code-quality sets and can be aggressive. Read the diff before keeping it:
   ```bash
   git diff
   ```

3. **Static analysis**:
   ```bash
   composer phpstan
   ```

4. **Fix each phpstan error at the source.** Never silence a real type problem with `@phpstan-ignore`.

   | Error | Fix |
   |---|---|
   | Missing return type | Add it, `void` included |
   | `array` without shape | `@param list<int>` / `@return array<string, mixed>` |
   | Possibly null | Early return, or narrow the type |
   | Unknown Eloquent magic | Larastan usually knows it — check the model's `@property` docblock |

5. **Verify nothing broke**:
   ```bash
   composer test
   ```

## Checklist for new files

- `declare(strict_types=1);` present
- `final` unless inheritance is used, `readonly` where immutable
- Constructor property promotion, all params typed
- Interface in `Domain/`, implementation in `Application/` or `Infrastructure/`

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 ai-agents →

Comments

Loading comments…

Newsletter

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