@dk/jolly 0.1.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.
- package/.env.example +3 -0
- package/.mcp.json +7 -0
- package/.sisyphus/boulder.json +13 -0
- package/.sisyphus/notepads/saleor-agent-cli/decisions.md +11 -0
- package/.sisyphus/notepads/saleor-agent-cli/issues.md +6 -0
- package/.sisyphus/notepads/saleor-agent-cli/learnings.md +6 -0
- package/.sisyphus/plans/saleor-agent-cli.md +600 -0
- package/AGENTS.md +46 -0
- package/README.md +121 -0
- package/bun.lock +65 -0
- package/bunfig.toml +8 -0
- package/dist/agent.js +259 -0
- package/dist/bootstrap.js +492 -0
- package/dist/index.js +5798 -0
- package/package.json +29 -0
- package/src/agents/index.ts +1 -0
- package/src/agents/setup.ts +210 -0
- package/src/api/auth.ts +21 -0
- package/src/api/client.ts +78 -0
- package/src/api/endpoints.ts +8 -0
- package/src/api/index.ts +4 -0
- package/src/cli/agent.ts +26 -0
- package/src/cli/bootstrap.ts +24 -0
- package/src/cli/commands/agent.ts +40 -0
- package/src/cli/commands/app.ts +51 -0
- package/src/cli/commands/config.ts +38 -0
- package/src/cli/commands/store.ts +65 -0
- package/src/cli/index.ts +16 -0
- package/src/commands/app.ts +126 -0
- package/src/commands/index.ts +1 -0
- package/src/commands/store.ts +64 -0
- package/src/test/command-handlers.test.ts +227 -0
- package/src/test/e2e-flows.test.ts +212 -0
- package/src/test/entry-points.test.ts +123 -0
- package/src/test/error-handling.test.ts +137 -0
- package/src/test/helpers.ts +49 -0
- package/src/test/index.ts +1 -0
- package/src/test/mocks.ts +132 -0
- package/src/test/setup.ts +29 -0
- package/src/tui/components.ts +77 -0
- package/src/tui/index.ts +3 -0
- package/src/tui/renderer.ts +34 -0
- package/src/tui/theme.ts +38 -0
- package/tsconfig.json +20 -0
package/.env.example
ADDED
package/.mcp.json
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
{
|
|
2
|
+
"active_plan": "/var/home/hands/Work/jolly/.sisyphus/plans/saleor-agent-cli.md",
|
|
3
|
+
"started_at": "2026-04-02T12:03:12.876Z",
|
|
4
|
+
"session_ids": [
|
|
5
|
+
"ses_2b27f2227ffekotd1vwCAlGQKE",
|
|
6
|
+
"ses_2b0878847ffe4HYHHUEZz4sU2v",
|
|
7
|
+
"ses_2b079461affeWdGy097VEA4gGr",
|
|
8
|
+
"ses_2b06fe52cffesH6qKzJwV0pSn1"
|
|
9
|
+
],
|
|
10
|
+
"plan_name": "saleor-agent-cli",
|
|
11
|
+
"agent": "atlas",
|
|
12
|
+
"task_sessions": {}
|
|
13
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
# Decisions - Jolly CLI
|
|
2
|
+
|
|
3
|
+
## Package Structure
|
|
4
|
+
- Single package @saleor/jolly with multiple bin entries
|
|
5
|
+
- Bun runtime, TypeScript throughout
|
|
6
|
+
- OpenTUI for rich terminal output
|
|
7
|
+
|
|
8
|
+
## CLI Architecture
|
|
9
|
+
- yargs for argument parsing
|
|
10
|
+
- Command-based structure (store, app, agent, config)
|
|
11
|
+
- Exit codes: 0 success, 1 error
|
|
@@ -0,0 +1,600 @@
|
|
|
1
|
+
# Jolly - Saleor Project Bootstrapper & Agent Configurator
|
|
2
|
+
|
|
3
|
+
## TL;DR
|
|
4
|
+
|
|
5
|
+
> **Quick Summary**: Jolly bootstraps Saleor projects and configures local AI agents (OpenCode, Claude Code) with Saleor skills, rules, and MCP access — enabling agents to work with Saleor out of the box.
|
|
6
|
+
>
|
|
7
|
+
> **Deliverables**:
|
|
8
|
+
> - `jolly` CLI with `bootstrap` command (creates Cloud + Storefront + Payment App)
|
|
9
|
+
> - `jolly setup-agents` command (configures OpenCode/Claude Code with skills, rules, MCP)
|
|
10
|
+
> - Rich TUI output via OpenTUI
|
|
11
|
+
>
|
|
12
|
+
> **Estimated Effort**: Small
|
|
13
|
+
> **Parallel Execution**: YES - 2 waves
|
|
14
|
+
> **Critical Path**: Project scaffolding → Bootstrap → Agent setup
|
|
15
|
+
|
|
16
|
+
---
|
|
17
|
+
|
|
18
|
+
## Context
|
|
19
|
+
|
|
20
|
+
### Original Request
|
|
21
|
+
Build a CLI for agents to use Saleor, inspired by swamp.club. Should:
|
|
22
|
+
- Install Saleor's agent skills
|
|
23
|
+
- Bootstrap complete new Saleor projects using saleor.io (Saleor Cloud)
|
|
24
|
+
- Be TypeScript with Bun runtime
|
|
25
|
+
|
|
26
|
+
### Clarified Vision
|
|
27
|
+
**Jolly replaces saleor CLI for the agent age**. It enables agents to work with Saleor:
|
|
28
|
+
1. **Project Bootstrapper** - Creates new Saleor projects (Cloud + Storefront + Payment App)
|
|
29
|
+
2. **Agent Configurator** - Sets up local AI agents with Saleor capabilities
|
|
30
|
+
3. **Agent Empowerment** - Agents can do everything they could do with manual CLI **and more**
|
|
31
|
+
|
|
32
|
+
Jolly **provides equivalent functionality** to saleor cli via:
|
|
33
|
+
- Saleor Cloud API (for all project/environment operations)
|
|
34
|
+
- Official saleor-mcp (for agent tool access to store data)
|
|
35
|
+
- saleor/agent-skills (for domain knowledge and best practices)
|
|
36
|
+
|
|
37
|
+
The agent using jolly + saleor-mcp + skills can:
|
|
38
|
+
- Query stores (products, orders, customers)
|
|
39
|
+
- Manage environments
|
|
40
|
+
- Deploy configurations
|
|
41
|
+
- **Plus**: Agent reasoning, automation, and enhanced capabilities
|
|
42
|
+
|
|
43
|
+
### Interview Summary
|
|
44
|
+
**Key Decisions**:
|
|
45
|
+
- **Bootstrap scope**: Saleor Cloud env + paper Storefront + hosted Payment App (Dummy/Stripe)
|
|
46
|
+
- **Agent setup**: Configure OpenCode + Claude Code with skills, rules, MCP
|
|
47
|
+
- **Stack**: Bun runtime, TypeScript, OpenTUI for rich TUI, direct Saleor API calls
|
|
48
|
+
- **Test strategy**: Bun's built-in test runner with BDD-inspired architecture
|
|
49
|
+
|
|
50
|
+
### Research Findings
|
|
51
|
+
- **Saleor Cloud API**: Direct API for creating environments, registering apps
|
|
52
|
+
- **paper Storefront** (`saleor/storefront`): React-based storefront template
|
|
53
|
+
- **Payment Apps**: Hosted on saleor.io - Dummy and Stripe options
|
|
54
|
+
- **Official Saleor MCP** (`mcp.saleor.app`): MCP server with channels, customers, orders, products, stocks
|
|
55
|
+
- **saleor/agent-skills**: Portable skills (saleor-app, saleor-configurator, saleor-core, saleor-storefront)
|
|
56
|
+
- **OpenTUI** (`@opentui/core`): Native Zig TUI core with TypeScript bindings
|
|
57
|
+
|
|
58
|
+
---
|
|
59
|
+
|
|
60
|
+
## Work Objectives
|
|
61
|
+
|
|
62
|
+
### Core Objective
|
|
63
|
+
Build a CLI tool that **creates new Saleor ecosystem components** and configures agents:
|
|
64
|
+
1. **New Stores** - Create Saleor Cloud environments
|
|
65
|
+
2. **New Apps** - Scaffold Saleor apps (Dashboards, Payment, Integrations)
|
|
66
|
+
3. **New Agents** - Configure AI agents to work with Saleor
|
|
67
|
+
4. **Configurator Integration** - Deploy/store configuration as code
|
|
68
|
+
|
|
69
|
+
### Concrete Deliverables
|
|
70
|
+
- `jolly` CLI executable (Bun-based)
|
|
71
|
+
- **Store commands** - Create/manage Saleor Cloud stores
|
|
72
|
+
- **App commands** - Scaffold new Saleor apps (Dashboard extensions, Payment apps, webhooks)
|
|
73
|
+
- **Agent commands** - Configure AI agents with Saleor capabilities
|
|
74
|
+
- **Config commands** - Deploy/configure stores via Configurator
|
|
75
|
+
|
|
76
|
+
### Definition of Done
|
|
77
|
+
- [ ] `jolly store create --name my-store` creates Saleor Cloud store
|
|
78
|
+
- [ ] `jolly app create --name my-app --type dashboard-extension` scaffolds app
|
|
79
|
+
- [ ] `jolly agent setup` configures agent with skills + AGENTS.md + MCP
|
|
80
|
+
- [ ] All commands have proper error handling and exit codes
|
|
81
|
+
- [ ] BDD tests pass for core functionality
|
|
82
|
+
|
|
83
|
+
### Must Have
|
|
84
|
+
- **Store creation**: Create Saleor Cloud environments
|
|
85
|
+
- **App scaffolding**: New Dashboard extensions, Payment apps, webhook integrations
|
|
86
|
+
- **Agent setup**: Configure OpenCode/Claude Code with skills, rules, MCP
|
|
87
|
+
- **Config integration**: Deploy/configure stores via Configurator
|
|
88
|
+
- Rich TUI output via OpenTUI
|
|
89
|
+
|
|
90
|
+
### Must NOT Have (Guardrails)
|
|
91
|
+
- No Saleor CLI wrapping (jolly uses APIs directly, doesn't wrap CLI)
|
|
92
|
+
- No local payment app development (uses hosted apps only)
|
|
93
|
+
- No web UI or dashboard
|
|
94
|
+
- No plugin system in v1
|
|
95
|
+
- No telemetry without consent
|
|
96
|
+
|
|
97
|
+
---
|
|
98
|
+
|
|
99
|
+
## Verification Strategy
|
|
100
|
+
|
|
101
|
+
### Test Decision
|
|
102
|
+
- **Infrastructure exists**: NO - New project
|
|
103
|
+
- **Automated tests**: YES - BDD with Bun test
|
|
104
|
+
- **Framework**: Bun's built-in test runner
|
|
105
|
+
- **Style**: BDD-inspired (describe/it + Given/When/Then helpers)
|
|
106
|
+
|
|
107
|
+
### QA Policy
|
|
108
|
+
Every task includes agent-executed QA scenarios:
|
|
109
|
+
- **CLI**: Use interactive_bash (tmux) to run commands and verify output
|
|
110
|
+
- **API**: Use Bash (curl) for Saleor Cloud API calls
|
|
111
|
+
- **Agent Config**: Verify files created and formatted correctly
|
|
112
|
+
|
|
113
|
+
---
|
|
114
|
+
|
|
115
|
+
## Execution Strategy
|
|
116
|
+
|
|
117
|
+
### npm Distribution Entry Points
|
|
118
|
+
|
|
119
|
+
| Command | Entry | Function |
|
|
120
|
+
|---------|-------|----------|
|
|
121
|
+
| `npx @saleor/jolly` | `jolly` bin | Full CLI (all commands) |
|
|
122
|
+
| `npm create @saleor/jolly` | `create-saleor-jolly` bin | Store bootstrap (interactive) |
|
|
123
|
+
| `npm init @saleor/jolly` | `init-saleor-jolly` bin | Agent setup |
|
|
124
|
+
|
|
125
|
+
### CLI Commands (via `npx @saleor/jolly`)
|
|
126
|
+
|
|
127
|
+
```
|
|
128
|
+
jolly store create --name <name> # Create Saleor Cloud store
|
|
129
|
+
jolly store list # List your stores
|
|
130
|
+
jolly store env create --store <id> # Create environment
|
|
131
|
+
|
|
132
|
+
jolly app create --name <name> --type <type> # Scaffold new app
|
|
133
|
+
# Types: dashboard-extension, payment-app, webhook-handler
|
|
134
|
+
|
|
135
|
+
jolly agent setup # Detect IDE, configure all (skills + AGENTS.md + MCP)
|
|
136
|
+
jolly agent skills install # Install saleor/agent-skills (IDE-aware paths)
|
|
137
|
+
|
|
138
|
+
jolly config deploy --store <id> # Deploy via Configurator
|
|
139
|
+
jolly config introspect --store <id> # Introspect current config
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
### Parallel Execution Waves
|
|
143
|
+
|
|
144
|
+
```
|
|
145
|
+
Wave 1 (Foundation):
|
|
146
|
+
├── Task 1: Project scaffolding + package.json + tsconfig
|
|
147
|
+
├── Task 2: Core CLI structure (OpenTUI + yargs)
|
|
148
|
+
├── Task 3: Saleor Cloud API client
|
|
149
|
+
├── Task 4: OpenTUI components for output
|
|
150
|
+
└── Task 5: BDD test setup
|
|
151
|
+
|
|
152
|
+
Wave 2 (Store & App Commands):
|
|
153
|
+
├── Task 6: Store commands - create/list environments
|
|
154
|
+
├── Task 7: App scaffold command - dashboard extensions
|
|
155
|
+
├── Task 8: App scaffold command - payment apps (hosted)
|
|
156
|
+
├── Task 9: App scaffold command - webhook handlers
|
|
157
|
+
|
|
158
|
+
Wave 3 (Agent Commands):
|
|
159
|
+
├── Task 10: Agent setup command - skills installation
|
|
160
|
+
├── Task 11: Agent setup command - AGENTS.md generation
|
|
161
|
+
├── Task 12: Agent setup command - MCP configuration
|
|
162
|
+
└── Task 13: Integration tests
|
|
163
|
+
|
|
164
|
+
Wave FINAL (Verification):
|
|
165
|
+
├── Task F1: Plan compliance audit
|
|
166
|
+
├── Task F2: Code quality review
|
|
167
|
+
├── Task F3: Real Manual QA
|
|
168
|
+
└── Task F4: Scope fidelity check
|
|
169
|
+
```
|
|
170
|
+
|
|
171
|
+
---
|
|
172
|
+
|
|
173
|
+
## TODOs
|
|
174
|
+
|
|
175
|
+
- [ ] 1. Project scaffolding + package.json + tsconfig
|
|
176
|
+
|
|
177
|
+
**What to do**:
|
|
178
|
+
- Initialize Bun TypeScript project
|
|
179
|
+
- Set up tsconfig.json for CLI build
|
|
180
|
+
- Configure bun build for executable
|
|
181
|
+
- Add dependencies: yargs, @opentui/core, @saleor/configurator
|
|
182
|
+
- Set up package.json with bin entries for npm distribution:
|
|
183
|
+
|
|
184
|
+
```json
|
|
185
|
+
{
|
|
186
|
+
"name": "@saleor/jolly",
|
|
187
|
+
"bin": {
|
|
188
|
+
"jolly": "./dist/cli.js",
|
|
189
|
+
"create-saleor-jolly": "./dist/bootstrap.js",
|
|
190
|
+
"init-saleor-jolly": "./dist/agent.js"
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
```
|
|
194
|
+
|
|
195
|
+
**npm Entry Points**:
|
|
196
|
+
- `npx @saleor/jolly` → `jolly` bin (full CLI)
|
|
197
|
+
- `npm create @saleor/jolly` → `create-saleor-jolly` bin (store bootstrap)
|
|
198
|
+
- `npm init @saleor/jolly` → `init-saleor-jolly` bin (agent setup)
|
|
199
|
+
|
|
200
|
+
**References**:
|
|
201
|
+
- `https://opentui.com` - OpenTUI framework
|
|
202
|
+
- `https://github.com/anomalyco/opentui` - OpenTUI GitHub
|
|
203
|
+
- npm bin naming convention for scoped packages
|
|
204
|
+
|
|
205
|
+
**QA Scenarios**:
|
|
206
|
+
```
|
|
207
|
+
Scenario: Build produces working executable
|
|
208
|
+
Tool: interactive_bash
|
|
209
|
+
Steps:
|
|
210
|
+
1. bun run build
|
|
211
|
+
2. ./dist/jolly.js --version
|
|
212
|
+
Expected: Version string printed
|
|
213
|
+
Evidence: .sisyphus/evidence/task-1-build.{ext}
|
|
214
|
+
|
|
215
|
+
Scenario: CLI help displays correctly
|
|
216
|
+
Tool: interactive_bash
|
|
217
|
+
Steps:
|
|
218
|
+
1. ./dist/jolly.js --help
|
|
219
|
+
Expected: Help text with all commands listed
|
|
220
|
+
Evidence: .sisyphus/evidence/task-1-help.{ext}
|
|
221
|
+
```
|
|
222
|
+
|
|
223
|
+
- [ ] 2. Core CLI structure (OpenTUI + yargs)
|
|
224
|
+
|
|
225
|
+
**What to do**:
|
|
226
|
+
- Set up yargs for argument parsing
|
|
227
|
+
- Integrate OpenTUI renderer for rich output
|
|
228
|
+
- Create base CLI with styled help/version
|
|
229
|
+
- Error handling with styled displays
|
|
230
|
+
- Exit codes (0 success, 1 error)
|
|
231
|
+
|
|
232
|
+
**QA Scenarios**:
|
|
233
|
+
```
|
|
234
|
+
Scenario: CLI returns exit code 0 on success
|
|
235
|
+
Tool: interactive_bash
|
|
236
|
+
Steps:
|
|
237
|
+
1. ./dist/jolly.js --version
|
|
238
|
+
Expected: Exit code 0
|
|
239
|
+
Evidence: .sisyphus/evidence/task-2-exit-success.{ext}
|
|
240
|
+
|
|
241
|
+
Scenario: CLI returns exit code 1 on error
|
|
242
|
+
Tool: interactive_bash
|
|
243
|
+
Steps:
|
|
244
|
+
1. ./dist/jolly.js invalid-command
|
|
245
|
+
Expected: Exit code 1 with error message
|
|
246
|
+
Evidence: .sisyphus/evidence/task-2-exit-error.{ext}
|
|
247
|
+
```
|
|
248
|
+
|
|
249
|
+
- [ ] 3. Saleor Cloud API client
|
|
250
|
+
|
|
251
|
+
**What to do**:
|
|
252
|
+
- Create HTTP client for Saleor Cloud API
|
|
253
|
+
- Auth via SALEOR_CLOUD_TOKEN env var
|
|
254
|
+
- Endpoints: create environment, register app, list apps
|
|
255
|
+
|
|
256
|
+
**References**:
|
|
257
|
+
- Saleor Cloud API docs (saleor.io/cloud)
|
|
258
|
+
- API base URL: https://cloud.saleor.io/api/
|
|
259
|
+
|
|
260
|
+
**QA Scenarios**:
|
|
261
|
+
```
|
|
262
|
+
Scenario: API client handles missing token gracefully
|
|
263
|
+
Tool: interactive_bash
|
|
264
|
+
Steps:
|
|
265
|
+
1. SALEOR_CLOUD_TOKEN="" ./dist/jolly.js store list
|
|
266
|
+
Expected: Error message about missing token, exit code 1
|
|
267
|
+
Evidence: .sisyphus/evidence/task-3-missing-token.{ext}
|
|
268
|
+
|
|
269
|
+
Scenario: API client creates store (mocked)
|
|
270
|
+
Tool: interactive_bash
|
|
271
|
+
Steps:
|
|
272
|
+
1. SALEOR_CLOUD_TOKEN=test-mock ./dist/jolly.js store create --name test
|
|
273
|
+
Expected: Mock response or appropriate error handling
|
|
274
|
+
Evidence: .sisyphus/evidence/task-3-store-create.{ext}
|
|
275
|
+
```
|
|
276
|
+
|
|
277
|
+
- [ ] 4. OpenTUI components for output
|
|
278
|
+
|
|
279
|
+
**What to do**:
|
|
280
|
+
- Create reusable OpenTUI components: Box, Text, Spinner, Progress
|
|
281
|
+
- Style system matching OpenCode aesthetic (dark theme, syntax colors)
|
|
282
|
+
- Consistent formatting for all CLI output
|
|
283
|
+
|
|
284
|
+
**QA Scenarios**:
|
|
285
|
+
```
|
|
286
|
+
Scenario: OpenTUI Text component renders with styling
|
|
287
|
+
Tool: interactive_bash
|
|
288
|
+
Steps:
|
|
289
|
+
1. ./dist/jolly.js --help
|
|
290
|
+
Expected: Styled text output (not plain)
|
|
291
|
+
Evidence: .sisyphus/evidence/task-4-text-output.{ext}
|
|
292
|
+
|
|
293
|
+
Scenario: OpenTUI Spinner shows during operation
|
|
294
|
+
Tool: interactive_bash
|
|
295
|
+
Steps:
|
|
296
|
+
1. ./dist/jolly.js store create --name test # with spinner
|
|
297
|
+
Expected: Spinner animation visible during operation
|
|
298
|
+
Evidence: .sisyphus/evidence/task-4-spinner.{ext}
|
|
299
|
+
```
|
|
300
|
+
|
|
301
|
+
- [ ] 5. BDD test setup
|
|
302
|
+
|
|
303
|
+
**What to do**:
|
|
304
|
+
- Set up Bun test with BDD describe/it
|
|
305
|
+
- Add Given/When/Then helpers
|
|
306
|
+
- Basic CLI structure tests
|
|
307
|
+
|
|
308
|
+
**QA Scenarios**:
|
|
309
|
+
```
|
|
310
|
+
Scenario: BDD tests run successfully
|
|
311
|
+
Tool: interactive_bash
|
|
312
|
+
Steps:
|
|
313
|
+
1. bun test
|
|
314
|
+
Expected: All tests pass (0 failures)
|
|
315
|
+
Evidence: .sisyphus/evidence/task-5-bdd-run.{ext}
|
|
316
|
+
|
|
317
|
+
Scenario: Given/When/Then helpers work
|
|
318
|
+
Tool: interactive_bash
|
|
319
|
+
Steps:
|
|
320
|
+
1. bun test src/test/helpers.test.ts
|
|
321
|
+
Expected: BDD helper tests pass
|
|
322
|
+
Evidence: .sisyphus/evidence/task-5-bdd-helpers.{ext}
|
|
323
|
+
```
|
|
324
|
+
|
|
325
|
+
- [ ] 6. Store commands - create/list environments
|
|
326
|
+
|
|
327
|
+
**What to do**:
|
|
328
|
+
- `jolly store create --name <name>` - Create Saleor Cloud store
|
|
329
|
+
- `jolly store list` - List your stores
|
|
330
|
+
- `jolly store env create` - Create environment
|
|
331
|
+
- Call Saleor Cloud API directly
|
|
332
|
+
|
|
333
|
+
**QA Scenarios**:
|
|
334
|
+
```
|
|
335
|
+
Scenario: store create command creates store (mocked)
|
|
336
|
+
Tool: interactive_bash
|
|
337
|
+
Steps:
|
|
338
|
+
1. SALEOR_CLOUD_TOKEN=test ./dist/jolly.js store create --name test-store
|
|
339
|
+
Expected: Store creation initiated or mock response
|
|
340
|
+
Evidence: .sisyphus/evidence/task-6-store-create.{ext}
|
|
341
|
+
|
|
342
|
+
Scenario: store list command lists stores
|
|
343
|
+
Tool: interactive_bash
|
|
344
|
+
Steps:
|
|
345
|
+
1. SALEOR_CLOUD_TOKEN=test ./dist/jolly.js store list
|
|
346
|
+
Expected: List output (may be empty)
|
|
347
|
+
Evidence: .sisyphus/evidence/task-6-store-list.{ext}
|
|
348
|
+
```
|
|
349
|
+
|
|
350
|
+
- [ ] 7. App scaffold command - Dashboard extensions
|
|
351
|
+
|
|
352
|
+
**What to do**:
|
|
353
|
+
- `jolly app create --name <name> --type dashboard-extension`
|
|
354
|
+
- Scaffold new Dashboard extension app
|
|
355
|
+
- Register with Saleor Cloud
|
|
356
|
+
|
|
357
|
+
**References**:
|
|
358
|
+
- `https://github.com/saleor/saleor-app-sdk` - App SDK
|
|
359
|
+
- Dashboard extension structure: src/pages/add/, useAppBridge()
|
|
360
|
+
|
|
361
|
+
**QA Scenarios**:
|
|
362
|
+
```
|
|
363
|
+
Scenario: app create scaffold dashboard-extension
|
|
364
|
+
Tool: interactive_bash
|
|
365
|
+
Steps:
|
|
366
|
+
1. ./dist/jolly.js app create --name my-dashboard --type dashboard-extension
|
|
367
|
+
Expected: Directory my-dashboard created with dashboard extension template
|
|
368
|
+
Evidence: .sisyphus/evidence/task-7-dashboard-scaffold.{ext}
|
|
369
|
+
|
|
370
|
+
Scenario: app create shows help for missing name
|
|
371
|
+
Tool: interactive_bash
|
|
372
|
+
Steps:
|
|
373
|
+
1. ./dist/jolly.js app create --type dashboard-extension
|
|
374
|
+
Expected: Error about missing required --name flag
|
|
375
|
+
Evidence: .sisyphus/evidence/task-7-missing-name.{ext}
|
|
376
|
+
```
|
|
377
|
+
|
|
378
|
+
- [ ] 8. App scaffold command - Payment apps (hosted)
|
|
379
|
+
|
|
380
|
+
**What to do**:
|
|
381
|
+
- `jolly app create --name <name> --type payment`
|
|
382
|
+
- Options: Dummy Payment App OR Stripe Payment App (hosted on saleor.io)
|
|
383
|
+
- Register hosted payment app with Saleor Cloud
|
|
384
|
+
|
|
385
|
+
**QA Scenarios**:
|
|
386
|
+
```
|
|
387
|
+
Scenario: app create scaffold payment with default (dummy)
|
|
388
|
+
Tool: interactive_bash
|
|
389
|
+
Steps:
|
|
390
|
+
1. ./dist/jolly.js app create --name my-payment --type payment
|
|
391
|
+
Expected: Payment app registered with Dummy (default)
|
|
392
|
+
Evidence: .sisyphus/evidence/task-8-payment-dummy.{ext}
|
|
393
|
+
|
|
394
|
+
Scenario: app create scaffold payment with stripe
|
|
395
|
+
Tool: interactive_bash
|
|
396
|
+
Steps:
|
|
397
|
+
1. ./dist/jolly.js app create --name my-payment --type payment --provider stripe
|
|
398
|
+
Expected: Payment app registered with Stripe
|
|
399
|
+
Evidence: .sisyphus/evidence/task-8-payment-stripe.{ext}
|
|
400
|
+
```
|
|
401
|
+
|
|
402
|
+
- [ ] 9. App scaffold command - Webhook handlers
|
|
403
|
+
|
|
404
|
+
**What to do**:
|
|
405
|
+
- `jolly app create --name <name> --type webhook`
|
|
406
|
+
- Scaffold webhook handler app
|
|
407
|
+
- Register with Saleor Cloud
|
|
408
|
+
|
|
409
|
+
**QA Scenarios**:
|
|
410
|
+
```
|
|
411
|
+
Scenario: app create scaffold webhook
|
|
412
|
+
Tool: interactive_bash
|
|
413
|
+
Steps:
|
|
414
|
+
1. ./dist/jolly.js app create --name my-webhook --type webhook
|
|
415
|
+
Expected: Directory my-webhook created with webhook handler template
|
|
416
|
+
Evidence: .sisyphus/evidence/task-9-webhook-scaffold.{ext}
|
|
417
|
+
|
|
418
|
+
Scenario: webhook app has correct structure
|
|
419
|
+
Tool: interactive_bash
|
|
420
|
+
Steps:
|
|
421
|
+
1. ./dist/jolly.js app create --name test-webhook --type webhook
|
|
422
|
+
2. ls test-webhook/src/webhooks/
|
|
423
|
+
Expected: Webhook handler files present
|
|
424
|
+
Evidence: .sisyphus/evidence/task-9-webhook-structure.{ext}
|
|
425
|
+
```
|
|
426
|
+
|
|
427
|
+
- [ ] 10. Agent setup - Skills installation (IDE-aware)
|
|
428
|
+
|
|
429
|
+
**What to do**:
|
|
430
|
+
- `jolly agent skills install`
|
|
431
|
+
- Follow agentskills.io best practices for skill structure
|
|
432
|
+
- Detect available agents: OpenCode, Claude Code, OpenClaw, Nanobot
|
|
433
|
+
- Use agent-specific skill paths:
|
|
434
|
+
- OpenCode: `.agents/skills/` (default)
|
|
435
|
+
- Claude Code: `.claude/skills/` or `~/.claude/skills/`
|
|
436
|
+
- OpenClaw: `.openclaw/skills/`
|
|
437
|
+
- Nanobot: `.nanobot/skills/`
|
|
438
|
+
- Install skills: saleor-app, saleor-configurator, saleor-core, saleor-storefront
|
|
439
|
+
|
|
440
|
+
**References**:
|
|
441
|
+
- `https://github.com/saleor/agent-skills`
|
|
442
|
+
- `https://agentskills.io` - Agent Skills Specification
|
|
443
|
+
- Skill format: SKILL.md + AGENTS.md + rules/ + references/
|
|
444
|
+
|
|
445
|
+
**QA Scenarios**:
|
|
446
|
+
```
|
|
447
|
+
Scenario: skills install creates correct directory structure
|
|
448
|
+
Tool: interactive_bash
|
|
449
|
+
Steps:
|
|
450
|
+
1. ./dist/jolly.js agent skills install
|
|
451
|
+
Expected: .agents/skills/ directory with saleor-* skills
|
|
452
|
+
Evidence: .sisyphus/evidence/task-10-skills-structure.{ext}
|
|
453
|
+
|
|
454
|
+
Scenario: skills have correct format (SKILL.md, AGENTS.md)
|
|
455
|
+
Tool: interactive_bash
|
|
456
|
+
Steps:
|
|
457
|
+
1. ./dist/jolly.js agent skills install
|
|
458
|
+
2. ls .agents/skills/saleor-app/
|
|
459
|
+
Expected: SKILL.md and AGENTS.md files present
|
|
460
|
+
Evidence: .sisyphus/evidence/task-10-skills-format.{ext}
|
|
461
|
+
```
|
|
462
|
+
|
|
463
|
+
- [ ] 11. Agent setup - AGENTS.md + IDE detection
|
|
464
|
+
|
|
465
|
+
**What to do**:
|
|
466
|
+
- `jolly agent setup` (combined command)
|
|
467
|
+
- Detect IDEs/agents present: OpenCode, Claude Code, OpenClaw, Nanobot
|
|
468
|
+
- Generate AGENTS.md with Saleor conventions (IDE-aware)
|
|
469
|
+
- Include build/lint/test commands
|
|
470
|
+
- Create appropriate skill directory structure for each agent
|
|
471
|
+
|
|
472
|
+
**Supported Agents**:
|
|
473
|
+
- OpenCode: `.agents/skills/`
|
|
474
|
+
- Claude Code: `.claude/skills/` or `~/.claude/skills/`
|
|
475
|
+
- OpenClaw: `.openclaw/skills/`
|
|
476
|
+
- Nanobot: `.nanobot/skills/`
|
|
477
|
+
|
|
478
|
+
**QA Scenarios**:
|
|
479
|
+
```
|
|
480
|
+
Scenario: agent setup creates AGENTS.md
|
|
481
|
+
Tool: interactive_bash
|
|
482
|
+
Steps:
|
|
483
|
+
1. ./dist/jolly.js agent setup
|
|
484
|
+
Expected: AGENTS.md created in current directory
|
|
485
|
+
Evidence: .sisyphus/evidence/task-11-agents-md.{ext}
|
|
486
|
+
|
|
487
|
+
Scenario: AGENTS.md contains Saleor-specific commands
|
|
488
|
+
Tool: interactive_bash
|
|
489
|
+
Steps:
|
|
490
|
+
1. ./dist/jolly.js agent setup
|
|
491
|
+
2. grep -i "saleor" AGENTS.md
|
|
492
|
+
Expected: Saleor commands and conventions present
|
|
493
|
+
Evidence: .sisyphus/evidence/task-11-agents-content.{ext}
|
|
494
|
+
```
|
|
495
|
+
|
|
496
|
+
- [ ] 12. Agent setup - MCP configuration (IDE-aware)
|
|
497
|
+
|
|
498
|
+
**What to do**:
|
|
499
|
+
- Detect IDE and create appropriate MCP config:
|
|
500
|
+
- OpenCode: `.mcp.json` in project root
|
|
501
|
+
- Claude Code: `.mcp.json` in project root (compatible)
|
|
502
|
+
- Configure saleor-mcp server
|
|
503
|
+
- Point to https://mcp.saleor.app
|
|
504
|
+
|
|
505
|
+
**References**:
|
|
506
|
+
- `https://mcp.saleor.app`
|
|
507
|
+
- MCP config format: { "mcpServers": { "saleor": { "command": "...", "url": "..." } } }
|
|
508
|
+
|
|
509
|
+
**QA Scenarios**:
|
|
510
|
+
```
|
|
511
|
+
Scenario: agent setup creates .mcp.json with saleor-mcp
|
|
512
|
+
Tool: interactive_bash
|
|
513
|
+
Steps:
|
|
514
|
+
1. ./dist/jolly.js agent setup
|
|
515
|
+
Expected: .mcp.json created with saleor-mcp server config
|
|
516
|
+
Evidence: .sisyphus/evidence/task-12-mcp-config.{ext}
|
|
517
|
+
|
|
518
|
+
Scenario: .mcp.json points to correct saleor-mcp URL
|
|
519
|
+
Tool: interactive_bash
|
|
520
|
+
Steps:
|
|
521
|
+
1. ./dist/jolly.js agent setup
|
|
522
|
+
2. cat .mcp.json | grep mcp.saleor.app
|
|
523
|
+
Expected: URL https://mcp.saleor.app present
|
|
524
|
+
Evidence: .sisyphus/evidence/task-12-mcp-url.{ext}
|
|
525
|
+
```
|
|
526
|
+
|
|
527
|
+
- [ ] 13. Integration tests
|
|
528
|
+
|
|
529
|
+
**What to do**:
|
|
530
|
+
- Test store creation flow (mocked API)
|
|
531
|
+
- Test app scaffold flow
|
|
532
|
+
- Test agent setup flow
|
|
533
|
+
- Test error handling
|
|
534
|
+
|
|
535
|
+
**QA Scenarios**:
|
|
536
|
+
```
|
|
537
|
+
Scenario: Full integration test suite passes
|
|
538
|
+
Tool: interactive_bash
|
|
539
|
+
Steps:
|
|
540
|
+
1. bun test
|
|
541
|
+
Expected: All integration tests pass
|
|
542
|
+
Evidence: .sisyphus/evidence/task-13-integration.{ext}
|
|
543
|
+
|
|
544
|
+
Scenario: Error handling tests cover edge cases
|
|
545
|
+
Tool: interactive_bash
|
|
546
|
+
Steps:
|
|
547
|
+
1. bun test src/test/error-handling.test.ts
|
|
548
|
+
Expected: Error tests pass
|
|
549
|
+
Evidence: .sisyphus/evidence/task-13-errors.{ext}
|
|
550
|
+
```
|
|
551
|
+
|
|
552
|
+
---
|
|
553
|
+
|
|
554
|
+
## Final Verification Wave
|
|
555
|
+
|
|
556
|
+
- [ ] F1. **Plan Compliance Audit** — `oracle`
|
|
557
|
+
- [ ] F2. **Code Quality Review** — `unspecified-high`
|
|
558
|
+
- [ ] F3. **Real Manual QA** — `unspecified-high`
|
|
559
|
+
- [ ] F4. **Scope Fidelity Check** — `deep`
|
|
560
|
+
|
|
561
|
+
---
|
|
562
|
+
|
|
563
|
+
## Commit Strategy
|
|
564
|
+
|
|
565
|
+
- **1**: `init: project scaffolding` — package.json (with bin entries), tsconfig, src/
|
|
566
|
+
- **2**: `feat: CLI structure` — OpenTUI + yargs setup
|
|
567
|
+
- **3**: `feat: Saleor API client` — Cloud API integration
|
|
568
|
+
- **4**: `feat: OpenTUI components` — Rich output components
|
|
569
|
+
- **5**: `feat: bootstrap command` — Store bootstrap command
|
|
570
|
+
- **6**: `feat: agent setup command` — Agent setup command
|
|
571
|
+
- **7**: `feat: app commands` — Dashboard/payment/webhook scaffold
|
|
572
|
+
- **8**: `test: BDD + integration` — Tests
|
|
573
|
+
|
|
574
|
+
---
|
|
575
|
+
|
|
576
|
+
## Success Criteria
|
|
577
|
+
|
|
578
|
+
### Verification Commands
|
|
579
|
+
```bash
|
|
580
|
+
# Build
|
|
581
|
+
bun run build
|
|
582
|
+
|
|
583
|
+
# Full CLI via npx
|
|
584
|
+
./dist/jolly.js --help
|
|
585
|
+
|
|
586
|
+
# npm create entry point (store bootstrap)
|
|
587
|
+
./dist/create-saleor-jolly.js --help
|
|
588
|
+
|
|
589
|
+
# npm init entry point (agent setup)
|
|
590
|
+
./dist/init-saleor-jolly.js --help
|
|
591
|
+
|
|
592
|
+
# Run tests
|
|
593
|
+
bun test
|
|
594
|
+
```
|
|
595
|
+
|
|
596
|
+
### Final Checklist
|
|
597
|
+
- [ ] All "Must Have" present
|
|
598
|
+
- [ ] All "Must NOT Have" absent
|
|
599
|
+
- [ ] All tests pass
|
|
600
|
+
- [ ] CLI produces working executable
|
package/AGENTS.md
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
# Saleor Development Guide
|
|
2
|
+
|
|
3
|
+
This project uses Saleor e-commerce platform.
|
|
4
|
+
|
|
5
|
+
## Commands
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
# Development
|
|
9
|
+
npm run dev
|
|
10
|
+
|
|
11
|
+
# Build
|
|
12
|
+
npm run build
|
|
13
|
+
|
|
14
|
+
# Test
|
|
15
|
+
npm run test
|
|
16
|
+
|
|
17
|
+
# Lint
|
|
18
|
+
npm run lint
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
## Saleor Cloud
|
|
22
|
+
|
|
23
|
+
- Dashboard: https://cloud.saleor.io
|
|
24
|
+
- Documentation: https://docs.saleor.io
|
|
25
|
+
- API Reference: https://docs.saleor.io/api
|
|
26
|
+
|
|
27
|
+
## Saleor Skills
|
|
28
|
+
|
|
29
|
+
This project includes Saleor agent skills:
|
|
30
|
+
- saleor-app: App development patterns
|
|
31
|
+
- saleor-configurator: Config as code
|
|
32
|
+
- saleor-core: Backend internals
|
|
33
|
+
- saleor-storefront: Storefront patterns
|
|
34
|
+
|
|
35
|
+
## MCP Server
|
|
36
|
+
|
|
37
|
+
Configure saleor-mcp for AI agent capabilities:
|
|
38
|
+
```json
|
|
39
|
+
{
|
|
40
|
+
"mcpServers": {
|
|
41
|
+
"saleor": {
|
|
42
|
+
"url": "https://mcp.saleor.app"
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
```
|