@curenorway/kode-cli 1.5.1 → 1.6.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/dist/{chunk-Z3QNIDBJ.js → chunk-GKNPODOV.js} +113 -3
- package/dist/cli.js +1 -1
- package/dist/index.js +1 -1
- package/package.json +1 -1
|
@@ -446,6 +446,10 @@ The \`.mcp.json\` file enables AI tools:
|
|
|
446
446
|
- Modify site structure, CMS collections, pages, and more
|
|
447
447
|
- Requires the Webflow MCP Bridge App running in Designer (press E \u2192 Apps)
|
|
448
448
|
|
|
449
|
+
**playwright MCP**: Testing and runtime HTML inspection
|
|
450
|
+
- \`browser_navigate\`, \`browser_snapshot\`, \`browser_click\`, \`browser_console_messages\`
|
|
451
|
+
- Use to verify scripts work correctly AFTER deploying to staging
|
|
452
|
+
|
|
449
453
|
Restart Claude Code after \`kode init\` to load MCP servers.
|
|
450
454
|
|
|
451
455
|
`;
|
|
@@ -676,6 +680,14 @@ Use both MCPs together for powerful workflows:
|
|
|
676
680
|
|
|
677
681
|
**IMPORTANT**: Before writing ANY JavaScript, always gather context first. Follow this decision tree:
|
|
678
682
|
|
|
683
|
+
### The Three MCPs
|
|
684
|
+
|
|
685
|
+
| MCP | Purpose | When to Use |
|
|
686
|
+
|-----|---------|-------------|
|
|
687
|
+
| **Cure Kode** | Script management, static HTML, deployment | Writing & deploying scripts |
|
|
688
|
+
| **Webflow** | Site structure, CMS, pages, assets | Understanding data & structure |
|
|
689
|
+
| **Playwright** | Runtime HTML, testing, screenshots | Verifying scripts work correctly |
|
|
690
|
+
|
|
679
691
|
### Step 1: Understand the Task
|
|
680
692
|
|
|
681
693
|
| Task Type | First Action |
|
|
@@ -685,8 +697,9 @@ Use both MCPs together for powerful workflows:
|
|
|
685
697
|
| JS for forms | Use Webflow MCP \u2192 get form structure, then Cure Kode for custom validation |
|
|
686
698
|
| JS for navigation/menus | Use Webflow MCP \u2192 \`pages_list\` to get site structure |
|
|
687
699
|
| JS for dynamic content | Check BOTH - Webflow for data structure, Cure Kode for existing scripts |
|
|
700
|
+
| Debugging existing JS | Use Playwright MCP \u2192 \`browser_navigate\` + \`browser_console_messages\` |
|
|
688
701
|
|
|
689
|
-
### Step 2:
|
|
702
|
+
### Step 2: The Complete Workflow
|
|
690
703
|
|
|
691
704
|
\`\`\`
|
|
692
705
|
1. DISCOVER: What elements/data am I working with?
|
|
@@ -702,8 +715,19 @@ Use both MCPs together for powerful workflows:
|
|
|
702
715
|
4. IMPLEMENT: Write the JavaScript
|
|
703
716
|
- Use kode_create_script or kode_update_script
|
|
704
717
|
|
|
705
|
-
5. DEPLOY:
|
|
706
|
-
- kode_deploy (staging)
|
|
718
|
+
5. DEPLOY: Push to staging
|
|
719
|
+
- kode_deploy (staging)
|
|
720
|
+
|
|
721
|
+
6. VERIFY: Test that it works! \u2B05\uFE0F CRITICAL STEP
|
|
722
|
+
- Playwright MCP: browser_navigate to staging URL
|
|
723
|
+
- Playwright MCP: browser_snapshot to see runtime DOM
|
|
724
|
+
- Playwright MCP: browser_console_messages to check for errors
|
|
725
|
+
- Playwright MCP: browser_click / browser_fill to test interactions
|
|
726
|
+
- If issues found \u2192 fix and redeploy
|
|
727
|
+
|
|
728
|
+
7. PROMOTE: Go live
|
|
729
|
+
- kode_promote (production)
|
|
730
|
+
- Optionally verify production with Playwright
|
|
707
731
|
\`\`\`
|
|
708
732
|
|
|
709
733
|
### Step 3: Common Patterns
|
|
@@ -758,6 +782,85 @@ If you can't find the right selectors or understand the structure:
|
|
|
758
782
|
3. Check if there's cached context in \`kode_list_pages_context\`
|
|
759
783
|
4. Ask the user to refresh context: \`kode html <url> --save --force\`
|
|
760
784
|
|
|
785
|
+
## \u{1F3AD} Playwright MCP (Testing & Verification)
|
|
786
|
+
|
|
787
|
+
Playwright MCP is **always included** because testing is essential. Use it to:
|
|
788
|
+
- Get **runtime HTML** (after JavaScript has executed)
|
|
789
|
+
- **Test interactions** (clicks, form fills, hovers)
|
|
790
|
+
- **Debug issues** (console logs, network errors)
|
|
791
|
+
- **Take screenshots** for visual verification
|
|
792
|
+
|
|
793
|
+
### Playwright MCP Tools
|
|
794
|
+
|
|
795
|
+
| Tool | Purpose | Example Use |
|
|
796
|
+
|------|---------|-------------|
|
|
797
|
+
| \`browser_navigate\` | Go to a URL | Navigate to staging site |
|
|
798
|
+
| \`browser_snapshot\` | Get accessibility tree (runtime DOM) | See what elements exist after JS runs |
|
|
799
|
+
| \`browser_click\` | Click an element | Test button clicks, menu opens |
|
|
800
|
+
| \`browser_fill\` | Type into input | Test form interactions |
|
|
801
|
+
| \`browser_select\` | Select dropdown option | Test select inputs |
|
|
802
|
+
| \`browser_hover\` | Hover over element | Test hover states |
|
|
803
|
+
| \`browser_screenshot\` | Take screenshot | Visual verification |
|
|
804
|
+
| \`browser_console_messages\` | Get console output | Check for JS errors |
|
|
805
|
+
| \`browser_network_requests\` | See network activity | Debug API calls |
|
|
806
|
+
|
|
807
|
+
### Static vs Runtime HTML
|
|
808
|
+
|
|
809
|
+
| Method | What You Get | When to Use |
|
|
810
|
+
|--------|--------------|-------------|
|
|
811
|
+
| \`kode_fetch_html_smart\` | Static HTML (before JS) | Understanding page structure |
|
|
812
|
+
| \`browser_snapshot\` | Runtime DOM (after JS) | Verifying JS worked correctly |
|
|
813
|
+
|
|
814
|
+
**Example**: If your script adds a class \`.is-active\` to elements, \`kode_fetch_html_smart\` won't show it, but \`browser_snapshot\` will!
|
|
815
|
+
|
|
816
|
+
### Testing Patterns
|
|
817
|
+
|
|
818
|
+
**Pattern: Verify Script Deployed Correctly**
|
|
819
|
+
\`\`\`
|
|
820
|
+
1. browser_navigate \u2192 staging URL
|
|
821
|
+
2. browser_snapshot \u2192 check if expected elements/classes exist
|
|
822
|
+
3. browser_console_messages \u2192 ensure no JS errors
|
|
823
|
+
\`\`\`
|
|
824
|
+
|
|
825
|
+
**Pattern: Test Click Interaction**
|
|
826
|
+
\`\`\`
|
|
827
|
+
1. browser_navigate \u2192 page URL
|
|
828
|
+
2. browser_click \u2192 target element (e.g., ".accordion-trigger")
|
|
829
|
+
3. browser_snapshot \u2192 verify state changed (e.g., ".accordion-content" visible)
|
|
830
|
+
\`\`\`
|
|
831
|
+
|
|
832
|
+
**Pattern: Test Form Validation**
|
|
833
|
+
\`\`\`
|
|
834
|
+
1. browser_navigate \u2192 form page
|
|
835
|
+
2. browser_fill \u2192 input invalid data
|
|
836
|
+
3. browser_click \u2192 submit button
|
|
837
|
+
4. browser_snapshot \u2192 verify error message appears
|
|
838
|
+
\`\`\`
|
|
839
|
+
|
|
840
|
+
**Pattern: Debug Why Script Isn't Working**
|
|
841
|
+
\`\`\`
|
|
842
|
+
1. browser_navigate \u2192 problem page
|
|
843
|
+
2. browser_console_messages \u2192 look for errors
|
|
844
|
+
3. browser_snapshot \u2192 check if elements exist
|
|
845
|
+
4. Compare with kode_fetch_html_smart \u2192 is JS even loading?
|
|
846
|
+
\`\`\`
|
|
847
|
+
|
|
848
|
+
### Testing Checklist
|
|
849
|
+
|
|
850
|
+
Before promoting to production, verify:
|
|
851
|
+
- [ ] No console errors (\`browser_console_messages\`)
|
|
852
|
+
- [ ] Expected DOM changes visible (\`browser_snapshot\`)
|
|
853
|
+
- [ ] Interactions work (\`browser_click\`, \`browser_fill\`)
|
|
854
|
+
- [ ] Works on key pages (test multiple URLs)
|
|
855
|
+
|
|
856
|
+
### Staging vs Production URLs
|
|
857
|
+
|
|
858
|
+
The staging URL for testing is typically:
|
|
859
|
+
- \`https://[site-slug].webflow.io\` (Webflow staging)
|
|
860
|
+
- Or check \`kode_site_info\` for configured staging domain
|
|
861
|
+
|
|
862
|
+
Always test on staging before promoting to production!
|
|
863
|
+
|
|
761
864
|
`;
|
|
762
865
|
}
|
|
763
866
|
|
|
@@ -910,6 +1013,10 @@ config.json
|
|
|
910
1013
|
url: "https://mcp.webflow.com/sse"
|
|
911
1014
|
};
|
|
912
1015
|
}
|
|
1016
|
+
mcpConfig.mcpServers["playwright"] = {
|
|
1017
|
+
command: "npx",
|
|
1018
|
+
args: ["-y", "@playwright/mcp@latest"]
|
|
1019
|
+
};
|
|
913
1020
|
spinner.start("Generating AI context files...");
|
|
914
1021
|
writeFileSync3(mcpConfigPath, JSON.stringify(mcpConfig, null, 2) + "\n");
|
|
915
1022
|
spinner.text = "Generating AI context files...";
|
|
@@ -1059,6 +1166,9 @@ config.json
|
|
|
1059
1166
|
console.log(chalk.dim(" webflow: ") + chalk.yellow("Not configured"));
|
|
1060
1167
|
console.log(chalk.dim(" Run `kode init --force` to set up Webflow MCP later."));
|
|
1061
1168
|
}
|
|
1169
|
+
console.log();
|
|
1170
|
+
console.log(chalk.dim(" playwright:"));
|
|
1171
|
+
console.log(chalk.dim(" Test scripts, get runtime HTML (after JS runs), take screenshots."));
|
|
1062
1172
|
if (claudeMdAction === "separate") {
|
|
1063
1173
|
console.log(chalk.yellow("\n\u{1F4A1} Tip: Add this line to your CLAUDE.md to reference Kode instructions:"));
|
|
1064
1174
|
console.log(chalk.dim(" See KODE.md for Cure Kode CDN management instructions."));
|
package/dist/cli.js
CHANGED
package/dist/index.js
CHANGED