@curenorway/kode-cli 1.5.0 → 1.5.1

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.
@@ -672,6 +672,92 @@ Use both MCPs together for powerful workflows:
672
672
  2. Use **cure-kode MCP** to add custom JavaScript behavior to those pages
673
673
  3. Deploy scripts with \`kode_deploy\`, then verify in Webflow Designer
674
674
 
675
+ ## \u{1F9E0} Smart Workflow Guide
676
+
677
+ **IMPORTANT**: Before writing ANY JavaScript, always gather context first. Follow this decision tree:
678
+
679
+ ### Step 1: Understand the Task
680
+
681
+ | Task Type | First Action |
682
+ |-----------|--------------|
683
+ | JS for CMS items (blog posts, products, etc.) | Use Webflow MCP \u2192 \`collections_list\`, \`collection_items\` to understand schema |
684
+ | JS for page interactions (modals, tabs, etc.) | Use Cure Kode MCP \u2192 \`kode_fetch_html_smart\` or \`kode_get_page_context\` |
685
+ | JS for forms | Use Webflow MCP \u2192 get form structure, then Cure Kode for custom validation |
686
+ | JS for navigation/menus | Use Webflow MCP \u2192 \`pages_list\` to get site structure |
687
+ | JS for dynamic content | Check BOTH - Webflow for data structure, Cure Kode for existing scripts |
688
+
689
+ ### Step 2: Discovery Workflow
690
+
691
+ \`\`\`
692
+ 1. DISCOVER: What elements/data am I working with?
693
+ - Webflow MCP: Site structure, CMS schemas, page list
694
+ - Cure Kode MCP: kode_get_page_context for CSS selectors and DOM structure
695
+
696
+ 2. CHECK: Are there existing scripts that do something similar?
697
+ - Cure Kode MCP: kode_list_scripts, kode_get_script
698
+
699
+ 3. PLAN: What selectors/APIs will my script need?
700
+ - Document in context.md using kode_update_context
701
+
702
+ 4. IMPLEMENT: Write the JavaScript
703
+ - Use kode_create_script or kode_update_script
704
+
705
+ 5. DEPLOY: Test on staging first
706
+ - kode_deploy (staging), verify, then kode_promote (production)
707
+ \`\`\`
708
+
709
+ ### Step 3: Common Patterns
710
+
711
+ **Pattern A: CMS-dependent JavaScript**
712
+ \`\`\`
713
+ User: "Add filtering to the blog posts"
714
+
715
+ AI Workflow:
716
+ 1. Webflow MCP \u2192 collections_list \u2192 find "Blog Posts" collection
717
+ 2. Webflow MCP \u2192 collection_get \u2192 understand fields (category, tags, date)
718
+ 3. Cure Kode MCP \u2192 kode_get_page_context("/blog") \u2192 get CSS selectors for blog items
719
+ 4. Write JS that uses the discovered selectors and field names
720
+ 5. Deploy to staging, test, promote
721
+ \`\`\`
722
+
723
+ **Pattern B: Interactive Component**
724
+ \`\`\`
725
+ User: "Add an accordion to the FAQ section"
726
+
727
+ AI Workflow:
728
+ 1. Cure Kode MCP \u2192 kode_get_page_context("/faq") \u2192 find FAQ section structure
729
+ 2. Check: Is it CMS-powered? If yes \u2192 Webflow MCP for collection schema
730
+ 3. Write JS using the exact CSS selectors from page context
731
+ 4. Deploy and test
732
+ \`\`\`
733
+
734
+ **Pattern C: Site-wide Feature**
735
+ \`\`\`
736
+ User: "Add a cookie consent banner"
737
+
738
+ AI Workflow:
739
+ 1. Cure Kode MCP \u2192 kode_list_scripts \u2192 check for existing consent scripts
740
+ 2. Create as GLOBAL script with autoLoad: true
741
+ 3. No page-specific context needed - runs on all pages
742
+ 4. Deploy to staging, verify on multiple pages, promote
743
+ \`\`\`
744
+
745
+ ### Key Principles
746
+
747
+ 1. **Never guess selectors** - Always use \`kode_get_page_context\` or \`kode_fetch_html_smart\`
748
+ 2. **Never assume CMS structure** - Always query Webflow MCP for collection schemas
749
+ 3. **Check before creating** - Use \`kode_list_scripts\` to avoid duplicates
750
+ 4. **Document discoveries** - Update \`context.md\` with findings for future sessions
751
+ 5. **Staging first** - Always deploy to staging before production
752
+
753
+ ### When You're Stuck
754
+
755
+ If you can't find the right selectors or understand the structure:
756
+ 1. Ask the user to open the page in browser and describe what they see
757
+ 2. Use \`kode_fetch_html_smart\` with the specific URL
758
+ 3. Check if there's cached context in \`kode_list_pages_context\`
759
+ 4. Ask the user to refresh context: \`kode html <url> --save --force\`
760
+
675
761
  `;
676
762
  }
677
763
 
package/dist/cli.js CHANGED
@@ -15,7 +15,7 @@ import {
15
15
  readPageContext,
16
16
  statusCommand,
17
17
  watchCommand
18
- } from "./chunk-XBDIENFY.js";
18
+ } from "./chunk-Z3QNIDBJ.js";
19
19
 
20
20
  // src/cli.ts
21
21
  import { Command } from "commander";
package/dist/index.js CHANGED
@@ -27,7 +27,7 @@ import {
27
27
  updateScriptPurpose,
28
28
  watchCommand,
29
29
  writeContext
30
- } from "./chunk-XBDIENFY.js";
30
+ } from "./chunk-Z3QNIDBJ.js";
31
31
  export {
32
32
  KodeApiClient,
33
33
  KodeApiError,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@curenorway/kode-cli",
3
- "version": "1.5.0",
3
+ "version": "1.5.1",
4
4
  "description": "CLI tool for Cure Kode - manage JS/CSS scripts for Webflow sites",
5
5
  "type": "module",
6
6
  "bin": {