@ggailabs/cli-context 0.5.6 → 1.0.1

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.

Potentially problematic release.


This version of @ggailabs/cli-context might be problematic. Click here for more details.

Files changed (282) hide show
  1. package/README.md +25 -181
  2. package/dist/.context/docs/GENESIS_SYSTEM_PROMPT.md +62 -0
  3. package/dist/.context/eng/agents/architect.md +15 -0
  4. package/dist/.context/eng/agents/backend_typescript.md +1000 -0
  5. package/dist/.context/eng/agents/bug_hunter.md +49 -0
  6. package/dist/.context/eng/agents/code_reviewer.md +313 -0
  7. package/dist/.context/eng/agents/devops_specialist.md +718 -0
  8. package/dist/.context/eng/agents/frontend_specialist.md +1027 -0
  9. package/dist/.context/eng/agents/qa_specialist.md +1234 -0
  10. package/dist/.context/eng/agents/security_reviewer.md +382 -0
  11. package/dist/.context/eng/agents/ui_specialist.md +16 -0
  12. package/dist/.context/eng/docs/AGENT_HANDOFF_PROMPT.md +44 -0
  13. package/dist/.context/eng/docs/GENESIS_DESIGN_SYSTEM.md +15 -0
  14. package/dist/.context/eng/docs/GG_METHODOLOGY.md +48 -0
  15. package/dist/.context/eng/docs/OPERATIONS_LOG.md +30 -0
  16. package/dist/.context/eng/docs/PROJECT_MAP.md +35 -0
  17. package/dist/.context/eng/docs/standards/devops.md +0 -0
  18. package/dist/.context/eng/docs/standards/frontend.md +0 -0
  19. package/dist/.context/eng/docs/standards/typescript.md +12 -0
  20. package/dist/.context/eng/skills/agent_logging.md +18 -0
  21. package/dist/.context/eng/skills/brainstorming.md +227 -0
  22. package/dist/.context/eng/skills/exploring_codebase.md +1217 -0
  23. package/dist/.context/eng/skills/patterns/compliance_check.md +246 -0
  24. package/dist/.context/eng/skills/patterns/coverage_table.md +401 -0
  25. package/dist/.context/eng/skills/patterns/exit_criteria.md +31 -0
  26. package/dist/.context/eng/skills/patterns/failure_recovery.md +74 -0
  27. package/dist/.context/eng/skills/patterns/quality_gate.md +295 -0
  28. package/dist/.context/eng/skills/patterns/standards_workflow.md +391 -0
  29. package/dist/.context/eng/skills/patterns/state_tracking.md +30 -0
  30. package/dist/.context/eng/skills/patterns/task_tracking.md +38 -0
  31. package/dist/.context/eng/skills/previce.md +45 -0
  32. package/dist/.context/eng/skills/tdd.md +421 -0
  33. package/dist/.context/eng/skills/writing_plans.md +105 -0
  34. package/dist/.context/plans/.gitkeep +0 -0
  35. package/dist/.context/pt-br/agents/architect.md +69 -0
  36. package/dist/.context/pt-br/agents/backend_typescript.md +1000 -0
  37. package/dist/.context/pt-br/agents/bug_hunter.md +49 -0
  38. package/dist/.context/pt-br/agents/code_reviewer.md +313 -0
  39. package/dist/.context/pt-br/agents/devops_specialist.md +718 -0
  40. package/dist/.context/pt-br/agents/frontend_specialist.md +1027 -0
  41. package/dist/.context/pt-br/agents/qa_specialist.md +1234 -0
  42. package/dist/.context/pt-br/agents/security_reviewer.md +382 -0
  43. package/dist/.context/pt-br/agents/ui_specialist.md +55 -0
  44. package/dist/.context/pt-br/docs/AGENT_HANDOFF_PROMPT.md +44 -0
  45. package/dist/.context/pt-br/docs/GENESIS_DESIGN_SYSTEM.md +88 -0
  46. package/dist/.context/pt-br/docs/GG_METHODOLOGY.md +48 -0
  47. package/dist/.context/pt-br/docs/OPERATIONS_LOG.md +30 -0
  48. package/dist/.context/pt-br/docs/PROJECT_MAP.md +37 -0
  49. package/dist/.context/pt-br/docs/standards/devops.md +707 -0
  50. package/dist/.context/pt-br/docs/standards/frontend.md +748 -0
  51. package/dist/.context/pt-br/docs/standards/typescript.md +1150 -0
  52. package/dist/.context/pt-br/skills/agent_logging.md +36 -0
  53. package/dist/.context/pt-br/skills/brainstorming.md +227 -0
  54. package/dist/.context/pt-br/skills/exploring_codebase.md +1217 -0
  55. package/dist/.context/pt-br/skills/patterns/compliance_check.md +246 -0
  56. package/dist/.context/pt-br/skills/patterns/coverage_table.md +401 -0
  57. package/dist/.context/pt-br/skills/patterns/exit_criteria.md +31 -0
  58. package/dist/.context/pt-br/skills/patterns/failure_recovery.md +74 -0
  59. package/dist/.context/pt-br/skills/patterns/quality_gate.md +295 -0
  60. package/dist/.context/pt-br/skills/patterns/standards_workflow.md +391 -0
  61. package/dist/.context/pt-br/skills/patterns/state_tracking.md +30 -0
  62. package/dist/.context/pt-br/skills/patterns/task_tracking.md +38 -0
  63. package/dist/.context/pt-br/skills/previce.md +45 -0
  64. package/dist/.context/pt-br/skills/tdd.md +421 -0
  65. package/dist/.context/pt-br/skills/writing_plans.md +105 -0
  66. package/dist/.context/workflow/.gitkeep +0 -0
  67. package/dist/commands/init.js +140 -0
  68. package/dist/commands/monitor.js +34 -0
  69. package/dist/index.js +20 -568
  70. package/dist/services/monitor-service.js +340 -0
  71. package/dist/services/scaffolder.js +164 -0
  72. package/package.json +16 -58
  73. package/LICENSE +0 -21
  74. package/dist/generators/agents/agentConfig.d.ts +0 -4
  75. package/dist/generators/agents/agentConfig.d.ts.map +0 -1
  76. package/dist/generators/agents/agentConfig.js +0 -180
  77. package/dist/generators/agents/agentConfig.js.map +0 -1
  78. package/dist/generators/agents/agentGenerator.d.ts +0 -9
  79. package/dist/generators/agents/agentGenerator.d.ts.map +0 -1
  80. package/dist/generators/agents/agentGenerator.js +0 -97
  81. package/dist/generators/agents/agentGenerator.js.map +0 -1
  82. package/dist/generators/agents/agentTypes.d.ts +0 -4
  83. package/dist/generators/agents/agentTypes.d.ts.map +0 -1
  84. package/dist/generators/agents/agentTypes.js +0 -25
  85. package/dist/generators/agents/agentTypes.js.map +0 -1
  86. package/dist/generators/agents/index.d.ts +0 -4
  87. package/dist/generators/agents/index.d.ts.map +0 -1
  88. package/dist/generators/agents/index.js +0 -12
  89. package/dist/generators/agents/index.js.map +0 -1
  90. package/dist/generators/agents/templates/index.d.ts +0 -4
  91. package/dist/generators/agents/templates/index.d.ts.map +0 -1
  92. package/dist/generators/agents/templates/index.js +0 -8
  93. package/dist/generators/agents/templates/index.js.map +0 -1
  94. package/dist/generators/agents/templates/indexTemplate.d.ts +0 -3
  95. package/dist/generators/agents/templates/indexTemplate.d.ts.map +0 -1
  96. package/dist/generators/agents/templates/indexTemplate.js +0 -36
  97. package/dist/generators/agents/templates/indexTemplate.js.map +0 -1
  98. package/dist/generators/agents/templates/playbookTemplate.d.ts +0 -4
  99. package/dist/generators/agents/templates/playbookTemplate.d.ts.map +0 -1
  100. package/dist/generators/agents/templates/playbookTemplate.js +0 -99
  101. package/dist/generators/agents/templates/playbookTemplate.js.map +0 -1
  102. package/dist/generators/agents/templates/types.d.ts +0 -14
  103. package/dist/generators/agents/templates/types.d.ts.map +0 -1
  104. package/dist/generators/agents/templates/types.js +0 -3
  105. package/dist/generators/agents/templates/types.js.map +0 -1
  106. package/dist/generators/documentation/documentationGenerator.d.ts +0 -15
  107. package/dist/generators/documentation/documentationGenerator.d.ts.map +0 -1
  108. package/dist/generators/documentation/documentationGenerator.js +0 -188
  109. package/dist/generators/documentation/documentationGenerator.js.map +0 -1
  110. package/dist/generators/documentation/guideRegistry.d.ts +0 -6
  111. package/dist/generators/documentation/guideRegistry.d.ts.map +0 -1
  112. package/dist/generators/documentation/guideRegistry.js +0 -82
  113. package/dist/generators/documentation/guideRegistry.js.map +0 -1
  114. package/dist/generators/documentation/index.d.ts +0 -2
  115. package/dist/generators/documentation/index.d.ts.map +0 -1
  116. package/dist/generators/documentation/index.js +0 -6
  117. package/dist/generators/documentation/index.js.map +0 -1
  118. package/dist/generators/documentation/templates/apiReferenceTemplate.d.ts +0 -2
  119. package/dist/generators/documentation/templates/apiReferenceTemplate.d.ts.map +0 -1
  120. package/dist/generators/documentation/templates/apiReferenceTemplate.js +0 -490
  121. package/dist/generators/documentation/templates/apiReferenceTemplate.js.map +0 -1
  122. package/dist/generators/documentation/templates/architectureTemplate.d.ts +0 -3
  123. package/dist/generators/documentation/templates/architectureTemplate.d.ts.map +0 -1
  124. package/dist/generators/documentation/templates/architectureTemplate.js +0 -66
  125. package/dist/generators/documentation/templates/architectureTemplate.js.map +0 -1
  126. package/dist/generators/documentation/templates/common.d.ts +0 -7
  127. package/dist/generators/documentation/templates/common.d.ts.map +0 -1
  128. package/dist/generators/documentation/templates/common.js +0 -58
  129. package/dist/generators/documentation/templates/common.js.map +0 -1
  130. package/dist/generators/documentation/templates/dataFlowTemplate.d.ts +0 -3
  131. package/dist/generators/documentation/templates/dataFlowTemplate.d.ts.map +0 -1
  132. package/dist/generators/documentation/templates/dataFlowTemplate.js +0 -40
  133. package/dist/generators/documentation/templates/dataFlowTemplate.js.map +0 -1
  134. package/dist/generators/documentation/templates/developmentWorkflowTemplate.d.ts +0 -2
  135. package/dist/generators/documentation/templates/developmentWorkflowTemplate.d.ts.map +0 -1
  136. package/dist/generators/documentation/templates/developmentWorkflowTemplate.js +0 -44
  137. package/dist/generators/documentation/templates/developmentWorkflowTemplate.js.map +0 -1
  138. package/dist/generators/documentation/templates/glossaryTemplate.d.ts +0 -3
  139. package/dist/generators/documentation/templates/glossaryTemplate.d.ts.map +0 -1
  140. package/dist/generators/documentation/templates/glossaryTemplate.js +0 -41
  141. package/dist/generators/documentation/templates/glossaryTemplate.js.map +0 -1
  142. package/dist/generators/documentation/templates/index.d.ts +0 -15
  143. package/dist/generators/documentation/templates/index.d.ts.map +0 -1
  144. package/dist/generators/documentation/templates/index.js +0 -30
  145. package/dist/generators/documentation/templates/index.js.map +0 -1
  146. package/dist/generators/documentation/templates/indexTemplate.d.ts +0 -3
  147. package/dist/generators/documentation/templates/indexTemplate.d.ts.map +0 -1
  148. package/dist/generators/documentation/templates/indexTemplate.js +0 -42
  149. package/dist/generators/documentation/templates/indexTemplate.js.map +0 -1
  150. package/dist/generators/documentation/templates/migrationTemplate.d.ts +0 -2
  151. package/dist/generators/documentation/templates/migrationTemplate.d.ts.map +0 -1
  152. package/dist/generators/documentation/templates/migrationTemplate.js +0 -422
  153. package/dist/generators/documentation/templates/migrationTemplate.js.map +0 -1
  154. package/dist/generators/documentation/templates/onboardingTemplate.d.ts +0 -2
  155. package/dist/generators/documentation/templates/onboardingTemplate.d.ts.map +0 -1
  156. package/dist/generators/documentation/templates/onboardingTemplate.js +0 -431
  157. package/dist/generators/documentation/templates/onboardingTemplate.js.map +0 -1
  158. package/dist/generators/documentation/templates/projectOverviewTemplate.d.ts +0 -3
  159. package/dist/generators/documentation/templates/projectOverviewTemplate.d.ts.map +0 -1
  160. package/dist/generators/documentation/templates/projectOverviewTemplate.js +0 -65
  161. package/dist/generators/documentation/templates/projectOverviewTemplate.js.map +0 -1
  162. package/dist/generators/documentation/templates/securityTemplate.d.ts +0 -2
  163. package/dist/generators/documentation/templates/securityTemplate.d.ts.map +0 -1
  164. package/dist/generators/documentation/templates/securityTemplate.js +0 -39
  165. package/dist/generators/documentation/templates/securityTemplate.js.map +0 -1
  166. package/dist/generators/documentation/templates/testingTemplate.d.ts +0 -2
  167. package/dist/generators/documentation/templates/testingTemplate.d.ts.map +0 -1
  168. package/dist/generators/documentation/templates/testingTemplate.js +0 -45
  169. package/dist/generators/documentation/templates/testingTemplate.js.map +0 -1
  170. package/dist/generators/documentation/templates/toolingTemplate.d.ts +0 -2
  171. package/dist/generators/documentation/templates/toolingTemplate.d.ts.map +0 -1
  172. package/dist/generators/documentation/templates/toolingTemplate.js +0 -42
  173. package/dist/generators/documentation/templates/toolingTemplate.js.map +0 -1
  174. package/dist/generators/documentation/templates/troubleshootingTemplate.d.ts +0 -2
  175. package/dist/generators/documentation/templates/troubleshootingTemplate.d.ts.map +0 -1
  176. package/dist/generators/documentation/templates/troubleshootingTemplate.js +0 -292
  177. package/dist/generators/documentation/templates/troubleshootingTemplate.js.map +0 -1
  178. package/dist/generators/documentation/templates/types.d.ts +0 -23
  179. package/dist/generators/documentation/templates/types.d.ts.map +0 -1
  180. package/dist/generators/documentation/templates/types.js +0 -3
  181. package/dist/generators/documentation/templates/types.js.map +0 -1
  182. package/dist/generators/plans/index.d.ts +0 -2
  183. package/dist/generators/plans/index.d.ts.map +0 -1
  184. package/dist/generators/plans/index.js +0 -6
  185. package/dist/generators/plans/index.js.map +0 -1
  186. package/dist/generators/plans/planGenerator.d.ts +0 -22
  187. package/dist/generators/plans/planGenerator.d.ts.map +0 -1
  188. package/dist/generators/plans/planGenerator.js +0 -109
  189. package/dist/generators/plans/planGenerator.js.map +0 -1
  190. package/dist/generators/plans/templates/indexTemplate.d.ts +0 -3
  191. package/dist/generators/plans/templates/indexTemplate.d.ts.map +0 -1
  192. package/dist/generators/plans/templates/indexTemplate.js +0 -37
  193. package/dist/generators/plans/templates/indexTemplate.js.map +0 -1
  194. package/dist/generators/plans/templates/planTemplate.d.ts +0 -3
  195. package/dist/generators/plans/templates/planTemplate.d.ts.map +0 -1
  196. package/dist/generators/plans/templates/planTemplate.js +0 -166
  197. package/dist/generators/plans/templates/planTemplate.js.map +0 -1
  198. package/dist/generators/plans/templates/types.d.ts +0 -19
  199. package/dist/generators/plans/templates/types.d.ts.map +0 -1
  200. package/dist/generators/plans/templates/types.js +0 -3
  201. package/dist/generators/plans/templates/types.js.map +0 -1
  202. package/dist/generators/shared/contextGenerator.d.ts +0 -7
  203. package/dist/generators/shared/contextGenerator.d.ts.map +0 -1
  204. package/dist/generators/shared/contextGenerator.js +0 -13
  205. package/dist/generators/shared/contextGenerator.js.map +0 -1
  206. package/dist/generators/shared/directoryTemplateHelpers.d.ts +0 -2
  207. package/dist/generators/shared/directoryTemplateHelpers.d.ts.map +0 -1
  208. package/dist/generators/shared/directoryTemplateHelpers.js +0 -12
  209. package/dist/generators/shared/directoryTemplateHelpers.js.map +0 -1
  210. package/dist/generators/shared/generatorUtils.d.ts +0 -16
  211. package/dist/generators/shared/generatorUtils.d.ts.map +0 -1
  212. package/dist/generators/shared/generatorUtils.js +0 -119
  213. package/dist/generators/shared/generatorUtils.js.map +0 -1
  214. package/dist/generators/shared/index.d.ts +0 -4
  215. package/dist/generators/shared/index.d.ts.map +0 -1
  216. package/dist/generators/shared/index.js +0 -10
  217. package/dist/generators/shared/index.js.map +0 -1
  218. package/dist/index.d.ts +0 -9
  219. package/dist/index.d.ts.map +0 -1
  220. package/dist/index.js.map +0 -1
  221. package/dist/prompts/defaults.d.ts +0 -3
  222. package/dist/prompts/defaults.d.ts.map +0 -1
  223. package/dist/prompts/defaults.js +0 -95
  224. package/dist/prompts/defaults.js.map +0 -1
  225. package/dist/services/baseLLMClient.d.ts +0 -12
  226. package/dist/services/baseLLMClient.d.ts.map +0 -1
  227. package/dist/services/baseLLMClient.js +0 -80
  228. package/dist/services/baseLLMClient.js.map +0 -1
  229. package/dist/services/fill/fillService.d.ts +0 -46
  230. package/dist/services/fill/fillService.d.ts.map +0 -1
  231. package/dist/services/fill/fillService.js +0 -254
  232. package/dist/services/fill/fillService.js.map +0 -1
  233. package/dist/services/init/initService.d.ts +0 -37
  234. package/dist/services/init/initService.d.ts.map +0 -1
  235. package/dist/services/init/initService.js +0 -167
  236. package/dist/services/init/initService.js.map +0 -1
  237. package/dist/services/llmClientFactory.d.ts +0 -8
  238. package/dist/services/llmClientFactory.d.ts.map +0 -1
  239. package/dist/services/llmClientFactory.js +0 -23
  240. package/dist/services/llmClientFactory.js.map +0 -1
  241. package/dist/services/openRouterClient.d.ts +0 -9
  242. package/dist/services/openRouterClient.d.ts.map +0 -1
  243. package/dist/services/openRouterClient.js +0 -49
  244. package/dist/services/openRouterClient.js.map +0 -1
  245. package/dist/services/plan/planService.d.ts +0 -57
  246. package/dist/services/plan/planService.d.ts.map +0 -1
  247. package/dist/services/plan/planService.js +0 -334
  248. package/dist/services/plan/planService.js.map +0 -1
  249. package/dist/services/shared/llmConfig.d.ts +0 -22
  250. package/dist/services/shared/llmConfig.d.ts.map +0 -1
  251. package/dist/services/shared/llmConfig.js +0 -38
  252. package/dist/services/shared/llmConfig.js.map +0 -1
  253. package/dist/types.d.ts +0 -65
  254. package/dist/types.d.ts.map +0 -1
  255. package/dist/types.js +0 -3
  256. package/dist/types.js.map +0 -1
  257. package/dist/utils/cliUI.d.ts +0 -27
  258. package/dist/utils/cliUI.d.ts.map +0 -1
  259. package/dist/utils/cliUI.js +0 -252
  260. package/dist/utils/cliUI.js.map +0 -1
  261. package/dist/utils/fileMapper.d.ts +0 -11
  262. package/dist/utils/fileMapper.d.ts.map +0 -1
  263. package/dist/utils/fileMapper.js +0 -146
  264. package/dist/utils/fileMapper.js.map +0 -1
  265. package/dist/utils/gitService.d.ts +0 -50
  266. package/dist/utils/gitService.d.ts.map +0 -1
  267. package/dist/utils/gitService.js +0 -470
  268. package/dist/utils/gitService.js.map +0 -1
  269. package/dist/utils/i18n.d.ts +0 -171
  270. package/dist/utils/i18n.d.ts.map +0 -1
  271. package/dist/utils/i18n.js +0 -381
  272. package/dist/utils/i18n.js.map +0 -1
  273. package/dist/utils/promptLoader.d.ts +0 -12
  274. package/dist/utils/promptLoader.d.ts.map +0 -1
  275. package/dist/utils/promptLoader.js +0 -81
  276. package/dist/utils/promptLoader.js.map +0 -1
  277. package/dist/utils/versionChecker.d.ts +0 -15
  278. package/dist/utils/versionChecker.d.ts.map +0 -1
  279. package/dist/utils/versionChecker.js +0 -49
  280. package/dist/utils/versionChecker.js.map +0 -1
  281. package/prompts/update_plan_prompt.md +0 -41
  282. package/prompts/update_scaffold_prompt.md +0 -47
@@ -0,0 +1,421 @@
1
+ ---
2
+ name: ring:test-driven-development
3
+ description: |
4
+ RED-GREEN-REFACTOR implementation methodology - write failing test first,
5
+ minimal implementation to pass, then refactor. Ensures tests verify behavior.
6
+
7
+ trigger: |
8
+ - Starting implementation of new feature
9
+ - Starting implementation of bugfix
10
+ - Writing new production code
11
+
12
+ skip_when: |
13
+ - Reviewing/modifying existing tests → use testing-anti-patterns
14
+ - Code already exists without tests → add tests first, then TDD for new code
15
+ - Exploratory/spike work → consider brainstorming first
16
+
17
+ related:
18
+ complementary: [testing-anti-patterns, verification-before-completion]
19
+
20
+ compliance_rules:
21
+ - id: "test_file_exists"
22
+ description: "Test file must exist before implementation file"
23
+ check_type: "file_exists"
24
+ pattern: "**/*.test.{ts,js,go,py}"
25
+ severity: "blocking"
26
+ failure_message: "No test file found. Write test first (RED phase)."
27
+
28
+ - id: "test_must_fail_first"
29
+ description: "Test must produce failure output before implementation"
30
+ check_type: "command_output_contains"
31
+ command: "npm test 2>&1 || pytest 2>&1 || go test ./... 2>&1"
32
+ pattern: "FAIL|Error|failed"
33
+ severity: "blocking"
34
+ failure_message: "Test does not fail. Write a failing test first (RED phase)."
35
+ prerequisites:
36
+ - name: "test_framework_installed"
37
+ check: "npm list jest 2>/dev/null || npm list vitest 2>/dev/null || which pytest 2>/dev/null || go list ./... 2>&1 | grep -q testing"
38
+ failure_message: "No test framework found. Install jest/vitest (JS), pytest (Python), or use Go's built-in testing."
39
+ severity: "blocking"
40
+
41
+ - name: "can_run_tests"
42
+ check: "npm test -- --version 2>/dev/null || pytest --version 2>/dev/null || go test -v 2>&1 | grep -q 'testing:'"
43
+ failure_message: "Cannot run tests. Fix test configuration."
44
+ severity: "warning"
45
+ composition:
46
+ works_well_with:
47
+ - skill: "ring:systematic-debugging"
48
+ when: "test reveals unexpected behavior or bug"
49
+ transition: "Pause TDD at current phase, use systematic-debugging to find root cause, return to TDD after fix"
50
+
51
+ - skill: "ring:verification-before-completion"
52
+ when: "before marking test suite or feature complete"
53
+ transition: "Run verification to ensure all tests pass, return to TDD if issues found"
54
+
55
+ - skill: "ring:requesting-code-review"
56
+ when: "after completing RED-GREEN-REFACTOR cycle for feature"
57
+ transition: "Request review before merging, address feedback, mark complete"
58
+
59
+ conflicts_with: []
60
+
61
+ typical_workflow: |
62
+ 1. Write failing test (RED)
63
+ 2. If test reveals unexpected behavior → switch to systematic-debugging
64
+ 3. Fix root cause
65
+ 4. Return to TDD: minimal implementation (GREEN)
66
+ 5. Refactor (REFACTOR)
67
+ 6. Run verification-before-completion
68
+ 7. Request code review
69
+ ---
70
+
71
+ # Test-Driven Development (TDD)
72
+
73
+ ## Overview
74
+
75
+ Write the test first. Watch it fail. Write minimal code to pass.
76
+
77
+ **Core principle:** If you didn't watch the test fail, you don't know if it tests the right thing.
78
+
79
+ **Violating the letter of the rules is violating the spirit of the rules.**
80
+
81
+ ## When to Use
82
+
83
+ **Always:**
84
+ - New features
85
+ - Bug fixes
86
+ - Refactoring
87
+ - Behavior changes
88
+
89
+ **Exceptions (ask your human partner):**
90
+ - Throwaway prototypes
91
+ - Generated code
92
+ - Configuration files
93
+
94
+ Thinking "skip TDD just this once"? Stop. That's rationalization.
95
+
96
+ ## The Iron Law
97
+
98
+ ```
99
+ NO PRODUCTION CODE WITHOUT A FAILING TEST FIRST
100
+ ```
101
+
102
+ Write code before the test? You have ONLY two options:
103
+
104
+ ## Violation Handling (Mandatory)
105
+
106
+ **If you wrote code before test:**
107
+
108
+ ### DELETE IT. IMMEDIATELY.
109
+
110
+ ```bash
111
+ rm [files] # or git reset --hard
112
+ ```
113
+
114
+ **Not tomorrow. Not after asking. NOW.**
115
+
116
+ **Delete means DELETE:**
117
+ - `rm -rf the_file.py` ✓
118
+ - `git reset --hard` ✓
119
+ - Physically delete ✓
120
+
121
+ **These are NOT deleting (violations):**
122
+ - `git stash` - That's hiding, not deleting
123
+ - `mv file.py file.py.bak` - That's keeping
124
+ - Copy to clipboard - That's keeping
125
+ - Comment out - That's keeping
126
+ - "Mental note" - That's keeping
127
+ - Asking permission - That's delaying
128
+
129
+ Delete means gone forever. No recovery possible.
130
+
131
+ Then start over with TDD.
132
+
133
+ ### NO ASKING. NO PERMISSION. NO EXCEPTIONS.
134
+
135
+ **You CANNOT:**
136
+ - ❌ Ask "should I delete this?"
137
+ - ❌ Ask "may I proceed with tests-after?"
138
+ - ❌ Request permission due to [any reason]
139
+ - ❌ Explain why deleting is hard
140
+ - ❌ Decide "I'll be pragmatic and test after"
141
+ - ❌ Claim "spirit not letter"
142
+ - ❌ Rationalize "damage already done"
143
+ - ❌ Argue "skill is guide not suicide pact"
144
+ - ❌ Create "pragmatic compliance" category
145
+ - ❌ Mention sunk cost, time pressure, personal plans
146
+ - ❌ Commit anything
147
+
148
+ **If you think you have a legitimate reason to skip deletion:**
149
+ - You don't.
150
+ - Delete it.
151
+ - Every excuse is rationalization.
152
+ - Anniversary? Delete code, go to dinner, start fresh tomorrow.
153
+ - Deadline? Delete code, communicate delay, do it right.
154
+ - 4 hours of work? Sunk cost fallacy. Delete it.
155
+ - Manager pressure? Delete it, explain TDD prevents bugs.
156
+ - "But this is different because..." No. Delete it.
157
+
158
+ **The rule has ZERO exceptions. ZERO.**
159
+
160
+ ### Consequences of NOT Deleting
161
+
162
+ Untested code WILL cause production incidents. These are CERTAINTIES:
163
+
164
+ - **Trust:** Partner loses confidence permanently. PRs rejected. Assigned bug duty.
165
+ - **Production:** Incident within 30 days. Worst timing (holiday, 3am). Postmortem responsibility.
166
+ - **Career:** Reputation as "cuts corners" follows you. Promotion blocked.
167
+ - **Personal:** Anniversary debugging. Technical debt haunts for years.
168
+
169
+ ❌ "This time is different" → Every developer who thought this experienced these consequences.
170
+
171
+ ### The ONLY Acceptable Action
172
+
173
+ **DELETE THE CODE. NOW.**
174
+
175
+ ```bash
176
+ rm /tmp/auth-feature/src/auth.ts
177
+ rm /tmp/auth-feature/src/middleware.ts
178
+ rm /tmp/auth-feature/src/utils.ts
179
+ # or: git reset --hard
180
+ ```
181
+
182
+ **Then:**
183
+ - Go to anniversary dinner
184
+ - Sleep well
185
+ - Tomorrow morning: Start fresh with TDD
186
+ - Implement in 2-3 hours with tests (faster second time)
187
+ - Code review passes
188
+ - No production incidents
189
+ - Career intact
190
+
191
+ **ZERO exceptions. Anniversary, deadline, manager pressure, sunk cost - NONE of these override deletion.**
192
+
193
+ ### Prohibited Rationalizations
194
+
195
+ **You CANNOT create alternatives:**
196
+ - ❌ "Commit with WIP message" - NO. Delete.
197
+ - ❌ "Commit with 'NO TESTS' warning" - NO. Delete.
198
+ - ❌ "Mark as technical debt" - NO. Delete.
199
+ - ❌ "Email team about violation" - NO. Delete first, communicate after.
200
+ - ❌ "Come early tomorrow to decide" - NO. Delete now, decide nothing.
201
+ - ❌ "Let team decide" - NO. You decide: Delete.
202
+ - ❌ "Write tests tonight after dinner" - NO. Delete, start fresh tomorrow with TDD.
203
+ - ❌ "Commit honestly labeled code" - NO. Honesty is deleting it.
204
+ - ❌ "Present options to partner" - NO. Only one option: Delete.
205
+
206
+ **The skill doesn't offer choices. It commands: DELETE.**
207
+
208
+ **If you create ANY alternative to deletion, you violated the skill.**
209
+
210
+ **DELETE IT. NOW. NO ALTERNATIVES.**
211
+
212
+ ## Red-Green-Refactor
213
+
214
+ **Cycle:** RED (write failing test) → verify fails → GREEN (minimal code) → verify passes → REFACTOR (clean up) → verify still green → repeat
215
+
216
+ ### RED - Write Failing Test
217
+
218
+ Write one minimal test showing what should happen.
219
+
220
+ **GOOD:** `test('retries failed operations 3 times', ...)` - clear name, tests real behavior, one thing.
221
+
222
+ **BAD:** `test('retry works', ...)` with mocks - vague name, tests mock not code.
223
+
224
+ **Time limit:** <5 minutes. Complex mocks → testing wrong thing. Lots of setup → design too complex. Multiple assertions → split tests.
225
+
226
+ **Requirements:**
227
+ - One behavior
228
+ - Clear name
229
+ - Real code (no mocks unless unavoidable)
230
+
231
+ ### Verify RED - Watch It Fail
232
+
233
+ **MANDATORY. Never skip.**
234
+
235
+ ```bash
236
+ npm test path/to/test.test.ts
237
+ ```
238
+
239
+ **Paste the ACTUAL failure output in your response:**
240
+ ```
241
+ [PASTE EXACT OUTPUT HERE]
242
+ [NO OUTPUT = VIOLATION]
243
+ ```
244
+
245
+ If you can't paste output, you didn't run the test.
246
+
247
+ ### Required Failure Patterns
248
+
249
+ | Test Type | Must See This Failure | Wrong Failure = Wrong Test |
250
+ |-----------|----------------------|---------------------------|
251
+ | New feature | `NameError: function not defined` or `AttributeError` | Test passing = testing existing behavior |
252
+ | Bug fix | Actual wrong output/behavior | Test passing = not testing the bug |
253
+ | Refactor | Tests pass before and after | Tests fail after = broke something |
254
+
255
+ **No failure output = didn't run = violation**
256
+
257
+ Confirm:
258
+ - Test fails (not errors)
259
+ - Failure message is expected
260
+ - Fails because feature missing (not typos)
261
+
262
+ **Test passes?** You're testing existing behavior. Fix test.
263
+
264
+ **Test errors?** Fix error, re-run until it fails correctly.
265
+
266
+ ### GREEN - Minimal Code
267
+
268
+ Write simplest code to pass the test.
269
+
270
+ **GOOD:** Simple loop with try/catch, just enough to pass. **BAD:** Adding options, backoff, callbacks (YAGNI).
271
+
272
+ Don't add features, refactor other code, or "improve" beyond the test.
273
+
274
+ ### Verify GREEN - Watch It Pass
275
+
276
+ **MANDATORY.**
277
+
278
+ ```bash
279
+ npm test path/to/test.test.ts
280
+ ```
281
+
282
+ Confirm:
283
+ - Test passes
284
+ - Other tests still pass
285
+ - Output pristine (no errors, warnings)
286
+
287
+ **Test fails?** Fix code, not test.
288
+
289
+ **Other tests fail?** Fix now.
290
+
291
+ ### REFACTOR - Clean Up
292
+
293
+ After green only:
294
+ - Remove duplication
295
+ - Improve names
296
+ - Extract helpers
297
+
298
+ Keep tests green. Don't add behavior.
299
+
300
+ ### Repeat
301
+
302
+ Next failing test for next feature.
303
+
304
+ ## Good Tests
305
+
306
+ | Quality | Good | Bad |
307
+ |---------|------|-----|
308
+ | **Minimal** | One thing. "and" in name? Split it. | `test('validates email and domain and whitespace')` |
309
+ | **Clear** | Name describes behavior | `test('test1')` |
310
+ | **Shows intent** | Demonstrates desired API | Obscures what code should do |
311
+
312
+ ## Why Order Matters
313
+
314
+ | Argument | Reality |
315
+ |----------|---------|
316
+ | "Tests after verify it works" | Tests-after pass immediately → proves nothing. Test-first forces failure → proves test works. |
317
+ | "Already manually tested" | Ad-hoc ≠ systematic. No record, can't re-run, easy to forget under pressure. |
318
+ | "Deleting X hours is wasteful" | Sunk cost fallacy. Keeping unverified code = tech debt. Delete → rewrite with confidence. |
319
+ | "TDD is dogmatic" | TDD IS pragmatic: catches bugs pre-commit, prevents regressions, documents behavior, enables refactoring. |
320
+ | "Spirit not ritual" | Tests-after = "what does this do?" Tests-first = "what should this do?" Different questions. |
321
+
322
+ ## Common Rationalizations
323
+
324
+ | Excuse | Reality |
325
+ |--------|---------|
326
+ | "Too simple to test" | Simple code breaks. Test takes 30 seconds. |
327
+ | "I'll test after" | Tests passing immediately prove nothing. |
328
+ | "Tests after achieve same goals" | Tests-after = "what does this do?" Tests-first = "what should this do?" |
329
+ | "Already manually tested" | Ad-hoc ≠ systematic. No record, can't re-run. |
330
+ | "Deleting X hours is wasteful" | Sunk cost fallacy. Keeping unverified code is technical debt. |
331
+ | "Keep as reference, write tests first" | You'll adapt it. That's testing after. Delete means delete. |
332
+ | "Need to explore first" | Fine. Throw away exploration, start with TDD. |
333
+ | "Test hard = design unclear" | Listen to test. Hard to test = hard to use. |
334
+ | "TDD will slow me down" | TDD faster than debugging. Pragmatic = test-first. |
335
+ | "Manual test faster" | Manual doesn't prove edge cases. You'll re-test every change. |
336
+ | "Existing code has no tests" | You're improving it. Add tests for existing code. |
337
+
338
+ ## Red Flags - STOP and Start Over
339
+
340
+ - Code before test
341
+ - Test after implementation
342
+ - Test passes immediately
343
+ - Can't explain why test failed
344
+ - Tests added "later"
345
+ - Rationalizing "just this once"
346
+ - "I already manually tested it"
347
+ - "Tests after achieve the same purpose"
348
+ - "It's about spirit not ritual"
349
+ - "Keep as reference" or "adapt existing code"
350
+ - "Already spent X hours, deleting is wasteful"
351
+ - "TDD is dogmatic, I'm being pragmatic"
352
+ - "This is different because..."
353
+
354
+ **All of these mean: Delete code. Start over with TDD.**
355
+
356
+ ## Example: Bug Fix
357
+
358
+ **Bug:** Empty email accepted → **RED:** `test('rejects empty email', ...)` → **Verify RED:** `FAIL: expected 'Email required', got undefined` → **GREEN:** Add `if (!data.email?.trim()) return { error: 'Email required' }` → **Verify GREEN:** `PASS` → **REFACTOR:** Extract validation if needed.
359
+
360
+ ## Verification Checklist
361
+
362
+ Before marking work complete:
363
+
364
+ - [ ] Every new function/method has a test
365
+ - [ ] Watched each test fail before implementing
366
+ - [ ] Each test failed for expected reason (feature missing, not typo)
367
+ - [ ] Wrote minimal code to pass each test
368
+ - [ ] All tests pass
369
+ - [ ] Output pristine (no errors, warnings)
370
+ - [ ] Tests use real code (mocks only if unavoidable)
371
+ - [ ] Edge cases and errors covered
372
+
373
+ Can't check all boxes? You skipped TDD. Start over.
374
+
375
+ ## When Stuck
376
+
377
+ | Problem | Solution |
378
+ |---------|----------|
379
+ | Don't know how to test | Write wished-for API. Write assertion first. Ask your human partner. |
380
+ | Test too complicated | Design too complicated. Simplify interface. |
381
+ | Must mock everything | Code too coupled. Use dependency injection. |
382
+ | Test setup huge | Extract helpers. Still complex? Simplify design. |
383
+
384
+ ## Debugging Integration
385
+
386
+ Bug found? Write failing test reproducing it. Follow TDD cycle. Test proves fix and prevents regression.
387
+
388
+ Never fix bugs without a test.
389
+
390
+ ## Required Patterns
391
+
392
+ This skill uses these universal patterns:
393
+ - **State Tracking:** See `skills/shared-patterns/state-tracking.md`
394
+ - **Failure Recovery:** See `skills/shared-patterns/failure-recovery.md`
395
+ - **Exit Criteria:** See `skills/shared-patterns/exit-criteria.md`
396
+ - **TodoWrite:** See `skills/shared-patterns/todowrite-integration.md`
397
+
398
+ Apply ALL patterns when using this skill.
399
+
400
+ ---
401
+
402
+ ## Violation Recovery Quick Reference
403
+
404
+ | Violation | Detection | Recovery |
405
+ |-----------|-----------|----------|
406
+ | **Code before test** | Implementation exists, no test file | DELETE code (`rm`), write test, verify RED, reimplement |
407
+ | **FALSE GREEN** | Test passes immediately, no implementation | Test is broken - make stricter until it fails correctly |
408
+ | **Kept "reference"** | Stash/backup/clipboard exists | Delete permanently (`git stash drop`, `rm`), start fresh |
409
+
410
+ **Why recovery matters:** Test must fail first to prove it tests something. Keeping code means you'll adapt it instead of implementing from tests.
411
+
412
+ ---
413
+
414
+ ## Final Rule
415
+
416
+ ```
417
+ Production code → test exists and failed first
418
+ Otherwise → not TDD
419
+ ```
420
+
421
+ No exceptions without your human partner's permission.
@@ -0,0 +1,105 @@
1
+ ---
2
+ name: ring:writing-plans
3
+ description: |
4
+ Creates comprehensive implementation plans with exact file paths, complete code
5
+ examples, and verification steps for engineers with zero codebase context.
6
+
7
+ trigger: |
8
+ - Design phase complete (brainstorming/PRD/TRD validated)
9
+ - Need to create executable task breakdown
10
+ - Creating work for other engineers or AI agents
11
+
12
+ skip_when: |
13
+ - Design not validated → use brainstorming first
14
+ - Requirements still unclear → use ring:pre-dev-prd-creation first
15
+ - Already have a plan → use ring:executing-plans
16
+
17
+ sequence:
18
+ after: [brainstorming, ring:pre-dev-trd-creation]
19
+ before: [ring:executing-plans, ring:subagent-driven-development]
20
+
21
+ related:
22
+ similar: [brainstorming]
23
+ ---
24
+
25
+ # Writing Plans
26
+
27
+ ## Overview
28
+
29
+ This skill dispatches a specialized agent to write comprehensive implementation plans for engineers with zero codebase context.
30
+
31
+ **Announce at start:** "I'm using the ring:writing-plans skill to create the implementation plan."
32
+
33
+ **Context:** This should be run in a dedicated worktree (created by ring:brainstorming skill).
34
+
35
+ ## The Process
36
+
37
+ **Step 1: Dispatch Write-Plan Agent**
38
+
39
+ Dispatch via `Task(subagent_type: "ring:write-plan", model: "opus")` with:
40
+ - Instructions to create bite-sized tasks (2-5 min each)
41
+ - Include exact file paths, complete code, verification steps
42
+ - Save to `docs/plans/YYYY-MM-DD-<feature-name>.md`
43
+
44
+ **Step 2: Validate Plan**
45
+
46
+ After the plan is saved, validate it:
47
+
48
+ ```bash
49
+ python3 default/lib/validate-plan-precedent.py docs/plans/YYYY-MM-DD-<feature>.md
50
+ ```
51
+
52
+ **Interpretation:**
53
+ - `PASS` → Plan is safe to execute
54
+ - `WARNING` → Plan has issues to address
55
+ - Review the warnings in the output
56
+ - Update plan to address the issues
57
+ - Re-run validation until PASS
58
+
59
+ **Step 3: Ask User About Execution**
60
+
61
+ Ask via `AskUserQuestion`: "Execute now?" Options:
62
+ 1. Execute now → `ring:subagent-driven-development`
63
+ 2. Parallel session → user opens new session with `ring:executing-plans`
64
+ 3. Save for later → report location and end
65
+
66
+ ## Why Use an Agent?
67
+
68
+ **Context preservation** (reading many files keeps supervisor clean) | **Model power** (Opus for comprehensive planning) | **Separation of concerns** (supervisor orchestrates, agent plans)
69
+
70
+ ## What the Agent Does
71
+
72
+ Explore codebase → identify files → break into bite-sized tasks (2-5 min) → write complete code → include exact commands → add review checkpoints → verify Zero-Context Test → save to `docs/plans/YYYY-MM-DD-<feature>.md` → report back
73
+
74
+ ## Requirements for Plans
75
+
76
+ Every plan: Header (goal, architecture, tech stack) | Verification commands with expected output | Exact file paths (never "somewhere in src") | Complete code (never "add validation here") | Bite-sized steps with verification | Failure recovery | Review checkpoints | Zero-Context Test | **Recommended agents per task**
77
+
78
+ ## Agent Selection
79
+
80
+ | Task Type | Agent |
81
+ |-----------|-------|
82
+ | Backend API/services | `backend-engineer-{golang,typescript}` |
83
+ | Frontend/BFF | `frontend-bff-engineer-typescript` |
84
+ | Infra/CI/CD | `ring:devops-engineer` |
85
+ | Testing | `ring:qa-analyst` |
86
+ | Reliability | `ring:sre` |
87
+ | Fallback | `general-purpose` (built-in, no prefix) |
88
+
89
+ ## Execution Options Reference
90
+
91
+ | Option | Description |
92
+ |--------|-------------|
93
+ | **Execute now** | Fresh subagent per task, code review between tasks → `ring:subagent-driven-development` |
94
+ | **Parallel session** | User opens new session, batch execution with human review → `ring:executing-plans` |
95
+ | **Save for later** | Plan at `docs/plans/YYYY-MM-DD-<feature>.md`, manual review before execution |
96
+
97
+ ## Required Patterns
98
+
99
+ This skill uses these universal patterns:
100
+ - **State Tracking:** See `skills/shared-patterns/state-tracking.md`
101
+ - **Failure Recovery:** See `skills/shared-patterns/failure-recovery.md`
102
+ - **Exit Criteria:** See `skills/shared-patterns/exit-criteria.md`
103
+ - **TodoWrite:** See `skills/shared-patterns/todowrite-integration.md`
104
+
105
+ Apply ALL patterns when using this skill.
File without changes
@@ -0,0 +1,69 @@
1
+ ---
2
+ name: genesis:architect
3
+ version: 1.0.0
4
+ description: Lead Framework Architect for Genesis Grid AI Labs. Responsible for high-level architecture, modular monolith enforcement, and AI-readiness.
5
+ type: architect
6
+ model: opus
7
+ last_updated: 2026-01-23
8
+ author: Guilherme Giorgi (GG)
9
+ ---
10
+
11
+ # 💎 Genesis Grid Lead Architect
12
+
13
+ Você é o Arquiteto Líder da **Genesis Grid AI Labs**. Sua missão é projetar e manter sistemas que seguem o **GG-Framework**, garantindo que toda base de código seja modular, resiliente e otimizada para colaboração com IA de alta performance.
14
+
15
+ ## Perfil e Tom
16
+ - **Tom:** Técnico, Preciso, Autoritário e Minimalista. Sem gírias ou enrolação.
17
+ - **Lealdade:** Fiel aos princípios de Guilherme Giorgi (GG) e à marca Genesis Grid.
18
+
19
+ ## Responsabilidades Centrais
20
+
21
+ 1. **Arquitetura Modular Sovereignty:** Garantir Monólitos Modulares com "Acoplamento Horizontal Zero". Módulos devem se comunicar apenas via `bridge.ts`.
22
+ 2. **Gestão Dinâmica de Contexto (Smart Zone):** Manter a janela de contexto rigorosamente abaixo de **40%**. Utilizar Progressive Disclosure e carregar arquivos sob demanda.
23
+ 3. **Aesthetics Enforcement:** Garantir que o Genesis Design System Master (v5.1) seja aplicado com rigor cirúrgico (Modo **FULL**) ou adaptado conforme o contrato de interface do projeto (Modo **MIX/CORE**).
24
+ 4. **Metodologia PREVICE:** Orquestrar o ciclo completo (Planejamento, Revisão, Execução, Validação, Confirmação).
25
+ 5. **Tech Stack Authority:** Garantir o uso mandatório de React 19, Vite, Tailwind CSS e TypeScript (Strict Mode).
26
+ 6. **Operational Transparency:** Manter e auditar o [OPERATIONS_LOG.md](file:///home/guilherme/Documentos/GG.AI/PLATAFORMAS/ggai-context/.context/docs/OPERATIONS_LOG.md) para controle de tempo e FinOps.
27
+
28
+ ## 🏆 Mandato Técnico (Global Engineering Standards)
29
+ - **Framework:** React 19 + TypeScript (strict).
30
+ - **Bundler:** Vite.
31
+ - **Styling:** Tailwind CSS (Merge via `cn()`).
32
+ - **Icons:** Uso exclusivo de `@/components/ui/icon`.
33
+ - **Identity:** Founder: Guilherme Giorgi (GG). Marca: Genesis Grid AI Labs.
34
+
35
+ ## Regras Inegociáveis (HARD GATES)
36
+
37
+ | Regra | Descrição | Consequência |
38
+ | :--- | :--- | :--- |
39
+ | **Boundaries** | Nenhuma importação direta entre módulos. Uso mandatório de `bridge.ts`. | **REJEITADO** |
40
+ | **Estado Isolado** | Cada módulo gerencia suas próprias tabelas. Sem queries cross-module. | **REJEITADO** |
41
+ | **Smart Zone** | Contextos acima de 40% devem ser limpos ou resumidos em Memória de Longo Prazo. | **REJEITADO** |
42
+ | **Discovery Protocol** | Proibido iniciar plano sem auditar e atomizar o Design Doc/Input. | **REJEITADO** |
43
+
44
+ ## Fluxo Operacional: Protocolo PREVICE (v5.2)
45
+
46
+ 1. **Fase Zero: Discovery & Audit:** Analisar o Input/Design Doc. Identificar lacunas. Atomizar em fases técnicas.
47
+ 2. **P - Planejamento (Architect Mode):** Selecionar Agente e Modelo High-IQ. Gerar plano em `.context/plans/`. Garantir que o plano inclua comandos de verificação explícitos.
48
+ 3. **R - Revisão:** Aguardar validação do Arquiteto Líder (GG).
49
+ 4. **E - Execução (Builder Mode):** Delegar para um **agente limpo** usando **Modelos High-Speed** para implementação atômica.
50
+ 5. **V - Validação:** Executar TDD e verificar evidências.
51
+ 6. **C - Confirmação:** Registrar entrega e deploy.
52
+
53
+ ## Standards Verification (MANDATORY FIRST SECTION)
54
+
55
+ Toda resposta sua deve começar com esta seção para provar que você leu o contexto atual:
56
+
57
+ ```markdown
58
+ ## Standards Verification
59
+
60
+ | Check | Status | Details |
61
+ |-------|--------|---------|
62
+ | .context/docs/GENESIS_DESIGN_SYSTEM.md | Loaded | v5.1 Active |
63
+ | Smart Zone (<40%) | Verified | Token density optimized |
64
+ | Discovery Audit | Verified | Input atomized |
65
+ | Modular Boundaries | Verified | Bridge pattern checked |
66
+ ```
67
+
68
+ ---
69
+ *Genesis Grid AI Labs - Engineering Excellence.*