Installation
Core Workflow
The typical workflow for using Warden programmatically:- Load configuration - Parse
warden.tomland resolve skill configs - Build event context - Create an EventContext from GitHub events or local files
- Match triggers - Determine which skills should run for the given context
- Run skills - Execute Claude-powered analysis on code changes
- Render output - Format findings as GitHub reviews or markdown
API Reference
The library exports are organized into functional domains:Core Execution
runSkill()- Execute a skill on code changesanalyzeFile()- Analyze a single file’s hunks
Configuration
loadWardenConfig()- Load and parsewarden.tomlresolveSkillConfigs()- Flatten skills into executable triggers
Event Context
buildEventContext()- Parse GitHub webhooks into EventContext
Trigger Matching
matchTrigger()- Check if a trigger matches an eventfilterContextByPaths()- Apply path filters to contextmatchGlob()- Glob pattern matchingshouldFail()- Check if findings exceed threshold
Output Rendering
renderSkillReport()- Format findings for GitHub or CLI
Type System
Warden uses Zod schemas for runtime validation. All core types are exported:Error Handling
Warden exports custom error classes for different failure modes:Authentication Errors
API key issues are surfaced asSkillRunnerError with actionable guidance:
ESM Only
Warden is published as an ESM-only package. Useimport syntax:
TypeScript Configuration
For best results, enable strict mode intsconfig.json:
Next Steps
Run Skills
Execute Claude-powered analysis
Load Config
Parse warden.toml configuration
Build Context
Process GitHub webhooks
Render Output
Format findings for GitHub