Test Case Review Agent
AI-powered test case document reviewer. Learns source code, then reviews test cases to find coverage gaps.
Quick Start
# Create project and add repo
tc-review project create myproject
tc-review project add-repo myproject https://github.com/org/repo.git
# Learn source code
tc-review learn myproject
# Review test cases
tc-review review tests/checkout.md --project myproject
Core Commands
Project Management
tc-review project create <name> # Create project
tc-review project list # List projects
tc-review project show <name> # Show details
tc-review project add-repo <name> <url> # Add GitHub repo
tc-review project delete <name> # Delete project
Learning & Review
tc-review learn <project> # Learn from all repos
tc-review review <file.md> --project <p> # Review test case file
tc-review suggest <project> # Suggest new test cases
Memory
tc-review memory status # Check local + Dify status
tc-review memory search <proj> <query> # Search knowledge
tc-review memory sync <project> # Sync to Dify RAG
Config
tc-review config show # Show current config
tc-review config init # Create config.json
tc-review config env # List env variables
LLM Configuration
Anthropic Claude (Default)
export LLM_PROVIDER=anthropic
export ANTHROPIC_API_KEY=sk-ant-...
export LLM_MODEL=claude-sonnet-4-20250514
OpenAI / Codex
export LLM_PROVIDER=openai
export OPENAI_API_KEY=sk-...
export LLM_MODEL=gpt-4-turbo
Test Case Format
Test cases must be in Markdown format:
# Test Suite: Checkout Flow
## TC-001: Successful Payment
**Preconditions:**
- User logged in
- Cart has items
**Steps:**
1. Navigate to checkout
2. Enter valid card
3. Click Pay
**Expected Result:**
Payment success, order created
Output Example
📊 Review Report: checkout.md
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Score: 65/100 Coverage: 65%
✅ Covered:
• Successful payment
• Invalid card
⚠️ Missing:
• Payment timeout
• Expired card
• Concurrent payments
💡 Suggested:
TC-003: Payment Timeout
TC-004: Expired Card Validation
Workflows
Initial Setup
- Create project:
tc-review project create <name> - Add repos:
tc-review project add-repo <name> <url> - Learn:
tc-review learn <name> - (Optional) Sync to Dify:
tc-review memory sync <name>
Review Cycle
- QA writes test cases in Markdown
- Run:
tc-review review <file> --project <name> - Address gaps found
- Re-review until score > 80
Get Suggestions
tc-review suggest myproject
Generates test case suggestions based on learned knowledge.
Memory System
| Layer | Storage | Search | Best For |
|---|---|---|---|
| Local | MD + JSON | Keyword | Offline, fast |
| Remote | Dify RAG | Semantic | Large codebases |
Dify RAG Setup (Optional)
export DIFY_ENABLED=true
export DIFY_API_KEY=app-...
export DIFY_DATASET_ID=...
export DIFY_BASE_URL=https://api.dify.ai/v1
Troubleshooting
No ANTHROPIC_API_KEY: Set export ANTHROPIC_API_KEY=sk-ant-...
Project not found: Run tc-review project list to see available projects
Low coverage score: Check gaps in report, add missing test cases
Dify not connected: Verify DIFY_API_KEY and DIFY_DATASET_ID are set
References
- FLOW.md - Detailed operation flow
- TESTCASE-FORMAT.md - Test case writing guide