文件内容
SPEC.md
# ia-php-laravel Specification
## Intent
`ia-php-laravel` is a `language`-class skill (stack-specific patterns and idioms). Modern PHP 8.4 and Laravel patterns: architecture, Eloquent, queues, testing. Use when working with Laravel, Eloquent, Blade, artisan, PHPUnit, PHPStan, or building/testing PHP applications with frameworks. Not for PHP internals (php-src) or general PHP language discussion.
## Scope
In scope:
- Behaviors described in `SKILL.md` and routed via the should_trigger phrasings in `distillery/tests/fixtures/triggers/ia-php-laravel.jsonl`.
- Updates to runtime behavior, structure, trigger precision, references, and validation.
Out of scope:
- Acting as the runtime instructions themselves (those live in `SKILL.md`).
- Trigger phrasings already covered by adjacent `ia-*` skills (`validate-plugin` flags >70% description overlap as DUPLICATE_TRIGGER).
- <!-- to fill in: domain-specific exclusions when the skill drifts -->
## Trigger Context
- Class: `language`
- Hook regex: `plugins/whetstone/hooks/skill-patterns.sh` -> `SKILL_PATTERNS[ia-php-laravel]`
- Common requests (from fixture should_trigger):
- "add a new Laravel controller for user profiles"
- "fix the Eloquent query performance"
- "create a blade template for the dashboard"
- Should not trigger for (from fixture should_not_trigger):
- "write a React component for the settings page"
- "optimize the PostgreSQL query plan"
- "write a Python CLI tool for data import"
## Source And Evidence Model
Authoritative sources:
- `SKILL.md` -- runtime instructions and reference routing.
- `references/*.md` -- bundled supplementary content (6 file(s)).
- `distillery/tests/fixtures/triggers/ia-php-laravel.jsonl` -- positive and negative trigger phrasings under regression test.
- `plugins/whetstone/hooks/skill-patterns.sh` -- regex pattern that fires this skill.
- `distillery/.eval-data/ia-php-laravel/` -- harvested session examples (when present).
Data that must not be stored in this skill or its references:
- Secrets, credentials, tokens.
- Machine-specific filesystem paths (`/home/...`, `/Users/...`, `~/ai/...`). The validator (`MACHINE_PATH_LEAK`) flags these as HIGH.
- Private URLs, customer data, or unredacted personal information.
### Coverage matrix
| Dimension | Status | Evidence |
|---|---|---|
| Trigger fixtures | complete | distillery/tests/fixtures/triggers/ia-php-laravel.jsonl (>=5 should_trigger, >=5 should_not_trigger) |
| Hook regex pattern | complete | plugins/whetstone/hooks/skill-patterns.sh (`SKILL_PATTERNS[ia-php-laravel]`) |
| Reference architecture | complete | 6 file(s) under references/ |
| Real-usage signal | <!-- populated by harvest-sessions when sessions exist --> | distillery/.eval-data/ia-php-laravel/ (created by harvest-sessions) |
## Evaluation
Lightweight (run on every change):
```bash
python3 distillery/scripts/distiller.py validate-plugin --component ia-php-laravel
python3 distillery/scripts/distiller.py test-triggers --skill ia-php-laravel
```
Deeper (when behavior risk warrants):
```bash
python3 distillery/scripts/distiller.py dspy-eval ia-php-laravel
python3 distillery/scripts/distiller.py diagnose-negatives ia-php-laravel
```
Acceptance gates:
- `validate-plugin --component ia-php-laravel` returns 0 HIGH findings.
- `test-triggers --skill ia-php-laravel` returns F1 = 1.0 with floors of 5 should_trigger and 5 should_not_trigger.
- For dspy-eval, the composite score does not regress against the most recent saved baseline (see `distillery/.eval-data/ia-php-laravel/history.json`).
## Known Limitations
<!-- to fill in over time as drift surfaces. Default rule: any time diagnose-negatives
surfaces a recurring failure pattern, document it here so future maintainers
understand the trade-off the current implementation accepts. -->
## Maintenance Notes
- Update `SKILL.md` when the runtime workflow, branch conditions, or output contract changes.
- Update this `SPEC.md` when intent, scope, evidence model, evaluation gates, or maintenance expectations change.
- Update the trigger fixture when adding new positive phrasings, removing stale ones, or expanding scope (the 5/5 floor is a hard validator gate).
- Update the hook regex in `skill-patterns.sh` whenever fixture positives expose a missed phrasing; verify F1 = 1.0 with `eval-triggers` before committing.
- Run the full release pipeline via `/release` -- never bump versions or update CHANGELOG.md from a per-skill edit.