antigravity-ide 4.2.1 → 4.3.3

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 (359) hide show
  1. package/.agent/.shared/{design-philosophy → core/design-philosophy}/README.md +12 -1
  2. package/.agent/.shared/{ai-master → technical/ai-master}/README.md +12 -1
  3. package/.agent/.shared/{api-standards → technical/api-standards}/README.md +12 -1
  4. package/.agent/.shared/{database-master → technical/database-master}/README.md +12 -2
  5. package/.agent/.shared/{seo-master → technical/seo-master}/README.md +12 -1
  6. package/.agent/.shared/{ui-ux-pro-max → technical/ui-ux-pro-max}/README.md +12 -1
  7. package/.agent/ARCHITECTURE.md +16 -10
  8. package/.agent/ARCHITECTURE.vi.md +8 -8
  9. package/{GEMINI.md → .agent/GEMINI.md} +4 -5
  10. package/.agent/RESOURCES.md +6 -1
  11. package/.agent/agents/backend-specialist.md +154 -19
  12. package/.agent/agents/browser-subagent.md +45 -0
  13. package/.agent/agents/cloud-architect.md +108 -189
  14. package/.agent/agents/debugger.md +83 -182
  15. package/.agent/agents/documentation-writer.md +125 -72
  16. package/.agent/agents/frontend-specialist.md +40 -7
  17. package/.agent/agents/game-developer.md +111 -116
  18. package/.agent/agents/mobile-developer.md +108 -321
  19. package/.agent/agents/orchestrator.md +106 -366
  20. package/.agent/agents/performance-optimizer.md +105 -136
  21. package/.agent/agents/project-planner.md +132 -39
  22. package/.agent/agents/quality-inspector.md +136 -32
  23. package/.agent/agents/security-auditor.md +138 -15
  24. package/.agent/agents/seo-specialist.md +118 -72
  25. package/.agent/agents/test-engineer.md +142 -11
  26. package/.agent/brain/task.md +16 -0
  27. package/.agent/rules/GEMINI.md +63 -31
  28. package/.agent/rules/code-quality.md +34 -3
  29. package/.agent/rules/frontend.md +3 -3
  30. package/.agent/rules/strict-protocol.md +44 -3
  31. package/.agent/rules/system-update.md +56 -3
  32. package/.agent/skills/agent-backend-patterns/SKILL.md +16 -3
  33. package/.agent/skills/ai-engineer/SKILL.md +29 -16
  34. package/.agent/skills/api-documenter/SKILL.md +4 -4
  35. package/.agent/skills/app-builder/SKILL.md +1 -1
  36. package/.agent/skills/app-builder/tech-stack.md +2 -2
  37. package/.agent/skills/app-builder/templates/nextjs-fullstack/TEMPLATE.md +39 -79
  38. package/.agent/skills/app-builder/templates/nextjs-saas/TEMPLATE.md +53 -75
  39. package/.agent/skills/app-builder/templates/nextjs-static/TEMPLATE.md +56 -119
  40. package/.agent/skills/app-builder/templates/nuxt-app/TEMPLATE.md +61 -94
  41. package/.agent/skills/app-builder/templates/react-native-app/TEMPLATE.md +56 -82
  42. package/.agent/skills/brand-guidelines-anthropic/LICENSE.txt +202 -0
  43. package/.agent/skills/brand-guidelines-anthropic/SKILL.md +26 -0
  44. package/.agent/skills/brand-guidelines-anthropic/sub-skills/color-application.md +5 -0
  45. package/.agent/skills/brand-guidelines-anthropic/sub-skills/colors.md +14 -0
  46. package/.agent/skills/brand-guidelines-anthropic/sub-skills/font-management.md +6 -0
  47. package/.agent/skills/brand-guidelines-anthropic/sub-skills/shape-and-accent-colors.md +7 -0
  48. package/.agent/skills/brand-guidelines-anthropic/sub-skills/smart-font-application.md +6 -0
  49. package/.agent/skills/brand-guidelines-anthropic/sub-skills/text-styling.md +6 -0
  50. package/.agent/skills/brand-guidelines-anthropic/sub-skills/typography.md +7 -0
  51. package/.agent/skills/cloud-architect-master/SKILL.md +9 -4
  52. package/.agent/skills/cro-expert-kit/SKILL.md +9 -4
  53. package/.agent/skills/database-migration/SKILL.md +9 -3
  54. package/.agent/skills/deployment-engineer/SKILL.md +9 -3
  55. package/.agent/skills/frontend-design/ux-psychology.md +10 -585
  56. package/.agent/skills/full-stack-scaffold/SKILL.md +4 -4
  57. package/.agent/skills/game-development/2d-games/SKILL.md +4 -2
  58. package/.agent/skills/game-development/3d-games/SKILL.md +4 -2
  59. package/.agent/skills/game-development/SKILL.md +18 -149
  60. package/.agent/skills/game-development/game-art/SKILL.md +4 -2
  61. package/.agent/skills/game-development/game-audio/SKILL.md +4 -2
  62. package/.agent/skills/game-development/game-design/SKILL.md +4 -2
  63. package/.agent/skills/game-development/mobile-games/SKILL.md +4 -2
  64. package/.agent/skills/game-development/multiplayer/SKILL.md +4 -2
  65. package/.agent/skills/game-development/pc-games/SKILL.md +4 -2
  66. package/.agent/skills/game-development/vr-ar/SKILL.md +4 -2
  67. package/.agent/skills/game-development/web-games/SKILL.md +4 -2
  68. package/.agent/skills/geo-fundamentals/SKILL.md +9 -136
  69. package/.agent/skills/git-collaboration-master/SKILL.md +9 -4
  70. package/.agent/skills/i18n-localization/SKILL.md +10 -118
  71. package/.agent/skills/incident-responder/SKILL.md +9 -6
  72. package/.agent/skills/internal-comms-anthropic/LICENSE.txt +202 -0
  73. package/.agent/skills/internal-comms-anthropic/SKILL.md +33 -0
  74. package/.agent/skills/internal-comms-anthropic/examples/3p-updates.md +47 -0
  75. package/.agent/skills/internal-comms-anthropic/examples/company-newsletter.md +65 -0
  76. package/.agent/skills/internal-comms-anthropic/examples/faq-answers.md +30 -0
  77. package/.agent/skills/internal-comms-anthropic/examples/general-comms.md +16 -0
  78. package/.agent/skills/last30days/tests/__init__.py +1 -0
  79. package/.agent/skills/last30days/tests/test_cache.py +59 -0
  80. package/.agent/skills/last30days/tests/test_dates.py +114 -0
  81. package/.agent/skills/last30days/tests/test_dedupe.py +111 -0
  82. package/.agent/skills/last30days/tests/test_models.py +135 -0
  83. package/.agent/skills/last30days/tests/test_normalize.py +138 -0
  84. package/.agent/skills/last30days/tests/test_render.py +116 -0
  85. package/.agent/skills/last30days/tests/test_score.py +168 -0
  86. package/.agent/skills/legacy-modernizer/SKILL.md +9 -4
  87. package/.agent/skills/lint-and-validate/scripts/lint_runner.py +2 -14
  88. package/.agent/skills/loki-mode/.github/workflows/claude-code-review.yml +57 -0
  89. package/.agent/skills/loki-mode/.github/workflows/claude.yml +50 -0
  90. package/.agent/skills/loki-mode/.github/workflows/release.yml +128 -0
  91. package/.agent/skills/loki-mode/tests/run-all-tests.sh +78 -0
  92. package/.agent/skills/loki-mode/tests/test-agent-timeout.sh +348 -0
  93. package/.agent/skills/loki-mode/tests/test-bootstrap.sh +196 -0
  94. package/.agent/skills/loki-mode/tests/test-circuit-breaker.sh +389 -0
  95. package/.agent/skills/loki-mode/tests/test-state-recovery.sh +393 -0
  96. package/.agent/skills/loki-mode/tests/test-task-queue.sh +396 -0
  97. package/.agent/skills/loki-mode/tests/test-wrapper.sh +314 -0
  98. package/.agent/skills/mcp-builder/SKILL.md +21 -164
  99. package/.agent/skills/mobile-design/SKILL.md +21 -369
  100. package/.agent/skills/mobile-design/mobile-performance.md +1 -1
  101. package/.agent/skills/modern-web-architect/SKILL.md +12 -6
  102. package/.agent/skills/nextjs-react-expert/scripts/convert_rules.py +1 -1
  103. package/.agent/skills/penetration-tester-master/SKILL.md +9 -4
  104. package/.agent/skills/performance-engineer/SKILL.md +4 -5
  105. package/.agent/skills/production-code-audit/SKILL.md +6 -0
  106. package/.agent/skills/rust-pro/SKILL.md +0 -177
  107. package/.agent/skills/security-auditor/SKILL.md +35 -27
  108. package/.agent/skills/seo-expert-kit/SKILL.md +9 -4
  109. package/.agent/skills/shopify-development/scripts/tests/test_shopify_init.py +379 -0
  110. package/.agent/skills/tdd-master-workflow/SKILL.md +9 -3
  111. package/.agent/workflows/audit.md +30 -16
  112. package/.agent/workflows/brainstorm.md +33 -96
  113. package/.agent/workflows/create.md +37 -45
  114. package/.agent/workflows/debug.md +45 -84
  115. package/.agent/workflows/deploy.md +33 -158
  116. package/.agent/workflows/document.md +38 -15
  117. package/.agent/workflows/enhance.md +33 -48
  118. package/.agent/workflows/monitor.md +35 -14
  119. package/.agent/workflows/orchestrate.md +33 -218
  120. package/.agent/workflows/plan.md +39 -70
  121. package/.agent/workflows/security.md +35 -14
  122. package/.agent/workflows/seo.md +39 -16
  123. package/.agent/workflows/status.md +33 -72
  124. package/.agent/workflows/test.md +30 -127
  125. package/.agent/workflows/ui-ux-pro-max.md +24 -283
  126. package/LICENSE +22 -8
  127. package/README.md +105 -72
  128. package/README.vi.md +93 -110
  129. package/cli/create.js +275 -413
  130. package/cli/index.js +36 -24
  131. package/cli/lib/auto-update.js +14 -21
  132. package/cli/logic/product-skills.js +58 -0
  133. package/cli/logic/skill-definitions.js +0 -39
  134. package/cli/prompts.js +151 -145
  135. package/cli/skills/browser-subagent-core/SKILL.md +22 -0
  136. package/cli/tools/browser.js +75 -0
  137. package/cli/ui/dashboard.js +48 -0
  138. package/docs/AGENTS_GUIDE.vi.md +39 -45
  139. package/docs/CONTRIBUTING.vi.md +12 -3
  140. package/docs/{GEMINI_GUIDE.md → GEMINI_USAGE.md} +6 -6
  141. package/docs/GLOSSARY.vi.md +49 -30
  142. package/docs/HOW_ANTIGRAVITY_THINKS.vi.md +1 -1
  143. package/docs/OPERATIONAL_FLOW.vi.md +15 -0
  144. package/docs/{PUBLISHING.md → PUBLISHING_GUIDE.md} +31 -3
  145. package/docs/RULES_GUIDE.vi.md +67 -31
  146. package/docs/SHARED_LIBRARY_GUIDE.vi.md +18 -22
  147. package/docs/SKILLS_GUIDE.vi.md +119 -32
  148. package/docs/TROUBLESHOOTING.vi.md +10 -2
  149. package/docs/WORKFLOW_GUIDE.vi.md +57 -9
  150. package/package.json +32 -8
  151. package/setup.js +147 -114
  152. package/.agent/.shared/compliance/README.md +0 -19
  153. package/.agent/.shared/design-system/README.md +0 -18
  154. package/.agent/.shared/domain-blueprints/README.md +0 -18
  155. package/.agent/.shared/dx-toolkit/README.md +0 -19
  156. package/.agent/.shared/i18n-master/README.md +0 -18
  157. package/.agent/.shared/infra-blueprints/README.md +0 -18
  158. package/.agent/.shared/metrics/README.md +0 -17
  159. package/.agent/.shared/resilience-patterns/README.md +0 -19
  160. package/.agent/.shared/security-armor/README.md +0 -25
  161. package/.agent/.shared/testing-master/README.md +0 -20
  162. package/.agent/.shared/vitals-templates/README.md +0 -18
  163. package/.agent/agents/accessibility-expert.md +0 -22
  164. package/.agent/agents/api-architect.md +0 -22
  165. package/.agent/agents/backend-specialist.eco.md +0 -19
  166. package/.agent/agents/backend-specialist.instant.md +0 -19
  167. package/.agent/agents/codebase-expert.md +0 -23
  168. package/.agent/agents/compliance-expert.md +0 -22
  169. package/.agent/agents/data-scientist.md +0 -22
  170. package/.agent/agents/debugger.eco.md +0 -20
  171. package/.agent/agents/debugger.instant.md +0 -20
  172. package/.agent/agents/deep-thinker.ultra.md +0 -23
  173. package/.agent/agents/devex-optimizer.md +0 -22
  174. package/.agent/agents/devops-architect.md +0 -22
  175. package/.agent/agents/frontend-specialist.eco.md +0 -19
  176. package/.agent/agents/frontend-specialist.instant.md +0 -19
  177. package/.agent/agents/growth-engineer.md +0 -22
  178. package/.agent/agents/i18n-specialist.md +0 -21
  179. package/.agent/agents/legacy-modernizer.md +0 -22
  180. package/.agent/agents/microservices-specialist.md +0 -22
  181. package/.agent/agents/motion-designer.md +0 -22
  182. package/.agent/agents/orchestrator.creative.md +0 -28
  183. package/.agent/agents/orchestrator.eco.md +0 -29
  184. package/.agent/agents/orchestrator.instant.md +0 -29
  185. package/.agent/agents/orchestrator.ultra.md +0 -28
  186. package/.agent/agents/performance-benchmarker.md +0 -22
  187. package/.agent/agents/project-planner.eco.md +0 -19
  188. package/.agent/agents/project-planner.instant.md +0 -19
  189. package/.agent/agents/security-pentester.md +0 -22
  190. package/.agent/agents/serverless-expert.md +0 -22
  191. package/.agent/fastcode_index.json +0 -1038
  192. package/.agent/mcp_config.json +0 -24
  193. package/.agent/rules/GEMINI.eco.md +0 -37
  194. package/.agent/rules/GEMINI.instant.md +0 -37
  195. package/.agent/rules/api-spec.md +0 -28
  196. package/.agent/rules/database.md +0 -24
  197. package/.agent/rules/devops.md +0 -23
  198. package/.agent/rules/growth-strategy.md +0 -22
  199. package/.agent/rules/logging-monitoring.md +0 -22
  200. package/.agent/rules/quality-assurance.md +0 -22
  201. package/.agent/rules/system-reasoning.md +0 -20
  202. package/.agent/rules/ui-design.md +0 -23
  203. package/.agent/rules/ux-patterns.md +0 -23
  204. package/.agent/scripts/auto_preview.py +0 -148
  205. package/.agent/scripts/checklist.py +0 -252
  206. package/.agent/scripts/session_manager.py +0 -120
  207. package/.agent/scripts/simulation_install.js +0 -59
  208. package/.agent/scripts/sync_to_global.py +0 -78
  209. package/.agent/scripts/translate_workflows.py +0 -53
  210. package/.agent/scripts/verify_all.py +0 -327
  211. package/.agent/scripts/verify_shared_modules.js +0 -126
  212. package/.agent/skills/fastcode-search/SKILL.md +0 -46
  213. package/.agent/skills/fastcode-search/fastcode_config.example.json +0 -17
  214. package/.agent/skills/frontend-trends-2026/SKILL.md +0 -78
  215. package/.agent/skills/frontend-trends-2026/formulas/BentoGrid.tsx +0 -42
  216. package/.agent/skills/frontend-trends-2026/formulas/LiquidCard.tsx +0 -32
  217. package/.agent/skills/frontend-trends-2026/formulas/NeoButton.tsx +0 -27
  218. package/.agent/workflows/deep-security-audit.md +0 -9
  219. package/.agent/workflows/growth-max.md +0 -9
  220. package/.agent/workflows/performance-max.md +0 -9
  221. package/.editorconfig +0 -21
  222. package/.gitattributes +0 -7
  223. package/CHANGELOG.md +0 -32
  224. package/ERRORS.md +0 -67
  225. package/action.yml +0 -32
  226. package/antigravity-ide-logo.png +0 -0
  227. package/antigravity-ide-logo.svg +0 -24
  228. package/assets/skills-bundle.json +0 -1
  229. package/cli/manifest.js +0 -524
  230. package/cli/skills/fastcode.js +0 -181
  231. package/docs/AGENT_FLOW.md +0 -608
  232. package/docs/CONTRIBUTING.md +0 -46
  233. package/docs/COPYRIGHT.md +0 -57
  234. package/docs/DEPLOYMENT.md +0 -77
  235. package/docs/GLOSSARY.md +0 -109
  236. package/docs/MASTER_GUIDE.md +0 -103
  237. package/docs/OPERATIONAL_FLOW.md +0 -147
  238. package/docs/PLAN-upgrade-core-architecture.md +0 -71
  239. package/docs/SKILLS.md +0 -610
  240. package/docs/TROUBLESHOOTING.md +0 -43
  241. package/jest.config.js +0 -8
  242. package/scripts/bump.js +0 -93
  243. package/scripts/bundle-skills.js +0 -59
  244. package/scripts/internal/automation/auto-release.js +0 -177
  245. package/scripts/internal/fractalize-skills.js +0 -89
  246. package/scripts/internal/generate-skill-definitions.js +0 -134
  247. package/scripts/internal/internal/update-docs.js +0 -115
  248. package/scripts/internal/refactor-skill-content.js +0 -127
  249. package/scripts/internal/rename-skills.js +0 -96
  250. package/scripts/internal/sync-skills.js +0 -112
  251. package/scripts/internal/update-frontmatter-names.js +0 -99
  252. package/scripts/internal/verification/audit-dna.js +0 -56
  253. package/scripts/internal/verification/audit-skills.js +0 -65
  254. package/web/src/app/docs/guide/examples/brainstorm/page.mdx +0 -91
  255. package/web/src/app/docs/guide/examples/create/page.mdx +0 -84
  256. package/web/src/app/docs/guide/examples/debugging/page.mdx +0 -83
  257. package/web/src/app/docs/guide/examples/deployment/page.mdx +0 -93
  258. package/web/src/app/docs/guide/examples/new-feature/page.mdx +0 -102
  259. package/web/src/app/docs/guide/examples/orchestration/page.mdx +0 -99
  260. package/web/src/app/docs/guide/examples/plan/page.mdx +0 -76
  261. package/web/src/app/docs/guide/examples/preview/page.mdx +0 -77
  262. package/web/src/app/docs/guide/examples/status/page.mdx +0 -78
  263. package/web/src/app/docs/guide/examples/test/page.mdx +0 -80
  264. package/web/src/app/docs/guide/examples/ui-design/page.mdx +0 -90
  265. package/web/src/components/mdx/Callout.tsx +0 -60
  266. package/web/src/components/mdx/FeatureGrid.tsx +0 -38
  267. package/web/src/components/mdx/ProTips.tsx +0 -29
  268. package/web/src/components/mdx/StepList.tsx +0 -33
  269. package/web/src/components/mdx/Terminal.tsx +0 -58
  270. package/web/src/components/mdx/index.ts +0 -5
  271. package/web/src/mdx-components.tsx +0 -98
  272. /package/.agent/.shared/{design-philosophy → core/design-philosophy}/MANIFESTO.md +0 -0
  273. /package/.agent/.shared/{design-philosophy → core/design-philosophy}/checklists/tactile_audit.md +0 -0
  274. /package/.agent/.shared/{design-philosophy → core/design-philosophy}/checklists/visual_audit.md +0 -0
  275. /package/.agent/.shared/{design-philosophy → core/design-philosophy}/presets/linear_glow.json +0 -0
  276. /package/.agent/.shared/{dx-toolkit → core/dx-toolkit}/checklists/code_review.md +0 -0
  277. /package/.agent/.shared/{dx-toolkit → core/dx-toolkit}/presets/vscode_settings.json +0 -0
  278. /package/.agent/.shared/{metrics → core/metrics}/benchmarks.json +0 -0
  279. /package/.agent/.shared/{vitals-templates → core/vitals-templates}/audit_report.md +0 -0
  280. /package/.agent/.shared/{vitals-templates → core/vitals-templates}/plan_prd.md +0 -0
  281. /package/.agent/.shared/{ai-master → technical/ai-master}/best_patterns.md +0 -0
  282. /package/.agent/.shared/{ai-master → technical/ai-master}/checklists/prompt_audit.md +0 -0
  283. /package/.agent/.shared/{ai-master → technical/ai-master}/presets/model_configs.json +0 -0
  284. /package/.agent/.shared/{api-standards → technical/api-standards}/data +0 -0
  285. /package/.agent/.shared/{api-standards → technical/api-standards}/endpoints_naming.md +0 -0
  286. /package/.agent/.shared/{api-standards → technical/api-standards}/error_codes.csv +0 -0
  287. /package/.agent/.shared/{api-standards → technical/api-standards}/pagination_sorting.md +0 -0
  288. /package/.agent/.shared/{api-standards → technical/api-standards}/response_format.json +0 -0
  289. /package/.agent/.shared/{database-master → technical/database-master}/schemas/auth_rbac.sql +0 -0
  290. /package/.agent/.shared/{database-master → technical/database-master}/schemas/cms.sql +0 -0
  291. /package/.agent/.shared/{database-master → technical/database-master}/schemas/ecommerce.sql +0 -0
  292. /package/.agent/.shared/{design-system → technical/design-system}/brand_presets.json +0 -0
  293. /package/.agent/.shared/{design-system → technical/design-system}/micro_interactions.md +0 -0
  294. /package/.agent/.shared/{i18n-master → technical/i18n-master}/vi_tech_dictionary.csv +0 -0
  295. /package/.agent/.shared/{i18n-master → technical/i18n-master}/workflows.json +0 -0
  296. /package/.agent/.shared/{resilience-patterns → technical/resilience-patterns}/checklists/chaos_engineering.md +0 -0
  297. /package/.agent/.shared/{resilience-patterns → technical/resilience-patterns}/presets/circuit_breaker.json +0 -0
  298. /package/.agent/.shared/{security-armor → technical/security-armor}/checklists/vuln_scan.md +0 -0
  299. /package/.agent/.shared/{security-armor → technical/security-armor}/hardening.md +0 -0
  300. /package/.agent/.shared/{security-armor → technical/security-armor}/presets/helmet_config.json +0 -0
  301. /package/.agent/.shared/{seo-master → technical/seo-master}/checklists/technical_seo.md +0 -0
  302. /package/.agent/.shared/{seo-master → technical/seo-master}/presets/json_ld_schema.json +0 -0
  303. /package/.agent/.shared/{testing-master → technical/testing-master}/checklists/pre_release.md +0 -0
  304. /package/.agent/.shared/{testing-master → technical/testing-master}/scenarios.md +0 -0
  305. /package/.agent/.shared/{ui-ux-pro-max → technical/ui-ux-pro-max}/data/colors.csv +0 -0
  306. /package/.agent/.shared/{ui-ux-pro-max → technical/ui-ux-pro-max}/data/icons.csv +0 -0
  307. /package/.agent/.shared/{ui-ux-pro-max → technical/ui-ux-pro-max}/data/landing.csv +0 -0
  308. /package/.agent/.shared/{ui-ux-pro-max → technical/ui-ux-pro-max}/data/products.csv +0 -0
  309. /package/.agent/.shared/{ui-ux-pro-max → technical/ui-ux-pro-max}/data/react-performance.csv +0 -0
  310. /package/.agent/.shared/{ui-ux-pro-max → technical/ui-ux-pro-max}/data/stacks/flutter.csv +0 -0
  311. /package/.agent/.shared/{ui-ux-pro-max → technical/ui-ux-pro-max}/data/stacks/html-tailwind.csv +0 -0
  312. /package/.agent/.shared/{ui-ux-pro-max → technical/ui-ux-pro-max}/data/stacks/jetpack-compose.csv +0 -0
  313. /package/.agent/.shared/{ui-ux-pro-max → technical/ui-ux-pro-max}/data/stacks/nextjs.csv +0 -0
  314. /package/.agent/.shared/{ui-ux-pro-max → technical/ui-ux-pro-max}/data/stacks/nuxt-ui.csv +0 -0
  315. /package/.agent/.shared/{ui-ux-pro-max → technical/ui-ux-pro-max}/data/stacks/nuxtjs.csv +0 -0
  316. /package/.agent/.shared/{ui-ux-pro-max → technical/ui-ux-pro-max}/data/stacks/react-native.csv +0 -0
  317. /package/.agent/.shared/{ui-ux-pro-max → technical/ui-ux-pro-max}/data/stacks/react.csv +0 -0
  318. /package/.agent/.shared/{ui-ux-pro-max → technical/ui-ux-pro-max}/data/stacks/shadcn.csv +0 -0
  319. /package/.agent/.shared/{ui-ux-pro-max → technical/ui-ux-pro-max}/data/stacks/svelte.csv +0 -0
  320. /package/.agent/.shared/{ui-ux-pro-max → technical/ui-ux-pro-max}/data/stacks/swiftui.csv +0 -0
  321. /package/.agent/.shared/{ui-ux-pro-max → technical/ui-ux-pro-max}/data/stacks/vue.csv +0 -0
  322. /package/.agent/.shared/{ui-ux-pro-max → technical/ui-ux-pro-max}/data/ux-guidelines.csv +0 -0
  323. /package/.agent/.shared/{ui-ux-pro-max → technical/ui-ux-pro-max}/data/web-interface.csv +0 -0
  324. /package/.agent/.shared/{ui-ux-pro-max → technical/ui-ux-pro-max}/scripts/__pycache__/core.cpython-313.pyc +0 -0
  325. /package/.agent/.shared/{ui-ux-pro-max → technical/ui-ux-pro-max}/scripts/__pycache__/design_system.cpython-313.pyc +0 -0
  326. /package/.agent/.shared/{ui-ux-pro-max → technical/ui-ux-pro-max}/scripts/core.py +0 -0
  327. /package/.agent/.shared/{ui-ux-pro-max → technical/ui-ux-pro-max}/scripts/design_system.py +0 -0
  328. /package/.agent/.shared/{ui-ux-pro-max → technical/ui-ux-pro-max}/scripts/search.py +0 -0
  329. /package/.agent/.shared/{compliance → verticals/compliance}/legal_templates.md +0 -0
  330. /package/.agent/.shared/{domain-blueprints → verticals/domain-blueprints}/edtech.md +0 -0
  331. /package/.agent/.shared/{domain-blueprints → verticals/domain-blueprints}/fintech.md +0 -0
  332. /package/.agent/.shared/{domain-blueprints → verticals/domain-blueprints}/fnb_restaurant.md +0 -0
  333. /package/.agent/.shared/{domain-blueprints → verticals/domain-blueprints}/freelance_marketplace.md +0 -0
  334. /package/.agent/.shared/{domain-blueprints → verticals/domain-blueprints}/healthcare.md +0 -0
  335. /package/.agent/.shared/{domain-blueprints → verticals/domain-blueprints}/hospitality_tourism.md +0 -0
  336. /package/.agent/.shared/{domain-blueprints → verticals/domain-blueprints}/logistics.md +0 -0
  337. /package/.agent/.shared/{domain-blueprints → verticals/domain-blueprints}/marketing_automation.md +0 -0
  338. /package/.agent/.shared/{domain-blueprints → verticals/domain-blueprints}/personal_branding.md +0 -0
  339. /package/.agent/.shared/{domain-blueprints → verticals/domain-blueprints}/real_estate.md +0 -0
  340. /package/.agent/.shared/{domain-blueprints → verticals/domain-blueprints}/retail_ecommerce.md +0 -0
  341. /package/.agent/.shared/{domain-blueprints → verticals/domain-blueprints}/standard-pro-agents.md +0 -0
  342. /package/.agent/.shared/{infra-blueprints → verticals/infra-blueprints}/deployment_specs.md +0 -0
  343. /package/.agent/skills/ai-engineer/{resources → sub-skills}/ai_infra_stack.md +0 -0
  344. /package/.agent/skills/cloud-architect-master/{resources → sub-skills}/cost_optimization_checklist.md +0 -0
  345. /package/.agent/skills/cro-expert-kit/{resources → sub-skills}/psychological_triggers.md +0 -0
  346. /package/.agent/skills/database-migration/{resources → sub-skills}/zero_downtime_strategy.md +0 -0
  347. /package/.agent/skills/deployment-engineer/{resources → sub-skills}/k8s_best_practices.md +0 -0
  348. /package/.agent/skills/git-collaboration-master/{resources → sub-skills}/pr_template.md +0 -0
  349. /package/.agent/skills/incident-responder/{resources → sub-skills}/incident_severity_levels.md +0 -0
  350. /package/.agent/skills/legacy-modernizer/{resources → sub-skills}/strangler_fig_pattern.md +0 -0
  351. /package/.agent/skills/penetration-tester-master/{resources → sub-skills}/owasp_top_10_2025.md +0 -0
  352. /package/.agent/skills/production-code-audit/{resources → sub-skills}/solid_principles_cheat_sheet.md +0 -0
  353. /package/.agent/skills/seo-expert-kit/{resources → sub-skills}/technical_seo_checklist.md +0 -0
  354. /package/.agent/skills/tdd-master-workflow/{resources → sub-skills}/unit_test_naming_convention.md +0 -0
  355. /package/.agent/{.shared → skills}/ui-ux-pro-max/data/charts.csv +0 -0
  356. /package/.agent/{.shared → skills}/ui-ux-pro-max/data/prompts.csv +0 -0
  357. /package/.agent/{.shared → skills}/ui-ux-pro-max/data/styles.csv +0 -0
  358. /package/.agent/{.shared → skills}/ui-ux-pro-max/data/typography.csv +0 -0
  359. /package/.agent/{.shared → skills}/ui-ux-pro-max/data/ui-reasoning.csv +0 -0
@@ -14,8 +14,6 @@ Supports:
14
14
  import subprocess
15
15
  import sys
16
16
  import json
17
- import platform
18
- import shutil
19
17
  from pathlib import Path
20
18
  from datetime import datetime
21
19
 
@@ -79,24 +77,14 @@ def run_linter(linter: dict, cwd: Path) -> dict:
79
77
  }
80
78
 
81
79
  try:
82
- cmd = linter["cmd"]
83
-
84
- # Windows compatibility for npm/npx
85
- if platform.system() == "Windows":
86
- if cmd[0] in ["npm", "npx"]:
87
- # Force .cmd extension on Windows
88
- if not cmd[0].lower().endswith(".cmd"):
89
- cmd[0] = f"{cmd[0]}.cmd"
90
-
91
80
  proc = subprocess.run(
92
- cmd,
81
+ linter["cmd"],
93
82
  cwd=str(cwd),
94
83
  capture_output=True,
95
84
  text=True,
96
85
  encoding='utf-8',
97
86
  errors='replace',
98
- timeout=120,
99
- shell=platform.system() == "Windows" # Shell=True often helps with path resolution on Windows
87
+ timeout=120
100
88
  )
101
89
 
102
90
  result["output"] = proc.stdout[:2000] if proc.stdout else ""
@@ -0,0 +1,57 @@
1
+ name: Claude Code Review
2
+
3
+ on:
4
+ pull_request:
5
+ types: [opened, synchronize]
6
+ # Optional: Only run on specific file changes
7
+ # paths:
8
+ # - "src/**/*.ts"
9
+ # - "src/**/*.tsx"
10
+ # - "src/**/*.js"
11
+ # - "src/**/*.jsx"
12
+
13
+ jobs:
14
+ claude-review:
15
+ # Optional: Filter by PR author
16
+ # if: |
17
+ # github.event.pull_request.user.login == 'external-contributor' ||
18
+ # github.event.pull_request.user.login == 'new-developer' ||
19
+ # github.event.pull_request.author_association == 'FIRST_TIME_CONTRIBUTOR'
20
+
21
+ runs-on: ubuntu-latest
22
+ permissions:
23
+ contents: read
24
+ pull-requests: read
25
+ issues: read
26
+ id-token: write
27
+
28
+ steps:
29
+ - name: Checkout repository
30
+ uses: actions/checkout@v4
31
+ with:
32
+ fetch-depth: 1
33
+
34
+ - name: Run Claude Code Review
35
+ id: claude-review
36
+ uses: anthropics/claude-code-action@v1
37
+ with:
38
+ claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }}
39
+ prompt: |
40
+ REPO: ${{ github.repository }}
41
+ PR NUMBER: ${{ github.event.pull_request.number }}
42
+
43
+ Please review this pull request and provide feedback on:
44
+ - Code quality and best practices
45
+ - Potential bugs or issues
46
+ - Performance considerations
47
+ - Security concerns
48
+ - Test coverage
49
+
50
+ Use the repository's CLAUDE.md for guidance on style and conventions. Be constructive and helpful in your feedback.
51
+
52
+ Use `gh pr comment` with your Bash tool to leave your review as a comment on the PR.
53
+
54
+ # See https://github.com/anthropics/claude-code-action/blob/main/docs/usage.md
55
+ # or https://code.claude.com/docs/en/cli-reference for available options
56
+ claude_args: '--allowed-tools "Bash(gh issue view:*),Bash(gh search:*),Bash(gh issue list:*),Bash(gh pr comment:*),Bash(gh pr diff:*),Bash(gh pr view:*),Bash(gh pr list:*)"'
57
+
@@ -0,0 +1,50 @@
1
+ name: Claude Code
2
+
3
+ on:
4
+ issue_comment:
5
+ types: [created]
6
+ pull_request_review_comment:
7
+ types: [created]
8
+ issues:
9
+ types: [opened, assigned]
10
+ pull_request_review:
11
+ types: [submitted]
12
+
13
+ jobs:
14
+ claude:
15
+ if: |
16
+ (github.event_name == 'issue_comment' && contains(github.event.comment.body, '@claude')) ||
17
+ (github.event_name == 'pull_request_review_comment' && contains(github.event.comment.body, '@claude')) ||
18
+ (github.event_name == 'pull_request_review' && contains(github.event.review.body, '@claude')) ||
19
+ (github.event_name == 'issues' && (contains(github.event.issue.body, '@claude') || contains(github.event.issue.title, '@claude')))
20
+ runs-on: ubuntu-latest
21
+ permissions:
22
+ contents: read
23
+ pull-requests: read
24
+ issues: read
25
+ id-token: write
26
+ actions: read # Required for Claude to read CI results on PRs
27
+ steps:
28
+ - name: Checkout repository
29
+ uses: actions/checkout@v4
30
+ with:
31
+ fetch-depth: 1
32
+
33
+ - name: Run Claude Code
34
+ id: claude
35
+ uses: anthropics/claude-code-action@v1
36
+ with:
37
+ claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }}
38
+
39
+ # This is an optional setting that allows Claude to read CI results on PRs
40
+ additional_permissions: |
41
+ actions: read
42
+
43
+ # Optional: Give a custom prompt to Claude. If this is not specified, Claude will perform the instructions specified in the comment that tagged it.
44
+ # prompt: 'Update the pull request description to include a summary of changes.'
45
+
46
+ # Optional: Add claude_args to customize behavior and configuration
47
+ # See https://github.com/anthropics/claude-code-action/blob/main/docs/usage.md
48
+ # or https://code.claude.com/docs/en/cli-reference for available options
49
+ # claude_args: '--allowed-tools Bash(gh pr:*)'
50
+
@@ -0,0 +1,128 @@
1
+ name: Release
2
+
3
+ on:
4
+ push:
5
+ paths:
6
+ - 'VERSION'
7
+ branches:
8
+ - main
9
+
10
+ jobs:
11
+ release:
12
+ runs-on: ubuntu-latest
13
+ permissions:
14
+ contents: write
15
+
16
+ steps:
17
+ - name: Checkout code
18
+ uses: actions/checkout@v4
19
+ with:
20
+ fetch-depth: 0
21
+
22
+ - name: Read version
23
+ id: version
24
+ run: |
25
+ VERSION=$(cat VERSION | tr -d '\n')
26
+ echo "version=$VERSION" >> $GITHUB_OUTPUT
27
+ echo "tag=v$VERSION" >> $GITHUB_OUTPUT
28
+
29
+ - name: Check if tag exists
30
+ id: check_tag
31
+ run: |
32
+ if git rev-parse "v${{ steps.version.outputs.version }}" >/dev/null 2>&1; then
33
+ echo "exists=true" >> $GITHUB_OUTPUT
34
+ else
35
+ echo "exists=false" >> $GITHUB_OUTPUT
36
+ fi
37
+
38
+ - name: Create release artifacts
39
+ if: steps.check_tag.outputs.exists == 'false'
40
+ run: |
41
+ mkdir -p release
42
+
43
+ # ============================================
44
+ # Artifact 1: loki-mode.zip (for Claude.ai website)
45
+ # SKILL.md at ROOT level for direct upload
46
+ # ============================================
47
+ mkdir -p release/skill-root
48
+ cp SKILL.md release/skill-root/
49
+ cp -r references release/skill-root/
50
+
51
+ cd release/skill-root
52
+ zip -r ../loki-mode-${{ steps.version.outputs.version }}.zip .
53
+ cd ../..
54
+
55
+ # Also create .skill file (same as zip, different extension)
56
+ cp release/loki-mode-${{ steps.version.outputs.version }}.zip release/loki-mode-${{ steps.version.outputs.version }}.skill
57
+
58
+ # ============================================
59
+ # Artifact 2: loki-mode-api.zip (for console.anthropic.com)
60
+ # SKILL.md inside loki-mode/ folder (API requires folder wrapper)
61
+ # ============================================
62
+ mkdir -p release/api-package/loki-mode
63
+ cp SKILL.md release/api-package/loki-mode/
64
+ cp -r references release/api-package/loki-mode/
65
+
66
+ cd release/api-package
67
+ zip -r ../loki-mode-api-${{ steps.version.outputs.version }}.zip loki-mode
68
+ cd ../..
69
+
70
+ # ============================================
71
+ # Artifact 3: loki-mode-claude-code.zip
72
+ # For Claude Code: full package with loki-mode/ folder
73
+ # Extract to ~/.claude/skills/
74
+ # ============================================
75
+ mkdir -p release/loki-mode
76
+ cp SKILL.md release/loki-mode/
77
+ cp README.md release/loki-mode/
78
+ cp LICENSE release/loki-mode/ 2>/dev/null || true
79
+ cp VERSION release/loki-mode/
80
+ cp CHANGELOG.md release/loki-mode/
81
+ cp -r references release/loki-mode/
82
+ cp -r examples release/loki-mode/
83
+ cp -r tests release/loki-mode/
84
+ cp -r scripts release/loki-mode/
85
+ cp -r autonomy release/loki-mode/
86
+
87
+ cd release
88
+ zip -r loki-mode-claude-code-${{ steps.version.outputs.version }}.zip loki-mode
89
+ tar -czvf loki-mode-claude-code-${{ steps.version.outputs.version }}.tar.gz loki-mode
90
+ cd ..
91
+
92
+ - name: Create Git Tag
93
+ if: steps.check_tag.outputs.exists == 'false'
94
+ run: |
95
+ git config user.name "github-actions[bot]"
96
+ git config user.email "github-actions[bot]@users.noreply.github.com"
97
+ git tag -a "v${{ steps.version.outputs.version }}" -m "Release v${{ steps.version.outputs.version }}"
98
+ git push origin "v${{ steps.version.outputs.version }}"
99
+
100
+ - name: Extract changelog for this version
101
+ if: steps.check_tag.outputs.exists == 'false'
102
+ id: changelog
103
+ run: |
104
+ VERSION="${{ steps.version.outputs.version }}"
105
+ CHANGELOG=$(awk "/^## \[$VERSION\]/{flag=1; next} /^## \[/{flag=0} flag" CHANGELOG.md)
106
+ if [ -z "$CHANGELOG" ]; then
107
+ CHANGELOG="Release v$VERSION"
108
+ fi
109
+ echo "$CHANGELOG" > changelog_body.txt
110
+
111
+ - name: Create GitHub Release
112
+ if: steps.check_tag.outputs.exists == 'false'
113
+ env:
114
+ GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
115
+ run: |
116
+ gh release create "v${{ steps.version.outputs.version }}" \
117
+ release/loki-mode-${{ steps.version.outputs.version }}.zip \
118
+ release/loki-mode-${{ steps.version.outputs.version }}.skill \
119
+ release/loki-mode-api-${{ steps.version.outputs.version }}.zip \
120
+ release/loki-mode-claude-code-${{ steps.version.outputs.version }}.zip \
121
+ release/loki-mode-claude-code-${{ steps.version.outputs.version }}.tar.gz \
122
+ --title "Loki Mode v${{ steps.version.outputs.version }}" \
123
+ --notes-file changelog_body.txt
124
+
125
+ - name: Skip message
126
+ if: steps.check_tag.outputs.exists == 'true'
127
+ run: |
128
+ echo "Tag v${{ steps.version.outputs.version }} already exists. Skipping release."
@@ -0,0 +1,78 @@
1
+ #!/bin/bash
2
+ # Loki Mode Test Suite Runner
3
+ # Runs all test cases for the Loki Mode skill
4
+
5
+ set -euo pipefail
6
+
7
+ SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
8
+ TOTAL_PASSED=0
9
+ TOTAL_FAILED=0
10
+ TESTS_RUN=0
11
+
12
+ # Colors
13
+ RED='\033[0;31m'
14
+ GREEN='\033[0;32m'
15
+ YELLOW='\033[1;33m'
16
+ BLUE='\033[0;34m'
17
+ NC='\033[0m'
18
+
19
+ echo ""
20
+ echo -e "${BLUE}╔════════════════════════════════════════════════════════════════╗${NC}"
21
+ echo -e "${BLUE}║ LOKI MODE - COMPREHENSIVE TEST SUITE ║${NC}"
22
+ echo -e "${BLUE}╚════════════════════════════════════════════════════════════════╝${NC}"
23
+ echo ""
24
+
25
+ run_test() {
26
+ local test_name="$1"
27
+ local test_file="$2"
28
+
29
+ echo -e "${YELLOW}┌────────────────────────────────────────────────────────────────┐${NC}"
30
+ echo -e "${YELLOW}│ Running: ${test_name}${NC}"
31
+ echo -e "${YELLOW}└────────────────────────────────────────────────────────────────┘${NC}"
32
+ echo ""
33
+
34
+ TESTS_RUN=$((TESTS_RUN + 1))
35
+
36
+ if bash "$test_file"; then
37
+ echo ""
38
+ echo -e "${GREEN}✓ ${test_name} PASSED${NC}"
39
+ TOTAL_PASSED=$((TOTAL_PASSED + 1))
40
+ else
41
+ echo ""
42
+ echo -e "${RED}✗ ${test_name} FAILED${NC}"
43
+ TOTAL_FAILED=$((TOTAL_FAILED + 1))
44
+ fi
45
+
46
+ echo ""
47
+ echo ""
48
+ }
49
+
50
+ # Run all tests
51
+ run_test "Bootstrap Tests" "$SCRIPT_DIR/test-bootstrap.sh"
52
+ run_test "Task Queue Tests" "$SCRIPT_DIR/test-task-queue.sh"
53
+ run_test "Circuit Breaker Tests" "$SCRIPT_DIR/test-circuit-breaker.sh"
54
+ run_test "Timeout & Stuck Process Tests" "$SCRIPT_DIR/test-agent-timeout.sh"
55
+ run_test "State Recovery Tests" "$SCRIPT_DIR/test-state-recovery.sh"
56
+ run_test "Wrapper Script Tests" "$SCRIPT_DIR/test-wrapper.sh"
57
+
58
+ # Summary
59
+ echo -e "${BLUE}╔════════════════════════════════════════════════════════════════╗${NC}"
60
+ echo -e "${BLUE}║ TEST SUITE SUMMARY ║${NC}"
61
+ echo -e "${BLUE}╚════════════════════════════════════════════════════════════════╝${NC}"
62
+ echo ""
63
+ echo -e "Tests Run: ${TESTS_RUN}"
64
+ echo -e "${GREEN}Passed: ${TOTAL_PASSED}${NC}"
65
+ echo -e "${RED}Failed: ${TOTAL_FAILED}${NC}"
66
+ echo ""
67
+
68
+ if [ $TOTAL_FAILED -eq 0 ]; then
69
+ echo -e "${GREEN}╔════════════════════════════════════════════════════════════════╗${NC}"
70
+ echo -e "${GREEN}║ ALL TESTS PASSED SUCCESSFULLY! ║${NC}"
71
+ echo -e "${GREEN}╚════════════════════════════════════════════════════════════════╝${NC}"
72
+ exit 0
73
+ else
74
+ echo -e "${RED}╔════════════════════════════════════════════════════════════════╗${NC}"
75
+ echo -e "${RED}║ SOME TESTS FAILED - PLEASE REVIEW ║${NC}"
76
+ echo -e "${RED}╚════════════════════════════════════════════════════════════════╝${NC}"
77
+ exit 1
78
+ fi
@@ -0,0 +1,348 @@
1
+ #!/bin/bash
2
+ # Test: Agent Timeout and Stuck Process Handling
3
+ # Tests timeout mechanisms for long-running commands like npm build
4
+
5
+ set -uo pipefail
6
+ # Note: Not using -e to allow collecting all test results
7
+
8
+ TEST_DIR=$(mktemp -d)
9
+ PASSED=0
10
+ FAILED=0
11
+
12
+ # Colors
13
+ RED='\033[0;31m'
14
+ GREEN='\033[0;32m'
15
+ YELLOW='\033[1;33m'
16
+ NC='\033[0m'
17
+
18
+ log_pass() { echo -e "${GREEN}[PASS]${NC} $1"; ((PASSED++)); }
19
+ log_fail() { echo -e "${RED}[FAIL]${NC} $1"; ((FAILED++)); }
20
+ log_test() { echo -e "${YELLOW}[TEST]${NC} $1"; }
21
+
22
+ cleanup() {
23
+ rm -rf "$TEST_DIR"
24
+ # Kill any test processes
25
+ pkill -f "test-long-running" 2>/dev/null || true
26
+ }
27
+ trap cleanup EXIT
28
+
29
+ cd "$TEST_DIR"
30
+
31
+ echo "========================================"
32
+ echo "Loki Mode Timeout & Stuck Process Tests"
33
+ echo "========================================"
34
+ echo ""
35
+
36
+ # macOS-compatible timeout function
37
+ run_with_timeout() {
38
+ local timeout_seconds="$1"
39
+ shift
40
+ local cmd="$@"
41
+
42
+ # Use gtimeout if available (from coreutils), otherwise use Perl
43
+ if command -v gtimeout &> /dev/null; then
44
+ gtimeout "$timeout_seconds" bash -c "$cmd"
45
+ return $?
46
+ elif command -v timeout &> /dev/null; then
47
+ timeout "$timeout_seconds" bash -c "$cmd"
48
+ return $?
49
+ else
50
+ # Perl-based timeout (works on macOS)
51
+ perl -e '
52
+ alarm shift @ARGV;
53
+ $SIG{ALRM} = sub { exit 124 };
54
+ exec @ARGV;
55
+ ' "$timeout_seconds" bash -c "$cmd"
56
+ return $?
57
+ fi
58
+ }
59
+
60
+ # Test 1: Command timeout with short process
61
+ log_test "Command completes within timeout"
62
+ START=$(date +%s)
63
+ run_with_timeout 5 "sleep 1" && RESULT="success" || RESULT="timeout"
64
+ END=$(date +%s)
65
+ DURATION=$((END - START))
66
+
67
+ if [ "$RESULT" = "success" ] && [ $DURATION -lt 3 ]; then
68
+ log_pass "Short command completed in ${DURATION}s"
69
+ else
70
+ log_fail "Short command handling failed (result: $RESULT, duration: ${DURATION}s)"
71
+ fi
72
+
73
+ # Test 2: Command timeout with long process
74
+ log_test "Command times out correctly"
75
+ START=$(date +%s)
76
+ run_with_timeout 2 "sleep 10" && RESULT="success" || RESULT="timeout"
77
+ END=$(date +%s)
78
+ DURATION=$((END - START))
79
+
80
+ if [ "$RESULT" = "timeout" ] && [ $DURATION -lt 5 ]; then
81
+ log_pass "Long command timed out correctly in ${DURATION}s"
82
+ else
83
+ log_fail "Timeout mechanism failed (duration: ${DURATION}s, result: $RESULT)"
84
+ fi
85
+
86
+ # Test 3: Task timeout configuration
87
+ log_test "Task timeout configuration"
88
+ python3 << 'EOF'
89
+ import json
90
+
91
+ # Task with custom timeout
92
+ task = {
93
+ "id": "task-build-001",
94
+ "type": "eng-frontend",
95
+ "payload": {
96
+ "action": "build",
97
+ "command": "npm run build"
98
+ },
99
+ "timeout": 600, # 10 minutes for builds
100
+ "createdAt": "2025-01-15T10:00:00Z"
101
+ }
102
+
103
+ # Different timeouts for different task types
104
+ TIMEOUT_CONFIG = {
105
+ 'default': 300, # 5 minutes
106
+ 'build': 600, # 10 minutes
107
+ 'test': 900, # 15 minutes
108
+ 'deploy': 1800, # 30 minutes
109
+ 'quick': 60 # 1 minute
110
+ }
111
+
112
+ def get_timeout(task):
113
+ action = task.get('payload', {}).get('action', 'default')
114
+ return task.get('timeout', TIMEOUT_CONFIG.get(action, TIMEOUT_CONFIG['default']))
115
+
116
+ timeout = get_timeout(task)
117
+ print(f"TIMEOUT:{timeout}")
118
+ assert timeout == 600, f"Expected 600, got {timeout}"
119
+ print("VERIFIED")
120
+ EOF
121
+
122
+ if [ $? -eq 0 ]; then
123
+ log_pass "Task timeout configuration works"
124
+ else
125
+ log_fail "Task timeout configuration failed"
126
+ fi
127
+
128
+ # Test 4: Stuck process detection
129
+ log_test "Stuck process detection (heartbeat)"
130
+ python3 << 'EOF'
131
+ import json
132
+ from datetime import datetime, timedelta
133
+
134
+ # Simulate agent state with heartbeat
135
+ agent_state = {
136
+ "id": "eng-backend-01",
137
+ "status": "active",
138
+ "currentTask": "task-001",
139
+ "lastHeartbeat": (datetime.utcnow() - timedelta(minutes=10)).isoformat() + 'Z'
140
+ }
141
+
142
+ HEARTBEAT_TIMEOUT = 300 # 5 minutes
143
+
144
+ def is_agent_stuck(agent):
145
+ if not agent.get('lastHeartbeat'):
146
+ return False
147
+
148
+ last_heartbeat = datetime.fromisoformat(agent['lastHeartbeat'].replace('Z', '+00:00'))
149
+ age = (datetime.now(last_heartbeat.tzinfo) - last_heartbeat).total_seconds()
150
+
151
+ return age > HEARTBEAT_TIMEOUT
152
+
153
+ is_stuck = is_agent_stuck(agent_state)
154
+ print(f"STUCK:{is_stuck}")
155
+ assert is_stuck == True, "Agent should be detected as stuck"
156
+ print("VERIFIED")
157
+ EOF
158
+
159
+ if [ $? -eq 0 ]; then
160
+ log_pass "Stuck process detection works"
161
+ else
162
+ log_fail "Stuck process detection failed"
163
+ fi
164
+
165
+ # Test 5: Process group killing
166
+ log_test "Process group killing (cleanup)"
167
+ # Create a process that spawns children
168
+ (
169
+ echo "parent-$$" > "$TEST_DIR/parent.pid"
170
+ (sleep 100 & echo $! > "$TEST_DIR/child.pid") &
171
+ wait
172
+ ) &
173
+ PARENT_PID=$!
174
+ sleep 0.5
175
+
176
+ # Kill the process group
177
+ if kill -0 $PARENT_PID 2>/dev/null; then
178
+ kill -TERM -$PARENT_PID 2>/dev/null || kill -TERM $PARENT_PID 2>/dev/null || true
179
+ sleep 0.5
180
+ if ! kill -0 $PARENT_PID 2>/dev/null; then
181
+ log_pass "Process group killed successfully"
182
+ else
183
+ kill -9 $PARENT_PID 2>/dev/null || true
184
+ log_pass "Process killed with SIGKILL"
185
+ fi
186
+ else
187
+ log_pass "Process already terminated"
188
+ fi
189
+
190
+ # Test 6: npm/node process timeout simulation
191
+ log_test "npm/node process timeout handling"
192
+ cat > "$TEST_DIR/slow-script.js" << 'EOF'
193
+ // Simulate a slow npm build
194
+ console.log('Starting slow process...');
195
+ setTimeout(() => {
196
+ console.log('Still running...');
197
+ }, 1000);
198
+ setTimeout(() => {
199
+ console.log('Completed!');
200
+ process.exit(0);
201
+ }, 5000);
202
+ EOF
203
+
204
+ if command -v node &> /dev/null; then
205
+ START=$(date +%s)
206
+ run_with_timeout 2 "node '$TEST_DIR/slow-script.js'" > /dev/null 2>&1 && RESULT="success" || RESULT="timeout"
207
+ END=$(date +%s)
208
+ DURATION=$((END - START))
209
+
210
+ if [ "$RESULT" = "timeout" ]; then
211
+ log_pass "Node process timed out correctly in ${DURATION}s"
212
+ else
213
+ log_fail "Node process should have timed out"
214
+ fi
215
+ else
216
+ log_pass "Node not available - skipping (acceptable)"
217
+ fi
218
+
219
+ # Test 7: Task retry after timeout
220
+ log_test "Task retry after timeout"
221
+ python3 << 'EOF'
222
+ import json
223
+ from datetime import datetime, timedelta
224
+
225
+ # Task that timed out
226
+ task = {
227
+ "id": "task-timeout-001",
228
+ "type": "eng-frontend",
229
+ "payload": {"action": "build"},
230
+ "timeout": 300,
231
+ "retries": 0,
232
+ "maxRetries": 3,
233
+ "lastError": "Timeout after 300 seconds",
234
+ "claimedBy": "agent-001",
235
+ "claimedAt": (datetime.utcnow() - timedelta(seconds=310)).isoformat() + 'Z'
236
+ }
237
+
238
+ def handle_timeout(task):
239
+ task['retries'] += 1
240
+ task['lastError'] = f"Timeout after {task['timeout']} seconds"
241
+ task['claimedBy'] = None
242
+ task['claimedAt'] = None
243
+
244
+ # Increase timeout for retry (25% increase)
245
+ task['timeout'] = int(task['timeout'] * 1.25)
246
+
247
+ return task
248
+
249
+ task = handle_timeout(task)
250
+ print(f"RETRIES:{task['retries']}")
251
+ print(f"NEW_TIMEOUT:{task['timeout']}")
252
+ assert task['retries'] == 1
253
+ assert task['timeout'] == 375 # 300 * 1.25
254
+ print("VERIFIED")
255
+ EOF
256
+
257
+ if [ $? -eq 0 ]; then
258
+ log_pass "Task retry after timeout works"
259
+ else
260
+ log_fail "Task retry after timeout failed"
261
+ fi
262
+
263
+ # Test 8: Watchdog timer pattern
264
+ log_test "Watchdog timer pattern"
265
+ python3 << 'EOF'
266
+ import time
267
+ from datetime import datetime, timedelta
268
+
269
+ class Watchdog:
270
+ def __init__(self, timeout_seconds):
271
+ self.timeout = timeout_seconds
272
+ self.last_pet = datetime.utcnow()
273
+
274
+ def pet(self):
275
+ """Reset the watchdog timer"""
276
+ self.last_pet = datetime.utcnow()
277
+
278
+ def is_expired(self):
279
+ """Check if watchdog has expired"""
280
+ age = (datetime.utcnow() - self.last_pet).total_seconds()
281
+ return age > self.timeout
282
+
283
+ def remaining(self):
284
+ """Get remaining time before expiry"""
285
+ age = (datetime.utcnow() - self.last_pet).total_seconds()
286
+ return max(0, self.timeout - age)
287
+
288
+ # Create watchdog with 2 second timeout
289
+ wd = Watchdog(2)
290
+ print(f"Initial remaining: {wd.remaining():.1f}s")
291
+ assert not wd.is_expired(), "Should not be expired initially"
292
+
293
+ # Simulate work with petting
294
+ time.sleep(0.5)
295
+ wd.pet()
296
+ print(f"After pet: {wd.remaining():.1f}s")
297
+ assert not wd.is_expired(), "Should not be expired after pet"
298
+
299
+ # Let it expire
300
+ time.sleep(0.1)
301
+ # Simulate expiry by setting last_pet in past
302
+ wd.last_pet = datetime.utcnow() - timedelta(seconds=3)
303
+ assert wd.is_expired(), "Should be expired"
304
+ print("Watchdog expired correctly")
305
+ print("VERIFIED")
306
+ EOF
307
+
308
+ if [ $? -eq 0 ]; then
309
+ log_pass "Watchdog timer pattern works"
310
+ else
311
+ log_fail "Watchdog timer pattern failed"
312
+ fi
313
+
314
+ # Test 9: Graceful shutdown with timeout
315
+ log_test "Graceful shutdown with timeout"
316
+ (
317
+ trap 'echo "Received SIGTERM"; exit 0' TERM
318
+ sleep 100
319
+ ) &
320
+ PID=$!
321
+ sleep 0.2
322
+
323
+ # Send SIGTERM
324
+ kill -TERM $PID 2>/dev/null || true
325
+ sleep 0.5
326
+
327
+ if ! kill -0 $PID 2>/dev/null; then
328
+ log_pass "Process handled SIGTERM gracefully"
329
+ else
330
+ kill -9 $PID 2>/dev/null || true
331
+ log_pass "Process required SIGKILL (acceptable)"
332
+ fi
333
+
334
+ echo ""
335
+ echo "========================================"
336
+ echo "Test Summary"
337
+ echo "========================================"
338
+ echo -e "${GREEN}Passed: $PASSED${NC}"
339
+ echo -e "${RED}Failed: $FAILED${NC}"
340
+ echo ""
341
+
342
+ if [ $FAILED -eq 0 ]; then
343
+ echo -e "${GREEN}All tests passed!${NC}"
344
+ exit 0
345
+ else
346
+ echo -e "${RED}Some tests failed!${NC}"
347
+ exit 1
348
+ fi