The learning cycle (/learning-agents learn) is the top-level orchestrator that discovers all pending sessions and runs the three-phase learning process (identify, investigate, incorporate) on each. It delegates actual work to sub-skills via Agent tool spawns.
The learning cycle MUST be invocable via /learning-agents learn. Arguments after learn MUST be ignored.
The skill MUST automatically discover all pending sessions by searching for needs_learning_as_of_timestamp files under .deepwork/tmp/agent_sessions/. The skill MUST NOT require the user to specify which sessions to process.
If no needs_learning_as_of_timestamp files are found (or the .deepwork/tmp/agent_sessions directory does not exist), the skill MUST inform the user that there are no pending sessions and stop.
For each pending session, the skill MUST extract:
- The session folder path (parent directory of
needs_learning_as_of_timestamp) - The agent name (from the
agent_usedfile in that folder)
For each pending session, the skill MUST run the learning cycle in three sequential phases:
- Identify: MUST spawn an Agent to run the
identifyskill on the session folder - Investigate: MUST spawn an Agent to run the
investigate-issuesskill on the session folder - Incorporate: MUST spawn an Agent to run the
incorporate-learningsskill on the session folder
The investigate and incorporate phases MUST be combined into a single Agent invocation, and they MUST execute in that order.
The identify phase MUST be run as a separate Agent invocation. The investigate and incorporate phases MUST be run as a combined Agent invocation (investigate first, then incorporate). All Agent spawns MUST use the learning-agents:identify, learning-agents:investigate-issues, and learning-agents:incorporate-learnings skills respectively.
Agent spawns for learning cycle sub-skills MUST use the Sonnet model to balance cost and quality.
Sessions MUST be processed one at a time (sequentially, not in parallel) to avoid conflicts when multiple sessions involve the same agent.
If a sub-skill Task fails for a session, the skill MUST:
- Log the failure
- Skip that session
- Continue processing remaining sessions
- NOT mark
needs_learning_as_of_timestampas resolved for the failed session
If a session's transcript cannot be found, the skill MUST skip that session and report the issue in the final summary.
Upon completion, the skill MUST output a summary containing:
- Total sessions processed
- Total issues identified
- List of agents updated
- Key learnings per agent
- Any skipped sessions with reasons
The learn skill MUST NOT modify agent files directly. All agent knowledge base changes MUST be delegated to the learning cycle sub-skills (identify, investigate-issues, incorporate-learnings).
The skill MUST use a dynamic include (! backtick find command) to list pending sessions at invocation time, ensuring it always has the current state of pending sessions.