@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,93 @@
1
+ ## Context
2
+
3
+ [Problem description - what user pain or business need does this address?]
4
+
5
+ **Current Issues:**
6
+ - [Issue or limitation 1]
7
+ - [Issue or limitation 2]
8
+
9
+ ---
10
+
11
+ ## User Story
12
+
13
+ **As a** [specific user role]
14
+ **I want to** [specific goal or action]
15
+ **So that** [concrete benefit or outcome]
16
+
17
+ **Example Scenario:**
18
+ [Real-world scenario where this feature would be used]
19
+
20
+ ---
21
+
22
+ ## Acceptance Criteria
23
+
24
+ ### Must Have
25
+ - [ ] [Specific, measurable criterion 1]
26
+ - [ ] [User can perform X action and see Y result]
27
+ - [ ] [System behaves correctly when Z happens]
28
+ - [ ] [Error handling: System shows helpful message when...]
29
+
30
+ ### Should Have
31
+ - [ ] [Nice-to-have enhancement]
32
+
33
+ ### Won't Have (Out of Scope)
34
+ - [Explicitly excluded functionality]
35
+
36
+ ### Tests
37
+ - [ ] Tests written for core functionality
38
+ - [ ] Edge cases and error scenarios covered
39
+ - [ ] All tests passing
40
+
41
+ ### Documentation
42
+ - [ ] Code documented (comments on complex logic)
43
+ - [ ] Knowledge base updated (if significant decisions/patterns)
44
+ - [ ] Context files updated (if architecture changes)
45
+ - [ ] N/A - No significant documentation needed
46
+
47
+ ---
48
+
49
+ ## Technical Notes
50
+
51
+ ### Implementation Approach
52
+ [High-level description of how this will be built]
53
+
54
+ **Key Technical Decisions:**
55
+ 1. [Decision 1 and rationale]
56
+ 2. [Decision 2 and rationale]
57
+
58
+ ### Components Needed
59
+ **New:**
60
+ - `ComponentName` - [What it does]
61
+
62
+ **Modify:**
63
+ - `ExistingComponent` - [What changes needed]
64
+
65
+ ### Data Model
66
+ ```typescript
67
+ // Schema changes if any
68
+ // OR: No data model changes required
69
+ ```
70
+
71
+ ### API Endpoints
72
+ - `POST /api/endpoint` - [Description]
73
+ - OR: No new endpoints required
74
+
75
+ ---
76
+
77
+ ## Dependencies
78
+
79
+ **Required Before Starting:**
80
+ - [Feature or system that must exist first]
81
+ - OR: No dependencies - can start immediately
82
+
83
+ **Enables Future Work:**
84
+ - [Feature that depends on this being complete]
85
+
86
+ ---
87
+
88
+ ## Design Reference
89
+ <!-- Add Figma links as attachments -->
90
+
91
+ ---
92
+
93
+ _Created: YYYY-MM-DD_
@@ -0,0 +1,84 @@
1
+ ## Sketch
2
+
3
+ **Quick Description:**
4
+ - **What:** [One sentence - what is this?]
5
+ - **Why:** [One sentence - why might this be valuable?]
6
+ - **How:** [One sentence - rough idea of how it might work]
7
+
8
+ **Details:**
9
+ [Additional thoughts, context, inspiration, related ideas]
10
+
11
+ ---
12
+
13
+ ## Potential Value
14
+
15
+ **For Users:**
16
+ - [Benefit 1]
17
+ - [Benefit 2]
18
+
19
+ **For Business/Product:**
20
+ - [Value 1]
21
+ - [Value 2]
22
+
23
+ **Estimated Impact:** High | Medium | Low | Unknown
24
+
25
+ ---
26
+
27
+ ## Questions to Answer
28
+
29
+ **Unknowns:**
30
+ - [ ] What needs research or investigation?
31
+ - [ ] What's the technical feasibility?
32
+ - [ ] What's the rough effort estimate?
33
+ - [ ] Does this already exist elsewhere?
34
+
35
+ **Dependencies:**
36
+ - [ ] Does this depend on other work?
37
+ - [ ] Are there technical constraints?
38
+
39
+ **Risks:**
40
+ - [ ] What could go wrong?
41
+
42
+ ---
43
+
44
+ ## Rough Complexity
45
+
46
+ **Complexity:** XS | S | M | L | XL | Unknown
47
+
48
+ **If XL or larger:**
49
+ [How could this be broken into smaller features?]
50
+
51
+ ---
52
+
53
+ ## Next Steps
54
+
55
+ **To Validate This Idea:**
56
+ 1. [Research step 1]
57
+ 2. [User validation needed]
58
+ 3. [Technical spike or prototype]
59
+
60
+ **To Turn Into a Feature:**
61
+ 1. [ ] Answer the questions above
62
+ 2. [ ] Define clear user story and acceptance criteria
63
+ 3. [ ] Get stakeholder buy-in
64
+ 4. [ ] Create feature issue with full template
65
+
66
+ ---
67
+
68
+ ## Status Tracking
69
+
70
+ - [ ] **Captured** - Idea written down
71
+ - [ ] **Researched** - Questions answered, feasibility checked
72
+ - [ ] **Validated** - Worth pursuing
73
+ - [ ] **Refined** - Converted to full feature issue
74
+ - [ ] **Declined** - Decided not to pursue
75
+
76
+ **If Declined:**
77
+ - **Reason:** [Why we decided not to do this]
78
+
79
+ **If Refined:**
80
+ - **New Issue:** [Link to feature issue created from this idea]
81
+
82
+ ---
83
+
84
+ _Captured: YYYY-MM-DD_
@@ -0,0 +1,28 @@
1
+ ---
2
+ name: implementation-agent
3
+ description: "Builds features, fixes bugs, writes code. Invoke for implementation, coding, or technical work."
4
+ model: inherit
5
+ readonly: false
6
+ is_background: false
7
+ ---
8
+
9
+ # Implementation Agent
10
+
11
+ Implementation agent for FlyDocs spec-driven development.
12
+
13
+ ## Role
14
+
15
+ - Build features according to spec acceptance criteria
16
+ - Fix bugs following documented reproduction steps
17
+ - Write clean, tested code following project standards
18
+ - Document decisions and blockers via issue comments
19
+ - Simplify code before handoff to review
20
+
21
+ ## Constraints
22
+
23
+ - **Scripts for issue updates** — use mechanism scripts for progress comments and transitions
24
+ - Follow installed community skills for code quality patterns
25
+ - Keep changes focused on the spec — don't over-engineer
26
+
27
+ Read `.claude/skills/flydocs-workflow/stages/implement.md` for the implementation procedure.
28
+ Read `flydocs/context/project.md` for stack and project-specific standards.
@@ -0,0 +1,27 @@
1
+ ---
2
+ name: pm-agent
3
+ description: "Specs, workflow, issue management. Invoke for capturing, refining, activating, reviewing, closing, or session management."
4
+ model: inherit
5
+ readonly: false
6
+ is_background: false
7
+ ---
8
+
9
+ # PM Agent
10
+
11
+ Product management agent for FlyDocs spec-driven workflow.
12
+
13
+ ## Role
14
+
15
+ - Manage issues through the workflow lifecycle (capture → close)
16
+ - Refine specs using templates from the workflow skill
17
+ - Coordinate handoffs between implementation and review
18
+ - Post project updates and manage sessions
19
+
20
+ ## Constraints
21
+
22
+ - **Do not modify code files** — this agent handles workflow, not implementation
23
+ - **Scripts for all issue ops** — read the mechanism skill's SKILL.md for calling conventions
24
+ - Defer technical decisions to implementation agent
25
+
26
+ Read `.claude/skills/flydocs-workflow/SKILL.md` for lifecycle and stage procedures.
27
+ Read `.flydocs/config.json` for project configuration.
@@ -0,0 +1,23 @@
1
+ ---
2
+ name: research-agent
3
+ description: "Codebase exploration and research. Invoke for understanding code structure, finding patterns, or gathering technical context."
4
+ model: inherit
5
+ readonly: true
6
+ is_background: false
7
+ ---
8
+
9
+ # Research Agent
10
+
11
+ Research agent for exploring codebases and gathering context.
12
+
13
+ ## Role
14
+
15
+ - Explore codebase structure and patterns
16
+ - Look up documentation and external references
17
+ - Gather technical context before implementation
18
+ - Answer questions about existing code
19
+
20
+ ## Constraints
21
+
22
+ - **Read-only** — cannot modify files or run commands
23
+ - Reports findings — does not make decisions or implement changes
@@ -0,0 +1,27 @@
1
+ ---
2
+ name: review-agent
3
+ description: "Code review and quality analysis. Invoke for reviewing implementations, checking quality, or validating acceptance criteria."
4
+ model: inherit
5
+ readonly: true
6
+ is_background: false
7
+ ---
8
+
9
+ # Review Agent
10
+
11
+ Code review agent — critical analysis, not rubber-stamping.
12
+
13
+ ## Role
14
+
15
+ - Review code changes against acceptance criteria and project standards
16
+ - Identify bugs, pattern violations, security issues, performance problems
17
+ - Run automated tests and report results
18
+ - Present findings with severity (blocking / should fix / suggestion)
19
+
20
+ ## Constraints
21
+
22
+ - **Read-only** — cannot modify code
23
+ - **Cannot transition issues** — reports findings, PM agent handles state changes
24
+ - **Cannot approve on behalf of user** — presents review, user decides
25
+
26
+ Read `.claude/skills/flydocs-workflow/stages/review.md` for the review procedure.
27
+ Read `flydocs/context/project.md` for project-specific standards.
@@ -0,0 +1,29 @@
1
+ {
2
+ "version": 1,
3
+ "hooks": {
4
+ "preToolUse": [
5
+ {
6
+ "matcher": "Bash",
7
+ "command": "python3 ./.flydocs/hooks/auto-approve.py",
8
+ "timeout": 5
9
+ },
10
+ {
11
+ "matcher": "mcp__linear.*",
12
+ "command": "python3 ./.flydocs/hooks/prefer-scripts.py",
13
+ "timeout": 5
14
+ }
15
+ ],
16
+ "afterFileEdit": [
17
+ {
18
+ "command": "python3 ./.flydocs/hooks/post-edit.py",
19
+ "timeout": 30
20
+ }
21
+ ],
22
+ "beforeSubmitPrompt": [
23
+ {
24
+ "command": "python3 ./.flydocs/hooks/prompt-submit.py",
25
+ "timeout": 10
26
+ }
27
+ ]
28
+ }
29
+ }
@@ -0,0 +1,16 @@
1
+ {
2
+ "$schema": "https://cursor.sh/schemas/mcp.json",
3
+ "mcpServers": {
4
+ "linear": {
5
+ "command": "npx",
6
+ "args": ["-y", "@linear/mcp-server"],
7
+ "env": {
8
+ "LINEAR_API_KEY": "${LINEAR_API_KEY}"
9
+ }
10
+ },
11
+ "context7": {
12
+ "command": "npx",
13
+ "args": ["-y", "@anthropics/context7-mcp"]
14
+ }
15
+ }
16
+ }
@@ -0,0 +1,44 @@
1
+ # FlyDocs Core - Environment Configuration
2
+ #
3
+ # Copy this file to .env and fill in your value:
4
+ # cp .env.example .env
5
+ #
6
+ # IMPORTANT: Never commit .env to git!
7
+ #
8
+ # HOW TO LOAD THIS VALUE:
9
+ # ─────────────────────────
10
+ # Option A (Recommended): Use direnv
11
+ # 1. Install direnv: brew install direnv
12
+ # 2. Add to ~/.zshrc: eval "$(direnv hook zsh)"
13
+ # 3. Create .envrc file: echo "dotenv" > .envrc
14
+ # 4. Allow it: direnv allow
15
+ # → Value auto-loads when you cd into the project!
16
+ #
17
+ # Option B: Add to shell profile (~/.zshrc)
18
+ # export LINEAR_API_KEY="your_key_here"
19
+ #
20
+ # Option C: Export manually before opening Cursor
21
+ # source .env && cursor .
22
+ #
23
+
24
+ # ===========================================
25
+ # REQUIRED: Linear API Key
26
+ # ===========================================
27
+ # Get from: Linear → Settings → API → Personal API Keys
28
+ # Format: lin_api_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
29
+ LINEAR_API_KEY=
30
+
31
+ # ===========================================
32
+ # OPTIONAL: Figma Access Token
33
+ # ===========================================
34
+ # Get from: Figma → Settings → Personal Access Tokens
35
+ # Only needed if using Figma MCP for design integration
36
+ FIGMA_ACCESS_TOKEN=
37
+
38
+ # ===========================================
39
+ # NOTE: Team ID and Project ID are discovered automatically
40
+ # ===========================================
41
+ # Run /flydocs-setup and the agent will:
42
+ # 1. Query your Linear teams (you select one)
43
+ # 2. Query projects in that team (you select one)
44
+ # 3. Save both IDs to .flydocs/config.json
@@ -0,0 +1,104 @@
1
+ {
2
+ "version": "0.4.0",
3
+ "sourceRepo": "github.com/plastrlab/flydocs-core",
4
+ "tier": "cloud",
5
+ "setupComplete": false,
6
+ "paths": {
7
+ "content": "flydocs"
8
+ },
9
+ "provider": {
10
+ "type": "linear",
11
+ "teamId": null
12
+ },
13
+ "workspace": {
14
+ "activeProjects": [],
15
+ "defaultMilestoneId": null,
16
+ "product": {
17
+ "name": null,
18
+ "labelIds": [],
19
+ "icon": null,
20
+ "color": null
21
+ }
22
+ },
23
+ "issueLabels": {
24
+ "_note": "Run /flydocs-setup to populate these from your Linear team",
25
+ "category": {
26
+ "feature": null,
27
+ "bug": null,
28
+ "chore": null,
29
+ "idea": null
30
+ },
31
+ "role": {
32
+ "design": null,
33
+ "development": null,
34
+ "operations": null,
35
+ "client": null
36
+ },
37
+ "other": {
38
+ "triage": null,
39
+ "internal": null
40
+ }
41
+ },
42
+ "detectedStack": {
43
+ "timestamp": null,
44
+ "frameworks": [],
45
+ "database": [],
46
+ "auth": [],
47
+ "styling": []
48
+ },
49
+ "mcp": {
50
+ "preferred": [],
51
+ "fallbackOnly": ["linear"],
52
+ "stackSpecific": {}
53
+ },
54
+ "skills": {
55
+ "installed": [],
56
+ "custom": []
57
+ },
58
+ "statusMapping": {
59
+ "BACKLOG": "Backlog",
60
+ "READY": "Todo",
61
+ "IMPLEMENTING": "In Progress",
62
+ "BLOCKED": "Blocked",
63
+ "REVIEW": "In Review",
64
+ "TESTING": "QA",
65
+ "COMPLETE": "Done",
66
+ "ARCHIVED": "Archived",
67
+ "CANCELED": "Canceled",
68
+ "DUPLICATE": "Duplicate"
69
+ },
70
+ "designSystem": null,
71
+ "aiLabor": {
72
+ "enabled": false,
73
+ "defaultProvider": "claude-sonnet-4",
74
+ "thresholds": {
75
+ "warnTokens": 200000,
76
+ "warnCost": 5.0,
77
+ "requireApproval": 10.0
78
+ },
79
+ "tracking": {
80
+ "recordActuals": true,
81
+ "calibrationEnabled": true
82
+ },
83
+ "providerRates": {
84
+ "claude-sonnet-4": {
85
+ "input": 3.0,
86
+ "output": 15.0,
87
+ "inputRatio": 0.7,
88
+ "outputRatio": 0.3
89
+ },
90
+ "claude-opus-4": {
91
+ "input": 15.0,
92
+ "output": 75.0,
93
+ "inputRatio": 0.7,
94
+ "outputRatio": 0.3
95
+ },
96
+ "gpt-4o": {
97
+ "input": 2.5,
98
+ "output": 10.0,
99
+ "inputRatio": 0.7,
100
+ "outputRatio": 0.3
101
+ }
102
+ }
103
+ }
104
+ }
@@ -0,0 +1,71 @@
1
+ #!/usr/bin/env python3
2
+ """
3
+ PreToolUse Hook: Auto-approve FlyDocs mechanism and workflow scripts
4
+
5
+ Auto-approves Bash commands that execute scripts in any FlyDocs skill:
6
+ - .claude/skills/flydocs-local/scripts/
7
+ - .claude/skills/flydocs-cloud/scripts/
8
+ - .claude/skills/flydocs-workflow/scripts/
9
+
10
+ Exit codes:
11
+ - 0 with JSON: Approved (decision in output)
12
+ - 0 with no output: No opinion, continue normally
13
+ - 2: Block (stderr shown to AI)
14
+ """
15
+
16
+ import sys
17
+ import json
18
+ import re
19
+
20
+
21
+ # Pattern matches any flydocs skill scripts directory
22
+ # Covers: flydocs-local, flydocs-cloud, flydocs-workflow
23
+ APPROVED_PATTERN = re.compile(
24
+ r'\.claude/skills/flydocs-(?:local|cloud|workflow)/scripts/\w+\.py'
25
+ )
26
+
27
+
28
+ def should_approve(command: str) -> bool:
29
+ """Check if command executes a FlyDocs skill script."""
30
+ return bool(APPROVED_PATTERN.search(command))
31
+
32
+
33
+ def get_script_info(command: str) -> tuple[str, str]:
34
+ """Extract skill name and script name from command."""
35
+ match = re.search(
36
+ r'\.claude/skills/(flydocs-\w+)/scripts/(\w+\.py)', command
37
+ )
38
+ if match:
39
+ return match.group(1), match.group(2)
40
+ return "unknown", "unknown"
41
+
42
+
43
+ def main():
44
+ try:
45
+ input_data = json.load(sys.stdin)
46
+ except (json.JSONDecodeError, EOFError):
47
+ sys.exit(0)
48
+
49
+ tool_name = input_data.get('tool_name', '')
50
+ tool_input = input_data.get('tool_input', {})
51
+
52
+ if tool_name != 'Bash':
53
+ sys.exit(0)
54
+
55
+ command = tool_input.get('command', '')
56
+
57
+ if should_approve(command):
58
+ skill, script = get_script_info(command)
59
+ result = {
60
+ "decision": "approve",
61
+ "reason": f"Auto-approved FlyDocs script: {skill}/{script}"
62
+ }
63
+ print(json.dumps(result))
64
+ sys.exit(0)
65
+ else:
66
+ # No opinion — exit 0 with no output to avoid hook error
67
+ sys.exit(0)
68
+
69
+
70
+ if __name__ == "__main__":
71
+ main()
@@ -0,0 +1,72 @@
1
+ #!/usr/bin/env python3
2
+ """
3
+ FlyDocs Hook: post-edit.py
4
+ Triggered: After Edit or Write tool completes
5
+ Purpose: Auto-format code after agent edits
6
+
7
+ Exit codes:
8
+ 0 - Success (optional JSON output parsed)
9
+ 2 - Blocking error (stderr shown to Claude)
10
+ Other - Non-blocking error (shown in verbose mode)
11
+ """
12
+
13
+ import json
14
+ import subprocess
15
+ import sys
16
+ from pathlib import Path
17
+
18
+
19
+ def get_file_extension(file_path: str) -> str:
20
+ """Extract file extension from path."""
21
+ return Path(file_path).suffix.lstrip('.')
22
+
23
+
24
+ def format_file(file_path: str, ext: str) -> None:
25
+ """Auto-format file based on extension (non-blocking)."""
26
+ try:
27
+ if ext in ('ts', 'tsx', 'js', 'jsx', 'json', 'md'):
28
+ # Check if package.json exists and npx is available
29
+ if Path('package.json').exists():
30
+ subprocess.run(
31
+ ['npx', 'prettier', '--write', file_path],
32
+ capture_output=True,
33
+ timeout=30
34
+ )
35
+ elif ext == 'py':
36
+ # Use black if available
37
+ subprocess.run(
38
+ ['black', '--quiet', file_path],
39
+ capture_output=True,
40
+ timeout=30
41
+ )
42
+ except (subprocess.TimeoutExpired, FileNotFoundError, subprocess.SubprocessError):
43
+ # Non-blocking - silently skip formatting failures
44
+ pass
45
+
46
+
47
+ def main() -> None:
48
+ """Main hook execution."""
49
+ # Read hook input from stdin
50
+ try:
51
+ input_data = json.loads(sys.stdin.read())
52
+ except (json.JSONDecodeError, ValueError):
53
+ input_data = {}
54
+
55
+ file_path = input_data.get('tool_input', {}).get('file_path', '')
56
+
57
+ # Skip if no file path
58
+ if not file_path:
59
+ print('{}')
60
+ sys.exit(0)
61
+
62
+ # Get file extension and format
63
+ ext = get_file_extension(file_path)
64
+ format_file(file_path, ext)
65
+
66
+ # Return empty object to allow operation
67
+ print('{}')
68
+ sys.exit(0)
69
+
70
+
71
+ if __name__ == '__main__':
72
+ main()