stitch-ui-design-spec-bootstrap
npx machina-cli add skill partme-ai/stitch-skills/stitch-ui-design-spec-bootstrap --openclawBootstrap Design Spec (Bootstrap 5 / Vue)
Constraint: Only use this skill when the user explicitly mentions "Stitch".
Purpose
This skill makes the Bootstrap design spec executable in two modes:
- Prefix mode: output a paste-ready Hard constraints prefix for Stitch
[Context]. - Selector mode: output
CONTRACT_SELECTION_JSON_V1and then an assembled Stitch prompt that injects only the required component/state snippets.
Trigger Keywords
Prefer this skill when the user request includes any of:
bootstrap,bootstrap-vue,bs-vue,bs5
Chinese trigger keywords (only for triggering):
bootstrap 风格响应式布局(if context implies Bootstrap)
Source of Truth
references/contract.mdreferences/examples.mdreferences/official.md
Output (STRICT)
Decide the mode by the user intent:
- If the user asks for beautify/polish/refine an existing screen, or asks for selector / JSON / contracts.include / states.include → use Selector mode.
- Otherwise → use Prefix mode.
Prefix mode
Return exactly one code block:
[Hard constraints prefix]
- Framework: BootstrapVue (Vue 3 compatible / Bootstrap 5).
- Design Tokens:
- Colors: Primary=#0d6efd, Secondary=#6c757d, Success=#198754, Danger=#dc3545, Warning=#ffc107, Info=#0dcaf0.
- Spacing: STRICTLY use utility classes (m-*, p-*, gap-*). Scale: 1=0.25rem, 2=0.5rem, 3=1rem (default), 4=1.5rem, 5=3rem.
- Radius: rounded (0.25rem), rounded-pill, rounded-circle.
- Shadows: shadow-sm, shadow, shadow-lg.
- Component Contracts:
- Layout: Use <b-container>, <b-row>, <b-col cols="..." md="...">. NO raw CSS grid.
- Buttons: Use <b-button variant="primary" size="sm/lg">. NO <button class="btn">.
- Forms: Use <b-form-group>, <b-form-input>, <b-form-select>.
- Cards: Use <b-card title="..." img-src="...">.
- Tables: Use <b-table striped hover :items="...">.
- Layout Invariants:
- Mobile-first responsive classes (e.g., col-12 col-md-6).
- Use d-flex utilities for alignment.
Selector mode
Return exactly two code blocks, in this order, with no extra prose:
- Contract selection JSON:
{
"version": "CONTRACT_SELECTION_JSON_V1",
"designSystem": "bootstrap-vue",
"mode": "selector",
"contracts": { "include": [] },
"states": { "include": [] }
}
- Final Stitch prompt:
[Context]
(Paste Hard Constraints Prefix here)
(Add "Layout Invariants" from contract.md if beautifying)
[Layout]
(Describe the macro layout structure, e.g., "Responsive Grid System with Container")
[Components]
(Inject component snippets matching the JSON selection above)
References
Source
git clone https://github.com/partme-ai/stitch-skills/blob/main/skills/stitch-ui-design-spec-bootstrap/SKILL.mdView on GitHub Overview
This skill translates Bootstrap-Vue design constraints into Stitch prompts. It can output a hard-constraints prefix for BootstrapVue (Bootstrap 5) or a selector mode with CONTRACT_SELECTION_JSON_V1 plus an assembled Stitch prompt, depending on user intent.
How This Skill Works
The skill decides mode based on user intent: Prefix mode for a hard constraints prefix, or Selector mode for a contract JSON and a final Stitch prompt. In Prefix mode, it outputs exactly one code block containing the Hard constraints prefix. In Selector mode, it outputs two code blocks: first the CONTRACT_SELECTION_JSON_V1, then a final Stitch prompt that injects only the required component/state snippets.
When to Use It
- You want a paste-ready hard constraints prefix for Stitch using BootstrapVue (Bootstrap 5).
- You need a selector-based contract JSON and a Stitch prompt for a screen or component.
- You’re refining or beautifying an existing Stitch UI with Bootstrap styling.
- You require enforcing specific BootstrapVue components like b-container, b-row, b-col in a Stitch prompt.
- You want to ensure mobile-first responsive layout and Bootstrap utility classes in the prompt.
Quick Start
- Step 1: Confirm the user mentions Stitch and Bootstrap-related keywords to trigger this skill.
- Step 2: Decide the mode: Prefix for hard constraints, Selector for contract JSON and final prompt, then respond accordingly.
- Step 3: Provide the requested code blocks exactly as specified (one block for Prefix mode; two blocks for Selector mode).
Best Practices
- Use the exact BootstrapVue components specified in the design (b-container, b-row, b-col, etc.).
- Stick to the provided color tokens and spacing scale; avoid custom CSS.
- Prefer Bootstrap utility classes for layout (col-12, col-md-6, d-flex, etc.).
- Choose Prefix mode for polishing screens; Selector mode for JSON-driven prompts.
- When in selector mode, ensure the JSON only includes the needed contracts and states.
Example Use Cases
- Generate a Prefix mode hard-constraints block for a Stitch screen using a responsive Bootstrap grid.
- Produce a CONTRACT_SELECTION_JSON_V1 and a Stitch prompt for a Bootstrap form with b-form-input and b-form-select.
- Beautify a Stitch screen with a BootstrapVue card layout (b-card) in selector mode.
- Create a Stitch prompt that uses a Bootstrap table (b-table) with striped hover.
- Refine a layout with mobile-first classes like col-12 and col-md-6 inside a b-container.