@theproductguy/create-mission-control 1.0.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/README.md +37 -0
- package/bin/cli.js +170 -0
- package/package.json +44 -0
- package/src/template/App.tsx +28 -0
- package/src/template/agent-os/commands/create-tasks/1-get-spec-requirements.md +19 -0
- package/src/template/agent-os/commands/create-tasks/2-create-tasks-list.md +234 -0
- package/src/template/agent-os/commands/create-tasks/create-tasks.md +254 -0
- package/src/template/agent-os/commands/design-screen/design-screen.md +32 -0
- package/src/template/agent-os/commands/design-shell/design-shell.md +34 -0
- package/src/template/agent-os/commands/design-tokens/design-tokens.md +36 -0
- package/src/template/agent-os/commands/export-product/export-product.md +181 -0
- package/src/template/agent-os/commands/implement-tasks/1-determine-tasks.md +13 -0
- package/src/template/agent-os/commands/implement-tasks/2-implement-tasks.md +63 -0
- package/src/template/agent-os/commands/implement-tasks/3-verify-implementation.md +113 -0
- package/src/template/agent-os/commands/implement-tasks/implement-tasks.md +207 -0
- package/src/template/agent-os/commands/initialize-design/initialize-design.md +67 -0
- package/src/template/agent-os/commands/orchestrate-tasks/orchestrate-tasks.md +180 -0
- package/src/template/agent-os/commands/plan-product/1-product-concept.md +53 -0
- package/src/template/agent-os/commands/plan-product/2-create-mission.md +78 -0
- package/src/template/agent-os/commands/plan-product/3-create-roadmap.md +73 -0
- package/src/template/agent-os/commands/plan-product/4-create-tech-stack.md +46 -0
- package/src/template/agent-os/commands/plan-product/plan-product.md +241 -0
- package/src/template/agent-os/commands/sample-data/sample-data.md +51 -0
- package/src/template/agent-os/commands/scaffold-implementation/scaffold-implementation.md +35 -0
- package/src/template/agent-os/commands/screenshot-design/screenshot-design.md +21 -0
- package/src/template/agent-os/commands/shape-spec/1-initialize-spec.md +95 -0
- package/src/template/agent-os/commands/shape-spec/2-shape-spec.md +300 -0
- package/src/template/agent-os/commands/shape-spec/shape-spec.md +40 -0
- package/src/template/agent-os/commands/write-spec/write-spec.md +134 -0
- package/src/template/agent-os/config.yml +13 -0
- package/src/template/agent-os/product/mission.md +29 -0
- package/src/template/agent-os/product/roadmap.md +9 -0
- package/src/template/agent-os/product/tech-stack.md +14 -0
- package/src/template/agent-os/scripts/generate_docs.sh +150 -0
- package/src/template/agent-os/specs/README.md +1 -0
- package/src/template/agent-os/standards/backend/api.md +10 -0
- package/src/template/agent-os/standards/backend/migrations.md +9 -0
- package/src/template/agent-os/standards/backend/models.md +10 -0
- package/src/template/agent-os/standards/backend/queries.md +9 -0
- package/src/template/agent-os/standards/frontend/accessibility.md +10 -0
- package/src/template/agent-os/standards/frontend/components.md +11 -0
- package/src/template/agent-os/standards/frontend/css.md +7 -0
- package/src/template/agent-os/standards/frontend/responsive.md +11 -0
- package/src/template/agent-os/standards/global/coding-style.md +10 -0
- package/src/template/agent-os/standards/global/commenting.md +5 -0
- package/src/template/agent-os/standards/global/conventions.md +11 -0
- package/src/template/agent-os/standards/global/error-handling.md +9 -0
- package/src/template/agent-os/standards/global/tech-stack.md +31 -0
- package/src/template/agent-os/standards/global/validation.md +11 -0
- package/src/template/agent-os/standards/testing/test-writing.md +9 -0
- package/src/template/agent-os-ui/README.md +73 -0
- package/src/template/agent-os-ui/package.json +54 -0
- package/src/template/agent-os-ui/src/components/AgentShell.tsx +31 -0
- package/src/template/agent-os-ui/src/components/AgentSidebar.tsx +65 -0
- package/src/template/agent-os-ui/src/components/GuidanceCard.tsx +75 -0
- package/src/template/agent-os-ui/src/components/MarkdownViewer.tsx +25 -0
- package/src/template/agent-os-ui/src/components/PromptButton.tsx +28 -0
- package/src/template/agent-os-ui/src/components/StatusItem.tsx +45 -0
- package/src/template/agent-os-ui/src/components/ThemeToggle.tsx +72 -0
- package/src/template/agent-os-ui/src/index.ts +11 -0
- package/src/template/agent-os-ui/src/style.css +3 -0
- package/src/template/agent-os-ui/tsconfig.json +33 -0
- package/src/template/agent-os-ui/vite.config.ts +32 -0
- package/src/template/control-center/backend/index.js +253 -0
- package/src/template/control-center/backend/package.json +19 -0
- package/src/template/control-center/frontend/README.md +73 -0
- package/src/template/control-center/frontend/eslint.config.js +23 -0
- package/src/template/control-center/frontend/index.html +21 -0
- package/src/template/control-center/frontend/package.json +43 -0
- package/src/template/control-center/frontend/postcss.config.js +6 -0
- package/src/template/control-center/frontend/public/favicon.svg +4 -0
- package/src/template/control-center/frontend/public/runtime-config.json +11 -0
- package/src/template/control-center/frontend/public/vite.svg +1 -0
- package/src/template/control-center/frontend/src/App.css +42 -0
- package/src/template/control-center/frontend/src/App.tsx +835 -0
- package/src/template/control-center/frontend/src/assets/react.svg +1 -0
- package/src/template/control-center/frontend/src/components/ThemeToggle.tsx +64 -0
- package/src/template/control-center/frontend/src/components/ui/ToastContext.tsx +81 -0
- package/src/template/control-center/frontend/src/index.css +149 -0
- package/src/template/control-center/frontend/src/main.tsx +14 -0
- package/src/template/control-center/frontend/src/vite-env.d.ts +1 -0
- package/src/template/control-center/frontend/tailwind.config.js +81 -0
- package/src/template/control-center/frontend/tsconfig.app.json +28 -0
- package/src/template/control-center/frontend/tsconfig.json +7 -0
- package/src/template/control-center/frontend/tsconfig.node.json +26 -0
- package/src/template/control-center/frontend/vite.config.ts +21 -0
- package/src/template/design/.claude/commands/design-os/data-model.md +122 -0
- package/src/template/design/.claude/commands/design-os/design-screen.md +309 -0
- package/src/template/design/.claude/commands/design-os/design-shell.md +238 -0
- package/src/template/design/.claude/commands/design-os/design-tokens.md +166 -0
- package/src/template/design/.claude/commands/design-os/export-product.md +1105 -0
- package/src/template/design/.claude/commands/design-os/product-roadmap.md +121 -0
- package/src/template/design/.claude/commands/design-os/product-vision.md +99 -0
- package/src/template/design/.claude/commands/design-os/sample-data.md +263 -0
- package/src/template/design/.claude/commands/design-os/screenshot-design.md +112 -0
- package/src/template/design/.claude/commands/design-os/shape-section.md +138 -0
- package/src/template/design/.claude/skills/frontend-design/SKILL.md +42 -0
- package/src/template/design/.github/CODE_OF_CONDUCT.md +5 -0
- package/src/template/design/.github/CONTRIBUTING.md +51 -0
- package/src/template/design/.github/ISSUE_TEMPLATE/config.yml +22 -0
- package/src/template/design/.github/PULL_REQUEST_TEMPLATE.md +20 -0
- package/src/template/design/.github/SECURITY.yml +5 -0
- package/src/template/design/.github/SUPPORT.md +19 -0
- package/src/template/design/.github/workflows/pr-decline.yml +135 -0
- package/src/template/design/.github/workflows/stale.yml +25 -0
- package/src/template/design/CHANGELOG.md +13 -0
- package/src/template/design/LICENSE +21 -0
- package/src/template/design/README.md +54 -0
- package/src/template/design/agents.md +218 -0
- package/src/template/design/claude.md +1 -0
- package/src/template/design/components.json +22 -0
- package/src/template/design/docs/codebase-implementation.md +153 -0
- package/src/template/design/docs/design-section.md +135 -0
- package/src/template/design/docs/export.md +149 -0
- package/src/template/design/docs/getting-started.md +59 -0
- package/src/template/design/docs/index.md +56 -0
- package/src/template/design/docs/product-planning.md +113 -0
- package/src/template/design/docs/requirements.md +22 -0
- package/src/template/design/docs/usage.md +62 -0
- package/src/template/design/eslint.config.js +23 -0
- package/src/template/design/index.html +21 -0
- package/src/template/design/package.json +46 -0
- package/src/template/design/postcss.config.js +6 -0
- package/src/template/design/public/favicon.svg +4 -0
- package/src/template/design/public/vite.svg +1 -0
- package/src/template/design/src/assets/react.svg +1 -0
- package/src/template/design/src/components/AppLayout.tsx +95 -0
- package/src/template/design/src/components/DataCard.tsx +139 -0
- package/src/template/design/src/components/DataModelPage.tsx +120 -0
- package/src/template/design/src/components/DesignPage.tsx +284 -0
- package/src/template/design/src/components/EmptyState.tsx +158 -0
- package/src/template/design/src/components/ExportPage.tsx +354 -0
- package/src/template/design/src/components/NextPhaseButton.tsx +33 -0
- package/src/template/design/src/components/PhaseNav.tsx +152 -0
- package/src/template/design/src/components/PhaseWarningBanner.tsx +81 -0
- package/src/template/design/src/components/ProductOverviewCard.tsx +102 -0
- package/src/template/design/src/components/ProductPage.tsx +97 -0
- package/src/template/design/src/components/ScreenDesignPage.tsx +370 -0
- package/src/template/design/src/components/ScreenDesignsCard.tsx +49 -0
- package/src/template/design/src/components/SectionPage.tsx +256 -0
- package/src/template/design/src/components/SectionsCard.tsx +47 -0
- package/src/template/design/src/components/SectionsPage.tsx +181 -0
- package/src/template/design/src/components/ShellCard.tsx +85 -0
- package/src/template/design/src/components/ShellDesignPage.tsx +242 -0
- package/src/template/design/src/components/SpecCard.tsx +121 -0
- package/src/template/design/src/components/StepIndicator.tsx +75 -0
- package/src/template/design/src/components/ThemeToggle.tsx +86 -0
- package/src/template/design/src/components/ui/ToastContext.tsx +81 -0
- package/src/template/design/src/components/ui/avatar.tsx +53 -0
- package/src/template/design/src/components/ui/badge.tsx +46 -0
- package/src/template/design/src/components/ui/button.tsx +60 -0
- package/src/template/design/src/components/ui/card.tsx +92 -0
- package/src/template/design/src/components/ui/collapsible.tsx +48 -0
- package/src/template/design/src/components/ui/dialog.tsx +143 -0
- package/src/template/design/src/components/ui/dropdown-menu.tsx +255 -0
- package/src/template/design/src/components/ui/input.tsx +21 -0
- package/src/template/design/src/components/ui/label.tsx +22 -0
- package/src/template/design/src/components/ui/progress.tsx +24 -0
- package/src/template/design/src/components/ui/scroll-area.tsx +18 -0
- package/src/template/design/src/components/ui/select.tsx +67 -0
- package/src/template/design/src/components/ui/separator.tsx +28 -0
- package/src/template/design/src/components/ui/sheet.tsx +137 -0
- package/src/template/design/src/components/ui/skeleton.tsx +13 -0
- package/src/template/design/src/components/ui/switch.tsx +46 -0
- package/src/template/design/src/components/ui/table.tsx +116 -0
- package/src/template/design/src/components/ui/tabs.tsx +64 -0
- package/src/template/design/src/index.css +239 -0
- package/src/template/design/src/lib/data-model-loader.ts +91 -0
- package/src/template/design/src/lib/design-system-loader.ts +101 -0
- package/src/template/design/src/lib/product-loader.ts +221 -0
- package/src/template/design/src/lib/router.tsx +61 -0
- package/src/template/design/src/lib/section-loader.ts +272 -0
- package/src/template/design/src/lib/shell-loader.ts +175 -0
- package/src/template/design/src/lib/utils.ts +6 -0
- package/src/template/design/src/main.tsx +15 -0
- package/src/template/design/src/sections/.gitkeep +0 -0
- package/src/template/design/src/sections/ai-orchestration-engine-oai/OrchestrationEngine.tsx +348 -0
- package/src/template/design/src/sections/core-platform-shell/AppShell.tsx +403 -0
- package/src/template/design/src/sections/gemini-live-integration/GeminiIntegration.tsx +332 -0
- package/src/template/design/src/sections/interactive-2d-canvas/WhiteboardCanvas.tsx +334 -0
- package/src/template/design/src/sections/participation-equity-tracker/EquityTracker.tsx +383 -0
- package/src/template/design/src/sections/persistent-memory-system/PersistentMemory.tsx +308 -0
- package/src/template/design/src/sections/real-time-communication-layer/VideoSession.tsx +342 -0
- package/src/template/design/src/sections/visual-intelligence-agents/VisualAgents.tsx +311 -0
- package/src/template/design/src/types/product.ts +97 -0
- package/src/template/design/src/types/section.ts +33 -0
- package/src/template/design/tailwind.config.js +77 -0
- package/src/template/design/tsconfig.app.json +34 -0
- package/src/template/design/tsconfig.json +13 -0
- package/src/template/design/tsconfig.node.json +26 -0
- package/src/template/design/vite.config.ts +17 -0
- package/src/template/index.css +102 -0
- package/src/template/package.json +27 -0
- package/src/template/tailwind.config.js +80 -0
- package/src/template/vite.config.ts +9 -0
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
# Getting Started
|
|
2
|
+
|
|
3
|
+
## Clone the Repository
|
|
4
|
+
|
|
5
|
+
```bash
|
|
6
|
+
git clone https://github.com/buildermethods/design-os.git my-project-design
|
|
7
|
+
cd my-project-design
|
|
8
|
+
```
|
|
9
|
+
|
|
10
|
+
Replace `my-project-design` with whatever you want to name your design workspace.
|
|
11
|
+
|
|
12
|
+
## Remove the Original Remote
|
|
13
|
+
|
|
14
|
+
```bash
|
|
15
|
+
git remote remove origin
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
Now you have a clean local instance ready to use.
|
|
19
|
+
|
|
20
|
+
## Install Dependencies
|
|
21
|
+
|
|
22
|
+
```bash
|
|
23
|
+
npm install
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
## Start the Dev Server
|
|
27
|
+
|
|
28
|
+
```bash
|
|
29
|
+
npm run dev
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
Open [http://localhost:5173](http://localhost:5173) in your browser.
|
|
33
|
+
|
|
34
|
+
## Open Claude Code
|
|
35
|
+
|
|
36
|
+
In the same project directory, start Claude Code:
|
|
37
|
+
|
|
38
|
+
```bash
|
|
39
|
+
claude
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
You're ready to start designing. Run `/product-vision` to begin defining your product.
|
|
43
|
+
|
|
44
|
+
---
|
|
45
|
+
|
|
46
|
+
## Optional: Save as Your Own Template
|
|
47
|
+
|
|
48
|
+
If you want to reuse Design OS for future projects:
|
|
49
|
+
|
|
50
|
+
1. Push to your own GitHub repository:
|
|
51
|
+
|
|
52
|
+
```bash
|
|
53
|
+
git remote add origin https://github.com/YOUR_USERNAME/YOUR_REPO_NAME.git
|
|
54
|
+
git push -u origin main
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
2. Go to your repository on GitHub, click **Settings**, and check **Template repository**.
|
|
58
|
+
|
|
59
|
+
Now you can create new instances using GitHub's "Use this template" button.
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
# What is Design OS?
|
|
2
|
+
|
|
3
|
+
Design OS is the missing step between your product idea and your codebase.
|
|
4
|
+
|
|
5
|
+
It's a product planning and design tool that helps you define your product vision, structure your data model, design your UI, and export production-ready components for implementation. Rather than jumping straight into code, you work through a guided process that captures what you're building and why—then hands off everything your coding agent needs to build it right.
|
|
6
|
+
|
|
7
|
+
## The Problem
|
|
8
|
+
|
|
9
|
+
AI coding tools are incredible at building fast. But the results often miss the mark. You describe what you want, the agent builds *something*, but it's not what you envisioned. The UI looks generic. Features get half-implemented. You spend as much time fixing and redirecting as you would have spent building.
|
|
10
|
+
|
|
11
|
+
The core issue: we're asking coding agents to figure out what to build *and* build it simultaneously. Design decisions get made on the fly, buried in code, impossible to adjust without starting over. There's no spec. No shared understanding. No source of truth for what "done" looks like.
|
|
12
|
+
|
|
13
|
+
## The Design OS Process
|
|
14
|
+
|
|
15
|
+
Design OS powers a guided design and architecture process. You + AI, working together through structured steps:
|
|
16
|
+
|
|
17
|
+
1. **Product Planning** — Define your vision, break down your roadmap, and model your data
|
|
18
|
+
2. **Design System** — Choose colors, typography, and design your application shell
|
|
19
|
+
3. **Section Design** — For each feature area: specify requirements, generate sample data, and design the screens
|
|
20
|
+
4. **Export** — Generate a complete handoff package for implementation
|
|
21
|
+
|
|
22
|
+
Each step is a conversation. The AI asks questions, you provide direction, and together you shape a product that matches your vision—before any implementation begins.
|
|
23
|
+
|
|
24
|
+
## How It Works
|
|
25
|
+
|
|
26
|
+
Design OS is its own separate codebase—a design environment you use *before* building. When you're done, you export components and assets to import into your actual product's codebase.
|
|
27
|
+
|
|
28
|
+
You interact with Design OS through slash commands. Each command walks you through a specific part of the process:
|
|
29
|
+
|
|
30
|
+
- `/product-vision` — Define what you're building and why
|
|
31
|
+
- `/product-roadmap` — Break your product into buildable sections
|
|
32
|
+
- `/data-model` — Define the core entities in your system
|
|
33
|
+
- `/design-tokens` — Choose your color palette and typography
|
|
34
|
+
- `/design-shell` — Design navigation and layout
|
|
35
|
+
- `/shape-section` — Specify a section's scope and requirements
|
|
36
|
+
- `/sample-data` — Generate realistic data for screen designs
|
|
37
|
+
- `/design-screen` — Create production-ready React components
|
|
38
|
+
- `/screenahot-design` — Snap a screenshot of a finished design screen for quick reference
|
|
39
|
+
- `/export-product` — Generate the complete handoff package
|
|
40
|
+
|
|
41
|
+
See [Usage](usage.md) for the full workflow.
|
|
42
|
+
|
|
43
|
+
## Who It's For
|
|
44
|
+
|
|
45
|
+
- **Technical builders** — Full control over architecture and design decisions without doing all the legwork yourself.
|
|
46
|
+
- **Non-technical product builders** — A strong vision for how your product should work, plus the ability to put your imprint on its systems—no technical background required.
|
|
47
|
+
|
|
48
|
+
## Compatibility
|
|
49
|
+
|
|
50
|
+
- Works with any AI coding agent: Claude Code, Cursor, Copilot, or anything that can implement from a handoff
|
|
51
|
+
- Your frontend needs React and Tailwind CSS
|
|
52
|
+
- Your backend can be anything—Rails, Laravel, Next.js, Python, whatever
|
|
53
|
+
|
|
54
|
+
## Open Source
|
|
55
|
+
|
|
56
|
+
Design OS is free, open source, and runs locally.
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
# Product Planning
|
|
2
|
+
|
|
3
|
+
The first phase of Design OS establishes the foundation for your product. Complete these steps before designing any screens.
|
|
4
|
+
|
|
5
|
+
## 1. Product Vision
|
|
6
|
+
|
|
7
|
+
```
|
|
8
|
+
/product-vision
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
Define your product's core identity. This is a conversational process where you'll establish:
|
|
12
|
+
|
|
13
|
+
- **Product name** — A clear, memorable name
|
|
14
|
+
- **Description** — 1-3 sentences capturing the essence
|
|
15
|
+
- **Problems & solutions** — What pain points you're addressing and how
|
|
16
|
+
- **Key features** — The main capabilities that make this possible
|
|
17
|
+
|
|
18
|
+
Share any notes, ideas, or rough thoughts you have about what you're building. The AI will ask clarifying questions and help you refine everything into a clear product overview.
|
|
19
|
+
|
|
20
|
+
**Creates:** `product/product-overview.md`
|
|
21
|
+
|
|
22
|
+
## 2. Product Roadmap
|
|
23
|
+
|
|
24
|
+
```
|
|
25
|
+
/product-roadmap
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
Break your product into 3-5 sections. Each section represents:
|
|
29
|
+
|
|
30
|
+
- A navigation item in your app's UI
|
|
31
|
+
- A self-contained feature area that can be designed and built independently
|
|
32
|
+
- A logical phase of your development roadmap
|
|
33
|
+
|
|
34
|
+
Based on your product overview, the AI will propose sections and discuss ordering. Sections are sequenced by development priority—the first section is your core functionality, with each subsequent section building on it.
|
|
35
|
+
|
|
36
|
+
**Creates:** `product/product-roadmap.md`
|
|
37
|
+
|
|
38
|
+
## 3. Data Model
|
|
39
|
+
|
|
40
|
+
```
|
|
41
|
+
/data-model
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
Define the core entities in your product—the "nouns" of your system. What are the main things users create, view, and manage?
|
|
45
|
+
|
|
46
|
+
The focus is conceptual, not technical:
|
|
47
|
+
|
|
48
|
+
- **Entity names** — User, Project, Invoice, Task, etc.
|
|
49
|
+
- **Plain-language descriptions** — What each entity represents
|
|
50
|
+
- **Relationships** — How entities connect to each other
|
|
51
|
+
|
|
52
|
+
Don't worry about database schemas or field types. Keep it minimal. The implementation agent will extend the model with additional details as needed.
|
|
53
|
+
|
|
54
|
+
**Creates:** `product/data-model/data-model.md`
|
|
55
|
+
|
|
56
|
+
## 4. Design Tokens
|
|
57
|
+
|
|
58
|
+
```
|
|
59
|
+
/design-tokens
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
Choose your visual identity:
|
|
63
|
+
|
|
64
|
+
### Colors
|
|
65
|
+
|
|
66
|
+
Select from Tailwind's built-in color palette:
|
|
67
|
+
|
|
68
|
+
- **Primary** — Main accent for buttons, links, key actions (e.g., `blue`, `indigo`, `emerald`, `lime`)
|
|
69
|
+
- **Secondary** — Complementary accent for tags, highlights (e.g., `violet`, `amber`, `teal`)
|
|
70
|
+
- **Neutral** — Backgrounds, text, borders (e.g., `slate`, `gray`, `zinc`, `stone`)
|
|
71
|
+
|
|
72
|
+
### Typography
|
|
73
|
+
|
|
74
|
+
Select from Google Fonts:
|
|
75
|
+
|
|
76
|
+
- **Heading** — For titles and section headers (e.g., `DM Sans`, `Inter`, `Space Grotesk`)
|
|
77
|
+
- **Body** — For paragraphs and UI text (e.g., `Inter`, `Source Sans 3`, `Nunito Sans`)
|
|
78
|
+
- **Mono** — For code and technical content (e.g., `JetBrains Mono`, `Fira Code`)
|
|
79
|
+
|
|
80
|
+
The AI will suggest options based on your product type and help you find a combination that fits.
|
|
81
|
+
|
|
82
|
+
**Creates:** `product/design-system/colors.json`, `product/design-system/typography.json`
|
|
83
|
+
|
|
84
|
+
## 5. Application Shell
|
|
85
|
+
|
|
86
|
+
```
|
|
87
|
+
/design-shell
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
Design the persistent navigation and layout that wraps all your sections. Choose from common patterns:
|
|
91
|
+
|
|
92
|
+
- **Sidebar Navigation** — Vertical nav on the left, content on the right. Best for dashboard-style tools, admin panels, apps with many sections.
|
|
93
|
+
- **Top Navigation** — Horizontal nav at top, content below. Best for simpler apps, marketing-style products, fewer sections.
|
|
94
|
+
- **Minimal Header** — Just logo + user menu. Best for single-purpose tools, wizard-style flows.
|
|
95
|
+
|
|
96
|
+
You'll also define:
|
|
97
|
+
|
|
98
|
+
- User menu placement and contents
|
|
99
|
+
- Responsive behavior (how it adapts on mobile)
|
|
100
|
+
- Any additional nav items (Settings, Help, etc.)
|
|
101
|
+
|
|
102
|
+
The shell is implemented as React components that will wrap your section screen designs.
|
|
103
|
+
|
|
104
|
+
**Creates:**
|
|
105
|
+
- `product/shell/spec.md` — Shell specification
|
|
106
|
+
- `src/shell/components/AppShell.tsx` — Main shell wrapper
|
|
107
|
+
- `src/shell/components/MainNav.tsx` — Navigation component
|
|
108
|
+
- `src/shell/components/UserMenu.tsx` — User menu component
|
|
109
|
+
- `src/shell/ShellPreview.tsx` — Preview wrapper for Design OS
|
|
110
|
+
|
|
111
|
+
## What's Next
|
|
112
|
+
|
|
113
|
+
With the foundation established, you're ready to design individual sections. See [Designing Sections](design-section.md) for the next steps.
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# Requirements
|
|
2
|
+
|
|
3
|
+
## Running Design OS
|
|
4
|
+
|
|
5
|
+
Design OS runs locally on your machine. You'll need:
|
|
6
|
+
|
|
7
|
+
- **Node.js** (v18 or higher)
|
|
8
|
+
- **npm** (comes with Node.js)
|
|
9
|
+
- **An AI coding assistant** — Design OS uses slash commands to guide the design process. Claude Code is recommended, but you can invoke the Design OS commands from any AI coding tool that supports custom commands or prompts (Cursor, Windsurf, Codex, etc.)
|
|
10
|
+
|
|
11
|
+
## Installing Your Exported Components
|
|
12
|
+
|
|
13
|
+
When you export your designs, you get production-ready React components. Your target codebase needs:
|
|
14
|
+
|
|
15
|
+
### Required
|
|
16
|
+
|
|
17
|
+
- **React** (v18 or higher)
|
|
18
|
+
- **Tailwind CSS** (v4) — Components use Tailwind utility classes for styling
|
|
19
|
+
|
|
20
|
+
### Backend
|
|
21
|
+
|
|
22
|
+
Your backend can be anything—Rails, Laravel, Next.js API routes, Python, Go, whatever. Design OS only handles the frontend design layer.
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
# Usage
|
|
2
|
+
|
|
3
|
+
Design OS uses slash commands to guide you through the design process. Each command is a conversation—the AI asks questions, you provide direction, and together you shape your product.
|
|
4
|
+
|
|
5
|
+
## The Design Workflow
|
|
6
|
+
|
|
7
|
+
Design OS follows a structured sequence. Each step builds on the previous one.
|
|
8
|
+
|
|
9
|
+
### Phase 1: Product Planning
|
|
10
|
+
|
|
11
|
+
Before designing any screens, establish the foundation:
|
|
12
|
+
|
|
13
|
+
1. **Product Vision** — Define what you're building and why
|
|
14
|
+
2. **Product Roadmap** — Break your product into sections
|
|
15
|
+
3. **Data Model** — Define the core entities in your system
|
|
16
|
+
4. **Design Tokens** — Choose colors and typography
|
|
17
|
+
5. **Application Shell** — Design navigation and layout
|
|
18
|
+
|
|
19
|
+
See [Product Planning](product-planning.md) for details on each command.
|
|
20
|
+
|
|
21
|
+
### Phase 2: Section Design
|
|
22
|
+
|
|
23
|
+
Once the foundation is set, work through each section:
|
|
24
|
+
|
|
25
|
+
1. **Shape the Section** — Define scope and requirements
|
|
26
|
+
2. **Create Sample Data** — Generate realistic data and types
|
|
27
|
+
3. **Design the Screen** — Build the actual React components
|
|
28
|
+
4. **Capture Screenshots** — Document the design (optional)
|
|
29
|
+
|
|
30
|
+
Repeat for each section in your roadmap.
|
|
31
|
+
|
|
32
|
+
See [Designing Sections](design-section.md) for details on each command.
|
|
33
|
+
|
|
34
|
+
### Phase 3: Export
|
|
35
|
+
|
|
36
|
+
When all sections are designed:
|
|
37
|
+
|
|
38
|
+
1. **Export** — Generate the complete handoff package
|
|
39
|
+
|
|
40
|
+
See [Export](export.md) for details on what's included and how to use it.
|
|
41
|
+
|
|
42
|
+
## Quick Reference
|
|
43
|
+
|
|
44
|
+
| Command | Purpose |
|
|
45
|
+
|---------|---------|
|
|
46
|
+
| `/product-vision` | Define product name, description, problems, features |
|
|
47
|
+
| `/product-roadmap` | Break product into sections |
|
|
48
|
+
| `/data-model` | Define core entities and relationships |
|
|
49
|
+
| `/design-tokens` | Choose colors and typography |
|
|
50
|
+
| `/design-shell` | Design navigation and layout |
|
|
51
|
+
| `/shape-section` | Define a section's scope and requirements |
|
|
52
|
+
| `/sample-data` | Generate sample data and TypeScript types |
|
|
53
|
+
| `/design-screen` | Create screen design components |
|
|
54
|
+
| `/screenshot-design` | Capture screenshots |
|
|
55
|
+
| `/export-product` | Generate the complete handoff package |
|
|
56
|
+
|
|
57
|
+
## Tips
|
|
58
|
+
|
|
59
|
+
- **Follow the sequence** — Each step builds on the previous. Don't skip ahead.
|
|
60
|
+
- **Be specific** — The more detail you provide, the better the output.
|
|
61
|
+
- **Iterate** — Each command is a conversation. Refine until you're happy.
|
|
62
|
+
- **Restart the dev server** — After creating new components, restart to see changes.
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import js from '@eslint/js'
|
|
2
|
+
import globals from 'globals'
|
|
3
|
+
import reactHooks from 'eslint-plugin-react-hooks'
|
|
4
|
+
import reactRefresh from 'eslint-plugin-react-refresh'
|
|
5
|
+
import tseslint from 'typescript-eslint'
|
|
6
|
+
import { defineConfig, globalIgnores } from 'eslint/config'
|
|
7
|
+
|
|
8
|
+
export default defineConfig([
|
|
9
|
+
globalIgnores(['dist']),
|
|
10
|
+
{
|
|
11
|
+
files: ['**/*.{ts,tsx}'],
|
|
12
|
+
extends: [
|
|
13
|
+
js.configs.recommended,
|
|
14
|
+
tseslint.configs.recommended,
|
|
15
|
+
reactHooks.configs.flat.recommended,
|
|
16
|
+
reactRefresh.configs.vite,
|
|
17
|
+
],
|
|
18
|
+
languageOptions: {
|
|
19
|
+
ecmaVersion: 2020,
|
|
20
|
+
globals: globals.browser,
|
|
21
|
+
},
|
|
22
|
+
},
|
|
23
|
+
])
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
<!doctype html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
|
|
4
|
+
<head>
|
|
5
|
+
<meta charset="UTF-8" />
|
|
6
|
+
<link rel="icon" type="image/svg+xml" href="/favicon.svg" />
|
|
7
|
+
<link rel="preconnect" href="https://fonts.googleapis.com">
|
|
8
|
+
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
|
9
|
+
<link
|
|
10
|
+
href="https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700;1,9..40,400&family=IBM+Plex+Mono:wght@400;500&display=swap"
|
|
11
|
+
rel="stylesheet">
|
|
12
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
13
|
+
<title>Design OS</title>
|
|
14
|
+
</head>
|
|
15
|
+
|
|
16
|
+
<body>
|
|
17
|
+
<div id="root"></div>
|
|
18
|
+
<script type="module" src="/src/main.tsx"></script>
|
|
19
|
+
</body>
|
|
20
|
+
|
|
21
|
+
</html>
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "design-os",
|
|
3
|
+
"private": true,
|
|
4
|
+
"version": "0.0.0",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"scripts": {
|
|
7
|
+
"dev": "vite",
|
|
8
|
+
"build": "tsc -b && vite build",
|
|
9
|
+
"lint": "eslint .",
|
|
10
|
+
"preview": "vite preview"
|
|
11
|
+
},
|
|
12
|
+
"dependencies": {
|
|
13
|
+
"@radix-ui/react-avatar": "^1.1.11",
|
|
14
|
+
"@radix-ui/react-collapsible": "^1.1.12",
|
|
15
|
+
"@radix-ui/react-dialog": "^1.1.15",
|
|
16
|
+
"@radix-ui/react-dropdown-menu": "^2.1.16",
|
|
17
|
+
"@radix-ui/react-label": "^2.1.8",
|
|
18
|
+
"@radix-ui/react-separator": "^1.1.8",
|
|
19
|
+
"@radix-ui/react-slot": "^1.2.4",
|
|
20
|
+
"@radix-ui/react-tabs": "^1.1.13",
|
|
21
|
+
"class-variance-authority": "^0.7.1",
|
|
22
|
+
"clsx": "^2.1.1",
|
|
23
|
+
"jszip": "^3.10.1",
|
|
24
|
+
"lucide-react": "^0.554.0",
|
|
25
|
+
"react": "^18.3.1",
|
|
26
|
+
"react-dom": "^18.3.1",
|
|
27
|
+
"react-router-dom": "^6.28.0",
|
|
28
|
+
"tailwind-merge": "^3.4.0"
|
|
29
|
+
},
|
|
30
|
+
"devDependencies": {
|
|
31
|
+
"@eslint/js": "^9.39.1",
|
|
32
|
+
"@types/node": "^24.10.1",
|
|
33
|
+
"@types/react": "^18.3.12",
|
|
34
|
+
"@types/react-dom": "^18.3.1",
|
|
35
|
+
"@vitejs/plugin-react": "^5.1.1",
|
|
36
|
+
"eslint": "^9.39.1",
|
|
37
|
+
"eslint-plugin-react-hooks": "^7.0.1",
|
|
38
|
+
"eslint-plugin-react-refresh": "^0.4.24",
|
|
39
|
+
"globals": "^16.5.0",
|
|
40
|
+
"autoprefixer": "^10.4.20",
|
|
41
|
+
"postcss": "^8.4.49",
|
|
42
|
+
"tailwindcss": "^3.4.17",
|
|
43
|
+
"typescript-eslint": "^8.46.4",
|
|
44
|
+
"vite": "^7.2.4"
|
|
45
|
+
}
|
|
46
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" class="iconify iconify--logos" width="31.88" height="32" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 257"><defs><linearGradient id="IconifyId1813088fe1fbc01fb466" x1="-.828%" x2="57.636%" y1="7.652%" y2="78.411%"><stop offset="0%" stop-color="#41D1FF"></stop><stop offset="100%" stop-color="#BD34FE"></stop></linearGradient><linearGradient id="IconifyId1813088fe1fbc01fb467" x1="43.376%" x2="50.316%" y1="2.242%" y2="89.03%"><stop offset="0%" stop-color="#FFEA83"></stop><stop offset="8.333%" stop-color="#FFDD35"></stop><stop offset="100%" stop-color="#FFA800"></stop></linearGradient></defs><path fill="url(#IconifyId1813088fe1fbc01fb466)" d="M255.153 37.938L134.897 252.976c-2.483 4.44-8.862 4.466-11.382.048L.875 37.958c-2.746-4.814 1.371-10.646 6.827-9.67l120.385 21.517a6.537 6.537 0 0 0 2.322-.004l117.867-21.483c5.438-.991 9.574 4.796 6.877 9.62Z"></path><path fill="url(#IconifyId1813088fe1fbc01fb467)" d="M185.432.063L96.44 17.501a3.268 3.268 0 0 0-2.634 3.014l-5.474 92.456a3.268 3.268 0 0 0 3.997 3.378l24.777-5.718c2.318-.535 4.413 1.507 3.936 3.838l-7.361 36.047c-.495 2.426 1.782 4.5 4.151 3.78l15.304-4.649c2.372-.72 4.652 1.36 4.15 3.788l-11.698 56.621c-.732 3.542 3.979 5.473 5.943 2.437l1.313-2.028l72.516-144.72c1.215-2.423-.88-5.186-3.54-4.672l-25.505 4.922c-2.396.462-4.435-1.77-3.759-4.114l16.646-57.705c.677-2.35-1.37-4.583-3.769-4.113Z"></path></svg>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" class="iconify iconify--logos" width="35.93" height="32" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 228"><path fill="#00D8FF" d="M210.483 73.824a171.49 171.49 0 0 0-8.24-2.597c.465-1.9.893-3.777 1.273-5.621c6.238-30.281 2.16-54.676-11.769-62.708c-13.355-7.7-35.196.329-57.254 19.526a171.23 171.23 0 0 0-6.375 5.848a155.866 155.866 0 0 0-4.241-3.917C100.759 3.829 77.587-4.822 63.673 3.233C50.33 10.957 46.379 33.89 51.995 62.588a170.974 170.974 0 0 0 1.892 8.48c-3.28.932-6.445 1.924-9.474 2.98C17.309 83.498 0 98.307 0 113.668c0 15.865 18.582 31.778 46.812 41.427a145.52 145.52 0 0 0 6.921 2.165a167.467 167.467 0 0 0-2.01 9.138c-5.354 28.2-1.173 50.591 12.134 58.266c13.744 7.926 36.812-.22 59.273-19.855a145.567 145.567 0 0 0 5.342-4.923a168.064 168.064 0 0 0 6.92 6.314c21.758 18.722 43.246 26.282 56.54 18.586c13.731-7.949 18.194-32.003 12.4-61.268a145.016 145.016 0 0 0-1.535-6.842c1.62-.48 3.21-.974 4.76-1.488c29.348-9.723 48.443-25.443 48.443-41.52c0-15.417-17.868-30.326-45.517-39.844Zm-6.365 70.984c-1.4.463-2.836.91-4.3 1.345c-3.24-10.257-7.612-21.163-12.963-32.432c5.106-11 9.31-21.767 12.459-31.957c2.619.758 5.16 1.557 7.61 2.4c23.69 8.156 38.14 20.213 38.14 29.504c0 9.896-15.606 22.743-40.946 31.14Zm-10.514 20.834c2.562 12.94 2.927 24.64 1.23 33.787c-1.524 8.219-4.59 13.698-8.382 15.893c-8.067 4.67-25.32-1.4-43.927-17.412a156.726 156.726 0 0 1-6.437-5.87c7.214-7.889 14.423-17.06 21.459-27.246c12.376-1.098 24.068-2.894 34.671-5.345a134.17 134.17 0 0 1 1.386 6.193ZM87.276 214.515c-7.882 2.783-14.16 2.863-17.955.675c-8.075-4.657-11.432-22.636-6.853-46.752a156.923 156.923 0 0 1 1.869-8.499c10.486 2.32 22.093 3.988 34.498 4.994c7.084 9.967 14.501 19.128 21.976 27.15a134.668 134.668 0 0 1-4.877 4.492c-9.933 8.682-19.886 14.842-28.658 17.94ZM50.35 144.747c-12.483-4.267-22.792-9.812-29.858-15.863c-6.35-5.437-9.555-10.836-9.555-15.216c0-9.322 13.897-21.212 37.076-29.293c2.813-.98 5.757-1.905 8.812-2.773c3.204 10.42 7.406 21.315 12.477 32.332c-5.137 11.18-9.399 22.249-12.634 32.792a134.718 134.718 0 0 1-6.318-1.979Zm12.378-84.26c-4.811-24.587-1.616-43.134 6.425-47.789c8.564-4.958 27.502 2.111 47.463 19.835a144.318 144.318 0 0 1 3.841 3.545c-7.438 7.987-14.787 17.08-21.808 26.988c-12.04 1.116-23.565 2.908-34.161 5.309a160.342 160.342 0 0 1-1.76-7.887Zm110.427 27.268a347.8 347.8 0 0 0-7.785-12.803c8.168 1.033 15.994 2.404 23.343 4.08c-2.206 7.072-4.956 14.465-8.193 22.045a381.151 381.151 0 0 0-7.365-13.322Zm-45.032-43.861c5.044 5.465 10.096 11.566 15.065 18.186a322.04 322.04 0 0 0-30.257-.006c4.974-6.559 10.069-12.652 15.192-18.18ZM82.802 87.83a323.167 323.167 0 0 0-7.227 13.238c-3.184-7.553-5.909-14.98-8.134-22.152c7.304-1.634 15.093-2.97 23.209-3.984a321.524 321.524 0 0 0-7.848 12.897Zm8.081 65.352c-8.385-.936-16.291-2.203-23.593-3.793c2.26-7.3 5.045-14.885 8.298-22.6a321.187 321.187 0 0 0 7.257 13.246c2.594 4.48 5.28 8.868 8.038 13.147Zm37.542 31.03c-5.184-5.592-10.354-11.779-15.403-18.433c4.902.192 9.899.29 14.978.29c5.218 0 10.376-.117 15.453-.343c-4.985 6.774-10.018 12.97-15.028 18.486Zm52.198-57.817c3.422 7.8 6.306 15.345 8.596 22.52c-7.422 1.694-15.436 3.058-23.88 4.071a382.417 382.417 0 0 0 7.859-13.026a347.403 347.403 0 0 0 7.425-13.565Zm-16.898 8.101a358.557 358.557 0 0 1-12.281 19.815a329.4 329.4 0 0 1-23.444.823c-7.967 0-15.716-.248-23.178-.732a310.202 310.202 0 0 1-12.513-19.846h.001a307.41 307.41 0 0 1-10.923-20.627a310.278 310.278 0 0 1 10.89-20.637l-.001.001a307.318 307.318 0 0 1 12.413-19.761c7.613-.576 15.42-.876 23.31-.876H128c7.926 0 15.743.303 23.354.883a329.357 329.357 0 0 1 12.335 19.695a358.489 358.489 0 0 1 11.036 20.54a329.472 329.472 0 0 1-11 20.722Zm22.56-122.124c8.572 4.944 11.906 24.881 6.52 51.026c-.344 1.668-.73 3.367-1.15 5.09c-10.622-2.452-22.155-4.275-34.23-5.408c-7.034-10.017-14.323-19.124-21.64-27.008a160.789 160.789 0 0 1 5.888-5.4c18.9-16.447 36.564-22.941 44.612-18.3ZM128 90.808c12.625 0 22.86 10.235 22.86 22.86s-10.235 22.86-22.86 22.86s-22.86-10.235-22.86-22.86s10.235-22.86 22.86-22.86Z"></path></svg>
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import type { ReactNode } from 'react'
|
|
2
|
+
import { useNavigate } from 'react-router-dom'
|
|
3
|
+
import { Layers, ArrowLeft } from 'lucide-react'
|
|
4
|
+
import { PhaseNav } from './PhaseNav'
|
|
5
|
+
import { ThemeToggle } from './ThemeToggle'
|
|
6
|
+
import { Button } from '@/components/ui/button'
|
|
7
|
+
|
|
8
|
+
interface AppLayoutProps {
|
|
9
|
+
children: ReactNode
|
|
10
|
+
/** Optional title shown in the header (for sub-pages) */
|
|
11
|
+
title?: string
|
|
12
|
+
/** Optional back navigation path */
|
|
13
|
+
backTo?: string
|
|
14
|
+
/** Optional back label */
|
|
15
|
+
backLabel?: string
|
|
16
|
+
/** Whether to show the phase nav (default: true) */
|
|
17
|
+
showPhaseNav?: boolean
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export function AppLayout({
|
|
21
|
+
children,
|
|
22
|
+
title,
|
|
23
|
+
backTo,
|
|
24
|
+
backLabel = 'Back',
|
|
25
|
+
showPhaseNav = true,
|
|
26
|
+
}: AppLayoutProps) {
|
|
27
|
+
const navigate = useNavigate()
|
|
28
|
+
|
|
29
|
+
// Determine if this is a sub-page (has back navigation)
|
|
30
|
+
const isSubPage = !!backTo
|
|
31
|
+
|
|
32
|
+
return (
|
|
33
|
+
<div className="min-h-screen bg-background animate-fade-in flex flex-col">
|
|
34
|
+
{/* Header */}
|
|
35
|
+
<header className="border-b border-stone-200 dark:border-stone-800 bg-card/80 backdrop-blur-sm sticky top-0 z-20">
|
|
36
|
+
{/* Headless Theme Listener */}
|
|
37
|
+
<ThemeToggle headless />
|
|
38
|
+
|
|
39
|
+
<div className="px-4 sm:px-6 py-3">
|
|
40
|
+
{isSubPage ? (
|
|
41
|
+
/* Sub-page header with back button */
|
|
42
|
+
<div className="max-w-3xl mx-auto flex items-center gap-4">
|
|
43
|
+
<Button
|
|
44
|
+
variant="ghost"
|
|
45
|
+
size="sm"
|
|
46
|
+
onClick={() => navigate(backTo)}
|
|
47
|
+
className="text-stone-600 dark:text-stone-400 hover:text-stone-900 dark:hover:text-stone-100 -ml-2"
|
|
48
|
+
>
|
|
49
|
+
<ArrowLeft className="w-4 h-4 mr-2" strokeWidth={1.5} />
|
|
50
|
+
{backLabel}
|
|
51
|
+
</Button>
|
|
52
|
+
{title && <h1 className="text-lg font-semibold">{title}</h1>}
|
|
53
|
+
{showPhaseNav && (
|
|
54
|
+
<div className="flex-1 flex justify-center">
|
|
55
|
+
<PhaseNav />
|
|
56
|
+
</div>
|
|
57
|
+
)}
|
|
58
|
+
<div className="w-10 shrink-0" />
|
|
59
|
+
</div>
|
|
60
|
+
) : (
|
|
61
|
+
/* Main header */
|
|
62
|
+
<div className="max-w-3xl mx-auto flex items-center justify-between gap-4">
|
|
63
|
+
<div className="flex items-center gap-4 flex-1">
|
|
64
|
+
{showPhaseNav && <PhaseNav />}
|
|
65
|
+
</div>
|
|
66
|
+
{/* Theme Toggle */}
|
|
67
|
+
<div className="w-10 shrink-0 flex justify-end" />
|
|
68
|
+
</div>
|
|
69
|
+
)}
|
|
70
|
+
</div>
|
|
71
|
+
</header>
|
|
72
|
+
|
|
73
|
+
{/* Main content */}
|
|
74
|
+
<main className="flex-1 max-w-3xl mx-auto px-6 py-12 w-full">
|
|
75
|
+
{children}
|
|
76
|
+
</main>
|
|
77
|
+
|
|
78
|
+
{/* Footer with logo */}
|
|
79
|
+
<footer className="py-8 flex justify-center">
|
|
80
|
+
<a
|
|
81
|
+
href="https://buildermethods.com/design-os"
|
|
82
|
+
target="_blank"
|
|
83
|
+
rel="noopener noreferrer"
|
|
84
|
+
className="flex items-center gap-2 text-stone-400 dark:text-stone-500 hover:text-stone-600 dark:hover:text-stone-400 transition-colors group"
|
|
85
|
+
>
|
|
86
|
+
<span className="text-xs">Powered by</span>
|
|
87
|
+
<div className="w-5 h-5 rounded bg-stone-300 dark:bg-stone-600 flex items-center justify-center transition-colors group-hover:bg-stone-400 dark:group-hover:bg-stone-500">
|
|
88
|
+
<Layers className="w-3 h-3 text-stone-100 dark:text-stone-900" strokeWidth={1.5} />
|
|
89
|
+
</div>
|
|
90
|
+
<span className="text-xs font-medium">Design OS</span>
|
|
91
|
+
</a>
|
|
92
|
+
</footer>
|
|
93
|
+
</div>
|
|
94
|
+
)
|
|
95
|
+
}
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
import { useState } from 'react'
|
|
2
|
+
import { Card, CardContent, CardHeader, CardTitle } from '@/components/ui/card'
|
|
3
|
+
import { Collapsible, CollapsibleContent, CollapsibleTrigger } from '@/components/ui/collapsible'
|
|
4
|
+
import { ChevronDown } from 'lucide-react'
|
|
5
|
+
import { EmptyState } from '@/components/EmptyState'
|
|
6
|
+
|
|
7
|
+
interface DataMeta {
|
|
8
|
+
models: Record<string, string>
|
|
9
|
+
relationships: string[]
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
interface DataCardProps {
|
|
13
|
+
data: Record<string, unknown> | null
|
|
14
|
+
sectionTitle?: string
|
|
15
|
+
sectionId?: string
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
function extractMeta(data: Record<string, unknown>): DataMeta | null {
|
|
19
|
+
const meta = data._meta as DataMeta | undefined
|
|
20
|
+
if (meta && typeof meta === 'object' && meta.models && meta.relationships) {
|
|
21
|
+
return meta
|
|
22
|
+
}
|
|
23
|
+
return null
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
function getDataWithoutMeta(data: Record<string, unknown>): Record<string, unknown> {
|
|
27
|
+
const { _meta, ...rest } = data
|
|
28
|
+
return rest
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
function countRecords(data: Record<string, unknown>): number {
|
|
32
|
+
// Count arrays at the top level as record collections (excluding _meta)
|
|
33
|
+
let count = 0
|
|
34
|
+
for (const [key, value] of Object.entries(data)) {
|
|
35
|
+
if (key !== '_meta' && Array.isArray(value)) {
|
|
36
|
+
count += value.length
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
return count
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
export function DataCard({ data, sectionTitle, sectionId }: DataCardProps) {
|
|
43
|
+
const [isJsonOpen, setIsJsonOpen] = useState(false)
|
|
44
|
+
|
|
45
|
+
// Empty state
|
|
46
|
+
if (!data) {
|
|
47
|
+
return <EmptyState type="data" context={sectionTitle} contextId={sectionId} />
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
const meta = extractMeta(data)
|
|
51
|
+
const dataWithoutMeta = getDataWithoutMeta(data)
|
|
52
|
+
const recordCount = countRecords(data)
|
|
53
|
+
|
|
54
|
+
return (
|
|
55
|
+
<Card className="border-stone-200 dark:border-stone-700 shadow-sm">
|
|
56
|
+
<CardHeader className="pb-4">
|
|
57
|
+
<div className="flex items-center gap-3">
|
|
58
|
+
<CardTitle className="text-lg font-semibold text-stone-900 dark:text-stone-100">
|
|
59
|
+
Sample Data
|
|
60
|
+
</CardTitle>
|
|
61
|
+
{recordCount > 0 && (
|
|
62
|
+
<span className="text-xs font-medium text-stone-500 dark:text-stone-400 bg-stone-100 dark:bg-stone-800 px-2 py-0.5 rounded">
|
|
63
|
+
{recordCount} {recordCount === 1 ? 'record' : 'records'}
|
|
64
|
+
</span>
|
|
65
|
+
)}
|
|
66
|
+
</div>
|
|
67
|
+
</CardHeader>
|
|
68
|
+
<CardContent className="pt-0 space-y-4">
|
|
69
|
+
{/* Data Model Descriptions */}
|
|
70
|
+
{meta && (
|
|
71
|
+
<div className="space-y-6">
|
|
72
|
+
{/* Models - Card Grid */}
|
|
73
|
+
<div>
|
|
74
|
+
<h4 className="text-sm font-medium text-stone-500 dark:text-stone-400 uppercase tracking-wide mb-3">
|
|
75
|
+
Data Models
|
|
76
|
+
</h4>
|
|
77
|
+
<div className="grid grid-cols-1 sm:grid-cols-2 gap-4">
|
|
78
|
+
{Object.entries(meta.models).map(([modelName, description]) => (
|
|
79
|
+
<div
|
|
80
|
+
key={modelName}
|
|
81
|
+
className="bg-stone-50 dark:bg-stone-800/50 rounded-lg p-4"
|
|
82
|
+
>
|
|
83
|
+
<h3 className="font-semibold text-stone-900 dark:text-stone-100 mb-1">
|
|
84
|
+
{modelName}
|
|
85
|
+
</h3>
|
|
86
|
+
<p className="text-stone-600 dark:text-stone-400 text-sm leading-relaxed">
|
|
87
|
+
{description}
|
|
88
|
+
</p>
|
|
89
|
+
</div>
|
|
90
|
+
))}
|
|
91
|
+
</div>
|
|
92
|
+
</div>
|
|
93
|
+
|
|
94
|
+
{/* Relationships */}
|
|
95
|
+
{meta.relationships.length > 0 && (
|
|
96
|
+
<div>
|
|
97
|
+
<h4 className="text-sm font-medium text-stone-500 dark:text-stone-400 uppercase tracking-wide mb-3">
|
|
98
|
+
How They Connect
|
|
99
|
+
</h4>
|
|
100
|
+
<ul className="space-y-2">
|
|
101
|
+
{meta.relationships.map((relationship, index) => (
|
|
102
|
+
<li
|
|
103
|
+
key={index}
|
|
104
|
+
className="text-stone-700 dark:text-stone-300 flex items-start gap-3"
|
|
105
|
+
>
|
|
106
|
+
<span className="w-1.5 h-1.5 rounded-full bg-stone-400 dark:bg-stone-500 mt-2 shrink-0" />
|
|
107
|
+
{relationship}
|
|
108
|
+
</li>
|
|
109
|
+
))}
|
|
110
|
+
</ul>
|
|
111
|
+
</div>
|
|
112
|
+
)}
|
|
113
|
+
</div>
|
|
114
|
+
)}
|
|
115
|
+
|
|
116
|
+
{/* Collapsible JSON View */}
|
|
117
|
+
<Collapsible open={isJsonOpen} onOpenChange={setIsJsonOpen}>
|
|
118
|
+
<CollapsibleTrigger className="flex items-center gap-2 text-left group">
|
|
119
|
+
<ChevronDown
|
|
120
|
+
className={`w-4 h-4 text-stone-400 dark:text-stone-500 transition-transform ${isJsonOpen ? 'rotate-180' : ''
|
|
121
|
+
}`}
|
|
122
|
+
strokeWidth={1.5}
|
|
123
|
+
/>
|
|
124
|
+
<span className="text-xs text-stone-500 dark:text-stone-400 group-hover:text-stone-700 dark:group-hover:text-stone-300 transition-colors">
|
|
125
|
+
{isJsonOpen ? 'Hide' : 'View'} JSON
|
|
126
|
+
</span>
|
|
127
|
+
</CollapsibleTrigger>
|
|
128
|
+
<CollapsibleContent>
|
|
129
|
+
<div className="bg-stone-50 dark:bg-stone-900 rounded-md p-4 overflow-x-auto mt-3">
|
|
130
|
+
<pre className="text-xs font-mono text-stone-700 dark:text-stone-300 whitespace-pre-wrap">
|
|
131
|
+
{JSON.stringify(dataWithoutMeta, null, 2)}
|
|
132
|
+
</pre>
|
|
133
|
+
</div>
|
|
134
|
+
</CollapsibleContent>
|
|
135
|
+
</Collapsible>
|
|
136
|
+
</CardContent>
|
|
137
|
+
</Card>
|
|
138
|
+
)
|
|
139
|
+
}
|