@event4u/agent-config 2.25.0 → 2.26.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.agent-src/commands/bug-fix.md +1 -0
- package/.agent-src/commands/feature/roadmap.md +2 -2
- package/.agent-src/commands/fix/seeder.md +3 -2
- package/.agent-src/commands/memory/add.md +3 -3
- package/.agent-src/commands/module/create.md +1 -0
- package/.agent-src/commands/module/explore.md +10 -6
- package/.agent-src/commands/onboard.md +9 -1
- package/.agent-src/commands/optimize/augmentignore.md +52 -20
- package/.agent-src/commands/optimize/rtk.md +56 -30
- package/.agent-src/commands/package-test.md +86 -10
- package/.agent-src/commands/quality-fix.md +49 -27
- package/.agent-src/commands/update-form-request-messages.md +2 -1
- package/.agent-src/contexts/augment-infrastructure.md +4 -7
- package/.agent-src/contexts/communication/rules-auto/guidelines-mechanics.md +1 -1
- package/.agent-src/contexts/contracts/research-schema.md +1 -1
- package/.agent-src/contexts/execution/interrupt-examples.md +34 -0
- package/.agent-src/contexts/skills-and-commands.md +2 -2
- package/.agent-src/rules/architecture.md +24 -10
- package/.agent-src/rules/artifact-drafting-protocol.md +6 -0
- package/.agent-src/rules/augment-edit-discipline.md +28 -0
- package/.agent-src/rules/augment-source-of-truth.md +2 -2
- package/.agent-src/rules/autonomous-execution.md +31 -0
- package/.agent-src/rules/context-hygiene.md +1 -1
- package/.agent-src/rules/domain-adoption-policy.md +4 -5
- package/.agent-src/rules/domain-safety-disclaimer.md +114 -0
- package/.agent-src/rules/domain-safety-pii.md +142 -0
- package/.agent-src/rules/domain-safety-retention.md +86 -0
- package/.agent-src/rules/downstream-changes.md +4 -4
- package/.agent-src/rules/framework-neutrality-in-generic-skills.md +130 -0
- package/.agent-src/rules/git-history-discipline.md +99 -0
- package/.agent-src/rules/minimal-safe-diff.md +6 -0
- package/.agent-src/rules/no-roadmap-references.md +4 -2
- package/.agent-src/rules/user-interrupt-priority.md +46 -0
- package/.agent-src/rules/verify-before-complete.md +11 -2
- package/.agent-src/skills/adversarial-review/SKILL.md +1 -1
- package/.agent-src/skills/ai-council/SKILL.md +1 -0
- package/.agent-src/skills/api-endpoint/SKILL.md +58 -154
- package/.agent-src/skills/api-testing/SKILL.md +11 -0
- package/.agent-src/skills/code-refactoring/SKILL.md +36 -30
- package/.agent-src/skills/code-review/SKILL.md +41 -36
- package/.agent-src/skills/context-authoring/SKILL.md +1 -1
- package/.agent-src/skills/dashboard-design/SKILL.md +1 -2
- package/.agent-src/skills/database/SKILL.md +8 -3
- package/.agent-src/skills/dependency-upgrade/SKILL.md +65 -19
- package/.agent-src/skills/developer-like-execution/SKILL.md +25 -14
- package/.agent-src/skills/eloquent/SKILL.md +1 -1
- package/.agent-src/skills/feature-planning/SKILL.md +1 -1
- package/.agent-src/skills/file-editor/SKILL.md +45 -19
- package/.agent-src/skills/finishing-a-development-branch/SKILL.md +2 -2
- package/.agent-src/skills/git-workflow/SKILL.md +4 -4
- package/.agent-src/skills/laravel-api-endpoint/SKILL.md +187 -0
- package/.agent-src/skills/{dto-creator → laravel-dto}/SKILL.md +5 -4
- package/.agent-src/skills/{migration-creator → laravel-migration}/SKILL.md +11 -10
- package/.agent-src/skills/laravel-reverb/SKILL.md +3 -3
- package/.agent-src/skills/{websocket → laravel-websocket}/SKILL.md +4 -3
- package/.agent-src/skills/learning-to-rule-or-skill/SKILL.md +1 -1
- package/.agent-src/skills/merge-conflicts/SKILL.md +49 -17
- package/.agent-src/skills/migration-architect/SKILL.md +6 -6
- package/.agent-src/skills/module-management/SKILL.md +1 -0
- package/.agent-src/skills/multi-tenancy/SKILL.md +15 -8
- package/.agent-src/skills/pest-testing/SKILL.md +18 -0
- package/.agent-src/skills/php-debugging/SKILL.md +28 -0
- package/.agent-src/skills/php-service/SKILL.md +3 -3
- package/.agent-src/skills/playwright-testing/SKILL.md +16 -1
- package/.agent-src/skills/project-analyzer/SKILL.md +68 -42
- package/.agent-src/skills/readme-writing-package/SKILL.md +94 -23
- package/.agent-src/skills/roadmap-management/SKILL.md +1 -1
- package/.agent-src/skills/rtk-output-filtering/SKILL.md +23 -8
- package/.agent-src/skills/rule-refactor/SKILL.md +145 -0
- package/.agent-src/skills/rule-writing/SKILL.md +34 -8
- package/.agent-src/skills/security/SKILL.md +38 -29
- package/.agent-src/skills/skill-reviewer/SKILL.md +1 -1
- package/.agent-src/skills/test-driven-development/SKILL.md +4 -4
- package/.agent-src/skills/test-performance/SKILL.md +6 -5
- package/.agent-src/skills/verify-completion-evidence/SKILL.md +24 -27
- package/.agent-src/templates/agents/agent-project-settings.example.yml +1 -1
- package/.agent-src/templates/copilot-instructions.md +2 -2
- package/.agent-src/templates/rule.md +2 -2
- package/.claude-plugin/marketplace.json +6 -4
- package/AGENTS.md +1 -1
- package/CHANGELOG.md +74 -170
- package/README.md +2 -2
- package/docs/architecture.md +2 -2
- package/docs/archive/CHANGELOG-pre-2.25.0.md +191 -0
- package/docs/catalog.md +17 -12
- package/docs/contracts/file-ownership-matrix.json +473 -43
- package/docs/contracts/kernel-membership.md +17 -0
- package/docs/contracts/smoke-contracts.md +8 -8
- package/docs/getting-started.md +1 -1
- package/docs/guidelines/php/api-design.md +1 -1
- package/docs/guidelines/php/controllers.md +1 -1
- package/docs/guidelines/php/resources.md +1 -1
- package/docs/guidelines/php/validations.md +1 -1
- package/package.json +1 -1
- package/scripts/build_linear_digest.py +0 -1
- package/scripts/lint_framework_leakage.py +348 -0
- package/scripts/lint_framework_leakage_allowlist.json +476 -0
- package/scripts/measure_augment_budget.py +6 -0
- package/scripts/schemas/command.schema.json +5 -0
- package/scripts/schemas/skill.schema.json +5 -0
- package/scripts/skill_linter.py +60 -7
- package/scripts/smoke/kernel.sh +4 -4
- package/scripts/smoke/router.sh +2 -2
- package/.agent-src/rules/agent-docs.md +0 -20
- package/.agent-src/rules/augment-portability.md +0 -23
- package/.agent-src/rules/capture-learnings.md +0 -19
- package/.agent-src/rules/docs-sync.md +0 -20
- package/.agent-src/rules/domain-safety-disclaimer-consulting.md +0 -52
- package/.agent-src/rules/domain-safety-disclaimer-financial.md +0 -54
- package/.agent-src/rules/domain-safety-disclaimer-legal.md +0 -49
- package/.agent-src/rules/domain-safety-disclaimer-medical.md +0 -56
- package/.agent-src/rules/domain-safety-export-redact.md +0 -65
- package/.agent-src/rules/domain-safety-logging-pii-floor.md +0 -55
- package/.agent-src/rules/domain-safety-pii-finance.md +0 -57
- package/.agent-src/rules/domain-safety-pii-marketing.md +0 -60
- package/.agent-src/rules/domain-safety-pii-recruiting.md +0 -56
- package/.agent-src/rules/domain-safety-pii-support.md +0 -57
- package/.agent-src/rules/domain-safety-retention-finance.md +0 -48
- package/.agent-src/rules/domain-safety-retention-support.md +0 -55
- package/.agent-src/rules/e2e-testing.md +0 -19
- package/.agent-src/rules/no-unsolicited-rebase.md +0 -107
- package/.agent-src/rules/post-push-rewrite-discipline.md +0 -70
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: dependency-upgrade
|
|
3
|
-
description: "Use when upgrading dependencies —
|
|
3
|
+
description: "Use when upgrading dependencies — 'update framework X', 'bump runtime version', or 'upgrade packages'. Covers changelog review, breaking-change detection, and verification. Stack-agnostic."
|
|
4
4
|
source: package
|
|
5
5
|
domain: engineering
|
|
6
6
|
---
|
|
@@ -9,10 +9,10 @@ domain: engineering
|
|
|
9
9
|
|
|
10
10
|
## When to use
|
|
11
11
|
|
|
12
|
-
Use this skill when upgrading Composer
|
|
12
|
+
Use this skill when upgrading project dependencies on any stack — Composer (PHP), npm / pnpm / yarn (JS/TS), pip / poetry / uv (Python), go.mod (Go), Cargo (Rust), or any other language-level package manager.
|
|
13
13
|
|
|
14
14
|
Do NOT use when:
|
|
15
|
-
- Installing new
|
|
15
|
+
- Installing new dependencies for the first time
|
|
16
16
|
- Routine code changes unrelated to package versions
|
|
17
17
|
|
|
18
18
|
## Procedure: Upgrade a dependency
|
|
@@ -25,7 +25,7 @@ Before upgrading:
|
|
|
25
25
|
- **Identify breaking changes** — look for "BREAKING", "BC break", major version bumps.
|
|
26
26
|
- **Check deprecation notices** — code using deprecated APIs needs updating.
|
|
27
27
|
- **Review upgrade guides** — many packages provide migration docs.
|
|
28
|
-
- **Check
|
|
28
|
+
- **Check runtime version requirements** — does the new version need a newer PHP / Node / Python / Go / Rust toolchain?
|
|
29
29
|
|
|
30
30
|
### 2. Plan
|
|
31
31
|
|
|
@@ -73,23 +73,69 @@ npm install package-name@latest
|
|
|
73
73
|
npm audit
|
|
74
74
|
```
|
|
75
75
|
|
|
76
|
-
|
|
76
|
+
#### pip / poetry / uv (Python)
|
|
77
|
+
|
|
78
|
+
```bash
|
|
79
|
+
# Check outdated packages
|
|
80
|
+
pip list --outdated # pip
|
|
81
|
+
poetry show --outdated # poetry
|
|
82
|
+
uv pip list --outdated # uv
|
|
83
|
+
|
|
84
|
+
# Upgrade a specific package
|
|
85
|
+
pip install --upgrade package-name
|
|
86
|
+
poetry update package-name
|
|
87
|
+
uv pip install --upgrade package-name
|
|
77
88
|
|
|
78
|
-
|
|
89
|
+
# Check for vulnerabilities
|
|
90
|
+
pip-audit # via pip-audit
|
|
91
|
+
safety check # via safety
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
#### go.mod (Go)
|
|
79
95
|
|
|
80
96
|
```bash
|
|
81
|
-
#
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
97
|
+
# List available updates
|
|
98
|
+
go list -u -m all
|
|
99
|
+
|
|
100
|
+
# Upgrade a specific module
|
|
101
|
+
go get example.com/pkg@latest
|
|
102
|
+
go get example.com/pkg@v1.2.3
|
|
103
|
+
|
|
104
|
+
# Tidy after upgrade
|
|
105
|
+
go mod tidy
|
|
106
|
+
|
|
107
|
+
# Check for known vulnerabilities
|
|
108
|
+
govulncheck ./...
|
|
91
109
|
```
|
|
92
110
|
|
|
111
|
+
#### Cargo (Rust)
|
|
112
|
+
|
|
113
|
+
```bash
|
|
114
|
+
# Check outdated
|
|
115
|
+
cargo outdated # requires cargo-outdated
|
|
116
|
+
|
|
117
|
+
# Upgrade
|
|
118
|
+
cargo update -p crate-name
|
|
119
|
+
cargo add crate-name@1.2 # edition-aware add
|
|
120
|
+
|
|
121
|
+
# Audit
|
|
122
|
+
cargo audit # requires cargo-audit
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
### 4. Verify
|
|
126
|
+
|
|
127
|
+
After upgrading, run the project's full verification pipeline. The exact commands depend on the stack — resolve via the project's `Taskfile.yml`, `package.json scripts`, `composer.json scripts`, `Makefile`, or the `quality-tools` skill.
|
|
128
|
+
|
|
129
|
+
| Stack | Type-check | Lint / autofix | Tests |
|
|
130
|
+
|---|---|---|---|
|
|
131
|
+
| PHP / Laravel | `vendor/bin/phpstan analyse` | `vendor/bin/rector process` + `vendor/bin/ecs check --fix` | `php artisan test` (or `vendor/bin/pest`) |
|
|
132
|
+
| TypeScript | `tsc --noEmit` | `eslint --fix` + `prettier --write` | `pnpm test` (or `vitest run`, `jest`) |
|
|
133
|
+
| Python | `mypy` / `pyright` | `ruff check --fix` + `ruff format` | `pytest` |
|
|
134
|
+
| Go | `go vet ./...` | `golangci-lint run --fix` | `go test ./...` |
|
|
135
|
+
| Rust | `cargo check` | `cargo clippy --fix` + `cargo fmt` | `cargo test` |
|
|
136
|
+
|
|
137
|
+
Re-run the type-checker after any auto-fixer that can rewrite types (Rector for PHP, `eslint --fix` for TS).
|
|
138
|
+
|
|
93
139
|
### 5. Document
|
|
94
140
|
|
|
95
141
|
- Note the upgrade in the commit message: `chore: upgrade vendor/package from 2.x to 3.x`
|
|
@@ -100,7 +146,7 @@ npm run lint # Check code style
|
|
|
100
146
|
When upgrading multiple packages:
|
|
101
147
|
|
|
102
148
|
- **Upgrade one at a time** — easier to identify which upgrade broke something.
|
|
103
|
-
- **Exception:** Tightly coupled packages (e.g., `laravel/framework` + `laravel
|
|
149
|
+
- **Exception:** Tightly coupled packages can be upgraded together (e.g., `laravel/framework` + `laravel/*`; `@nestjs/core` + `@nestjs/*`; `react` + `react-dom`; `next` + `@next/*`).
|
|
104
150
|
- **Run tests after each upgrade** — don't batch upgrades and test once at the end.
|
|
105
151
|
|
|
106
152
|
## Common pitfalls
|
|
@@ -111,7 +157,7 @@ When upgrading multiple packages:
|
|
|
111
157
|
| Upgrading all packages at once | One package at a time (or tightly coupled groups) |
|
|
112
158
|
| Trusting `composer update` blindly | Use `--dry-run` first, review changes |
|
|
113
159
|
| Ignoring deprecation warnings | Fix deprecations before they become errors |
|
|
114
|
-
| Skipping tests after upgrade | Full test suite + PHPStan after every upgrade |
|
|
160
|
+
| Skipping tests after upgrade | Full test suite + project type-checker (PHPStan / tsc / mypy / `go vet` / `cargo check`) after every upgrade |
|
|
115
161
|
| Lock file conflicts | Coordinate upgrades with the team |
|
|
116
162
|
|
|
117
163
|
## Version constraint guidelines
|
|
@@ -165,7 +211,7 @@ npm audit
|
|
|
165
211
|
|---|---|---|
|
|
166
212
|
| **Known CVEs** | `composer audit` / `npm audit` | Direct vulnerabilities |
|
|
167
213
|
| **Maintenance status** | GitHub: last commit, open issues | Abandoned packages are a risk |
|
|
168
|
-
| **Dependency tree** | `composer show -t vendor/pkg` / `npm ls new-package` | Transitive
|
|
214
|
+
| **Dependency tree** | `composer show -t vendor/pkg` / `npm ls new-package` | Transitive dependencies may conflict |
|
|
169
215
|
| **License compatibility** | `composer licenses` / check `package.json` | Legal compliance |
|
|
170
216
|
| **Bundle size** (npm) | `npx bundlephobia new-package` | Impact on frontend bundle |
|
|
171
217
|
|
|
@@ -84,8 +84,8 @@ When UI changes are involved:
|
|
|
84
84
|
- `rg`, `grep` for text: specific patterns, not full files
|
|
85
85
|
- `head`, `tail`, `cut`, `sort`, `uniq` for narrowing results
|
|
86
86
|
- `--filter`, `--json`, `--format` flags on CLI tools — always use them
|
|
87
|
-
- Laravel
|
|
88
|
-
- Logs
|
|
87
|
+
- Route lookup — Laravel `php artisan route:list --json | jq '…'`, Rails `bin/rails routes | grep users`, Express `console.log(app._router.stack)`, FastAPI `app.routes`, Symfony `bin/console debug:router`.
|
|
88
|
+
- Logs — `rg "request_id=abc123" <log-dir>` — never `cat <log-file>`. Log dirs by stack: Laravel `storage/logs/`, Rails `log/`, Node `./logs/` or `journalctl`, Python `./logs/` or `journalctl`, Docker `docker compose logs <svc> --since 5m`.
|
|
89
89
|
|
|
90
90
|
### Avoid large output by default
|
|
91
91
|
|
|
@@ -156,22 +156,33 @@ If full TDD is not practical: at least write down the expected output before cod
|
|
|
156
156
|
#### Backend examples
|
|
157
157
|
|
|
158
158
|
```bash
|
|
159
|
-
#
|
|
160
|
-
php artisan route:list --json | jq '.[] | select(.uri == "api/users") | {method, uri, name, action, middleware}'
|
|
161
|
-
|
|
162
|
-
#
|
|
163
|
-
|
|
159
|
+
# Route lookup — pick the project's framework
|
|
160
|
+
php artisan route:list --json | jq '.[] | select(.uri == "api/users") | {method, uri, name, action, middleware}' # Laravel
|
|
161
|
+
bin/console debug:router --format=json | jq '.[] | select(.path == "/api/users")' # Symfony
|
|
162
|
+
bin/rails routes -g users # Rails
|
|
163
|
+
curl -s http://localhost:3000/__routes | jq '.[] | select(.path == "/api/users")' # Express custom-introspection
|
|
164
|
+
curl -s http://localhost:8000/openapi.json | jq '.paths["/api/users"]' # FastAPI
|
|
165
|
+
|
|
166
|
+
# Config inspection
|
|
167
|
+
php artisan config:show app | grep env # Laravel
|
|
168
|
+
bin/console debug:config framework # Symfony
|
|
169
|
+
bin/rails runner 'puts Rails.application.config_for(:database)' # Rails
|
|
164
170
|
|
|
165
171
|
# API inspection — extract only what you need
|
|
166
172
|
curl -s http://localhost/api/users | jq '.[0] | {id, email, status}'
|
|
167
173
|
curl -s http://localhost/api/users/1 | jq '{id, name, roles: [.roles[].name]}'
|
|
168
174
|
|
|
169
|
-
#
|
|
170
|
-
rg "
|
|
171
|
-
tail -n 200
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
+
# Recent logs — targeted, not full dump
|
|
176
|
+
tail -n 200 storage/logs/laravel.log | rg "payment|timeout" # Laravel
|
|
177
|
+
tail -n 200 log/development.log | rg "payment|timeout" # Rails
|
|
178
|
+
docker compose logs api --since 5m --no-color | rg "payment|timeout" # any container stack
|
|
179
|
+
journalctl -u myapp --since "5 min ago" | rg "payment|timeout" # systemd
|
|
180
|
+
|
|
181
|
+
# DB-state probe — targeted single record, not full table
|
|
182
|
+
php artisan tinker --execute="User::where('email','x@y')->first(['id','email','status'])" # Laravel
|
|
183
|
+
bin/rails runner "p User.where(email: 'x@y').first&.slice(:id,:email,:status)" # Rails
|
|
184
|
+
bin/console doctrine:query:sql "SELECT id,email,status FROM users WHERE email='x@y' LIMIT 1" # Symfony
|
|
185
|
+
psql -d mydb -c "SELECT id,email,status FROM users WHERE email='x@y' LIMIT 1" # raw SQL fallback
|
|
175
186
|
```
|
|
176
187
|
|
|
177
188
|
#### Debugging with Xdebug
|
|
@@ -218,7 +229,7 @@ Never load full output into context when a filter gives you the answer.
|
|
|
218
229
|
|
|
219
230
|
Tests are mandatory when behavior changes or bugs are fixed.
|
|
220
231
|
|
|
221
|
-
Prefer: failing test first →
|
|
232
|
+
Prefer: failing test first → implementation → passing test.
|
|
222
233
|
|
|
223
234
|
Test types: unit (isolated logic), feature/integration (behavior), UI (frontend), regression (bugs).
|
|
224
235
|
|
|
@@ -15,7 +15,7 @@ Use when creating/modifying Eloquent models, relationships, scopes, or writing d
|
|
|
15
15
|
|
|
16
16
|
Do NOT use when:
|
|
17
17
|
- Schema design or query optimization (use `database` skill)
|
|
18
|
-
- Creating migrations only (use `migration
|
|
18
|
+
- Creating migrations only (use `laravel-migration` skill)
|
|
19
19
|
|
|
20
20
|
## Procedure: Create or modify a model
|
|
21
21
|
|
|
@@ -145,7 +145,7 @@ Structural roadmap tasks must include:
|
|
|
145
145
|
|
|
146
146
|
1. **Exact file path** — `app/Modules/Auth/Services/LoginService.php`, never *"the login service"*.
|
|
147
147
|
2. **Complete code** — every method body, import, and signature ready to paste; no `// existing code` ellipses, no `…`.
|
|
148
|
-
3. **Exact command** — `php artisan migrate --path=database/migrations/2026_05_09_create_logins.php
|
|
148
|
+
3. **Exact command** — the precise CLI invocation, never *"run the migration"*. Examples: `php artisan migrate --path=database/migrations/2026_05_09_create_logins.php` (Laravel), `bin/console doctrine:migrations:migrate --no-interaction` (Symfony), `bin/rails db:migrate VERSION=20260509…` (Rails), `npx prisma migrate deploy` (Prisma), `alembic upgrade +1` (Python / Alembic), `sqlx migrate run` (Rust).
|
|
149
149
|
4. **Expected output** — what success looks like (`Migrated: 2026_05_09_create_logins`) and the exit code.
|
|
150
150
|
5. **No placeholders** — angle-bracket placeholders, `TODO`, `FIXME`, `tbd`, and `???` are blockers; resolve before the task ships.
|
|
151
151
|
|
|
@@ -40,7 +40,7 @@ Relevant settings for this skill:
|
|
|
40
40
|
|
|
41
41
|
| Key | Values | Default | Description |
|
|
42
42
|
|---|---|---|---|
|
|
43
|
-
| `personal.ide` | `code`, `phpstorm` | _(empty)_ | CLI command to open files |
|
|
43
|
+
| `personal.ide` | `code`, `cursor`, `windsurf`, `phpstorm`, `webstorm`, `idea`, `goland`, `rubymine`, `pycharm`, `rider`, `subl`, `vim`, `nvim`, `emacs`, `zed` | _(empty)_ | CLI command to open files |
|
|
44
44
|
| `personal.open_edited_files` | `true`, `false` | `false` | Whether to auto-open edited files |
|
|
45
45
|
|
|
46
46
|
## Behavior
|
|
@@ -62,31 +62,49 @@ cat .agent-settings.yml 2>/dev/null
|
|
|
62
62
|
After editing one or more files, open them using the `ide` setting.
|
|
63
63
|
**Always jump to the first edited line.** The syntax depends on the IDE:
|
|
64
64
|
|
|
65
|
-
**
|
|
65
|
+
**JetBrains IDEs** (`personal.ide: phpstorm` / `webstorm` / `idea` / `pycharm` / `goland` / `rubymine` / `rider`):
|
|
66
66
|
```bash
|
|
67
|
-
phpstorm --line {line} {file}
|
|
67
|
+
phpstorm --line {line} {file} # PHP
|
|
68
|
+
webstorm --line {line} {file} # JS / TS
|
|
69
|
+
idea --line {line} {file} # Java / Kotlin / general
|
|
70
|
+
pycharm --line {line} {file} # Python
|
|
71
|
+
goland --line {line} {file} # Go
|
|
68
72
|
```
|
|
69
73
|
|
|
70
|
-
**VS Code** (`personal.ide: code`):
|
|
74
|
+
**VS Code-family** (`personal.ide: code` / `cursor` / `windsurf`):
|
|
71
75
|
```bash
|
|
72
|
-
code
|
|
76
|
+
code --goto {file}:{line}
|
|
77
|
+
cursor --goto {file}:{line}
|
|
78
|
+
windsurf --goto {file}:{line}
|
|
73
79
|
```
|
|
74
80
|
|
|
75
|
-
|
|
81
|
+
**Zed** (`personal.ide: zed`):
|
|
76
82
|
```bash
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
phpstorm --line 15 app/Services/UserService.php
|
|
83
|
+
zed {file}:{line}
|
|
84
|
+
```
|
|
80
85
|
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
86
|
+
**Terminal editors** (`personal.ide: vim` / `nvim` / `emacs`):
|
|
87
|
+
```bash
|
|
88
|
+
vim +{line} {file}
|
|
89
|
+
nvim +{line} {file}
|
|
90
|
+
emacs +{line} {file}
|
|
84
91
|
```
|
|
85
92
|
|
|
86
|
-
|
|
93
|
+
For multiple files, run one command per file:
|
|
87
94
|
```bash
|
|
88
|
-
|
|
89
|
-
|
|
95
|
+
# JetBrains (PhpStorm / WebStorm / GoLand / PyCharm)
|
|
96
|
+
phpstorm --line 42 src/Services/UserService.php
|
|
97
|
+
webstorm --line 15 src/services/user-service.ts
|
|
98
|
+
goland --line 27 internal/user/service.go
|
|
99
|
+
pycharm --line 88 app/services/user_service.py
|
|
100
|
+
|
|
101
|
+
# VS Code-family
|
|
102
|
+
code --goto src/services/user-service.ts:15
|
|
103
|
+
cursor --goto app/services/user_service.py:88
|
|
104
|
+
|
|
105
|
+
# Open file without jumping to a line
|
|
106
|
+
code src/services/user-service.ts
|
|
107
|
+
phpstorm src/Services/UserService.php
|
|
90
108
|
```
|
|
91
109
|
|
|
92
110
|
### Rules
|
|
@@ -102,8 +120,16 @@ code app/Models/User.php
|
|
|
102
120
|
|
|
103
121
|
| IDE | Command | Install |
|
|
104
122
|
|---|---|---|
|
|
105
|
-
| VS Code
|
|
106
|
-
|
|
|
123
|
+
| VS Code | `code {file}` | Shell Command: Install 'code' in PATH |
|
|
124
|
+
| Cursor | `cursor {file}` | Settings → "Install 'cursor' shell command" |
|
|
125
|
+
| Windsurf | `windsurf {file}` | Settings → "Install 'windsurf' shell command" |
|
|
126
|
+
| Zed | `zed {file}` | Settings → "Install CLI" (creates `zed` in PATH) |
|
|
127
|
+
| PhpStorm | `phpstorm {file}` | JetBrains Toolbox CLI or *Tools → Create command-line launcher* in PhpStorm |
|
|
128
|
+
| WebStorm | `webstorm {file}` | JetBrains Toolbox CLI or *Tools → Create command-line launcher* in WebStorm |
|
|
129
|
+
| IntelliJ IDEA | `idea {file}` | JetBrains Toolbox CLI or *Tools → Create command-line launcher* in IDEA |
|
|
130
|
+
| PyCharm | `pycharm {file}` | JetBrains Toolbox CLI or *Tools → Create command-line launcher* in PyCharm |
|
|
131
|
+
| GoLand | `goland {file}` | JetBrains Toolbox CLI or *Tools → Create command-line launcher* in GoLand |
|
|
132
|
+
| Vim / Neovim | `vim {file}` / `nvim {file}` | Bundled with most distros |
|
|
107
133
|
|
|
108
134
|
## Output format
|
|
109
135
|
|
|
@@ -121,8 +147,8 @@ code app/Models/User.php
|
|
|
121
147
|
## Gotcha
|
|
122
148
|
|
|
123
149
|
- Check `.agent-settings.yml` for `personal.open_edited_files` before opening anything — the user may have disabled it.
|
|
124
|
-
- Don't open files during batch operations (e.g., fixing 20 PHPStan
|
|
125
|
-
-
|
|
150
|
+
- Don't open files during batch operations (e.g., fixing 20 type-checker errors across PHPStan / tsc / mypy / `cargo check`) — only open when specifically relevant.
|
|
151
|
+
- JetBrains IDEs (PhpStorm, WebStorm, IDEA, PyCharm, GoLand, RubyMine, Rider) sometimes briefly lock a file on open — wait a moment before editing the same file.
|
|
126
152
|
|
|
127
153
|
## Do NOT
|
|
128
154
|
|
|
@@ -61,7 +61,7 @@ Run the full end-of-work gate before presenting any options — see
|
|
|
61
61
|
|
|
62
62
|
1. Targeted tests green
|
|
63
63
|
2. Full test suite green
|
|
64
|
-
3. Quality pipeline (
|
|
64
|
+
3. Quality pipeline green — the project's full sequence (type-checker → auto-fixer dry-run → linter → type-checker; e.g. PHPStan → Rector → ECS → PHPStan for Laravel-PHP, tsc → eslint --fix → eslint → tsc for TS, mypy → ruff --fix → ruff → mypy for Python)
|
|
65
65
|
4. `git status` clean — nothing unstaged, no stray files
|
|
66
66
|
5. Branch is pushed or explicitly marked local-only
|
|
67
67
|
|
|
@@ -102,7 +102,7 @@ a different sub-procedure (steps 5a–5d).
|
|
|
102
102
|
1. Ensure the branch is up to date with the base →
|
|
103
103
|
[`prepare-for-review`](../../commands/prepare-for-review.md)
|
|
104
104
|
2. Self-review the full diff → [`review-changes`](../../commands/review-changes.md)
|
|
105
|
-
3. Write the PR description → [`create-pr-description`](../../commands/create-pr-
|
|
105
|
+
3. Write the PR description → [`create-pr-description`](../../commands/create-pr/description-only.md)
|
|
106
106
|
4. Open the PR → [`create-pr`](../../commands/create-pr.md)
|
|
107
107
|
5. Confirm the PR opened green, not red
|
|
108
108
|
|
|
@@ -27,8 +27,8 @@ Do NOT use when:
|
|
|
27
27
|
|
|
28
28
|
## Procedure: Before opening a PR
|
|
29
29
|
|
|
30
|
-
1. Run quality pipeline:
|
|
31
|
-
2. Run
|
|
30
|
+
1. Run the project's quality pipeline (see `quality-tools` skill) — typically: type-checker → auto-fixer → linter → type-checker.
|
|
31
|
+
2. Run the project's test command — detect from manifest: `php artisan test` / `vendor/bin/phpunit` (PHP), `npm test` / `pnpm test` / `vitest` / `jest` (JS-TS), `pytest` (Python), `cargo test` (Rust), `go test ./...` (Go).
|
|
32
32
|
3. Rebase onto `main`.
|
|
33
33
|
4. Fill in PR template completely.
|
|
34
34
|
|
|
@@ -83,7 +83,7 @@ Use ONLY when the user explicitly authorized a squash on a branch that
|
|
|
83
83
|
is already on origin. The whole sequence runs in **one turn** — never
|
|
84
84
|
end the session between rewrite and push.
|
|
85
85
|
|
|
86
|
-
Trigger context: `
|
|
86
|
+
Trigger context: `git-history-discipline` rule routed here.
|
|
87
87
|
|
|
88
88
|
### 1. Snapshot before touching anything
|
|
89
89
|
|
|
@@ -159,7 +159,7 @@ A blind `git pull --rebase` here replays remote commits on top of a
|
|
|
159
159
|
local history that may already represent the same work in a different
|
|
160
160
|
shape — guaranteed conflict storm in derived files, possible
|
|
161
161
|
double-application of the same change. This is the documented failure
|
|
162
|
-
mode behind `
|
|
162
|
+
mode behind `git-history-discipline`.
|
|
163
163
|
|
|
164
164
|
### 2. Tag both sides immediately
|
|
165
165
|
|
|
@@ -0,0 +1,187 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: laravel-api-endpoint
|
|
3
|
+
description: "Use when creating a new Laravel API endpoint — Controller, FormRequest, Resource, route, Policy, OpenAPI annotations — versioned route layout, single-action `__invoke` controllers."
|
|
4
|
+
source: package
|
|
5
|
+
domain: engineering
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# laravel-api-endpoint
|
|
9
|
+
|
|
10
|
+
## When to use
|
|
11
|
+
|
|
12
|
+
Use this skill when the project is **Laravel** (detected via `artisan` + `composer.json` with `laravel/framework`) and the user asks to create a new API endpoint, REST route, or controller action.
|
|
13
|
+
|
|
14
|
+
Routed in from [`api-endpoint`](../api-endpoint/SKILL.md) once the stack is detected as Laravel.
|
|
15
|
+
|
|
16
|
+
Do NOT use when:
|
|
17
|
+
- Modifying existing endpoints — use the code-refactoring skill.
|
|
18
|
+
- API design decisions — use [`api-design`](../api-design/SKILL.md).
|
|
19
|
+
- The project is Symfony / Next.js / FastAPI / etc. — go back to [`api-endpoint`](../api-endpoint/SKILL.md) and pick the right carve-out.
|
|
20
|
+
|
|
21
|
+
## Procedure: Create a Laravel API endpoint
|
|
22
|
+
|
|
23
|
+
1. **Read project docs** — Check `./agents/` and `AGENTS.md` for controller conventions, resource patterns, routing.
|
|
24
|
+
2. **Create route** — Add to the correct `routes/api.php` or module route file (`routes/api/v{N}/{domain}.php`).
|
|
25
|
+
3. **Create controller** — Single-action invokable controller, thin, delegate logic to a service.
|
|
26
|
+
4. **Create FormRequest** — Validate all input at the boundary; authorize via Policy in `authorize()`.
|
|
27
|
+
5. **Create Resource** — Transform model output via API Resource (never raw arrays / models / `response()->json()`).
|
|
28
|
+
6. **Create Policy** — If authorization is needed and no Policy exists yet.
|
|
29
|
+
7. **Verify** — Run PHPStan, run tests, confirm response shape matches conventions.
|
|
30
|
+
|
|
31
|
+
## What to generate
|
|
32
|
+
|
|
33
|
+
1. **Controller** — Single Action (invokable). Read `agents/docs/controller.md` and `../../../docs/guidelines/php/controllers.md`.
|
|
34
|
+
2. **FormRequest** — Validation rules, `authorize()` via policies. Read `../../../docs/guidelines/php/validations.md`.
|
|
35
|
+
3. **Resource** — JSON response transformation. Read `agents/docs/api-resources.md`.
|
|
36
|
+
4. **Route** — Add to the correct versioned route file.
|
|
37
|
+
5. **Policy** — If authorization is needed.
|
|
38
|
+
6. **Filter classes** — If it's a list endpoint with filtering. Read `agents/docs/query-filter.md` (if it exists).
|
|
39
|
+
|
|
40
|
+
## Conventions
|
|
41
|
+
|
|
42
|
+
- Controllers are thin — delegate to Services.
|
|
43
|
+
- **Every controller MUST return an API Resource** — never raw arrays, models, or `response()->json()`.
|
|
44
|
+
- Controllers type-hint the return value as the Resource class (e.g. `): ProjectResource`).
|
|
45
|
+
- Use `Resource::make()` for single items, `Resource::collection()` for lists.
|
|
46
|
+
- Use method injection on `__invoke()` for new controllers.
|
|
47
|
+
- Use DTOs for data transfer between layers.
|
|
48
|
+
|
|
49
|
+
## Show endpoint example
|
|
50
|
+
|
|
51
|
+
```php
|
|
52
|
+
declare(strict_types=1);
|
|
53
|
+
|
|
54
|
+
namespace App\Http\Controllers\v1\Project;
|
|
55
|
+
|
|
56
|
+
use App\Http\Controllers\Controller;
|
|
57
|
+
use App\Http\Requests\v1\Projects\ShowProjectRequest;
|
|
58
|
+
use App\Http\Resources\v1\Project\ProjectResource;
|
|
59
|
+
use App\Models\ExternalCustomerDatabase\Project\Project;
|
|
60
|
+
use App\OpenApi\Schema\Request\ShowResourceRequestSchema;
|
|
61
|
+
use App\OpenApi\Schema\Response\ResourceNotFoundResponse;
|
|
62
|
+
use App\OpenApi\Schema\Response\ShowResourceResponseSchema;
|
|
63
|
+
|
|
64
|
+
class ShowProjectController extends Controller
|
|
65
|
+
{
|
|
66
|
+
#[ShowResourceRequestSchema(path: '/projects/{id}', version: '1', resource: ProjectResource::class)]
|
|
67
|
+
#[ShowResourceResponseSchema(ProjectResource::class, wrapInDataObject: false)]
|
|
68
|
+
#[ResourceNotFoundResponse(ProjectResource::class)]
|
|
69
|
+
public function __invoke(ShowProjectRequest $request, Project $project): ProjectResource
|
|
70
|
+
{
|
|
71
|
+
return ProjectResource::make($project);
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
## Create endpoint with service injection
|
|
77
|
+
|
|
78
|
+
```php
|
|
79
|
+
class CreateCustomerController extends Controller
|
|
80
|
+
{
|
|
81
|
+
#[CreateCustomerRequestSchema(path: '/customers', version: '1', resource: CustomerResource::class)]
|
|
82
|
+
#[CreateResourceResponseSchema(resource: CreatedCustomerResource::class, wrapInDataObject: false)]
|
|
83
|
+
#[ValidationErrorResponse]
|
|
84
|
+
public function __invoke(
|
|
85
|
+
CreateCustomerRequest $request,
|
|
86
|
+
CustomerModelService $customerService,
|
|
87
|
+
): CustomerResource {
|
|
88
|
+
$result = $customerService->create(CreateCustomerDTO::fromRequest($request));
|
|
89
|
+
|
|
90
|
+
return CreatedCustomerResource::make($result);
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
## FormRequest example
|
|
96
|
+
|
|
97
|
+
```php
|
|
98
|
+
declare(strict_types=1);
|
|
99
|
+
|
|
100
|
+
namespace App\Http\Requests\v1\Projects;
|
|
101
|
+
|
|
102
|
+
use Illuminate\Foundation\Http\FormRequest;
|
|
103
|
+
|
|
104
|
+
class ShowProjectRequest extends FormRequest
|
|
105
|
+
{
|
|
106
|
+
public function authorize(): bool
|
|
107
|
+
{
|
|
108
|
+
return $this->user()->can('view', $this->route('project'));
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
/** @return array<string, mixed> */
|
|
112
|
+
public function rules(): array
|
|
113
|
+
{
|
|
114
|
+
return [];
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
## List endpoint with CollectionFormRequest
|
|
120
|
+
|
|
121
|
+
For list endpoints, extend `CollectionFormRequest` which provides `perPage`, `page`, and `orderBy` rules:
|
|
122
|
+
|
|
123
|
+
```php
|
|
124
|
+
use App\Contracts\Http\Requests\CollectionFormRequest;
|
|
125
|
+
|
|
126
|
+
class ListProjectsRequest extends CollectionFormRequest
|
|
127
|
+
{
|
|
128
|
+
public string $model = Project::class;
|
|
129
|
+
|
|
130
|
+
/** @return array<string, mixed> */
|
|
131
|
+
public function rules(): array
|
|
132
|
+
{
|
|
133
|
+
return [
|
|
134
|
+
...parent::rules(),
|
|
135
|
+
'status' => ['sometimes', 'string'],
|
|
136
|
+
];
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
## File locations
|
|
142
|
+
|
|
143
|
+
| Component | Path |
|
|
144
|
+
|---|---|
|
|
145
|
+
| Controller | `app/Http/Controllers/v{N}/{Domain}/{Action}{Entity}Controller.php` |
|
|
146
|
+
| FormRequest | `app/Http/Requests/v{N}/{Domain}/{Action}{Entity}Request.php` |
|
|
147
|
+
| Resource | `app/Http/Resources/v{N}/{Domain}/{Entity}Resource.php` |
|
|
148
|
+
| Route | `routes/api/v{N}/{domain}.php` |
|
|
149
|
+
| Policy | `app/Policies/{Entity}Policy.php` |
|
|
150
|
+
|
|
151
|
+
## OpenAPI documentation
|
|
152
|
+
|
|
153
|
+
Controllers use PHP 8 attributes for OpenAPI spec generation from `App\OpenApi\Schema\`:
|
|
154
|
+
|
|
155
|
+
- `ShowResourceRequestSchema`, `ListResourceRequestSchema`, `CreateResourceRequestSchema`
|
|
156
|
+
- `ShowResourceResponseSchema`, `ListResourceResponseSchema`, `CreateResourceResponseSchema`
|
|
157
|
+
- `ResourceNotFoundResponse`, `ValidationErrorResponse`
|
|
158
|
+
|
|
159
|
+
## Output format
|
|
160
|
+
|
|
161
|
+
1. Generated files — controller, route registration, FormRequest, Resource, Policy.
|
|
162
|
+
2. Test file with happy path and validation error cases.
|
|
163
|
+
3. Summary of created files and their locations.
|
|
164
|
+
|
|
165
|
+
## Gotcha
|
|
166
|
+
|
|
167
|
+
- Don't forget to register the route — creating the controller without the route is a common miss.
|
|
168
|
+
- Always check if a similar endpoint already exists — duplicates cause confusion.
|
|
169
|
+
- FormRequest validation rules must match the OpenAPI schema — keep them in sync.
|
|
170
|
+
- The model tends to forget the `return` type on Resource `toArray()` methods.
|
|
171
|
+
|
|
172
|
+
## Do NOT
|
|
173
|
+
|
|
174
|
+
- Do NOT put business logic in controllers — delegate to services.
|
|
175
|
+
- Do NOT skip FormRequest validation — every controller needs a FormRequest.
|
|
176
|
+
- Do NOT return raw Eloquent models — always use API Resources.
|
|
177
|
+
- Do NOT create routes without proper authorization (Policy in FormRequest or middleware).
|
|
178
|
+
- Do NOT create multi-action controllers — only single-action with `__invoke()`.
|
|
179
|
+
- Do NOT use `response()->json()` — use `Resource::make()`.
|
|
180
|
+
|
|
181
|
+
## Auto-trigger keywords
|
|
182
|
+
|
|
183
|
+
- laravel endpoint
|
|
184
|
+
- laravel controller
|
|
185
|
+
- form request
|
|
186
|
+
- API resource
|
|
187
|
+
- laravel api route
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
---
|
|
2
|
-
name: dto
|
|
3
|
-
description: "Use when
|
|
2
|
+
name: laravel-dto
|
|
3
|
+
description: "Use when creating a Laravel/PHP DTO with the SimpleDto base class and attribute mapping. For DTOs in other stacks, use the stack-native skill (TypeScript, Python, Rust, Go)."
|
|
4
4
|
source: package
|
|
5
5
|
domain: engineering
|
|
6
|
+
framework: laravel
|
|
6
7
|
---
|
|
7
8
|
|
|
8
|
-
# dto
|
|
9
|
+
# laravel-dto
|
|
9
10
|
|
|
10
11
|
## When to use
|
|
11
12
|
|
|
@@ -102,7 +103,7 @@ Always check `composer.json` for DTO-related packages before choosing the approa
|
|
|
102
103
|
|
|
103
104
|
- DTOs must extend `SimpleDto` — don't create plain PHP classes as DTOs.
|
|
104
105
|
- The model forgets to add the model linkage (`$modelClass`) when the DTO maps to an Eloquent model.
|
|
105
|
-
- Attribute names in the DTO must match the
|
|
106
|
+
- Attribute names in the DTO must match the database column names (snake_case), not the PHP property names.
|
|
106
107
|
|
|
107
108
|
## Do NOT
|
|
108
109
|
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
---
|
|
2
|
-
name: migration
|
|
3
|
-
description: "Use when
|
|
2
|
+
name: laravel-migration
|
|
3
|
+
description: "Use when creating a Laravel migration — table prefixes, column naming, multi-tenant awareness, php artisan make:migration. Other stacks: use stack-native migration tooling."
|
|
4
4
|
source: package
|
|
5
5
|
domain: engineering
|
|
6
|
+
framework: laravel
|
|
6
7
|
---
|
|
7
8
|
|
|
8
|
-
# migration
|
|
9
|
+
# laravel-migration
|
|
9
10
|
|
|
10
11
|
## When to use
|
|
11
12
|
|
|
@@ -27,9 +28,9 @@ Use this skill when the user asks to create a database migration, add a column,
|
|
|
27
28
|
|
|
28
29
|
## Laravel projects
|
|
29
30
|
|
|
30
|
-
### Multi-
|
|
31
|
+
### Multi-database architecture
|
|
31
32
|
|
|
32
|
-
Some projects use multiple
|
|
33
|
+
Some projects use multiple database connections. Check `config/database.php` for connections.
|
|
33
34
|
|
|
34
35
|
| Check | How |
|
|
35
36
|
|---|---|
|
|
@@ -37,9 +38,9 @@ Some projects use multiple DB connections. Check `config/database.php` for conne
|
|
|
37
38
|
| Migration directories | `database/migrations/` (default), check for additional directories |
|
|
38
39
|
| Custom migrate commands | `php artisan list migrate` — look for project-specific commands |
|
|
39
40
|
|
|
40
|
-
**Always determine which
|
|
41
|
+
**Always determine which database the table belongs to before creating a migration.**
|
|
41
42
|
|
|
42
|
-
### API
|
|
43
|
+
### API database migration
|
|
43
44
|
|
|
44
45
|
```bash
|
|
45
46
|
php artisan make:migration create_example_table
|
|
@@ -73,13 +74,13 @@ return new class extends Migration {
|
|
|
73
74
|
};
|
|
74
75
|
```
|
|
75
76
|
|
|
76
|
-
### Customer
|
|
77
|
+
### Customer database migration
|
|
77
78
|
|
|
78
79
|
```bash
|
|
79
80
|
php artisan make:migration:customer AddWeatherColumn --table=cl_lv_weather
|
|
80
81
|
```
|
|
81
82
|
|
|
82
|
-
Customer
|
|
83
|
+
Customer database tables use the `cl_` prefix (e.g. `cl_user`, `cl_lv_weather`).
|
|
83
84
|
|
|
84
85
|
### Adding a column (with explicit connection)
|
|
85
86
|
|
|
@@ -153,7 +154,7 @@ Focus on the "Database migrations" attack questions: Can this destroy data? Is r
|
|
|
153
154
|
|
|
154
155
|
## Auto-trigger keywords
|
|
155
156
|
|
|
156
|
-
-
|
|
157
|
+
- database migration
|
|
157
158
|
- create migration
|
|
158
159
|
- table prefix
|
|
159
160
|
- column naming
|