after-task

Mandatory knowledge capture after completing work. Documents solution in Graphiti and tracks effectiveness for system improvement.

16 stars

Best use case

after-task is best used when you need a repeatable AI agent workflow instead of a one-off prompt.

Mandatory knowledge capture after completing work. Documents solution in Graphiti and tracks effectiveness for system improvement.

Teams using after-task should expect a more consistent output, faster repeated execution, less prompt rewriting.

When to use this skill

  • You want a reusable workflow that can be run more than once with consistent structure.

When not to use this skill

  • You only need a quick one-off answer and do not need a reusable workflow.
  • You cannot install or maintain the underlying files, dependencies, or repository context.

Installation

Claude Code / Cursor / Codex

$curl -o ~/.claude/skills/after-task/SKILL.md --create-dirs "https://raw.githubusercontent.com/diegosouzapw/awesome-omni-skill/main/skills/backend/after-task/SKILL.md"

Manual Installation

  1. Download SKILL.md from GitHub
  2. Place it in .claude/skills/after-task/SKILL.md inside your project
  3. Restart your AI agent — it will auto-discover the skill

How after-task Compares

Feature / Agentafter-taskStandard Approach
Platform SupportNot specifiedLimited / Varies
Context Awareness High Baseline
Installation ComplexityUnknownN/A

Frequently Asked Questions

What does this skill do?

Mandatory knowledge capture after completing work. Documents solution in Graphiti and tracks effectiveness for system improvement.

Where can I find the source code?

You can find the source code on GitHub using the link provided at the top of the page.

SKILL.md Source

# @after-task - Knowledge Capture

**Use AFTER:**
- Spec completed and tests passing
- Pre-push hook succeeded
- Before creating PR or merging
- Complex bug fixed
- Major refactoring done

**MANDATORY** - Don't skip this! Future you will thank you.

---

## What It Does

```
1. Document solution in Graphiti (group_id="screengraph")
   - Problem statement
   - Solution approach
   - Key learnings and gotchas
   - Files modified
   - Related specs/bugs
   
2. Optional: Track MCP effectiveness
   - Which MCPs were actually used
   - What worked well
   - What could be better
```

**Token cost**: ~600 tokens  
**Frequency**: Once per spec/major-task  
**ROI**: Future specs benefit = exponential improvement

---

## Execution

### Mandatory: Document in Graphiti

```typescript
add_memory({
  name: "[Spec/Bug Number]: [Short Title]",
  episode_body: `
    [Tags: domain, type, technology]
    
    **Problem**: [What we were trying to solve]
    
    **Solution**: [High-level approach, not code details]
    
    **Key Learnings**:
    - [Learning 1]
    - [Learning 2]
    
    **Gotchas**:
    - [Gotcha 1 with workaround]
    - [Gotcha 2 with workaround]
    
    **Files Modified**:
    - [file 1]
    - [file 2]
    
    **Tests Added**:
    - [test file 1]
    
    **Related**: [Spec-XXX, BUG-YYY, FR-ZZZ]
    
    **Date**: [YYYY-MM-DD]
  `,
  group_id: "screengraph",
  source: "text"
});
```

### Optional: Track MCP Effectiveness

```typescript
track_effectiveness({
  task: "[Original task description]",
  mcps_used: ["graphiti", "encore-mcp", "svelte"],
  outcome: "helpful",  // or "partially_helpful" or "not_helpful"
  feedback: "[What worked well or what was missing]"
});
```

**This helps the orchestrator learn and improve recommendations!**

---

## Template for Common Scenarios

### Completed Spec

```typescript
add_memory({
  name: "Spec-001: Automate Appium Lifecycle",
  episode_body: `
    [Tags: spec, backend, appium, devops, lifecycle]
    
    **Problem**: Manual Appium server management was error-prone and time-consuming
    
    **Solution**: 
    - Created lifecycle management service
    - Automated start/stop/health-check
    - Integration with agent setup flow
    
    **Key Learnings**:
    - Appium sessions need explicit health monitoring
    - Port conflicts must be detected before starting
    - Process management requires PID tracking
    
    **Gotchas**:
    - Appium doesn't expose ready signal (must poll /status)
    - Zombie processes if not cleaned up properly
    - Port 4723 conflicts with other Appium instances
    
    **Files Modified**:
    - backend/appium/lifecycle.service.ts
    - backend/agent/nodes/setup/EnsureDevice/node.ts
    - .cursor/commands/backend/Taskfile.yml
    
    **Tests Added**:
    - backend/appium/tests/lifecycle.test.ts
    
    **Related**: Spec-001
    
    **Date**: 2025-11-13
  `,
  group_id: "screengraph",
  source: "text"
});
```

### Bug Fixed

```typescript
add_memory({
  name: "BUG-015: Agent Stalls on Privacy Consent Dialog",
  episode_body: `
    [Tags: bug, backend, agent, appium, dialogs]
    
    **Problem**: Agent hung when app showed privacy consent modal
    
    **Solution**: 
    - Added pre-flight dialog detection
    - User prompted to handle consent manually
    - Check runs before policy execution starts
    
    **Key Learnings**:
    - First-run experience often has modals
    - Can't automate all user interactions
    - Human-in-loop pattern works well
    
    **Gotchas**:
    - Different apps have different consent flows
    - Some dialogs block entire UI hierarchy
    - Must check BEFORE starting automation
    
    **Files Modified**:
    - backend/agent/nodes/setup/EnsureDevice/device-check.ts
    
    **Related**: BUG-015, Spec-001
    
    **Date**: 2025-11-13
  `,
  group_id: "screengraph",
  source: "text"
});
```

### Refactoring

```typescript
add_memory({
  name: "Refactor: Agent State Machine to Single Sink Pattern",
  episode_body: `
    [Tags: refactor, backend, agent, architecture]
    
    **Problem**: Multiple terminal states added complexity
    
    **Solution**: 
    - Single "completed" state
    - stopReason field captures why (success/error/canceled)
    - Frontend uses stopReason for UI decisions
    
    **Key Learnings**:
    - Simpler state machines are easier to debug
    - stopReason pattern is flexible
    - Database schema aligned with code
    
    **Gotchas**:
    - Must migrate existing runs to new pattern
    - Frontend needs update to check stopReason
    
    **Files Modified**:
    - backend/agent/machine/AgentMachine.ts
    - backend/db/migrations/008_single_sink.up.sql
    - frontend/src/routes/runs/[runId]/+page.svelte
    
    **Related**: Architecture decision docs
    
    **Date**: 2025-11-05
  `,
  group_id: "screengraph",
  source: "text"
});
```

---

## Integration Points

### After Pre-Push
```bash
# Pre-push succeeded
git push origin feature-X

# Now document (BEFORE creating PR)
@after-task [completed spec/task]

# Review documentation template
# Fill in learnings
# Add to Graphiti
```

### After PR Merge
```bash
# PR merged to main

# Document if not done already
@after-task [completed work]
```

---

## Quality Standards

**Good documentation includes:**
- ✅ Clear problem statement
- ✅ High-level solution (not code details)
- ✅ Specific gotchas with workarounds
- ✅ ALL files modified
- ✅ Related specs/bugs linked
- ✅ Proper tags for categorization

**Bad documentation:**
- ❌ Just code snippets
- ❌ No gotchas mentioned
- ❌ Vague problem statement
- ❌ Missing file references
- ❌ No tags

---

## Why This is Mandatory

**If you skip @after-task:**
- ❌ Knowledge is lost
- ❌ Next person hits same gotchas
- ❌ Patterns aren't discovered
- ❌ System doesn't improve

**If you run @after-task:**
- ✅ Knowledge compounds
- ✅ Future specs are faster
- ✅ Gotchas documented once, avoided forever
- ✅ System gets exponentially smarter

**Future you will thank present you.**

---

## Enforcement

From `founder_rules.mdc`:
```markdown
**After Completing Task:**
1. ✅ Document solution via Graphiti
2. ✅ Include: problem, solution, gotchas, files
3. ✅ Use tags for organization
```

**This isn't optional. It's how the system improves.**

---

**Purpose**: Capture institutional knowledge so future work benefits from past work. The self-improvement loop closes here.

Related Skills

aidf-task-templates

16
from diegosouzapw/awesome-omni-skill

Task template definitions for AIDF. Provides structured templates for component, refactor, test, docs, architecture, and bugfix task types.

Announcement Drafter

16
from diegosouzapw/awesome-omni-skill

Write clear, impactful company announcements for any audience

todo-task-planning

16
from diegosouzapw/awesome-omni-skill

Execute task planning based on the specified file and manage questions[/todo-task-planning file_path --pr --branch branch_name]

task-automation

16
from diegosouzapw/awesome-omni-skill

Execute development tasks from manifest, run parallel agents, verify builds, manage task pipeline. Use when user wants to run tasks, check task status, execute dev loop, or work through the backlog.

task-add

16
from diegosouzapw/awesome-omni-skill

This skill should be used when the user asks to "add a task", "create task", "new task", or "task to do X". Adds timestamped tasks to daily note log with optional due dates.

pixi-tasks

16
from diegosouzapw/awesome-omni-skill

Complex pixi task workflows and orchestration. Use when building task dependency chains, configuring caching with inputs/outputs, creating parameterized tasks, or setting up CI pipelines—e.g., "pixi task depends-on", "task caching for build automation", "multi-environment test matrices".

mise-tasks

16
from diegosouzapw/awesome-omni-skill

Orchestrate workflows with mise [tasks]. TRIGGERS - mise tasks, mise run, task runner, depends, depends_post, workflow automation, task dependencies.

Onboarding Check-in Drafter

16
from diegosouzapw/awesome-omni-skill

Draft onboarding check-in emails at 7, 14, and 30 days after deal close. Use when an onboarding milestone triggers or user asks "draft onboarding check-in", "send new customer welcome", or needs to proactively engage new accounts. Returns stage-appropriate check-in with setup assistance, adoption tips, or expansion conversation.

sqlmodel-task-models

16
from diegosouzapw/awesome-omni-skill

This skill should be used when defining a robust, type-safe, and async-compatible database schema for the Todo application using SQLModel, ensuring compatibility with Better Auth and optimized for PostgreSQL.

after-effects

16
from diegosouzapw/awesome-omni-skill

Use when implementing Disney's 12 animation principles in Adobe After Effects

agent-task-distributor

16
from diegosouzapw/awesome-omni-skill

Expert task distributor specializing in intelligent work allocation, load balancing, and queue management. Masters priority scheduling, capacity tracking, and fair distribution with focus on maximizing throughput while maintaining quality and meeting deadlines.

agent-task-delegator

16
from diegosouzapw/awesome-omni-skill

Delegate tasks across multi-agent architectures with proper context preservation.