test
Unified Playwright test automation. Default runs full autonomous loop. Use --explore for interactive, --ticket ENG-123 for Linear tickets, --describe for text descriptions.
What this skill does
# /test - Unified Test Automation
Generate production-ready Playwright tests with multiple input modes. Default mode runs the full autonomous loop with pattern learning.
## Quick Start
```bash
/test login # Full autonomous (default) - explore → plan → generate → heal → learn
/test --explore login # Interactive exploration only - opens visible browser
/test --ticket ENG-123 # From Linear ticket - fetches AC, generates tests
/test --describe "..." # From user description - skips exploration
```
## Modes Comparison
| Mode | Explore | Plan | Generate | Heal | Learn |
|------|---------|------|----------|------|-------|
| `/test login` (default) | ✅ Auto | ✅ | ✅ | ✅ 5x | ✅ |
| `/test --explore login` | ✅ Interactive | ❌ | ❌ | ❌ | ❌ |
| `/test --ticket ENG-123` | ❌ (from AC) | ✅ | ✅ | ✅ | ✅ |
| `/test --describe "..."` | ❌ (from text) | ✅ | ✅ | ✅ | ✅ |
---
## Workflow Overview
```
┌─────────────────────────────────────────────────────────────────────────────┐
│ /test {feature} │
├─────────────────────────────────────────────────────────────────────────────┤
│ │
│ INPUT SOURCES: │
│ ├── Default → EXPLORE with Playwright MCP │
│ ├── --ticket → Linear ticket acceptance criteria │
│ ├── --describe → User text description │
│ └── --explore → Interactive exploration only (STOPS after explore) │
│ │
│ PHASES: │
│ 0. SETUP → Auto-config, load patterns, discover credentials │
│ 0.6 LOAD CONTEXT → triqual_load_context tool builds context files (MANDATORY, BLOCKING)│
│ 1. EXPLORE → Playwright MCP (skip with --ticket/--describe) │
│ 2. PLAN → Quoth context output + input source │
│ 3. GENERATE → .spec.ts in .draft/tests/ (NEVER directly to tests/) │
│ 4. HEAL LOOP → Run → Fix → Re-run (max 5 iterations) │
│ 5. PROMOTE → User approves → Move to production test directory │
│ 6. LEARN → Save patterns + anti-patterns │
│ │
└─────────────────────────────────────────────────────────────────────────────┘
```
---
## Phase 0: SETUP (Auto-Config & Authentication)
This phase loads configuration and handles authentication before any exploration.
### 0.1 Load Configuration
Read `triqual.config.ts` if it exists:
```bash
# Check for TypeScript config
ls triqual.config.ts 2>/dev/null
```
If TypeScript config exists, read it to extract configuration values. The config uses `defineConfig` from `triqual` for type safety:
```typescript
// triqual.config.ts
import { defineConfig } from 'triqual';
export default defineConfig({
project_id: 'my-app',
testDir: './tests',
baseUrl: 'http://localhost:3000',
auth: { strategy: 'storageState', ... },
// ...
});
```
If missing, prompt user to run `/init` first or auto-detect basic config.
### 0.2 Load Existing Patterns
Read from `${PLUGIN_ROOT}/context/`:
- `patterns-learned.json` - Successful patterns from previous runs
- `anti-patterns-learned.json` - Known failure→fix mappings
### 0.3 Handle Authentication
Based on `auth.strategy` from config, authenticate before exploration:
#### Strategy: `storageState` (Fastest)
If `.auth/user.json` exists and is configured:
```javascript
// Load saved auth state via browser_run_code
mcp__plugin_triqual-plugin_playwright__browser_run_code({
code: `async (page) => {
const fs = require('fs');
const state = JSON.parse(fs.readFileSync('.auth/user.json', 'utf8'));
// Add cookies
if (state.cookies?.length) {
await page.context().addCookies(state.cookies);
}
// Navigate to trigger cookie application
await page.goto('${baseUrl}');
// Restore localStorage if present
if (state.origins?.[0]?.localStorage?.length) {
await page.evaluate((items) => {
items.forEach(({ name, value }) => localStorage.setItem(name, value));
}, state.origins[0].localStorage);
}
return 'Auth state loaded';
}`
})
```
#### Strategy: `uiLogin` (When no saved state)
If credentials are configured but no storageState:
```javascript
// Navigate to login page
mcp__plugin_triqual-plugin_playwright__browser_navigate({
url: config.auth.uiLogin.loginUrl // e.g., "/login"
})
// Get page snapshot to find form elements
mcp__plugin_triqual-plugin_playwright__browser_snapshot({})
// Fill login form using configured selectors
mcp__plugin_triqual-plugin_playwright__browser_fill_form({
fields: [
{
name: 'Email',
type: 'textbox',
ref: '{email-field-ref}', // From snapshot
value: credentials.email
},
{
name: 'Password',
type: 'textbox',
ref: '{password-field-ref}', // From snapshot
value: credentials.password
}
]
})
// Click submit
mcp__plugin_triqual-plugin_playwright__browser_click({
ref: '{submit-button-ref}',
element: 'Login submit button'
})
// Wait for navigation to success URL
mcp__plugin_triqual-plugin_playwright__browser_wait_for({
text: 'Dashboard' // Or wait for URL change
})
```
#### Strategy: `setupProject` (Playwright native)
If project uses Playwright's setup project pattern:
```bash
# Run setup project first
npx playwright test --project=setup
```
Then proceed with tests that have `dependencies: ['setup']`.
#### Strategy: `none` (No auth needed)
Skip authentication, proceed directly to exploration.
### 0.4 Verify Authentication
After auth, verify we're logged in:
```javascript
// Take snapshot to confirm auth state
mcp__plugin_triqual-plugin_playwright__browser_snapshot({})
// Check for logged-in indicators:
// - User avatar/menu visible
// - Dashboard or protected content visible
// - No login form visible
```
### 0.5 Optionally Save Auth State
After successful UI login, save state for future runs:
```javascript
// Save state for future runs (optional)
mcp__plugin_triqual-plugin_playwright__browser_run_code({
code: `async (page) => {
const state = await page.context().storageState();
require('fs').writeFileSync('.auth/user.json', JSON.stringify(state, null, 2));
return 'Auth state saved to .auth/user.json';
}`
})
```
---
## Phase 0.6: LOAD CONTEXT (EXECUTE IMMEDIATELY AFTER SETUP)
**This is a blocking gate.** The hooks will BLOCK test writing and test-planner dispatch until context files exist.
### Execute Context Loading
Call the context loading tool with just the feature name - the system automatically determines the optimal depth:
```
triqual_load_context({ feature: "{feature}" })
```
If you have a Linear ticket:
```
triqual_load_context({ feature: "{feature}", ticket: "ENG-123" })
```
If you have a description:
```
triqual_load_context({ feature: "{feature}", description: "..." })
```
Wait for the tool to complete before proceeding to Phase 1.
### What Happens Automatically
The tool intelligently analyzes your request and optimizes context depth:
- **Simple features** with existing patterns → Fast local scan
- **New test generation** → Quoth patterns + codebase analysis
- **Complex features** or tickets → Full context with failure history
This optimization saves ~70% tokens on average without any manual configuration.
### Output Files
Context files are written to `.triqual/context/{feature}/`:
- `patterns.md` — Proven patterns from Quoth
- `codebase.md` — Relevant source files, selectors, routes
- `existing-tests.md` — Reusable tests and page objects
- `summary.md` — Index of all context
Additional files are added automaticalRelated in Code Review
gstack
IncludedFast headless browser for QA testing and site dogfooding. Navigate pages, interact with elements, verify state, diff before/after, take annotated screenshots, test responsive layouts, forms, uploads, dialogs, and capture bug evidence. Use when asked to open or test a site, verify a deployment, dogfood a user flow, or file a bug with screenshots. (gstack)
startup-due-diligence
IncludedLegal due diligence review for seed-stage and Series A startups (US, Delaware C-Corp focus). Supports both investor and founder perspectives. Capabilities include: (1) Interactive document review and issue spotting; (2) Document request list generation; (3) Cap table and SAFE/convertible note analysis; (4) Red flag identification with severity ratings; (5) Diligence report generation. TRIGGERS: due diligence, DD, startup investment, cap table review, Series A, seed round, investor diligence, legal review startup, SAFE analysis, convertible note, 409A, founder vesting.
interview-master
IncludedThis skill should be used when the user asks to "generate interview questions", "prepare for interview", "optimize resume", "conduct mock interview", "analyze git commits for resume", "generate resume from code", "review my resume", or mentions interview preparation, career assistance, or extracting project experience from git history. Provides comprehensive interview and career development guidance for both job seekers and interviewers.
fix-issue
IncludedFixes GitHub issues using parallel analysis agents for root cause investigation, code exploration, and regression detection. Reads issue context from gh CLI, searches codebase and memory for related patterns, generates a fix with tests, and links the resolution back to the issue via PR. Includes prevention analysis to avoid recurrence. Use when debugging errors, resolving regressions, fixing bugs, or triaging issues.
sf-apex
IncludedGenerates and reviews Salesforce Apex code with 150-point scoring. TRIGGER when: user writes, reviews, or fixes Apex classes, triggers, test classes, batch/queueable/schedulable jobs, or touches .cls/.trigger files. DO NOT TRIGGER when: LWC JavaScript (use sf-lwc), Flow XML (use sf-flow), SOQL-only queries (use sf-soql), or non-Salesforce code.
swift-development
IncludedComprehensive Swift development for building, testing, and deploying iOS/macOS applications. Use when Claude needs to: (1) Build Swift packages or Xcode projects from command line, (2) Run tests with XCTest or Swift Testing framework, (3) Manage iOS simulators with simctl, (4) Handle code signing, provisioning profiles, and app distribution, (5) Format or lint Swift code with SwiftFormat/SwiftLint, (6) Work with Swift Package Manager (SPM), (7) Implement Swift 6 concurrency patterns (async/await, actors, Sendable), (8) Create SwiftUI views with MVVM architecture, (9) Set up Core Data or SwiftData persistence, or any other Swift/iOS/macOS development tasks.