@flydocs/cli 0.5.0-beta.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 +96 -0
- package/dist/cli.js +2666 -0
- package/package.json +32 -0
- package/template/.claude/CLAUDE.md +90 -0
- package/template/.claude/agents/README.md +19 -0
- package/template/.claude/agents/implementation-agent.md +29 -0
- package/template/.claude/agents/pm-agent.md +29 -0
- package/template/.claude/agents/research-agent.md +25 -0
- package/template/.claude/agents/review-agent.md +29 -0
- package/template/.claude/commands/activate.md +10 -0
- package/template/.claude/commands/attach.md +9 -0
- package/template/.claude/commands/block.md +10 -0
- package/template/.claude/commands/capture.md +10 -0
- package/template/.claude/commands/close.md +10 -0
- package/template/.claude/commands/flydocs-setup.md +598 -0
- package/template/.claude/commands/flydocs-update.md +27 -0
- package/template/.claude/commands/implement.md +10 -0
- package/template/.claude/commands/new-project.md +11 -0
- package/template/.claude/commands/project-update.md +10 -0
- package/template/.claude/commands/refine.md +10 -0
- package/template/.claude/commands/review.md +10 -0
- package/template/.claude/commands/start-session.md +10 -0
- package/template/.claude/commands/status.md +10 -0
- package/template/.claude/commands/validate.md +10 -0
- package/template/.claude/commands/wrap-session.md +10 -0
- package/template/.claude/settings.json +49 -0
- package/template/.claude/skills/README.md +293 -0
- package/template/.claude/skills/flydocs-cloud/SKILL.md +96 -0
- package/template/.claude/skills/flydocs-cloud/cursor-rule.mdc +50 -0
- package/template/.claude/skills/flydocs-cloud/scripts/assign.py +38 -0
- package/template/.claude/skills/flydocs-cloud/scripts/assign_cycle.py +44 -0
- package/template/.claude/skills/flydocs-cloud/scripts/assign_milestone.py +44 -0
- package/template/.claude/skills/flydocs-cloud/scripts/comment.py +39 -0
- package/template/.claude/skills/flydocs-cloud/scripts/create_issue.py +100 -0
- package/template/.claude/skills/flydocs-cloud/scripts/create_milestone.py +46 -0
- package/template/.claude/skills/flydocs-cloud/scripts/create_project.py +40 -0
- package/template/.claude/skills/flydocs-cloud/scripts/estimate.py +38 -0
- package/template/.claude/skills/flydocs-cloud/scripts/flydocs_api.py +277 -0
- package/template/.claude/skills/flydocs-cloud/scripts/get_issue.py +77 -0
- package/template/.claude/skills/flydocs-cloud/scripts/link.py +47 -0
- package/template/.claude/skills/flydocs-cloud/scripts/list_cycles.py +35 -0
- package/template/.claude/skills/flydocs-cloud/scripts/list_issues.py +105 -0
- package/template/.claude/skills/flydocs-cloud/scripts/list_milestones.py +40 -0
- package/template/.claude/skills/flydocs-cloud/scripts/list_projects.py +45 -0
- package/template/.claude/skills/flydocs-cloud/scripts/priority.py +38 -0
- package/template/.claude/skills/flydocs-cloud/scripts/project_update.py +59 -0
- package/template/.claude/skills/flydocs-cloud/scripts/transition.py +67 -0
- package/template/.claude/skills/flydocs-cloud/scripts/update_description.py +47 -0
- package/template/.claude/skills/flydocs-cloud/scripts/update_issue.py +111 -0
- package/template/.claude/skills/flydocs-context-graph/SKILL.md +87 -0
- package/template/.claude/skills/flydocs-context-graph/schema.md +78 -0
- package/template/.claude/skills/flydocs-context-graph/scripts/graph_build.py +299 -0
- package/template/.claude/skills/flydocs-context-graph/scripts/graph_context.py +338 -0
- package/template/.claude/skills/flydocs-context-graph/scripts/graph_query.py +191 -0
- package/template/.claude/skills/flydocs-context-graph/scripts/graph_session.py +161 -0
- package/template/.claude/skills/flydocs-context-graph/scripts/graph_update.py +194 -0
- package/template/.claude/skills/flydocs-context-graph/scripts/graph_utils.py +118 -0
- package/template/.claude/skills/flydocs-estimates/SKILL.md +384 -0
- package/template/.claude/skills/flydocs-estimates/references/provider-costs.md +152 -0
- package/template/.claude/skills/flydocs-figma/SKILL.md +377 -0
- package/template/.claude/skills/flydocs-figma/references/PROMPTING.md +108 -0
- package/template/.claude/skills/flydocs-figma/references/TROUBLESHOOTING.md +112 -0
- package/template/.claude/skills/flydocs-local/SKILL.md +103 -0
- package/template/.claude/skills/flydocs-local/cursor-rule.mdc +43 -0
- package/template/.claude/skills/flydocs-local/scripts/assign.py +20 -0
- package/template/.claude/skills/flydocs-local/scripts/comment.py +27 -0
- package/template/.claude/skills/flydocs-local/scripts/create_issue.py +44 -0
- package/template/.claude/skills/flydocs-local/scripts/estimate.py +37 -0
- package/template/.claude/skills/flydocs-local/scripts/flydocs_api.py +272 -0
- package/template/.claude/skills/flydocs-local/scripts/get_issue.py +20 -0
- package/template/.claude/skills/flydocs-local/scripts/link.py +41 -0
- package/template/.claude/skills/flydocs-local/scripts/list_issues.py +34 -0
- package/template/.claude/skills/flydocs-local/scripts/priority.py +37 -0
- package/template/.claude/skills/flydocs-local/scripts/project_update.py +67 -0
- package/template/.claude/skills/flydocs-local/scripts/status_summary.py +16 -0
- package/template/.claude/skills/flydocs-local/scripts/transition.py +24 -0
- package/template/.claude/skills/flydocs-local/scripts/update_description.py +35 -0
- package/template/.claude/skills/flydocs-local/scripts/update_issue.py +84 -0
- package/template/.claude/skills/flydocs-workflow/SKILL.md +85 -0
- package/template/.claude/skills/flydocs-workflow/cursor-rule.mdc +53 -0
- package/template/.claude/skills/flydocs-workflow/reference/comment-templates.md +131 -0
- package/template/.claude/skills/flydocs-workflow/reference/golden-rules.md +76 -0
- package/template/.claude/skills/flydocs-workflow/reference/priority-estimates.md +28 -0
- package/template/.claude/skills/flydocs-workflow/reference/status-workflow.md +50 -0
- package/template/.claude/skills/flydocs-workflow/session.md +128 -0
- package/template/.claude/skills/flydocs-workflow/stages/activate.md +46 -0
- package/template/.claude/skills/flydocs-workflow/stages/capture.md +50 -0
- package/template/.claude/skills/flydocs-workflow/stages/close.md +32 -0
- package/template/.claude/skills/flydocs-workflow/stages/implement.md +124 -0
- package/template/.claude/skills/flydocs-workflow/stages/refine.md +51 -0
- package/template/.claude/skills/flydocs-workflow/stages/review.md +86 -0
- package/template/.claude/skills/flydocs-workflow/stages/validate.md +90 -0
- package/template/.claude/skills/flydocs-workflow/templates/bug.md +95 -0
- package/template/.claude/skills/flydocs-workflow/templates/chore.md +75 -0
- package/template/.claude/skills/flydocs-workflow/templates/feature.md +93 -0
- package/template/.claude/skills/flydocs-workflow/templates/idea.md +84 -0
- package/template/.cursor/agents/implementation-agent.md +28 -0
- package/template/.cursor/agents/pm-agent.md +27 -0
- package/template/.cursor/agents/research-agent.md +23 -0
- package/template/.cursor/agents/review-agent.md +27 -0
- package/template/.cursor/hooks.json +29 -0
- package/template/.cursor/mcp.json +16 -0
- package/template/.env.example +44 -0
- package/template/.flydocs/config.json +104 -0
- package/template/.flydocs/hooks/auto-approve.py +71 -0
- package/template/.flydocs/hooks/post-edit.py +72 -0
- package/template/.flydocs/hooks/prefer-scripts.py +89 -0
- package/template/.flydocs/hooks/prompt-submit.py +277 -0
- package/template/.flydocs/scripts/generate_manifest.py +287 -0
- package/template/.flydocs/scripts/skill_manager.py +541 -0
- package/template/.flydocs/templates/README.md +46 -0
- package/template/.flydocs/templates/bug.md +166 -0
- package/template/.flydocs/templates/chore.md +110 -0
- package/template/.flydocs/templates/design-system/README.md +27 -0
- package/template/.flydocs/templates/design-system/component-patterns.md +92 -0
- package/template/.flydocs/templates/design-system/token-mapping.md +168 -0
- package/template/.flydocs/templates/feature.md +173 -0
- package/template/.flydocs/templates/idea.md +122 -0
- package/template/.flydocs/templates/instructions.md +228 -0
- package/template/.flydocs/templates/quick-capture.md +35 -0
- package/template/.flydocs/templates/scripts/check-design-system.template.mjs +179 -0
- package/template/.flydocs/version +1 -0
- package/template/AGENTS.md +95 -0
- package/template/CHANGELOG.md +271 -0
- package/template/flydocs/README.md +186 -0
- package/template/flydocs/context/project.md +51 -0
- package/template/flydocs/design-system/README.md +126 -0
- package/template/flydocs/design-system/component-patterns.md +173 -0
- package/template/flydocs/design-system/token-mapping.md +114 -0
- package/template/flydocs/knowledge/INDEX.md +100 -0
- package/template/flydocs/knowledge/README.md +62 -0
- package/template/flydocs/knowledge/product/personas.md +79 -0
- package/template/flydocs/knowledge/product/user-flows.md +88 -0
- package/template/manifest.json +221 -0
|
@@ -0,0 +1,186 @@
|
|
|
1
|
+
# FlyDocs Cloud
|
|
2
|
+
|
|
3
|
+
This project uses FlyDocs Cloud - a hybrid workflow where:
|
|
4
|
+
- **Work items (specs)** live in Linear
|
|
5
|
+
- **Project understanding** lives locally in this directory
|
|
6
|
+
- **Framework config, rules & templates** live in `.flydocs/`
|
|
7
|
+
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
## This Directory is Living Documentation
|
|
11
|
+
|
|
12
|
+
**This `flydocs/` directory is your project's evolving knowledge base.**
|
|
13
|
+
|
|
14
|
+
It grows alongside your project:
|
|
15
|
+
- Update `context/` as your vision, stack, and standards evolve
|
|
16
|
+
- Add to `knowledge/` as you make decisions and learn things
|
|
17
|
+
- Expand `patterns/` as you discover project-specific conventions
|
|
18
|
+
- Maintain `design-system/` as design tokens change
|
|
19
|
+
|
|
20
|
+
FlyDocs will **never overwrite** these files during updates - they're yours to maintain.
|
|
21
|
+
|
|
22
|
+
---
|
|
23
|
+
|
|
24
|
+
## Directory Structure
|
|
25
|
+
|
|
26
|
+
```
|
|
27
|
+
.flydocs/ # FRAMEWORK (replaced on FlyDocs update)
|
|
28
|
+
├── config.json # Provider settings, workspace config
|
|
29
|
+
├── version # For upgrade detection
|
|
30
|
+
├── rules/ # Workflow rules
|
|
31
|
+
├── scripts/ # Automation scripts
|
|
32
|
+
├── hooks/ # Workflow hooks
|
|
33
|
+
└── templates/ # Issue templates (source)
|
|
34
|
+
|
|
35
|
+
flydocs/ # PROJECT CONTENT (evolves with project)
|
|
36
|
+
├── context/ # Project fundamentals
|
|
37
|
+
│ ├── overview.md # Vision, goals, scope (update as it evolves)
|
|
38
|
+
│ ├── stack.md # Tech stack, architecture (update as it changes)
|
|
39
|
+
│ ├── standards.md # Code conventions (update as they mature)
|
|
40
|
+
│ └── patterns/ # Project-specific patterns (grow over time)
|
|
41
|
+
│
|
|
42
|
+
├── design-system/ # Design tokens (if using /design-setup)
|
|
43
|
+
│ ├── token-mapping.md # Figma → code translations
|
|
44
|
+
│ └── component-patterns.md
|
|
45
|
+
│
|
|
46
|
+
├── knowledge/ # Project knowledge (grows continuously)
|
|
47
|
+
│ ├── INDEX.md # Knowledge inventory
|
|
48
|
+
│ ├── decisions/ # Architecture Decision Records
|
|
49
|
+
│ ├── features/ # Complex feature documentation
|
|
50
|
+
│ ├── notes/ # Learnings, gotchas, tips
|
|
51
|
+
│ └── product/ # Personas, user flows
|
|
52
|
+
│
|
|
53
|
+
└── README.md # This file
|
|
54
|
+
|
|
55
|
+
.cursor/ # Cursor IDE integration
|
|
56
|
+
├── rules/*.mdc # Cursor rules (flat .mdc files)
|
|
57
|
+
├── agents/ # Cursor-native agents
|
|
58
|
+
├── commands/ # Workflow commands
|
|
59
|
+
└── hooks.json # Cursor hooks
|
|
60
|
+
|
|
61
|
+
.claude/ # Claude Code integration
|
|
62
|
+
├── agents/ # Subagent definitions
|
|
63
|
+
├── skills/ # Workflow skills
|
|
64
|
+
└── settings.json # Claude hooks
|
|
65
|
+
│ ├── pm-agent/RULE.md # Planning triggers
|
|
66
|
+
│ ├── implementation-agent/RULE.md # Build triggers
|
|
67
|
+
│ ├── qe-agent/RULE.md # Testing triggers
|
|
68
|
+
│ ├── linear-integration/RULE.md
|
|
69
|
+
│ └── ...
|
|
70
|
+
└── commands/ # Slash commands
|
|
71
|
+
|
|
72
|
+
.claude/
|
|
73
|
+
├── CLAUDE.md # Claude Code instructions
|
|
74
|
+
└── commands/ # Symlinks to .cursor/commands/
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
**Note:** Content folder name is configurable via `paths.content` in `.flydocs/config.json`.
|
|
78
|
+
|
|
79
|
+
---
|
|
80
|
+
|
|
81
|
+
## What Lives Where
|
|
82
|
+
|
|
83
|
+
### LOCAL (This Directory)
|
|
84
|
+
|
|
85
|
+
| Content | Location | Purpose |
|
|
86
|
+
|---------|----------|---------|
|
|
87
|
+
| Project overview | `context/overview.md` | Vision, goals, scope |
|
|
88
|
+
| Tech stack | `context/stack.md` | Architecture, dependencies |
|
|
89
|
+
| Code standards | `context/standards.md` | Conventions, patterns |
|
|
90
|
+
| ADRs | `knowledge/decisions/` | Why we made choices |
|
|
91
|
+
| Feature docs | `knowledge/features/` | How features work |
|
|
92
|
+
| Notes | `knowledge/notes/` | Learnings, gotchas |
|
|
93
|
+
| Product docs | `knowledge/product/` | Personas, user flows |
|
|
94
|
+
|
|
95
|
+
**Why local?** Agent needs instant access, changes with code, developers need it in IDE.
|
|
96
|
+
|
|
97
|
+
### LINEAR (Cloud)
|
|
98
|
+
|
|
99
|
+
| Content | Linear Location | Purpose |
|
|
100
|
+
|---------|-----------------|---------|
|
|
101
|
+
| Specs | Issues | Features, bugs, chores, ideas |
|
|
102
|
+
| Status | Workflow states | BACKLOG → DONE progression |
|
|
103
|
+
| Priorities | Priority field | Urgent, High, Medium, Low |
|
|
104
|
+
| Assignments | Assignee | Who's working on what |
|
|
105
|
+
| Assets | Attachments | Figma links, screenshots |
|
|
106
|
+
| Progress | Comments | Decision log, impl notes |
|
|
107
|
+
|
|
108
|
+
**Why cloud?** Team collaboration, stakeholder visibility, AI agent integration.
|
|
109
|
+
|
|
110
|
+
---
|
|
111
|
+
|
|
112
|
+
## No Longer Exists
|
|
113
|
+
|
|
114
|
+
These are **replaced by Linear**:
|
|
115
|
+
|
|
116
|
+
- ~~`flydocs/specs/`~~ → Linear issues
|
|
117
|
+
- ~~`flydocs/INDEX.md`~~ → Linear issue list
|
|
118
|
+
- ~~`flydocs/ACTIVE.md`~~ → Linear "In Progress" view
|
|
119
|
+
- ~~`flydocs/specs/assets/`~~ → Linear attachments
|
|
120
|
+
|
|
121
|
+
---
|
|
122
|
+
|
|
123
|
+
## Quick Commands
|
|
124
|
+
|
|
125
|
+
```
|
|
126
|
+
/start-session - Check Linear status, plan work
|
|
127
|
+
/capture - Create new Linear issue
|
|
128
|
+
/new-project - Create project with product label/icon
|
|
129
|
+
/implement - Pick up issue from Linear
|
|
130
|
+
/validate - Test implementation
|
|
131
|
+
/close - Move issue to Done
|
|
132
|
+
/flydocs-update - Sync rules from source repo
|
|
133
|
+
/design-setup - (Optional) Initialize design system integration
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
---
|
|
137
|
+
|
|
138
|
+
## Design System (Optional)
|
|
139
|
+
|
|
140
|
+
If you have a Figma design system with tokens, run `/design-setup` to enable enhanced Figma integration:
|
|
141
|
+
|
|
142
|
+
```
|
|
143
|
+
/design-setup
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
This creates:
|
|
147
|
+
- `flydocs/design-system/token-mapping.md` - Your Figma → code translations
|
|
148
|
+
- `flydocs/design-system/component-patterns.md` - Your reusable components
|
|
149
|
+
|
|
150
|
+
And updates `.flydocs/config.json` with:
|
|
151
|
+
```json
|
|
152
|
+
{
|
|
153
|
+
"designSystem": {
|
|
154
|
+
"enabled": true,
|
|
155
|
+
"figmaFiles": {
|
|
156
|
+
"designs": "your-designs-file-key",
|
|
157
|
+
"system": "your-design-system-file-key"
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
```
|
|
162
|
+
|
|
163
|
+
**Without design system:** Baseline Figma workflow (5-phase, screenshot-first) always works.
|
|
164
|
+
**With design system:** Token enforcement, validation, stricter design consistency.
|
|
165
|
+
|
|
166
|
+
---
|
|
167
|
+
|
|
168
|
+
## Configuration
|
|
169
|
+
|
|
170
|
+
See `.flydocs/config.json` for:
|
|
171
|
+
- FlyDocs version
|
|
172
|
+
- `paths.content` - This folder name (default: "flydocs")
|
|
173
|
+
- `provider.teamId` - Linear team ID
|
|
174
|
+
- `workspace.activeProjects` - Array of active project IDs
|
|
175
|
+
- `workspace.product` - Product identity (name, labelIds, icon, color)
|
|
176
|
+
- `statusMapping` - Workflow state names
|
|
177
|
+
|
|
178
|
+
See `.cursor/mcp.json` for MCP server configuration.
|
|
179
|
+
|
|
180
|
+
---
|
|
181
|
+
|
|
182
|
+
## More Information
|
|
183
|
+
|
|
184
|
+
- `AGENTS.md` - AI agent instructions
|
|
185
|
+
- `.claude/skills/` - Portable agent skills (platform + community)
|
|
186
|
+
- `knowledge/INDEX.md` - Knowledge base inventory
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
# Project Context
|
|
2
|
+
|
|
3
|
+
## What This Is
|
|
4
|
+
|
|
5
|
+
<!-- Fill during setup: 2-3 sentences describing the project -->
|
|
6
|
+
[Project name] — [what it does and who it's for].
|
|
7
|
+
|
|
8
|
+
## Stack
|
|
9
|
+
|
|
10
|
+
<!-- Fill during setup: auto-detected or manual -->
|
|
11
|
+
- **Framework**: [e.g., Next.js 14 / React 18]
|
|
12
|
+
- **Language**: [e.g., TypeScript 5.x]
|
|
13
|
+
- **Styling**: [e.g., Tailwind CSS]
|
|
14
|
+
- **Database**: [e.g., PostgreSQL / Convex]
|
|
15
|
+
- **Hosting**: [e.g., Vercel]
|
|
16
|
+
- **Testing**: [e.g., Vitest + Testing Library]
|
|
17
|
+
|
|
18
|
+
## Standards
|
|
19
|
+
|
|
20
|
+
Code standards are defined by installed community skills. Skills are installed
|
|
21
|
+
based on detected stack during setup or manually via `npx flydocs skills add`.
|
|
22
|
+
|
|
23
|
+
Read the relevant skill before writing code in that domain. List installed skills
|
|
24
|
+
with `npx flydocs skills list`.
|
|
25
|
+
|
|
26
|
+
### Project-Specific Standards
|
|
27
|
+
|
|
28
|
+
<!-- Add project-specific rules, overrides, or clarifications here -->
|
|
29
|
+
<!-- Example: "We use CSS Modules instead of Tailwind for this project" -->
|
|
30
|
+
|
|
31
|
+
## Key Decisions
|
|
32
|
+
|
|
33
|
+
Architectural decisions: `flydocs/knowledge/decisions/`
|
|
34
|
+
Project notes: `flydocs/knowledge/notes/`
|
|
35
|
+
|
|
36
|
+
## Active Priorities
|
|
37
|
+
|
|
38
|
+
<!-- Updated by session-wrap or manually -->
|
|
39
|
+
1. [Current priority 1]
|
|
40
|
+
2. [Current priority 2]
|
|
41
|
+
3. [Current priority 3]
|
|
42
|
+
|
|
43
|
+
## Links
|
|
44
|
+
|
|
45
|
+
- **Repository**: [URL]
|
|
46
|
+
- **Design**: [Figma URL if applicable]
|
|
47
|
+
- **Docs**: [External docs URL if applicable]
|
|
48
|
+
|
|
49
|
+
---
|
|
50
|
+
|
|
51
|
+
*Last Updated: YYYY-MM-DD*
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
# Design System Configuration
|
|
2
|
+
|
|
3
|
+
> This directory maps your Figma design system to code implementation.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## Purpose
|
|
8
|
+
|
|
9
|
+
When using the `flydocs-figma` skill to extract designs, the AI needs to know:
|
|
10
|
+
|
|
11
|
+
1. **How Figma tokens map to code** (colors, spacing, typography)
|
|
12
|
+
2. **What component patterns exist** (and how to match them)
|
|
13
|
+
3. **Design system constraints** (never invent, always map)
|
|
14
|
+
|
|
15
|
+
---
|
|
16
|
+
|
|
17
|
+
## Setup
|
|
18
|
+
|
|
19
|
+
### 1. Run /design-setup
|
|
20
|
+
|
|
21
|
+
The `/design-setup` command will:
|
|
22
|
+
- Connect to your Figma file via MCP
|
|
23
|
+
- Extract design tokens
|
|
24
|
+
- Generate initial mappings
|
|
25
|
+
- Create component pattern documentation
|
|
26
|
+
|
|
27
|
+
### 2. Populate Token Mapping
|
|
28
|
+
|
|
29
|
+
Edit `token-mapping.md` to define how Figma tokens translate to your code:
|
|
30
|
+
|
|
31
|
+
```markdown
|
|
32
|
+
## Colors
|
|
33
|
+
|
|
34
|
+
| Figma Token | CSS Variable | Tailwind Class |
|
|
35
|
+
|-------------|--------------|----------------|
|
|
36
|
+
| Primary/500 | --color-primary-500 | bg-primary-500 |
|
|
37
|
+
| Neutral/100 | --color-neutral-100 | bg-neutral-100 |
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
### 3. Document Component Patterns
|
|
41
|
+
|
|
42
|
+
Edit `component-patterns.md` to map Figma components to code:
|
|
43
|
+
|
|
44
|
+
```markdown
|
|
45
|
+
## Button
|
|
46
|
+
|
|
47
|
+
**Figma Component:** `Components/Button/Primary`
|
|
48
|
+
|
|
49
|
+
**Code Pattern:**
|
|
50
|
+
```tsx
|
|
51
|
+
<Button variant="primary" size="md">
|
|
52
|
+
{children}
|
|
53
|
+
</Button>
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
**Variants:**
|
|
57
|
+
- Primary → variant="primary"
|
|
58
|
+
- Secondary → variant="secondary"
|
|
59
|
+
- Ghost → variant="ghost"
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
---
|
|
63
|
+
|
|
64
|
+
## File Structure
|
|
65
|
+
|
|
66
|
+
```
|
|
67
|
+
flydocs/design-system/
|
|
68
|
+
├── README.md # This file
|
|
69
|
+
├── token-mapping.md # Figma token → code mapping
|
|
70
|
+
├── component-patterns.md # Figma component → code mapping
|
|
71
|
+
└── tokens/ # Optional: extracted token JSON
|
|
72
|
+
├── colors.json
|
|
73
|
+
├── spacing.json
|
|
74
|
+
└── typography.json
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
---
|
|
78
|
+
|
|
79
|
+
## Integration with flydocs-figma Skill
|
|
80
|
+
|
|
81
|
+
The `flydocs-figma` skill references this directory:
|
|
82
|
+
|
|
83
|
+
1. **Before extraction** - Loads token-mapping.md for translation rules
|
|
84
|
+
2. **During extraction** - Matches Figma elements to documented patterns
|
|
85
|
+
3. **After extraction** - Validates no tokens were invented
|
|
86
|
+
|
|
87
|
+
### Strict Enforcement
|
|
88
|
+
|
|
89
|
+
The skill enforces:
|
|
90
|
+
- **NO inventing tokens** - Every value must map to documented token
|
|
91
|
+
- **NO guessing components** - Every component must match documented pattern
|
|
92
|
+
- **Ask if uncertain** - Prompt user when mapping is unclear
|
|
93
|
+
|
|
94
|
+
---
|
|
95
|
+
|
|
96
|
+
## Maintenance
|
|
97
|
+
|
|
98
|
+
### When Design System Changes
|
|
99
|
+
|
|
100
|
+
1. Update Figma file
|
|
101
|
+
2. Re-run `/design-setup` to detect changes
|
|
102
|
+
3. Update token-mapping.md with new/changed tokens
|
|
103
|
+
4. Update component-patterns.md with new components
|
|
104
|
+
|
|
105
|
+
### Version Tracking
|
|
106
|
+
|
|
107
|
+
Add version notes to track design system evolution:
|
|
108
|
+
|
|
109
|
+
```markdown
|
|
110
|
+
## Changelog
|
|
111
|
+
|
|
112
|
+
### v2.0 (2024-01)
|
|
113
|
+
- Added new color palette (Primary → Brand)
|
|
114
|
+
- Updated button variants
|
|
115
|
+
|
|
116
|
+
### v1.0 (2023-06)
|
|
117
|
+
- Initial design system
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
---
|
|
121
|
+
|
|
122
|
+
## Templates
|
|
123
|
+
|
|
124
|
+
See `.flydocs/templates/design-system/` for:
|
|
125
|
+
- `token-mapping.md` - Template for token documentation
|
|
126
|
+
- `component-patterns.md` - Template for component documentation
|
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
# Component Patterns
|
|
2
|
+
|
|
3
|
+
> Maps Figma components to code implementation patterns.
|
|
4
|
+
> **Run /design-setup to auto-populate from your Figma file.**
|
|
5
|
+
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
## How to Use This Document
|
|
9
|
+
|
|
10
|
+
When implementing from Figma designs:
|
|
11
|
+
|
|
12
|
+
1. **Find the Figma component** in the design
|
|
13
|
+
2. **Look up the pattern** in this document
|
|
14
|
+
3. **Use the exact code pattern** provided
|
|
15
|
+
4. **Never invent** - if no pattern exists, ask or document first
|
|
16
|
+
|
|
17
|
+
---
|
|
18
|
+
|
|
19
|
+
## Buttons
|
|
20
|
+
|
|
21
|
+
### Primary Button
|
|
22
|
+
|
|
23
|
+
**Figma Component:** `Components/Button/Primary`
|
|
24
|
+
|
|
25
|
+
```tsx
|
|
26
|
+
<Button variant="primary" size="md">
|
|
27
|
+
Label Text
|
|
28
|
+
</Button>
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
**Variants:**
|
|
32
|
+
| Figma Variant | Code Prop |
|
|
33
|
+
|---------------|-----------|
|
|
34
|
+
| Primary | `variant="primary"` |
|
|
35
|
+
| Secondary | `variant="secondary"` |
|
|
36
|
+
| Ghost | `variant="ghost"` |
|
|
37
|
+
| Destructive | `variant="destructive"` |
|
|
38
|
+
|
|
39
|
+
**Sizes:**
|
|
40
|
+
| Figma Size | Code Prop |
|
|
41
|
+
|------------|-----------|
|
|
42
|
+
| Small | `size="sm"` |
|
|
43
|
+
| Medium | `size="md"` |
|
|
44
|
+
| Large | `size="lg"` |
|
|
45
|
+
|
|
46
|
+
---
|
|
47
|
+
|
|
48
|
+
## Form Inputs
|
|
49
|
+
|
|
50
|
+
### Text Input
|
|
51
|
+
|
|
52
|
+
**Figma Component:** `Components/Input/Text`
|
|
53
|
+
|
|
54
|
+
```tsx
|
|
55
|
+
<Input
|
|
56
|
+
type="text"
|
|
57
|
+
label="Field Label"
|
|
58
|
+
placeholder="Placeholder text"
|
|
59
|
+
error={errorMessage}
|
|
60
|
+
/>
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
**States:**
|
|
64
|
+
| Figma State | Code Prop |
|
|
65
|
+
|-------------|-----------|
|
|
66
|
+
| Default | (default) |
|
|
67
|
+
| Focused | Handled by CSS |
|
|
68
|
+
| Error | `error="Message"` |
|
|
69
|
+
| Disabled | `disabled` |
|
|
70
|
+
|
|
71
|
+
---
|
|
72
|
+
|
|
73
|
+
## Cards
|
|
74
|
+
|
|
75
|
+
### Content Card
|
|
76
|
+
|
|
77
|
+
**Figma Component:** `Components/Card/Content`
|
|
78
|
+
|
|
79
|
+
```tsx
|
|
80
|
+
<Card>
|
|
81
|
+
<CardHeader>
|
|
82
|
+
<CardTitle>Title</CardTitle>
|
|
83
|
+
<CardDescription>Description</CardDescription>
|
|
84
|
+
</CardHeader>
|
|
85
|
+
<CardContent>
|
|
86
|
+
{children}
|
|
87
|
+
</CardContent>
|
|
88
|
+
<CardFooter>
|
|
89
|
+
{actions}
|
|
90
|
+
</CardFooter>
|
|
91
|
+
</Card>
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
---
|
|
95
|
+
|
|
96
|
+
## Layout Patterns
|
|
97
|
+
|
|
98
|
+
### Page Container
|
|
99
|
+
|
|
100
|
+
**Figma Frame:** `Layout/Page`
|
|
101
|
+
|
|
102
|
+
```tsx
|
|
103
|
+
<div className="container mx-auto px-4 py-8 max-w-7xl">
|
|
104
|
+
{children}
|
|
105
|
+
</div>
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
### Section
|
|
109
|
+
|
|
110
|
+
**Figma Frame:** `Layout/Section`
|
|
111
|
+
|
|
112
|
+
```tsx
|
|
113
|
+
<section className="py-12 space-y-6">
|
|
114
|
+
<h2 className="text-2xl font-semibold">{title}</h2>
|
|
115
|
+
{children}
|
|
116
|
+
</section>
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
---
|
|
120
|
+
|
|
121
|
+
## Navigation
|
|
122
|
+
|
|
123
|
+
### Nav Item
|
|
124
|
+
|
|
125
|
+
**Figma Component:** `Components/Nav/Item`
|
|
126
|
+
|
|
127
|
+
```tsx
|
|
128
|
+
<NavLink
|
|
129
|
+
href={href}
|
|
130
|
+
active={isActive}
|
|
131
|
+
>
|
|
132
|
+
{icon && <Icon name={icon} />}
|
|
133
|
+
{label}
|
|
134
|
+
</NavLink>
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
---
|
|
138
|
+
|
|
139
|
+
## Adding New Patterns
|
|
140
|
+
|
|
141
|
+
When you encounter a Figma component without a documented pattern:
|
|
142
|
+
|
|
143
|
+
1. **Stop** - Don't guess the implementation
|
|
144
|
+
2. **Document** - Add the pattern to this file
|
|
145
|
+
3. **Verify** - Ensure it matches existing code conventions
|
|
146
|
+
4. **Then implement** - Use the documented pattern
|
|
147
|
+
|
|
148
|
+
### Pattern Template
|
|
149
|
+
|
|
150
|
+
```markdown
|
|
151
|
+
### [Component Name]
|
|
152
|
+
|
|
153
|
+
**Figma Component:** `[Exact Figma path]`
|
|
154
|
+
|
|
155
|
+
```tsx
|
|
156
|
+
// Code pattern here
|
|
157
|
+
```
|
|
158
|
+
|
|
159
|
+
**Variants:**
|
|
160
|
+
| Figma Variant | Code Prop |
|
|
161
|
+
|---------------|-----------|
|
|
162
|
+
| ... | ... |
|
|
163
|
+
```
|
|
164
|
+
|
|
165
|
+
---
|
|
166
|
+
|
|
167
|
+
## Validation Checklist
|
|
168
|
+
|
|
169
|
+
Before implementing from Figma:
|
|
170
|
+
- [ ] Component pattern exists in this document
|
|
171
|
+
- [ ] All variants are documented
|
|
172
|
+
- [ ] Token mappings exist for all design values
|
|
173
|
+
- [ ] Pattern matches existing codebase conventions
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
# Design Token Mapping
|
|
2
|
+
|
|
3
|
+
> Maps Figma design tokens to code implementation.
|
|
4
|
+
> **Run /design-setup to auto-populate from your Figma file.**
|
|
5
|
+
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
## Colors
|
|
9
|
+
|
|
10
|
+
| Figma Token | CSS Variable | Tailwind Class | Hex Value |
|
|
11
|
+
|-------------|--------------|----------------|-----------|
|
|
12
|
+
| _Run /design-setup to populate_ | | | |
|
|
13
|
+
|
|
14
|
+
### Example Format
|
|
15
|
+
|
|
16
|
+
```markdown
|
|
17
|
+
| Primary/500 | --color-primary-500 | bg-primary-500 | #3B82F6 |
|
|
18
|
+
| Primary/600 | --color-primary-600 | bg-primary-600 | #2563EB |
|
|
19
|
+
| Neutral/50 | --color-neutral-50 | bg-neutral-50 | #FAFAFA |
|
|
20
|
+
| Neutral/900 | --color-neutral-900 | text-neutral-900 | #171717 |
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
---
|
|
24
|
+
|
|
25
|
+
## Spacing
|
|
26
|
+
|
|
27
|
+
| Figma Token | CSS Variable | Tailwind Class | Value |
|
|
28
|
+
|-------------|--------------|----------------|-------|
|
|
29
|
+
| _Run /design-setup to populate_ | | | |
|
|
30
|
+
|
|
31
|
+
### Example Format
|
|
32
|
+
|
|
33
|
+
```markdown
|
|
34
|
+
| Space/1 | --space-1 | p-1 | 4px |
|
|
35
|
+
| Space/2 | --space-2 | p-2 | 8px |
|
|
36
|
+
| Space/4 | --space-4 | p-4 | 16px |
|
|
37
|
+
| Space/8 | --space-8 | p-8 | 32px |
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
---
|
|
41
|
+
|
|
42
|
+
## Typography
|
|
43
|
+
|
|
44
|
+
| Figma Style | CSS Class | Tailwind Classes | Properties |
|
|
45
|
+
|-------------|-----------|------------------|------------|
|
|
46
|
+
| _Run /design-setup to populate_ | | | |
|
|
47
|
+
|
|
48
|
+
### Example Format
|
|
49
|
+
|
|
50
|
+
```markdown
|
|
51
|
+
| Heading/H1 | .text-h1 | text-4xl font-bold | 36px/40px, 700 |
|
|
52
|
+
| Heading/H2 | .text-h2 | text-3xl font-semibold | 30px/36px, 600 |
|
|
53
|
+
| Body/Default | .text-body | text-base | 16px/24px, 400 |
|
|
54
|
+
| Body/Small | .text-sm | text-sm | 14px/20px, 400 |
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
---
|
|
58
|
+
|
|
59
|
+
## Border Radius
|
|
60
|
+
|
|
61
|
+
| Figma Token | CSS Variable | Tailwind Class | Value |
|
|
62
|
+
|-------------|--------------|----------------|-------|
|
|
63
|
+
| _Run /design-setup to populate_ | | | |
|
|
64
|
+
|
|
65
|
+
### Example Format
|
|
66
|
+
|
|
67
|
+
```markdown
|
|
68
|
+
| Radius/SM | --radius-sm | rounded-sm | 4px |
|
|
69
|
+
| Radius/MD | --radius-md | rounded-md | 8px |
|
|
70
|
+
| Radius/LG | --radius-lg | rounded-lg | 12px |
|
|
71
|
+
| Radius/Full | --radius-full | rounded-full | 9999px |
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
---
|
|
75
|
+
|
|
76
|
+
## Shadows
|
|
77
|
+
|
|
78
|
+
| Figma Style | CSS Variable | Tailwind Class | Value |
|
|
79
|
+
|-------------|--------------|----------------|-------|
|
|
80
|
+
| _Run /design-setup to populate_ | | | |
|
|
81
|
+
|
|
82
|
+
### Example Format
|
|
83
|
+
|
|
84
|
+
```markdown
|
|
85
|
+
| Shadow/SM | --shadow-sm | shadow-sm | 0 1px 2px rgba(0,0,0,0.05) |
|
|
86
|
+
| Shadow/MD | --shadow-md | shadow-md | 0 4px 6px rgba(0,0,0,0.1) |
|
|
87
|
+
| Shadow/LG | --shadow-lg | shadow-lg | 0 10px 15px rgba(0,0,0,0.1) |
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
---
|
|
91
|
+
|
|
92
|
+
## Usage Notes
|
|
93
|
+
|
|
94
|
+
### Figma Token Format
|
|
95
|
+
- Tokens are typically in `Category/Name` format
|
|
96
|
+
- Use exact Figma names for reliable extraction
|
|
97
|
+
|
|
98
|
+
### CSS Variables
|
|
99
|
+
- Define in your global CSS or theme file
|
|
100
|
+
- Use `var(--token-name)` in components
|
|
101
|
+
|
|
102
|
+
### Tailwind Integration
|
|
103
|
+
- Map to existing Tailwind classes where possible
|
|
104
|
+
- Extend Tailwind config for custom tokens
|
|
105
|
+
|
|
106
|
+
---
|
|
107
|
+
|
|
108
|
+
## Validation
|
|
109
|
+
|
|
110
|
+
Before using these tokens, verify:
|
|
111
|
+
- [ ] All Figma tokens have code mappings
|
|
112
|
+
- [ ] CSS variables are defined in stylesheets
|
|
113
|
+
- [ ] Tailwind config includes custom values
|
|
114
|
+
- [ ] Component library uses these tokens consistently
|