Skip to content

Commit 9db7274

Browse files
feat(ai-workflow): Add security scanning to preflight checks
Add comprehensive security scanning detection to /workflow-preflight: - Dependency audits: pnpm/npm/yarn audit, pip-audit, cargo audit - Semgrep SAST detection via config files, CI workflows, README docs - Docker fallback with Windows MSYS path conversion fix - ESLint security plugin detection - Updated skill documentation with security scanning quick reference
1 parent 1137522 commit 9db7274

7 files changed

Lines changed: 171 additions & 27 deletions

File tree

.claude-plugin/marketplace.json

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
},
77
"metadata": {
88
"description": "A curated list of custom Claude Code plugins, agents, and skills for developers.",
9-
"version": "1.9.0",
9+
"version": "1.9.1",
1010
"pluginRoot": "./plugins"
1111
},
1212
"plugins": [
@@ -141,8 +141,8 @@
141141
{
142142
"name": "ai-workflow",
143143
"source": "./plugins/ai-workflow",
144-
"description": "AI-powered development workflow automation - Phase-based planning, implementation orchestration, and preflight code quality checks for efficient sub-agent execution",
145-
"version": "1.0.3",
144+
"description": "AI-powered development workflow automation - Phase-based planning, implementation orchestration, and preflight code quality checks with security scanning for efficient sub-agent execution",
145+
"version": "1.1.0",
146146
"keywords": [
147147
"ai",
148148
"workflow",
@@ -155,6 +155,9 @@
155155
"typecheck",
156156
"lint",
157157
"testing",
158+
"security",
159+
"audit",
160+
"semgrep",
158161
"automation",
159162
"productivity"
160163
],

CHANGELOG.md

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,25 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## [Unreleased]
99

10+
## [1.9.1] - 2026-01-18
11+
12+
### Added
13+
14+
#### AI-Workflow Plugin (v1.1.0)
15+
16+
- **Added security scanning detection to `/workflow-preflight` command**
17+
- Detects and runs `pnpm audit`, `npm audit`, `yarn audit` for dependency vulnerability scanning
18+
- Detects `eslint-plugin-security` in devDependencies and notes when security linting is active
19+
- Universal Semgrep detection via multiple sources:
20+
- Package.json scripts (e.g., `pnpm run semgrep`)
21+
- Config files: `.semgreprc.yml`, `.semgrep.yml`, `semgrep.yml`, `.semgrep/`
22+
- CI workflows: `.github/workflows/*.yml` (extracts `--config` flags)
23+
- README.md documentation (Security sections)
24+
- Local CLI availability
25+
- Docker fallback when semgrep CLI not installed
26+
- Added Python (`pip-audit`, `safety`) and Rust (`cargo audit`) dependency scanning
27+
- Updated preflight skill with security scanning quick reference table
28+
1029
## [1.9.0] - 2026-01-14
1130

1231
### Added
@@ -504,7 +523,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
504523

505524
- README.md, CLAUDE.md, individual plugin READMEs, and MIT license
506525

507-
[Unreleased]: https://github.com/charlesjones-dev/claude-code-plugins-dev/compare/v1.9.0...HEAD
526+
[Unreleased]: https://github.com/charlesjones-dev/claude-code-plugins-dev/compare/v1.9.1...HEAD
527+
[1.9.1]: https://github.com/charlesjones-dev/claude-code-plugins-dev/compare/v1.9.0...v1.9.1
508528
[1.9.0]: https://github.com/charlesjones-dev/claude-code-plugins-dev/compare/v1.8.0...v1.9.0
509529
[1.8.0]: https://github.com/charlesjones-dev/claude-code-plugins-dev/compare/v1.7.1...v1.8.0
510530
[1.7.1]: https://github.com/charlesjones-dev/claude-code-plugins-dev/compare/v1.7.0...v1.7.1

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Claude Code Plugins for Developers
22

3-
[![Version](https://img.shields.io/badge/version-1.9.0-blue.svg)](https://github.com/charlesjones-dev/claude-code-plugins-dev/releases)
3+
[![Version](https://img.shields.io/badge/version-1.9.1-blue.svg)](https://github.com/charlesjones-dev/claude-code-plugins-dev/releases)
44
[![License](https://img.shields.io/badge/license-MIT-green.svg)](LICENSE)
55
[![GitHub Issues](https://img.shields.io/github/issues/charlesjones-dev/claude-code-plugins-dev.svg)](https://github.com/charlesjones-dev/claude-code-plugins-dev/issues)
66
[![GitHub Stars](https://img.shields.io/github/stars/charlesjones-dev/claude-code-plugins-dev.svg)](https://github.com/charlesjones-dev/claude-code-plugins-dev/stargazers)

plugins/ai-workflow/.claude-plugin/plugin.json

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "ai-workflow",
3-
"version": "1.0.3",
4-
"description": "AI-powered development workflow automation - Phase-based planning, implementation orchestration, and preflight code quality checks for efficient sub-agent execution",
3+
"version": "1.1.0",
4+
"description": "AI-powered development workflow automation - Phase-based planning, implementation orchestration, and preflight code quality checks with security scanning for efficient sub-agent execution",
55
"author": {
66
"name": "Charles Jones",
77
"url": "https://charlesjones.dev"
@@ -19,6 +19,9 @@
1919
"typecheck",
2020
"lint",
2121
"testing",
22+
"security",
23+
"audit",
24+
"semgrep",
2225
"automation",
2326
"productivity"
2427
]

plugins/ai-workflow/README.md

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ Provides tools for managing complex development workflows including breaking fea
1212

1313
- **Phase Planning**: Break large features into properly-sized phases (30-50k tokens each) optimized for sub-agent execution
1414
- **Implementation Orchestration**: Analyze dependencies and execute phases with optimal parallel/sequential strategies
15-
- **Preflight Checks**: Auto-detect and run type checking, linting, formatting, and tests across multiple ecosystems
15+
- **Preflight Checks**: Auto-detect and run type checking, linting, formatting, security scanning, and tests across multiple ecosystems
1616

1717
---
1818

@@ -96,7 +96,9 @@ Run comprehensive code quality checks before commits, PRs, or deployments.
9696
**What it does:**
9797

9898
- Auto-detects configured quality tools across ecosystems
99-
- Runs checks in optimal order: format -> typecheck -> lint -> tests
99+
- Runs checks in optimal order: format -> typecheck -> lint -> security -> tests
100+
- Detects security tools: pnpm/npm/yarn audit, eslint-plugin-security, Semgrep
101+
- Universal Semgrep detection via config files, CI workflows, README docs, or Docker fallback
100102
- Reports results with clear pass/fail/warning indicators
101103
- Offers interactive fix mode (or use `--fix` for automatic)
102104
- Respects existing project scripts (uses `npm run lint` over raw `eslint`)
@@ -112,13 +114,13 @@ Run comprehensive code quality checks before commits, PRs, or deployments.
112114

113115
**Supported Ecosystems:**
114116

115-
| Ecosystem | Type Check | Lint | Format | Test |
116-
|-----------|------------|------|--------|------|
117-
| **Node.js/TypeScript** | tsc | ESLint, Biome | Prettier | Jest, Vitest |
118-
| **Python** | MyPy | Ruff | Black, Ruff | Pytest |
119-
| **.NET** | dotnet build | Analyzers | dotnet format | dotnet test |
120-
| **Go** | go build | golangci-lint | gofmt | go test |
121-
| **Rust** | cargo check | Clippy | cargo fmt | cargo test |
117+
| Ecosystem | Type Check | Lint | Format | Security | Test |
118+
|-----------|------------|------|--------|----------|------|
119+
| **Node.js/TypeScript** | tsc | ESLint, Biome | Prettier | pnpm/npm/yarn audit, eslint-plugin-security, Semgrep | Jest, Vitest |
120+
| **Python** | MyPy | Ruff | Black, Ruff | pip-audit, safety, Semgrep | Pytest |
121+
| **.NET** | dotnet build | Analyzers | dotnet format | Semgrep | dotnet test |
122+
| **Go** | go build | golangci-lint | gofmt | Semgrep | go test |
123+
| **Rust** | cargo check | Clippy | cargo fmt | cargo audit, Semgrep | cargo test |
122124

123125
**Before (manual checks):**
124126

@@ -273,10 +275,10 @@ Discovery Phase
273275
Detect Project Type(s)
274276
|
275277
v
276-
Find Configured Tools
278+
Find Configured Tools (including security scanners)
277279
|
278280
v
279-
Run Checks (format -> type -> lint -> test)
281+
Run Checks (format -> type -> lint -> security -> test)
280282
|
281283
v
282284
Present Results
@@ -341,11 +343,12 @@ Plus improved code quality, fewer context overflows, and more efficient sub-agen
341343
## Plugin Details
342344

343345
- **Name:** AI-Workflow
344-
- **Version:** 1.0.0
346+
- **Version:** 1.1.0
345347
- **Type:** Development Workflow Automation
346348
- **Features:**
347349
- Commands: `/workflow-plan-phases`, `/workflow-implement-phases`, `/workflow-preflight`
348350
- Skills: `plan-phases`, `implement-phases`, `preflight-checks`
351+
- Security scanning: pnpm/npm/yarn audit, eslint-plugin-security, Semgrep (CLI or Docker)
349352
- **License:** MIT
350353
- **Author:** Charles Jones
351354

plugins/ai-workflow/commands/workflow-preflight.md

Lines changed: 70 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,14 @@ First, analyze the project to discover configured quality tools. Check for:
5555
- `rustfmt.toml` / `.rustfmt.toml` - Rustfmt configuration
5656
- `clippy.toml` / `.clippy.toml` - Clippy configuration
5757

58+
### Security Scanning
59+
- `pnpm-lock.yaml` / `package-lock.json` / `yarn.lock` - Dependency audit support
60+
- `.semgreprc.yml` / `.semgrep.yml` / `semgrep.yml` / `.semgrep/` - Semgrep configuration
61+
- `.github/workflows/*.yml` - Check for semgrep CI jobs (extract config flags)
62+
- `eslint-plugin-security` in devDependencies - ESLint security rules
63+
- `package.json` scripts containing `audit` or `semgrep` - Custom security scripts
64+
- `README.md` / `CONTRIBUTING.md` - Check for documented security scanning commands
65+
5866
### Other
5967
- `Makefile` / `makefile` - Check for lint/test/check targets
6068
- `.pre-commit-config.yaml` - Pre-commit hooks
@@ -73,6 +81,7 @@ Type Checking: [tool name] via [config file]
7381
Linting: [tool name] via [config file]
7482
Testing: [tool name] via [config file]
7583
Formatting: [tool name] via [config file]
84+
Security Scanning: [tool name(s)] via [config file/method]
7685
Not configured: [any missing categories]
7786
7887
Ready to run checks?
@@ -84,7 +93,12 @@ Run the discovered checks in this order:
8493
1. **Type checking** (fastest feedback on type errors)
8594
2. **Linting** (code quality issues)
8695
3. **Formatting check** (style consistency - check only, don't auto-fix yet)
87-
4. **Tests** (run last as they take longest)
96+
4. **Security scanning** - MANDATORY if any security tools detected:
97+
- Dependency audit (npm audit, pnpm audit, etc.)
98+
- **Semgrep SAST** - MUST run if detected in CI workflows or config files
99+
5. **Tests** (run last as they take longest)
100+
101+
**CRITICAL: If Semgrep was detected in discovery (CI workflows, config files, or README), you MUST run it. Do NOT skip Semgrep and report "All checks passed" without running it.**
88102

89103
For each check, report:
90104
- Pass - no issues found
@@ -121,17 +135,68 @@ For each check, report:
121135
- Tests: `cargo test`
122136
- Format check: `cargo fmt --check`
123137

138+
### Security Scanning Commands
139+
140+
**Dependency Audits (run based on detected package manager):**
141+
- pnpm: `pnpm audit` or `pnpm audit:check` (if script exists in package.json)
142+
- npm: `npm audit`
143+
- yarn: `yarn audit`
144+
- pip: `pip-audit` (if installed) or `safety check` (if installed)
145+
- cargo: `cargo audit` (if installed)
146+
147+
**Semgrep (static analysis - MUST run if detected in CI or config):**
148+
149+
IMPORTANT: If Semgrep is detected in CI workflows or config files, you MUST run it as part of preflight checks. Do not skip it.
150+
151+
Detection order:
152+
1. Check for custom script in package.json (e.g., `pnpm run semgrep` or `npm run semgrep`)
153+
2. Check for semgrep config files: `.semgreprc.yml`, `.semgrep.yml`, `semgrep.yml`, or `.semgrep/` directory
154+
3. Check `.github/workflows/*.yml` for semgrep jobs - extract `--config` flags used in CI
155+
4. **Check `README.md` for documented semgrep commands** - ALWAYS check this before trying generic Docker commands, as projects often document the exact command needed for their setup
156+
5. Check if `semgrep` CLI is available locally: `semgrep --version`
157+
6. Check if Docker is available: `docker --version`
158+
7. If Docker available but no semgrep CLI, use Docker (see platform-specific commands below)
159+
160+
**Semgrep execution:**
161+
- With config file: `semgrep scan --config .semgreprc.yml` (or detected config)
162+
- Without config (auto rules): `semgrep scan --config auto`
163+
- With language-specific rules: `semgrep scan --config auto --config p/javascript --config p/typescript`
164+
165+
**Docker execution (AUTOMATIC PLATFORM DETECTION):**
166+
167+
CRITICAL: You MUST detect the platform and use the correct command automatically. Check the platform from the environment context.
168+
169+
- **If platform is `win32` (Windows):** ALWAYS use `MSYS_NO_PATHCONV=1` prefix for Docker commands:
170+
```bash
171+
MSYS_NO_PATHCONV=1 docker run --rm -v "$(pwd):/src" semgrep/semgrep semgrep scan --config auto /src
172+
```
173+
174+
- **If platform is `darwin` (macOS) or `linux`:** Use standard Docker command:
175+
```bash
176+
docker run --rm -v "$(pwd):/src" semgrep/semgrep semgrep scan --config auto /src
177+
```
178+
179+
**Why this matters on Windows:** Git Bash/MSYS2 performs automatic POSIX-to-Windows path conversion. Without `MSYS_NO_PATHCONV=1`, the Docker volume mount `/src` gets incorrectly converted to `C:/Program Files/Git/src`, causing Semgrep to fail with "Invalid scanning root" error.
180+
181+
DO NOT try the command without the prefix first on Windows - use the correct platform-specific command immediately.
182+
183+
**ESLint Security Plugin:**
184+
- If `eslint-plugin-security` is detected in devDependencies, security rules are already included in the linting step
185+
- No separate command needed, but note in discovery output that security linting is active
186+
124187
## Step 4: Results Summary
125188

126189
Present results in a clear summary:
127190

128191
```
129192
Preflight Results
130193
131-
Type Checking Passed
132-
Linting 3 errors, 2 warnings
133-
Formatting 5 files need formatting
134-
Tests 42 passed, 0 failed
194+
Type Checking Passed
195+
Linting 3 errors, 2 warnings
196+
Formatting 5 files need formatting
197+
Security Audit 2 vulnerabilities found
198+
Security SAST Passed (semgrep)
199+
Tests 42 passed, 0 failed
135200
136201
Overall: Issues found
137202
```

plugins/ai-workflow/skills/preflight-checks/SKILL.md

Lines changed: 53 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@ Preflight checks are the quality gates that verify code before commits, PRs, or
1414
1. **Type Checking** - Static type verification (TypeScript, MyPy, etc.)
1515
2. **Linting** - Code quality and style enforcement
1616
3. **Formatting** - Consistent code style
17-
4. **Testing** - Unit, integration, and e2e tests
17+
4. **Security Scanning** - Dependency audits and static analysis (SAST)
18+
5. **Testing** - Unit, integration, and e2e tests
1819

1920
## Quick Reference
2021

@@ -91,6 +92,44 @@ pytest # Tests
9192
| Format | `cargo fmt --check` | `cargo fmt` |
9293
| Tests | `cargo test` | N/A |
9394

95+
### Security Scanning (Cross-Platform)
96+
97+
| Tool | Purpose | Command |
98+
|------|---------|---------|
99+
| pnpm audit | Dependency CVE scan | `pnpm audit` or `pnpm audit:check` |
100+
| npm audit | Dependency CVE scan | `npm audit` |
101+
| yarn audit | Dependency CVE scan | `yarn audit` |
102+
| eslint-plugin-security | JS/TS security patterns | Runs with ESLint |
103+
| Semgrep | SAST scanning | `semgrep scan --config auto` |
104+
| Semgrep (Docker) | SAST scanning | See platform-specific commands below |
105+
| pip-audit | Python dependency scan | `pip-audit` |
106+
| cargo-audit | Rust dependency scan | `cargo audit` |
107+
108+
**IMPORTANT: If Semgrep is detected in CI workflows or config files, you MUST run it as part of preflight checks. Do not skip it.**
109+
110+
**Semgrep Detection Priority:**
111+
1. Package.json scripts (e.g., `pnpm run semgrep`)
112+
2. Config files: `.semgreprc.yml`, `.semgrep.yml`, `semgrep.yml`, `.semgrep/`
113+
3. CI workflows: `.github/workflows/*.yml` (extract `--config` flags)
114+
4. **README.md documentation** - ALWAYS check this before trying generic Docker commands
115+
5. Local CLI: `semgrep --version`
116+
6. Docker fallback (see platform-specific commands below)
117+
118+
**Semgrep Docker Commands (AUTOMATIC PLATFORM DETECTION):**
119+
120+
CRITICAL: Detect the platform from environment context and use the correct command automatically.
121+
122+
- **Windows (`win32`):** ALWAYS use `MSYS_NO_PATHCONV=1` prefix:
123+
```bash
124+
MSYS_NO_PATHCONV=1 docker run --rm -v "$(pwd):/src" semgrep/semgrep semgrep scan --config auto /src
125+
```
126+
- **macOS (`darwin`) / Linux:** Standard command:
127+
```bash
128+
docker run --rm -v "$(pwd):/src" semgrep/semgrep semgrep scan --config auto /src
129+
```
130+
131+
**Why `MSYS_NO_PATHCONV=1` is required on Windows:** Git Bash/MSYS2 auto-converts POSIX paths to Windows paths. Without this prefix, `/src` becomes `C:/Program Files/Git/src`, causing "Invalid scanning root" error. DO NOT try without the prefix first on Windows.
132+
94133
## Discovery Strategy
95134

96135
### Step 1: Identify Project Type(s)
@@ -154,12 +193,22 @@ check: lint test
154193
### Step 3: Detect CI Configuration
155194

156195
Check for CI files to align local checks with CI:
157-
- `.github/workflows/*.yml` - GitHub Actions
196+
- `.github/workflows/*.yml` - GitHub Actions (also check for semgrep jobs)
158197
- `.gitlab-ci.yml` - GitLab CI
159198
- `azure-pipelines.yml` - Azure DevOps
160199
- `Jenkinsfile` - Jenkins
161200
- `.circleci/config.yml` - CircleCI
162201

202+
### Step 4: Detect Security Tools
203+
204+
Check for security scanning configuration:
205+
- `package.json` devDependencies for `eslint-plugin-security`
206+
- `package.json` scripts containing `audit` or `semgrep`
207+
- Semgrep config files: `.semgreprc.yml`, `.semgrep.yml`, `semgrep.yml`
208+
- CI workflows for semgrep jobs (extract `--config` flags for local replication)
209+
- `README.md` for documented security commands (often in Security sections)
210+
- Lock files (`pnpm-lock.yaml`, `package-lock.json`, `yarn.lock`) for audit support
211+
163212
## Best Practices
164213

165214
### Execution Order
@@ -168,7 +217,8 @@ Run checks in order of speed and feedback value:
168217
1. **Format check** (fastest, catches style issues)
169218
2. **Type checking** (fast, catches type errors)
170219
3. **Linting** (medium, catches quality issues)
171-
4. **Tests** (slowest, catches logic errors)
220+
4. **Security scanning** (medium, catches vulnerabilities)
221+
5. **Tests** (slowest, catches logic errors)
172222

173223
This order provides fastest feedback on failures.
174224

0 commit comments

Comments
 (0)