@sentry/warden 0.0.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 (199) hide show
  1. package/.agents/skills/find-bugs/SKILL.md +75 -0
  2. package/.agents/skills/vercel-react-best-practices/AGENTS.md +2934 -0
  3. package/.agents/skills/vercel-react-best-practices/SKILL.md +136 -0
  4. package/.agents/skills/vercel-react-best-practices/rules/advanced-event-handler-refs.md +55 -0
  5. package/.agents/skills/vercel-react-best-practices/rules/advanced-init-once.md +42 -0
  6. package/.agents/skills/vercel-react-best-practices/rules/advanced-use-latest.md +39 -0
  7. package/.agents/skills/vercel-react-best-practices/rules/async-api-routes.md +38 -0
  8. package/.agents/skills/vercel-react-best-practices/rules/async-defer-await.md +80 -0
  9. package/.agents/skills/vercel-react-best-practices/rules/async-dependencies.md +51 -0
  10. package/.agents/skills/vercel-react-best-practices/rules/async-parallel.md +28 -0
  11. package/.agents/skills/vercel-react-best-practices/rules/async-suspense-boundaries.md +99 -0
  12. package/.agents/skills/vercel-react-best-practices/rules/bundle-barrel-imports.md +59 -0
  13. package/.agents/skills/vercel-react-best-practices/rules/bundle-conditional.md +31 -0
  14. package/.agents/skills/vercel-react-best-practices/rules/bundle-defer-third-party.md +49 -0
  15. package/.agents/skills/vercel-react-best-practices/rules/bundle-dynamic-imports.md +35 -0
  16. package/.agents/skills/vercel-react-best-practices/rules/bundle-preload.md +50 -0
  17. package/.agents/skills/vercel-react-best-practices/rules/client-event-listeners.md +74 -0
  18. package/.agents/skills/vercel-react-best-practices/rules/client-localstorage-schema.md +71 -0
  19. package/.agents/skills/vercel-react-best-practices/rules/client-passive-event-listeners.md +48 -0
  20. package/.agents/skills/vercel-react-best-practices/rules/client-swr-dedup.md +56 -0
  21. package/.agents/skills/vercel-react-best-practices/rules/js-batch-dom-css.md +107 -0
  22. package/.agents/skills/vercel-react-best-practices/rules/js-cache-function-results.md +80 -0
  23. package/.agents/skills/vercel-react-best-practices/rules/js-cache-property-access.md +28 -0
  24. package/.agents/skills/vercel-react-best-practices/rules/js-cache-storage.md +70 -0
  25. package/.agents/skills/vercel-react-best-practices/rules/js-combine-iterations.md +32 -0
  26. package/.agents/skills/vercel-react-best-practices/rules/js-early-exit.md +50 -0
  27. package/.agents/skills/vercel-react-best-practices/rules/js-hoist-regexp.md +45 -0
  28. package/.agents/skills/vercel-react-best-practices/rules/js-index-maps.md +37 -0
  29. package/.agents/skills/vercel-react-best-practices/rules/js-length-check-first.md +49 -0
  30. package/.agents/skills/vercel-react-best-practices/rules/js-min-max-loop.md +82 -0
  31. package/.agents/skills/vercel-react-best-practices/rules/js-set-map-lookups.md +24 -0
  32. package/.agents/skills/vercel-react-best-practices/rules/js-tosorted-immutable.md +57 -0
  33. package/.agents/skills/vercel-react-best-practices/rules/rendering-activity.md +26 -0
  34. package/.agents/skills/vercel-react-best-practices/rules/rendering-animate-svg-wrapper.md +47 -0
  35. package/.agents/skills/vercel-react-best-practices/rules/rendering-conditional-render.md +40 -0
  36. package/.agents/skills/vercel-react-best-practices/rules/rendering-content-visibility.md +38 -0
  37. package/.agents/skills/vercel-react-best-practices/rules/rendering-hoist-jsx.md +46 -0
  38. package/.agents/skills/vercel-react-best-practices/rules/rendering-hydration-no-flicker.md +82 -0
  39. package/.agents/skills/vercel-react-best-practices/rules/rendering-hydration-suppress-warning.md +30 -0
  40. package/.agents/skills/vercel-react-best-practices/rules/rendering-svg-precision.md +28 -0
  41. package/.agents/skills/vercel-react-best-practices/rules/rendering-usetransition-loading.md +75 -0
  42. package/.agents/skills/vercel-react-best-practices/rules/rerender-defer-reads.md +39 -0
  43. package/.agents/skills/vercel-react-best-practices/rules/rerender-dependencies.md +45 -0
  44. package/.agents/skills/vercel-react-best-practices/rules/rerender-derived-state-no-effect.md +40 -0
  45. package/.agents/skills/vercel-react-best-practices/rules/rerender-derived-state.md +29 -0
  46. package/.agents/skills/vercel-react-best-practices/rules/rerender-functional-setstate.md +74 -0
  47. package/.agents/skills/vercel-react-best-practices/rules/rerender-lazy-state-init.md +58 -0
  48. package/.agents/skills/vercel-react-best-practices/rules/rerender-memo-with-default-value.md +38 -0
  49. package/.agents/skills/vercel-react-best-practices/rules/rerender-memo.md +44 -0
  50. package/.agents/skills/vercel-react-best-practices/rules/rerender-move-effect-to-event.md +45 -0
  51. package/.agents/skills/vercel-react-best-practices/rules/rerender-simple-expression-in-memo.md +35 -0
  52. package/.agents/skills/vercel-react-best-practices/rules/rerender-transitions.md +40 -0
  53. package/.agents/skills/vercel-react-best-practices/rules/rerender-use-ref-transient-values.md +73 -0
  54. package/.agents/skills/vercel-react-best-practices/rules/server-after-nonblocking.md +73 -0
  55. package/.agents/skills/vercel-react-best-practices/rules/server-auth-actions.md +96 -0
  56. package/.agents/skills/vercel-react-best-practices/rules/server-cache-lru.md +41 -0
  57. package/.agents/skills/vercel-react-best-practices/rules/server-cache-react.md +76 -0
  58. package/.agents/skills/vercel-react-best-practices/rules/server-dedup-props.md +65 -0
  59. package/.agents/skills/vercel-react-best-practices/rules/server-parallel-fetching.md +83 -0
  60. package/.agents/skills/vercel-react-best-practices/rules/server-serialization.md +38 -0
  61. package/.claude/settings.json +57 -0
  62. package/.claude/settings.local.json +88 -0
  63. package/.claude/skills/agent-prompt/SKILL.md +54 -0
  64. package/.claude/skills/agent-prompt/references/agentic-patterns.md +94 -0
  65. package/.claude/skills/agent-prompt/references/anti-patterns.md +140 -0
  66. package/.claude/skills/agent-prompt/references/context-design.md +124 -0
  67. package/.claude/skills/agent-prompt/references/core-principles.md +75 -0
  68. package/.claude/skills/agent-prompt/references/model-guidance.md +118 -0
  69. package/.claude/skills/agent-prompt/references/output-formats.md +98 -0
  70. package/.claude/skills/agent-prompt/references/skill-structure.md +115 -0
  71. package/.claude/skills/agent-prompt/references/system-prompts.md +115 -0
  72. package/.claude/skills/notseer/SKILL.md +131 -0
  73. package/.claude/skills/skill-writer/SKILL.md +140 -0
  74. package/.claude/skills/testing-guidelines/SKILL.md +132 -0
  75. package/.claude/skills/warden-skill/SKILL.md +250 -0
  76. package/.claude/skills/warden-skill/references/config-schema.md +133 -0
  77. package/.dex/config.toml +2 -0
  78. package/.github/workflows/ci.yml +33 -0
  79. package/.github/workflows/release.yml +54 -0
  80. package/.github/workflows/warden.yml +40 -0
  81. package/AGENTS.md +89 -0
  82. package/CONTRIBUTING.md +60 -0
  83. package/LICENSE +105 -0
  84. package/README.md +43 -0
  85. package/SPEC.md +263 -0
  86. package/action.yml +87 -0
  87. package/assets/favicon.png +0 -0
  88. package/assets/warden-icon-bw.svg +5 -0
  89. package/assets/warden-icon-purple.png +0 -0
  90. package/assets/warden-icon-purple.svg +5 -0
  91. package/docs/.claude/settings.local.json +11 -0
  92. package/docs/astro.config.mjs +43 -0
  93. package/docs/package.json +19 -0
  94. package/docs/pnpm-lock.yaml +4000 -0
  95. package/docs/public/favicon.svg +5 -0
  96. package/docs/src/components/Code.astro +141 -0
  97. package/docs/src/components/PackageManagerTabs.astro +183 -0
  98. package/docs/src/components/Terminal.astro +212 -0
  99. package/docs/src/layouts/Base.astro +380 -0
  100. package/docs/src/pages/cli.astro +167 -0
  101. package/docs/src/pages/config.astro +394 -0
  102. package/docs/src/pages/guide.astro +449 -0
  103. package/docs/src/pages/index.astro +490 -0
  104. package/docs/src/styles/global.css +551 -0
  105. package/docs/tsconfig.json +3 -0
  106. package/docs/vercel.json +5 -0
  107. package/eslint.config.js +33 -0
  108. package/package.json +73 -0
  109. package/src/action/index.ts +1 -0
  110. package/src/action/main.ts +868 -0
  111. package/src/cli/args.test.ts +477 -0
  112. package/src/cli/args.ts +415 -0
  113. package/src/cli/commands/add.ts +447 -0
  114. package/src/cli/commands/init.test.ts +136 -0
  115. package/src/cli/commands/init.ts +132 -0
  116. package/src/cli/commands/setup-app/browser.ts +38 -0
  117. package/src/cli/commands/setup-app/credentials.ts +45 -0
  118. package/src/cli/commands/setup-app/manifest.ts +48 -0
  119. package/src/cli/commands/setup-app/server.ts +172 -0
  120. package/src/cli/commands/setup-app.ts +156 -0
  121. package/src/cli/commands/sync.ts +114 -0
  122. package/src/cli/context.ts +131 -0
  123. package/src/cli/files.test.ts +155 -0
  124. package/src/cli/files.ts +89 -0
  125. package/src/cli/fix.test.ts +310 -0
  126. package/src/cli/fix.ts +387 -0
  127. package/src/cli/git.test.ts +119 -0
  128. package/src/cli/git.ts +318 -0
  129. package/src/cli/index.ts +14 -0
  130. package/src/cli/main.ts +672 -0
  131. package/src/cli/output/box.ts +235 -0
  132. package/src/cli/output/formatters.test.ts +187 -0
  133. package/src/cli/output/formatters.ts +269 -0
  134. package/src/cli/output/icons.ts +13 -0
  135. package/src/cli/output/index.ts +44 -0
  136. package/src/cli/output/ink-runner.tsx +337 -0
  137. package/src/cli/output/jsonl.test.ts +347 -0
  138. package/src/cli/output/jsonl.ts +126 -0
  139. package/src/cli/output/reporter.ts +435 -0
  140. package/src/cli/output/tasks.ts +374 -0
  141. package/src/cli/output/tty.test.ts +117 -0
  142. package/src/cli/output/tty.ts +60 -0
  143. package/src/cli/output/verbosity.test.ts +40 -0
  144. package/src/cli/output/verbosity.ts +31 -0
  145. package/src/cli/terminal.test.ts +148 -0
  146. package/src/cli/terminal.ts +301 -0
  147. package/src/config/index.ts +3 -0
  148. package/src/config/loader.test.ts +313 -0
  149. package/src/config/loader.ts +103 -0
  150. package/src/config/schema.ts +168 -0
  151. package/src/config/writer.test.ts +119 -0
  152. package/src/config/writer.ts +84 -0
  153. package/src/diff/classify.test.ts +162 -0
  154. package/src/diff/classify.ts +92 -0
  155. package/src/diff/coalesce.test.ts +208 -0
  156. package/src/diff/coalesce.ts +133 -0
  157. package/src/diff/context.test.ts +226 -0
  158. package/src/diff/context.ts +201 -0
  159. package/src/diff/index.ts +4 -0
  160. package/src/diff/parser.test.ts +212 -0
  161. package/src/diff/parser.ts +149 -0
  162. package/src/event/context.ts +132 -0
  163. package/src/event/index.ts +2 -0
  164. package/src/event/schedule-context.ts +101 -0
  165. package/src/examples/examples.integration.test.ts +66 -0
  166. package/src/examples/index.test.ts +101 -0
  167. package/src/examples/index.ts +122 -0
  168. package/src/examples/setup.ts +25 -0
  169. package/src/index.ts +115 -0
  170. package/src/output/dedup.test.ts +419 -0
  171. package/src/output/dedup.ts +607 -0
  172. package/src/output/github-checks.test.ts +300 -0
  173. package/src/output/github-checks.ts +476 -0
  174. package/src/output/github-issues.ts +329 -0
  175. package/src/output/index.ts +5 -0
  176. package/src/output/issue-renderer.ts +197 -0
  177. package/src/output/renderer.test.ts +727 -0
  178. package/src/output/renderer.ts +217 -0
  179. package/src/output/stale.test.ts +375 -0
  180. package/src/output/stale.ts +155 -0
  181. package/src/output/types.ts +34 -0
  182. package/src/sdk/index.ts +1 -0
  183. package/src/sdk/runner.test.ts +806 -0
  184. package/src/sdk/runner.ts +1232 -0
  185. package/src/skills/index.ts +36 -0
  186. package/src/skills/loader.test.ts +300 -0
  187. package/src/skills/loader.ts +423 -0
  188. package/src/skills/remote.test.ts +704 -0
  189. package/src/skills/remote.ts +604 -0
  190. package/src/triggers/matcher.test.ts +277 -0
  191. package/src/triggers/matcher.ts +152 -0
  192. package/src/types/index.ts +194 -0
  193. package/src/utils/async.ts +18 -0
  194. package/src/utils/index.test.ts +84 -0
  195. package/src/utils/index.ts +50 -0
  196. package/tsconfig.json +25 -0
  197. package/vitest.config.ts +8 -0
  198. package/vitest.integration.config.ts +11 -0
  199. package/warden.toml +19 -0
@@ -0,0 +1,449 @@
1
+ ---
2
+ import Base from '../layouts/Base.astro';
3
+ import Terminal from '../components/Terminal.astro';
4
+ import { Code } from 'astro:components';
5
+
6
+ const base = import.meta.env.BASE_URL.replace(/\/$/, '');
7
+ ---
8
+
9
+ <Base title="Guide" description="How to use Warden to watch over your code">
10
+ <h1>Guide</h1>
11
+
12
+ <p>Warden watches over your code by running <strong>skills</strong> against your changes. Skills are prompts that define what to look for: security vulnerabilities, API design issues, performance problems, or anything else you want consistent coverage on.</p>
13
+
14
+ <nav class="toc">
15
+ <details open>
16
+ <summary>On this page</summary>
17
+ <ul>
18
+ <li><a href="#the-core-idea">The Core Idea</a></li>
19
+ <li><a href="#when-to-use-warden">When to Use Warden</a></li>
20
+ <li><a href="#local-development">Local Development</a></li>
21
+ <li><a href="#creating-skills">Creating Skills</a></li>
22
+ <li><a href="#adding-skills">Adding Skills</a></li>
23
+ <li><a href="#pull-request-reviews">Pull Request Reviews</a></li>
24
+ <li><a href="#github-app">GitHub App (Optional)</a></li>
25
+ <li><a href="#tips">Tips</a></li>
26
+ </ul>
27
+ </details>
28
+ </nav>
29
+
30
+ <h2 id="the-core-idea">The Core Idea</h2>
31
+
32
+ <p>Every time you run Warden, it:</p>
33
+ <ol>
34
+ <li>Identifies what changed (files, hunks, or entire directories)</li>
35
+ <li>Matches changes against configured triggers</li>
36
+ <li>Runs the appropriate skills against matching code</li>
37
+ <li>Reports findings with severity, location, and optional fixes</li>
38
+ </ol>
39
+
40
+ <p>Skills follow the <a href="https://agentskills.io">agentskills.io</a> specification -they're markdown files with a prompt that tells the AI what to look for. You can use community skills, write your own, or combine both.</p>
41
+
42
+ <p>Warden works in two contexts:</p>
43
+ <ul>
44
+ <li><strong>Locally</strong> - Review changes before you push, get instant feedback</li>
45
+ <li><strong>In CI</strong> - Automatically review pull requests, post findings as comments</li>
46
+ </ul>
47
+
48
+ <h2 id="when-to-use-warden">When to Use Warden</h2>
49
+
50
+ <p><strong>Use Warden when:</strong></p>
51
+ <ul>
52
+ <li>You want consistent code review coverage across your team</li>
53
+ <li>You need specialized reviews that human reviewers might miss (security, API contracts, accessibility)</li>
54
+ <li>You want to catch issues before human review starts</li>
55
+ <li>You're enforcing patterns or conventions specific to your codebase</li>
56
+ </ul>
57
+
58
+ <p><strong>Skip Warden when:</strong></p>
59
+ <ul>
60
+ <li>Quick typo or formatting fixes</li>
61
+ <li>Documentation-only changes (unless you have a docs skill)</li>
62
+ <li>Generated code or vendored dependencies</li>
63
+ </ul>
64
+
65
+ <h2 id="local-development">Local Development</h2>
66
+
67
+ <p>Running Warden locally is the fastest way to get value. You get feedback before pushing, while the code is fresh in your mind.</p>
68
+
69
+ <h3>Authentication</h3>
70
+
71
+ <p>Warden uses your Claude Code subscription if you're logged in. Otherwise, set an API key:</p>
72
+
73
+ <Terminal showCopy={true}>
74
+ <Code
75
+ code={`# Option 1: Claude Code subscription (if logged in)
76
+ claude login
77
+
78
+ # Option 2: API key
79
+ export WARDEN_ANTHROPIC_API_KEY=sk-ant-...`}
80
+ lang="bash"
81
+ theme="vitesse-black"
82
+ />
83
+ </Terminal>
84
+
85
+ <p>Get an API key from <a href="https://console.anthropic.com/">console.anthropic.com</a>. CI/CD environments require an API key.</p>
86
+
87
+ <h3>Review Uncommitted Changes</h3>
88
+
89
+ <p>Run Warden with no arguments to review your working directory:</p>
90
+
91
+ <Terminal showCopy={true}>
92
+ <Code
93
+ code={`warden`}
94
+ lang="bash"
95
+ theme="vitesse-black"
96
+ />
97
+ </Terminal>
98
+
99
+ <p>Warden analyzes staged and unstaged changes, running any skills that match via your configured triggers.</p>
100
+
101
+ <h3>Review Before Pushing</h3>
102
+
103
+ <p>Review all commits on your branch that aren't on main:</p>
104
+
105
+ <Terminal showCopy={true}>
106
+ <Code
107
+ code={`warden main..HEAD`}
108
+ lang="bash"
109
+ theme="vitesse-black"
110
+ />
111
+ </Terminal>
112
+
113
+ <p>This catches everything you're about to push.</p>
114
+
115
+ <h3>Run a Specific Skill</h3>
116
+
117
+ <p>Skip trigger matching and run one skill directly:</p>
118
+
119
+ <Terminal showCopy={true}>
120
+ <Code
121
+ code={`warden --skill security-review`}
122
+ lang="bash"
123
+ theme="vitesse-black"
124
+ />
125
+ </Terminal>
126
+
127
+ <h3>Auto-Fix Issues</h3>
128
+
129
+ <p>Let Warden apply suggested fixes interactively:</p>
130
+
131
+ <Terminal showCopy={true}>
132
+ <Code
133
+ code={`warden --fix`}
134
+ lang="bash"
135
+ theme="vitesse-black"
136
+ />
137
+ </Terminal>
138
+
139
+ <p>You'll be prompted to accept or reject each fix.</p>
140
+
141
+ <h3>Analyze Specific Files</h3>
142
+
143
+ <p>Target specific files or directories:</p>
144
+
145
+ <Terminal showCopy={true}>
146
+ <Code
147
+ code={`warden src/auth.ts
148
+ warden src/api/`}
149
+ lang="bash"
150
+ theme="vitesse-black"
151
+ />
152
+ </Terminal>
153
+
154
+ <h2 id="creating-skills">Creating Skills</h2>
155
+
156
+ <p>Skills are markdown files that tell Warden what to look for. They follow the <a href="https://agentskills.io">agentskills.io</a> specification.</p>
157
+
158
+ <h3>Directory Structure</h3>
159
+
160
+ <p>Create a skill in one of these directories (first match wins):</p>
161
+
162
+ <Terminal showCopy={true}>
163
+ <Code
164
+ code={`.warden/skills/skill-name/SKILL.md # Warden-specific (highest priority)
165
+ .agents/skills/skill-name/SKILL.md # Shared agent skills
166
+ .claude/skills/skill-name/SKILL.md # Claude Code skills`}
167
+ lang="text"
168
+ theme="vitesse-black"
169
+ />
170
+ </Terminal>
171
+
172
+ <h3>SKILL.md Format</h3>
173
+
174
+ <p>A skill has YAML frontmatter for metadata and markdown for the prompt:</p>
175
+
176
+ <Terminal showCopy={true}>
177
+ <Code
178
+ code={`---
179
+ name: security-review
180
+ description: Review code for security vulnerabilities
181
+ allowed-tools: Read Grep Glob
182
+ ---
183
+
184
+ Review the code for security issues including:
185
+ - SQL injection and parameter binding
186
+ - XSS vulnerabilities in user input handling
187
+ - Hardcoded secrets or credentials
188
+ - Insecure cryptographic practices
189
+ - Path traversal vulnerabilities
190
+
191
+ Focus on issues in the changed code. For each issue found, report:
192
+ - The specific vulnerability type
193
+ - Why it's a problem
194
+ - How to fix it`}
195
+ lang="markdown"
196
+ theme="vitesse-black"
197
+ />
198
+ </Terminal>
199
+
200
+ <h3>Frontmatter Fields</h3>
201
+
202
+ <dl>
203
+ <dt>name</dt>
204
+ <dd>Skill identifier (referenced in triggers and CLI)</dd>
205
+ <dt>description</dt>
206
+ <dd>Brief description of what the skill does</dd>
207
+ <dt>allowed-tools</dt>
208
+ <dd>Space-separated list of tools the skill can use</dd>
209
+ </dl>
210
+
211
+ <h3>Available Tools</h3>
212
+
213
+ <p><code>Read</code>, <code>Grep</code>, <code>Glob</code>, <code>Edit</code>, <code>Write</code>, <code>Bash</code>, <code>WebFetch</code>, <code>WebSearch</code></p>
214
+
215
+ <p>Most review skills only need <code>Read</code>, <code>Grep</code>, and <code>Glob</code> for exploring context.</p>
216
+
217
+ <h3>What Makes a Good Skill</h3>
218
+
219
+ <ul>
220
+ <li><strong>Specific scope</strong> - One skill, one concern. "Security review" not "code quality"</li>
221
+ <li><strong>Clear criteria</strong> - What counts as an issue? What severity?</li>
222
+ <li><strong>Actionable output</strong> - Findings should include how to fix</li>
223
+ <li><strong>Examples</strong> - Show what good and bad code looks like</li>
224
+ </ul>
225
+
226
+ <h2 id="adding-skills">Adding Skills</h2>
227
+
228
+ <p>Warden can discover and install community skills.</p>
229
+
230
+ <h3>Interactive Mode</h3>
231
+
232
+ <Terminal showCopy={true}>
233
+ <Code
234
+ code={`warden add`}
235
+ lang="bash"
236
+ theme="vitesse-black"
237
+ />
238
+ </Terminal>
239
+
240
+ <p>Browse available skills and select which to add.</p>
241
+
242
+ <h3>List Available Skills</h3>
243
+
244
+ <Terminal showCopy={true}>
245
+ <Code
246
+ code={`warden add --list`}
247
+ lang="bash"
248
+ theme="vitesse-black"
249
+ />
250
+ </Terminal>
251
+
252
+ <h3>Add a Specific Skill</h3>
253
+
254
+ <Terminal showCopy={true}>
255
+ <Code
256
+ code={`warden add security-review`}
257
+ lang="bash"
258
+ theme="vitesse-black"
259
+ />
260
+ </Terminal>
261
+
262
+ <p>This adds the skill and creates a trigger in <code>warden.toml</code>.</p>
263
+
264
+ <h2 id="pull-request-reviews">Pull Request Reviews</h2>
265
+
266
+ <p>Warden runs automatically on pull requests via GitHub Actions, posting findings as review comments.</p>
267
+
268
+ <h3>Organization Setup</h3>
269
+
270
+ <p>Add your Anthropic API key as an organization secret so all repos can use it:</p>
271
+
272
+ <ol>
273
+ <li>Go to <strong>Organization Settings → Secrets and variables → Actions</strong></li>
274
+ <li>Add <code>WARDEN_ANTHROPIC_API_KEY</code> with your key from <a href="https://console.anthropic.com/">console.anthropic.com</a></li>
275
+ </ol>
276
+
277
+ <h3>Repository Setup</h3>
278
+
279
+ <p>Initialize Warden in each repository:</p>
280
+
281
+ <Terminal showCopy={true}>
282
+ <Code
283
+ code={`npx warden init`}
284
+ lang="bash"
285
+ theme="vitesse-black"
286
+ />
287
+ </Terminal>
288
+
289
+ <p>This creates:</p>
290
+ <ul>
291
+ <li><code>warden.toml</code> - Configuration with triggers</li>
292
+ <li><code>.github/workflows/warden.yml</code> - GitHub Actions workflow</li>
293
+ </ul>
294
+
295
+ <h3>What Happens on a PR</h3>
296
+
297
+ <ol>
298
+ <li>PR is opened or updated</li>
299
+ <li>GitHub Actions runs the Warden workflow</li>
300
+ <li>Warden analyzes changed files against configured triggers</li>
301
+ <li>Findings are posted as inline review comments</li>
302
+ <li>Check passes or fails based on <code>failOn</code> severity</li>
303
+ </ol>
304
+
305
+ <h3>Configuring Triggers</h3>
306
+
307
+ <p>Triggers map events to skills. Edit <code>warden.toml</code>:</p>
308
+
309
+ <Terminal showCopy={true}>
310
+ <Code
311
+ code={`version = 1
312
+
313
+ [[triggers]]
314
+ name = "Security Review"
315
+ event = "pull_request"
316
+ actions = ["opened", "synchronize"]
317
+ skill = "security-review"
318
+
319
+ [[triggers]]
320
+ name = "API Review"
321
+ event = "pull_request"
322
+ actions = ["opened", "synchronize"]
323
+ skill = "api-review"
324
+
325
+ [triggers.filters]
326
+ paths = ["src/api/**/*.ts"]`}
327
+ lang="toml"
328
+ theme="vitesse-black"
329
+ />
330
+ </Terminal>
331
+
332
+ <p>See the <a href={`${base}/config`}>Config reference</a> for all trigger options.</p>
333
+
334
+ <h3>Controlling Output</h3>
335
+
336
+ <p>Configure when to fail and what to comment on:</p>
337
+
338
+ <Terminal showCopy={true}>
339
+ <Code
340
+ code={`[defaults.output]
341
+ failOn = "high" # Fail the check on high or critical findings
342
+ commentOn = "medium" # Post comments for medium and above`}
343
+ lang="toml"
344
+ theme="vitesse-black"
345
+ />
346
+ </Terminal>
347
+
348
+ <h2 id="github-app">GitHub App (Optional)</h2>
349
+
350
+ <p>By default, Warden posts comments as "github-actions". Create a GitHub App for branded comments that appear from "Warden" with a custom avatar.</p>
351
+
352
+ <h3>Create the App</h3>
353
+
354
+ <Terminal showCopy={true}>
355
+ <Code
356
+ code={`npx warden setup-app --org your-org`}
357
+ lang="bash"
358
+ theme="vitesse-black"
359
+ />
360
+ </Terminal>
361
+
362
+ <p>This opens a browser to create and install the app.</p>
363
+
364
+ <h3>Add Secrets</h3>
365
+
366
+ <p>Add these to your organization secrets:</p>
367
+
368
+ <dl>
369
+ <dt>WARDEN_APP_ID</dt>
370
+ <dd>App ID from the setup command output</dd>
371
+ <dt>WARDEN_PRIVATE_KEY</dt>
372
+ <dd>Private key (full PEM contents)</dd>
373
+ </dl>
374
+
375
+ <h3>Update Workflow</h3>
376
+
377
+ <p>Uncomment the GitHub App section in <code>.github/workflows/warden.yml</code>:</p>
378
+
379
+ <Terminal showCopy={true}>
380
+ <Code
381
+ code={`- uses: actions/create-github-app-token@v1
382
+ id: app-token
383
+ with:
384
+ app-id: \${{ secrets.WARDEN_APP_ID }}
385
+ private-key: \${{ secrets.WARDEN_PRIVATE_KEY }}
386
+
387
+ - uses: getsentry/warden-action@v1
388
+ with:
389
+ github-token: \${{ steps.app-token.outputs.token }}`}
390
+ lang="yaml"
391
+ theme="vitesse-black"
392
+ />
393
+ </Terminal>
394
+
395
+ <h2 id="tips">Tips</h2>
396
+
397
+ <ul>
398
+ <li><strong><code>--verbose</code></strong> - See which triggers matched and what Warden is doing</li>
399
+ <li><strong><code>--fix</code></strong> - Apply suggested fixes interactively</li>
400
+ <li><strong><code>--skill &lt;name&gt;</code></strong> - Skip trigger matching and run one skill directly</li>
401
+ <li><strong><code>--fail-on &lt;level&gt;</code></strong> - Override the failure threshold for CI</li>
402
+ <li><strong><code>-vv</code></strong> - Debug output with token counts and latencies</li>
403
+ </ul>
404
+
405
+ <p>See the <a href={`${base}/cli`}>CLI reference</a> for all options.</p>
406
+ </Base>
407
+
408
+ <style>
409
+ .toc {
410
+ margin-bottom: 2rem;
411
+ padding: 1rem 1.25rem;
412
+ background: var(--surface);
413
+ border: 1px solid var(--border);
414
+ border-radius: 6px;
415
+ }
416
+
417
+ .toc summary {
418
+ font-weight: 600;
419
+ cursor: pointer;
420
+ color: var(--text-primary);
421
+ font-size: 0.9rem;
422
+ }
423
+
424
+ .toc ul {
425
+ margin: 0.5rem 0 0 0;
426
+ padding-left: 1.25rem;
427
+ list-style: none;
428
+ }
429
+
430
+ .toc > details > ul {
431
+ padding-left: 0;
432
+ }
433
+
434
+ .toc li {
435
+ margin: 0.25rem 0;
436
+ line-height: 1.4;
437
+ }
438
+
439
+ .toc a {
440
+ color: var(--text-secondary);
441
+ text-decoration: none;
442
+ font-size: 0.875rem;
443
+ }
444
+
445
+ .toc a:hover {
446
+ color: var(--text-primary);
447
+ text-decoration: underline;
448
+ }
449
+ </style>