@johngaynor/entourage 0.2.0 → 0.4.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 +29 -8
- package/cli/entourage +21 -7
- package/cli/lib/commands.sh +3 -0
- package/cli/lib/common.sh +8 -2
- package/cli/lib/handoff.sh +211 -0
- package/cli/lib/project.sh +80 -12
- package/cli/lib/task.sh +12 -3
- package/cli/lib/trust.sh +70 -0
- package/herdr/README.md +59 -4
- package/herdr/layouts/test.json +2 -2
- package/herdr/mods/projects/main.js +357 -0
- package/herdr/mods/projects/mod.json +1 -0
- package/package.json +1 -1
- package/prompts/task-new.md +1 -1
- package/skills/sdlc-breakdown/SKILL.md +22 -9
- package/skills/sdlc-define/SKILL.md +19 -8
- package/skills/sdlc-plan/SKILL.md +19 -8
package/herdr/README.md
CHANGED
|
@@ -9,8 +9,9 @@ layouts (whole-window arrangements of mods).
|
|
|
9
9
|
|---|---|
|
|
10
10
|
| `mods/cpu/` | Live CPU usage with a scrolling history. macOS only (reads `/usr/bin/top`). |
|
|
11
11
|
| `mods/layout-switch/` | A dropdown that shows the current layout and switches to another. |
|
|
12
|
+
| `mods/projects/` | Every project in your config, open or not. Click one to show its space; `+` makes a new one. |
|
|
12
13
|
| `layouts/default.json` | Herdr's own layout, plus the layout dropdown. |
|
|
13
|
-
| `layouts/test.json` | `default` plus the CPU mod in the sidebar. |
|
|
14
|
+
| `layouts/test.json` | `default` with the projects list in place of spaces, plus the CPU mod in the sidebar. |
|
|
14
15
|
| `projects/template/` | The starting `PROJECT.md` for every new project. |
|
|
15
16
|
|
|
16
17
|
The skills are in [../skills/](../skills/), outside this folder. They are
|
|
@@ -98,10 +99,19 @@ template is in this repo. Your own projects are in
|
|
|
98
99
|
|
|
99
100
|
- **Make one:** `entourage project new <name>`, then
|
|
100
101
|
`entourage project add <name> <path>` for each repo. The repo must already
|
|
101
|
-
be cloned on this machine.
|
|
102
|
+
be cloned on this machine. Paths after the name add those repos as the
|
|
103
|
+
project is made: `entourage project new <name> <path>...`. Every one is
|
|
104
|
+
checked first, and a path that is not a repo stops it with nothing made.
|
|
105
|
+
- **Make one in Herdr:** click the `+` above the projects list (on the `test`
|
|
106
|
+
layout) and choose a repo's folder. A dialog suggests a name from the
|
|
107
|
+
folder, lists the repo, and can add more. Create makes the project with
|
|
108
|
+
`entourage project new` and shows its space; whatever the command refuses
|
|
109
|
+
(a name in use, a folder that is not a repo) is shown in the dialog.
|
|
102
110
|
- **Open it:** `entourage project open <name>` rebuilds the links and shows
|
|
103
111
|
the project's space, making it if it is not open. The space's folder is the
|
|
104
112
|
project folder.
|
|
113
|
+
- **List them:** `entourage project ls`. `--json` prints the same list as
|
|
114
|
+
JSON with each project's folder; the projects mod reads it.
|
|
105
115
|
- **Check them:** `entourage status` reports a repo that has moved or gone,
|
|
106
116
|
and a `PROJECT.md` that is still the template. Delete the template's first
|
|
107
117
|
line once you have filled it in.
|
|
@@ -112,8 +122,9 @@ template is in this repo. Your own projects are in
|
|
|
112
122
|
|
|
113
123
|
## Tasks
|
|
114
124
|
|
|
115
|
-
A task is one piece of work in a project, usually a Linear card.
|
|
116
|
-
commands,
|
|
125
|
+
A task is one piece of work in a project, usually a Linear card. You run two
|
|
126
|
+
commands, in this order: `task new`, then `task start`. Two more, `task
|
|
127
|
+
handoff` and `task log`, record and show how each step of the write-up ended.
|
|
117
128
|
|
|
118
129
|
### Writing the card up
|
|
119
130
|
|
|
@@ -125,6 +136,14 @@ entourage task new <project> <card>
|
|
|
125
136
|
- **It opens a tab named after the card** in the project's space, in the
|
|
126
137
|
project folder, and starts an agent in it. The agent is `claude`;
|
|
127
138
|
`ENTOURAGE_AGENT` picks another command.
|
|
139
|
+
- **The project folder is trusted first.** Claude Code asks "do you trust this
|
|
140
|
+
folder?" the first time it starts somewhere, which would leave the agent
|
|
141
|
+
waiting. So `project new`, and `task new` before it opens the tab, mark the
|
|
142
|
+
project's folder as trusted in Claude Code's own file (`~/.claude.json`).
|
|
143
|
+
Only a project folder entourage made is marked: never a repo, and not a
|
|
144
|
+
project folder you linked in from somewhere else. Where it cannot be done
|
|
145
|
+
(no `jq`, or Claude Code has never run on the machine), entourage says so
|
|
146
|
+
and Claude Code asks once.
|
|
128
147
|
- **The agent's first message** is [prompts/task-new.md](../prompts/task-new.md)
|
|
129
148
|
with the card and project filled in. It tells the agent to start with
|
|
130
149
|
`sdlc-define` and follow each skill's handoff block to the next
|
|
@@ -137,6 +156,42 @@ entourage task new <project> <card>
|
|
|
137
156
|
`~/.claude/skills` stops it before anything is opened. Run
|
|
138
157
|
`entourage update` to link the skills.
|
|
139
158
|
|
|
159
|
+
### Hand-offs
|
|
160
|
+
|
|
161
|
+
Each step of a write-up ends by handing off: which step it was, how it ended
|
|
162
|
+
(`done`, `needs-human` or `failed`) and what comes next. The agent records
|
|
163
|
+
that itself, with the block on stdin:
|
|
164
|
+
|
|
165
|
+
```sh
|
|
166
|
+
entourage task handoff <project> <card> <<'EOF'
|
|
167
|
+
phase: define
|
|
168
|
+
status: done
|
|
169
|
+
next: plan
|
|
170
|
+
summary: Set the type to fix. The Specification has six Done when items.
|
|
171
|
+
EOF
|
|
172
|
+
```
|
|
173
|
+
|
|
174
|
+
```sh
|
|
175
|
+
entourage task log <project> <card>
|
|
176
|
+
```
|
|
177
|
+
|
|
178
|
+
- **The command holds the rules.** It refuses a block with a missing line, an
|
|
179
|
+
unknown status or step, a line that doesn't belong to that status, or a
|
|
180
|
+
value that runs onto a second line, and says what to fix. Run it with no
|
|
181
|
+
block to see the rules.
|
|
182
|
+
- **It is a command because wording wasn't enough.** An agent going from one
|
|
183
|
+
skill straight into the next writes nothing in between, but it does run
|
|
184
|
+
commands.
|
|
185
|
+
- **`task new` records the start,** so the time each step took can be read
|
|
186
|
+
from the hand-offs alone.
|
|
187
|
+
- **They are kept in `~/.config/entourage/entourage.db`,** a SQLite file
|
|
188
|
+
beside your projects, on this machine only. It needs `sqlite3`, which macOS
|
|
189
|
+
ships; `ENTOURAGE_SQLITE` picks another command. Without it `task new`
|
|
190
|
+
still starts the agent, the hand-offs are not recorded, and
|
|
191
|
+
`entourage status` says so.
|
|
192
|
+
- **The card stays in Linear.** The store records how a step ended, not what
|
|
193
|
+
was written.
|
|
194
|
+
|
|
140
195
|
### Starting the work
|
|
141
196
|
|
|
142
197
|
One branch, checked out as a git worktree of the repos the task needs, and
|
package/herdr/layouts/test.json
CHANGED
|
@@ -0,0 +1,357 @@
|
|
|
1
|
+
// Every project in the entourage config, open or not. Herdr only knows a
|
|
2
|
+
// project while its space has a tab, so the list comes from the entourage
|
|
3
|
+
// command, which owns where projects live and what counts as one. Click a
|
|
4
|
+
// project to show its space; one with no space is opened by the command.
|
|
5
|
+
//
|
|
6
|
+
// One mod, two faces: the list a layout places, and the New project dialog
|
|
7
|
+
// (the same mod again, with props { create: true }). The + above the list
|
|
8
|
+
// asks for a repo's folder with the system's picker, then opens the dialog on
|
|
9
|
+
// it. The dialog makes the project with the command too.
|
|
10
|
+
import { View, div } from "gpui-kit";
|
|
11
|
+
import { v_flex, h_flex, InputState, Input } from "gpui-base";
|
|
12
|
+
import {
|
|
13
|
+
exec, spaces, run, notify, theme, layout, window, checking, appHome, home, props,
|
|
14
|
+
pickFolder, openOverlay, closeOverlay, nextCommand,
|
|
15
|
+
} from "herdr";
|
|
16
|
+
|
|
17
|
+
const REFRESH_MS = 15000; // projects change rarely; the open marks are live anyway
|
|
18
|
+
const TIMEOUT_MS = 10000;
|
|
19
|
+
const ROW = 30;
|
|
20
|
+
const RAIL_CELL = 32;
|
|
21
|
+
// How this mod's own link into the repo that ships it ends.
|
|
22
|
+
const LINKED_AT = "/herdr/mods/projects";
|
|
23
|
+
const EMPTY = "No projects yet. Make one with the + above.";
|
|
24
|
+
const OLD_CLI = "This entourage cannot list projects as JSON. Run: entourage update";
|
|
25
|
+
|
|
26
|
+
function find(node, id) {
|
|
27
|
+
if (node?.id === id) return node;
|
|
28
|
+
for (const child of node?.children ?? []) {
|
|
29
|
+
const found = find(child, id);
|
|
30
|
+
if (found) return found;
|
|
31
|
+
}
|
|
32
|
+
return null;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
// The sidebar's rail goes by its width, as in Herdr's own lists.
|
|
36
|
+
const narrow = () => (find(layout(), "sidebar")?.size?.px ?? Infinity) < 160;
|
|
37
|
+
|
|
38
|
+
// The listing, or null when the output is not the JSON this mod reads (an
|
|
39
|
+
// older entourage prints the plain list whatever the option).
|
|
40
|
+
function parse(text) {
|
|
41
|
+
try {
|
|
42
|
+
const list = JSON.parse(text).projects;
|
|
43
|
+
return Array.isArray(list) ? list : null;
|
|
44
|
+
} catch {
|
|
45
|
+
return null;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
// What a failed command said, without the name it starts its errors with.
|
|
50
|
+
const said = (r) => (r.stderr || r.stdout).trim().replace(/^entourage: /, "");
|
|
51
|
+
|
|
52
|
+
// A picked folder without the slash a picker may end it with.
|
|
53
|
+
const tidy = (path) => (path.length > 1 ? path.replace(/\/+$/, "") : path);
|
|
54
|
+
const base = (path) => path.split("/").pop();
|
|
55
|
+
const tilde = (path) => (path.startsWith(`${home()}/`) ? `~${path.slice(home().length)}` : path);
|
|
56
|
+
// A name to start the dialog with, from the first repo's folder. Only a
|
|
57
|
+
// suggestion: the command decides what a project may be called.
|
|
58
|
+
const suggest = (text) => text.toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, "");
|
|
59
|
+
|
|
60
|
+
export default class Projects extends View {
|
|
61
|
+
init(_props, cx) {
|
|
62
|
+
this.projects = null; // null until the first listing answers
|
|
63
|
+
this.error = null;
|
|
64
|
+
this.busy = false;
|
|
65
|
+
this.opening = null; // the project a click is making a space for
|
|
66
|
+
this.cmd = "entourage"; // the one on PATH, until that cannot start
|
|
67
|
+
this.picking = false; // the system's folder picker is up
|
|
68
|
+
if (props()?.create) return this.initForm(cx);
|
|
69
|
+
if (checking()) return;
|
|
70
|
+
cx.timer.every(REFRESH_MS, (cx) => this.refresh(cx));
|
|
71
|
+
// The dialog says when it has made a project, so its row need not wait
|
|
72
|
+
// for the timer.
|
|
73
|
+
cx.spawn(async (cx) => {
|
|
74
|
+
for (;;) {
|
|
75
|
+
if ((await nextCommand()) === "refresh") this.refresh(cx);
|
|
76
|
+
cx.notify();
|
|
77
|
+
}
|
|
78
|
+
});
|
|
79
|
+
this.refresh(cx);
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
// The dialog. props: { create: true, folder: the first repo, cmd: the
|
|
83
|
+
// entourage command the list found, overlay }.
|
|
84
|
+
initForm(cx) {
|
|
85
|
+
const p = props() ?? {};
|
|
86
|
+
if (p.cmd) this.cmd = p.cmd;
|
|
87
|
+
this.repos = p.folder ? [tidy(p.folder)] : [];
|
|
88
|
+
this.name = suggest(base(this.repos[0] ?? ""));
|
|
89
|
+
this.error = "";
|
|
90
|
+
this.working = false;
|
|
91
|
+
this.input = InputState.new({ value: this.name, placeholder: "my-project" });
|
|
92
|
+
if (this.name) this.input.set_selected_range({ start: 0, end: this.name.length });
|
|
93
|
+
this.input.on("change", (_e, cx) => { this.name = this.input.value(); this.error = ""; cx.notify(); });
|
|
94
|
+
this.input.on("submit", (_e, cx) => this.submit(cx));
|
|
95
|
+
this.inputFocused = true;
|
|
96
|
+
this.input.on("focus", (_e, cx) => { this.inputFocused = true; cx.notify(); });
|
|
97
|
+
this.input.on("blur", (_e, cx) => { this.inputFocused = false; cx.notify(); });
|
|
98
|
+
this.handle = cx.focus_handle();
|
|
99
|
+
// Twice, as Herdr's own prompt does: the first lands before the dialog shows.
|
|
100
|
+
this.input.focus();
|
|
101
|
+
cx.timer.after(600, () => this.input.focus());
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
// Runs the entourage command. With `fallback`, a command that cannot run is
|
|
105
|
+
// tried again as the copy this mod is linked from (Herdr may have been
|
|
106
|
+
// started without the user's PATH). Only the listing asks for that: it is
|
|
107
|
+
// safe to run twice, and it has answered before there is a row to click. An
|
|
108
|
+
// open never does, because its failure may be a timeout with the first run
|
|
109
|
+
// still making the space.
|
|
110
|
+
async entourage(args, { fallback = false } = {}) {
|
|
111
|
+
try {
|
|
112
|
+
return await exec(this.cmd, args, { timeout: TIMEOUT_MS });
|
|
113
|
+
} catch (e) {
|
|
114
|
+
if (!fallback || this.cmd !== "entourage") throw e;
|
|
115
|
+
const link = await exec("readlink", [`${appHome()}/mods/projects`]);
|
|
116
|
+
const at = link.stdout.trim();
|
|
117
|
+
if (link.code !== 0 || !at.endsWith(LINKED_AT)) throw e;
|
|
118
|
+
this.cmd = `${at.slice(0, -LINKED_AT.length)}/cli/entourage`;
|
|
119
|
+
return exec(this.cmd, args, { timeout: TIMEOUT_MS });
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
refresh(cx) {
|
|
124
|
+
// Skip while a listing is in flight or nobody can see the window.
|
|
125
|
+
if (this.busy || window()?.visible === false) return;
|
|
126
|
+
this.busy = true;
|
|
127
|
+
cx.spawn(async (cx) => {
|
|
128
|
+
try {
|
|
129
|
+
const r = await this.entourage(["project", "ls", "--json"], { fallback: true });
|
|
130
|
+
const list = r.code === 0 ? parse(r.stdout) : null;
|
|
131
|
+
if (list) this.projects = list;
|
|
132
|
+
this.error = list ? null : r.code === 0 ? OLD_CLI : said(r) || "entourage project ls failed";
|
|
133
|
+
} catch (e) {
|
|
134
|
+
this.error = `Could not run entourage: ${e?.message ?? e}`;
|
|
135
|
+
}
|
|
136
|
+
this.busy = false;
|
|
137
|
+
cx.notify();
|
|
138
|
+
});
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
// `space`: the project's open space, or null.
|
|
142
|
+
pick(p, space, cx) {
|
|
143
|
+
if (space) {
|
|
144
|
+
run("space.select", { id: space.id });
|
|
145
|
+
return;
|
|
146
|
+
}
|
|
147
|
+
// One at a time: a second open would not see the first one's space yet.
|
|
148
|
+
if (this.opening) return;
|
|
149
|
+
this.opening = p.name;
|
|
150
|
+
cx.notify();
|
|
151
|
+
cx.spawn(async (cx) => {
|
|
152
|
+
let failed = null;
|
|
153
|
+
try {
|
|
154
|
+
const r = await this.entourage(["project", "open", p.name]);
|
|
155
|
+
if (r.code !== 0) failed = said(r);
|
|
156
|
+
} catch (e) {
|
|
157
|
+
failed = String(e?.message ?? e);
|
|
158
|
+
}
|
|
159
|
+
if (failed !== null) notify({ title: `Could not open ${p.name}`, body: failed, level: "error" });
|
|
160
|
+
this.opening = null;
|
|
161
|
+
this.refresh(cx);
|
|
162
|
+
cx.notify();
|
|
163
|
+
});
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
// The + above the list: choose the first repo, then name the project.
|
|
167
|
+
create(cx) {
|
|
168
|
+
if (this.picking) return;
|
|
169
|
+
this.picking = true;
|
|
170
|
+
cx.spawn(async (cx) => {
|
|
171
|
+
let folder = null;
|
|
172
|
+
try {
|
|
173
|
+
folder = await pickFolder({ prompt: "Choose" });
|
|
174
|
+
} catch (e) {
|
|
175
|
+
notify({ title: "Could not open the folder picker", body: String(e?.message ?? e), level: "error" });
|
|
176
|
+
}
|
|
177
|
+
this.picking = false;
|
|
178
|
+
if (folder) {
|
|
179
|
+
openOverlay({
|
|
180
|
+
mod: "projects", kind: "dialog", modal: true, width: 480,
|
|
181
|
+
props: { create: true, folder, cmd: this.cmd },
|
|
182
|
+
});
|
|
183
|
+
}
|
|
184
|
+
cx.notify();
|
|
185
|
+
});
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
row(p, space, t) {
|
|
189
|
+
const on = Boolean(space?.active);
|
|
190
|
+
const n = (p.repos ?? []).length;
|
|
191
|
+
const tail = this.opening === p.name ? "Opening…" : `${n} repo${n === 1 ? "" : "s"}`;
|
|
192
|
+
const dot = div().size(7).rounded(4).flex_none();
|
|
193
|
+
return h_flex().id(`project-${p.name}`).h(ROW).flex_none().px(8).gap(9).items_center().rounded(8)
|
|
194
|
+
.when(on, (el) => el.bg(t.selected))
|
|
195
|
+
.when(!on, (el) => el.hover((s) => s.bg(t.hover)))
|
|
196
|
+
.on_click((_e, cx) => this.pick(p, space, cx))
|
|
197
|
+
.child(h_flex().size(18).flex_none().items_center().justify_center()
|
|
198
|
+
.child(space ? dot.bg(t.ansi2) : dot.border_1().border_color(t.dim)))
|
|
199
|
+
.child(div().flex_1().min_w(0).truncate().text_color(space ? t.foreground : t.muted).child(p.name))
|
|
200
|
+
.child(div().flex_none().text_size(11.5).text_color(t.dim).child(tail));
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
// On the sidebar's rail: the project's first letter.
|
|
204
|
+
compact(p, space, t) {
|
|
205
|
+
const on = Boolean(space?.active);
|
|
206
|
+
return h_flex().flex_none().justify_center().child(
|
|
207
|
+
h_flex().id(`project-${p.name}`).w(RAIL_CELL).h(26).rounded(6).items_center().justify_center()
|
|
208
|
+
.tooltip(p.name)
|
|
209
|
+
.when(on, (el) => el.bg(t.selected))
|
|
210
|
+
.when(!on, (el) => el.hover((s) => s.bg(t.hover)))
|
|
211
|
+
.on_click((_e, cx) => this.pick(p, space, cx))
|
|
212
|
+
.child(div().text_color(space ? t.foreground : t.dim).child((p.name[0] ?? "?").toUpperCase())));
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
render() {
|
|
216
|
+
return props()?.create ? this.form() : this.list();
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
list() {
|
|
220
|
+
const t = theme();
|
|
221
|
+
const collapsed = narrow();
|
|
222
|
+
// A project is open when a space on this computer has its folder.
|
|
223
|
+
const local = spaces().filter((s) => !s.machine);
|
|
224
|
+
const note = (text, color) => div().px(8).py(6).text_size(12).text_color(color).child(text);
|
|
225
|
+
const items = [];
|
|
226
|
+
if (!collapsed) {
|
|
227
|
+
if (this.error) items.push(note(this.error, t.blocked));
|
|
228
|
+
else if (this.projects === null) items.push(note("Loading…", t.dim));
|
|
229
|
+
else if (this.projects.length === 0) items.push(note(EMPTY, t.dim));
|
|
230
|
+
}
|
|
231
|
+
for (const p of this.projects ?? []) {
|
|
232
|
+
const space = local.find((s) => s.folder === p.folder) ?? null;
|
|
233
|
+
items.push(collapsed ? this.compact(p, space, t) : this.row(p, space, t));
|
|
234
|
+
}
|
|
235
|
+
return v_flex().size_full().min_h(0).bg(t.chrome).text_size(13)
|
|
236
|
+
.child(h_flex().h(31).flex_none().pl(16).pr(10).items_center().justify_between()
|
|
237
|
+
.text_size(11.5).text_color(t.dim)
|
|
238
|
+
.when(collapsed, (el) => el.pl(0).pr(0).justify_center())
|
|
239
|
+
.when(!collapsed, (el) => el.child("Projects"))
|
|
240
|
+
.child(div().id("project-new").size(26).flex_none().flex().items_center().justify_center()
|
|
241
|
+
.rounded(6).text_size(15).tooltip("New project")
|
|
242
|
+
.hover((s) => s.bg(t.hover).text_color(t.foreground))
|
|
243
|
+
.on_click((_e, cx) => this.create(cx))
|
|
244
|
+
.child("+")))
|
|
245
|
+
.child(v_flex().id("project-list").flex_1().min_h(0).px(collapsed ? 0 : 8).pb(14)
|
|
246
|
+
.overflow_y_scrollbar().mode("always").children(items));
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
// --- the New project dialog ----------------------------------------------
|
|
250
|
+
|
|
251
|
+
close() {
|
|
252
|
+
closeOverlay(props().overlay);
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
// Another repo for the project, from the system's picker.
|
|
256
|
+
addRepo(cx) {
|
|
257
|
+
if (this.picking || this.working) return;
|
|
258
|
+
this.picking = true;
|
|
259
|
+
cx.spawn(async (cx) => {
|
|
260
|
+
try {
|
|
261
|
+
const folder = await pickFolder({ prompt: "Add" });
|
|
262
|
+
if (folder && !this.repos.includes(tidy(folder))) this.repos.push(tidy(folder));
|
|
263
|
+
this.error = "";
|
|
264
|
+
} catch (e) {
|
|
265
|
+
this.error = `Could not open the folder picker: ${e?.message ?? e}`;
|
|
266
|
+
}
|
|
267
|
+
this.picking = false;
|
|
268
|
+
this.input.focus();
|
|
269
|
+
cx.notify();
|
|
270
|
+
});
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
// Makes the project and shows its space. The command checks the name and
|
|
274
|
+
// every repo before it makes anything, so what it refuses is shown here and
|
|
275
|
+
// the dialog stays open to be put right.
|
|
276
|
+
submit(cx) {
|
|
277
|
+
if (this.working) return;
|
|
278
|
+
const name = this.name.trim();
|
|
279
|
+
this.working = true;
|
|
280
|
+
this.error = "";
|
|
281
|
+
cx.notify();
|
|
282
|
+
cx.spawn(async (cx) => {
|
|
283
|
+
let failed = null;
|
|
284
|
+
try {
|
|
285
|
+
const r = await this.entourage(["project", "new", name, ...this.repos]);
|
|
286
|
+
if (r.code !== 0) failed = said(r) || "entourage project new failed";
|
|
287
|
+
} catch (e) {
|
|
288
|
+
failed = `Could not run entourage: ${e?.message ?? e}`;
|
|
289
|
+
}
|
|
290
|
+
if (failed !== null) {
|
|
291
|
+
this.working = false;
|
|
292
|
+
this.error = failed;
|
|
293
|
+
cx.notify();
|
|
294
|
+
return;
|
|
295
|
+
}
|
|
296
|
+
// Tell the list. With no list showing there is nobody to tell, and that
|
|
297
|
+
// must not stop the space from opening.
|
|
298
|
+
try { run("projects.refresh"); } catch {}
|
|
299
|
+
// The project is made, so a space that will not open is not this
|
|
300
|
+
// dialog's to keep asking about: say so and leave it in the list.
|
|
301
|
+
let unopened = null;
|
|
302
|
+
try {
|
|
303
|
+
const r = await this.entourage(["project", "open", name]);
|
|
304
|
+
if (r.code !== 0) unopened = said(r);
|
|
305
|
+
} catch (e) {
|
|
306
|
+
unopened = String(e?.message ?? e);
|
|
307
|
+
}
|
|
308
|
+
if (unopened !== null) notify({ title: `Made ${name}, but could not open it`, body: unopened, level: "error" });
|
|
309
|
+
this.close();
|
|
310
|
+
});
|
|
311
|
+
}
|
|
312
|
+
|
|
313
|
+
form() {
|
|
314
|
+
const t = theme();
|
|
315
|
+
const label = (text) => div().pt(16).pb(7).text_size(11.5).text_color(t.dim).child(text);
|
|
316
|
+
const button = (id, text, primary, action) =>
|
|
317
|
+
h_flex().id(id).h(32).px(14).items_center().rounded(8)
|
|
318
|
+
.border_1().border_color(primary ? t.solid : t.input).bg(primary ? t.solid : t.raised)
|
|
319
|
+
.text_color(primary ? t.solid_foreground : t.foreground).text_size(12.5).font_medium()
|
|
320
|
+
.cursor_pointer().hover((s) => s.opacity(0.88)).on_click(action).child(text);
|
|
321
|
+
const repo = (path, i) =>
|
|
322
|
+
h_flex().h(ROW).flex_none().pl(10).pr(4).gap(10).items_center().rounded(8).bg(t.raised)
|
|
323
|
+
.child(div().flex_none().max_w(180).truncate().child(base(path)))
|
|
324
|
+
.child(div().flex_1().min_w(0).truncate().text_size(11.5).text_color(t.dim).child(tilde(path)))
|
|
325
|
+
.child(div().id(`project-new-drop-${i}`).size(22).flex_none().flex().items_center().justify_center()
|
|
326
|
+
.rounded(6).text_color(t.dim).tooltip("Leave this repo out")
|
|
327
|
+
.hover((s) => s.bg(t.hover).text_color(t.foreground))
|
|
328
|
+
.on_click((_e, cx) => { this.repos.splice(i, 1); this.error = ""; cx.notify(); })
|
|
329
|
+
.child("×"));
|
|
330
|
+
return v_flex().id("project-new-form").track_focus(this.handle)
|
|
331
|
+
.on_key_down((e, cx) => { if (e.key === "escape") { this.close(); cx.stop_propagation(); } })
|
|
332
|
+
.w_full().min_h(0).p(18).bg(t.popover).text_color(t.foreground).text_size(13)
|
|
333
|
+
.child(h_flex().items_center()
|
|
334
|
+
.child(div().flex_1().text_size(15).font_semibold().child("New project"))
|
|
335
|
+
.child(div().text_size(11).text_color(t.dim).child("Esc")))
|
|
336
|
+
.child(div().pt(6).text_size(12.8).text_color(t.muted)
|
|
337
|
+
.child("A project groups the repos that belong together and opens as one space."))
|
|
338
|
+
.child(label("Name"))
|
|
339
|
+
.child(Input.new(this.input).h(36).px(10).rounded(9).border_1()
|
|
340
|
+
.border_color(this.inputFocused ? t.accent : t.input).bg(t.background)
|
|
341
|
+
.text_size(12.8).text_color(t.foreground))
|
|
342
|
+
.child(label("Repos"))
|
|
343
|
+
.child(v_flex().id("project-new-repos").max_h(200).min_h(0).flex_shrink(1).gap(4)
|
|
344
|
+
.overflow_y_scroll().children(this.repos.map(repo)))
|
|
345
|
+
.child(h_flex().id("project-new-add").h(ROW).flex_none().mt(this.repos.length ? 4 : 0).px(10)
|
|
346
|
+
.items_center().rounded(8).text_color(t.muted).cursor_pointer()
|
|
347
|
+
.hover((s) => s.bg(t.hover).text_color(t.foreground))
|
|
348
|
+
.on_click((_e, cx) => this.addRepo(cx))
|
|
349
|
+
.child(this.repos.length ? "+ Add another repo…" : "+ Add a repo…"))
|
|
350
|
+
.when(Boolean(this.error), (el) =>
|
|
351
|
+
el.child(div().pt(12).text_size(12).text_color(t.blocked).child(this.error)))
|
|
352
|
+
.child(h_flex().pt(20).gap(8).justify_end()
|
|
353
|
+
.child(button("project-new-cancel", "Cancel", false, () => this.close()))
|
|
354
|
+
.child(button("project-new-create", this.working ? "Creating…" : "Create", true,
|
|
355
|
+
(_e, cx) => this.submit(cx))));
|
|
356
|
+
}
|
|
357
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{ "place": "none", "title": "Projects" }
|
package/package.json
CHANGED
package/prompts/task-new.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Write up Linear card {card} so that it is ready to build. This session is in the entourage project `{project}`.
|
|
2
2
|
|
|
3
|
-
Start with the sdlc-define skill. Each skill ends by
|
|
3
|
+
Start with the sdlc-define skill. Each skill ends by recording a hand-off with `entourage task handoff {project} {card}`, as the skill describes. Record each one before you start the next skill, even though you carry straight on: the hand-offs are how I see how each step ended. You are driving this run, so act on the `status` you recorded:
|
|
4
4
|
|
|
5
5
|
- `done`: go straight on to the step in `next`, without waiting for me. `plan` is the sdlc-plan skill and `breakdown` is the sdlc-breakdown skill.
|
|
6
6
|
- `needs-human`: wait for my answer, then carry on with the same skill.
|
|
@@ -98,13 +98,15 @@ Give them a summary they can answer from without opening Linear:
|
|
|
98
98
|
- The approach, in a sentence or two.
|
|
99
99
|
- Whether it is one piece or several, and why. If several, the slice names in order.
|
|
100
100
|
|
|
101
|
-
Then ask them to approve or say what to change.
|
|
101
|
+
Then ask them to approve or say what to change. Record the ask as a hand-off with this block, then end your message with the summary and, below it, the block the command printed:
|
|
102
102
|
|
|
103
103
|
```
|
|
104
|
+
entourage task handoff <project> <card ID> <<'EOF'
|
|
104
105
|
phase: breakdown
|
|
105
106
|
status: needs-human
|
|
106
107
|
question: Approve <card ID> as specified, planned and broken down?
|
|
107
108
|
options: approve | change breakdown | change plan | change specification
|
|
109
|
+
EOF
|
|
108
110
|
```
|
|
109
111
|
|
|
110
112
|
Wait for their answer.
|
|
@@ -138,11 +140,19 @@ Read the parent and each sub-issue back, then hand off.
|
|
|
138
140
|
|
|
139
141
|
## Hand off
|
|
140
142
|
|
|
141
|
-
Breakdown is finished when the human has approved the card and, if it was sliced, its sub-issues exist. Then
|
|
143
|
+
Breakdown is finished when the human has approved the card and, if it was sliced, its sub-issues exist. Then record the hand-off:
|
|
142
144
|
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
145
|
+
```
|
|
146
|
+
entourage task handoff <project> <card ID> <<'EOF'
|
|
147
|
+
phase: breakdown
|
|
148
|
+
status: done
|
|
149
|
+
next: setup
|
|
150
|
+
summary: <that the card is approved, and whether it is one piece or sliced; if sliced, the sub-issues in order with their IDs, and which one is first>
|
|
151
|
+
flags: <anything that didn't go to plan, such as a blocking relation that couldn't be set>
|
|
152
|
+
EOF
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
Put your own words in place of each hint in angle brackets, and leave the `flags` line out when there is nothing to flag.
|
|
146
156
|
|
|
147
157
|
Setup is not a skill. It is the `entourage task start` command, which the human runs, so there is no step for you to go on to.
|
|
148
158
|
|
|
@@ -150,9 +160,10 @@ Setup is not a skill. It is the `entourage task start` command, which the human
|
|
|
150
160
|
|
|
151
161
|
Every step of the lifecycle ends the same way, so whoever is driving it, a person or a script, can tell how the step ended without reading the whole session.
|
|
152
162
|
|
|
153
|
-
|
|
163
|
+
Record a hand-off every time this step ends or pauses: when the step is finished, when you need an answer, and when something has gone wrong. Record it even when you go straight on to another step, because the record is what shows this one ended. Run `entourage task handoff` with the block on stdin, one value per line:
|
|
154
164
|
|
|
155
165
|
```
|
|
166
|
+
entourage task handoff <project> <card ID> <<'EOF'
|
|
156
167
|
phase: <this step>
|
|
157
168
|
status: <done, needs-human or failed>
|
|
158
169
|
next: <the step that follows>
|
|
@@ -161,9 +172,10 @@ flags: <what the human should know but wasn't asked>
|
|
|
161
172
|
question: <one question>
|
|
162
173
|
options: <the answers you expect, your recommendation first, separated by " | ">
|
|
163
174
|
reason: <what went wrong, and what you already tried>
|
|
175
|
+
EOF
|
|
164
176
|
```
|
|
165
177
|
|
|
166
|
-
Which lines you write depends on the status:
|
|
178
|
+
`<project>` is the entourage project this session is in. The words in angle brackets are hints: put your own in their place. The command checks the block, records it and prints it back. Which lines you write depends on the status:
|
|
167
179
|
|
|
168
180
|
| Status | Use it when | Lines |
|
|
169
181
|
|---|---|---|
|
|
@@ -171,11 +183,12 @@ Which lines you write depends on the status:
|
|
|
171
183
|
| `needs-human` | You can't go on without an answer or an approval | `phase`, `status`, `question`, `options`, and `summary` if it helps them answer |
|
|
172
184
|
| `failed` | Something is missing or went wrong, and this skill tells you to stop or doesn't cover it | `phase`, `status`, `reason` |
|
|
173
185
|
|
|
186
|
+
- **If the command refuses the block, fix what it names and run it again.** If it can't record at all, because the command is missing, you are not in an entourage project, or it says the hand-off was not recorded, write the block in your message instead and carry on. Don't make a project or install anything to get it to run.
|
|
187
|
+
- **When you stop for the human, end your message with the block the command printed.** Above it goes only what the human needs and can't read on the card: a section you could not write there, or the summary they approve from.
|
|
174
188
|
- **Wherever this skill says to ask, tell or stop, use the block.** An ask is `needs-human`. Something to tell goes in `flags`. A stop because something is missing or went wrong is `failed`.
|
|
175
189
|
- **`needs-human` is a pause, not an ending.** Wait for the answer, then carry on with this step. The step is over only at `done` or `failed`.
|
|
176
190
|
- **Ask one question per block.** If you have two, ask first the one whose answer could change the other. The human can always answer in their own words, so `options` are suggestions.
|
|
177
|
-
- **
|
|
178
|
-
- **After `done`, this step is over.** Write the block before anything else. If another step sent you here to revise this section, go back to that step and ignore `next`. Otherwise go on to the step in `next` only if you were asked to run more than this one step, and if you weren't, stop there.
|
|
191
|
+
- **After `done`, this step is over.** Record the hand-off before anything else. If another step sent you here to revise this section, go back to that step and ignore `next`. Otherwise go on to the step in `next` only if you were asked to run more than this one step, and if you weren't, stop there.
|
|
179
192
|
- **After `failed`, change nothing more.** Leave the card as it is for the human.
|
|
180
193
|
|
|
181
194
|
## If something goes wrong
|
|
@@ -102,19 +102,28 @@ After writing, read the card back. Check that the original description is unchan
|
|
|
102
102
|
|
|
103
103
|
## 5. Hand off
|
|
104
104
|
|
|
105
|
-
When the Specification is on the card and you have read it back,
|
|
105
|
+
When the Specification is on the card and you have read it back, record the hand-off. Define is not finished until it is recorded:
|
|
106
106
|
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
107
|
+
```
|
|
108
|
+
entourage task handoff <project> <card ID> <<'EOF'
|
|
109
|
+
phase: define
|
|
110
|
+
status: done
|
|
111
|
+
next: plan
|
|
112
|
+
summary: <the type you set, whether you replaced a label that was already there, and how many Done when items there are>
|
|
113
|
+
flags: <anything you weren't sure about, and whether the card looks like more than one thing>
|
|
114
|
+
EOF
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
Put your own words in place of each hint in angle brackets, and leave the `flags` line out when there is nothing to flag.
|
|
110
118
|
|
|
111
119
|
## The handoff block
|
|
112
120
|
|
|
113
121
|
Every step of the lifecycle ends the same way, so whoever is driving it, a person or a script, can tell how the step ended without reading the whole session.
|
|
114
122
|
|
|
115
|
-
|
|
123
|
+
Record a hand-off every time this step ends or pauses: when the step is finished, when you need an answer, and when something has gone wrong. Record it even when you go straight on to another step, because the record is what shows this one ended. Run `entourage task handoff` with the block on stdin, one value per line:
|
|
116
124
|
|
|
117
125
|
```
|
|
126
|
+
entourage task handoff <project> <card ID> <<'EOF'
|
|
118
127
|
phase: <this step>
|
|
119
128
|
status: <done, needs-human or failed>
|
|
120
129
|
next: <the step that follows>
|
|
@@ -123,9 +132,10 @@ flags: <what the human should know but wasn't asked>
|
|
|
123
132
|
question: <one question>
|
|
124
133
|
options: <the answers you expect, your recommendation first, separated by " | ">
|
|
125
134
|
reason: <what went wrong, and what you already tried>
|
|
135
|
+
EOF
|
|
126
136
|
```
|
|
127
137
|
|
|
128
|
-
Which lines you write depends on the status:
|
|
138
|
+
`<project>` is the entourage project this session is in. The words in angle brackets are hints: put your own in their place. The command checks the block, records it and prints it back. Which lines you write depends on the status:
|
|
129
139
|
|
|
130
140
|
| Status | Use it when | Lines |
|
|
131
141
|
|---|---|---|
|
|
@@ -133,11 +143,12 @@ Which lines you write depends on the status:
|
|
|
133
143
|
| `needs-human` | You can't go on without an answer or an approval | `phase`, `status`, `question`, `options`, and `summary` if it helps them answer |
|
|
134
144
|
| `failed` | Something is missing or went wrong, and this skill tells you to stop or doesn't cover it | `phase`, `status`, `reason` |
|
|
135
145
|
|
|
146
|
+
- **If the command refuses the block, fix what it names and run it again.** If it can't record at all, because the command is missing, you are not in an entourage project, or it says the hand-off was not recorded, write the block in your message instead and carry on. Don't make a project or install anything to get it to run.
|
|
147
|
+
- **When you stop for the human, end your message with the block the command printed.** Above it goes only what the human needs and can't read on the card: a section you could not write there, or the summary they approve from.
|
|
136
148
|
- **Wherever this skill says to ask, tell or stop, use the block.** An ask is `needs-human`. Something to tell goes in `flags`. A stop because something is missing or went wrong is `failed`.
|
|
137
149
|
- **`needs-human` is a pause, not an ending.** Wait for the answer, then carry on with this step. The step is over only at `done` or `failed`.
|
|
138
150
|
- **Ask one question per block.** If you have two, ask first the one whose answer could change the other. The human can always answer in their own words, so `options` are suggestions.
|
|
139
|
-
- **
|
|
140
|
-
- **After `done`, this step is over.** Write the block before anything else. If another step sent you here to revise this section, go back to that step and ignore `next`. Otherwise go on to the step in `next` only if you were asked to run more than this one step, and if you weren't, stop there.
|
|
151
|
+
- **After `done`, this step is over.** Record the hand-off before anything else. If another step sent you here to revise this section, go back to that step and ignore `next`. Otherwise go on to the step in `next` only if you were asked to run more than this one step, and if you weren't, stop there.
|
|
141
152
|
- **After `failed`, change nothing more.** Leave the card as it is for the human.
|
|
142
153
|
|
|
143
154
|
## If something goes wrong
|