annotask 0.0.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 (60) hide show
  1. package/README.md +191 -0
  2. package/dist/chunk-2TUWBFQG.js +882 -0
  3. package/dist/chunk-2TUWBFQG.js.map +1 -0
  4. package/dist/chunk-3VLTLTEO.js +53 -0
  5. package/dist/chunk-3VLTLTEO.js.map +1 -0
  6. package/dist/chunk-53D2PE43.js +105 -0
  7. package/dist/chunk-53D2PE43.js.map +1 -0
  8. package/dist/chunk-6UQW2W7S.js +358 -0
  9. package/dist/chunk-6UQW2W7S.js.map +1 -0
  10. package/dist/chunk-6VYCY34B.js +848 -0
  11. package/dist/chunk-6VYCY34B.js.map +1 -0
  12. package/dist/chunk-B7IKW7UB.js +792 -0
  13. package/dist/chunk-B7IKW7UB.js.map +1 -0
  14. package/dist/chunk-BDMOC2BG.js +794 -0
  15. package/dist/chunk-BDMOC2BG.js.map +1 -0
  16. package/dist/chunk-CFBRU3DQ.js +332 -0
  17. package/dist/chunk-CFBRU3DQ.js.map +1 -0
  18. package/dist/chunk-CWA33RDQ.js +21 -0
  19. package/dist/chunk-CWA33RDQ.js.map +1 -0
  20. package/dist/chunk-DGUM43GV.js +11 -0
  21. package/dist/chunk-DGUM43GV.js.map +1 -0
  22. package/dist/chunk-EAT6V4LF.js +358 -0
  23. package/dist/chunk-EAT6V4LF.js.map +1 -0
  24. package/dist/chunk-FBXNRXMY.js +849 -0
  25. package/dist/chunk-FBXNRXMY.js.map +1 -0
  26. package/dist/chunk-LKRKKLOT.js +61 -0
  27. package/dist/chunk-LKRKKLOT.js.map +1 -0
  28. package/dist/chunk-STOP7QF3.js +61 -0
  29. package/dist/chunk-STOP7QF3.js.map +1 -0
  30. package/dist/chunk-T6TKVAAA.js +332 -0
  31. package/dist/chunk-T6TKVAAA.js.map +1 -0
  32. package/dist/chunk-VCC7UV6G.js +291 -0
  33. package/dist/chunk-VCC7UV6G.js.map +1 -0
  34. package/dist/chunk-XR26XVHT.js +21 -0
  35. package/dist/chunk-XR26XVHT.js.map +1 -0
  36. package/dist/chunk-XZNNRBUW.js +311 -0
  37. package/dist/chunk-XZNNRBUW.js.map +1 -0
  38. package/dist/cli.js +248 -0
  39. package/dist/index.d.ts +9 -0
  40. package/dist/index.js +171 -0
  41. package/dist/index.js.map +1 -0
  42. package/dist/server.d.ts +50 -0
  43. package/dist/server.js +15 -0
  44. package/dist/server.js.map +1 -0
  45. package/dist/shell/assets/index-BD3nZNWX.js +59 -0
  46. package/dist/shell/assets/index-DwbhEo-C.css +1 -0
  47. package/dist/shell/index.html +13 -0
  48. package/dist/standalone.d.ts +10 -0
  49. package/dist/standalone.js +9 -0
  50. package/dist/standalone.js.map +1 -0
  51. package/dist/webpack-loader.d.ts +3 -0
  52. package/dist/webpack-loader.js +59 -0
  53. package/dist/webpack-loader.js.map +1 -0
  54. package/dist/webpack.d.ts +11 -0
  55. package/dist/webpack.js +63 -0
  56. package/dist/webpack.js.map +1 -0
  57. package/package.json +78 -0
  58. package/skills/annotask-apply/SKILL.md +133 -0
  59. package/skills/annotask-init/SKILL.md +230 -0
  60. package/skills/annotask-watch/SKILL.md +45 -0
package/README.md ADDED
@@ -0,0 +1,191 @@
1
+ # Annotask
2
+
3
+ Visual markup tool for web apps. Annotate your UI in the browser — pins, arrows, drawn sections, notes — and Annotask generates structured tasks that AI coding agents apply to your source code. Supports Vue, React, Svelte, Astro, and plain HTML/htmx with Vite and Webpack.
4
+
5
+ ## Workflow
6
+
7
+ ```
8
+ You (in browser) Your coding agent
9
+ ───────────────── ──────────────────
10
+ Open Annotask shell
11
+ Annotate the UI:
12
+ pin elements, draw
13
+ sections, add notes, ──> /annotask-apply
14
+ describe what you want Reads tasks from Annotask API
15
+ Edits source files
16
+ Marks tasks as "ready for review"
17
+ Review changes in <──
18
+ Annotask shell:
19
+ Accept ✓ or Deny ✗
20
+ (denied tasks return
21
+ with your feedback
22
+ for the agent to retry)
23
+ ```
24
+
25
+ ### How it works
26
+
27
+ 1. **You mark up the UI** — Use the Annotask shell to annotate elements: pin a component and describe what you want changed, draw a section where new content should go, highlight text that needs editing, or drop arrows showing where things should move.
28
+
29
+ 2. **Tasks are created** — Each annotation becomes a structured task with full context: source file, line number, component name, element tag, surrounding layout, and your intent in plain language.
30
+
31
+ 3. **Your coding agent applies the tasks** — Invoke `/annotask-apply` in Claude Code (or the equivalent skill in your agent). It fetches pending tasks from the Annotask API, edits the source files, and marks each task as ready for review.
32
+
33
+ 4. **You review** — Back in the Annotask shell, accept or deny each change. Denied tasks return to the queue with your feedback so the agent can retry with corrections.
34
+
35
+ ## Agent Setup
36
+
37
+ Annotask ships skills for AI coding agents. Install them into your project:
38
+
39
+ ```bash
40
+ npx annotask init-skills
41
+ ```
42
+
43
+ This copies skill files to `.claude/skills/` and `.agents/skills/` so your agent can discover them.
44
+
45
+ | Agent | Skill directory | Notes |
46
+ |-------|----------------|-------|
47
+ | Claude Code | `.claude/skills/` | Invoke with `/annotask-apply`, `/annotask-init`, `/annotask-watch` |
48
+ | GitHub Copilot | `.agents/skills/` | Auto-discovered by Copilot agents |
49
+ | OpenAI Codex | `.agents/skills/` | Uses the same `.agents/` convention |
50
+ | Other agents | `.agents/skills/` | Any agent that reads `.agents/skills/` |
51
+
52
+ ### Skills
53
+
54
+ | Skill | What it does |
55
+ |-------|-------------|
56
+ | `/annotask-init` | Scans your project and generates `.annotask/design-spec.json` with detected tokens, fonts, colors, and component library. Run once per project. |
57
+ | `/annotask-apply` | Fetches pending tasks from the Annotask API, applies changes to source files, and marks them for review. |
58
+ | `/annotask-watch` | Streams live changes from the Annotask WebSocket so your agent can narrate what you're doing in real time. |
59
+
60
+ ## Quick Start
61
+
62
+ ```bash
63
+ npm install -D annotask
64
+ ```
65
+
66
+ ### Vite (Vue, React, Svelte, or plain HTML)
67
+
68
+ ```ts
69
+ import { annotask } from 'annotask'
70
+
71
+ export default defineConfig({
72
+ plugins: [
73
+ vue(), // or react() or svelte() — omit for plain HTML/htmx
74
+ annotask(),
75
+ ],
76
+ })
77
+ ```
78
+
79
+ ### Astro
80
+
81
+ ```js
82
+ import { defineConfig } from 'astro/config'
83
+ import { annotask } from 'annotask'
84
+
85
+ export default defineConfig({
86
+ vite: {
87
+ plugins: [annotask()],
88
+ },
89
+ })
90
+ ```
91
+
92
+ Astro source mapping uses Astro's native `data-astro-source-*` attributes — no extra configuration needed.
93
+
94
+ ### Webpack
95
+
96
+ ```ts
97
+ import { AnnotaskWebpackPlugin } from 'annotask/webpack'
98
+
99
+ // Add to your webpack config plugins (dev only):
100
+ plugins: [new AnnotaskWebpackPlugin()]
101
+ ```
102
+
103
+ Start your dev server, then open:
104
+ - **App**: `http://localhost:5173/` (Vite) or `http://localhost:8090/` (Webpack)
105
+ - **Annotask**: `http://localhost:5173/__annotask/`
106
+
107
+ ## Features
108
+
109
+ ### Annotation tools (primary)
110
+ - **Pins** — Pin an element and describe what you want changed
111
+ - **Arrows** — Draw arrows to reference other elements or parts of the page
112
+ - **Drawn sections** — Draw a rectangle where new content should go, with a prompt
113
+ - **Text highlights** — Select text to mark it for editing
114
+ - **Notes** — Attach free-text design notes to any element
115
+
116
+ ### Visual editing (experimental)
117
+ - **Element inspection** — Click any element to see its source file, line, component, and computed styles
118
+ - **Live style editing** — Modify layout, spacing, size, colors, and typography with immediate preview
119
+ - **Class editing** — Add, remove, or modify CSS classes on elements
120
+ - **Theme token editing** — Edit design tokens (colors, typography, spacing, borders) from a detected design spec
121
+
122
+ ### Infrastructure
123
+ - **Change reports** — Structured JSON of all changes, ready for agents to consume
124
+ - **Task pipeline** — Create, review, accept, or deny design change tasks
125
+ - **CLI** — `annotask watch` for live streaming, `annotask report` for current state
126
+ - **API** — HTTP and WebSocket endpoints for programmatic access
127
+
128
+ ## CLI
129
+
130
+ ```bash
131
+ annotask watch # Live stream of changes
132
+ annotask report # Fetch current report JSON
133
+ annotask status # Check connection
134
+ annotask init-skills # Install agent skills into your project
135
+ ```
136
+
137
+ ## API
138
+
139
+ - `GET /__annotask/api/report` — Current change report
140
+ - `GET /__annotask/api/tasks` — Task list
141
+ - `POST /__annotask/api/tasks` — Create a task
142
+ - `PATCH /__annotask/api/tasks/:id` — Update task status
143
+ - `GET /__annotask/api/status` — Health check
144
+ - `ws://localhost:5173/__annotask/ws` — Live WebSocket stream
145
+
146
+ ## Supported Frameworks
147
+
148
+ | Framework | Vite | Webpack |
149
+ |-----------|------|---------|
150
+ | Vue 3 | Yes | Yes |
151
+ | React | Yes | Yes |
152
+ | Svelte | Yes | Yes |
153
+ | Astro | Yes | — |
154
+ | Plain HTML| Yes | — |
155
+ | htmx | Yes | — |
156
+
157
+ ## Limitations
158
+
159
+ - **Dev mode only** — Annotask only runs in dev servers (Vite or Webpack), never in production builds
160
+ - **Local only** — API and WebSocket endpoints are unauthenticated (same model as Vite HMR)
161
+ - **Source mapping** — Works best with component files (`.vue`, `.tsx`, `.svelte`, `.astro`, `.html`); dynamic components and render functions may not map correctly
162
+
163
+ ## Development
164
+
165
+ ```bash
166
+ pnpm install
167
+ pnpm build # Build shell + plugin + CLI
168
+ pnpm dev:vue-vite # Start Vue test app with Annotask
169
+ pnpm test # Run tests
170
+ pnpm test:e2e # Run E2E tests (all frameworks)
171
+ ```
172
+
173
+ ## Project Structure
174
+
175
+ - `src/plugin/` — Vite plugin (multi-framework transform, toggle button, bridge client)
176
+ - `src/server/` — HTTP API, WebSocket server, shell serving, project state
177
+ - `src/webpack/` — Webpack plugin and transform loader
178
+ - `src/shell/` — Design tool UI (Vue 3 app, pre-built into dist/shell/)
179
+ - `src/shared/` — Shared types (postMessage bridge protocol)
180
+ - `src/schema.ts` — TypeScript types for change reports
181
+ - `src/cli/` — CLI tool for terminal interaction
182
+ - `skills/` — Agent skill definitions (shipped with the npm package)
183
+ - `playgrounds/` — Test apps (vue-vite, vue-webpack, react-vite, svelte-vite, html-vite, astro, htmx-vite)
184
+
185
+ ## Troubleshooting
186
+
187
+ **Elements don't show source info**: Make sure your framework plugin (Vue, React, or Svelte) is installed and the Annotask plugin is listed after it in your Vite config. The transform needs to run before the framework compiler processes the source. For Astro, source mapping is automatic via Astro's native attributes. For plain HTML/htmx, source mapping is injected via `transformIndexHtml`.
188
+
189
+ **WebSocket not connecting**: Ensure the dev server is running. The CLI and shell connect to `/__annotask/ws` on the same port as your dev server.
190
+
191
+ **Changes not appearing in report**: Only style and class changes that differ from computed values are included. If before and after are identical, the change is filtered out.