@skilly-hand/skilly-hand 0.7.0 → 0.8.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.
- package/CHANGELOG.md +17 -0
- package/catalog/README.md +3 -0
- package/catalog/catalog-index.json +3 -0
- package/catalog/skills/frontend-design/SKILL.md +237 -0
- package/catalog/skills/frontend-design/agents/component-designer.md +95 -0
- package/catalog/skills/frontend-design/agents/stack-detector.md +154 -0
- package/catalog/skills/frontend-design/assets/stack-scan-checklist.md +58 -0
- package/catalog/skills/frontend-design/manifest.json +27 -0
- package/catalog/skills/life-guard/SKILL.md +180 -0
- package/catalog/skills/life-guard/assets/committee-member-template.md +44 -0
- package/catalog/skills/life-guard/assets/safety-guard-template.md +47 -0
- package/catalog/skills/life-guard/manifest.json +33 -0
- package/catalog/skills/test-driven-development/SKILL.md +159 -0
- package/catalog/skills/test-driven-development/assets/tdd-cycle.md +487 -0
- package/catalog/skills/test-driven-development/manifest.json +25 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -16,6 +16,23 @@ All notable changes to this project are documented in this file.
|
|
|
16
16
|
### Removed
|
|
17
17
|
- _None._
|
|
18
18
|
|
|
19
|
+
## [0.8.0] - 2026-04-04
|
|
20
|
+
[View on npm](https://www.npmjs.com/package/@skilly-hand/skilly-hand/v/0.8.0)
|
|
21
|
+
|
|
22
|
+
### Added
|
|
23
|
+
- Added portable skill `frontend-design` for project-aware UI component design that enforces stack detection before any design work.
|
|
24
|
+
- Added portable skill `life-guard` for multi-perspective code and decision review using a committee + domain expert safety guard pattern.
|
|
25
|
+
- Added portable skill `test-driven-development` for guiding the RED → GREEN → REFACTOR TDD cycle.
|
|
26
|
+
|
|
27
|
+
### Changed
|
|
28
|
+
- _None._
|
|
29
|
+
|
|
30
|
+
### Fixed
|
|
31
|
+
- _None._
|
|
32
|
+
|
|
33
|
+
### Removed
|
|
34
|
+
- _None._
|
|
35
|
+
|
|
19
36
|
## [0.7.0] - 2026-04-04
|
|
20
37
|
[View on npm](https://www.npmjs.com/package/@skilly-hand/skilly-hand/v/0.7.0)
|
|
21
38
|
|
package/catalog/README.md
CHANGED
|
@@ -8,8 +8,11 @@ Published portable skills consumed by the `skilly-hand` CLI.
|
|
|
8
8
|
| `agents-root-orchestrator` | Author root AGENTS.md as a Where/What/When orchestrator that routes tasks and skill invocation clearly. | core, workflow, orchestration | all |
|
|
9
9
|
| `angular-guidelines` | Guide Angular code generation and review using latest stable Angular verification and modern framework best practices. | angular, frontend, workflow, best-practices | all |
|
|
10
10
|
| `figma-mcp-0to1` | Guide users from Figma MCP installation and authentication through first canvas creation, with function-level tool coverage and operational recovery patterns. | figma, mcp, workflow, design | all |
|
|
11
|
+
| `frontend-design` | Project-aware frontend design skill that detects the existing tech stack, UI libraries, CSS variables, and design tokens before proposing any UI work. Never invents design decisions — reads the project first, confirms with the user, then designs. | frontend, design, workflow, ui | all |
|
|
12
|
+
| `life-guard` | Review code, decisions, and artifacts through a multi-perspective committee and a domain expert safety guard, then synthesize a structured verdict. | core, review, workflow, quality | all |
|
|
11
13
|
| `skill-creator` | Create and standardize AI skills with reusable structure, metadata rules, and templates. | core, workflow, authoring | all |
|
|
12
14
|
| `spec-driven-development` | Plan, execute, and verify multi-step work through versioned specs with small, testable tasks. | core, workflow, planning | all |
|
|
15
|
+
| `test-driven-development` | Guide implementation using the RED → GREEN → REFACTOR TDD cycle: write a failing test first, write the minimum code to pass, then refactor while tests stay green. | testing, workflow, quality, core | all |
|
|
13
16
|
| `token-optimizer` | Classify task complexity and right-size reasoning depth, context gathering, and response detail to reduce wasted tokens. | core, workflow, efficiency | all |
|
|
14
17
|
|
|
15
18
|
Legacy source remains under `source/legacy/agentic-structure` and is excluded from installation.
|
|
@@ -0,0 +1,237 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: frontend-design
|
|
3
|
+
description: >
|
|
4
|
+
Project-aware frontend design skill that detects the existing tech stack, UI libraries,
|
|
5
|
+
CSS variables, and design tokens before proposing any UI work. Never invents design
|
|
6
|
+
decisions — reads the project first, confirms with the user, then designs.
|
|
7
|
+
Trigger: user asks to build, design, style, or update any UI component, page, or visual element in a frontend project.
|
|
8
|
+
metadata:
|
|
9
|
+
author: skilly-hand
|
|
10
|
+
last-edit: 2026-04-04
|
|
11
|
+
license: Apache-2.0
|
|
12
|
+
version: "1.0.0"
|
|
13
|
+
changelog: "initial release; prevents AI slop design by enforcing project-aware stack detection before any design work; affects all frontend design and styling tasks"
|
|
14
|
+
auto-invoke: "design a component, create a UI, style this page, build a frontend, update the layout"
|
|
15
|
+
allowed-tools: Read, Grep, Glob, Bash, Edit, Write
|
|
16
|
+
allowed-modes:
|
|
17
|
+
- stack-detector # Scan the project for tech stack, UI libs, CSS vars, and design tokens
|
|
18
|
+
- component-designer # Design and implement components following the confirmed project stack
|
|
19
|
+
---
|
|
20
|
+
|
|
21
|
+
# Frontend Design Guide
|
|
22
|
+
|
|
23
|
+
## When to Use
|
|
24
|
+
|
|
25
|
+
Use this skill when:
|
|
26
|
+
|
|
27
|
+
- You are designing, building, or restyling a UI component, page, or layout in an existing project.
|
|
28
|
+
- You are adding new visual elements that must match the project's existing design language.
|
|
29
|
+
- You are refactoring styling or structure of frontend code to align with established patterns.
|
|
30
|
+
- You need to choose between UI components, tokens, or styles already available in the project.
|
|
31
|
+
|
|
32
|
+
Do not use this skill for:
|
|
33
|
+
|
|
34
|
+
- Greenfield design system creation with no existing codebase to read from.
|
|
35
|
+
- Backend, API, or data-layer tasks with no UI surface.
|
|
36
|
+
- Design tool work (Figma, Sketch) unrelated to code implementation.
|
|
37
|
+
- Projects where the user has explicitly opted out of stack detection.
|
|
38
|
+
|
|
39
|
+
---
|
|
40
|
+
|
|
41
|
+
## Routing Map
|
|
42
|
+
|
|
43
|
+
Always run stack detection first. Never skip to design.
|
|
44
|
+
|
|
45
|
+
| Step | Intent | Sub-agent |
|
|
46
|
+
| --- | --- | --- |
|
|
47
|
+
| 0 (always first) | Detect framework, UI library, CSS approach, tokens, and existing patterns | [agents/stack-detector.md](agents/stack-detector.md) |
|
|
48
|
+
| 1 (only after confirmation) | Design and implement components using confirmed stack | [agents/component-designer.md](agents/component-designer.md) |
|
|
49
|
+
|
|
50
|
+
---
|
|
51
|
+
|
|
52
|
+
## Standard Execution Sequence
|
|
53
|
+
|
|
54
|
+
1. **Run stack detection** — always start with `stack-detector`, no exceptions.
|
|
55
|
+
2. **Present findings to the user** — surface the detected stack clearly and ask for explicit confirmation.
|
|
56
|
+
3. **If anything is unclear or ambiguous, ask** — do not proceed with partial or uncertain information.
|
|
57
|
+
4. **Scan existing tokens and components** — read what already exists before proposing anything.
|
|
58
|
+
5. **Design with confirmed context only** — hand off to `component-designer` only after step 2 is complete.
|
|
59
|
+
|
|
60
|
+
---
|
|
61
|
+
|
|
62
|
+
## Critical Patterns
|
|
63
|
+
|
|
64
|
+
### Pattern 1: Tech Stack Detection is Non-Negotiable
|
|
65
|
+
|
|
66
|
+
Before writing a single line of UI code or proposing any design, run [agents/stack-detector.md](agents/stack-detector.md).
|
|
67
|
+
|
|
68
|
+
This means:
|
|
69
|
+
- Reading `package.json` to identify the framework and installed libraries.
|
|
70
|
+
- Detecting CSS approach (Tailwind, CSS Modules, styled-components, Sass, vanilla).
|
|
71
|
+
- Finding existing design tokens (CSS custom properties, theme files, `tokens.json`).
|
|
72
|
+
- Sampling real components from the project to understand naming, structure, and styling conventions.
|
|
73
|
+
|
|
74
|
+
If `package.json` is missing or the project root is unclear, stop and ask the user where to look.
|
|
75
|
+
|
|
76
|
+
Never assume a library is present based on file extensions alone — verify it in dependencies.
|
|
77
|
+
|
|
78
|
+
### Pattern 2: Never Invent Tokens — Read First
|
|
79
|
+
|
|
80
|
+
Before using any color, spacing, font size, border radius, shadow, or z-index value:
|
|
81
|
+
|
|
82
|
+
1. Search for CSS custom properties: `grep -r "var(--" src/`
|
|
83
|
+
2. Check for a theme file: `tailwind.config.ts`, `theme.ts`, `tokens.json`, `_variables.scss`
|
|
84
|
+
3. Check for a design system config: `@mui/material`, `chakra-ui/theme`, `shadcn/ui` config
|
|
85
|
+
|
|
86
|
+
If the token does not exist in the project, do not invent it. Ask the user: "This project doesn't define a token for X. Should I add one, or is there an existing value I missed?"
|
|
87
|
+
|
|
88
|
+
### Pattern 3: Confirm Before Every Design Decision
|
|
89
|
+
|
|
90
|
+
At every fork — layout choice, component variant, color, interaction pattern — if the right answer is not derivable from the existing code, ask the user.
|
|
91
|
+
|
|
92
|
+
Examples of things that require confirmation:
|
|
93
|
+
- Which existing component to base a new one on.
|
|
94
|
+
- Whether to use Tailwind utility classes or a CSS module.
|
|
95
|
+
- Whether to match a specific existing page's spacing rhythm or start fresh.
|
|
96
|
+
- Which breakpoints the project already targets.
|
|
97
|
+
|
|
98
|
+
Short, specific questions are better than long ambiguous ones. One question at a time if possible.
|
|
99
|
+
|
|
100
|
+
### Pattern 4: Follow the Project's Visual Language
|
|
101
|
+
|
|
102
|
+
After stack detection, read 3–5 existing components before proposing any design. Identify:
|
|
103
|
+
- The naming convention (PascalCase components, BEM CSS, camelCase tokens, etc.)
|
|
104
|
+
- The composition pattern (atomic components, compound components, render props, slots)
|
|
105
|
+
- The styling approach (co-located styles, global theme, utility-first classes)
|
|
106
|
+
|
|
107
|
+
Every new component or style must feel like it was written by the same team that wrote the existing code — not imported from a different design system.
|
|
108
|
+
|
|
109
|
+
---
|
|
110
|
+
|
|
111
|
+
## What Not To Do
|
|
112
|
+
|
|
113
|
+
These are the most critical rules. Violating any of them produces AI slop.
|
|
114
|
+
|
|
115
|
+
- **Never assume a UI library is present** without verifying it in `package.json`. Shadcn and Radix look similar in JSX — check the deps.
|
|
116
|
+
- **Never pick colors, fonts, or spacing values not already in the project**. If the project has no purple, do not introduce purple.
|
|
117
|
+
- **Never use Inter as a default font** unless it is explicitly declared in the project. Inter is a sign of uncontextualized AI output.
|
|
118
|
+
- **Never generate a component without reading at least one existing component first**. The project's conventions must be the template.
|
|
119
|
+
- **Never apply a generic layout** (hero + cards + CTA, standard nav + footer) without verifying the project already uses or wants that structure.
|
|
120
|
+
- **Never chain design decisions silently**. If one decision implies a downstream choice (e.g. using a grid library implies a layout system), surface it.
|
|
121
|
+
- **Never proceed after ambiguity**. If the detected stack is inconsistent (e.g., Tailwind and styled-components both present), stop and ask which one is canonical.
|
|
122
|
+
- **Never treat a partial stack detection as complete**. If `package.json` was readable but no component files were found, say so and ask for the component directory.
|
|
123
|
+
- **Never ship a "placeholder" or "you can customize this later" design**. Every value must be intentional and project-derived.
|
|
124
|
+
- **Never skip the confirmation step** even if the stack looks obvious. One confirmation prevents ten corrections.
|
|
125
|
+
|
|
126
|
+
---
|
|
127
|
+
|
|
128
|
+
## Decision Tree
|
|
129
|
+
|
|
130
|
+
```text
|
|
131
|
+
User asks for UI work
|
|
132
|
+
-> Has stack-detector been run and confirmed by user?
|
|
133
|
+
NO -> Run stack-detector, present findings, ask for confirmation
|
|
134
|
+
YES -> Continue
|
|
135
|
+
|
|
136
|
+
Is the requested component similar to an existing one in the project?
|
|
137
|
+
YES -> Read the existing component, use it as the structural and styling template
|
|
138
|
+
NO -> Ask the user which existing component is closest, or if this is a net-new pattern
|
|
139
|
+
|
|
140
|
+
Does the design require a token/value (color, spacing, font) not yet found in the project?
|
|
141
|
+
YES -> Ask the user: add a new token, use an existing one, or clarify?
|
|
142
|
+
NO -> Use the existing token
|
|
143
|
+
|
|
144
|
+
Is the CSS approach Tailwind?
|
|
145
|
+
YES -> Use only classes declared in tailwind.config; no arbitrary values unless project already uses them
|
|
146
|
+
NO -> Continue
|
|
147
|
+
|
|
148
|
+
Is the CSS approach CSS Modules or Sass?
|
|
149
|
+
YES -> Follow the naming convention of existing .module.css or .scss files exactly
|
|
150
|
+
NO -> Continue
|
|
151
|
+
|
|
152
|
+
Is the CSS approach styled-components or CSS-in-JS?
|
|
153
|
+
YES -> Match the theme structure; use theme.colors/spacing/typography from the existing theme provider
|
|
154
|
+
NO -> Use whatever CSS approach was detected; if none detected, ask the user
|
|
155
|
+
|
|
156
|
+
Ready to implement?
|
|
157
|
+
YES -> Hand off to component-designer with full confirmed context
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
---
|
|
161
|
+
|
|
162
|
+
## Code Examples
|
|
163
|
+
|
|
164
|
+
### Example 1: Detecting CSS custom properties in a project
|
|
165
|
+
|
|
166
|
+
```bash
|
|
167
|
+
# Find all CSS variables defined at :root
|
|
168
|
+
grep -rn ":root" src/ --include="*.css" --include="*.scss"
|
|
169
|
+
|
|
170
|
+
# Find all usages of CSS custom properties
|
|
171
|
+
grep -rn "var(--" src/ --include="*.css" --include="*.scss" --include="*.tsx" --include="*.vue"
|
|
172
|
+
```
|
|
173
|
+
|
|
174
|
+
### Example 2: Identifying a Tailwind project and reading its token config
|
|
175
|
+
|
|
176
|
+
```bash
|
|
177
|
+
# Check if Tailwind is installed
|
|
178
|
+
cat package.json | grep tailwind
|
|
179
|
+
|
|
180
|
+
# Read the full color/spacing/font token config
|
|
181
|
+
cat tailwind.config.ts
|
|
182
|
+
```
|
|
183
|
+
|
|
184
|
+
### Example 3: Sampling existing components to learn the pattern
|
|
185
|
+
|
|
186
|
+
```bash
|
|
187
|
+
# Find all component files in a React project
|
|
188
|
+
find src/components -name "*.tsx" | head -5
|
|
189
|
+
|
|
190
|
+
# Read one to understand structure and styling approach
|
|
191
|
+
cat src/components/Button/Button.tsx
|
|
192
|
+
```
|
|
193
|
+
|
|
194
|
+
### Example 4: Detecting shadcn/ui vs MUI vs Chakra
|
|
195
|
+
|
|
196
|
+
```bash
|
|
197
|
+
# shadcn/ui (no package — installed as local files)
|
|
198
|
+
ls src/components/ui/
|
|
199
|
+
|
|
200
|
+
# MUI
|
|
201
|
+
grep '"@mui/material"' package.json
|
|
202
|
+
|
|
203
|
+
# Chakra UI
|
|
204
|
+
grep '"@chakra-ui/react"' package.json
|
|
205
|
+
|
|
206
|
+
# Radix Primitives (often underlies shadcn)
|
|
207
|
+
grep '"@radix-ui' package.json
|
|
208
|
+
```
|
|
209
|
+
|
|
210
|
+
---
|
|
211
|
+
|
|
212
|
+
## Commands
|
|
213
|
+
|
|
214
|
+
```bash
|
|
215
|
+
# Read project dependencies
|
|
216
|
+
cat package.json | grep -A 50 '"dependencies"'
|
|
217
|
+
|
|
218
|
+
# Detect CSS approach from file extensions
|
|
219
|
+
find src -name "*.module.css" | head -3 # CSS Modules
|
|
220
|
+
find src -name "*.module.scss" | head -3 # Sass Modules
|
|
221
|
+
grep -rl "styled-components\|emotion" src/ # CSS-in-JS
|
|
222
|
+
grep -rl "cn(\|clsx\|classnames" src/ # Tailwind class merging
|
|
223
|
+
|
|
224
|
+
# Find design token files
|
|
225
|
+
find . -name "tokens.json" -o -name "theme.ts" -o -name "_variables.scss" 2>/dev/null
|
|
226
|
+
|
|
227
|
+
# List existing components
|
|
228
|
+
find src/components -maxdepth 2 -name "*.tsx" -o -name "*.vue" | head -10
|
|
229
|
+
```
|
|
230
|
+
|
|
231
|
+
---
|
|
232
|
+
|
|
233
|
+
## Resources
|
|
234
|
+
|
|
235
|
+
- Stack detection procedure: [agents/stack-detector.md](agents/stack-detector.md)
|
|
236
|
+
- Component design rules: [agents/component-designer.md](agents/component-designer.md)
|
|
237
|
+
- Full scan checklist: [assets/stack-scan-checklist.md](assets/stack-scan-checklist.md)
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
# Component Designer
|
|
2
|
+
|
|
3
|
+
## Precondition
|
|
4
|
+
|
|
5
|
+
**Do not start without a confirmed stack summary from [stack-detector.md](stack-detector.md).**
|
|
6
|
+
|
|
7
|
+
If the user asks you to design something and no confirmed stack summary exists, respond:
|
|
8
|
+
"Before I design anything, I need to scan the project. Running stack detection first."
|
|
9
|
+
Then invoke stack-detector. Do not skip this, even if the task feels small.
|
|
10
|
+
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
## When to Use
|
|
14
|
+
|
|
15
|
+
Use this agent when:
|
|
16
|
+
|
|
17
|
+
- Stack detection is complete and the user has confirmed the summary.
|
|
18
|
+
- The user asks to build, style, or refactor a specific UI component or page section.
|
|
19
|
+
- You need to design something new that must fit the project's existing visual language.
|
|
20
|
+
|
|
21
|
+
Do not use this agent when:
|
|
22
|
+
|
|
23
|
+
- Stack detection has not been run or confirmed.
|
|
24
|
+
- The request is to redesign the entire application's design system.
|
|
25
|
+
- The user explicitly asks for a greenfield design with no constraints.
|
|
26
|
+
|
|
27
|
+
---
|
|
28
|
+
|
|
29
|
+
## Design Rules
|
|
30
|
+
|
|
31
|
+
These rules are absolute. No exceptions without explicit user confirmation.
|
|
32
|
+
|
|
33
|
+
1. **Use only confirmed tokens.** Every color, spacing, font, shadow, and border-radius value must come from the confirmed stack summary. If a token does not exist, ask before inventing one.
|
|
34
|
+
|
|
35
|
+
2. **Follow the sampled component structure.** The typing pattern, import style, prop naming, and composition approach must match what was observed in the sampled components. Do not introduce patterns from other frameworks or design systems.
|
|
36
|
+
|
|
37
|
+
3. **Match the CSS approach exactly.** If the project uses Tailwind classes, use only classes present in `tailwind.config`. If the project uses CSS Modules, write a co-located `.module.css` file following the existing naming convention. If the project uses a theme object (MUI, Chakra), reference `theme.colors`, `theme.spacing`, etc.
|
|
38
|
+
|
|
39
|
+
4. **Reference existing components, not external patterns.** When a new component is structurally similar to an existing one, start from that existing component. Do not start from a blank slate or an external design system example.
|
|
40
|
+
|
|
41
|
+
5. **No placeholder values.** No `#000`, `16px`, `1rem` hardcoded without a corresponding token. No `/* TODO: replace with brand color */` comments. If you don't have the right value, ask.
|
|
42
|
+
|
|
43
|
+
---
|
|
44
|
+
|
|
45
|
+
## Questioning Protocol
|
|
46
|
+
|
|
47
|
+
At every point of uncertainty, ask the user a short, specific question before proceeding.
|
|
48
|
+
|
|
49
|
+
**Layout questions:**
|
|
50
|
+
- "Should this component use the same grid as [ExistingPage], or does it have different spacing requirements?"
|
|
51
|
+
- "The project breakpoints in tailwind.config are `sm`, `md`, `lg`. Should this component be responsive at all three, or only `md` and above?"
|
|
52
|
+
|
|
53
|
+
**Style questions:**
|
|
54
|
+
- "I see `--color-primary` and `--color-accent` in globals.css. Which one should this button use for its default state?"
|
|
55
|
+
- "The existing Card uses `rounded-md`. Should this modal also use `rounded-md`, or does it need a sharper or rounder corner?"
|
|
56
|
+
|
|
57
|
+
**Interaction / state questions:**
|
|
58
|
+
- "Should this component have a loading state? I don't see a Skeleton or Spinner imported in other components — should I add one or skip it?"
|
|
59
|
+
- "The existing Input has a `disabled` prop. Should this new Select also handle `disabled`?"
|
|
60
|
+
|
|
61
|
+
**Composition questions:**
|
|
62
|
+
- "Do you want this to accept children (composable) or receive structured props (data-driven)? The existing Card uses both — which pattern fits here?"
|
|
63
|
+
|
|
64
|
+
One question at a time. Do not front-load a list of 8 questions before starting.
|
|
65
|
+
|
|
66
|
+
---
|
|
67
|
+
|
|
68
|
+
## Implementation Checklist
|
|
69
|
+
|
|
70
|
+
Before finalizing any output, verify every item:
|
|
71
|
+
|
|
72
|
+
- [ ] All color values come from confirmed project tokens, not hardcoded hex or named colors.
|
|
73
|
+
- [ ] All spacing values use confirmed tokens (Tailwind classes, CSS vars, or theme values).
|
|
74
|
+
- [ ] Typography (font family, size, weight, line-height) matches an existing usage in the codebase.
|
|
75
|
+
- [ ] The component's file structure (location, naming, exports) matches the existing pattern.
|
|
76
|
+
- [ ] The prop interface follows the same TypeScript conventions as sampled components.
|
|
77
|
+
- [ ] The styling approach (Tailwind, CSS Module, styled, theme) is consistent with the confirmed stack.
|
|
78
|
+
- [ ] No new dependencies were introduced without asking the user first.
|
|
79
|
+
- [ ] No new design tokens were invented without explicit user approval.
|
|
80
|
+
- [ ] The component was cross-referenced against at least one existing component for structural consistency.
|
|
81
|
+
- [ ] Accessibility: semantic HTML elements, aria attributes consistent with existing components.
|
|
82
|
+
|
|
83
|
+
---
|
|
84
|
+
|
|
85
|
+
## What Finished Work Looks Like
|
|
86
|
+
|
|
87
|
+
A finished component from this agent:
|
|
88
|
+
|
|
89
|
+
- Reads like it was written by the existing team.
|
|
90
|
+
- Uses the same imports, utilities, and style tokens as the rest of the codebase.
|
|
91
|
+
- Has no values that can't be traced back to a confirmed project resource.
|
|
92
|
+
- Includes no design decisions that weren't explicitly confirmed by the user or directly derived from existing code.
|
|
93
|
+
- Has no "you can customize this" placeholder comments.
|
|
94
|
+
|
|
95
|
+
If the output doesn't meet this bar, it is not done.
|
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
# Stack Detector
|
|
2
|
+
|
|
3
|
+
## Goal
|
|
4
|
+
|
|
5
|
+
Surface a complete, verified picture of the project's frontend stack before any design work begins. This agent produces a **confirmed stack summary** that the component-designer requires as a precondition. Nothing gets designed until this output is validated by the user.
|
|
6
|
+
|
|
7
|
+
Do not guess. Do not assume. Do not approximate. Every field in the output must come from something you actually read in the project.
|
|
8
|
+
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
## When to Use
|
|
12
|
+
|
|
13
|
+
Run this agent:
|
|
14
|
+
|
|
15
|
+
- At the very start of every frontend design task, before any other action.
|
|
16
|
+
- When the user changes direction mid-task and a different part of the codebase is now in scope.
|
|
17
|
+
- When the confirmed stack summary from a previous run is no longer current (e.g., user says "we migrated to Tailwind").
|
|
18
|
+
|
|
19
|
+
Do not skip this agent:
|
|
20
|
+
|
|
21
|
+
- Not even when the stack "looks obvious" from the file names.
|
|
22
|
+
- Not even when the user describes the stack in plain language — descriptions can be outdated or incomplete.
|
|
23
|
+
|
|
24
|
+
---
|
|
25
|
+
|
|
26
|
+
## Scan Procedure
|
|
27
|
+
|
|
28
|
+
Run these steps in order. Do not skip a step because a previous one seemed sufficient.
|
|
29
|
+
|
|
30
|
+
### Step 1 — Read package.json
|
|
31
|
+
|
|
32
|
+
```bash
|
|
33
|
+
cat package.json
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
Extract:
|
|
37
|
+
- Framework: `react`, `vue`, `@angular/core`, `svelte`, `next`, `nuxt`, `astro`, `remix`, etc.
|
|
38
|
+
- UI component library: `@mui/material`, `@chakra-ui/react`, `@radix-ui/*`, `antd`, `@headlessui/react`, etc.
|
|
39
|
+
- CSS-in-JS library: `styled-components`, `@emotion/react`, `@stitches/react`, `vanilla-extract`, etc.
|
|
40
|
+
- CSS utilities: `tailwindcss`, `unocss`, `windicss`
|
|
41
|
+
- Preprocessor: `sass`, `less`, `postcss`
|
|
42
|
+
- Note the exact version of each — not just presence.
|
|
43
|
+
|
|
44
|
+
If `package.json` is missing, ask: "I can't find package.json. Where is the project root?"
|
|
45
|
+
|
|
46
|
+
### Step 2 — Detect CSS Approach
|
|
47
|
+
|
|
48
|
+
One project may use multiple CSS strategies. Identify all of them.
|
|
49
|
+
|
|
50
|
+
```bash
|
|
51
|
+
# CSS Modules
|
|
52
|
+
find src -name "*.module.css" -o -name "*.module.scss" | head -5
|
|
53
|
+
|
|
54
|
+
# Tailwind (class-based utility)
|
|
55
|
+
cat tailwind.config.ts 2>/dev/null || cat tailwind.config.js 2>/dev/null
|
|
56
|
+
|
|
57
|
+
# styled-components or emotion
|
|
58
|
+
grep -rl "styled\." src/ | head -3
|
|
59
|
+
grep -rl "css\`" src/ | head -3
|
|
60
|
+
|
|
61
|
+
# Global stylesheets
|
|
62
|
+
find src -name "globals.css" -o -name "global.scss" -o -name "index.css" | head -3
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
If both Tailwind and styled-components are present, flag it: "I see both Tailwind and styled-components in this project. Which is the canonical styling approach for new components?"
|
|
66
|
+
|
|
67
|
+
### Step 3 — Find Design Tokens
|
|
68
|
+
|
|
69
|
+
```bash
|
|
70
|
+
# CSS custom properties
|
|
71
|
+
grep -rn ":root" src/ --include="*.css" --include="*.scss" | head -20
|
|
72
|
+
|
|
73
|
+
# Tailwind config tokens
|
|
74
|
+
cat tailwind.config.ts 2>/dev/null
|
|
75
|
+
|
|
76
|
+
# Token files
|
|
77
|
+
find . -name "tokens.json" -o -name "design-tokens.json" -o -name "_variables.scss" -o -name "variables.css" 2>/dev/null
|
|
78
|
+
|
|
79
|
+
# Theme files (MUI, Chakra, custom)
|
|
80
|
+
find src -name "theme.ts" -o -name "theme.tsx" -o -name "theme.js" | head -3
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
Extract and list the available tokens by category: colors, spacing, typography, border-radius, shadows.
|
|
84
|
+
|
|
85
|
+
If no tokens are found, note it explicitly: "No design tokens were found. This project may be using hardcoded values or a library's default theme."
|
|
86
|
+
|
|
87
|
+
### Step 4 — Detect shadcn/ui (special case)
|
|
88
|
+
|
|
89
|
+
shadcn/ui is installed as local source files, not as a package. Detect it separately:
|
|
90
|
+
|
|
91
|
+
```bash
|
|
92
|
+
# shadcn/ui components live here
|
|
93
|
+
ls src/components/ui/ 2>/dev/null
|
|
94
|
+
|
|
95
|
+
# shadcn config
|
|
96
|
+
cat components.json 2>/dev/null
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
If `components.json` exists, read it to understand the alias paths, CSS variable naming, and base color.
|
|
100
|
+
|
|
101
|
+
### Step 5 — Sample Existing Components
|
|
102
|
+
|
|
103
|
+
Read 3–5 existing component files. Choose a variety: a simple atomic component, a composite one, and if available, a page-level layout.
|
|
104
|
+
|
|
105
|
+
```bash
|
|
106
|
+
find src/components -maxdepth 2 -name "*.tsx" -o -name "*.vue" | head -10
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
For each sampled component, note:
|
|
110
|
+
- How it imports and applies styles (classNames, css modules, theme tokens, Tailwind classes).
|
|
111
|
+
- How props are typed and named.
|
|
112
|
+
- Whether it uses composition patterns (children, slots, render props).
|
|
113
|
+
- Any shared utility functions (e.g., `cn()`, `clsx()`, `twMerge()`).
|
|
114
|
+
|
|
115
|
+
---
|
|
116
|
+
|
|
117
|
+
## Confirmation Checklist
|
|
118
|
+
|
|
119
|
+
Before handing off to component-designer, present the following summary to the user and ask for explicit confirmation:
|
|
120
|
+
|
|
121
|
+
```
|
|
122
|
+
Detected stack:
|
|
123
|
+
Framework: [e.g. React 18 (Next.js 14)]
|
|
124
|
+
UI library: [e.g. shadcn/ui (Radix + Tailwind) | None detected]
|
|
125
|
+
CSS approach: [e.g. Tailwind CSS v3 with CSS Modules for overrides]
|
|
126
|
+
Design tokens: [e.g. CSS vars in globals.css: --color-primary, --spacing-md, ...]
|
|
127
|
+
OR [None found — using Tailwind config colors/spacing]
|
|
128
|
+
Component sample: [e.g. Button, Card, Modal — all use cn() + Tailwind classes]
|
|
129
|
+
|
|
130
|
+
Does this match your project setup? Any corrections before I proceed?
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
Do not move forward until the user responds. A non-answer ("looks fine", "yes") is acceptable. Silence is not.
|
|
134
|
+
|
|
135
|
+
---
|
|
136
|
+
|
|
137
|
+
## Output Format
|
|
138
|
+
|
|
139
|
+
After user confirmation, produce a structured stack summary to pass to component-designer:
|
|
140
|
+
|
|
141
|
+
```
|
|
142
|
+
CONFIRMED STACK SUMMARY
|
|
143
|
+
-----------------------
|
|
144
|
+
Framework: React 18 / Next.js 14 (App Router)
|
|
145
|
+
UI library: shadcn/ui (components.json present, alias: @/components/ui)
|
|
146
|
+
CSS approach: Tailwind CSS v3; utility classes primary; no CSS Modules
|
|
147
|
+
Design tokens: Tailwind config (src/styles/tailwind.config.ts)
|
|
148
|
+
CSS vars: --background, --foreground, --primary, --muted (globals.css)
|
|
149
|
+
Style utilities: cn() from @/lib/utils (clsx + tailwind-merge)
|
|
150
|
+
Component pattern: Functional, TypeScript, props typed via interface, forwardRef on inputs
|
|
151
|
+
Sampled: Button.tsx, Card.tsx, Input.tsx
|
|
152
|
+
```
|
|
153
|
+
|
|
154
|
+
This summary is the required input for component-designer. If the summary cannot be completed, do not proceed.
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
# Stack Scan Checklist
|
|
2
|
+
|
|
3
|
+
Reference table for stack-detector. Use this to ensure no detection category is missed before producing the confirmed stack summary.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## Detection Categories
|
|
8
|
+
|
|
9
|
+
| Category | What to Find | Where to Look | How to Detect | Confirmed? |
|
|
10
|
+
| --- | --- | --- | --- | --- |
|
|
11
|
+
| **Framework** | React, Vue, Angular, Svelte, Solid, Astro, etc. | `package.json` dependencies | `react`, `vue`, `@angular/core`, `svelte`, `astro` in deps | [ ] |
|
|
12
|
+
| **Meta-framework** | Next.js, Nuxt, Remix, SvelteKit, etc. | `package.json`, config files | `next`, `nuxt`, `@remix-run/react` in deps; `next.config.*`, `nuxt.config.*` | [ ] |
|
|
13
|
+
| **UI component library** | MUI, Chakra, shadcn, Radix, Headless, Ant, Mantine | `package.json` + component imports | `@mui/material`, `@chakra-ui/react`, `antd`, `@mantine/core`, `@headlessui/react`, or `components.json` | [ ] |
|
|
14
|
+
| **shadcn/ui (special)** | Local shadcn component files | `src/components/ui/`, `components.json` | `ls src/components/ui/`; `cat components.json` | [ ] |
|
|
15
|
+
| **CSS approach** | Tailwind, CSS Modules, styled-components, Emotion, Sass, vanilla | File extensions + package.json | `.module.css`, `.module.scss`, `styled.`, `css\``, `tailwindcss` in deps | [ ] |
|
|
16
|
+
| **CSS preprocessor** | Sass/SCSS, Less, PostCSS | `package.json`, file extensions | `sass`, `less`, `postcss` in deps; `.scss`, `.less` files | [ ] |
|
|
17
|
+
| **Design tokens (CSS vars)** | Custom properties at `:root` | Global CSS/SCSS files | `grep -rn ":root"` in stylesheets | [ ] |
|
|
18
|
+
| **Design tokens (Tailwind)** | Extended colors, spacing, fonts | `tailwind.config.ts` / `tailwind.config.js` | `theme.extend.colors`, `theme.extend.spacing`, `theme.extend.fontFamily` | [ ] |
|
|
19
|
+
| **Design tokens (theme file)** | MUI theme, Chakra theme, custom theme provider | `src/theme.ts`, `src/styles/theme.ts`, `ThemeProvider` usage | `cat theme.ts`; search for `createTheme`, `extendTheme`, `ThemeProvider` | [ ] |
|
|
20
|
+
| **Design tokens (JSON)** | Figma tokens, Style Dictionary output | `tokens.json`, `design-tokens.json` | `find . -name "tokens.json"` | [ ] |
|
|
21
|
+
| **Style utilities** | cn(), clsx(), classnames, twMerge | Utility files, component imports | `grep -rl "clsx\|cn(\|classnames\|twMerge" src/` | [ ] |
|
|
22
|
+
| **Component location** | Where components live in the project | `src/components/`, `app/components/`, `components/` | `find src -maxdepth 3 -type d -name "components"` | [ ] |
|
|
23
|
+
| **Naming convention** | PascalCase files, kebab-case files, flat vs nested | Sampled component file names | Read 3–5 component files | [ ] |
|
|
24
|
+
| **TypeScript** | Typed props, interfaces, generics in use | File extensions, tsconfig | `.tsx`, `.ts` files; `typescript` in deps | [ ] |
|
|
25
|
+
| **Existing breakpoints** | sm, md, lg, xl values | `tailwind.config`, global CSS, theme file | `theme.screens` in Tailwind; media queries in global CSS | [ ] |
|
|
26
|
+
|
|
27
|
+
---
|
|
28
|
+
|
|
29
|
+
## Ambiguity Flags
|
|
30
|
+
|
|
31
|
+
Stop and ask the user if any of these are true:
|
|
32
|
+
|
|
33
|
+
| Condition | Question to Ask |
|
|
34
|
+
| --- | --- |
|
|
35
|
+
| Both Tailwind and styled-components present | "Which is the canonical styling approach for new components?" |
|
|
36
|
+
| Multiple UI libraries detected | "Are all of these in active use, or is one being deprecated?" |
|
|
37
|
+
| No tokens found anywhere | "No design tokens were found. Are values hardcoded throughout, or is there a file I missed?" |
|
|
38
|
+
| `components/ui/` exists but no `components.json` | "I see a `ui/` folder but no shadcn config. Is this shadcn, or a custom component library?" |
|
|
39
|
+
| CSS Modules and Tailwind both in use | "Do new components use Tailwind, CSS Modules, or both? Which does the team prefer?" |
|
|
40
|
+
| No component files found in expected locations | "Where does the project keep its UI components?" |
|
|
41
|
+
| `package.json` exists but no lock file | "Is this project actively maintained? No lock file found — dependencies may be inconsistent." |
|
|
42
|
+
|
|
43
|
+
---
|
|
44
|
+
|
|
45
|
+
## Minimum Viable Summary
|
|
46
|
+
|
|
47
|
+
The confirmed stack summary passed to component-designer must include all of the following. Any `[unknown]` field must be resolved with the user before proceeding.
|
|
48
|
+
|
|
49
|
+
```
|
|
50
|
+
Framework: [name + version]
|
|
51
|
+
Meta-framework: [name + version] or [none]
|
|
52
|
+
UI library: [name + version] or [none]
|
|
53
|
+
CSS approach: [primary approach] + [secondary if applicable]
|
|
54
|
+
Design tokens: [source file(s) + list of key token categories available]
|
|
55
|
+
Style utilities: [e.g. cn() from @/lib/utils] or [none]
|
|
56
|
+
Component pattern: [structural observation from sampled files]
|
|
57
|
+
Sampled files: [list of 3–5 file paths read]
|
|
58
|
+
```
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
{
|
|
2
|
+
"id": "frontend-design",
|
|
3
|
+
"title": "Frontend Design",
|
|
4
|
+
"description": "Project-aware frontend design skill that detects the existing tech stack, UI libraries, CSS variables, and design tokens before proposing any UI work.",
|
|
5
|
+
"portable": true,
|
|
6
|
+
"tags": ["frontend", "design", "workflow", "ui"],
|
|
7
|
+
"detectors": ["always"],
|
|
8
|
+
"detectionTriggers": ["manual"],
|
|
9
|
+
"installsFor": ["all"],
|
|
10
|
+
"agentSupport": ["codex", "claude", "cursor", "gemini", "copilot"],
|
|
11
|
+
"skillMetadata": {
|
|
12
|
+
"author": "skilly-hand",
|
|
13
|
+
"last-edit": "2026-04-04",
|
|
14
|
+
"license": "Apache-2.0",
|
|
15
|
+
"version": "1.0.0",
|
|
16
|
+
"changelog": "Initial frontend-design skill; enforces stack-detection-first workflow before any UI component generation; affects catalog skill coverage for frontend and design workflows",
|
|
17
|
+
"auto-invoke": "Designing or generating UI components, pages, or layouts in a web or mobile project",
|
|
18
|
+
"allowed-tools": ["Read", "Grep", "Glob", "Bash", "Edit", "Write"]
|
|
19
|
+
},
|
|
20
|
+
"files": [
|
|
21
|
+
{ "path": "SKILL.md", "kind": "instruction" },
|
|
22
|
+
{ "path": "agents/stack-detector.md", "kind": "asset" },
|
|
23
|
+
{ "path": "agents/component-designer.md", "kind": "asset" },
|
|
24
|
+
{ "path": "assets/stack-scan-checklist.md", "kind": "asset" }
|
|
25
|
+
],
|
|
26
|
+
"dependencies": []
|
|
27
|
+
}
|