ワンクリックで
debug
Systematic debugging with MCP integration, auto-invoke from qa-commit, Phase 7 Harden
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
メニュー
Systematic debugging with MCP integration, auto-invoke from qa-commit, Phase 7 Harden
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
SOC 職業分類に基づく
Connect and verify the Well MCP — authenticate, confirm the tools work, and show what to ask. Use when the user runs /well:connect, just installed the Well plugin, or says the Well connection/MCP "isn't working" / "nothing happened".
Produce an accounts-receivable aging report and surface overdue invoices for a Well workspace. Use when the user asks who owes them money, an AR aging report, overdue invoices, days sales outstanding (DSO), or which customers to chase.
Forecast cash flow and runway for a Well workspace from booked invoices and collected bank transactions. Use when the user asks for a cash-flow forecast, runway, how long until they run out of cash, projected balance, or expected inflows/outflows.
Run a month-end (or period) close checklist against a Well workspace — verify everything is reconciled and posted before the books are closed. Use when the user asks to close the month/period, run a close checklist, check if the books are ready to close, or what's left before closing.
Produce a VAT / sales-tax summary for a period from a Well workspace's posted ledger. Use when the user asks for a VAT return, VAT summary, sales tax owed, output vs input VAT, or tax declaration figures for a period.
Build a balance sheet (bilan) from a Well workspace. Use when the user asks for a balance sheet, bilan, assets/liabilities/equity, or financial position at a point in time.
| name | debug |
| description | Systematic debugging with MCP integration, auto-invoke from qa-commit, Phase 7 Harden |
Diagnose and fix issues systematically. Enhanced with MCP integrations for deeper analysis and automatic regression test generation.
| Mode | Trigger | Context Provided |
|---|---|---|
| Auto | qa-commit RED verdict | Failed G#N/AC#N, error messages |
| Manual | User invokes | User describes issue |
Phase 0: Context Loading (if auto-invoked)
↓
Phase 0.5: Jidoka Escalation Check ──→ [Tier 2/3] ──→ ESCALATE to human
↓ [Tier 1]
Phase 1: Gather (ReadLints, Browser MCP, Context7)
↓
Phase 2: Reproduce (Browser MCP)
↓
Phase 3: Isolate (Known Issues DB query)
↓
Phase 4: Diagnose
↓
Phase 5: Fix
↓
Phase 6: Verify ──→ [FAIL] ──→ Phase 8 ──→ Phase 0.5
↓ [PASS]
Phase 7: Harden (generate regression test)
↓
Phase 8: Update Jidoka Counters (reset on success)
When invoked from qa-commit, receive context:
## Debug Context (from qa-commit)
**Failed Criteria:**
- [G#N or AC#N]: [Description]
**Verification Report:**
- ReadLints errors: [list]
- Shell errors: [list]
- Browser errors: [list if applicable]
**Expected Behavior:**
[From QA Contract]
**Actual Behavior:**
[Observed during verification]
Skip this phase if manually invoked.
Before attempting fix, check escalation tier to determine if human intervention is needed.
Maintain error_history across debug invocations:
| Field | Description |
|---|---|
| error_signature | Hash of error type + location |
| count | Times this exact error seen |
| fixes_attempted | List of fix descriptions |
| Tier | Condition | Action |
|---|---|---|
| Tier 1 | error_count < 3 | Continue to Phase 1 (normal debug) |
| Tier 2 | error_count >= 3 (same error) | ESCALATE to human |
| Tier 3 | total_errors >= 5 (any) | ESCALATE to human |
If escalation triggered, skip Phases 1-7 and output:
R | [Feature] | AGENT | JIDOKA STOP
---
Same error detected [N] times:
> [Error message]
Attempted fixes:
1. [Fix 1] - Failed: [why]
2. [Fix 2] - Failed: [why]
3. [Fix 3] - Failed: [why]
Options:
A. Try different approach - [describe alternative]
B. Skip this commit, continue to next
C. Pause session, investigate manually
D. Abort feature, reassess scope
---
Reply with A, B, C, or D
Invoke decision-capture skill with escalation context.
On user response:
session-status for final metricsUse Cursor's ReadLints tool on affected files:
ReadLints:
paths: [affected files from context]
Categorize:
For frontend issues, use Browser MCP:
browser_navigate: [affected URL]
browser_snapshot: Get current DOM state
browser_console_messages: All errors/warnings
browser_network_requests: API failures
Extract:
Identify libraries involved and query for error patterns:
Context7 MCP:
1. resolve-library-id: libraryName = "[library from stack trace]"
2. get-library-docs: topic = "[error message keywords]", mode = "info"
Look for:
## Reproduction Steps
1. Navigate to: [URL]
2. Action: [What triggers the issue]
3. Expected: [What should happen]
4. Actual: [What actually happens]
browser_navigate: [starting URL]
browser_click: [trigger element]
browser_type: [if input needed]
browser_take_screenshot: Capture failure state
browser_network_requests: Capture API calls
Before deep investigation, check if this is a known issue:
Notion MCP:
API-query-database:
database_id: "[KNOWN_ISSUES_DB_ID]"
filter:
property: "Error Pattern"
rich_text:
contains: "[error keywords]"
If match found:
## Known Issue Match
**Pattern:** [Error pattern from DB]
**Root Cause:** [From DB]
**Fix Pattern:** [From DB]
**Occurrences:** [N] times
Applying known fix...
→ Skip to Phase 5 with known fix.
If no match: → Continue to Phase 4.
git log -5 --onelineSemanticSearch, GrepRead relevant code with context:
Read: [file with error]
SemanticSearch: "How is [function] supposed to work?"
## Diagnosis
**Root Cause:** [What's causing the issue]
**Evidence:**
- [Evidence 1]
- [Evidence 2]
**Proposed Fix:** [What needs to change]
Before implementing fix:
design-context skill (silent)Make the code changes.
npm run typecheck
npm run lint
npm run test -- --grep "[related tests]"
For the specific failed criteria:
## Re-verification
Re-running qa-commit for:
- [G#N or AC#N that failed]
Result: [PASS/FAIL]
If PASS: Continue to Phase 7 (Harden) If FAIL: Return to Phase 3 (Isolate) with new information
Prevent regression by generating tests and updating knowledge base.
Create test that would catch this issue:
For Backend (G#N):
// Regression test: [issue description]
// Debug session: [date]
it('should not [bug behavior] when [condition]', async () => {
// Reproduction steps
const result = await [action that caused bug];
expect(result).not.toBe([buggy behavior]);
expect(result).toBe([correct behavior]);
});
For Frontend (AC#N):
// Regression test: [issue description]
test('should handle [edge case]', async ({ page }) => {
// Reproduction steps
await page.goto('[URL]');
await page.click('[trigger]');
await expect(page.locator('[element]')).toBeVisible();
});
Invoking test-hardening skill for regression test...
If this was a new issue pattern:
Notion MCP:
API-create-page:
parent: { database_id: "[KNOWN_ISSUES_DB_ID]" }
properties:
Error Pattern: "[Error message pattern]"
Root Cause: "[What caused it]"
Fix Pattern: "[How to fix]"
Library: [relation if applicable]
Occurrences: 1
If this reveals a pattern worth remembering:
Invoking decision-capture skill...
"Learned: [pattern] causes [issue]. Fix: [approach]."
Update escalation counters based on fix outcome.
session-status to update muda tracking## Jidoka Counter Reset
Error signature: [hash]
Previous count: [N]
New count: 0
Status: RESOLVED
## Jidoka Counter Update
Error signature: [hash]
Count: [N] → [N+1]
Fix attempted: [description]
Next: Re-evaluate escalation tier
## Debug Report
### Issue
[Brief description]
### Root Cause
[What caused it]
### Fix Applied
[What was changed]
### Verification
- TypeCheck: PASS
- Lint: PASS
- Tests: PASS
- qa-commit: GREEN
### Hardening
- Regression test: [Created/Skipped]
- Known Issues: [Added/Existing]
- Patine: [Captured/Skipped]
**Status:** RESOLVED
| Tool | Phase | Purpose |
|---|---|---|
| ReadLints | 1 | Get lint/type errors |
| Browser MCP | 1, 2 | Console, network, DOM |
| Context7 | 1 | Library error patterns |
| Notion MCP | 3, 7 | Known Issues database |
| Shell | 6 | Run tests, typecheck |
| SemanticSearch | 3, 4 | Find related code |
| Grep | 3 | Search for patterns |