You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- Move shell CSS partials into src/shell/styles/
- Switch to inspector panel when scan-a11y triggered from toolbar
- Drop "Insert as task" from component preview (libraries page)
- Apply skill: require component library search before adding new UI
@@ -14,20 +14,30 @@ Use this skill when the user says:
14
14
15
15
Annotask is a visual markup tool that integrates with Vite and Webpack. The user annotates the page with pins, sticky notes, arrows, text highlights, and drawn sections. These become **tasks** stored in `.annotask/tasks.json` and served via API. This skill fetches pending tasks, applies them, and marks them for review.
16
16
17
+
## MCP preference
18
+
19
+
If you have `annotask_*` MCP tools available, prefer them over CLI commands — they return structured data directly, are faster, and avoid shell/npx issues. If MCP tools are not available, use the CLI commands shown below.
20
+
21
+
**Always pass `--mcp` to CLI commands.** The flag emits compact JSON that matches the MCP tool response shapes exactly (no ANSI colors, no human prefixes, `visual` stripped, `agent_feedback` trimmed). That way the same parsing logic works whether you're calling the MCP tool or the CLI fallback.
22
+
17
23
## Steps
18
24
19
25
### 0. Check server status
20
26
27
+
**MCP:** If you have MCP tools, the server is already running — skip this step.
28
+
21
29
```bash
22
-
npx annotask status
30
+
npx annotask status --mcp
23
31
```
24
32
25
33
If this fails, the Annotask dev server isn't running. Ask the user to start it.
26
34
27
35
### 1. Fetch pending tasks
28
36
37
+
**MCP:**`annotask_get_tasks(status: "pending")` — returns compact summaries. Use `detail: true` for full objects.
Each task summary has: `id`, `type`, `status`, `description`, `file`, `line`, and optionally `component`, `action`, `screenshot`, `feedback` (on denied tasks), `blocked_reason`, `resolution`.
39
49
40
-
For full task details (context, element_context, viewport, interaction_history, agent_feedback), use the `annotask_get_task` MCP tool with a specific task ID. Only fetch full details when the summary doesn't provide enough context to apply the change.
50
+
For full task details (context, element_context, viewport, interaction_history, agent_feedback), use `annotask_get_task` MCP tool or `npx annotask task <id> --mcp` for a single task (`npx annotask tasks --mcp --detail` for the full list). Only fetch full details when the summary doesn't provide enough context to apply the change.
41
51
42
52
### Screenshot reference
43
53
44
54
Some tasks include a `screenshot` field. The screenshot shows exactly what the user sees in the browser. To view it:
This downloads the PNG to `.annotask/screenshots/`. Use it as visual context alongside the task description and source code.
62
+
This downloads the PNG to `.annotask/screenshots/`. Use it as visual context alongside the task description and source code. (The screenshot command writes the file on disk — `--mcp` doesn't apply.)
51
63
52
64
### 2. Process each pending task — one at a time
53
65
@@ -57,23 +69,90 @@ Filter for `status: "pending"` and `status: "denied"` (with `feedback`) tasks. A
57
69
58
70
Mark it `in_progress` so the user sees you're working on it:
Before making any design or styling decisions, fetch the project's design spec to ensure consistency with existing tokens (colors, typography, spacing, borders, etc.):
-**Style updates** — Use design tokens instead of arbitrary colors or spacing values
101
+
-**Typography changes** — Reference the font scale and families from the spec
102
+
-**Responsive design** — Use detected breakpoints when adding media queries
103
+
-**New components** — Match the design system when creating new UI
104
+
105
+
**How to apply:**
106
+
- For color changes, use token names (e.g., `--color-primary`) instead of hardcoded hex values
107
+
- For spacing/sizing, use the project's scale (e.g., Tailwind scale: xs, sm, base, lg, xl)
108
+
- For responsive design, use the detected breakpoints
109
+
- Document the token reference in your resolution note (e.g., "Applied primary color token")
110
+
111
+
#### c. Find relevant components (required when adding any UI element)
112
+
113
+
If the task asks you to add, insert, or create a UI element of any kind — a table, button, card, modal, input, dropdown, form, list, nav, etc. — you **must** search the component library first before writing HTML from scratch. This applies to all task types: `section_request`, `annotation` with actions like `add_column`/`add_row`/`wrap_container`, and free-text `annotation` notes whose `description` implies new UI.
114
+
115
+
**MCP:**`annotask_get_components(search: "button")` — returns matching components from registered libraries with names, descriptions, and prop signatures. Limit results with `limit`, offset with `offset`, filter by `library`.
For a specific component, get its full prop signature:
127
+
128
+
```bash
129
+
npx annotask component Button --mcp
130
+
```
131
+
132
+
**When to use:**
133
+
-**Section requests** — Instead of creating HTML from scratch, search for relevant components and compose them
134
+
-**UI additions** — Check if a table, button, card, modal, input, form, list, or nav component already exists before writing custom HTML
135
+
-**Styling consistency** — Using library components ensures your changes match the design system
136
+
137
+
**How to apply:**
138
+
- Search for components matching the intent (e.g., "table" if adding tabular data, "dropdown" if adding a select menu)
139
+
- Read the props to understand customization options (variant, size, disabled, etc.)
140
+
- Use the component in your JSX/Vue/Svelte code with appropriate props
141
+
- Document the component reference in your resolution note
142
+
143
+
#### d. Apply the change
65
144
66
145
Read the task type and apply accordingly:
67
146
68
147
-**`annotation` with `action: "text_edit"`**: The `description` field says what text to change. Find the text in the source file and apply the edit.
69
148
70
-
-**`annotation` with other actions** (`add_column`, `add_row`, `wrap_container`, `delete`, `duplicate`, `move_up`, `move_down`): Apply the structural change described in `description`.
149
+
-**`annotation` with other actions** (`add_column`, `add_row`, `wrap_container`, `delete`, `duplicate`, `move_up`, `move_down`): Apply the structural change described in `description`. If the action adds new UI (e.g. `add_row` into a table that doesn't exist yet, or `wrap_container` that introduces a new component), run step c first.
71
150
72
-
-**`annotation` with no action**: This is a free-text note. Read `description` and apply your best judgment to the source code. If `context.to_element` is present, this is an arrow annotation referencing two elements.
151
+
-**`annotation` with no action**: This is a free-text note. Read `description` and apply your best judgment to the source code. If `context.to_element` is present, this is an arrow annotation referencing two elements.**If the description asks you to add, insert, or create any UI element (e.g. "add a table", "put a form here", "insert a card"), you must run step c (component library search) before writing HTML.**
73
152
74
153
-**`style_update`**: Apply CSS property changes. The `context.changes` array contains each change with `property`, `before`, and `after` values. Use scoped styles, inline styles, or Tailwind classes based on project patterns.
75
154
76
-
-**`section_request`**: Create a new section in the template near the referenced element. The `description` field describes what content to create. `placement` gives spatial hints.
155
+
-**`section_request`**: Create a new section in the template near the referenced element. The `description` field describes what content to create. `placement` gives spatial hints. Use the design spec (step b) and component library search (step c) to find relevant components and tokens before writing custom HTML.
77
156
78
157
-**`a11y_fix`**: Fix an accessibility violation. The `context` contains `rule` (axe rule ID), `impact`, `help` (what to fix), `helpUrl` (WCAG reference), and `elements` array with `html` snippets, `selector`, `fix` suggestions, and source `file`/`line`/`component`.
79
158
@@ -93,12 +172,14 @@ Read the task type and apply accordingly:
93
172
- If `isNew` is true: add the new variable/config entry in the most appropriate location (`:root` block in the main CSS file, or Tailwind config `theme.extend`).
94
173
- After applying, update `.annotask/design-spec.json` to reflect the new value so the Theme page stays in sync.
95
174
96
-
#### c. Ask for clarification (only when stuck)
175
+
#### e. Ask for clarification (only when stuck)
97
176
98
177
If you are **genuinely stuck** — missing API context, unclear library usage, ambiguous intent that could lead to a wrong implementation — ask the user for clarification instead of guessing:
99
178
179
+
**MCP:**`annotask_update_task(task_id: "TASK_ID", questions: [{"id":"q1","text":"Which auth library should I use?","type":"choice","options":["NextAuth","Clerk","Custom"]},{"id":"q2","text":"Where is the session config located?","type":"text"}])`
180
+
100
181
```bash
101
-
npx annotask update-task TASK_ID --ask='{"message":"Optional markdown context","questions":[{"id":"q1","text":"Which auth library should I use?","type":"choice","options":["NextAuth","Clerk","Custom"]},{"id":"q2","text":"Where is the session config located?","type":"text"}]}'
182
+
npx annotask update-task TASK_ID --mcp --ask='{"message":"Optional markdown context","questions":[{"id":"q1","text":"Which auth library should I use?","type":"choice","options":["NextAuth","Clerk","Custom"]},{"id":"q2","text":"Where is the session config located?","type":"text"}]}'
102
183
```
103
184
104
185
This sets the task to `needs_info` status. The user sees your questions in the Annotask UI and responds there. When answered, the task returns to `in_progress` with answers in `agent_feedback`.
@@ -111,14 +192,16 @@ This sets the task to `needs_info` status. The user sees your questions in the A
111
192
- Only ask when you truly cannot proceed — do not ask for confirmation on straightforward tasks
112
193
- Be specific: "Which CSS framework should I use for the grid?" is better than "How should I do this?"
113
194
- Combine related questions into a single ask rather than multiple rounds
114
-
- After asking, move on to the next task. Come back to check answers later via `npx annotask tasks`
195
+
- After asking, move on to the next task. Come back to check answers later via `annotask_get_tasks` MCP tool or `npx annotask tasks --mcp`
115
196
116
-
#### d. Mark as blocked (when the task can't be done)
197
+
#### f. Mark as blocked (when the task can't be done)
117
198
118
199
If the task is **fundamentally outside your control** — a performance issue in a third-party library, an accessibility bug in a dependency, a config change that requires infrastructure access, etc. — mark it as blocked with an explanation:
119
200
201
+
**MCP:**`annotask_update_task(task_id: "TASK_ID", blocked_reason: "This layout shift is caused by vue-router v4's async route loading. Needs upstream fix or a loading skeleton wrapper — cannot be resolved by editing component code alone.")`
202
+
120
203
```bash
121
-
npx annotask update-task TASK_ID --blocked-reason="This layout shift is caused by vue-router v4's async route loading. Needs upstream fix or a loading skeleton wrapper — cannot be resolved by editing component code alone."
204
+
npx annotask update-task TASK_ID --mcp --blocked-reason="This layout shift is caused by vue-router v4's async route loading. Needs upstream fix or a loading skeleton wrapper — cannot be resolved by editing component code alone."
122
205
```
123
206
124
207
This sets the task to `blocked` status automatically. The user sees your explanation and can either **dismiss** the task or **push back** (deny it with feedback asking you to try a different approach).
@@ -127,19 +210,21 @@ This sets the task to `blocked` status automatically. The user sees your explana
127
210
-`needs_info` = "I can do this, but I need more information from you"
128
211
-`blocked` = "This can't be done through source code changes — here's why"
129
212
130
-
#### e. Mark for review immediately
213
+
#### g. Mark for review immediately
131
214
132
215
As soon as you finish applying **this** task, mark it for review with a brief resolution note:
133
216
217
+
**MCP:**`annotask_update_task(task_id: "TASK_ID", status: "review", resolution: "Swapped grid to flexbox, added gap-4 for spacing")`
218
+
134
219
```bash
135
-
npx annotask update-task TASK_ID --status=review --resolution="Swapped grid to flexbox, added gap-4 for spacing"
220
+
npx annotask update-task TASK_ID --status=review --resolution="Swapped grid to flexbox, added gap-4 for spacing" --mcp
136
221
```
137
222
138
223
Keep resolutions short — one sentence describing what you changed, not why. The user sees it in the Annotask shell alongside the diff.
139
224
140
-
#### f. Move to the next task
225
+
#### h. Move to the next task
141
226
142
-
Repeat steps a–c for each remaining pending task. This way the user gets incremental feedback — they can accept or deny early tasks while later ones are still being applied.
227
+
Repeat steps a–g for each remaining pending task. This way the user gets incremental feedback — they can accept or deny early tasks while later ones are still being applied.
0 commit comments