@su-record/vibe 2.16.4 → 3.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (267) hide show
  1. package/CLAUDE.md +8 -8
  2. package/README.en.md +46 -29
  3. package/README.md +41 -24
  4. package/agents/acceptance-tester.md +56 -0
  5. package/agents/architect.md +25 -67
  6. package/agents/build-error-resolver.md +28 -97
  7. package/agents/code-reviewer.md +89 -0
  8. package/agents/diagrammer.md +34 -169
  9. package/agents/documenter.md +43 -0
  10. package/agents/e2e-tester.md +46 -281
  11. package/agents/event/event-ops.md +54 -77
  12. package/agents/event/event-planner.md +63 -0
  13. package/agents/figma/figma-engineer.md +76 -0
  14. package/agents/implementer.md +26 -41
  15. package/agents/security-reviewer.md +56 -0
  16. package/agents/tester.md +37 -33
  17. package/agents/ui/design-reviewer.md +62 -0
  18. package/agents/ui/design-system-gen.md +63 -0
  19. package/dist/cli/commands/remove.d.ts.map +1 -1
  20. package/dist/cli/commands/remove.js +8 -10
  21. package/dist/cli/commands/remove.js.map +1 -1
  22. package/dist/cli/index.d.ts +0 -4
  23. package/dist/cli/index.d.ts.map +1 -1
  24. package/dist/cli/index.js +0 -4
  25. package/dist/cli/index.js.map +1 -1
  26. package/dist/cli/llm/model-refresh.js +1 -1
  27. package/dist/cli/llm/model-refresh.js.map +1 -1
  28. package/dist/cli/postinstall/claude-agents.d.ts.map +1 -1
  29. package/dist/cli/postinstall/claude-agents.js +16 -77
  30. package/dist/cli/postinstall/claude-agents.js.map +1 -1
  31. package/dist/cli/postinstall/constants.d.ts.map +1 -1
  32. package/dist/cli/postinstall/constants.js +80 -296
  33. package/dist/cli/postinstall/constants.js.map +1 -1
  34. package/dist/cli/postinstall/cursor-agents.d.ts +5 -0
  35. package/dist/cli/postinstall/cursor-agents.d.ts.map +1 -1
  36. package/dist/cli/postinstall/cursor-agents.js +26 -68
  37. package/dist/cli/postinstall/cursor-agents.js.map +1 -1
  38. package/dist/cli/postinstall/cursor-skills.d.ts.map +1 -1
  39. package/dist/cli/postinstall/cursor-skills.js +26 -30
  40. package/dist/cli/postinstall/cursor-skills.js.map +1 -1
  41. package/dist/cli/postinstall/main.d.ts.map +1 -1
  42. package/dist/cli/postinstall/main.js +0 -2
  43. package/dist/cli/postinstall/main.js.map +1 -1
  44. package/dist/cli/setup/Provisioner.d.ts.map +1 -1
  45. package/dist/cli/setup/Provisioner.js +19 -21
  46. package/dist/cli/setup/Provisioner.js.map +1 -1
  47. package/dist/cli/utils.d.ts +4 -1
  48. package/dist/cli/utils.d.ts.map +1 -1
  49. package/dist/cli/utils.js +4 -1
  50. package/dist/cli/utils.js.map +1 -1
  51. package/dist/infra/lib/FrameworkDetector.js +4 -4
  52. package/dist/infra/lib/FrameworkDetector.js.map +1 -1
  53. package/dist/infra/lib/OrchestrateWorkflow.js +2 -2
  54. package/dist/infra/lib/OrchestrateWorkflow.js.map +1 -1
  55. package/dist/infra/lib/browser/launch.js +1 -1
  56. package/dist/infra/lib/browser/launch.js.map +1 -1
  57. package/dist/infra/lib/browser/types.d.ts +1 -1
  58. package/dist/infra/lib/browser/types.js +1 -1
  59. package/dist/infra/lib/constants.d.ts +1 -1
  60. package/dist/infra/lib/constants.d.ts.map +1 -1
  61. package/dist/infra/lib/constants.js +4 -5
  62. package/dist/infra/lib/constants.js.map +1 -1
  63. package/dist/infra/lib/evolution/__tests__/integration.test.js +7 -7
  64. package/dist/infra/lib/evolution/__tests__/integration.test.js.map +1 -1
  65. package/dist/infra/lib/memory/index.d.ts +0 -2
  66. package/dist/infra/lib/memory/index.d.ts.map +1 -1
  67. package/dist/infra/lib/memory/index.js +0 -2
  68. package/dist/infra/lib/memory/index.js.map +1 -1
  69. package/dist/infra/lib/telemetry/SkillTelemetry.test.js +1 -1
  70. package/dist/infra/lib/telemetry/SkillTelemetry.test.js.map +1 -1
  71. package/dist/tools/index.d.ts +0 -4
  72. package/dist/tools/index.d.ts.map +1 -1
  73. package/dist/tools/index.js +0 -4
  74. package/dist/tools/index.js.map +1 -1
  75. package/dist/tools/memory/autoSaveContext.d.ts +0 -1
  76. package/dist/tools/memory/autoSaveContext.d.ts.map +1 -1
  77. package/dist/tools/memory/autoSaveContext.js +13 -27
  78. package/dist/tools/memory/autoSaveContext.js.map +1 -1
  79. package/hooks/scripts/__tests__/code-check-detectors.test.js +2 -2
  80. package/hooks/scripts/__tests__/run-ledger.test.js +1 -1
  81. package/hooks/scripts/__tests__/scope-from-spec.test.js +12 -12
  82. package/hooks/scripts/__tests__/step-counter.test.js +1 -1
  83. package/hooks/scripts/code-check.js +16 -203
  84. package/hooks/scripts/context-save.js +0 -11
  85. package/hooks/scripts/lib/scope-from-spec.js +9 -6
  86. package/hooks/scripts/post-edit-dispatcher.js +1 -1
  87. package/hooks/scripts/prompt-dispatcher.js +7 -18
  88. package/hooks/scripts/session-start.js +25 -35
  89. package/package.json +2 -4
  90. package/skills/agents-md/SKILL.md +62 -15
  91. package/skills/arch-guard/SKILL.md +1 -1
  92. package/skills/brand-assets/SKILL.md +2 -2
  93. package/skills/capability-loop/SKILL.md +1 -1
  94. package/skills/chub-usage/SKILL.md +1 -1
  95. package/skills/commerce-patterns/SKILL.md +2 -2
  96. package/skills/commit-push-pr/SKILL.md +0 -1
  97. package/skills/context7-usage/SKILL.md +1 -1
  98. package/skills/design-refine/SKILL.md +140 -0
  99. package/skills/{design-polish → design-refine}/templates/polish-report.md +1 -1
  100. package/skills/{design-normalize → design-refine}/templates/token-audit.md +3 -3
  101. package/skills/design-review/SKILL.md +143 -0
  102. package/skills/{design-audit → design-review}/agents/a11y-auditor.md +1 -1
  103. package/skills/{design-audit → design-review}/agents/performance-auditor.md +1 -1
  104. package/skills/{design-audit → design-review}/agents/responsive-auditor.md +1 -1
  105. package/skills/{design-audit → design-review}/agents/slop-detector.md +1 -1
  106. package/skills/{design-audit → design-review}/frameworks/core-web-vitals.md +1 -1
  107. package/skills/{design-audit → design-review}/frameworks/wcag-checklist.md +1 -1
  108. package/skills/{design-audit → design-review}/orchestrator.md +3 -3
  109. package/skills/{design-critique → design-review}/templates/critique-report.md +3 -3
  110. package/skills/{design-audit → design-review}/templates/report.md +3 -3
  111. package/skills/design-teach/SKILL.md +11 -11
  112. package/skills/docs/SKILL.md +14 -16
  113. package/skills/e2e-commerce/SKILL.md +1 -1
  114. package/skills/event-comms/SKILL.md +1 -1
  115. package/skills/event-ops/SKILL.md +2 -2
  116. package/skills/event-planning/SKILL.md +1 -1
  117. package/skills/exec-plan/SKILL.md +2 -2
  118. package/skills/figma/SKILL.md +240 -148
  119. package/skills/figma/rubrics/css-mapping.md +125 -0
  120. package/skills/git-worktree/SKILL.md +1 -1
  121. package/skills/handoff/SKILL.md +1 -1
  122. package/skills/parallel-research/SKILL.md +14 -28
  123. package/skills/priority-todos/SKILL.md +1 -1
  124. package/skills/regress/SKILL.md +11 -0
  125. package/skills/restraint/SKILL.md +72 -0
  126. package/skills/seo-checklist/SKILL.md +2 -2
  127. package/skills/spec/SKILL.md +65 -836
  128. package/skills/test/SKILL.md +3 -3
  129. package/skills/tool-fallback/SKILL.md +2 -2
  130. package/skills/vercel-react-best-practices/SKILL.md +1 -1
  131. package/skills/vibe/SKILL.md +20 -35
  132. package/skills/vibe.analyze/SKILL.md +7 -9
  133. package/skills/vibe.docs/SKILL.md +1 -1
  134. package/skills/vibe.event/SKILL.md +27 -27
  135. package/skills/vibe.figma/SKILL.md +14 -18
  136. package/skills/vibe.harness/SKILL.md +5 -5
  137. package/skills/vibe.reason/SKILL.md +0 -2
  138. package/skills/vibe.review/SKILL.md +45 -49
  139. package/skills/vibe.run/SKILL.md +2 -5
  140. package/skills/vibe.run/references/parallel-agents.md +33 -98
  141. package/skills/vibe.spec/SKILL.md +38 -535
  142. package/skills/vibe.utils/SKILL.md +3 -3
  143. package/skills/vibe.verify/SKILL.md +70 -542
  144. package/skills/video-production/SKILL.md +1 -1
  145. package/vibe/rules/orchestrator-contract.md +5 -4
  146. package/vibe/rules/quality/performance.md +1 -1
  147. package/vibe/templates/claudemd-template.md +1 -1
  148. package/vibe/templates/spec-template.md +35 -185
  149. package/agents/architect-low.md +0 -41
  150. package/agents/architect-medium.md +0 -59
  151. package/agents/compounder.md +0 -265
  152. package/agents/docs/api-documenter.md +0 -99
  153. package/agents/docs/changelog-writer.md +0 -93
  154. package/agents/event/event-comms.md +0 -78
  155. package/agents/event/event-content.md +0 -68
  156. package/agents/event/event-image.md +0 -95
  157. package/agents/event/event-scheduler.md +0 -69
  158. package/agents/event/event-speaker.md +0 -86
  159. package/agents/explorer-low.md +0 -42
  160. package/agents/explorer-medium.md +0 -59
  161. package/agents/explorer.md +0 -48
  162. package/agents/figma/figma-analyst.md +0 -56
  163. package/agents/figma/figma-architect.md +0 -116
  164. package/agents/figma/figma-auditor.md +0 -86
  165. package/agents/figma/figma-builder.md +0 -104
  166. package/agents/implementer-low.md +0 -43
  167. package/agents/implementer-medium.md +0 -52
  168. package/agents/junior-mentor.md +0 -141
  169. package/agents/planning/requirements-analyst.md +0 -84
  170. package/agents/planning/ux-advisor.md +0 -83
  171. package/agents/qa/acceptance-tester.md +0 -86
  172. package/agents/qa/edge-case-finder.md +0 -93
  173. package/agents/qa/qa-coordinator.md +0 -131
  174. package/agents/refactor-cleaner.md +0 -143
  175. package/agents/research/best-practices.md +0 -199
  176. package/agents/research/codebase-patterns.md +0 -157
  177. package/agents/research/framework-docs.md +0 -188
  178. package/agents/research/security-advisory.md +0 -213
  179. package/agents/review/architecture-reviewer.md +0 -107
  180. package/agents/review/complexity-reviewer.md +0 -116
  181. package/agents/review/data-integrity-reviewer.md +0 -88
  182. package/agents/review/git-history-reviewer.md +0 -103
  183. package/agents/review/performance-reviewer.md +0 -86
  184. package/agents/review/python-reviewer.md +0 -150
  185. package/agents/review/rails-reviewer.md +0 -139
  186. package/agents/review/react-reviewer.md +0 -144
  187. package/agents/review/security-reviewer.md +0 -80
  188. package/agents/review/simplicity-reviewer.md +0 -140
  189. package/agents/review/test-coverage-reviewer.md +0 -116
  190. package/agents/review/typescript-reviewer.md +0 -127
  191. package/agents/searcher.md +0 -54
  192. package/agents/simplifier.md +0 -124
  193. package/agents/teams/debug-team.md +0 -74
  194. package/agents/teams/dev-team.md +0 -92
  195. package/agents/teams/docs-team.md +0 -84
  196. package/agents/teams/figma-team.md +0 -89
  197. package/agents/teams/fullstack-team.md +0 -87
  198. package/agents/teams/lite-team.md +0 -73
  199. package/agents/teams/migration-team.md +0 -82
  200. package/agents/teams/refactor-team.md +0 -98
  201. package/agents/teams/research-team.md +0 -90
  202. package/agents/teams/review-debate-team.md +0 -129
  203. package/agents/teams/security-team.md +0 -85
  204. package/agents/ui/ui-a11y-auditor.md +0 -93
  205. package/agents/ui/ui-antipattern-detector.md +0 -102
  206. package/agents/ui/ui-dataviz-advisor.md +0 -69
  207. package/agents/ui/ui-design-system-gen.md +0 -57
  208. package/agents/ui/ui-industry-analyzer.md +0 -49
  209. package/agents/ui/ui-layout-architect.md +0 -65
  210. package/agents/ui/ui-stack-implementer.md +0 -68
  211. package/agents/ui/ux-compliance-reviewer.md +0 -81
  212. package/agents/ui-previewer.md +0 -262
  213. package/hooks/scripts/__tests__/keyword-detector.test.js +0 -242
  214. package/hooks/scripts/keyword-detector.js +0 -226
  215. package/skills/characterization-test/SKILL.md +0 -209
  216. package/skills/characterization-test/agents/behavior-capturer.md +0 -50
  217. package/skills/characterization-test/agents/coverage-checker.md +0 -54
  218. package/skills/characterization-test/agents/reporter.md +0 -50
  219. package/skills/characterization-test/agents/test-writer.md +0 -49
  220. package/skills/characterization-test/rubrics/coverage-criteria.md +0 -53
  221. package/skills/characterization-test/templates/test-template.ts +0 -101
  222. package/skills/claude-md-guide/SKILL.md +0 -353
  223. package/skills/claude-md-guide/rubrics/anti-patterns.md +0 -88
  224. package/skills/design-audit/SKILL.md +0 -154
  225. package/skills/design-critique/SKILL.md +0 -140
  226. package/skills/design-distill/SKILL.md +0 -131
  227. package/skills/design-normalize/SKILL.md +0 -135
  228. package/skills/design-polish/SKILL.md +0 -132
  229. package/skills/figma-convert/SKILL.md +0 -236
  230. package/skills/figma-extract/SKILL.md +0 -242
  231. package/skills/interview/SKILL.md +0 -358
  232. package/skills/interview/checklists/api.md +0 -101
  233. package/skills/interview/checklists/feature.md +0 -88
  234. package/skills/interview/checklists/library.md +0 -95
  235. package/skills/interview/checklists/mobile.md +0 -89
  236. package/skills/interview/checklists/webapp.md +0 -97
  237. package/skills/interview/checklists/website.md +0 -99
  238. package/skills/plan/SKILL.md +0 -254
  239. package/skills/rob-pike/SKILL.md +0 -66
  240. package/skills/spec/references/askuser-examples.md +0 -57
  241. package/skills/spec/references/example-session.md +0 -87
  242. package/skills/spec/references/templates.md +0 -194
  243. package/skills/spec-review/SKILL.md +0 -725
  244. package/skills/systematic-debugging/SKILL.md +0 -142
  245. package/skills/techdebt/SKILL.md +0 -126
  246. package/skills/techdebt/agents/analyzer.md +0 -50
  247. package/skills/techdebt/agents/fixer.md +0 -41
  248. package/skills/techdebt/agents/reviewer.md +0 -47
  249. package/skills/techdebt/agents/scanner.md +0 -44
  250. package/skills/techdebt/orchestrator.md +0 -72
  251. package/skills/techdebt/rubrics/severity.md +0 -51
  252. package/skills/techdebt/scripts/scan.js +0 -90
  253. package/skills/techdebt/templates/report.md +0 -86
  254. package/skills/typescript-advanced-types/SKILL.md +0 -68
  255. package/skills/typescript-advanced-types/rubrics/type-patterns.md +0 -109
  256. package/skills/yagni-ladder/SKILL.md +0 -90
  257. /package/skills/{claude-md-guide → agents-md}/templates/claude-md.md +0 -0
  258. /package/skills/{design-polish → design-refine}/rubrics/polish-checklist.md +0 -0
  259. /package/skills/{design-normalize → design-refine}/rubrics/token-naming.md +0 -0
  260. /package/skills/{design-distill → design-refine}/templates/design-system.md +0 -0
  261. /package/skills/{design-audit → design-review}/agents/scorer.md +0 -0
  262. /package/skills/{design-audit → design-review}/rubrics/ai-slop-patterns.md +0 -0
  263. /package/skills/{design-audit → design-review}/rubrics/scoring.md +0 -0
  264. /package/skills/{design-critique → design-review}/rubrics/ux-heuristics.md +0 -0
  265. /package/skills/{figma-convert → figma}/rubrics/conversion-rules.md +0 -0
  266. /package/skills/{figma-extract → figma}/rubrics/image-rules.md +0 -0
  267. /package/skills/{figma-convert → figma}/templates/component.md +0 -0
@@ -1,226 +0,0 @@
1
- #!/usr/bin/env node
2
- /**
3
- * Keyword Detector & Combiner
4
- * 매직 키워드 감지 및 조합 처리
5
- */
6
-
7
- import { VIBE_PATH, PROJECT_DIR } from './utils.js';
8
-
9
- // 매직 키워드 정의
10
- const MAGIC_KEYWORDS = {
11
- // Deprecated: 기본 루프 동작과 동일 (no-op). exit=coverage-100으로 해석.
12
- ralph: {
13
- name: 'Ralph (deprecated alias)',
14
- description: '[deprecated] Looping to convergence is the default; alias mapped',
15
- flags: ['persistence', 'verification'],
16
- output: '[vibe] \'ralph\' is deprecated — looping to convergence is the default; alias mapped.',
17
- },
18
-
19
- // 울트라워크 모드 (automationLevel: autonomous + 병렬 ACT)
20
- ultrawork: {
21
- name: 'Ultrawork',
22
- description: 'automationLevel: autonomous + parallel ACT (deprecated alias)',
23
- flags: ['parallel', 'auto_continue', 'no_confirmation'],
24
- output: '[ULTRAWORK] automationLevel: autonomous + parallel ACT. Loop runs to convergence; stuck → auto-TODO (no confirmation).',
25
- },
26
- ulw: {
27
- alias: 'ultrawork',
28
- },
29
- 울트라워크: {
30
- alias: 'ultrawork',
31
- },
32
-
33
- // 계획 모드
34
- plan: {
35
- name: 'Plan Mode',
36
- description: 'Planning interview mode',
37
- flags: ['planning', 'interview'],
38
- output: '[PLAN MODE] Enter planning interview mode. Gather requirements before implementation.',
39
- strict: true, // 일상어 — 명령 끝 위치 또는 --plan 플래그에서만 (오탐 방지)
40
- },
41
-
42
- // Ralph + Plan 조합
43
- ralplan: {
44
- name: 'Ralph Plan',
45
- description: 'Iterative planning with persistence',
46
- flags: ['persistence', 'planning', 'iteration'],
47
- output: '[RALPLAN MODE] Iterative planning with consensus. Will refine plan until approved, then execute with Ralph persistence.',
48
- },
49
-
50
- // Deprecated: 기본 JUDGE는 항상 결정론 검증 (no-op)
51
- verify: {
52
- name: 'Verify (deprecated alias)',
53
- description: '[deprecated] Deterministic verification is the default; alias mapped',
54
- flags: ['verification', 'strict'],
55
- output: '[vibe] \'verify\' is deprecated — deterministic JUDGE is the default; alias mapped.',
56
- strict: true, // 일상어 ("please verify the fix" 오탐 방지)
57
- },
58
-
59
- // 탐색 모드
60
- explore: {
61
- name: 'Explore Mode',
62
- description: 'Deep codebase exploration',
63
- flags: ['exploration', 'thorough'],
64
- output: '[EXPLORE MODE] Deep exploration enabled. Use multiple Explore agents for thorough codebase analysis.',
65
- strict: true, // 일상어 ("let me explore the options" 오탐 방지)
66
- },
67
-
68
- // Deprecated: --max-iter 1 매핑
69
- quick: {
70
- name: 'Quick (deprecated alias)',
71
- description: '[deprecated] Maps to --max-iter 1; use --max-iter 1 explicitly',
72
- flags: ['fast', 'minimal_verification'],
73
- output: '[vibe] \'quick\' maps to --max-iter 1 (single-pass, minimal JUDGE).',
74
- strict: true, // 일상어 ("quick question on auth" 오탐 방지)
75
- },
76
- };
77
-
78
- // 키워드 조합 시너지 (deprecated alias 조합도 매핑 유지)
79
- const KEYWORD_SYNERGIES = {
80
- 'ralph+ultrawork': {
81
- name: 'Ralph+Ultrawork (deprecated)',
82
- output: '[vibe] \'ralph\'+\'ultrawork\' deprecated: automationLevel: autonomous + parallel ACT, exit=coverage-100.',
83
- },
84
- 'ralph+verify': {
85
- name: 'Ralph+Verify (deprecated)',
86
- output: '[vibe] \'ralph\'+\'verify\' deprecated: both are default behavior; alias mapped.',
87
- },
88
- 'ultrawork+explore': {
89
- name: 'Ultrawork+Explore',
90
- output: '[ULTRAWORK+EXPLORE] automationLevel: autonomous + parallel exploration agents.',
91
- },
92
- };
93
-
94
- /**
95
- * 텍스트에서 키워드 추출
96
- */
97
- function detectKeywords(text) {
98
- const lowerText = text.toLowerCase();
99
- const detected = [];
100
- const resolvedKeywords = new Map();
101
-
102
- for (const [keyword, config] of Object.entries(MAGIC_KEYWORDS)) {
103
- // alias는 본체의 strict 설정을 따른다.
104
- const target = config.alias ? MAGIC_KEYWORDS[config.alias] : config;
105
- // strict 키워드(일상어: quick/plan/verify/explore)는 단어경계만으로는
106
- // "quick question", "please verify" 등에 오탐한다. 따라서
107
- // ① 명령 끝 위치의 독립 토큰 ("... 만들어줘 quick") 또는
108
- // ② 명시 플래그 ("--quick", "-quick", "/quick")
109
- // 에서만 매칭한다. 조어(ralph/ultrawork)는 오탐이 거의 없어 단어경계 유지.
110
- const regex = target.strict
111
- ? new RegExp(`(?:(?:^|\\s)--?${keyword}\\b)|(?:(?:^|\\s)${keyword}\\s*$)`, 'i')
112
- : new RegExp(`\\b${keyword}\\b`, 'i');
113
- if (regex.test(lowerText)) {
114
- // alias 해결
115
- const resolved = config.alias ? MAGIC_KEYWORDS[config.alias] : config;
116
- const resolvedName = config.alias || keyword;
117
-
118
- if (!resolvedKeywords.has(resolvedName)) {
119
- resolvedKeywords.set(resolvedName, resolved);
120
- detected.push({
121
- keyword: resolvedName,
122
- original: keyword,
123
- ...resolved,
124
- });
125
- }
126
- }
127
- }
128
-
129
- return detected;
130
- }
131
-
132
- /**
133
- * 키워드 조합 처리
134
- */
135
- function processCombinations(detected) {
136
- if (detected.length <= 1) {
137
- return null;
138
- }
139
-
140
- // 키워드 이름 정렬하여 조합 키 생성
141
- const keywordNames = detected.map(d => d.keyword).sort();
142
-
143
- // 모든 2-조합 확인
144
- for (let i = 0; i < keywordNames.length; i++) {
145
- for (let j = i + 1; j < keywordNames.length; j++) {
146
- const comboKey = `${keywordNames[i]}+${keywordNames[j]}`;
147
- if (KEYWORD_SYNERGIES[comboKey]) {
148
- return KEYWORD_SYNERGIES[comboKey];
149
- }
150
- }
151
- }
152
-
153
- return null;
154
- }
155
-
156
- /**
157
- * 모든 플래그 수집
158
- */
159
- function collectFlags(detected) {
160
- const flags = new Set();
161
- for (const d of detected) {
162
- if (d.flags) {
163
- d.flags.forEach(f => flags.add(f));
164
- }
165
- }
166
- return Array.from(flags);
167
- }
168
-
169
- /**
170
- * 출력 생성
171
- */
172
- function generateOutput(detected, combination) {
173
- const outputs = [];
174
-
175
- // 시너지 조합 우선
176
- if (combination) {
177
- outputs.push(combination.output);
178
- } else {
179
- // 개별 키워드 출력
180
- for (const d of detected) {
181
- if (d.output) {
182
- outputs.push(d.output);
183
- }
184
- }
185
- }
186
-
187
- // 모든 플래그 수집
188
- const flags = collectFlags(detected);
189
- if (flags.length > 0) {
190
- outputs.push(`[FLAGS] ${flags.join(', ')}`);
191
- }
192
-
193
- return outputs.join('\n');
194
- }
195
-
196
- // 메인 실행
197
- const input = process.argv.slice(2).join(' ') || process.env.USER_PROMPT || '';
198
-
199
- if (!input) {
200
- console.log(`
201
- VIBE Keyword Detector
202
-
203
- Available magic keywords:
204
- ${Object.entries(MAGIC_KEYWORDS)
205
- .filter(([_, v]) => !v.alias)
206
- .map(([k, v]) => ` ${k.padEnd(12)} - ${v.description}`)
207
- .join('\n')}
208
-
209
- Keyword combinations:
210
- ${Object.entries(KEYWORD_SYNERGIES)
211
- .map(([k, v]) => ` ${k.padEnd(20)} - ${v.name}`)
212
- .join('\n')}
213
-
214
- Usage:
215
- node keyword-detector.js "implement login ralph ultrawork"
216
- `);
217
- process.exit(0);
218
- }
219
-
220
- const detected = detectKeywords(input);
221
-
222
- if (detected.length > 0) {
223
- const combination = processCombinations(detected);
224
- const output = generateOutput(detected, combination);
225
- console.log(output);
226
- }
@@ -1,209 +0,0 @@
1
- ---
2
- name: characterization-test
3
- user-invocable: false
4
- invocation: [auto]
5
- tier: core
6
- description: "Lock existing behavior with characterization tests BEFORE refactoring or modifying legacy/untested code (files >200 lines without tests)."
7
- triggers: [legacy, characterization test, lock behavior, regression prevention, before refactor, large file, refactor, rewrite, modernize, clean up]
8
- priority: 65
9
- ---
10
-
11
- # Characterization Test Skill
12
-
13
- > **Philosophy: "Never change what you cannot verify"**
14
-
15
- Lock existing behavior with snapshot/characterization tests before modifying code. This prevents regressions in legacy, complex, or unfamiliar codebases.
16
-
17
- ## Pre-check (K1)
18
-
19
- > Are you modifying existing code with uncertain behavior? If the code is new (you just wrote it), well-tested, or trivially simple, skip characterization tests and write regular unit tests instead.
20
-
21
- ## When to Use
22
-
23
- | Scenario | Signal |
24
- |----------|--------|
25
- | Legacy file (>500 lines) | Large files with accumulated behavior |
26
- | Complex branching | Multiple if/else, switch, ternary chains |
27
- | API endpoint modification | Request/response contract must be preserved |
28
- | Database schema change | Migration must preserve existing data semantics |
29
- | Refactoring request | "refactor", "clean up", "simplify" keywords |
30
- | Unfamiliar code | No prior context about the module |
31
-
32
- ## Core Workflow
33
-
34
- ```
35
- ANALYZE → GENERATE → VERIFY → CHANGE → REGRESS → RECONCILE
36
- ```
37
-
38
- ### Step 1: ANALYZE
39
-
40
- Explore the target code to understand its current behavior.
41
-
42
- **Parallel exploration** (use sub-agents when available):
43
- - Read the target file(s)
44
- - Identify all public exports / API surface
45
- - Map branching paths (if/else, switch, try/catch)
46
- - List external dependencies and side effects
47
- - Check for existing tests
48
-
49
- **Analysis checklist:**
50
- - [ ] All public functions identified
51
- - [ ] Input parameter ranges documented
52
- - [ ] Edge cases listed (null, empty, boundary values)
53
- - [ ] Side effects cataloged (DB writes, file I/O, network calls)
54
- - [ ] Error paths mapped
55
-
56
- ### Step 2: GENERATE
57
-
58
- Create characterization tests that capture current behavior as-is.
59
-
60
- **TypeScript template:**
61
- ```typescript
62
- import { describe, it, expect } from 'vitest';
63
-
64
- describe('[ModuleName] characterization tests', () => {
65
- // Happy path - capture normal behavior
66
- it('should [describe current behavior]', () => {
67
- const result = targetFunction(normalInput);
68
- // Snapshot the ACTUAL output, not what you THINK it should be
69
- expect(result).toMatchSnapshot();
70
- });
71
-
72
- // Edge cases - capture boundary behavior
73
- it('should handle empty input', () => {
74
- const result = targetFunction('');
75
- expect(result).toMatchSnapshot();
76
- });
77
-
78
- // Error paths - capture failure modes
79
- it('should handle invalid input', () => {
80
- expect(() => targetFunction(null)).toThrowErrorMatchingSnapshot();
81
- });
82
- });
83
- ```
84
-
85
- **Python template:**
86
- ```python
87
- import pytest
88
-
89
- class TestModuleNameCharacterization:
90
- """Lock existing behavior before modification."""
91
-
92
- def test_normal_behavior(self, snapshot):
93
- result = target_function(normal_input)
94
- assert result == snapshot
95
-
96
- def test_empty_input(self, snapshot):
97
- result = target_function("")
98
- assert result == snapshot
99
-
100
- def test_invalid_input(self):
101
- with pytest.raises(Exception) as exc_info:
102
- target_function(None)
103
- assert str(exc_info.value) # Capture error message
104
- ```
105
-
106
- **Key principles:**
107
- - Test ACTUAL behavior, not expected behavior
108
- - Use `toMatchSnapshot()` / snapshot assertions
109
- - Cover every public function
110
- - Include edge cases and error paths
111
- - Do NOT fix bugs in characterization tests
112
-
113
- ### Step 3: VERIFY
114
-
115
- Run the characterization tests to confirm they pass with current code.
116
-
117
- ```bash
118
- # TypeScript
119
- npx vitest run --reporter=verbose [test-file]
120
-
121
- # Python
122
- pytest -v [test-file]
123
- ```
124
-
125
- - All tests MUST pass before proceeding
126
- - If any test fails, the characterization is wrong — fix the test, not the code
127
- - Update snapshots if needed: `npx vitest run -u [test-file]`
128
-
129
- ### Step 4: CHANGE
130
-
131
- Now implement the requested modification.
132
-
133
- - Make changes incrementally
134
- - Run characterization tests after each change
135
- - Any unexpected test failure = potential regression
136
-
137
- ### Step 5: REGRESS
138
-
139
- Run full characterization test suite after all changes.
140
-
141
- ```bash
142
- npx vitest run [characterization-test-file]
143
- ```
144
-
145
- - **All passing**: Changes preserve existing behavior
146
- - **Expected failures**: Tests for intentionally changed behavior
147
- - **Unexpected failures**: STOP — investigate regression
148
-
149
- ### Step 6: RECONCILE
150
-
151
- Update characterization tests to match new intended behavior.
152
-
153
- - Review each failing test individually
154
- - Confirm the failure is due to intentional change
155
- - Update snapshot: `npx vitest run -u`
156
- - Add NEW tests for new behavior
157
- - Document why each test changed
158
-
159
- ## Scenario-Specific Workflows
160
-
161
- ### Legacy File (>500 lines)
162
-
163
- 1. Generate function-level characterization tests
164
- 2. Focus on public API surface first
165
- 3. Add integration tests for cross-function flows
166
- 4. Refactor in small increments
167
-
168
- ### Complex Branching
169
-
170
- 1. Map all branches with a decision tree
171
- 2. Write one test per branch path
172
- 3. Include boundary values for each condition
173
- 4. Test combinations of related conditions
174
-
175
- ### API Endpoint
176
-
177
- 1. Capture request/response pairs for all routes
178
- 2. Test all HTTP methods, status codes, headers
179
- 3. Include authentication/authorization paths
180
- 4. Test error responses and validation messages
181
-
182
- ### Database Schema
183
-
184
- 1. Create fixtures with representative data
185
- 2. Test queries before and after migration
186
- 3. Verify data integrity post-migration
187
- 4. Test rollback scenarios
188
-
189
- ## Integration with VIBE Workflow
190
-
191
- ### With `/vibe.spec`
192
- Add characterization test phase to SPEC before implementation:
193
- ```
194
- ## Pre-Implementation
195
- - [ ] Characterization tests written for affected modules
196
- - [ ] All characterization tests passing
197
- ```
198
-
199
- ### With `/vibe.run`
200
- The implementation agent should:
201
- 1. Check for characterization tests before modifying files
202
- 2. Run them before and after changes
203
- 3. Flag any unexpected failures
204
-
205
- ### With `/vibe.review`
206
- Review agents verify:
207
- - Characterization tests exist for modified legacy code
208
- - No regressions in existing behavior
209
- - New behavior has corresponding new tests
@@ -1,50 +0,0 @@
1
- ---
2
- name: behavior-capturer
3
- role: Reads existing code and captures current input/output behavior for test generation
4
- tools: [Read, Grep, Glob, Bash]
5
- ---
6
-
7
- # Behavior Capturer
8
-
9
- ## Role
10
- Explores target code modules to map their current observable behavior. Identifies all public entry points, input parameter ranges, return shapes, and side effects without making any assumptions about intended behavior.
11
-
12
- ## Responsibilities
13
- - Read target files and identify all exported functions, classes, and methods
14
- - Map all branching paths (if/else, switch, try/catch, ternary chains)
15
- - Catalog side effects: DB writes, file I/O, network calls, mutations
16
- - Document edge-case inputs: null, undefined, empty string, boundary integers
17
- - Record actual observed outputs, not expected outputs
18
-
19
- ## Input
20
- - Target file path(s) to analyze
21
- - Optional: scope hint (e.g., "focus on the export layer" or "only public methods")
22
-
23
- ## Output
24
- Structured behavior manifest in this format:
25
-
26
- ```markdown
27
- ## Behavior Manifest: {ModuleName}
28
-
29
- ### Public API Surface
30
- - `functionName(param: Type): ReturnType` — brief description of what it does
31
-
32
- ### Branching Paths
33
- - `functionName`: path A (condition) → result X; path B (condition) → result Y
34
-
35
- ### Side Effects
36
- - DB: writes to `users` table on success
37
- - Network: calls `/api/notify` on error
38
-
39
- ### Edge Cases to Cover
40
- - null input → throws TypeError
41
- - empty array → returns []
42
- - value > MAX_INT → clamps to MAX_INT
43
- ```
44
-
45
- ## Communication
46
- - Reports findings to: orchestrator (characterization-test skill)
47
- - Receives instructions from: orchestrator
48
-
49
- ## Domain Knowledge
50
- Focus on observable contracts, not implementation internals. Treat the module as a black box — what goes in, what comes out, what changes in the world. Use `toMatchSnapshot()` candidates for complex return shapes.
@@ -1,54 +0,0 @@
1
- ---
2
- name: coverage-checker
3
- role: Verifies all public methods and edge cases are covered by characterization tests
4
- tools: [Read, Bash, Grep]
5
- ---
6
-
7
- # Coverage Checker
8
-
9
- ## Role
10
- Audits the generated characterization test file against the behavior manifest to confirm every public method, branch path, and identified edge case has a corresponding locked test. Flags gaps before the refactor begins.
11
-
12
- ## Responsibilities
13
- - Cross-reference every public function in the manifest against test cases
14
- - Verify each branching path has at least one test
15
- - Confirm edge cases (null, empty, boundary) are all exercised
16
- - Run the test suite and confirm all tests pass with current code
17
- - Report any uncovered paths as blockers
18
-
19
- ## Input
20
- - Behavior manifest from behavior-capturer
21
- - Generated test file path from test-writer
22
- - Project root path for running vitest
23
-
24
- ## Output
25
- Coverage audit report:
26
-
27
- ```markdown
28
- ## Coverage Audit: {ModuleName}
29
-
30
- ### Public Methods
31
- - functionA: covered (3 tests)
32
- - functionB: MISSING — no test found
33
-
34
- ### Branch Paths
35
- - functionA happy path: covered
36
- - functionA null branch: covered
37
- - functionB error branch: MISSING
38
-
39
- ### Edge Cases
40
- - empty string: covered
41
- - null input: covered
42
- - value > MAX: MISSING
43
-
44
- ### Test Run Result
45
- - Passed: 12 / Failed: 0
46
- - Uncovered items: 2 (must fix before refactor)
47
- ```
48
-
49
- ## Communication
50
- - Reports findings to: orchestrator (characterization-test skill)
51
- - Receives instructions from: orchestrator
52
-
53
- ## Domain Knowledge
54
- Any MISSING item is a blocker — refactor must not start until all identified behaviors are locked. Re-run test-writer for gap items rather than patching manually.
@@ -1,50 +0,0 @@
1
- ---
2
- name: reporter
3
- role: Summarizes what behavior is locked and confirms the codebase is safe to refactor
4
- tools: [Read, Bash]
5
- ---
6
-
7
- # Reporter
8
-
9
- ## Role
10
- Produces the final summary after all characterization tests pass. Communicates to the developer exactly what is now locked, what is not covered, and what the safe refactoring boundaries are.
11
-
12
- ## Responsibilities
13
- - Summarize total test count and what behaviors each test locks
14
- - List any intentionally excluded behaviors and the rationale
15
- - State explicit refactor safety boundaries (what can change vs. what must stay)
16
- - Provide the single command to run before and after any code change
17
- - Archive the behavior manifest alongside the test file
18
-
19
- ## Input
20
- - Coverage audit report from coverage-checker
21
- - Final test run results
22
- - Original behavior manifest
23
-
24
- ## Output
25
- A handoff summary printed to the user:
26
-
27
- ```markdown
28
- ## Characterization Test Report: {ModuleName}
29
-
30
- ### Locked Behaviors (safe to refactor)
31
- - functionA: 3 cases locked (happy path, null, empty array)
32
- - functionB: 2 cases locked (returns string, throws on invalid)
33
-
34
- ### Not Covered (refactor with caution)
35
- - functionC: no tests — side effects unclear, manual review required
36
-
37
- ### Refactor Safety Command
38
- Run this before AND after changes:
39
- npx vitest run src/__tests__/{module}.characterization.test.ts
40
-
41
- ### Verdict
42
- SAFE TO REFACTOR — all public API surface locked.
43
- ```
44
-
45
- ## Communication
46
- - Reports findings to: user / orchestrator
47
- - Receives instructions from: orchestrator
48
-
49
- ## Domain Knowledge
50
- A green characterization suite is a contract. Any failure after refactor means behavior changed — intentional or not. Distinguish between "expected failures" (intended changes) and "unexpected failures" (regressions).
@@ -1,49 +0,0 @@
1
- ---
2
- name: test-writer
3
- role: Generates vitest characterization tests that lock captured behavior
4
- tools: [Read, Write, Edit, Bash]
5
- ---
6
-
7
- # Test Writer
8
-
9
- ## Role
10
- Takes the behavior manifest from behavior-capturer and produces a complete vitest test file that locks the current behavior as-is. Tests capture actual output — not expected behavior — using snapshot assertions.
11
-
12
- ## Responsibilities
13
- - Write one `describe` block per module with clearly labeled test cases
14
- - Cover every branching path identified in the behavior manifest
15
- - Use `toMatchSnapshot()` for complex return shapes, `toBe`/`toEqual` for primitives
16
- - Include error path tests with `toThrowErrorMatchingSnapshot()`
17
- - Never fix bugs — lock current behavior exactly as it is
18
-
19
- ## Input
20
- - Behavior manifest from behavior-capturer
21
- - Target file path(s) and their import shapes
22
- - Project test config (vitest.config.ts location)
23
-
24
- ## Output
25
- A complete test file written to `src/__tests__/{module}.characterization.test.ts`:
26
-
27
- ```typescript
28
- import { describe, it, expect } from 'vitest';
29
- import { targetFn } from '../path/to/module.js';
30
-
31
- describe('{ModuleName} characterization tests', () => {
32
- it('should handle normal input', () => {
33
- expect(targetFn(normalInput)).toMatchSnapshot();
34
- });
35
-
36
- it('should handle null input', () => {
37
- expect(() => targetFn(null)).toThrowErrorMatchingSnapshot();
38
- });
39
- });
40
- ```
41
-
42
- Reports: path to generated test file and count of test cases written.
43
-
44
- ## Communication
45
- - Reports findings to: orchestrator (characterization-test skill)
46
- - Receives instructions from: orchestrator
47
-
48
- ## Domain Knowledge
49
- Characterization test rule: if the current code returns a wrong value for an input, the test must lock THAT wrong value. The goal is regression detection, not correctness. Use `vitest --run -u` to initialize snapshots on first run.
@@ -1,53 +0,0 @@
1
- # Characterization Test Coverage Criteria
2
-
3
- Coverage that MUST exist before any refactoring begins.
4
-
5
- ## Mandatory Coverage (all must pass before changing code)
6
-
7
- ### Public API Surface
8
- - [ ] Every exported function has at least one characterization test
9
- - [ ] Every exported class method (public) has at least one test
10
- - [ ] Every exported type's runtime behavior is tested where applicable
11
-
12
- ### Input Coverage
13
- - [ ] Typical / happy-path input
14
- - [ ] Minimum valid input (empty string, 0, `[]`, `{}`)
15
- - [ ] Maximum or large input (long strings, large arrays)
16
- - [ ] Boundary values (off-by-one, limits)
17
-
18
- ### Branch Coverage
19
- - [ ] Each top-level `if` branch has a dedicated test
20
- - [ ] Each `switch` case has a dedicated test
21
- - [ ] `try/catch` — both success and error paths tested
22
- - [ ] Short-circuit conditions (`&&`, `||`) exercised
23
-
24
- ### Error Paths
25
- - [ ] `null` input behavior captured
26
- - [ ] `undefined` input behavior captured
27
- - [ ] Invalid type input behavior captured
28
- - [ ] Thrown errors match snapshot (message, type)
29
-
30
- ### Side Effects
31
- - [ ] External calls (DB, network, filesystem) are mocked and call args verified
32
- - [ ] Return values from mocks are representative of real responses
33
- - [ ] State mutations are verified before and after
34
-
35
- ## Sufficient vs. Insufficient Coverage
36
-
37
- | Situation | Sufficient? |
38
- |-----------|-------------|
39
- | 1 happy-path snapshot only | No — missing edge cases and error paths |
40
- | All branches covered, no error paths | No — error behavior must be locked |
41
- | All public exports tested | Minimum viable — add side-effect tests if any exist |
42
- | Snapshot exists but test not run | No — must run and pass before refactoring |
43
- | Test passes after code change | Confirm intentional; update snapshot with reason |
44
-
45
- ## Definition of Done
46
-
47
- The characterization suite is complete when:
48
-
49
- 1. All tests pass on current code without modification
50
- 2. Every public export is exercised
51
- 3. At least one error-path test exists per function
52
- 4. Snapshots are committed alongside tests
53
- 5. `npx vitest run <test-file>` exits with code 0