@johngaynor/entourage 0.0.0-stage → 0.1.2
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 +96 -2
- package/cli/entourage +92 -0
- package/cli/lib/commands.sh +86 -0
- package/cli/lib/common.sh +33 -0
- package/cli/lib/links.sh +93 -0
- package/cli/lib/project.sh +172 -0
- package/cli/lib/task.sh +194 -0
- package/herdr/README.md +185 -0
- package/herdr/layouts/default.json +197 -0
- package/herdr/layouts/test.json +207 -0
- package/herdr/mods/cpu/main.js +90 -0
- package/herdr/mods/cpu/mod.json +1 -0
- package/herdr/mods/layout-switch/main.js +48 -0
- package/herdr/mods/layout-switch/mod.json +1 -0
- package/herdr/projects/template/PROJECT.md +19 -0
- package/package.json +24 -4
- package/prompts/task-new.md +14 -0
- package/skills/sdlc-breakdown/SKILL.md +178 -0
- package/skills/sdlc-define/SKILL.md +153 -0
- package/skills/sdlc-plan/SKILL.md +159 -0
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: sdlc-define
|
|
3
|
+
description: Fill out a Linear card from its title and short description by setting its type label and writing its Specification (Why, Done when, Out of scope). Use this as the first step on any card that has no Specification yet, and whenever asked to define, spec, scope or write up a card, even if the request only says "start on ABC-123" and the card is still just a title and a sentence or two.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Define a card
|
|
7
|
+
|
|
8
|
+
Define is the first step of the lifecycle. It takes a card that holds a title and a sentence or two, and leaves it with a type and a Specification that says what is wanted and how anyone can tell it is done.
|
|
9
|
+
|
|
10
|
+
Everything after this step is checked against the Specification. Plan maps its tests to Done when, breakdown cuts along it, build is finished when it is true, and John reads it to approve the card. A vague Specification doesn't slow an agent down. It gets built as whatever the agent guessed.
|
|
11
|
+
|
|
12
|
+
Define says what and why. How it will be built belongs to plan, and whether it is one piece or several belongs to breakdown. Leave both alone here.
|
|
13
|
+
|
|
14
|
+
## Before you write anything
|
|
15
|
+
|
|
16
|
+
1. Get the card. If you weren't given a card ID, ask for one.
|
|
17
|
+
2. Read the card with the Linear tools: title, description, labels and comments.
|
|
18
|
+
3. If the card already has a Specification section, don't write a second one. Tell John and ask whether he wants it revised.
|
|
19
|
+
4. Read the project's `PROJECT.md`, and look at only enough of the product, docs and code to use the right names and to know what exists today. Stop there. Working out the approach is plan's job, and doing it now tends to leak files and design into the Specification.
|
|
20
|
+
|
|
21
|
+
## 1. Set the type
|
|
22
|
+
|
|
23
|
+
Every card gets exactly one type. The types come from Conventional Branch, because the type becomes the branch prefix.
|
|
24
|
+
|
|
25
|
+
| Type | Use it when the change… |
|
|
26
|
+
|---|---|
|
|
27
|
+
| `feat` | adds behaviour a user, admin or agent can use |
|
|
28
|
+
| `fix` | corrects behaviour that was broken |
|
|
29
|
+
| `chore` | is neither: a refactor, docs, tests, tooling, infrastructure or a dependency update |
|
|
30
|
+
|
|
31
|
+
- If two could fit, take the first that does, in this order: `fix`, `feat`, `chore`.
|
|
32
|
+
- Work the type out from the title and description even when the card already carries a type label. Labels get added by habit and are often wrong. Replace the label if yours differs.
|
|
33
|
+
- Set the type as the card's label in the `Type` label group, which allows one per card. The name is lowercase and exact, because setup uses it as the branch prefix: `<type>/<card-id>-<short-name>`, for example `feat/abc-122-export-orders`.
|
|
34
|
+
- If the work is really two types, such as a fix plus an unrelated clean-up, this card keeps its main change. Tell John about the other part and ask whether he wants a second card for it. Don't create that card yourself.
|
|
35
|
+
|
|
36
|
+
The type is a label only. Don't write it into the card's text.
|
|
37
|
+
|
|
38
|
+
## 2. Write the Specification
|
|
39
|
+
|
|
40
|
+
It has three parts.
|
|
41
|
+
|
|
42
|
+
### Why
|
|
43
|
+
|
|
44
|
+
One or two lines on the reason. How it reads depends on the type.
|
|
45
|
+
|
|
46
|
+
| Type | Why reads as |
|
|
47
|
+
|---|---|
|
|
48
|
+
| `feat` | A story: who can now do what, so that why |
|
|
49
|
+
| `fix` | What is broken and who it affects, with how to reproduce it, what was expected and what happens |
|
|
50
|
+
| `chore` | What is awkward, missing or out of date, and why now. For a refactor, also what must stay the same |
|
|
51
|
+
|
|
52
|
+
### Done when
|
|
53
|
+
|
|
54
|
+
A checklist of three to seven items. A small chore can have fewer. Each item is something a reviewer can check without asking you what you meant.
|
|
55
|
+
|
|
56
|
+
- **Describe an outcome, not work.** "A manager can download this month's orders as a CSV" is an outcome. "Add an export endpoint" is work, and it can be finished while the outcome is still false.
|
|
57
|
+
- **Make it pass or fail.** "The page loads quickly" can't fail. "The orders page shows within two seconds on the seed data" can.
|
|
58
|
+
- **Make each item checkable alone.** If two things have to be checked together, they are one item.
|
|
59
|
+
- **Cover the unhappy path that matters.** Think about the empty state, bad input and someone without permission, and include the ones a user would actually hit.
|
|
60
|
+
- **Turn needs like speed or access into items.** Agents build what the list says. A need that isn't on the list won't be met on purpose.
|
|
61
|
+
- **A fix always includes** "A test fails before the fix and passes after." That is what shows the bug was real and is gone.
|
|
62
|
+
- **A change that shouldn't alter behaviour, such as a refactor, always includes** "Existing tests pass without being changed." That is what shows behaviour didn't move.
|
|
63
|
+
- **Don't split by layer.** An API change and the screen that depends on it belong on the same card. A card that stops at the API can't be checked by anyone using the product.
|
|
64
|
+
|
|
65
|
+
If you end up with more than seven items, the card is probably more than one thing. Write the items anyway and say so when you finish. Breakdown deals with it after plan.
|
|
66
|
+
|
|
67
|
+
### Out of scope
|
|
68
|
+
|
|
69
|
+
Include this only when a reader would reasonably expect something that this card will not do. Otherwise leave it out.
|
|
70
|
+
|
|
71
|
+
## 3. When to ask John
|
|
72
|
+
|
|
73
|
+
Ask in the session and wait for the answer when:
|
|
74
|
+
|
|
75
|
+
- The title and description aren't enough to say who this is for or what done looks like.
|
|
76
|
+
- An item depends on a product decision or a fact only he has, such as a limit, a wording, or which users.
|
|
77
|
+
- There are two readings that would give different Done when lists.
|
|
78
|
+
|
|
79
|
+
Ask one question at a time, and offer your best guess so he can answer with a yes. Don't fill a gap with a guess or a placeholder. A made-up criterion reads exactly like a real one, and it will be built.
|
|
80
|
+
|
|
81
|
+
## 4. Write it to the card
|
|
82
|
+
|
|
83
|
+
- Leave the original description exactly as it is, at the top. It is the original ask, and later steps read it.
|
|
84
|
+
- Append the Specification below it as a collapsible section, so the card stays short when John opens it.
|
|
85
|
+
- Add nothing else. No type line, repo, risk or flags, and no approach or file names.
|
|
86
|
+
|
|
87
|
+
Use this form:
|
|
88
|
+
|
|
89
|
+
```
|
|
90
|
+
>>> ## Specification
|
|
91
|
+
**Why:** …
|
|
92
|
+
|
|
93
|
+
**Done when:**
|
|
94
|
+
- [ ] …
|
|
95
|
+
- [ ] …
|
|
96
|
+
|
|
97
|
+
**Out of scope:** …
|
|
98
|
+
>>>
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
After writing, read the card back. Check that the original description is unchanged and that the Specification shows as a collapsed section.
|
|
102
|
+
|
|
103
|
+
## 5. Finish
|
|
104
|
+
|
|
105
|
+
Tell John in two or three lines:
|
|
106
|
+
|
|
107
|
+
- The type you set, and whether you replaced a label that was already there.
|
|
108
|
+
- How many Done when items there are.
|
|
109
|
+
- Anything you weren't sure about, and whether the card looks like more than one thing.
|
|
110
|
+
|
|
111
|
+
Then stop. Plan is the next step, and John may want to read the Specification first.
|
|
112
|
+
|
|
113
|
+
## If something goes wrong
|
|
114
|
+
|
|
115
|
+
| When this happens | Do this |
|
|
116
|
+
|---|---|
|
|
117
|
+
| The card ID doesn't resolve | Ask John for the ID. Don't pick a card because its title looks similar |
|
|
118
|
+
| The Linear tools aren't available | Stop and say so. Show the finished section in the session so the work isn't lost. Don't save it somewhere else and report the step as done |
|
|
119
|
+
| A write to the card fails | Read the card before doing anything else. Retry once, and only if the section isn't there, so it can't be added twice |
|
|
120
|
+
| The read-back shows that text above your section changed | Put it back from what you read at the start of this run, append your section again, and tell John |
|
|
121
|
+
| The collapsed section shows as plain `>>>` text | Leave the content as it is and tell John. Don't keep reformatting it |
|
|
122
|
+
| The `Type` label group, or the label you need, doesn't exist | Don't create it. Finish the Specification, and tell John which label is missing |
|
|
123
|
+
| The card carries more than one type label | Leave only the one you worked out |
|
|
124
|
+
|
|
125
|
+
If something fails that isn't on this list, stop and tell John what happened. Don't work around it.
|
|
126
|
+
|
|
127
|
+
## Example
|
|
128
|
+
|
|
129
|
+
**The card arrives as**
|
|
130
|
+
|
|
131
|
+
> **Export orders as CSV**
|
|
132
|
+
> Managers keep asking for the raw order list so they can work on it in a spreadsheet. Let them download it.
|
|
133
|
+
|
|
134
|
+
**Type:** `feat`, set as the label.
|
|
135
|
+
|
|
136
|
+
**Appended to the card**
|
|
137
|
+
|
|
138
|
+
```
|
|
139
|
+
>>> ## Specification
|
|
140
|
+
**Why:** A manager can download the order list as a CSV, so they can analyse it in their own spreadsheet.
|
|
141
|
+
|
|
142
|
+
**Done when:**
|
|
143
|
+
- [ ] On the orders page, a manager sees a Download CSV button.
|
|
144
|
+
- [ ] The file has one row per order, with the order number, date, customer, status and total.
|
|
145
|
+
- [ ] The file covers the same filters and date range that are showing on screen.
|
|
146
|
+
- [ ] With no orders in range, the file has the header row and no others.
|
|
147
|
+
- [ ] Someone who is not a manager does not see the button and cannot fetch the file.
|
|
148
|
+
|
|
149
|
+
**Out of scope:** Scheduled or emailed exports.
|
|
150
|
+
>>>
|
|
151
|
+
```
|
|
152
|
+
|
|
153
|
+
Notice what isn't there: no endpoint, no file names, no library. Those are plan's.
|
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: sdlc-plan
|
|
3
|
+
description: Write the technical plan for a Linear card that already has a Specification by reading the card and the code, then appending a Plan (Approach, Changes, Tests) to the card. Use this after define and before breakdown, and whenever asked to plan a card, scope it technically or work out how to build it, even if the request only says "plan ABC-123" or "how would we build this one".
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Plan a card
|
|
7
|
+
|
|
8
|
+
Plan is the second step of the lifecycle. Define said what is wanted. Plan reads the code and says how it will be built: the approach, the files that change, and how each Done when item will be shown to be true.
|
|
9
|
+
|
|
10
|
+
Two readers depend on it. John reads it to approve the card, so it has to be short and honest. The build step starts later in a fresh session with only the card, so the plan has to be exact enough to build from cold. A plan that says "update the orders module" helps neither of them.
|
|
11
|
+
|
|
12
|
+
Plan only reads. It writes no code and makes no branch or worktree. Whether the card is one piece or several is breakdown's job, which comes next.
|
|
13
|
+
|
|
14
|
+
## Before you write anything
|
|
15
|
+
|
|
16
|
+
1. Read the card with the Linear tools: the original description and the Specification.
|
|
17
|
+
2. If there is no Specification, define hasn't run. Say so and stop.
|
|
18
|
+
3. If the card already has a Plan section, don't write a second one. Tell John and ask whether he wants it revised.
|
|
19
|
+
|
|
20
|
+
## 1. Read the code
|
|
21
|
+
|
|
22
|
+
Start from the project's `PROJECT.md`. Its sections on what each repo owns tell you where this work belongs.
|
|
23
|
+
|
|
24
|
+
Then read until you could explain the change to someone who knows the codebase:
|
|
25
|
+
|
|
26
|
+
- **The guidance above the code you expect to touch.** Read the `CLAUDE.md`, `AGENTS.md` or `.ai/` files on the path down to those files. They hold conventions you can't infer from one file.
|
|
27
|
+
- **Where similar work already lives.** Find the closest existing feature and read it end to end. The best plan is usually "built like that one".
|
|
28
|
+
- **What you can reuse.** Look for shared helpers, components and test utilities before planning a new one.
|
|
29
|
+
- **How it is tested.** Find the tests for the closest feature, and note the level they work at and how they are set up.
|
|
30
|
+
|
|
31
|
+
The repo clones linked into the project are shared reference copies. Don't switch branches or edit anything in them. Fetch first, and if a clone isn't on an up-to-date base branch, read from the remote base branch with git instead of from the working files.
|
|
32
|
+
|
|
33
|
+
## 2. Write the Plan
|
|
34
|
+
|
|
35
|
+
It has three parts.
|
|
36
|
+
|
|
37
|
+
### Approach
|
|
38
|
+
|
|
39
|
+
A few sentences on how it will be built. Name the existing pattern it follows and where that pattern lives.
|
|
40
|
+
|
|
41
|
+
- If you chose between two real options, add one line on the one you rejected and why. It saves John asking.
|
|
42
|
+
- If the work needs a new dependency, say so here. That is a decision John should see.
|
|
43
|
+
- If the work needs more than one repo, say which and why.
|
|
44
|
+
|
|
45
|
+
### Changes
|
|
46
|
+
|
|
47
|
+
The files you expect to touch, grouped by app or package. Give each one a few words on what changes.
|
|
48
|
+
|
|
49
|
+
- Write each path from the repo root, starting with the repo's name, so the repo never needs stating separately.
|
|
50
|
+
- Mark new files as new.
|
|
51
|
+
- Include the unglamorous ones: migrations, config, seed data, docs.
|
|
52
|
+
- Name the helpers you will reuse.
|
|
53
|
+
- Check that every existing path you write is real. A path you guessed reads exactly like one you checked, and the build step will trust it.
|
|
54
|
+
|
|
55
|
+
This is a list of where and what, not code. Don't write the implementation.
|
|
56
|
+
|
|
57
|
+
### Tests
|
|
58
|
+
|
|
59
|
+
One line for each Done when item, in the same order, saying how it will be shown to be true.
|
|
60
|
+
|
|
61
|
+
- Prefer a test, and say what level it works at and which file it goes in.
|
|
62
|
+
- Where a test can't prove the item, say what will: a screenshot, or the output of a command.
|
|
63
|
+
- Every Done when item gets a line. An item with no line is an item nobody will check.
|
|
64
|
+
- For a fix, the first test reproduces the bug and fails before the change.
|
|
65
|
+
- For a change that shouldn't alter behaviour, name the existing tests that cover it. No new ones are needed.
|
|
66
|
+
|
|
67
|
+
## 3. Stay inside the Specification
|
|
68
|
+
|
|
69
|
+
Plan never edits the Specification or the original description. They are what John asked for, and the plan answers to them.
|
|
70
|
+
|
|
71
|
+
- **A Done when item can't be met as written.** The code may show that an item is impossible, contradicts how the product works, or costs far more than the card suggests. Stop and ask John. He may change the Specification. You may not.
|
|
72
|
+
- **A technical question.** Settle it from the code where you can. Ask John only what the code can't answer, such as an upcoming change that affects the approach, or a choice between two workable options with different costs. Ask one question at a time and give your recommendation.
|
|
73
|
+
- **Something outside the Specification.** While reading you may find a nearby bug, a missing test or a refactor that would help. Leave it out of the plan and tell John when you finish. Folding it in makes the card bigger than what he approved.
|
|
74
|
+
|
|
75
|
+
## 4. Write it to the card
|
|
76
|
+
|
|
77
|
+
- Append the Plan below the Specification as a collapsible section.
|
|
78
|
+
- Change nothing above it.
|
|
79
|
+
- Add nothing else: no repo line, no risk, no open questions.
|
|
80
|
+
|
|
81
|
+
Use this form:
|
|
82
|
+
|
|
83
|
+
```
|
|
84
|
+
>>> ## Plan
|
|
85
|
+
**Approach:** …
|
|
86
|
+
|
|
87
|
+
**Changes:**
|
|
88
|
+
- `repo/path/to/file`: what changes
|
|
89
|
+
- `repo/path/to/new-file` (new): what it holds
|
|
90
|
+
|
|
91
|
+
**Tests:**
|
|
92
|
+
1. <Done when item, in a few words>: how it is shown
|
|
93
|
+
2. …
|
|
94
|
+
>>>
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
After writing, read the card back. Check that the description and Specification are unchanged and that the Plan shows as a collapsed section.
|
|
98
|
+
|
|
99
|
+
## 5. Finish
|
|
100
|
+
|
|
101
|
+
Tell John in a few lines:
|
|
102
|
+
|
|
103
|
+
- The approach in one sentence.
|
|
104
|
+
- Roughly how much it touches: how many files, in which apps or repos.
|
|
105
|
+
- Whether it looks like one pull request's worth or more. Breakdown decides, but your read is useful.
|
|
106
|
+
- Anything you found that sits outside the Specification.
|
|
107
|
+
|
|
108
|
+
Then stop. Breakdown is the next step.
|
|
109
|
+
|
|
110
|
+
## If something goes wrong
|
|
111
|
+
|
|
112
|
+
| When this happens | Do this |
|
|
113
|
+
|---|---|
|
|
114
|
+
| The card ID doesn't resolve | Ask John for the ID. Don't pick a card because its title looks similar |
|
|
115
|
+
| The Linear tools aren't available | Stop and say so. Show the finished section in the session so the work isn't lost. Don't save it somewhere else and report the step as done |
|
|
116
|
+
| A write to the card fails | Read the card before doing anything else. Retry once, and only if the section isn't there, so it can't be added twice |
|
|
117
|
+
| The read-back shows that text above your section changed | Put it back from what you read at the start of this run, append your section again, and tell John |
|
|
118
|
+
| The collapsed section shows as plain `>>>` text | Leave the content as it is and tell John. Don't keep reformatting it |
|
|
119
|
+
| A repo named in `PROJECT.md` is missing, or the fetch fails | Tell John, and ask whether to plan from what is on disk |
|
|
120
|
+
| You can't tell which repo the work belongs in | Ask John. Don't guess paths |
|
|
121
|
+
| A path you were about to write doesn't exist | Find the real one, or mark the file as new. Never leave a path you haven't checked |
|
|
122
|
+
|
|
123
|
+
If something fails that isn't on this list, stop and tell John what happened. Don't work around it.
|
|
124
|
+
|
|
125
|
+
## Example
|
|
126
|
+
|
|
127
|
+
**The card's Specification**
|
|
128
|
+
|
|
129
|
+
```
|
|
130
|
+
**Why:** A manager can download the order list as a CSV, so they can analyse it in their own spreadsheet.
|
|
131
|
+
|
|
132
|
+
**Done when:**
|
|
133
|
+
- [ ] On the orders page, a manager sees a Download CSV button.
|
|
134
|
+
- [ ] The file has one row per order, with the order number, date, customer, status and total.
|
|
135
|
+
- [ ] The file covers the same filters and date range that are showing on screen.
|
|
136
|
+
- [ ] With no orders in range, the file has the header row and no others.
|
|
137
|
+
- [ ] Someone who is not a manager does not see the button and cannot fetch the file.
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
**Appended to the card**
|
|
141
|
+
|
|
142
|
+
```
|
|
143
|
+
>>> ## Plan
|
|
144
|
+
**Approach:** Add a CSV response to the existing orders list endpoint, and a button on the orders page that calls it with the filters currently applied. This follows the invoice export, which already streams a CSV the same way. A separate export endpoint was rejected because it would duplicate the list endpoint's filtering.
|
|
145
|
+
|
|
146
|
+
**Changes:**
|
|
147
|
+
- `shop/api/app/orders/routes.py`: accept `format=csv` on the list route, managers only
|
|
148
|
+
- `shop/api/app/orders/export.py` (new): turn the filtered query into CSV rows, reusing `csv_stream` from `shop/api/app/common/export.py`
|
|
149
|
+
- `shop/web/src/pages/orders/OrdersPage.tsx`: Download CSV button, shown to managers, passing the current filters
|
|
150
|
+
- `shop/web/src/api/orders.ts`: `downloadOrdersCsv(filters)`
|
|
151
|
+
|
|
152
|
+
**Tests:**
|
|
153
|
+
1. Button shows for a manager: component test in `OrdersPage.test.tsx`
|
|
154
|
+
2. Columns, and one row per order: API test in `test_orders_export.py`
|
|
155
|
+
3. Same filters and range as on screen: API test with a filtered request, and a component test that the filters are passed
|
|
156
|
+
4. Empty range gives the header only: API test in `test_orders_export.py`
|
|
157
|
+
5. A non-manager can't see or fetch it: component test for the button, API test for a 403
|
|
158
|
+
>>>
|
|
159
|
+
```
|