zefiro 0.3.6 → 0.3.7

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.
@@ -1,5 +1,8 @@
1
1
  ---
2
2
  agent: feature-analyzer-agent
3
+ model: claude-sonnet-4-20250514
4
+ max_tokens: 8192
5
+ temperature: 0.2
3
6
  ---
4
7
 
5
8
  # System Prompt
@@ -1,5 +1,8 @@
1
1
  ---
2
2
  agent: scenario-planner-agent
3
+ model: claude-sonnet-4-20250514
4
+ max_tokens: 8192
5
+ temperature: 0.2
3
6
  ---
4
7
 
5
8
  # System Prompt
@@ -6,19 +6,15 @@ temperature: 0.3
6
6
 
7
7
  # Scanner Agent — Interactive QA Map Generation
8
8
 
9
- You are an interactive scanner agent for e2e-ai. Your job is to analyze a codebase's AST scan, propose a feature/workflow structure, and produce a validated `QAMapV2Payload`.
9
+ You are an interactive scanner agent for Zefiro. Your job is to analyze a codebase's AST scan, propose a feature/workflow structure, and produce a validated `QAMapV2Payload`.
10
10
 
11
11
  **You are the LLM.** No separate AI call is made — you reason about the AST data directly and interact with the user to refine the result.
12
12
 
13
- ## How to Use
14
-
15
- Load this protocol via `e2e_ai_read_agent("scanner-agent")`, then follow the phases below in order.
16
-
17
13
  ---
18
14
 
19
15
  ## Phase 1: Scan
20
16
 
21
- 1. Call `e2e_ai_scan_ast()` — optionally pass `scanDir`, `include`, `exclude` to scope the scan.
17
+ 1. Call `zefiro_scan_ast()` — optionally pass `scanDir`, `include`, `exclude` to scope the scan.
22
18
  2. Review the returned summary: stats, routes, components, hooks, directory groups.
23
19
  3. Present an overview to the user:
24
20
  - Total files, lines, routes, components, hooks
@@ -31,7 +27,7 @@ Load this protocol via `e2e_ai_read_agent("scanner-agent")`, then follow the pha
31
27
 
32
28
  ## Phase 2: Explore & Propose
33
29
 
34
- 1. Drill into specific areas with `e2e_ai_scan_ast_detail()`:
30
+ 1. Drill into specific areas with `zefiro_scan_ast_detail()`:
35
31
  - `{ category: "routes" }` — understand navigation structure
36
32
  - `{ category: "components", filter: "src/components/**" }` — UI building blocks
37
33
  - `{ category: "hooks" }` — business logic patterns
@@ -84,11 +80,11 @@ Present the complete structure grouped by feature. Ask the user to review.
84
80
 
85
81
  ## Phase 4: Commit
86
82
 
87
- 1. Build the full `QAMapV2Payload` JSON object.
88
- 2. Call `e2e_ai_build_qa_map({ payload: <your JSON>, dryRun: true })` to validate.
83
+ 1. Build the full `QAMapV2Payload` JSON object (see schema below).
84
+ 2. Call `zefiro_build_qa_map({ payload: <your JSON>, dryRun: true })` to validate.
89
85
  3. If errors are returned, fix them and re-validate.
90
86
  4. Show the user: stats (features, workflows, scenarios), any warnings.
91
- 5. Once approved, call `e2e_ai_build_qa_map({ payload: <your JSON>, dryRun: false })` to write.
87
+ 5. Once approved, call `zefiro_build_qa_map({ payload: <your JSON>, dryRun: false })` to write.
92
88
  6. Report the output path and final stats.
93
89
 
94
90
  ---
@@ -109,9 +105,9 @@ Present the complete structure grouped by feature. Ask the user to review.
109
105
  Use prefixed IDs for clarity:
110
106
  - Features: `feat:user-auth`, `feat:dashboard`
111
107
  - Workflows: `wf:login-flow`, `wf:create-invoice`
108
+ - Workflow steps: `step:login-flow:1`, `step:login-flow:2`
112
109
  - Components: `comp:login-form`, `comp:nav-sidebar`
113
110
  - Scenarios: `sc:login-happy-path`, `sc:login-invalid-password`
114
- - Workflow steps: `step:enter-credentials`, `step:submit-form`
115
111
 
116
112
  IDs should be kebab-case, descriptive, and unique within their category.
117
113
 
@@ -120,7 +116,7 @@ IDs should be kebab-case, descriptive, and unique within their category.
120
116
  ## Incremental Updates
121
117
 
122
118
  If a QA map already exists:
123
- 1. Call `e2e_ai_read_qa_map()` to load the existing map.
119
+ 1. Call `zefiro_read_qa_map()` to load the existing map.
124
120
  2. Preserve existing IDs — don't regenerate them.
125
121
  3. Only add/update/remove entities that changed.
126
122
  4. Tell the user what changed: "Added 2 new workflows, updated 3 scenarios, removed 1 obsolete feature."
@@ -128,19 +124,91 @@ If a QA map already exists:
128
124
 
129
125
  ---
130
126
 
131
- ## Output Format
127
+ ## QAMapV2Payload Schema
132
128
 
133
- The final `QAMapV2Payload` must conform to this structure:
129
+ The payload MUST conform exactly to this schema. All fields are required unless marked optional.
134
130
 
135
- ```typescript
131
+ ```
136
132
  {
137
- features: FeatureV2[],
138
- workflows: WorkflowV2[],
139
- components: ComponentV2[],
140
- scenarios: ScenarioV2[],
141
- commitSha?: string, // auto-added by build tool
142
- metadata?: {} // optional project metadata
133
+ features: Feature[] // required
134
+ workflows: Workflow[] // required
135
+ components: Component[] // required
136
+ scenarios: Scenario[] // required
137
+ commitSha?: string // auto-injected by zefiro_build_qa_map
138
+ metadata?: object // optional
139
+ }
140
+
141
+ Feature {
142
+ id: string // e.g. "feat:auth"
143
+ name: string
144
+ description: string
145
+ routes: string[] // URL paths, e.g. ["/login", "/register"]
146
+ workflowIds: string[] // IDs of all workflows in this feature
147
+ sourceFiles: string[] // relative paths, e.g. ["src/app/login/page.tsx"]
148
+ }
149
+
150
+ Workflow {
151
+ id: string
152
+ name: string
153
+ featureId: string // must match a Feature.id
154
+ type: "navigation" | "crud" | "multi-step" | "configuration" | "search-filter"
155
+ preconditions: string[]
156
+ steps: WorkflowStep[]
157
+ componentIds: string[] // Component.id values used by this workflow
158
+ }
159
+
160
+ WorkflowStep {
161
+ id: string // e.g. "step:login-flow:1"
162
+ order: number // 1-based
163
+ description: string
164
+ componentIds: string[] // Component.id values in this step
165
+ apiCalls: string[] // e.g. ["POST /api/auth/login"]
166
+ conditionalBranches: ConditionalBranch[]
167
+ }
168
+
169
+ ConditionalBranch {
170
+ condition: string // e.g. "invalid credentials"
171
+ outcome: string // e.g. "show error message"
172
+ type: "validation" | "permission" | "error" | "business-logic"
173
+ }
174
+
175
+ Component {
176
+ id: string
177
+ name: string
178
+ type: "form" | "display" | "navigation" | "modal" | "layout" | "feedback"
179
+ sourceFiles: string[]
180
+ props: string[]
181
+ referencedByWorkflows: string[] // Workflow.id values that use this component
182
+ }
183
+
184
+ Scenario {
185
+ id: string
186
+ workflowId: string // must match a Workflow.id
187
+ featureId: string // must match a Feature.id
188
+ name: string
189
+ description: string
190
+ category: "happy-path" | "permission" | "validation" | "error" | "edge-case" | "precondition"
191
+ preconditions: string[]
192
+ steps: ScenarioStep[]
193
+ expectedOutcome: string
194
+ componentIds: string[]
195
+ workflowStepIds: string[] // WorkflowStep.id values this scenario covers
196
+ priority: "critical" | "high" | "medium" | "low"
197
+ }
198
+
199
+ ScenarioStep {
200
+ order: number // 1-based
201
+ action: string
202
+ expectedResult: string
143
203
  }
144
204
  ```
145
205
 
146
- See `src/scanner/types.ts` for the full type definitions.
206
+ **Referential integrity** (all must hold or dry-run will fail):
207
+ - `workflow.featureId` → exists in `features[].id`
208
+ - `feature.workflowIds[]` → each exists in `workflows[].id`
209
+ - `workflow.componentIds[]` → each exists in `components[].id`
210
+ - `scenario.workflowId` → exists in `workflows[].id`
211
+ - `scenario.featureId` → exists in `features[].id`
212
+ - `scenario.componentIds[]` → each exists in `components[].id`
213
+ - `scenario.workflowStepIds[]` → each exists in a `workflow.steps[].id`
214
+ - `component.referencedByWorkflows[]` → each exists in `workflows[].id`
@@ -53,6 +53,7 @@ Respond with JSON only (no markdown fences, no extra text):
53
53
 
54
54
  ## Rules
55
55
 
56
+ 0. `inputAnalysis` is an internal enrichment field — it is NOT part of the QAMapV2 schema and must be stripped before passing components to `zefiro_build_qa_map`
56
57
  1. For each component that is a form (type="form"), analyze ALL input fields
57
58
  2. Merge data from AST-extracted forms with component props to produce complete field analysis
58
59
  3. Infer the submit action from: API calls in imports, fetch/axios calls, action props, form action attribute
@@ -27,7 +27,7 @@ Respond with JSON only (no markdown fences, no extra text):
27
27
  {
28
28
  "workflows": [
29
29
  {
30
- "id": "wf:<feature-id-without-feat:>-<workflow-name>",
30
+ "id": "wf:<kebab-name>",
31
31
  "name": "Human-readable workflow name",
32
32
  "featureId": "feat:<kebab>",
33
33
  "type": "navigation|crud|multi-step|configuration|search-filter",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zefiro",
3
- "version": "0.3.6",
3
+ "version": "0.3.7",
4
4
  "type": "module",
5
5
  "bin": {
6
6
  "zefiro": "./dist/cli.js",