testing
Run and troubleshoot tests for DBHub, including unit tests, integration tests with Testcontainers, and database-specific tests. Use when asked to run tests,…
Use when given a GitHub issue URL or number to investigate and implement a fix. Triggers on "fix issue", "fix bug", "fix #123", GitHub issue URLs, or any request to resolve a reported problem from a GitHub issue. Also triggers when asked to investigate errors, diagnose failures,
$ npx -y skills add bytebase/dbhub --skill fix-bug --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
/fix-bugContext preview
The summary Claude sees to decide when to auto-load this skill.
Use when given a GitHub issue URL or number to investigate and implement a fix. Triggers on "fix issue", "fix bug", "fix #123", GitHub issue URLs, or any request to resolve a reported problem from a GitHub issue. Also triggers when asked to investigate errors, diagnose failures,
name: fix-bug description: Use when given a GitHub issue URL or number to investigate and implement a fix. Triggers on "fix issue", "fix bug", "fix #123", GitHub issue URLs, or any request to resolve a reported problem from a GitHub issue. Also triggers when asked to investigate errors, diagnose failures, or debug unexpected behavior in DBHub.
Systematic workflow for turning a GitHub issue into a working fix in the DBHub codebase.
1. **Fetch** → 2. **Analyze** → 3. **Locate** → 4. **Reproduce** → 5. **Plan** → 6. **Implement** → 7. **Verify** → 8. **PR**
# From URL: https://github.com/owner/repo/issues/123 gh issue view 123 --json title,body,labels,comments,state # From another repo gh issue view 123 --repo owner/repo --json title,body,labels,comments,state
| Input | How to fetch | |-------|-------------| | `https://github.com/owner/repo/issues/42` | `gh issue view 42 --repo owner/repo` | | `#42` or `42` | `gh issue view 42` (current repo) | | `owner/repo#42` | `gh issue view 42 --repo owner/repo` |
Extract from the issue:
Use the issue details to identify which part of the codebase is affected. DBHub has a clear modular structure — most bugs fall into one of these areas:
| Bug Category | Where to Look | Key Files | |-------------|--------------|-----------| | Connection failures | Connector implementations | `src/connectors/{db-type}/index.ts`, `src/connectors/manager.ts` | | SQL execution errors | Tool handlers | `src/tools/execute-sql.ts`, `src/utils/allowed-keywords.ts` | | Schema/table listing | Search tool | `src/tools/search-objects.ts` | | DSN parsing issues | Parser logic | `src/connectors/{db-type}/index.ts` (DSNParser), `src/utils/dsn-obfuscate.ts`, `src/utils/safe-url.ts` | | SSH tunnel problems | Tunnel utilities | `src/utils/ssh-tunnel.ts`, `src/utils/ssh-config-parser.ts` | | TOML config issues | Config loading | `src/config/toml-loader.ts`, `src/types/config.ts` | | Multi-database routing | Manager & tools | `src/connectors/manager.ts`, `src/utils/tool-handler-helpers.ts` | | Custom tool issues | Custom handler | `src/tools/custom-tool-handler.ts`, `src/tools/registry.ts` | | HTTP transport | Server setup | `src/server.ts` | | Read-only violations | SQL validation | `src/utils/allowed-keywords.ts`, `src/utils/sql-parser.ts` | | Row limiting | SQL rewriting | `src/utils/sql-row-limiter.ts` | | API endpoint issues | API handlers | `src/api/sources.ts`, `src/api/requests.ts` | | AWS IAM auth | Token signing | `src/utils/aws-rds-signer.ts` |
Search for error messages, function names, or file paths mentioned in the issue. Trace the code path from entry point to the failure.
**If integration tests exist for the area:** Write a failing test that captures the bug. DBHub's test infrastructure makes this straightforward:
Use the test fixtures in `src/__fixtures__/` for multi-database or readonly/max_rows scenarios.
**If no test infrastructure applies:** Trace the code path and confirm the logic flaw by reading.
For non-trivial fixes (multi-file, architectural impact): use `EnterPlanMode`.
For simple fixes (single function, clear root cause): proceed directly.
Run the relevant tests to confirm the fix:
pnpm test:unit # Quick check — no Docker needed pnpm test src/path/to/test.ts # Run the specific test file pnpm test:integration # Full integration suite if needed
Check that:
1. **Create a branch**:
git checkout -b fix/issue-123
2. **Commit changes** referencing the issue:
git add <changed-files> git commit -m "$(cat <<'EOF' Fix: <short description> Closes #123 EOF )"
3. **Push and create the PR**:
git push -u origin fix/issue-123 gh pr create --title "Fix: <short description>" --body "$(cat <<'EOF' ## Summary <What was broken and how this fixes it> ## Changes <Bullet list of changes> Closes #123 ## Test plan - [ ] Existing tests pass - [ ] New test covers the bug scenario (if applicable) EOF )"
4. **Return the PR URL** to the user.
Token conscious database MCP server for Postgres, MySQL, SQL Server, MariaDB, SQLite.
Repo: bytebase/dbhub
Run and troubleshoot tests for DBHub, including unit tests, integration tests with Testcontainers, and database-specific tests. Use when asked to run tests,…
Explore a database schema token-efficiently via the DBHub tools; use before writing SQL against a schema you haven't seen.
Connect DBHub to a database or fix a failing connection; also covers changing the DSN, write access, or multiple databases.
Guide for querying databases through DBHub MCP server. Use this skill whenever you need to explore database schemas, inspect tables, or run SQL queries via…