security-audit
Skill66 starsChanged 9 months agoMITView on GitHub
Security checklist specific to claude-code-discord-bridge — subprocess injection, env leaks, input validation
- Reads credentials
We split this skill into the rules it gives an agent
4 rules. 0 are common, 3 are distinctive, and 1 is very specific to this project.
0
Common
Most of the 173 edited versions we read keep these.
3
Distinctive
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 12
Before any commit that changes runner.py, _run_helper.py, or any Cog
- Distinctive: line 13
When adding new user-facing commands
- Distinctive: line 14
When modifying subprocess execution or argument passing
- Distinctive: line 15
When adding new environment variables or configuration
“Common” is measured: kept by at least 6 in 10 of the 173 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
Security Audit — claude-code-discord-bridge Specific
This project runs arbitrary Claude Code sessions triggered by Discord messages. Security is the #1 priority.
When to Activate
- Before any commit that changes
runner.py,_run_helper.py, or any Cog - When adding new user-facing commands
- When modifying subprocess execution or argument passing
- When adding new environment variables or configuration
- Periodically as a full audit
Threat Model
| Threat | Vector | Mitigation |
| Command injection | User message passed to CLI args | create_subprocess_exec (no shell), -- separator |
| Flag injection | Prompt starting with - | -- separator before prompt |
| Session hijack | Fake session ID | Strict regex validation ^[a-f0-9\-]+$ |
| Skill injection | Malicious skill name | Strict regex validation ^[\w-]+$ |
| Secret exfiltration | Claude Bash tool reads env | Strip secrets from subprocess env |
| Nesting attack | Claude spawns another claude-code-discord-bridge | Strip CLAUDECODE from env |
| Token theft | Bot token in logs/errors | Never log tokens, strip from env |
Checklist
Subprocess Safety
- All subprocess calls use
asyncio.create_subprocess_exec(NEVERshell=True) --separator is always placed before user-provided prompt text- No string formatting/interpolation of user input into command strings
- Session IDs validated with
re.match(r"^[a-f0-9\-]+$", session_id) - Skill names validated with
re.match(r"^[\w-]+$", name)
Environment Security
_STRIPPED_ENV_KEYSincludes all secret environment variablesDISCORD_BOT_TOKENis stripped from subprocess envCLAUDECODEis stripped (prevents nesting detection bypass)- No secrets in log output (check
logger.info/debug/warning/errorcalls) .envfile is in.gitignore
Input Validation
- All user-provided strings are validated before use
- Discord message content is never directly interpolated into commands
- Thread IDs and channel IDs are validated as integers
- No user input reaches dangerous evaluation functions
Error Handling
- Error messages don't leak internal paths or secrets
- Stack traces are logged (not sent to Discord)
- Failed sessions clean up properly (no zombie processes)
Dependencies
- All dependencies are pinned in
uv.lock - No unnecessary dependencies
- discord.py is from the official PyPI package
Quick Scan Commands
# Search for dangerous patterns
grep -rn "shell=True" claude_discord/
grep -rn "subprocess\.call" claude_discord/
grep -rn "subprocess\.run" claude_discord/
# Check that secrets are stripped
grep -n "_STRIPPED_ENV_KEYS" claude_discord/claude/runner.py
# Verify .env is gitignored
grep "\.env" .gitignoreResponse Protocol
- CRITICAL (injection, secret leak): Stop immediately. Fix before any other work.
- HIGH (missing validation): Fix before committing.
- MEDIUM (logging concern): Fix in the same PR.
- LOW (style/hardening): Track as a follow-up issue.
Other versions195 projects use a version of this.
Word for word · 1
- ebibibi/ebi-agent-chat-relay★ 66100% same
Edited · 0
None found.
Wrote their own version · 194
- ruvnet/claude-flow★ 80ksame name
- ruvnet/ruflo★ 79ksame name
- PostHog/posthog★ 40ksame name
- Donchitos/Claude-Code-Game-Studios★ 27ksame name
- cloudflare/security-audit-skill★ 18ksame name
- rommapp/romm★ 14ksame name
- kubeshark/kubeshark★ 12ksame name
- maximhq/bifrost★ 9.3ksame name
- mono/SkiaSharp★ 5.6ksame name
- MaxMiksa/Auto-Company★ 3.2ksame name
184 more not listed
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.
Used alongsideProjects with it also use create-stories, story-done and 10 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.
lilangMaxSkillcreate-stories
Break a single epic into implementable story files. Reads the epic, its GDD, governing ADRs, and control manifest. Each story embeds its GDD requirement TR-ID, ADR guidance, acceptance criteria, story type, and test evidence path. Run after /create-epics for each epic.
Also in 11 projects that use this
lilangMaxSkillstory-done
End-of-story completion review. Reads the story file, verifies each acceptance criterion against the implementation, checks for GDD/ADR deviations, prompts code review, updates story status to Complete, and surfaces the next ready story from the sprint.
Also in 11 projects that use this
nicepkgSkillcommunity-led-growth
Expert in community-led growth (CLG) - leveraging user communities to drive acquisition, retention, and expansion. Covers building developer communities, user groups, ambassador programs, and turning customers into advocates. Knows the difference between community as a feature vs community as a growth engine, and how to measure community ROI. Use when "community-led, CLG, ambassador program, champion program, user community, developer community, word of mouth, user group, " mentioned.
Also in 5 projects that use this
nicepkgSkillph-community-outreach
Engage Reddit, Indie Hackers, Hacker News and other communities for Product Hunt launches. Use this skill to identify relevant communities, craft appropriate posts, and drive cross-platform engagement without appearing spammy.
Also in 5 projects that use this
- +8 more from lilangMax
In this repository9 other files it gives its agents.
- AGENTS.mdAGENTS.md
- .github/copilot-instructions.mdCopilot instructions
- add-cogSkill
- python-qualitySkill
- releaseSkill
- tddSkill
- test-guideSkill
- verifySkill
- relay-thread-managerSkill
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.

