flyee 0.1.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/LICENSE +21 -0
- package/README.md +134 -0
- package/bin/install.js +357 -0
- package/bridge/bridge.py +1780 -0
- package/bridge/local_tracker.py +722 -0
- package/core/agents/backend-specialist.md +266 -0
- package/core/agents/code-archaeologist.md +106 -0
- package/core/agents/database-architect.md +226 -0
- package/core/agents/debugger.md +225 -0
- package/core/agents/devops-engineer.md +323 -0
- package/core/agents/documentation-writer.md +104 -0
- package/core/agents/explorer-agent.md +73 -0
- package/core/agents/frontend-specialist.md +743 -0
- package/core/agents/game-developer.md +162 -0
- package/core/agents/mobile-developer.md +377 -0
- package/core/agents/orchestrator.md +416 -0
- package/core/agents/penetration-tester.md +188 -0
- package/core/agents/performance-optimizer.md +187 -0
- package/core/agents/product-manager.md +112 -0
- package/core/agents/product-owner.md +95 -0
- package/core/agents/project-planner.md +470 -0
- package/core/agents/qa-automation-engineer.md +103 -0
- package/core/agents/security-auditor.md +170 -0
- package/core/agents/seo-specialist.md +111 -0
- package/core/agents/stitch-designer.md +190 -0
- package/core/agents/tdd-reviewer.md +282 -0
- package/core/agents/test-engineer.md +158 -0
- package/core/scripts/auto_preview.py +148 -0
- package/core/scripts/checklist.py +243 -0
- package/core/scripts/cost_report.py +149 -0
- package/core/scripts/doc-sync-check.py +461 -0
- package/core/scripts/parse_user_stories.py +79 -0
- package/core/scripts/prepare_notion_updates.py +172 -0
- package/core/scripts/print_create_payload.py +18 -0
- package/core/scripts/session_manager.py +120 -0
- package/core/scripts/task_complete.py +127 -0
- package/core/scripts/verify_all.py +327 -0
- package/core/skills/analytics-strategy/SKILL.md +128 -0
- package/core/skills/api-patterns/SKILL.md +81 -0
- package/core/skills/api-patterns/api-style.md +42 -0
- package/core/skills/api-patterns/auth.md +24 -0
- package/core/skills/api-patterns/documentation.md +26 -0
- package/core/skills/api-patterns/graphql.md +41 -0
- package/core/skills/api-patterns/rate-limiting.md +31 -0
- package/core/skills/api-patterns/response.md +37 -0
- package/core/skills/api-patterns/rest.md +40 -0
- package/core/skills/api-patterns/scripts/api_validator.py +211 -0
- package/core/skills/api-patterns/security-testing.md +122 -0
- package/core/skills/api-patterns/trpc.md +41 -0
- package/core/skills/api-patterns/versioning.md +22 -0
- package/core/skills/app-builder/SKILL.md +75 -0
- package/core/skills/app-builder/agent-coordination.md +71 -0
- package/core/skills/app-builder/feature-building.md +53 -0
- package/core/skills/app-builder/project-detection.md +34 -0
- package/core/skills/app-builder/scaffolding.md +118 -0
- package/core/skills/app-builder/tech-stack.md +40 -0
- package/core/skills/app-builder/templates/SKILL.md +39 -0
- package/core/skills/app-builder/templates/astro-static/TEMPLATE.md +76 -0
- package/core/skills/app-builder/templates/chrome-extension/TEMPLATE.md +92 -0
- package/core/skills/app-builder/templates/cli-tool/TEMPLATE.md +88 -0
- package/core/skills/app-builder/templates/electron-desktop/TEMPLATE.md +88 -0
- package/core/skills/app-builder/templates/express-api/TEMPLATE.md +83 -0
- package/core/skills/app-builder/templates/flutter-app/TEMPLATE.md +90 -0
- package/core/skills/app-builder/templates/monorepo-turborepo/TEMPLATE.md +90 -0
- package/core/skills/app-builder/templates/nextjs-fullstack/TEMPLATE.md +82 -0
- package/core/skills/app-builder/templates/nextjs-saas/TEMPLATE.md +100 -0
- package/core/skills/app-builder/templates/nextjs-static/TEMPLATE.md +106 -0
- package/core/skills/app-builder/templates/nuxt-app/TEMPLATE.md +101 -0
- package/core/skills/app-builder/templates/python-fastapi/TEMPLATE.md +83 -0
- package/core/skills/app-builder/templates/react-native-app/TEMPLATE.md +93 -0
- package/core/skills/architecture/SKILL.md +55 -0
- package/core/skills/architecture/context-discovery.md +43 -0
- package/core/skills/architecture/examples.md +94 -0
- package/core/skills/architecture/pattern-selection.md +68 -0
- package/core/skills/architecture/patterns-reference.md +50 -0
- package/core/skills/architecture/trade-off-analysis.md +77 -0
- package/core/skills/atomic-design/SKILL.md +282 -0
- package/core/skills/atomic-design/references/classification-guide.md +132 -0
- package/core/skills/atomic-design/references/quality-checklist.md +60 -0
- package/core/skills/atomic-design/references/stacks/stack-blade.md +254 -0
- package/core/skills/atomic-design/references/stacks/stack-nextjs.md +272 -0
- package/core/skills/atomic-design/references/stacks/stack-react.md +239 -0
- package/core/skills/atomic-design/references/stacks/stack-vue.md +224 -0
- package/core/skills/bash-linux/SKILL.md +199 -0
- package/core/skills/behavioral-modes/SKILL.md +242 -0
- package/core/skills/brainstorming/SKILL.md +163 -0
- package/core/skills/brainstorming/dynamic-questioning.md +373 -0
- package/core/skills/checkpointing-patterns/SKILL.md +163 -0
- package/core/skills/clean-code/SKILL.md +201 -0
- package/core/skills/code-review-checklist/SKILL.md +109 -0
- package/core/skills/code-truth-validation/SKILL.md +149 -0
- package/core/skills/component-library-discovery/SKILL.md +154 -0
- package/core/skills/content-strategy/SKILL.md +222 -0
- package/core/skills/context-budget/SKILL.md +155 -0
- package/core/skills/context-gathering-patterns/SKILL.md +278 -0
- package/core/skills/cost-tracking/SKILL.md +206 -0
- package/core/skills/database-design/SKILL.md +52 -0
- package/core/skills/database-design/database-selection.md +43 -0
- package/core/skills/database-design/indexing.md +39 -0
- package/core/skills/database-design/migrations.md +48 -0
- package/core/skills/database-design/optimization.md +36 -0
- package/core/skills/database-design/orm-selection.md +30 -0
- package/core/skills/database-design/schema-design.md +56 -0
- package/core/skills/database-design/scripts/schema_validator.py +172 -0
- package/core/skills/deployment-procedures/SKILL.md +295 -0
- package/core/skills/design-md/README.md +34 -0
- package/core/skills/design-md/SKILL.md +172 -0
- package/core/skills/design-md/examples/DESIGN.md +154 -0
- package/core/skills/design-system-enforcement/SKILL.md +339 -0
- package/core/skills/doc.md +177 -0
- package/core/skills/document-registry/SKILL.md +130 -0
- package/core/skills/documentation-publishing/SKILL.md +174 -0
- package/core/skills/documentation-templates/SKILL.md +194 -0
- package/core/skills/enhance-prompt/README.md +34 -0
- package/core/skills/enhance-prompt/SKILL.md +204 -0
- package/core/skills/enhance-prompt/references/KEYWORDS.md +114 -0
- package/core/skills/frontend-design/SKILL.md +430 -0
- package/core/skills/frontend-design/animation-guide.md +331 -0
- package/core/skills/frontend-design/color-system.md +311 -0
- package/core/skills/frontend-design/decision-trees.md +418 -0
- package/core/skills/frontend-design/motion-graphics.md +306 -0
- package/core/skills/frontend-design/scripts/accessibility_checker.py +183 -0
- package/core/skills/frontend-design/scripts/ux_audit.py +722 -0
- package/core/skills/frontend-design/typography-system.md +345 -0
- package/core/skills/frontend-design/ux-psychology.md +541 -0
- package/core/skills/frontend-design/visual-effects.md +383 -0
- package/core/skills/game-development/2d-games/SKILL.md +119 -0
- package/core/skills/game-development/3d-games/SKILL.md +135 -0
- package/core/skills/game-development/SKILL.md +167 -0
- package/core/skills/game-development/game-art/SKILL.md +185 -0
- package/core/skills/game-development/game-audio/SKILL.md +190 -0
- package/core/skills/game-development/game-design/SKILL.md +129 -0
- package/core/skills/game-development/mobile-games/SKILL.md +108 -0
- package/core/skills/game-development/multiplayer/SKILL.md +132 -0
- package/core/skills/game-development/pc-games/SKILL.md +144 -0
- package/core/skills/game-development/vr-ar/SKILL.md +123 -0
- package/core/skills/game-development/web-games/SKILL.md +150 -0
- package/core/skills/geo-fundamentals/SKILL.md +156 -0
- package/core/skills/geo-fundamentals/scripts/geo_checker.py +289 -0
- package/core/skills/git-workflow/SKILL.md +263 -0
- package/core/skills/history-check-patterns/SKILL.md +125 -0
- package/core/skills/i18n-localization/SKILL.md +154 -0
- package/core/skills/i18n-localization/scripts/i18n_checker.py +241 -0
- package/core/skills/integration-completeness/SKILL.md +219 -0
- package/core/skills/intelligent-routing/SKILL.md +370 -0
- package/core/skills/lint-and-validate/SKILL.md +45 -0
- package/core/skills/lint-and-validate/scripts/lint_runner.py +173 -0
- package/core/skills/lint-and-validate/scripts/type_coverage.py +173 -0
- package/core/skills/local-verification/SKILL.md +195 -0
- package/core/skills/mcp-builder/SKILL.md +176 -0
- package/core/skills/mobile-design/SKILL.md +394 -0
- package/core/skills/mobile-design/decision-trees.md +516 -0
- package/core/skills/mobile-design/mobile-backend.md +491 -0
- package/core/skills/mobile-design/mobile-color-system.md +420 -0
- package/core/skills/mobile-design/mobile-debugging.md +122 -0
- package/core/skills/mobile-design/mobile-design-thinking.md +357 -0
- package/core/skills/mobile-design/mobile-navigation.md +458 -0
- package/core/skills/mobile-design/mobile-performance.md +767 -0
- package/core/skills/mobile-design/mobile-testing.md +356 -0
- package/core/skills/mobile-design/mobile-typography.md +433 -0
- package/core/skills/mobile-design/platform-android.md +666 -0
- package/core/skills/mobile-design/platform-ios.md +561 -0
- package/core/skills/mobile-design/scripts/mobile_audit.py +670 -0
- package/core/skills/mobile-design/touch-psychology.md +537 -0
- package/core/skills/nextjs-react-expert/1-async-eliminating-waterfalls.md +312 -0
- package/core/skills/nextjs-react-expert/2-bundle-bundle-size-optimization.md +240 -0
- package/core/skills/nextjs-react-expert/3-server-server-side-performance.md +490 -0
- package/core/skills/nextjs-react-expert/4-client-client-side-data-fetching.md +264 -0
- package/core/skills/nextjs-react-expert/5-rerender-re-render-optimization.md +581 -0
- package/core/skills/nextjs-react-expert/6-rendering-rendering-performance.md +432 -0
- package/core/skills/nextjs-react-expert/7-js-javascript-performance.md +684 -0
- package/core/skills/nextjs-react-expert/8-advanced-advanced-patterns.md +150 -0
- package/core/skills/nextjs-react-expert/SKILL.md +267 -0
- package/core/skills/nextjs-react-expert/scripts/convert_rules.py +222 -0
- package/core/skills/nextjs-react-expert/scripts/react_performance_checker.py +252 -0
- package/core/skills/nodejs-best-practices/SKILL.md +333 -0
- package/core/skills/notion-task-patterns/SKILL.md +2529 -0
- package/core/skills/page-specifications/SKILL.md +367 -0
- package/core/skills/parallel-agents/SKILL.md +175 -0
- package/core/skills/performance-profiling/SKILL.md +143 -0
- package/core/skills/performance-profiling/scripts/lighthouse_audit.py +76 -0
- package/core/skills/plan-writing/SKILL.md +190 -0
- package/core/skills/powershell-windows/SKILL.md +167 -0
- package/core/skills/project-foundation/SKILL.md +117 -0
- package/core/skills/project-setup/SKILL.md +141 -0
- package/core/skills/project-tracking-patterns/SKILL.md +357 -0
- package/core/skills/project-type-discovery/SKILL.md +239 -0
- package/core/skills/python-patterns/SKILL.md +441 -0
- package/core/skills/qa-test-generation/SKILL.md +156 -0
- package/core/skills/react-components/README.md +36 -0
- package/core/skills/react-components/SKILL.md +47 -0
- package/core/skills/react-components/examples/gold-standard-card.tsx +80 -0
- package/core/skills/react-components/package-lock.json +231 -0
- package/core/skills/react-components/package.json +16 -0
- package/core/skills/react-components/resources/architecture-checklist.md +15 -0
- package/core/skills/react-components/resources/component-template.tsx +37 -0
- package/core/skills/react-components/resources/stitch-api-reference.md +14 -0
- package/core/skills/react-components/resources/style-guide.json +27 -0
- package/core/skills/react-components/scripts/fetch-stitch.sh +30 -0
- package/core/skills/react-components/scripts/validate.js +68 -0
- package/core/skills/red-team-tactics/SKILL.md +199 -0
- package/core/skills/remotion/README.md +105 -0
- package/core/skills/remotion/SKILL.md +393 -0
- package/core/skills/remotion/examples/WalkthroughComposition.tsx +78 -0
- package/core/skills/remotion/examples/screens.json +56 -0
- package/core/skills/remotion/resources/composition-checklist.md +124 -0
- package/core/skills/remotion/resources/screen-slide-template.tsx +123 -0
- package/core/skills/remotion/scripts/download-stitch-asset.sh +38 -0
- package/core/skills/seo-fundamentals/SKILL.md +129 -0
- package/core/skills/seo-fundamentals/scripts/seo_checker.py +219 -0
- package/core/skills/server-management/SKILL.md +161 -0
- package/core/skills/session-resilience/SKILL.md +199 -0
- package/core/skills/shadcn-ui/README.md +248 -0
- package/core/skills/shadcn-ui/SKILL.md +326 -0
- package/core/skills/shadcn-ui/examples/auth-layout.tsx +177 -0
- package/core/skills/shadcn-ui/examples/data-table.tsx +313 -0
- package/core/skills/shadcn-ui/examples/form-pattern.tsx +177 -0
- package/core/skills/shadcn-ui/resources/component-catalog.md +481 -0
- package/core/skills/shadcn-ui/resources/customization-guide.md +516 -0
- package/core/skills/shadcn-ui/resources/migration-guide.md +463 -0
- package/core/skills/shadcn-ui/resources/setup-guide.md +412 -0
- package/core/skills/shadcn-ui/scripts/verify-setup.sh +134 -0
- package/core/skills/state-machine/SKILL.md +264 -0
- package/core/skills/stitch-loop/README.md +54 -0
- package/core/skills/stitch-loop/SKILL.md +203 -0
- package/core/skills/stitch-loop/examples/SITE.md +73 -0
- package/core/skills/stitch-loop/examples/next-prompt.md +25 -0
- package/core/skills/stitch-loop/resources/baton-schema.md +61 -0
- package/core/skills/stitch-loop/resources/site-template.md +104 -0
- package/core/skills/systematic-debugging/SKILL.md +109 -0
- package/core/skills/tailwind-patterns/SKILL.md +284 -0
- package/core/skills/tdd-validation/SKILL.md +243 -0
- package/core/skills/tdd-workflow/SKILL.md +284 -0
- package/core/skills/testing-patterns/SKILL.md +196 -0
- package/core/skills/testing-patterns/scripts/test_runner.py +219 -0
- package/core/skills/ui-ux-discovery/SKILL.md +329 -0
- package/core/skills/ui-validation/SKILL.md +190 -0
- package/core/skills/ui-validation/scripts/ui_antipattern_check.py +317 -0
- package/core/skills/verification-gate/SKILL.md +205 -0
- package/core/skills/vulnerability-scanner/SKILL.md +276 -0
- package/core/skills/vulnerability-scanner/checklists.md +121 -0
- package/core/skills/vulnerability-scanner/scripts/security_scan.py +458 -0
- package/core/skills/web-design-guidelines/SKILL.md +57 -0
- package/core/skills/webapp-testing/SKILL.md +187 -0
- package/core/skills/webapp-testing/scripts/playwright_runner.py +173 -0
- package/core/templates/ARCHITECTURE.template.md +407 -0
- package/core/templates/project-resources.example.json +71 -0
- package/core/workflows/atomic.md +182 -0
- package/core/workflows/brainstorm.md +134 -0
- package/core/workflows/check-task.md +242 -0
- package/core/workflows/copy-collect.md +306 -0
- package/core/workflows/create-agent.md +33 -0
- package/core/workflows/create-skill.md +39 -0
- package/core/workflows/create-workflow.md +33 -0
- package/core/workflows/create.md +92 -0
- package/core/workflows/debug.md +186 -0
- package/core/workflows/demand.md +443 -0
- package/core/workflows/deploy.md +260 -0
- package/core/workflows/discovery.md +267 -0
- package/core/workflows/document.md +272 -0
- package/core/workflows/ds-components.md +296 -0
- package/core/workflows/ds-init.md +58 -0
- package/core/workflows/ds-refactor.md +245 -0
- package/core/workflows/ds-references.md +197 -0
- package/core/workflows/ds-styleguide.md +237 -0
- package/core/workflows/ds-token-diff.md +103 -0
- package/core/workflows/ds-tokens.md +317 -0
- package/core/workflows/ds-validate.md +309 -0
- package/core/workflows/execute.md +483 -0
- package/core/workflows/extract-template.md +278 -0
- package/core/workflows/fix-failed-tests.md +160 -0
- package/core/workflows/init-project.md +386 -0
- package/core/workflows/legacy-project.md +849 -0
- package/core/workflows/log.md +97 -0
- package/core/workflows/new-project.md +610 -0
- package/core/workflows/new-project.md.bak +3292 -0
- package/core/workflows/new-task.md +404 -0
- package/core/workflows/orchestrate.md +237 -0
- package/core/workflows/page-build.md +296 -0
- package/core/workflows/plan.md +89 -0
- package/core/workflows/prd.md +255 -0
- package/core/workflows/preview.md +81 -0
- package/core/workflows/review-page.md +304 -0
- package/core/workflows/status.md +86 -0
- package/core/workflows/stitch.md +226 -0
- package/core/workflows/task-complete.md +473 -0
- package/core/workflows/task-update.md +163 -0
- package/core/workflows/tdd.md +344 -0
- package/core/workflows/test.md +251 -0
- package/core/workflows/ui-ux-pro-max.md +437 -0
- package/core/workflows/ux-mobile-optimize.md +262 -0
- package/core/workflows/ux-mobile-validate.md +297 -0
- package/engine-files/GEMINI.md +69 -0
- package/package.json +47 -0
- package/runtime-adapters/antigravity.js +26 -0
- package/runtime-adapters/claude.js +57 -0
- package/runtime-adapters/codex.js +51 -0
- package/runtime-adapters/copilot.js +51 -0
- package/runtime-adapters/cursor.js +51 -0
- package/runtime-adapters/gemini-cli.js +30 -0
- package/runtime-adapters/opencode.js +51 -0
- package/runtime-adapters/windsurf.js +51 -0
|
@@ -0,0 +1,296 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Create, extend, and document Design System components using **shadcn/ui as the canonical base**, strictly governed by Design Tokens and Design System validation rules.
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
This workflow guarantees:
|
|
6
|
+
|
|
7
|
+
* Visual consistency
|
|
8
|
+
* Token-only styling
|
|
9
|
+
* Proper documentation
|
|
10
|
+
* Safe scalability of UI components
|
|
11
|
+
|
|
12
|
+
---
|
|
13
|
+
|
|
14
|
+
## HARD PRECONDITIONS (NON-NEGOTIABLE)
|
|
15
|
+
|
|
16
|
+
Before execution, **ALL** conditions below MUST be true:
|
|
17
|
+
|
|
18
|
+
* `design_system.validated === true`
|
|
19
|
+
* `design_system.tokens === "ready"`
|
|
20
|
+
* `design_system.token_origin !== "scaffold_only"`
|
|
21
|
+
* `shadcn/ui` is initialized
|
|
22
|
+
* `src/app/globals.css` exists
|
|
23
|
+
* No pending blocking issues from `/next-step`
|
|
24
|
+
* `/next-step` status === "ALLOW_COMPONENTS"
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
❌ If any condition fails → **BLOCK execution**
|
|
28
|
+
✅ Output reason + required corrective command
|
|
29
|
+
|
|
30
|
+
---
|
|
31
|
+
|
|
32
|
+
## INPUT
|
|
33
|
+
|
|
34
|
+
* Component name (required)
|
|
35
|
+
* Optional customization requirements (variants, states, behaviors)
|
|
36
|
+
|
|
37
|
+
Example:
|
|
38
|
+
|
|
39
|
+
```
|
|
40
|
+
/ds-components Button
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
---
|
|
44
|
+
|
|
45
|
+
## WORKFLOW STEPS
|
|
46
|
+
|
|
47
|
+
---
|
|
48
|
+
|
|
49
|
+
### 1. Component Discovery (shadcn Registry)
|
|
50
|
+
|
|
51
|
+
Use shadcn MCP to determine if the component exists.
|
|
52
|
+
|
|
53
|
+
#### Actions
|
|
54
|
+
|
|
55
|
+
* `search_items_in_registries` → query: `[component-name]`
|
|
56
|
+
|
|
57
|
+
#### Decision
|
|
58
|
+
|
|
59
|
+
* If found → go to **Step 2**
|
|
60
|
+
* If NOT found → go to **Step 4**
|
|
61
|
+
|
|
62
|
+
---
|
|
63
|
+
|
|
64
|
+
### 2. Install Base Component (shadcn)
|
|
65
|
+
|
|
66
|
+
Retrieve install command:
|
|
67
|
+
|
|
68
|
+
* `get_add_command_for_items`
|
|
69
|
+
|
|
70
|
+
Execute:
|
|
71
|
+
|
|
72
|
+
```bash
|
|
73
|
+
npx shadcn@latest add [component-name]
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
#### Post-install Verification
|
|
77
|
+
|
|
78
|
+
* Component created in `/components/ui/`
|
|
79
|
+
* Uses Tailwind classes mapped to CSS variables
|
|
80
|
+
* No hardcoded colors, spacing, or fonts
|
|
81
|
+
|
|
82
|
+
---
|
|
83
|
+
|
|
84
|
+
### 3. Optional Customization (Extension Layer)
|
|
85
|
+
|
|
86
|
+
If the base component requires project-specific behavior or variants:
|
|
87
|
+
|
|
88
|
+
#### Rules
|
|
89
|
+
|
|
90
|
+
* ❌ Never modify files in `/components/ui/`
|
|
91
|
+
* ✅ Create wrapper in `/components/[ComponentName].tsx`
|
|
92
|
+
* ✅ Use CSS variables only (`bg-primary`, `text-muted-foreground`, etc.)
|
|
93
|
+
|
|
94
|
+
#### Example Pattern
|
|
95
|
+
|
|
96
|
+
```tsx
|
|
97
|
+
import { Button } from "@/components/ui/button"
|
|
98
|
+
import { cn } from "@/lib/utils"
|
|
99
|
+
|
|
100
|
+
interface CustomButtonProps extends React.ComponentProps<typeof Button> {
|
|
101
|
+
intent?: "default" | "success" | "warning" | "info"
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
export function CustomButton({
|
|
105
|
+
intent = "default",
|
|
106
|
+
className,
|
|
107
|
+
...props
|
|
108
|
+
}: CustomButtonProps) {
|
|
109
|
+
return (
|
|
110
|
+
<Button
|
|
111
|
+
className={cn(
|
|
112
|
+
intent === "success" && "bg-success text-success-foreground",
|
|
113
|
+
intent === "warning" && "bg-warning text-warning-foreground",
|
|
114
|
+
intent === "info" && "bg-info text-info-foreground",
|
|
115
|
+
className
|
|
116
|
+
)}
|
|
117
|
+
{...props}
|
|
118
|
+
/>
|
|
119
|
+
)
|
|
120
|
+
}
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
---
|
|
124
|
+
|
|
125
|
+
### 4. Build Custom Component (If Not in shadcn)
|
|
126
|
+
|
|
127
|
+
If the component does not exist in shadcn:
|
|
128
|
+
|
|
129
|
+
#### Rules
|
|
130
|
+
|
|
131
|
+
* Use shadcn primitives and patterns
|
|
132
|
+
* Use Tailwind + CSS variables exclusively
|
|
133
|
+
* Follow accessibility best practices (ARIA, keyboard support)
|
|
134
|
+
|
|
135
|
+
#### Example
|
|
136
|
+
|
|
137
|
+
```tsx
|
|
138
|
+
import { cn } from "@/lib/utils"
|
|
139
|
+
|
|
140
|
+
interface CustomWidgetProps {
|
|
141
|
+
variant?: "default" | "primary" | "muted"
|
|
142
|
+
className?: string
|
|
143
|
+
children: React.ReactNode
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
export function CustomWidget({
|
|
147
|
+
variant = "default",
|
|
148
|
+
className,
|
|
149
|
+
children,
|
|
150
|
+
}: CustomWidgetProps) {
|
|
151
|
+
return (
|
|
152
|
+
<div
|
|
153
|
+
className={cn(
|
|
154
|
+
"rounded-lg border p-4",
|
|
155
|
+
variant === "default" && "bg-card text-card-foreground border-border",
|
|
156
|
+
variant === "primary" && "bg-primary text-primary-foreground border-primary",
|
|
157
|
+
variant === "muted" && "bg-muted text-muted-foreground border-border",
|
|
158
|
+
className
|
|
159
|
+
)}
|
|
160
|
+
>
|
|
161
|
+
{children}
|
|
162
|
+
</div>
|
|
163
|
+
)
|
|
164
|
+
}
|
|
165
|
+
```
|
|
166
|
+
|
|
167
|
+
---
|
|
168
|
+
|
|
169
|
+
### 5. Generate Component Showcase (MANDATORY)
|
|
170
|
+
|
|
171
|
+
Create:
|
|
172
|
+
|
|
173
|
+
```
|
|
174
|
+
src/app/styleguide/components/[component-name]/page.tsx
|
|
175
|
+
```
|
|
176
|
+
|
|
177
|
+
#### Must Include
|
|
178
|
+
|
|
179
|
+
* All variants
|
|
180
|
+
* All states (default, hover, focus, disabled, loading)
|
|
181
|
+
* Light & Dark mode (using Theme Toggle)
|
|
182
|
+
* Interactive examples
|
|
183
|
+
* Code snippets
|
|
184
|
+
|
|
185
|
+
❌ If showcase is missing → component is considered **incomplete**
|
|
186
|
+
|
|
187
|
+
❌ If the component exists in `/components/` but has no showcase page
|
|
188
|
+
→ Treat as INVALID
|
|
189
|
+
→ Must not be referenced by any UI or page
|
|
190
|
+
|
|
191
|
+
|
|
192
|
+
---
|
|
193
|
+
|
|
194
|
+
### 6. Document Usage
|
|
195
|
+
|
|
196
|
+
Inside the showcase page, document:
|
|
197
|
+
|
|
198
|
+
* Import path
|
|
199
|
+
* Basic usage
|
|
200
|
+
* Props table (types + defaults)
|
|
201
|
+
* Variant examples
|
|
202
|
+
* Accessibility notes
|
|
203
|
+
|
|
204
|
+
---
|
|
205
|
+
|
|
206
|
+
### 7. Update Styleguide Navigation
|
|
207
|
+
|
|
208
|
+
Update:
|
|
209
|
+
|
|
210
|
+
```
|
|
211
|
+
src/app/styleguide/navigation.ts
|
|
212
|
+
```
|
|
213
|
+
|
|
214
|
+
Add entry:
|
|
215
|
+
|
|
216
|
+
```ts
|
|
217
|
+
{
|
|
218
|
+
name: "[Component Name]",
|
|
219
|
+
href: "/styleguide/components/[component-name]"
|
|
220
|
+
}
|
|
221
|
+
```
|
|
222
|
+
|
|
223
|
+
---
|
|
224
|
+
|
|
225
|
+
### 8. Validation Check (Component-Level)
|
|
226
|
+
|
|
227
|
+
Before completion, validate:
|
|
228
|
+
|
|
229
|
+
* No hardcoded styles
|
|
230
|
+
* Uses only tokens from `globals.css`
|
|
231
|
+
* Renders correctly in light and dark mode
|
|
232
|
+
* Matches shadcn patterns
|
|
233
|
+
* Passes accessibility baseline
|
|
234
|
+
|
|
235
|
+
❌ If any check fails → BLOCK completion
|
|
236
|
+
|
|
237
|
+
---
|
|
238
|
+
|
|
239
|
+
### Project State Update (Mandatory)
|
|
240
|
+
|
|
241
|
+
{
|
|
242
|
+
"design_system": {
|
|
243
|
+
"components": "in_progress",
|
|
244
|
+
"last_component_added": "[component-name]",
|
|
245
|
+
"last_updated": "ISO_TIMESTAMP"
|
|
246
|
+
}
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
|
|
250
|
+
---
|
|
251
|
+
|
|
252
|
+
## OUTPUT
|
|
253
|
+
|
|
254
|
+
* Component installed or created
|
|
255
|
+
* Optional custom wrapper added
|
|
256
|
+
* Showcase page generated
|
|
257
|
+
* Styleguide navigation updated
|
|
258
|
+
* Component visible and interactive in `/styleguide`
|
|
259
|
+
|
|
260
|
+
---
|
|
261
|
+
|
|
262
|
+
## POST-CONDITIONS
|
|
263
|
+
|
|
264
|
+
On success:
|
|
265
|
+
|
|
266
|
+
* Component is approved for reuse
|
|
267
|
+
* Component becomes part of the official Design System
|
|
268
|
+
* No further UI generation is blocked by this component
|
|
269
|
+
|
|
270
|
+
---
|
|
271
|
+
|
|
272
|
+
## AUTHORITY & RESTRICTIONS
|
|
273
|
+
|
|
274
|
+
* This workflow is the **ONLY allowed way** to create components
|
|
275
|
+
* Manual UI component creation outside this workflow is forbidden
|
|
276
|
+
* Tokens are immutable during this workflow
|
|
277
|
+
* Design decisions are LOCKED
|
|
278
|
+
|
|
279
|
+
---
|
|
280
|
+
|
|
281
|
+
## RELATED WORKFLOWS
|
|
282
|
+
|
|
283
|
+
* `/ds-init`
|
|
284
|
+
* `/ds-tokens`
|
|
285
|
+
* `/ds-validate`
|
|
286
|
+
* `/ds-styleguide`
|
|
287
|
+
* `/next-step`
|
|
288
|
+
|
|
289
|
+
---
|
|
290
|
+
|
|
291
|
+
## FINAL NOTE
|
|
292
|
+
|
|
293
|
+
> **shadcn defines structure.
|
|
294
|
+
> Tokens define identity.
|
|
295
|
+
> The styleguide proves correctness.**
|
|
296
|
+
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Initialize a production-ready Design System using shadcn/ui.
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
## STEPS
|
|
6
|
+
|
|
7
|
+
1. Verify if the project uses Next.js App Router.
|
|
8
|
+
- If not, abort and request explicit user confirmation.
|
|
9
|
+
|
|
10
|
+
2. Initialize shadcn/ui as the **UI infrastructure layer**:
|
|
11
|
+
- Run `npx shadcn@latest init`
|
|
12
|
+
- Use default style
|
|
13
|
+
- Enable CSS variables
|
|
14
|
+
- Select neutral base color
|
|
15
|
+
|
|
16
|
+
⚠️ Important:
|
|
17
|
+
- shadcn/ui DOES NOT define the Design System
|
|
18
|
+
- It only provides the structural and technical foundation
|
|
19
|
+
- All visual identity will be overridden by Design Tokens
|
|
20
|
+
|
|
21
|
+
3. Verify that `/app/globals.css` exists.
|
|
22
|
+
- If missing, create it.
|
|
23
|
+
|
|
24
|
+
4. Inject a **minimal and provisional** CSS variable scaffold into `globals.css`:
|
|
25
|
+
- Background
|
|
26
|
+
- Foreground
|
|
27
|
+
- Primary
|
|
28
|
+
- Secondary
|
|
29
|
+
- Muted
|
|
30
|
+
- Accent
|
|
31
|
+
- Destructive
|
|
32
|
+
- Border
|
|
33
|
+
- Radius
|
|
34
|
+
- Light and Dark mode blocks
|
|
35
|
+
|
|
36
|
+
⚠️ Rules:
|
|
37
|
+
- Values are placeholders only
|
|
38
|
+
- No brand decisions are allowed here
|
|
39
|
+
- These variables MUST be replaced by `/ds-tokens`
|
|
40
|
+
|
|
41
|
+
5. Ensure Tailwind is configured to consume CSS variables:
|
|
42
|
+
- colors
|
|
43
|
+
- borderRadius
|
|
44
|
+
- shadows
|
|
45
|
+
- typography (if applicable)
|
|
46
|
+
|
|
47
|
+
6. Scan the project for existing UI components:
|
|
48
|
+
- If hardcoded styles are found:
|
|
49
|
+
- Emit warnings
|
|
50
|
+
- Do NOT fail initialization
|
|
51
|
+
- Block UI generation in `/next-step` until resolved
|
|
52
|
+
|
|
53
|
+
## OUTPUT
|
|
54
|
+
- shadcn/ui initialized as infrastructure
|
|
55
|
+
- globals.css prepared with provisional tokens
|
|
56
|
+
- Tailwind configured for token consumption
|
|
57
|
+
- Design System marked as `initialized`
|
|
58
|
+
- Project ready for `/ds-tokens`
|
|
@@ -0,0 +1,245 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: This workflow provides a controlled, auditable, and user-authorized mechanism to refactor existing UI code so it fully complies with the Design System, without redoing the design. It exists **only** to remediate violations detected by `/ds-validate`
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
## PURPOSE
|
|
6
|
+
|
|
7
|
+
Safely convert **non-compliant UI code** (hardcoded values, inline styles, token bypasses) into **token-only, governance-compliant code**, while:
|
|
8
|
+
|
|
9
|
+
* Preserving visual output
|
|
10
|
+
* Preserving component structure
|
|
11
|
+
* Preserving locked design decisions
|
|
12
|
+
* Maintaining full auditability
|
|
13
|
+
|
|
14
|
+
---
|
|
15
|
+
|
|
16
|
+
## HARD PRECONDITIONS (NON-NEGOTIABLE)
|
|
17
|
+
|
|
18
|
+
The workflow **MUST NOT RUN** unless **ALL** conditions are met:
|
|
19
|
+
|
|
20
|
+
1. `design_system.validated === false`
|
|
21
|
+
2. A `/ds-validate` run exists with status **FAIL**
|
|
22
|
+
3. Validation report exists at:
|
|
23
|
+
|
|
24
|
+
```
|
|
25
|
+
src/design-system/validation/ds-validation-report.json
|
|
26
|
+
```
|
|
27
|
+
4. Violations include **auto-fixable types only** (see classification below)
|
|
28
|
+
5. User has explicitly invoked `/ds-refactor`
|
|
29
|
+
|
|
30
|
+
❌ If any condition fails → **ABORT**
|
|
31
|
+
|
|
32
|
+
---
|
|
33
|
+
|
|
34
|
+
## AUTO-FIXABLE VIOLATION TYPES
|
|
35
|
+
|
|
36
|
+
Only the following violations are eligible:
|
|
37
|
+
|
|
38
|
+
| Type | Description |
|
|
39
|
+
| ----------------- | --------------------------------------------------- |
|
|
40
|
+
| `hardcoded_color` | Hex/RGB values replaceable by existing color tokens |
|
|
41
|
+
| `inline_style` | Inline styles convertible to Tailwind token classes |
|
|
42
|
+
| `raw_spacing` | Numeric spacing matching existing spacing tokens |
|
|
43
|
+
| `raw_radius` | Border-radius values matching radius tokens |
|
|
44
|
+
|
|
45
|
+
❌ NOT ELIGIBLE:
|
|
46
|
+
|
|
47
|
+
* Missing tokens
|
|
48
|
+
* New variants
|
|
49
|
+
* Layout changes
|
|
50
|
+
* Visual hierarchy changes
|
|
51
|
+
* Behavioral logic changes
|
|
52
|
+
|
|
53
|
+
---
|
|
54
|
+
|
|
55
|
+
## INPUT
|
|
56
|
+
|
|
57
|
+
```text
|
|
58
|
+
/ds-refactor
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
Optional:
|
|
62
|
+
|
|
63
|
+
```text
|
|
64
|
+
/ds-refactor --apply
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
---
|
|
68
|
+
|
|
69
|
+
## WORKFLOW STEPS
|
|
70
|
+
|
|
71
|
+
---
|
|
72
|
+
|
|
73
|
+
### 1️⃣ Load Validation Artifacts
|
|
74
|
+
|
|
75
|
+
Read:
|
|
76
|
+
|
|
77
|
+
* `ds-validation-report.json`
|
|
78
|
+
* Affected source files
|
|
79
|
+
* `globals.css`
|
|
80
|
+
* Design token definitions
|
|
81
|
+
|
|
82
|
+
---
|
|
83
|
+
|
|
84
|
+
### 2️⃣ Violation Classification
|
|
85
|
+
|
|
86
|
+
For each violation, produce a structured record:
|
|
87
|
+
|
|
88
|
+
```json
|
|
89
|
+
{
|
|
90
|
+
"file": "goal-card.tsx",
|
|
91
|
+
"violation_type": "hardcoded_color",
|
|
92
|
+
"original": "#0F172A",
|
|
93
|
+
"mapped_token": "bg-card",
|
|
94
|
+
"confidence": "high"
|
|
95
|
+
}
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
If **any** violation cannot be deterministically mapped → **BLOCK** workflow.
|
|
99
|
+
|
|
100
|
+
---
|
|
101
|
+
|
|
102
|
+
### 3️⃣ Patch Generation (Dry Run)
|
|
103
|
+
|
|
104
|
+
Generate **diff-only patches**.
|
|
105
|
+
|
|
106
|
+
Example:
|
|
107
|
+
|
|
108
|
+
```diff
|
|
109
|
+
- backgroundColor: "#0F172A"
|
|
110
|
+
+ className="bg-card"
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
Rules:
|
|
114
|
+
|
|
115
|
+
* ❌ No file writes
|
|
116
|
+
* ❌ No formatting changes
|
|
117
|
+
* ❌ No refactors beyond token replacement
|
|
118
|
+
|
|
119
|
+
---
|
|
120
|
+
|
|
121
|
+
### 4️⃣ Review Summary (MANDATORY STOP)
|
|
122
|
+
|
|
123
|
+
Output a summary:
|
|
124
|
+
|
|
125
|
+
```text
|
|
126
|
+
Auto-refactor candidates detected
|
|
127
|
+
Files: 6
|
|
128
|
+
Total changes: 19
|
|
129
|
+
|
|
130
|
+
Affected files:
|
|
131
|
+
- goal-card.tsx
|
|
132
|
+
- meeting-card.tsx
|
|
133
|
+
- feature-card.tsx
|
|
134
|
+
- documents-card.tsx
|
|
135
|
+
- lead-card.tsx
|
|
136
|
+
- summary-card.tsx
|
|
137
|
+
|
|
138
|
+
Authorize application?
|
|
139
|
+
/ds-refactor --apply
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
❌ Without explicit authorization → **STOP**
|
|
143
|
+
|
|
144
|
+
---
|
|
145
|
+
|
|
146
|
+
### 5️⃣ Apply Patches (Authorized Only)
|
|
147
|
+
|
|
148
|
+
When invoked with `--apply`:
|
|
149
|
+
|
|
150
|
+
* Apply generated diffs
|
|
151
|
+
* Preserve original formatting
|
|
152
|
+
* Do NOT introduce new tokens
|
|
153
|
+
* Do NOT alter component APIs
|
|
154
|
+
|
|
155
|
+
---
|
|
156
|
+
|
|
157
|
+
### 6️⃣ Build & Sanity Check
|
|
158
|
+
|
|
159
|
+
* Run build
|
|
160
|
+
* Verify no runtime errors
|
|
161
|
+
* Ensure visual output unchanged (best-effort)
|
|
162
|
+
|
|
163
|
+
❌ On failure → rollback changes
|
|
164
|
+
|
|
165
|
+
---
|
|
166
|
+
|
|
167
|
+
### 7️⃣ Re-run Validation
|
|
168
|
+
|
|
169
|
+
Automatically invoke:
|
|
170
|
+
|
|
171
|
+
```
|
|
172
|
+
/ds-validate
|
|
173
|
+
```
|
|
174
|
+
|
|
175
|
+
---
|
|
176
|
+
|
|
177
|
+
### 8️⃣ Audit Log Generation
|
|
178
|
+
|
|
179
|
+
Create:
|
|
180
|
+
|
|
181
|
+
```
|
|
182
|
+
src/design-system/audit/ds-refactor-log.md
|
|
183
|
+
```
|
|
184
|
+
|
|
185
|
+
Include:
|
|
186
|
+
|
|
187
|
+
* Timestamp
|
|
188
|
+
* Files changed
|
|
189
|
+
* Tokens used
|
|
190
|
+
* Validation result (PASS/FAIL)
|
|
191
|
+
* User authorization confirmation
|
|
192
|
+
|
|
193
|
+
---
|
|
194
|
+
|
|
195
|
+
## OUTPUT
|
|
196
|
+
|
|
197
|
+
### On Success
|
|
198
|
+
|
|
199
|
+
```text
|
|
200
|
+
Design System Refactor: COMPLETE
|
|
201
|
+
Validation: PASS
|
|
202
|
+
UI Generation: UNBLOCKED
|
|
203
|
+
```
|
|
204
|
+
|
|
205
|
+
### On Failure
|
|
206
|
+
|
|
207
|
+
```text
|
|
208
|
+
Design System Refactor: PARTIAL / FAILED
|
|
209
|
+
Remaining Violations: X
|
|
210
|
+
Next Action: Manual remediation required
|
|
211
|
+
UI Generation: BLOCKED
|
|
212
|
+
```
|
|
213
|
+
|
|
214
|
+
---
|
|
215
|
+
|
|
216
|
+
## GOVERNANCE RULES (HARD LAW)
|
|
217
|
+
|
|
218
|
+
* No silent fixes
|
|
219
|
+
* No automatic application
|
|
220
|
+
* No token mutation
|
|
221
|
+
* No visual redesign
|
|
222
|
+
* Full auditability required
|
|
223
|
+
|
|
224
|
+
---
|
|
225
|
+
|
|
226
|
+
## `/next-step` INTEGRATION
|
|
227
|
+
|
|
228
|
+
`/next-step` MUST interpret:
|
|
229
|
+
|
|
230
|
+
```text
|
|
231
|
+
ds-validate FAIL + auto-fixable violations
|
|
232
|
+
```
|
|
233
|
+
|
|
234
|
+
As:
|
|
235
|
+
|
|
236
|
+
```text
|
|
237
|
+
NEXT ACTION: /ds-refactor
|
|
238
|
+
```
|
|
239
|
+
|
|
240
|
+
---
|
|
241
|
+
|
|
242
|
+
## FINAL PRINCIPLE
|
|
243
|
+
|
|
244
|
+
> **Refactoring is correction, not redesign.**
|
|
245
|
+
> **Governance is preserved, velocity is restored.**
|