core/capabilities/execution/implement/SKILL.md
Implements a single task from the plan using TDD discipline. Reads the task spec, writes tests first, writes minimal passing code, refactors, and commits. Use when executing a planned task, writing code for a feature, or when the user says "implement this", "write the code", "build this task", or "execute the plan".
npx skillsauth add xoai/sage implementInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Write code for one task. Follow TDD. Stay in scope. Commit.
Core Principle: Implementation is the mechanical part. The thinking was done in the spec and plan. Your job now is to faithfully translate the plan into working, tested code — not to redesign, optimize, or "improve" beyond what was specified.
During the execution phase of any workflow, when a task from the plan is ready for implementation.
Read the full task specification from the plan. Understand:
If anything is unclear, ASK before proceeding. Guessing at requirements causes rework. It is always faster to ask one question than to rewrite 200 lines of code.
Reference the codebase-scan output and .sage/conventions.md:
Your implementation MUST follow existing conventions unless the task explicitly requires deviating from them.
Follow the tdd skill strictly:
Before declaring the task complete, check:
This is the critical persistence step. After committing, update the plan file to record completion. This is NOT optional — it IS the state persistence mechanism.
In the plan file (.sage/work/<feature>/plan.md):
- [ ] → - [x]✅ DONE (commit: <hash>)**Last updated:** timestamp**Status:** to completeWhy this matters: If the session ends unexpectedly — terminal closed, context window full, connection dropped — the plan file on disk shows exactly which tasks are done. The next session reads the plan file, sees the checkboxes, and resumes from the right place. This works because artifacts are the source of truth.
Write a semantic commit message:
<type>(<scope>): <short description>
<what was done and why, referencing the task>
Types: feat, fix, refactor, test, docs, chore
MUST (violation = broken code or lost work):
tdd skill is mandatory and has no exceptions.scope-guard skill is active. Do what the task says.SHOULD (violation = suboptimal but working):
MAY (context-dependent):
On Tier 1 platforms (Claude Code, Codex), each task implementation MAY be dispatched to a fresh subagent with clean context. The subagent receives:
The subagent implements, tests, self-reviews, and commits. Then the spec-review and quality-review run as separate subagents (adversarial review).
On Tier 2 platforms, the same process runs sequentially in one session.
tools
Captures agent mistakes, corrections, and discovered gotchas so they are not repeated. Use when: (1) a command or operation fails unexpectedly, (2) the user corrects the agent, (3) the agent discovers non-obvious behavior through debugging, (4) an API or tool behaves differently than expected, (5) a better approach is found for a recurring task. Also searches past learnings before starting tasks to avoid known pitfalls. Activate alongside the sage-memory skill — they share the same MCP backend but serve different purposes (sage-memory = codebase knowledge, sage-self-learning = agent mistakes and gotchas).
development
Typed knowledge graph stored in sage-memory. Use when creating or querying structured entities (Person, Project, Task, Event, Document), linking related objects, checking dependencies, planning multi-step actions as graph transformations, or when skills need to share structured state. Trigger on "remember that X is Y", "what do I know about", "link X to Y", "show dependencies", "what blocks X", entity CRUD, cross-skill data access, or any request involving structured relationships between things.
tools
Integrates sage-memory into Sage workflows. Teaches the agent when to remember (store findings during work), when to recall (search memory at session start and task start), and how to learn (structured knowledge capture via sage learn). Use when the user mentions memory, remember, recall, learn, capture knowledge, onboard to codebase, or when starting any session where sage-memory MCP tools are available.
tools
Captures agent mistakes, corrections, and discovered gotchas so they are not repeated. Use when: (1) a command or operation fails unexpectedly, (2) the user corrects the agent, (3) the agent discovers non-obvious behavior through debugging, (4) an API or tool behaves differently than expected, (5) a better approach is found for a recurring task. Also searches past learnings before starting tasks to avoid known pitfalls. Activate alongside the sage-memory skill — they share the same MCP backend but serve different purposes (sage-memory = codebase knowledge, sage-self-learning = agent mistakes and gotchas).