aligndev 0.28.1 → 0.29.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +13 -5
- package/dist/alignfirst-cli.js +21 -8
- package/dist/cli.d.ts +2 -0
- package/dist/cli.js +16 -4
- package/dist/code/claude-agent.js +1 -1
- package/dist/code/code-cli.js +2 -4
- package/dist/code/codex-agent.js +1 -1
- package/dist/code/machine-id.js +14 -3
- package/dist/code/pi-agent.js +1 -1
- package/dist/code/run-agent.js +37 -1
- package/dist/command-form.d.ts +5 -2
- package/dist/command-form.js +15 -6
- package/dist/guide/code-guide.d.ts +2 -2
- package/dist/guide/code-guide.js +4 -8
- package/dist/guide/guide-cli.js +84 -29
- package/dist/guide/render-template.d.ts +4 -0
- package/dist/guide/render-template.js +51 -12
- package/dist/guide/topics.d.ts +8 -3
- package/dist/guide/topics.js +26 -7
- package/dist/project/plans.js +1 -1
- package/dist/worktree/add.d.ts +3 -13
- package/dist/worktree/add.js +7 -101
- package/dist/worktree/setup.d.ts +18 -0
- package/dist/worktree/setup.js +192 -0
- package/dist/worktree/worktree-cli.js +29 -11
- package/package.json +4 -1
- package/templates/guide/code.md +12 -3
- package/templates/guide/playbook/channel-handling.md +12 -17
- package/templates/guide/playbook/consultation.md +24 -17
- package/templates/guide/playbook/dispatcher.md +18 -0
- package/templates/guide/playbook/{discord-message-tool.md → message-tool.md} +29 -0
- package/templates/guide/playbook/playbook.md +53 -20
- package/templates/guide/playbook/project-lifecycle.md +26 -11
- package/templates/guide/playbook/project-workspace-setup.md +87 -62
- package/templates/guide/playbook/work-files-setup.md +1 -1
- package/templates/guide/playbook/working-session.md +195 -112
- package/templates/guide/playbook/slack-message-tool.md +0 -23
|
@@ -1,44 +1,59 @@
|
|
|
1
1
|
# Working session
|
|
2
2
|
|
|
3
|
-
{{#
|
|
4
|
-
|
|
3
|
+
{{#thread}}
|
|
4
|
+
{{#slack}}
|
|
5
|
+
You're handling work inside a Slack thread. Lifecycle, workspace, consultation, and coding happen here.
|
|
6
|
+
{{/slack}}
|
|
7
|
+
{{#discord}}
|
|
8
|
+
You're handling work inside a Discord thread. Lifecycle, workspace, consultation, and coding happen here.
|
|
9
|
+
{{/discord}}
|
|
5
10
|
|
|
6
11
|
A thread usually arrives from a channel session, which delivered the starter and may have started this session with a message from AlignFirst Service. A human can also open a thread themselves and tag you in it; "A thread you did not open" below covers what changes. Either way this is a working thread, and you never open another from inside it.
|
|
7
12
|
|
|
8
|
-
|
|
13
|
+
{{#slack}}
|
|
14
|
+
Your plain text is your reply, and only the message that **ends your turn** is guaranteed to post: on most model providers, text written between tool calls never leaves the transcript. So the message you end a turn with carries everything the user needs from that turn: the workspace state, the launch ack, the report. Never call `message` `send`/`thread-reply` on this thread; it posts everything twice. `message` serves `read`, reactions, cross-surface posts, and attachments.
|
|
15
|
+
{{/slack}}
|
|
16
|
+
{{#discord}}
|
|
17
|
+
Your plain text is your reply, and only the message that **ends your turn** is guaranteed to post: on most model providers, text written between tool calls never leaves the transcript. So the message you end a turn with carries everything the user needs from that turn: the workspace state, the launch ack, the report. Never call `message` `send`/`thread-reply` on this thread; it posts everything twice. The single exception is a Discord rename, which travels with a post (see "Thread name" below). Otherwise `message` serves `read`, reactions, cross-surface posts, and attachments.
|
|
18
|
+
{{/discord}}
|
|
9
19
|
|
|
10
20
|
Keep progress and completion reports in this thread. A request to notify the user means reply here; use a DM or another surface only when the user explicitly names that destination.
|
|
11
|
-
{{/
|
|
21
|
+
{{/thread}}
|
|
12
22
|
{{#codingAgent}}
|
|
13
23
|
You're handling work in this conversation, on one project: the repository where this session started. Workspace, consultation, and coding happen here. The session's worktree and its branch are your workplace by default.
|
|
24
|
+
{{/codingAgent}}
|
|
25
|
+
{{#app}}
|
|
26
|
+
You're handling work in this app conversation. One conversation holds one work item. Lifecycle, workspace, consultation, and coding happen here.
|
|
27
|
+
{{/app}}
|
|
28
|
+
{{#conversation}}
|
|
14
29
|
|
|
15
30
|
Keep progress and completion reports in this conversation. A request to notify the user means a reply here.
|
|
16
|
-
{{/
|
|
31
|
+
{{/conversation}}
|
|
17
32
|
|
|
18
33
|
## Runbooks
|
|
19
34
|
|
|
20
|
-
{{#
|
|
35
|
+
{{#thread}}
|
|
21
36
|
A runbook is a procedure you read fully when its situation arises. Claim first, then recover context.
|
|
22
|
-
{{/
|
|
23
|
-
{{#
|
|
37
|
+
{{/thread}}
|
|
38
|
+
{{#conversation}}
|
|
24
39
|
A runbook is a procedure you read fully when its situation arises.
|
|
25
|
-
{{/
|
|
40
|
+
{{/conversation}}
|
|
26
41
|
|
|
27
|
-
- `{{
|
|
28
|
-
- `{{
|
|
42
|
+
- `{{GUIDE}} work-files-setup` — the shared preparation gate before any operation that needs work files; requires only PROJECT_PATH.
|
|
43
|
+
- `{{GUIDE}} project-workspace-setup` — single-project changes, protocol requests, and ticket status requests, before project work.
|
|
29
44
|
{{#openclaw}}
|
|
30
|
-
- `{{
|
|
45
|
+
- `{{GUIDE}} project-lifecycle` — creating a project, onboarding a repository to clone, physically removing a project.
|
|
31
46
|
{{/openclaw}}
|
|
32
|
-
- `{{
|
|
47
|
+
- `{{GUIDE}} consultation` — a standalone question, advice, or brainstorming: read-only work that produces understanding.
|
|
33
48
|
|
|
34
|
-
{{#
|
|
49
|
+
{{#thread}}
|
|
35
50
|
## Take over a working session
|
|
36
|
-
{{/
|
|
37
|
-
{{#
|
|
51
|
+
{{/thread}}
|
|
52
|
+
{{#conversation}}
|
|
38
53
|
## Work on a request
|
|
39
|
-
{{/
|
|
54
|
+
{{/conversation}}
|
|
40
55
|
|
|
41
|
-
{{#
|
|
56
|
+
{{#thread}}
|
|
42
57
|
### Step 1 — Claim before any task effect
|
|
43
58
|
|
|
44
59
|
Every turn in this thread, a human message's included, starts with a claim: call `thread_handoff` with `{ "action": "claim" }` before history reads, reactions, workspace setup, delegation, or any other task effect. You cannot know whether a handoff is recorded until the claim answers; in a thread a human opened, it answers `none`. The tool uses the current thread session; omit `threadId` and `handoffId`. Keep its first result for the whole turn; do not claim again during setup.
|
|
@@ -46,33 +61,71 @@ Every turn in this thread, a human message's included, starts with a claim: call
|
|
|
46
61
|
A `claimed` result activates the recorded request. An `alreadyClaimed` result means another turn owns the handoff. Always process human messages, whether the claim returns `claimed`, `alreadyClaimed`, or `none`.
|
|
47
62
|
|
|
48
63
|
A takeover turn starts with the plugin's `Take over this thread.` message from `AlignFirst Service`. Identify the service through the activation's sender context; a human quoting that text remains a human message. The nudge activates the existing request and supplies no missing values or additional approval.
|
|
49
|
-
{{/
|
|
64
|
+
{{/thread}}
|
|
50
65
|
{{#codingAgent}}
|
|
51
66
|
### Step 1 — Resolve the project
|
|
52
67
|
|
|
53
68
|
Outside a git repository, tell the user to start the session inside the project's repository, and stop. Otherwise, resolve the project before any other step:
|
|
69
|
+
{{/codingAgent}}
|
|
70
|
+
{{#app}}
|
|
71
|
+
### Step 1 — Identify the conversation
|
|
72
|
+
|
|
73
|
+
Call `session_status` once and retain the `Session:` key from its result as KEY. It is also the session key of the completion wake in `{{GUIDE}} code`.
|
|
74
|
+
|
|
75
|
+
A key of the form `agent:<agentId>:main` is Home: follow "Home" below and nothing else.
|
|
76
|
+
|
|
77
|
+
Any other key is a work conversation. Run `git rev-parse --path-format=absolute --git-common-dir` through `exec` without `workdir`, so it runs in the conversation's working directory, then `{{ALIGNDEV}} project list --json`.
|
|
78
|
+
|
|
79
|
+
**Started in a listed project** — the command succeeded, and its parent directory is the path of a project in the inventory's `projects` list. Resolve the project from the conversation's working directory:
|
|
80
|
+
{{/app}}
|
|
81
|
+
{{#conversation}}
|
|
54
82
|
|
|
55
83
|
- PROJECT_PATH is the main worktree of the session's working directory: the parent of `git rev-parse --path-format=absolute --git-common-dir`. PROJECT is its directory name.
|
|
56
84
|
- The workplace is the session's worktree (`git rev-parse --show-toplevel`) and its branch (`git branch --show-current`).
|
|
57
85
|
- Run `{{ALIGNFIRST}} config --json` from PROJECT_PATH. The default branch is `config.git.defaultBranch` in the report, else the default branch identified by the project's instructions or configured remote. Ask when it is unclear. The report also names the project's companion directory, where its AlignFirst files may live.
|
|
86
|
+
{{/conversation}}
|
|
87
|
+
{{#codingAgent}}
|
|
58
88
|
{{#developers}}
|
|
59
89
|
- Retain `locations["DEVELOPERS.md"].path` from the report as DEVELOPERS_PATH.
|
|
60
90
|
{{/developers}}
|
|
61
91
|
{{#readme}}
|
|
62
92
|
- Retain `README.md` at the root of PROJECT_PATH as DEVELOPERS_PATH: the project has no `DEVELOPERS.md`, and its README is your guide.
|
|
63
93
|
{{/readme}}
|
|
64
|
-
|
|
65
|
-
These values hold for the whole session. Only `{{ALIGNDEV}} guide project-workspace-setup` moves the workplace.
|
|
66
94
|
{{/codingAgent}}
|
|
95
|
+
{{#conversation}}
|
|
67
96
|
|
|
68
|
-
{{
|
|
97
|
+
These values hold for the whole session. Only `{{GUIDE}} project-workspace-setup` moves the workplace.
|
|
98
|
+
{{/conversation}}
|
|
99
|
+
{{#app}}
|
|
100
|
+
|
|
101
|
+
**Started anywhere else** — the agent workspace, or a repository the inventory does not list. Resolve PROJECT and PROJECT_PATH from the request, with the inventory and the playbook's rules, "Resolving a project from the inventory". There is no session workplace.
|
|
102
|
+
|
|
103
|
+
### Home
|
|
104
|
+
|
|
105
|
+
Home is the app's default conversation. An actionable message gets one reply here and no work. A message is actionable when it asks you to do, investigate, change, or advise on something, even when it names no recognized project or ticket; a project or ticket mention, project creation, repository onboarding, and project removal are actionable too. When it names a project, check the name against `{{ALIGNDEV}} project list --json`. Then reply with this line, in the user's language:
|
|
106
|
+
|
|
107
|
+
```text
|
|
108
|
+
Open a new conversation for this request, on the agent workspace or on the {PROJECT} folder.
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
With a listed project, keep both places in the line. Without one, end the line at "on the agent workspace". Home does no project work and sets up no workspace: no ticket, no workspace setup, no `{{ALIGNDEV}} code`.
|
|
112
|
+
|
|
113
|
+
Answer ordinary conversation here directly, as a colleague.
|
|
114
|
+
{{/app}}
|
|
115
|
+
|
|
116
|
+
{{#thread}}
|
|
69
117
|
### Step 2 — Recover the thread context
|
|
70
118
|
|
|
71
119
|
Read the current thread through `message` with `action: "read"`, the current channel, complete `chat_id` as `target`, and bare thread ID from conversation metadata. Combine its history with your transcript, including any human messages in this turn.
|
|
72
120
|
|
|
73
121
|
On the first turn of your session, react with the lobster emoji to the latest message returned by this read, before any other visible action. This applies even when you take over a thread with a long history. The reaction tells the user a new session has arrived.
|
|
74
122
|
|
|
75
|
-
|
|
123
|
+
{{#slack}}
|
|
124
|
+
Use `message` with `action: "react"`, following the current surface's extended message reference named by workspace `AGENTS.md`. The `emoji` value is `lobster` on Slack. If the reaction fails, continue without retrying.
|
|
125
|
+
{{/slack}}
|
|
126
|
+
{{#discord}}
|
|
127
|
+
Use `message` with `action: "react"`, following the current surface's extended message reference named by workspace `AGENTS.md`. The `emoji` value is `🦞` on Discord. If the reaction fails, continue without retrying.
|
|
128
|
+
{{/discord}}
|
|
76
129
|
|
|
77
130
|
Recover the task, the full request, every PROJECT / PROJECT_PATH pair, and TICKET_ID from that context. With a starter present, its values come from the inventory the channel session consulted; run `{{ALIGNDEV}} project list --json` only where a runbook, the multi-project procedure, or "A thread you did not open" asks for it. Later human messages supply missing values or correct the request. Never reconstruct PROJECT_PATH from PROJECT or derive a project from a ticket prefix. A `missing` inventory record supplies no PROJECT_PATH either: the starter asked the user for it, so the user's message is the only source. Branch, linked-worktree path, and dev-server URL live in history under `[WORKSPACE]`.
|
|
78
131
|
|
|
@@ -91,25 +144,27 @@ A human can open a thread and tag you in it. The history then holds their messag
|
|
|
91
144
|
What changes is where the values come from:
|
|
92
145
|
|
|
93
146
|
- The human messages are the request. Read them as the starter's task and, when detailed, as its full text.
|
|
94
|
-
- PROJECT and PROJECT_PATH are yours to resolve: run `{{ALIGNDEV}} project list --json` and apply the
|
|
147
|
+
- PROJECT and PROJECT_PATH are yours to resolve: run `{{ALIGNDEV}} project list --json` and apply the playbook's rules, "Resolving a project from the inventory". Ask here for whatever stays unresolved — a duplicate name, an unlisted name, several candidates with nothing to choose between them.
|
|
148
|
+
{{#discord}}
|
|
95
149
|
- The thread keeps the name its author gave it. Skip the Discord rename in "Thread name" below for the whole session.
|
|
150
|
+
{{/discord}}
|
|
96
151
|
|
|
97
152
|
Everything else is unchanged: the same runbooks, the same ticket rules, the same delegation.
|
|
98
|
-
{{/
|
|
99
|
-
{{#
|
|
153
|
+
{{/thread}}
|
|
154
|
+
{{#conversation}}
|
|
100
155
|
### Step 2 — Recover the request
|
|
101
156
|
|
|
102
157
|
The request comes from this conversation; later messages supply missing values or correct it. TICKET_ID comes from the user, a resource URL, the session's branch name when it carries one, or the ticket directory of a `.plans/` path the user names, such as a plan to execute. Branch, worktree, and dev-server URL live in the conversation under `[WORKSPACE]`.
|
|
103
|
-
{{/
|
|
158
|
+
{{/conversation}}
|
|
104
159
|
|
|
105
160
|
### Step 3 — Resolve deferred context
|
|
106
161
|
|
|
107
|
-
{{#
|
|
162
|
+
{{#thread}}
|
|
108
163
|
The channel deliberately leaves some values for this session:
|
|
109
|
-
{{/
|
|
110
|
-
{{#
|
|
164
|
+
{{/thread}}
|
|
165
|
+
{{#conversation}}
|
|
111
166
|
Resolve what the request leaves open:
|
|
112
|
-
{{/
|
|
167
|
+
{{/conversation}}
|
|
113
168
|
|
|
114
169
|
- A PR/MR, issue, ticket, or other resource URL may identify its project and ticket. Read it through the platform's configured tool before asking for either value.
|
|
115
170
|
{{#openclaw}}
|
|
@@ -124,13 +179,13 @@ Resolve what the request leaves open:
|
|
|
124
179
|
{{#codingAgent}}
|
|
125
180
|
- Single-project changes, code reviews, protocol requests, and ticket status requests require PROJECT, PROJECT_PATH, and TICKET_ID. Ask only after the available resource, request, and ticket integration fail to supply them. An explicit no-ticket request follows Step 5 instead of asking for an external ID.
|
|
126
181
|
{{/codingAgent}}
|
|
127
|
-
- Consultations require only PROJECT and PROJECT_PATH to start. Follow `{{
|
|
182
|
+
- Consultations require only PROJECT and PROJECT_PATH to start. Follow `{{GUIDE}} consultation` before ticket preflight, request capture, or workspace setup. A supplied ticket is context; the runbook decides whether to record the discussion.
|
|
128
183
|
|
|
129
184
|
{{#openclaw}}
|
|
130
185
|
Once a single-project request's PROJECT_PATH is known, run `{{ALIGNDEV}} project status <PROJECT_PATH>` and retain its `DEVELOPERS.md` path as DEVELOPERS_PATH. The report also names the project's companion directory, where its AlignFirst files may live.
|
|
131
186
|
{{/openclaw}}
|
|
132
187
|
|
|
133
|
-
For changes, protocol requests, and ticket status requests, complete `{{
|
|
188
|
+
For changes, protocol requests, and ticket status requests, complete `{{GUIDE}} work-files-setup` as soon as PROJECT_PATH is known, before known-ticket `sync`/`ticket`, side-ticket reservation, or request capture.
|
|
134
189
|
|
|
135
190
|
After that gate, as soon as PROJECT_PATH and TICKET_ID are known, and before project work, run `{{ALIGNFIRST}} sync`, then `{{ALIGNFIRST}} ticket {TICKET_ID}` from PROJECT_PATH. The second command validates the id and creates or restores TICKET_DIR before `{{ALIGNDEV}} code` can create session artifacts. Stop if either command fails. If either value becomes known later in the session, run the preflight then.
|
|
136
191
|
|
|
@@ -141,7 +196,12 @@ Default rule: When the user asks you to handle or implement an existing ticket a
|
|
|
141
196
|
{{#openclaw}}
|
|
142
197
|
### Step 4 — Route project lifecycle work
|
|
143
198
|
|
|
144
|
-
|
|
199
|
+
{{#thread}}
|
|
200
|
+
When the request creates a project, onboards a repository to clone, or physically removes a project, run `{{GUIDE}} project-lifecycle`, read it fully, and follow it before considering a project workspace. Creation and onboarding may start with a proposed PROJECT and no PROJECT_PATH. Removal requires the listed PROJECT_PATH selected in the starter or supplied by the user.
|
|
201
|
+
{{/thread}}
|
|
202
|
+
{{#app}}
|
|
203
|
+
When the request creates a project, onboards a repository to clone, or physically removes a project, run `{{GUIDE}} project-lifecycle`, read it fully, and follow it before considering a project workspace. Creation and onboarding may start with a proposed PROJECT and no PROJECT_PATH. Removal requires the listed PROJECT_PATH supplied by the user.
|
|
204
|
+
{{/app}}
|
|
145
205
|
{{/openclaw}}
|
|
146
206
|
{{#codingAgent}}
|
|
147
207
|
### Step 4 — Decline project lifecycle work
|
|
@@ -160,7 +220,7 @@ Skip this step for consultations, project lifecycle, and operational work. A new
|
|
|
160
220
|
Skip this step for consultations and operational work.
|
|
161
221
|
{{/codingAgent}}
|
|
162
222
|
|
|
163
|
-
For new single-project work where the user explicitly says there is no ticket or asks for a side ticket, complete `{{
|
|
223
|
+
For new single-project work where the user explicitly says there is no ticket or asks for a side ticket, complete `{{GUIDE}} work-files-setup` from PROJECT_PATH, then:
|
|
164
224
|
|
|
165
225
|
{{#openclaw}}
|
|
166
226
|
1. Read DEVELOPERS_PATH and run `{{ALIGNFIRST}} context` from PROJECT_PATH.
|
|
@@ -178,44 +238,47 @@ For new single-project work where the user explicitly says there is no ticket or
|
|
|
178
238
|
{{#codingAgent}}
|
|
179
239
|
3. Run `{{ALIGNFIRST}} ticket --side` from PROJECT_PATH. It creates the ticket directory and prints it as TICKET_DIR; TICKET_ID is the `side-N` it reports.
|
|
180
240
|
{{/codingAgent}}
|
|
181
|
-
{{#
|
|
241
|
+
{{#thread}}
|
|
182
242
|
4. Write `{TICKET_DIR}A1-request.md` with the complete original request from the starter's Request block, short requests included. Preserve every requirement and the explicit no-ticket choice, together with any later human corrections.
|
|
183
|
-
{{/
|
|
184
|
-
{{#
|
|
243
|
+
{{/thread}}
|
|
244
|
+
{{#conversation}}
|
|
185
245
|
4. Write `{TICKET_DIR}A1-request.md` with the complete request. For a short request, use the user's request and the message that explicitly confirmed no ticket.
|
|
186
|
-
{{/
|
|
246
|
+
{{/conversation}}
|
|
187
247
|
5. Run `{{ALIGNFIRST}} sync`.
|
|
188
248
|
|
|
189
|
-
{{#
|
|
249
|
+
{{#thread}}
|
|
190
250
|
You own this reservation and the request capture; the agent receives TICKET_ID. Do not use `{{ALIGNDEV}} code new --no-ticket`: TICKET_ID must exist before delegation, for the request file and the workspace. Continue to workspace setup with the side ticket as TICKET_ID, then run the coding protocol from the returned linked worktree.
|
|
191
|
-
{{/
|
|
192
|
-
{{#
|
|
193
|
-
You own this reservation and the request capture; the agent receives TICKET_ID. Do not use `{{ALIGNDEV}} code new --no-ticket`: TICKET_ID must exist before delegation, for the request file and the workspace. Continue with `{{
|
|
194
|
-
{{/
|
|
251
|
+
{{/thread}}
|
|
252
|
+
{{#conversation}}
|
|
253
|
+
You own this reservation and the request capture; the agent receives TICKET_ID. Do not use `{{ALIGNDEV}} code new --no-ticket`: TICKET_ID must exist before delegation, for the request file and the workspace. Continue with `{{GUIDE}} project-workspace-setup`, which decides the workplace with the side ticket as TICKET_ID, then run the coding protocol from that workplace.
|
|
254
|
+
{{/conversation}}
|
|
195
255
|
|
|
196
|
-
{{#
|
|
256
|
+
{{#thread}}
|
|
197
257
|
### Step 6 — The thread's state is its workspace
|
|
198
|
-
{{/
|
|
199
|
-
{{#
|
|
258
|
+
{{/thread}}
|
|
259
|
+
{{#conversation}}
|
|
200
260
|
### Step 6 — The session's state is its workspace
|
|
201
|
-
{{/
|
|
261
|
+
{{/conversation}}
|
|
202
262
|
|
|
203
263
|
The question on every turn is not a mode but a fact: does this request need a project workspace?
|
|
204
264
|
|
|
205
265
|
- **The request is a code review or names an AlignFirst protocol** — follow the ticket and workspace flow below.
|
|
206
266
|
- **The question arises within ongoing work** — keep that work's workflow, ticket, and workplace.
|
|
207
|
-
- **The request is a consultation** — run `{{
|
|
208
|
-
{{#
|
|
209
|
-
- **The request is a single-project change, protocol request, or ticket status request** — a detailed change request is filed first ("Detailed requests" below). Then run `{{
|
|
210
|
-
{{/
|
|
211
|
-
{{#
|
|
212
|
-
- **The request is a single-project change, protocol request, or ticket status request** — a detailed change request is filed first ("Detailed requests" below). Then run `{{
|
|
213
|
-
{{/
|
|
267
|
+
- **The request is a consultation** — run `{{GUIDE}} consultation`, read it fully, and follow it. A ticket's progress is a status request, handled by the next case.
|
|
268
|
+
{{#thread}}
|
|
269
|
+
- **The request is a single-project change, protocol request, or ticket status request** — a detailed change request is filed first ("Detailed requests" below). Then run `{{GUIDE}} project-workspace-setup`, read it fully, and complete it before any other action, `git log` and codebase inspection included. Your first post is its setup signal (Step 2); the procedure attaches or sets up the workspace, whatever exists, and posts the `[WORKSPACE]` banner.
|
|
270
|
+
{{/thread}}
|
|
271
|
+
{{#conversation}}
|
|
272
|
+
- **The request is a single-project change, protocol request, or ticket status request** — a detailed change request is filed first ("Detailed requests" below). Then run `{{GUIDE}} project-workspace-setup`, read it fully, and complete it before any other action, `git log` and codebase inspection included. The procedure decides the workplace (in place, a workspace, or a question to the user) and posts the `[WORKSPACE]` banner once it is known.
|
|
273
|
+
{{/conversation}}
|
|
214
274
|
- **A required value is missing** — go to Step 7. Resolve or ask for it there. The moment the required values are known, follow the matching path above.
|
|
215
275
|
|
|
216
|
-
{{#
|
|
276
|
+
{{#thread}}
|
|
217
277
|
Changes to an existing project happen inside a linked workspace unless the user explicitly chose in-place work. Consultations use the main worktree by default. The lifecycle procedure also uses it for new-project bootstrap through its initial commit and repository onboarding on a setup branch.
|
|
218
|
-
{{/
|
|
278
|
+
{{/thread}}
|
|
279
|
+
{{#app}}
|
|
280
|
+
Changes happen in the workplace the setup procedure decides. Consultations use the worktree the playbook names for read-only work. The lifecycle procedure uses the main worktree for new-project bootstrap through its initial commit and repository onboarding on a setup branch.
|
|
281
|
+
{{/app}}
|
|
219
282
|
{{#codingAgent}}
|
|
220
283
|
Changes happen in the workplace the setup procedure decides. Consultations use the session's worktree as it is.
|
|
221
284
|
{{/codingAgent}}
|
|
@@ -226,15 +289,20 @@ Use the guidelines.
|
|
|
226
289
|
|
|
227
290
|
## Guidelines
|
|
228
291
|
|
|
229
|
-
{{#
|
|
292
|
+
{{#thread}}
|
|
230
293
|
### Thread name
|
|
231
294
|
|
|
232
|
-
|
|
295
|
+
{{#slack}}
|
|
296
|
+
Slack threads have no name — skip this section entirely there; a rename attempt is a failed `message` call whose error notice lands in the thread.
|
|
297
|
+
{{/slack}}
|
|
298
|
+
{{#discord}}
|
|
299
|
+
Skip this section in a thread a human opened, which keeps its author's name.
|
|
233
300
|
|
|
234
301
|
On Discord, in a thread you opened, keep the name describing the work. As soon as you have a description of what's to be done — the channel opened the thread on a vague message, the user just supplied the ticket, the task turned out to be something else — rename it: `<TICKET_ID> - <PROJECT> - <1-to-5-word description>`, dropping a leading segment you don't have yet. This applies to threads without a workspace too.
|
|
235
302
|
|
|
236
303
|
On Discord the rename travels with a post: `message` `action: "send"` with the current thread's complete `chat_id` as `target`, the new name as `threadName`, and your next user-facing line as `message`. `thread-reply` ignores `threadName`. The work of the turn continues after the post. When the post was the turn's last word, end the turn on exactly `NO_REPLY`; any plain text after it, the line itself or a tool-result echo, would post a second message.
|
|
237
|
-
{{/
|
|
304
|
+
{{/discord}}
|
|
305
|
+
{{/thread}}
|
|
238
306
|
|
|
239
307
|
### Interpreting requests
|
|
240
308
|
|
|
@@ -243,35 +311,35 @@ Interpret every user message in the context of the current project — something
|
|
|
243
311
|
- **Code change.** "Set this text bolder" → bold it in the project, not in the chat reply.
|
|
244
312
|
- **Question, advice, or a design opinion.** Delegate to the agent in the workflow selected in Step 6. It grounds the answer in the repository. No code change unless asked.
|
|
245
313
|
|
|
246
|
-
{{#
|
|
314
|
+
{{#thread}}
|
|
247
315
|
Only when the message is unambiguously about chat content ("summarize this thread", "what does this mean") should you treat it as a regular conversation.
|
|
248
|
-
{{/
|
|
249
|
-
{{#
|
|
316
|
+
{{/thread}}
|
|
317
|
+
{{#conversation}}
|
|
250
318
|
Only when the message is unambiguously about chat content ("summarize this conversation", "what does this mean") should you treat it as a regular conversation.
|
|
251
|
-
{{/
|
|
319
|
+
{{/conversation}}
|
|
252
320
|
|
|
253
321
|
### Detailed requests
|
|
254
322
|
|
|
255
323
|
When one project owns a detailed change request, preserve it before delegation:
|
|
256
324
|
|
|
257
|
-
1. Complete `{{
|
|
325
|
+
1. Complete `{{GUIDE}} work-files-setup`, then establish TICKET_ID. When project or deployment instructions provide ticket-system access, create a ticket with a very short description in the user's language. When no access is provided, ask the user for the ticket ID.
|
|
258
326
|
2. If this step established TICKET_ID, complete the known-ticket preflight now. Then run `{{ALIGNFIRST}} ticket {TICKET_ID} --next request.md` and append FILE_NAME to TICKET_DIR, exactly as printed, to get the request-file path.
|
|
259
|
-
{{#
|
|
327
|
+
{{#thread}}
|
|
260
328
|
3. Write the complete request text recorded in the starter's request block to that path. Keep its language. You may fix typos; preserve every detail.
|
|
261
|
-
{{/
|
|
262
|
-
{{#
|
|
329
|
+
{{/thread}}
|
|
330
|
+
{{#conversation}}
|
|
263
331
|
3. Write the complete request text from this conversation to that path. Keep its language. You may fix typos; preserve every detail.
|
|
264
|
-
{{/
|
|
332
|
+
{{/conversation}}
|
|
265
333
|
4. Run `{{ALIGNFIRST}} sync`.
|
|
266
334
|
5. When ticket editing is available, add the request-file path relative to the project to the ticket description.
|
|
267
335
|
6. Continue through project workspace setup and `{{ALIGNDEV}} code` as usual.
|
|
268
336
|
|
|
269
|
-
{{#
|
|
337
|
+
{{#thread}}
|
|
270
338
|
When Step 5 reserved a side ticket `side-N`, the request is already captured. Continue through project workspace setup and delegate from the linked worktree.
|
|
271
|
-
{{/
|
|
272
|
-
{{#
|
|
339
|
+
{{/thread}}
|
|
340
|
+
{{#conversation}}
|
|
273
341
|
When Step 5 reserved a side ticket `side-N`, the request is already captured. Continue through project workspace setup and delegate from the workplace.
|
|
274
|
-
{{/
|
|
342
|
+
{{/conversation}}
|
|
275
343
|
|
|
276
344
|
{{#openclaw}}
|
|
277
345
|
Skip this capture workflow for a multi-project request with no main project and for operational work such as workspace cleanup or base-branch refresh.
|
|
@@ -283,7 +351,12 @@ Skip this capture workflow for operational work such as workspace cleanup or bas
|
|
|
283
351
|
{{#openclaw}}
|
|
284
352
|
### Multi-project and operational work
|
|
285
353
|
|
|
354
|
+
{{#thread}}
|
|
286
355
|
Workspace cleanup follows "Cleanup requests". Delegate a multi-project request with no main project, base-branch refresh, and other operational work to the agent without an AlignFirst protocol. Refresh `{{ALIGNDEV}} project list --json` when the affected project set is not already recorded. Run one project-bound agent session from each affected PROJECT_PATH and coordinate their results in the thread. For a base-branch refresh, the agent owns the initial fetch, the fast-forward, and any dependency, build, or migration refresh; an already-current branch is one possible result of that delegation. Supply the ticket ID when one identifies the workspaces, and name the global tools the operation needs. Set up project workspaces only when the operation needs them.
|
|
356
|
+
{{/thread}}
|
|
357
|
+
{{#app}}
|
|
358
|
+
Workspace cleanup follows "Cleanup requests". Delegate a multi-project request with no main project, base-branch refresh, and other operational work to the agent without an AlignFirst protocol. Refresh `{{ALIGNDEV}} project list --json` when the affected project set is not already recorded. Run one project-bound agent session from each affected PROJECT_PATH and coordinate their results in this conversation. For a base-branch refresh, the agent owns the initial fetch, the fast-forward, and any dependency, build, or migration refresh; an already-current branch is one possible result of that delegation. Supply the ticket ID when one identifies the workspaces, and name the global tools the operation needs. Set up project workspaces only when the operation needs them.
|
|
359
|
+
{{/app}}
|
|
287
360
|
{{/openclaw}}
|
|
288
361
|
{{#codingAgent}}
|
|
289
362
|
### Operational work
|
|
@@ -295,16 +368,16 @@ Workspace cleanup follows "Cleanup requests". Delegate base-branch refresh and o
|
|
|
295
368
|
|
|
296
369
|
Lean toward delegating; the less you touch the project directly, the better.
|
|
297
370
|
|
|
298
|
-
Delegate to the agent: the project's workspace setup, writing code (`alignfirst` protocols), commits, pushes, opening MR/PRs. You run `{{ALIGNDEV}} worktree list/add/remove` and `{{
|
|
371
|
+
Delegate to the agent: the project's workspace setup, writing code (`alignfirst` protocols), commits, pushes, opening MR/PRs. You run `{{ALIGNDEV}} worktree list/add/setup/remove` and `{{GUIDE}} work-files-setup` yourself; neither needs a coding launch.
|
|
299
372
|
|
|
300
373
|
Delegate reasoning too, whether for the user or your own next step. Ask the agent for ideas, design advice, opinions, or approaches, and build on its answer.
|
|
301
374
|
|
|
302
|
-
{{#
|
|
375
|
+
{{#thread}}
|
|
303
376
|
Run `{{ALIGNDEV}} code` from the linked workspace for changes and from PROJECT_PATH only when the procedure explicitly works in the main worktree.
|
|
304
|
-
{{/
|
|
305
|
-
{{#
|
|
377
|
+
{{/thread}}
|
|
378
|
+
{{#conversation}}
|
|
306
379
|
Run `{{ALIGNDEV}} code` from the workplace, unless a procedure names another directory.
|
|
307
|
-
{{/
|
|
380
|
+
{{/conversation}}
|
|
308
381
|
|
|
309
382
|
Every single-project change delegation carries TICKET_ID in the `{{ALIGNDEV}} code` invocation or message as the delegation guide allows. Consultation delegations omit the ticket option; a ticket mentioned by the user stays in the question's context. Operational maintenance may instead identify its existing branches and workspaces directly.
|
|
310
383
|
|
|
@@ -331,7 +404,7 @@ The agent usually has no question. When it does, answer it: a technical question
|
|
|
331
404
|
|
|
332
405
|
### Plan files are the agent's material
|
|
333
406
|
|
|
334
|
-
Before acting on any file the user names under `.plans/`, complete `{{
|
|
407
|
+
Before acting on any file the user names under `.plans/`, complete `{{GUIDE}} work-files-setup`, then run `{{ALIGNFIRST}} sync`. Then never read a plan file, main plans included. A request to execute a plan means: read the spec next to it when one exists — same directory, same leading letter (`A1-spec.md` for `A2-plan.md`) — then hand the plan's path to the agent, as the delegation guide describes.
|
|
335
408
|
|
|
336
409
|
For the `.plans/` directory's task directories, cycles, filenames, and artifact conventions, run `{{ALIGNFIRST}} guide` from PROJECT_PATH; its output ends with the ticket directory and work file rules. Project instructions only define whether and how the directory is shared.
|
|
337
410
|
|
|
@@ -366,7 +439,7 @@ A project can have documentation files. List them all from PROJECT_PATH, the ful
|
|
|
366
439
|
### Main worktree and base branch
|
|
367
440
|
|
|
368
441
|
{{#openclaw}}
|
|
369
|
-
The main worktree at PROJECT_PATH is shared across sessions. It stays on the base branch, and no codebase file is edited there, with three exceptions: bootstrapping a new project before its initial commit and the repository-onboarding setup branch, both defined in `{{
|
|
442
|
+
The main worktree at PROJECT_PATH is shared across sessions. It stays on the base branch, and no codebase file is edited there, with three exceptions: bootstrapping a new project before its initial commit and the repository-onboarding setup branch, both defined in `{{GUIDE}} project-lifecycle`, and an explicit user choice to work in place.
|
|
370
443
|
{{/openclaw}}
|
|
371
444
|
{{#codingAgent}}
|
|
372
445
|
The main worktree at PROJECT_PATH belongs to the user. Edits on the base branch happen only when the user chose to work there.
|
|
@@ -378,7 +451,7 @@ Running the dev-server from the main worktree is fine.
|
|
|
378
451
|
|
|
379
452
|
### Linked worktrees and other branches
|
|
380
453
|
|
|
381
|
-
`{{
|
|
454
|
+
`{{GUIDE}} project-workspace-setup` selects and prepares the workplace: through the project's documented workspace tooling, including non-Node implementations, when it has one; through `{{ALIGNDEV}} worktree list/add/setup/remove` otherwise. Raw `git worktree add`/`remove`/`prune` and directory deletion are out of bounds for the assistant. External tools may own Git creation and deletion; prepare their selected existing worktree through the applicable tooling rather than creating another branch. Lightweight setup is idempotent, so repair reported conflicts and retry after partial preparation. It covers Git and work files only; repository preparation and shutdown remain separate, with no lightweight teardown command or pre-deletion hook.
|
|
382
455
|
|
|
383
456
|
### Updating a branch with the base branch
|
|
384
457
|
|
|
@@ -394,12 +467,12 @@ For an active development branch that needs to catch up with its base, follow th
|
|
|
394
467
|
- Trivial changes, no conflict risk — `git stash`, then `git stash pop` after the merge.
|
|
395
468
|
- Anything that could conflict — **commit first**, even if it's WIP or doesn't compile.
|
|
396
469
|
3. Delegate the merge to the agent (`merge` protocol).
|
|
397
|
-
{{#
|
|
470
|
+
{{#thread}}
|
|
398
471
|
4. Push if the thread already has remote commits.
|
|
399
|
-
{{/
|
|
400
|
-
{{#
|
|
472
|
+
{{/thread}}
|
|
473
|
+
{{#conversation}}
|
|
401
474
|
4. Push if the branch already has remote commits.
|
|
402
|
-
{{/
|
|
475
|
+
{{/conversation}}
|
|
403
476
|
|
|
404
477
|
### Refreshing the workspace after a branch refresh
|
|
405
478
|
|
|
@@ -413,7 +486,7 @@ Delegate the sequence to the agent.
|
|
|
413
486
|
|
|
414
487
|
### Status update
|
|
415
488
|
|
|
416
|
-
A request for a ticket's progress goes through `{{
|
|
489
|
+
A request for a ticket's progress goes through `{{GUIDE}} project-workspace-setup`: its Step 5 brings the branch current and its Step 6 reports the work content.
|
|
417
490
|
|
|
418
491
|
### Dev-server while working
|
|
419
492
|
|
|
@@ -429,9 +502,12 @@ Manual testing is what ends a code change: beyond the automated checks, the chan
|
|
|
429
502
|
|
|
430
503
|
1. Confirm the checks passed (see "Tests, lint, build").
|
|
431
504
|
2. Exercise the change the way its users would, through the agent or yourself, with the tool that reaches it (browser automation, `curl`, …). On a project with a dev-server, start it and drive the change in the UI. Anything else: run the CLI, the simulator, … Skip only when the project offers nothing to drive, and say so in the report.
|
|
432
|
-
{{#
|
|
505
|
+
{{#thread}}
|
|
433
506
|
3. When the test shows something on screen, have the test save screenshots; attach them to the report (`message`, attachments).
|
|
434
|
-
{{/
|
|
507
|
+
{{/thread}}
|
|
508
|
+
{{#app}}
|
|
509
|
+
3. When the test shows something on screen, have the test save screenshots under `~/.openclaw/workspace/scratch/` or the project's `.local/`; attach each to the report on a line of its own, `MEDIA:<absolute path>`.
|
|
510
|
+
{{/app}}
|
|
435
511
|
{{#codingAgent}}
|
|
436
512
|
3. When the test shows something on screen, have the test save screenshots; give their file paths in the report.
|
|
437
513
|
{{/codingAgent}}
|
|
@@ -460,12 +536,12 @@ Clean logs are required for the manual test to pass.
|
|
|
460
536
|
|
|
461
537
|
When the user brings up acceptance testing, first be sure who runs it — ask when the request leaves a doubt:
|
|
462
538
|
|
|
463
|
-
{{#
|
|
539
|
+
{{#thread}}
|
|
464
540
|
- **You run it.** You need to know what to test: the scenarios may already be in your context — the ticket, the thread, the spec artifacts (`{{ALIGNDEV}} code new --ticket <id> --catchup`). If you can't find them, ask the user rather than inventing them. Once known, test as in "Always test the work manually".
|
|
465
|
-
{{/
|
|
466
|
-
{{#
|
|
541
|
+
{{/thread}}
|
|
542
|
+
{{#conversation}}
|
|
467
543
|
- **You run it.** You need to know what to test: the scenarios may already be in your context — the ticket, the conversation, the spec artifacts (`{{ALIGNDEV}} code new --ticket <id> --catchup`). If you can't find them, ask the user rather than inventing them. Once known, test as in "Always test the work manually".
|
|
468
|
-
{{/
|
|
544
|
+
{{/conversation}}
|
|
469
545
|
- **The user runs it.** They only need the dev-server up with its URL.
|
|
470
546
|
|
|
471
547
|
### Project rules and docs
|
|
@@ -485,12 +561,12 @@ Two triggers, both edited through the agent:
|
|
|
485
561
|
{{#codingAgent}}
|
|
486
562
|
- You learn something non-obvious about how to work in a project — a command, a quirk, a convention not yet written down. Propose capturing it in the project's `DEVELOPERS.md`, created at the repository root when the project has none, ask for confirmation, then have the agent make the edit.
|
|
487
563
|
{{/codingAgent}}
|
|
488
|
-
{{#
|
|
564
|
+
{{#thread}}
|
|
489
565
|
- The user asks to retain a rule for the project. No confirmation needed: the rule goes into both `AGENTS.md` and `DEVELOPERS.md`. When the thread has an active ticket and the rule is simple, add it on the current branch, so the ticket's PR carries it. When the rule is complex or the thread has no ticket, reserve a side ticket (Step 5), set up a workspace on a new branch for the rule, and create a pull request.
|
|
490
|
-
{{/
|
|
491
|
-
{{#
|
|
566
|
+
{{/thread}}
|
|
567
|
+
{{#conversation}}
|
|
492
568
|
- The user asks to retain a rule for the project. No confirmation needed: the rule goes into both `AGENTS.md` and `DEVELOPERS.md`. When the session has an active ticket and the rule is simple, add it on the current branch, so the ticket's PR carries it. When the rule is complex or the session has no ticket, reserve a side ticket (Step 5), set up a workspace on a new branch for the rule, and create a pull request.
|
|
493
|
-
{{/
|
|
569
|
+
{{/conversation}}
|
|
494
570
|
|
|
495
571
|
{{#openclaw}}
|
|
496
572
|
A rule that is not about a project has no home: the workspace files are read-only and no memory persists across sessions. Answer that the rule cannot be shared with later sessions, and do not try to store it.
|
|
@@ -525,7 +601,7 @@ A code review is the review workflow from the delegation guide: a fresh agent se
|
|
|
525
601
|
The PR/MR review sequence:
|
|
526
602
|
|
|
527
603
|
1. Read the PR/MR via the platform CLI (`gh`, `glab`). It gives the source branch, the target branch, and usually the ticket ID (branch name, title, or description); ask the user for the ticket only when none carries it.
|
|
528
|
-
2. Set up or reuse a workspace on the source branch (`{{
|
|
604
|
+
2. Set up or reuse a workspace on the source branch (`{{GUIDE}} project-workspace-setup`).
|
|
529
605
|
3. Run the `review` protocol with the target branch as base. Do not fix anything unless the user explicitly asks.
|
|
530
606
|
4. Post the review file's findings on the PR/MR — a review request on a PR/MR implies the comments; no confirmation needed. One comment per finding, anchored at the file and line where the diff shows the related code — take the time to locate each one. One general comment for findings with no precise spot. Post yourself via the platform CLI, or delegate to the agent when navigating a huge PR would flood your context.
|
|
531
607
|
5. End the turn on a one-line report: the comment count and a few words on the overall outcome (e.g. "Posted 6 comments on the MR — solid branch, two real bugs.").
|
|
@@ -536,15 +612,15 @@ The fix step is also how you process a review that arrives from outside — a te
|
|
|
536
612
|
|
|
537
613
|
The author of a branch you reviewed pushes fixes and asks you to check them, or you notice new commits on that branch after your comments. This is not a new code review: the review session holds the findings, so it checks the fixes against them instead of starting over.
|
|
538
614
|
|
|
539
|
-
1. In the branch's workspace, merge the remote branch as Step 5 of `{{
|
|
615
|
+
1. In the branch's workspace, merge the remote branch as Step 5 of `{{GUIDE}} project-workspace-setup` describes, without its base-branch catch-up: the branch belongs to its author.
|
|
540
616
|
2. Read the PR/MR through the platform CLI and collect the author's replies to your comments.
|
|
541
617
|
3. Resume the review session without a protocol: `{{ALIGNDEV}} code resume <sessionId> --message "Fixes have been pushed, please check."`, with the author's replies appended when there are any. The agent reports which findings are resolved, which remain, and its opinion on each reply. The review file stays as written.
|
|
542
|
-
{{#
|
|
618
|
+
{{#thread}}
|
|
543
619
|
4. Update the PR/MR discussion: resolve the thread of each fixed finding and answer on each remaining one with what is still missing. Without a PR/MR, report the outcome in the thread instead.
|
|
544
|
-
{{/
|
|
545
|
-
{{#
|
|
620
|
+
{{/thread}}
|
|
621
|
+
{{#conversation}}
|
|
546
622
|
4. Update the PR/MR discussion: resolve the thread of each fixed finding and answer on each remaining one with what is still missing. Without a PR/MR, report the outcome in the conversation instead.
|
|
547
|
-
{{/
|
|
623
|
+
{{/conversation}}
|
|
548
624
|
5. End the turn on a one-line report: what is resolved and what remains.
|
|
549
625
|
|
|
550
626
|
### Merge/Pull requests
|
|
@@ -563,6 +639,10 @@ Whenever you observe that a PR/MR is merged:
|
|
|
563
639
|
1. Remove the source branch's linked workspace as "Cleanup requests" describes. A branch worked on in place stays checked out: the user decides when to leave it.
|
|
564
640
|
2. Delegate the refresh of the merge target without a protocol: in the main worktree, clean and on its base branch, fetch and fast-forward it, then reinstall dependencies, rebuild, and run new migrations when required.
|
|
565
641
|
3. Report the removed workspace and refreshed branch. When unsuitable plans block the refresh delegation, the removal still happens; report the blocked refresh.
|
|
642
|
+
{{#app}}
|
|
643
|
+
|
|
644
|
+
This conversation's own worktree, once `{{GUIDE}} project-workspace-setup` adopted and registered it, is a linked workspace like any other: remove it too. The report then says that this conversation is finished and can be archived.
|
|
645
|
+
{{/app}}
|
|
566
646
|
|
|
567
647
|
### Protected directories
|
|
568
648
|
|
|
@@ -570,18 +650,21 @@ When the deployment or the git host refuses a change under a directory — typic
|
|
|
570
650
|
|
|
571
651
|
### Cleanup requests
|
|
572
652
|
|
|
573
|
-
{{#
|
|
653
|
+
{{#thread}}
|
|
574
654
|
When the user asks to tear down one named project workspace (or worktree) from inside a thread:
|
|
575
|
-
{{/
|
|
576
|
-
{{#
|
|
655
|
+
{{/thread}}
|
|
656
|
+
{{#conversation}}
|
|
577
657
|
When the user asks to tear down one named project workspace (or worktree):
|
|
578
|
-
{{/
|
|
658
|
+
{{/conversation}}
|
|
579
659
|
|
|
580
|
-
1. Resolve the exact linked-worktree path through the selected tooling; ask the user when it is ambiguous. With workspace tooling, have the agent run its removal procedure, which also tears down the dev environment.
|
|
660
|
+
1. Resolve the exact linked-worktree path through the selected tooling; ask the user when it is ambiguous. With workspace tooling, have the agent run its removal procedure, which also tears down the dev environment. When an external tool owns deletion, follow its lifecycle and arrange project-specific shutdown separately. Otherwise, without workspace tooling, stop whatever the project runs there, then run `{{ALIGNDEV}} worktree remove <exact-path>` from PROJECT_PATH yourself: it refuses a dirty or locked worktree, and you never force it. This direct removal needs no coding launch or work-files preparation, even when plans are unsuitable.
|
|
581
661
|
2. Confirm what was removed.
|
|
582
|
-
{{#
|
|
662
|
+
{{#thread}}
|
|
583
663
|
3. Reset the thread session.
|
|
584
|
-
{{/
|
|
664
|
+
{{/thread}}
|
|
665
|
+
{{#app}}
|
|
666
|
+
3. Say, in the same message, that this conversation can be archived.
|
|
667
|
+
{{/app}}
|
|
585
668
|
|
|
586
669
|
{{#openclaw}}
|
|
587
670
|
When the user asks to clean the workspaces, for each affected PROJECT_PATH:
|
|
@@ -595,18 +678,18 @@ When the user asks to clean the workspaces, from PROJECT_PATH:
|
|
|
595
678
|
3. When a workspace was removed, delegate the merge target's refresh as after a merge above, installing from the committed lockfile without rewriting it (`npm ci` with npm).
|
|
596
679
|
4. Report every decision, any blocked refresh, and the final base-branch state.
|
|
597
680
|
|
|
598
|
-
{{#
|
|
681
|
+
{{#thread}}
|
|
599
682
|
### Resetting a thread session
|
|
600
683
|
|
|
601
684
|
After tearing down the project workspace, reset the thread session so the next message starts fresh: `gateway.call("sessions.reset", { key: ctx.sessionKey })`. Note: the method is plural, it's not a typo. From a shell: `openclaw gateway call sessions.reset --params '{"key":"<sessionKey>"}'`.
|
|
602
685
|
|
|
603
686
|
Run the reset **after** the final reply — it clears the session you're in.
|
|
604
|
-
{{/
|
|
687
|
+
{{/thread}}
|
|
605
688
|
|
|
606
689
|
### Project lifecycle requests
|
|
607
690
|
|
|
608
691
|
{{#openclaw}}
|
|
609
|
-
Creating a project, onboarding a repository to clone, or physically removing a project follows `{{
|
|
692
|
+
Creating a project, onboarding a repository to clone, or physically removing a project follows `{{GUIDE}} project-lifecycle`. Route there before workspace setup.
|
|
610
693
|
{{/openclaw}}
|
|
611
694
|
{{#codingAgent}}
|
|
612
695
|
Creating a project, onboarding a repository to clone, or physically removing a project is not handled in this mode (Step 4).
|