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
Add design spec and component library guidance to annotask-apply skill
Includes new sections on:
- Referencing design spec for consistent tokens and styling
- Searching component libraries before creating new UI
- Updated section_request guidance to use both resources
Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
Copy file name to clipboardExpand all lines: skills/annotask-apply/SKILL.md
+83-16Lines changed: 83 additions & 16 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -18,14 +18,16 @@ Annotask is a visual markup tool that integrates with Vite and Webpack. The user
18
18
19
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
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
+
21
23
## Steps
22
24
23
25
### 0. Check server status
24
26
25
27
**MCP:** If you have MCP tools, the server is already running — skip this step.
26
28
27
29
```bash
28
-
npx annotask status
30
+
npx annotask status --mcp
29
31
```
30
32
31
33
If this fails, the Annotask dev server isn't running. Ask the user to start it.
@@ -35,7 +37,7 @@ If this fails, the Annotask dev server isn't running. Ask the user to start it.
35
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`.
47
49
48
-
For full task details (context, element_context, viewport, interaction_history, agent_feedback), use `annotask_get_task` MCP tool or `npx annotask tasks --pretty`. 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.
49
51
50
52
### Screenshot reference
51
53
@@ -57,7 +59,7 @@ Some tasks include a `screenshot` field. The screenshot shows exactly what the u
57
59
npx annotask screenshot TASK_ID
58
60
```
59
61
60
-
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.)
61
63
62
64
### 2. Process each pending task — one at a time
63
65
@@ -70,10 +72,75 @@ 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 (optional but recommended)
112
+
113
+
Before applying structural changes (e.g., `section_request`, new UI elements), check if there are existing components in the project's component library that you can reuse:
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 button, card, modal, or input 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., "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
77
144
78
145
Read the task type and apply accordingly:
79
146
@@ -85,7 +152,7 @@ Read the task type and apply accordingly:
85
152
86
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.
87
154
88
-
-**`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.
89
156
90
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`.
91
158
@@ -105,14 +172,14 @@ Read the task type and apply accordingly:
105
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`).
106
173
- After applying, update `.annotask/design-spec.json` to reflect the new value so the Theme page stays in sync.
107
174
108
-
#### c. Ask for clarification (only when stuck)
175
+
#### e. Ask for clarification (only when stuck)
109
176
110
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:
111
178
112
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"}])`
113
180
114
181
```bash
115
-
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"}]}'
116
183
```
117
184
118
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`.
@@ -125,16 +192,16 @@ This sets the task to `needs_info` status. The user sees your questions in the A
125
192
- Only ask when you truly cannot proceed — do not ask for confirmation on straightforward tasks
126
193
- Be specific: "Which CSS framework should I use for the grid?" is better than "How should I do this?"
127
194
- Combine related questions into a single ask rather than multiple rounds
128
-
- After asking, move on to the next task. Come back to check answers later via `annotask_get_tasks` MCP tool or `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`
129
196
130
-
#### d. Mark as blocked (when the task can't be done)
197
+
#### f. Mark as blocked (when the task can't be done)
131
198
132
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:
133
200
134
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.")`
135
202
136
203
```bash
137
-
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."
138
205
```
139
206
140
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).
@@ -143,21 +210,21 @@ This sets the task to `blocked` status automatically. The user sees your explana
143
210
-`needs_info` = "I can do this, but I need more information from you"
144
211
-`blocked` = "This can't be done through source code changes — here's why"
145
212
146
-
#### e. Mark for review immediately
213
+
#### g. Mark for review immediately
147
214
148
215
As soon as you finish applying **this** task, mark it for review with a brief resolution note:
149
216
150
217
**MCP:**`annotask_update_task(task_id: "TASK_ID", status: "review", resolution: "Swapped grid to flexbox, added gap-4 for spacing")`
151
218
152
219
```bash
153
-
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
154
221
```
155
222
156
223
Keep resolutions short — one sentence describing what you changed, not why. The user sees it in the Annotask shell alongside the diff.
157
224
158
-
#### f. Move to the next task
225
+
#### h. Move to the next task
159
226
160
-
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