@mehuljatiya/troupe 0.1.15

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.
@@ -0,0 +1,56 @@
1
+ Help me turn a Figma design into working code.
2
+
3
+ ---
4
+
5
+ ## Prerequisites — Check Figma MCP
6
+
7
+ Before doing anything, call `mcp__claude_ai_Figma__whoami`. If it fails or returns an auth error, stop and tell the user:
8
+
9
+ > **Setup required before this command can run:**
10
+ >
11
+ > 1. Open the **Claude desktop app**
12
+ > 2. Go to **Settings → Integrations**
13
+ > 3. Find **Figma** and click **Enable**
14
+ > 4. **Quit and relaunch** Claude Code — the MCP won't load until you restart
15
+ > 5. Then re-run `/figma` with your Figma URL
16
+ >
17
+ > If you've already done this and it still fails, run `claude mcp add --transport http figma https://mcp.figma.com/mcp --scope user` in your terminal, then restart.
18
+
19
+ Do not proceed until Figma MCP is confirmed working.
20
+
21
+ ---
22
+
23
+ The user will paste a Figma URL. Here's what to do:
24
+
25
+ **Step 1 — Read the design**
26
+ Use the Figma MCP tools to understand what's being designed:
27
+ - Call `get_design_context` with the URL (use `forceCode: true`)
28
+ - Get each variant/state individually so you see the full picture
29
+ - Call `get_screenshot` to visually confirm what you're seeing
30
+
31
+ **Step 2 — Describe it before coding**
32
+ In plain language (no code), tell the user:
33
+ - What kind of component this is (button, card, nav, form field, etc.)
34
+ - What states or variants it has
35
+ - What the key interaction is
36
+
37
+ Ask for the component name if it's not obvious from the design.
38
+
39
+ **Step 3 — Understand the project**
40
+ Before writing anything, look at the current project:
41
+ - What framework/tech stack is being used?
42
+ - What existing components exist to follow as patterns?
43
+ - What design tokens or CSS variables are available?
44
+ - Never use hardcoded colors, sizes, or fonts — use project tokens
45
+
46
+ **Step 4 — Build it**
47
+ Implement the component following the project's existing patterns.
48
+ After building, tell the user:
49
+ - What files were created/changed
50
+ - How to find and use the component
51
+ - Any decisions you made that they might want to adjust
52
+
53
+ Keep all explanations in plain, friendly language. If you hit something unclear, ask before guessing.
54
+
55
+ ---
56
+ If the user hasn't shared a Figma URL yet, ask them for it now.
@@ -0,0 +1,92 @@
1
+ Generate a developer handoff document for a component.
2
+
3
+ If the user hasn't specified which component, ask them.
4
+
5
+ Create a thorough, precise handoff spec that a developer could use to build this component from scratch. Be exact — use real token names, real pixel values, real behavior descriptions.
6
+
7
+ ---
8
+
9
+ ## [Component Name] — Handoff Spec
10
+
11
+ **Overview**
12
+ What this component is and what problem it solves. Where it lives in the product.
13
+
14
+ ---
15
+
16
+ **Visual Specs**
17
+
18
+ | Property | Value |
19
+ |---|---|
20
+ | Width / Height | |
21
+ | Padding | |
22
+ | Gap / spacing | |
23
+ | Border radius | (token name + px value) |
24
+ | Border | (width, style, color token) |
25
+ | Background | (token name) |
26
+ | Shadow | (token name or none) |
27
+
28
+ Typography:
29
+ - Label: font, size, weight, color token
30
+ - (add any other text elements)
31
+
32
+ ---
33
+
34
+ **States**
35
+
36
+ For each state, describe exactly what changes visually:
37
+
38
+ | State | What changes |
39
+ |---|---|
40
+ | Default | |
41
+ | Hover | |
42
+ | Focus | |
43
+ | Active / pressed | |
44
+ | Disabled | |
45
+ | Loading | (if applicable) |
46
+ | Error | (if applicable) |
47
+
48
+ Transitions: describe any animations (duration, easing, what animates).
49
+
50
+ ---
51
+
52
+ **Interactions**
53
+
54
+ Mouse / touch:
55
+ - Click / tap: what happens
56
+ - Long press: (if applicable)
57
+
58
+ Keyboard:
59
+ - Tab: focus behavior
60
+ - Enter / Space: action
61
+ - Escape: (if applicable)
62
+ - Arrow keys: (if applicable)
63
+
64
+ ---
65
+
66
+ **Responsive behavior**
67
+
68
+ Describe how the component adapts at:
69
+ - Mobile (< 768px)
70
+ - Tablet (768px – 1024px)
71
+ - Desktop (> 1024px)
72
+
73
+ ---
74
+
75
+ **Accessibility requirements**
76
+
77
+ - Role: (button, link, checkbox, etc.)
78
+ - Required ARIA attributes
79
+ - Screen reader announcement on interaction
80
+ - Focus visible style
81
+ - Minimum touch target size
82
+
83
+ ---
84
+
85
+ **Open questions**
86
+
87
+ List anything that still needs a design decision or clarification.
88
+
89
+ ---
90
+
91
+ Save as `[ComponentName].handoff.md` next to the component file.
92
+ Confirm the save location when done.
@@ -0,0 +1,26 @@
1
+ Help me create a new component.
2
+
3
+ Start a short, friendly conversation to understand what they need before writing any code.
4
+
5
+ **Ask these questions (one at a time, not all at once):**
6
+ 1. "What should this component do?" — let them describe in plain language
7
+ 2. "Can you describe what it looks like? Or share a sketch, screenshot, or reference link?"
8
+ 3. "Does it need any special states — like a loading state, disabled version, or error message?"
9
+
10
+ **Then, before building:**
11
+ - Look at 2–3 existing components in this project to understand the patterns used
12
+ - Check what design tokens and styles are available
13
+ - Confirm the component name with the user if it's not clear
14
+
15
+ **Build it:**
16
+ - Follow the same structure, file naming, and patterns as existing components
17
+ - Use design tokens and project styles — never hardcode colors, fonts, or spacing
18
+ - Keep it focused — only build what was asked for, nothing extra
19
+ - Add just enough to make it functional: no over-engineering
20
+
21
+ **When done, tell the user:**
22
+ - The name and location of every file created
23
+ - How to use/import the component
24
+ - What you'd suggest they try or configure first
25
+
26
+ Speak in plain, encouraging language. Avoid jargon. If something requires a decision, explain the trade-off simply and let them choose.
package/commands/qa.md ADDED
@@ -0,0 +1,89 @@
1
+ Compare a Figma design to what's actually built and flag gaps.
2
+
3
+ If the user hasn't shared a Figma URL, ask for one. Also ask which component or file in the codebase to compare it against.
4
+
5
+ ---
6
+
7
+ ## Step 1 — Read the design
8
+
9
+ Call `mcp__claude_ai_Figma__whoami` first. If it fails, tell the user:
10
+
11
+ > **Setup required:**
12
+ > 1. Open Claude desktop app → Settings → Integrations → Enable Figma
13
+ > 2. Quit and relaunch Claude Code
14
+ > 3. Re-run `/qa` with your Figma URL
15
+
16
+ Call `get_design_context` on the provided URL. Call `get_screenshot` to get a visual reference of every variant and state.
17
+
18
+ ---
19
+
20
+ ## Step 2 — Read the built component
21
+
22
+ Find the component in the codebase. Read its implementation and any associated styles, tokens, and tests.
23
+
24
+ ---
25
+
26
+ ## Step 3 — Compare and report
27
+
28
+ Output a gap analysis report in this format:
29
+
30
+ ```
31
+ # QA Report — [Component Name]
32
+ Figma: [url]
33
+ Built: [file path]
34
+
35
+ ## Summary
36
+ One sentence verdict: how close is the implementation to the design?
37
+
38
+ ## Gaps Found
39
+
40
+ ### Visual
41
+ | Property | Figma | Built | Severity |
42
+ |---|---|---|---|
43
+ | [property] | [design value] | [actual value] | High / Medium / Low |
44
+
45
+ ### Missing States
46
+ List every state visible in Figma that is not handled in the implementation.
47
+
48
+ | State | In Figma | In Code | Notes |
49
+ |---|---|---|---|
50
+ | [state] | ✓ | ✗ | [what's missing] |
51
+
52
+ ### Missing Variants
53
+ List every variant in Figma that has no corresponding implementation.
54
+
55
+ ### Interaction gaps
56
+ Describe any behaviours defined in the design (hover, transitions, animations) that are missing or wrong in the code.
57
+
58
+ ### Accessibility gaps
59
+ - Missing ARIA attributes
60
+ - Keyboard navigation issues
61
+ - Colour contrast failures (compare design tokens to WCAG AA)
62
+
63
+ ## What's correct
64
+ List things that match the design well — this gives the developer confidence in what not to change.
65
+
66
+ ## Recommended fixes
67
+ Prioritised list of what to fix, most important first.
68
+
69
+ 1. [Fix] — why it matters
70
+ 2. [Fix] — why it matters
71
+ ```
72
+
73
+ ---
74
+
75
+ ## Severity guide
76
+
77
+ - **High** — visible to users, breaks the intended experience, or blocks accessibility
78
+ - **Medium** — noticeable difference but doesn't break functionality
79
+ - **Low** — minor polish, pixel-level spacing, or nice-to-have
80
+
81
+ ---
82
+
83
+ ## Quality check
84
+
85
+ Before finishing:
86
+ - [ ] Every state in Figma is checked against the code
87
+ - [ ] All gaps have a severity rating
88
+ - [ ] Recommended fixes are ordered by impact, not by what's easiest
89
+ - [ ] Nothing invented — all findings come from the Figma file and codebase
@@ -0,0 +1,49 @@
1
+ Review this component or design for quality.
2
+
3
+ If the user hasn't said what to review, ask which component or file they're working on.
4
+
5
+ Look at the component carefully and evaluate each area below. Be specific — don't just say "looks good", point to exact things.
6
+
7
+ ---
8
+
9
+ **Consistency**
10
+ - Are design tokens and CSS variables used, or are there hardcoded values (colors, spacing, font sizes)?
11
+ - Does the visual style match other components in this project?
12
+ - Is naming consistent with the rest of the codebase?
13
+
14
+ **Completeness — states**
15
+ Check that all of these are handled (visually and functionally):
16
+ - [ ] Default
17
+ - [ ] Hover
18
+ - [ ] Focus (keyboard)
19
+ - [ ] Active / pressed
20
+ - [ ] Disabled
21
+ - [ ] Loading (if the component triggers async actions)
22
+ - [ ] Error / validation
23
+ - [ ] Empty state (if the component can have no content)
24
+
25
+ **Responsiveness**
26
+ - Does it work on mobile screen sizes?
27
+ - Is text readable and tappable (minimum 44px touch targets)?
28
+ - Does it reflow or adapt, or does it break?
29
+
30
+ **Accessibility**
31
+ - Can it be navigated by keyboard alone?
32
+ - Is color contrast sufficient for text and icons?
33
+ - Are interactive elements labeled for screen readers?
34
+ - Does it work with browser zoom up to 200%?
35
+
36
+ **Edge cases**
37
+ - What happens with very long or very short text?
38
+ - What if an image fails to load?
39
+ - What if there's no data / empty content?
40
+
41
+ ---
42
+
43
+ Format the review using these ratings for each finding:
44
+ ✓ **Good** — working as expected, worth calling out
45
+ ⚠ **Needs attention** — works but could be better; explain why it matters
46
+ ✗ **Missing** — not handled; explain the impact and how to fix it
47
+
48
+ End with a short "Priority fixes" list (max 3 items) if there are any ✗ findings.
49
+ Write for a designer — plain language, no code jargon unless necessary.
@@ -0,0 +1,77 @@
1
+ Generate a ticket-ready spec from a Figma design.
2
+
3
+ If the user hasn't shared a Figma URL, ask for one before proceeding.
4
+
5
+ ---
6
+
7
+ ## Step 1 — Read the design
8
+
9
+ Call `mcp__claude_ai_Figma__whoami` first. If it fails, tell the user:
10
+
11
+ > **Setup required:**
12
+ > 1. Open Claude desktop app → Settings → Integrations → Enable Figma
13
+ > 2. Quit and relaunch Claude Code
14
+ > 3. Re-run `/spec` with your Figma URL
15
+
16
+ Call `get_design_context` on the provided URL. Also call `get_screenshot` to visually verify all variants and states.
17
+
18
+ ---
19
+
20
+ ## Step 2 — Write the spec
21
+
22
+ Output a structured spec a PM could paste directly into a Jira/Linear ticket or Notion page.
23
+
24
+ ```
25
+ # [Component / Feature Name] — Spec
26
+
27
+ ## Overview
28
+ One paragraph: what this is, what problem it solves, where it lives in the product.
29
+
30
+ ## Variants & States
31
+ List every variant and state visible in the Figma design. Do not invent states that don't exist in the file.
32
+
33
+ | Variant / State | Description | Trigger |
34
+ |---|---|---|
35
+ | [name] | [what it looks like] | [what causes it] |
36
+
37
+ ## Behaviour
38
+ Describe every interaction:
39
+ - What happens on click / tap
40
+ - What happens on hover
41
+ - Any transitions or animations
42
+ - Error handling visible in the design
43
+
44
+ ## Edge Cases
45
+ List at least 3 non-obvious edge cases the developer needs to handle:
46
+ - Empty state (no data / no content)
47
+ - Long text / overflow
48
+ - Loading state
49
+ - Error state
50
+ - Any other edge cases visible or implied by the design
51
+
52
+ ## Acceptance Criteria
53
+ Bulleted checklist a developer can use to verify the feature is complete. Write each item as a testable statement starting with "User can..." or "System should...".
54
+
55
+ - [ ] User can...
56
+ - [ ] System should...
57
+
58
+ ## Open Questions
59
+ List anything that is unclear or not defined in the Figma file that needs a decision before development starts.
60
+
61
+ 1. [Question]
62
+ 2. [Question]
63
+
64
+ ## Out of Scope
65
+ Explicitly list anything that looks related but is NOT part of this ticket.
66
+ ```
67
+
68
+ ---
69
+
70
+ ## Quality check
71
+
72
+ Before finishing, verify:
73
+ - [ ] Every state visible in Figma is listed
74
+ - [ ] At least 3 edge cases documented
75
+ - [ ] Acceptance criteria are testable, not vague
76
+ - [ ] Open questions flag actual gaps — do not leave this section empty if there are genuine unknowns
77
+ - [ ] Nothing invented — all content comes from the Figma file
@@ -0,0 +1,42 @@
1
+ Help me understand the design tokens in this project.
2
+
3
+ Look through the project for design tokens — CSS variables, theme files, token definitions, or any named design values.
4
+
5
+ Organize them into a readable reference guide grouped by type:
6
+
7
+ ---
8
+
9
+ **Colors**
10
+ For each color token:
11
+ - Name (what it's called in the code)
12
+ - Value (the actual hex/rgb/etc.)
13
+ - Purpose (plain English: "Used for primary buttons and links")
14
+ - Group by role: backgrounds, text, borders, brand, status (success/error/warning/info)
15
+
16
+ **Typography**
17
+ - Font families and what they're used for
18
+ - Type sizes and their intended use (heading 1, body, caption, etc.)
19
+ - Font weights available
20
+
21
+ **Spacing**
22
+ - The spacing scale (4px, 8px, 16px, etc.)
23
+ - What each size is typically used for (padding inside buttons, gap between sections, etc.)
24
+
25
+ **Shape**
26
+ - Border radius values and when to use each
27
+ - Border/stroke widths
28
+
29
+ **Shadows & elevation**
30
+ - Shadow tokens and the visual hierarchy they create
31
+
32
+ ---
33
+
34
+ **Hardcoded values to fix**
35
+ After listing the tokens, scan the codebase for hardcoded values (raw hex colors, pixel values not using tokens, font sizes not referencing the scale).
36
+ List any you find with the file and a suggestion for which token to use instead.
37
+
38
+ ---
39
+
40
+ Write this as a designer-friendly reference, not a code dump.
41
+ For colors, if you can describe them visually ("a light warm grey", "vivid blue"), do that alongside the hex value.
42
+ If the token naming is confusing or inconsistent, flag it.
package/package.json ADDED
@@ -0,0 +1,44 @@
1
+ {
2
+ "name": "@mehuljatiya/troupe",
3
+ "version": "0.1.15",
4
+ "description": "AI-powered workflow toolkit for designers, developers, and PMs — 9 slash commands for Claude Code",
5
+ "type": "module",
6
+ "bin": {
7
+ "troupe": "bin/cli.js",
8
+ "design": "bin/design.js"
9
+ },
10
+ "files": [
11
+ "bin/",
12
+ "src/",
13
+ "commands/"
14
+ ],
15
+ "scripts": {
16
+ "start": "node bin/cli.js setup",
17
+ "release": "npm version patch && git push && npm publish --access public"
18
+ },
19
+ "keywords": [
20
+ "claude",
21
+ "claude-code",
22
+ "design",
23
+ "figma",
24
+ "ai",
25
+ "designer",
26
+ "developer",
27
+ "product-manager",
28
+ "troupe",
29
+ "cli"
30
+ ],
31
+ "author": "Mehul Jatiya",
32
+ "license": "MIT",
33
+ "dependencies": {
34
+ "@inquirer/prompts": "^7.0.0",
35
+ "chalk": "^5.3.0"
36
+ },
37
+ "engines": {
38
+ "node": ">=20"
39
+ },
40
+ "repository": {
41
+ "type": "git",
42
+ "url": "git+https://github.com/mehuljatiya/troupe.git"
43
+ }
44
+ }