zefiro 0.1.2 → 0.1.3
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.
- package/README.md +180 -0
- package/package.json +1 -1
package/README.md
ADDED
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
# Zefiro
|
|
2
|
+
|
|
3
|
+
AI-powered codebase scanner and QA map generator. Scans your project's AST, identifies features and workflows, and generates structured test scenarios — all driven by LLM agents.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install -g zefiro
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
### Environment Variables
|
|
12
|
+
|
|
13
|
+
| Variable | Required | Description |
|
|
14
|
+
|----------|----------|-------------|
|
|
15
|
+
| `OPENAI_API_KEY` | Yes (if using OpenAI) | OpenAI API key |
|
|
16
|
+
| `ANTHROPIC_API_KEY` | Yes (if using Anthropic) | Anthropic API key |
|
|
17
|
+
| `E2E_AI_API_URL` | No | Remote API URL for QA map push |
|
|
18
|
+
| `E2E_AI_API_KEY` | No | API key for push authentication |
|
|
19
|
+
|
|
20
|
+
## Quick Start
|
|
21
|
+
|
|
22
|
+
```bash
|
|
23
|
+
# Initialize config and agents
|
|
24
|
+
zefiro init
|
|
25
|
+
|
|
26
|
+
# Scan → Analyze → Push
|
|
27
|
+
zefiro scan
|
|
28
|
+
zefiro analyze
|
|
29
|
+
zefiro push
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
## CLI Usage
|
|
33
|
+
|
|
34
|
+
### Global Options
|
|
35
|
+
|
|
36
|
+
```
|
|
37
|
+
-k, --key <KEY> Issue key (e.g., PROJ-101)
|
|
38
|
+
--provider <provider> LLM provider: openai | anthropic
|
|
39
|
+
--model <model> LLM model override
|
|
40
|
+
-v, --verbose Verbose output
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
### Commands
|
|
44
|
+
|
|
45
|
+
#### `zefiro init`
|
|
46
|
+
|
|
47
|
+
Initialize zefiro in your project. Creates `.qai/zefiro/` with config and agent templates.
|
|
48
|
+
|
|
49
|
+
```bash
|
|
50
|
+
zefiro init
|
|
51
|
+
zefiro init --non-interactive
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
Interactive setup prompts for issue tracker, output format, LLM provider, and base URL.
|
|
55
|
+
|
|
56
|
+
#### `zefiro scan`
|
|
57
|
+
|
|
58
|
+
Scan your codebase AST to extract routes, components, hooks, imports, and dependencies.
|
|
59
|
+
|
|
60
|
+
```bash
|
|
61
|
+
zefiro scan
|
|
62
|
+
zefiro scan --scan-dir src/app
|
|
63
|
+
zefiro scan --output custom-scan.json
|
|
64
|
+
zefiro scan --no-cache
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
| Option | Description |
|
|
68
|
+
|--------|-------------|
|
|
69
|
+
| `--output <file>` | Output file (default: `.qai/zefiro/ast-scan.json`) |
|
|
70
|
+
| `--scan-dir <dir>` | Directory to scan (overrides config) |
|
|
71
|
+
| `--no-cache` | Disable file-level MD5 caching |
|
|
72
|
+
|
|
73
|
+
#### `zefiro analyze [input]`
|
|
74
|
+
|
|
75
|
+
Run two-stage AI analysis to generate a QA map from the AST scan.
|
|
76
|
+
|
|
77
|
+
**Stage 1:** Feature analysis — identifies features, workflows, and components.
|
|
78
|
+
**Stage 2:** Scenario planning — generates test scenarios for each workflow.
|
|
79
|
+
|
|
80
|
+
```bash
|
|
81
|
+
zefiro analyze
|
|
82
|
+
zefiro analyze custom-scan.json
|
|
83
|
+
zefiro analyze --skip-scenarios
|
|
84
|
+
zefiro analyze --output custom-qa-map.json
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
| Option | Description |
|
|
88
|
+
|--------|-------------|
|
|
89
|
+
| `[input]` | AST scan file (default: `.qai/zefiro/ast-scan.json`) |
|
|
90
|
+
| `--output <file>` | QA map output (default: `.qai/zefiro/qa-map.json`) |
|
|
91
|
+
| `--skip-scenarios` | Only run feature analysis, skip scenario generation |
|
|
92
|
+
|
|
93
|
+
#### `zefiro push [input]`
|
|
94
|
+
|
|
95
|
+
Push the generated QA map to a remote API.
|
|
96
|
+
|
|
97
|
+
```bash
|
|
98
|
+
zefiro push
|
|
99
|
+
zefiro push custom-qa-map.json
|
|
100
|
+
zefiro push --commit-sha abc1234
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
| Option | Description |
|
|
104
|
+
|--------|-------------|
|
|
105
|
+
| `[input]` | QA map file (default: `.qai/zefiro/qa-map.json`) |
|
|
106
|
+
| `--commit-sha <sha>` | Git commit SHA to associate with the push |
|
|
107
|
+
|
|
108
|
+
Requires `push.apiUrl` and `push.apiKey` in config or via environment variables.
|
|
109
|
+
|
|
110
|
+
## Configuration
|
|
111
|
+
|
|
112
|
+
Configuration lives in `.qai/zefiro/config.ts`:
|
|
113
|
+
|
|
114
|
+
```typescript
|
|
115
|
+
import { defineConfig } from 'zefiro/config';
|
|
116
|
+
|
|
117
|
+
export default defineConfig({
|
|
118
|
+
inputSource: 'jira', // 'none' | 'jira' | 'linear'
|
|
119
|
+
outputTarget: 'markdown', // 'markdown' | 'zephyr' | 'both'
|
|
120
|
+
|
|
121
|
+
llm: {
|
|
122
|
+
provider: 'openai', // 'openai' | 'anthropic'
|
|
123
|
+
model: 'gpt-4o', // Override default model
|
|
124
|
+
agentModels: { // Per-agent overrides
|
|
125
|
+
'feature-analyzer-agent': 'claude-sonnet-4-20250514',
|
|
126
|
+
},
|
|
127
|
+
},
|
|
128
|
+
|
|
129
|
+
scanner: {
|
|
130
|
+
scanDir: 'src',
|
|
131
|
+
include: ['**/*.ts', '**/*.tsx', '**/*.js', '**/*.jsx'],
|
|
132
|
+
exclude: ['**/node_modules/**', '**/dist/**'],
|
|
133
|
+
cacheDir: '.qai/zefiro/scan-cache',
|
|
134
|
+
},
|
|
135
|
+
|
|
136
|
+
push: {
|
|
137
|
+
apiUrl: 'https://your-api.com/qa-map',
|
|
138
|
+
apiKey: 'your-key',
|
|
139
|
+
},
|
|
140
|
+
});
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
## AI Agents
|
|
144
|
+
|
|
145
|
+
Zefiro ships with 3 agents (customizable in `.qai/zefiro/agents/`):
|
|
146
|
+
|
|
147
|
+
| Agent | Purpose |
|
|
148
|
+
|-------|---------|
|
|
149
|
+
| `feature-analyzer-agent` | Identifies features, workflows, and components from AST |
|
|
150
|
+
| `scenario-planner-agent` | Generates test scenarios for each workflow |
|
|
151
|
+
| `scanner-agent` | Interactive agent for manual QA map building (MCP) |
|
|
152
|
+
|
|
153
|
+
## QA Map Output
|
|
154
|
+
|
|
155
|
+
The generated QA map contains:
|
|
156
|
+
|
|
157
|
+
- **Features** — User-facing capabilities grouped by routes
|
|
158
|
+
- **Workflows** — User journeys (navigation, CRUD, multi-step, configuration, search/filter)
|
|
159
|
+
- **Components** — UI elements (forms, modals, navigation, display)
|
|
160
|
+
- **Scenarios** — Test cases with categories (happy-path, validation, error, edge-case, permission)
|
|
161
|
+
|
|
162
|
+
## Project Structure
|
|
163
|
+
|
|
164
|
+
After initialization, zefiro creates:
|
|
165
|
+
|
|
166
|
+
```
|
|
167
|
+
your-project/
|
|
168
|
+
.qai/zefiro/
|
|
169
|
+
config.ts # Configuration
|
|
170
|
+
context.md # Project context for AI agents
|
|
171
|
+
agents/ # Agent prompts (customizable)
|
|
172
|
+
workflow.md # Workflow guide
|
|
173
|
+
ast-scan.json # AST scan output
|
|
174
|
+
qa-map.json # Generated QA map
|
|
175
|
+
scan-cache/ # File-level MD5 cache
|
|
176
|
+
```
|
|
177
|
+
|
|
178
|
+
## License
|
|
179
|
+
|
|
180
|
+
MIT
|