Skip to content

Commit de2ecd1

Browse files
committed
chore: add docs on profile to agent migration
1 parent 8027a13 commit de2ecd1

File tree

2 files changed

+99
-0
lines changed

2 files changed

+99
-0
lines changed

docs/SUMMARY.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,4 @@
55
- [The Agent Format](./agent-format.md)
66
- [Built-in Tools](./built-in-tools.md)
77
- [Knowledge Management](./knowledge-management.md)
8+
- [Profile to Agent Migration](./legacy-profile-to-agent-migration.md)
Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
# Migrating Profiles to Agents
2+
3+
All global profiles (created under `~/.aws/amazonq/profiles/`) support automatic migration to the global agents directory under `~/.aws/amazonq/cli-agents/` on initial startup.
4+
5+
If you have local MCP configuration defined under `.amazonq/mcp.json`, then you can optionally add this configuration to a global agent, or create a new workspace agent.
6+
7+
## Creating a New Workspace Agent
8+
9+
Workspace agents are managed under the current working directory inside `.amazonq/cli-agents/`.
10+
11+
You can create a new workspace agent with `q agent create --name my-agent -d .`.
12+
13+
## MCP Servers
14+
15+
The agent configuration supports the same MCP format as previously configured.
16+
17+
See [the agent format documentation for more details](./agent-format.md#mcpservers-field).
18+
19+
## Context Files
20+
21+
Context files are now [file URI's](https://en.wikipedia.org/wiki/File_URI_scheme) and configured under the `"resources"` field.
22+
23+
Example from profiles:
24+
```json
25+
{
26+
"paths": [
27+
"~/my-files/**/*.txt"
28+
]
29+
}
30+
```
31+
32+
Same example for agents:
33+
```json
34+
{
35+
"resources": [
36+
"file://~/my-files/**/*.txt"
37+
]
38+
}
39+
```
40+
41+
## Hooks
42+
43+
Hook triggers have been updated:
44+
- Hook name is no longer required
45+
- `conversation_start` is now `agentSpawn`
46+
- `per_prompt` is now `userPromptSubmit`
47+
48+
See [the agent format documentation for more details](./agent-format.md#hooks-field).
49+
50+
Example from profiles:
51+
```json
52+
{
53+
"hooks": {
54+
"sleep_conv_start": {
55+
"trigger": "conversation_start",
56+
"type": "inline",
57+
"disabled": false,
58+
"timeout_ms": 30000,
59+
"max_output_size": 10240,
60+
"cache_ttl_seconds": 0,
61+
"command": "echo Conversation start hook"
62+
},
63+
"hello_world": {
64+
"trigger": "per_prompt",
65+
"type": "inline",
66+
"disabled": false,
67+
"timeout_ms": 30000,
68+
"max_output_size": 10240,
69+
"cache_ttl_seconds": 0,
70+
"command": "echo Per prompt hook"
71+
}
72+
}
73+
}
74+
```
75+
76+
Same example for agents:
77+
```json
78+
{
79+
"hooks": {
80+
"userPromptSubmit": [
81+
{
82+
"command": "echo Per prompt hook",
83+
"timeout_ms": 30000,
84+
"max_output_size": 10240,
85+
"cache_ttl_seconds": 0
86+
}
87+
],
88+
"agentSpawn": [
89+
{
90+
"command": "echo Conversation start hook",
91+
"timeout_ms": 30000,
92+
"max_output_size": 10240,
93+
"cache_ttl_seconds": 0
94+
}
95+
]
96+
}
97+
}
98+
```

0 commit comments

Comments
 (0)