Skip to content

Commit 04e1fe8

Browse files
committed
Shell polish and apply-skill guidance, v0.0.35
- 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
1 parent feefada commit 04e1fe8

15 files changed

Lines changed: 221 additions & 74 deletions

File tree

.agents/skills/annotask-apply/SKILL.md

Lines changed: 103 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -14,20 +14,30 @@ Use this skill when the user says:
1414

1515
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.
1616

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+
1723
## Steps
1824

1925
### 0. Check server status
2026

27+
**MCP:** If you have MCP tools, the server is already running — skip this step.
28+
2129
```bash
22-
npx annotask status
30+
npx annotask status --mcp
2331
```
2432

2533
If this fails, the Annotask dev server isn't running. Ask the user to start it.
2634

2735
### 1. Fetch pending tasks
2836

37+
**MCP:** `annotask_get_tasks(status: "pending")` — returns compact summaries. Use `detail: true` for full objects.
38+
2939
```bash
30-
npx annotask tasks
40+
npx annotask tasks --mcp --status=pending
3141
```
3242

3343
Response (compact task summaries):
@@ -37,17 +47,19 @@ Response (compact task summaries):
3747

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

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

4252
### Screenshot reference
4353

4454
Some tasks include a `screenshot` field. The screenshot shows exactly what the user sees in the browser. To view it:
4555

56+
**MCP:** `annotask_get_screenshot(task_id: "TASK_ID")` — returns base64-encoded PNG directly.
57+
4658
```bash
4759
npx annotask screenshot TASK_ID
4860
```
4961

50-
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.)
5163

5264
### 2. Process each pending task — one at a time
5365

@@ -57,23 +69,90 @@ Filter for `status: "pending"` and `status: "denied"` (with `feedback`) tasks. A
5769

5870
Mark it `in_progress` so the user sees you're working on it:
5971

72+
**MCP:** `annotask_update_task(task_id: "TASK_ID", status: "in_progress")`
73+
74+
```bash
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+
6095
```bash
61-
npx annotask update-task TASK_ID --status=in_progress
96+
npx annotask design-spec --category=colors --mcp
6297
```
6398

64-
#### 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 (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`.
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 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
65144

66145
Read the task type and apply accordingly:
67146

68147
- **`annotation` with `action: "text_edit"`**: The `description` field says what text to change. Find the text in the source file and apply the edit.
69148

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

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.**
73152

74153
- **`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.
75154

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

78157
- **`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`.
79158

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

96-
#### c. Ask for clarification (only when stuck)
175+
#### e. Ask for clarification (only when stuck)
97176

98177
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:
99178

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+
100181
```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"}]}'
102183
```
103184

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

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

118199
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:
119200

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+
120203
```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."
122205
```
123206

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

130-
#### e. Mark for review immediately
213+
#### g. Mark for review immediately
131214

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

217+
**MCP:** `annotask_update_task(task_id: "TASK_ID", status: "review", resolution: "Swapped grid to flexbox, added gap-4 for spacing")`
218+
134219
```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
136221
```
137222

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

140-
#### f. Move to the next task
225+
#### h. Move to the next task
141226

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

144229
### 3. Report to the user
145230

0 commit comments

Comments
 (0)