flyee 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (302) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +134 -0
  3. package/bin/install.js +357 -0
  4. package/bridge/bridge.py +1780 -0
  5. package/bridge/local_tracker.py +722 -0
  6. package/core/agents/backend-specialist.md +266 -0
  7. package/core/agents/code-archaeologist.md +106 -0
  8. package/core/agents/database-architect.md +226 -0
  9. package/core/agents/debugger.md +225 -0
  10. package/core/agents/devops-engineer.md +323 -0
  11. package/core/agents/documentation-writer.md +104 -0
  12. package/core/agents/explorer-agent.md +73 -0
  13. package/core/agents/frontend-specialist.md +743 -0
  14. package/core/agents/game-developer.md +162 -0
  15. package/core/agents/mobile-developer.md +377 -0
  16. package/core/agents/orchestrator.md +416 -0
  17. package/core/agents/penetration-tester.md +188 -0
  18. package/core/agents/performance-optimizer.md +187 -0
  19. package/core/agents/product-manager.md +112 -0
  20. package/core/agents/product-owner.md +95 -0
  21. package/core/agents/project-planner.md +470 -0
  22. package/core/agents/qa-automation-engineer.md +103 -0
  23. package/core/agents/security-auditor.md +170 -0
  24. package/core/agents/seo-specialist.md +111 -0
  25. package/core/agents/stitch-designer.md +190 -0
  26. package/core/agents/tdd-reviewer.md +282 -0
  27. package/core/agents/test-engineer.md +158 -0
  28. package/core/scripts/auto_preview.py +148 -0
  29. package/core/scripts/checklist.py +243 -0
  30. package/core/scripts/cost_report.py +149 -0
  31. package/core/scripts/doc-sync-check.py +461 -0
  32. package/core/scripts/parse_user_stories.py +79 -0
  33. package/core/scripts/prepare_notion_updates.py +172 -0
  34. package/core/scripts/print_create_payload.py +18 -0
  35. package/core/scripts/session_manager.py +120 -0
  36. package/core/scripts/task_complete.py +127 -0
  37. package/core/scripts/verify_all.py +327 -0
  38. package/core/skills/analytics-strategy/SKILL.md +128 -0
  39. package/core/skills/api-patterns/SKILL.md +81 -0
  40. package/core/skills/api-patterns/api-style.md +42 -0
  41. package/core/skills/api-patterns/auth.md +24 -0
  42. package/core/skills/api-patterns/documentation.md +26 -0
  43. package/core/skills/api-patterns/graphql.md +41 -0
  44. package/core/skills/api-patterns/rate-limiting.md +31 -0
  45. package/core/skills/api-patterns/response.md +37 -0
  46. package/core/skills/api-patterns/rest.md +40 -0
  47. package/core/skills/api-patterns/scripts/api_validator.py +211 -0
  48. package/core/skills/api-patterns/security-testing.md +122 -0
  49. package/core/skills/api-patterns/trpc.md +41 -0
  50. package/core/skills/api-patterns/versioning.md +22 -0
  51. package/core/skills/app-builder/SKILL.md +75 -0
  52. package/core/skills/app-builder/agent-coordination.md +71 -0
  53. package/core/skills/app-builder/feature-building.md +53 -0
  54. package/core/skills/app-builder/project-detection.md +34 -0
  55. package/core/skills/app-builder/scaffolding.md +118 -0
  56. package/core/skills/app-builder/tech-stack.md +40 -0
  57. package/core/skills/app-builder/templates/SKILL.md +39 -0
  58. package/core/skills/app-builder/templates/astro-static/TEMPLATE.md +76 -0
  59. package/core/skills/app-builder/templates/chrome-extension/TEMPLATE.md +92 -0
  60. package/core/skills/app-builder/templates/cli-tool/TEMPLATE.md +88 -0
  61. package/core/skills/app-builder/templates/electron-desktop/TEMPLATE.md +88 -0
  62. package/core/skills/app-builder/templates/express-api/TEMPLATE.md +83 -0
  63. package/core/skills/app-builder/templates/flutter-app/TEMPLATE.md +90 -0
  64. package/core/skills/app-builder/templates/monorepo-turborepo/TEMPLATE.md +90 -0
  65. package/core/skills/app-builder/templates/nextjs-fullstack/TEMPLATE.md +82 -0
  66. package/core/skills/app-builder/templates/nextjs-saas/TEMPLATE.md +100 -0
  67. package/core/skills/app-builder/templates/nextjs-static/TEMPLATE.md +106 -0
  68. package/core/skills/app-builder/templates/nuxt-app/TEMPLATE.md +101 -0
  69. package/core/skills/app-builder/templates/python-fastapi/TEMPLATE.md +83 -0
  70. package/core/skills/app-builder/templates/react-native-app/TEMPLATE.md +93 -0
  71. package/core/skills/architecture/SKILL.md +55 -0
  72. package/core/skills/architecture/context-discovery.md +43 -0
  73. package/core/skills/architecture/examples.md +94 -0
  74. package/core/skills/architecture/pattern-selection.md +68 -0
  75. package/core/skills/architecture/patterns-reference.md +50 -0
  76. package/core/skills/architecture/trade-off-analysis.md +77 -0
  77. package/core/skills/atomic-design/SKILL.md +282 -0
  78. package/core/skills/atomic-design/references/classification-guide.md +132 -0
  79. package/core/skills/atomic-design/references/quality-checklist.md +60 -0
  80. package/core/skills/atomic-design/references/stacks/stack-blade.md +254 -0
  81. package/core/skills/atomic-design/references/stacks/stack-nextjs.md +272 -0
  82. package/core/skills/atomic-design/references/stacks/stack-react.md +239 -0
  83. package/core/skills/atomic-design/references/stacks/stack-vue.md +224 -0
  84. package/core/skills/bash-linux/SKILL.md +199 -0
  85. package/core/skills/behavioral-modes/SKILL.md +242 -0
  86. package/core/skills/brainstorming/SKILL.md +163 -0
  87. package/core/skills/brainstorming/dynamic-questioning.md +373 -0
  88. package/core/skills/checkpointing-patterns/SKILL.md +163 -0
  89. package/core/skills/clean-code/SKILL.md +201 -0
  90. package/core/skills/code-review-checklist/SKILL.md +109 -0
  91. package/core/skills/code-truth-validation/SKILL.md +149 -0
  92. package/core/skills/component-library-discovery/SKILL.md +154 -0
  93. package/core/skills/content-strategy/SKILL.md +222 -0
  94. package/core/skills/context-budget/SKILL.md +155 -0
  95. package/core/skills/context-gathering-patterns/SKILL.md +278 -0
  96. package/core/skills/cost-tracking/SKILL.md +206 -0
  97. package/core/skills/database-design/SKILL.md +52 -0
  98. package/core/skills/database-design/database-selection.md +43 -0
  99. package/core/skills/database-design/indexing.md +39 -0
  100. package/core/skills/database-design/migrations.md +48 -0
  101. package/core/skills/database-design/optimization.md +36 -0
  102. package/core/skills/database-design/orm-selection.md +30 -0
  103. package/core/skills/database-design/schema-design.md +56 -0
  104. package/core/skills/database-design/scripts/schema_validator.py +172 -0
  105. package/core/skills/deployment-procedures/SKILL.md +295 -0
  106. package/core/skills/design-md/README.md +34 -0
  107. package/core/skills/design-md/SKILL.md +172 -0
  108. package/core/skills/design-md/examples/DESIGN.md +154 -0
  109. package/core/skills/design-system-enforcement/SKILL.md +339 -0
  110. package/core/skills/doc.md +177 -0
  111. package/core/skills/document-registry/SKILL.md +130 -0
  112. package/core/skills/documentation-publishing/SKILL.md +174 -0
  113. package/core/skills/documentation-templates/SKILL.md +194 -0
  114. package/core/skills/enhance-prompt/README.md +34 -0
  115. package/core/skills/enhance-prompt/SKILL.md +204 -0
  116. package/core/skills/enhance-prompt/references/KEYWORDS.md +114 -0
  117. package/core/skills/frontend-design/SKILL.md +430 -0
  118. package/core/skills/frontend-design/animation-guide.md +331 -0
  119. package/core/skills/frontend-design/color-system.md +311 -0
  120. package/core/skills/frontend-design/decision-trees.md +418 -0
  121. package/core/skills/frontend-design/motion-graphics.md +306 -0
  122. package/core/skills/frontend-design/scripts/accessibility_checker.py +183 -0
  123. package/core/skills/frontend-design/scripts/ux_audit.py +722 -0
  124. package/core/skills/frontend-design/typography-system.md +345 -0
  125. package/core/skills/frontend-design/ux-psychology.md +541 -0
  126. package/core/skills/frontend-design/visual-effects.md +383 -0
  127. package/core/skills/game-development/2d-games/SKILL.md +119 -0
  128. package/core/skills/game-development/3d-games/SKILL.md +135 -0
  129. package/core/skills/game-development/SKILL.md +167 -0
  130. package/core/skills/game-development/game-art/SKILL.md +185 -0
  131. package/core/skills/game-development/game-audio/SKILL.md +190 -0
  132. package/core/skills/game-development/game-design/SKILL.md +129 -0
  133. package/core/skills/game-development/mobile-games/SKILL.md +108 -0
  134. package/core/skills/game-development/multiplayer/SKILL.md +132 -0
  135. package/core/skills/game-development/pc-games/SKILL.md +144 -0
  136. package/core/skills/game-development/vr-ar/SKILL.md +123 -0
  137. package/core/skills/game-development/web-games/SKILL.md +150 -0
  138. package/core/skills/geo-fundamentals/SKILL.md +156 -0
  139. package/core/skills/geo-fundamentals/scripts/geo_checker.py +289 -0
  140. package/core/skills/git-workflow/SKILL.md +263 -0
  141. package/core/skills/history-check-patterns/SKILL.md +125 -0
  142. package/core/skills/i18n-localization/SKILL.md +154 -0
  143. package/core/skills/i18n-localization/scripts/i18n_checker.py +241 -0
  144. package/core/skills/integration-completeness/SKILL.md +219 -0
  145. package/core/skills/intelligent-routing/SKILL.md +370 -0
  146. package/core/skills/lint-and-validate/SKILL.md +45 -0
  147. package/core/skills/lint-and-validate/scripts/lint_runner.py +173 -0
  148. package/core/skills/lint-and-validate/scripts/type_coverage.py +173 -0
  149. package/core/skills/local-verification/SKILL.md +195 -0
  150. package/core/skills/mcp-builder/SKILL.md +176 -0
  151. package/core/skills/mobile-design/SKILL.md +394 -0
  152. package/core/skills/mobile-design/decision-trees.md +516 -0
  153. package/core/skills/mobile-design/mobile-backend.md +491 -0
  154. package/core/skills/mobile-design/mobile-color-system.md +420 -0
  155. package/core/skills/mobile-design/mobile-debugging.md +122 -0
  156. package/core/skills/mobile-design/mobile-design-thinking.md +357 -0
  157. package/core/skills/mobile-design/mobile-navigation.md +458 -0
  158. package/core/skills/mobile-design/mobile-performance.md +767 -0
  159. package/core/skills/mobile-design/mobile-testing.md +356 -0
  160. package/core/skills/mobile-design/mobile-typography.md +433 -0
  161. package/core/skills/mobile-design/platform-android.md +666 -0
  162. package/core/skills/mobile-design/platform-ios.md +561 -0
  163. package/core/skills/mobile-design/scripts/mobile_audit.py +670 -0
  164. package/core/skills/mobile-design/touch-psychology.md +537 -0
  165. package/core/skills/nextjs-react-expert/1-async-eliminating-waterfalls.md +312 -0
  166. package/core/skills/nextjs-react-expert/2-bundle-bundle-size-optimization.md +240 -0
  167. package/core/skills/nextjs-react-expert/3-server-server-side-performance.md +490 -0
  168. package/core/skills/nextjs-react-expert/4-client-client-side-data-fetching.md +264 -0
  169. package/core/skills/nextjs-react-expert/5-rerender-re-render-optimization.md +581 -0
  170. package/core/skills/nextjs-react-expert/6-rendering-rendering-performance.md +432 -0
  171. package/core/skills/nextjs-react-expert/7-js-javascript-performance.md +684 -0
  172. package/core/skills/nextjs-react-expert/8-advanced-advanced-patterns.md +150 -0
  173. package/core/skills/nextjs-react-expert/SKILL.md +267 -0
  174. package/core/skills/nextjs-react-expert/scripts/convert_rules.py +222 -0
  175. package/core/skills/nextjs-react-expert/scripts/react_performance_checker.py +252 -0
  176. package/core/skills/nodejs-best-practices/SKILL.md +333 -0
  177. package/core/skills/notion-task-patterns/SKILL.md +2529 -0
  178. package/core/skills/page-specifications/SKILL.md +367 -0
  179. package/core/skills/parallel-agents/SKILL.md +175 -0
  180. package/core/skills/performance-profiling/SKILL.md +143 -0
  181. package/core/skills/performance-profiling/scripts/lighthouse_audit.py +76 -0
  182. package/core/skills/plan-writing/SKILL.md +190 -0
  183. package/core/skills/powershell-windows/SKILL.md +167 -0
  184. package/core/skills/project-foundation/SKILL.md +117 -0
  185. package/core/skills/project-setup/SKILL.md +141 -0
  186. package/core/skills/project-tracking-patterns/SKILL.md +357 -0
  187. package/core/skills/project-type-discovery/SKILL.md +239 -0
  188. package/core/skills/python-patterns/SKILL.md +441 -0
  189. package/core/skills/qa-test-generation/SKILL.md +156 -0
  190. package/core/skills/react-components/README.md +36 -0
  191. package/core/skills/react-components/SKILL.md +47 -0
  192. package/core/skills/react-components/examples/gold-standard-card.tsx +80 -0
  193. package/core/skills/react-components/package-lock.json +231 -0
  194. package/core/skills/react-components/package.json +16 -0
  195. package/core/skills/react-components/resources/architecture-checklist.md +15 -0
  196. package/core/skills/react-components/resources/component-template.tsx +37 -0
  197. package/core/skills/react-components/resources/stitch-api-reference.md +14 -0
  198. package/core/skills/react-components/resources/style-guide.json +27 -0
  199. package/core/skills/react-components/scripts/fetch-stitch.sh +30 -0
  200. package/core/skills/react-components/scripts/validate.js +68 -0
  201. package/core/skills/red-team-tactics/SKILL.md +199 -0
  202. package/core/skills/remotion/README.md +105 -0
  203. package/core/skills/remotion/SKILL.md +393 -0
  204. package/core/skills/remotion/examples/WalkthroughComposition.tsx +78 -0
  205. package/core/skills/remotion/examples/screens.json +56 -0
  206. package/core/skills/remotion/resources/composition-checklist.md +124 -0
  207. package/core/skills/remotion/resources/screen-slide-template.tsx +123 -0
  208. package/core/skills/remotion/scripts/download-stitch-asset.sh +38 -0
  209. package/core/skills/seo-fundamentals/SKILL.md +129 -0
  210. package/core/skills/seo-fundamentals/scripts/seo_checker.py +219 -0
  211. package/core/skills/server-management/SKILL.md +161 -0
  212. package/core/skills/session-resilience/SKILL.md +199 -0
  213. package/core/skills/shadcn-ui/README.md +248 -0
  214. package/core/skills/shadcn-ui/SKILL.md +326 -0
  215. package/core/skills/shadcn-ui/examples/auth-layout.tsx +177 -0
  216. package/core/skills/shadcn-ui/examples/data-table.tsx +313 -0
  217. package/core/skills/shadcn-ui/examples/form-pattern.tsx +177 -0
  218. package/core/skills/shadcn-ui/resources/component-catalog.md +481 -0
  219. package/core/skills/shadcn-ui/resources/customization-guide.md +516 -0
  220. package/core/skills/shadcn-ui/resources/migration-guide.md +463 -0
  221. package/core/skills/shadcn-ui/resources/setup-guide.md +412 -0
  222. package/core/skills/shadcn-ui/scripts/verify-setup.sh +134 -0
  223. package/core/skills/state-machine/SKILL.md +264 -0
  224. package/core/skills/stitch-loop/README.md +54 -0
  225. package/core/skills/stitch-loop/SKILL.md +203 -0
  226. package/core/skills/stitch-loop/examples/SITE.md +73 -0
  227. package/core/skills/stitch-loop/examples/next-prompt.md +25 -0
  228. package/core/skills/stitch-loop/resources/baton-schema.md +61 -0
  229. package/core/skills/stitch-loop/resources/site-template.md +104 -0
  230. package/core/skills/systematic-debugging/SKILL.md +109 -0
  231. package/core/skills/tailwind-patterns/SKILL.md +284 -0
  232. package/core/skills/tdd-validation/SKILL.md +243 -0
  233. package/core/skills/tdd-workflow/SKILL.md +284 -0
  234. package/core/skills/testing-patterns/SKILL.md +196 -0
  235. package/core/skills/testing-patterns/scripts/test_runner.py +219 -0
  236. package/core/skills/ui-ux-discovery/SKILL.md +329 -0
  237. package/core/skills/ui-validation/SKILL.md +190 -0
  238. package/core/skills/ui-validation/scripts/ui_antipattern_check.py +317 -0
  239. package/core/skills/verification-gate/SKILL.md +205 -0
  240. package/core/skills/vulnerability-scanner/SKILL.md +276 -0
  241. package/core/skills/vulnerability-scanner/checklists.md +121 -0
  242. package/core/skills/vulnerability-scanner/scripts/security_scan.py +458 -0
  243. package/core/skills/web-design-guidelines/SKILL.md +57 -0
  244. package/core/skills/webapp-testing/SKILL.md +187 -0
  245. package/core/skills/webapp-testing/scripts/playwright_runner.py +173 -0
  246. package/core/templates/ARCHITECTURE.template.md +407 -0
  247. package/core/templates/project-resources.example.json +71 -0
  248. package/core/workflows/atomic.md +182 -0
  249. package/core/workflows/brainstorm.md +134 -0
  250. package/core/workflows/check-task.md +242 -0
  251. package/core/workflows/copy-collect.md +306 -0
  252. package/core/workflows/create-agent.md +33 -0
  253. package/core/workflows/create-skill.md +39 -0
  254. package/core/workflows/create-workflow.md +33 -0
  255. package/core/workflows/create.md +92 -0
  256. package/core/workflows/debug.md +186 -0
  257. package/core/workflows/demand.md +443 -0
  258. package/core/workflows/deploy.md +260 -0
  259. package/core/workflows/discovery.md +267 -0
  260. package/core/workflows/document.md +272 -0
  261. package/core/workflows/ds-components.md +296 -0
  262. package/core/workflows/ds-init.md +58 -0
  263. package/core/workflows/ds-refactor.md +245 -0
  264. package/core/workflows/ds-references.md +197 -0
  265. package/core/workflows/ds-styleguide.md +237 -0
  266. package/core/workflows/ds-token-diff.md +103 -0
  267. package/core/workflows/ds-tokens.md +317 -0
  268. package/core/workflows/ds-validate.md +309 -0
  269. package/core/workflows/execute.md +483 -0
  270. package/core/workflows/extract-template.md +278 -0
  271. package/core/workflows/fix-failed-tests.md +160 -0
  272. package/core/workflows/init-project.md +386 -0
  273. package/core/workflows/legacy-project.md +849 -0
  274. package/core/workflows/log.md +97 -0
  275. package/core/workflows/new-project.md +610 -0
  276. package/core/workflows/new-project.md.bak +3292 -0
  277. package/core/workflows/new-task.md +404 -0
  278. package/core/workflows/orchestrate.md +237 -0
  279. package/core/workflows/page-build.md +296 -0
  280. package/core/workflows/plan.md +89 -0
  281. package/core/workflows/prd.md +255 -0
  282. package/core/workflows/preview.md +81 -0
  283. package/core/workflows/review-page.md +304 -0
  284. package/core/workflows/status.md +86 -0
  285. package/core/workflows/stitch.md +226 -0
  286. package/core/workflows/task-complete.md +473 -0
  287. package/core/workflows/task-update.md +163 -0
  288. package/core/workflows/tdd.md +344 -0
  289. package/core/workflows/test.md +251 -0
  290. package/core/workflows/ui-ux-pro-max.md +437 -0
  291. package/core/workflows/ux-mobile-optimize.md +262 -0
  292. package/core/workflows/ux-mobile-validate.md +297 -0
  293. package/engine-files/GEMINI.md +69 -0
  294. package/package.json +47 -0
  295. package/runtime-adapters/antigravity.js +26 -0
  296. package/runtime-adapters/claude.js +57 -0
  297. package/runtime-adapters/codex.js +51 -0
  298. package/runtime-adapters/copilot.js +51 -0
  299. package/runtime-adapters/cursor.js +51 -0
  300. package/runtime-adapters/gemini-cli.js +30 -0
  301. package/runtime-adapters/opencode.js +51 -0
  302. package/runtime-adapters/windsurf.js +51 -0
@@ -0,0 +1,172 @@
1
+ import re
2
+ import json
3
+ import argparse
4
+ import os
5
+ import sys
6
+
7
+ # =============================================================================
8
+ # AUTO-FILL MAPPINGS (Generic defaults)
9
+ # =============================================================================
10
+
11
+ # Default category based on Agent responsible
12
+ DEFAULT_AGENT_TO_CATEGORY = {
13
+ "frontend-specialist": ["Frontend", "UI/UX"],
14
+ "backend-specialist": ["Backend", "API"],
15
+ "mobile-developer": ["Mobile", "Frontend"],
16
+ "devops-engineer": ["DevOps", "Infra"],
17
+ "security-auditor": ["Backend", "Security"],
18
+ "debugger": ["Debug"],
19
+ "orchestrator": ["Planejamento"],
20
+ "database-architect": ["Backend", "Database"],
21
+ }
22
+
23
+ # Story Points based on Estimate
24
+ ESTIMATE_TO_POINTS = {
25
+ "S": 2, "XS": 1,
26
+ "Pequeno": 2,
27
+ "M": 3,
28
+ "MƩdio": 3,
29
+ "L": 5,
30
+ "Grande": 5,
31
+ "XL": 8,
32
+ "Muito Grande": 8,
33
+ }
34
+
35
+ def get_category(agent: str, custom_mapping=None) -> list:
36
+ """Returns category list based on agent."""
37
+ mapping = custom_mapping or DEFAULT_AGENT_TO_CATEGORY
38
+ agent_key = agent.lower().replace(" ", "-").split(",")[0].strip()
39
+
40
+ for key, cats in mapping.items():
41
+ if key in agent_key or agent_key in key:
42
+ return cats
43
+ return ["Outros"]
44
+
45
+ def get_points(estimate: str) -> int:
46
+ """Returns story points based on estimate."""
47
+ return ESTIMATE_TO_POINTS.get(estimate, 3)
48
+
49
+ def parse_markdown_stories(file_path):
50
+ """Simple parser for Markdown user stories if JSON not provided"""
51
+ with open(file_path, "r", encoding="utf-8") as f:
52
+ content = f.read()
53
+
54
+ tasks = {}
55
+ current_task = None
56
+
57
+ lines = content.split('\n')
58
+ for line in lines:
59
+ m = re.match(r"^### (\d+\.\d+) (.+)", line)
60
+ if m:
61
+ if current_task:
62
+ tasks[current_task['id']] = current_task
63
+
64
+ current_task = {
65
+ 'id': m.group(1),
66
+ 'title': m.group(2).strip(),
67
+ 'content': [],
68
+ 'priority': 'MUST',
69
+ 'estimate': 'S',
70
+ 'agent': 'frontend-specialist'
71
+ }
72
+ elif current_task:
73
+ current_task['content'].append(line)
74
+
75
+ if "**Priority:**" in line:
76
+ current_task['priority'] = line.split("**Priority:**")[1].strip()
77
+ if "**Estimate:**" in line:
78
+ current_task['estimate'] = line.split("**Estimate:**")[1].strip()
79
+ if "**Agent:**" in line:
80
+ current_task['agent'] = line.split("**Agent:**")[1].strip()
81
+
82
+ if current_task:
83
+ tasks[current_task['id']] = current_task
84
+
85
+ return tasks
86
+
87
+ def main():
88
+ parser = argparse.ArgumentParser(description="Prepare Notion Updates from Stories")
89
+ parser.add_argument("--input", required=True, help="Input file (Markdown stories or parsed JSON)")
90
+ parser.add_argument("--database-id", required=True, help="Target Notion Database ID")
91
+ parser.add_argument("--epic", required=True, help="Epic name for the tasks (e.g. 'Authentication')")
92
+ parser.add_argument("--id-map", help="JSON file mapping Task IDs to Page IDs (for updates)")
93
+ parser.add_argument("--output", default="notion_updates.json", help="Output JSON file")
94
+
95
+ args = parser.parse_args()
96
+
97
+ # 1. Load Tasks
98
+ if args.input.endswith('.json'):
99
+ with open(args.input, 'r', encoding='utf-8') as f:
100
+ data = json.load(f)
101
+ # Convert list to dict if needed, or assume list format
102
+ if isinstance(data, list):
103
+ tasks = {t['id']: t for t in data}
104
+ else:
105
+ tasks = data
106
+ else:
107
+ tasks = parse_markdown_stories(args.input)
108
+
109
+ # 2. Load ID Map (if exists)
110
+ id_map = {}
111
+ if args.id_map and os.path.exists(args.id_map):
112
+ with open(args.id_map, 'r', encoding='utf-8') as f:
113
+ id_map = json.load(f)
114
+
115
+ print(f"Loaded {len(tasks)} tasks.")
116
+ if id_map:
117
+ print(f"Loaded {len(id_map)} ID mappings.")
118
+
119
+ updates = []
120
+ creates = []
121
+
122
+ for tid, tdata in tasks.items():
123
+ # Handle different structures (parsed json vs markdown dict)
124
+ description = tdata.get('description', "")
125
+ if not description and 'content' in tdata:
126
+ description = "\n".join(tdata['content']).strip()
127
+
128
+ agent = tdata.get('agent', 'Pending')
129
+ estimate = tdata.get('estimate', 'M')
130
+ priority = tdata.get('priority', 'Medium')
131
+ title = tdata.get('title', f"{tid} Task")
132
+
133
+ props = {
134
+ "ID": {"rich_text": [{"text": {"content": str(tid)}}]},
135
+ "Ɖpico": {"select": {"name": args.epic}},
136
+ "Prioridade": {"select": {"name": priority}},
137
+ "Estimativa": {"rich_text": [{"text": {"content": estimate}}]}, # Changed to text as per ARCHITECTURE
138
+ "Agente": {"select": {"name": agent.replace(" + ", ",").split(",")[0].strip()}},
139
+ "Descrição": {"rich_text": [{"text": {"content": description[:1900]}}]},
140
+
141
+ # Auto-fill
142
+ "Categoria": {"multi_select": [{"name": "Feature"}]}, # Standardized to Feature
143
+ "Pontos": {"number": get_points(estimate)},
144
+ "% Progresso": {"number": 0},
145
+ "Tags": {"multi_select": [{"name": cat} for cat in get_category(agent)]} # Moved technical tags to Tags
146
+ }
147
+
148
+ # Check if updating or creating
149
+ page_id = id_map.get(tid)
150
+
151
+ if page_id:
152
+ updates.append({"page_id": page_id, "properties": props})
153
+ else:
154
+ create_props = props.copy()
155
+ # Ensure title is set for creation
156
+ if "Nome da tarefa" not in create_props:
157
+ create_props["Nome da tarefa"] = {"title": [{"text": {"content": title}}]}
158
+
159
+ create_props["Status"] = {"status": {"name": "backlog"}}
160
+ creates.append({"parent": {"database_id": args.database_id}, "properties": create_props})
161
+
162
+ # Output
163
+ output_data = {"updates": updates, "creates": creates}
164
+
165
+ with open(args.output, "w", encoding="utf-8") as f:
166
+ json.dump(output_data, f, indent=2, ensure_ascii=False)
167
+
168
+ print(f"āœ… Generated {len(updates)} updates and {len(creates)} creates")
169
+ print(f"šŸ“„ Output written to: {args.output}")
170
+
171
+ if __name__ == "__main__":
172
+ main()
@@ -0,0 +1,18 @@
1
+ import json
2
+ import sys
3
+
4
+ target = sys.argv[1]
5
+ with open('notion_updates.json', 'r', encoding='utf-8') as f:
6
+ data = json.load(f)
7
+
8
+ found = False
9
+ for c in data['creates']:
10
+ title = c['properties']['Nome da tarefa']['title'][0]['text']['content']
11
+ if target in title:
12
+ with open('temp_payload.json', 'w', encoding='utf-8') as out:
13
+ json.dump(c, out, indent=2, ensure_ascii=False)
14
+ found = True
15
+ break
16
+
17
+ if not found:
18
+ print(f"Task containing '{target}' not found in creates.")
@@ -0,0 +1,120 @@
1
+ #!/usr/bin/env python3
2
+ """
3
+ Session Manager - Antigravity Kit
4
+ =================================
5
+ Analyzes project state, detects tech stack, tracks file statistics, and provides
6
+ a summary of the current session.
7
+
8
+ Usage:
9
+ python .agent/scripts/session_manager.py status [path]
10
+ python .agent/scripts/session_manager.py info [path]
11
+ """
12
+
13
+ import os
14
+ import json
15
+ import argparse
16
+ from pathlib import Path
17
+ from typing import Dict, Any, List
18
+
19
+ def get_project_root(path: str) -> Path:
20
+ return Path(path).resolve()
21
+
22
+ def analyze_package_json(root: Path) -> Dict[str, Any]:
23
+ pkg_file = root / "package.json"
24
+ if not pkg_file.exists():
25
+ return {"type": "unknown", "dependencies": {}}
26
+
27
+ try:
28
+ with open(pkg_file, 'r', encoding='utf-8') as f:
29
+ data = json.load(f)
30
+
31
+ deps = data.get("dependencies", {})
32
+ dev_deps = data.get("devDependencies", {})
33
+ all_deps = {**deps, **dev_deps}
34
+
35
+ stack = []
36
+ if "next" in all_deps: stack.append("Next.js")
37
+ elif "react" in all_deps: stack.append("React")
38
+ elif "vue" in all_deps: stack.append("Vue")
39
+ elif "svelte" in all_deps: stack.append("Svelte")
40
+ elif "express" in all_deps: stack.append("Express")
41
+ elif "nestjs" in all_deps or "@nestjs/core" in all_deps: stack.append("NestJS")
42
+
43
+ if "tailwindcss" in all_deps: stack.append("Tailwind CSS")
44
+ if "prisma" in all_deps: stack.append("Prisma")
45
+ if "typescript" in all_deps: stack.append("TypeScript")
46
+
47
+ return {
48
+ "name": data.get("name", "unnamed"),
49
+ "version": data.get("version", "0.0.0"),
50
+ "stack": stack,
51
+ "scripts": list(data.get("scripts", {}).keys())
52
+ }
53
+ except Exception as e:
54
+ return {"error": str(e)}
55
+
56
+ def count_files(root: Path) -> Dict[str, int]:
57
+ stats = {"created": 0, "modified": 0, "total": 0}
58
+ # Simple count for now, comprehensive tracking would require git diff or extensive history
59
+ exclude = {".git", "node_modules", ".next", "dist", "build", ".agent", ".gemini", "__pycache__"}
60
+
61
+ for root_dir, dirs, files in os.walk(root):
62
+ dirs[:] = [d for d in dirs if d not in exclude]
63
+ stats["total"] += len(files)
64
+
65
+ return stats
66
+
67
+ def detect_features(root: Path) -> List[str]:
68
+ # Heuristic: look at folder names in src/
69
+ features = []
70
+ src = root / "src"
71
+ if src.exists():
72
+ possible_dirs = ["components", "modules", "features", "app", "pages", "services"]
73
+ for d in possible_dirs:
74
+ p = src / d
75
+ if p.exists() and p.is_dir():
76
+ # List subdirectories as likely features
77
+ for child in p.iterdir():
78
+ if child.is_dir():
79
+ features.append(child.name)
80
+ return features[:10] # Limit to top 10
81
+
82
+ def print_status(root: Path):
83
+ info = analyze_package_json(root)
84
+ stats = count_files(root)
85
+ features = detect_features(root)
86
+
87
+ print("\n=== Project Status ===")
88
+ print(f"\nšŸ“ Project: {info.get('name', root.name)}")
89
+ print(f"šŸ“‚ Path: {root}")
90
+ print(f"šŸ·ļø Type: {', '.join(info.get('stack', ['Generic']))}")
91
+ print(f"šŸ“Š Status: Active")
92
+
93
+ print("\nšŸ”§ Tech Stack:")
94
+ for tech in info.get('stack', []):
95
+ print(f" • {tech}")
96
+
97
+ print(f"\nāœ… Detected Modules/Features ({len(features)}):")
98
+ for feat in features:
99
+ print(f" • {feat}")
100
+ if not features:
101
+ print(" (No distinct feature modules detected)")
102
+
103
+ print(f"\nšŸ“„ Files: {stats['total']} total files tracked")
104
+ print("\n====================\n")
105
+
106
+ def main():
107
+ parser = argparse.ArgumentParser(description="Session Manager")
108
+ parser.add_argument("command", choices=["status", "info"], help="Command to run")
109
+ parser.add_argument("path", nargs="?", default=".", help="Project path")
110
+
111
+ args = parser.parse_args()
112
+ root = get_project_root(args.path)
113
+
114
+ if args.command == "status":
115
+ print_status(root)
116
+ elif args.command == "info":
117
+ print(json.dumps(analyze_package_json(root), indent=2))
118
+
119
+ if __name__ == "__main__":
120
+ main()
@@ -0,0 +1,127 @@
1
+
2
+ import sys
3
+ import os
4
+ import argparse
5
+ import re
6
+
7
+ def update_task_md(file_path: str, task_id: str):
8
+ """Updates the tabular status in task.md"""
9
+ if not os.path.exists(file_path):
10
+ return False
11
+
12
+ with open(file_path, 'r', encoding='utf-8') as f:
13
+ content = f.read()
14
+
15
+ lines = content.split('\n')
16
+ new_lines = []
17
+ updated = False
18
+
19
+ # Regex to match | 1 | or | 1.1 |
20
+ # Matches: pipe, space, id, space, pipe
21
+ # Using strict check for the ID column
22
+
23
+ for line in lines:
24
+ if line.strip().startswith('|'):
25
+ parts = [p.strip() for p in line.split('|')]
26
+ # parts[0] is empty (before first pipe), parts[1] is ID
27
+ if len(parts) > 2 and parts[1] == str(task_id):
28
+ # Found the row. Update last column (Status)
29
+ # Assuming standard 5-6 column layout.
30
+ # Let's rebuild the line carefully retaining structure if possible,
31
+ # or just replacing the last part.
32
+ # Easiest: Replace the last column content.
33
+ if "āœ… Complete" not in parts[-2]: # Check status column (ignoring empty last part)
34
+ # Reconstruct line: replace last segment
35
+ # This is brittle if columns change. Let's use simple logic: replace last pipe content
36
+ last_pipe_index = line.rfind('|')
37
+ second_last_pipe = line.rfind('|', 0, last_pipe_index)
38
+ if second_last_pipe != -1:
39
+ new_line = line[:second_last_pipe] + "| āœ… Complete |"
40
+ new_lines.append(new_line)
41
+ updated = True
42
+ continue
43
+ new_lines.append(line)
44
+
45
+ if updated:
46
+ with open(file_path, 'w', encoding='utf-8') as f:
47
+ f.write('\n'.join(new_lines))
48
+ print(f"āœ… Updated task.md for Task {task_id}")
49
+ return updated
50
+
51
+ def update_project_progress(file_path: str, task_id: str):
52
+ """Updates inline status in PROJECT-PROGRESS.md e.g. #1 -> #1 āœ…"""
53
+ if not os.path.exists(file_path):
54
+ print(f"āš ļø {file_path} not found.")
55
+ return False
56
+
57
+ with open(file_path, 'r', encoding='utf-8') as f:
58
+ content = f.read()
59
+
60
+ # Check if already marked
61
+ # Pattern: #{task_id} followed by check or āœ…
62
+ # Regex: #{task_id}(?![^|\n]*āœ…) - negative lookahead is tricky with other text
63
+
64
+ # Simple approach: Find "#{task_id}" not followed closely by "āœ…"
65
+ updated_content = content
66
+ pattern = rf"#{task_id}(?![:\s-]*āœ…)"
67
+
68
+ # If we find specifically "#{task_id}" and it doesn't have a check next to it
69
+ # We replace it with "#{task_id} āœ…"
70
+ # But wait, the format is "#1-#4...".
71
+ # If tasks are grouped "#1-#4", verifying individual task #2 is hard.
72
+ # However, sometimes they are listed individually.
73
+
74
+ # If found individual marker:
75
+ if re.search(rf"#{task_id}\b", content):
76
+ # Naive replacement: #{id} -> #{id} āœ…
77
+ # But we must avoid double checking
78
+ updated_content = re.sub(rf"(#{task_id})\b(?![:\s-]*āœ…)", r"\1 āœ…", content)
79
+
80
+ if updated_content != content:
81
+ with open(file_path, 'w', encoding='utf-8') as f:
82
+ f.write(updated_content)
83
+ print(f"āœ… Updated PROJECT-PROGRESS.md for Task {task_id}")
84
+ return True
85
+ else:
86
+ print(f"ā„¹ļø Task {task_id} not found or already marked in PROJECT-PROGRESS.md")
87
+ return False
88
+
89
+ def main():
90
+ parser = argparse.ArgumentParser(description="Automate Task Completion")
91
+ parser.add_argument("task_id", help="Task ID (e.g. 1)")
92
+ parser.add_argument("time_spent", help="Time spent (e.g. '1h')")
93
+ parser.add_argument("summary", help="Summary message")
94
+ parser.add_argument("--project-root", default=".", help="Project root directory")
95
+
96
+ args = parser.parse_args()
97
+
98
+ # Update local files
99
+ # 1. task.md (Artifact)
100
+ # The artifact might be in a variable path, but usually we know the relative path or it's in the brain dir.
101
+ # We will search for task.md in the current directory or standard paths.
102
+
103
+ # Since we are running from root, let's try to find task.md
104
+ task_md_path = None
105
+ # Search recursively for task.md? No, usually in .brain or docs or root
106
+ # For now, let's assume the user passes absolute path or we look in typical spots
107
+ # In this environment, task.md is in the ephemeral brain dir.
108
+ # We can try to find it using `fd` logic or just checking known artifact path provided in memory?
109
+ # Actually, the agent knows the path. But the script doesn't.
110
+ # Hack: Update the script to look into the 'brain' folder if it knows it, or just scan current dir and subdirs
111
+
112
+ # For PROJECT-PROGRESS.md it is in docs/
113
+ proj_progress_path = os.path.join(args.project_root, "docs", "PROJECT-PROGRESS.md")
114
+ update_project_progress(proj_progress_path, args.task_id)
115
+
116
+ # Output Instructions for Agent
117
+ print(f"\nšŸ“¢ ACTION REQUIRED: Run bridge.py to sync with Flyee")
118
+ print(f"----------------------------------------")
119
+ print(f"TASK ID: {args.task_id}")
120
+ print(f"TIME: {args.time_spent}")
121
+ print(f"SUMMARY: {args.summary}")
122
+ print(f"----------------------------------------")
123
+ print("Run: python3 .agent/flyee-bridge/bridge.py --update-task <flyee-id> --status completed --result success")
124
+ print("Then: update docs/INDEX.md if any documents were created during this task.")
125
+
126
+ if __name__ == "__main__":
127
+ main()