@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.
Files changed (134) hide show
  1. package/README.md +96 -0
  2. package/dist/cli.js +2666 -0
  3. package/package.json +32 -0
  4. package/template/.claude/CLAUDE.md +90 -0
  5. package/template/.claude/agents/README.md +19 -0
  6. package/template/.claude/agents/implementation-agent.md +29 -0
  7. package/template/.claude/agents/pm-agent.md +29 -0
  8. package/template/.claude/agents/research-agent.md +25 -0
  9. package/template/.claude/agents/review-agent.md +29 -0
  10. package/template/.claude/commands/activate.md +10 -0
  11. package/template/.claude/commands/attach.md +9 -0
  12. package/template/.claude/commands/block.md +10 -0
  13. package/template/.claude/commands/capture.md +10 -0
  14. package/template/.claude/commands/close.md +10 -0
  15. package/template/.claude/commands/flydocs-setup.md +598 -0
  16. package/template/.claude/commands/flydocs-update.md +27 -0
  17. package/template/.claude/commands/implement.md +10 -0
  18. package/template/.claude/commands/new-project.md +11 -0
  19. package/template/.claude/commands/project-update.md +10 -0
  20. package/template/.claude/commands/refine.md +10 -0
  21. package/template/.claude/commands/review.md +10 -0
  22. package/template/.claude/commands/start-session.md +10 -0
  23. package/template/.claude/commands/status.md +10 -0
  24. package/template/.claude/commands/validate.md +10 -0
  25. package/template/.claude/commands/wrap-session.md +10 -0
  26. package/template/.claude/settings.json +49 -0
  27. package/template/.claude/skills/README.md +293 -0
  28. package/template/.claude/skills/flydocs-cloud/SKILL.md +96 -0
  29. package/template/.claude/skills/flydocs-cloud/cursor-rule.mdc +50 -0
  30. package/template/.claude/skills/flydocs-cloud/scripts/assign.py +38 -0
  31. package/template/.claude/skills/flydocs-cloud/scripts/assign_cycle.py +44 -0
  32. package/template/.claude/skills/flydocs-cloud/scripts/assign_milestone.py +44 -0
  33. package/template/.claude/skills/flydocs-cloud/scripts/comment.py +39 -0
  34. package/template/.claude/skills/flydocs-cloud/scripts/create_issue.py +100 -0
  35. package/template/.claude/skills/flydocs-cloud/scripts/create_milestone.py +46 -0
  36. package/template/.claude/skills/flydocs-cloud/scripts/create_project.py +40 -0
  37. package/template/.claude/skills/flydocs-cloud/scripts/estimate.py +38 -0
  38. package/template/.claude/skills/flydocs-cloud/scripts/flydocs_api.py +277 -0
  39. package/template/.claude/skills/flydocs-cloud/scripts/get_issue.py +77 -0
  40. package/template/.claude/skills/flydocs-cloud/scripts/link.py +47 -0
  41. package/template/.claude/skills/flydocs-cloud/scripts/list_cycles.py +35 -0
  42. package/template/.claude/skills/flydocs-cloud/scripts/list_issues.py +105 -0
  43. package/template/.claude/skills/flydocs-cloud/scripts/list_milestones.py +40 -0
  44. package/template/.claude/skills/flydocs-cloud/scripts/list_projects.py +45 -0
  45. package/template/.claude/skills/flydocs-cloud/scripts/priority.py +38 -0
  46. package/template/.claude/skills/flydocs-cloud/scripts/project_update.py +59 -0
  47. package/template/.claude/skills/flydocs-cloud/scripts/transition.py +67 -0
  48. package/template/.claude/skills/flydocs-cloud/scripts/update_description.py +47 -0
  49. package/template/.claude/skills/flydocs-cloud/scripts/update_issue.py +111 -0
  50. package/template/.claude/skills/flydocs-context-graph/SKILL.md +87 -0
  51. package/template/.claude/skills/flydocs-context-graph/schema.md +78 -0
  52. package/template/.claude/skills/flydocs-context-graph/scripts/graph_build.py +299 -0
  53. package/template/.claude/skills/flydocs-context-graph/scripts/graph_context.py +338 -0
  54. package/template/.claude/skills/flydocs-context-graph/scripts/graph_query.py +191 -0
  55. package/template/.claude/skills/flydocs-context-graph/scripts/graph_session.py +161 -0
  56. package/template/.claude/skills/flydocs-context-graph/scripts/graph_update.py +194 -0
  57. package/template/.claude/skills/flydocs-context-graph/scripts/graph_utils.py +118 -0
  58. package/template/.claude/skills/flydocs-estimates/SKILL.md +384 -0
  59. package/template/.claude/skills/flydocs-estimates/references/provider-costs.md +152 -0
  60. package/template/.claude/skills/flydocs-figma/SKILL.md +377 -0
  61. package/template/.claude/skills/flydocs-figma/references/PROMPTING.md +108 -0
  62. package/template/.claude/skills/flydocs-figma/references/TROUBLESHOOTING.md +112 -0
  63. package/template/.claude/skills/flydocs-local/SKILL.md +103 -0
  64. package/template/.claude/skills/flydocs-local/cursor-rule.mdc +43 -0
  65. package/template/.claude/skills/flydocs-local/scripts/assign.py +20 -0
  66. package/template/.claude/skills/flydocs-local/scripts/comment.py +27 -0
  67. package/template/.claude/skills/flydocs-local/scripts/create_issue.py +44 -0
  68. package/template/.claude/skills/flydocs-local/scripts/estimate.py +37 -0
  69. package/template/.claude/skills/flydocs-local/scripts/flydocs_api.py +272 -0
  70. package/template/.claude/skills/flydocs-local/scripts/get_issue.py +20 -0
  71. package/template/.claude/skills/flydocs-local/scripts/link.py +41 -0
  72. package/template/.claude/skills/flydocs-local/scripts/list_issues.py +34 -0
  73. package/template/.claude/skills/flydocs-local/scripts/priority.py +37 -0
  74. package/template/.claude/skills/flydocs-local/scripts/project_update.py +67 -0
  75. package/template/.claude/skills/flydocs-local/scripts/status_summary.py +16 -0
  76. package/template/.claude/skills/flydocs-local/scripts/transition.py +24 -0
  77. package/template/.claude/skills/flydocs-local/scripts/update_description.py +35 -0
  78. package/template/.claude/skills/flydocs-local/scripts/update_issue.py +84 -0
  79. package/template/.claude/skills/flydocs-workflow/SKILL.md +85 -0
  80. package/template/.claude/skills/flydocs-workflow/cursor-rule.mdc +53 -0
  81. package/template/.claude/skills/flydocs-workflow/reference/comment-templates.md +131 -0
  82. package/template/.claude/skills/flydocs-workflow/reference/golden-rules.md +76 -0
  83. package/template/.claude/skills/flydocs-workflow/reference/priority-estimates.md +28 -0
  84. package/template/.claude/skills/flydocs-workflow/reference/status-workflow.md +50 -0
  85. package/template/.claude/skills/flydocs-workflow/session.md +128 -0
  86. package/template/.claude/skills/flydocs-workflow/stages/activate.md +46 -0
  87. package/template/.claude/skills/flydocs-workflow/stages/capture.md +50 -0
  88. package/template/.claude/skills/flydocs-workflow/stages/close.md +32 -0
  89. package/template/.claude/skills/flydocs-workflow/stages/implement.md +124 -0
  90. package/template/.claude/skills/flydocs-workflow/stages/refine.md +51 -0
  91. package/template/.claude/skills/flydocs-workflow/stages/review.md +86 -0
  92. package/template/.claude/skills/flydocs-workflow/stages/validate.md +90 -0
  93. package/template/.claude/skills/flydocs-workflow/templates/bug.md +95 -0
  94. package/template/.claude/skills/flydocs-workflow/templates/chore.md +75 -0
  95. package/template/.claude/skills/flydocs-workflow/templates/feature.md +93 -0
  96. package/template/.claude/skills/flydocs-workflow/templates/idea.md +84 -0
  97. package/template/.cursor/agents/implementation-agent.md +28 -0
  98. package/template/.cursor/agents/pm-agent.md +27 -0
  99. package/template/.cursor/agents/research-agent.md +23 -0
  100. package/template/.cursor/agents/review-agent.md +27 -0
  101. package/template/.cursor/hooks.json +29 -0
  102. package/template/.cursor/mcp.json +16 -0
  103. package/template/.env.example +44 -0
  104. package/template/.flydocs/config.json +104 -0
  105. package/template/.flydocs/hooks/auto-approve.py +71 -0
  106. package/template/.flydocs/hooks/post-edit.py +72 -0
  107. package/template/.flydocs/hooks/prefer-scripts.py +89 -0
  108. package/template/.flydocs/hooks/prompt-submit.py +277 -0
  109. package/template/.flydocs/scripts/generate_manifest.py +287 -0
  110. package/template/.flydocs/scripts/skill_manager.py +541 -0
  111. package/template/.flydocs/templates/README.md +46 -0
  112. package/template/.flydocs/templates/bug.md +166 -0
  113. package/template/.flydocs/templates/chore.md +110 -0
  114. package/template/.flydocs/templates/design-system/README.md +27 -0
  115. package/template/.flydocs/templates/design-system/component-patterns.md +92 -0
  116. package/template/.flydocs/templates/design-system/token-mapping.md +168 -0
  117. package/template/.flydocs/templates/feature.md +173 -0
  118. package/template/.flydocs/templates/idea.md +122 -0
  119. package/template/.flydocs/templates/instructions.md +228 -0
  120. package/template/.flydocs/templates/quick-capture.md +35 -0
  121. package/template/.flydocs/templates/scripts/check-design-system.template.mjs +179 -0
  122. package/template/.flydocs/version +1 -0
  123. package/template/AGENTS.md +95 -0
  124. package/template/CHANGELOG.md +271 -0
  125. package/template/flydocs/README.md +186 -0
  126. package/template/flydocs/context/project.md +51 -0
  127. package/template/flydocs/design-system/README.md +126 -0
  128. package/template/flydocs/design-system/component-patterns.md +173 -0
  129. package/template/flydocs/design-system/token-mapping.md +114 -0
  130. package/template/flydocs/knowledge/INDEX.md +100 -0
  131. package/template/flydocs/knowledge/README.md +62 -0
  132. package/template/flydocs/knowledge/product/personas.md +79 -0
  133. package/template/flydocs/knowledge/product/user-flows.md +88 -0
  134. package/template/manifest.json +221 -0
@@ -0,0 +1,598 @@
1
+ # FlyDocs Setup (PM/Planning Agent)
2
+
3
+ Initial project onboarding — define project context, connect to provider, and
4
+ create an initial backlog. This command handles two scenarios: new projects
5
+ and FlyDocs version updates (including legacy content migration).
6
+
7
+ Read the active mechanism skill's `SKILL.md` for script calling conventions
8
+ before executing any scripts.
9
+
10
+ Triggers: "setup flydocs", "onboard project", "flydocs init"
11
+
12
+ ---
13
+
14
+ ## Phase 0: Scenario Detection
15
+
16
+ Before starting, detect the project state by checking the filesystem:
17
+
18
+ 1. **FlyDocs Update** — Check that `.flydocs/config.json` exists AND any of
19
+ these signals indicate prior setup: `flydocs/context/project.md` has real
20
+ content beyond template placeholders (the "What This Is" section contains
21
+ more than `[Project name]`), OR `flydocs/issues/` contains issue files
22
+ (local tier), OR `workspace.activeProjects` is populated in config, OR
23
+ `detectedStack.timestamp` is non-null in config.
24
+ 2. **New Project** — Neither of the above. Fresh setup.
25
+
26
+ Read `.flydocs/config.json` to determine the **tier** (`local` or `cloud`).
27
+ This affects which phases apply and which scripts are available.
28
+
29
+ **Announce the detected scenario and tier to the user. Confirm before proceeding.**
30
+
31
+ Example:
32
+
33
+ ```
34
+ Detected: New project setup (cloud tier)
35
+ I'll walk you through project definition, Linear setup, and initial backlog.
36
+ Ready to begin?
37
+ ```
38
+
39
+ ---
40
+
41
+ ## Phase 1: Project Definition
42
+
43
+ The goal is to fill every section of `flydocs/context/project.md` with real
44
+ content. The approach differs by scenario.
45
+
46
+ ### Phase 1A — New Project
47
+
48
+ Collaborative discovery. The user may arrive with anything from a loose idea
49
+ to a full PRD. Adapt accordingly.
50
+
51
+ **Step 1: Scan for existing project documentation.**
52
+
53
+ Before asking questions, proactively scan the repo for planning and vision docs:
54
+
55
+ - Root directory: `PRD.md`, `README.md`, `BRIEF.md`, `SPEC.md`, `VISION.md`,
56
+ `OVERVIEW.md`, `REQUIREMENTS.md`
57
+ - Common directories: `docs/`, `spec/`, `specs/`, `planning/`, `design/`
58
+ - Any `.md` files in root that look like project descriptions
59
+
60
+ If docs are found, offer to use them:
61
+
62
+ ```
63
+ I found some existing documentation:
64
+ - README.md (project overview)
65
+ - docs/PRD.md (product requirements)
66
+
67
+ Want me to read these and use them as a starting point for your project context?
68
+ ```
69
+
70
+ Read any docs the user approves. Extract key details: vision, goals, target
71
+ users, features, technical decisions, constraints.
72
+
73
+ **Step 2: Fill gaps through conversation.**
74
+
75
+ If no docs were found, or if the docs don't cover everything, ask questions:
76
+
77
+ - "What are you building? Who is it for?"
78
+ - "What problem does it solve?"
79
+ - "Any technical constraints or preferences I should know about?"
80
+
81
+ If the user references a file path or URL not yet read, read it and extract
82
+ the key details.
83
+
84
+ The goal is to build a complete picture by combining existing documentation
85
+ with conversational discovery — not to re-ask things already documented.
86
+
87
+ **Step 3: Stack detection.**
88
+
89
+ Scan the project root for tech stack signals:
90
+
91
+ - `package.json` → frameworks (React, Next.js, Vue, etc.), test runners
92
+ - `tsconfig.json` → TypeScript version and config
93
+ - `tailwind.config.*` → Tailwind CSS
94
+ - `prisma/`, `drizzle.config.*` → ORM / database
95
+ - `Dockerfile`, `fly.toml`, `vercel.json`, `netlify.toml` → hosting
96
+ - `vitest.config.*`, `jest.config.*` → testing framework
97
+ - `.python-version`, `requirements.txt`, `pyproject.toml` → Python projects
98
+ - `go.mod` → Go projects
99
+ - `Cargo.toml` → Rust projects
100
+
101
+ Report what you find. Ask the user to confirm or correct.
102
+
103
+ Update `.flydocs/config.json` field `detectedStack` with results:
104
+
105
+ ```json
106
+ {
107
+ "timestamp": "YYYY-MM-DDTHH:MM:SSZ",
108
+ "frameworks": ["next.js"],
109
+ "database": ["postgresql"],
110
+ "auth": [],
111
+ "styling": ["tailwind"]
112
+ }
113
+ ```
114
+
115
+ **Step 4: Iterative refinement of project.md.**
116
+
117
+ Fill each section of `flydocs/context/project.md`:
118
+
119
+ - **What This Is** — 2-3 sentences: project name, what it does, who it's for.
120
+ Reflect your understanding back. Ask: "Does this capture it, or should I
121
+ adjust anything?"
122
+
123
+ - **Stack** — Populate from detection results. Use the template format:
124
+
125
+ ```
126
+ - **Framework**: Next.js 14
127
+ - **Language**: TypeScript 5.x
128
+ - **Styling**: Tailwind CSS
129
+ - **Database**: PostgreSQL via Prisma
130
+ - **Hosting**: Vercel
131
+ - **Testing**: Vitest + Testing Library
132
+ ```
133
+
134
+ - **Standards** — Note which community skills were installed during setup
135
+ (if any). Ask about project-specific standards or conventions:
136
+ "Any project-specific rules I should know? For example: naming conventions,
137
+ folder structure preferences, or libraries to prefer/avoid?"
138
+
139
+ - **Active Priorities** — Ask: "What are the top 3 things you want to
140
+ accomplish first?" These become the initial priority list.
141
+
142
+ - **Links** — Ask for repository URL, design files (Figma), documentation
143
+ links. Fill what's available, leave the rest as placeholders.
144
+
145
+ - **Last Updated** — Set to today's date.
146
+
147
+ **Step 5: Write project.md.**
148
+
149
+ Show the user the complete filled project.md content. Ask for confirmation
150
+ or corrections. Write the file only after approval.
151
+
152
+ ### Phase 1U — FlyDocs Update
153
+
154
+ > **Note:** If the user just ran `/flydocs-update` (or `flydocs update`), the
155
+ > framework files and changelog have already been refreshed. This phase focuses
156
+ > on updating project _content_ (project.md, config), not framework files.
157
+
158
+ The project already has a populated project.md. Check for staleness and
159
+ offer updates.
160
+
161
+ **Step 0: Check for legacy context files.**
162
+
163
+ Before reading project.md, check if `flydocs/context/legacy/` exists. This
164
+ directory is created by `install.sh` when it finds pre-v1.0 separate context
165
+ files (`overview.md`, `stack.md`, `standards.md`) and moves them there for
166
+ safe migration.
167
+
168
+ If the legacy directory exists and contains files:
169
+
170
+ - Read `flydocs/context/legacy/overview.md` → Extract vision, goals, scope
171
+ - Read `flydocs/context/legacy/stack.md` → Extract tech stack details
172
+ - Read `flydocs/context/legacy/standards.md` → Extract conventions
173
+
174
+ Consolidate into project.md using the same mapping as Phase 1M Step 2.
175
+ Show the user the merged result and confirm before writing.
176
+
177
+ After successful migration, delete the files from `legacy/` so the next
178
+ `install.sh` run will clean up the empty directory.
179
+
180
+ **Step 1: Show what's new in this version.**
181
+
182
+ Read `.flydocs/CHANGELOG.md` and `.flydocs/version`. Compare the installed
183
+ version with what was previously installed (if the user knows, or check git
184
+ history for the version file). Show a summary of changes since their last
185
+ update:
186
+
187
+ ```
188
+ Updated to FlyDocs v0.2.0. Here's what changed:
189
+ - Scenario-aware setup command with proactive doc scanning
190
+ - Deprecated file cleanup in install.sh
191
+ - Legacy context migration for pre-v1.0 projects
192
+ - Changelog and version tracking
193
+ ```
194
+
195
+ If CHANGELOG.md doesn't exist (pre-0.2.0 install), skip this step.
196
+
197
+ **Step 2: Read existing project.md.**
198
+
199
+ Read `flydocs/context/project.md`. Check which sections are filled vs still
200
+ using template placeholders.
201
+
202
+ **Step 3: Report what's current.**
203
+
204
+ Show the user a brief summary:
205
+
206
+ ```
207
+ Your project.md looks good. Here's what I see:
208
+ - What This Is: ✓ (filled)
209
+ - Stack: ✓ (Next.js, TypeScript, Tailwind)
210
+ - Standards: ✓ (has project-specific rules)
211
+ - Active Priorities: ⚠ (last updated 3 weeks ago)
212
+ - Links: ✓ (repo + Figma linked)
213
+ ```
214
+
215
+ **Step 4: Offer updates.**
216
+
217
+ - If any section uses placeholder text, offer to fill it.
218
+ - If Active Priorities look stale, ask if they should be refreshed.
219
+ - Ask: "Anything else you'd like to update in your project context?"
220
+
221
+ **Step 5: Re-run stack detection.**
222
+
223
+ New frameworks or tools may have been added. Run detection, compare with
224
+ existing `detectedStack`, and report changes:
225
+
226
+ ```
227
+ Stack changes detected:
228
+ - Added: Drizzle ORM (new dependency)
229
+ - Removed: Prisma (no longer in package.json)
230
+ Update config? (y/n)
231
+ ```
232
+
233
+ **Step 6: Check for new config options.**
234
+
235
+ Read `.flydocs/config.json` and look for fields that are unconfigured but
236
+ may be useful:
237
+
238
+ - `aiLabor.enabled` — if false, mention it's available
239
+ - `designSystem` — if null and the project has design files, mention setup
240
+ - `workspace.product.name` — if null, offer to set it
241
+
242
+ ---
243
+
244
+ ## Phase 2: Provider Setup — Cloud Only
245
+
246
+ > **Local tier:** Skip this phase entirely. Print: "Local tier — no provider
247
+ > setup needed. Issues will be stored in `flydocs/issues/`."
248
+
249
+ For cloud tier, connect to Linear:
250
+
251
+ **Step 1: Verify API key.**
252
+
253
+ Check that `LINEAR_API_KEY` is set in the environment (from `.env` or
254
+ `.env.local`). If not:
255
+
256
+ ```
257
+ LINEAR_API_KEY is not set. Add it to your .env file:
258
+ LINEAR_API_KEY=lin_api_xxxxx
259
+
260
+ Get your key from: Linear → Settings → API → Personal API keys
261
+ ```
262
+
263
+ Do not proceed until the key is available.
264
+
265
+ **Step 2: Select team.**
266
+
267
+ If `provider.teamId` in config is null, discover available teams:
268
+
269
+ ```bash
270
+ python3 .claude/skills/flydocs-cloud/scripts/list_projects.py --all
271
+ ```
272
+
273
+ Present the teams to the user. Let them select. If only one team exists,
274
+ confirm it.
275
+
276
+ **Step 3: Get or create project.**
277
+
278
+ Query existing projects:
279
+
280
+ ```bash
281
+ python3 .claude/skills/flydocs-cloud/scripts/list_projects.py
282
+ ```
283
+
284
+ If matching projects exist, let the user select one. Otherwise, offer to
285
+ create a new project:
286
+
287
+ ```bash
288
+ python3 .claude/skills/flydocs-cloud/scripts/create_project.py --name "Project Name"
289
+ ```
290
+
291
+ **Step 4: Configure product identity.**
292
+
293
+ Ask about product metadata for Linear:
294
+
295
+ - **Product name** — how it appears in Linear (default: project name from
296
+ project.md)
297
+ - **Labels** — auto-create category labels (feature, bug, chore, idea) and
298
+ role labels (design, development, operations) if they don't exist
299
+ - **Icon and color** — optional, ask if they have preferences
300
+
301
+ **Step 5: Save to config.**
302
+
303
+ Update `.flydocs/config.json`:
304
+
305
+ - `provider.teamId` — selected team ID
306
+ - `workspace.activeProjects` — add the project ID
307
+ - `workspace.product.name` — product name
308
+ - `issueLabels` — map label IDs if created
309
+
310
+ ---
311
+
312
+ ## Phase 3: Milestones — Cloud Only
313
+
314
+ > **Local tier:** Skip this phase entirely.
315
+ > **FlyDocs Update:** Skip if milestones already exist.
316
+
317
+ **Step 1: Check existing milestones.**
318
+
319
+ ```bash
320
+ python3 .claude/skills/flydocs-cloud/scripts/list_milestones.py
321
+ ```
322
+
323
+ **Step 2: If milestones exist** — show them and confirm they'll be used for
324
+ backlog assignment in the next phase.
325
+
326
+ **Step 3: If no milestones exist** — offer to create a phased structure:
327
+
328
+ Suggest the Foundation / Core / Polish pattern:
329
+
330
+ ```
331
+ Suggested milestones:
332
+ 1. Phase 1: Foundation — Project setup, core infrastructure, auth
333
+ 2. Phase 2: Core Features — Primary user-facing functionality
334
+ 3. Phase 3: Polish — UX refinement, performance, edge cases
335
+
336
+ Want me to create these, or would you prefer different phases?
337
+ ```
338
+
339
+ Let the user customize names, descriptions, and target dates.
340
+
341
+ **Step 4: Create milestones.**
342
+
343
+ For each approved milestone:
344
+
345
+ ```bash
346
+ python3 .claude/skills/flydocs-cloud/scripts/create_milestone.py \
347
+ --name "Phase 1: Foundation" --target-date YYYY-MM-DD
348
+ ```
349
+
350
+ Record the milestone IDs for use in Phase 4.
351
+
352
+ ---
353
+
354
+ ## Phase 4: Initial Backlog
355
+
356
+ Capture the first batch of work items. The approach varies by scenario.
357
+
358
+ ### For New Project (any tier)
359
+
360
+ Guide the user through capturing 5-15 high-level work items. These don't need
361
+ to be fully refined — they're the starting backlog.
362
+
363
+ **Step 1: Seed from priorities.**
364
+
365
+ Use the Active Priorities from project.md as starting points:
366
+ "Based on your priorities, here are some issues I'd suggest capturing.
367
+ Want to start with these, or do you have your own list?"
368
+
369
+ **Step 2: Capture each item.**
370
+
371
+ For each work item, follow the capture procedure from
372
+ `.claude/skills/flydocs-workflow/stages/capture.md`:
373
+
374
+ - Determine type (feature, bug, chore, idea)
375
+ - Create via the mechanism script:
376
+ ```bash
377
+ python3 .claude/skills/flydocs-{tier}/scripts/create_issue.py \
378
+ --title "Issue title" --type feature --priority 3 --estimate 2
379
+ ```
380
+ - For quick ideas, use `--triage` flag
381
+
382
+ **Step 3: Milestone assignment (cloud only).**
383
+
384
+ > **Local tier:** Skip this step.
385
+
386
+ After creating issues, assign them to milestones:
387
+
388
+ ```bash
389
+ python3 .claude/skills/flydocs-cloud/scripts/assign_milestone.py \
390
+ <issue-ref> <milestone-id>
391
+ ```
392
+
393
+ Ask the user which milestone each issue belongs to, or suggest assignments
394
+ based on the issue content.
395
+
396
+ ### For FlyDocs Update
397
+
398
+ **Step 1: Check if backlog is populated.**
399
+
400
+ ```bash
401
+ python3 .claude/skills/flydocs-{tier}/scripts/list_issues.py --limit 10
402
+ ```
403
+
404
+ If issues exist, skip this phase:
405
+
406
+ ```
407
+ Your backlog already has [N] issues. Skipping initial backlog creation.
408
+ Want to capture any new items?
409
+ ```
410
+
411
+ **Step 2: Capture new items if desired.**
412
+
413
+ Only if the user wants to add more.
414
+
415
+ ---
416
+
417
+ ## Phase 5: Prioritization — Cloud Only
418
+
419
+ > **Local tier:** Skip this phase. Local issues have priority set at creation.
420
+ > **FlyDocs Update:** Skip if issues are already prioritized.
421
+
422
+ **Step 1: Review captured items.**
423
+
424
+ List all issues in Backlog status:
425
+
426
+ ```bash
427
+ python3 .claude/skills/flydocs-cloud/scripts/list_issues.py --status BACKLOG
428
+ ```
429
+
430
+ **Step 2: Set priorities.**
431
+
432
+ For each issue, suggest a priority and let the user confirm or adjust:
433
+
434
+ - **1 (Urgent)** — Blocking other work or critical path
435
+ - **2 (High)** — Important for current milestone
436
+ - **3 (Medium)** — Standard priority (default)
437
+ - **4 (Low)** — Nice to have, no urgency
438
+
439
+ ```bash
440
+ python3 .claude/skills/flydocs-cloud/scripts/priority.py <issue-ref> <0-4>
441
+ ```
442
+
443
+ Note: Linear uses 0=No priority, 1=Urgent, 2=High, 3=Medium, 4=Low.
444
+
445
+ **Step 3: Set estimates.**
446
+
447
+ For each issue, suggest a t-shirt size estimate:
448
+
449
+ - **1** — Trivial (< 1 hour)
450
+ - **2** — Small (half day)
451
+ - **3** — Medium (1-2 days)
452
+ - **4** — Large (3-5 days)
453
+ - **5** — XL (1+ week, consider breaking down)
454
+
455
+ ```bash
456
+ python3 .claude/skills/flydocs-cloud/scripts/estimate.py <issue-ref> <1-5>
457
+ ```
458
+
459
+ **Step 4: Identify dependencies.**
460
+
461
+ Ask about blocking relationships between issues. If any exist, note them
462
+ (Linear handles dependency tracking natively).
463
+
464
+ **Step 5: Recommend implementation order.**
465
+
466
+ Based on priorities, estimates, and dependencies, suggest an order:
467
+
468
+ ```
469
+ Recommended implementation order:
470
+ 1. ENG-101 — Auth setup (blocks most features)
471
+ 2. ENG-102 — Database schema (foundation)
472
+ 3. ENG-105 — User profile page (high priority, small)
473
+ ...
474
+ ```
475
+
476
+ ---
477
+
478
+ ## Phase 6: Completion & Onboarding
479
+
480
+ Summarize what was accomplished and provide a guided onboarding experience.
481
+
482
+ ### Step 1: Completion summary
483
+
484
+ ```
485
+ Setup complete! Here's what we did:
486
+
487
+ Scenario: [New Project / FlyDocs Update]
488
+ Tier: [local / cloud]
489
+
490
+ ✓ Project context: flydocs/context/project.md
491
+ ✓ Stack detected: [framework list]
492
+ ✓ Provider: [Linear connected / Local file-based] (if applicable)
493
+ ✓ Milestones: [N created] (cloud only)
494
+ ✓ Backlog: [N issues captured]
495
+ ✓ Priorities set (cloud only)
496
+ ```
497
+
498
+ **Mark setup as complete.**
499
+
500
+ Update `.flydocs/config.json` to set `setupComplete` to `true`. This disables
501
+ the setup reminder in the prompt hook. Read the config, set the field, and
502
+ write it back:
503
+
504
+ ```json
505
+ { "setupComplete": true }
506
+ ```
507
+
508
+ ### Step 2: Quick-start guide
509
+
510
+ Present the core workflow commands with brief descriptions:
511
+
512
+ ```
513
+ Here's how to work with FlyDocs:
514
+
515
+ Getting started:
516
+ /start-session Begin a work session (sets focus, loads context)
517
+ /activate Pick your next issue to work on
518
+ /capture Capture a new issue or idea anytime
519
+
520
+ During development:
521
+ /implement Start implementation on your active issue
522
+ /status Check current session and issue status
523
+ /block Flag a blocker on the current issue
524
+
525
+ Wrapping up:
526
+ /review Submit work for code review
527
+ /validate Run QE validation on completed work
528
+ /wrap-session End your session (posts summary, saves progress)
529
+ ```
530
+
531
+ ### Step 3: Tier-specific notes
532
+
533
+ **For cloud tier:**
534
+
535
+ - Linear project URL (if available from create_project response)
536
+ - Recommend reviewing milestones in Linear's UI for timeline view
537
+
538
+ **For local tier:**
539
+
540
+ - Issues live in `flydocs/issues/` as markdown files
541
+ - No account or API key needed — everything is local and offline
542
+ - Run `/status` anytime to see your backlog at a glance
543
+
544
+ ### Step 4: Beta CTA
545
+
546
+ Always end with the beta call-to-action:
547
+
548
+ ```
549
+ ─────────────────────────────────────────────────────
550
+
551
+ FlyDocs is in active development. Premium features coming soon:
552
+ → Cloud sync with Linear, Jira, and more
553
+ → AI-powered skills and automation
554
+ → Team analytics and cost intelligence
555
+
556
+ Join the beta for early access and updates:
557
+ https://www.flydocs.ai?utm_source=cli&utm_medium=setup&utm_campaign=beta
558
+
559
+ ─────────────────────────────────────────────────────
560
+ ```
561
+
562
+ ---
563
+
564
+ ## Error Handling
565
+
566
+ Throughout the setup flow:
567
+
568
+ - **Script failures** — If any mechanism script returns exit code 1, show the
569
+ error message from stderr and ask the user how to proceed. Do not retry
570
+ silently.
571
+ - **Missing API key** — For cloud tier, cannot proceed past Phase 2 without
572
+ `LINEAR_API_KEY`. Guide the user to set it up.
573
+ - **Missing config** — If `.flydocs/config.json` doesn't exist, the user
574
+ likely needs to run `flydocs` (install) first. Advise them accordingly.
575
+ - **Partial completion** — If the user needs to stop mid-setup, note which
576
+ phases are complete and which remain. They can re-run the command later
577
+ and Phase 0 will detect the current state (FlyDocs Update scenario).
578
+
579
+ ---
580
+
581
+ ## Key Rules
582
+
583
+ 1. **Always read the mechanism skill's `SKILL.md`** before running any script.
584
+ Script calling conventions may differ between tiers.
585
+ 2. **All script paths** follow the pattern:
586
+ `python3 .claude/skills/flydocs-{tier}/scripts/<script>.py`
587
+ where `{tier}` is read from `.flydocs/config.json`.
588
+ 3. **Never skip user confirmation** on project.md content. This is their
589
+ project definition — they must approve it.
590
+ 4. **Never hardcode tier** — always read from config. A project can switch
591
+ tiers via `flydocs --tier <tier>`.
592
+ 5. **Cloud scripts only for cloud tier.** Extended scripts (estimate, priority,
593
+ milestones, projects) only exist in `flydocs-cloud`. Do not attempt to call
594
+ them for local tier.
595
+ 6. **Capture procedure** — when creating issues during Phase 4, follow the
596
+ full capture procedure from `.claude/skills/flydocs-workflow/stages/capture.md`.
597
+
598
+ $ARGUMENTS
@@ -0,0 +1,27 @@
1
+ # FlyDocs Update (System)
2
+
3
+ Check for and apply FlyDocs updates to this project.
4
+
5
+ ## Steps
6
+
7
+ 1. **Check current version** — read `.flydocs/version` and report it.
8
+ 2. **Show changelog** — read `.flydocs/CHANGELOG.md` and summarize recent changes
9
+ since the installed version.
10
+ 3. **Run update** — execute `flydocs update` (or `install.sh --update` if using
11
+ the bash CLI) to update skills, commands, hooks, and config to the latest
12
+ version. Preserves project-specific content in `flydocs/context/project.md`
13
+ and user config in `.flydocs/config.json`.
14
+ 4. **Post-update** — if version changed, suggest running `/flydocs-setup` to review
15
+ any new config options or migrate legacy content.
16
+ 5. **Beta reminder** — always end with:
17
+
18
+ ```
19
+ ─────────────────────────────────────────────────────
20
+
21
+ Join the FlyDocs beta for early access to premium features and updates:
22
+ https://www.flydocs.ai?utm_source=cli&utm_medium=update&utm_campaign=beta
23
+
24
+ ─────────────────────────────────────────────────────
25
+ ```
26
+
27
+ $ARGUMENTS
@@ -0,0 +1,10 @@
1
+ # Implement (Implementation Agent)
2
+
3
+ Build the feature or fix, following the implementation checklist.
4
+
5
+ Read `.claude/skills/flydocs-workflow/stages/implement.md` and follow the procedure.
6
+ Read the active mechanism skill's `SKILL.md` for script calling conventions.
7
+
8
+ Triggers: "implement", "build this", "start coding", "pick up"
9
+
10
+ $ARGUMENTS
@@ -0,0 +1,11 @@
1
+ # New Project (PM/Planning Agent)
2
+
3
+ Create a new project and add it to active projects in config.
4
+
5
+ Use `create_project.py` from the active mechanism skill (cloud only).
6
+ For local tier: create project directory structure manually.
7
+ Update `.flydocs/config.json` with the new project ID in `workspace.activeProjects`.
8
+
9
+ Triggers: "new project", "create project", "start a new project"
10
+
11
+ $ARGUMENTS
@@ -0,0 +1,10 @@
1
+ # Project Update (PM/Planning Agent)
2
+
3
+ Post a project health update (onTrack, atRisk, offTrack).
4
+
5
+ Use `project_update.py` from the active mechanism skill (cloud only).
6
+ For local tier: append update to `flydocs/context/project.md` Active Priorities section.
7
+
8
+ Triggers: "project update", "health update", "post update"
9
+
10
+ $ARGUMENTS
@@ -0,0 +1,10 @@
1
+ # Refine (PM/Planning Agent)
2
+
3
+ Triage a raw capture or refine an existing issue's spec, priority, and estimate.
4
+
5
+ Read `.claude/skills/flydocs-workflow/stages/refine.md` and follow the procedure.
6
+ Read the active mechanism skill's `SKILL.md` for script calling conventions.
7
+
8
+ Triggers: "refine this", "triage", "flesh out", "add details to"
9
+
10
+ $ARGUMENTS
@@ -0,0 +1,10 @@
1
+ # Review (PM/Planning Agent)
2
+
3
+ Code review — verify acceptance criteria, code quality, and test coverage.
4
+
5
+ Read `.claude/skills/flydocs-workflow/stages/review.md` and follow the procedure.
6
+ Read the active mechanism skill's `SKILL.md` for script calling conventions.
7
+
8
+ Triggers: "review", "code review", "check this"
9
+
10
+ $ARGUMENTS
@@ -0,0 +1,10 @@
1
+ # Start Session (PM/Planning Agent)
2
+
3
+ Begin a work session — check active work, stale issues, and present a status dashboard.
4
+
5
+ Read `.claude/skills/flydocs-workflow/session.md` and follow the session start procedure.
6
+ Read the active mechanism skill's `SKILL.md` for script calling conventions.
7
+
8
+ Triggers: "start session", "what's going on", "pick up where I left off"
9
+
10
+ $ARGUMENTS