compact-agent 1.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 (324) hide show
  1. package/README.md +394 -0
  2. package/bin/anycode.js +2 -0
  3. package/bin/crowcoder.js +19 -0
  4. package/bin/ecc-hooks.cjs +138 -0
  5. package/dist/agents.d.ts +17 -0
  6. package/dist/agents.js +1603 -0
  7. package/dist/agents.js.map +1 -0
  8. package/dist/api.d.ts +16 -0
  9. package/dist/api.js +115 -0
  10. package/dist/api.js.map +1 -0
  11. package/dist/autonomous-loops.d.ts +108 -0
  12. package/dist/autonomous-loops.js +526 -0
  13. package/dist/autonomous-loops.js.map +1 -0
  14. package/dist/codemaps.d.ts +53 -0
  15. package/dist/codemaps.js +325 -0
  16. package/dist/codemaps.js.map +1 -0
  17. package/dist/compaction.d.ts +30 -0
  18. package/dist/compaction.js +125 -0
  19. package/dist/compaction.js.map +1 -0
  20. package/dist/config.d.ts +5 -0
  21. package/dist/config.js +79 -0
  22. package/dist/config.js.map +1 -0
  23. package/dist/content-engine.d.ts +97 -0
  24. package/dist/content-engine.js +721 -0
  25. package/dist/content-engine.js.map +1 -0
  26. package/dist/cost-tracker.d.ts +49 -0
  27. package/dist/cost-tracker.js +150 -0
  28. package/dist/cost-tracker.js.map +1 -0
  29. package/dist/counter-button.d.ts +35 -0
  30. package/dist/counter-button.js +48 -0
  31. package/dist/counter-button.js.map +1 -0
  32. package/dist/counter.d.ts +21 -0
  33. package/dist/counter.js +31 -0
  34. package/dist/counter.js.map +1 -0
  35. package/dist/coverage.d.ts +23 -0
  36. package/dist/coverage.js +215 -0
  37. package/dist/coverage.js.map +1 -0
  38. package/dist/docs-sync.d.ts +23 -0
  39. package/dist/docs-sync.js +266 -0
  40. package/dist/docs-sync.js.map +1 -0
  41. package/dist/ecc.d.ts +41 -0
  42. package/dist/ecc.js +644 -0
  43. package/dist/ecc.js.map +1 -0
  44. package/dist/evaluation.d.ts +24 -0
  45. package/dist/evaluation.js +412 -0
  46. package/dist/evaluation.js.map +1 -0
  47. package/dist/export.d.ts +22 -0
  48. package/dist/export.js +109 -0
  49. package/dist/export.js.map +1 -0
  50. package/dist/git-workflow.d.ts +22 -0
  51. package/dist/git-workflow.js +197 -0
  52. package/dist/git-workflow.js.map +1 -0
  53. package/dist/hook-controls.d.ts +34 -0
  54. package/dist/hook-controls.js +90 -0
  55. package/dist/hook-controls.js.map +1 -0
  56. package/dist/hooks.d.ts +30 -0
  57. package/dist/hooks.js +130 -0
  58. package/dist/hooks.js.map +1 -0
  59. package/dist/html-parser.d.ts +18 -0
  60. package/dist/html-parser.js +101 -0
  61. package/dist/html-parser.js.map +1 -0
  62. package/dist/index.d.ts +12 -0
  63. package/dist/index.js +1230 -0
  64. package/dist/index.js.map +1 -0
  65. package/dist/learning.d.ts +35 -0
  66. package/dist/learning.js +238 -0
  67. package/dist/learning.js.map +1 -0
  68. package/dist/login.d.ts +37 -0
  69. package/dist/login.js +191 -0
  70. package/dist/login.js.map +1 -0
  71. package/dist/memory.d.ts +39 -0
  72. package/dist/memory.js +183 -0
  73. package/dist/memory.js.map +1 -0
  74. package/dist/model-router.d.ts +23 -0
  75. package/dist/model-router.js +145 -0
  76. package/dist/model-router.js.map +1 -0
  77. package/dist/modes.d.ts +17 -0
  78. package/dist/modes.js +217 -0
  79. package/dist/modes.js.map +1 -0
  80. package/dist/orchestration.d.ts +37 -0
  81. package/dist/orchestration.js +139 -0
  82. package/dist/orchestration.js.map +1 -0
  83. package/dist/package-detect.d.ts +36 -0
  84. package/dist/package-detect.js +529 -0
  85. package/dist/package-detect.js.map +1 -0
  86. package/dist/permissions.d.ts +25 -0
  87. package/dist/permissions.js +50 -0
  88. package/dist/permissions.js.map +1 -0
  89. package/dist/pm2-manager.d.ts +40 -0
  90. package/dist/pm2-manager.js +127 -0
  91. package/dist/pm2-manager.js.map +1 -0
  92. package/dist/query.d.ts +15 -0
  93. package/dist/query.js +278 -0
  94. package/dist/query.js.map +1 -0
  95. package/dist/refactor.d.ts +22 -0
  96. package/dist/refactor.js +226 -0
  97. package/dist/refactor.js.map +1 -0
  98. package/dist/retry.d.ts +20 -0
  99. package/dist/retry.js +88 -0
  100. package/dist/retry.js.map +1 -0
  101. package/dist/rules.d.ts +34 -0
  102. package/dist/rules.js +942 -0
  103. package/dist/rules.js.map +1 -0
  104. package/dist/schema.d.ts +23 -0
  105. package/dist/schema.js +12 -0
  106. package/dist/schema.js.map +1 -0
  107. package/dist/search-first.d.ts +17 -0
  108. package/dist/search-first.js +301 -0
  109. package/dist/search-first.js.map +1 -0
  110. package/dist/security.d.ts +10 -0
  111. package/dist/security.js +145 -0
  112. package/dist/security.js.map +1 -0
  113. package/dist/sessions.d.ts +21 -0
  114. package/dist/sessions.js +112 -0
  115. package/dist/sessions.js.map +1 -0
  116. package/dist/skill-create.d.ts +38 -0
  117. package/dist/skill-create.js +389 -0
  118. package/dist/skill-create.js.map +1 -0
  119. package/dist/skills.d.ts +34 -0
  120. package/dist/skills.js +161 -0
  121. package/dist/skills.js.map +1 -0
  122. package/dist/strategic-compaction.d.ts +24 -0
  123. package/dist/strategic-compaction.js +144 -0
  124. package/dist/strategic-compaction.js.map +1 -0
  125. package/dist/system-prompt.d.ts +3 -0
  126. package/dist/system-prompt.js +101 -0
  127. package/dist/system-prompt.js.map +1 -0
  128. package/dist/theme.d.ts +60 -0
  129. package/dist/theme.js +220 -0
  130. package/dist/theme.js.map +1 -0
  131. package/dist/tools/bash.d.ts +2 -0
  132. package/dist/tools/bash.js +49 -0
  133. package/dist/tools/bash.js.map +1 -0
  134. package/dist/tools/edit.d.ts +2 -0
  135. package/dist/tools/edit.js +76 -0
  136. package/dist/tools/edit.js.map +1 -0
  137. package/dist/tools/glob.d.ts +2 -0
  138. package/dist/tools/glob.js +54 -0
  139. package/dist/tools/glob.js.map +1 -0
  140. package/dist/tools/grep.d.ts +2 -0
  141. package/dist/tools/grep.js +64 -0
  142. package/dist/tools/grep.js.map +1 -0
  143. package/dist/tools/index.d.ts +5 -0
  144. package/dist/tools/index.js +27 -0
  145. package/dist/tools/index.js.map +1 -0
  146. package/dist/tools/list-dir.d.ts +2 -0
  147. package/dist/tools/list-dir.js +51 -0
  148. package/dist/tools/list-dir.js.map +1 -0
  149. package/dist/tools/read.d.ts +2 -0
  150. package/dist/tools/read.js +56 -0
  151. package/dist/tools/read.js.map +1 -0
  152. package/dist/tools/types.d.ts +45 -0
  153. package/dist/tools/types.js +2 -0
  154. package/dist/tools/types.js.map +1 -0
  155. package/dist/tools/web-fetch.d.ts +2 -0
  156. package/dist/tools/web-fetch.js +41 -0
  157. package/dist/tools/web-fetch.js.map +1 -0
  158. package/dist/tools/web-search.d.ts +27 -0
  159. package/dist/tools/web-search.js +139 -0
  160. package/dist/tools/web-search.js.map +1 -0
  161. package/dist/tools/write.d.ts +2 -0
  162. package/dist/tools/write.js +36 -0
  163. package/dist/tools/write.js.map +1 -0
  164. package/dist/types.d.ts +28 -0
  165. package/dist/types.js +57 -0
  166. package/dist/types.js.map +1 -0
  167. package/dist/users.d.ts +51 -0
  168. package/dist/users.js +193 -0
  169. package/dist/users.js.map +1 -0
  170. package/dist/verification.d.ts +73 -0
  171. package/dist/verification.js +269 -0
  172. package/dist/verification.js.map +1 -0
  173. package/dist/walkthrough.d.ts +10 -0
  174. package/dist/walkthrough.js +121 -0
  175. package/dist/walkthrough.js.map +1 -0
  176. package/package.json +58 -0
  177. package/resources/ecc/agents/architect.json +16 -0
  178. package/resources/ecc/agents/architect.md +212 -0
  179. package/resources/ecc/agents/build-error-resolver.json +17 -0
  180. package/resources/ecc/agents/build-error-resolver.md +116 -0
  181. package/resources/ecc/agents/chief-of-staff.json +17 -0
  182. package/resources/ecc/agents/chief-of-staff.md +153 -0
  183. package/resources/ecc/agents/code-reviewer.json +16 -0
  184. package/resources/ecc/agents/code-reviewer.md +238 -0
  185. package/resources/ecc/agents/database-reviewer.json +16 -0
  186. package/resources/ecc/agents/database-reviewer.md +92 -0
  187. package/resources/ecc/agents/doc-updater.json +16 -0
  188. package/resources/ecc/agents/doc-updater.md +108 -0
  189. package/resources/ecc/agents/e2e-runner.json +17 -0
  190. package/resources/ecc/agents/e2e-runner.md +109 -0
  191. package/resources/ecc/agents/go-build-resolver.json +17 -0
  192. package/resources/ecc/agents/go-build-resolver.md +96 -0
  193. package/resources/ecc/agents/go-reviewer.json +16 -0
  194. package/resources/ecc/agents/go-reviewer.md +77 -0
  195. package/resources/ecc/agents/harness-optimizer.json +15 -0
  196. package/resources/ecc/agents/harness-optimizer.md +34 -0
  197. package/resources/ecc/agents/loop-operator.json +16 -0
  198. package/resources/ecc/agents/loop-operator.md +36 -0
  199. package/resources/ecc/agents/planner.json +15 -0
  200. package/resources/ecc/agents/planner.md +212 -0
  201. package/resources/ecc/agents/python-reviewer.json +16 -0
  202. package/resources/ecc/agents/python-reviewer.md +99 -0
  203. package/resources/ecc/agents/refactor-cleaner.json +17 -0
  204. package/resources/ecc/agents/refactor-cleaner.md +87 -0
  205. package/resources/ecc/agents/security-reviewer.json +16 -0
  206. package/resources/ecc/agents/security-reviewer.md +109 -0
  207. package/resources/ecc/agents/tdd-guide.json +17 -0
  208. package/resources/ecc/agents/tdd-guide.md +93 -0
  209. package/resources/ecc/commands/add-language-rules.md +39 -0
  210. package/resources/ecc/commands/database-migration.md +36 -0
  211. package/resources/ecc/commands/feature-development.md +38 -0
  212. package/resources/ecc/prompts/build-fix.prompt.md +47 -0
  213. package/resources/ecc/prompts/code-review.prompt.md +56 -0
  214. package/resources/ecc/prompts/plan.prompt.md +52 -0
  215. package/resources/ecc/prompts/refactor.prompt.md +50 -0
  216. package/resources/ecc/prompts/security-review.prompt.md +70 -0
  217. package/resources/ecc/prompts/tdd.prompt.md +47 -0
  218. package/resources/ecc/rules/common-agents.md +53 -0
  219. package/resources/ecc/rules/common-coding-style.md +52 -0
  220. package/resources/ecc/rules/common-development-workflow.md +33 -0
  221. package/resources/ecc/rules/common-git-workflow.md +28 -0
  222. package/resources/ecc/rules/common-hooks.md +34 -0
  223. package/resources/ecc/rules/common-patterns.md +35 -0
  224. package/resources/ecc/rules/common-performance.md +59 -0
  225. package/resources/ecc/rules/common-security.md +33 -0
  226. package/resources/ecc/rules/common-testing.md +33 -0
  227. package/resources/ecc/rules/golang-coding-style.md +31 -0
  228. package/resources/ecc/rules/golang-hooks.md +16 -0
  229. package/resources/ecc/rules/golang-patterns.md +44 -0
  230. package/resources/ecc/rules/golang-security.md +33 -0
  231. package/resources/ecc/rules/golang-testing.md +30 -0
  232. package/resources/ecc/rules/kotlin-coding-style.md +39 -0
  233. package/resources/ecc/rules/kotlin-hooks.md +16 -0
  234. package/resources/ecc/rules/kotlin-patterns.md +50 -0
  235. package/resources/ecc/rules/kotlin-security.md +58 -0
  236. package/resources/ecc/rules/kotlin-testing.md +38 -0
  237. package/resources/ecc/rules/php-coding-style.md +25 -0
  238. package/resources/ecc/rules/php-hooks.md +21 -0
  239. package/resources/ecc/rules/php-patterns.md +23 -0
  240. package/resources/ecc/rules/php-security.md +24 -0
  241. package/resources/ecc/rules/php-testing.md +26 -0
  242. package/resources/ecc/rules/python-coding-style.md +42 -0
  243. package/resources/ecc/rules/python-hooks.md +19 -0
  244. package/resources/ecc/rules/python-patterns.md +39 -0
  245. package/resources/ecc/rules/python-security.md +30 -0
  246. package/resources/ecc/rules/python-testing.md +38 -0
  247. package/resources/ecc/rules/swift-coding-style.md +47 -0
  248. package/resources/ecc/rules/swift-hooks.md +20 -0
  249. package/resources/ecc/rules/swift-patterns.md +66 -0
  250. package/resources/ecc/rules/swift-security.md +33 -0
  251. package/resources/ecc/rules/swift-testing.md +45 -0
  252. package/resources/ecc/rules/typescript-coding-style.md +63 -0
  253. package/resources/ecc/rules/typescript-hooks.md +20 -0
  254. package/resources/ecc/rules/typescript-patterns.md +50 -0
  255. package/resources/ecc/rules/typescript-security.md +26 -0
  256. package/resources/ecc/rules/typescript-testing.md +16 -0
  257. package/resources/ecc/skills/agent-introspection-debugging/SKILL.md +152 -0
  258. package/resources/ecc/skills/agent-introspection-debugging/agents/openai.yaml +7 -0
  259. package/resources/ecc/skills/agent-sort/SKILL.md +214 -0
  260. package/resources/ecc/skills/agent-sort/agents/openai.yaml +7 -0
  261. package/resources/ecc/skills/api-design/SKILL.md +522 -0
  262. package/resources/ecc/skills/api-design/agents/openai.yaml +7 -0
  263. package/resources/ecc/skills/article-writing/SKILL.md +78 -0
  264. package/resources/ecc/skills/article-writing/agents/openai.yaml +7 -0
  265. package/resources/ecc/skills/backend-patterns/SKILL.md +597 -0
  266. package/resources/ecc/skills/backend-patterns/agents/openai.yaml +7 -0
  267. package/resources/ecc/skills/brand-voice/SKILL.md +96 -0
  268. package/resources/ecc/skills/brand-voice/agents/openai.yaml +7 -0
  269. package/resources/ecc/skills/brand-voice/references/voice-profile-schema.md +55 -0
  270. package/resources/ecc/skills/bun-runtime/SKILL.md +83 -0
  271. package/resources/ecc/skills/bun-runtime/agents/openai.yaml +7 -0
  272. package/resources/ecc/skills/coding-standards/SKILL.md +548 -0
  273. package/resources/ecc/skills/coding-standards/agents/openai.yaml +7 -0
  274. package/resources/ecc/skills/content-engine/SKILL.md +130 -0
  275. package/resources/ecc/skills/content-engine/agents/openai.yaml +7 -0
  276. package/resources/ecc/skills/crosspost/SKILL.md +110 -0
  277. package/resources/ecc/skills/crosspost/agents/openai.yaml +7 -0
  278. package/resources/ecc/skills/deep-research/SKILL.md +154 -0
  279. package/resources/ecc/skills/deep-research/agents/openai.yaml +7 -0
  280. package/resources/ecc/skills/dmux-workflows/SKILL.md +143 -0
  281. package/resources/ecc/skills/dmux-workflows/agents/openai.yaml +7 -0
  282. package/resources/ecc/skills/documentation-lookup/SKILL.md +89 -0
  283. package/resources/ecc/skills/documentation-lookup/agents/openai.yaml +7 -0
  284. package/resources/ecc/skills/e2e-testing/SKILL.md +325 -0
  285. package/resources/ecc/skills/e2e-testing/agents/openai.yaml +7 -0
  286. package/resources/ecc/skills/eval-harness/SKILL.md +235 -0
  287. package/resources/ecc/skills/eval-harness/agents/openai.yaml +7 -0
  288. package/resources/ecc/skills/everything-claude-code/SKILL.md +442 -0
  289. package/resources/ecc/skills/everything-claude-code/agents/openai.yaml +7 -0
  290. package/resources/ecc/skills/exa-search/SKILL.md +169 -0
  291. package/resources/ecc/skills/exa-search/agents/openai.yaml +7 -0
  292. package/resources/ecc/skills/fal-ai-media/SKILL.md +276 -0
  293. package/resources/ecc/skills/fal-ai-media/agents/openai.yaml +7 -0
  294. package/resources/ecc/skills/frontend-patterns/SKILL.md +647 -0
  295. package/resources/ecc/skills/frontend-patterns/agents/openai.yaml +7 -0
  296. package/resources/ecc/skills/frontend-slides/SKILL.md +183 -0
  297. package/resources/ecc/skills/frontend-slides/STYLE_PRESETS.md +330 -0
  298. package/resources/ecc/skills/frontend-slides/agents/openai.yaml +7 -0
  299. package/resources/ecc/skills/investor-materials/SKILL.md +95 -0
  300. package/resources/ecc/skills/investor-materials/agents/openai.yaml +7 -0
  301. package/resources/ecc/skills/investor-outreach/SKILL.md +90 -0
  302. package/resources/ecc/skills/investor-outreach/agents/openai.yaml +7 -0
  303. package/resources/ecc/skills/market-research/SKILL.md +74 -0
  304. package/resources/ecc/skills/market-research/agents/openai.yaml +7 -0
  305. package/resources/ecc/skills/mcp-server-patterns/SKILL.md +66 -0
  306. package/resources/ecc/skills/mcp-server-patterns/agents/openai.yaml +7 -0
  307. package/resources/ecc/skills/mle-workflow/SKILL.md +346 -0
  308. package/resources/ecc/skills/mle-workflow/agents/openai.yaml +7 -0
  309. package/resources/ecc/skills/nextjs-turbopack/SKILL.md +43 -0
  310. package/resources/ecc/skills/nextjs-turbopack/agents/openai.yaml +7 -0
  311. package/resources/ecc/skills/product-capability/SKILL.md +140 -0
  312. package/resources/ecc/skills/product-capability/agents/openai.yaml +7 -0
  313. package/resources/ecc/skills/security-review/SKILL.md +494 -0
  314. package/resources/ecc/skills/security-review/agents/openai.yaml +7 -0
  315. package/resources/ecc/skills/strategic-compact/SKILL.md +102 -0
  316. package/resources/ecc/skills/strategic-compact/agents/openai.yaml +7 -0
  317. package/resources/ecc/skills/tdd-workflow/SKILL.md +409 -0
  318. package/resources/ecc/skills/tdd-workflow/agents/openai.yaml +7 -0
  319. package/resources/ecc/skills/verification-loop/SKILL.md +125 -0
  320. package/resources/ecc/skills/verification-loop/agents/openai.yaml +7 -0
  321. package/resources/ecc/skills/video-editing/SKILL.md +307 -0
  322. package/resources/ecc/skills/video-editing/agents/openai.yaml +7 -0
  323. package/resources/ecc/skills/x-api/SKILL.md +229 -0
  324. package/resources/ecc/skills/x-api/agents/openai.yaml +7 -0
@@ -0,0 +1,266 @@
1
+ /**
2
+ * Documentation Synchronization — find stale docs, missing JSDoc, and sync with code.
3
+ * Keeps documentation in sync with actual code.
4
+ */
5
+ import chalk from 'chalk';
6
+ import { existsSync, readdirSync } from 'node:fs';
7
+ import { join } from 'node:path';
8
+ // ── Helper: Detect Language ──────────────────────────────────────
9
+ function detectProjectLanguage(cwd) {
10
+ const pkgPath = join(cwd, 'package.json');
11
+ const cargoPath = join(cwd, 'Cargo.toml');
12
+ const pyPath = join(cwd, 'pyproject.toml');
13
+ if (existsSync(pkgPath)) {
14
+ const srcDir = join(cwd, 'src');
15
+ if (existsSync(srcDir)) {
16
+ const files = readdirSync(srcDir, { recursive: true });
17
+ if (files.some((f) => f.toString().endsWith('.ts'))) {
18
+ return 'typescript';
19
+ }
20
+ }
21
+ return 'javascript';
22
+ }
23
+ if (existsSync(cargoPath))
24
+ return 'rust';
25
+ if (existsSync(pyPath))
26
+ return 'python';
27
+ return 'unknown';
28
+ }
29
+ // ── Main Functions ──────────────────────────────────────────────
30
+ /**
31
+ * Detect all documentation files in the project.
32
+ * Returns: README.md, CHANGELOG.md, docs/, JSDoc comments, docstrings, API docs
33
+ */
34
+ export function detectDocFiles(cwd) {
35
+ const docs = [];
36
+ // Check for root-level markdown files
37
+ const rootFiles = ['README.md', 'CHANGELOG.md', 'CONTRIBUTING.md', 'API.md', 'ARCHITECTURE.md'];
38
+ for (const file of rootFiles) {
39
+ const path = join(cwd, file);
40
+ if (existsSync(path)) {
41
+ docs.push({
42
+ path,
43
+ type: file === 'README.md' ? 'readme' : file === 'CHANGELOG.md' ? 'changelog' : 'markdown',
44
+ });
45
+ }
46
+ }
47
+ // Check for docs directory
48
+ const docsDir = join(cwd, 'docs');
49
+ if (existsSync(docsDir)) {
50
+ const recurse = (dir) => {
51
+ try {
52
+ const entries = readdirSync(dir, { withFileTypes: true });
53
+ for (const entry of entries) {
54
+ if (entry.isDirectory() && !entry.name.startsWith('.')) {
55
+ recurse(join(dir, entry.name));
56
+ }
57
+ else if (entry.isFile() && entry.name.endsWith('.md')) {
58
+ docs.push({
59
+ path: join(dir, entry.name),
60
+ type: 'guide',
61
+ });
62
+ }
63
+ }
64
+ }
65
+ catch {
66
+ // Ignore read errors
67
+ }
68
+ };
69
+ recurse(docsDir);
70
+ }
71
+ // Check for source files with JSDoc/docstrings
72
+ const srcDir = join(cwd, 'src');
73
+ if (existsSync(srcDir)) {
74
+ const language = detectProjectLanguage(cwd);
75
+ const extensions = {
76
+ typescript: ['.ts', '.tsx'],
77
+ javascript: ['.js', '.jsx'],
78
+ python: ['.py'],
79
+ rust: ['.rs'],
80
+ };
81
+ const exts = extensions[language] || [];
82
+ const recurse = (dir) => {
83
+ try {
84
+ const entries = readdirSync(dir, { withFileTypes: true });
85
+ for (const entry of entries) {
86
+ if (entry.isDirectory() && !entry.name.startsWith('.')) {
87
+ recurse(join(dir, entry.name));
88
+ }
89
+ else if (entry.isFile() && exts.some((ext) => entry.name.endsWith(ext))) {
90
+ docs.push({
91
+ path: join(dir, entry.name),
92
+ type: 'jsdoc',
93
+ });
94
+ }
95
+ }
96
+ }
97
+ catch {
98
+ // Ignore read errors
99
+ }
100
+ };
101
+ recurse(srcDir);
102
+ }
103
+ return docs;
104
+ }
105
+ /**
106
+ * Build a prompt that tells the AI to sync documentation with code.
107
+ */
108
+ export function buildDocsUpdatePrompt(cwd) {
109
+ const language = detectProjectLanguage(cwd);
110
+ const docFiles = detectDocFiles(cwd);
111
+ const docSummary = docFiles
112
+ .map((d) => ` - ${d.type.toUpperCase()}: ${d.path}`)
113
+ .join('\n');
114
+ return `Update and synchronize all documentation to match the current code.
115
+
116
+ ## Current Working Directory
117
+ \`\`\`
118
+ ${cwd}
119
+ \`\`\`
120
+
121
+ ## Detected Language
122
+ ${language}
123
+
124
+ ## Found Documentation Files
125
+ \`\`\`
126
+ ${docSummary}
127
+ \`\`\`
128
+
129
+ ## Instructions
130
+ 1. **Review all documentation files**:
131
+ - README.md: Check installation, usage, API overview
132
+ - CHANGELOG.md: Verify recent entries match recent code changes
133
+ - docs/*.md: Check all guides for outdated examples
134
+ - Source files: Check for missing or stale JSDoc/docstrings
135
+
136
+ 2. **Compare with actual code**:
137
+ - List all exported functions, classes, and types
138
+ - Check if they appear in documentation
139
+ - Verify function signatures match docs
140
+ - Check if CLI flags, config options are documented
141
+ - Look for examples that might be outdated
142
+
143
+ 3. **Identify gaps**:
144
+ - Missing JSDoc comments on public APIs
145
+ - Undocumented exports
146
+ - Examples that don't run
147
+ - Missing error documentation
148
+ - Deprecated features still documented
149
+ - New features not documented
150
+
151
+ 4. **Update stale documentation**:
152
+ - Fix outdated examples with current syntax
153
+ - Update API signatures if code changed
154
+ - Correct parameter names and types
155
+ - Update version numbers in examples
156
+ - Fix broken internal links
157
+
158
+ 5. **Add missing documentation**:
159
+ - Add JSDoc to all public functions and classes
160
+ - Document all public exports in README or API.md
161
+ - Add examples for common use cases
162
+ - Document error cases and exceptions
163
+ - Add CLI usage if applicable
164
+
165
+ ## Documentation Standards
166
+ For JSDoc/Docstrings:
167
+ \`\`\`typescript
168
+ /**
169
+ * Brief description of what this does.
170
+ *
171
+ * More detailed explanation if needed.
172
+ *
173
+ * @param paramName - Description of parameter
174
+ * @returns Description of return value
175
+ * @throws ErrorType If this condition occurs
176
+ * @example
177
+ * const result = myFunction('input');
178
+ */
179
+ function exampleFunction(paramName: string): string {
180
+ // ...
181
+ }
182
+ \`\`\`
183
+
184
+ For README:
185
+ - Brief project description
186
+ - Installation instructions
187
+ - Quick start example
188
+ - Link to full API documentation
189
+ - Contributing guidelines
190
+ - License
191
+
192
+ ## Expected Output Format
193
+ 1. **Summary**:
194
+ - Total documentation files found
195
+ - Number of public exports
196
+ - Coverage % (documented vs total)
197
+
198
+ 2. **For each documentation file**:
199
+ - **File**: Path
200
+ - **Status**: (up-to-date / needs update / incomplete)
201
+ - **Issues Found**: Specific problems
202
+ - **Changes Made**: What was updated
203
+
204
+ 3. **For JSDoc/Docstrings**:
205
+ - **Functions without docs**: List
206
+ - **Outdated docs**: List with fixes
207
+ - **Missing examples**: Which functions need them
208
+
209
+ 4. **Overall Documentation Health**:
210
+ - Completeness score (0-100%)
211
+ - Key gaps remaining
212
+ - Recommended priorities for next steps`;
213
+ }
214
+ /**
215
+ * Print documentation status summary.
216
+ */
217
+ export function printDocsSyncStatus(docFiles, coveredExports, totalExports) {
218
+ console.log(chalk.cyan('\n Documentation Status:'));
219
+ console.log(` ${chalk.dim(`Total doc files: ${docFiles.length}`)}`);
220
+ // Group by type
221
+ const byType = {};
222
+ for (const doc of docFiles) {
223
+ byType[doc.type] = (byType[doc.type] || 0) + 1;
224
+ }
225
+ for (const [type, count] of Object.entries(byType)) {
226
+ console.log(chalk.dim(` ${type}: ${count}`));
227
+ }
228
+ // Coverage
229
+ if (coveredExports !== undefined && totalExports !== undefined) {
230
+ const percentage = totalExports > 0 ? (coveredExports / totalExports) * 100 : 0;
231
+ const color = percentage >= 80 ? chalk.green : percentage >= 60 ? chalk.yellow : chalk.red;
232
+ console.log(chalk.cyan('\n API Documentation Coverage:'));
233
+ console.log(` ${color(` ${percentage.toFixed(1)}%`)} (${coveredExports} / ${totalExports} exports)`);
234
+ }
235
+ // Recommendations
236
+ const hasReadme = docFiles.some((d) => d.type === 'readme');
237
+ const hasChangelog = docFiles.some((d) => d.type === 'changelog');
238
+ const hasGuides = docFiles.some((d) => d.type === 'guide');
239
+ if (!hasReadme) {
240
+ console.log(chalk.yellow('\n ⚠ Missing README.md'));
241
+ }
242
+ if (!hasChangelog) {
243
+ console.log(chalk.yellow(' ⚠ Missing CHANGELOG.md'));
244
+ }
245
+ if (!hasGuides && docFiles.length > 0) {
246
+ console.log(chalk.yellow(' ⚠ No guides in docs/ directory'));
247
+ }
248
+ console.log();
249
+ }
250
+ // ── Exports ──────────────────────────────────────────────
251
+ export function getProjectLanguage(cwd) {
252
+ return detectProjectLanguage(cwd);
253
+ }
254
+ export function getDocumentationFiles(cwd) {
255
+ return detectDocFiles(cwd);
256
+ }
257
+ export function hasReadme(cwd) {
258
+ return existsSync(join(cwd, 'README.md'));
259
+ }
260
+ export function hasChangelog(cwd) {
261
+ return existsSync(join(cwd, 'CHANGELOG.md'));
262
+ }
263
+ export function hasDocsDirectory(cwd) {
264
+ return existsSync(join(cwd, 'docs'));
265
+ }
266
+ //# sourceMappingURL=docs-sync.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"docs-sync.js","sourceRoot":"","sources":["../src/docs-sync.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,UAAU,EAAgB,WAAW,EAAE,MAAM,SAAS,CAAC;AAChE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AASjC,oEAAoE;AACpE,SAAS,qBAAqB,CAAC,GAAW;IACxC,MAAM,OAAO,GAAG,IAAI,CAAC,GAAG,EAAE,cAAc,CAAC,CAAC;IAC1C,MAAM,SAAS,GAAG,IAAI,CAAC,GAAG,EAAE,YAAY,CAAC,CAAC;IAC1C,MAAM,MAAM,GAAG,IAAI,CAAC,GAAG,EAAE,gBAAgB,CAAC,CAAC;IAE3C,IAAI,UAAU,CAAC,OAAO,CAAC,EAAE,CAAC;QACxB,MAAM,MAAM,GAAG,IAAI,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;QAChC,IAAI,UAAU,CAAC,MAAM,CAAC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4DAA4D;AAC5D,MAAM,UAAU,kBAAkB,CAAC,GAAW;IAC5C,OAAO,qBAAqB,CAAC,GAAG,CAAC,CAAC;AACpC,CAAC;AAED,MAAM,UAAU,qBAAqB,CAAC,GAAW;IAC/C,OAAO,cAAc,CAAC,GAAG,CAAC,CAAC;AAC7B,CAAC;AAED,MAAM,UAAU,SAAS,CAAC,GAAW;IACnC,OAAO,UAAU,CAAC,IAAI,CAAC,GAAG,EAAE,WAAW,CAAC,CAAC,CAAC;AAC5C,CAAC;AAED,MAAM,UAAU,YAAY,CAAC,GAAW;IACtC,OAAO,UAAU,CAAC,IAAI,CAAC,GAAG,EAAE,cAAc,CAAC,CAAC,CAAC;AAC/C,CAAC;AAED,MAAM,UAAU,gBAAgB,CAAC,GAAW;IAC1C,OAAO,UAAU,CAAC,IAAI,CAAC,GAAG,EAAE,MAAM,CAAC,CAAC,CAAC;AACvC,CAAC"}
package/dist/ecc.d.ts ADDED
@@ -0,0 +1,41 @@
1
+ import { type Skill } from './skills.js';
2
+ export interface EccState {
3
+ installedAt: string;
4
+ version: string;
5
+ counts: {
6
+ skills: number;
7
+ agents: number;
8
+ commands: number;
9
+ rules: number;
10
+ prompts: number;
11
+ };
12
+ }
13
+ export declare function loadEccState(): EccState | null;
14
+ export declare function eccResourcesAvailable(): boolean;
15
+ export interface ImportReport {
16
+ skills: number;
17
+ agents: number;
18
+ commands: number;
19
+ rules: number;
20
+ prompts: number;
21
+ errors: string[];
22
+ }
23
+ export declare function listEccCommands(): string[];
24
+ /**
25
+ * Resolve a `/ecc-<name>` command to its prompt body. Frontmatter is stripped;
26
+ * if `allowed_tools` is set, it's preserved as a note at the top.
27
+ */
28
+ export declare function getEccCommandPrompt(name: string): string | null;
29
+ export declare function installEcc(opts?: {
30
+ verbose?: boolean;
31
+ }): ImportReport;
32
+ export declare function printEccStatus(): void;
33
+ export declare function printEccSkills(): void;
34
+ export declare function printEccAgents(): void;
35
+ export declare function printEccCommandList(): void;
36
+ /**
37
+ * Match the user's free-form text against ECC skill triggers and return the
38
+ * top-matching skill prompt body, or null if nothing fires. Used to auto-inject
39
+ * skill content into the system prompt — bumps relevance for that turn.
40
+ */
41
+ export declare function findEccSkillForQuery(query: string): Skill | null;