Quality & Debugging

VerifiedCaution

Provides a structured debugging workflow (reproduce, isolate, identify root cause, fix minimally, verify) and testing guidance (TDD, test priority, verification commands). Helps developers systematically fix bugs and ensure code quality before marking tasks as done.

Sby Skills Guide Bot
TestingIntermediate
1706/2/2026
Claude Code
#debugging#testing#verification#tdd#quality-assurance

Recommended for

Our review

This skill provides a structured 5-step debugging process, along with testing guidelines and final quality verification for code.

Strengths

  • Systematic 5-step approach (reproduce, isolate, identify, fix, verify)
  • Integrates TDD with clear test priorities
  • Includes a 'Definition of Done' checklist and 'Red Flags' to catch common issues

Limitations

  • Primarily geared towards TypeScript/Node, requires adaptation for other languages
  • Does not cover advanced debugging (profiling, memory, performance)
  • Assumes use of specific tools (tsc, vitest, etc.)
When to use it

Use this skill when encountering bugs, errors, failing tests, or to apply a quality check before marking a task as done.

When not to use it

Avoid using it for quick development tasks without formal testing needs, or when the project does not use TypeScript or a compatible test framework.

Security analysis

Caution
Quality score95/100

The skill uses Bash for essential development tasks like running TypeScript compiler, tests, linting, and grep searches. No destructive or exfiltrating patterns are present, but the presence of Bash warrants caution.

Findings
  • Includes Bash execution capability, which could be misused if the agent runs commands beyond the specified safe ones.

Examples

Debug a crash
My app crashes when I try to load a user profile that has null data. Use the quality skill to debug and fix it.
Write tests for a new feature
Write unit tests for the createPost function following TDD and the test priorities from the quality skill.
Verify code quality
Run the final verification commands from the quality skill on my src/ directory and report any issues.

name: quality description: "Debug, test, verify. Auto-use for bugs, errors, testing." version: 3.0.0 allowed-tools:

  • Read
  • Edit
  • Write
  • Bash
  • Grep
  • Glob

Quality

Auto-use when: bug, error, fix, debug, not working, broken, test, failing

Works with: All skills - final verification gate


Debugging (5 Steps)

1. REPRODUCE

# Create failing test or clear steps
it('should not crash with null profile', () => {
  const user = { id: '1', profile: null }
  expect(() => getAvatar(user)).not.toThrow()
})

2. ISOLATE

# Find exact location
git log --oneline -10 -- path/to/file.ts
git blame -L 40,50 path/to/file.ts

3. IDENTIFY ROOT CAUSE

Why crash? -> profile is null
Why null? -> API returns null for new users
Why not handled? -> Assumed profile always exists
ROOT CAUSE: Missing null handling

4. FIX (Minimal)

// Before
return user.profile.avatar.url

// After
return user.profile?.avatar?.url ?? '/default.png'

5. VERIFY

npx tsc --noEmit        # Types pass
npm test                # Tests pass
# Check similar patterns in codebase

Testing

TDD Flow

RED -> Write failing test
GREEN -> Minimal code to pass
REFACTOR -> Clean up

Test Priority

P0: Happy path works
P0: Auth blocks unauthorized
P0: Ownership blocks others' data
P1: Validation rejects bad input
P1: Edge cases handled
P2: Error states work

Test Template

import { describe, it, expect, vi } from 'vitest'

describe('createPost', () => {
  it('creates for authenticated user', async () => {
    vi.mocked(auth).mockResolvedValue({ userId: 'user-1' })
    const result = await createPost({ title: 'Test' })
    expect(result.authorId).toBe('user-1')
  })

  it('rejects unauthenticated', async () => {
    vi.mocked(auth).mockResolvedValue({ userId: null })
    await expect(createPost({ title: 'Test' })).rejects.toThrow('Unauthorized')
  })
})

Verification Commands

# MUST pass before "done"
npx tsc --noEmit          # TypeScript
npm test                   # Tests
npm run lint              # Lint
npm run build             # Build

# Check for lazy patterns
grep -r "TODO\|FIXME" src/
grep -r ": any" src/
grep -r "console\.log" src/
grep -rE "mock|fake" src/

Definition of Done

[] tsc --noEmit = 0 errors
[] Tests pass
[] No TODO comments
[] No any types
[] No mock data
[] No console.log
[] All UI states handled
[] Error handling present

Red Flags (STOP)

| If You See | Action | |------------|--------| | TODO: | Implement now | | : any | Add types | | mockData | Wire to API | | console.log(error) | Show to user | | Missing loading state | Add skeleton | | Missing error state | Add error UI | | catch {} (empty) | Handle error |

Related skills