builder-smoke-test
Smoke test the Agent Builder feature branch end-to-end against a hermetic project scaffolded by the skill (linked to the current worktree). Covers workspace…
Use early when debugging a medium or hard bug, especially when tests alone may not reveal the real runtime failure. Trigger this before extended TDD iteration when a bug involves runtime state, ordering, persistence, streaming, concurrency, UI/manual reproduction, external
$ npx -y skills add mastra-ai/mastra --skill debugging-difficult-bugs --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
/debugging-difficult-bugsContext preview
The summary Claude sees to decide when to auto-load this skill.
Use early when debugging a medium or hard bug, especially when tests alone may not reveal the real runtime failure. Trigger this before extended TDD iteration when a bug involves runtime state, ordering, persistence, streaming, concurrency, UI/manual reproduction, external
name: debugging-difficult-bugs description: Use early when debugging a medium or hard bug, especially when tests alone may not reveal the real runtime failure. Trigger this before extended TDD iteration when a bug involves runtime state, ordering, persistence, streaming, concurrency, UI/manual reproduction, external services, or when a red or newly passing test may not model the real issue. Skip only when the root cause is already directly proven by a stack trace or deterministic test that exercises the real runtime path.
Use this skill early for medium or hard bugs where normal TDD may give false confidence because the test does not fully capture the real bug.
Core idea: **instrument the actual runtime path, reproduce the real issue, then inspect append-only JSONL logs before deciding on a fix.**
Use this workflow near the start of debugging when any of these are true:
Do **not** keep iterating only on tests if you do not understand the runtime behavior.
Skip this workflow only when the root cause is already directly proven by a stack trace or by a deterministic failing test that exercises the real runtime path. If you are tempted to make a second speculative fix, use this workflow.
1. **State the uncertainty**
2. **Add temporary unconditional instrumentation**
3. **Reproduce the real issue**
4. **Analyze the log before fixing**
5. **Clean up instrumentation**
6. **Keep or improve tests**
Use append-only JSONL in `cwd` so it works across CLIs, dev servers, tests, and manual reproduction.
import { appendFileSync } from 'node:fs';
import { join } from 'node:path';
function debugBug(event: string, data: Record<string, unknown> = {}) {
appendFileSync(
join(process.cwd(), 'debug-difficult-bug.jsonl'),
`${JSON.stringify({
ts: new Date().toISOString(),
event,
...data,
})}\n`,
);
}Call it at every meaningful branch or state transition:
debugBug('workflow.start', { runId, stepId, inputKeys: Object.keys(input ?? {}) });
debugBug('workflow.beforeStep', {
runId,
stepId,
status: step.status,
hasResumeData: Boolean(resumeData),
});
try {
const result = await executeStep();
debugBug('workflow.afterStep', { runId, stepId, resultShape: Object.keys(result ?? {}) });
return result;
} catch (error) {
debugBug('workflow.stepError', {
runId,
stepId,
errorName: error instanceof Error ? error.name : typeof error,
errorMessage: error instanceof Error ? error.message : String(error),
});
throw error;
}Prefer compact, structured data over huge dumps.
Log:
Avoid logging:
Treat debug logs as potentially sensitive. Do not ask the user to paste them into public issues, PRs, or shared channels unless they have reviewed/redacted them first.
If sensitive data might appear, log redacted summaries:
debugBug('request.received', {
hasAuthHeader: BooleanMastra is a framework for building AI-powered applications and agents with a modern TypeScript stack. It includes everything you need to go from early prototypes to production-ready applications.
Repo: mastra-ai/mastra
Smoke test the Agent Builder feature branch end-to-end against a hermetic project scaffolded by the skill (linked to the current worktree). Covers workspace…
Autonomous, report-only documentation review for Mastra docs. Use when auditing changed docs against source, validating contextual code examples or API…
Convert existing docs diagram images to Mermaid, and author new Mermaid diagrams for Mastra docs. Use when replacing an Excalidraw or PNG/JPG/SVG diagram with…
REQUIRED when modifying any file in packages/playground-ui or packages/playground. Triggers on: React component creation/modification/refactoring, UI changes,…
Review open mastra-ai/mastra GitHub issues, identify direct @mastra/core bugs, and apply the @mastra/core label. Use when auditing issues for core ownership,…
Documentation guidelines for Mastra. Use this skill when creating, editing, moving, deleting, or reviewing Mastra documentation, sidebars, redirects, or docs…