From 63bd9e6c62f08640d619ea1830f660d162406228 Mon Sep 17 00:00:00 2001 From: Harivansh Rathi Date: Wed, 14 Jan 2026 14:04:30 -0800 Subject: [PATCH] comman --- commands/implement.md | 152 ++++++++++++++++++++++++++++++++++++++ skills/implement/SKILL.md | 148 ------------------------------------- 2 files changed, 152 insertions(+), 148 deletions(-) create mode 100644 commands/implement.md delete mode 100644 skills/implement/SKILL.md diff --git a/commands/implement.md b/commands/implement.md new file mode 100644 index 0000000..06fa121 --- /dev/null +++ b/commands/implement.md @@ -0,0 +1,152 @@ +--- +description: Implement iOS/SwiftUI features from eval specs with automatic verification +argument-hint: +allowed-tools: Read, Write, Edit, Bash, Grep, Glob, Task +--- + +# /implement Command + +Implement iOS features from eval specs. Spawns verifier agent for checking - never tests own work. + +## Usage + +``` +/implement +``` + +## Flow + +``` +Read eval spec -> Check SwiftUI guide -> Implement -> Spawn verifier -> Fix if needed -> Done +``` + +## Process + +### 1. Load Eval Spec + +Read `.claude/evals/.yaml` and extract `building_spec`: +- description +- requirements +- constraints +- files + +If no eval exists: +``` +No eval spec found for "". +Create one first with: /eval +``` + +### 2. Check SwiftUI Guide + +Read `.claude/axiom-skills-guide.md` for: +- Project-specific iOS patterns +- Architecture preferences +- SwiftUI conventions + +If missing, use standard SwiftUI best practices. + +### 3. Implement + +Build the feature following the spec. iOS/SwiftUI guidelines: +- `@State`, `@Binding`, `@ObservedObject` appropriately +- `async/await` over completion handlers +- `@MainActor` for UI updates +- Small, composable Views +- Proper error handling + +### 4. Spawn Verifier (MANDATORY) + +**NEVER verify own work.** Always spawn eval-verifier agent: + +```python +verifier_result = spawn_agent("eval-verifier", { + "spec": f".claude/evals/{name}.yaml" +}) +``` + +The verifier: +- Runs all checks from `verification_spec` +- Collects evidence +- Reports pass/fail + +### 5. Handle Results + +**Pass:** Report success and files changed. + +**Fail:** Read failure feedback, fix specific issues, re-spawn verifier. + +Max 5 iterations. + +## Orchestration Logic + +```python +max_iterations = 5 +iteration = 0 + +# Read spec +spec = read_yaml(f".claude/evals/{name}.yaml") +guide = read_file(".claude/axiom-skills-guide.md") # optional + +# Implement +implement(spec.building_spec, guide) + +while iteration < max_iterations: + # ALWAYS spawn verifier - never test own work + verifier_result = spawn_agent("eval-verifier", { + "spec": f".claude/evals/{name}.yaml" + }) + + if verifier_result.all_passed: + return success(verifier_result) + + # Fix failures + fix_issues(verifier_result.failures) + iteration += 1 + +return failure("Max iterations reached") +``` + +## Output + +``` +/implement auth +--- + +[Loading eval spec: .claude/evals/auth.yaml] + +Building Spec: + - Login view with email/password + - Async authentication service + - Error handling with alerts + +[Checking .claude/axiom-skills-guide.md...] + +[Implementing...] + +Files Created: + + Sources/Features/Auth/LoginView.swift + + Sources/Features/Auth/AuthViewModel.swift + + Sources/Services/AuthService.swift + +Files Modified: + ~ Sources/App/ContentView.swift + +[Spawning eval-verifier...] + +Verification: + ✅ file-exists: LoginView.swift + ✅ file-contains: @MainActor + ✅ ui-login: Form renders correctly + 📸 Evidence: 2 screenshots + +--- +Implementation complete: 3/3 checks passed +``` + +## Critical Rules + +1. **NEVER test own work** - always spawn eval-verifier +2. **NEVER skip verification** - even if "confident" +3. **NEVER claim pass without verifier confirmation** +4. **Read the spec** - don't assume requirements +5. **Minimal fixes** - on retry, fix only what failed diff --git a/skills/implement/SKILL.md b/skills/implement/SKILL.md deleted file mode 100644 index ae03247..0000000 --- a/skills/implement/SKILL.md +++ /dev/null @@ -1,148 +0,0 @@ ---- -name: implement -description: Implement iOS/SwiftUI features from eval specs. Use when building iOS features. Triggers on "/implement", "build ios feature", or "implement [feature] for ios". -allowed-tools: Read, Write, Edit, Bash, Grep, Glob, Task ---- - -# Implement Skill (iOS/SwiftUI) - -I implement iOS features from eval specs. I build - I do NOT verify. - -## Critical Rule - -**NEVER test or verify my own work.** After implementation, I spawn the `eval-verifier` agent to check my work. This separation ensures honest verification. - -## Workflow - -``` -Read eval spec -> Implement -> Spawn eval-verifier -> Report results -``` - -### Step 1: Find Eval Spec - -Look for the eval in `.claude/evals/.yaml` - -If no eval exists, tell user to create one first: -``` -No eval spec found for "". -Run: /eval -to create the building and verification spec first. -``` - -### Step 2: Read Building Spec - -Extract from eval YAML: -- `building_spec.description` - what to build -- `building_spec.requirements` - specific requirements -- `building_spec.constraints` - rules to follow -- `building_spec.files` - suggested file paths - -### Step 3: Reference SwiftUI Guide - -Before implementing, check `.claude/axiom-skills-guide.md` for: -- SwiftUI patterns and conventions -- Project-specific iOS guidelines -- Architecture preferences (MVVM, etc.) - -If guide doesn't exist, use standard SwiftUI best practices. - -### Step 4: Implement - -Build the feature following: -1. Requirements from eval spec -2. Constraints from eval spec -3. SwiftUI best practices -4. Project conventions - -**iOS/SwiftUI Guidelines:** -- Use `@State`, `@Binding`, `@ObservedObject` appropriately -- Prefer `async/await` over completion handlers -- Use `@MainActor` for UI updates -- Keep Views small and composable -- Extract reusable components -- Use proper error handling with `Result` or `throws` - -### Step 5: Spawn Verifier - -After implementation complete, spawn the eval-verifier agent: - -``` -Task tool call: - subagent_type: general-purpose - prompt: | - You are the eval-verifier agent. Read the agent instructions from: - agents/eval-verifier.md - - Then verify the implementation against: - .claude/evals/.yaml - - Run all verification checks, collect evidence, and report pass/fail. -``` - -### Step 6: Handle Results - -**If verifier passes:** -``` -Implementation complete: -All checks passed. - -Files created: - + path/to/file.swift - -Files modified: - ~ path/to/existing.swift -``` - -**If verifier fails:** -Read failure feedback, fix specific issues, re-spawn verifier. -Max 5 iterations. - -## Output Format - -``` -Implementing: ---- - -[Reading eval spec...] - -Building Spec: - - Requirement 1 - - Requirement 2 - -[Implementing...] - -Files Created: - + Sources/Features/Login/LoginView.swift - + Sources/Features/Login/LoginViewModel.swift - -Files Modified: - ~ Sources/App/ContentView.swift - -[Spawning verifier...] - ---- -Verification Results: - [verifier output here] -``` - -## Example - -User: `/implement auth` - -1. Read `.claude/evals/auth.yaml` -2. Check `.claude/axiom-skills-guide.md` for iOS patterns -3. Implement: - - `LoginView.swift` - SwiftUI form - - `LoginViewModel.swift` - business logic - - `AuthService.swift` - API calls -4. Spawn eval-verifier -5. Report results - -## What I Do NOT Do - -- Skip reading the eval spec -- Verify my own work (verifier does this) -- Collect evidence (verifier does this) -- Generate tests (verifier does this) -- Add features not in the spec -- Assume verification passed without running verifier