Command Palette

Search for a command to run...

oorty plan

Pro

Analyze your codebase and generate a comprehensive test plan using AI.

Usage

Terminal
npx oorty plan

Options

OptionDefaultDescription
--output, -o.oorty/plans/test-plan.mdOutput path for the test plan
--formatmarkdownOutput format: markdown or json
--max-tokens16000Max output tokens per AI request
--focus-Only analyze files matching a path
--limit-Cap analyzed files for quick/cost test runs
--forcefalseOverwrite existing plan files without prompt
--yes, -yfalseSkip prompts and use default confirmations
--verbosefalseShow detailed analysis output
--cwd.Working directory

What It Does

The plan command performs these steps:

  1. Scans your codebase - Identifies components, utilities, hooks, pages, and API routes
  2. Analyzes code structure - Understands exports, props, dependencies, and complexity
  3. Detects existing tests- Finds what's already covered to avoid duplication
  4. Generates test plan - Creates a prioritized markdown document with specific test recommendations

Example Output

Terminal
npx oorty plan
Analyzing codebase...
Scanning src/ directory...
Found 47 components, 12 utilities, 8 pages
Checking existing test coverage...
Found 3 existing test files
Generating test plan...
Created: .oorty/plans/test-plan.md
Test Plan Summary:
Priority 1 (Critical): 8 tests
Priority 2 (Important): 21 tests
Priority 3 (Nice to have): 15 tests
Unit tests: 23
Component tests: 15
E2E tests: 6
Run 'oorty generate' to create these tests.

Test Plan Format

The generated test plan is a markdown file with structured test recommendations:

.oorty/plans/test-plan.md
1# Test Plan
2
3Generated: 2024-01-15
4Framework: Next.js 14
5Total recommendations: 44
6
7## Priority 1: Critical Path
8
9### Unit Tests
10
11#### utils/formatCurrency.ts
12- **Type:** Unit
13- **Priority:** 1
14- **Rationale:** Pure function used in 12 components
15- **Test cases:**
16 - Formats USD correctly
17 - Handles zero values
18 - Handles negative values
19 - Handles large numbers
20
21#### hooks/useCart.ts
22- **Type:** Unit
23- **Priority:** 1
24- **Rationale:** Core business logic for cart operations
25- **Test cases:**
26 - Adds items to cart
27 - Removes items from cart
28 - Updates quantities
29 - Calculates totals correctly
30
31### Component Tests
32
33#### components/ProductCard.tsx
34- **Type:** Component
35- **Priority:** 1
36- **Rationale:** Key conversion component
37- **Test cases:**
38 - Renders product information
39 - Handles add to cart click
40 - Shows loading state
41 - Displays sale price when applicable
42
43## Priority 2: Important
44
45...

Next Steps

After generating your test plan, run oorty generate to create all the test files automatically.