Skip to content

Commit ab2f7a5

Browse files
kurtstohrerclaude
andcommitted
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>
1 parent a9ce886 commit ab2f7a5

10 files changed

Lines changed: 83 additions & 16 deletions

File tree

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

skills/annotask-apply/SKILL.md

Lines changed: 83 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,16 @@ Annotask is a visual markup tool that integrates with Vite and Webpack. The user
1818

1919
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.
2020

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+
2123
## Steps
2224

2325
### 0. Check server status
2426

2527
**MCP:** If you have MCP tools, the server is already running — skip this step.
2628

2729
```bash
28-
npx annotask status
30+
npx annotask status --mcp
2931
```
3032

3133
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.
3537
**MCP:** `annotask_get_tasks(status: "pending")` — returns compact summaries. Use `detail: true` for full objects.
3638

3739
```bash
38-
npx annotask tasks
40+
npx annotask tasks --mcp --status=pending
3941
```
4042

4143
Response (compact task summaries):
@@ -45,7 +47,7 @@ Response (compact task summaries):
4547

4648
Each task summary has: `id`, `type`, `status`, `description`, `file`, `line`, and optionally `component`, `action`, `screenshot`, `feedback` (on denied tasks), `blocked_reason`, `resolution`.
4749

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.
4951

5052
### Screenshot reference
5153

@@ -57,7 +59,7 @@ Some tasks include a `screenshot` field. The screenshot shows exactly what the u
5759
npx annotask screenshot TASK_ID
5860
```
5961

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.)
6163

6264
### 2. Process each pending task — one at a time
6365

@@ -70,10 +72,75 @@ Mark it `in_progress` so the user sees you're working on it:
7072
**MCP:** `annotask_update_task(task_id: "TASK_ID", status: "in_progress")`
7173

7274
```bash
73-
npx annotask update-task TASK_ID --status=in_progress
75+
npx annotask update-task TASK_ID --status=in_progress --mcp
76+
```
77+
78+
#### b. Reference the design spec for consistency
79+
80+
Before making any design or styling decisions, fetch the project's design spec to ensure consistency with existing tokens (colors, typography, spacing, borders, etc.):
81+
82+
**MCP:** `annotask_get_design_spec()` — returns design tokens summary, framework detection (Tailwind, CSS-in-JS, etc.), and responsive breakpoints.
83+
84+
```bash
85+
npx annotask design-spec --mcp
86+
```
87+
88+
Response example:
89+
```json
90+
{"version":"1.0","framework":"tailwind","tokens":{"colors":{"primary":"#3b82f6","secondary":"#8b5cf6"},"typography":{"scale":["xs","sm","base","lg","xl"],"families":["Inter","Roboto"]}},"breakpoints":{"sm":"640px","md":"768px","lg":"1024px"}}
91+
```
92+
93+
For detailed tokens in a specific category:
94+
95+
```bash
96+
npx annotask design-spec --category=colors --mcp
7497
```
7598

76-
#### b. Apply the change
99+
**When to use:**
100+
- **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`.
116+
117+
```bash
118+
npx annotask components "button" --mcp
119+
```
120+
121+
Response example:
122+
```json
123+
{"version":"1.0","libraries":[{"name":"antenna","components":[{"name":"Button","description":"Primary button component","props":{"variant":{"type":"string","default":"primary","options":["primary","secondary","tertiary"]},"size":{"type":"string","default":"md"},"disabled":{"type":"boolean"}}}]}]}
124+
```
125+
126+
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
77144

78145
Read the task type and apply accordingly:
79146

@@ -85,7 +152,7 @@ Read the task type and apply accordingly:
85152

86153
- **`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.
87154

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.
89156

90157
- **`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`.
91158

@@ -105,14 +172,14 @@ Read the task type and apply accordingly:
105172
- 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`).
106173
- After applying, update `.annotask/design-spec.json` to reflect the new value so the Theme page stays in sync.
107174

108-
#### c. Ask for clarification (only when stuck)
175+
#### e. Ask for clarification (only when stuck)
109176

110177
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:
111178

112179
**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"}])`
113180

114181
```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"}]}'
116183
```
117184

118185
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
125192
- Only ask when you truly cannot proceed — do not ask for confirmation on straightforward tasks
126193
- Be specific: "Which CSS framework should I use for the grid?" is better than "How should I do this?"
127194
- 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`
129196

130-
#### d. Mark as blocked (when the task can't be done)
197+
#### f. Mark as blocked (when the task can't be done)
131198

132199
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:
133200

134201
**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.")`
135202

136203
```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."
138205
```
139206

140207
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
143210
- `needs_info` = "I can do this, but I need more information from you"
144211
- `blocked` = "This can't be done through source code changes — here's why"
145212

146-
#### e. Mark for review immediately
213+
#### g. Mark for review immediately
147214

148215
As soon as you finish applying **this** task, mark it for review with a brief resolution note:
149216

150217
**MCP:** `annotask_update_task(task_id: "TASK_ID", status: "review", resolution: "Swapped grid to flexbox, added gap-4 for spacing")`
151218

152219
```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
154221
```
155222

156223
Keep resolutions short — one sentence describing what you changed, not why. The user sees it in the Annotask shell alongside the diff.
157224

158-
#### f. Move to the next task
225+
#### h. Move to the next task
159226

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.
161228

162229
### 3. Report to the user
163230

0 commit comments

Comments
 (0)