Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 20 additions & 13 deletions .claude/skills/validate.md
Original file line number Diff line number Diff line change
@@ -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

Expand All @@ -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.
37 changes: 15 additions & 22 deletions src/commands/templates.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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');

Expand Down Expand Up @@ -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({
Expand Down Expand Up @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion src/data/storage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down
24 changes: 24 additions & 0 deletions warden.toml
Original file line number Diff line number Diff line change
@@ -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/**"]