spectra-audit
Skill45 starsChanged 8 months agoMITView on GitHub
Audit changed code for security sharp edges — dangerous defaults, type confusion, and silent failures
6 other projects use a version of this, 5 of them edited.
Adopted by
Most recently taken up by
- Will-SW74/passdown-osedited, first seen Oct 11, 2026
- DanSnow/hoarder-pipettetheir own version, first seen Oct 8, 2026
- leoho0722/naver-blog-image-downloaderedited, first seen Aug 31, 2026
- PsychQuant/claude-hot-limitedited, first seen Jul 1, 2026
- harrychuang/cursor-skillsedited, first seen Jun 17, 2026
- BananaBay69/claude-code-watchdogedited, first seen Apr 29, 2026
Used with
Projects with it also use spectra-commit, spectra-analyze and 2 more.
Other files people use alongside this one.
Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
BananaBay69Skillspectra-commit
Commit files related to a specific Spectra change
Also in 6 projects that use this
harrychuangSkillspectra-analyze
Analyze artifact consistency for a change
Also in 5 projects that use this
harrychuangSkillspectra-drift
Detect drift between a Spectra change and the current codebase state
Also in 5 projects that use this
- +1 more from harrychuang
Other versions6 projects use a version of this.
Word for word · 0
None found.
Edited · 5
- harrychuang/cursor-skills★ 19100% same
- BananaBay69/claude-code-watchdog★ 2100% same
- leoho0722/naver-blog-image-downloader★ 2100% same
- PsychQuant/claude-hot-limit★ 0100% same
- Will-SW74/passdown-os★ 084% same
Wrote their own version · 1
- DanSnow/hoarder-pipette★ 98same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository18 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- plugin/CLAUDE.mdCLAUDE.md
- spectra-applySkill
- spectra-archiveSkill
- spectra-askSkill
- spectra-auditSkill
- spectra-debugSkill
- spectra-discussSkill
- spectra-ingestSkill
- spectra-proposeSkill
- spectra-applySkill
- spectra-archiveSkill
- spectra-askSkill
- spectra-debugSkill
- spectra-discussSkill
- spectra-ingestSkill
- spectra-proposeSkill
The file
We split this skill into the rules it gives an agent
10 rules. 8 are common, 0 are distinctive, and 2 are very specific to this project.
8
Common
Most of the 6 edited versions we read keep these.
0
Distinctive
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 32
When invoked directly as /spectra-audit:
- Common: line 36
Run git diff HEAD to get the full diff of current modifications.
- Common: line 38
If there are no changes, report "No changes to audit" and stop.
- Common: line 48
Search the diff for:
- Common: line 84
If fixable: apply the fix directly
- Common: line 85
If false positive or not worth changing: skip without debate
- Very specific: line 94
When referenced by /spectra-apply (via spectra instructions --skill audit), do NOT launch the 3-agent workflow above.
- Common: line 98
Before finalizing any code that involves APIs, configuration, parameters, or security-related logic, ask:
- Common: line 106
Stop and fix immediately if you notice:
- Common: line 117
Not every line of code needs audit scrutiny.
“Common” is measured: kept by at least 6 in 10 of the 6 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Audit changed code for security sharp edges — API design traps, dangerous defaults, and interfaces that make it easy to do the wrong thing.
Good APIs don't require developers to "be careful" to stay secure. If the correct usage requires reading docs, remembering rules, or understanding cryptography, the API has failed.
Core principle: Security should be the path of least resistance. Insecure usage should be harder than secure usage.
Two Modes
This skill operates in two modes depending on how it's invoked:
- Standalone (
/spectra-audit): Full 3-agent parallel analysis on current git diff. See Standalone Mode. - Discipline (via
/spectra-applywhenaudit: true): Condensed checklist applied during implementation. See Discipline Mode.
Both modes share the same Core Framework.
Standalone Mode
When invoked directly as /spectra-audit:
Phase 1: Gather Changes
Run git diff HEAD to get the full diff of current modifications.
If there are no changes, report "No changes to audit" and stop.
Phase 2: Parallel 3-Agent Analysis
Launch 3 agents in parallel (one message, 3 tool calls). Each agent receives the full diff and analyzes it through one adversary lens.
Agent 1 — The Scoundrel (壞蛋)
A malicious developer or attacker deliberately manipulating configuration.
Search the diff for:
- Config options that can disable security mechanisms
- Algorithm parameters that accept downgrades (e.g.,
"none","md5") - Values that can be injected to bypass validation
- Dangerous config combinations (e.g.,
auth_required: true+bypass_auth_for_health: true+health_check_path: "/") - String concatenation in security-critical paths (permissions, queries, paths)
Agent 2 — The Lazy Developer (懶惰的開發者)
A developer who copy-pastes examples and skips documentation.
Search the diff for:
- Unsafe defaults:
verify: false,timeout: 0, empty strings as keys - Zero/nil/empty behavior: what does
timeout=0,max_attempts=0,key=""mean? - Error messages that don't guide toward secure usage
- The "first example found" test: is the most obvious usage secure?
- Path of least resistance: does the simplest way to use this API produce secure results?
Agent 3 — The Confused Developer (搞混的開發者)
A developer who misunderstands API usage.
Search the diff for:
- Parameters that can be swapped without type errors (e.g.,
encrypt(msg, key, nonce)— key and nonce are both strings) - Silent failures: security checks that return true/false where the return value can be ignored
- Raw primitives where semantic types should exist (strings for keys, bytes for nonces)
- Configuration cliffs: one wrong value = catastrophe with no warning (e.g.,
verify_ssl: fasle) - Stringly-typed security: permissions as comma-separated strings instead of enums
Phase 3: Consolidate and Fix
Merge findings from all 3 agents. For each finding:
- If fixable: apply the fix directly
- If false positive or not worth changing: skip without debate
- Classify severity: Critical / High / Medium / Low
End with a brief summary of what was fixed (or confirm the code is clean).
Discipline Mode
When referenced by /spectra-apply (via spectra instructions --skill audit), do NOT launch the 3-agent workflow above. Instead, apply this condensed checklist continuously during implementation.
Quick 3-Role Check
Before finalizing any code that involves APIs, configuration, parameters, or security-related logic, ask:
- Scoundrel: Can this be abused? Can config disable security? Can values be injected?
- Lazy Developer: Is the default safe? Will copy-paste usage be secure? Does the error message guide correctly?
- Confused Developer: Can params be swapped? Will wrong usage fail loudly? Are types distinct enough?
Red Flags During Implementation
Stop and fix immediately if you notice:
- Adding a string parameter for security-related logic → use enum or newtype
- Adding a config option that defaults to
false→ is the "off" state safe? if value == 0orif key.nil?→ what does zero/nil MEAN in this context?- Security check returns true/false → can the return value be ignored?
- Accepting algorithm/mode as a parameter → can it be hardcoded to the safe choice?
- Adding a config option without validation → what happens with invalid/malicious values?
When to Engage
Not every line of code needs audit scrutiny. Focus on:
- New function signatures and public APIs
- Configuration options and their defaults
- Authentication, authorization, encryption interfaces
- Input validation and error handling at system boundaries
- Anywhere a developer makes a security-relevant choice
Core Framework
Three Adversaries
| Role | Mindset | Key Questions |
| Scoundrel | Malicious, deliberate exploitation | Can I disable security via config? Downgrade algorithms? Inject values? |
| Lazy Developer | Copy-paste, skips docs, deadline pressure | Is the first example safe? Is the default secure? Do errors guide me right? |
| Confused Developer | Misunderstands usage | Can I swap params silently? Will mistakes fail loudly? Are types distinguishable? |
Six Trap Categories
1. Algorithm Choice Traps
Letting developers choose algorithms = inviting them to choose wrong.
# Dangerous: accepts arbitrary algorithm
OpenSSL::Digest.new(algorithm).hexdigest(password) # algorithm = "md5"?
# Safe: no choice
BCrypt::Password.create(password) # can't pick wrong2. Dangerous Defaults
Defaults that are insecure, or zero/empty values that disable security.
# What does timeout=0 mean? Never expire? Expire immediately?
def verify_token(token, timeout: 300)
return true if timeout == 0 # 0 = skip verification?!
endKey question: What do timeout=0, max_attempts=0, key="", nil each mean?
3. Raw Primitives vs Semantic Types
Using raw bytes/strings instead of meaningful types invites type confusion.
# Dangerous: both params are strings, swappable
encrypt(message, key, nonce)
# Safe: types protect against swapping
encrypt(message, Key.new(k), Nonce.new(n))4. Configuration Cliffs
One wrong config value = disaster, with no warning.
# A typo = security mechanism disappears
verify_ssl: fasle # not "false", might be treated as truthy?
# Dangerous combination
auth_required: true
bypass_auth_for_health: true
health_check_path: "/" # oops, entire site bypasses auth5. Silent Failures
Security errors that don't surface, or "success" masking failure.
# Silent bypass
def verify_signature(sig, data, key)
return true if key.nil? # no key = skip verification?!
end
# Return value ignored
result = crypto.verify(data, sig) # returns false but nobody checks6. Stringly-Typed Security
Security-critical values as plain strings = open door for injection and confusion.
# Dangerous: string concatenation
permissions = "read,write"
permissions += ",admin" # too easy to escalate
# Safe: use enums
permissions = Set[Permission::READ, Permission::WRITE]Severity Classification
| Severity | Condition | Example |
| Critical | Default or most obvious usage is insecure | verify: false is default, empty password accepted |
| High | Easy misconfiguration breaks security | Algorithm param accepts "none" |
| Medium | Uncommon but possible misconfiguration | Negative timeout has unexpected behavior |
| Low | Requires deliberate misuse | Obscure parameter combination |
Rationalization Table
| Excuse | Why It's Wrong | What To Do |
| "Docs explain it" | Devs skip docs under deadlines | Make the safe option the default or only option |
| "Advanced users need flexibility" | Flexibility = foot-gun opportunity | Provide safe high-level API, hide low-level primitives |
| "It's the developer's responsibility" | You designed the trap | Remove the trap or make it impossible to misuse |
| "Nobody would do that" | Devs under pressure do everything | Assume maximum developer chaos |
| "It's just a config option" | Config is code; wrong config ships to prod | Validate config, reject dangerous combinations |
| "Backwards compatibility" | Insecure defaults can't be grandfathered | Deprecate loudly, force migration |
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

