agentleFS
Will-SW74Will-SW74/passdown-os/.claude/skills/spectra-audit/SKILL.md

spectra-audit

Skill0 starsChanged 4 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, 3 of them edited.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

1 rule. 0 are common, 1 is distinctive, and 0 are very specific to this project.

  • 0

    Common

    Most of the 4 edited versions we read keep these.

  • 1

    Distinctive

    This author's own choices. Worth a look.

  • 0

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Run git diff HEAD to gather the current changes.

    line 19

“Common” is measured: kept by at least 6 in 10 of the 4 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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Audit changed code for security sharp edges in a Claude Code fork. This generated skill is report-only: it SHALL NOT edit files and SHALL NOT apply fixes directly inside the fork.

Claude fork context

Run git diff HEAD to gather the current changes. If there are no changes, report that no security sharp edges were found and stop.

Analyze the diff through the Scoundrel, Lazy Developer, and Confused Developer lenses. Return a consolidated report with findings grouped by severity, affected files, and recommended fixes. The main thread decides whether to apply any fixes.


Core Framework

Three Adversaries

RoleMindsetKey Questions
ScoundrelMalicious, deliberate exploitationCan I disable security via config? Downgrade algorithms? Inject values?
Lazy DeveloperCopy-paste, skips docs, deadline pressureIs the first example safe? Is the default secure? Do errors guide me right?
Confused DeveloperMisunderstands usageCan 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 wrong

2. 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?!
end

Key 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 auth

5. 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 checks

6. 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

SeverityConditionExample
CriticalDefault or most obvious usage is insecureverify: false is default, empty password accepted
HighEasy misconfiguration breaks securityAlgorithm param accepts "none"
MediumUncommon but possible misconfigurationNegative timeout has unexpected behavior
LowRequires deliberate misuseObscure parameter combination

Rationalization Table

ExcuseWhy It's WrongWhat To Do
"Docs explain it"Devs skip docs under deadlinesMake the safe option the default or only option
"Advanced users need flexibility"Flexibility = foot-gun opportunityProvide safe high-level API, hide low-level primitives
"It's the developer's responsibility"You designed the trapRemove the trap or make it impossible to misuse
"Nobody would do that"Devs under pressure do everythingAssume maximum developer chaos
"It's just a config option"Config is code; wrong config ships to prodValidate config, reject dangerous combinations
"Backwards compatibility"Insecure defaults can't be grandfatheredDeprecate loudly, force migration

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.