9 Commits

Author SHA1 Message Date
William Tan f09e5c729a Remove legacy codex compatiblity scripts/shims. (#173)
* Remove legacy codex compatiblity scripts/shims.

Codex supports claude plugins so this shouldn't be necessary.
Add a script to test the plugin loadablility in both claude and codex

* fix: resolve code review findings for PR #173

Review findings addressed (4 reviewers: pr-review-toolkit agents,
Codex gpt-5.3-codex, direct diff review):

P2 fixed:
- Bump versions for the 5 substantively changed plugins in both
  plugin.json and marketplace.json (gh-cli 1.5.0 new skill,
  claude-in-chrome-troubleshooting 1.1.0 skill rename,
  modern-python 1.5.1 / skill-improver 1.0.3 hooks change,
  zeroize-audit 0.1.1 MCP config relocation) so clients pick up
  the changes
- README Codex install: replace unpasteable /plugins slash-command
  block with verified CLI syntax (codex plugin marketplace add)
- check_claude_loadability: parse_json_output now fails fast with
  command context on empty CLI output instead of returning None
- check_codex_loadability: surface skipped RPC error messages in
  timeout failures instead of a bare TimeoutError

P3 fixed:
- Both checkers: error out when marketplace.json lists no plugins
  instead of passing vacuously

Dismissed:
- @latest CLI installs in validate.yml: deliberate; the check
  validates against the clients users actually run
- select.select portability: CI-only script on ubuntu-latest
- Divergent mcpServers validation between checkers: intentional;
  the Codex checker enforces the repo's .mcp.json convention

Verified: ruff, prek, validate_plugin_metadata.py, and both
loadability checks pass end-to-end (39 plugins, 74 skills, 2 MCP
servers load in Claude Code and Codex)

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Dan Guido <dan@trailofbits.com>
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-05 12:18:09 -04:00
Jonathan Hefner debfb29c8e Fix allowed-tools to use spec-compliant space-delimited strings (#139)
* Fix `allowed-tools` to use spec-compliant space-delimited strings

Per the agentskills.io specification, `allowed-tools` must be a single
string of space-delimited patterns, not a YAML list. Converted all 23
SKILL.md files from the `- Item` list format to the correct
`"Item1 Item2"` string format. Also updated the frontmatter examples in
CLAUDE.md and the workflow-skill-design skill template to match.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* Fix remaining allowed-tools format in firebase-apk-scanner and workflow-skill-design docs

- Convert firebase-apk-scanner from comma-separated to space-delimited
- Update anti-patterns.md and tool-assignment-guide.md examples from YAML lists to space-delimited strings
- Remove unnecessary quotes from SKILL.md template placeholder

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* Cover commands, new SKILL.md files, and fix template placeholder

Extends the previous spec-compliance fixes:

* Convert command frontmatter (commands/*.md) — per Claude Code
  docs, command files use the same frontmatter as skills, so the
  same space-delimited rule applies.
* Convert three SKILL.md files added since the original PR:
  mutation-testing, trailmark-structural, trailmark-summary.
* Fix the placeholder in the workflow-skill-design template.
  The previous "[minimum tools needed, space-delimited]" was YAML
  flow-sequence syntax, which parses as a list — the opposite of
  what the placeholder claims. Replaced with a concrete-looking
  space-delimited example plus a comment.

Zeroize-audit agent files still use `allowed-tools:` in YAML list
form. They are intentionally excluded: per the project's own docs
(workflow-skill-design references), agents declare tools with
`tools:` (not `allowed-tools:`). Fixing those requires changing
the field name as well as the format and is out of scope for this
PR.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* zeroize-audit agents: switch allowed-tools to tools

Subagents declare their tool allowlist via `tools:` (comma-separated),
not `allowed-tools:` — see Claude Code's subagent docs and this
repo's own designing-workflow-skills/SKILL.md:47:

> Skills use `allowed-tools:` in frontmatter. Agents use `tools:`
> in frontmatter.

Before this change, the zeroize-audit agents declared their tool list
under `allowed-tools:`, which Claude Code does not read for subagents.
The field was effectively a no-op; the spawned agents had no tool
restriction enforced.

Renames the field on all 11 agents to `tools:` and reformats the YAML
list as comma-separated to match the documented format and existing
agents elsewhere in the repo (e.g. function-analyzer.md,
spec-compliance-checker.md). Tool sets are unchanged.

Behavior change: tools now actually constrain what each spawned agent
can call. The lists are the ones the original author intended.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* skill-improver: convert command allowed-tools to space-delimited

The two command files in plugins/skill-improver/commands/ still used
the JSON flow-array format (`allowed-tools: ["..."]`), which the rest
of this PR converted everywhere else. Convert them to the spec-compliant
space-delimited string form for consistency.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-authored-by: Dan Guido <dan@trailofbits.com>
2026-04-28 19:50:30 -04:00
Artem Dinaburg aab484c5b7 Add Codex-native skill installation support (#123)
* Add Codex-native skill installation support

* Document Codex install commands in README

* Enforce Codex skill mappings in CI

* Fix review issues in Codex skill support

- Fix ruff line-length violations in validate_codex_skills.py
- Rewrite gh-cli SKILL.md description to third-person voice
- Fix misleading error messages: describe actual symlink fix
  instead of referencing the user-local installer script
- Add early check for missing .codex/skills/ directory
- Distinguish dangling symlinks from mismatched symlinks
- Add defensive ValueError handling in rel()
- Add PLUGINS_DIR existence guard
- Add install count and zero-install warning to installer
- Add SOURCE_DIR existence check to installer

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Dan Guido <dan@trailofbits.com>
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-16 14:29:40 -04:00
Benjamin Samuels 9fb1ec15de Add workflow-skill-design plugin (#100)
* Add workflow-skill-design plugin

Adds a plugin that teaches design patterns for workflow-based Claude Code
skills, including a skill with reference docs, workflow guides, and a
review agent for auditing existing skills.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* Fix gaps in workflow-skill-design plugin and update CLAUDE.md URLs

Update CLAUDE.md doc links from docs.anthropic.com to code.claude.com.
Add frontmatter reference table, string substitutions, context:fork
guidance, and LSP Server row to tool-assignment-guide.md. Expand
SKILL.md frontmatter skeleton with optional fields, add substitutions
note, and renumber anti-pattern table to match anti-patterns.md AP-N
numbering. Add TodoWrite phase tracking to reviewer agent.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* Add research-driven improvements to workflow-skill-design plugin

Add AP-20 (description summarizes workflow) anti-pattern from
superpowers/writing-skills tested failure, degrees-of-freedom
principle from Anthropic best practices, feedback loop guidance
for iterative validation, and new reference links to CLAUDE.md.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Co-authored-by: Dan Guido <dan@trailofbits.com>
2026-02-18 23:31:12 -07:00
Dan Guido 42466c4600 Fix Gemini heredoc patterns that prevent variable expansion (#87)
* Fix Gemini heredoc patterns that prevent variable expansion

Single-quoted heredoc delimiters (<<'PROMPT') suppress shell
substitution, so $(cat /tmp/review-diff.txt) was passed to
Gemini as literal text. Replaced all heredoc patterns with
pipe-based construction ({ printf ...; cat ...; } | gemini)
which avoids both the quoting bug and shell metacharacter
issues from unquoted heredocs (diffs contain $ and backticks).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* Bump second-opinion version in marketplace.json to match plugin.json

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* Clarify marketplace.json path in CLAUDE.md PR checklist

The checklist said `.claude-plugin/marketplace.json` which is
ambiguous — every plugin has its own `.claude-plugin/` directory.
Specify that the marketplace.json is at the repo root, distinct
from each plugin's `.claude-plugin/plugin.json`.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-12 19:53:29 -05:00
William Tan dca4d846ad Add hook for gh-cli (#78)
* Add hook for gh-cli

This should prevent claude code from wasting cycles trying to fetch from
Github which will not work 90% of the time.

* Add guidance for claude for updating CODEOWNERS

* update codeowners

* fix: resolve code review findings for PR #78

- Add actions and gist endpoint handling to curl hook (parity with fetch hook)
- Skip non-repo github.com paths (settings, notifications, login) in fetch hook
- Move gh-cli entry to correct alphabetical position in marketplace.json
- Fix stale "prefer-gh-cli" name in test_helper.bash comment
- Remove unused Grep from SKILL.md allowed-tools

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* fix: improve agent self-correction suggestions for PR #78

Add specific pattern matching for github.com PR, issue, release-download,
and tree URLs so the deny message suggests the exact correct gh command
(e.g., `gh pr view 78 --repo owner/repo`) instead of the generic
`gh repo view owner/repo` catch-all. Also add releases/download pattern
to the curl hook.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Dan Guido <dan@trailofbits.com>
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-02-11 19:46:50 -05:00
Jay Little c9b644a8c2 update version of plugins with updates and a note about doing this for future claudes (#61)
* update version numbers of any plugins with updates and a note about doing this for future claudes

* update more plugins versions and sync with marketplace

* claude.md update
2026-01-31 01:02:26 -05:00
William Tan 4aeaa737f6 Add hook to modern-python to intercept python3 and pip calls (#40)
* Add hook to modern-python to intercept python3 and pip calls

Uses tree-sitter-bash parse the AST for more robust hooking

* Fix ruff line-length lint in intercept-legacy-python hook

Run ruff format to properly break long lines into multi-line tuples.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* Rewrite legacy Python hook in shell for performance

Replace tree-sitter-based Python implementation with a shell script
using jq and regex patterns. This eliminates the overhead of spawning
Python and loading tree-sitter on every Bash command.

- Use jq for JSON parsing (fast, commonly available)
- Regex-based pattern matching for python/pip commands
- Allow uv run commands to pass through
- Context-aware suggestions based on subcommand
- Passes shellcheck validation

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* Allow diagnostic commands and simplify error message

- Skip `which`, `type`, `whereis`, `command -v` for python/pip
- Simplify denial message (Claude already knows uv commands)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* Allow search tools through legacy Python hook

Add allowlist for grep, rg, ag, ack, find to prevent false positives
when searching for "python" or "pip" as text patterns. Also normalize
character class ordering for consistency with other patterns.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* Fix shfmt formatting (2-space indent)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* Add hook development guidance to CLAUDE.md

Document design lessons from PR #40's Python-to-shell rewrite:
- Performance: prefer shell+jq over Python with dependencies
- Simplicity: accept false positives when performance gain is worth it
- False positive awareness: diagnostic commands, search tools, filenames
- Explicit tradeoff documentation in PR descriptions

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* Refine CLAUDE.md formatting for consistent density

Remove section breaks (horizontal rules) between major sections and
condense the Hooks section from verbose multi-paragraph format into
a unified list while preserving all guidance.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
Co-authored-by: Dan Guido <dan@trailofbits.com>
2026-01-26 19:03:08 -05:00
Dan Guido 695119c312 Initial release of Trail of Bits Skills Marketplace
16 plugins for security analysis, smart contract auditing, and verification:

Smart Contract Security:
- building-secure-contracts
- entry-point-analyzer

Code Auditing:
- audit-context-building
- burpsuite-project-parser
- differential-review
- semgrep-rule-creator
- sharp-edges
- testing-handbook-skills
- variant-analysis

Verification:
- constant-time-analysis
- property-based-testing
- spec-to-code-compliance

Audit Lifecycle:
- fix-review

Reverse Engineering:
- dwarf-expert

Development:
- ask-questions-if-underspecified

Team Management:
- culture-index

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-14 15:24:03 -05:00