whisper-money/app
Víctor Falcón d2a4412118
feat(console): add agent:db command for querying local and prod DB (#522)
## What

Adds an `agent:db` artisan command so agents (and humans) can run read
queries against the local or production database from the CLI.

```bash
php artisan agent:db "select id, email from users limit 5"        # local, JSON (default)
php artisan agent:db --format=table "select count(*) from transactions"  # console table
php artisan agent:db --prod "select count(*) from users"          # production
```

### Options
- `--format=json` (default) — pretty-printed JSON
- `--format=table` — classic console table
- `--prod` — target the production connection (new `prod` connection
backed by `PROD_DB_URL`)

## Notes
- Read-only: uses `DB::select()`, so it won't run
`INSERT`/`UPDATE`/`DELETE`. Query errors are caught and reported.
- Adds a `querying-the-database` skill documenting the command
(auto-activates on prod/DB questions).
- De-duplicates the skills tree: `.agents/skills` is now the canonical
directory and `.claude/skills` is a symlink to it (previously both were
tracked as identical copies).

## Test plan
- [x] `php artisan test --filter=AgentDatabaseCommand` (4 passing: json,
table, invalid format, query error)
- [x] `vendor/bin/pint`
2026-06-12 18:35:14 +02:00
..
Actions feat: parent/child category tree (#474) 2026-06-03 19:30:12 +02:00
Console/Commands feat(console): add agent:db command for querying local and prod DB (#522) 2026-06-12 18:35:14 +02:00
Contracts feat(open-banking): finalize bank connection without a session via state token (#498) 2026-06-06 12:12:07 +02:00
Enums feat(analysis): project-aware transaction analysis (#513) 2026-06-09 15:32:07 +02:00
Events Add Budgeting Feature to Track and Manage Spending (#36) 2026-01-21 15:25:50 +01:00
Exceptions/Banking Handle transient EnableBanking sync failures (#358) 2026-05-06 09:24:05 +02:00
Features feat(transactions): save and reuse transaction filters (#496) 2026-06-05 18:00:14 +02:00
Http feat(analysis): per-category 12-month spending drawer (#519) 2026-06-11 09:52:53 +02:00
Jobs feat(settings): let users disable bank transactions email (#472) 2026-06-02 12:24:39 +02:00
Listeners feat(users): track last login and last active timestamps (#516) 2026-06-10 11:01:30 +02:00
Mail feat(leads): add user lead re-invite campaign (#432) 2026-05-26 08:35:31 +02:00
Models feat(users): track last login and last active timestamps (#516) 2026-06-10 11:01:30 +02:00
Notifications fix: verify email via signed link without requiring login (#490) 2026-06-05 10:01:32 +02:00
Policies refactor(policies): extract HandlesUserOwnership trait (#478) 2026-06-03 17:43:30 +02:00
Providers feat(users): track last login and last active timestamps (#516) 2026-06-10 11:01:30 +02:00
Rules feat: parent/child category tree (#474) 2026-06-03 19:30:12 +02:00
Services feat(analysis): break down spending by sub-category (#508) 2026-06-08 14:53:36 +02:00