codeloop 0.1.4 → 0.1.7

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.
@@ -40,126 +40,76 @@ If the project has a UI (Flutter, web app, mobile app, desktop app):
40
40
  ### Step B: Video capture review (dynamic correctness)
41
41
  After screenshots pass, record yourself OPERATING the app to catch transition,
42
42
  animation, and real-world UX issues that static screenshots miss:
43
- 1. Identify 2-3 core user journeys (e.g., onboarding, main workflow, settings)
44
- 2. Build and launch the app (if not already running)
45
- 3. Call codeloop_start_recording with app_name — this brings the app to front and
43
+ 1. Build and launch the app (if not already running)
44
+ 2. Call codeloop_start_recording with app_name — this brings the app to front and
46
45
  starts recording in the background. The app window is un-minimized automatically.
47
- 4. While recording is active, you MUST interact with the app. Do NOT just let it sit idle.
48
- The video must show real interactions, not a still image. Follow the platform guide below.
49
- 5. Wait 1-2 seconds between each interaction so frames capture each state change.
50
- 6. Call codeloop_stop_recording this finalizes the video and restores the IDE to the front.
51
- 7. Call codeloop_interaction_replay with the run_id and expected_flow description
52
- 8. Analyze the returned frame sequence for: broken transitions, stuck loading states,
46
+ 3. While recording is active, use codeloop_interact to interact with EVERY element in the app.
47
+ Do NOT use raw osascript/PowerShell/xdotool use codeloop_interact for all interactions.
48
+ The video MUST show real interactions, not a still image. You must:
49
+ - Navigate to EVERY page/route in the app
50
+ - Click EVERY button, link, and navigation element
51
+ - Fill EVERY form field with test data and submit
52
+ - Open/close every modal, dropdown, menu, and accordion
53
+ - Test hover states, tooltips, and interactive components
54
+ - If auth screens exist: test login (test@example.com / TestPass123!), signup, change-password, logout
55
+ - Test form validation: submit empty forms, type invalid data, verify error messages
56
+ - Type+Save (edit → Cmd+S), Type+Submit (fill → Submit), Type+Search (query → Enter)
57
+ - Double-click, right-click, drag-and-drop, scroll every scrollable area
58
+ - Mobile: swipe, long-press, back button, deep links, permissions, rotate device
59
+ 4. Wait 1-2 seconds between each interaction so frames capture each state change.
60
+ 5. Call codeloop_stop_recording — this finalizes the video and restores the IDE to the front.
61
+ 6. Call codeloop_interaction_replay with the run_id and expected_flow description
62
+ 7. Analyze the returned frame sequence for: broken transitions, stuck loading states,
53
63
  window sizing issues, animation glitches, navigation dead-ends, and flow completion
54
- 9. Fix any dynamic UX issues found
55
- 10. ONLY THEN proceed to gate_check
64
+ 8. Fix any dynamic UX issues found
65
+ 9. ONLY THEN proceed to gate_check
56
66
 
57
67
  ### How to operate the app during recording:
58
68
 
59
- **Step 0: Identify the interaction types your app needs.**
60
- Read the source code to understand what interactions the app supports. Different
61
- apps require different interaction types. Choose from this list:
62
-
63
- | Interaction | When to use | macOS osascript | Playwright | Maestro |
64
- |-------------|-------------|----------------|------------|---------|
65
- | Click/tap | Buttons, links, menus, tabs | \`click at {x,y}\` | \`page.click(selector)\` | \`- tapOn: "label"\` |
66
- | Double-click | Select word, zoom, open item | \`double click at {x,y}\` | \`page.dblclick(selector)\` | \`- doubleTapOn\` |
67
- | Right-click | Context menus | \`click at {x,y} with command down\` | \`page.click(sel, {button:'right'})\` | N/A |
68
- | Type text | Input fields, search, forms | \`keystroke "hello"\` | \`page.fill(sel, "hello")\` | \`- inputText: "hello"\` |
69
- | Key press | Enter, Escape, Tab, shortcuts | \`key code 36\` (Return) | \`page.keyboard.press('Enter')\` | \`- pressKey: Enter\` |
70
- | Drag / draw | Drawing canvas, sliders, resize | \`click at {x1,y1}\` then \`click at {x2,y2}\` | \`page.mouse.move(); mouse.down(); mouse.move(); mouse.up()\` | \`- swipe\` |
71
- | Draw lines/curves | Ruler, design, annotation tools | Click multiple points with delays between | \`mouse.down()\` series of \`mouse.move()\` → \`mouse.up()\` | Swipe gestures |
72
- | Scroll | Long pages, lists, content areas | \`scroll area 1 ... scroll down\` | \`page.mouse.wheel(0, 500)\` | \`- scroll\` |
73
- | Hover | Tooltips, dropdown menus | Move mouse without clicking | \`page.hover(selector)\` | N/A |
74
- | Long press | Mobile context actions | Hold click for 1+ seconds | \`page.click(sel, {delay: 1000})\` | \`- longPressOn\` |
75
- | Pinch/zoom | Maps, images, canvas | N/A (desktop) | N/A (browser) | \`- pinch\` |
76
- | Select from dropdown | Dropdown menus, pickers | Click dropdown → click option | \`page.selectOption(sel, val)\` | Tap to open → tap option |
77
- | Drag and drop | Sortable lists, kanban, file upload | Mouse down → move → mouse up | \`page.dragAndDrop(src, dst)\` | Swipe from → to |
78
-
79
- **Deciding which interactions to perform:**
80
- 1. Read the app's source code: what features are implemented?
81
- - A drawing app test drawing lines, curves, shapes (click-drag sequences)
82
- - A form-heavy app test typing in fields, selecting dropdowns, submitting
83
- - A navigation app → test clicking links, tabs, back buttons, breadcrumbs
84
- - A canvas/ruler app → test clicking points, drawing measurements, using tools
85
- - A dashboard test clicking charts, filtering data, expanding panels
86
- 2. Study the golden screenshots from Step A — what buttons, tools, and modes exist?
87
- 3. Plan a realistic user journey that exercises the core features
88
-
89
- **Desktop apps (Flutter, native macOS/Windows/Linux):**
90
- Use OS-level automation. First study the golden screenshots and source code.
91
-
92
- *macOS:*
93
- - Click: \`osascript -e 'tell application "System Events" to click at {x, y}'\`
94
- - Drag/draw: click start point, wait, click end point (or series of points)
95
- - Type text: \`osascript -e 'tell application "System Events" to keystroke "text"'\`
96
- - Key press: \`osascript -e 'tell application "System Events" to key code 36'\` (Return=36, Escape=53, Tab=48)
97
- - Right-click: \`osascript -e 'tell application "System Events" to click at {x,y} with {control down}'\`
98
-
99
- *Windows:*
100
- Use PowerShell with user32.dll for automation:
101
- - Click: \`powershell -Command "Add-Type @'\\nusing System;using System.Runtime.InteropServices;\\npublic class W{[DllImport(\\"user32.dll\\")]public static extern bool SetCursorPos(int X,int Y);[DllImport(\\"user32.dll\\")]public static extern void mouse_event(uint f,int x,int y,uint d,UIntPtr e);}\\n'@; [W]::SetCursorPos(X,Y); [W]::mouse_event(0x0002,0,0,0,[UIntPtr]::Zero); Start-Sleep -Ms 50; [W]::mouse_event(0x0004,0,0,0,[UIntPtr]::Zero)"\`
102
- - Type text: \`powershell -Command "[System.Windows.Forms.SendKeys]::SendWait('text')"\`
103
- - Key press: \`powershell -Command "Add-Type @'\\nusing System;using System.Runtime.InteropServices;\\npublic class K{[DllImport(\\"user32.dll\\")]public static extern void keybd_event(byte k,byte s,uint f,UIntPtr e);}\\n'@; [K]::keybd_event(0x0D,0,0,[UIntPtr]::Zero); Start-Sleep -Ms 50; [K]::keybd_event(0x0D,0,2,[UIntPtr]::Zero)"\` (Enter=0x0D, Esc=0x1B, Tab=0x09)
104
-
105
- *Linux:*
106
- - Click: \`xdotool mousemove X Y click 1\`
107
- - Type text: \`xdotool type "text"\`
108
- - Key press: \`xdotool key Return\` (Return, Escape, Tab, space, etc.)
109
- - Drag: \`xdotool mousemove X1 Y1 mousedown 1 mousemove X2 Y2 mouseup 1\`
110
-
111
- All platforms: use codeloop_capture_screenshot between interactions to verify each action worked.
112
-
113
- **Web apps (React, Next.js, Vue, etc.):**
114
- Run Playwright test scripts that operate the real browser during recording:
115
- - \`npx playwright test --headed\` to run tests in a visible browser
116
- - Playwright handles clicks, typing, drag-and-drop, scrolling, hover — all captured in video
117
- - For drawing/canvas: use \`page.mouse.down()\`, \`page.mouse.move(x,y)\`, \`page.mouse.up()\`
118
- - Browser console logs are automatically captured by CodeLoop during recording
119
-
120
- **Mobile apps (iOS/Android):**
121
-
122
- *Android (emulator):*
123
- Use ADB commands or Maestro flows:
124
- - Tap: \`adb shell input tap X Y\`
125
- - Type: \`adb shell input text "hello"\`
126
- - Key press: \`adb shell input keyevent KEYCODE_ENTER\` (KEYCODE_BACK, KEYCODE_HOME, KEYCODE_TAB)
127
- - Swipe/scroll: \`adb shell input swipe X1 Y1 X2 Y2 300\`
128
- - Screenshot: \`adb shell screencap -p /sdcard/screen.png && adb pull /sdcard/screen.png\`
129
- - Start codeloop_start_recording with target_type="android_emulator" for device-level recording
130
- - App logs captured via \`adb logcat\` automatically during recording
131
-
132
- *iOS (simulator — macOS only):*
133
- Use Maestro or simctl:
134
- - Maestro flows: \`maestro test flows/\` — taps, swipes, long-press, pinch, scroll, text input
135
- - Launch app: \`xcrun simctl launch booted com.example.app\`
136
- - Terminate: \`xcrun simctl terminate booted com.example.app\`
137
- - Screenshot: \`xcrun simctl io booted screenshot output.png\`
138
- - Start codeloop_start_recording with target_type="ios_simulator" for simulator-level recording
139
- - App logs captured via \`simctl log stream\` automatically during recording
140
-
141
- *Android Studio native:*
142
- - Build: \`./gradlew assembleDebug\`
143
- - Test: \`./gradlew connectedAndroidTest\`
144
- - Interact via ADB commands as above
145
-
146
- *Xcode/Swift native (macOS only):*
147
- - Build: \`xcodebuild build -scheme AppName\`
148
- - Test: \`xcodebuild test -scheme AppName -destination 'platform=iOS Simulator,name=iPhone 16'\`
149
- - Interact via Maestro or XCUITest
150
-
151
- **Critical:** The video MUST show the app changing state — not a still image.
152
- Match the interaction types to what the app actually does. If the app is a drawing
153
- tool, the video must show drawing. If it's a form, the video must show typing and
154
- submitting. If you cannot automate a specific interaction, tell the user to operate
155
- the app manually while recording is active.
69
+ Use the codeloop_interact tool for ALL interactions. Do NOT use raw osascript,
70
+ PowerShell, xdotool, adb, or simctl commands directly. codeloop_interact
71
+ handles all platforms automatically:
72
+
73
+ **Available actions:** click, double_click, right_click, hover, type, keystroke,
74
+ hotkey, scroll, drag_drop, long_press, type_and_submit, type_and_tab, fill_form,
75
+ select_option, toggle, upload_file, navigate_url, navigate_back, wait, swipe,
76
+ back_button, home_button, deep_link, grant_permission, rotate_device,
77
+ biometric_auth, launch_app, clear_app_data, mock_location, simulate_network,
78
+ maestro_flow, win_ui_inspect, win_ui_automate, sequence.
79
+
80
+ **Examples:**
81
+ - Click a button: \`codeloop_interact(action: "click", x: 200, y: 300)\`
82
+ - Click browser element: \`codeloop_interact(action: "click", target_type: "browser", selector: "#submit-btn")\`
83
+ - Type in field: \`codeloop_interact(action: "type", target_type: "browser", selector: "#email", text: "test@example.com")\`
84
+ - Fill form + submit: \`codeloop_interact(action: "fill_form", target_type: "browser", fields: [{selector: "#email", value: "test@example.com"}, {selector: "#password", value: "TestPass123!"}], submit_selector: "#login-btn")\`
85
+ - Scroll down: \`codeloop_interact(action: "scroll", direction: "down", amount: 300)\`
86
+ - Press Enter: \`codeloop_interact(action: "keystroke", key: "enter")\`
87
+ - Save with hotkey: \`codeloop_interact(action: "hotkey", keys: "cmd+s")\`
88
+ - Type and search: \`codeloop_interact(action: "type_and_submit", selector: "#search", text: "query")\`
89
+ - Android tap: \`codeloop_interact(action: "click", target_type: "android_emulator", x: 540, y: 960)\`
90
+ - Android swipe: \`codeloop_interact(action: "swipe", target_type: "android_emulator", x: 540, y: 1200, x2: 540, y2: 600)\`
91
+ - iOS deep link: \`codeloop_interact(action: "deep_link", target_type: "ios_simulator", url: "myapp://profile")\`
92
+ - Maestro flow: \`codeloop_interact(action: "maestro_flow", maestro_steps: ["tap on \\"Login\\"", "type \\"hello\\"", "tap on \\"Submit\\""])\`
93
+
94
+ **Mandatory interaction depth during recording:**
95
+ - Navigate to EVERY page/route
96
+ - Click EVERY button, link, nav element
97
+ - Fill EVERY form field with test data and submit
98
+ - Test auth flows if present: login, signup, change-password, logout
99
+ - Test form validation: empty submissions, invalid data, error messages
100
+ - Test compound patterns: type+save, type+submit, type+search, copy+paste, undo+redo
101
+ - Open/close every modal, dropdown, accordion, tooltip
102
+ - Scroll to bottom of every scrollable area
103
+ - Test double-click, right-click, hover, drag-and-drop if applicable
104
+ - Mobile: swipe, long-press, back button, rotate device, deep links
156
105
 
157
106
  **App logs:** CodeLoop automatically captures app runtime logs during video recording:
158
- - Flutter apps: \`flutter logs\` output
159
- - Android: \`adb logcat\` filtered to the app
160
- - iOS Simulator: \`simctl log stream\`
161
- - Native macOS: \`log stream --process\`
107
+ - Flutter apps: flutter logs output
108
+ - Android: adb logcat filtered to the app
109
+ - iOS Simulator: simctl log stream
110
+ - Native macOS: log stream --process
162
111
  - Web: browser console events via Playwright
112
+ - Backend: dev server stdout/stderr
163
113
  These logs are included in the interaction_replay analysis so you can correlate
164
114
  visual frames with runtime errors, warnings, and exceptions.
165
115
 
@@ -172,13 +122,29 @@ Screenshots catch per-page layout issues. Video catches cross-page flow issues,
172
122
  transitions, animations, real window behavior, and interaction bugs that static
173
123
  screenshots miss entirely (e.g., wrong window size, broken navigation, stuck modals).
174
124
 
125
+ ## THE CODELOOP AUTO-FIX LOOP (MANDATORY)
126
+
127
+ This is an AUTOMATIC loop. You do NOT ask the user for permission to continue.
128
+ You do NOT stop and report partial progress. You keep going until the gate passes.
129
+
130
+ Loop: Verify → Diagnose → Fix → Verify → ... → Screenshots → Video+Interact → Replay → Gate
131
+
132
+ RULES:
133
+ - If gate returns "continue_fixing": GO BACK TO codeloop_verify IMMEDIATELY.
134
+ Do NOT ask the user. Do NOT report partial results. Just fix and re-verify.
135
+ - If gate returns "escalate": STOP and report blockers to the user.
136
+ Only escalate after 8 failed fix attempts OR a true blocker (missing dependency, etc.)
137
+ - If gate returns "ready_for_review" with confidence >= 94%: proceed to dev report.
138
+ - The user only sees the final result AFTER the gate passes at >= 94%.
139
+ - Maximum loop iterations: 15. After 15 loops without reaching 94%, escalate.
140
+
175
141
  ## Before marking any task or feature as complete:
176
142
  1. Call codeloop_check_workflow to see which verification steps are still pending
177
143
  2. Complete ALL pending steps listed by codeloop_check_workflow
178
144
  3. Call codeloop_gate_check with the run_id, spec path, and acceptance path
179
- 4. If the result says "continue_fixing", keep fixing and re-verifying
145
+ 4. If the result says "continue_fixing", LOOP BACK to codeloop_verify immediately — do NOT ask the user
180
146
  5. If the result says "escalate", stop and report the blockers to the developer
181
- 6. Only declare the task complete when gate_check returns "ready_for_review" with confidence >= 85%
147
+ 6. Only declare the task complete when gate_check returns "ready_for_review" with confidence >= 94%
182
148
  7. Call codeloop_check_workflow one final time to confirm everything is done
183
149
 
184
150
  ## After the ENTIRE development loop is complete — MANDATORY development log:
@@ -245,15 +211,16 @@ Every CodeLoop-powered development session follows this mandatory lifecycle:
245
211
  1. **Implement** → write/modify code
246
212
  2. **Verify** → codeloop_verify (tests, lint, build)
247
213
  3. **Diagnose** → codeloop_diagnose (if failures)
248
- 4. **Fix** → repair confirmed issues only
214
+ 4. **Fix** → repair confirmed issues only → LOOP BACK to step 2
249
215
  5. **Screenshot** → codeloop_capture_screenshot + codeloop_visual_review (all pages)
250
- 6. **Video** → codeloop_start_recording → interact with ALL elements → codeloop_stop_recording
216
+ 6. **Video** → codeloop_start_recording → codeloop_interact with ALL elements → codeloop_stop_recording
251
217
  7. **Replay** → codeloop_interaction_replay (analyze frames + logs)
252
- 8. **Gate** → codeloop_gate_check (confidence >= 85%)
218
+ 8. **Gate** → codeloop_gate_check (confidence >= 94%) — if "continue_fixing", LOOP to step 2 automatically
253
219
  9. **Report** → codeloop_generate_dev_report → write docs/DEVELOPMENT_LOG.md
254
220
  10. **Deliver** → present working project + development log to developer
255
221
 
256
222
  Steps 5-7 are MANDATORY for any project with a UI. Step 9 is MANDATORY for every project.
223
+ The loop between steps 2-8 is AUTOMATIC. Do NOT ask the user between iterations.
257
224
  `;
258
225
  export const LOOP_MDC = `---
259
226
  description: CodeLoop multi-section development loop
@@ -269,7 +236,7 @@ When a master spec exists at docs/specs/_master.md:
269
236
  3. Read the spec file for the current section (the path is in the section_status response)
270
237
  4. Read the acceptance criteria file for the current section
271
238
  5. Implement the section according to the spec
272
- 6. Run codeloop_verify → codeloop_diagnose → fix → repeat until codeloop_gate_check passes with confidence >= 85%
239
+ 6. Run codeloop_verify → codeloop_diagnose → fix → repeat until codeloop_gate_check passes with confidence >= 94%
273
240
  7. Call codeloop_section_status again to get the next section
274
241
  8. If more sections remain, proceed to the next section IMMEDIATELY
275
242
  9. Do NOT stop between sections for human review
@@ -283,7 +250,7 @@ When a master spec exists at docs/specs/_master.md:
283
250
  12. Only THEN report to the developer with the full evidence summary, confidence scores,
284
251
  and the development log — showing exactly how CodeLoop powered the quality assurance
285
252
 
286
- ## After codeloop_gate_check returns "ready_for_review" with confidence >= 85%:
253
+ ## After codeloop_gate_check returns "ready_for_review" with confidence >= 94%:
287
254
 
288
255
  Generate or update the project README.md with:
289
256
  1. Project description and key features
@@ -549,31 +516,21 @@ For each page discovered, navigate to it and interact with these elements:
549
516
  - Verify sticky headers/footers remain visible
550
517
  - Check that lazy-loaded content appears when scrolled into view
551
518
 
552
- **How to interact — use osascript (macOS) or Playwright:**
553
-
554
- Navigate pages:
555
- \`osascript -e 'tell application "Google Chrome" to set URL of active tab of front window to "http://localhost:3000/page"'\`
556
-
557
- Click at coordinates (from screenshot analysis):
558
- \`osascript -e 'tell application "System Events" to click at {x, y}'\`
559
-
560
- Scroll down:
561
- \`osascript -e 'tell application "System Events" to key code 121'\` (Page Down)
562
-
563
- Scroll to top:
564
- \`osascript -e 'tell application "System Events" to key code 115'\` (Home)
565
-
566
- Type text in focused field:
567
- \`osascript -e 'tell application "System Events" to keystroke "test@example.com"'\`
568
-
569
- Press Enter:
570
- \`osascript -e 'tell application "System Events" to key code 36'\`
519
+ **How to interact — use codeloop_interact:**
571
520
 
572
- Press Tab:
573
- \`osascript -e 'tell application "System Events" to key code 48'\`
521
+ Use codeloop_interact with target_type="browser" for all web interactions:
522
+ - Navigate: \`codeloop_interact(action: "navigate_url", target_type: "browser", url: "http://localhost:3000/page")\`
523
+ - Click: \`codeloop_interact(action: "click", target_type: "browser", selector: "#btn")\`
524
+ - Type: \`codeloop_interact(action: "type", target_type: "browser", selector: "#email", text: "test@example.com")\`
525
+ - Fill form: \`codeloop_interact(action: "fill_form", target_type: "browser", fields: [...], submit_selector: "#submit")\`
526
+ - Scroll: \`codeloop_interact(action: "scroll", target_type: "browser", direction: "down", amount: 500)\`
527
+ - Select: \`codeloop_interact(action: "select_option", target_type: "browser", selector: "#dropdown", value: "option1")\`
528
+ - Toggle: \`codeloop_interact(action: "toggle", target_type: "browser", selector: "#checkbox")\`
529
+ - Hover: \`codeloop_interact(action: "hover", target_type: "browser", selector: ".tooltip-trigger")\`
530
+ - Wait: \`codeloop_interact(action: "wait", duration_ms: 1500)\`
574
531
 
575
532
  **IMPORTANT:** Wait 1-2 seconds between each interaction so video frames capture
576
- each state change. Use \`await new Promise(r => setTimeout(r, 1500))\` in scripts.
533
+ each state change.
577
534
 
578
535
  ### Step 4: Stop recording and analyze
579
536
  Call codeloop_stop_recording, then codeloop_interaction_replay with a detailed
@@ -1 +1 @@
1
- {"version":3,"file":"cursor-rules.js","sourceRoot":"","sources":["../../src/templates/cursor-rules.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,QAAQ,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAgQvB,CAAC;AAEF,MAAM,CAAC,MAAM,QAAQ,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA6CvB,CAAC;AAEF,MAAM,CAAC,MAAM,mBAAmB,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA0FlC,CAAC;AAEF,MAAM,CAAC,MAAM,eAAe,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAwC9B,CAAC;AAEF,MAAM,CAAC,MAAM,WAAW,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAiC1B,CAAC;AAEF,MAAM,CAAC,MAAM,OAAO,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA+HtB,CAAC;AAEF,MAAM,CAAC,MAAM,UAAU,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAmCzB,CAAC"}
1
+ {"version":3,"file":"cursor-rules.js","sourceRoot":"","sources":["../../src/templates/cursor-rules.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,QAAQ,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA+NvB,CAAC;AAEF,MAAM,CAAC,MAAM,QAAQ,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA6CvB,CAAC;AAEF,MAAM,CAAC,MAAM,mBAAmB,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA0FlC,CAAC;AAEF,MAAM,CAAC,MAAM,eAAe,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAwC9B,CAAC;AAEF,MAAM,CAAC,MAAM,WAAW,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAiC1B,CAAC;AAEF,MAAM,CAAC,MAAM,OAAO,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAqHtB,CAAC;AAEF,MAAM,CAAC,MAAM,UAAU,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAmCzB,CAAC"}
@@ -1,4 +1,4 @@
1
- export declare const SKILL_LOOP = "---\nname: codeloop-loop\ndescription: Run the full CodeLoop verify-diagnose-fix cycle until all quality gates pass. Use when implementing a feature end-to-end or completing a development section that requires verified, production-ready code.\n---\n\n# CodeLoop Loop\n\nOrchestrates the complete verification cycle for a feature or section.\n\n## When to use\n\n- After implementing a feature or completing a code change that needs verification\n- When working through a multi-section development plan\n- When you need evidence-based confirmation that code is ready for review\n\n## Instructions\n\n1. Call `codeloop_verify` with the appropriate scope (\"full\" for entire project, \"affected\" for changed files only) and platform (\"auto\" to detect, or \"flutter\"/\"web\"/\"mobile\" explicitly)\n\n2. Read the structured output. If all checks pass, proceed to step 5.\n\n3. If there are failures, call `codeloop_diagnose` with the `run_id` from the verify result. Read the categorized issues and repair tasks carefully.\n\n4. Fix ONLY the issues listed in the repair tasks. Do not guess or fix unrelated code. After fixing, go back to step 1 and re-verify. Repeat up to 8 times.\n\n5. Call `codeloop_gate_check` with the `run_id`, the spec path, and the acceptance criteria path.\n\n6. If gate_check returns:\n - `\"ready_for_review\"` with confidence >= 85% \u2014 the task is complete\n - `\"continue_fixing\"` \u2014 go back to step 1\n - `\"escalate\"` \u2014 stop and report blockers to the developer\n\n7. If working through a multi-section plan, call `codeloop_section_status` to get the next section and repeat the entire cycle.\n\n## Important\n\n- Never mark a task complete without evidence from `codeloop_gate_check`\n- After 8 failed repair attempts, escalate instead of continuing\n- Trust deterministic results (test pass/fail) over model opinions\n";
1
+ export declare const SKILL_LOOP = "---\nname: codeloop-loop\ndescription: Run the full CodeLoop verify-diagnose-fix cycle until all quality gates pass. Use when implementing a feature end-to-end or completing a development section that requires verified, production-ready code.\n---\n\n# CodeLoop Loop\n\nOrchestrates the complete verification cycle for a feature or section.\n\n## When to use\n\n- After implementing a feature or completing a code change that needs verification\n- When working through a multi-section development plan\n- When you need evidence-based confirmation that code is ready for review\n\n## Instructions\n\n1. Call `codeloop_verify` with the appropriate scope (\"full\" for entire project, \"affected\" for changed files only) and platform (\"auto\" to detect, or \"flutter\"/\"web\"/\"mobile\" explicitly)\n\n2. Read the structured output. If all checks pass, proceed to step 5.\n\n3. If there are failures, call `codeloop_diagnose` with the `run_id` from the verify result. Read the categorized issues and repair tasks carefully.\n\n4. Fix ONLY the issues listed in the repair tasks. Do not guess or fix unrelated code. After fixing, go back to step 1 and re-verify. Repeat up to 8 times.\n\n5. Call `codeloop_gate_check` with the `run_id`, the spec path, and the acceptance criteria path.\n\n6. If gate_check returns:\n - `\"ready_for_review\"` with confidence >= 94% \u2014 the task is complete\n - `\"continue_fixing\"` \u2014 go back to step 1\n - `\"escalate\"` \u2014 stop and report blockers to the developer\n\n7. If working through a multi-section plan, call `codeloop_section_status` to get the next section and repeat the entire cycle.\n\n## Important\n\n- Never mark a task complete without evidence from `codeloop_gate_check`\n- After 8 failed repair attempts, escalate instead of continuing\n- Trust deterministic results (test pass/fail) over model opinions\n";
2
2
  export declare const SKILL_VERIFY = "---\nname: codeloop-verify\ndescription: Run a single CodeLoop verification pass to check if the current code compiles, passes tests, and meets quality standards. Use after any code change to get structured pass/fail results.\n---\n\n# CodeLoop Verify\n\nRuns a single verification pass and returns structured results.\n\n## When to use\n\n- After making code changes and wanting a quick check\n- Before committing code to ensure nothing is broken\n- When you need structured test/lint/build output instead of raw terminal output\n\n## Instructions\n\n1. Call `codeloop_verify` with parameters:\n - `scope`: \"full\" (all checks) or \"affected\" (only changed files)\n - `platform`: \"auto\" (detect from project), \"flutter\", \"web\", or \"mobile\"\n\n2. The tool returns a structured report containing:\n - Pass/fail counts for each check category\n - Artifact paths for logs and screenshots\n - A next-step suggestion\n\n3. If there are failures, consider using the codeloop-loop skill for the full diagnose-fix cycle, or call `codeloop_diagnose` manually with the `run_id`.\n\n4. If all checks pass, you can proceed with confidence or run `codeloop_gate_check` for formal completion evidence.\n\n## Output format\n\nThe verification result includes:\n- `run_id`: unique identifier for this run (needed by diagnose and gate_check)\n- `summary`: overall pass/fail with counts\n- `checks`: detailed results per category (build, tests, lint, format)\n- `artifacts`: paths to generated logs and screenshots\n- `suggestion`: recommended next action\n";
3
3
  export declare const SKILL_VISUAL_REVIEW = "---\nname: codeloop-visual-review\ndescription: Capture screenshots of the current UI and analyze them for visual issues, layout problems, and design fidelity. Use after UI changes to catch visual regressions.\n---\n\n# CodeLoop Visual Review\n\nCaptures and analyzes UI screenshots for visual quality.\n\n## When to use\n\n- After making UI/styling changes and wanting to verify visual correctness\n- When a design reference image is available and you want to compare against it\n- When checking responsive layout across different viewport sizes\n- When verifying accessibility-related visual aspects (contrast, sizing)\n\n## Instructions\n\n### For visual review (no reference image):\n\n1. Call `codeloop_visual_review` with:\n - `run_id`: from a recent `codeloop_verify` run (optional)\n - `viewport_sizes`: array of viewport dimensions (e.g., [\"375x812\", \"1440x900\"])\n - `ux_checklist_path`: path to UX checklist if one exists\n\n2. The tool captures screenshots at each viewport size and uses a vision model to identify issues.\n\n### For design comparison (with reference image):\n\n1. Call `codeloop_design_compare` with:\n - `reference_image_path`: path to the design mockup or Figma export\n - `screen_name`: identifier for the screen being compared\n - `platform`: the platform being tested\n - `viewport_sizes`: viewport dimensions to test\n\n2. The tool returns a match score, list of differences, and comparison screenshots.\n\n## Tips\n\n- Store design references in `artifacts/references/` for easy access\n- Run visual review after every UI change, not just at the end\n- Use the UX checklist template at `docs/ux-checklists/_template.md` for consistent checks\n";
4
4
  export declare const SKILL_RECOMMEND = "---\nname: codeloop-recommend\ndescription: Get evidence-based recommendations for third-party tools and services based on the project stack, budget, and constraints. Use when choosing hosting, databases, email services, analytics, or any infrastructure.\n---\n\n# CodeLoop Recommend\n\nProvides structured tool and service recommendations.\n\n## When to use\n\n- When the developer asks about hosting, deployment, or infrastructure options\n- When choosing between email services, analytics tools, auth providers, or databases\n- When evaluating tools for monitoring, file storage, or marketing\n- When the task requires selecting a third-party service and you want objective comparison\n\n## Instructions\n\n1. Call `codeloop_recommend_tool` with:\n - `category`: the type of tool needed (e.g., \"hosting\", \"email\", \"database\", \"analytics\", \"auth\", \"monitoring\", \"file-storage\")\n - `stack`: key-value pairs describing the current tech stack\n - `budget`: \"free\", \"low\", \"medium\", or \"enterprise\"\n - `constraints`: any specific requirements (e.g., `{\"gdpr\": true, \"region\": \"eu\"}`)\n\n2. The tool returns ranked recommendations with reasoning, pricing, tradeoffs, and starter tasks.\n\n3. Present the results with reasoning and tradeoffs \u2014 never just recommend a name without context.\n\n## Tips\n\n- Always include the current stack so recommendations account for compatibility\n- Set budget to match the developer's stated constraints\n- Use constraints for regulatory requirements (GDPR, SOC2, HIPAA)\n";
@@ -26,7 +26,7 @@ Orchestrates the complete verification cycle for a feature or section.
26
26
  5. Call \`codeloop_gate_check\` with the \`run_id\`, the spec path, and the acceptance criteria path.
27
27
 
28
28
  6. If gate_check returns:
29
- - \`"ready_for_review"\` with confidence >= 85% — the task is complete
29
+ - \`"ready_for_review"\` with confidence >= 94% — the task is complete
30
30
  - \`"continue_fixing"\` — go back to step 1
31
31
  - \`"escalate"\` — stop and report blockers to the developer
32
32
 
@@ -20,5 +20,13 @@ export declare const CLAUDE_MCP_CONFIG: {
20
20
  };
21
21
  };
22
22
  };
23
+ /**
24
+ * Returns MCP config with the actual API key value injected.
25
+ * When apiKey is provided, writes the real key instead of the env placeholder.
26
+ * This is critical for Claude Code which doesn't expand shell env vars in JSON.
27
+ */
28
+ export declare function getMcpConfig(apiKey?: string | null): {
29
+ mcpServers: Record<string, unknown>;
30
+ };
23
31
  export declare const CLAUDE_PERMISSIONS_ALLOW: string[];
24
32
  //# sourceMappingURL=mcp-config.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"mcp-config.d.ts","sourceRoot":"","sources":["../../src/templates/mcp-config.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,iBAAiB;;;;;;;;;;CAU7B,CAAC;AAEF,eAAO,MAAM,iBAAiB;;;;;;;;;;CAU7B,CAAC;AAEF,eAAO,MAAM,wBAAwB,UA2BpC,CAAC"}
1
+ {"version":3,"file":"mcp-config.d.ts","sourceRoot":"","sources":["../../src/templates/mcp-config.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,iBAAiB;;;;;;;;;;CAU7B,CAAC;AAEF,eAAO,MAAM,iBAAiB;;;;;;;;;;CAU7B,CAAC;AAEF;;;;GAIG;AACH,wBAAgB,YAAY,CAAC,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG;IAAE,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;CAAE,CAY5F;AAED,eAAO,MAAM,wBAAwB,UA2BpC,CAAC"}
@@ -20,6 +20,24 @@ export const CLAUDE_MCP_CONFIG = {
20
20
  },
21
21
  },
22
22
  };
23
+ /**
24
+ * Returns MCP config with the actual API key value injected.
25
+ * When apiKey is provided, writes the real key instead of the env placeholder.
26
+ * This is critical for Claude Code which doesn't expand shell env vars in JSON.
27
+ */
28
+ export function getMcpConfig(apiKey) {
29
+ return {
30
+ mcpServers: {
31
+ codeloop: {
32
+ command: "npx",
33
+ args: ["-y", "codeloop-mcp-server"],
34
+ env: {
35
+ CODELOOP_API_KEY: apiKey || "${CODELOOP_API_KEY}",
36
+ },
37
+ },
38
+ },
39
+ };
40
+ }
23
41
  export const CLAUDE_PERMISSIONS_ALLOW = [
24
42
  "Bash(flutter *)",
25
43
  "Bash(dart *)",
@@ -1 +1 @@
1
- {"version":3,"file":"mcp-config.js","sourceRoot":"","sources":["../../src/templates/mcp-config.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,iBAAiB,GAAG;IAC/B,UAAU,EAAE;QACV,QAAQ,EAAE;YACR,OAAO,EAAE,KAAK;YACd,IAAI,EAAE,CAAC,IAAI,EAAE,qBAAqB,CAAC;YACnC,GAAG,EAAE;gBACH,gBAAgB,EAAE,qBAAqB;aACxC;SACF;KACF;CACF,CAAC;AAEF,MAAM,CAAC,MAAM,iBAAiB,GAAG;IAC/B,UAAU,EAAE;QACV,QAAQ,EAAE;YACR,OAAO,EAAE,KAAK;YACd,IAAI,EAAE,CAAC,IAAI,EAAE,qBAAqB,CAAC;YACnC,GAAG,EAAE;gBACH,gBAAgB,EAAE,qBAAqB;aACxC;SACF;KACF;CACF,CAAC;AAEF,MAAM,CAAC,MAAM,wBAAwB,GAAG;IACtC,iBAAiB;IACjB,cAAc;IACd,aAAa;IACb,aAAa;IACb,cAAc;IACd,aAAa;IACb,cAAc;IACd,gBAAgB;IAChB,iBAAiB;IACjB,uBAAuB;IACvB,aAAa;IACb,eAAe;IACf,YAAY;IACZ,YAAY;IACZ,YAAY;IACZ,aAAa;IACb,YAAY;IACZ,eAAe;IACf,cAAc;IACd,cAAc;IACd,cAAc;IACd,cAAc;IACd,cAAc;IACd,YAAY;IACZ,cAAc;IACd,WAAW;CACZ,CAAC"}
1
+ {"version":3,"file":"mcp-config.js","sourceRoot":"","sources":["../../src/templates/mcp-config.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,iBAAiB,GAAG;IAC/B,UAAU,EAAE;QACV,QAAQ,EAAE;YACR,OAAO,EAAE,KAAK;YACd,IAAI,EAAE,CAAC,IAAI,EAAE,qBAAqB,CAAC;YACnC,GAAG,EAAE;gBACH,gBAAgB,EAAE,qBAAqB;aACxC;SACF;KACF;CACF,CAAC;AAEF,MAAM,CAAC,MAAM,iBAAiB,GAAG;IAC/B,UAAU,EAAE;QACV,QAAQ,EAAE;YACR,OAAO,EAAE,KAAK;YACd,IAAI,EAAE,CAAC,IAAI,EAAE,qBAAqB,CAAC;YACnC,GAAG,EAAE;gBACH,gBAAgB,EAAE,qBAAqB;aACxC;SACF;KACF;CACF,CAAC;AAEF;;;;GAIG;AACH,MAAM,UAAU,YAAY,CAAC,MAAsB;IACjD,OAAO;QACL,UAAU,EAAE;YACV,QAAQ,EAAE;gBACR,OAAO,EAAE,KAAK;gBACd,IAAI,EAAE,CAAC,IAAI,EAAE,qBAAqB,CAAC;gBACnC,GAAG,EAAE;oBACH,gBAAgB,EAAE,MAAM,IAAI,qBAAqB;iBAClD;aACF;SACF;KACF,CAAC;AACJ,CAAC;AAED,MAAM,CAAC,MAAM,wBAAwB,GAAG;IACtC,iBAAiB;IACjB,cAAc;IACd,aAAa;IACb,aAAa;IACb,cAAc;IACd,aAAa;IACb,cAAc;IACd,gBAAgB;IAChB,iBAAiB;IACjB,uBAAuB;IACvB,aAAa;IACb,eAAe;IACf,YAAY;IACZ,YAAY;IACZ,YAAY;IACZ,aAAa;IACb,YAAY;IACZ,eAAe;IACf,cAAc;IACd,cAAc;IACd,cAAc;IACd,cAAc;IACd,cAAc;IACd,YAAY;IACZ,cAAc;IACd,WAAW;CACZ,CAAC"}
@@ -0,0 +1,2 @@
1
+ export declare function applyGlobalMcpConfig(apiKey: string): Promise<void>;
2
+ //# sourceMappingURL=global-setup.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"global-setup.d.ts","sourceRoot":"","sources":["../../src/utils/global-setup.ts"],"names":[],"mappings":"AAMA,wBAAsB,oBAAoB,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAWxE"}
@@ -0,0 +1,16 @@
1
+ import { join } from "path";
2
+ import { homedir } from "os";
3
+ import { mergeMcpConfig } from "./file-writer.js";
4
+ import { getMcpConfig } from "../templates/mcp-config.js";
5
+ import { printSuccess } from "./ui.js";
6
+ export async function applyGlobalMcpConfig(apiKey) {
7
+ const home = homedir();
8
+ const config = getMcpConfig(apiKey);
9
+ const cursorGlobalPath = join(home, ".cursor", "mcp.json");
10
+ mergeMcpConfig(cursorGlobalPath, config.mcpServers);
11
+ printSuccess("~/.cursor/mcp.json (global — all Cursor workspaces)");
12
+ const claudeGlobalPath = join(home, ".claude.json");
13
+ mergeMcpConfig(claudeGlobalPath, config.mcpServers);
14
+ printSuccess("~/.claude.json (global — all Claude Code workspaces)");
15
+ }
16
+ //# sourceMappingURL=global-setup.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"global-setup.js","sourceRoot":"","sources":["../../src/utils/global-setup.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAC5B,OAAO,EAAE,OAAO,EAAE,MAAM,IAAI,CAAC;AAC7B,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC1D,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAEvC,MAAM,CAAC,KAAK,UAAU,oBAAoB,CAAC,MAAc;IACvD,MAAM,IAAI,GAAG,OAAO,EAAE,CAAC;IACvB,MAAM,MAAM,GAAG,YAAY,CAAC,MAAM,CAAC,CAAC;IAEpC,MAAM,gBAAgB,GAAG,IAAI,CAAC,IAAI,EAAE,SAAS,EAAE,UAAU,CAAC,CAAC;IAC3D,cAAc,CAAC,gBAAgB,EAAE,MAAM,CAAC,UAAU,CAAC,CAAC;IACpD,YAAY,CAAC,qDAAqD,CAAC,CAAC;IAEpE,MAAM,gBAAgB,GAAG,IAAI,CAAC,IAAI,EAAE,cAAc,CAAC,CAAC;IACpD,cAAc,CAAC,gBAAgB,EAAE,MAAM,CAAC,UAAU,CAAC,CAAC;IACpD,YAAY,CAAC,sDAAsD,CAAC,CAAC;AACvE,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "codeloop",
3
- "version": "0.1.4",
3
+ "version": "0.1.7",
4
4
  "description": "CLI tool for CodeLoop — automated verification for AI coding agents",
5
5
  "type": "module",
6
6
  "bin": {
@@ -30,14 +30,15 @@
30
30
  ],
31
31
  "license": "MIT",
32
32
  "dependencies": {
33
- "commander": "^13.1.0",
34
33
  "@inquirer/prompts": "^7.5.0",
35
34
  "chalk": "^5.4.1",
35
+ "commander": "^13.1.0",
36
+ "open": "^11.0.0",
36
37
  "ora": "^8.2.0"
37
38
  },
38
39
  "devDependencies": {
39
- "typescript": "^5.8.3",
40
40
  "@types/node": "^22.15.3",
41
+ "typescript": "^5.8.3",
41
42
  "vitest": "^3.1.2"
42
43
  }
43
44
  }