diff --git a/.claude/skills/validate.md b/.claude/skills/validate.md index 72dfe37..2dc7782 100644 --- a/.claude/skills/validate.md +++ b/.claude/skills/validate.md @@ -1,23 +1,30 @@ --- -description: Run full validation (lint, format, typecheck, tests, build). Use before committing or after changes. +description: Run full validation (lint, format, typecheck, tests, build) and warden code review. Use before committing or after changes. --- # Validate -Run the full validation suite to ensure code quality. +Run the full validation suite and code review to ensure code quality. -## Command +## Steps -```bash -bun run validate -``` +1. Run the validation suite: + ```bash + bun run validate + ``` + This runs: + - `oxlint` - Linting with type-aware rules + - `oxfmt --check` - Format verification + - `tsc --noEmit` - Type checking + - `vitest run` - Unit tests + - `tsc` - Build -This runs: -1. `oxlint` - Linting with type-aware rules -2. `oxfmt --check` - Format verification -3. `tsc --noEmit` - Type checking -4. `vitest run` - Unit tests -5. `tsc` - Build +2. If validation passes, run warden for code review feedback: + ```bash + warden -v + ``` + The `-v` flag streams findings in real-time (code simplification, bug detection). + Fix any issues warden finds before proceeding. ## When to Use @@ -27,4 +34,4 @@ This runs: ## Expected Output -All checks should pass with no errors. If any step fails, fix the issues before proceeding. +All checks should pass with no errors. Warden findings should be addressed before proceeding. diff --git a/src/commands/templates.ts b/src/commands/templates.ts index a8cec53..665d476 100644 --- a/src/commands/templates.ts +++ b/src/commands/templates.ts @@ -23,6 +23,10 @@ function parseExerciseSpec(spec: string): TemplateExercise { }; } +function parseExerciseSpecs(input: string): TemplateExercise[] { + return input.split(',').map((s) => parseExerciseSpec(s.trim())); +} + export function createTemplatesCommand(getProfile: () => string | undefined): Command { const templates = new Command('templates').description('Manage workout templates'); @@ -100,16 +104,12 @@ export function createTemplatesCommand(getProfile: () => string | undefined): Co const storage = getStorage(getProfile()); const id = options.id ?? slugify(name); - const exerciseSpecs = options.exercises.split(',').map((s) => s.trim()); - const exercises: TemplateExercise[] = []; - - for (const spec of exerciseSpecs) { - try { - exercises.push(parseExerciseSpec(spec)); - } catch (err) { - console.error((err as Error).message); - process.exit(1); - } + let exercises: TemplateExercise[]; + try { + exercises = parseExerciseSpecs(options.exercises); + } catch (err) { + console.error((err as Error).message); + process.exit(1); } const template = Template.parse({ @@ -166,19 +166,12 @@ export function createTemplatesCommand(getProfile: () => string | undefined): Co } if (options.exercises) { - const exerciseSpecs = options.exercises.split(',').map((s) => s.trim()); - const exercises: TemplateExercise[] = []; - - for (const spec of exerciseSpecs) { - try { - exercises.push(parseExerciseSpec(spec)); - } catch (err) { - console.error((err as Error).message); - process.exit(1); - } + try { + updates.exercises = parseExerciseSpecs(options.exercises); + } catch (err) { + console.error((err as Error).message); + process.exit(1); } - - updates.exercises = exercises; } if (Object.keys(updates).length === 0) { diff --git a/src/data/storage.ts b/src/data/storage.ts index b2c923a..b702e75 100644 --- a/src/data/storage.ts +++ b/src/data/storage.ts @@ -165,7 +165,7 @@ export class Storage { if (index === -1) { throw new Error(`Template "${id}" not found`); } - templates[index] = { ...templates[index]!, ...updates }; + templates[index] = Template.parse({ ...templates[index]!, ...updates }); this.saveTemplates(templates); } diff --git a/warden.toml b/warden.toml new file mode 100644 index 0000000..191921c --- /dev/null +++ b/warden.toml @@ -0,0 +1,24 @@ +version = 1 + +[defaults.filters] +ignorePaths = ["**/*.md", "**/*.lock", "**/*.json"] + +[[triggers]] +name = "code-simplifier" +event = "pull_request" +actions = ["opened", "synchronize", "reopened"] +skill = "code-simplifier" +remote = "getsentry/skills" + +[triggers.filters] +paths = ["src/**", "test/**"] + +[[triggers]] +name = "find-bugs" +event = "pull_request" +actions = ["opened", "synchronize", "reopened"] +skill = "find-bugs" +remote = "getsentry/warden" + +[triggers.filters] +paths = ["src/**"]