一键导入
sparqinit
Bootstrap SparQ configuration. Use when: starting SparQ for the first time, re-initializing config, or switching projects.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Bootstrap SparQ configuration. Use when: starting SparQ for the first time, re-initializing config, or switching projects.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Generate automated E2E tests from scratch for a feature or bug ticket (Playwright or Cypress per config). Combines requirements analysis with automated test generation. Use when: (1) creating E2E tests for a new feature, (2) generating E2E tests from Jira ticket, (3) building automation suite from requirements, (4) creating a regression test from a bug ticket — orchestrator auto-detects and applies REG- IDs + inline-append behavior.
Generating both manual test cases AND automated E2E tests in a single pipeline. Combines requirements analysis, manual test generation, and E2E code generation. Use when: (1) creating complete test coverage for a feature, (2) generating manual tests and automated E2E together, (3) full QA pipeline from requirements to E2E code, (4) need both QA documentation and automation, (5) generating tests for multiple Jira tickets in batch.
Convert manual test cases into automated E2E tests. Use when: (1) automating existing manual tests, (2) transforming TMS test cases to E2E tests, (3) automating a manual test suite, (4) converting TestRail or Qase test cases to Playwright E2E via MCP. Accepts test cases as text, file path, TMS reference (TestRail XML, Qase JSON, local JSON), CSV export, or live TMS connection (TestRail MCP, Qase MCP).
Consulting Playwright enterprise best practices — architecture, authentication, assertions, mocking, CI/CD, accessibility, visual regression, and anti-patterns. Providing production-ready patterns and code examples for Playwright test suites. Use when: user asks about Playwright best practices, test architecture, auth patterns, assertion strategies, CI setup, accessibility testing, visual regression, or wants to avoid common Playwright anti-patterns.
Advanced prompt optimization for Claude Code agents. Token budgeting, context engineering, Claude 4.6 specifics, data format selection, and prompt compression. Use when writing or refining skills, CLAUDE.md rules, multi-agent prompts, or debugging verbose/irrelevant output. Complements base formatting rules in CLAUDE.md.
Validating existing E2E tests against current UI, codebase, and designs. Detecting broken selectors, stale flows, UI drift, and technical freshness issues. Use when: (1) tests exist but may be outdated, (2) after UI refactoring, (3) periodic health checks, (4) checking if tests still match current state.
| name | sparq:init |
| description | Bootstrap SparQ configuration. Use when: starting SparQ for the first time, re-initializing config, or switching projects. |
| audience | qa |
Purpose: Create or reset sparq.config.json and set up the .sparq/ directory structure. This is the entry point for new SparQ users or when switching to a new project.
When user provides --quick or asks for quick setup, use the streamlined 3-question flow:
package.json and filesystem (tech stack, E2E, source root, routes)/sparq:start"Quick mode defaults:
/sparq:config)Check existing config: If sparq.config.json exists, prompt user:
Auto-detect tech stack from package.json and project structure:
package.json -> detect framework (vue, react, angular, svelte) — framework name is NOT stored in config; only derived fields (componentFileExtensions, sourceRoot, routeDiscoveryPattern) are stored in the project sectionproject.componentFileExtensionsvue-router -> "vue-router", react-router or react-router-dom -> "react-router", @angular/router -> "angular-router", next -> "next-router", nuxt -> "nuxt-router"project.sourceRoot: check for src/, app/, lib/ directories; use whichever exists (prefer src/ if multiple)project.routeDiscoveryPattern: derive from detected router (e.g., "**/router/**/*.ts" for vue-router, "app/**/page.tsx" for Next.js, "**/app-routing*.ts" for Angular)Auto-detect E2E setup from filesystem:
playwright.config.* AND cypress.config.* to determine E2E frameworke2e.framework: "playwright"e2e/ or cypress/ directorye2e/pages/**/*.page.tse2e/components/**/*.component.tse2e/steps/**/*.steps.tse2e/fixtures/**/*.fixture.tse2e/specs/**/*.spec.tsabstract.page.ts or class extending nothing with abstract methodse2e/fixtures/index.tsPrompt for source configuration (requirements gathering):
docs/specs)Prompt for export targets (where to publish results):
.sparq/tms-export (configurable via outputs.tms.local.outputDir)Generate sparq.config.json: Assemble all detected and user-provided values. See .claude/skills/sparq-shared/references/config-schema.md for full schema and defaults.
Create .sparq/ directory structure:
.sparq/
├── requirements/ # REQ-{feature}.md files
├── test-cases/ # TC-{feature}-manual.md and .xml files
├── coverage/ # Coverage matrices
├── validation/ # Validation reports
├── refresh/ # S5 diff reports and previous requirement snapshots
├── plans/ # Execution plans
├── parallel/ # Temporary parallel staging (shared file patches only, cleaned after merge)
└── tracking/ # Test registry for traceability
└── test-registry.json # Auto-maintained test-to-requirement mapping
Note: E2E test code (pages, steps, fixtures, specs) is written directly to the project's test directory per e2e.structure.* config. The .sparq/ directory holds metadata only.
Note: .sparq/state/ is NOT created by init — the orchestrator creates it at workflow start and is the sole writer. See resume-protocol.md.
Directory .sparq/tracking/ must be created before initializing test-registry.json.
Initialize test-registry.json with: {"version":"1.0","lastUpdated":null,"entries":[]}
Verify MCP server availability (30s timeout per server): Test each enabled source:
mcp__atlassian__jira_get_issue with a known ticket (or list projects)mcp__atlassian__confluence_search with space keymcp__figma__whoamimcp__testrail__get_sections with project IDmcp__qase__list_suites with project code
If verification fails, warn and continue -- user can configure later (see degradation-strategy.md Init Skill Fallback).e2e.framework is playwright): run npx playwright --version to detect CLI availabilityAtlassian OAuth note: Jira and Confluence use the Atlassian MCP server which authenticates via OAuth 2.1 browser login — no ENV vars or API tokens needed. On first connection, Claude Code opens a browser for Atlassian login and consent. If "Auth required" is reported, the user needs to complete the OAuth flow (e.g., via /mcp in Claude Code settings). See jira-patterns.md ## Authentication for alternative CI/headless auth methods.
The "Jira project key" prompted during init (e.g.,
EP,PROJ) is the project identifier used in JQL queries — it is NOT an API key or credential.
After verification, present results in a clear dashboard:
Integration Status
──────────────────
Jira ({key}): {status} -- {action if failed}
Confluence ({key}): {status} -- {action if failed}
Figma: {status} -- {action if failed}
Playwright: {status} -- {action if failed}
Status values:
If any source is unavailable, explain impact:
npm i -D @playwright/test && npx playwright install. Browser verification will be skipped until installed."Report setup summary (use plain language — explain what each connection does):
SparQ Configuration Summary
===========================
Project: my-app
Source Root: src/
Tech Stack: {framework} + {e2e.framework}
E2E Framework: {e2e.framework} (from config)
E2E Infrastructure: 3 pages, 2 components, 1 fixture, 5 specs
Connections (how SparQ talks to your tools):
Jira (EP): Reads requirements from your Jira tickets ........... available
Confluence (TEAM): Reads specifications from your Confluence pages ... available
Figma: Reads UI designs for selector discovery ............. not configured
Playwright: Runs tests and verifies selectors in a browser ..... available
Local (docs/specs): Reads requirements from local markdown files .... available
Export Targets (where results are published):
TMS: testrail (project 1, suite 1)
Jira: adds coverage comments to tickets
Confluence: publishes test plans to space TEAM
Config saved to: sparq.config.json
Get started: /sparq:start (guided workflow)
Or jump in: /sparq:generate {ticket-id}
Generate quick reference card at .sparq/QUICKREF.md using the claude/templates/sparq-quickref.md template, filling in project-specific values from the config:
{project.name} from package.json name field (not stored in sparq.config.json){e2e.framework} from sparq.config.json e2e.framework{project.testDir} from sparq.config.json e2e.structure.specsDir (e.g., e2e/specs){enabled sources} — comma-separated list of sources where enabled: true (e.g., Jira, Confluence, Local files){outputs.tms.provider} from sparq.config.json outputs.tms.provider (or none if not configured){preferences.checkpointLevel} from sparq.config.json preferences.checkpointLevel.sparq/QUICKREF.md.sparq/QUICKREF.md"/sparq:init explicitlysparq.config.json and suggests running initsparq.config.json written to project root.sparq/ directory structure createdpackage.json not found: prompt user for project name and tech stack manuallye2e/ directory and no E2E config files: set e2e.detected: false, default to e2e.framework: "playwright" for new projects<done_criteria>
package.json and filesystemsparq.config.json generated at project root with all detected and user-provided settingsconfig-schema.md — all required fields present with correct types and no unknown keys.sparq/ directory structure created with all required subdirectories and test-registry.json initialized.sparq/QUICKREF.md with project-specific values filled in from config
</done_criteria>.claude/skills/sparq-shared/references/config-schema.md -- full schema documentation.claude/skills/sparq-shared/references/degradation-strategy.md -- fallback behaviors for unavailable sourcesclaude/templates/sparq-quickref.md -- quick reference card template (filled during step 10)/sparq:init
Examples:
"Initialize SparQ in this project""Set up SparQ with quick mode""Re-initialize SparQ config for a new project"/sparq:init
-> checks for existing config (not found)
-> reads package.json: detects framework, router, componentFileExtensions
-> detects project.sourceRoot: src/
-> detects componentFileExtensions from framework
-> checks for playwright.config.* / cypress.config.* -> determines e2e.framework
-> scans e2e/: 3 pages, 2 components, 1 step, 1 fixture, 5 specs
-> prompts: Jira key? "EP" | Confluence? "TEAM" | Figma? "y" | TMS? "testrail" (project 1, suite 1)
-> generates sparq.config.json (with all detected fields)
-> creates .sparq/ directories
-> verifies: Jira OK, Confluence OK, Figma OK, TestRail OK, Qase N/A, E2E runner OK
-> output: setup summary
-> generates .sparq/QUICKREF.md from template with project values