warden
Skill2 starsChanged todayMITView on GitHub
Detects code smell, complexity violations, architectural boundary breaches, dead code, and dependency decay in project code. Runs on every PR diff and on demand for full codebase scans. The chaos does not arrive all at once — The Warden is here for the accumulation. Use on PR diffs and codebase quality scans.
7 other projects use a version of this.
Adopted by
Most recently taken up by
- thatmike1/claude-skillstheir own version, first seen Oct 26, 2026
- fhgomes/my-awesome-agents-skillstheir own version, first seen Oct 13, 2026
- cameroncooke/XcodeBuildMCPtheir own version, first seen Oct 8, 2026
- Arshgill01/manifesttheir own version, first seen Oct 3, 2026
- getsentry/MobileBuildMCPtheir own version, first seen Sep 23, 2026
- getsentry/XcodeBuildMCPtheir own version, first seen Sep 23, 2026
Used with
Projects with it also use mobilebuildmcp-cli, mobilebuildmcp-docs-command-review and 9 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.
SentrySkillmobilebuildmcp-cli
Official skill for the MobileBuildMCP CLI. Use when doing iOS/macOS/watchOS/tvOS/visionOS work (build, test, run, debug, log, UI automation).
Also in 3 projects that use this
SentrySkillmobilebuildmcp-docs-command-review
Use when reviewing MobileBuildMCP changelog CLI command references for invalid current guidance while allowing historical migration examples.
Also in 3 projects that use this
- +9 more from getsentry
Other versions7 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 7
- cameroncooke/XcodeBuildMCP★ 6.5ksame name
- getsentry/MobileBuildMCP★ 6.5ksame name
- getsentry/XcodeBuildMCP★ 6.5ksame name
- getsentry/warden★ 424same name
- thatmike1/claude-skills★ 10same name
- fhgomes/my-awesome-agents-skills★ 5same name
- Arshgill01/manifest★ 2same 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 repository60 other files it gives its agents.
- AGENTS.mdAGENTS.md
- accessibility-auditorSkill
- architectSkill
- auditorSkill
- awsSkill
- bug-fix-teammateSkill
- builderSkill
- cleanup-specialistSkill
- code-reviewSkill
- commit-messagesSkill
- concept-explainerSkill
- context-economySkill
- cross-provider-translationSkill
- datadogSkill
- debuggerSkill
- debugging-and-error-recoverySkill
- debugging-tutorSkill
- dockerSkill
- doormanSkill
- elasticsearchSkill
- emailSkill
- envoySkill
- githubSkill
- gitlabSkill
- goal-refinementSkill
- heraldSkill
- implementation-plannerSkill
- inspectorSkill
- institutional-knowledgeSkill
- issue-managerSkill
- jiraSkill
- kubernetesSkill
- librarianSkill
- linearSkill
- mailmanSkill
- mediatorSkill
- mongodbSkill
- mysqlSkill
- onboarding-planSkill
- operatorSkill
- oracleSkill
- postgresSkill
- pull-request-assistantSkill
- redisSkill
- release-notesSkill
- rememberSkill
- reviewerSkill
- runtime-healthSkill
- scribeSkill
- security-and-hardeningSkill
- sentinelSkill
- sentrySkill
- society-integritySkill
- spec-driven-developmentSkill
- stewardSkill
- strategistSkill
- telegramSkill
- test-driven-developmentSkill
- testerSkill
- validation-and-enforcementSkill
The file
We split this skill into the rules it gives an agent
12 rules. 0 are common, 9 are distinctive, and 3 are very specific to this project.
0
Common
Most of the 7 edited versions we read keep these.
9
Distinctive
This author's own choices. Worth a look.
3
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 21
Before merging to main — confirm the branch does not worsen the codebase's health score
- Distinctive: line 22
After a large refactor — verify the refactor did not introduce new coupling
- Distinctive: line 24
When the codebase feels slow or brittle — before attributing it to something else
- Very specific: line 32
Run git diff origin/main...HEAD --name-only to get changed files
- Distinctive: line 56
Check for the following categories in scanned files:
- Distinctive: line 61
When flagging: name the function, line count, and file:line location
- Distinctive: line 70
When flagging: name the function and the deepest block
- Distinctive: line 80
When flagging: list all locations of the duplicate
- Distinctive: line 101
Add 1 for the function itself
- Very specific: line 126
If the project has a custom architecture, read docs/architecture/ or equivalent before scanning.
- Very specific: line 130
When running a full scan (/warden dead-code):
- Distinctive: line 138
Do not flag test files for unused exports — test utilities are legitimately not imported elsewhere.
“Common” is measured: kept by at least 6 in 10 of the 7 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
The Warden
Overview
The Warden watches for the conditions that produce bugs before the bugs appear. Code smell is not a style preference — it is a leading indicator of where the next defect will live. A function with eight parameters will be called wrong. A file with 800 lines will have a bug nobody finds because nobody reads it all. A circular dependency will produce an import error nobody can explain. The Warden sees these things while they are still cheap to fix.
When to Use
- On every PR — scan the diff for new smells introduced by the change
- Before merging to main — confirm the branch does not worsen the codebase's health score
- After a large refactor — verify the refactor did not introduce new coupling
- On demand — full codebase scan to establish or revisit a health baseline
- When the codebase feels slow or brittle — before attributing it to something else
Process
PR Diff Scan
On every PR, scan only the changed files to keep the check fast:
- Run
git diff origin/main...HEAD --name-onlyto get changed files - For each changed file, check against all smell categories below
- Produce a report showing new smells introduced (not pre-existing ones)
- Block the PR if any BLOCKING threshold is exceeded on changed lines
- Warn (not block) for WARNING threshold violations
Report format:
Warden Scan — PR #42 (feat/user-preferences)
Date: YYYY-MM-DD
Files scanned: 4
✅ No blocking violations
⚠️ Warnings (2):
src/components/PreferencesForm.tsx:87
Function `handleSubmit` is 52 lines (warning threshold: 40)
src/api/preferences.ts:23
Nesting depth 4 in `validatePayload` (warning threshold: 3)
Smell-free files: src/hooks/usePreferences.ts, src/types/preferences.tsCode Smell Detection
Check for the following categories in scanned files:
Long functions
- Count lines per function/method (excluding blank lines and comments)
- Warning: >40 lines. Blocking: >80 lines
- When flagging: name the function, line count, and file:line location
Large files
- Count total lines per file
- Warning: >300 lines. Blocking: >500 lines
Deep nesting
- Count maximum nesting depth (if/for/while/try blocks)
- Warning: >3. Blocking: >5
- When flagging: name the function and the deepest block
Too many parameters
- Count parameters per function signature
- Warning: >4. Blocking: >7
- Exception: config/options objects (single object parameter) are not flagged
Duplicated logic
- Identify blocks of >10 lines that are near-identical across two or more locations
- Warning: >10 lines. Blocking: >20 lines
- When flagging: list all locations of the duplicate
Inconsistent naming
- Within a single file: flag mixed conventions (camelCase + snake_case for the same type of identifier)
- Flag variables named with single letters outside of loop counters (
i,j,k) - Flag boolean variables not prefixed with
is,has,should, orcan
Feature envy
- Flag functions that call methods on another module more than they use their own module's data
- Indicates the function likely belongs in the other module
Dead code
- Exported symbols (functions, types, constants) with no import found in the project
- Variables declared but never read
- Conditions that are always true or always false
console.log,print,debuggerstatements in non-test files
Complexity Enforcement
For each function in the diff, compute cyclomatic complexity:
- Count:
if,else if,for,while,case,catch,&&,||, ternary? - Add 1 for the function itself
- Warning: >10. Blocking: >20
When blocking, provide:
- Function name and location
- Complexity score
- The top 3 branches contributing most to complexity
- Suggested decomposition: "Extract
validateInput(handles 4 branches) andprocessResult(handles 3 branches)"
Architectural Boundary Violations
Detect imports that cross layer boundaries. Default layer order (innermost to outermost):
domain / core → no imports from outer layers
application → may import from domain only
infrastructure → may import from application and domain
presentation / ui → may import from application only; never from infrastructure directlyDetection steps:
- Identify the project's layer structure from directory names and existing imports
- For each import in the diff, check if it crosses a boundary inward
- Flag:
ui/PreferencesForm.tsx imports from db/queries.ts — UI must not import from infrastructure
If the project has a custom architecture, read docs/architecture/ or equivalent before scanning.
Dead Code Audit
When running a full scan (/warden dead-code):
- Build an import graph: which files import which exports
- Find exports with zero importers — flag as UNUSED EXPORT
- Find variables assigned but never read within their scope — flag as DEAD VARIABLE
- Find commented-out code blocks (>3 lines) — flag as COMMENTED BLOCK with file:line
- Find
TODOandFIXMEcomments — list with age if determinable fromgit log
Do not flag test files for unused exports — test utilities are legitimately not imported elsewhere.
Dependency Hygiene
Scan package.json, requirements.txt, Pipfile, go.mod, Cargo.toml, or equivalent:
Wildcard versions — flag any *, latest, or overly broad range (^0.x, >=1.0.0)
Unused dependencies — cross-reference declared deps against actual imports in source
Duplicate functionality — flag pairs like lodash + underscore, moment + dayjs
Deprecated packages — flag packages marked deprecated on their registry page
Dev deps in production — flag packages in dependencies that are only used in tests or scripts
Red Flags
- A function whose purpose cannot be stated in one sentence — complexity has won
- A file that is the only place that knows about two unrelated things
- Any
// TODO: fix this properlycomment older than one sprint - A dependency version pinned to
latestin a production manifest - Dead code defended with "we might need it later"
- A test file with no assertions (it passes but proves nothing)
- Circular imports between any two modules
Rationalizations
| What you think | What The Warden knows |
| "The function is long but it's readable" | Readability and length are not the same thing. A 90-line function cannot be held in working memory. It will be misread by the next person and mischanged by the one after that. |
| "We'll refactor it after the deadline" | The deadline passes. The next one begins. The function stays. Six months from now nobody remembers why it was left and everyone is afraid to touch it. |
| "The duplication is fine, they just look similar" | They look similar because they do the same thing. When the logic changes, it will be changed in one place and not the other. That is where the bug will live. |
| "Dead code doesn't hurt anything" | It hurts comprehension. Every reader must determine whether it is dead or dormant. That cost is paid on every read, forever. |
| "The architectural violation is just this once" | The second violation is easier to justify than the first. The third is routine. By the tenth, the architecture no longer exists. |
Verification
The Warden's scan is complete when:
- All changed files in the diff have been scanned
- No BLOCKING violations remain unresolved
- All WARNING violations are acknowledged — either fixed or explicitly accepted with justification
- No new architectural boundary violations introduced
- No dead code added (new unused exports, new commented-out blocks)
- Dependency manifest has no new wildcard versions
- Full scan baseline (if run) is recorded for comparison at next scan
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.

