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,307 @@
1
+ ---
2
+ name: video-editing
3
+ description: AI-assisted video editing workflows for cutting, structuring, and augmenting real footage. Covers the full pipeline from raw capture through FFmpeg, Remotion, ElevenLabs, fal.ai, and final polish in Descript or CapCut. Use when the user wants to edit video, cut footage, create vlogs, or build video content.
4
+ ---
5
+
6
+ # Video Editing
7
+
8
+ AI-assisted editing for real footage. Not generation from prompts. Editing existing video fast.
9
+
10
+ ## When to Activate
11
+
12
+ - User wants to edit, cut, or structure video footage
13
+ - Turning long recordings into short-form content
14
+ - Building vlogs, tutorials, or demo videos from raw capture
15
+ - Adding overlays, subtitles, music, or voiceover to existing video
16
+ - Reframing video for different platforms (YouTube, TikTok, Instagram)
17
+ - User says "edit video", "cut this footage", "make a vlog", or "video workflow"
18
+
19
+ ## Core Thesis
20
+
21
+ AI video editing is useful when you stop asking it to create the whole video and start using it to compress, structure, and augment real footage. The value is not generation. The value is compression.
22
+
23
+ ## The Pipeline
24
+
25
+ ```
26
+ Screen Studio / raw footage
27
+ → Claude / Codex
28
+ → FFmpeg
29
+ → Remotion
30
+ → ElevenLabs / fal.ai
31
+ → Descript or CapCut
32
+ ```
33
+
34
+ Each layer has a specific job. Do not skip layers. Do not try to make one tool do everything.
35
+
36
+ ## Layer 1: Capture (Screen Studio / Raw Footage)
37
+
38
+ Collect the source material:
39
+ - **Screen Studio**: polished screen recordings for app demos, coding sessions, browser workflows
40
+ - **Raw camera footage**: vlog footage, interviews, event recordings
41
+ - **Desktop capture via VideoDB**: session recording with real-time context (see `videodb` skill)
42
+
43
+ Output: raw files ready for organization.
44
+
45
+ ## Layer 2: Organization (Claude / Codex)
46
+
47
+ Use Claude Code or Codex to:
48
+ - **Transcribe and label**: generate transcript, identify topics and themes
49
+ - **Plan structure**: decide what stays, what gets cut, what order works
50
+ - **Identify dead sections**: find pauses, tangents, repeated takes
51
+ - **Generate edit decision list**: timestamps for cuts, segments to keep
52
+ - **Scaffold FFmpeg and Remotion code**: generate the commands and compositions
53
+
54
+ ```
55
+ Example prompt:
56
+ "Here's the transcript of a 4-hour recording. Identify the 8 strongest segments
57
+ for a 24-minute vlog. Give me FFmpeg cut commands for each segment."
58
+ ```
59
+
60
+ This layer is about structure, not final creative taste.
61
+
62
+ ## Layer 3: Deterministic Cuts (FFmpeg)
63
+
64
+ FFmpeg handles the boring but critical work: splitting, trimming, concatenating, and preprocessing.
65
+
66
+ ### Extract segment by timestamp
67
+
68
+ ```bash
69
+ ffmpeg -i raw.mp4 -ss 00:12:30 -to 00:15:45 -c copy segment_01.mp4
70
+ ```
71
+
72
+ ### Batch cut from edit decision list
73
+
74
+ ```bash
75
+ #!/bin/bash
76
+ # cuts.txt: start,end,label
77
+ while IFS=, read -r start end label; do
78
+ ffmpeg -i raw.mp4 -ss "$start" -to "$end" -c copy "segments/${label}.mp4"
79
+ done < cuts.txt
80
+ ```
81
+
82
+ ### Concatenate segments
83
+
84
+ ```bash
85
+ # Create file list
86
+ for f in segments/*.mp4; do echo "file '$f'"; done > concat.txt
87
+ ffmpeg -f concat -safe 0 -i concat.txt -c copy assembled.mp4
88
+ ```
89
+
90
+ ### Create proxy for faster editing
91
+
92
+ ```bash
93
+ ffmpeg -i raw.mp4 -vf "scale=960:-2" -c:v libx264 -preset ultrafast -crf 28 proxy.mp4
94
+ ```
95
+
96
+ ### Extract audio for transcription
97
+
98
+ ```bash
99
+ ffmpeg -i raw.mp4 -vn -acodec pcm_s16le -ar 16000 audio.wav
100
+ ```
101
+
102
+ ### Normalize audio levels
103
+
104
+ ```bash
105
+ ffmpeg -i segment.mp4 -af loudnorm=I=-16:TP=-1.5:LRA=11 -c:v copy normalized.mp4
106
+ ```
107
+
108
+ ## Layer 4: Programmable Composition (Remotion)
109
+
110
+ Remotion turns editing problems into composable code. Use it for things that traditional editors make painful:
111
+
112
+ ### When to use Remotion
113
+
114
+ - Overlays: text, images, branding, lower thirds
115
+ - Data visualizations: charts, stats, animated numbers
116
+ - Motion graphics: transitions, explainer animations
117
+ - Composable scenes: reusable templates across videos
118
+ - Product demos: annotated screenshots, UI highlights
119
+
120
+ ### Basic Remotion composition
121
+
122
+ ```tsx
123
+ import { AbsoluteFill, Sequence, Video, useCurrentFrame } from "remotion";
124
+
125
+ export const VlogComposition: React.FC = () => {
126
+ const frame = useCurrentFrame();
127
+
128
+ return (
129
+ <AbsoluteFill>
130
+ {/* Main footage */}
131
+ <Sequence from={0} durationInFrames={300}>
132
+ <Video src="/segments/intro.mp4" />
133
+ </Sequence>
134
+
135
+ {/* Title overlay */}
136
+ <Sequence from={30} durationInFrames={90}>
137
+ <AbsoluteFill style={{
138
+ justifyContent: "center",
139
+ alignItems: "center",
140
+ }}>
141
+ <h1 style={{
142
+ fontSize: 72,
143
+ color: "white",
144
+ textShadow: "2px 2px 8px rgba(0,0,0,0.8)",
145
+ }}>
146
+ The AI Editing Stack
147
+ </h1>
148
+ </AbsoluteFill>
149
+ </Sequence>
150
+
151
+ {/* Next segment */}
152
+ <Sequence from={300} durationInFrames={450}>
153
+ <Video src="/segments/demo.mp4" />
154
+ </Sequence>
155
+ </AbsoluteFill>
156
+ );
157
+ };
158
+ ```
159
+
160
+ ### Render output
161
+
162
+ ```bash
163
+ npx remotion render src/index.ts VlogComposition output.mp4
164
+ ```
165
+
166
+ See the [Remotion docs](https://www.remotion.dev/docs) for detailed patterns and API reference.
167
+
168
+ ## Layer 5: Generated Assets (ElevenLabs / fal.ai)
169
+
170
+ Generate only what you need. Do not generate the whole video.
171
+
172
+ ### Voiceover with ElevenLabs
173
+
174
+ ```python
175
+ import os
176
+ import requests
177
+
178
+ resp = requests.post(
179
+ f"https://api.elevenlabs.io/v1/text-to-speech/{voice_id}",
180
+ headers={
181
+ "xi-api-key": os.environ["ELEVENLABS_API_KEY"],
182
+ "Content-Type": "application/json"
183
+ },
184
+ json={
185
+ "text": "Your narration text here",
186
+ "model_id": "eleven_turbo_v2_5",
187
+ "voice_settings": {"stability": 0.5, "similarity_boost": 0.75}
188
+ }
189
+ )
190
+ with open("voiceover.mp3", "wb") as f:
191
+ f.write(resp.content)
192
+ ```
193
+
194
+ ### Music and SFX with fal.ai
195
+
196
+ Use the `fal-ai-media` skill for:
197
+ - Background music generation
198
+ - Sound effects (ThinkSound model for video-to-audio)
199
+ - Transition sounds
200
+
201
+ ### Generated visuals with fal.ai
202
+
203
+ Use for insert shots, thumbnails, or b-roll that doesn't exist:
204
+ ```
205
+ generate(model_name: "fal-ai/nano-banana-pro", input: {
206
+ "prompt": "professional thumbnail for tech vlog, dark background, code on screen",
207
+ "image_size": "landscape_16_9"
208
+ })
209
+ ```
210
+
211
+ ### VideoDB generative audio
212
+
213
+ If VideoDB is configured:
214
+ ```python
215
+ voiceover = coll.generate_voice(text="Narration here", voice="alloy")
216
+ music = coll.generate_music(prompt="lo-fi background for coding vlog", duration=120)
217
+ sfx = coll.generate_sound_effect(prompt="subtle whoosh transition")
218
+ ```
219
+
220
+ ## Layer 6: Final Polish (Descript / CapCut)
221
+
222
+ The last layer is human. Use a traditional editor for:
223
+ - **Pacing**: adjust cuts that feel too fast or slow
224
+ - **Captions**: auto-generated, then manually cleaned
225
+ - **Color grading**: basic correction and mood
226
+ - **Final audio mix**: balance voice, music, and SFX levels
227
+ - **Export**: platform-specific formats and quality settings
228
+
229
+ This is where taste lives. AI clears the repetitive work. You make the final calls.
230
+
231
+ ## Social Media Reframing
232
+
233
+ Different platforms need different aspect ratios:
234
+
235
+ | Platform | Aspect Ratio | Resolution |
236
+ |----------|-------------|------------|
237
+ | YouTube | 16:9 | 1920x1080 |
238
+ | TikTok / Reels | 9:16 | 1080x1920 |
239
+ | Instagram Feed | 1:1 | 1080x1080 |
240
+ | X / Twitter | 16:9 or 1:1 | 1280x720 or 720x720 |
241
+
242
+ ### Reframe with FFmpeg
243
+
244
+ ```bash
245
+ # 16:9 to 9:16 (center crop)
246
+ ffmpeg -i input.mp4 -vf "crop=ih*9/16:ih,scale=1080:1920" vertical.mp4
247
+
248
+ # 16:9 to 1:1 (center crop)
249
+ ffmpeg -i input.mp4 -vf "crop=ih:ih,scale=1080:1080" square.mp4
250
+ ```
251
+
252
+ ### Reframe with VideoDB
253
+
254
+ ```python
255
+ # Smart reframe (AI-guided subject tracking)
256
+ reframed = video.reframe(start=0, end=60, target="vertical", mode=ReframeMode.smart)
257
+ ```
258
+
259
+ ## Scene Detection and Auto-Cut
260
+
261
+ ### FFmpeg scene detection
262
+
263
+ ```bash
264
+ # Detect scene changes (threshold 0.3 = moderate sensitivity)
265
+ ffmpeg -i input.mp4 -vf "select='gt(scene,0.3)',showinfo" -vsync vfr -f null - 2>&1 | grep showinfo
266
+ ```
267
+
268
+ ### Silence detection for auto-cut
269
+
270
+ ```bash
271
+ # Find silent segments (useful for cutting dead air)
272
+ ffmpeg -i input.mp4 -af silencedetect=noise=-30dB:d=2 -f null - 2>&1 | grep silence
273
+ ```
274
+
275
+ ### Highlight extraction
276
+
277
+ Use Claude to analyze transcript + scene timestamps:
278
+ ```
279
+ "Given this transcript with timestamps and these scene change points,
280
+ identify the 5 most engaging 30-second clips for social media."
281
+ ```
282
+
283
+ ## What Each Tool Does Best
284
+
285
+ | Tool | Strength | Weakness |
286
+ |------|----------|----------|
287
+ | Claude / Codex | Organization, planning, code generation | Not the creative taste layer |
288
+ | FFmpeg | Deterministic cuts, batch processing, format conversion | No visual editing UI |
289
+ | Remotion | Programmable overlays, composable scenes, reusable templates | Learning curve for non-devs |
290
+ | Screen Studio | Polished screen recordings immediately | Only screen capture |
291
+ | ElevenLabs | Voice, narration, music, SFX | Not the center of the workflow |
292
+ | Descript / CapCut | Final pacing, captions, polish | Manual, not automatable |
293
+
294
+ ## Key Principles
295
+
296
+ 1. **Edit, don't generate.** This workflow is for cutting real footage, not creating from prompts.
297
+ 2. **Structure before style.** Get the story right in Layer 2 before touching anything visual.
298
+ 3. **FFmpeg is the backbone.** Boring but critical. Where long footage becomes manageable.
299
+ 4. **Remotion for repeatability.** If you'll do it more than once, make it a Remotion component.
300
+ 5. **Generate selectively.** Only use AI generation for assets that don't exist, not for everything.
301
+ 6. **Taste is the last layer.** AI clears repetitive work. You make the final creative calls.
302
+
303
+ ## Related Skills
304
+
305
+ - `fal-ai-media` — AI image, video, and audio generation
306
+ - `videodb` — Server-side video processing, indexing, and streaming
307
+ - `content-engine` — Platform-native content distribution
@@ -0,0 +1,7 @@
1
+ interface:
2
+ display_name: "Video Editing"
3
+ short_description: "AI-assisted editing for real footage"
4
+ brand_color: "#EF4444"
5
+ default_prompt: "Use $video-editing to plan an AI-assisted edit for real footage."
6
+ policy:
7
+ allow_implicit_invocation: true
@@ -0,0 +1,229 @@
1
+ ---
2
+ name: x-api
3
+ description: X/Twitter API integration for posting tweets, threads, reading timelines, search, and analytics. Covers OAuth auth patterns, rate limits, and platform-native content posting. Use when the user wants to interact with X programmatically.
4
+ ---
5
+
6
+ # X API
7
+
8
+ Programmatic interaction with X (Twitter) for posting, reading, searching, and analytics.
9
+
10
+ ## When to Activate
11
+
12
+ - User wants to post tweets or threads programmatically
13
+ - Reading timeline, mentions, or user data from X
14
+ - Searching X for content, trends, or conversations
15
+ - Building X integrations or bots
16
+ - Analytics and engagement tracking
17
+ - User says "post to X", "tweet", "X API", or "Twitter API"
18
+
19
+ ## Authentication
20
+
21
+ ### OAuth 2.0 Bearer Token (App-Only)
22
+
23
+ Best for: read-heavy operations, search, public data.
24
+
25
+ ```bash
26
+ # Environment setup
27
+ export X_BEARER_TOKEN="your-bearer-token"
28
+ ```
29
+
30
+ ```python
31
+ import os
32
+ import requests
33
+
34
+ bearer = os.environ["X_BEARER_TOKEN"]
35
+ headers = {"Authorization": f"Bearer {bearer}"}
36
+
37
+ # Search recent tweets
38
+ resp = requests.get(
39
+ "https://api.x.com/2/tweets/search/recent",
40
+ headers=headers,
41
+ params={"query": "claude code", "max_results": 10}
42
+ )
43
+ tweets = resp.json()
44
+ ```
45
+
46
+ ### OAuth 1.0a (User Context)
47
+
48
+ Required for: posting tweets, managing account, DMs, and any write flow.
49
+
50
+ ```bash
51
+ # Environment setup — source before use
52
+ export X_CONSUMER_KEY="your-consumer-key"
53
+ export X_CONSUMER_SECRET="your-consumer-secret"
54
+ export X_ACCESS_TOKEN="your-access-token"
55
+ export X_ACCESS_TOKEN_SECRET="your-access-token-secret"
56
+ ```
57
+
58
+ Legacy aliases such as `X_API_KEY`, `X_API_SECRET`, and `X_ACCESS_SECRET` may exist in older setups. Prefer the `X_CONSUMER_*` and `X_ACCESS_TOKEN_SECRET` names when documenting or wiring new flows.
59
+
60
+ ```python
61
+ import os
62
+ from requests_oauthlib import OAuth1Session
63
+
64
+ oauth = OAuth1Session(
65
+ os.environ["X_CONSUMER_KEY"],
66
+ client_secret=os.environ["X_CONSUMER_SECRET"],
67
+ resource_owner_key=os.environ["X_ACCESS_TOKEN"],
68
+ resource_owner_secret=os.environ["X_ACCESS_TOKEN_SECRET"],
69
+ )
70
+ ```
71
+
72
+ ## Core Operations
73
+
74
+ ### Post a Tweet
75
+
76
+ ```python
77
+ resp = oauth.post(
78
+ "https://api.x.com/2/tweets",
79
+ json={"text": "Hello from Claude Code"}
80
+ )
81
+ resp.raise_for_status()
82
+ tweet_id = resp.json()["data"]["id"]
83
+ ```
84
+
85
+ ### Post a Thread
86
+
87
+ ```python
88
+ def post_thread(oauth, tweets: list[str]) -> list[str]:
89
+ ids = []
90
+ reply_to = None
91
+ for text in tweets:
92
+ payload = {"text": text}
93
+ if reply_to:
94
+ payload["reply"] = {"in_reply_to_tweet_id": reply_to}
95
+ resp = oauth.post("https://api.x.com/2/tweets", json=payload)
96
+ tweet_id = resp.json()["data"]["id"]
97
+ ids.append(tweet_id)
98
+ reply_to = tweet_id
99
+ return ids
100
+ ```
101
+
102
+ ### Read User Timeline
103
+
104
+ ```python
105
+ resp = requests.get(
106
+ f"https://api.x.com/2/users/{user_id}/tweets",
107
+ headers=headers,
108
+ params={
109
+ "max_results": 10,
110
+ "tweet.fields": "created_at,public_metrics",
111
+ }
112
+ )
113
+ ```
114
+
115
+ ### Search Tweets
116
+
117
+ ```python
118
+ resp = requests.get(
119
+ "https://api.x.com/2/tweets/search/recent",
120
+ headers=headers,
121
+ params={
122
+ "query": "from:affaanmustafa -is:retweet",
123
+ "max_results": 10,
124
+ "tweet.fields": "public_metrics,created_at",
125
+ }
126
+ )
127
+ ```
128
+
129
+ ### Pull Recent Original Posts for Voice Modeling
130
+
131
+ ```python
132
+ resp = requests.get(
133
+ "https://api.x.com/2/tweets/search/recent",
134
+ headers=headers,
135
+ params={
136
+ "query": "from:affaanmustafa -is:retweet -is:reply",
137
+ "max_results": 25,
138
+ "tweet.fields": "created_at,public_metrics",
139
+ }
140
+ )
141
+ voice_samples = resp.json()
142
+ ```
143
+
144
+ ### Get User by Username
145
+
146
+ ```python
147
+ resp = requests.get(
148
+ "https://api.x.com/2/users/by/username/affaanmustafa",
149
+ headers=headers,
150
+ params={"user.fields": "public_metrics,description,created_at"}
151
+ )
152
+ ```
153
+
154
+ ### Upload Media and Post
155
+
156
+ ```python
157
+ # Media upload uses v1.1 endpoint
158
+
159
+ # Step 1: Upload media
160
+ media_resp = oauth.post(
161
+ "https://upload.twitter.com/1.1/media/upload.json",
162
+ files={"media": open("image.png", "rb")}
163
+ )
164
+ media_id = media_resp.json()["media_id_string"]
165
+
166
+ # Step 2: Post with media
167
+ resp = oauth.post(
168
+ "https://api.x.com/2/tweets",
169
+ json={"text": "Check this out", "media": {"media_ids": [media_id]}}
170
+ )
171
+ ```
172
+
173
+ ## Rate Limits
174
+
175
+ X API rate limits vary by endpoint, auth method, and account tier, and they change over time. Always:
176
+ - Check the current X developer docs before hardcoding assumptions
177
+ - Read `x-rate-limit-remaining` and `x-rate-limit-reset` headers at runtime
178
+ - Back off automatically instead of relying on static tables in code
179
+
180
+ ```python
181
+ import time
182
+
183
+ remaining = int(resp.headers.get("x-rate-limit-remaining", 0))
184
+ if remaining < 5:
185
+ reset = int(resp.headers.get("x-rate-limit-reset", 0))
186
+ wait = max(0, reset - int(time.time()))
187
+ print(f"Rate limit approaching. Resets in {wait}s")
188
+ ```
189
+
190
+ ## Error Handling
191
+
192
+ ```python
193
+ resp = oauth.post("https://api.x.com/2/tweets", json={"text": content})
194
+ if resp.status_code == 201:
195
+ return resp.json()["data"]["id"]
196
+ elif resp.status_code == 429:
197
+ reset = int(resp.headers["x-rate-limit-reset"])
198
+ raise Exception(f"Rate limited. Resets at {reset}")
199
+ elif resp.status_code == 403:
200
+ raise Exception(f"Forbidden: {resp.json().get('detail', 'check permissions')}")
201
+ else:
202
+ raise Exception(f"X API error {resp.status_code}: {resp.text}")
203
+ ```
204
+
205
+ ## Security
206
+
207
+ - **Never hardcode tokens.** Use environment variables or `.env` files.
208
+ - **Never commit `.env` files.** Add to `.gitignore`.
209
+ - **Rotate tokens** if exposed. Regenerate at developer.x.com.
210
+ - **Use read-only tokens** when write access is not needed.
211
+ - **Store OAuth secrets securely** — not in source code or logs.
212
+
213
+ ## Integration with Content Engine
214
+
215
+ Use `brand-voice` plus `content-engine` to generate platform-native content, then post via X API:
216
+ 1. Pull recent original posts when voice matching matters
217
+ 2. Build or reuse a `VOICE PROFILE`
218
+ 3. Generate content with `content-engine` in X-native format
219
+ 4. Validate length and thread structure
220
+ 5. Return the draft for approval unless the user explicitly asked to post now
221
+ 6. Post via X API only after approval
222
+ 7. Track engagement via public_metrics
223
+
224
+ ## Related Skills
225
+
226
+ - `brand-voice` — Build a reusable voice profile from real X and site/source material
227
+ - `content-engine` — Generate platform-native content for X
228
+ - `crosspost` — Distribute content across X, LinkedIn, and other platforms
229
+ - `connections-optimizer` — Reorganize the X graph before drafting network-driven outreach
@@ -0,0 +1,7 @@
1
+ interface:
2
+ display_name: "X API"
3
+ short_description: "X API posting, timelines, and analytics"
4
+ brand_color: "#000000"
5
+ default_prompt: "Use $x-api to build X API posting, timeline, or analytics workflows."
6
+ policy:
7
+ allow_implicit_invocation: true