ワンクリックで
safety-pattern-auditor
Systematic audit of safety patterns to identify gaps, regressions, and improvement opportunities
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
メニュー
Systematic audit of safety patterns to identify gaps, regressions, and improvement opportunities
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
SOC 職業分類に基づく
Run the pragmatic-skeptic 'ponytail' reviewer over the current diff to surface over-engineering — code, abstractions, dependencies, files, or process steps the problem does not need. Read-only and advisory; never trims safety, security, accessibility, data-loss handling, or their tests. Use before pushing a PR, when a change feels heavier than the task warranted, or when boilerplate/a new dependency crept in. Triggers: 'ponytail review', 'is this over-engineered', 'what can I delete here', 'did I over-build this'.
Use this skill to run a structured user-discovery interview for Caro and save the transcript into docs/discovery/transcripts/ under the project's anonymization rules. Use when a new product line or major feature spec needs to clear Gate 1 of .claude/rules/validation-discipline.md (the 20-transcripts rule). Also use to synthesize transcripts into the hypothesis ledger after each batch of 5 interviews. Triggers - "run a discovery interview for <feature>", "log this user conversation as a Caro discovery transcript", "synthesize this week's transcripts into the hypothesis ledger".
Safely reclaim disk space in the caro project. Cleans Rust build cache, stale git worktrees (both .claude/worktrees/ and .worktrees/), empty stubs, and node_modules using a tiered audit that preserves any worktree with uncommitted changes, missing remotes, or a lock file. Use when du shows the project > 30 GB or disk free is low.
DEPRECATED 2026-05-16 — use caro-shell instead. This skill recommends the --backend claude flag and a ~/.config/caro/config.toml path that do not work on the current caro 1.4.0 binary, and its 522-line educational body is 4× the size of caro-shell for no benefit to an agent. Will be removed after 2026-08-01.
Use this skill when the user needs a POSIX shell command synthesized from natural language — "how do I find/grep/awk/find files modified in the last hour", "kill the process on port 3000", "tar this up excluding .git", or any other terminal-task-as-prose. Shells out to the `caro` CLI for safety-validated command inference and presents the suggestion for explicit approval. Refuses to execute the command itself.
Build, render, ship, AND MAINTAIN the caro landing-page demo video using Remotion. Use when creating, updating, re-rendering, extending the project demo MP4 at website/public/caro-demo.mp4 — or when responding to a drift alert from the caro-demo-drift CI workflow or a beads task with label `caro-demo-video`.
| name | safety-pattern-auditor |
| description | Systematic audit of safety patterns to identify gaps, regressions, and improvement opportunities |
Purpose: Conduct comprehensive audits of safety pattern coverage to find vulnerabilities before attackers do.
When to Use:
Duration: 1-3 hours depending on audit scope
./scripts/analyze-pattern-gaps.py./scripts/capture-safety-baseline.shcargo build --release.claude/beta-testing/test-cases.yamlPhase 1: Baseline Capture (10 min)
↓
Phase 2: Gap Analysis (20 min)
↓
Phase 3: Regression Testing (15 min)
↓
Phase 4: Priority Assessment (30 min)
↓
Phase 5: Report & Recommendations (30 min)
Goal: Establish current state of pattern coverage.
Capture pattern metrics:
./scripts/capture-safety-baseline.sh .claude/audits/baseline-$(date +%Y%m%d).json
Review baseline:
cat .claude/audits/baseline-$(date +%Y%m%d).json | python3 -m json.tool
Key metrics:
Document starting point:
## Audit Baseline - 2026-01-08
- Total Patterns: 52
- Critical: 23
- High: 16
- Medium: 0
- Test Pass Rate: 4/4 (100%)
Goal: Use automated tools to find missing coverage.
Run gap analyzer:
./scripts/analyze-pattern-gaps.py src/safety/patterns.rs \
-o .claude/audits/gaps-$(date +%Y%m%d).md
Review gap report:
cat .claude/audits/gaps-$(date +%Y%m%d).md
Categorize gaps by detector type:
# Count gaps by type
grep "**Type**: argument_order" .claude/audits/gaps-*.md | wc -l
grep "**Type**: path_variant" .claude/audits/gaps-*.md | wc -l
grep "**Type**: wildcard" .claude/audits/gaps-*.md | wc -l
grep "**Type**: platform" .claude/audits/gaps-*.md | wc -l
Extract critical gaps:
./scripts/analyze-pattern-gaps.py src/safety/patterns.rs \
--min-severity critical
Argument Order Gaps:
Path Variant Gaps:
Wildcard Gaps:
Platform Gaps:
Goal: Ensure no regressions introduced recently.
Run regression checker:
./scripts/check-safety-regressions.sh .claude/audits/baseline-*.json
Run full test suite:
./target/release/caro test --backend static \
--suite .claude/beta-testing/test-cases.yaml
Check pattern compilation:
cargo test --lib safety::patterns --quiet
Test false positives (sample safe commands):
echo "cd .." | ./target/release/caro --backend static
echo "ls -la" | ./target/release/caro --backend static
echo "cp file.txt backup/" | ./target/release/caro --backend static
All should be ALLOWED.
Goal: Triage gaps and create action plan.
Count gaps by severity:
./scripts/analyze-pattern-gaps.py src/safety/patterns.rs \
--format json | jq '.gaps | group_by(.severity) | map({severity: .[0].severity, count: length})'
Assess each critical gap: For each critical gap, determine:
Create priority matrix:
| Gap ID | Severity | Likelihood | Ease | Coverage | Fix | Priority |
|---|---|---|---|---|---|---|
| GAP-001 | Critical | High | Easy | None | Simple | P0 |
| GAP-002 | Critical | Medium | Medium | Partial | Medium | P1 |
| GAP-015 | High | High | Easy | None | Simple | P1 |
Priority Levels:
Estimate effort:
P0 gaps: 3 × 1h = 3 hours
P1 gaps: 8 × 1h = 8 hours
P2 gaps: 15 × 1h = 15 hours
Total: 26 hours to close all high-priority gaps
Goal: Produce actionable audit report with clear next steps.
Generate executive summary:
# Safety Pattern Audit Report - 2026-01-08
## Executive Summary
**Status**: 🟡 NEEDS ATTENTION
- Total Patterns: 52
- Gaps Found: 202 (21 critical, 90 high, 87 medium, 4 low)
- Regressions: 0
- False Positives: 0
- Test Coverage: 100%
**Key Findings**:
- 21 critical gaps require immediate attention
- Argument order variations are the most common gap type
- Platform coverage (PowerShell/CMD) is incomplete
**Recommendation**: Address 3 P0 gaps before next release.
Create detailed findings: Use the gap analyzer report + your assessments.
List actionable recommendations:
## Recommendations
### Immediate (P0) - Complete before release
1. **GAP-003**: Add parent directory deletion pattern
- Command: `rm -rf ../`
- Effort: 1 hour
- Owner: Security team
2. **GAP-012**: Add dd argument order pattern
- Command: `dd of=/dev/sda if=/dev/zero`
- Effort: 1 hour
- Owner: Security team
3. **GAP-018**: Add recursive wildcard pattern
- Command: `rm -rf **`
- Effort: 1 hour
- Owner: Security team
### Short-term (P1) - Next 2 weeks
[List P1 gaps with estimates]
### Long-term (P2) - Next quarter
[List P2 gaps]
### Process Improvements
- Run gap analyzer in CI/CD before merge
- Add pre-commit hook to block pattern regressions
- Monthly security audit schedule
Track audit metrics over time:
## Trend Analysis
| Date | Patterns | Critical Gaps | High Gaps | Total Gaps |
|------|----------|---------------|-----------|------------|
| 2025-12-01 | 45 | 28 | 102 | 215 |
| 2026-01-01 | 48 | 24 | 95 | 205 |
| 2026-01-08 | 52 | 21 | 90 | 202 |
**Trend**: ✅ Improving (gaps decreasing)
Save audit artifacts:
mkdir -p .claude/audits/2026-01-08/
mv .claude/audits/baseline-*.json .claude/audits/2026-01-08/
mv .claude/audits/gaps-*.md .claude/audits/2026-01-08/
cp priority-matrix.md .claude/audits/2026-01-08/
┌─────────────────────────────────────────────────────────┐
│ SAFETY PATTERN AUDIT CHECKLIST │
├─────────────────────────────────────────────────────────┤
│ │
│ ☐ Phase 1: Baseline captured │
│ ☐ Phase 2: Gap analyzer run │
│ ☐ Phase 3: Regression tests passed │
│ ☐ Phase 4: Gaps prioritized (P0/P1/P2/P3) │
│ ☐ Phase 5: Report written & shared │
│ │
│ ☐ No regressions detected │
│ ☐ No false positives found │
│ ☐ P0 gaps identified (<3 acceptable) │
│ ☐ Action plan with owners assigned │
│ ☐ Audit artifacts saved │
└─────────────────────────────────────────────────────────┘
See examples/audit-report-template.md for a complete template.
Key sections:
Audit is complete when:
The auditor skill wraps the gap analyzer tool with:
Gap Analyzer (automated):
Auditor Skill (human-guided):
Typical: 20+ critical gaps Solution: Focus on P0 subset (3-5 gaps), tackle incrementally
Typical: 60%+ are argument order Solution: Use flexible regex patterns with optional groups
Typical: 30+ PowerShell gaps Solution: Create platform-specific patterns with shell_specific field
Typical: <50% pass rate Solution: Expand test suite before adding patterns
Resources:
./scripts/analyze-pattern-gaps.py --help./scripts/capture-safety-baseline.sh./scripts/check-safety-regressions.sh.claude/skills/safety-pattern-developer/If stuck:
examples/audit-report-template.md.claude/audits/This skill provides systematic auditing to maintain high safety pattern quality and catch vulnerabilities early.