init
Initialize Triqual for this project. Analyzes project structure, detects existing tests, generates config. Run on first use or after major changes.
What this skill does
# /init - Project Genesis
Configure Triqual for the current project by analyzing its structure and generating personalized configuration files.
## When to Use
- **First time using Triqual** in a project
- **After major project restructuring** (new test directories, different framework setup)
- **When onboarding a new team member** to ensure consistent configuration
- **After updating Triqual plugin** to regenerate configuration with new features
## Quick Start
```bash
/init # Interactive - analyzes and generates config
/init --force # Regenerate even if config exists
```
## Workflow Overview
```
┌─────────────────────────────────────────────────────────────────┐
│ TRIQUAL INIT PROCESS │
├─────────────────────────────────────────────────────────────────┤
│ 0. CREATE .TRIQUAL DIRECTORY │
│ ├── mkdir -p .triqual/runs │
│ ├── mkdir -p .triqual/context │
│ └── Create knowledge.md from template │
│ │
│ 1. CHECK EXISTING CONFIG │
│ └── Skip if triqual.config.ts exists (unless --force) │
│ │
│ 2. DETECT PROJECT STRUCTURE │
│ ├── Find playwright.config.ts/js │
│ ├── Locate test directories │
│ ├── Identify Page Objects │
│ └── Scan package.json for dependencies │
│ │
│ 3. ANALYZE EXISTING TESTS │
│ ├── Count .spec.ts / .test.ts files │
│ ├── Extract common selectors │
│ ├── Detect timeout patterns │
│ └── Identify helper functions │
│ │
│ 4. DETECT AUTHENTICATION STRATEGY │
│ ├── Check for .auth/ storageState files │
│ ├── Find auth.setup.ts / global-setup.ts │
│ ├── Locate test credentials (users.ts, .env.test) │
│ ├── Parse playwright.config for storageState usage │
│ └── Determine best auth strategy for /test │
│ │
│ 5. DETECT MCP CAPABILITIES │
│ ├── Check Playwright MCP availability │
│ ├── Verify browser_run_code for storageState │
│ ├── Check Quoth/Exolar connectivity │
│ └── Configure fallback strategies │
│ │
│ 6. GENERATE CONFIGURATION │
│ ├── triqual.config.ts (root) - TypeScript with defineConfig │
│ └── Docs/context/ (optional detailed config) │
│ ├── project.json │
│ ├── patterns.json │
│ └── selectors.json │
│ │
│ 7. DISPLAY SUMMARY │
│ └── Show what was detected and generated │
└─────────────────────────────────────────────────────────────────┘
```
---
## Step 0: Create .triqual Directory Structure
Before anything else, ensure the .triqual directory structure exists:
```bash
# Create .triqual directory structure
mkdir -p .triqual/runs .triqual/context
# Check if knowledge.md exists, create from template if not
ls .triqual/knowledge.md 2>/dev/null
```
If `.triqual/knowledge.md` doesn't exist, create it from the template at `${PLUGIN_ROOT}/context/knowledge.template.md`:
```bash
# Get plugin root (where Triqual is installed)
# Copy knowledge template
cp "${PLUGIN_ROOT}/context/knowledge.template.md" .triqual/knowledge.md
```
The `.triqual/` directory structure:
```
.triqual/
├── runs/ # Run logs for each feature (e.g., login.md, dashboard.md)
├── knowledge.md # Project-specific test knowledge (accumulated learnings)
└── context/ # Pre-built context files per feature (generated by triqual_load_context)
```
**Important:** Run logs in `.triqual/runs/` are required by hooks before writing test files.
Context files in `.triqual/context/` are required by hooks before dispatching test-planner.
---
## Step 1: Check Existing Configuration
First, check if Triqual is already configured:
```bash
# Check for existing configuration files (prefer .ts)
ls triqual.config.ts 2>/dev/null || ls triqual.config.json 2>/dev/null
```
**If configuration exists:**
- Inform user: "Triqual is already configured. Use `/init --force` to regenerate."
- Exit unless `--force` flag is provided
**If no configuration:**
- Proceed with analysis
---
## Step 2: Detect Project Structure
### 2.1 Find Playwright Configuration
```bash
# Look for Playwright config files
ls playwright.config.ts playwright.config.js 2>/dev/null
```
If found, read it to extract:
- `testDir` - Where tests are located
- `baseURL` - Default application URL
- `timeout` - Global timeout settings
- `projects` - Multi-project setup
### 2.2 Analyze package.json
```bash
cat package.json | grep -E '"@playwright|"playwright|"test":'
```
Extract:
- Playwright version
- Test scripts (npm test, npm run test:e2e, etc.)
- Related dependencies (test utilities)
### 2.3 Find Test Directories
Search in common locations:
```bash
# Common test directory patterns
ls -d tests/ test/ e2e/ automation/ playwright/ spec/ __tests__/ 2>/dev/null
# Playwright-specific
ls -d automation/playwright/tests/ e2e/tests/ tests/e2e/ 2>/dev/null
```
### 2.4 Locate Page Objects
```bash
# Find Page Object files
find . -name "*.page.ts" -o -name "*.page.js" -o -name "*Page.ts" -o -name "*Page.js" 2>/dev/null | head -20
```
### 2.5 Find Helpers and Utilities
```bash
# Find helper/utility files
find . -path "*/helpers/*" -name "*.ts" -o -path "*/utils/*" -name "*.ts" 2>/dev/null | head -20
```
---
## Step 3: Analyze Existing Tests
### 3.1 Count Test Files
```bash
# Count .spec.ts and .test.ts files
find . -name "*.spec.ts" -o -name "*.test.ts" 2>/dev/null | wc -l
```
### 3.2 Extract Common Selectors
Read a sample of test files and identify selector patterns:
```bash
# Find most common selector patterns
grep -Erh "locator|getByRole|getByTestId|data-testid" --include="*.spec.ts" . 2>/dev/null | head -50
```
Identify:
- Primary strategy (data-testid, role, text)
- Custom attributes
- Page-specific patterns
### 3.3 Detect Timeout Patterns
```bash
# Check for timeout usage
grep -rh "timeout:" --include="*.spec.ts" . 2>/dev/null | head -20
```
### 3.4 Find Authentication Setup
```bash
# Look for auth setup
ls .auth/ auth.setup.ts global-setup.ts 2>/dev/null
grep -rh "storageState" --include="*.ts" . 2>/dev/null | head -10
```
---
## Step 4: Detect Authentication Strategy
This is critical for `/test` to work with authenticated flows. Detect what auth methods are available and choose the best strategy.
### 4.1 Check for Saved StorageState
```bash
# Check for .auth/ directory with saved state
ls -la .auth/*.json 2>/dev/null
# Common patterns
ls .auth/user.json .auth/admin.json .auth/storageState.json 2>/dev/null
```
**If found:** Can use `storageState` directly via Playwright MCP's `browser_run_code`:
```javascript
browser_run_code({
code: `async (page) => {
await page.context().addCookies(require('./.auth/user.json').cookies);
}`
})
Related in General
modeling-omnistudio-epc-catalog
IncludedSalesforce Industries CME EPC product-modeling skill for Product2-based catalog creation. Use when creating EPC products, configuring product attributes, building offer bundles with Product Child Items, or reviewing EPC DataPack JSON metadata for product catalog changes. TRIGGER when: user creates or updates Product2 EPC records, AttributeAssignment payloads, AttributeMetadata/AttributeDefaultValues, Offer bundles, or ProductChildItem relationships. DO NOT TRIGGER when: designing OmniScripts/FlexCards/Integration Procedures (use building-omnistudio-omniscript, building-omnistudio-flexcard, or building-omnistudio-integration-procedure), implementing Apex business logic (use generating-apex), or troubleshooting deployment pipelines (use deploying-metadata).
relationship-science-coach
IncludedUse this skill for direct, practical adult relationship coaching: couples conflict, repair, trust, marriage, dating, flirting, attachment patterns, emotional connection, sex, desire differences, eroticism, kink negotiation, affection, love languages, breakups, and long-term passion. Draw on Gottman, EFT and Hold Me Tight, attachment science, modern sex research, Perel, Nagoski, Kerner, Schnarch, Love and Stosny, and flexible love-language tools. Be concrete and low-hedge. Redirect only for imminent danger, abuse, coercive control, minors, non-consent, self-harm, stalking, or medical/legal/psychiatric decisions.
building-sf-integrations
IncludedSalesforce integration architecture and runtime plumbing with 120-point scoring. Use this skill to set up Named Credentials, External Credentials, External Services, REST/SOAP callout patterns, Platform Events, and Change Data Capture. TRIGGER when: user sets up Named Credentials, External Services, REST/SOAP callouts, Platform Events, CDC, or touches .namedCredential-meta.xml files. DO NOT TRIGGER when: Connected App/OAuth config (use configuring-connected-apps), Apex-only logic (use generating-apex), or data import/export (use handling-sf-data).
venue-templates
IncludedAccess comprehensive LaTeX templates, formatting requirements, and submission guidelines for major scientific publication venues (Nature, Science, PLOS, IEEE, ACM), academic conferences (NeurIPS, ICML, CVPR, CHI), research posters, and grant proposals (NSF, NIH, DOE, DARPA). This skill should be used when preparing manuscripts for journal submission, conference papers, research posters, or grant proposals and need venue-specific formatting requirements and templates.
let-fate-decide
IncludedDraws the 12 Houses of the Zodiac Tarot spread to inject entropy into planning when prompts are vague, ambiguous, or casually delegated. Interprets the spread to guide next steps. Use when the user says 'let fate decide', 'YOLO', 'whatever', 'idk', or other nonchalant phrases, makes Yu-Gi-Oh references, or when you are about to arbitrarily pick between multiple reasonable approaches. Prefer over ask-questions-if-underspecified when the user's tone is casual or playful rather than precision-seeking.
net-ops
IncludedCross-platform network troubleshooting (Windows, macOS, Linux) via local or remote shell. Use for: DNS broken, can't resolve hostnames, nslookup/dig works but apps fail, NRPT, WFP, scutil, /etc/resolver, systemd-resolved, /etc/resolv.conf, NetworkManager, VPN DNS leak residue (ProtonVPN/Mullvad/WireGuard/AnyConnect), AV/firewall blocking DNS or DoH, Tailscale DNS interaction, intermittent connectivity, remote diagnostics over SSH.