thuthi-plugin 0.0.0-stage → 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (115) hide show
  1. package/.claude-plugin/marketplace.json +55 -0
  2. package/README.md +13 -2
  3. package/bin/parallel-browser.js +109 -0
  4. package/extension/background.js +1329 -0
  5. package/extension/config.json +1 -0
  6. package/extension/guard.js +44 -0
  7. package/extension/manifest.json +10 -0
  8. package/extension/overlay.js +104 -0
  9. package/extension/popup.html +34 -0
  10. package/extension/popup.js +39 -0
  11. package/extension-reloader/manifest.json +13 -0
  12. package/extension-reloader/sw.js +17 -0
  13. package/package.json +13 -4
  14. package/plugins/thuthi/.claude-plugin/plugin.json +8 -0
  15. package/plugins/thuthi/context.md +3 -0
  16. package/plugins/thuthi/hooks/hooks.json +15 -0
  17. package/plugins/thuthi/skills/setup/SKILL.md +55 -0
  18. package/plugins/thuthi/skills/setup/scripts/doctor.py +249 -0
  19. package/plugins/thuthi/skills/setup/scripts/selftest.py +188 -0
  20. package/plugins/thuthi/tools/claude-switch/claude_switch.py +8 -0
  21. package/plugins/thuthi/tools/legacy_launcher.py +65 -0
  22. package/plugins/thuthi/tools/statusline/statusline.py +8 -0
  23. package/plugins/thuthi-accounts/.claude-plugin/plugin.json +9 -0
  24. package/plugins/thuthi-accounts/bin/claude-switch +5 -0
  25. package/plugins/thuthi-accounts/bin/claude-switch.cmd +4 -0
  26. package/plugins/thuthi-accounts/hooks/hooks.json +15 -0
  27. package/plugins/thuthi-accounts/lib/tls.py +68 -0
  28. package/plugins/thuthi-accounts/lib/usage_store.py +150 -0
  29. package/plugins/thuthi-accounts/setup_check.py +21 -0
  30. package/plugins/thuthi-accounts/skills/claude-switch/SKILL.md +48 -0
  31. package/plugins/thuthi-accounts/tools/claude-switch/claude-switch-tui.py +397 -0
  32. package/plugins/thuthi-accounts/tools/claude-switch/claude_switch.py +1204 -0
  33. package/plugins/thuthi-accounts/tools/claude-switch/credstore.py +417 -0
  34. package/plugins/thuthi-accounts/tools/claude-switch/install.py +301 -0
  35. package/plugins/thuthi-accounts/tools/claude-switch/tests/selftest.py +491 -0
  36. package/plugins/thuthi-accounts/tools/statusline/statusline.py +212 -0
  37. package/plugins/thuthi-agenda-picker/.claude-plugin/plugin.json +9 -0
  38. package/plugins/thuthi-agenda-picker/context.md +3 -0
  39. package/plugins/thuthi-agenda-picker/hooks/hooks.json +15 -0
  40. package/plugins/thuthi-agenda-picker/lib/pbpage.py +397 -0
  41. package/plugins/thuthi-agenda-picker/setup_check.py +18 -0
  42. package/plugins/thuthi-agenda-picker/skills/agenda-picker/SKILL.md +280 -0
  43. package/plugins/thuthi-agenda-picker/skills/agenda-picker/references/design-rules.md +110 -0
  44. package/plugins/thuthi-agenda-picker/skills/agenda-picker/references/diagram/base.css +33 -0
  45. package/plugins/thuthi-agenda-picker/skills/agenda-picker/references/example/agenda.json +146 -0
  46. package/plugins/thuthi-agenda-picker/skills/agenda-picker/references/example/shots/A-dark.svg +5 -0
  47. package/plugins/thuthi-agenda-picker/skills/agenda-picker/references/example/shots/A-light.svg +5 -0
  48. package/plugins/thuthi-agenda-picker/skills/agenda-picker/references/example/shots/B-dark.svg +5 -0
  49. package/plugins/thuthi-agenda-picker/skills/agenda-picker/references/example/shots/B-light.svg +5 -0
  50. package/plugins/thuthi-agenda-picker/skills/agenda-picker/references/example/shots/C-dark.svg +5 -0
  51. package/plugins/thuthi-agenda-picker/skills/agenda-picker/references/example/shots/C-light.svg +5 -0
  52. package/plugins/thuthi-agenda-picker/skills/agenda-picker/references/example/shots/base.css +33 -0
  53. package/plugins/thuthi-agenda-picker/skills/agenda-picker/references/example/shots/name-B.html +15 -0
  54. package/plugins/thuthi-agenda-picker/skills/agenda-picker/references/example/shots/now-dark.svg +5 -0
  55. package/plugins/thuthi-agenda-picker/skills/agenda-picker/references/example/shots/now-light.svg +5 -0
  56. package/plugins/thuthi-agenda-picker/skills/agenda-picker/scripts/picker.py +1286 -0
  57. package/plugins/thuthi-agenda-picker/skills/agenda-picker/scripts/selftest.py +771 -0
  58. package/plugins/thuthi-agenda-picker/skills/agenda-picker/scripts/shot.py +117 -0
  59. package/plugins/thuthi-agenda-picker/skills/agenda-picker/scripts/template.html +1029 -0
  60. package/plugins/thuthi-arch-diagram/.claude-plugin/plugin.json +9 -0
  61. package/plugins/thuthi-arch-diagram/lib/pbpage.py +397 -0
  62. package/plugins/thuthi-arch-diagram/lib/tls.py +68 -0
  63. package/plugins/thuthi-arch-diagram/setup_check.py +10 -0
  64. package/plugins/thuthi-arch-diagram/skills/arch-diagram/SKILL.md +125 -0
  65. package/plugins/thuthi-arch-diagram/skills/arch-diagram/references/design-rules.md +110 -0
  66. package/plugins/thuthi-arch-diagram/skills/arch-diagram/references/example-shop.py +167 -0
  67. package/plugins/thuthi-arch-diagram/skills/arch-diagram/scripts/check.py +194 -0
  68. package/plugins/thuthi-arch-diagram/skills/arch-diagram/scripts/diagramkit.py +682 -0
  69. package/plugins/thuthi-arch-diagram/skills/arch-diagram/scripts/interact_test.py +115 -0
  70. package/plugins/thuthi-arch-diagram/skills/arch-diagram/scripts/render.py +113 -0
  71. package/plugins/thuthi-browser/.claude-plugin/plugin.json +9 -0
  72. package/plugins/thuthi-browser/context.md +3 -0
  73. package/plugins/thuthi-browser/hooks/hooks.json +15 -0
  74. package/plugins/thuthi-browser/lib/pbpage.py +397 -0
  75. package/plugins/thuthi-browser/setup_check.py +93 -0
  76. package/plugins/thuthi-browser/skills/parallel-browser/SKILL.md +271 -0
  77. package/plugins/thuthi-browser/skills/parallel-browser/references/api.md +243 -0
  78. package/plugins/thuthi-browser/skills/parallel-browser/references/install.md +106 -0
  79. package/plugins/thuthi-demo-video/.claude-plugin/plugin.json +9 -0
  80. package/plugins/thuthi-demo-video/lib/pbpage.py +397 -0
  81. package/plugins/thuthi-demo-video/setup_check.py +14 -0
  82. package/plugins/thuthi-demo-video/skills/demo-video/SKILL.md +261 -0
  83. package/plugins/thuthi-demo-video/skills/demo-video/scripts/caption.html +16 -0
  84. package/plugins/thuthi-demo-video/skills/demo-video/scripts/cursor.js +132 -0
  85. package/plugins/thuthi-demo-video/skills/demo-video/scripts/demo_video.py +2416 -0
  86. package/plugins/thuthi-demo-video/skills/demo-video/scripts/example_scenario.py +97 -0
  87. package/plugins/thuthi-demo-video/skills/demo-video/scripts/frame.html +95 -0
  88. package/plugins/thuthi-demo-video/skills/demo-video/scripts/overlay.js +129 -0
  89. package/plugins/thuthi-demo-video/skills/demo-video/scripts/title.html +30 -0
  90. package/plugins/thuthi-no-more-slop/.claude-plugin/plugin.json +9 -0
  91. package/plugins/thuthi-no-more-slop/setup_check.py +10 -0
  92. package/plugins/thuthi-no-more-slop/skills/no-more-slop/LICENSE +21 -0
  93. package/plugins/thuthi-no-more-slop/skills/no-more-slop/SKILL.md +235 -0
  94. package/plugins/thuthi-no-more-slop/skills/no-more-slop/SOURCE.txt +1 -0
  95. package/plugins/thuthi-no-more-slop/skills/no-more-slop/agents/openai.yaml +6 -0
  96. package/plugins/thuthi-no-more-slop/skills/no-more-slop/references/examples.md +289 -0
  97. package/plugins/thuthi-no-more-slop/skills/no-more-slop/references/tokens.md +46 -0
  98. package/plugins/thuthi-no-more-slop/skills/no-more-slop/references/unslop-fallback.md +36 -0
  99. package/plugins/thuthi-no-more-slop/skills/no-more-slop/scripts/count_tells.py +426 -0
  100. package/plugins/thuthi-orca/.claude-plugin/plugin.json +9 -0
  101. package/plugins/thuthi-orca/context.md +5 -0
  102. package/plugins/thuthi-orca/hooks/hooks.json +18 -0
  103. package/plugins/thuthi-orca/hooks/orca-team-grid.ts +21 -0
  104. package/plugins/thuthi-orca/setup_check.py +12 -0
  105. package/plugins/thuthi-orca/skills/orca-new-work/SKILL.md +492 -0
  106. package/plugins/thuthi-orca/tools/orca-team-grid/bin/tmux +338 -0
  107. package/plugins/thuthi-orca/tools/orca-team-grid/tests/selftest.py +299 -0
  108. package/runtime/client.js +69 -0
  109. package/runtime/daemon.js +503 -0
  110. package/runtime/focus-monitor.js +53 -0
  111. package/runtime/keys.js +86 -0
  112. package/runtime/owner.js +64 -0
  113. package/runtime/recorder.js +267 -0
  114. package/runtime/relay.js +95 -0
  115. package/runtime/session.js +1599 -0
@@ -0,0 +1,36 @@
1
+ 규칙 번호는 원본과 같아서 빠진 번호가 있다.
2
+
3
+ ### 내용
4
+
5
+ 3. **뜻 없이 붙인 꼬리 구문.** "강한 성장세를 보여 주며", "원활한 경험을 보장하며", "핵심 흐름을 강조하며". 구문을 지운다.
6
+ 5. **막연한 출처.** "전문가들은 ~라고 본다", "업계에서는", "많은 팀이 이미". 출처를 밝히거나 지운다. 고객 수, 평점처럼 숫자가 든 주장은 지우지 않고 할 일로 적는다.
7
+
8
+ ### 말
9
+
10
+ 7. **AI 어휘.** 혁신적인, 원활한, 매끄러운, 강력한, 최적의, 차별화된, 극대화, 한눈에, 손쉽게, 새로운 차원. 평범한 말로 바꾸거나 지운다.
11
+ 8. **"이다" 를 돌려 말하기.** "~로 자리 잡고 있다", "~역할을 한다", "~를 자랑한다", "~를 갖추고 있다". "이다" 나 "있다" 로 쓴다.
12
+ 9. **"단순한 X 가 아니라 Y."** 요점을 바로 말한다.
13
+ 10. **셋으로 맞추기.** 생각을 억지로 셋씩 묶지 않는다. 있는 만큼만 쓴다.
14
+ 11. **같은 것을 다른 이름으로.** 한 대상을 워크스페이스, 프로젝트, 스페이스로 번갈아 부른다. 이름 하나를 정해 계속 쓴다.
15
+ 12. **가짜 범위.** 양 끝이 실제 척도 위에 있지 않은 "스타트업부터 대기업까지". 누구를 위한 것인지 말한다.
16
+
17
+ ### 표기
18
+
19
+ 13. **Em 대시 (—).** 쓰지 않는다. 문장을 끝내거나 쉼표를 쓴다.
20
+ 17. **단어마다 대문자 (Title Case).** 영문은 문장 첫 글자만 대문자로 쓴다.
21
+
22
+ ### 군말
23
+
24
+ 23. **군말.** "~하기 위해서" 는 "~하려고" 로 쓴다. "~라는 점에 주목할 필요가 있습니다" 는 지운다.
25
+ 24. **겹친 얼버무림.** 한 문장에 "~일 수 있다" 하나까지만 쓴다. "아마", "어쩌면", "~인 것 같다", "~로 보인다" 를 겹쳐 쓰지 않는다.
26
+ 25. **뻔한 맺음말.** "금융의 미래가 여기 있습니다." 사실을 쓰거나 지운다.
27
+
28
+ ### 평범한 말
29
+
30
+ 26. **비유로 쓴 추상 명사.** 토대, 축, 지렛대, 엔진, 생태계, 북극성, 플라이휠, 하네스. 가리키는 구체적인 말로 바꾼다 ("데이터 토대" 는 "공용 DB", "결제의 엔진" 은 "결제 서버"). 그 말이 실제 이름이거나 실제 뜻이면 (제품 이름 "Harness", 진짜 엔진) 남긴다.
31
+ 27. **느낌이 아니라 하는 일을 말한다.** "금융을 단순하게" 는 느낌이다. 동작 방식이나 숫자를 쓴다. 다른 제품 페이지에 그대로 옮겨도 말이 되는 문장은 지운다.
32
+ 28. **빽빽한 문장은 줄이거나 나눈다.** 한 문장에 생각 하나.
33
+ 29. **능동으로 쓴다.** "변경 사항이 편집기에 의해 저장됩니다" 는 "편집기가 변경 사항을 저장합니다" 로 쓴다.
34
+ 30. **부사를 뺀다.** 매끄럽게, 손쉽게, 빠르게, 크게. 빼거나 숫자로 바꾼다.
35
+ 31. **쉬운 말을 쓴다.** "활용하다" 는 "쓰다", "용이하게 하다" 는 "돕다" 로 쓴다.
36
+ 32. **멋 부린 문장.** 경구, 수사적인 토막 문장, 비유로 쓴 동사. 뜻 그대로 쓴다.
@@ -0,0 +1,426 @@
1
+ #!/usr/bin/env python3
2
+ """Count UI slop candidates in a file or folder.
3
+
4
+ Usage: python3 count_tells.py [--surface] [--max N] <file-or-folder> [...]
5
+
6
+ Prints JSON: {rule: {"count": n, "examples": ["file:line", ...]}, "total": n}.
7
+ Regex heuristic for before/after comparison. It misses tells that need
8
+ reading (U3, U4, U5, U7, U8, U14) and can flag legitimate cases.
9
+ U23 (background gradients) is counted by default, without --surface.
10
+ U26 (local paths) counts home and temp folder paths.
11
+ U24 (narrated titles) looks only at heading tags, markdown headings, title
12
+ props and the first string of title-like builder calls.
13
+ --surface adds the visual rules U17 to U20 (gradients and glows, off-scale
14
+ spacing, extra-heavy weights, motion).
15
+ --max N exits 1 when the total is above N, for CI.
16
+ """
17
+ import argparse
18
+ import bisect
19
+ import json
20
+ import os
21
+ import re
22
+ import sys
23
+
24
+ KINDS = {
25
+ "markup": {".html", ".htm", ".jsx", ".tsx", ".js", ".mjs", ".cjs", ".ts", ".vue", ".svelte", ".astro"},
26
+ "prose": {".md", ".mdx"},
27
+ "style": {".css", ".scss", ".less"},
28
+ "data": {".json"},
29
+ "python": {".py"},
30
+ }
31
+ KIND_OF = {ext: kind for kind, exts in KINDS.items() for ext in exts}
32
+ SKIP_DIRS = {"node_modules", ".git", "dist", "build", ".next", ".svelte-kit", ".astro", "coverage", ".venv", "venv", "__pycache__"}
33
+ SKIP_FILES = {"package-lock.json", "package.json"}
34
+ # Minified bundles and data dumps are not hand-written interface code.
35
+ MAX_BYTES = 1_000_000
36
+ # Enough to show where to look without flooding the agent's context.
37
+ MAX_EXAMPLES = 5
38
+
39
+ ALL = set(KINDS)
40
+ TEXT = ALL - {"style"}
41
+
42
+
43
+ def blank(match):
44
+ return re.sub(r"[^\n]", " ", match.group(0))
45
+
46
+
47
+ COMMENTS = {
48
+ "block": re.compile(r"^[ \t]*/\*.*?\*/", re.S | re.M),
49
+ "jsx": re.compile(r"\{/\*.*?\*/\}", re.S),
50
+ "html": re.compile(r"<!--.*?-->", re.S),
51
+ "line": re.compile(r"^[ \t]*//.*$", re.M),
52
+ # After code punctuation only, so "https://" and a "01 // Features" text node survive.
53
+ "trailing": re.compile(r"(?<=[;,{}()\[\]])[ \t]*//(?!/)[^<\n]*$", re.M),
54
+ "hash": re.compile(r"^[ \t]*#.*$", re.M),
55
+ }
56
+ COMMENTS_FOR = {
57
+ "markup": ("jsx", "html", "block", "line", "trailing"),
58
+ "prose": ("jsx", "html"),
59
+ "style": ("block", "line"),
60
+ "data": (),
61
+ "python": ("hash",),
62
+ }
63
+
64
+
65
+ def strip_comments(text, kind):
66
+ """Blank comments out, keeping every offset and line number."""
67
+ for name in COMMENTS_FOR[kind]:
68
+ text = COMMENTS[name].sub(blank, text)
69
+ return text
70
+
71
+
72
+ def rx(pattern, flags=0):
73
+ regex = re.compile(pattern, flags)
74
+ return lambda text: [m.start() for m in regex.finditer(text)]
75
+
76
+
77
+ def once_per_line(find):
78
+ """One hit per line, for patterns where two matches are one sentence."""
79
+ def wrapped(text):
80
+ hits, last_line_start = [], -1
81
+ for pos in find(text):
82
+ line_start = text.rfind("\n", 0, pos) + 1
83
+ if line_start != last_line_start:
84
+ hits.append(pos)
85
+ last_line_start = line_start
86
+ return hits
87
+
88
+ return wrapped
89
+
90
+
91
+ def enclosing_tag(text, pos):
92
+ """Name of the tag opened last before pos, or ''."""
93
+ start = text.rfind("<", max(0, pos - 400), pos + 1)
94
+ match = re.match(r"</?([A-Za-z][\w.]*)", text[start:start + 60]) if start != -1 else None
95
+ return match.group(1) if match else ""
96
+
97
+
98
+ def quoted_segment(text, pos):
99
+ """The string literal around pos, or its line when there are no quotes."""
100
+ lo = max(0, pos - 400)
101
+ before = max(text.rfind(q, lo, pos) for q in "\"'`")
102
+ after = [i for i in (text.find(q, pos, pos + 400) for q in "\"'`") if i != -1]
103
+ if before == -1 or not after:
104
+ return text.rfind("\n", 0, pos) + 1, (text.find("\n", pos) + 1 or len(text))
105
+ return before + 1, min(after)
106
+
107
+
108
+ # U1: uppercase plus widened tracking in one class string. Table headers and
109
+ # key caps use the same styling and are not eyebrows.
110
+ EYEBROW = re.compile(
111
+ r"\buppercase\b[^\"'`<>]{0,200}?\btracking-(?!tight|normal)"
112
+ r"|\btracking-(?!tight|normal)[^\"'`<>]{0,200}?\buppercase\b"
113
+ r"|text-transform:\s*uppercase|textTransform:\s*[\"']uppercase"
114
+ )
115
+ NOT_EYEBROW_TAGS = {"th", "TableHead", "TableHeader", "kbd", "abbr"}
116
+
117
+
118
+ def eyebrows(text):
119
+ return [m.start() for m in EYEBROW.finditer(text) if enclosing_tag(text, m.start()) not in NOT_EYEBROW_TAGS]
120
+
121
+
122
+ # U2: "01", "01.", "01 //" as text, a zero-padded index, or "//" used as an
123
+ # ornament inside a text node. Dates and times ("01/02", "01:30") are not it.
124
+ NUMBERING = (
125
+ r">\s*0[1-9](?![/:.\-]\d)(?:\s|<|\.|/)"
126
+ r"|(?<![=\w])['\"`]0[1-9]['\"`]"
127
+ r"|>[^<>{}\n]*?(?<!:)//[^<>\n]*<"
128
+ r"|padStart\(\s*2\s*,\s*['\"`]0['\"`]\s*\)"
129
+ r"|>\s*0\{"
130
+ )
131
+
132
+ # U6: two or more separators close together make a chain. One separator
133
+ # ("Jan 3 · 14:02") is ordinary punctuation.
134
+ SEPARATOR = re.compile(r"·|•|&middot;|&#183;|&bull;|\\u00b7|\\u2022")
135
+ JOINED = re.compile(r"join\(\s*['\"`]\s*(?:·|•|\|)\s*['\"`]\s*\)")
136
+ PIPED = re.compile(r">[^<>{}\n]*\s\|\s[^<>{}\n]*\s\|\s[^<>{}\n]*<")
137
+ CHAIN_GAP = 200
138
+
139
+
140
+ def status_strings(text):
141
+ hits = [m.start() for m in JOINED.finditer(text)] + [m.start() for m in PIPED.finditer(text)]
142
+ cluster = []
143
+ for pos in [m.start() for m in SEPARATOR.finditer(text)] + [None]:
144
+ if cluster and (pos is None or pos - cluster[-1] > CHAIN_GAP):
145
+ if len(cluster) > 1:
146
+ hits.append(cluster[0])
147
+ cluster = []
148
+ if pos is not None:
149
+ cluster.append(pos)
150
+ return hits
151
+
152
+
153
+ # U9: a flavor word standing alone in a text node. Uppercase words count
154
+ # anywhere except inside a control; "New", "Pro" and friends only inside
155
+ # something badge-shaped, because <Button>New</Button> is an action.
156
+ BADGE_NODE = re.compile(
157
+ r">\s*(?:(LIVE|NEW|BETA|AI|PRO|HOT)|(Live|New|Beta|Pro|Hot|Popular|Most popular|Coming soon|Featured|Trending|AI-powered|Powered by AI))\s*<"
158
+ )
159
+ BADGE_LITERAL = re.compile(r"['\"`](?:LIVE|NEW|BETA|HOT)['\"`]")
160
+ CONTROL_TAGS = {
161
+ "button", "Button", "a", "Link", "NavLink", "option", "label", "Label", "th", "td", "title",
162
+ "MenuItem", "DropdownMenuItem", "SelectItem", "CommandItem", "TabsTrigger", "Tab",
163
+ "h1", "h2", "h3", "h4", "h5", "h6",
164
+ }
165
+ BADGE_TAGS = {"span", "sup", "small", "mark", "Badge", "Pill", "Chip", "Tag"}
166
+
167
+
168
+ def badge_words(text):
169
+ hits = [m.start() for m in BADGE_LITERAL.finditer(text)]
170
+ for m in BADGE_NODE.finditer(text):
171
+ tag = enclosing_tag(text, m.start())
172
+ if tag in CONTROL_TAGS:
173
+ continue
174
+ if m.group(1) or tag in BADGE_TAGS:
175
+ hits.append(m.start())
176
+ return hits
177
+
178
+
179
+ # U10: a small round element, or a pulse that is not a loading skeleton.
180
+ DOT_TOKEN = re.compile(r"\brounded-full\b|\banimate-(?:pulse|ping)\b")
181
+ SMALL = r"(?:1|1\.5|2|2\.5|3|px)(?![\w.])"
182
+ SMALL_SIZE = re.compile(r"(?<![\w:-])size-" + SMALL)
183
+ SMALL_H = re.compile(r"(?<![\w:-])h-" + SMALL)
184
+ SMALL_W = re.compile(r"(?<![\w:-])w-" + SMALL)
185
+ SKELETON = re.compile(r"skeleton|\bbg-(?:muted|accent|secondary|(?:gray|slate|zinc|neutral|stone)-\d)", re.I)
186
+
187
+
188
+ def status_dots(text):
189
+ hits, seen = [], set()
190
+ for m in DOT_TOKEN.finditer(text):
191
+ start, end = quoted_segment(text, m.start())
192
+ if start in seen:
193
+ continue
194
+ seen.add(start)
195
+ segment = text[start:end]
196
+ dot = "rounded-full" in segment and (
197
+ SMALL_SIZE.search(segment) or (SMALL_H.search(segment) and SMALL_W.search(segment))
198
+ )
199
+ skeleton = SKELETON.search(segment) or "skeleton" in enclosing_tag(text, start).lower()
200
+ if dot or "animate-ping" in segment or ("animate-pulse" in segment and not skeleton):
201
+ hits.append(start)
202
+ return hits
203
+
204
+
205
+ # U11: pictographs. Check marks and crosses (U+2713 to U+2718) are left out:
206
+ # they are usually the control or the value itself.
207
+ EMOJI = (
208
+ "[\U0001F300-\U0001FAFF\U00002600-\U00002712\U00002719-\U000027BF\U0001F000-\U0001F2FF"
209
+ "\U00002B50\U00002B55\U0000231A-\U0000231B\U000023E9-\U000023FA]"
210
+ )
211
+
212
+ # U11: an icon in a tinted tile. A small fixed-size box with a tinted fill and
213
+ # rounded corners whose first child is an icon. The icon-only control, an
214
+ # avatar and a tile that also holds text are not it.
215
+ CLASS_ATTR = re.compile(r"""class(?:Name)?\s*=\s*(?:"([^"]*)"|\{?\s*[`']([^`']*)[`']\s*\}?)""")
216
+ TILE_FILL = re.compile(r"(?<![\w:-])bg-(?!(?:white|transparent|black)\b)[a-z]+(?:-(?:50|100|200)\b|-\d{3}/\d{1,2}\b|/\d{1,2}\b)")
217
+ TILE_BOX = re.compile(r"(?<![\w:-])(?:size-(?:7|8|9|10|11|12)|(?:h|w)-(?:7|8|9|10|11|12))(?![\w.])")
218
+ TILE_ROUND = re.compile(r"(?<![\w:-])rounded(?:-(?:md|lg|xl|2xl|full))?(?![\w-])")
219
+ TILE_CHILD = re.compile(r"\s*>\s*<(?:svg\b|i\b|[A-Z]\w*\b[^<>]*/>)")
220
+
221
+
222
+ def icon_tiles(text):
223
+ hits = []
224
+ for m in CLASS_ATTR.finditer(text):
225
+ classes = m.group(1) or m.group(2) or ""
226
+ if TILE_FILL.search(classes) and TILE_BOX.search(classes) and TILE_ROUND.search(classes):
227
+ if TILE_CHILD.match(text, m.end()):
228
+ hits.append(m.start())
229
+ return hits
230
+
231
+
232
+ CHART_TYPE_TITLE = r"\b(?:bar|line|pie|area|scatter|donut|column) (?:chart|graph|plot) (?:of|showing|for)\b"
233
+ # 한국어: "월별 매출 막대 차트", "주간 사용자 선 그래프"
234
+ CHART_TYPE_TITLE += r"|(?:막대|선|꺾은선|원|파이|영역|산점도|도넛)\s?(?:차트|그래프)"
235
+ READING_INSTRUCTIONS = r"\beach (?:bar|point|dot|line|slice|column|row) (?:represents|shows|is)\b|\bhover (?:over|for|to see)\b"
236
+ # 한국어: "막대 하나가 한 달입니다", "각 점은 ...", "마우스를 올리면 ..."
237
+ READING_INSTRUCTIONS += r"|(?:막대|점|선|조각|행|칸) 하나[가는]|각 (?:막대|점|선|조각|행)[은는이가]|마우스를 올[리려]"
238
+
239
+ # U15 and U16 run on the whole file, so a config formatted over several
240
+ # lines counts the same as a one-liner.
241
+ SCAFFOLDING = (
242
+ r"feDropShadow|drop-shadow\(|shadowBlur|shadowColor|\bminor\s*:\s*\{"
243
+ r"|border\s*:\s*\{[^}]*\bwidth\s*:\s*(?:[2-9]|1\.[5-9])"
244
+ r"|grid\s*:\s*\{[^}]*\blineWidth\s*:\s*(?:[2-9]|1\.[5-9])"
245
+ )
246
+ SCAFFOLDING_PY = r"\.grid\([^)]*\b(?:linewidth|lw)\s*=\s*(?:[2-9]|1\.[5-9])|\bshadow\s*=\s*True"
247
+ LEGEND = r"legend\s*:\s*\{[^}]*\b(?:display|show)\s*:\s*true|\bshowlegend\s*:\s*true|<(?:Chart)?Legend\b"
248
+ LEGEND_PY = r"\.legend\(|\bshowlegend\s*=\s*True"
249
+
250
+ # A lone dash standing for "no value" is a table convention, not prose.
251
+ EM_DASH = re.compile(r"—|&mdash;|&#8212;|\\u2014")
252
+ LONE_DASH = re.compile(r"(?<=[\"'`>])\s*(?:—|&mdash;|&#8212;|\\u2014)\s*(?=[\"'`<])")
253
+
254
+
255
+ def em_dashes(text):
256
+ return [m.start() for m in EM_DASH.finditer(LONE_DASH.sub(blank, text))]
257
+
258
+
259
+ # U18: odd pixel values, and anything over 16 that is not a multiple of 4.
260
+ # 2, 6, 10 and 14 are Tailwind's half steps (0.5, 1.5, 2.5, 3.5).
261
+ SPACING = re.compile(
262
+ r"(?<![\w-])-?(?:[mp][trblxyse]?|gap(?:-[xy])?|space-[xy])-\[(\d+)px\]"
263
+ r"|\b(?:margin|padding)(?:-(?:top|right|bottom|left))?\s*:\s*(\d+)px\s*(?:[;}\"']|$)"
264
+ r"|\bgap\s*:\s*(\d+)px",
265
+ re.M,
266
+ )
267
+
268
+
269
+ def off_scale(text):
270
+ hits = []
271
+ for m in SPACING.finditer(text):
272
+ value = int(next(g for g in m.groups() if g))
273
+ if value % 2 or (value > 16 and value % 4):
274
+ hits.append(m.start())
275
+ return hits
276
+
277
+
278
+ TITLE_SOURCES = [
279
+ re.compile(r"<h[1-6][^>]*>([^<]{2,200})</h[1-6]>"),
280
+ re.compile(r"^#{1,6}[ \t]+(.{2,200})$", re.M),
281
+ re.compile(r"\btitle\s*[:=]\s*\{?\s*[\"'`]([^\"'`\n]{2,200})[\"'`]"),
282
+ # Deck and document builders: content('제목', ...), table('제목', ...), slide("제목") ...
283
+ re.compile(r"\b(?:title|heading|content|section|slide|table|card|page)\s*\(\s*[\"'`]([^\"'`\n]{2,200})[\"'`]"),
284
+ ]
285
+ NARRATED_TITLE = re.compile(
286
+ r"[::]\s*\S[^:]*(?:다|요)\.?\s*$" # colon then a sentence
287
+ r"|[::]\s*[^,:]+,\s*[^,:]+," # colon then a contents list
288
+ r"|(?:→|->)[^→]*(?:→|->)" # flow written into the title
289
+ r"|\((?:보강|추가|초안|최신순|오래된순|[^()]{1,24}\s?=\s?[^()]{1,40}|[^()]*\s발언)\)" # bracketed reading guide
290
+ r"|\S(?:는|할) (?:일|것|때)(?=\s*$|\s*[:,(]|과 |와 )" # verb phrase instead of a name
291
+ )
292
+
293
+
294
+ def narrated_titles(text):
295
+ hits = []
296
+ for source in TITLE_SOURCES:
297
+ for m in source.finditer(text):
298
+ if NARRATED_TITLE.search(m.group(1)):
299
+ hits.append(m.start(1))
300
+ return sorted(set(hits))
301
+
302
+
303
+ TILDE_SKIP = re.compile(
304
+ r"^```.*?^```" # fenced code block
305
+ r"|`[^`\n]*`" # inline code
306
+ r"|<[A-Za-z][^<>\n]*>" # tag with attributes on one line
307
+ r"|\{[^{}\n]*\}" # JSX expression or JSON-like prop on one line
308
+ r"|\\~", # already escaped
309
+ re.S | re.M,
310
+ )
311
+
312
+
313
+ def tilde_strikes(text):
314
+ """Lines of markdown prose where two unescaped tildes would draw a strikethrough."""
315
+ visible = TILDE_SKIP.sub(blank, text)
316
+ hits, offset = [], 0
317
+ for line in visible.split("\n"):
318
+ # A table row is split per cell: a tilde pair must sit inside one cell to strike.
319
+ cells = line.split("|") if line.lstrip().startswith("|") else [line]
320
+ if any(cell.count("~") >= 2 for cell in cells):
321
+ hits.append(offset + line.index("~"))
322
+ offset += len(line) + 1
323
+ return hits
324
+
325
+
326
+ MARKUP = {"markup", "prose"}
327
+ RULES = [
328
+ ("U1 eyebrow", eyebrows, MARKUP | {"style"}),
329
+ ("U2 decorative numbering", rx(NUMBERING), MARKUP),
330
+ ("U6 status string", status_strings, TEXT),
331
+ ("U9 badge word", badge_words, MARKUP | {"data"}),
332
+ ("U10 status dot", status_dots, MARKUP),
333
+ ("U11 emoji", rx(EMOJI), ALL),
334
+ ("U11 icon tile", icon_tiles, MARKUP),
335
+ ("U12 chart-type title", rx(CHART_TYPE_TITLE, re.I), TEXT),
336
+ ("U13 reading instructions", once_per_line(rx(READING_INSTRUCTIONS, re.I)), TEXT),
337
+ ("U15 chart scaffolding", rx(SCAFFOLDING), MARKUP),
338
+ ("U15 chart scaffolding", rx(SCAFFOLDING_PY), {"python"}),
339
+ ("U16 legend", rx(LEGEND), MARKUP),
340
+ ("U16 legend", rx(LEGEND_PY), {"python"}),
341
+ ("U23 background gradient", rx(
342
+ r"\bbg-(?:gradient|linear|radial|conic)-|background(?:-image)?\s*:[^;{}]*(?:linear|radial|conic)-gradient\("
343
+ ), MARKUP | {"style"}),
344
+ ("U24 narrated title", narrated_titles, MARKUP),
345
+ ("U26 local path", rx(r"(?<![\w/])(?:~/|/Users/[A-Za-z]|/home/[a-z]|[A-Z]:\\\\?Users\\\\?|/private/tmp/|/tmp/)"), TEXT),
346
+ ("U30 edit marker", rx(r"\((?:고침|수정|수정됨|추가|추가됨|갱신|신규|변경|변경됨|보강)\)|\b(?:NEW|UPDATED)\b"), MARKUP),
347
+ ("U31 tilde strikethrough", tilde_strikes, {"prose"}),
348
+ ("글쓰기 13 em dash", em_dashes, TEXT),
349
+ ]
350
+ STYLED = MARKUP | {"style"}
351
+ SURFACE_RULES = [
352
+ ("U17 gradient or glow", rx(
353
+ r"\bbg-(?:gradient|linear|radial|conic)-to?-?|(?:linear|radial|conic)-gradient\(|\bbg-clip-text\b|background-clip:\s*text"
354
+ r"|\bblur-(?:2xl|3xl)\b|\bshadow-\[0_0_|\bshadow-[a-z]+-\d{2,3}(?:/\d+)?\b|box-shadow:[^;]*\b0\s+0\s+\d+px"
355
+ ), STYLED),
356
+ ("U18 off-scale spacing", off_scale, STYLED),
357
+ ("U19 extra-heavy weight", rx(
358
+ r"\bfont-(?:extrabold|black)\b|font-?[wW]eight\W{0,3}[89]00\b|\bfont-\[[89]00\]"
359
+ ), STYLED),
360
+ ("U20 motion", rx(
361
+ r"\btransition-all\b|transition:\s*all\b|\bhover:scale-|\banimate-bounce\b"
362
+ ), STYLED),
363
+ ]
364
+
365
+
366
+ def iter_files(targets):
367
+ for target in targets:
368
+ if os.path.isfile(target):
369
+ yield target
370
+ continue
371
+ for root, dirs, files in os.walk(target):
372
+ dirs[:] = sorted(d for d in dirs if d not in SKIP_DIRS)
373
+ for name in sorted(files):
374
+ if name in SKIP_FILES or ".min." in name:
375
+ continue
376
+ if os.path.splitext(name)[1].lower() in KIND_OF:
377
+ yield os.path.join(root, name)
378
+
379
+
380
+ def count(targets, surface=False):
381
+ rules = RULES + (SURFACE_RULES if surface else [])
382
+ results = {name: {"count": 0, "examples": []} for name, _, _ in rules}
383
+ for path in iter_files(targets):
384
+ # A file named on the command line is scanned whatever its extension.
385
+ kind = KIND_OF.get(os.path.splitext(path)[1].lower(), "markup")
386
+ try:
387
+ if os.path.getsize(path) > MAX_BYTES:
388
+ continue
389
+ with open(path, encoding="utf-8", errors="replace") as f:
390
+ text = strip_comments(f.read(), kind)
391
+ except OSError as e:
392
+ print("Skipped {}: {}".format(path, e), file=sys.stderr)
393
+ continue
394
+ line_starts = [m.end() for m in re.finditer(r"\n", text)]
395
+ for name, find, kinds in rules:
396
+ if kind not in kinds:
397
+ continue
398
+ entry = results[name]
399
+ for pos in sorted(find(text)):
400
+ entry["count"] += 1
401
+ if len(entry["examples"]) < MAX_EXAMPLES:
402
+ entry["examples"].append("{}:{}".format(path, bisect.bisect_right(line_starts, pos) + 1))
403
+ results["total"] = sum(r["count"] for r in results.values())
404
+ return results
405
+
406
+
407
+ def main():
408
+ parser = argparse.ArgumentParser(description="Count UI slop candidates in files or folders.")
409
+ parser.add_argument("targets", nargs="+", metavar="file-or-folder")
410
+ parser.add_argument("--surface", action="store_true", help="also count U17 to U20")
411
+ parser.add_argument("--max", type=int, metavar="N", help="exit 1 when the total is above N")
412
+ args = parser.parse_args()
413
+
414
+ missing = [t for t in args.targets if not os.path.exists(t)]
415
+ if missing:
416
+ print("Not found: " + ", ".join(missing), file=sys.stderr)
417
+ sys.exit(2)
418
+
419
+ results = count(args.targets, args.surface)
420
+ print(json.dumps(results, indent=2, ensure_ascii=False))
421
+ if args.max is not None and results["total"] > args.max:
422
+ sys.exit(1)
423
+
424
+
425
+ if __name__ == "__main__":
426
+ main()
@@ -0,0 +1,9 @@
1
+ {
2
+ "name": "thuthi-orca",
3
+ "version": "0.12.1",
4
+ "description": "Orca 용: orca-new-work 스킬 (새 브랜치 worktree + 탭 + claude 에 작업 넘기기), agent-teams 팀원 칸 격자 배치, orca CLI 상시 지시",
5
+ "author": {
6
+ "name": "thuthi"
7
+ },
8
+ "dependencies": ["thuthi"]
9
+ }
@@ -0,0 +1,5 @@
1
+ # thuthi-orca 상시 지시
2
+
3
+ - `orca` CLI 명령은 샌드박스가 Orca 런타임 소켓 접근을 막는다. 샌드박스로 먼저 시도하지 말고, 처음부터 항상 `dangerouslyDisableSandbox: true` 로 실행한다.
4
+ - Orca 새 탭: 터미널 탭은 `orca terminal create --json` (옵션 `--title "이름"`, `--command "codex"`), 브라우저 탭은 `orca tab create --url <url> --json`.
5
+ - Orca 에서 새 브랜치 worktree 를 만들거나 다른 worktree 탭에서 명령 · 에이전트를 띄울 때는 `thuthi-orca:orca-new-work` 스킬 절차를 따른다 (동레벨 `<repo>-orca-wt-<branch>`, `orca repo add` 금지, `id:<repoId>::<path>` 셀렉터, `--focus` 금지).
@@ -0,0 +1,18 @@
1
+ {
2
+ "modules": [
3
+ "./orca-team-grid.ts"
4
+ ],
5
+ "hooks": {
6
+ "SessionStart": [
7
+ {
8
+ "hooks": [
9
+ {
10
+ "type": "command",
11
+ "command": "cat \"${CLAUDE_PLUGIN_ROOT}/context.md\"",
12
+ "timeout": 5
13
+ }
14
+ ]
15
+ }
16
+ ]
17
+ }
18
+ }
@@ -0,0 +1,21 @@
1
+ import type { Register } from 'claude-code'
2
+
3
+ // Orca `claude-teams` 팀장 세션이면 tools/orca-team-grid/bin 을 이 프로세스 PATH 맨 앞에 붙인다.
4
+ // Claude Code 가 팀원 칸을 만들려고 부르는 tmux 가 그 폴더의 감싸기로 가서
5
+ // "팀장 1줄 + 한 줄에 4명" 으로 나뉜다. 끄기: ORCA_TEAM_GRID=0 으로 띄운다.
6
+ export const register: Register = on => {
7
+ on('session.start', async ($, e, next) => {
8
+ const team = await $.env.get('ORCA_AGENT_TEAMS_TEAM_ID')
9
+ const off = (await $.env.get('ORCA_TEAM_GRID')) === '0'
10
+ if (team && !off) {
11
+ const dir = `${$.plugin.root}/tools/orca-team-grid/bin`
12
+ const path = (await $.env.get('PATH')) ?? ''
13
+ if (!path.split(':').includes(dir)) {
14
+ await $.env.set('PATH', path ? `${dir}:${path}` : dir)
15
+ }
16
+ await $.env.set('ORCA_TEAM_GRID', '1')
17
+ }
18
+
19
+ return next(e)
20
+ })
21
+ }
@@ -0,0 +1,12 @@
1
+ """thuthi-orca 점검 (thuthi:setup 의 doctor.py 가 부른다)."""
2
+ from __future__ import annotations
3
+
4
+ import shutil
5
+
6
+
7
+ def check(d) -> list:
8
+ orca, jq = shutil.which("orca"), shutil.which("jq")
9
+ return [
10
+ ("orca", d.OK if orca else d.BAD, "orca CLI", "" if orca else "Orca 앱 설치 (이 플러그인은 Orca 전용)"),
11
+ ("orca", d.OK if jq else d.BAD, "jq", "" if jq else "brew install jq"),
12
+ ]