whisper-money/tests/Feature/Console
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
..
AgentDatabaseCommandTest.php feat(console): add agent:db command for querying local and prod DB (#522) 2026-06-12 18:35:14 +02:00
CheckBankLogosCommandTest.php Add weekly bank logo audit command (#211) 2026-03-06 11:05:13 +00:00
GenerateLandingAuthLinkCommandTest.php feat(landing): add signed auth links (#312) 2026-04-21 08:28:59 +01:00
ResetDemoAccountCommandTest.php feat(categories): add Self-Employment Income income category (#164) 2026-02-28 18:04:21 +00:00
ResetUserCategoriesCommandTest.php fix(categories): expose cashflow setting on create (#448) 2026-05-29 11:05:04 +02:00
SendSubscriptionCancelledEmailCommandTest.php Add subscription cancellation email with manual trigger command (#47) 2025-12-30 20:32:44 +01:00
SendUpdateEmailCommandTest.php Support soft-deleted users with reusable emails (#316) 2026-04-22 11:41:41 +01:00
SetBankLogoCommandTest.php fix(banks:set-logo): add JPEG support test coverage and prompt for missing arguments (#214) 2026-03-07 16:33:54 +00:00
SetupMainUserCommandTest.php Command: Setup Main User 2025-11-15 22:16:41 +01:00