@exodus/xqa 1.4.0 → 1.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -23,13 +23,38 @@ IMPORTANT: Never generate a draft before the interview is complete. The user des
23
23
 
24
24
  ### 1. Explore
25
25
 
26
- Silently scan `.xqa/specs/*.test.md`. Learn:
26
+ Time budget: complete within 10 tool calls. Do not surface findings yet.
27
27
 
28
- - Naming conventions
29
- - Tag vocabulary
30
- - Level of detail and step granularity
28
+ **a. Existing specs and app context — run in parallel:**
31
29
 
32
- Also read `.xqa/app.md` if it exists for app context.
30
+ MUST issue all of the following as a single parallel batch (one message, multiple tool calls):
31
+
32
+ - Glob `**/.xqa/specs/*.test.md` → read every result
33
+ - Read `.xqa/app.md` if it exists
34
+
35
+ Learn from specs: naming conventions, step granularity, level of detail.
36
+
37
+ **b. Codebase discovery — run in parallel:**
38
+
39
+ MUST issue all of the following as a single parallel batch:
40
+
41
+ - Glob `**/*Screen.tsx` | `**/*Screen.ts`
42
+ - Glob `**/screens/**/*.tsx` | `**/screens/**/*.ts`
43
+ - Glob `**/navigation/**` | `**/routes.ts` | `**/routes.tsx` | `**/router.ts`
44
+ - Glob `**/*Navigator.tsx` | `**/*Navigator.ts`
45
+
46
+ Read every Glob result that returns ≤ 5 files. When a Glob returns > 5 files, read only the first 3 results — prioritise files whose names match the flow the user described.
47
+
48
+ **c. Feature-specific scan (conditional):**
49
+
50
+ If the user named a specific feature or screen, run ONE additional parallel batch:
51
+
52
+ - Grep the feature name across `**/*.tsx`, `**/*.ts` (files with matches only)
53
+ - Grep for copy strings related to the feature in `**/*.ts` | `**/*.tsx` | `**/*.json`
54
+
55
+ Read up to 3 matching files. Stop.
56
+
57
+ **Capture silently:** screen names, navigation routes, copy strings, feature flag identifiers. This context is used only during step 3a reminders — never presented to the user unprompted.
33
58
 
34
59
  ### 2. Detect mode
35
60
 
@@ -47,19 +72,33 @@ Ask one question at a time. Wait for the answer before asking the next. Prefer m
47
72
  **Question sequence:**
48
73
 
49
74
  1. **What flow?** — Confirm what's being tested if not already clear. Suggest a filename and `feature` name.
50
- 2. **Entry point** — "What's the navigation path to reach this flow?" (e.g., `App launch`, `Home > Wallet`) → becomes `entry:` frontmatter
51
- 3. **Starting state** — "What's already set up? What state is the device/app in?" → becomes `## Setup`
52
- 4. **Steps** — "Walk me through the steps, one at a time. I'll ask for the next when you're done." → collect each step, then ask "What should happen?" for the assertion (optional)
53
- 5. **Global assertions** — "Any overall things that should be true at the end of the flow?" → becomes `## Assertions` (skip if none)
54
- 6. **Max steps** — "Set a timeout in seconds? (optional, for long-running specs)" → becomes `timeout:` frontmatter (offer to skip)
75
+ 2. **Starting state** — "What's already set up? What state is the device/app in?" → becomes `## Setup`
76
+ 3. **Steps** — "Walk me through the steps, one at a time. For each step, describe the intent (what the user is trying to do), and optionally the expected outcome and a hint about the current label or wording." → collect each step. Prompt for outcome only when user mentions something to verify. Prompt for hint only when current label wording is useful.
77
+ 4. **Global assertions** — "Any overall things that should be true at the end of the flow?" → becomes `## Assertions` (skip if none)
78
+ 5. **Timeout** — "Set a timeout in seconds? (optional, for long-running specs)" → becomes `timeout:` frontmatter (offer to skip)
55
79
 
56
80
  IMPORTANT: Ask each question in its own message. Never batch questions.
57
81
 
82
+ ### 3a. Code-informed reminders (during step collection)
83
+
84
+ After the user describes a step, you MAY offer AT MOST ONE code-informed follow-up reminder before moving to the next step. Phrase it as:
85
+
86
+ > "I also see <intent-first phrase> in the code — want to include it as a step? (source: `<file>`)"
87
+
88
+ Rules:
89
+
90
+ - Max one unsolicited suggestion per user-described step. No bulk proposals.
91
+ - Declined once → never re-offer that suggestion.
92
+ - Translate code findings into intent-first language BEFORE presenting. Component names, route names, and variable names must be rewritten as user goals.
93
+ - Copy strings belong in `hint:` only — never in the intent phrase.
94
+ - Always cite the source file the suggestion was derived from.
95
+ - If no code-backed reminder is worth offering, stay silent and move on.
96
+
58
97
  ### 4. Draft
59
98
 
60
- Assemble using ONLY these frontmatter fields: `feature`, `entry`, `timeout`. Do not add any other frontmatter field. `feature` MUST be present. `timeout` MUST be a positive number (seconds) if included.
99
+ Assemble using ONLY these frontmatter fields: `feature`, `timeout`. Do not add any other frontmatter field. `feature` MUST be present. `timeout` MUST be a positive number (seconds) if included.
61
100
 
62
- Steps and assertions come from the user — never invent them. Present the full draft for review.
101
+ Steps come from the user — never invent them. Use intent-first language: describe the user's goal, not literal widget taps. Present the full draft for review.
63
102
 
64
103
  ### 5. Review
65
104
 
@@ -72,32 +111,62 @@ Iterate until approved. One round of changes per message.
72
111
  Before writing, verify the draft passes all checks:
73
112
 
74
113
  - [ ] `feature` is present and non-empty
75
- - [ ] frontmatter contains only permitted fields: `feature`, `entry`, `timeout`
114
+ - [ ] frontmatter contains only permitted fields: `feature`, `timeout`
76
115
  - [ ] `timeout` if present is a positive number in seconds (not a string, not zero)
77
116
  - [ ] `## Setup` section is present
78
117
  - [ ] `## Steps` section is present
79
- - [ ] No forbidden fields: `tags`, `max_steps`, `priority`, `type`, `description`, `id`, `author`
118
+ - [ ] No step begins with `Tap "<literal label>"` or equivalent literal-widget references — steps use intent-first language
119
+ - [ ] No forbidden fields: `tags`, `max_steps`, `priority`, `type`, `description`, `id`, `author`, `version`, `entry`
80
120
 
81
121
  Fix any failure before writing. Save to `.xqa/specs/<name>.test.md` only after explicit approval.
82
122
 
123
+ ## Step Grammar
124
+
125
+ ```
126
+ <intent phrase> [→ <outcome state>] [hint: <advisory text>]
127
+ ```
128
+
129
+ - **Intent phrase** — imperative, action-oriented, describes the user's goal. No literal widget labels. Include a domain noun (e.g., "agreement", "asset", "settings").
130
+ - **Outcome state** — optional. Include only when the step has something to verify. Observable screen state or content predicate.
131
+ - **Hint** — optional. Free-form natural text describing expected label or qualities. Agent infers role (primary/secondary/dismissal) from context. Never use structured `role=` syntax.
132
+
133
+ ### Valid examples
134
+
135
+ ```md
136
+ 1. Accept the terms and conditions → Portfolio screen visible [hint: "Agree and continue"]
137
+ 2. Open the settings menu
138
+ 3. Dismiss the backup reminder [hint: skip or maybe later button]
139
+ 4. Enter the recovery phrase words in order → All 12 fields filled, Confirm becomes active
140
+ ```
141
+
142
+ ### Anti-patterns
143
+
144
+ ```md
145
+ # Literal label as selector — breaks on rename
146
+
147
+ 1. Tap the "Agree and continue" button
148
+
149
+ # Vague intent — agent has nothing to anchor on
150
+
151
+ 2. Do the onboarding thing
152
+ ```
153
+
83
154
  ## File format
84
155
 
85
156
  FRONTMATTER SCHEMA — exact fields, exact types, no others:
86
157
 
87
158
  ```
88
159
  feature string REQUIRED
89
- entry string OPTIONAL — omit if not provided
90
- timeout positive number (seconds) OPTIONAL — omit if not provided
160
+ timeout positive number (seconds) OPTIONAL — omit if not provided
91
161
  ```
92
162
 
93
- FORBIDDEN frontmatter fields — never generate these: `tags`, `max_steps`, `priority`, `type`, `description`, `id`, `author`, `version`
163
+ FORBIDDEN frontmatter fields — never generate these: `tags`, `max_steps`, `priority`, `type`, `description`, `id`, `author`, `version`, `entry`
94
164
 
95
165
  CANONICAL OUTPUT FORMAT:
96
166
 
97
167
  ```md
98
168
  ---
99
169
  feature: <string>
100
- entry: <string>
101
170
  timeout: <seconds>
102
171
  ---
103
172
 
@@ -107,19 +176,31 @@ timeout: <seconds>
107
176
 
108
177
  ## Steps
109
178
 
110
- 1. <action> → <expected outcome>
111
- 2. <action>
179
+ 1. <intent> → <outcome> [hint: <advisory>]
180
+ 2. <intent>
112
181
 
113
182
  ## Assertions
114
183
 
115
184
  - <global flow-level check>
116
185
  ```
117
186
 
118
- Omit `entry` and `timeout` lines if not provided. Omit `## Assertions` section if none.
187
+ Omit `timeout` line if not provided. Omit `## Assertions` section if none. Omit `→ <outcome>` or `[hint: ...]` per-step when not applicable.
119
188
 
120
189
  ## Rules
121
190
 
122
- - Inline assertion syntax: `action → outcome` using the → character
191
+ - Step grammar: `<intent> [<outcome>] [hint: <advisory>]` using the → character
192
+ - Outcome and hint are optional per step; include only when useful
123
193
  - Steps come from the user — never invent them
194
+ - Intent-first language only; no literal `Tap "<label>"` references
124
195
  - Write file only after explicit approval
125
196
  - In edit mode, ask before touching anything
197
+
198
+ ### Code exploration constraints
199
+
200
+ - Never present a pre-populated step list derived from code before the user has described the flow
201
+ - Never use component names, route names, or variable names as intent phrases — translate to user-goal language first
202
+ - Never place code-derived text in the intent phrase — copy strings belong in `hint:` only
203
+ - Never re-offer a suggested step after the user declines it once
204
+ - Never propose more than one unsolicited step per user-described step (no bulk suggestions)
205
+ - Always cite the source file when proposing a code-derived reminder
206
+ - Never infer the entire flow from navigation routes or screen stack and present it as a draft