buildline 0.0.0-stage → 0.3.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/LICENSE +21 -0
- package/README.md +214 -2
- package/bin/buildline.js +131 -0
- package/package.json +44 -4
- package/src/cli.js +537 -0
- package/src/detect.js +228 -0
- package/src/features.js +157 -0
- package/src/files.js +107 -0
- package/src/install.js +280 -0
- package/src/models.js +66 -0
- package/src/render.js +9 -0
- package/src/server.js +143 -0
- package/src/ui/index.html +333 -0
- package/templates/AGENTS.block.md +48 -0
- package/templates/CLAUDE.block.md +20 -0
- package/templates/GEMINI.block.md +3 -0
- package/templates/agents/buildline-design-reviewer.md +21 -0
- package/templates/agents/buildline-mapper.md +23 -0
- package/templates/agents/buildline-reviewer.md +24 -0
- package/templates/agents/buildline-spec-critic.md +19 -0
- package/templates/agents/buildline-verifier.md +30 -0
- package/templates/bin/gates.mjs +65 -0
- package/templates/bin/hook.mjs +90 -0
- package/templates/buildline-readme.md +55 -0
- package/templates/ci/buildline.yml +71 -0
- package/templates/context/architecture.md +21 -0
- package/templates/context/design.md +22 -0
- package/templates/context/product.md +22 -0
- package/templates/cursor.mdc +11 -0
- package/templates/feature/progress.md +6 -0
- package/templates/feature/spec.md +34 -0
- package/templates/principles.md +23 -0
- package/templates/stations/autopilot.md +52 -0
- package/templates/stations/build.md +52 -0
- package/templates/stations/buildline.md +48 -0
- package/templates/stations/design.md +39 -0
- package/templates/stations/new.md +39 -0
- package/templates/stations/onboard.md +57 -0
- package/templates/stations/plan.md +44 -0
- package/templates/stations/review.md +37 -0
- package/templates/stations/ship.md +32 -0
- package/templates/stations/spec.md +46 -0
- package/templates/stations/verify.md +44 -0
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
# Station: plan
|
|
2
|
+
|
|
3
|
+
Goal: turn the spec into an ordered list of small, verifiable tasks in `feature.json`. A good plan lets a fresh agent session, with no memory of today, pick up the next task and finish it.
|
|
4
|
+
|
|
5
|
+
Resolve the feature from `$ARGUMENTS`, or use the most recent feature with status `plan`. Read the whole `spec.md` and the code areas named in the technical design.
|
|
6
|
+
|
|
7
|
+
## Write the tasks
|
|
8
|
+
|
|
9
|
+
Write them into `feature.json → tasks` (replace the placeholder):
|
|
10
|
+
|
|
11
|
+
```json
|
|
12
|
+
{
|
|
13
|
+
"id": "T1",
|
|
14
|
+
"title": "Add `saved_carts` table and model",
|
|
15
|
+
"covers": ["R1", "A2"],
|
|
16
|
+
"verify": "`npm test -- saved-cart.model` passes; migration runs up and down",
|
|
17
|
+
"passes": false,
|
|
18
|
+
"notes": ""
|
|
19
|
+
}
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
Rules:
|
|
23
|
+
|
|
24
|
+
- **Small**: each task fits in one focused session and one commit, usually under ~200 changed lines.
|
|
25
|
+
- **Vertical first**: the first task should produce a thin end-to-end path (even if ugly) that later tasks fill out. Avoid "all the backend, then all the frontend".
|
|
26
|
+
- **Verifiable**: `verify` says exactly what to run or observe. "Works" is not a verification.
|
|
27
|
+
- **Traceable**: `covers` lists the requirement and acceptance ids it moves forward. Every `A*` scenario must be covered by at least one task.
|
|
28
|
+
- **Test-first where it's cheap**: when a task introduces logic, its first step is a failing test for the acceptance scenario.
|
|
29
|
+
- **Ordered**: dependencies come first. Mark tasks that could run in parallel with `"parallel": true`.
|
|
30
|
+
- Include the boring tasks: migrations, feature flags, docs, analytics events, cleanup of temporary code.
|
|
31
|
+
|
|
32
|
+
Then write a one-paragraph `## Plan` summary in `spec.md` (approach, order, risks) so humans don't have to read JSON.
|
|
33
|
+
|
|
34
|
+
## Check
|
|
35
|
+
|
|
36
|
+
- Every acceptance scenario is covered by at least one task.
|
|
37
|
+
- No task changes the acceptance criteria.
|
|
38
|
+
- The final task is "All gates pass and acceptance scenarios verified end to end."
|
|
39
|
+
|
|
40
|
+
## Handoff
|
|
41
|
+
|
|
42
|
+
- Set status to `build`. Append a `history` entry.
|
|
43
|
+
- **Approval:** at autonomy ≤ 2, ask the person to approve the plan and record `approvals.plan` only on an explicit yes. At L3+, continue without waiting.
|
|
44
|
+
- Next: `/buildline-build <id>`, or `/buildline-autopilot <id>` to run build → verify → review unattended.
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
# Station: review
|
|
2
|
+
|
|
3
|
+
Goal: catch what tests don't (wrong behaviour against the spec, security holes, maintainability problems) and prepare the change so a human reviewer can approve it in minutes.
|
|
4
|
+
|
|
5
|
+
Resolve the feature from `$ARGUMENTS`, or use the most recent feature with status `review`.
|
|
6
|
+
|
|
7
|
+
## 1. Get the diff
|
|
8
|
+
|
|
9
|
+
Work out the base (usually the default branch) and collect the full diff for this feature: `git diff <base>...HEAD`. If the feature isn't on its own branch, use the commits tagged with the feature id.
|
|
10
|
+
|
|
11
|
+
## 2. Independent review
|
|
12
|
+
|
|
13
|
+
Ask the `buildline-reviewer` subagent to review the diff against `spec.md` and `.buildline/principles.md`. In Claude Code you can also run `/code-review` for an extra correctness pass.
|
|
14
|
+
|
|
15
|
+
The reviewer reports only findings that matter, each with file:line, severity (`blocker` / `should-fix` / `nit`) and a concrete fix:
|
|
16
|
+
|
|
17
|
+
- **Spec fit:** every requirement implemented; nothing extra that wasn't asked for.
|
|
18
|
+
- **Correctness:** edge cases, error handling, concurrency, off-by-one, null handling.
|
|
19
|
+
- **Security:** injection, authz checks on every new endpoint, secrets, unsafe input handling, dependency risk.
|
|
20
|
+
- **Maintainability:** follows existing conventions, no dead code or debug leftovers, names make sense.
|
|
21
|
+
- **Tests:** the tests actually assert the behaviour (not just "doesn't crash"); no skipped or weakened tests.
|
|
22
|
+
- **UX (UI changes):** matches `## Design`; use the `buildline-design-reviewer` subagent with screenshots from `evidence/`.
|
|
23
|
+
|
|
24
|
+
Reviewers tend to over-report. Discard style opinions that the linter doesn't enforce, and anything speculative without a concrete failure scenario.
|
|
25
|
+
|
|
26
|
+
## 3. Act on findings
|
|
27
|
+
|
|
28
|
+
- `blocker` and `should-fix`: add a task per finding, go back to `build` (increment `metrics.reworks`), and fix it. Fixes go through the normal task loop, gates included.
|
|
29
|
+
- `nit`: fix if trivial, otherwise list in the PR description.
|
|
30
|
+
|
|
31
|
+
## 4. Human review packet
|
|
32
|
+
|
|
33
|
+
Write `## Review` in `spec.md`: a summary of what changed and why, risk areas to look at first (with file paths), what was verified and how (link to `## Verification`), and remaining nits. This becomes the PR description.
|
|
34
|
+
|
|
35
|
+
## 5. Route
|
|
36
|
+
|
|
37
|
+
When there are no open blockers or should-fix findings: status `ship`, history entry, next `/buildline-ship <id>`. A human still approves the merge at every autonomy level.
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
# Station: ship
|
|
2
|
+
|
|
3
|
+
Goal: get the change merged cleanly and leave the factory smarter than it was. The second part is what makes the factory improve over time instead of rotting.
|
|
4
|
+
|
|
5
|
+
Resolve the feature from `$ARGUMENTS`, or use the most recent feature with status `ship`.
|
|
6
|
+
|
|
7
|
+
## 1. Final check
|
|
8
|
+
|
|
9
|
+
- `node .buildline/bin/gates.mjs` is green on the latest commit.
|
|
10
|
+
- All tasks have `"passes": true`; `## Verification` shows every scenario passing; `## Review` has no open blockers.
|
|
11
|
+
|
|
12
|
+
## 2. Pull request
|
|
13
|
+
|
|
14
|
+
- Make sure the work is on a feature branch named like `feat/<id>-<slug>` (or `fix/…`). Ask before pushing.
|
|
15
|
+
- Open a PR (with `gh pr create` if available). Use the `## Review` section as the body, link the spec file, and list the acceptance scenarios with their results.
|
|
16
|
+
- If the project keeps a CHANGELOG, add an entry written for users, not developers.
|
|
17
|
+
- Merging is a human decision. Never merge on your own, whatever the autonomy level.
|
|
18
|
+
|
|
19
|
+
## 3. Fold learnings back (living context)
|
|
20
|
+
|
|
21
|
+
Specs are written for one change; the context files carry what lasts. Update them in the same PR:
|
|
22
|
+
|
|
23
|
+
- `.buildline/context/architecture.md`: new modules, data model changes, decisions made in `### Technical` that future work must respect.
|
|
24
|
+
- `.buildline/context/design.md`: new components, patterns or tokens introduced.
|
|
25
|
+
- `.buildline/context/product.md`: new capabilities and glossary terms.
|
|
26
|
+
- `AGENTS.md` (outside the Buildline block) or `.buildline/principles.md`: any **recurring** mistake an agent made during this feature that a one-line rule would have prevented. Keep these lean; delete rules that no longer earn their place.
|
|
27
|
+
|
|
28
|
+
## 4. Close
|
|
29
|
+
|
|
30
|
+
- Set status to `done`, fill `metrics.shippedAt`, append a `history` entry with the PR link.
|
|
31
|
+
- Append a final `progress.md` entry.
|
|
32
|
+
- Suggest the next feature in the queue (`/buildline`).
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
# Station: spec
|
|
2
|
+
|
|
3
|
+
Goal: a spec short enough to actually read, precise enough that "done" can be checked by someone who didn't write the code. Owner: product (PM), with anyone's input.
|
|
4
|
+
|
|
5
|
+
Resolve the feature from `$ARGUMENTS` (id like `004` or a slug). If none is given, use the most recently updated feature whose status is `spec`, or ask.
|
|
6
|
+
|
|
7
|
+
## 1. Load context
|
|
8
|
+
|
|
9
|
+
Read `spec.md → ## Brief`, `.buildline/context/product.md`, and `.buildline/principles.md`. Skim the code areas involved so the requirements fit what already exists.
|
|
10
|
+
|
|
11
|
+
## 2. Grill, briefly
|
|
12
|
+
|
|
13
|
+
Interview the person **one question at a time** until these are clear. Offer your best guess with each question so they can just say "yes".
|
|
14
|
+
|
|
15
|
+
- Who exactly is the user, and what are they trying to get done?
|
|
16
|
+
- What is the smallest version that delivers the outcome?
|
|
17
|
+
- What happens on the unhappy paths: empty, error, slow, offline, no permission, huge data?
|
|
18
|
+
- What must **not** change (existing behaviour, APIs, data)?
|
|
19
|
+
- How will we know it worked after release (a metric, an event, a support ticket that stops)?
|
|
20
|
+
|
|
21
|
+
Stop as soon as you could write the acceptance scenarios with confidence. Five to eight questions is typical; for small features, two or three.
|
|
22
|
+
|
|
23
|
+
## 3. Write the spec
|
|
24
|
+
|
|
25
|
+
Fill these sections of `spec.md` (keep the headings exactly; tooling reads them):
|
|
26
|
+
|
|
27
|
+
- `## Requirements`: numbered, testable statements (`R1`, `R2`, …). Use "must" for required and "should" for nice-to-have. No implementation details.
|
|
28
|
+
- `## Acceptance`: scenarios in Given / When / Then form, numbered `A1`, `A2`, … Cover the main path, the important unhappy paths, and the "must not change" items. Each scenario must be observable from the outside: UI, API response, CLI output, or a database state.
|
|
29
|
+
- `## Out of scope`: what we are deliberately not doing.
|
|
30
|
+
- `## Open questions`: anything unresolved, with an owner.
|
|
31
|
+
|
|
32
|
+
Aim for one screen of text. If it's getting longer than two, the feature is probably an epic.
|
|
33
|
+
|
|
34
|
+
## 4. Critique
|
|
35
|
+
|
|
36
|
+
Ask the `buildline-spec-critic` subagent to review `spec.md` (it checks for untestable requirements, missing unhappy paths, contradictions and hidden scope). Fix what's valid; mention anything you chose to leave and why.
|
|
37
|
+
|
|
38
|
+
## 5. Epics: split
|
|
39
|
+
|
|
40
|
+
If `type` is `epic`, end by proposing 2–6 child features, each a thin, shippable vertical slice. With the person's agreement, create them (`npx buildline new "<title>" --type feature --parent <epic-id>`) and copy the relevant requirements and acceptance into each child. The epic stays at `spec` as an index.
|
|
41
|
+
|
|
42
|
+
## 6. Approval and handoff
|
|
43
|
+
|
|
44
|
+
- Set status to `design` (or `plan` if the change has no UX or architecture decisions; say why).
|
|
45
|
+
- **Approval:** the spec needs human approval when autonomy ≤ 3. Ask: "Approve this spec?" Only when the person explicitly approves, record `approvals.spec = { "by": "<name or role>", "at": "<ISO date>" }`. Never record an approval on someone's behalf. They can also approve from `npx buildline ui` or with `npx buildline approve <id> spec`.
|
|
46
|
+
- Append a `history` entry and suggest the next command.
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
# Station: verify
|
|
2
|
+
|
|
3
|
+
Goal: an **independent** check that the feature does what the acceptance scenarios say, run by someone who didn't build it. The builder's own "it works" doesn't count here.
|
|
4
|
+
|
|
5
|
+
Resolve the feature from `$ARGUMENTS`, or use the most recent feature with status `verify`.
|
|
6
|
+
|
|
7
|
+
## 1. Delegate to a clean context
|
|
8
|
+
|
|
9
|
+
Hand the job to the `buildline-verifier` subagent. Give it only:
|
|
10
|
+
|
|
11
|
+
- the feature folder path,
|
|
12
|
+
- the dev/start command from `buildline.json → commands.dev`,
|
|
13
|
+
- the instruction to verify every `A*` scenario in `spec.md → ## Acceptance` and report evidence.
|
|
14
|
+
|
|
15
|
+
Don't pass it your build notes or your opinion of the code: the point is a fresh pair of eyes. If subagents aren't available in your tool, start a new session and run the steps below yourself, reading only the spec.
|
|
16
|
+
|
|
17
|
+
## 2. What the verifier does
|
|
18
|
+
|
|
19
|
+
1. Runs `node .buildline/bin/gates.mjs`. Any red gate is a fail.
|
|
20
|
+
2. For each acceptance scenario, sets up the *Given*, performs the *When*, and observes the *Then* the way a user or client would:
|
|
21
|
+
- **UI:** run the app; use browser automation (Playwright or browser tools) to click through; take screenshots of key states.
|
|
22
|
+
- **API:** real HTTP requests against the running service; check status codes and bodies.
|
|
23
|
+
- **CLI / library:** run the command or a small script and check output.
|
|
24
|
+
- Prefer an existing automated end-to-end test that encodes the scenario; run it and confirm it actually asserts the *Then*.
|
|
25
|
+
3. Checks the design states listed in `## Design` (loading, empty, error…) and basic accessibility (keyboard path, labels) for UI changes.
|
|
26
|
+
4. Reports each scenario as `PASS` / `FAIL` / `BLOCKED` with evidence (command + output excerpt, or screenshot path).
|
|
27
|
+
|
|
28
|
+
## 3. Record the result
|
|
29
|
+
|
|
30
|
+
Write `## Verification` in `spec.md`:
|
|
31
|
+
|
|
32
|
+
```
|
|
33
|
+
<ISO date> · verifier
|
|
34
|
+
- A1 PASS: `npx playwright test saved-carts.spec.ts` (3 passed)
|
|
35
|
+
- A2 PASS: POST /api/carts → 201, body has id; screenshot .buildline/features/004-saved-carts/evidence/a2.png
|
|
36
|
+
- A3 FAIL: empty state shows "undefined items" instead of the empty message
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
Save screenshots and logs to `.buildline/features/<id>-<slug>/evidence/`.
|
|
40
|
+
|
|
41
|
+
## 4. Route
|
|
42
|
+
|
|
43
|
+
- All pass → status `review`, history entry, next `/buildline-review <id>`.
|
|
44
|
+
- Any fail → status back to `build`. For each failure, add a new task to `feature.json` (`"title": "Fix A3: empty state copy"`, `"covers": ["A3"]`, `"passes": false`) and increment `metrics.reworks` in `feature.json`. Next: `/buildline-build <id>`.
|