Commit Graph

40 Commits

Author SHA1 Message Date
Drew Dennison f22c03f2cb "Claude Code Review workflow" 2026-01-22 23:43:02 -08:00
Drew Dennison 2e3e84dc32 "Claude PR Assistant workflow" 2026-01-22 23:43:00 -08:00
Drew Dennison b47191a021 Add pre-commit instruction to always run make
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-20 11:58:22 -08:00
Drew Dennison 69ce5427dd Add official Semgrep rule syntax docs and schema references
- Link to https://semgrep.dev/docs/writing-rules/rule-syntax
- Link to https://github.com/semgrep/semgrep-interfaces/blob/main/rule_schema_v1.yaml
- Updated SKILL.md, workflow.md, and quick-reference.md

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-20 11:57:11 -08:00
Drew Dennison 62dd371c73 Update CLAUDE.md to reflect actual repo structure
- Document two skill types: guideline skills (rules/) and reference skills (references/)
- Add build system documentation with Makefile targets
- Update install command to npx skills add semgrep/skills
- Remove outdated script-focused template
- Add section on adding rules to guideline skills

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-20 11:02:04 -08:00
Drew Dennison c2ddd2fb50 Remove data flow command from SKILL.md
Removed a command for showing data flow in semgrep.
2026-01-20 10:55:10 -08:00
Drew Dennison 74e48e451e update zip 2026-01-20 10:54:01 -08:00
Drew Dennison 1e1d6c9712 Update SKILL.md 2026-01-20 10:53:34 -08:00
Drew Dennison 5e52e0cb69 update zip files 2026-01-20 10:28:32 -08:00
Drew Dennison 2366e9fda4 improve semgrep skill 2026-01-20 10:28:07 -08:00
Drew Dennison 603e9e278f Fix install command to npx skills add semgrep/skills
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-20 10:20:50 -08:00
Drew Dennison 0ee9a5f44a Standardize install command to npx skills semgrep/skills
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-20 10:20:19 -08:00
Drew Dennison f67bfacece Add README to semgrep skill
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-20 10:17:52 -08:00
Drew Dennison b9eac31076 Add semgrep skill for static analysis and custom rule creation
Combines functionality from Trail of Bits' semgrep and semgrep-rule-creator skills:
- Running Semgrep scans with curated rulesets
- Creating custom detection rules with pattern matching and taint mode
- Test-driven rule development workflow
- CI/CD integration examples

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-20 10:14:47 -08:00
Drew Dennison a338b9f908 update install command 2026-01-20 09:53:50 -08:00
Drew Dennison b8aa65bada Update installation command for skills 2026-01-20 09:52:19 -08:00
Drew Dennison 6befb8a586 Update README.md 2026-01-17 11:49:19 -08:00
Drew Dennison f99267b67e Update README.md 2026-01-17 11:48:33 -08:00
Drew Dennison 16ebae6d46 Update README.md 2026-01-17 11:47:59 -08:00
Drew Dennison 823e429b92 Add llm-security skill and make build tooling generic
- Add llm-security skill covering OWASP Top 10 for LLM Applications 2025
  - 10 rules: Prompt Injection, Sensitive Disclosure, Supply Chain,
    Data Poisoning, Output Handling, Excessive Agency, System Prompt
    Leakage, Vector/Embedding Weaknesses, Misinformation, Unbounded
    Consumption
  - Python code examples with vulnerable/secure patterns

- Rename packages/code-security-build to packages/skill-build
  - Accept skill name as CLI argument: `pnpm validate llm-security`
  - Auto-discover skills with rules/ directories
  - Support Vulnerable/Secure labels (in addition to Incorrect/Correct)

- Update Makefile to build all skills automatically
  - `make validate` - validates all skills
  - `make build` - builds AGENTS.md for all skills
  - `make validate-skill SKILL=name` - single skill operations

- Update READMEs with llm-security documentation

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-15 14:59:55 -08:00
Drew Dennison 769eb809d6 remove 2026-01-15 14:31:39 -08:00
Drew Dennison e6d279659f Expand sql-injection.md with multi-language examples
Based on semgrep-rules test cases, now covers:
- Python (psycopg2): concatenation, .format(), f-strings
- JavaScript (pg): template literals, concatenation
- Java (JDBC): Statement vs PreparedStatement
- Go (database/sql): concatenation, fmt.Sprintf
- Ruby (pg): concatenation, interpolation
- C# (SqlCommand): String.Format, SqlParameter

Test cases: 347 → 364 (+17 examples)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-15 14:23:17 -08:00
Drew Dennison cd382c1c40 Extract section parsing into shared module
- Create sections.ts to parse _sections.md dynamically
- Eliminate hardcoded section map from parser.ts (was 28 entries)
- Replace duplicate parsing code in build.ts with shared module
- _sections.md is now the single source of truth for section metadata

Adding a new rule now only requires updating _sections.md

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-15 14:17:35 -08:00
Drew Dennison bfa8941893 Fix section mapping for security rules
- Replace React performance section map with security categories (1-28)
- Fix _sections.md parsing to use ### headings instead of ##
- Each rule now maps to its proper section by filename

Now generates 28 sections organized by impact level:
- Critical (1-9): SQL injection, XSS, secrets, etc.
- High (10-22): Crypto, SSRF, Terraform, K8s, etc.
- Medium (23-25): Regex DoS, race conditions
- Low (26-28): Best practices, performance

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-15 14:14:33 -08:00
Drew Dennison 2e12e64d4d Improve rule consistency and rewrite parser with remark/unified
Rule consistency:
- Add missing impactDescription and tags to 15 rule files
- Standardize reference format to **References:** across all rules
- Update _template.md with correct reference format

Parser improvements:
- Replace regex-based parser with AST-based parsing using remark/unified
- Add unified, remark-parse, remark-frontmatter, unist-util-visit, js-yaml
- More robust extraction of frontmatter, examples, and code blocks

Validation improvements:
- Add warnings for missing optional fields (impactDescription, tags)
- Report all errors/warnings instead of stopping on first error

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-15 14:11:57 -08:00
Drew Dennison 2ea1e704b3 Fix nested code fence in README breaking numbered list
Use 4 backticks for outer fence so inner code blocks don't break it.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-15 13:18:23 -08:00
Drew Dennison 8bcf9f1ce7 Regenerate zip with updated READMEs 2026-01-15 13:13:57 -08:00
Drew Dennison ffaf3d2612 Update READMEs and add build package documentation
- skills/code-security/README.md: Simplified, added categories summary
- packages/code-security-build/README.md: New - documents build tooling

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-15 13:13:57 -08:00
Drew Dennison 3cd507999b Regenerate zip with updated README 2026-01-15 13:10:41 -08:00
Drew Dennison 5ad8da18da Update README with full list of security categories
- Added all 28 security rule categories organized by impact level
- Listed supported languages (15+)
- Expanded use cases to include infrastructure configuration

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-15 13:10:35 -08:00
Drew Dennison 4802d8723f Add Makefile for validate, build, and zip automation
Targets:
- make all/release: validate, build, and create zip packages
- make validate: validate rule files via pnpm
- make build: build skill files
- make zip: create zip packages for all skills
- make clean: remove generated files

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-15 13:06:55 -08:00
Drew Dennison 1f11971e5a add an acknowledgement section 2026-01-15 13:03:50 -08:00
Drew Dennison 698aa2bb91 Add SKILL.md and zip package for code-security skill
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-15 13:01:34 -08:00
Drew Dennison cfec7199b8 make it very clear this is an example non-valid secret 2026-01-15 12:56:49 -08:00
Drew Dennison 1804f863e2 reduce size of files 2026-01-15 12:54:30 -08:00
Drew Dennison c81e69ac77 first pass 2026-01-15 12:33:17 -08:00
Drew Dennison eaff835852 remove old code example 2026-01-15 08:26:33 -08:00
Drew Dennison 4e9b382510 inital commit 2026-01-15 08:23:52 -08:00
Drew Dennison 3e9960a7d2 add AGENTS.md and CLAUDE.md symlink 2026-01-14 21:00:23 -08:00
Drew Dennison a09e9f1647 add readme 2026-01-14 20:56:50 -08:00