Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
38 changes: 19 additions & 19 deletions .claude/plugins/test-automation/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ Multi-agent test automation workflow for UShadow - from specification to executa

## Overview

This plugin provides a complete test automation workflow using three specialized agents:
This plugin provides a complete test automation workflow using three specialized skills:

1. **spec-agent** - Creates feature specifications from discussions
2. **qa-agent** - Generates comprehensive test case specifications
3. **automation-agent** - Produces executable test code in appropriate frameworks
1. **/test-automation:spec** - Creates feature specifications from discussions
2. **/test-automation:qa-test-cases** - Generates comprehensive test case specifications
3. **/test-automation:automate-tests** - Produces executable test code in appropriate frameworks

## Quick Start

Expand All @@ -17,7 +17,7 @@ This plugin provides a complete test automation workflow using three specialized
When discussing a new feature, run:

```
/spec
/test-automation:spec
```

This will:
Expand All @@ -30,7 +30,7 @@ This will:
Once the spec is approved, run:

```
/qa-test-cases
/test-automation:qa-test-cases
```

This will:
Expand All @@ -45,7 +45,7 @@ This will:
After reviewing test cases, run:

```
/automate-tests
/test-automation:automate-tests
```

This will:
Expand Down Expand Up @@ -109,15 +109,15 @@ This separation allows:
```bash
# 1. During feature discussion
User: "I want users to be able to upload profile images"
> /spec user-profile-images
> /test-automation:spec user-profile-images

# Output: specs/features/user-profile-images.md created
# - 5 functional requirements
# - 3 non-functional requirements
# - Integration with S3 identified

# 2. Generate test cases
> /qa-test-cases user-profile-images
> /test-automation:qa-test-cases user-profile-images

# Output: specs/features/user-profile-images.testcases.md created
# - 12 test cases total
Expand All @@ -129,7 +129,7 @@ User: "I want users to be able to upload profile images"
# (Manual review step)

# 4. Generate executable tests
> /automate-tests user-profile-images
> /test-automation:automate-tests user-profile-images

# Output:
# - ushadow/backend/tests/test_image_validation.py (5 unit tests)
Expand Down Expand Up @@ -176,9 +176,9 @@ export class ProfilePage extends BasePage {
### Verifies Test IDs
Runs `./scripts/verify-frontend-testids.sh` to ensure all interactive elements are properly marked.

## Agent Descriptions
## Skill Descriptions

### spec-agent (Green)
### /test-automation:spec
**Purpose**: Extract requirements from discussions and create structured specifications

**Output**: `specs/features/{feature}.md`
Expand All @@ -190,7 +190,7 @@ Runs `./scripts/verify-frontend-testids.sh` to ensure all interactive elements a
- Identifies integration points and dependencies
- Notes security considerations

### qa-agent (Purple)
### /test-automation:qa-test-cases
**Purpose**: Generate comprehensive test case specifications

**Output**: `specs/features/{feature}.testcases.md`
Expand All @@ -202,7 +202,7 @@ Runs `./scripts/verify-frontend-testids.sh` to ensure all interactive elements a
- Creates test coverage matrix
- Provides realistic test data

### automation-agent (Blue)
### /test-automation:automate-tests
**Purpose**: Generate executable test code in appropriate frameworks

**Output**: Test files in `ushadow/backend/tests/`, `robot_tests/api/`, `frontend/e2e/`
Expand Down Expand Up @@ -315,29 +315,29 @@ pytest -m "requires_secrets or integration"

## Best Practices

### When to Use Each Agent
### When to Use Each Skill

**spec-agent**:
**/test-automation:spec**:
- During feature planning discussions
- When requirements are unclear or informal
- Before starting development
- When you need stakeholder alignment

**qa-agent**:
**/test-automation:qa-test-cases**:
- After spec is approved
- Before writing any code
- When you need comprehensive test coverage
- To identify edge cases early

**automation-agent**:
**/test-automation:automate-tests**:
- After test cases are reviewed
- When implementing the feature
- To ensure consistent test patterns
- To maintain test/code ratio

### Tips for Success

1. **Start with spec-agent** - Good specs lead to good tests
1. **Start with /test-automation:spec** - Good specs lead to good tests
2. **Review test cases** - Don't automate bad test designs
3. **Follow the pyramid** - 70% unit, 20% integration/API, 10% E2E
4. **Mark secrets correctly** - Enables fast PR feedback
Expand Down
136 changes: 136 additions & 0 deletions .claude/plugins/test-automation/USAGE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,136 @@
# Test Automation Plugin - Quick Usage Guide

## ✅ Plugin is Now Fixed and Working

Your plugin has been refactored to work correctly with Claude Code's architecture.

## How to Use

### Available Commands

All skills are invoked with the plugin namespace:

```bash
/test-automation:spec [feature-name]
/test-automation:qa-test-cases [feature-name]
/test-automation:automate-tests [feature-name]
```

### Typical Workflow

#### 1. Create Specification
During a feature discussion:

```bash
User: "I want to add user profile editing"
You: /test-automation:spec user-profile-editing
```

**Result**: Creates `specs/features/user-profile-editing.md` with:
- User stories
- Functional requirements
- Non-functional requirements
- Integration points
- Security considerations

#### 2. Generate Test Cases
After spec is approved:

```bash
/test-automation:qa-test-cases user-profile-editing
```

**Result**: Creates `specs/features/user-profile-editing.testcases.md` with:
- Comprehensive test scenarios
- Happy path, edge cases, negative tests
- Test type categorization (unit/integration/API/E2E)
- Secret requirements marked

#### 3. Generate Test Code
After test cases are reviewed:

```bash
/test-automation:automate-tests user-profile-editing
```

**Result**: Generates executable test files:
- `ushadow/backend/tests/test_*.py` (unit tests)
- `ushadow/backend/tests/integration/test_*.py` (integration tests)
- `robot_tests/api/*.robot` (API tests)
- `frontend/e2e/*.spec.ts` (E2E tests)
- Updates Page Object Models
- Adds `data-testid` attributes to frontend

## What Was Fixed

### Before (Broken)
- Skills tried to invoke plugin agents via Task tool
- Plugin agents can't be called with `subagent_type` parameter
- Commands wouldn't work

### After (Working)
- All agent logic merged directly into skills
- Skills are self-contained and executable
- Agent files kept for documentation only

## Architecture Notes

**Skills** (`.claude/plugins/*/skills/*.md`):
- ✅ Can be invoked: `/plugin-name:skill-name`
- Contains executable instructions
- Claude follows the instructions directly

**Agents** (`.claude/plugins/*/agents/*.md`):
- ❌ Cannot be invoked via Task tool
- Kept for documentation/reference
- Logic should be in skills, not agents

## Testing the Plugin

Try it out:

```bash
# Test 1: Create a spec from this conversation
/test-automation:spec test-feature

# Test 2: List skills (should show your three skills)
# Use the Skill tool to see available skills
```

## Troubleshooting

**Skill not appearing?**
- Check `.claude/settings.json` - plugin must be enabled
- Restart Claude Code session
- Verify plugin.json lists the skill files

**Skill runs but does nothing?**
- Check that feature name is provided or inferrable
- Ensure conversation has feature context
- Skill will ask clarifying questions if needed

## File Structure

```
.claude/plugins/test-automation/
├── plugin.json # Plugin config
├── README.md # Full documentation
├── USAGE.md # This file
├── skills/
│ ├── spec.md # ✅ /test-automation:spec
│ ├── qa-test-cases.md # ✅ /test-automation:qa-test-cases
│ └── automate-tests.md # ✅ /test-automation:automate-tests
└── agents/ # Documentation only
├── spec-agent.md
├── qa-agent.md
└── automation-agent.md
```

## Next Steps

1. Try creating a spec for a real feature you're working on
2. Review the generated spec and provide feedback
3. Generate test cases from the spec
4. Generate executable tests from the test cases

Happy testing!
50 changes: 0 additions & 50 deletions .claude/plugins/test-automation/automate-tests.md

This file was deleted.

12 changes: 6 additions & 6 deletions .claude/plugins/test-automation/plugin.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
"version": "1.0.0",
"description": "Multi-agent test automation workflow for UShadow - from specification to test implementation",
"agents": [
"spec-agent.md",
"qa-agent.md",
"automation-agent.md"
"agents/spec-agent.md",
"agents/qa-agent.md",
"agents/automation-agent.md"
],
"skills": [
"spec.md",
"qa-test-cases.md",
"automate-tests.md"
"skills/spec.md",
"skills/qa-test-cases.md",
"skills/automate-tests.md"
]
}
48 changes: 0 additions & 48 deletions .claude/plugins/test-automation/qa-test-cases.md

This file was deleted.

Loading