# Tc Review

> Review QA test case documents (Markdown) against source code. Use when: (1) Reviewing test cases for coverage gaps, (2) Learning source code to extract test scenarios, (3) Suggesting missing test cases, (4) Measuring test case quality. Supports multi-repo projects with dual memory (local MD + Dify RAG).

- Skill: `hangnhat57/tc-review` (Agent Skill, multi-file: 5 files)
- Install (CLI): `npx skillmds@latest add hangnhat57/tc-review`
- Raw SKILL.md: https://api.skillmd.com/api/skills/hangnhat57/tc-review/raw
- Safety review: pending (external: skill-scanner PASS, skillspector PASS)
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: AI & ML
- Author: hangnhat57 (https://skillmd.com/u/hangnhat57)
- Updated: 2026-09-10
- Page: https://skillmd.com/skills/hangnhat57/tc-review

---


# Test Case Review Agent

AI-powered test case document reviewer. Learns source code, then reviews test cases to find coverage gaps.

## Quick Start

```bash
# 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

```bash
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

```bash
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

```bash
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

```bash
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)
```bash
export LLM_PROVIDER=anthropic
export ANTHROPIC_API_KEY=sk-ant-...
export LLM_MODEL=claude-sonnet-4-20250514
```

### OpenAI / Codex
```bash
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:

```markdown
# 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
1. Create project: `tc-review project create <name>`
2. Add repos: `tc-review project add-repo <name> <url>`
3. Learn: `tc-review learn <name>`
4. (Optional) Sync to Dify: `tc-review memory sync <name>`

### Review Cycle
1. QA writes test cases in Markdown
2. Run: `tc-review review <file> --project <name>`
3. Address gaps found
4. Re-review until score > 80

### Get Suggestions
```bash
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)

```bash
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](references/FLOW.md) - Detailed operation flow
- [TESTCASE-FORMAT.md](references/TESTCASE-FORMAT.md) - Test case writing guide

