timsquad 2.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 (181) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +347 -0
  3. package/bin/tsq.js +6 -0
  4. package/dist/commands/feedback.d.ts +3 -0
  5. package/dist/commands/feedback.d.ts.map +1 -0
  6. package/dist/commands/feedback.js +142 -0
  7. package/dist/commands/feedback.js.map +1 -0
  8. package/dist/commands/full.d.ts +3 -0
  9. package/dist/commands/full.d.ts.map +1 -0
  10. package/dist/commands/full.js +87 -0
  11. package/dist/commands/full.js.map +1 -0
  12. package/dist/commands/git/commit.d.ts +3 -0
  13. package/dist/commands/git/commit.d.ts.map +1 -0
  14. package/dist/commands/git/commit.js +88 -0
  15. package/dist/commands/git/commit.js.map +1 -0
  16. package/dist/commands/git/index.d.ts +5 -0
  17. package/dist/commands/git/index.d.ts.map +1 -0
  18. package/dist/commands/git/index.js +5 -0
  19. package/dist/commands/git/index.js.map +1 -0
  20. package/dist/commands/git/pr.d.ts +3 -0
  21. package/dist/commands/git/pr.d.ts.map +1 -0
  22. package/dist/commands/git/pr.js +138 -0
  23. package/dist/commands/git/pr.js.map +1 -0
  24. package/dist/commands/git/release.d.ts +3 -0
  25. package/dist/commands/git/release.d.ts.map +1 -0
  26. package/dist/commands/git/release.js +158 -0
  27. package/dist/commands/git/release.js.map +1 -0
  28. package/dist/commands/git/sync.d.ts +3 -0
  29. package/dist/commands/git/sync.d.ts.map +1 -0
  30. package/dist/commands/git/sync.js +132 -0
  31. package/dist/commands/git/sync.js.map +1 -0
  32. package/dist/commands/init.d.ts +3 -0
  33. package/dist/commands/init.d.ts.map +1 -0
  34. package/dist/commands/init.js +150 -0
  35. package/dist/commands/init.js.map +1 -0
  36. package/dist/commands/log.d.ts +3 -0
  37. package/dist/commands/log.d.ts.map +1 -0
  38. package/dist/commands/log.js +271 -0
  39. package/dist/commands/log.js.map +1 -0
  40. package/dist/commands/metrics.d.ts +3 -0
  41. package/dist/commands/metrics.d.ts.map +1 -0
  42. package/dist/commands/metrics.js +299 -0
  43. package/dist/commands/metrics.js.map +1 -0
  44. package/dist/commands/quick.d.ts +3 -0
  45. package/dist/commands/quick.d.ts.map +1 -0
  46. package/dist/commands/quick.js +136 -0
  47. package/dist/commands/quick.js.map +1 -0
  48. package/dist/commands/retro.d.ts +3 -0
  49. package/dist/commands/retro.d.ts.map +1 -0
  50. package/dist/commands/retro.js +280 -0
  51. package/dist/commands/retro.js.map +1 -0
  52. package/dist/commands/status.d.ts +3 -0
  53. package/dist/commands/status.d.ts.map +1 -0
  54. package/dist/commands/status.js +127 -0
  55. package/dist/commands/status.js.map +1 -0
  56. package/dist/commands/watch.d.ts +3 -0
  57. package/dist/commands/watch.d.ts.map +1 -0
  58. package/dist/commands/watch.js +213 -0
  59. package/dist/commands/watch.js.map +1 -0
  60. package/dist/index.d.ts +3 -0
  61. package/dist/index.d.ts.map +1 -0
  62. package/dist/index.js +50 -0
  63. package/dist/index.js.map +1 -0
  64. package/dist/lib/config.d.ts +34 -0
  65. package/dist/lib/config.d.ts.map +1 -0
  66. package/dist/lib/config.js +108 -0
  67. package/dist/lib/config.js.map +1 -0
  68. package/dist/lib/project.d.ts +47 -0
  69. package/dist/lib/project.d.ts.map +1 -0
  70. package/dist/lib/project.js +191 -0
  71. package/dist/lib/project.js.map +1 -0
  72. package/dist/lib/template.d.ts +33 -0
  73. package/dist/lib/template.d.ts.map +1 -0
  74. package/dist/lib/template.js +151 -0
  75. package/dist/lib/template.js.map +1 -0
  76. package/dist/types/config.d.ts +75 -0
  77. package/dist/types/config.d.ts.map +1 -0
  78. package/dist/types/config.js +66 -0
  79. package/dist/types/config.js.map +1 -0
  80. package/dist/types/feedback.d.ts +59 -0
  81. package/dist/types/feedback.d.ts.map +1 -0
  82. package/dist/types/feedback.js +26 -0
  83. package/dist/types/feedback.js.map +1 -0
  84. package/dist/types/index.d.ts +4 -0
  85. package/dist/types/index.d.ts.map +1 -0
  86. package/dist/types/index.js +5 -0
  87. package/dist/types/index.js.map +1 -0
  88. package/dist/types/project.d.ts +89 -0
  89. package/dist/types/project.d.ts.map +1 -0
  90. package/dist/types/project.js +44 -0
  91. package/dist/types/project.js.map +1 -0
  92. package/dist/utils/colors.d.ts +30 -0
  93. package/dist/utils/colors.d.ts.map +1 -0
  94. package/dist/utils/colors.js +54 -0
  95. package/dist/utils/colors.js.map +1 -0
  96. package/dist/utils/date.d.ts +25 -0
  97. package/dist/utils/date.d.ts.map +1 -0
  98. package/dist/utils/date.js +65 -0
  99. package/dist/utils/date.js.map +1 -0
  100. package/dist/utils/fs.d.ts +49 -0
  101. package/dist/utils/fs.d.ts.map +1 -0
  102. package/dist/utils/fs.js +84 -0
  103. package/dist/utils/fs.js.map +1 -0
  104. package/dist/utils/prompts.d.ts +31 -0
  105. package/dist/utils/prompts.d.ts.map +1 -0
  106. package/dist/utils/prompts.js +95 -0
  107. package/dist/utils/prompts.js.map +1 -0
  108. package/dist/utils/yaml.d.ts +21 -0
  109. package/dist/utils/yaml.d.ts.map +1 -0
  110. package/dist/utils/yaml.js +40 -0
  111. package/dist/utils/yaml.js.map +1 -0
  112. package/package.json +71 -0
  113. package/templates/common/CLAUDE.md.template +254 -0
  114. package/templates/common/claude/agents/tsq-dba.md +290 -0
  115. package/templates/common/claude/agents/tsq-designer.md +304 -0
  116. package/templates/common/claude/agents/tsq-developer.md +118 -0
  117. package/templates/common/claude/agents/tsq-planner.md +90 -0
  118. package/templates/common/claude/agents/tsq-prompter.md +336 -0
  119. package/templates/common/claude/agents/tsq-qa.md +134 -0
  120. package/templates/common/claude/agents/tsq-retro.md +168 -0
  121. package/templates/common/claude/agents/tsq-security.md +190 -0
  122. package/templates/common/claude/skills/architecture/SKILL.md +123 -0
  123. package/templates/common/claude/skills/backend/node/SKILL.md +1015 -0
  124. package/templates/common/claude/skills/coding/SKILL.md +171 -0
  125. package/templates/common/claude/skills/database/prisma/SKILL.md +357 -0
  126. package/templates/common/claude/skills/frontend/nextjs/SKILL.md +279 -0
  127. package/templates/common/claude/skills/frontend/react/SKILL.md +1729 -0
  128. package/templates/common/claude/skills/methodology/bdd/SKILL.md +234 -0
  129. package/templates/common/claude/skills/methodology/ddd/SKILL.md +311 -0
  130. package/templates/common/claude/skills/methodology/tdd/SKILL.md +512 -0
  131. package/templates/common/claude/skills/planning/SKILL.md +90 -0
  132. package/templates/common/claude/skills/security/SKILL.md +234 -0
  133. package/templates/common/claude/skills/testing/SKILL.md +146 -0
  134. package/templates/common/claude/skills/typescript/SKILL.md +435 -0
  135. package/templates/common/config.template.yaml +131 -0
  136. package/templates/common/timsquad/architectures/clean/ARCHITECTURE.md +49 -0
  137. package/templates/common/timsquad/architectures/clean/backend.xml +210 -0
  138. package/templates/common/timsquad/architectures/clean/frontend.xml +148 -0
  139. package/templates/common/timsquad/architectures/fsd/ARCHITECTURE.md +67 -0
  140. package/templates/common/timsquad/architectures/fsd/frontend.xml +288 -0
  141. package/templates/common/timsquad/architectures/hexagonal/ARCHITECTURE.md +60 -0
  142. package/templates/common/timsquad/architectures/hexagonal/backend.xml +300 -0
  143. package/templates/common/timsquad/constraints/competency-framework.xml +501 -0
  144. package/templates/common/timsquad/constraints/ssot-schema.xml +433 -0
  145. package/templates/common/timsquad/feedback/feedback-router.sh +341 -0
  146. package/templates/common/timsquad/feedback/routing-rules.yaml +352 -0
  147. package/templates/common/timsquad/generators/data-design.xml +290 -0
  148. package/templates/common/timsquad/generators/prd.xml +280 -0
  149. package/templates/common/timsquad/generators/requirements.xml +220 -0
  150. package/templates/common/timsquad/generators/service-spec.xml +266 -0
  151. package/templates/common/timsquad/logs/_example.md +81 -0
  152. package/templates/common/timsquad/logs/_template.md +46 -0
  153. package/templates/common/timsquad/patterns/cqrs.xml +127 -0
  154. package/templates/common/timsquad/patterns/event-sourcing.xml +85 -0
  155. package/templates/common/timsquad/patterns/repository.xml +64 -0
  156. package/templates/common/timsquad/process/state-machine.xml +343 -0
  157. package/templates/common/timsquad/process/validation-rules.xml +308 -0
  158. package/templates/common/timsquad/process/workflow-base.xml +202 -0
  159. package/templates/common/timsquad/retrospective/cycle-report.template.md +205 -0
  160. package/templates/common/timsquad/retrospective/metrics/metrics-schema.json +203 -0
  161. package/templates/common/timsquad/retrospective/patterns/failure-patterns.md +199 -0
  162. package/templates/common/timsquad/retrospective/patterns/success-patterns.md +262 -0
  163. package/templates/common/timsquad/retrospective/retrospective-config.xml +294 -0
  164. package/templates/common/timsquad/retrospective/retrospective-state.xml +210 -0
  165. package/templates/common/timsquad/ssot/adr/ADR-000-template.md +121 -0
  166. package/templates/common/timsquad/ssot/adr/ADR-001-example.md +115 -0
  167. package/templates/common/timsquad/ssot/data-design.template.md +132 -0
  168. package/templates/common/timsquad/ssot/deployment-spec.template.md +384 -0
  169. package/templates/common/timsquad/ssot/env-config.template.md +346 -0
  170. package/templates/common/timsquad/ssot/error-codes.template.md +114 -0
  171. package/templates/common/timsquad/ssot/functional-spec.template.md +185 -0
  172. package/templates/common/timsquad/ssot/glossary.template.md +148 -0
  173. package/templates/common/timsquad/ssot/integration-spec.template.md +391 -0
  174. package/templates/common/timsquad/ssot/planning.template.md +94 -0
  175. package/templates/common/timsquad/ssot/prd.template.md +102 -0
  176. package/templates/common/timsquad/ssot/requirements.template.md +117 -0
  177. package/templates/common/timsquad/ssot/security-spec.template.md +309 -0
  178. package/templates/common/timsquad/ssot/service-spec.template.md +194 -0
  179. package/templates/common/timsquad/ssot/test-spec.template.md +264 -0
  180. package/templates/common/timsquad/ssot/ui-ux-spec.template.md +262 -0
  181. package/templates/common/timsquad/state/workspace.xml +217 -0
@@ -0,0 +1,341 @@
1
+ #!/bin/bash
2
+
3
+ # TimSquad Feedback Router v1.0
4
+ # 피드백을 분석하고 적절한 담당자에게 라우팅
5
+ #
6
+ # 사용법:
7
+ # tsq feedback <message>
8
+ # echo "error message" | tsq feedback
9
+ # tsq feedback --analyze <file>
10
+
11
+ set -e
12
+
13
+ SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
14
+
15
+ # 색상 정의
16
+ RED='\033[0;31m'
17
+ GREEN='\033[0;32m'
18
+ YELLOW='\033[1;33m'
19
+ BLUE='\033[0;34m'
20
+ CYAN='\033[0;36m'
21
+ NC='\033[0m'
22
+
23
+ # TimSquad 루트 찾기
24
+ find_timsquad_root() {
25
+ local dir="$PWD"
26
+ while [[ "$dir" != "/" ]]; do
27
+ if [[ -d "$dir/.timsquad" ]]; then
28
+ echo "$dir"
29
+ return 0
30
+ fi
31
+ dir="$(dirname "$dir")"
32
+ done
33
+ return 1
34
+ }
35
+
36
+ # 도움말
37
+ show_help() {
38
+ echo "사용법: tsq feedback [options] <message>"
39
+ echo ""
40
+ echo "Options:"
41
+ echo " -l, --level <1|2|3> 피드백 레벨 지정"
42
+ echo " -p, --pattern <name> 패턴 이름 지정"
43
+ echo " -f, --file <path> 파일에서 피드백 읽기"
44
+ echo " --analyze 분석만 수행 (라우팅 안함)"
45
+ echo " -h, --help 도움말 표시"
46
+ echo ""
47
+ echo "예시:"
48
+ echo " tsq feedback \"test failed: expected 1 but got 2\""
49
+ echo " tsq feedback -l 2 \"API 인터페이스 변경 필요\""
50
+ echo " echo \"error\" | tsq feedback"
51
+ }
52
+
53
+ # 키워드 기반 레벨 분류
54
+ classify_level() {
55
+ local message="$1"
56
+ local msg_lower=$(echo "$message" | tr '[:upper:]' '[:lower:]')
57
+
58
+ # Level 3 키워드
59
+ local level3_keywords=(
60
+ "requirement" "scope" "stakeholder" "business logic"
61
+ "priority" "deadline" "budget" "feature request"
62
+ "clarification needed" "user feedback" "client"
63
+ )
64
+
65
+ # Level 2 키워드
66
+ local level2_keywords=(
67
+ "architecture" "design" "api mismatch" "schema"
68
+ "performance" "scalability" "security" "integration"
69
+ "ssot" "spec violation" "migration"
70
+ )
71
+
72
+ # Level 1 키워드
73
+ local level1_keywords=(
74
+ "test" "lint" "type error" "runtime" "exception"
75
+ "formatting" "code style" "naming" "coverage"
76
+ "bug" "fix" "typo"
77
+ )
78
+
79
+ # Level 3 체크
80
+ for keyword in "${level3_keywords[@]}"; do
81
+ if [[ "$msg_lower" == *"$keyword"* ]]; then
82
+ echo "3"
83
+ return
84
+ fi
85
+ done
86
+
87
+ # Level 2 체크
88
+ for keyword in "${level2_keywords[@]}"; do
89
+ if [[ "$msg_lower" == *"$keyword"* ]]; then
90
+ echo "2"
91
+ return
92
+ fi
93
+ done
94
+
95
+ # Level 1 체크
96
+ for keyword in "${level1_keywords[@]}"; do
97
+ if [[ "$msg_lower" == *"$keyword"* ]]; then
98
+ echo "1"
99
+ return
100
+ fi
101
+ done
102
+
103
+ # 기본값
104
+ echo "1"
105
+ }
106
+
107
+ # 패턴 감지
108
+ detect_pattern() {
109
+ local message="$1"
110
+ local msg_lower=$(echo "$message" | tr '[:upper:]' '[:lower:]')
111
+
112
+ # 패턴 매핑
113
+ if [[ "$msg_lower" == *"test"*"fail"* ]]; then
114
+ echo "test_failure"
115
+ elif [[ "$msg_lower" == *"lint"* || "$msg_lower" == *"eslint"* ]]; then
116
+ echo "lint_error"
117
+ elif [[ "$msg_lower" == *"type"*"error"* || "$msg_lower" == *"typescript"* ]]; then
118
+ echo "type_error"
119
+ elif [[ "$msg_lower" == *"runtime"* || "$msg_lower" == *"exception"* ]]; then
120
+ echo "runtime_error"
121
+ elif [[ "$msg_lower" == *"api"*"mismatch"* || "$msg_lower" == *"contract"* ]]; then
122
+ echo "api_mismatch"
123
+ elif [[ "$msg_lower" == *"schema"* || "$msg_lower" == *"migration"* ]]; then
124
+ echo "schema_mismatch"
125
+ elif [[ "$msg_lower" == *"security"* || "$msg_lower" == *"vulnerab"* ]]; then
126
+ echo "security_vulnerability"
127
+ elif [[ "$msg_lower" == *"requirement"* ]]; then
128
+ echo "requirement_change"
129
+ elif [[ "$msg_lower" == *"scope"* ]]; then
130
+ echo "scope_creep"
131
+ elif [[ "$msg_lower" == *"performance"* || "$msg_lower" == *"slow"* ]]; then
132
+ echo "performance_issue"
133
+ else
134
+ echo "general"
135
+ fi
136
+ }
137
+
138
+ # 라우팅 대상 결정
139
+ get_route_target() {
140
+ local level="$1"
141
+
142
+ case $level in
143
+ 1)
144
+ echo "tsq-developer"
145
+ ;;
146
+ 2)
147
+ echo "tsq-planner (architect mode)"
148
+ ;;
149
+ 3)
150
+ echo "tsq-planner (planning mode) → User 승인 필요"
151
+ ;;
152
+ *)
153
+ echo "tsq-developer"
154
+ ;;
155
+ esac
156
+ }
157
+
158
+ # 피드백 로그 저장
159
+ log_feedback() {
160
+ local level="$1"
161
+ local pattern="$2"
162
+ local message="$3"
163
+ local target="$4"
164
+
165
+ local log_dir="$TSQ_ROOT/.timsquad/logs"
166
+ local log_file="$log_dir/feedback.log"
167
+ local timestamp=$(date +"%Y-%m-%d %H:%M:%S")
168
+
169
+ mkdir -p "$log_dir"
170
+
171
+ cat >> "$log_file" << EOF
172
+
173
+ ---
174
+ timestamp: $timestamp
175
+ level: $level
176
+ pattern: $pattern
177
+ target: $target
178
+ message: |
179
+ $message
180
+ ---
181
+ EOF
182
+ }
183
+
184
+ # 메트릭 업데이트
185
+ update_metrics() {
186
+ local level="$1"
187
+ local pattern="$2"
188
+
189
+ local metrics_file="$TSQ_ROOT/.timsquad/retrospective/metrics/feedback-stats.json"
190
+
191
+ # 파일이 없으면 초기화
192
+ if [[ ! -f "$metrics_file" ]]; then
193
+ mkdir -p "$(dirname "$metrics_file")"
194
+ echo '{"by_level":{"1":0,"2":0,"3":0},"by_pattern":{},"total":0}' > "$metrics_file"
195
+ fi
196
+
197
+ # jq가 있으면 JSON 업데이트
198
+ if command -v jq &> /dev/null; then
199
+ local tmp_file=$(mktemp)
200
+ jq --arg level "$level" --arg pattern "$pattern" '
201
+ .total += 1 |
202
+ .by_level[$level] += 1 |
203
+ .by_pattern[$pattern] = ((.by_pattern[$pattern] // 0) + 1)
204
+ ' "$metrics_file" > "$tmp_file" && mv "$tmp_file" "$metrics_file"
205
+ fi
206
+ }
207
+
208
+ # 메인 라우팅 함수
209
+ route_feedback() {
210
+ local level="$1"
211
+ local pattern="$2"
212
+ local message="$3"
213
+ local analyze_only="$4"
214
+
215
+ local target=$(get_route_target "$level")
216
+
217
+ echo ""
218
+ echo -e "${CYAN}━━━ 피드백 분석 결과 ━━━${NC}"
219
+ echo ""
220
+
221
+ # 레벨별 색상
222
+ case $level in
223
+ 1)
224
+ echo -e " 레벨: ${GREEN}Level 1 (구현 수정)${NC}"
225
+ ;;
226
+ 2)
227
+ echo -e " 레벨: ${YELLOW}Level 2 (설계 수정)${NC}"
228
+ ;;
229
+ 3)
230
+ echo -e " 레벨: ${RED}Level 3 (기획 수정)${NC}"
231
+ ;;
232
+ esac
233
+
234
+ echo -e " 패턴: ${BLUE}$pattern${NC}"
235
+ echo -e " 라우팅: $target"
236
+ echo ""
237
+ echo -e " 메시지:"
238
+ echo -e " ${GRAY}$message${NC}"
239
+ echo ""
240
+
241
+ if [[ "$analyze_only" == "true" ]]; then
242
+ echo -e "${YELLOW}분석 모드: 라우팅 실행하지 않음${NC}"
243
+ return
244
+ fi
245
+
246
+ # 로그 저장
247
+ log_feedback "$level" "$pattern" "$message" "$target"
248
+
249
+ # 메트릭 업데이트
250
+ update_metrics "$level" "$pattern"
251
+
252
+ # Level 3인 경우 사용자 알림
253
+ if [[ "$level" == "3" ]]; then
254
+ echo -e "${RED}⚠ 사용자 승인이 필요합니다${NC}"
255
+ echo ""
256
+ echo "다음 내용을 검토해주세요:"
257
+ echo " - 영향 범위 분석"
258
+ echo " - 대안 옵션"
259
+ echo " - SSOT 문서 업데이트 필요 여부"
260
+ echo ""
261
+ fi
262
+
263
+ echo -e "${GREEN}✓ 피드백이 기록되었습니다${NC}"
264
+ }
265
+
266
+ # ============================================================
267
+ # 메인 실행
268
+ # ============================================================
269
+
270
+ # TimSquad 루트 확인
271
+ TSQ_ROOT=$(find_timsquad_root) || {
272
+ echo -e "${RED}Error: TimSquad 프로젝트가 아닙니다.${NC}"
273
+ exit 1
274
+ }
275
+
276
+ # 인자 파싱
277
+ LEVEL=""
278
+ PATTERN=""
279
+ MESSAGE=""
280
+ FILE=""
281
+ ANALYZE_ONLY=false
282
+
283
+ while [[ $# -gt 0 ]]; do
284
+ case $1 in
285
+ -l|--level)
286
+ LEVEL="$2"
287
+ shift 2
288
+ ;;
289
+ -p|--pattern)
290
+ PATTERN="$2"
291
+ shift 2
292
+ ;;
293
+ -f|--file)
294
+ FILE="$2"
295
+ shift 2
296
+ ;;
297
+ --analyze)
298
+ ANALYZE_ONLY=true
299
+ shift
300
+ ;;
301
+ -h|--help)
302
+ show_help
303
+ exit 0
304
+ ;;
305
+ *)
306
+ MESSAGE="$MESSAGE $1"
307
+ shift
308
+ ;;
309
+ esac
310
+ done
311
+
312
+ # 파일에서 읽기
313
+ if [[ -n "$FILE" && -f "$FILE" ]]; then
314
+ MESSAGE=$(cat "$FILE")
315
+ fi
316
+
317
+ # stdin에서 읽기
318
+ if [[ -z "$MESSAGE" && ! -t 0 ]]; then
319
+ MESSAGE=$(cat)
320
+ fi
321
+
322
+ # 메시지 정리
323
+ MESSAGE=$(echo "$MESSAGE" | xargs)
324
+
325
+ if [[ -z "$MESSAGE" ]]; then
326
+ echo -e "${RED}Error: 피드백 메시지가 필요합니다${NC}"
327
+ show_help
328
+ exit 1
329
+ fi
330
+
331
+ # 자동 분류 (지정되지 않은 경우)
332
+ if [[ -z "$LEVEL" ]]; then
333
+ LEVEL=$(classify_level "$MESSAGE")
334
+ fi
335
+
336
+ if [[ -z "$PATTERN" ]]; then
337
+ PATTERN=$(detect_pattern "$MESSAGE")
338
+ fi
339
+
340
+ # 라우팅 실행
341
+ route_feedback "$LEVEL" "$PATTERN" "$MESSAGE" "$ANALYZE_ONLY"
@@ -0,0 +1,352 @@
1
+ # TimSquad Feedback Routing Rules
2
+ # 피드백을 적절한 담당자에게 자동 라우팅하는 규칙 정의
3
+ #
4
+ # 이론적 기반:
5
+ # - FRAME (Feedback-Driven Refinement): 레벨별 피드백 분류
6
+ # - Agentsway: Agent specialization에 따른 라우팅
7
+ #
8
+ # 사용법:
9
+ # 1. 피드백 발생 시 triggers 매칭
10
+ # 2. 매칭된 레벨의 route_to로 전달
11
+ # 3. 필요 시 사용자 승인 요청
12
+
13
+ version: "1.0"
14
+
15
+ # ============================================================
16
+ # 피드백 레벨 정의
17
+ # ============================================================
18
+ levels:
19
+ level_1:
20
+ name: "구현 수정"
21
+ description: "코드 레벨 수정, 설계 변경 없음"
22
+ approval_required: false
23
+ ssot_update: false
24
+
25
+ level_2:
26
+ name: "설계 수정"
27
+ description: "아키텍처/API 설계 변경 필요"
28
+ approval_required: false
29
+ ssot_update: true
30
+
31
+ level_3:
32
+ name: "기획 수정"
33
+ description: "요구사항/기획 변경 필요, 사용자 승인 필수"
34
+ approval_required: true
35
+ ssot_update: true
36
+
37
+ # ============================================================
38
+ # 라우팅 규칙
39
+ # ============================================================
40
+ routing:
41
+ # --------------------------------------------------------
42
+ # Level 1: 구현 수정 → Developer
43
+ # --------------------------------------------------------
44
+ level_1:
45
+ triggers:
46
+ # 테스트 관련
47
+ - pattern: "test_failure"
48
+ keywords: ["test failed", "assertion error", "expected", "actual"]
49
+
50
+ - pattern: "test_coverage"
51
+ keywords: ["coverage below", "uncovered lines", "missing tests"]
52
+
53
+ # 코드 품질
54
+ - pattern: "lint_error"
55
+ keywords: ["eslint", "prettier", "formatting", "lint error"]
56
+
57
+ - pattern: "type_error"
58
+ keywords: ["type error", "typescript", "cannot assign", "is not assignable"]
59
+
60
+ - pattern: "runtime_error"
61
+ keywords: ["runtime error", "exception", "crash", "undefined is not"]
62
+
63
+ # 코드 스타일
64
+ - pattern: "code_style"
65
+ keywords: ["naming convention", "code style", "formatting issue"]
66
+
67
+ - pattern: "code_smell"
68
+ keywords: ["code smell", "duplicate code", "long method", "complex"]
69
+
70
+ # 성능 (minor)
71
+ - pattern: "minor_performance"
72
+ keywords: ["slow query", "n+1", "unnecessary loop"]
73
+
74
+ route_to: "tsq-developer"
75
+
76
+ actions:
77
+ - type: "auto_fix"
78
+ enabled: true
79
+ max_attempts: 3
80
+
81
+ - type: "log"
82
+ destination: ".timsquad/logs/"
83
+
84
+ escalation:
85
+ condition: "attempts >= 3"
86
+ escalate_to: "level_2"
87
+ notify: ["tsq-planner"]
88
+
89
+ # --------------------------------------------------------
90
+ # Level 2: 설계 수정 → Planner (Architect 모드)
91
+ # --------------------------------------------------------
92
+ level_2:
93
+ triggers:
94
+ # 아키텍처 관련
95
+ - pattern: "architecture_issue"
96
+ keywords: ["architecture", "design pattern", "dependency", "coupling"]
97
+
98
+ - pattern: "api_mismatch"
99
+ keywords: ["api mismatch", "contract violation", "interface change"]
100
+
101
+ - pattern: "schema_mismatch"
102
+ keywords: ["schema mismatch", "migration needed", "db change"]
103
+
104
+ # 성능 (major)
105
+ - pattern: "performance_issue"
106
+ keywords: ["performance degradation", "timeout", "memory leak", "bottleneck"]
107
+
108
+ - pattern: "scalability_concern"
109
+ keywords: ["scalability", "load handling", "concurrent users"]
110
+
111
+ # 보안 (implementation level)
112
+ - pattern: "security_vulnerability"
113
+ keywords: ["vulnerability", "security issue", "injection", "xss", "csrf"]
114
+
115
+ # 통합 문제
116
+ - pattern: "integration_issue"
117
+ keywords: ["integration failed", "external api", "third party"]
118
+
119
+ # SSOT 불일치
120
+ - pattern: "ssot_violation"
121
+ keywords: ["ssot mismatch", "spec violation", "documentation outdated"]
122
+
123
+ route_to: "tsq-planner"
124
+ planner_mode: "architect"
125
+
126
+ actions:
127
+ - type: "analyze"
128
+ agent: "tsq-planner"
129
+
130
+ - type: "update_ssot"
131
+ documents: ["service-spec.md", "data-design.md", "error-codes.md"]
132
+
133
+ - type: "create_adr"
134
+ enabled: true
135
+ template: "ADR-000-template.md"
136
+
137
+ - type: "log"
138
+ destination: ".timsquad/logs/"
139
+
140
+ escalation:
141
+ condition: "impact >= high OR user_facing == true"
142
+ escalate_to: "level_3"
143
+ notify: ["user"]
144
+
145
+ # --------------------------------------------------------
146
+ # Level 3: 기획 수정 → User 승인 필요
147
+ # --------------------------------------------------------
148
+ level_3:
149
+ triggers:
150
+ # 요구사항 관련
151
+ - pattern: "requirement_ambiguity"
152
+ keywords: ["unclear requirement", "ambiguous", "need clarification"]
153
+
154
+ - pattern: "requirement_change"
155
+ keywords: ["requirement change", "scope change", "new feature"]
156
+
157
+ - pattern: "scope_creep"
158
+ keywords: ["scope creep", "out of scope", "additional feature"]
159
+
160
+ # 비즈니스 로직
161
+ - pattern: "business_logic_error"
162
+ keywords: ["business logic", "business rule", "domain error"]
163
+
164
+ - pattern: "stakeholder_feedback"
165
+ keywords: ["stakeholder", "client feedback", "user feedback"]
166
+
167
+ # 우선순위/일정
168
+ - pattern: "priority_change"
169
+ keywords: ["priority change", "timeline", "deadline", "milestone"]
170
+
171
+ # 기술 결정
172
+ - pattern: "technology_decision"
173
+ keywords: ["technology choice", "framework", "library selection"]
174
+
175
+ # 비용/리소스
176
+ - pattern: "resource_constraint"
177
+ keywords: ["budget", "resource", "cost", "infrastructure"]
178
+
179
+ route_to: "tsq-planner"
180
+ planner_mode: "planning"
181
+
182
+ actions:
183
+ - type: "notify_user"
184
+ priority: "high"
185
+
186
+ - type: "prepare_summary"
187
+ include: ["impact", "options", "recommendation"]
188
+
189
+ - type: "await_approval"
190
+ timeout: "24h"
191
+ reminder: "4h"
192
+
193
+ - type: "update_ssot"
194
+ documents: ["prd.md", "requirements.md", "planning.md"]
195
+ requires_approval: true
196
+
197
+ - type: "log"
198
+ destination: ".timsquad/logs/"
199
+
200
+ approval_flow:
201
+ - step: "present_options"
202
+ agent: "tsq-planner"
203
+
204
+ - step: "user_decision"
205
+ timeout: "24h"
206
+
207
+ - step: "apply_changes"
208
+ condition: "approved == true"
209
+
210
+ - step: "cascade_updates"
211
+ documents: ["affected_ssot_documents"]
212
+
213
+ # ============================================================
214
+ # 키워드 기반 자동 분류
215
+ # ============================================================
216
+ classification:
217
+ # 자동 분류 활성화
218
+ auto_classify: true
219
+
220
+ # 신뢰도 임계값 (0-1)
221
+ confidence_threshold: 0.7
222
+
223
+ # 낮은 신뢰도 시 동작
224
+ low_confidence_action: "ask_user"
225
+
226
+ # 분류 우선순위 (높은 레벨 우선)
227
+ priority: ["level_3", "level_2", "level_1"]
228
+
229
+ # 복합 패턴 처리
230
+ compound_patterns:
231
+ - patterns: ["security_vulnerability", "architecture_issue"]
232
+ result_level: "level_2"
233
+ priority: "critical"
234
+
235
+ - patterns: ["requirement_change", "scope_creep"]
236
+ result_level: "level_3"
237
+ priority: "high"
238
+
239
+ # ============================================================
240
+ # 에스컬레이션 규칙
241
+ # ============================================================
242
+ escalation:
243
+ # 시간 기반 에스컬레이션
244
+ time_based:
245
+ level_1:
246
+ timeout: "2h"
247
+ escalate_to: "level_2"
248
+
249
+ level_2:
250
+ timeout: "8h"
251
+ escalate_to: "level_3"
252
+
253
+ # 반복 기반 에스컬레이션
254
+ recurrence_based:
255
+ threshold: 3
256
+ window: "7d"
257
+ action: "escalate_and_create_pattern"
258
+
259
+ # 심각도 기반 에스컬레이션
260
+ severity_based:
261
+ critical:
262
+ immediate_escalate_to: "level_3"
263
+ notify: ["user", "tsq-planner"]
264
+
265
+ high:
266
+ escalate_after: "1h"
267
+
268
+ medium:
269
+ follow_normal_flow: true
270
+
271
+ low:
272
+ batch_process: true
273
+ batch_interval: "4h"
274
+
275
+ # ============================================================
276
+ # 알림 설정
277
+ # ============================================================
278
+ notifications:
279
+ channels:
280
+ # 콘솔 출력
281
+ console:
282
+ enabled: true
283
+ levels: ["level_1", "level_2", "level_3"]
284
+
285
+ # 로그 파일
286
+ log_file:
287
+ enabled: true
288
+ path: ".timsquad/logs/feedback.log"
289
+
290
+ # 사용자 프롬프트
291
+ user_prompt:
292
+ enabled: true
293
+ levels: ["level_3"]
294
+
295
+ templates:
296
+ level_1: |
297
+ [Level 1] 구현 수정 필요
298
+ 패턴: {{pattern}}
299
+ 대상: {{target_file}}
300
+ 담당: @tsq-developer
301
+
302
+ level_2: |
303
+ [Level 2] 설계 수정 필요
304
+ 패턴: {{pattern}}
305
+ 영향: {{impact}}
306
+ 담당: @tsq-planner (architect)
307
+ SSOT 업데이트 필요
308
+
309
+ level_3: |
310
+ [Level 3] 기획 검토 필요 - 사용자 승인 대기
311
+ 패턴: {{pattern}}
312
+ 영향: {{impact}}
313
+ 옵션: {{options}}
314
+
315
+ 승인 대기 중...
316
+
317
+ # ============================================================
318
+ # 메트릭 수집
319
+ # ============================================================
320
+ metrics:
321
+ collect:
322
+ - feedback_count_by_level
323
+ - feedback_count_by_pattern
324
+ - resolution_time
325
+ - escalation_rate
326
+ - recurrence_rate
327
+
328
+ storage: ".timsquad/retrospective/metrics/feedback-stats.json"
329
+
330
+ aggregation:
331
+ interval: "daily"
332
+ retention: "90d"
333
+
334
+ # ============================================================
335
+ # 학습/개선
336
+ # ============================================================
337
+ learning:
338
+ # 패턴 자동 등록
339
+ auto_pattern_registration:
340
+ enabled: true
341
+ threshold: 3 # 3회 이상 반복 시
342
+
343
+ # 회고 시스템 연동
344
+ retrospective_integration:
345
+ enabled: true
346
+ report_to: ".timsquad/retrospective/patterns/"
347
+
348
+ # 라우팅 규칙 개선 제안
349
+ rule_improvement:
350
+ enabled: true
351
+ suggest_new_keywords: true
352
+ suggest_threshold_adjustments: true