| name | diagnose |
| description | Systematically diagnoses build, runtime, DB, API, and frontend errors with classification and fix workflow. Use when encountering errors or test failures. |
| disable-model-invocation | true |
| user-invocable | true |
| argument-hint | [์๋ฌ ๋ฉ์์ง ๋๋ ์ฆ์ ์ค๋ช
] |
| allowed-tools | Read, Grep, Edit, Bash(cargo *), Bash(npm *), Bash(podman *), Bash(git *), Bash(curl *) |
| context | fork |
| agent | debugger |
์ฒด๊ณ์ ์๋ฌ ์ง๋จ
$ARGUMENTS ๋ฌธ์ ๋ฅผ ์ง๋จํฉ๋๋ค.
1๋จ๊ณ: ์๋ฌ ๋ถ๋ฅ
์ ๋ฌ๋ ์๋ฌ๋ฅผ ๋ค์ ์นดํ
๊ณ ๋ฆฌ๋ก ๋ถ๋ฅํฉ๋๋ค:
| ์นดํ
๊ณ ๋ฆฌ | ํค์๋ | ์ง๋จ ๊ฒฝ๋ก |
|---|
| ์ปดํ์ผ ์๋ฌ | error[E, cannot find, trait bound | โ Rust ์ง๋จ |
| ๋ฐํ์ ์๋ฌ | panic, thread 'main', SIGABRT | โ ๋ฐํ์ ์ง๋จ |
| DB ์๋ฌ | sqlx, relation does not exist, connection | โ DB ์ง๋จ |
| API ์๋ฌ | 4xx, 5xx, timeout, connection refused | โ API ์ง๋จ |
| ํ๋ก ํธ์๋ ์๋ฌ | TypeError, ESLint, tsc | โ TS ์ง๋จ |
| ์ปจํ
์ด๋ ์๋ฌ | podman, container, port | โ ์ธํ๋ผ ์ง๋จ |
2๋จ๊ณ: ์นดํ
๊ณ ๋ฆฌ๋ณ ์ง๋จ
Rust ์ปดํ์ผ ์๋ฌ
# ์ ์ฒด ๋น๋๋ก ์๋ฌ ์ปจํ
์คํธ ํ์ธ
cargo check 2>&1 | Select-Object -First 50
# ํน์ ํจํค์ง๋ง
cargo check -p <package> --message-format=short
์๋ฌ ์ฝ๋๋ณ ์ผ๋ฐ์ ์์ธ:
E0277 (trait bound) โ ํ์
๋ถ์ผ์น, derive ๋๋ฝ
E0308 (mismatched types) โ Decimal/f64 ํผ์ฉ ํ์ธ
E0433 (unresolved import) โ use ๊ฒฝ๋ก ํ์ธ
E0599 (method not found) โ ํธ๋ ์ดํธ import ๋๋ฝ
DB ์ฐ๊ฒฐ/๋ง์ด๊ทธ๋ ์ด์
์๋ฌ
# 1. ์ปจํ
์ด๋ ์ํ ํ์ธ
podman ps --filter "name=trader"
# 2. DB ์ ์ ํ
์คํธ
podman exec trader-timescaledb pg_isready -U trader
# 3. ๋ง์ด๊ทธ๋ ์ด์
์ํ ํ์ธ
podman exec trader-timescaledb psql -U trader -d trader -c "SELECT * FROM _sqlx_migrations ORDER BY installed_on DESC LIMIT 5"
API ์๋ฌ
# 1. API ์๋ฒ ์ํ
curl -s http://localhost:3000/health | ConvertFrom-Json
# 2. ํน์ ์๋ํฌ์ธํธ ํ
์คํธ
curl -s http://localhost:3000/api/v1/<endpoint> | ConvertFrom-Json
ํ๋ก ํธ์๋ ์๋ฌ
Push-Location frontend
npx tsc --noEmit 2>&1 | Select-Object -First 30
npx eslint src --max-warnings 0 2>&1 | Select-Object -First 30
Pop-Location
3๋จ๊ณ: ์์ ๋ฐ ๊ฒ์ฆ
- ์์ธ ํ์
ํ ์์
- ์์ ํ ๋์ผ ๋ช
๋ น์ผ๋ก ์ฌ๊ฒ์ฆ
- ๊ด๋ จ ํ
์คํธ ์คํ์ผ๋ก ํ๊ท ํ์ธ
- ๊ฒฐ๊ณผ๋ฅผ ์ฌ์ฉ์์๊ฒ ๋ณด๊ณ