From tiny-brain
Create a fix document for bug tracking. Use when user reports a bug or wants to track a fix with full test plan.
npx claudepluginhub magic-ingredients/tiny-brain-releases --plugin tiny-brainThis skill is limited to using the following tools:
Create a fix document when:
Executes step-by-step bug fix workflow: read issue, diagnose root cause, reproduce (browser for UI bugs), minimal fix, regression test, verify, open PR.
Fixes scoped bugs via lightweight TDD workflow: parses description, applies project standards, reproduces with failing test, implements fix, verifies, escalates complex issues.
Fixes scoped bugs via lightweight TDD workflow: parses description, discovers standards, analyzes codebase, plans fix for approval, reproduces with failing test, implements, verifies. Escalates complex cases.
Share bugs, ideas, or general feedback.
Create a fix document when:
Before documenting, investigate:
Use exploration tools (grep, read, etc.) to understand the issue.
mkdir -p .tiny-brain/fixes
Use the template at templates/fix-template.md.
Save to: .tiny-brain/fixes/{fix-id}.md
File naming: Use descriptive kebab-case:
dashboard-not-loading-after-upgrade.mdprogress-json-sync-failing.mdmissing-test-coverage.mdYAML Frontmatter:
---
id: fix-kebab-case-id
title: Brief Description of the Fix
status: documented
severity: low | medium | high | critical
reported: 2026-01-07T15:30:00.000Z # Use new Date().toISOString()
resolved: null # Set to ISO timestamp when resolved
---
In the fix document, clearly explain:
IMPORTANT: Do NOT use ### N. numbered headings (e.g., ### 1. Some heading) outside the ## Tasks section. The sync-file parser treats ### N. Title as task definitions โ using them in Root Cause Analysis or elsewhere will create duplicate task IDs. Use bold text or unnumbered ### headings instead.
IMPORTANT: Before documenting the test plan, you must actively analyze the codebase to identify relevant tests. Do NOT guess - read the actual test files.
Find test files for affected code:
service.test.ts next to service.ts)__tests__/ directoriesRead the test files to understand:
Categorize each test:
Use the emoji schema for test categorization:
| Emoji | Category | Description |
|---|---|---|
๐ | Regression | Must pass unchanged |
โ๏ธ | Amended Case | Existing case to be modified |
๐ | Amended File | File with modified expectations |
๐ | New Case | New test case in existing file |
๐ | New File | Entirely new test file |
Example test plan:
## Test Plan
### ๐ Regression Tests (must pass unchanged)
| File | Cases | Status |
|------|-------|--------|
| src/__tests__/service.test.ts | all existing | โ |
### โ๏ธ Amended Tests
| File | Case | Change | Status |
|------|------|--------|--------|
| src/__tests__/service.test.ts | handles errors | Update expected error | โ |
### ๐ New Tests
| File | Case | Status |
|------|------|--------|
| src/__tests__/service.test.ts | handles edge case | โ |
Use the same task format as features:
## Tasks
### 1. Write failing test for the fix
Add test that reproduces the bug.
**Files to modify:**
- `src/__tests__/service.test.ts`
### 2. Implement the fix
Fix the root cause.
**Files to modify:**
- `src/service.ts`
After creating the fix document, sync it to progress.json:
npx tiny-brain sync-file .tiny-brain/fixes/{fix-id}.md
This updates .tiny-brain/fixes/progress.json with the fix tasks.
After creating and syncing, commit the fix document so it's tracked in git:
git add .tiny-brain/fixes/{fix-id}.md .tiny-brain/fixes/progress.json
git commit -m "chore: add fix document for {fix-id}"
Tell the user:
"I've created fix document '{title}' at
.tiny-brain/fixes/{fix-id}.mdwith {N} tasks."
Then always ask:
"Would you like me to implement this fix now?"
If yes, proceed to implement using the TDD workflow below.
When implementing a fix, follow TDD phases with proper commit tracking.
fix(scope): commit title
Fix: {fix-id}
Task: {exact-task-description}
Description of changes...
๐ค Generated with Claude Code
Multi-Task Fix Commits:
Related fix tasks that are naturally implemented together can be grouped in a single commit. Each task needs its own Task: header:
fix(dashboard): resolve SSE reconnection issues
Fix: dashboard-sse-fix
Task: Add retry logic
Task: Fix timeout handling
Task: Update error messages
All SSE-related fixes implemented together...
๐ค Generated with Claude Code
All tasks in the commit get the same commit SHA in progress tracking.
| Phase | Commit Prefix | Description |
|---|---|---|
| RED | test: or test(scope): | Write failing tests first |
| GREEN | fix: or fix(scope): | Implement minimum code to pass tests |
| REFACTOR | refactor: or refactor(scope): | Improve code quality (optional) |
RED Phase: Write failing test
test(dashboard): add SSE reconnection test
Fix: dashboard-sse-fix
Task: Write failing test for reconnection
Add test that verifies the SSE client reconnects...
๐ค Generated with Claude Code
GREEN Phase: Implement fix
fix(dashboard): implement SSE reconnection
Fix: dashboard-sse-fix
Task: Implement SSE reconnection
Add exponential backoff reconnection logic...
๐ค Generated with Claude Code
REFACTOR Phase (optional): Clean up
refactor(dashboard): extract reconnection strategy
Fix: dashboard-sse-fix
Task: Implement SSE reconnection
Extract reconnection logic to separate module...
๐ค Generated with Claude Code
Commits with Fix: and Task: headers are automatically tracked in .tiny-brain/fixes/progress.json:
test: commits update testCommitSha and set status to in_progressfix: commits update commitSha and set status to completedrefactor: commits update refactorCommitShaWhen updating .tiny-brain/fixes/progress.json manually, use these statuses:
| Status | When to Use | Requirements |
|---|---|---|
not_started | Task created but not started | None |
in_progress | Work has begun (tests written or implementation underway) | None |
completed | Implementation done (GREEN phase) | commitSha required |
superseded | Task no longer needed (work done elsewhere or obsolete) | No commit required |
Important:
completed MUST have a commitSha - this is how we verify work was donesuperseded is for tasks that were resolved by other work (e.g., a refactoring that fixed multiple issues) or are no longer relevantresolved, all tasks should be either completed (with commit) or supersededWhen all tasks are complete (either completed with commit SHA or superseded), mark the fix as resolved:
Edit the fix document's YAML frontmatter:
---
id: dashboard-sse-fix
title: Dashboard SSE connection fails
status: resolved # Change from in_progress
severity: medium
reported: 2026-01-07T15:30:00.000Z
resolved: 2026-01-21T15:30:00.000Z # Add ISO timestamp
resolution:
rootCause: The SSE endpoint path changed in v2.0 but the client was not updated
fix:
- Updated SSE client to use new endpoint path
- Added retry logic for connection failures
- Fixed timeout handling
filesModified:
- packages/dashboard/src/services/SSEClient.ts
- packages/dashboard/src/hooks/useSSE.ts
---
Run sync-file to update progress.json:
npx tiny-brain sync-file .tiny-brain/fixes/{fix-id}.md
| Field | Description |
|---|---|
rootCause | Brief explanation of what caused the bug |
fix | Array of actions taken to fix the issue |
filesModified | Array of file paths that were changed |
templates/fix-template.mdUser: "The dashboard isn't loading after the upgrade"
Claude:
1. Investigate: Check logs, network requests, SSE endpoint
2. Identify: "The SSE endpoint path changed in v2.0"
3. Create:
- .tiny-brain/fixes/dashboard-sse-endpoint-changed.md
- Document root cause, test plan, fix tasks
4. Run `npx tiny-brain sync-file .tiny-brain/fixes/dashboard-sse-endpoint-changed.md`
5. Confirm: "Created fix document with 3 tasks"
6. Ask: "Would you like me to implement this fix now?"
If user says yes:
7. Write failing test (test: commit with Fix:/Task: headers)
8. Implement fix (fix: commit with Fix:/Task: headers)
9. Verify all tests pass
10. Optional refactor (refactor: commit)