Analyze Requirements
Config and fallback per claude/rules/skills.md preamble. Only query sources where enabled: true.
Workflow
- Parse input -- determine source type (Jira ID, Confluence URL, Figma link, file path, or plain text)
- Scan
{project.sourceRoot} from config for existing types and route definitions relevant to the feature (informs selectors and URL patterns). Use project.componentFileExtensions to determine which file types to grep (e.g., *.vue for Vue, *.tsx/*.jsx for React, *.svelte for Svelte).
- Delegate to
sparq-requirements-analyst agent with delegation payload:
- Source type and identifiers (ticket ID, URL, file path)
- Enabled sources from config (
sources.jira.enabled, sources.confluence.enabled, etc.)
- E2E infrastructure summary from config
e2e section (existing pages, components, fixtures)
- Tech stack context from config:
project.componentFileExtensions (for grep patterns)
project.sourceRoot (for source scanning scope)
- Feature name (derived from input or user-specified)
- Consolidate into structured requirements doc
- Write to
.sparq/requirements/REQ-{feature}.md -- include E2E Infrastructure Summary (from config e2e section) so downstream agents know existing page objects/components
Accepted Inputs
- Jira ticket ID:
EP-14, PROJ-200 (Jira MCP via mcp__atlassian__jira_*)
- Confluence URL:
https://team.atlassian.net/wiki/spaces/... (Confluence MCP via mcp__atlassian__confluence_*)
- Figma link:
https://www.figma.com/design/... (Figma MCP via mcp__figma__*)
- Local file path:
docs/specs/feature.md (filesystem)
- Plain text:
"User login with MFA" (used as-is)
Multiple inputs combinable: /sparq:analyze EP-14 https://figma.com/design/...
Usage Modes
- Standalone: Run
/sparq:analyze EP-14 to review requirements before generating tests. Useful for requirements review, gap analysis, or preparing a spec for stakeholders.
- Internal: Called automatically by
/sparq:generate-manual and /sparq:generate-e2e when no .sparq/requirements/REQ-{feature}.md exists -- no need to run separately in that case.
Output
Write to .sparq/requirements/REQ-{feature}.md with sections:
- Sources -- origin references with labels (SRC-J, SRC-C, SRC-F, SRC-L)
- User Journey -- ordered user steps through the feature
- Requirements -- structured requirements with IDs (
REQ-{feature}-{NNN})
- UI Elements -- interactive elements with suggested selectors
- Edge Cases -- boundary conditions, error scenarios, unusual inputs
- Open Questions -- ambiguities requiring stakeholder clarification
Fallback Behavior
When MCP sources are unavailable, degrade per degradation-strategy.md. Primary source fails: prompt user for text/file. Secondary sources: skip and continue. Never block entirely -- always produce output from available sources.
References
.claude/skills/sparq-shared/references/jira-patterns.md, confluence-patterns.md, figma-patterns.md
.claude/skills/sparq-shared/references/config-schema.md
.claude/skills/sparq-shared/references/degradation-strategy.md
Example
/sparq:analyze EP-14
-> reads config, enables: jira, confluence, figma
-> fetches EP-14, finds linked Confluence page + Figma link
-> delegates to sparq-requirements-analyst with source type, identifiers, enabled sources
-> output: .sparq/requirements/REQ-login.md
1---2name: sparq-analyze3description: Gather and consolidate requirements from Jira, Confluence, Figma, and local files. Use when: (1) analyzing a Jira ticket for testing, (2) extracting requirements from Confluence specs, (3) understanding UI flows from Figma designs, (4) preparing requirements for test generation. Triggers: Jira ticket ID, Confluence page URL, Figma link, or feature description.4---56# Analyze Requirements78Config and fallback per `claude/rules/skills.md` preamble. Only query sources where `enabled: true`.910## Workflow11121. Parse input -- determine source type (Jira ID, Confluence URL, Figma link, file path, or plain text)132. Scan `{project.sourceRoot}` from config for existing types and route definitions relevant to the feature (informs selectors and URL patterns). Use `project.componentFileExtensions` to determine which file types to grep (e.g., `*.vue` for Vue, `*.tsx`/`*.jsx` for React, `*.svelte` for Svelte).143. Delegate to `sparq-requirements-analyst` agent with delegation payload:15 - **Source type** and **identifiers** (ticket ID, URL, file path)16 - **Enabled sources** from config (`sources.jira.enabled`, `sources.confluence.enabled`, etc.)17 - **E2E infrastructure summary** from config `e2e` section (existing pages, components, fixtures)18 - **Tech stack context** from config:19 - `project.componentFileExtensions` (for grep patterns)20 - `project.sourceRoot` (for source scanning scope)21 - **Feature name** (derived from input or user-specified)224. Consolidate into structured requirements doc235. Write to `.sparq/requirements/REQ-{feature}.md` -- include E2E Infrastructure Summary (from config e2e section) so downstream agents know existing page objects/components2425## Accepted Inputs2627- **Jira ticket ID**: `EP-14`, `PROJ-200` (Jira MCP via `mcp__atlassian__jira_*`)28- **Confluence URL**: `https://team.atlassian.net/wiki/spaces/...` (Confluence MCP via `mcp__atlassian__confluence_*`)29- **Figma link**: `https://www.figma.com/design/...` (Figma MCP via `mcp__figma__*`)30- **Local file path**: `docs/specs/feature.md` (filesystem)31- **Plain text**: `"User login with MFA"` (used as-is)3233Multiple inputs combinable: `/sparq:analyze EP-14 https://figma.com/design/...`3435## Usage Modes3637- **Standalone**: Run `/sparq:analyze EP-14` to review requirements before generating tests. Useful for requirements review, gap analysis, or preparing a spec for stakeholders.38- **Internal**: Called automatically by `/sparq:generate-manual` and `/sparq:generate-e2e` when no `.sparq/requirements/REQ-{feature}.md` exists -- no need to run separately in that case.3940## Output4142Write to `.sparq/requirements/REQ-{feature}.md` with sections:43441. **Sources** -- origin references with labels (SRC-J, SRC-C, SRC-F, SRC-L)452. **User Journey** -- ordered user steps through the feature463. **Requirements** -- structured requirements with IDs (`REQ-{feature}-{NNN}`)474. **UI Elements** -- interactive elements with suggested selectors485. **Edge Cases** -- boundary conditions, error scenarios, unusual inputs496. **Open Questions** -- ambiguities requiring stakeholder clarification5051## Fallback Behavior5253When MCP sources are unavailable, degrade per `degradation-strategy.md`. Primary source fails: prompt user for text/file. Secondary sources: skip and continue. Never block entirely -- always produce output from available sources.5455<done_criteria>561. `sparq.config.json` read and validated; only sources with `enabled: true` are queried572. All enabled requirement sources queried (Jira/Confluence/Figma/local) with fallback applied for any unavailable source per `degradation-strategy.md`583. Requirements document written to `.sparq/requirements/REQ-{feature}.md` with unique `REQ-{feature}-{NNN}` IDs and source labels (SRC-J/C/F/L)594. Every requirement entry contains at least one acceptance criterion605. Open Questions section lists any ambiguities or coverage gaps identified during analysis61</done_criteria>6263## References6465- `.claude/skills/sparq-shared/references/jira-patterns.md`, `confluence-patterns.md`, `figma-patterns.md`66- `.claude/skills/sparq-shared/references/config-schema.md`67- `.claude/skills/sparq-shared/references/degradation-strategy.md`6869## Example7071```72/sparq:analyze EP-1473-> reads config, enables: jira, confluence, figma74-> fetches EP-14, finds linked Confluence page + Figma link75-> delegates to sparq-requirements-analyst with source type, identifiers, enabled sources76-> output: .sparq/requirements/REQ-login.md77```