shopify-agentic-dev-workflow 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.
Files changed (44) hide show
  1. package/.cursor/rules/shopify-agentic-dev.mdc +290 -0
  2. package/AGENTS.md +285 -0
  3. package/CHANGELOG.md +14 -0
  4. package/CLAUDE.md +285 -0
  5. package/GEMINI.md +285 -0
  6. package/HANDOFF.md +351 -0
  7. package/LICENSE +21 -0
  8. package/README.md +370 -0
  9. package/bin/shopify-agent.js +2786 -0
  10. package/docs/00-prerequisites.md +88 -0
  11. package/docs/01-onboarding.md +111 -0
  12. package/docs/02-theme-sdlc.md +106 -0
  13. package/docs/03-app-sdlc.md +66 -0
  14. package/docs/04-admin-api-ops.md +58 -0
  15. package/docs/05-codex-prompts.md +37 -0
  16. package/docs/06-security-guardrails.md +47 -0
  17. package/docs/07-github-rollout.md +30 -0
  18. package/docs/08-product-design.md +168 -0
  19. package/docs/09-shopify-cli-4-capabilities.md +48 -0
  20. package/docs/10-field-learnings.md +66 -0
  21. package/package.json +82 -0
  22. package/scripts/bootstrap.sh +35 -0
  23. package/scripts/validate-graphql.js +303 -0
  24. package/templates/.env.example +20 -0
  25. package/templates/codex-config.toml +3 -0
  26. package/templates/github-actions/deploy-theme.yml +32 -0
  27. package/templates/graphql/content/pages-list.graphql +12 -0
  28. package/templates/graphql/content/redirects-list.graphql +9 -0
  29. package/templates/graphql/customers/new-customers.graphql +15 -0
  30. package/templates/graphql/customers/top-spenders.graphql +16 -0
  31. package/templates/graphql/discounts/active-discounts.graphql +27 -0
  32. package/templates/graphql/discounts-list.graphql +40 -0
  33. package/templates/graphql/inventory-audit.graphql +38 -0
  34. package/templates/graphql/metafields/product-metafields.graphql +14 -0
  35. package/templates/graphql/orders/list-open.graphql +30 -0
  36. package/templates/graphql/orders/revenue-summary.graphql +15 -0
  37. package/templates/graphql/products/list.graphql +16 -0
  38. package/templates/graphql/products/low-inventory.graphql +18 -0
  39. package/templates/graphql/products-seo-audit.graphql +14 -0
  40. package/templates/graphql/shop-query.graphql +9 -0
  41. package/templates/graphql/store/full-info.graphql +23 -0
  42. package/templates/graphql/store/webhooks.graphql +16 -0
  43. package/templates/prompts/admin-operation.md +12 -0
  44. package/templates/prompts/theme-task.md +19 -0
package/README.md ADDED
@@ -0,0 +1,370 @@
1
+ # shopify-agentic-dev-workflow
2
+
3
+ A terminal-first agentic toolkit for Shopify stores. One command connects your store, sets up your local workspace, configures your AI coding agent, and gives your entire team — developers, catalogers, marketers, and business admins — a full CLI to operate Shopify without living in the Admin panel.
4
+
5
+ Works with **Codex, Claude Code, Cursor, and Gemini**. Shopify CLI 4.x runs under the hood.
6
+
7
+ ## Quick start
8
+
9
+ ```bash
10
+ # Install globally from npm
11
+ npm install -g shopify-agentic-dev-workflow
12
+
13
+ # In your project folder
14
+ shopify-agent init # connect store, configure auth, select theme, write guardrails
15
+ shopify-agent doctor # verify all tools and show active config
16
+ shopify-agent dashboard # snapshot of open orders, low stock, active discounts
17
+ ```
18
+
19
+ ## Who this is for
20
+
21
+ | Role | What they can do |
22
+ |---|---|
23
+ | **Developers** | Theme dev (hot-reload, lint, push, publish), app dev, raw GraphQL |
24
+ | **Catalogers** | Manage products, variants, collections, inventory |
25
+ | **Marketing teams** | Discount codes, gift cards, pages, blog articles, redirects, metafields |
26
+ | **Business admins** | Orders, customers, store info, dashboard |
27
+
28
+ All of it from the terminal. All mutations prompt for confirmation before touching live data.
29
+
30
+ ## What still needs Shopify Admin
31
+
32
+ - Add collaborator or staff access
33
+ - Create or install a custom app and approve OAuth scopes
34
+ - Connect GitHub theme sync
35
+ - Theme editor UI (drag-and-drop sections)
36
+
37
+ ---
38
+
39
+ ## Commands
40
+
41
+ ### Setup & diagnostics
42
+
43
+ ```bash
44
+ shopify-agent init # Full interactive setup wizard
45
+ shopify-agent doctor # Check tools, show active config + install hints
46
+ shopify-agent capabilities # Detect which Shopify CLI 4.x commands are available
47
+ shopify-agent auth # shopify auth login
48
+
49
+ shopify-agent agents:install # Write AGENTS.md / CLAUDE.md / Cursor rules / GEMINI.md
50
+ shopify-agent mcp:install # Add Shopify Dev MCP to ~/.codex/config.toml
51
+
52
+ shopify-agent profile:list # List saved profiles
53
+ shopify-agent profile:use # Switch active profile
54
+
55
+ shopify-agent store:list # Show Shopify orgs linked to your account
56
+ shopify-agent store:auth # Create Admin API token with selected scopes (CLI 4.x)
57
+ ```
58
+
59
+ ### Theme development
60
+
61
+ ```bash
62
+ shopify-agent theme:list # List themes with roles
63
+ shopify-agent theme:select # Pick active theme (live ⚠ warning included)
64
+ shopify-agent theme:pull # Download theme files locally
65
+ shopify-agent theme:dev # Hot-reload dev server — opens browser automatically
66
+ shopify-agent theme:check # Liquid linting via Theme Check
67
+ shopify-agent theme:push # Push to staging (3-option guard if theme is live)
68
+ shopify-agent theme:publish # Prompts for confirmation before going live
69
+ ```
70
+
71
+ ### App development
72
+
73
+ ```bash
74
+ shopify-agent app:dev # shopify app dev
75
+ shopify-agent app:deploy # shopify app deploy
76
+ ```
77
+
78
+ ### Raw GraphQL
79
+
80
+ ```bash
81
+ shopify-agent admin:query <file.graphql> # Read-only Admin GraphQL
82
+ shopify-agent admin:mutate <file.graphql> # Mutation (prompts for confirmation)
83
+ ```
84
+
85
+ ---
86
+
87
+ ### 📦 Products & Catalog
88
+
89
+ ```bash
90
+ shopify-agent products:list # List products [--status active|draft|archived] [--limit N]
91
+ shopify-agent products:get # Interactive full product detail viewer
92
+ shopify-agent products:create # Wizard: title, type, vendor, price, SKU, inventory, status
93
+ shopify-agent products:publish # Set a product to Active (visible in store)
94
+ shopify-agent products:archive # Set a product to Archived
95
+ shopify-agent products:draft # Set a product back to Draft
96
+ shopify-agent products:delete # Delete a product (with confirmation)
97
+
98
+ shopify-agent variants:list # Pick a product → see all variants with price/SKU/qty
99
+ shopify-agent variants:update # Update price, SKU, barcode for a variant
100
+
101
+ shopify-agent collections:list # List all collections (manual + smart)
102
+ shopify-agent collections:create # Wizard: manual or smart (with rule builder)
103
+ ```
104
+
105
+ ### 🏷️ Inventory
106
+
107
+ ```bash
108
+ shopify-agent inventory:list # List all inventory levels across locations
109
+ shopify-agent inventory:set <qty> # Set ALL variants to <qty> in bulk
110
+ shopify-agent inventory:adjust # Adjust one variant: +5, -3, or =10
111
+ ```
112
+
113
+ ### 📋 Orders
114
+
115
+ ```bash
116
+ shopify-agent orders:list # List orders [--status open|closed|cancelled|any] [--limit N]
117
+ shopify-agent orders:get # Full order detail: line items, tracking, totals
118
+ shopify-agent orders:cancel # Cancel an open order (choose reason, refund, restock)
119
+ shopify-agent orders:close # Mark an order as closed
120
+ ```
121
+
122
+ ### 👥 Customers
123
+
124
+ ```bash
125
+ shopify-agent customers:list # List customers [--limit N]
126
+ shopify-agent customers:search # Search by name, email, phone, or tag
127
+ shopify-agent customers:get # Full customer profile + recent order history
128
+ shopify-agent customers:create # Wizard: name, email, phone, tags, marketing opt-in
129
+ shopify-agent customers:tags # Add or remove tags on a customer
130
+ ```
131
+
132
+ ### 🎟️ Discounts & Gift Cards
133
+
134
+ ```bash
135
+ shopify-agent discounts:list # List all discount codes with usage stats
136
+ shopify-agent discounts:create # Wizard: % off, fixed amount, per-customer, expiry, usage limit
137
+ shopify-agent discounts:delete # Delete a discount code
138
+ shopify-agent discounts:enable # Re-activate a disabled discount
139
+ shopify-agent discounts:disable # Deactivate without deleting
140
+
141
+ shopify-agent gift-cards:list # List all gift cards with balance
142
+ shopify-agent gift-cards:create # Create a gift card (with optional customer assignment)
143
+ ```
144
+
145
+ ### 🏪 Store
146
+
147
+ ```bash
148
+ shopify-agent store:info # Name, plan, currency, timezone, multi-currency
149
+ shopify-agent store:locations # List locations with fulfillment status
150
+ shopify-agent store:dashboard # Snapshot: open orders + low-stock + active discounts
151
+ shopify-agent dashboard # Alias for store:dashboard
152
+ ```
153
+
154
+ ### 📝 Content
155
+
156
+ ```bash
157
+ shopify-agent pages:list # List all pages
158
+ shopify-agent pages:create # Wizard: title, body HTML, publish immediately
159
+ shopify-agent blogs:list # List blogs with 5 recent articles each
160
+ shopify-agent articles:list # Pick a blog → list articles with author + status
161
+ shopify-agent redirects:list # List all URL redirects
162
+ shopify-agent redirects:create # Create a URL redirect (from → to)
163
+ ```
164
+
165
+ ### 🔧 Metafields
166
+
167
+ ```bash
168
+ shopify-agent metafields:list # List metafields for any resource
169
+ shopify-agent metafields:set # Create or update a metafield on any resource
170
+ # Works with: Product, Collection, Customer, Order, Shop
171
+ ```
172
+
173
+ ---
174
+
175
+ ## Flags
176
+
177
+ ```bash
178
+ --yes, -y Auto-confirm all prompts (for scripting / CI)
179
+ --status <s> Filter by status where supported
180
+ --limit <n> Limit result count where supported
181
+ ```
182
+
183
+ Examples:
184
+ ```bash
185
+ shopify-agent products:list --status active --limit 100
186
+ shopify-agent orders:list --status open
187
+ shopify-agent inventory:set 10 --yes
188
+ shopify-agent discounts:list
189
+ ```
190
+
191
+ ---
192
+
193
+ ## GraphQL template files
194
+
195
+ Pre-built query/mutation files in `templates/graphql/` for use with `admin:query` and `admin:mutate`:
196
+
197
+ ```
198
+ templates/graphql/
199
+ products/
200
+ list.graphql Active products with variants and pricing
201
+ low-inventory.graphql Products with < 5 units (restocking alert)
202
+ orders/
203
+ list-open.graphql Open orders with line items + tracking
204
+ revenue-summary.graphql Paid orders with totals for a date range
205
+ customers/
206
+ top-spenders.graphql Customers ranked by total spend
207
+ new-customers.graphql Customers created in the last 30 days
208
+ discounts/
209
+ active-discounts.graphql Active discount codes with usage counts
210
+ store/
211
+ full-info.graphql Complete shop info + locations
212
+ webhooks.graphql All registered webhook subscriptions
213
+ content/
214
+ pages-list.graphql All pages with SEO fields
215
+ redirects-list.graphql All URL redirects
216
+ metafields/
217
+ product-metafields.graphql Metafields for a specific product (edit GID)
218
+ shop-query.graphql Shop name + domain
219
+ inventory-audit.graphql Inventory levels across all locations
220
+ discounts-list.graphql All discount codes
221
+ products-seo-audit.graphql Products with SEO title/description gaps
222
+ ```
223
+
224
+ ---
225
+
226
+ ## Live theme safety
227
+
228
+ Every operation that touches a live theme requires explicit confirmation. `theme:push` on a live theme shows:
229
+
230
+ ```
231
+ 1. Push to a NEW staging theme (safe — preview before publishing) [RECOMMENDED]
232
+ 2. Push directly to LIVE theme (type store domain to confirm)
233
+ 3. Cancel
234
+ ```
235
+
236
+ `theme:publish` shows the theme name, store domain, and consequences before asking.
237
+
238
+ The AI guardrail files installed by `agents:install` enforce the same rules inside Codex/Claude/Cursor/Gemini.
239
+
240
+ ---
241
+
242
+ ## Theme dev workflow
243
+
244
+ ```bash
245
+ # One-time setup per project
246
+ shopify-agent init # connect store, select unpublished theme
247
+ shopify-agent theme:pull # download theme files to themes/<theme-name>-<theme-id>/
248
+
249
+ # Daily loop
250
+ shopify-agent theme:dev # hot-reload server, browser opens automatically
251
+ # edit sections/*.liquid, assets/*.css, etc.
252
+ shopify-agent theme:check # lint after changes
253
+ shopify-agent theme:push # push to unpublished staging theme
254
+ # preview in Shopify Admin → Themes → Preview
255
+
256
+ shopify-agent theme:publish # prompts for confirmation — go live after review
257
+ ```
258
+
259
+ ### Theme folders and Git guardrails
260
+
261
+ The CLI keeps each Shopify theme isolated under `themes/<theme-name>-<theme-id>/` and writes `.shopify-theme.json` metadata inside that folder. This prevents a developer from pulling Theme A over Theme B or dumping theme files into the project root.
262
+
263
+ `theme:pull`, `theme:push`, and `theme:publish` require a clean Git worktree. Commit after every pull and before every push so every Shopify operation has a visible rollback point.
264
+
265
+ ### Figma-to-Dawn workflow
266
+
267
+ When building a storefront from Figma, treat design fidelity and live Shopify data as two separate concerns:
268
+
269
+ - Map Figma frames to real Dawn sections and templates: home, collection, product, cart, header, and footer.
270
+ - Use section schema settings for merchant-editable content.
271
+ - Keep design-preview fallback content until the real catalog is ready; demo store products can make a correct layout look broken.
272
+ - Add explicit toggles such as `Use live collection products` and `Use live product data` before letting Shopify catalog data override Figma visuals.
273
+ - Verify with `shopify-agent theme:check` and desktop/mobile preview screenshots for home, PLP, PDP, header, footer, links, and horizontal overflow.
274
+
275
+ ---
276
+
277
+ ## Configuration
278
+
279
+ `init` creates two local files (both git-ignored):
280
+
281
+ | File | Contents |
282
+ |---|---|
283
+ | `.env` | 7 managed `SHOPIFY_*` keys — user-added keys are never overwritten |
284
+ | `.shopify-agent/profiles/<name>.json` | Store domain, theme ID/name/role, token, app config, API version |
285
+
286
+ Key `.env` values:
287
+
288
+ ```
289
+ SHOPIFY_STORE=your-store.myshopify.com
290
+ SHOPIFY_CLI_THEME_TOKEN= # Theme Access token (optional; blank = Shopify CLI session)
291
+ SHOPIFY_THEME_ID= # Active staging theme ID
292
+ SHOPIFY_API_VERSION=2026-04
293
+ ```
294
+
295
+ ## Auth model
296
+
297
+ | Method | How | Best for |
298
+ |---|---|---|
299
+ | Shopify CLI session | `shopify auth login` (browser OAuth) | Local dev with Partners/staff access |
300
+ | Theme Access token | Password from Theme Access app | Theme-only work, CI, agencies |
301
+
302
+ The toolkit never reads or copies Shopify CLI's internal session tokens.
303
+
304
+ ## Requirements
305
+
306
+ - Node.js 18+ (checked at startup — error includes install URL)
307
+ - Shopify CLI 4.x (`npm install -g @shopify/cli@latest`)
308
+ - Git
309
+
310
+ Optional:
311
+ - GitHub CLI (`gh`) for repo/PR workflow
312
+ - Codex, Claude Code, Cursor, or Gemini for AI-assisted development
313
+
314
+ ## Install guides
315
+
316
+ - macOS: `brew install node && npm install -g @shopify/cli@latest`
317
+ - Windows/Linux: see [docs/00-prerequisites.md](docs/00-prerequisites.md)
318
+
319
+ ## Publishing to npm
320
+
321
+ The public npm package name is currently intended to be:
322
+
323
+ ```bash
324
+ shopify-agentic-dev-workflow
325
+ ```
326
+
327
+ Release checklist:
328
+
329
+ ```bash
330
+ npm login
331
+ npm test
332
+ npm pack --dry-run
333
+ npm publish
334
+ ```
335
+
336
+ After publishing, users can install it with:
337
+
338
+ ```bash
339
+ npm install -g shopify-agentic-dev-workflow
340
+ shopify-agent init
341
+ ```
342
+
343
+ ## Repository layout
344
+
345
+ ```
346
+ bin/shopify-agent.js CLI entrypoint — all 60+ commands, single file, no deps
347
+ docs/ Onboarding, SDLC, security, product design notes
348
+ scripts/bootstrap.sh Local dev bootstrap helper
349
+ templates/
350
+ .env.example
351
+ codex-config.toml
352
+ github-actions/deploy-theme.yml
353
+ graphql/ Pre-built GraphQL query + mutation files by category
354
+ prompts/ Reusable agent task prompts
355
+ HANDOFF.md Full technical handoff for agents and new contributors
356
+ ```
357
+
358
+ ## Security defaults
359
+
360
+ - Secrets are never committed — `.env` and `.shopify-agent/` are git-ignored
361
+ - All mutation commands prompt for confirmation before modifying live store data
362
+ - `theme:publish` shows consequences and asks before going live
363
+ - Live `theme:push` requires typing the store domain
364
+ - `--yes` / `-y` flag bypasses prompts — only for scripts where user has already reviewed
365
+ - Agent guardrail files enforce all rules inside Codex/Claude/Cursor/Gemini
366
+
367
+ ## For the team
368
+
369
+ See [HANDOFF.md](HANDOFF.md) for full architecture, all design decisions, and implementation details.
370
+ See [docs/10-field-learnings.md](docs/10-field-learnings.md) for lessons from a full store connection, theme pull, Figma build, and local QA session.