Session-to-Agent Skill
Convert an interactive coding session into a reusable goal-seeking agent with
memory. The skill reads session transcripts, extracts goals and patterns, and
generates a complete agent via amplihack new.
Quick Start
Step 1: Invoke the skill
User: /session-to-agent
Or describe what you want:
User: Turn this session into a reusable agent
Step 2: The skill extracts from the current session
It analyzes the session transcript to identify:
- Primary goal and sub-goals
- Constraints (technical, operational, time)
- Tools and commands used
- Patterns and strategies observed
- Domain knowledge gained during the session
Step 3: A goal-seeking agent is generated
The skill writes a prompt.md file and runs:
amplihack new --file prompt.md --sdk copilot --enable-memory
The generated agent can be re-run autonomously to repeat or extend the
session's workflow.
What It Extracts
| Category |
Examples |
| Primary Goal |
"Implement JWT authentication for the REST API" |
| Sub-Goals |
Token generation, middleware, refresh flow, tests |
| Constraints |
Must use RS256, tokens expire in 1h, no external IdP |
| Tools Used |
pytest, ruff, git, curl, Bash, Read, Edit |
| Patterns |
Outside-in TDD, error-first validation, retry logic |
| Domain Knowledge |
JWT spec details, library quirks, API contract rules |
| Success Criteria |
All tests pass, CI green, security review approved |
Customizing the Generated Agent
After generation, you can refine the agent by editing:
prompt.md -- the goal description and constraints
plan.yaml -- the execution phases and dependencies
skills.yaml -- the required skills and tool mappings
metadata.json -- SDK, memory, and multi-agent settings
Re-run the generator after edits:
amplihack new --file prompt.md --sdk copilot --enable-memory
Memory Export (Optional)
When --enable-memory is used, the skill can optionally export the current
session's Kuzu memory database as the agent's initial knowledge base. This
seeds the new agent with facts, discoveries, and context from the session
that created it.
# Export is offered interactively after agent generation
# Or specify explicitly:
amplihack new --file prompt.md --enable-memory --sdk copilot
When to Use This Skill
- After completing a multi-step workflow you want to repeat
- When a session reveals a reusable process worth automating
- To hand off a workflow to a colleague as a runnable agent
- To create a CI/CD or SRE automation agent from manual steps
- When session knowledge should persist as an executable artifact
When NOT to Use This Skill
- For trivial single-command tasks (use a script instead)
- When the session was exploratory with no clear repeatable goal
- When the workflow is already captured as a recipe or agent
Supporting Files
| Need |
File |
| Full extraction algorithm and templates |
reference.md |
| Worked examples with real sessions |
examples.md |
| Goal-seeking agent design guidance |
goal-seeking-agent-pattern skill |
| Knowledge extraction from sessions |
knowledge-extractor skill |
1---
2name: session-to-agent
3version: 1.0.0
4description: >-
5 Converts interactive Claude Code or GitHub Copilot session goals and processes
6 into a reusable goal-seeking agent with memory. Extracts goals, constraints,
7 and approaches from session transcripts and generates agent prompts via the
8 amplihack goal_agent_generator CLI.
9auto-detection:
10 triggers:
11 - "session to agent"
12 - "turn session into agent"
13 - "convert session"
14 - "create agent from session"
15 - "extract agent from conversation"
16 - "reusable agent from session"
17 - "productize this workflow"
18invokes:
19 - tools: [Read, Write, Glob, Grep, Bash]
20 - commands: [amplihack new]
21 - skills: [goal-seeking-agent-pattern, knowledge-extractor]
22allowed-tools: ["Read", "Write", "Glob", "Grep", "Bash"]
23target-agents: ["architect", "builder"]
24priority: medium
25complexity: medium
26maturity: production
27metadata:
28 source: https://skillmd.com/skills/rysweet/session-to-agent
29---
30
31# Session-to-Agent Skill
32
33Convert an interactive coding session into a reusable goal-seeking agent with
34memory. The skill reads session transcripts, extracts goals and patterns, and
35generates a complete agent via `amplihack new`.
36
37## Quick Start
38
39### Step 1: Invoke the skill
40
41```
42User: /session-to-agent
43```
44
45Or describe what you want:
46
47```
48User: Turn this session into a reusable agent
49```
50
51### Step 2: The skill extracts from the current session
52
53It analyzes the session transcript to identify:
54
55- **Primary goal** and sub-goals
56- **Constraints** (technical, operational, time)
57- **Tools and commands** used
58- **Patterns and strategies** observed
59- **Domain knowledge** gained during the session
60
61### Step 3: A goal-seeking agent is generated
62
63The skill writes a `prompt.md` file and runs:
64
65```bash
66amplihack new --file prompt.md --sdk copilot --enable-memory
67```
68
69The generated agent can be re-run autonomously to repeat or extend the
70session's workflow.
71
72## What It Extracts
73
74| Category | Examples |
75| -------------------- | ---------------------------------------------------- |
76| **Primary Goal** | "Implement JWT authentication for the REST API" |
77| **Sub-Goals** | Token generation, middleware, refresh flow, tests |
78| **Constraints** | Must use RS256, tokens expire in 1h, no external IdP |
79| **Tools Used** | pytest, ruff, git, curl, Bash, Read, Edit |
80| **Patterns** | Outside-in TDD, error-first validation, retry logic |
81| **Domain Knowledge** | JWT spec details, library quirks, API contract rules |
82| **Success Criteria** | All tests pass, CI green, security review approved |
83
84## Customizing the Generated Agent
85
86After generation, you can refine the agent by editing:
87
88- `prompt.md` -- the goal description and constraints
89- `plan.yaml` -- the execution phases and dependencies
90- `skills.yaml` -- the required skills and tool mappings
91- `metadata.json` -- SDK, memory, and multi-agent settings
92
93Re-run the generator after edits:
94
95```bash
96amplihack new --file prompt.md --sdk copilot --enable-memory
97```
98
99## Memory Export (Optional)
100
101When `--enable-memory` is used, the skill can optionally export the current
102session's Kuzu memory database as the agent's initial knowledge base. This
103seeds the new agent with facts, discoveries, and context from the session
104that created it.
105
106```bash
107# Export is offered interactively after agent generation
108# Or specify explicitly:
109amplihack new --file prompt.md --enable-memory --sdk copilot
110```
111
112## When to Use This Skill
113
114- After completing a multi-step workflow you want to repeat
115- When a session reveals a reusable process worth automating
116- To hand off a workflow to a colleague as a runnable agent
117- To create a CI/CD or SRE automation agent from manual steps
118- When session knowledge should persist as an executable artifact
119
120## When NOT to Use This Skill
121
122- For trivial single-command tasks (use a script instead)
123- When the session was exploratory with no clear repeatable goal
124- When the workflow is already captured as a recipe or agent
125
126## Supporting Files
127
128| Need | File |
129| --------------------------------------- | -------------------------------- |
130| Full extraction algorithm and templates | [reference.md](reference.md) |
131| Worked examples with real sessions | [examples.md](examples.md) |
132| Goal-seeking agent design guidance | goal-seeking-agent-pattern skill |
133| Knowledge extraction from sessions | knowledge-extractor skill |