artimath/effect-skills/effect-deep-audit
Claude Code and agent skill by artimath/effect-skills
- community
Checking that the SKILL.md file is still in the repository.
Deep audit of an Effect-TS codebase against actual Effect core team patterns. Produces a tiered finding list + executable DAG plan, then systematically rewrites non-idiomatic code. USE THIS SKILL WHEN: 'audit this effect code', 'is this idiomatic effect', 'deep audit', starting a new Effect project and want to verify patterns, refactoring an Effect codebase toward library-grade quality, reviewing code before it ships to production. NOT FOR: Greenfield Effect projects (use effectts skill).
Install
npx vskill@latest install artimath/effect-skills/effect-deep-auditSKILL.md
Effect Deep Audit
Systematic methodology for bringing an Effect codebase to library-grade quality, battle-tested across full-stack audits covering auth, middleware, schemas, repos, event handlers, API groups, and tests.
Prerequisites (Optional)
- Effect source (recommended):
git clone https://github.com/Effect-TS/effectfor pattern verification - Effect MCP: https://github.com/tim-smart/effect-mcp for API lookups (fallback: https://effect.website/docs)
The Process
Phase 1: Reconnaissance (DO THIS FIRST)
Verify against Effect source, not docs. Docs lag. Source is truth.
If you have effect-mcp configured, also use effect_docs_search({ query: "..." }) for API concepts.
Check what your framework already provides. Before writing custom code, grep the framework source. This is consistently the highest-leverage finding in audits — frameworks often provide operations that hundreds of lines of custom code reimplement.
Phase 2: Tiered Finding Classification
Audit every file in the target. Classify each finding:
| Tier | Tag | What | Priority | |
|---|---|---|---|---|
| 0 | BUG | Code that doesn't execute or produces wrong results | Fix immediately | |
| 1 | PERF | Unnecessary work (double resolution, N+1, redundant queries) | Fix in same pass | |
| 2 | SCHEMA | Manual mappers, hand-written schemas that mirror tables, as casts | High — schema drift is a bug factory | |
| 3 | ARCH | Monolith files, duplicated helpers, wrong abstraction boundaries | Medium — affects velocity | |
| 4 | IDIOM | Non-idiomatic but correct (DateTime.unsafeNow, missing spans, process.env) | Low — clean up after structural work | |
| 5 | FINE | Confirmed correct. Document why to prevent future "fixes" | N/A |
Specific patterns to grep for:
Phase 3: Plan as DAG
Structure the plan as a dependency graph. Key insight: type errors cascade. Changing a schema breaks every consumer. Changing a service interface breaks every implementation. Work bottom-up:
Each layer gates on: 0 type errors + all tests passing. Do NOT proceed to the next layer with errors. The type checker is your friend — it tells you every callsite that needs updating.
Phase 4: Execution
Parallelize mechanical work. Schema renames, import fixes, field renames across 20 files — these are perfect for parallel agents. Save judgment-heavy work for files that require it (handler rewrites, middleware logic, layer composition).
Keep tests green. Run tsc --noEmit + vitest run after EVERY structural change. If you have 14 errors, fix all 14 before moving on. Compounding errors across layers is how 3-hour debugging sessions happen.
Delete aggressively. No backwards compat shims. No renamed _unused vars. No // removed comments. If code is dead, rm it. Git has history.
Key Patterns Discovered
createSelectSchema = sole schema source of truth
Every API response schema derives from a Drizzle table:
Critical: Use Schema.DateTimeUtc (Encoded=string), NOT Schema.DateTimeUtcFromDate (Encoded=Date). DateTimeUtcFromDate breaks HTTP JSON round-trips because the encoded form is a Date object, not a string. This bug was found in multiple domain packages during audits.
Nullable columns with overrides need `S.NullOr()` wrapping — the override replaces the full column schema including auto-nullability.
Handlers decode inline — no mapper functions:
Single middleware pattern
One middleware that: resolves session, checks authorization, provides context. Not two middlewares where the second re-resolves what the first already resolved.
Effect.logError is an Effect, not a statement
Tracing
- Use
Effect.fn("Service.method")for service method definitions (preferred — combines function definition + automatic span) - Use
Effect.withSpanonly when wrapping existing effects in pipe chains - Add
Effect.annotateLogs("service", "ServiceName")to every service module
Monolith handler files -> one file per API group
A 500-line handler file with all routes is unnavigable. Split into:
groups/HealthGroupLive.tsgroups/AdminGroupLive.tsgroups/UserManagementGroupLive.ts- etc.
The main handler file becomes pure layer wiring (~30-50 lines).
Shared error helpers go in a dedicated module, not duplicated across group files.
DateTime.now vs DateTime.unsafeNow
DateTime.unsafeNow() is sync. DateTime.now is effectful. In Effect.gen contexts, always use yield* DateTime.now. The "unsafe" prefix exists for a reason — it bypasses the Effect runtime's clock, which matters for testing and time-travel debugging.
Checklist (run after every audit)
References
| Reference | Content | |
|---|---|---|
effectts skill | Idiomatic Effect patterns (services, layers, errors) | |
| Effect source | Grep here for real patterns, not docs — git clone https://github.com/Effect-TS/effect |
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewNot runA model review is scheduled for the next rescan.
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/effect-deep-audit/SKILL.md
Popularity
- Repository stars
- 8
- 7-day trend score
- 8
Stars and forks are for the whole GitHub repository, not this skill alone. Refreshed 23 Mar 2026, 8 months ago.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/artimath/effect-skills/effect-deep-audit)