From gilfoyle
Runs after every track completion to extract learnings. Analyzes what worked, what failed, and what patterns emerged. Updates conductor/knowledge/patterns.md with new solutions and errors.json with new error patterns. Proposes skill updates if workflow improvements are identified. Triggered automatically by orchestrator after COMPLETE step.
npx claudepluginhub ahmedelhadarey/gilfoyle --plugin gilfoyleThis skill uses the workspace's default tool permissions.
Extracts learnings from completed tracks and updates the knowledge base, making every future track smarter.
Generates design tokens/docs from CSS/Tailwind/styled-components codebases, audits visual consistency across 10 dimensions, detects AI slop in UI.
Records polished WebM UI demo videos of web apps using Playwright with cursor overlay, natural pacing, and three-phase scripting. Activates for demo, walkthrough, screen recording, or tutorial requests.
Delivers idiomatic Kotlin patterns for null safety, immutability, sealed classes, coroutines, Flows, extensions, DSL builders, and Gradle DSL. Use when writing, reviewing, refactoring, or designing Kotlin code.
Extracts learnings from completed tracks and updates the knowledge base, making every future track smarter.
Automatically โ The orchestrator calls this agent AFTER a track reaches COMPLETE status.
Review the track's execution data:
## Track Analysis: [track-id]
### Execution Summary
- **Total Tasks**: 12
- **Fix Cycles**: 1
- **Lead Consultations**: 3
- **Duration**: Plan to Complete
### What Worked Well
- [Extracted from smooth tasks with no fix cycles]
### What Caused Problems
- [Extracted from fix cycles and blocked tasks]
### Patterns Discovered
- [New solutions that could be reused]
### Errors Encountered
- [New error patterns and their fixes]
Look for reusable solutions in the completed work:
Pattern Candidates:
Pattern Template:
### [Pattern Name]
**Category**: [UI | State | API | Auth | Integration | Testing | Performance]
**Discovered**: [track-id] on [date]
**Problem**: What problem does this solve?
**Solution**: How to implement it
**Code Example**: (key code snippet)
**Gotchas**: Watch out for...
Look for errors that were fixed during the track:
Error Candidates:
Error Template:
{
"id": "err-XXX",
"pattern": "Regex pattern matching the error",
"category": "typescript|react|nextjs|supabase|stripe|etc",
"context": "When this error typically occurs",
"problem": "What causes this error",
"solution": "How to fix it",
"code_fix": "Code snippet if applicable",
"occurrences": 1,
"last_seen": "2026-01-31",
"discovered_in": "track-id"
}
Check if the track revealed workflow issues:
Questions to Ask:
Improvement Candidates:
Append new patterns to the appropriate category section:
## [Category] Patterns
### [New Pattern Name]
**Category**: [Category]
**Discovered**: [track-id] on [YYYY-MM-DD]
**Problem**: [Problem statement]
**Solution**: [Solution description]
**Code Example**:
```[language]
[code]
Gotchas: [Warnings]
#### Update errors.json
Add new error patterns:
```typescript
// Read current errors.json
const errors = JSON.parse(await readFile('conductor/knowledge/errors.json'));
// Add new error
errors.errors.push({
id: `err-${String(errors.errors.length + 1).padStart(3, '0')}`,
pattern: "New error pattern regex",
category: "category",
context: "When this occurs",
problem: "What causes it",
solution: "How to fix",
code_fix: "Code if applicable",
occurrences: 1,
last_seen: new Date().toISOString().split('T')[0],
discovered_in: trackId
});
// Write back
await writeFile('conductor/knowledge/errors.json', JSON.stringify(errors, null, 2));
Write a retrospective file for the track:
Location: conductor/tracks/[track-id]/retrospective.md
# Retrospective: [Track ID]
**Completed**: [YYYY-MM-DD]
**Duration**: [X days/hours]
**Fix Cycles**: [N]
## Summary
[1-2 sentence summary of what the track accomplished]
## What Worked Well
- [Thing 1]
- [Thing 2]
## What Caused Problems
- [Problem 1]: [How it was resolved]
- [Problem 2]: [How it was resolved]
## Patterns Extracted
- **[Pattern Name]** โ Added to patterns.md under [Category]
## Errors Logged
- **[Error Pattern]** โ Added to errors.json as err-XXX
## Skill Improvements Proposed
- [ ] [Improvement 1] โ [Which skill to update]
- [ ] [Improvement 2] โ [Which skill to update]
## Recommendations for Similar Tracks
- [Advice for future tracks doing similar work]
The Retrospective Agent returns:
{
"track_id": "feature-name_20260131",
"completed_at": "2026-01-31T15:00:00Z",
"patterns_added": [
{
"name": "Pattern Name",
"category": "Category",
"added_to": "conductor/knowledge/patterns.md"
}
],
"errors_added": [
{
"id": "err-011",
"pattern": "Error pattern",
"added_to": "conductor/knowledge/errors.json"
}
],
"skill_improvements": [
{
"skill": "loop-executor",
"improvement": "Add checkpoint after each task for better resumption",
"priority": "medium"
}
],
"retrospective_file": "conductor/tracks/feature-name_20260131/retrospective.md"
}
The orchestrator triggers retrospective after completion:
// In conductor-orchestrator, after track reaches COMPLETE
async function runRetrospective(trackId: string) {
const result = await Task({
subagent_type: "general-purpose",
description: "Run track retrospective",
prompt: `You are the retrospective-agent.
Track: ${trackId}
1. Read conductor/tracks/${trackId}/plan.md
2. Read conductor/tracks/${trackId}/metadata.json
3. Analyze what worked and what failed
4. Extract patterns โ Update conductor/knowledge/patterns.md
5. Extract errors โ Update conductor/knowledge/errors.json
6. Write retrospective to conductor/tracks/${trackId}/retrospective.md
Return summary of learnings added.`
});
console.log(`Retrospective complete. ${result.patterns_added.length} patterns, ${result.errors_added.length} errors added.`);
}
Skip retrospective if:
Prioritize extracting learnings about:
Over time, the knowledge base grows:
The goal: Every track makes the next track easier.