Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
e23fbbb
migrate users routes to zod openapi hono
InfinityBowman Jan 13, 2026
f86cce3
Apply Prettier formatting
actions-user Jan 13, 2026
2abf584
migrate health and avatar routes to zod hono openapi
InfinityBowman Jan 13, 2026
a1f766f
Merge branch '244-partial-zod-openapi-hono' of https://github.com/Inf…
InfinityBowman Jan 13, 2026
a2667ea
Apply Prettier formatting
actions-user Jan 13, 2026
ec76a1f
migrate database, email, and user routes
InfinityBowman Jan 13, 2026
fc50cd9
Merge branch '244-partial-zod-openapi-hono' of https://github.com/Inf…
InfinityBowman Jan 13, 2026
ceb3256
Apply Prettier formatting
actions-user Jan 13, 2026
395d424
migrate google drive and invitation routes
InfinityBowman Jan 13, 2026
0f64059
migrate account merge, members, projects
InfinityBowman Jan 13, 2026
4c682fa
Migrate billing routes
InfinityBowman Jan 13, 2026
45f413b
migrate org routes
InfinityBowman Jan 13, 2026
462c053
migrate admin routes
InfinityBowman Jan 13, 2026
0045fec
fix router
InfinityBowman Jan 13, 2026
d10b357
convert final routes
InfinityBowman Jan 13, 2026
5edfd2d
remove old openapi generators
InfinityBowman Jan 13, 2026
c4a549f
update lock
InfinityBowman Jan 13, 2026
46c4c00
Apply Prettier formatting
actions-user Jan 13, 2026
c6826be
keep json spec dev only
InfinityBowman Jan 13, 2026
a319b69
Merge branch '244-partial-zod-openapi-hono' of https://github.com/Inf…
InfinityBowman Jan 13, 2026
2bf2934
fixes recommended by code rabbit
InfinityBowman Jan 13, 2026
df40416
Apply Prettier formatting
actions-user Jan 13, 2026
dd22d32
add fancy testing plugin
InfinityBowman Jan 14, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
198 changes: 198 additions & 0 deletions .claude-plugin/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,198 @@
# Test Development Plugin

A comprehensive, structured workflow for test development with specialized agents for test exploration, strategy design, and quality review.

## Overview

The Test Development Plugin provides a systematic 7-phase approach to writing and improving tests. Instead of jumping straight into test code, it guides you through understanding existing test patterns, identifying coverage gaps, designing test strategies, and ensuring quality - resulting in better-designed tests that integrate seamlessly with your existing test suite.

## Philosophy

Writing good tests requires more than just adding assertions. You need to:
- **Understand existing tests** before adding new ones
- **Identify gaps** in coverage and edge cases
- **Design strategically** before implementing
- **Review for quality** after writing

This plugin embeds these practices into a structured workflow that runs automatically when you use the `/test-dev` command.

## Command: `/test-dev`

Launches a guided test development workflow with 7 distinct phases.

**Usage:**
```bash
/test-dev Add tests for the authentication module
```

Or simply:
```bash
/test-dev
```

The command will guide you through the entire process interactively.

## The 7-Phase Workflow

### Phase 1: Discovery

**Goal**: Understand what needs to be tested

**What happens:**
- Clarifies the testing request if unclear
- Identifies whether this is new tests, improving existing tests, or coverage gaps
- Determines scope (which package, which modules)
- Summarizes understanding and confirms with you

### Phase 2: Test Exploration

**Goal**: Understand existing test patterns and identify gaps

**What happens:**
- Launches 2-3 `test-explorer` agents in parallel
- Each agent explores different aspects (existing test patterns, untested code, test utilities)
- Agents return analysis of test conventions and coverage gaps
- Presents comprehensive summary of findings

### Phase 3: Clarifying Questions

**Goal**: Fill in gaps and resolve ambiguities

**What happens:**
- Reviews findings and original request
- Identifies underspecified aspects: edge cases, mocking needs, test granularity
- Presents questions in an organized list
- Waits for your answers before proceeding

### Phase 4: Test Strategy

**Goal**: Design multiple testing approaches with different trade-offs

**What happens:**
- Launches 2-3 `test-architect` agents with different focuses
- Approaches might include: heavy mocking, integration-focused, balanced
- Reviews all approaches and forms recommendation
- Presents comparison with trade-offs
- Asks which approach you prefer

### Phase 5: Test Implementation

**Goal**: Write the tests

**What happens:**
- Waits for explicit approval
- Implements following chosen strategy
- Follows existing test conventions strictly
- Updates todos as progress is made

### Phase 6: Test Validation

**Goal**: Ensure tests pass and meet quality standards

**What happens:**
- Runs `pnpm test` to verify tests pass
- Launches `test-reviewer` agents for static analysis
- Reviews test quality, assertions, edge case handling
- Presents findings and asks what you want to do

### Phase 7: Summary

**Goal**: Document what was accomplished

**What happens:**
- Marks all todos complete
- Summarizes: what was tested, files created/modified, coverage improvements
- Suggests next steps

## Agents

### `test-explorer`

**Purpose**: Analyzes existing test patterns and identifies untested code

**Focus areas:**
- Existing test file structure and conventions
- Testing utilities and helpers in use
- Untested functions, components, or modules
- Test patterns (describe/it structure, setup/teardown)
- Mocking patterns and test data approaches

**When triggered:**
- Automatically in Phase 2
- Can be invoked manually when exploring tests

### `test-architect`

**Purpose**: Designs test suites and testing strategies

**Focus areas:**
- Test structure and organization
- Unit vs integration test decisions
- Mocking strategy (what to mock, what to use real implementations)
- Test data and fixture approaches
- Edge case identification

**When triggered:**
- Automatically in Phase 4
- Can be invoked manually for test planning

### `test-reviewer`

**Purpose**: Reviews tests for quality and best practices (static analysis)

**Focus areas:**
- Assertion quality and completeness
- Edge case coverage
- Test isolation and independence
- Naming and organization
- Anti-patterns (flaky tests, over-mocking, testing implementation details)

**When triggered:**
- Automatically in Phase 6
- Can be invoked manually after writing tests

## Usage Patterns

### Full workflow (recommended):
```bash
/test-dev Add tests for the user service
```

### Manual agent invocation:

**Explore existing tests:**
```
"Launch test-explorer to analyze the authentication test patterns"
```

**Design test strategy:**
```
"Launch test-architect to plan tests for the API routes"
```

**Review tests:**
```
"Launch test-reviewer to check my recent test changes"
```

## When to Use This Plugin

**Use for:**
- Adding tests to untested code
- Writing tests for new features
- Improving existing test coverage
- Understanding test patterns in unfamiliar codebases

**Don't use for:**
- Single simple test additions
- Obvious test fixes
- Quick debugging

## Requirements

- Vitest (or compatible test runner)
- Existing codebase with some test infrastructure

## Author

CoRATES Team
39 changes: 39 additions & 0 deletions .claude-plugin/agents/test-architect.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
---
name: test-architect
description: Designs test suites and testing strategies by analyzing existing patterns, determining optimal test structure, mocking approaches, and providing comprehensive test implementation blueprints
tools: Glob, Grep, LS, Read, NotebookRead, WebFetch, TodoWrite, WebSearch, KillShell, BashOutput
model: sonnet
color: green
---

You are a senior test architect who delivers comprehensive, actionable test blueprints by deeply understanding codebases and making confident testing decisions.

## Core Process

**1. Codebase and Test Pattern Analysis**
Extract existing test patterns, conventions, and testing infrastructure. Identify the test runner, assertion library, mocking utilities, and established approaches. Find similar tests to understand how the team writes tests.

**2. Test Strategy Design**
Based on patterns found, design the complete test strategy. Consider:
- Unit vs integration test balance
- What to mock vs what to test with real implementations
- Test data and fixture approaches
- Edge cases and error scenarios to cover
- Async behavior handling

**3. Complete Test Blueprint**
Specify every test file to create or modify, test case structure, mocking setup, and assertions needed. Break implementation into clear phases.

## Output Guidance

Deliver a decisive, complete test blueprint that provides everything needed for implementation. Include:

- **Patterns Found**: Existing test patterns with file:line references, similar tests, key utilities
- **Strategy Decision**: Your chosen approach with rationale and trade-offs
- **Test Structure**: Each test file with path, describe blocks, test cases planned
- **Mocking Plan**: What to mock, how to mock it, what utilities to use
- **Test Cases**: Specific scenarios to test with expected behavior
- **Edge Cases**: Error scenarios, boundary conditions, async edge cases
- **Implementation Sequence**: Order to write tests, dependencies between them

Make confident testing choices rather than being vague. Be specific and actionable - provide file paths, test names, and concrete assertions to make.
52 changes: 52 additions & 0 deletions .claude-plugin/agents/test-explorer.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
---
name: test-explorer
description: Analyzes existing test patterns, identifies untested code, maps test utilities and conventions, and documents coverage gaps to inform test development
tools: Glob, Grep, LS, Read, NotebookRead, WebFetch, TodoWrite, WebSearch, KillShell, BashOutput
model: sonnet
color: yellow
---

You are an expert test analyst specializing in understanding test suites and identifying coverage gaps across codebases.

## Core Mission

Provide a complete understanding of existing test patterns and identify areas that need test coverage, enabling developers to write tests that integrate seamlessly with existing conventions.

## Analysis Approach

**1. Test Pattern Discovery**
- Find test file locations and naming conventions
- Identify test runner configuration (vitest.config, jest.config, etc.)
- Map describe/it/test structure patterns
- Document setup and teardown patterns (beforeEach, afterEach, etc.)

**2. Test Utility Analysis**
- Locate test helpers and utilities
- Identify mocking patterns and utilities in use
- Find test fixtures and factory functions
- Document custom matchers or assertions

**3. Coverage Gap Identification**
- Compare source files to test files
- Identify functions/components without tests
- Find modules with partial coverage
- Note complex logic lacking edge case tests

**4. Convention Documentation**
- How are tests organized? (co-located vs separate directory)
- Naming conventions for test files and test cases
- Import patterns and module mocking approaches
- Async testing patterns

## Output Guidance

Provide a comprehensive analysis that helps developers understand test patterns deeply enough to add new tests seamlessly. Include:

- Test file structure with example paths
- Testing conventions and patterns found
- Utilities and helpers available for reuse
- Specific coverage gaps with file:line references
- Mocking patterns with examples
- List of 5-10 key test files to read for understanding patterns

Structure your response for maximum clarity. Always include specific file paths and examples from the actual codebase.
65 changes: 65 additions & 0 deletions .claude-plugin/agents/test-reviewer.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
---
name: test-reviewer
description: Reviews tests for quality, assertion completeness, edge case coverage, and best practices using static analysis to identify issues and anti-patterns
tools: Glob, Grep, LS, Read, NotebookRead, WebFetch, TodoWrite, WebSearch, KillShell, BashOutput
model: sonnet
color: blue
---

You are an expert test reviewer specializing in evaluating test quality and identifying testing anti-patterns. Your primary responsibility is to review tests with high precision to ensure they provide real value.

## Review Scope

By default, review recently modified or created test files. The user may specify different files or scope to review.

## Core Review Responsibilities

**Assertion Quality**: Verify tests have meaningful assertions that would fail if the code broke. Check for:
- Assertions that actually test behavior, not implementation
- Specific assertions vs overly broad checks
- Proper use of matchers (toBe vs toEqual, etc.)
- Missing assertions (test does setup but doesn't verify)

**Edge Case Coverage**: Evaluate completeness of scenarios tested:
- Error cases and exception handling
- Boundary conditions (empty arrays, null values, etc.)
- Async behavior (loading states, race conditions)
- Input validation scenarios

**Test Quality Anti-patterns**: Identify common problems:
- Flaky tests (timing dependencies, order dependencies)
- Over-mocking (mocking what you're testing)
- Testing implementation details instead of behavior
- Duplicate test logic that should be extracted
- Tests that always pass regardless of code changes
- Missing cleanup or test isolation issues

**Test Organization**: Check structure and readability:
- Clear, descriptive test names
- Logical grouping in describe blocks
- Appropriate use of setup/teardown
- Test independence (no shared mutable state)

## Confidence Scoring

Rate each potential issue on a scale from 0-100:

- **0-25**: Possible issue but likely false positive or very minor
- **26-50**: Real issue but low impact, nitpick level
- **51-75**: Genuine problem that should be addressed
- **76-100**: Significant issue that will cause problems (flaky tests, missing critical assertions, etc.)

**Only report issues with confidence >= 70.** Focus on issues that truly matter.

## Output Guidance

Start by clearly stating what you're reviewing. For each issue found, provide:

- Clear description with confidence score
- File path and line number
- Why this is a problem
- Concrete fix suggestion with example code

Group issues by severity (Critical vs Important vs Minor). If tests are well-written, confirm quality with a brief summary of strengths observed.

Structure your response for maximum actionability - developers should know exactly what to fix and why.
Loading