Commit Graph

88 Commits

Author SHA1 Message Date
wizardengineer 4c9d5989a4 Add modern-cpp plugin for C++20/23/26 best practices
Modern C++ skill guiding Claude toward modern idioms with a security
emphasis. Mirrors modern-python in spirit but focuses on language
standards rather than toolchain.

Features tiered by practical usability:
- Tier 1 (Use Today): C++20/23 features with solid compiler support
- Tier 2 (Deploy Now): Compiler hardening, sanitizers, hardened libc++
- Tier 3 (Plan For): C++26 reflection
- Tier 4 (Watch): Contracts, std::execution

Includes SKILL.md entry point + 6 reference docs:
- anti-patterns.md (30+ legacy-to-modern swaps)
- cpp20-features.md (concepts, ranges, span, format, coroutines)
- cpp23-features.md (expected, print, deducing this, flat_map)
- cpp26-features.md (reflection, contracts, memory safety)
- compiler-hardening.md (flags, sanitizers, hardened libc++)
- safe-idioms.md (security patterns by vulnerability class)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-03 10:17:42 -04:00
Paweł Płatek d7f76b532d Cosmos improve (#127)
* cosmos update 1

* cosmos update 2

* cosmos update 3

* rm internal data

* renumber

* ibc

* bump cosmos skill version

* proper checklist with progressive disclosure

* rm duplicates

* workflow instaed of checklist

* better workflows

* correct version

* main skill saves findings
2026-04-01 10:50:10 -04:00
Paweł Płatek 17ba9fa3e9 Sast improve (#119)
* experimental rules in run all mode; more explicit gates/ask-user

* bump version
2026-04-01 10:49:33 -04:00
tob-joe 40f192b390 let-fate-decide: replace os.urandom with secrets.randbelow (#125)
* galvanize(iter1): replace os.urandom with secrets.randbelow, add tests

Switch card selection from hand-rolled secure_randbelow(os.urandom)
to stdlib secrets.randbelow(). Update all docstrings, SKILL.md, and
README.md references. Add 25-test suite covering deck construction,
shuffle invariants, CLI validation, and migration regression checks.

* Bump version to 1.1.0 and fix stale rejection sampling claim

- Bump version in plugin.json and marketplace.json (1.0.0 → 1.1.0)
- Update SKILL.md to say "via secrets.randbelow()" instead of claiming
  the script itself implements rejection sampling

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

* Fix ruff format: collapse line continuation in test assertion

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

* Merge Scott's PR #128 improvements + vivisect fixes

Incorporates unique changes from Scott's closed PR #128:
- Broadened trigger patterns (casual delegation, YOLO, shrug-like
  brevity, expanded Yu-Gi-Oh references) in README.md and SKILL.md
- Improved SKILL.md frontmatter description with casual/playful
  tone guidance and prefer-over-ask-questions-if-underspecified note
- is_reversed() uses secrets.randbits(1) (more idiomatic coin flip)

Additional fixes from vivisect analysis:
- Converted MAJOR_ARCANA, RANKS, SUITS from lists to tuples
  (prevents silent deck corruption if imported as library)
- Added type guard in draw() rejecting non-int/bool inputs
- Added test_constants_are_immutable and test_draw_rejects_non_int

Co-Authored-By: Scott Arciszewski <scott.arciszewski@trailofbits.com>

* let-fate-decide: improve performance by avoiding text-only turns

---------

Co-authored-by: Dan Guido <dan@trailofbits.com>
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-authored-by: Scott Arciszewski <scott.arciszewski@trailofbits.com>
2026-04-01 10:49:10 -04:00
tob-joe 635e186d1d Add draw agent for let-fate-decide (#134)
* add draw agent for let-fate-decide (Haiku, named agent)

Adds agents/draw.md to the let-fate-decide plugin. This
lets callers dispatch tarot draws as a named agent:

  Agent(subagent_type="let-fate-decide:draw",
    prompt="What portent awaits?")

instead of the current Agent-wrapped-Skill pattern:

  Agent(prompt="Call Skill(let-fate-decide, ...)...")

Benefits:
- Runs on Haiku (model: haiku in frontmatter) -- cheaper
  than inheriting the parent model for card interpretation
- Card file content stays in agent context, not caller's
- Caches the draw logic across parallel tarot agents
  (shared prefix optimization)
- Simplifies dispatch from 4-line prompt to 1-line

The agent does exactly: Bash(draw_cards.py) -> Read(4
card files) -> return 1-2 sentence reading. Falls back
to "fate unavailable" if the script errors.

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

* draw agent: --content flag eliminates 4 sequential Read calls

draw_cards.py --content reads card .md files and includes
their text in the JSON output. The draw agent now needs
exactly 1 Bash call (was 1 Bash + 4 sequential Reads).

Saves 4 turns per tarot draw (~8-12 turns per vivisect run).
Haiku was ignoring <use_parallel_tool_calls> and reading
cards one at a time; this bypasses the issue entirely.

Removed Read from agent tools list (no longer needed).

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

* Fix draw agent script discovery and bump version to 1.1.0

- Replace fragile `find ~/.claude/plugins` with `${CLAUDE_PLUGIN_ROOT}`
- Use context manager for file reads in draw_cards.py
- Bump version to 1.1.0 in plugin.json and marketplace.json

Co-Authored-By: Claude Opus 4.6 (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-03-31 18:14:41 -04:00
bohendo af35cdeac9 init mutation-testing skill (#140)
* init mutation-testing skill

* fix metadata

* init codex symlink

* polish according to review feedback

---------

Co-authored-by: Dan Guido <dan@trailofbits.com>
2026-03-31 18:12:57 -04:00
Scott Arciszewski 6b79b5e879 feat(trailmark): skills that reason about code as graphs (#133)
* feat(trailmark): skills that reason about code as graphs

* Add Codex skill symlinks for trailmark plugin

The trailmark plugin's 10 skills were missing .codex/skills/ mappings,
which caused the validate_codex_skills CI check to fail.

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

* Address PR #133 review feedback

- Add Rationalizations (Do Not Skip) sections to 5 security skills:
  trailmark, audit-augmentation, crypto-protocol-diagram,
  mermaid-to-proverif, graph-evolution
- Fix requires-python: diagram.py >= 3.12 (was 3.13), protocol.py
  >= 3.12 (was 3.11) to match trailmark's actual requirement
- Rename diagram/ to diagramming-code/ to match SKILL.md frontmatter
  name and all cross-skill references; update Codex symlink

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

* Fix diagram skill to use uv run instead of plain python

The diagram.py script carries PEP 723 inline metadata declaring
trailmark as a dependency. Plain python ignores this metadata,
causing ImportError for users who haven't pre-installed trailmark.
uv run processes the metadata and handles dependency resolution.

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

* Address second round of PR #133 review feedback

- Fix README directory tree: diagram/ -> diagramming-code/
- Fix diagram-types.md: python -> uv run for all script invocations
- Fix graph-evolution Phase 3: replace undefined shell variables
  ($BEFORE_JSON etc) with template substitutions ({before_json} etc)
- Fix vector-forge mutation-frameworks.md: replace cross-skill file
  link with prose reference to genotoxic skill (avoids reference chain)

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

* Local skill-improver review pass across all 10 trailmark skills

diagramming-code:
- Fix arrow syntax inconsistency: uncertain edges use ..-> not -.->
- Fix extra closing paren in diagram-types.md
- Fix diagram.py docstring to match uv run invocation

crypto-protocol-diagram:
- Remove reference chain: spec-parsing-patterns.md no longer links to
  mermaid-sequence-syntax.md, inlines the arrow syntax instead
- Fix ProVerif example note: "Tamarin/ProVerif" -> "ProVerif"

trailmark:
- Replace "path/to/project" with {targetDir} in query-patterns.md
- Add uv run prefix to CLI examples in query-patterns.md
- Add circom to supported language list
- Add pre-analysis annotation kinds to annotation docs

genotoxic:
- Remove reference chains: triage-methodology.md and
  mutation-frameworks.md no longer link to graph-analysis.md

vector-forge:
- Add trailmark to Prerequisites section
- Fix bare trailmark commands to use uv run with {targetDir}

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

* Address third round of PR #133 review feedback

mermaid-to-proverif:
- Fix ProVerif type error: verify(...) = true is a type mismatch
  since verify returns bitstring. Use let _ = verify(...) in instead,
  which aborts on destructor failure (correct ProVerif pattern)

trailmark-summary, trailmark-structural:
- Add 8 missing language extensions to find command (.rb, .php, .cs,
  .java, .hs, .erl, .cairo, .circom)
- Remove unsupported .lean extension
- Split .c -> --language c and .cpp -> --language cpp (separate parsers)

All 7 security skills:
- Rename "Rationalizations (Do Not Skip)" to "Rationalizations to
  Reject" per CLAUDE.md convention

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

* Address fourth round of PR #133 review feedback

mermaid-to-proverif:
- Fix ProVerif type errors in process template: pkey values cannot
  appear in bitstring positions. Add pkey2bs() and concat() to the
  function declarations and rewrite the template to use them,
  matching the sample-output.pv example

trailmark-summary:
- Split .js/.ts mapping: .js -> --language javascript,
  .ts -> --language typescript (separate parsers)

graph-evolution:
- Replace bare python with python3 in graph_diff.py invocations
  (python does not exist on modern Ubuntu/Debian/macOS)

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

* Address fifth round of PR #133 review feedback

graph-evolution:
- Change python3 to uv run for graph_diff.py invocations to match
  ecosystem convention

trailmark-structural, trailmark-summary:
- Add Rationalizations to Reject sections (both are security skills
  running blast radius, taint, and privilege boundary analysis)

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

* Fix ProVerif type consistency and graph-evolution template vars

mermaid-to-proverif:
- Rename senc/sdec to aead_enc/aead_dec in Step 3 preamble to match
  the process template and sample-output.pv
- Fix hkdf signature: hkdf(key, bitstring): key (first arg is DH
  shared secret which has type key, not bitstring)

crypto-to-proverif-mapping.md:
- Fix hkdf declaration and summary table to match corrected signature
- Fix example to use concat/pkey2bs for type-correct HKDF input

graph-evolution:
- Replace $BEFORE_DIR/$AFTER_DIR shell vars in Phase 5 with
  {before_dir}/{after_dir} template substitutions

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

* Comprehensive vivisect-style review of all trailmark skills

ProVerif correctness (mermaid-to-proverif):
- Fix broken ForwardSecrecyTest pattern in security-properties.md:
  process waited on c_fs but nothing sent on it, past_session_key
  was never bound to any session. Replaced with working pattern
  that leaks long-term keys and checks session key secrecy.
- Fix hkdf(bitstring,bitstring) -> hkdf(key,bitstring) in
  proverif-syntax.md to match SKILL.md and sample-output.pv
- Fix type-incorrect example in proverif-syntax.md: tuple of
  (key,pkey,pkey) passed where bitstring expected. Now uses
  concat2/pkey2bs for type-correct serialization.
- Align senc/sdec -> aead_enc/aead_dec in proverif-syntax.md and
  crypto-to-proverif-mapping.md to match SKILL.md and example
- Fix auth query parameter count in security-properties.md:
  beginI fires before session key is known, so has fewer params

Cross-skill consistency:
- Fix 3 stale "diagram skill" references -> "diagramming-code"
  in trailmark/SKILL.md and preanalysis-passes.md
- Add PEP 723 header to graph_diff.py for convention consistency

README and helper skills:
- Add trailmark-summary and trailmark-structural to README skills
  table and directory tree
- Add secondary file extensions (.jsx, .tsx, .h, .hpp, .cc, .cxx)
  to language detection in summary and structural skills
- Inline language mapping in trailmark-structural (was deferred
  to trailmark-summary, violating one-level-deep rule)

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

* Fix ProVerif type consistency and graph-evolution template vars

- Fix endInitiator -> endI in mermaid-to-proverif Step 6 template
  (endInitiator was never declared as an event)
- Add missing msg2_label constant to Step 3 constants block
- Add .hh/.hxx C++ header extensions to language detection in
  trailmark-summary and trailmark-structural

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

* Fix mermaid-to-proverif template: missing beginI event and secrecy witness

Step 6 Initiator template:
- Add missing event beginI(pk(sk_I), pk_R) before first out —
  without it, authentication queries always report false attacks
- Replace local new secret_I with free private_I [private] to
  match sample-output.pv's secrecy witness pattern

security-properties.md:
- Fix beginI/beginR from 3 args to 2 args in mutual auth section
  and query checklist (begin events fire before session key is
  known, so they only take the two public keys)
- Update "Placing Events" table to match 2-param form

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

* Address sixth round of PR #133 review feedback

proverif-syntax.md Two-Party Process example:
- Fix type errors: pkey values passed directly to bitstring params
  in sign() and verify(). Now uses concat2(pkey2bs(...)) pattern.
- Add missing pkey2bs declaration to function list
- Add missing info_session constant declaration
- Fix msg2_label -> msg2 in verification check example to match
  the file's own constant declarations

trailmark-structural:
- Fix contradiction: Rationalizations table said "Install trailmark
  first" but Execution section forbids install commands. Changed
  to "Report not installed and return" to match execution policy.

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

---------

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-31 17:31:30 -04:00
Tim Ren 4b9a4e9087 docs(aflpp): add opinionated environment variables guide (#130)
* docs(aflpp): add opinionated environment variables guide

Add a practical "Environment Variables That Matter" section covering:
- Always-set variables (AFL_TMPDIR, AFL_FAST_CAL) for free perf wins
- Multi-core campaign variables (AFL_FINAL_SYNC, AFL_TESTCACHE_SIZE)
- CI/automated fuzzing variables (AFL_EXIT_ON_TIME, AFL_NO_UI)
- Variables to avoid (AFL_NO_ARITH, AFL_SHUFFLE_QUEUE, AFL_DISABLE_TRIM)

Follow-up from PR #15 review feedback.

Closes #18

* docs(aflpp): address review feedback on env vars guide

- AFL_FAST_CAL: clarify it's recommended for slow targets, not universal
- AFL_FINAL_SYNC: correct scope to afl-cmin corpus minimization
- AFL_TESTCACHE_SIZE: add default (50 MB) and recommended range (50-250)
- AFL_NO_ARITH: note it may help for text-based formats

* fix: address review feedback on AFL env vars descriptions

- AFL_FAST_CAL: move to its own "Slow Targets" section to clarify it's
  specifically recommended for slow targets, not always
- AFL_FINAL_SYNC: clarify it only matters for afl-cmin corpus
  minimization, not for the fuzzing process itself
- AFL_TESTCACHE_SIZE: mention default is 50 MB and good range is 50-250 MB
- AFL_NO_ARITH: soften wording to note it may be useful for text-based targets

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

---------

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-27 11:38:32 +01:00
Benjamin Samuels 9df47310d4 add dimensional analysis plugin (#132)
* add dimensional analysis plugin

* remove emails
2026-03-25 08:38:04 -04:00
Dan Guido 5c15f4f564 Add archetype deep profiles to culture-index skill (#126)
* Add 17 archetype deep profile references to culture-index skill

Convert Culture Index archetype PDFs into structured markdown reference
files with consistent format: core traits, strengths, challenges,
management approach, risk profile, FlashPoints, variations, and summary.

Add Influencer to the archetype summary table in patterns-archetypes.md
and register all archetype files in the SKILL.md reference index.

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

* Fix review issues in archetype profiles

- Align patterns-archetypes.md table with authoritative archetype files
  for Technical Expert, Socializer, Philosopher, Debater, Administrator
- Standardize "Moderate" to "Mid" in Trailblazer H1
- Split merged Organization/Environment FlashPoints rows into separate
  rows in Facilitator, Socializer, Traditionalist
- Remove leaked PDF source references from Debater, Technical Expert,
  Traditionalist variations sections

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

---------

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-17 13:50:09 -04:00
Tannr b1f2ed986b Improve skill-improver plugin's ability to locate skill-reviewer (#122)
* The pre-flight check for plugin-dev only searched sibling directories
   and flat plugin paths. When installed via marketplace, plugins live
   under ~/.claude/plugins/cache/<marketplace>/plugin-dev/<version>/,
   which none of the existing paths matched.

   Add glob patterns to search the marketplace cache directory structure.

* add alternative search path for skill-improver since .claude-plugin is stripped when plugins are installed through marketplace

* Bump skill-improver to 1.0.1 and document fallback check

- Bump version in plugin.json and marketplace.json so existing
  users receive the cache detection fix
- Document why the agents/skill-reviewer.md fallback exists
  (cached marketplace installs strip .claude-plugin/)

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:05:28 -04:00
mschwager 8655937ac0 Add some improvements to semgrep-rule-creator (#116)
* Add some improvements to semgrep-rule-creator

* Bump second version location

* Use raw GH markdown for docs links

* Fix YAML indentation for by-side-effect in Focus example

The by-side-effect key was at column 3 (same as the list dash),
causing a YAML parse error. Moved to column 5 to be part of the
list item mapping alongside patterns.

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

* Fix invalid by-side-effect value in taint options example

The pseudo-syntax (true|only) is not valid YAML and is rejected by
semgrep --validate. Use a real value with a comment documenting the
alternative.

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

* Wrap multi-line comment example in inline code backticks

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

* Add missing pattern-sources to taint mode anti-pattern example

Taint mode requires both pattern-sources and pattern-sinks.
Without sources, semgrep --validate rejects the rule.

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

* Fix review issues: restore {baseDir} paths, improve quick-reference clarity

- Restore {baseDir} in SKILL.md and workflow.md path references per repo convention
- Normalize YAML indentation in focus-metavariable taint example
- Preserve behavioral description in by-side-effect comment
- Rename ambiguous "Operators" section to "Matching Operators"

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

---------

Co-authored-by: Maciej Domanski <maciej.domanski@trailofbits.com>
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Co-authored-by: Dan Guido <dan@trailofbits.com>
2026-03-16 13:45:31 -04:00
Dan Guido c6097699e4 Fix burpsuite-project-parser skill directory structure (#115)
Move SKILL.md and scripts/ into a named subdirectory matching the
frontmatter name. Both Claude Code and OpenCode discover skills at
skills/<name>/SKILL.md where <name> must match the frontmatter name
field.

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-03 21:24:19 -08:00
William Tan 00c013dba7 gh-cli: Replace skill with hooks-only enforcement (#114)
* Add hooks to block gh api contents fallback and enforce session-scoped clone paths

Add two new PreToolUse hooks:
- intercept-gh-api-contents: blocks `gh api repos/.../contents/... | base64 -d`
  and suggests cloning instead
- intercept-gh-clone-path: denies `gh repo clone` to non-session-scoped temp
  paths, enforcing the `$TMPDIR/gh-clones-$CLAUDE_SESSION_ID/` convention

Update existing fetch/curl hooks to warn against the `gh api` contents
anti-pattern in their denial messages. Update skill docs and references to
discourage base64-decoding file contents via the API.

Bump version 1.3.0 → 1.6.0.

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

* Replace regex-based PreToolUse hooks with a gh PATH shim

Swap intercept-gh-api-contents.sh and intercept-gh-clone-path.sh
(regex-matched PreToolUse hooks) for a single shims/gh wrapper
prepended to PATH via a SessionStart hook. The shim receives
properly tokenized $@ args, eliminating the class of regex bypass
bugs identified in PR review (subshell, @base64d, compound command
gaps). All /contents/ API access is now blocked unconditionally.

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

* Fix gh shim clone bypass, exec error handling, and docs accuracy

- Replace hardcoded $4 clone target with arg iteration to prevent
  flag-based bypass (e.g., -u upstream owner/repo /tmp/bad-path)
- Handle exec failure on real gh binary with error message and exit 126
- Add diagnostic message when gh not found on PATH in setup-shims.sh
- Add error handling for CLAUDE_ENV_FILE write failure
- Replace blocked gh api contents example in SKILL.md Quick Start
- Fix incorrect --branch <sha> docs (git clone --branch requires a
  branch/tag name, not a commit SHA)
- Rename misleading "exits silently" test names to "exits gracefully"
- Add test for clone bypass with flags before target path

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

* Fix review findings: dead exec handler, inaccurate docs, add tests

Remove unreachable || block after exec in the gh shim (dead code
since exec replaces the process). Fix shallow clone + SHA checkout
guidance to note --depth 1 must be omitted. Qualify README passthrough
list to account for shim interceptions. Improve anti-pattern docs
and api.md Headers section. Add 4 tests: bare gh passthrough, tmp
substring path, session-scoped /var/folders/, missing shims dir.

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

* Address PR review: shim executable check, tests, comment/doc accuracy

- Validate shims/gh is executable in setup-shims.sh before writing PATH
- Add tests: API contents with query params, long-form flags before clone
  target, non-executable shim file
- Fix README "silently pass through" wording
- Clarify shim comment on flag-value scanning behavior
- Rename test for clarity on flag-preceding-target behavior

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

* Remove using-gh-cli skill, keep hooks-only enforcement

The skill rarely triggered (~0-11% recall across eval runs) because
Claude's system prompt already includes gh CLI instructions. The hooks
(WebFetch/curl interception, gh shim, clone cleanup) enforce the
critical behaviors regardless of skill triggering, making the skill
redundant.

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

* Fix CI: marketplace description mismatch, shellcheck, bats test

- Sync marketplace.json description with plugin.json
- Add shellcheck disable directives for bats subshell warnings
- Use absolute bash path in setup-shims test to handle PATH filtering

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

* Remove skill reference from gh-cli README

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

* Fix curl hook circular suggestion, shim false positives, and session ID diagnostic

- Curl hook: add api.github.com/repos/.../contents/ branch before
  generic catch-all so it suggests clone instead of gh api (which the
  shim would then block)
- Shim: anchor /contents/ regex to ^repos/ and skip flags so jq filter
  values don't cause false positives
- Shim: emit specific diagnostic when CLAUDE_SESSION_ID is unset
  instead of a self-contradicting suggestion
- Curl hook: remove redundant gh/git early exits so compound commands
  like "curl github.com/... && gh version" are correctly denied
- Tests: add coverage for all three fixes

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

* Add error handling for shim exec failure and session ID persistence

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

* Fix review issues: exec dead code, leading-slash bypass, exit codes, fetch contents gap

- Fix exec failure handler in gh shim: disable set -e around exec so
  the error message is actually reachable, use resolved path consistently
- Handle leading-slash API endpoints (gh api /repos/.../contents/...)
  by changing regex from ^repos/ to ^/?repos/
- Exit 1 (not 0) when CLAUDE_ENV_FILE is missing in setup-shims.sh,
  since this is a runtime contract violation, not graceful degradation
- Add /contents/ branch to fetch hook for api.github.com URLs so
  WebFetch to api.github.com/repos/.../contents/ gets the clone
  suggestion instead of the generic gh api suggestion
- Add tests for all fixes (leading slash, /private/tmp session path,
  CLAUDE_ENV_FILE exit code, fetch contents endpoint)

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-03-03 17:28:44 -08:00
Dan Guido 19c463e3f6 Import fp-check plugin from skills-internal (#113)
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-03 08:40:15 -08:00
Dan Guido 1a868d25d2 second-opinion: use Codex CLI's built-in MCP server (#110)
* Replace third-party codex-mcp-server with Codex CLI's built-in MCP server

Swap `uvx codex-mcp-server` (third-party Python package) for `codex mcp-server`
(built-in to the Codex CLI). Eliminates the Python/uvx dependency and uses
OpenAI's officially maintained MCP server instead.

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

* Gitignore uv.lock at repo root

No root pyproject.toml exists — the lockfile is a stale artifact from
an accidental uv invocation.

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

* Fix stale references to third-party codex-mcp-server

Update root README table and .gitignore comment to reflect the switch
to Codex CLI's built-in MCP server.

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

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-27 01:03:31 -05:00
Paweł Płatek 8f92c6dee0 Simpler sast (#104)
* static-analysis selects all or important queries

* make semgrep/codeql better

* semgrep/codeql - descriptions

* semgrep - workflow plugin improvements

* semgrep - workflow plugin improvements 2

* codeql - workflow plugin improvements

* codeql - workflow plugin improvements 2

* output dir and artifacts more precise  handling, better db discovery

* Fix review issues: grep -P on macOS, LANG collision, stale triage refs, error handling

- Replace grep -oP with sed in macOS arm64e workaround (BSD grep lacks -P)
- Rename LANG to CODEQL_LANG across all CodeQL files to avoid POSIX locale collision
- Remove stale triage description from semgrep-scanner agent
- Rename merge_triaged_sarif.py to merge_sarif.py and update all references
- Restore {baseDir} in semgrep-scanner agent and sarif-parsing skill paths
- Fix quoted heredoc in scan-workflow.md preventing $(date) expansion
- Fix suite file location ($RESULTS_DIR -> $RAW_DIR) to match workflow
- Quote $OUTPUT_DIR in extension-yaml-format.md cp commands
- Add SARIF ruleIndex portability note for non-CodeQL tools
- Split CodeQL install check into separate command -v and --version steps
- Add semgrep install check before Pro detection in scan-workflow
- Add rm -rf guards in scanner agent and task prompt
- Narrow OSError catch in merge script with specific exception types
- Track and report skipped files in pure Python SARIF merge
- Add variable guards (${CODEQL_LANG:?}) in suite generation scripts
- Separate neutralModel into own section with column definition

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

---------

Co-authored-by: Dan Guido <dan@trailofbits.com>
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-26 11:30:21 -05:00
Dan Guido 3b378ebd47 Import skill-improver plugin from skills-internal (#109)
Iterative fix-review loop that automatically refines Claude Code skills
until they meet quality standards. Uses the plugin-dev:skill-reviewer
agent for automated review cycles with a stop hook to continue the loop.

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-26 10:34:59 -05:00
Dan Guido ed41cd7ceb Import five plugins from skills-internal (#108)
* Import four plugins from skills-internal and clean up README

Import seatbelt-sandboxer, supply-chain-risk-auditor, zeroize-audit,
and let-fate-decide from skills-internal. Remove dead humanizer and
skill-extractor directories. Fold "About Trail of Bits" into the
license line.

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

* Fix CI: shellcheck SC2317 and let-fate-decide description mismatch

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

* Import agentic-actions-auditor from skills-internal

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

* Fix review issues across 5 imported plugins

- Fix empty array expansion crash under set -u on macOS bash 3.2
  (emit_rust_mir.sh, emit_asm.sh, emit_ir.sh)
- Fix copy-paste error in seatbelt-sandboxer README ("variant analysis")
- Remove references to non-existent leak-hunter skill
- Update agentic-actions-auditor license to match repo CC-BY-SA-4.0
- Add PEP 723 metadata to check_rust_asm_{aarch64,x86}.py
- Replace unsafe xargs trim with parameter expansion in track_dataflow.sh
- Add json_escape function to analyze_asm.sh, analyze_heap.sh,
  track_dataflow.sh for safe JSON construction with backslashes
- Add allowed-tools frontmatter to seatbelt-sandboxer and
  supply-chain-risk-auditor SKILL.md
- Add minimum finding count assertions to run_smoke.sh
- Fix double period typo in supply-chain-risk-auditor SKILL.md

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

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-26 10:21:20 -05:00
newklei 52314112b9 fix(ct_analyzer): escape XML special chars in _compile_csharp() (#106)
* fix(ct_analyzer): escape XML special chars in _compile_csharp()

source_path and output_dir were embedded into the .csproj f-string
without escaping. On Linux, filenames may contain XML-special chars
(", <, >, &), allowing a crafted filename to inject arbitrary MSBuild
XML (CWE-91 -> CWE-78).

Fix: wrap both values with xml.sax.saxutils.escape() before
interpolation. The extra {chr(34): '&quot;'} arg covers double-quotes
inside the attribute value (chr(34) avoids an f-string quote conflict
on Python < 3.12).

* Update script_analyzers.py

---------

Co-authored-by: Scott Arciszewski <147527775+tob-scott-a@users.noreply.github.com>
2026-02-26 09:07:19 -05:00
Dan Guido 60ab7b0fe0 Fix second-opinion Codex schema validation and update Gemini model (#103)
codex-review-schema.json failed OpenAI structured output validation
because required arrays didn't include all sibling property keys when
additionalProperties: false was set. Made optional fields nullable
and added them to required to satisfy the constraint.

Update Gemini model from gemini-3-pro-preview to gemini-3.1-pro-preview
following the Feb 19 release.

Bump version 1.5.0 → 1.5.1.

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-20 13:56:28 -07:00
Francesco Bertolaccini 2f0ae6f15c Fix workflow-skill-design plugin failing to load (#102)
* fix: escape raw substitution patterns in workflow-skill-design

The skill loader preprocesses $ARGUMENTS, $N, ${CLAUDE_SESSION_ID},
and !`command` patterns before Claude sees the file. The SKILL.md and
tool-assignment-guide.md documented these using the raw syntax, causing
shell preprocessing to attempt execution of "command" and dollar
variables to silently resolve to empty strings.

Replace raw patterns with textual descriptions and add a caution note
warning skill authors about this pitfall.

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

* fix: version bump and clarify substitution docs

- Bump version to 1.0.1 in plugin.json and marketplace.json
- Replace invented pseudo-syntax (DOLLAR-ARGUMENTS) with natural
  descriptions (a dollar sign followed by ARGUMENTS)
- Clarify shell preprocessing example with proper sentence structure
- Warn that code fences do not prevent substitution processing

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

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-19 10:13:54 -07:00
dm 7e885f5982 Sync devcontainer-setup templates with upstream claude-code-devcontainer (#101)
- Add initializeCommand to create ~/.gitconfig if missing (prevents bind mount failure)
- Add trailofbits/skills-curated marketplace plugin to Dockerfile
- Update SKILL.md to document the new marketplace plugin

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-02-19 07:55:39 -07:00
Dan Guido c557d2a269 Bundle codex-mcp-server into second-opinion plugin (#95)
Add .mcp.json to auto-start the codex-mcp-server when the plugin is
installed, providing codex_ask, codex_exec, and codex_review MCP tools.
The MCP tool descriptions are self-documenting — no separate skill
docs needed. Bump version to 1.5.0.

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-02-18 23:49:35 -07: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 224f51731e ci: enforce pre-commit formatting hooks in CI (#99)
* ci: enforce pre-commit formatting hooks in CI

check-yaml, check-json, end-of-file-fixer, and trailing-whitespace
only ran locally via pre-commit. Contributors who skip pre-commit
can introduce formatting drift (see #97). Add a CI job using
pre-commit/action to enforce these four hooks on every PR.

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

* ci: consolidate lint jobs into single pre-commit pass

Run all pre-commit hooks (ruff, shellcheck, shfmt, check-yaml,
check-json, end-of-file-fixer, trailing-whitespace) in one job
instead of separate CI jobs per tool. Fixes the extra_args error
where pre-commit run only accepts one hook ID positionally.

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

* style: fix trailing whitespace and EOF in semgrep-rule-creator

Pre-commit hooks caught two files missed by the earlier formatting
PR: trailing blank line in quick-reference.md and trailing
whitespace plus missing final newline in workflow.md.

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

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-18 10:20:31 -07:00
Dan Guido 9f7f8adad9 style: fix formatting issues across 27 plugin files (#98)
Pre-commit hooks auto-fixed missing newlines at EOF and trailing
whitespace to satisfy end-of-file-fixer and trailing-whitespace checks.

Co-authored-by: Dallas McIntyre <dkmcintyre@safaricircuits.com>
Co-authored-by: Claude Code <noreply@anthropic.com>
2026-02-18 10:09:58 -07:00
Dan Guido 4c854b712e Fix culture-index SKILL.md standards compliance (#96)
* Fix culture-index SKILL.md standards compliance

- Switch description to third-person voice, remove "PDF vision" mention
  that contradicts body's prohibition on visual estimation
- Add allowed-tools to frontmatter (Bash, Read, Grep, Glob, Write)
- Add required "When to Use" and "When NOT to Use" sections

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

* Bump culture-index version to 1.1.0

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

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-17 21:32:35 -07:00
Dan Guido 776ccc812c second-opinion: switch Codex from codex review to codex exec (#93)
* Switch second-opinion Codex path from codex review to codex exec

Use codex exec with --output-schema and -o (--output-last-message)
instead of codex review. This eliminates context waste from verbose
[thinking] and [exec] blocks by capturing only the structured JSON
review output to a file. Uses OpenAI's published code review prompt
that GPT-5.2-codex was specifically trained on.

Also lowers default reasoning from xhigh to high, removes the
--base/--commit prompt limitation (all scopes now support project
context and focus instructions), and adds a JSON schema for
structured findings output.

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

* Fix review issues: untracked files, hardcoded paths, schema naming

- Include untracked files in uncommitted scope diff using
  git ls-files + git diff --no-index, matching the coverage
  that codex review --uncommitted previously provided
- Replace hardcoded /tmp/ paths with mktemp for portability
- Rename absolute_file_path to file_path in schema since
  git diff produces relative paths
- Capture stderr to a log file instead of /dev/null for
  faster error diagnosis without retry

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

* Fix PR review findings: schema constraints, flag naming, citation

- Add required and additionalProperties: false to JSON schema
- Use -o (short flag) consistently; clarify --output-last-message
- Add cookbook citation URL for the code review prompt
- Add || true to git diff --no-index (exits 1 on diff found)
- Fix schema.json → codex-review-schema.json in SKILL.md quick ref

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

* Restore xhigh reasoning effort, fix cookbook citation URL

- Change reasoning effort back to xhigh from high
- Update cookbook URL to canonical developers.openai.com domain
  (old cookbook.openai.com returns 308 redirect)

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

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-17 03:05:33 -07:00
William Tan dc1bc277f0 Also hook pipx (#90)
* Also hook pipx

* fix: resolve code review findings for PR #90

- Add upgrade-all case to pipx shim (pipx upgrade-all → uv tool upgrade --all)
- Add ensurepath case to pipx shim (pipx ensurepath → uv tool update-shell)
- Update setup-shims.sh comment to mention pipx
- Add README rows for upgrade-all and ensurepath mappings
- Add tests for upgrade-all, ensurepath, and unknown subcommand
- Rename generic ensurepath test to unknown subcommand test

P2 fixed: missing upgrade-all subcommand mapping
P3 fixed: stale setup-shims.sh comment, ensurepath deserves specific mapping
P3 dismissed: -ne 0 vs -eq 1 in tests (matches existing convention)
P4 noted: pipefail no-op, Gemini false positive on bats syntax

All 37 bats tests pass. Shellcheck clean.

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

---------

Co-authored-by: Dan Guido <dan@trailofbits.com>
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-13 14:43:27 -05:00
Dan Guido d3630e5193 Skip dep scan when diff doesn't touch dependency files (#91)
The Gemini `/security:scan-deps` command scans the entire project
dependency tree regardless of what changed. This wastes time when
reviewing small config or code changes that don't involve dependencies.

Now the scan only runs when the diff actually touches manifest files
(package.json, Gemfile, requirements.txt, Cargo.toml, go.mod, etc.).

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-13 14:33:36 -05:00
Dan Guido 962f7433a1 Add spec-compliance-checker agent to spec-to-code-compliance (#82)
* Add spec-compliance-checker agent to spec-to-code-compliance plugin

Introduces a formal agent definition for the full specification-to-code
compliance workflow. Updates SKILL.md to reference agent and bumps
version to 1.1.0.

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

* Fix {baseDir} paths and bump marketplace.json version

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

* fix: resolve code review findings for PR #82

- Normalize double hyphens to em dashes in agent rationalizations table
  for consistency with SKILL.md formatting conventions
- Add invocation example to SKILL.md Agent section

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

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-13 08:09:08 +04:00
Dan Guido 271c095d31 Add function-analyzer agent to audit-context-building (#83)
* Add function-analyzer agent to audit-context-building plugin

Introduces a formal agent definition for ultra-granular per-function
analysis. Updates SKILL.md Section 8 to reference agent and bumps
version to 1.1.0.

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

* Fix {baseDir} paths and bump marketplace.json version

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

* fix: resolve code review findings for PR #83

- Wrap long SKILL.md line (239 chars -> multi-line) for readability
- Trim verbose agent description frontmatter
- Add "When NOT to Use" section to agent file per project standards

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

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-13 08:08:06 +04:00
William Tan 994fe9687b use PATH shim override technique instead of hooking every pre tool usage (#89)
* use PATH shim override technique instead of hooking every pre tool usage

* remove unecessary check

* fix: resolve code review findings for PR #89

P1 fixes:
- setup-shims.sh: Add CLAUDE_ENV_FILE guard to prevent opaque
  'unbound variable' crash when env var is unset (matches
  gh-cli plugin pattern)

P2 fixes:
- setup-shims.sh: Guard shims_dir resolution failure to prevent
  empty PATH prefix on partial installs
- shims/uv: Fix shfmt formatting (here-string spacing)
- shims/uv: Resolve PATH entries before comparison to prevent
  exec loop with symlinked/unnormalized paths
- shims/uv: Use ${PATH:-} to handle unset PATH defensively
- setup-shims.bats: Add test for unset CLAUDE_ENV_FILE
- uv-shim.bats: Add test for 'real uv not found' error path

P3 dismissed:
- CI linting gap for extensionless shim scripts: accepted as-is
  since shims must masquerade as real binaries (no .sh extension);
  manual review covers these files
- Unset PATH in uv shim: addressed by ${PATH:-} fix above

All 27 bats tests pass. shellcheck and shfmt clean.

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

---------

Co-authored-by: Dan Guido <dan@trailofbits.com>
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-12 22:16:40 -05:00
William Tan d356b6b5bb improve gh hook to prefer cloning repo instead of using api to fetch files (#88)
* improve gh hook to prefer cloning repo instead of using api to fetch files

This should make finding stuff way more efficient

Repos are saved to a per claude session directory and cleaned up at the end of the session

* fix formatting

* fix: resolve code review findings for PR #88

P1 (CI-blocking):
- Fix shell formatting: convert tabs to 2-space indent per project
  shfmt config (shfmt -i 2 -ci). The prior "fix formatting" commit
  used default shfmt settings (tabs) instead of project settings.

P2 (important):
- Add ${TMPDIR:-/tmp} fallback in suggestion strings across both
  intercept hooks. Without the fallback, $TMPDIR expands to empty
  on Linux systems where it's unset, producing paths at filesystem
  root.
- Add session_id format validation in persist-session-id.sh and
  cleanup-clones.sh to prevent shell injection via malformed input.
  Session IDs are now required to match ^[a-zA-Z0-9_-]+$.
- Add stderr warning in persist-session-id.sh when CLAUDE_ENV_FILE
  is unset, since the entire clone workflow silently breaks without
  it (CLAUDE_SESSION_ID never gets defined).
- Remove 2>/dev/null from rm -rf in cleanup-clones.sh and add
  directory existence check. The stderr suppression hid real
  failures like permission errors. Add justification comment for
  rm -rf per project conventions.
- Add missing test for tree/ URL pattern in fetch hook.
- Add bats tests for persist-session-id.sh and cleanup-clones.sh
  covering: invalid JSON, empty session_id, shell metacharacter
  rejection, CLAUDE_ENV_FILE behavior, actual directory cleanup.
- Add test for gist.github.com in curl hook.
- Add test verifying clone suggestions include CLAUDE_SESSION_ID
  and --depth 1.

P3 (nice to have):
- Add test for github.com/settings allow path (site pages).
- Strip query strings and fragment identifiers from URLs before
  parsing in fetch hook to handle edge cases like
  github.com/owner/repo?tab=issues.

Dismissed findings:
- P3 #8 (version jump 1.0.0→1.3.0): Author's choice, not a bug.
- P4 #13 (missing gh silently disables plugin): Intentional design
  — a broken hook should not block user operations.
- P4 #14 (loose test assertions): Addressed partially with new
  CLAUDE_SESSION_ID/--depth 1 assertion; full template validation
  would add test fragility without proportional value.

All 75 bats tests pass. shellcheck and shfmt clean.

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

---------

Co-authored-by: Dan Guido <dan@trailofbits.com>
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-12 21:16:05 -05: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
Dan Guido 9600b3d9e6 Add semgrep-scanner and semgrep-triager agents to static-analysis (#80)
* Add semgrep-scanner and semgrep-triager agents to static-analysis plugin

Introduces formal agent definitions for the scanning and triage
workflows. Updates SKILL.md to reference agents and bumps version
to 1.1.0.

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

* Fix {baseDir} paths and bump marketplace.json version

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

* fix: resolve code review findings for PR #80

- Update scanner-task-prompt.md to reference semgrep-scanner subagent
  type instead of Bash (consistent with SKILL.md Step 4 change)
- Update triage-task-prompt.md to reference semgrep-triager subagent
  type instead of general-purpose (consistent with SKILL.md Step 5 change)
- Add Agents Included section to README.md documenting new agents
- Fix Agents table column header in SKILL.md from "Type" to "Tools"

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

* fix: use fully-qualified agent type names for semgrep subagents

Plugin agents require the `plugin-name:agent-name` format at runtime,
but the skill referenced bare names (`semgrep-scanner`, `semgrep-triager`)
causing "Agent type not found" errors when spawning scan/triage Tasks.

Also adds agent types to the Step 3 plan template and pre-scan checklist
so they appear in generated plans and survive context clearing.

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

* Explicit semgrep scan allow

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Co-authored-by: axelm-tob <axel.mierczuk@trailofbits.com>
2026-02-12 11:17:57 -05:00
Paweł Płatek f4b2a7218f better ci validations, fix marketplace error (#85)
* better ci validations, fix marketplace error

* fix lints

* fix lint script

* fix lint script2

* fix ruff errors

* fix abs path regex

* fix shellcheck lint

* fix: resolve code review findings for PR #85

- Remove dead CHANGED_FILES code path (unreachable in CI)
- Add version and description consistency checks between plugin.json
  and marketplace.json
- Eliminate duplicate plugin.json reads via parse_plugin_json()
- Fix bats test discovery for filenames with spaces (print0/xargs -0)
- Sync marketplace.json with plugin.json for 5 pre-existing mismatches
  (second-opinion version, ask-questions/burpsuite/fix-review/insecure-defaults descriptions)

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

* fix: gh-cli bats tests fail when gh is in /usr/bin

The _no_gh test helpers used PATH=/usr/bin:/bin to exclude gh, but
on Ubuntu CI runners gh is installed at /usr/bin/gh. Fix by creating
a temp directory with symlinks to only jq and bash.

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

* fix: improve plugin descriptions for better skill triggering

- ask-questions-if-underspecified: restore trigger context ("asking
  questions") while keeping invocation constraint
- burpsuite-project-parser: drop filler "directly from the command
  line", use outcome-oriented "for security analysis"
- insecure-defaults: restore specific scenarios (hardcoded credentials,
  fallback secrets, weak auth defaults) for better matching

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

---------

Co-authored-by: Dan Guido <dan@trailofbits.com>
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-12 10:28:33 -05:00
Dan Guido 15f6b1c880 Remove fix-review plugin (moved to skills-internal) (#86)
* Remove fix-review plugin (moved to skills-internal)

This plugin is only useful for internal audit workflows and was
added to the public repo by mistake.

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

* Remove empty Audit Lifecycle section from README

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

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-12 09:31:01 -05:00
Henrik Brodin f8819350fe Add git-cleanup skill (#77)
* Add git-cleanup skill

Safely clean up accumulated git worktrees and local branches with a
gated confirmation workflow. Categorizes branches as merged, stale,
or active, and requires explicit user confirmation before any deletions.

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

* fix: resolve code review findings for PR #77

- Shorten description to focus on function, remove invocation rules
- Remove undocumented `invoke: user` frontmatter field
- Add Read and Grep to allowed-tools
- Quote all $branch variables in bash snippets to prevent injection
- Add programmatic protected branch filtering (main/master/develop/release/*)
- Use $default_branch variable consistently instead of hardcoded 'main'
- Tighten SUPERSEDED criteria to require merge evidence, not just shared prefix
- Replace chained && execution with individual commands for partial failure handling
- Remove duplicated Anti-Patterns, Commands Reference, and Example Session sections
- Add non-interactive automation note to When NOT to Use
- Add release/* to README protected branches list
- Sync descriptions across plugin.json, marketplace.json, and SKILL.md

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

* Add missing CODEOWNERS entries and require explicit invocation for git-cleanup

- Add 7 missing CODEOWNERS entries (claude-in-chrome-troubleshooting,
  culture-index, devcontainer-setup, fix-review, git-cleanup, sharp-edges,
  yara-authoring) and fix alphabetical ordering
- Set disable-model-invocation: true on git-cleanup skill so it only
  runs when explicitly requested by the user

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

---------

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
Co-authored-by: Dan Guido <dan@trailofbits.com>
2026-02-11 19:59:33 -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
Henrik Brodin 57a837d18b Add failure interpretation guide to property-based-testing skill (#74)
Adds references/interpreting-failures.md with guidance on analyzing
PBT failures: self-reflection workflow, property grounding checklist,
failure classification, and bug report template. Based on insights
from Anthropic's red team research on AI-driven property-based testing.

Updates SKILL.md decision tree and generating.md with cross-references.
Adds "Rationalizations to Reject" section per project guidelines.
Bumps version to 1.1.0.

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-11 11:39:47 -05:00
Paweł Płatek 78bcf4c086 remaining fixes from vanhauser-thc (#75) 2026-02-11 11:38:58 -05:00
Ronald Eytchison 1d843475e7 Add debug-buttercup skill (#73)
* Add debug-buttercup skill

* Fix debug-buttercup skill gaps found in PR #73 review

- Add missing services to table (registry-cache, scratch-cleaner,
  pov-reproducer, competition-api, ui) and frontmatter description
- Add orchestrator_delete_task_queue to queue table, diagnose.sh, and
  failure-patterns.md queue loop
- Add OpenTelemetry/Signoz telemetry debugging section
- Add kubectl availability check and configurable namespace to diagnose.sh
- Complete failure-patterns.md queue loop from 7 to all 13 queues
- Rename README category from "Trail of Bits Tools" to "Infrastructure"

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

---------

Co-authored-by: Dan Guido <dan@trailofbits.com>
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-10 23:40:38 -05:00
Dan Guido f1d166608b Sync devcontainer skill with upstream trailofbits/claude-code-devcontainer (#71)
- Dockerfile: use multi-stage build for uv (ARG actually used now)
- Dockerfile: reorder installs to match upstream (git-delta → uv → fzf)
- devcontainer.json: remove UV_VERSION/FZF_VERSION build args (handled by Dockerfile ARGs)
- .zshrc: sync fzf comment wording

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-10 06:49:17 -05:00
dm 543816914a Add devcontainer-setup plugin (#26)
* Add devcontainer-setup plugin for Claude Code development environments

Creates pre-configured devcontainers with Claude Code and language-specific
tooling. Supports Python, Node/TypeScript, Rust, and Go projects with
automatic detection and configuration.

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

* Add plugin to marketplace list

* Fix the post install command

* Fix YARN installation

* Install fzf from GitHub and add plugin marketplaces

- Install fzf from GitHub releases instead of apt (Ubuntu 24.04's apt
  version lacks shell integration)
- Add Claude plugin marketplace setup for anthropics/skills and
  trailofbits/skills in post_install.py

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

* Fix linting issues in devcontainer-setup plugin

- Use contextlib.suppress instead of try-except-pass (SIM105)
- Fix case statement indentation in install.sh for shfmt

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

* Exclude /home/vscode from hardcoded path check

Standard devcontainer user path should not be flagged as a
personal hardcoded path.

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

* Sync devcontainer-setup with upstream claude-code-devcontainer

Sync resources with https://github.com/trailofbits/claude-code-devcontainer:

- Add Python 3.13 via uv and Node 22 via fnm to base Dockerfile
- Add ast-grep for AST-based code search
- Include network isolation tools (iptables, ipset) by default
- Add Tailscale feature for secure networking
- Add NPM security settings (ignore-scripts, 24-hour release delay)
- Add init: true and updateRemoteUserUID: true to devcontainer.json
- Expand .zshrc with fnm integration, fzf config, and more aliases
- Update post_install.py to print to stderr and add ghostty terminal features
- Integrate delta config into .gitconfig.local
- Move marketplace plugin installation from post_install.py to Dockerfile

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

* Sync devcontainer-setup resources with upstream

Align with https://github.com/trailofbits/claude-code-devcontainer:

- Move PATH env before Claude install
- Remove -p fzf from Oh My Zsh, download fzf shell integration separately
- Add FZF_VERSION arg for shell integration download
- Use uv run --no-project for post_install.py
- Add fzf sourcing to .zshrc
- Add symlink resolution and update command to install.sh

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

* Address PR review comments and sync with upstream devcontainer

DarkaMaul's review comments:
- Restore SHA256 hash on base image for reproducibility
- Sort apt packages alphabetically within category groups
- Install fzf from GitHub releases (v0.67.0) instead of old apt package
- Remove Tailscale feature (not generic enough for template)

Upstream sync (3 new commits from claude-code-devcontainer):
- Add bubblewrap and socat for Claude Code sandboxing
- Add exec, upgrade, and mount commands to devc CLI
- Mount .devcontainer/ read-only to prevent container escape on rebuild

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

* Harden devcontainer templates from multi-agent review findings

- Pin uv to 0.10.0 with SHA256 digest (supply chain security)
- Add SYS_ADMIN capability guard to install.sh (prevents defeating
  read-only .devcontainer mount)
- Fix mount filter to use target paths instead of source prefixes
  (was broken when PROJECT_SLUG was substituted)
- Fix temp file leak in extract_mounts_to_file
- Remove claude-yolo alias (unsafe pattern for a template)
- Remove dead POWERLEVEL9K_DISABLE_GITSTATUS and NODE_OPTIONS configs
- Remove unnecessary terminal profile definitions
- Default timezone to UTC instead of America/New_York
- Remove stale Tailscale reference from SKILL.md
- Fix line length violations throughout install.sh

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

* Restore claude-yolo alias and POWERLEVEL9K_DISABLE_GITSTATUS

The claude-yolo alias is intentional for devcontainer use.
POWERLEVEL9K_DISABLE_GITSTATUS is needed because zsh-in-docker
installs Powerlevel10k, whose gitstatus can be slow in large repos.

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

* Restore NODE_OPTIONS, terminal profiles, and re-clone URL

NODE_OPTIONS 4GB heap is intentional for Claude Code in containers.
Terminal profiles are useful in VS Code dropdown. Re-clone message
needs the full URL to be actionable.

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

---------

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
Co-authored-by: Dan Guido <dan@trailofbits.com>
2026-02-10 06:12:28 -05:00
Dan Guido d98cfc79ad Fix second-opinion skill issues found in live testing (#70) (#70)
- Fix "sequentially" → "parallel" in Question 1 to match Running Both section
- Document Codex context limitation for --base/--commit (skill will not
  create AGENTS.md; inform user of the limitation instead)
- Add Codex output parsing guidance (summarize findings, don't dump 55KB
  of raw thinking/exec blocks)
- Document EPERM/sandbox errors as expected (codex review is sandboxed,
  cannot run tests or builds)
- Bump version to 1.2.0

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-10 02:05:44 -05:00
Dan Guido 211ecdec1c Fix second-opinion skill: broken Codex prompt passing, unnecessary upfront checks, parallel reviews (#69)
- Fix Codex --base/--commit prompt passing: the positional [PROMPT] arg
  is mutually exclusive with these flags (confirmed via CLI), and stdin
  via `-` is also rejected. Document the AGENTS.md workaround instead.
- Remove upfront `command -v` availability checks. Just run the tool and
  handle errors — saves a turn and avoids mishandled control flow.
- Run Codex and Gemini reviews in parallel (both are read-only, no
  shared state) instead of sequentially.
- Expand error handling table with explicit per-extension install URLs.
- Bump version to 1.1.0.

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-10 01:30:17 -05:00
Dan Guido bf125052d4 Add second-opinion skill for external LLM code reviews (#68)
Shells out to OpenAI Codex CLI and Google Gemini CLI to get
independent code reviews from different models on uncommitted
changes, branch diffs, or specific commits.

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-02-10 00:57:34 -05:00
Paweł Płatek f821e35473 codeql skills merge and improve (#67)
* init codeql merge

* test and improve

* test and improve 2

* test and improve 3

* test and improve 4, bump version, fix authors

* Bump testing-handbook-skills version for codeql skill removal

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

---------

Co-authored-by: Dan Guido <dan@trailofbits.com>
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-06 11:34:43 -05:00