@elizaos/skills 2.0.0-alpha.10
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.
- package/README.md +126 -0
- package/dist/formatter.d.ts +44 -0
- package/dist/formatter.d.ts.map +1 -0
- package/dist/formatter.js +182 -0
- package/dist/frontmatter.d.ts +39 -0
- package/dist/frontmatter.d.ts.map +1 -0
- package/dist/frontmatter.js +105 -0
- package/dist/index.d.ts +29 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +31 -0
- package/dist/loader.d.ts +33 -0
- package/dist/loader.d.ts.map +1 -0
- package/dist/loader.js +362 -0
- package/dist/resolver.d.ts +18 -0
- package/dist/resolver.d.ts.map +1 -0
- package/dist/resolver.js +90 -0
- package/dist/types.d.ts +201 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +1 -0
- package/package.json +57 -0
- package/skills/1password/SKILL.md +70 -0
- package/skills/1password/references/cli-examples.md +29 -0
- package/skills/1password/references/get-started.md +17 -0
- package/skills/apple-notes/SKILL.md +77 -0
- package/skills/apple-reminders/SKILL.md +96 -0
- package/skills/bear-notes/SKILL.md +107 -0
- package/skills/bird/SKILL.md +224 -0
- package/skills/blogwatcher/SKILL.md +69 -0
- package/skills/blucli/SKILL.md +47 -0
- package/skills/bluebubbles/SKILL.md +131 -0
- package/skills/camsnap/SKILL.md +45 -0
- package/skills/canvas/SKILL.md +203 -0
- package/skills/clawhub/SKILL.md +77 -0
- package/skills/coding-agent/SKILL.md +284 -0
- package/skills/discord/SKILL.md +578 -0
- package/skills/eightctl/SKILL.md +50 -0
- package/skills/food-order/SKILL.md +48 -0
- package/skills/gemini/SKILL.md +43 -0
- package/skills/gifgrep/SKILL.md +79 -0
- package/skills/github/SKILL.md +77 -0
- package/skills/gog/SKILL.md +116 -0
- package/skills/goplaces/SKILL.md +52 -0
- package/skills/healthcheck/SKILL.md +245 -0
- package/skills/himalaya/SKILL.md +257 -0
- package/skills/himalaya/references/configuration.md +184 -0
- package/skills/himalaya/references/message-composition.md +199 -0
- package/skills/imsg/SKILL.md +74 -0
- package/skills/local-places/SERVER_README.md +101 -0
- package/skills/local-places/SKILL.md +102 -0
- package/skills/local-places/pyproject.toml +21 -0
- package/skills/local-places/src/local_places/__init__.py +2 -0
- package/skills/local-places/src/local_places/google_places.py +314 -0
- package/skills/local-places/src/local_places/main.py +65 -0
- package/skills/local-places/src/local_places/schemas.py +107 -0
- package/skills/mcporter/SKILL.md +61 -0
- package/skills/model-usage/SKILL.md +69 -0
- package/skills/model-usage/references/codexbar-cli.md +33 -0
- package/skills/model-usage/scripts/model_usage.py +310 -0
- package/skills/nano-banana-pro/SKILL.md +58 -0
- package/skills/nano-banana-pro/scripts/generate_image.py +184 -0
- package/skills/nano-pdf/SKILL.md +38 -0
- package/skills/notion/SKILL.md +172 -0
- package/skills/obsidian/SKILL.md +81 -0
- package/skills/openai-image-gen/SKILL.md +89 -0
- package/skills/openai-image-gen/scripts/gen.py +240 -0
- package/skills/openai-whisper/SKILL.md +38 -0
- package/skills/openai-whisper-api/SKILL.md +52 -0
- package/skills/openai-whisper-api/scripts/transcribe.sh +85 -0
- package/skills/openhue/SKILL.md +51 -0
- package/skills/oracle/SKILL.md +125 -0
- package/skills/ordercli/SKILL.md +78 -0
- package/skills/peekaboo/SKILL.md +190 -0
- package/skills/sag/SKILL.md +87 -0
- package/skills/security-ask-questions-if-underspecified/.claude-plugin/plugin.json +10 -0
- package/skills/security-ask-questions-if-underspecified/README.md +24 -0
- package/skills/security-ask-questions-if-underspecified/SKILL.md +85 -0
- package/skills/security-ask-questions-if-underspecified/skills/ask-questions-if-underspecified/SKILL.md +85 -0
- package/skills/security-audit-context-building/.claude-plugin/plugin.json +10 -0
- package/skills/security-audit-context-building/README.md +58 -0
- package/skills/security-audit-context-building/SKILL.md +297 -0
- package/skills/security-audit-context-building/commands/audit-context.md +21 -0
- package/skills/security-audit-context-building/skills/audit-context-building/SKILL.md +297 -0
- package/skills/security-audit-context-building/skills/audit-context-building/resources/COMPLETENESS_CHECKLIST.md +47 -0
- package/skills/security-audit-context-building/skills/audit-context-building/resources/FUNCTION_MICRO_ANALYSIS_EXAMPLE.md +355 -0
- package/skills/security-audit-context-building/skills/audit-context-building/resources/OUTPUT_REQUIREMENTS.md +71 -0
- package/skills/security-building-secure-contracts/.claude-plugin/plugin.json +10 -0
- package/skills/security-building-secure-contracts/README.md +241 -0
- package/skills/security-building-secure-contracts/SKILL.md +67 -0
- package/skills/security-building-secure-contracts/skills/algorand-vulnerability-scanner/SKILL.md +284 -0
- package/skills/security-building-secure-contracts/skills/algorand-vulnerability-scanner/resources/VULNERABILITY_PATTERNS.md +405 -0
- package/skills/security-building-secure-contracts/skills/audit-prep-assistant/SKILL.md +409 -0
- package/skills/security-building-secure-contracts/skills/cairo-vulnerability-scanner/SKILL.md +329 -0
- package/skills/security-building-secure-contracts/skills/cairo-vulnerability-scanner/resources/VULNERABILITY_PATTERNS.md +722 -0
- package/skills/security-building-secure-contracts/skills/code-maturity-assessor/SKILL.md +218 -0
- package/skills/security-building-secure-contracts/skills/code-maturity-assessor/resources/ASSESSMENT_CRITERIA.md +355 -0
- package/skills/security-building-secure-contracts/skills/code-maturity-assessor/resources/EXAMPLE_REPORT.md +248 -0
- package/skills/security-building-secure-contracts/skills/code-maturity-assessor/resources/REPORT_FORMAT.md +33 -0
- package/skills/security-building-secure-contracts/skills/cosmos-vulnerability-scanner/SKILL.md +334 -0
- package/skills/security-building-secure-contracts/skills/cosmos-vulnerability-scanner/resources/VULNERABILITY_PATTERNS.md +740 -0
- package/skills/security-building-secure-contracts/skills/guidelines-advisor/SKILL.md +252 -0
- package/skills/security-building-secure-contracts/skills/guidelines-advisor/resources/ASSESSMENT_AREAS.md +329 -0
- package/skills/security-building-secure-contracts/skills/guidelines-advisor/resources/DELIVERABLES.md +118 -0
- package/skills/security-building-secure-contracts/skills/guidelines-advisor/resources/EXAMPLE_REPORT.md +298 -0
- package/skills/security-building-secure-contracts/skills/secure-workflow-guide/SKILL.md +161 -0
- package/skills/security-building-secure-contracts/skills/secure-workflow-guide/resources/EXAMPLE_REPORT.md +279 -0
- package/skills/security-building-secure-contracts/skills/secure-workflow-guide/resources/WORKFLOW_STEPS.md +132 -0
- package/skills/security-building-secure-contracts/skills/solana-vulnerability-scanner/SKILL.md +389 -0
- package/skills/security-building-secure-contracts/skills/solana-vulnerability-scanner/resources/VULNERABILITY_PATTERNS.md +669 -0
- package/skills/security-building-secure-contracts/skills/substrate-vulnerability-scanner/SKILL.md +298 -0
- package/skills/security-building-secure-contracts/skills/substrate-vulnerability-scanner/resources/VULNERABILITY_PATTERNS.md +791 -0
- package/skills/security-building-secure-contracts/skills/token-integration-analyzer/SKILL.md +362 -0
- package/skills/security-building-secure-contracts/skills/token-integration-analyzer/resources/ASSESSMENT_CATEGORIES.md +571 -0
- package/skills/security-building-secure-contracts/skills/token-integration-analyzer/resources/REPORT_TEMPLATES.md +141 -0
- package/skills/security-building-secure-contracts/skills/ton-vulnerability-scanner/SKILL.md +388 -0
- package/skills/security-building-secure-contracts/skills/ton-vulnerability-scanner/resources/VULNERABILITY_PATTERNS.md +595 -0
- package/skills/security-differential-review/.claude-plugin/plugin.json +10 -0
- package/skills/security-differential-review/README.md +109 -0
- package/skills/security-differential-review/SKILL.md +220 -0
- package/skills/security-differential-review/commands/diff-review.md +21 -0
- package/skills/security-differential-review/skills/differential-review/SKILL.md +220 -0
- package/skills/security-differential-review/skills/differential-review/adversarial.md +203 -0
- package/skills/security-differential-review/skills/differential-review/methodology.md +234 -0
- package/skills/security-differential-review/skills/differential-review/patterns.md +300 -0
- package/skills/security-differential-review/skills/differential-review/reporting.md +369 -0
- package/skills/security-entry-point-analyzer/.claude-plugin/plugin.json +10 -0
- package/skills/security-entry-point-analyzer/README.md +74 -0
- package/skills/security-entry-point-analyzer/SKILL.md +251 -0
- package/skills/security-entry-point-analyzer/commands/entry-points.md +18 -0
- package/skills/security-entry-point-analyzer/skills/entry-point-analyzer/SKILL.md +251 -0
- package/skills/security-entry-point-analyzer/skills/entry-point-analyzer/references/cosmwasm.md +182 -0
- package/skills/security-entry-point-analyzer/skills/entry-point-analyzer/references/move-aptos.md +107 -0
- package/skills/security-entry-point-analyzer/skills/entry-point-analyzer/references/move-sui.md +87 -0
- package/skills/security-entry-point-analyzer/skills/entry-point-analyzer/references/solana.md +155 -0
- package/skills/security-entry-point-analyzer/skills/entry-point-analyzer/references/solidity.md +135 -0
- package/skills/security-entry-point-analyzer/skills/entry-point-analyzer/references/ton.md +185 -0
- package/skills/security-entry-point-analyzer/skills/entry-point-analyzer/references/vyper.md +141 -0
- package/skills/security-fix-review/.claude-plugin/plugin.json +13 -0
- package/skills/security-fix-review/README.md +118 -0
- package/skills/security-fix-review/SKILL.md +264 -0
- package/skills/security-fix-review/commands/fix-review.md +24 -0
- package/skills/security-fix-review/skills/fix-review/SKILL.md +264 -0
- package/skills/security-fix-review/skills/fix-review/references/bug-detection.md +408 -0
- package/skills/security-fix-review/skills/fix-review/references/finding-matching.md +298 -0
- package/skills/security-fix-review/skills/fix-review/references/report-parsing.md +398 -0
- package/skills/security-insecure-defaults/.claude-plugin/plugin.json +10 -0
- package/skills/security-insecure-defaults/README.md +45 -0
- package/skills/security-insecure-defaults/SKILL.md +117 -0
- package/skills/security-insecure-defaults/skills/insecure-defaults/SKILL.md +117 -0
- package/skills/security-insecure-defaults/skills/insecure-defaults/references/examples.md +409 -0
- package/skills/security-modern-python/.claude-plugin/plugin.json +10 -0
- package/skills/security-modern-python/README.md +58 -0
- package/skills/security-modern-python/SKILL.md +333 -0
- package/skills/security-modern-python/hooks/hooks.json +16 -0
- package/skills/security-modern-python/hooks/intercept-legacy-python.bats +388 -0
- package/skills/security-modern-python/hooks/intercept-legacy-python.sh +109 -0
- package/skills/security-modern-python/hooks/test_helper.bash +75 -0
- package/skills/security-modern-python/skills/modern-python/SKILL.md +333 -0
- package/skills/security-modern-python/skills/modern-python/references/dependabot.md +43 -0
- package/skills/security-modern-python/skills/modern-python/references/migration-checklist.md +141 -0
- package/skills/security-modern-python/skills/modern-python/references/pep723-scripts.md +259 -0
- package/skills/security-modern-python/skills/modern-python/references/prek.md +211 -0
- package/skills/security-modern-python/skills/modern-python/references/pyproject.md +254 -0
- package/skills/security-modern-python/skills/modern-python/references/ruff-config.md +240 -0
- package/skills/security-modern-python/skills/modern-python/references/security-setup.md +255 -0
- package/skills/security-modern-python/skills/modern-python/references/testing.md +284 -0
- package/skills/security-modern-python/skills/modern-python/references/uv-commands.md +200 -0
- package/skills/security-modern-python/skills/modern-python/templates/dependabot.yml +36 -0
- package/skills/security-modern-python/skills/modern-python/templates/pre-commit-config.yaml +66 -0
- package/skills/security-property-based-testing/.claude-plugin/plugin.json +9 -0
- package/skills/security-property-based-testing/README.md +47 -0
- package/skills/security-property-based-testing/SKILL.md +109 -0
- package/skills/security-property-based-testing/skills/property-based-testing/README.md +88 -0
- package/skills/security-property-based-testing/skills/property-based-testing/SKILL.md +109 -0
- package/skills/security-property-based-testing/skills/property-based-testing/references/design.md +191 -0
- package/skills/security-property-based-testing/skills/property-based-testing/references/generating.md +200 -0
- package/skills/security-property-based-testing/skills/property-based-testing/references/libraries.md +130 -0
- package/skills/security-property-based-testing/skills/property-based-testing/references/refactoring.md +181 -0
- package/skills/security-property-based-testing/skills/property-based-testing/references/reviewing.md +209 -0
- package/skills/security-property-based-testing/skills/property-based-testing/references/strategies.md +124 -0
- package/skills/semgrep-rule-creator/.claude-plugin/plugin.json +8 -0
- package/skills/semgrep-rule-creator/README.md +43 -0
- package/skills/semgrep-rule-creator/SKILL.md +168 -0
- package/skills/semgrep-rule-creator/commands/semgrep-rule.md +26 -0
- package/skills/semgrep-rule-creator/skills/semgrep-rule-creator/SKILL.md +168 -0
- package/skills/semgrep-rule-creator/skills/semgrep-rule-creator/references/quick-reference.md +203 -0
- package/skills/semgrep-rule-creator/skills/semgrep-rule-creator/references/workflow.md +240 -0
- package/skills/session-logs/SKILL.md +115 -0
- package/skills/sharp-edges/.claude-plugin/plugin.json +10 -0
- package/skills/sharp-edges/README.md +48 -0
- package/skills/sharp-edges/SKILL.md +292 -0
- package/skills/sharp-edges/skills/sharp-edges/SKILL.md +292 -0
- package/skills/sharp-edges/skills/sharp-edges/references/auth-patterns.md +252 -0
- package/skills/sharp-edges/skills/sharp-edges/references/case-studies.md +274 -0
- package/skills/sharp-edges/skills/sharp-edges/references/config-patterns.md +333 -0
- package/skills/sharp-edges/skills/sharp-edges/references/crypto-apis.md +190 -0
- package/skills/sharp-edges/skills/sharp-edges/references/lang-c.md +205 -0
- package/skills/sharp-edges/skills/sharp-edges/references/lang-csharp.md +285 -0
- package/skills/sharp-edges/skills/sharp-edges/references/lang-go.md +270 -0
- package/skills/sharp-edges/skills/sharp-edges/references/lang-java.md +263 -0
- package/skills/sharp-edges/skills/sharp-edges/references/lang-javascript.md +269 -0
- package/skills/sharp-edges/skills/sharp-edges/references/lang-kotlin.md +265 -0
- package/skills/sharp-edges/skills/sharp-edges/references/lang-php.md +245 -0
- package/skills/sharp-edges/skills/sharp-edges/references/lang-python.md +274 -0
- package/skills/sharp-edges/skills/sharp-edges/references/lang-ruby.md +273 -0
- package/skills/sharp-edges/skills/sharp-edges/references/lang-rust.md +272 -0
- package/skills/sharp-edges/skills/sharp-edges/references/lang-swift.md +287 -0
- package/skills/sharp-edges/skills/sharp-edges/references/language-specific.md +588 -0
- package/skills/sherpa-onnx-tts/SKILL.md +103 -0
- package/skills/sherpa-onnx-tts/bin/sherpa-onnx-tts +178 -0
- package/skills/skill-creator/SKILL.md +370 -0
- package/skills/skill-creator/license.txt +202 -0
- package/skills/skill-creator/scripts/init_skill.py +378 -0
- package/skills/skill-creator/scripts/package_skill.py +111 -0
- package/skills/skill-creator/scripts/quick_validate.py +101 -0
- package/skills/slack/SKILL.md +144 -0
- package/skills/songsee/SKILL.md +49 -0
- package/skills/sonoscli/SKILL.md +46 -0
- package/skills/spec-to-code-compliance/.claude-plugin/plugin.json +10 -0
- package/skills/spec-to-code-compliance/README.md +67 -0
- package/skills/spec-to-code-compliance/SKILL.md +349 -0
- package/skills/spec-to-code-compliance/commands/spec-compliance.md +22 -0
- package/skills/spec-to-code-compliance/skills/spec-to-code-compliance/SKILL.md +349 -0
- package/skills/spec-to-code-compliance/skills/spec-to-code-compliance/resources/COMPLETENESS_CHECKLIST.md +69 -0
- package/skills/spec-to-code-compliance/skills/spec-to-code-compliance/resources/IR_EXAMPLES.md +417 -0
- package/skills/spec-to-code-compliance/skills/spec-to-code-compliance/resources/OUTPUT_REQUIREMENTS.md +105 -0
- package/skills/spotify-player/SKILL.md +64 -0
- package/skills/static-analysis/.claude-plugin/plugin.json +8 -0
- package/skills/static-analysis/README.md +59 -0
- package/skills/static-analysis/SKILL.md +91 -0
- package/skills/static-analysis/skills/codeql/SKILL.md +315 -0
- package/skills/static-analysis/skills/sarif-parsing/SKILL.md +479 -0
- package/skills/static-analysis/skills/sarif-parsing/resources/jq-queries.md +162 -0
- package/skills/static-analysis/skills/sarif-parsing/resources/sarif_helpers.py +331 -0
- package/skills/static-analysis/skills/semgrep/SKILL.md +337 -0
- package/skills/summarize/SKILL.md +87 -0
- package/skills/testing-handbook-skills/.claude-plugin/plugin.json +8 -0
- package/skills/testing-handbook-skills/README.md +241 -0
- package/skills/testing-handbook-skills/SKILL.md +104 -0
- package/skills/testing-handbook-skills/scripts/pyproject.toml +8 -0
- package/skills/testing-handbook-skills/scripts/validate-skills.py +657 -0
- package/skills/testing-handbook-skills/skills/address-sanitizer/SKILL.md +341 -0
- package/skills/testing-handbook-skills/skills/aflpp/SKILL.md +640 -0
- package/skills/testing-handbook-skills/skills/atheris/SKILL.md +515 -0
- package/skills/testing-handbook-skills/skills/cargo-fuzz/SKILL.md +454 -0
- package/skills/testing-handbook-skills/skills/codeql/SKILL.md +549 -0
- package/skills/testing-handbook-skills/skills/constant-time-testing/SKILL.md +507 -0
- package/skills/testing-handbook-skills/skills/coverage-analysis/SKILL.md +607 -0
- package/skills/testing-handbook-skills/skills/fuzzing-dictionary/SKILL.md +297 -0
- package/skills/testing-handbook-skills/skills/fuzzing-obstacles/SKILL.md +426 -0
- package/skills/testing-handbook-skills/skills/harness-writing/SKILL.md +614 -0
- package/skills/testing-handbook-skills/skills/libafl/SKILL.md +625 -0
- package/skills/testing-handbook-skills/skills/libfuzzer/SKILL.md +795 -0
- package/skills/testing-handbook-skills/skills/ossfuzz/SKILL.md +426 -0
- package/skills/testing-handbook-skills/skills/ruzzy/SKILL.md +443 -0
- package/skills/testing-handbook-skills/skills/semgrep/SKILL.md +601 -0
- package/skills/testing-handbook-skills/skills/testing-handbook-generator/SKILL.md +372 -0
- package/skills/testing-handbook-skills/skills/testing-handbook-generator/agent-prompt.md +280 -0
- package/skills/testing-handbook-skills/skills/testing-handbook-generator/discovery.md +452 -0
- package/skills/testing-handbook-skills/skills/testing-handbook-generator/templates/domain-skill.md +504 -0
- package/skills/testing-handbook-skills/skills/testing-handbook-generator/templates/fuzzer-skill.md +454 -0
- package/skills/testing-handbook-skills/skills/testing-handbook-generator/templates/technique-skill.md +527 -0
- package/skills/testing-handbook-skills/skills/testing-handbook-generator/templates/tool-skill.md +366 -0
- package/skills/testing-handbook-skills/skills/testing-handbook-generator/testing.md +482 -0
- package/skills/testing-handbook-skills/skills/wycheproof/SKILL.md +533 -0
- package/skills/things-mac/SKILL.md +86 -0
- package/skills/tmux/SKILL.md +135 -0
- package/skills/tmux/scripts/find-sessions.sh +112 -0
- package/skills/tmux/scripts/wait-for-text.sh +83 -0
- package/skills/trello/SKILL.md +95 -0
- package/skills/variant-analysis/.claude-plugin/plugin.json +8 -0
- package/skills/variant-analysis/README.md +41 -0
- package/skills/variant-analysis/SKILL.md +142 -0
- package/skills/variant-analysis/commands/variants.md +23 -0
- package/skills/variant-analysis/skills/variant-analysis/METHODOLOGY.md +327 -0
- package/skills/variant-analysis/skills/variant-analysis/SKILL.md +142 -0
- package/skills/variant-analysis/skills/variant-analysis/resources/codeql/cpp.ql +119 -0
- package/skills/variant-analysis/skills/variant-analysis/resources/codeql/go.ql +69 -0
- package/skills/variant-analysis/skills/variant-analysis/resources/codeql/java.ql +71 -0
- package/skills/variant-analysis/skills/variant-analysis/resources/codeql/javascript.ql +63 -0
- package/skills/variant-analysis/skills/variant-analysis/resources/codeql/python.ql +80 -0
- package/skills/variant-analysis/skills/variant-analysis/resources/semgrep/cpp.yaml +98 -0
- package/skills/variant-analysis/skills/variant-analysis/resources/semgrep/go.yaml +63 -0
- package/skills/variant-analysis/skills/variant-analysis/resources/semgrep/java.yaml +61 -0
- package/skills/variant-analysis/skills/variant-analysis/resources/semgrep/javascript.yaml +60 -0
- package/skills/variant-analysis/skills/variant-analysis/resources/semgrep/python.yaml +72 -0
- package/skills/variant-analysis/skills/variant-analysis/resources/variant-report-template.md +75 -0
- package/skills/video-frames/SKILL.md +46 -0
- package/skills/video-frames/scripts/frame.sh +81 -0
- package/skills/voice-call/SKILL.md +45 -0
- package/skills/wacli/SKILL.md +72 -0
- package/skills/weather/SKILL.md +54 -0
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: tmux
|
|
3
|
+
description: Remote-control tmux sessions for interactive CLIs by sending keystrokes and scraping pane output.
|
|
4
|
+
metadata:
|
|
5
|
+
{ "otto": { "emoji": "🧵", "os": ["darwin", "linux"], "requires": { "bins": ["tmux"] } } }
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# tmux Skill (Otto)
|
|
9
|
+
|
|
10
|
+
Use tmux only when you need an interactive TTY. Prefer exec background mode for long-running, non-interactive tasks.
|
|
11
|
+
|
|
12
|
+
## Quickstart (isolated socket, exec tool)
|
|
13
|
+
|
|
14
|
+
```bash
|
|
15
|
+
SOCKET_DIR="${OTTO_TMUX_SOCKET_DIR:-${TMPDIR:-/tmp}/otto-tmux-sockets}"
|
|
16
|
+
mkdir -p "$SOCKET_DIR"
|
|
17
|
+
SOCKET="$SOCKET_DIR/otto.sock"
|
|
18
|
+
SESSION=otto-python
|
|
19
|
+
|
|
20
|
+
tmux -S "$SOCKET" new -d -s "$SESSION" -n shell
|
|
21
|
+
tmux -S "$SOCKET" send-keys -t "$SESSION":0.0 -- 'PYTHON_BASIC_REPL=1 python3 -q' Enter
|
|
22
|
+
tmux -S "$SOCKET" capture-pane -p -J -t "$SESSION":0.0 -S -200
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
After starting a session, always print monitor commands:
|
|
26
|
+
|
|
27
|
+
```
|
|
28
|
+
To monitor:
|
|
29
|
+
tmux -S "$SOCKET" attach -t "$SESSION"
|
|
30
|
+
tmux -S "$SOCKET" capture-pane -p -J -t "$SESSION":0.0 -S -200
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
## Socket convention
|
|
34
|
+
|
|
35
|
+
- Use `OTTO_TMUX_SOCKET_DIR`.
|
|
36
|
+
- Default socket path: `"$OTTO_TMUX_SOCKET_DIR/otto.sock"`.
|
|
37
|
+
|
|
38
|
+
## Targeting panes and naming
|
|
39
|
+
|
|
40
|
+
- Target format: `session:window.pane` (defaults to `:0.0`).
|
|
41
|
+
- Keep names short; avoid spaces.
|
|
42
|
+
- Inspect: `tmux -S "$SOCKET" list-sessions`, `tmux -S "$SOCKET" list-panes -a`.
|
|
43
|
+
|
|
44
|
+
## Finding sessions
|
|
45
|
+
|
|
46
|
+
- List sessions on your socket: `{baseDir}/scripts/find-sessions.sh -S "$SOCKET"`.
|
|
47
|
+
- Scan all sockets: `{baseDir}/scripts/find-sessions.sh --all` (uses `OTTO_TMUX_SOCKET_DIR`).
|
|
48
|
+
|
|
49
|
+
## Sending input safely
|
|
50
|
+
|
|
51
|
+
- Prefer literal sends: `tmux -S "$SOCKET" send-keys -t target -l -- "$cmd"`.
|
|
52
|
+
- Control keys: `tmux -S "$SOCKET" send-keys -t target C-c`.
|
|
53
|
+
- For interactive TUI apps like Claude Code/Codex, this guidance covers **how to send commands**.
|
|
54
|
+
Do **not** append `Enter` in the same `send-keys`. These apps may treat a fast text+Enter
|
|
55
|
+
sequence as paste/multi-line input and not submit; this is timing-dependent. Send text and
|
|
56
|
+
`Enter` as separate commands with a small delay (tune per environment; increase if needed,
|
|
57
|
+
or use `sleep 1` if sub-second sleeps aren't supported):
|
|
58
|
+
|
|
59
|
+
```bash
|
|
60
|
+
tmux -S "$SOCKET" send-keys -t target -l -- "$cmd" && sleep 0.1 && tmux -S "$SOCKET" send-keys -t target Enter
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
## Watching output
|
|
64
|
+
|
|
65
|
+
- Capture recent history: `tmux -S "$SOCKET" capture-pane -p -J -t target -S -200`.
|
|
66
|
+
- Wait for prompts: `{baseDir}/scripts/wait-for-text.sh -t session:0.0 -p 'pattern'`.
|
|
67
|
+
- Attaching is OK; detach with `Ctrl+b d`.
|
|
68
|
+
|
|
69
|
+
## Spawning processes
|
|
70
|
+
|
|
71
|
+
- For python REPLs, set `PYTHON_BASIC_REPL=1` (non-basic REPL breaks send-keys flows).
|
|
72
|
+
|
|
73
|
+
## Windows / WSL
|
|
74
|
+
|
|
75
|
+
- tmux is supported on macOS/Linux. On Windows, use WSL and install tmux inside WSL.
|
|
76
|
+
- This skill is gated to `darwin`/`linux` and requires `tmux` on PATH.
|
|
77
|
+
|
|
78
|
+
## Orchestrating Coding Agents (Codex, Claude Code)
|
|
79
|
+
|
|
80
|
+
tmux excels at running multiple coding agents in parallel:
|
|
81
|
+
|
|
82
|
+
```bash
|
|
83
|
+
SOCKET="${TMPDIR:-/tmp}/codex-army.sock"
|
|
84
|
+
|
|
85
|
+
# Create multiple sessions
|
|
86
|
+
for i in 1 2 3 4 5; do
|
|
87
|
+
tmux -S "$SOCKET" new-session -d -s "agent-$i"
|
|
88
|
+
done
|
|
89
|
+
|
|
90
|
+
# Launch agents in different workdirs
|
|
91
|
+
tmux -S "$SOCKET" send-keys -t agent-1 "cd /tmp/project1 && codex --yolo 'Fix bug X'" Enter
|
|
92
|
+
tmux -S "$SOCKET" send-keys -t agent-2 "cd /tmp/project2 && codex --yolo 'Fix bug Y'" Enter
|
|
93
|
+
|
|
94
|
+
# When sending prompts to Claude Code/Codex TUI, split text + Enter with a delay
|
|
95
|
+
tmux -S "$SOCKET" send-keys -t agent-1 -l -- "Please make a small edit to README.md." && sleep 0.1 && tmux -S "$SOCKET" send-keys -t agent-1 Enter
|
|
96
|
+
|
|
97
|
+
# Poll for completion (check if prompt returned)
|
|
98
|
+
for sess in agent-1 agent-2; do
|
|
99
|
+
if tmux -S "$SOCKET" capture-pane -p -t "$sess" -S -3 | grep -q "❯"; then
|
|
100
|
+
echo "$sess: DONE"
|
|
101
|
+
else
|
|
102
|
+
echo "$sess: Running..."
|
|
103
|
+
fi
|
|
104
|
+
done
|
|
105
|
+
|
|
106
|
+
# Get full output from completed session
|
|
107
|
+
tmux -S "$SOCKET" capture-pane -p -t agent-1 -S -500
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
**Tips:**
|
|
111
|
+
|
|
112
|
+
- Use separate git worktrees for parallel fixes (no branch conflicts)
|
|
113
|
+
- `pnpm install` first before running codex in fresh clones
|
|
114
|
+
- Check for shell prompt (`❯` or `$`) to detect completion
|
|
115
|
+
- Codex needs `--yolo` or `--full-auto` for non-interactive fixes
|
|
116
|
+
|
|
117
|
+
## Cleanup
|
|
118
|
+
|
|
119
|
+
- Kill a session: `tmux -S "$SOCKET" kill-session -t "$SESSION"`.
|
|
120
|
+
- Kill all sessions on a socket: `tmux -S "$SOCKET" list-sessions -F '#{session_name}' | xargs -r -n1 tmux -S "$SOCKET" kill-session -t`.
|
|
121
|
+
- Remove everything on the private socket: `tmux -S "$SOCKET" kill-server`.
|
|
122
|
+
|
|
123
|
+
## Helper: wait-for-text.sh
|
|
124
|
+
|
|
125
|
+
`{baseDir}/scripts/wait-for-text.sh` polls a pane for a regex (or fixed string) with a timeout.
|
|
126
|
+
|
|
127
|
+
```bash
|
|
128
|
+
{baseDir}/scripts/wait-for-text.sh -t session:0.0 -p 'pattern' [-F] [-T 20] [-i 0.5] [-l 2000]
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
- `-t`/`--target` pane target (required)
|
|
132
|
+
- `-p`/`--pattern` regex to match (required); add `-F` for fixed string
|
|
133
|
+
- `-T` timeout seconds (integer, default 15)
|
|
134
|
+
- `-i` poll interval seconds (default 0.5)
|
|
135
|
+
- `-l` history lines to search (integer, default 1000)
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
set -euo pipefail
|
|
3
|
+
|
|
4
|
+
usage() {
|
|
5
|
+
cat <<'USAGE'
|
|
6
|
+
Usage: find-sessions.sh [-L socket-name|-S socket-path|-A] [-q pattern]
|
|
7
|
+
|
|
8
|
+
List tmux sessions on a socket (default tmux socket if none provided).
|
|
9
|
+
|
|
10
|
+
Options:
|
|
11
|
+
-L, --socket tmux socket name (passed to tmux -L)
|
|
12
|
+
-S, --socket-path tmux socket path (passed to tmux -S)
|
|
13
|
+
-A, --all scan all sockets under OTTO_TMUX_SOCKET_DIR
|
|
14
|
+
-q, --query case-insensitive substring to filter session names
|
|
15
|
+
-h, --help show this help
|
|
16
|
+
USAGE
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
socket_name=""
|
|
20
|
+
socket_path=""
|
|
21
|
+
query=""
|
|
22
|
+
scan_all=false
|
|
23
|
+
socket_dir="${OTTO_TMUX_SOCKET_DIR:-${TMPDIR:-/tmp}/otto-tmux-sockets}"
|
|
24
|
+
|
|
25
|
+
while [[ $# -gt 0 ]]; do
|
|
26
|
+
case "$1" in
|
|
27
|
+
-L|--socket) socket_name="${2-}"; shift 2 ;;
|
|
28
|
+
-S|--socket-path) socket_path="${2-}"; shift 2 ;;
|
|
29
|
+
-A|--all) scan_all=true; shift ;;
|
|
30
|
+
-q|--query) query="${2-}"; shift 2 ;;
|
|
31
|
+
-h|--help) usage; exit 0 ;;
|
|
32
|
+
*) echo "Unknown option: $1" >&2; usage; exit 1 ;;
|
|
33
|
+
esac
|
|
34
|
+
done
|
|
35
|
+
|
|
36
|
+
if [[ "$scan_all" == true && ( -n "$socket_name" || -n "$socket_path" ) ]]; then
|
|
37
|
+
echo "Cannot combine --all with -L or -S" >&2
|
|
38
|
+
exit 1
|
|
39
|
+
fi
|
|
40
|
+
|
|
41
|
+
if [[ -n "$socket_name" && -n "$socket_path" ]]; then
|
|
42
|
+
echo "Use either -L or -S, not both" >&2
|
|
43
|
+
exit 1
|
|
44
|
+
fi
|
|
45
|
+
|
|
46
|
+
if ! command -v tmux >/dev/null 2>&1; then
|
|
47
|
+
echo "tmux not found in PATH" >&2
|
|
48
|
+
exit 1
|
|
49
|
+
fi
|
|
50
|
+
|
|
51
|
+
list_sessions() {
|
|
52
|
+
local label="$1"; shift
|
|
53
|
+
local tmux_cmd=(tmux "$@")
|
|
54
|
+
|
|
55
|
+
if ! sessions="$("${tmux_cmd[@]}" list-sessions -F '#{session_name}\t#{session_attached}\t#{session_created_string}' 2>/dev/null)"; then
|
|
56
|
+
echo "No tmux server found on $label" >&2
|
|
57
|
+
return 1
|
|
58
|
+
fi
|
|
59
|
+
|
|
60
|
+
if [[ -n "$query" ]]; then
|
|
61
|
+
sessions="$(printf '%s\n' "$sessions" | grep -i -- "$query" || true)"
|
|
62
|
+
fi
|
|
63
|
+
|
|
64
|
+
if [[ -z "$sessions" ]]; then
|
|
65
|
+
echo "No sessions found on $label"
|
|
66
|
+
return 0
|
|
67
|
+
fi
|
|
68
|
+
|
|
69
|
+
echo "Sessions on $label:"
|
|
70
|
+
printf '%s\n' "$sessions" | while IFS=$'\t' read -r name attached created; do
|
|
71
|
+
attached_label=$([[ "$attached" == "1" ]] && echo "attached" || echo "detached")
|
|
72
|
+
printf ' - %s (%s, started %s)\n' "$name" "$attached_label" "$created"
|
|
73
|
+
done
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
if [[ "$scan_all" == true ]]; then
|
|
77
|
+
if [[ ! -d "$socket_dir" ]]; then
|
|
78
|
+
echo "Socket directory not found: $socket_dir" >&2
|
|
79
|
+
exit 1
|
|
80
|
+
fi
|
|
81
|
+
|
|
82
|
+
shopt -s nullglob
|
|
83
|
+
sockets=("$socket_dir"/*)
|
|
84
|
+
shopt -u nullglob
|
|
85
|
+
|
|
86
|
+
if [[ "${#sockets[@]}" -eq 0 ]]; then
|
|
87
|
+
echo "No sockets found under $socket_dir" >&2
|
|
88
|
+
exit 1
|
|
89
|
+
fi
|
|
90
|
+
|
|
91
|
+
exit_code=0
|
|
92
|
+
for sock in "${sockets[@]}"; do
|
|
93
|
+
if [[ ! -S "$sock" ]]; then
|
|
94
|
+
continue
|
|
95
|
+
fi
|
|
96
|
+
list_sessions "socket path '$sock'" -S "$sock" || exit_code=$?
|
|
97
|
+
done
|
|
98
|
+
exit "$exit_code"
|
|
99
|
+
fi
|
|
100
|
+
|
|
101
|
+
tmux_cmd=(tmux)
|
|
102
|
+
socket_label="default socket"
|
|
103
|
+
|
|
104
|
+
if [[ -n "$socket_name" ]]; then
|
|
105
|
+
tmux_cmd+=(-L "$socket_name")
|
|
106
|
+
socket_label="socket name '$socket_name'"
|
|
107
|
+
elif [[ -n "$socket_path" ]]; then
|
|
108
|
+
tmux_cmd+=(-S "$socket_path")
|
|
109
|
+
socket_label="socket path '$socket_path'"
|
|
110
|
+
fi
|
|
111
|
+
|
|
112
|
+
list_sessions "$socket_label" "${tmux_cmd[@]:1}"
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
set -euo pipefail
|
|
3
|
+
|
|
4
|
+
usage() {
|
|
5
|
+
cat <<'USAGE'
|
|
6
|
+
Usage: wait-for-text.sh -t target -p pattern [options]
|
|
7
|
+
|
|
8
|
+
Poll a tmux pane for text and exit when found.
|
|
9
|
+
|
|
10
|
+
Options:
|
|
11
|
+
-t, --target tmux target (session:window.pane), required
|
|
12
|
+
-p, --pattern regex pattern to look for, required
|
|
13
|
+
-F, --fixed treat pattern as a fixed string (grep -F)
|
|
14
|
+
-T, --timeout seconds to wait (integer, default: 15)
|
|
15
|
+
-i, --interval poll interval in seconds (default: 0.5)
|
|
16
|
+
-l, --lines number of history lines to inspect (integer, default: 1000)
|
|
17
|
+
-h, --help show this help
|
|
18
|
+
USAGE
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
target=""
|
|
22
|
+
pattern=""
|
|
23
|
+
grep_flag="-E"
|
|
24
|
+
timeout=15
|
|
25
|
+
interval=0.5
|
|
26
|
+
lines=1000
|
|
27
|
+
|
|
28
|
+
while [[ $# -gt 0 ]]; do
|
|
29
|
+
case "$1" in
|
|
30
|
+
-t|--target) target="${2-}"; shift 2 ;;
|
|
31
|
+
-p|--pattern) pattern="${2-}"; shift 2 ;;
|
|
32
|
+
-F|--fixed) grep_flag="-F"; shift ;;
|
|
33
|
+
-T|--timeout) timeout="${2-}"; shift 2 ;;
|
|
34
|
+
-i|--interval) interval="${2-}"; shift 2 ;;
|
|
35
|
+
-l|--lines) lines="${2-}"; shift 2 ;;
|
|
36
|
+
-h|--help) usage; exit 0 ;;
|
|
37
|
+
*) echo "Unknown option: $1" >&2; usage; exit 1 ;;
|
|
38
|
+
esac
|
|
39
|
+
done
|
|
40
|
+
|
|
41
|
+
if [[ -z "$target" || -z "$pattern" ]]; then
|
|
42
|
+
echo "target and pattern are required" >&2
|
|
43
|
+
usage
|
|
44
|
+
exit 1
|
|
45
|
+
fi
|
|
46
|
+
|
|
47
|
+
if ! [[ "$timeout" =~ ^[0-9]+$ ]]; then
|
|
48
|
+
echo "timeout must be an integer number of seconds" >&2
|
|
49
|
+
exit 1
|
|
50
|
+
fi
|
|
51
|
+
|
|
52
|
+
if ! [[ "$lines" =~ ^[0-9]+$ ]]; then
|
|
53
|
+
echo "lines must be an integer" >&2
|
|
54
|
+
exit 1
|
|
55
|
+
fi
|
|
56
|
+
|
|
57
|
+
if ! command -v tmux >/dev/null 2>&1; then
|
|
58
|
+
echo "tmux not found in PATH" >&2
|
|
59
|
+
exit 1
|
|
60
|
+
fi
|
|
61
|
+
|
|
62
|
+
# End time in epoch seconds (integer, good enough for polling)
|
|
63
|
+
start_epoch=$(date +%s)
|
|
64
|
+
deadline=$((start_epoch + timeout))
|
|
65
|
+
|
|
66
|
+
while true; do
|
|
67
|
+
# -J joins wrapped lines, -S uses negative index to read last N lines
|
|
68
|
+
pane_text="$(tmux capture-pane -p -J -t "$target" -S "-${lines}" 2>/dev/null || true)"
|
|
69
|
+
|
|
70
|
+
if printf '%s\n' "$pane_text" | grep $grep_flag -- "$pattern" >/dev/null 2>&1; then
|
|
71
|
+
exit 0
|
|
72
|
+
fi
|
|
73
|
+
|
|
74
|
+
now=$(date +%s)
|
|
75
|
+
if (( now >= deadline )); then
|
|
76
|
+
echo "Timed out after ${timeout}s waiting for pattern: $pattern" >&2
|
|
77
|
+
echo "Last ${lines} lines from $target:" >&2
|
|
78
|
+
printf '%s\n' "$pane_text" >&2
|
|
79
|
+
exit 1
|
|
80
|
+
fi
|
|
81
|
+
|
|
82
|
+
sleep "$interval"
|
|
83
|
+
done
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: trello
|
|
3
|
+
description: Manage Trello boards, lists, and cards via the Trello REST API.
|
|
4
|
+
homepage: https://developer.atlassian.com/cloud/trello/rest/
|
|
5
|
+
metadata:
|
|
6
|
+
{
|
|
7
|
+
"otto":
|
|
8
|
+
{ "emoji": "📋", "requires": { "bins": ["jq"], "env": ["TRELLO_API_KEY", "TRELLO_TOKEN"] } },
|
|
9
|
+
}
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
# Trello Skill
|
|
13
|
+
|
|
14
|
+
Manage Trello boards, lists, and cards directly from Otto.
|
|
15
|
+
|
|
16
|
+
## Setup
|
|
17
|
+
|
|
18
|
+
1. Get your API key: https://trello.com/app-key
|
|
19
|
+
2. Generate a token (click "Token" link on that page)
|
|
20
|
+
3. Set environment variables:
|
|
21
|
+
```bash
|
|
22
|
+
export TRELLO_API_KEY="your-api-key"
|
|
23
|
+
export TRELLO_TOKEN="your-token"
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
## Usage
|
|
27
|
+
|
|
28
|
+
All commands use curl to hit the Trello REST API.
|
|
29
|
+
|
|
30
|
+
### List boards
|
|
31
|
+
|
|
32
|
+
```bash
|
|
33
|
+
curl -s "https://api.trello.com/1/members/me/boards?key=$TRELLO_API_KEY&token=$TRELLO_TOKEN" | jq '.[] | {name, id}'
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
### List lists in a board
|
|
37
|
+
|
|
38
|
+
```bash
|
|
39
|
+
curl -s "https://api.trello.com/1/boards/{boardId}/lists?key=$TRELLO_API_KEY&token=$TRELLO_TOKEN" | jq '.[] | {name, id}'
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
### List cards in a list
|
|
43
|
+
|
|
44
|
+
```bash
|
|
45
|
+
curl -s "https://api.trello.com/1/lists/{listId}/cards?key=$TRELLO_API_KEY&token=$TRELLO_TOKEN" | jq '.[] | {name, id, desc}'
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
### Create a card
|
|
49
|
+
|
|
50
|
+
```bash
|
|
51
|
+
curl -s -X POST "https://api.trello.com/1/cards?key=$TRELLO_API_KEY&token=$TRELLO_TOKEN" \
|
|
52
|
+
-d "idList={listId}" \
|
|
53
|
+
-d "name=Card Title" \
|
|
54
|
+
-d "desc=Card description"
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
### Move a card to another list
|
|
58
|
+
|
|
59
|
+
```bash
|
|
60
|
+
curl -s -X PUT "https://api.trello.com/1/cards/{cardId}?key=$TRELLO_API_KEY&token=$TRELLO_TOKEN" \
|
|
61
|
+
-d "idList={newListId}"
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
### Add a comment to a card
|
|
65
|
+
|
|
66
|
+
```bash
|
|
67
|
+
curl -s -X POST "https://api.trello.com/1/cards/{cardId}/actions/comments?key=$TRELLO_API_KEY&token=$TRELLO_TOKEN" \
|
|
68
|
+
-d "text=Your comment here"
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
### Archive a card
|
|
72
|
+
|
|
73
|
+
```bash
|
|
74
|
+
curl -s -X PUT "https://api.trello.com/1/cards/{cardId}?key=$TRELLO_API_KEY&token=$TRELLO_TOKEN" \
|
|
75
|
+
-d "closed=true"
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
## Notes
|
|
79
|
+
|
|
80
|
+
- Board/List/Card IDs can be found in the Trello URL or via the list commands
|
|
81
|
+
- The API key and token provide full access to your Trello account - keep them secret!
|
|
82
|
+
- Rate limits: 300 requests per 10 seconds per API key; 100 requests per 10 seconds per token; `/1/members` endpoints are limited to 100 requests per 900 seconds
|
|
83
|
+
|
|
84
|
+
## Examples
|
|
85
|
+
|
|
86
|
+
```bash
|
|
87
|
+
# Get all boards
|
|
88
|
+
curl -s "https://api.trello.com/1/members/me/boards?key=$TRELLO_API_KEY&token=$TRELLO_TOKEN&fields=name,id" | jq
|
|
89
|
+
|
|
90
|
+
# Find a specific board by name
|
|
91
|
+
curl -s "https://api.trello.com/1/members/me/boards?key=$TRELLO_API_KEY&token=$TRELLO_TOKEN" | jq '.[] | select(.name | contains("Work"))'
|
|
92
|
+
|
|
93
|
+
# Get all cards on a board
|
|
94
|
+
curl -s "https://api.trello.com/1/boards/{boardId}/cards?key=$TRELLO_API_KEY&token=$TRELLO_TOKEN" | jq '.[] | {name, list: .idList}'
|
|
95
|
+
```
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
# Variant Analysis
|
|
2
|
+
|
|
3
|
+
Find similar vulnerabilities and bugs across codebases using pattern-based analysis.
|
|
4
|
+
|
|
5
|
+
**Author:** Axel Mierczuk
|
|
6
|
+
|
|
7
|
+
## When to Use
|
|
8
|
+
|
|
9
|
+
Use this skill when you need to:
|
|
10
|
+
- Hunt for bug variants after finding an initial vulnerability
|
|
11
|
+
- Build CodeQL or Semgrep queries from a known bug pattern
|
|
12
|
+
- Perform systematic code audits across large codebases
|
|
13
|
+
- Analyze security vulnerabilities and find similar instances
|
|
14
|
+
- Create reusable patterns for recurring vulnerability classes
|
|
15
|
+
|
|
16
|
+
## What It Does
|
|
17
|
+
|
|
18
|
+
This skill provides a systematic five-step process for variant analysis:
|
|
19
|
+
1. **Understand the original issue** - Identify root cause, conditions, and exploitability
|
|
20
|
+
2. **Create an exact match** - Start with a pattern matching only the known bug
|
|
21
|
+
3. **Identify abstraction points** - Determine what can be generalized
|
|
22
|
+
4. **Iteratively generalize** - Expand patterns one element at a time
|
|
23
|
+
5. **Analyze and triage** - Document and prioritize findings
|
|
24
|
+
|
|
25
|
+
Includes:
|
|
26
|
+
- Tool selection guidance (ripgrep, Semgrep, CodeQL)
|
|
27
|
+
- Critical pitfalls to avoid (narrow scope, over-specific patterns)
|
|
28
|
+
- Ready-to-use templates for CodeQL and Semgrep in Python, JavaScript, Java, Go, and C++
|
|
29
|
+
- Detailed methodology documentation
|
|
30
|
+
|
|
31
|
+
## Installation
|
|
32
|
+
|
|
33
|
+
```
|
|
34
|
+
/plugin install trailofbits/skills/plugins/variant-analysis
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
## Related Skills
|
|
38
|
+
|
|
39
|
+
- `codeql` - Primary tool for deep interprocedural variant analysis
|
|
40
|
+
- `semgrep` - Fast pattern matching for simpler variants
|
|
41
|
+
- `sarif-parsing` - Process variant analysis results
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: variant-analysis
|
|
3
|
+
description: Find similar vulnerabilities and bugs across codebases using pattern-based analysis. Use when hunting bug variants, building CodeQL/Semgrep queries, analyzing security vulnerabilities, or performing systematic code audits after finding an initial issue.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Variant Analysis
|
|
7
|
+
|
|
8
|
+
You are a variant analysis expert. Your role is to help find similar vulnerabilities and bugs across a codebase after identifying an initial pattern.
|
|
9
|
+
|
|
10
|
+
## When to Use
|
|
11
|
+
|
|
12
|
+
Use this skill when:
|
|
13
|
+
- A vulnerability has been found and you need to search for similar instances
|
|
14
|
+
- Building or refining CodeQL/Semgrep queries for security patterns
|
|
15
|
+
- Performing systematic code audits after an initial issue discovery
|
|
16
|
+
- Hunting for bug variants across a codebase
|
|
17
|
+
- Analyzing how a single root cause manifests in different code paths
|
|
18
|
+
|
|
19
|
+
## When NOT to Use
|
|
20
|
+
|
|
21
|
+
Do NOT use this skill for:
|
|
22
|
+
- Initial vulnerability discovery (use audit-context-building or domain-specific audits instead)
|
|
23
|
+
- General code review without a known pattern to search for
|
|
24
|
+
- Writing fix recommendations (use issue-writer instead)
|
|
25
|
+
- Understanding unfamiliar code (use audit-context-building for deep comprehension first)
|
|
26
|
+
|
|
27
|
+
## The Five-Step Process
|
|
28
|
+
|
|
29
|
+
### Step 1: Understand the Original Issue
|
|
30
|
+
|
|
31
|
+
Before searching, deeply understand the known bug:
|
|
32
|
+
- **What is the root cause?** Not the symptom, but WHY it's vulnerable
|
|
33
|
+
- **What conditions are required?** Control flow, data flow, state
|
|
34
|
+
- **What makes it exploitable?** User control, missing validation, etc.
|
|
35
|
+
|
|
36
|
+
### Step 2: Create an Exact Match
|
|
37
|
+
|
|
38
|
+
Start with a pattern that matches ONLY the known instance:
|
|
39
|
+
```bash
|
|
40
|
+
rg -n "exact_vulnerable_code_here"
|
|
41
|
+
```
|
|
42
|
+
Verify: Does it match exactly ONE location (the original)?
|
|
43
|
+
|
|
44
|
+
### Step 3: Identify Abstraction Points
|
|
45
|
+
|
|
46
|
+
| Element | Keep Specific | Can Abstract |
|
|
47
|
+
|---------|---------------|--------------|
|
|
48
|
+
| Function name | If unique to bug | If pattern applies to family |
|
|
49
|
+
| Variable names | Never | Always use metavariables |
|
|
50
|
+
| Literal values | If value matters | If any value triggers bug |
|
|
51
|
+
| Arguments | If position matters | Use `...` wildcards |
|
|
52
|
+
|
|
53
|
+
### Step 4: Iteratively Generalize
|
|
54
|
+
|
|
55
|
+
**Change ONE element at a time:**
|
|
56
|
+
1. Run the pattern
|
|
57
|
+
2. Review ALL new matches
|
|
58
|
+
3. Classify: true positive or false positive?
|
|
59
|
+
4. If FP rate acceptable, generalize next element
|
|
60
|
+
5. If FP rate too high, revert and try different abstraction
|
|
61
|
+
|
|
62
|
+
**Stop when false positive rate exceeds ~50%**
|
|
63
|
+
|
|
64
|
+
### Step 5: Analyze and Triage Results
|
|
65
|
+
|
|
66
|
+
For each match, document:
|
|
67
|
+
- **Location**: File, line, function
|
|
68
|
+
- **Confidence**: High/Medium/Low
|
|
69
|
+
- **Exploitability**: Reachable? Controllable inputs?
|
|
70
|
+
- **Priority**: Based on impact and exploitability
|
|
71
|
+
|
|
72
|
+
For deeper strategic guidance, see [METHODOLOGY.md](skills/variant-analysis/METHODOLOGY.md).
|
|
73
|
+
|
|
74
|
+
## Tool Selection
|
|
75
|
+
|
|
76
|
+
| Scenario | Tool | Why |
|
|
77
|
+
|----------|------|-----|
|
|
78
|
+
| Quick surface search | ripgrep | Fast, zero setup |
|
|
79
|
+
| Simple pattern matching | Semgrep | Easy syntax, no build needed |
|
|
80
|
+
| Data flow tracking | Semgrep taint / CodeQL | Follows values across functions |
|
|
81
|
+
| Cross-function analysis | CodeQL | Best interprocedural analysis |
|
|
82
|
+
| Non-building code | Semgrep | Works on incomplete code |
|
|
83
|
+
|
|
84
|
+
## Key Principles
|
|
85
|
+
|
|
86
|
+
1. **Root cause first**: Understand WHY before searching for WHERE
|
|
87
|
+
2. **Start specific**: First pattern should match exactly the known bug
|
|
88
|
+
3. **One change at a time**: Generalize incrementally, verify after each change
|
|
89
|
+
4. **Know when to stop**: 50%+ FP rate means you've gone too generic
|
|
90
|
+
5. **Search everywhere**: Always search the ENTIRE codebase, not just the module where the bug was found
|
|
91
|
+
6. **Expand vulnerability classes**: One root cause often has multiple manifestations
|
|
92
|
+
|
|
93
|
+
## Critical Pitfalls to Avoid
|
|
94
|
+
|
|
95
|
+
These common mistakes cause analysts to miss real vulnerabilities:
|
|
96
|
+
|
|
97
|
+
### 1. Narrow Search Scope
|
|
98
|
+
|
|
99
|
+
Searching only the module where the original bug was found misses variants in other locations.
|
|
100
|
+
|
|
101
|
+
**Example:** Bug found in `api/handlers/` → only searching that directory → missing variant in `utils/auth.py`
|
|
102
|
+
|
|
103
|
+
**Mitigation:** Always run searches against the entire codebase root directory.
|
|
104
|
+
|
|
105
|
+
### 2. Pattern Too Specific
|
|
106
|
+
|
|
107
|
+
Using only the exact attribute/function from the original bug misses variants using related constructs.
|
|
108
|
+
|
|
109
|
+
**Example:** Bug uses `isAuthenticated` check → only searching for that exact term → missing bugs using related properties like `isActive`, `isAdmin`, `isVerified`
|
|
110
|
+
|
|
111
|
+
**Mitigation:** Enumerate ALL semantically related attributes/functions for the bug class.
|
|
112
|
+
|
|
113
|
+
### 3. Single Vulnerability Class
|
|
114
|
+
|
|
115
|
+
Focusing on only one manifestation of the root cause misses other ways the same logic error appears.
|
|
116
|
+
|
|
117
|
+
**Example:** Original bug is "return allow when condition is false" → only searching that pattern → missing:
|
|
118
|
+
- Null equality bypasses (`null == null` evaluates to true)
|
|
119
|
+
- Documentation/code mismatches (function does opposite of what docs claim)
|
|
120
|
+
- Inverted conditional logic (wrong branch taken)
|
|
121
|
+
|
|
122
|
+
**Mitigation:** List all possible manifestations of the root cause before searching.
|
|
123
|
+
|
|
124
|
+
### 4. Missing Edge Cases
|
|
125
|
+
|
|
126
|
+
Testing patterns only with "normal" scenarios misses vulnerabilities triggered by edge cases.
|
|
127
|
+
|
|
128
|
+
**Example:** Testing auth checks only with valid users → missing bypass when `userId = null` matches `resourceOwnerId = null`
|
|
129
|
+
|
|
130
|
+
**Mitigation:** Test with: unauthenticated users, null/undefined values, empty collections, and boundary conditions.
|
|
131
|
+
|
|
132
|
+
## Resources
|
|
133
|
+
|
|
134
|
+
Ready-to-use templates in `resources/`:
|
|
135
|
+
|
|
136
|
+
**CodeQL** (`resources/codeql/`):
|
|
137
|
+
- `python.ql`, `javascript.ql`, `java.ql`, `go.ql`, `cpp.ql`
|
|
138
|
+
|
|
139
|
+
**Semgrep** (`resources/semgrep/`):
|
|
140
|
+
- `python.yaml`, `javascript.yaml`, `java.yaml`, `go.yaml`, `cpp.yaml`
|
|
141
|
+
|
|
142
|
+
**Report**: `resources/variant-report-template.md`
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: trailofbits:variants
|
|
3
|
+
description: Finds similar vulnerabilities using pattern-based analysis
|
|
4
|
+
argument-hint: "(uses conversation context for bug pattern)"
|
|
5
|
+
allowed-tools:
|
|
6
|
+
- Read
|
|
7
|
+
- Grep
|
|
8
|
+
- Glob
|
|
9
|
+
- Bash
|
|
10
|
+
- Task
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
# Find Vulnerability Variants
|
|
14
|
+
|
|
15
|
+
**Arguments:** $ARGUMENTS
|
|
16
|
+
|
|
17
|
+
This command is context-driven. Use conversation context to understand:
|
|
18
|
+
1. The original bug/vulnerability that was found
|
|
19
|
+
2. The codebase to search
|
|
20
|
+
|
|
21
|
+
If context is unclear, ask for a description of the original vulnerability.
|
|
22
|
+
|
|
23
|
+
Invoke the `variant-analysis` skill for the full workflow.
|