opencode-skills-collection 3.1.14 → 3.1.16

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 (164) hide show
  1. package/bundled-skills/.antigravity-install-manifest.json +36 -1
  2. package/bundled-skills/007/scripts/full_audit.py +34 -22
  3. package/bundled-skills/007/scripts/quick_scan.py +24 -15
  4. package/bundled-skills/007/scripts/scanners/dependency_scanner.py +31 -19
  5. package/bundled-skills/007/scripts/scanners/injection_scanner.py +24 -14
  6. package/bundled-skills/007/scripts/scanners/secrets_scanner.py +24 -14
  7. package/bundled-skills/007/scripts/score_calculator.py +25 -13
  8. package/bundled-skills/2slides-ppt-generator/scripts/download_slides_pages_voices.py +15 -1
  9. package/bundled-skills/aegisops-ai/SKILL.md +1 -1
  10. package/bundled-skills/agent-self-scheduling/SKILL.md +88 -0
  11. package/bundled-skills/alpha-vantage/SKILL.md +3 -1
  12. package/bundled-skills/anti-sleep/SKILL.md +90 -0
  13. package/bundled-skills/api-security-best-practices/SKILL.md +1 -1
  14. package/bundled-skills/app-store-optimization/SKILL.md +7 -0
  15. package/bundled-skills/audio-transcriber/scripts/transcribe.py +17 -4
  16. package/bundled-skills/azure-mgmt-botservice-py/SKILL.md +2 -1
  17. package/bundled-skills/azure-resource-manager-mysql-dotnet/SKILL.md +2 -1
  18. package/bundled-skills/azure-resource-manager-postgresql-dotnet/SKILL.md +2 -1
  19. package/bundled-skills/azure-resource-manager-sql-dotnet/SKILL.md +2 -1
  20. package/bundled-skills/biopython/SKILL.md +2 -1
  21. package/bundled-skills/brain-to-docs/SKILL.md +54 -0
  22. package/bundled-skills/browser-harness/SKILL.md +220 -0
  23. package/bundled-skills/browser-harness/references/install.md +132 -0
  24. package/bundled-skills/bumblebee/scripts/render_report.py +16 -3
  25. package/bundled-skills/bun-development/SKILL.md +1 -1
  26. package/bundled-skills/cc-skill-security-review/SKILL.md +2 -2
  27. package/bundled-skills/claude-monitor/scripts/monitor.py +15 -2
  28. package/bundled-skills/cmux/SKILL.md +250 -0
  29. package/bundled-skills/code-polish/SKILL.md +192 -0
  30. package/bundled-skills/code-review-checklist/SKILL.md +1 -1
  31. package/bundled-skills/codex-subagent/SKILL.md +117 -0
  32. package/bundled-skills/competitor-analysis/scripts/capture_screenshots.mjs +24 -3
  33. package/bundled-skills/competitor-analysis/scripts/compile_report.mjs +13 -2
  34. package/bundled-skills/competitor-analysis/scripts/extract_vs_names.mjs +23 -2
  35. package/bundled-skills/competitor-analysis/scripts/gate_candidates.mjs +21 -0
  36. package/bundled-skills/competitor-analysis/scripts/list_urls.mjs +23 -2
  37. package/bundled-skills/competitor-analysis/scripts/merge_partials.mjs +24 -3
  38. package/bundled-skills/container-security-hardening/SKILL.md +1 -1
  39. package/bundled-skills/content-creator/scripts/brand_voice_analyzer.py +15 -1
  40. package/bundled-skills/content-creator/scripts/seo_optimizer.py +15 -1
  41. package/bundled-skills/context-kit/SKILL.md +135 -0
  42. package/bundled-skills/cyber-audit/SKILL.md +138 -0
  43. package/bundled-skills/deepapi/SKILL.md +649 -0
  44. package/bundled-skills/delegating-to-agents/SKILL.md +64 -0
  45. package/bundled-skills/developer-signup-flow/SKILL.md +1 -1
  46. package/bundled-skills/diary/scripts/fetch_diaries.py +14 -1
  47. package/bundled-skills/diary/scripts/prepare_context.py +15 -2
  48. package/bundled-skills/diary/scripts/sync_to_notion.py +14 -1
  49. package/bundled-skills/dispatch/SKILL.md +19 -7
  50. package/bundled-skills/distribute-skill-to-all-agents/SKILL.md +85 -0
  51. package/bundled-skills/docs/integrations/jetski-cortex.md +3 -3
  52. package/bundled-skills/docs/integrations/jetski-gemini-loader/README.md +1 -1
  53. package/bundled-skills/docs/maintainers/repo-growth-seo.md +3 -3
  54. package/bundled-skills/docs/maintainers/skills-update-guide.md +1 -1
  55. package/bundled-skills/docs/users/bundles.md +1 -1
  56. package/bundled-skills/docs/users/claude-code-skills.md +1 -1
  57. package/bundled-skills/docs/users/gemini-cli-skills.md +1 -1
  58. package/bundled-skills/docs/users/getting-started.md +1 -1
  59. package/bundled-skills/docs/users/kiro-integration.md +1 -1
  60. package/bundled-skills/docs/users/usage.md +4 -4
  61. package/bundled-skills/docs/users/visual-guide.md +4 -4
  62. package/bundled-skills/docx-official/ooxml/scripts/pack.py +30 -3
  63. package/bundled-skills/docx-official/ooxml/scripts/unpack.py +16 -3
  64. package/bundled-skills/drizzle-migration-conflict/scripts/check_drizzle_migrations.py +27 -17
  65. package/bundled-skills/ecl-harness-engineer/agents/creator-config.md +17 -3
  66. package/bundled-skills/ecl-harness-engineer/references/environment-detection-guide.md +9 -5
  67. package/bundled-skills/effective-agent-skills/SKILL.md +333 -0
  68. package/bundled-skills/electron-development/SKILL.md +6 -2
  69. package/bundled-skills/environment-setup-guide/SKILL.md +2 -5
  70. package/bundled-skills/expo-ui/scripts/list-components.js +5 -1
  71. package/bundled-skills/fable-safe-prompt/SKILL.md +79 -0
  72. package/bundled-skills/folder-specific-claude-and-agents-md/SKILL.md +96 -0
  73. package/bundled-skills/frontend-slides/scripts/extract-pptx.py +18 -4
  74. package/bundled-skills/gcp-cloud-run/SKILL.md +2 -1
  75. package/bundled-skills/gemini-api-integration/SKILL.md +3 -1
  76. package/bundled-skills/gemini-live-api-dev/SKILL.md +2 -1
  77. package/bundled-skills/gemini-omni-flash-api/scripts/video/generate_video.py +49 -14
  78. package/bundled-skills/goal-loop/SKILL.md +175 -0
  79. package/bundled-skills/hugging-face-evaluation/SKILL.md +1 -1
  80. package/bundled-skills/hugging-face-jobs/SKILL.md +1 -1
  81. package/bundled-skills/hugging-face-jobs/scripts/finepdfs-stats.py +14 -1
  82. package/bundled-skills/hugging-face-model-trainer/scripts/convert_to_gguf.py +10 -1
  83. package/bundled-skills/hugo-to-markdown/scripts/inventory_hugo_rules.py +14 -1
  84. package/bundled-skills/image-generator/SKILL.md +3 -1
  85. package/bundled-skills/instagram/scripts/export.py +18 -7
  86. package/bundled-skills/interview-style-doc-building/SKILL.md +86 -0
  87. package/bundled-skills/junta-leiloeiros/scripts/export.py +19 -10
  88. package/bundled-skills/landing-page-generator/scripts/landing_page_scaffolder.py +15 -1
  89. package/bundled-skills/linear-claude-skill/SKILL.md +4 -2
  90. package/bundled-skills/linkedin-post-writer/SKILL.md +159 -0
  91. package/bundled-skills/linkedin-post-writer/references/hook-formulas.md +482 -0
  92. package/bundled-skills/llm-council/SKILL.md +4 -2
  93. package/bundled-skills/loki-mode/examples/todo-app-generated/backend/package-lock.json +5 -6
  94. package/bundled-skills/loki-mode/examples/todo-app-generated/backend/package.json +2 -3
  95. package/bundled-skills/markdown-rendering/SKILL.md +72 -0
  96. package/bundled-skills/matematico-tao/scripts/complexity_analyzer.py +14 -1
  97. package/bundled-skills/matematico-tao/scripts/dependency_graph.py +15 -2
  98. package/bundled-skills/mobile-design/scripts/mobile_audit.py +20 -6
  99. package/bundled-skills/monte-carlo-validation-notebook/scripts/resolve_dbt_schema.py +15 -2
  100. package/bundled-skills/multi-agent-architect/SKILL.md +1 -1
  101. package/bundled-skills/odoo-rpc-api/SKILL.md +2 -1
  102. package/bundled-skills/pci-compliance/SKILL.md +3 -1
  103. package/bundled-skills/pdf-official/scripts/create_validation_image.py +17 -3
  104. package/bundled-skills/pdf-official/scripts/extract_form_field_info.py +1 -1
  105. package/bundled-skills/personal-tool-builder/SKILL.md +1 -1
  106. package/bundled-skills/pi-custom-model/SKILL.md +68 -0
  107. package/bundled-skills/pi-web-search/SKILL.md +74 -0
  108. package/bundled-skills/playwright-skill/run.js +19 -1
  109. package/bundled-skills/pptx-official/ooxml/scripts/pack.py +30 -3
  110. package/bundled-skills/pptx-official/ooxml/scripts/unpack.py +16 -3
  111. package/bundled-skills/pptx-official/scripts/inventory.py +17 -4
  112. package/bundled-skills/pptx-official/scripts/rearrange.py +15 -2
  113. package/bundled-skills/pptx-official/scripts/replace.py +16 -3
  114. package/bundled-skills/product-manager-toolkit/scripts/customer_interview_analyzer.py +15 -1
  115. package/bundled-skills/production-code-audit/SKILL.md +1 -1
  116. package/bundled-skills/push-skill-to-github/SKILL.md +61 -0
  117. package/bundled-skills/rclone-cli/references/commands/rclone_completion_powershell.md +3 -2
  118. package/bundled-skills/read-all-adrs/SKILL.md +35 -0
  119. package/bundled-skills/remote-gpu-trainer/scripts/verify_local.py +14 -1
  120. package/bundled-skills/research-prompt/SKILL.md +63 -0
  121. package/bundled-skills/run-deep-swe/SKILL.md +120 -0
  122. package/bundled-skills/senior-architect/scripts/architecture_diagram_generator.py +15 -2
  123. package/bundled-skills/senior-architect/scripts/dependency_analyzer.py +15 -2
  124. package/bundled-skills/senior-architect/scripts/project_architect.py +15 -2
  125. package/bundled-skills/senior-frontend/scripts/bundle_analyzer.py +14 -1
  126. package/bundled-skills/senior-frontend/scripts/frontend_scaffolder.py +14 -1
  127. package/bundled-skills/senior-fullstack/scripts/code_quality_analyzer.py +15 -2
  128. package/bundled-skills/senior-fullstack/scripts/fullstack_scaffolder.py +15 -2
  129. package/bundled-skills/senior-fullstack/scripts/project_scaffolder.py +15 -2
  130. package/bundled-skills/setup-help/SKILL.md +50 -0
  131. package/bundled-skills/shodan-reconnaissance/SKILL.md +2 -1
  132. package/bundled-skills/short/SKILL.md +28 -0
  133. package/bundled-skills/skill-creator/scripts/init_skill.py +15 -2
  134. package/bundled-skills/skill-creator/scripts/package_skill.py +29 -12
  135. package/bundled-skills/skill-creator/scripts/quick_validate.py +14 -2
  136. package/bundled-skills/skill-creator-ms/SKILL.md +1 -1
  137. package/bundled-skills/skill-installer/scripts/install_skill.py +42 -8
  138. package/bundled-skills/skill-installer/scripts/package_skill.py +29 -17
  139. package/bundled-skills/skill-installer/scripts/validate_skill.py +37 -22
  140. package/bundled-skills/stripe-integration/SKILL.md +7 -3
  141. package/bundled-skills/swiftui-expert-skill/scripts/instruments_parser/xctrace.py +7 -1
  142. package/bundled-skills/swiftui-expert-skill/scripts/instruments_parser/xml_utils.py +7 -1
  143. package/bundled-skills/taisly-social-media-posting/SKILL.md +79 -0
  144. package/bundled-skills/technical-tutorials/SKILL.md +1 -1
  145. package/bundled-skills/telegram/scripts/setup_project.py +17 -2
  146. package/bundled-skills/time-ledger/SKILL.md +118 -0
  147. package/bundled-skills/trading-ledger/SKILL.md +121 -0
  148. package/bundled-skills/videodb/scripts/ws_listener.py +17 -4
  149. package/bundled-skills/voice-ai-development/SKILL.md +2 -1
  150. package/bundled-skills/vps-server-management/SKILL.md +72 -0
  151. package/bundled-skills/weaviate/scripts/weaviate_conn.py +20 -18
  152. package/bundled-skills/wgm/SKILL.md +137 -0
  153. package/bundled-skills/whatsapp-cloud-api/scripts/setup_project.py +16 -1
  154. package/bundled-skills/workorai/SKILL.md +137 -0
  155. package/bundled-skills/wp-site-health-auditor/SKILL.md +341 -0
  156. package/bundled-skills/wp-site-health-auditor/references/catalog.md +135 -0
  157. package/bundled-skills/writing-skills/render-graphs.js +13 -2
  158. package/bundled-skills/x-twitter-scraper/SKILL.md +3 -1
  159. package/bundled-skills/youtube-notetaker/scripts/serve.py +41 -31
  160. package/bundled-skills/youtube-notetaker/scripts/vtt_to_transcript.py +16 -2
  161. package/bundled-skills/youtube-notetaker/scripts/write_library_item.py +15 -1
  162. package/bundled-skills/youtube-transcript/SKILL.md +120 -0
  163. package/package.json +5 -1
  164. package/skills_index.json +786 -6
@@ -0,0 +1,132 @@
1
+ ---
2
+ name: browser-install
3
+ description: Install browser-harness into the current agent and connect it to a browser with minimal prompting.
4
+ ---
5
+
6
+ # `browser-harness` installation
7
+
8
+ Use this file only for browser-harness install, browser connection setup, and connection troubleshooting. For day-to-day browser work, read `SKILL.md`. Task-specific edits belong in `agent-workspace/agent_helpers.py` and `agent-workspace/domain-skills/`.
9
+
10
+ ## Recommended `browser-harness` setup
11
+
12
+ Clone the repo once into a durable location, then install it as an editable tool so `browser-harness` works from any directory:
13
+
14
+ ```bash
15
+ git clone https://github.com/browser-use/browser-harness
16
+ cd browser-harness
17
+ uv tool install -e .
18
+ command -v browser-harness
19
+ ```
20
+
21
+ That keeps the command global while still pointing at the real repo checkout, so when the agent edits `agent-workspace/agent_helpers.py` the next `browser-harness` uses the new code immediately. Prefer a stable path like `~/Developer/browser-harness`, not `/tmp`.
22
+
23
+ ## Make browser-harness global for the current agent
24
+
25
+ After the repo is installed, register this repo's `SKILL.md` with the agent you are using:
26
+
27
+ - **Codex**: add this file as a global skill at `$CODEX_HOME/skills/browser-harness/SKILL.md` (often `~/.codex/skills/browser-harness/SKILL.md`). A symlink to this repo's `SKILL.md` is fine.
28
+
29
+ ```bash
30
+ mkdir -p "${CODEX_HOME:-$HOME/.codex}/skills/browser-harness" && ln -sf "$PWD/SKILL.md" "${CODEX_HOME:-$HOME/.codex}/skills/browser-harness/SKILL.md"
31
+ ```
32
+
33
+ - **Claude Code**: add an import to `~/.claude/CLAUDE.md` that points at this repo's `SKILL.md`, for example `@~/Developer/browser-harness/SKILL.md`.
34
+
35
+ This makes new Codex or Claude Code sessions in other folders load the runtime browser harness instructions automatically.
36
+
37
+ ## Keeping the harness current
38
+
39
+ - On each run, `browser-harness` prints `[browser-harness] update available: X -> Y` (once per day) when a newer GitHub release exists.
40
+ - When you see that banner, run `browser-harness --update -y` yourself — don't ask the user. It pulls the new code (`git pull --ff-only` for editable clones, `uv tool upgrade browser-harness` for PyPI installs) and stops the running daemon so the next call picks up the new code. With `-y` it won't prompt.
41
+ - `--update` refuses to run on an editable clone with uncommitted changes. If that happens, tell the user and let them resolve the dirty worktree.
42
+
43
+ ## Maintenance commands
44
+
45
+ - browser-harness --doctor — show version, install mode, daemon and Chrome state, and whether an update is pending.
46
+
47
+ ## Architecture
48
+
49
+ ```text
50
+ Chrome / Browser Use cloud -> CDP WS -> browser_harness.daemon -> IPC -> browser_harness.run
51
+ ```
52
+
53
+ - Protocol is one JSON line each way.
54
+ - Requests are {method, params, session_id} for CDP or {meta: ...} for daemon control.
55
+ - Responses are {result} / {error} / {events} / {session_id}.
56
+ - IPC: Unix socket at `/tmp/bu-<NAME>.sock` on POSIX, TCP loopback + port file on Windows.
57
+ - BU_NAME namespaces the daemon's IPC, pid, and log files.
58
+ - BU_CDP_WS overrides local Chrome discovery for remote browsers.
59
+ - BU_CDP_URL overrides local Chrome discovery with a specific DevTools HTTP endpoint (used for Way 2).
60
+ - BU_BROWSER_ID + BROWSER_USE_API_KEY lets the daemon stop a Browser Use cloud browser on shutdown.
61
+
62
+ # Browser connection setup and troubleshooting
63
+
64
+ ## Browser connection reference
65
+
66
+ This section is the source of truth for how browser-harness connects to a browser. It is the canonical reference for every agent and user of this repo. Every statement here is intended to be verifiable against either an official Chrome source or this repo's own code, and is held to that standard deliberately. If anything below is incorrect, incomplete, or misleading, open an issue on the browser-harness repository immediately with clear evidence and explanation so it can be corrected. Do not silently work around an error in this document; the cost of one user being misled is much higher than the cost of one issue.
67
+
68
+ Browser-harness can connect to any Chrome or Chromium-based browser on your computer, or to a Browser Use cloud browser.
69
+
70
+ **Cloud browsers** are managed by the Browser Use cloud API. Start one in Python with `start_remote_daemon("work", ...)`. Authentication is via the `BROWSER_USE_API_KEY` environment variable; the harness handles the WebSocket URL itself. To carry your local Chrome cookies into a cloud browser, install the Browser Use `profile-use` helper only after reviewing the upstream installer instructions, then call `uuid = sync_local_profile("MyChromeProfile")` followed by `start_remote_daemon("work", profileId=uuid)`. Cookies are the only thing synced — not localStorage, not extensions, not history.
71
+
72
+ **Local browsers** require remote debugging to be enabled. There are two ways, and they suit different use cases.
73
+
74
+ *Way 1: chrome://inspect/#remote-debugging checkbox — uses your real profile.* In your running Chrome, navigate to `chrome://inspect/#remote-debugging` and tick the "Allow remote debugging for this browser instance" checkbox. This setting is per-profile and sticky: tick it once and it persists across every future Chrome launch of that profile. Then run any `browser-harness` command. On Chrome 144 and later, the first attach by the harness triggers an in-browser "Allow remote debugging?" popup that you must click Allow on. The popup may reappear on later attaches under conditions that are not fully characterized.[^1] This path inherits your everyday Chrome's logins, extensions, history, and bookmarks, which makes it the right choice for an agent helping you with tasks in your real browser.
75
+
76
+ *Way 2: command-line flag — uses an isolated profile, no popups ever.* Launch Chrome with `--remote-debugging-port=9222 --user-data-dir=<path>`. Two precisions:
77
+
78
+ - The path must be a directory that is **not** Chrome's platform default (`%LOCALAPPDATA%\Google\Chrome\User Data` on Windows, `~/Library/Application Support/Google/Chrome` on macOS, `~/.config/google-chrome` on Linux). On Chrome 136 and later, the port flag is silently no-opped when the user-data-dir is the platform default, even if you pass it explicitly. An empty or new path gives a fresh clean profile that Chrome will persist there across future runs.
79
+ - This path does **not** let you reuse your everyday Chrome profile. Copying the default profile's files into a custom directory makes Chrome accept the flag, but cookies are encrypted under a key bound to the original directory and will not survive the copy — so you carry over bookmarks and extensions but lose every logged-in session. If you want your real logins, use Way 1.
80
+
81
+ Tell the harness which port you launched on by setting `BU_CDP_URL=http://127.0.0.1:9222` before running `browser-harness`.
82
+
83
+ For most tasks where the agent acts on your behalf in your normal browser, use Way 1. For automation that runs without you watching, or any case where popup interruptions are unacceptable, use Way 2 or a cloud browser.
84
+
85
+ [^1]: The conditions that cause Chrome to re-show the "Allow remote debugging?" popup on a subsequent attach (time elapsed since previous Allow, daemon restart, browser restart, new CDP session, version-dependent options like "Allow for N hours") are not fully characterized. Way 2 sidesteps this entirely.
86
+
87
+ ## First time setup
88
+
89
+ Try yourself before asking the user to do anything. Retry transient errors briefly. Only ask the user when a step genuinely needs them — ticking a checkbox, clicking Allow.
90
+
91
+ If the user hasn't said which connection method to use, default to Way 1 if Chrome is already running, Way 2 if not. Cloud is only used when the user opts in.
92
+
93
+ 1. Try the harness:
94
+
95
+ ```bash
96
+ browser-harness -c 'print(page_info())'
97
+ ```
98
+
99
+ If it prints page info, you're done.
100
+
101
+ 2. Otherwise run `browser-harness --doctor`. The two lines that matter for connection are `chrome running` and `daemon alive`.
102
+
103
+ 3. Match the output to a case:
104
+
105
+ - **chrome FAIL** → no Chrome process detected.
106
+ - **Way 1**: ask the user to open their target Chrome themselves.
107
+ - **Way 2**: launch Chrome yourself with `--remote-debugging-port=9222 --user-data-dir=<non-default path>`, then set `BU_CDP_URL=http://127.0.0.1:9222` for the harness (see the Browser connection reference).
108
+
109
+ - **chrome ok, daemon FAIL** → Way 1 setup is incomplete. Tell the user to:
110
+ - navigate to `chrome://inspect/#remote-debugging` in their Chrome and tick "Allow remote debugging for this browser instance" if not yet ticked (one-time per profile)
111
+ - click Allow on the in-browser popup if it appears (every attach on Chrome 144+)
112
+
113
+ On macOS, you can open the inspect page in their running Chrome yourself instead of asking them to navigate:
114
+
115
+ ```bash
116
+ osascript -e 'tell application "Google Chrome" to activate' \
117
+ -e 'tell application "Google Chrome" to open location "chrome://inspect/#remote-debugging"'
118
+ ```
119
+
120
+ - **chrome ok, daemon ok, but step 1 still failed** → stale daemon. Restart it:
121
+
122
+ ```bash
123
+ browser-harness -c 'restart_daemon()'
124
+ ```
125
+
126
+ If that hangs, escalate: kill all Chrome and daemon processes, then reopen Chrome and retry. On macOS/Linux, also remove `/tmp/bu-default.sock` and `/tmp/bu-default.pid` if they linger.
127
+
128
+ 4. After any fix, retry step 1.
129
+
130
+ If Way 1 fails repeatedly or the user's task is unattended, move to Way 2 or a cloud browser per the Browser connection reference (these have no popups).
131
+
132
+ If you are testing browser connection for the first time, run this demo: open `https://github.com/browser-use/browser-harness` in a new tab and activate it (`switch_tab`) so the user sees the harness has attached. Then ask what they want to do next.
@@ -30,6 +30,19 @@ import sys
30
30
  from collections import Counter, defaultdict
31
31
  from datetime import datetime, timezone
32
32
  from pathlib import Path
33
+
34
+
35
+ def safe_user_path(path_value, base_dir="."):
36
+ """Resolve a CLI path under the current workspace."""
37
+ if base_dir != ".":
38
+ raise ValueError("Custom base directories are not supported for CLI paths")
39
+ base_path = Path.cwd().resolve()
40
+ resolved_path = Path(path_value).expanduser().resolve()
41
+ try:
42
+ resolved_path.relative_to(base_path)
43
+ except ValueError as exc:
44
+ raise ValueError(f"Path escapes allowed directory: {path_value}") from exc
45
+ return resolved_path
33
46
  from typing import Any
34
47
 
35
48
 
@@ -336,11 +349,11 @@ def build_report(records: list[dict[str, Any]], source_path: Path) -> str:
336
349
 
337
350
  def main(argv: list[str]) -> int:
338
351
  if len(argv) != 3:
339
- print(f"usage: {Path(argv[0]).name} <input.ndjson> <output.md>", file=sys.stderr)
352
+ print(f"usage: {safe_user_path(argv[0]).name} <input.ndjson> <output.md>", file=sys.stderr)
340
353
  return 1
341
354
 
342
- input_path = Path(argv[1])
343
- output_path = Path(argv[2])
355
+ input_path = safe_user_path(argv[1])
356
+ output_path = safe_user_path(argv[2])
344
357
 
345
358
  if not input_path.exists() or input_path.stat().st_size == 0:
346
359
  print(f"error: {input_path} is missing or empty", file=sys.stderr)
@@ -384,7 +384,7 @@ const allUsers = db.query("SELECT * FROM users").all();
384
384
 
385
385
  ```typescript
386
386
  // Hash password
387
- const password = "super-secret";
387
+ const password = crypto.randomUUID();
388
388
  const hash = await Bun.password.hash(password);
389
389
 
390
390
  // Verify password
@@ -25,8 +25,8 @@ This skill ensures all code follows security best practices and identifies poten
25
25
 
26
26
  #### ❌ NEVER Do This
27
27
  ```typescript
28
- const apiKey = "sk-proj-xxxxx" // Hardcoded secret
29
- const dbPassword = "password123" // In source code
28
+ const leakedToken = "[redacted API key]" // Hardcoded secret
29
+ const dbCredential = "[redacted password]" // In source code
30
30
  ```
31
31
 
32
32
  #### ✅ ALWAYS Do This
@@ -20,6 +20,19 @@ import time
20
20
  from datetime import datetime
21
21
  from pathlib import Path
22
22
 
23
+
24
+ def safe_user_path(path_value, base_dir="."):
25
+ """Resolve a CLI path under the current workspace."""
26
+ if base_dir != ".":
27
+ raise ValueError("Custom base directories are not supported for CLI paths")
28
+ base_path = Path.cwd().resolve()
29
+ resolved_path = Path(path_value).expanduser().resolve()
30
+ try:
31
+ resolved_path.relative_to(base_path)
32
+ except ValueError as exc:
33
+ raise ValueError(f"Path escapes allowed directory: {path_value}") from exc
34
+ return resolved_path
35
+
23
36
  try:
24
37
  import psutil
25
38
  except ImportError:
@@ -281,8 +294,8 @@ def main():
281
294
  else:
282
295
  output_path = f"monitor_log_{datetime.now().strftime('%Y%m%d_%H%M%S')}.json"
283
296
 
284
- with open(output_path, "w", encoding="utf-8") as f:
285
- json.dump(output_data, f, indent=2, ensure_ascii=False)
297
+ with safe_user_path(output_path).open("w", encoding="utf-8") as f:
298
+ f.write(json.dumps(output_data, indent=2, ensure_ascii=False))
286
299
 
287
300
  print(f"\nLog salvo em: {output_path}\n")
288
301
 
@@ -0,0 +1,250 @@
1
+ ---
2
+ name: cmux
3
+ description: "Control cmux workspaces, panes, surfaces, and agent sessions safely from macOS terminal workflows."
4
+ category: development
5
+ risk: critical
6
+ source: community
7
+ source_repo: davidondrej/skills
8
+ source_type: community
9
+ date_added: "2026-07-07"
10
+ author: davidondrej
11
+ tags: [cmux, terminal, agents, macos]
12
+ tools: [claude, codex]
13
+ license: "MIT"
14
+ license_source: "https://github.com/davidondrej/skills/blob/main/LICENSE"
15
+ ---
16
+
17
+ # cmux Control
18
+
19
+ ## When to Use
20
+
21
+ - Use when you need to inspect, create, close, or rearrange cmux panes, surfaces, or workspaces.
22
+ - Use when you need to send input to or monitor agents running inside cmux.
23
+
24
+ cmux is a native macOS terminal app for running multiple AI coding agents in parallel. It exposes a CLI (`cmux`) and a Unix-socket JSON-RPC API (`/tmp/cmux.sock`) for full topology and browser control.
25
+
26
+ ## Core Concepts
27
+
28
+ - **Window** — top-level macOS cmux window
29
+ - **Workspace** — sidebar tab within a window (one git branch / project context)
30
+ - **Pane** — split region inside a workspace
31
+ - **Surface** — tab inside a pane (terminal or browser)
32
+
33
+ Handles default to short refs (`workspace:2`, `pane:1`, `surface:7`); UUIDs accepted as input. Add `--id-format uuids|both` for UUID output.
34
+
35
+ ### Ref syntax — get this right or fail silently
36
+
37
+ - **Always use PREFIXED refs** (`pane:38`, `surface:46`). A **bare number is treated as an INDEX, not an ID** — `--surface 46` means "the surface at index 46" (usually nonexistent → silent failure), NOT `surface:46`.
38
+ - **`read-screen` and `capture-pane` have NO `--pane` flag** — they target `--workspace` or `--surface` only. Passing `--pane` errors, and a bare/missing target falls back to your OWN surface (you'll read your own footer and draw wrong conclusions). To read a pane: resolve it to a surface FIRST with `cmux list-pane-surfaces --pane pane:N`, then `cmux read-screen --surface surface:N`.
39
+ - **Never append `2>/dev/null` to cmux commands.** Errors go to stderr with exit code 1; suppressing them blinds you to your own ref/flag mistakes (the #1 cause of "(no output)").
40
+
41
+ ## Detect cmux in a Shell
42
+
43
+ ```bash
44
+ [ -S "${CMUX_SOCKET_PATH:-/tmp/cmux.sock}" ] || exit 0 # bail if not in cmux
45
+ [ -n "${CMUX_WORKSPACE_ID:-}" ] && echo "inside cmux surface"
46
+ ```
47
+
48
+ Injected env vars in every cmux-spawned terminal: `CMUX_WORKSPACE_ID`, `CMUX_SURFACE_ID`, `CMUX_SOCKET_PATH`, `CMUX_PORT`. **Always anchor automation to `CMUX_WORKSPACE_ID`** — the visually focused workspace may not be the agent's caller workspace.
49
+
50
+ ## Fast Start — Topology
51
+
52
+ ```bash
53
+ cmux identify --json # who am I (window/workspace/pane/surface)
54
+ cmux tree # full hierarchy
55
+ cmux list-workspaces --json
56
+ cmux list-panes --workspace "$CMUX_WORKSPACE_ID"
57
+ cmux list-surfaces --workspace "$CMUX_WORKSPACE_ID"
58
+
59
+ cmux new-workspace --name "feature-x" --cwd /path/to/repo
60
+ cmux new-pane --workspace "$CMUX_WORKSPACE_ID" --type terminal --direction right --focus false
61
+ cmux new-pane --workspace "$CMUX_WORKSPACE_ID" --type browser --direction right --url http://localhost:3000
62
+ cmux move-surface --surface surface:7 --pane pane:2 --focus false
63
+ cmux split-off --surface surface:7 right
64
+ cmux reorder-surface --surface surface:7 --before surface:3
65
+ cmux close-surface --surface surface:7
66
+ ```
67
+
68
+ ## Polling Pi Agents in Panes — Keep Sleeps Short
69
+
70
+ When launching a Pi Agent inside a cmux pane and polling for output, use **short `sleep` intervals (2–5s)**. Pi is fast and minimal, and the user runs it on Opus 4.8 Fast via OpenRouter, which streams tokens extremely quickly. Do NOT use `sleep 15` unless genuinely needed (a big build/refactor) — most of the time `sleep 2`–`sleep 5` is more than enough.
71
+
72
+ After every agent check, send the user a one-line status update: what the agent is doing and whether it is on track. Keep it extremely concise.
73
+
74
+ Claude Code cmux note: after Claude finishes, it may prefill a predicted next user message; that draft is Claude, not the user speaking.
75
+
76
+ ## Send Input
77
+
78
+ **Command names:** there is NO `send-surface` / `send-key-surface`. Target a specific surface with the `--surface` flag on `send` / `send-key` (same commands as the focused terminal). `send-panel` / `send-key-panel` exist ONLY for panels (`--panel`), not surfaces.
79
+
80
+ ```bash
81
+ cmux send "echo hi\n" # focused terminal
82
+ cmux send-key "ctrl+c" # enter|tab|esc|backspace|arrows|ctrl+x|shift+tab
83
+ cmux send --surface surface:7 "npm run build" # specific surface (NOT send-surface)
84
+ cmux send-key --surface surface:7 enter # specific surface (NOT send-key-surface)
85
+ ```
86
+
87
+ ## Notifications & Sidebar Metadata
88
+
89
+ ```bash
90
+ cmux notify --title "Done" --body "tests passed"
91
+ cmux set-status build "compiling" --icon hammer --color "#ff9500"
92
+ cmux set-progress 0.5 --label "Building..."
93
+ cmux log --level success "All 42 tests passed" # info|progress|success|warning|error
94
+ cmux trigger-flash --workspace "$CMUX_WORKSPACE_ID" # blue-ring attention cue
95
+ cmux sidebar-state --json # dump all sidebar metadata
96
+ ```
97
+
98
+ ## Browser Automation (WKWebView)
99
+
100
+ Workflow: open → wait → snapshot → act → re-snapshot.
101
+
102
+ ```bash
103
+ S=$(cmux --json browser open https://example.com | jq -r .result.surface_ref)
104
+ cmux browser "$S" wait --load-state complete --timeout-ms 15000
105
+ cmux browser "$S" snapshot --interactive # returns elements as e1, e2, ...
106
+ cmux browser "$S" fill e1 "<email-address>"
107
+ cmux browser "$S" click e2 --snapshot-after
108
+
109
+ # Navigation / inspection
110
+ cmux browser "$S" goto URL | back | forward | reload
111
+ cmux browser "$S" get url | get title | get text body | get value "#email" | get count ".row"
112
+ cmux browser "$S" eval 'return document.title'
113
+
114
+ # Waits
115
+ cmux browser "$S" wait --selector "#ready" --timeout-ms 10000
116
+ cmux browser "$S" wait --url-contains "/dashboard" --timeout-ms 10000
117
+
118
+ # Session
119
+ cmux browser "$S" cookies get | cookies set --name foo --value bar
120
+ cmux browser "$S" state save /tmp/auth.json | state load /tmp/auth.json
121
+
122
+ # Diagnostics
123
+ cmux browser "$S" console list | errors list | screenshot
124
+ ```
125
+
126
+ **Not supported by WKWebView** (return `not_supported`): viewport emulation, geolocation/offline emulation, trace recording, network route interception, raw input injection.
127
+
128
+ ## Markdown Viewer
129
+
130
+ ```bash
131
+ cmux markdown open plan.md --direction right # live-watching renderer
132
+ cmux open file.pdf # auto-routes to right viewer
133
+ ```
134
+
135
+ `cmux markdown open` flags: `--workspace`, `--surface`, `--window`, `--direction <right|down|left|up>`, `--focus <true|false>`. There is **NO `--pane` flag** — passing it errors. To target a pane, pass `--surface <existing-md-surface-in-that-pane>`.
136
+
137
+ ### Reuse the existing right markdown pane (don't spawn strays)
138
+
139
+ Default behavior of `markdown open` is to **create a new pane** every time, even with `--direction right`. To keep all docs as tabs in ONE right pane, follow this exactly:
140
+
141
+ ```bash
142
+ # 1. Find the right pane and its surfaces (anchor to THIS workspace)
143
+ cmux list-panes --workspace "$CMUX_WORKSPACE_ID"
144
+ cmux list-pane-surfaces --pane pane:10 # the right/helper pane
145
+
146
+ # 2. Open targeting an existing markdown surface IN that pane (reuses pane, adds tab)
147
+ cmux markdown open /abs/path/file.md --surface surface:12 --focus false
148
+
149
+ # 3. If it STILL spawned a new pane (it can), move the new surface in + verify
150
+ cmux move-surface --surface surface:NEW --pane pane:10 --focus false
151
+ cmux list-panes --workspace "$CMUX_WORKSPACE_ID" # confirm stray pane is gone
152
+ ```
153
+
154
+ ### Swapping the file in the single right pane (close-FIRST, then open)
155
+
156
+ To replace the doc shown in your one right markdown pane, the ONLY reliable order is **close the previous surface FIRST, then `markdown open` the new file fresh** — never move an existing viewer, never open-then-close.
157
+
158
+ ```bash
159
+ # 1. close the previous right markdown surface (right side goes empty)
160
+ cmux list-panes --workspace "$CMUX_WORKSPACE_ID"
161
+ cmux close-surface --surface surface:PREV
162
+ # 2. THEN open the new file fresh
163
+ cmux markdown open /abs/path/new.md --direction right --focus false
164
+ ```
165
+
166
+ ORDER MATTERS: close-previous BEFORE open-new. Opening first then closing the old one, or `move-surface`-ing an existing viewer, leaves the right pane BLANK.
167
+
168
+ ### Hard-won lessons (avoid the trial-and-error)
169
+
170
+ - **Surface refs are global, not per-workspace.** A ref like `surface:126` from an earlier `markdown open` may live in a different window/workspace. Always re-list (`list-panes` / `list-pane-surfaces`) before reusing a ref — never assume a ref from a previous turn is still in the right pane.
171
+ - **`move-surface`-ing a markdown viewer often leaves it BLANK.** The moved surface keeps `type=markdown` and `surface-health` looks fine, but renders nothing. Fix: `close-surface` it and `cmux markdown open <path>` fresh, then move the *fresh* surface if needed. Don't waste time on `refresh-surfaces` — it usually won't fix a moved-then-blank viewer.
172
+ - **You cannot screenshot or `read-screen` a markdown surface** (`Surface is not a terminal` / browser screenshot is WKWebView-only). To verify a markdown viewer rendered, ask the user or open the file in a browser surface instead. Don't burn turns trying to capture it.
173
+ - **`cmux list-surfaces` does not exist.** Use `cmux list-pane-surfaces [--pane ...]`.
174
+
175
+ ## Settings & Config
176
+
177
+ ```bash
178
+ cmux docs settings # prints paths, schema URL, reload cmd — read BEFORE editing
179
+ cmux settings path # path to cmux.json
180
+ cmux settings cmux-json # open in editor
181
+ cmux reload-config # hot-reload cmux.json + ~/.config/ghostty/config (Cmd+Shift+,)
182
+ ```
183
+
184
+ Locations:
185
+ - cmux settings: `~/.config/cmux/cmux.json` (canonical). Project-local override: `.cmux/cmux.json` or `./cmux.json`.
186
+ - Terminal rendering (font, cursor, theme, scrollback, opacity, blur): `~/.config/ghostty/config` — NOT cmux.json.
187
+
188
+ Before editing `cmux.json`, copy it to a timestamped `.bak` next to it so the user can revert. Schema: `https://raw.githubusercontent.com/manaflow-ai/cmux/main/web/data/cmux.schema.json`.
189
+
190
+ ## Agent Hooks & Install
191
+
192
+ ```bash
193
+ brew tap manaflow-ai/cmux && brew install --cask cmux
194
+ sudo ln -sf /Applications/cmux.app/Contents/Resources/bin/cmux /usr/local/bin/cmux
195
+ cmux hooks setup # all detected agents
196
+ cmux hooks setup codex|grok|antigravity|opencode # specific agent
197
+ npx skills add manaflow-ai/cmux -g -y # install cmux skills for agents
198
+ ```
199
+
200
+ Native session-resume supported for: Claude Code, Codex, Grok, OpenCode, Pi, Amp, Cursor CLI, Gemini, Antigravity, Rovo Dev, Hermes, Copilot, CodeBuddy, Factory, Qoder.
201
+
202
+ ## Socket API (advanced)
203
+
204
+ `/tmp/cmux.sock` — Unix socket, JSON-RPC v2. Use for tight loops where subprocess spawn cost matters; otherwise prefer the CLI.
205
+
206
+ ```bash
207
+ echo '{"id":"1","method":"workspace.list","params":{}}' | nc -U /tmp/cmux.sock
208
+ ```
209
+
210
+ Method prefixes: `system.*`, `window.*`, `workspace.*`, `pane.*`, `surface.*`, `notification.*`, `browser.*`. Full list and Python client example in `references/socket-api.md`.
211
+
212
+ Access modes: `cmuxOnly` (default — only cmux-spawned processes), `automation` (any local process), `password`, `allowAll` (unsafe). If you hit `Failed to connect to socket`, you're likely an external process under `cmuxOnly` — switch mode in Settings > Automation or run from inside a cmux terminal.
213
+
214
+ ## Critical Rules — Non-Disruptive Automation
215
+
216
+ These rules come from the `cmux-workspace` skill and prevent agents from yanking the user's focus:
217
+
218
+ 1. **Anchor to `CMUX_WORKSPACE_ID`.** Never assume the visually focused workspace is the target.
219
+ 2. **Never call focus-changing verbs speculatively.** `select-workspace`, `focus-pane`, `focus-panel`, `focus-surface` only on explicit user request. Pass `--focus false` whenever available.
220
+ 3. **Build layout additively in one call.** `cmux new-pane --type … --focus false` beats create-then-move-then-focus chains.
221
+ 4. **Right-side helper pane pattern.** Reuse an existing non-caller helper pane if present; otherwise create exactly one right-side pane.
222
+ 5. **Never send input to surfaces you don't own.** Only target surfaces in the caller's workspace unless the user explicitly asks for cross-workspace routing.
223
+ 6. **Check surface health before routing input** when UI state may be stale: `cmux surface-health`.
224
+
225
+ ## Common Pitfalls
226
+
227
+ - **Pi/Pi-like socket connection failures from external processes** → default `cmuxOnly` mode; either run inside a cmux terminal or change socket mode.
228
+ - **macOS only.** No Linux/Windows port.
229
+ - **WKWebView ≠ CDP.** Don't expect Playwright-equivalent network mocking or viewport emulation.
230
+ - **Resume strips sensitive env vars.** Re-inject tokens at resume time if the agent needs them.
231
+ - **Skills snapshot at app start.** Edits to skill files require a restart of the consuming agent.
232
+ - **Legacy v1 socket payloads (`{"command":...}`) rejected.** Use v2 JSON-RPC only.
233
+ - **Don't `cat ~/.cmuxterm/*-hook-sessions.json`** expecting secrets — they're scrubbed. Look there for session/surface mappings only.
234
+
235
+ ## Reference: Full CLI Help
236
+
237
+ For any command, `cmux <cmd> --help` is authoritative. Use `cmux capabilities --json` to enumerate available socket methods in the current build.
238
+
239
+ ## Keyboard Shortcuts (most-used)
240
+
241
+ Workspaces: ⌘N new, ⌘1–8 jump, ⌃⌘[ / ⌃⌘] prev/next, ⌘⇧W close, ⌘B sidebar.
242
+ Surfaces: ⌘T new, ⌘⇧[ / ⌘⇧] prev/next, ⌘W close, ⌃1–8 jump.
243
+ Splits: ⌘D right, ⌘⇧D down, ⌥⌘D browser right, ⌥⌘←→↑↓ focus directional, ⌘⇧↵ zoom.
244
+ Browser: ⌘⇧L open, ⌘L address bar, ⌘[/⌘] back/forward, ⌥⌘I devtools.
245
+ App: ⌘, settings, ⌘⇧, reload-config, ⌘⇧P palette, ⌘⇧O restore session, ⌃⌥⌘. system-wide show/hide.
246
+
247
+ ## Limitations
248
+
249
+ - Adapted from `davidondrej/skills`; verify local paths, tools, credentials, and agent features before acting.
250
+ - For commands, remote access, scheduling, browser automation, or file-changing workflows, get explicit user approval and confirm the target environment first.