@sentry/warden 0.13.0 → 0.15.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (132) hide show
  1. package/agents.lock +7 -0
  2. package/dist/cli/args.d.ts +15 -12
  3. package/dist/cli/args.d.ts.map +1 -1
  4. package/dist/cli/args.js +61 -3
  5. package/dist/cli/args.js.map +1 -1
  6. package/dist/cli/commands/add.d.ts.map +1 -1
  7. package/dist/cli/commands/add.js +25 -33
  8. package/dist/cli/commands/add.js.map +1 -1
  9. package/dist/cli/commands/init.d.ts +0 -3
  10. package/dist/cli/commands/init.d.ts.map +1 -1
  11. package/dist/cli/commands/init.js +206 -19
  12. package/dist/cli/commands/init.js.map +1 -1
  13. package/dist/cli/commands/logs.d.ts +19 -0
  14. package/dist/cli/commands/logs.d.ts.map +1 -0
  15. package/dist/cli/commands/logs.js +412 -0
  16. package/dist/cli/commands/logs.js.map +1 -0
  17. package/dist/cli/commands/setup-app.d.ts.map +1 -1
  18. package/dist/cli/commands/setup-app.js +19 -15
  19. package/dist/cli/commands/setup-app.js.map +1 -1
  20. package/dist/cli/context.d.ts +2 -0
  21. package/dist/cli/context.d.ts.map +1 -1
  22. package/dist/cli/context.js +8 -2
  23. package/dist/cli/context.js.map +1 -1
  24. package/dist/cli/files.d.ts.map +1 -1
  25. package/dist/cli/files.js +27 -30
  26. package/dist/cli/files.js.map +1 -1
  27. package/dist/cli/git.d.ts +8 -3
  28. package/dist/cli/git.d.ts.map +1 -1
  29. package/dist/cli/git.js +24 -13
  30. package/dist/cli/git.js.map +1 -1
  31. package/dist/cli/index.js +10 -0
  32. package/dist/cli/index.js.map +1 -1
  33. package/dist/cli/input.d.ts +7 -0
  34. package/dist/cli/input.d.ts.map +1 -1
  35. package/dist/cli/input.js +13 -2
  36. package/dist/cli/input.js.map +1 -1
  37. package/dist/cli/main.d.ts.map +1 -1
  38. package/dist/cli/main.js +108 -32
  39. package/dist/cli/main.js.map +1 -1
  40. package/dist/cli/output/formatters.d.ts +2 -1
  41. package/dist/cli/output/formatters.d.ts.map +1 -1
  42. package/dist/cli/output/formatters.js +22 -19
  43. package/dist/cli/output/formatters.js.map +1 -1
  44. package/dist/cli/output/index.d.ts +1 -1
  45. package/dist/cli/output/index.d.ts.map +1 -1
  46. package/dist/cli/output/index.js +1 -1
  47. package/dist/cli/output/index.js.map +1 -1
  48. package/dist/cli/output/ink-runner.js +1 -1
  49. package/dist/cli/output/ink-runner.js.map +1 -1
  50. package/dist/cli/output/jsonl.d.ts +49 -13
  51. package/dist/cli/output/jsonl.d.ts.map +1 -1
  52. package/dist/cli/output/jsonl.js +137 -4
  53. package/dist/cli/output/jsonl.js.map +1 -1
  54. package/dist/cli/output/tasks.d.ts.map +1 -1
  55. package/dist/cli/output/tasks.js +1 -22
  56. package/dist/cli/output/tasks.js.map +1 -1
  57. package/dist/cli/terminal.d.ts.map +1 -1
  58. package/dist/cli/terminal.js +0 -2
  59. package/dist/cli/terminal.js.map +1 -1
  60. package/dist/config/schema.d.ts +49 -98
  61. package/dist/config/schema.d.ts.map +1 -1
  62. package/dist/config/schema.js +0 -12
  63. package/dist/config/schema.js.map +1 -1
  64. package/dist/config/writer.d.ts.map +1 -1
  65. package/dist/config/writer.js +18 -0
  66. package/dist/config/writer.js.map +1 -1
  67. package/dist/evals/index.js +1 -1
  68. package/dist/evals/index.js.map +1 -1
  69. package/dist/evals/runner.d.ts.map +1 -1
  70. package/dist/evals/runner.js +0 -1
  71. package/dist/evals/runner.js.map +1 -1
  72. package/dist/evals/types.d.ts +9 -15
  73. package/dist/evals/types.d.ts.map +1 -1
  74. package/dist/output/github-checks.d.ts +1 -1
  75. package/dist/output/github-checks.d.ts.map +1 -1
  76. package/dist/output/github-checks.js +2 -6
  77. package/dist/output/github-checks.js.map +1 -1
  78. package/dist/output/github-issues.d.ts.map +1 -1
  79. package/dist/output/github-issues.js +14 -8
  80. package/dist/output/github-issues.js.map +1 -1
  81. package/dist/output/issue-renderer.js +1 -1
  82. package/dist/output/issue-renderer.js.map +1 -1
  83. package/dist/sdk/analyze.d.ts.map +1 -1
  84. package/dist/sdk/analyze.js +14 -27
  85. package/dist/sdk/analyze.js.map +1 -1
  86. package/dist/sdk/auth.d.ts +16 -0
  87. package/dist/sdk/auth.d.ts.map +1 -0
  88. package/dist/sdk/auth.js +37 -0
  89. package/dist/sdk/auth.js.map +1 -0
  90. package/dist/sdk/errors.d.ts +8 -1
  91. package/dist/sdk/errors.d.ts.map +1 -1
  92. package/dist/sdk/errors.js +22 -2
  93. package/dist/sdk/errors.js.map +1 -1
  94. package/dist/sdk/prompt.js +1 -1
  95. package/dist/sdk/runner.d.ts +2 -1
  96. package/dist/sdk/runner.d.ts.map +1 -1
  97. package/dist/sdk/runner.js +3 -1
  98. package/dist/sdk/runner.js.map +1 -1
  99. package/dist/sdk/types.d.ts +0 -3
  100. package/dist/sdk/types.d.ts.map +1 -1
  101. package/dist/sdk/types.js.map +1 -1
  102. package/dist/skills/remote.js +1 -1
  103. package/dist/skills/remote.js.map +1 -1
  104. package/dist/types/index.d.ts +23 -24
  105. package/dist/types/index.d.ts.map +1 -1
  106. package/dist/types/index.js +19 -7
  107. package/dist/types/index.js.map +1 -1
  108. package/dist/utils/exec.d.ts +4 -1
  109. package/dist/utils/exec.d.ts.map +1 -1
  110. package/dist/utils/exec.js +6 -4
  111. package/dist/utils/exec.js.map +1 -1
  112. package/package.json +1 -1
  113. package/skills/warden/SKILL.md +76 -0
  114. package/skills/warden/references/cli-reference.md +142 -0
  115. package/skills/warden/references/config-schema.md +111 -0
  116. package/skills/warden/references/configuration.md +110 -0
  117. package/skills/warden/references/creating-skills.md +84 -0
  118. package/skills/warden-sweep/SKILL.md +400 -0
  119. package/skills/warden-sweep/references/patch-prompt.md +72 -0
  120. package/skills/warden-sweep/references/verify-prompt.md +25 -0
  121. package/skills/warden-sweep/scripts/_utils.py +99 -0
  122. package/skills/warden-sweep/scripts/create_issue.py +189 -0
  123. package/skills/warden-sweep/scripts/extract_findings.py +219 -0
  124. package/skills/warden-sweep/scripts/find_reviewers.py +114 -0
  125. package/skills/warden-sweep/scripts/generate_report.py +266 -0
  126. package/skills/warden-sweep/scripts/index_prs.py +187 -0
  127. package/skills/warden-sweep/scripts/organize.py +422 -0
  128. package/skills/warden-sweep/scripts/scan.py +584 -0
  129. package/dist/sdk/session.d.ts +0 -43
  130. package/dist/sdk/session.d.ts.map +0 -1
  131. package/dist/sdk/session.js +0 -105
  132. package/dist/sdk/session.js.map +0 -1
@@ -0,0 +1,76 @@
1
+ ---
2
+ name: warden
3
+ description: Run Warden to analyze code changes before committing. Use when asked to "run warden", "check my changes", "review before commit", "warden config", "warden.toml", "create a warden skill", "add trigger", or any Warden-related local development task.
4
+ ---
5
+
6
+ Run Warden to analyze code changes before committing.
7
+
8
+ ## References
9
+
10
+ Read the relevant reference when the task requires deeper detail:
11
+
12
+ | Document | Read When |
13
+ |----------|-----------|
14
+ | `${CLAUDE_SKILL_ROOT}/references/cli-reference.md` | Full option details, per-command flags, examples |
15
+ | `${CLAUDE_SKILL_ROOT}/references/configuration.md` | Editing warden.toml, triggers, patterns, troubleshooting |
16
+ | `${CLAUDE_SKILL_ROOT}/references/config-schema.md` | Exact field names, types, and defaults |
17
+ | `${CLAUDE_SKILL_ROOT}/references/creating-skills.md` | Writing custom skills, remote skills, skill discovery |
18
+
19
+ ## Running Warden
20
+
21
+ ```bash
22
+ # Analyze uncommitted changes (uses warden.toml triggers)
23
+ warden
24
+
25
+ # Run a specific skill
26
+ warden --skill <skill-name>
27
+
28
+ # Analyze specific files
29
+ warden src/auth.ts src/database.ts
30
+
31
+ # Analyze changes from a git ref
32
+ warden main..HEAD
33
+ warden HEAD~3
34
+
35
+ # Auto-apply suggested fixes
36
+ warden --fix
37
+
38
+ # Fail on high-severity findings
39
+ warden --fail-on high
40
+ ```
41
+
42
+ Set `WARDEN_ANTHROPIC_API_KEY` or log in via `claude login` before running.
43
+
44
+ ## Pre-Commit Workflow
45
+
46
+ After making code changes and before committing:
47
+
48
+ 1. Run `warden` to analyze uncommitted changes
49
+ 2. Review the findings
50
+ 3. Fix issues Warden reports (or use `warden --fix` to auto-apply)
51
+ 4. Commit the changes
52
+
53
+ Run Warden once to validate work. Do not loop re-running Warden on the same changes.
54
+
55
+ ## Reading Output
56
+
57
+ **Severity levels:**
58
+ - `high` - Must fix before merge
59
+ - `medium` - Worth reviewing
60
+ - `low` - Minor improvement
61
+
62
+ **Exit codes:** `0` = no findings at or above fail threshold. `1` = findings at or above fail threshold.
63
+
64
+ **Verbosity:** `-v` shows real-time findings. `-vv` shows debug info (tokens, latency). `-q` shows errors and summary only.
65
+
66
+ ## Commands
67
+
68
+ | Command | Description |
69
+ |---------|-------------|
70
+ | `warden` | Run analysis (default) |
71
+ | `warden init` | Initialize warden.toml and GitHub workflow |
72
+ | `warden add [skill]` | Add skill trigger to warden.toml |
73
+ | `warden sync [remote]` | Update cached remote skills |
74
+ | `warden setup-app` | Create GitHub App via manifest flow |
75
+
76
+ For full options and flags, read `${CLAUDE_SKILL_ROOT}/references/cli-reference.md`.
@@ -0,0 +1,142 @@
1
+ # CLI Reference
2
+
3
+ ## Usage
4
+
5
+ ```
6
+ warden [command] [targets...] [options]
7
+ ```
8
+
9
+ Analyze code for security issues and code quality.
10
+
11
+ ## Commands
12
+
13
+ | Command | Description |
14
+ |---------|-------------|
15
+ | `(default)` | Run analysis on targets or using warden.toml skills |
16
+ | `init` | Initialize warden.toml and GitHub workflow |
17
+ | `add [skill]` | Add a skill to warden.toml |
18
+ | `sync [remote]` | Update cached remote skills to latest |
19
+ | `setup-app` | Create a GitHub App for Warden via manifest flow |
20
+
21
+ ## Targets
22
+
23
+ | Target | Description |
24
+ |--------|-------------|
25
+ | `<files>` | Analyze specific files (e.g., `src/auth.ts`) |
26
+ | `<glob>` | Analyze files matching pattern (e.g., `"src/**/*.ts"`) |
27
+ | `<git-ref>` | Analyze changes from git ref (e.g., `HEAD~3`, `main..feature`) |
28
+ | `(none)` | Analyze uncommitted changes using warden.toml skills |
29
+
30
+ Ambiguous targets (no path separator, no extension) are resolved by checking if a file exists at the path. Use `--git` to force git ref interpretation.
31
+
32
+ ## Options
33
+
34
+ | Option | Description |
35
+ |--------|-------------|
36
+ | `--skill <name>` | Run only this skill (default: run all built-in skills) |
37
+ | `--config <path>` | Path to warden.toml (default: `./warden.toml`) |
38
+ | `-m, --model <model>` | Model to use (fallback when not set in config) |
39
+ | `--json` | Output results as JSON |
40
+ | `-o, --output <path>` | Write full run output to a JSONL file |
41
+ | `--fail-on <severity>` | Exit with code 1 if findings >= severity |
42
+ | `--report-on <severity>` | Only show findings >= severity in output |
43
+ | `--fix` | Automatically apply all suggested fixes |
44
+ | `--parallel <n>` | Max concurrent skill executions (default: 4) |
45
+ | `--git` | Force ambiguous targets to be treated as git refs |
46
+ | `--offline` | Use cached remote skills without network access |
47
+ | `-q, --quiet` | Errors and final summary only |
48
+ | `-v, --verbose` | Show real-time findings and hunk details |
49
+ | `-vv` | Show debug info (token counts, latencies) |
50
+ | `--debug` | Enable debug output (equivalent to `-vv`) |
51
+ | `--log` | Use log output (no animations, timestamped) |
52
+ | `--color / --no-color` | Override color detection |
53
+ | `-h, --help` | Show help message |
54
+ | `-V, --version` | Show version number |
55
+
56
+ ## Per-Command Options
57
+
58
+ **Init:**
59
+ | Option | Description |
60
+ |--------|-------------|
61
+ | `-f, --force` | Overwrite existing files |
62
+
63
+ **Add:**
64
+ | Option | Description |
65
+ |--------|-------------|
66
+ | `--list` | List available skills |
67
+ | `--remote <ref>` | Remote repository (`owner/repo`, URL, or with `@sha`) |
68
+ | `--force` | Bypass skill cache and fetch latest |
69
+
70
+ **Sync:**
71
+ | Option | Description |
72
+ |--------|-------------|
73
+ | `--remote <ref>` | Specific remote to sync (default: all) |
74
+
75
+ **Setup-app:**
76
+ | Option | Description |
77
+ |--------|-------------|
78
+ | `--org <name>` | Create under organization (default: personal) |
79
+ | `--port <number>` | Local server port (default: 3000) |
80
+ | `--timeout <sec>` | Callback timeout in seconds (default: 300) |
81
+ | `--name <string>` | Custom app name (default: Warden) |
82
+ | `--no-open` | Print URL instead of opening browser |
83
+
84
+ ## Severity Levels
85
+
86
+ Used in `--fail-on` and `--report-on`:
87
+
88
+ | Level | Meaning |
89
+ |-------|---------|
90
+ | `high` | Must fix before merge |
91
+ | `medium` | Worth reviewing |
92
+ | `low` | Minor improvement |
93
+ | `off` | Disable the threshold |
94
+
95
+ ## Exit Codes
96
+
97
+ | Code | Meaning |
98
+ |------|---------|
99
+ | `0` | No findings at or above `--fail-on` threshold |
100
+ | `1` | Findings at or above `--fail-on` threshold |
101
+
102
+ ## Examples
103
+
104
+ ```bash
105
+ # Initialize
106
+ warden init
107
+
108
+ # Interactive skill selection
109
+ warden add
110
+ warden add <skill-name>
111
+ warden add --list
112
+
113
+ # Remote skills
114
+ warden add --remote <org>/<repo> --skill <skill-name>
115
+ warden add --remote https://github.com/<org>/<repo> --skill <skill-name>
116
+ warden add --remote <org>/<repo>@<ref> --skill <skill-name>
117
+
118
+ # Run analysis
119
+ warden # Skills from warden.toml
120
+ warden src/auth.ts # Specific file
121
+ warden src/auth.ts --skill <skill-name>
122
+ warden "src/**/*.ts" # Glob pattern
123
+ warden HEAD~3 # Git changes
124
+ warden HEAD~3 --skill <skill-name>
125
+ warden main..HEAD # Branch diff
126
+
127
+ # Output control
128
+ warden --json
129
+ warden --fail-on high
130
+ warden -o results.jsonl
131
+
132
+ # Fix mode
133
+ warden --fix
134
+
135
+ # Cached skills only
136
+ warden --offline
137
+ warden sync # Update all unpinned remote skills
138
+
139
+ # GitHub App setup
140
+ warden setup-app
141
+ warden setup-app --org myorg
142
+ ```
@@ -0,0 +1,111 @@
1
+ # warden.toml Configuration Schema
2
+
3
+ ## Top-Level Structure
4
+
5
+ ```toml
6
+ version = 1 # Required, must be 1
7
+
8
+ [defaults] # Optional, inherited by all skills
9
+ [[skills]] # Required, array of skill configs
10
+ ```
11
+
12
+ ## Defaults Section
13
+
14
+ ```toml
15
+ [defaults]
16
+ model = "claude-sonnet-4-20250514" # Default model
17
+ maxTurns = 50 # Max agentic turns per hunk
18
+ defaultBranch = "main" # Base branch for comparisons
19
+ failOn = "high" # Exit 1 if findings >= this severity
20
+ reportOn = "medium" # Show findings >= this severity
21
+ maxFindings = 50 # Max findings to report (0 = unlimited)
22
+ reportOnSuccess = false # Post report even with no findings
23
+ paths = ["src/**/*.ts"] # Include only matching files
24
+ ignorePaths = ["*.test.ts"] # Exclude matching files
25
+
26
+ [defaults.chunking]
27
+ enabled = true # Enable hunk-based chunking
28
+
29
+ [defaults.chunking.coalesce]
30
+ enabled = true # Merge nearby hunks
31
+ maxGapLines = 30 # Lines between hunks to merge
32
+ maxChunkSize = 8000 # Max chars per chunk
33
+
34
+ [[defaults.chunking.filePatterns]]
35
+ pattern = "*.config.*" # Glob pattern
36
+ mode = "whole-file" # per-hunk | whole-file | skip
37
+ ```
38
+
39
+ ## Skills Section
40
+
41
+ ```toml
42
+ [[skills]]
43
+ name = "skill-name" # Required, unique identifier
44
+ remote = "owner/repo@sha" # Optional, fetch skill from GitHub repo
45
+ paths = ["src/**"] # Include only matching files
46
+ ignorePaths = ["**/*.test.ts"] # Exclude matching files
47
+
48
+ # Optional overrides (inherit from defaults if not set)
49
+ model = "claude-opus-4-20250514"
50
+ maxTurns = 100
51
+ failOn = "high"
52
+ reportOn = "medium"
53
+ maxFindings = 20
54
+ reportOnSuccess = true
55
+
56
+ [[skills.triggers]]
57
+ type = "pull_request" # Required: pull_request | local | schedule
58
+ actions = ["opened", "synchronize"] # Required for pull_request
59
+
60
+ # Schedule-specific (only for type = "schedule")
61
+ [[skills.triggers]]
62
+ type = "schedule"
63
+
64
+ [skills.triggers.schedule]
65
+ issueTitle = "Daily Security Review" # GitHub issue title for tracking
66
+ createFixPR = true # Create PR with fixes
67
+ fixBranchPrefix = "security-fix" # Branch name prefix
68
+ ```
69
+
70
+ **Trigger types:**
71
+ - `pull_request` - Triggers on PR events
72
+ - `local` - Local CLI only (will not run in CI)
73
+ - `schedule` - Cron schedule (GitHub Action only)
74
+
75
+ All skills run locally regardless of trigger type. Skills with no triggers run everywhere (wildcard). Use `type = "local"` for skills that should *only* run locally.
76
+
77
+ **Actions (for pull_request):**
78
+ - `opened`, `synchronize`, `reopened`, `closed`
79
+
80
+ ## Severity Values
81
+
82
+ Used in `failOn` and `reportOn`:
83
+ - `high` - Must fix before merge
84
+ - `medium` - Worth reviewing
85
+ - `low` - Minor improvement
86
+ - `off` - Disable threshold
87
+
88
+ ## Built-in Skip Patterns
89
+
90
+ Always skipped (cannot be overridden):
91
+ - Package locks: `pnpm-lock.yaml`, `package-lock.json`, `yarn.lock`, `Cargo.lock`, etc.
92
+ - Minified files: `**/*.min.js`, `**/*.min.css`
93
+ - Build artifacts: `dist/`, `build/`, `node_modules/`, `.next/`, `__pycache__/`
94
+ - Generated code: `*.generated.*`, `*.g.ts`, `__generated__/`
95
+
96
+ ## Environment Variables
97
+
98
+ | Variable | Purpose |
99
+ |----------|---------|
100
+ | `WARDEN_ANTHROPIC_API_KEY` | Claude API key (required) |
101
+ | `WARDEN_MODEL` | Default model (lowest priority) |
102
+ | `WARDEN_STATE_DIR` | Override cache location (default: `~/.local/warden`) |
103
+ | `WARDEN_SKILL_CACHE_TTL` | Cache TTL in seconds for unpinned remotes (default: 86400) |
104
+
105
+ ## Model Precedence (highest to lowest)
106
+
107
+ 1. Skill-level `model`
108
+ 2. `[defaults]` `model`
109
+ 3. CLI `--model` flag
110
+ 4. `WARDEN_MODEL` env var
111
+ 5. SDK default
@@ -0,0 +1,110 @@
1
+ # Configuration (warden.toml)
2
+
3
+ See [config-schema.md](config-schema.md) for the complete schema reference.
4
+
5
+ ## Minimal Example
6
+
7
+ The `name` field references a skill you've created (via `warden add`) or defined in `.agents/skills/<name>/SKILL.md`. Use that same name everywhere — in config, CLI flags, and triggers.
8
+
9
+ ```toml
10
+ version = 1
11
+
12
+ [defaults]
13
+ model = "claude-sonnet-4-20250514"
14
+
15
+ [[skills]]
16
+ name = "my-skill" # matches .agents/skills/my-skill/SKILL.md
17
+ paths = ["src/**/*.ts"]
18
+
19
+ [[skills.triggers]]
20
+ type = "pull_request"
21
+ actions = ["opened", "synchronize"]
22
+ ```
23
+
24
+ ## Skill Configuration
25
+
26
+ Skills define what to analyze and when. Each skill requires a name. Triggers are optional — skills with no triggers run everywhere (PR, local, schedule). All skills run locally regardless of trigger type.
27
+
28
+ ```toml
29
+ [[skills]]
30
+ name = "my-skill"
31
+ paths = ["src/auth/**", "src/payments/**"]
32
+ failOn = "high"
33
+ reportOn = "medium"
34
+ maxFindings = 20
35
+
36
+ [[skills.triggers]]
37
+ type = "pull_request"
38
+ actions = ["opened", "synchronize"]
39
+ ```
40
+
41
+ **Trigger types:** `pull_request`, `local` (local-only), `schedule` (CI-only)
42
+
43
+ **Actions (pull_request):** `opened`, `synchronize`, `reopened`, `closed`
44
+
45
+ ## Common Patterns
46
+
47
+ **Strict checks on critical files:**
48
+ ```toml
49
+ [[skills]]
50
+ name = "my-skill"
51
+ model = "claude-opus-4-20250514"
52
+ maxTurns = 100
53
+ paths = ["src/auth/**", "src/payments/**"]
54
+ failOn = "high"
55
+
56
+ [[skills.triggers]]
57
+ type = "pull_request"
58
+ actions = ["opened", "synchronize"]
59
+ ```
60
+
61
+ **Skip test files:**
62
+ ```toml
63
+ [[skills]]
64
+ name = "my-skill"
65
+ paths = ["src/**/*.ts"]
66
+ ignorePaths = ["**/*.test.ts", "**/*.spec.ts"]
67
+ ```
68
+
69
+ **Whole-file analysis for configs:**
70
+ ```toml
71
+ [defaults.chunking.filePatterns]
72
+ pattern = "*.config.*"
73
+ mode = "whole-file"
74
+ ```
75
+
76
+ ## Model Precedence
77
+
78
+ From highest to lowest priority:
79
+
80
+ 1. Skill-level `model`
81
+ 2. `[defaults]` `model`
82
+ 3. CLI `--model` flag
83
+ 4. `WARDEN_MODEL` env var
84
+ 5. SDK default
85
+
86
+ ## Environment Variables
87
+
88
+ | Variable | Purpose |
89
+ |----------|---------|
90
+ | `WARDEN_ANTHROPIC_API_KEY` | Claude API key (required unless using Claude Code subscription) |
91
+ | `WARDEN_MODEL` | Default model (lowest priority) |
92
+ | `WARDEN_STATE_DIR` | Override cache location (default: `~/.local/warden`) |
93
+ | `WARDEN_SKILL_CACHE_TTL` | Cache TTL in seconds for unpinned remotes (default: 86400) |
94
+
95
+ ## Troubleshooting
96
+
97
+ **No findings reported:**
98
+ - Check `--report-on` threshold (default shows all)
99
+ - Verify skill matches file types in `paths`
100
+ - Use `-v` to see which files are being analyzed
101
+
102
+ **Files being skipped:**
103
+ - Built-in skip patterns: lock files, minified, `node_modules/`, `dist/`
104
+ - Check `ignorePaths` in config
105
+ - Use `-vv` to see skip reasons
106
+
107
+ **Token/cost issues:**
108
+ - Reduce `maxTurns` (default: 50)
109
+ - Use chunking settings to control chunk size
110
+ - Filter to relevant files with `paths`
@@ -0,0 +1,84 @@
1
+ # Creating Skills
2
+
3
+ Skills are markdown files that tell Warden what to look for. They follow the [agentskills.io](https://agentskills.io) specification.
4
+
5
+ ## Skill Discovery
6
+
7
+ Warden searches these directories in order (first match wins):
8
+
9
+ ```
10
+ .agents/skills/{name}/SKILL.md # Primary (recommended)
11
+ .claude/skills/{name}/SKILL.md # Backup (Claude Code convention)
12
+ ```
13
+
14
+ ## SKILL.md Format
15
+
16
+ ```markdown
17
+ ---
18
+ name: my-skill
19
+ description: What this skill analyzes
20
+ allowed-tools: Read Grep Glob
21
+ ---
22
+
23
+ [Analysis instructions for the agent]
24
+
25
+ ## What to Look For
26
+ - Specific issue type 1
27
+ - Specific issue type 2
28
+
29
+ ## Output Format
30
+ Report findings with severity, location, and suggested fix.
31
+ ```
32
+
33
+ ## Available Tools
34
+
35
+ `Read`, `Glob`, `Grep`, `WebFetch`, `WebSearch`, `Bash`, `Write`, `Edit`
36
+
37
+ Most review skills only need `Read`, `Grep`, and `Glob` for exploring context.
38
+
39
+ ## Writing Checklist
40
+
41
+ - One skill, one concern ("security review" not "code quality")
42
+ - Clear criteria for what counts as an issue and at what severity
43
+ - Actionable findings that include how to fix
44
+ - Examples of good and bad code where helpful
45
+
46
+ ## Remote Skills
47
+
48
+ Skills can be fetched from GitHub repositories:
49
+
50
+ ```bash
51
+ # Add a remote skill
52
+ warden add --remote <org>/<repo> --skill <skill-name>
53
+
54
+ # Add with version pinning (recommended for reproducibility)
55
+ warden add --remote <org>/<repo>@<ref> --skill <skill-name>
56
+
57
+ # List skills in a remote repo
58
+ warden add --remote <org>/<repo> --list
59
+
60
+ # Update all unpinned remote skills
61
+ warden sync
62
+
63
+ # Update specific repo
64
+ warden sync <org>/<repo>
65
+
66
+ # Run with cached skills only (no network)
67
+ warden --offline
68
+ ```
69
+
70
+ **Remote skill in warden.toml:**
71
+
72
+ ```toml
73
+ [[skills]]
74
+ name = "my-skill"
75
+ remote = "<org>/<repo>@<ref>"
76
+
77
+ [[skills.triggers]]
78
+ type = "pull_request"
79
+ actions = ["opened", "synchronize"]
80
+ ```
81
+
82
+ **Cache location:** `~/.local/warden/skills/` (override with `WARDEN_STATE_DIR`)
83
+
84
+ **Cache TTL:** 24 hours for unpinned refs (override with `WARDEN_SKILL_CACHE_TTL` in seconds)