@next-friday/create-app 9.4.0 → 9.5.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/package.json +1 -1
- package/templates/base/.agents/release-approval-form +1 -0
- package/templates/base/SETUP.md +1 -1
- package/templates/base/plugins/sdlc/claude-code/skills/sdlc-mode/playbooks/build.md +8 -7
- package/templates/base/plugins/sdlc/claude-code/skills/sdlc-mode/playbooks/fix.md +9 -8
- package/templates/base/plugins/sdlc/cursor/skills/sdlc-mode/playbooks/build.md +8 -7
- package/templates/base/plugins/sdlc/cursor/skills/sdlc-mode/playbooks/fix.md +9 -8
- package/templates/base/scripts/check-plan.ts +15 -18
- package/templates/nestjs/.github/workflows/ci.yml +5 -0
- package/templates/nestjs/AGENTS.md +1 -1
- package/templates/nextjs/.github/workflows/ci.yml +5 -0
- package/templates/nextjs/AGENTS.md +1 -1
- package/templates/nodejs/.github/workflows/ci.yml +5 -0
- package/templates/nodejs/AGENTS.md +1 -1
- package/templates/payload/.github/workflows/ci.yml +5 -0
- package/templates/payload/AGENTS.md +1 -1
- package/templates/turborepo/.github/workflows/ci.yml +3 -0
- package/templates/turborepo/AGENTS.md +1 -1
package/package.json
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
^[A-Z]+-[0-9]+$
|
package/templates/base/SETUP.md
CHANGED
|
@@ -92,7 +92,7 @@ Replace `security@example.com` in `SECURITY.md` with the contact the security po
|
|
|
92
92
|
- **Sources of truth (engineering lead):** for each artifact, name one system as the source of truth: this repository, an existing tool such as Jira, or, as the minimum, a link both ways (the record id in the file and the commit SHA in the record).
|
|
93
93
|
- **Higher risk (engineering lead):** decide which changes count as higher risk. A tech lead or architect approves their specs and plans.
|
|
94
94
|
- **Policies (each policy owner, with an engineer):** the plugin ships a default for each area, `plugins/sdlc/claude-code/skills/<area>-policy/SKILL.md` (security: OWASP ASVS 5.0.0 Level 1; UX: WCAG 2.2 Level AA; compliance: the OECD privacy principles; brand: one declared source for every brand value). Review it. To replace a default, add the organization's own rules in `.agents/skills/<area>-policy/SKILL.md` in the project: that file wins over the plugin's default, and the `CODEOWNERS` line of step 2 for that area makes the policy owner its code owner. Do not edit the plugin's copy. Then run `pnpm rules:sync`, which renders the project's own policy skill for Claude Code and Cursor. Test that the skill triggers: ask for the relevant task in different ways and confirm the skill loads each time.
|
|
95
|
-
- **Production gate (engineering leadership, with change management and compliance):** name the release managers and add them as required reviewers on the `prod` environment, as the README's deploy section describes. `.agents/hooks/agent-production-gate.sh` blocks an agent's shell commands that dispatch a `prod` deploy, run a Railway command with `prod` as its environment, or push a release tag. It does not read MCP tools. A release manager whose own agent session must do one of these starts the agent with `RELEASE_APPROVAL` set to the approval record, for example `RELEASE_APPROVAL=CHG-123 claude`.
|
|
95
|
+
- **Production gate (engineering leadership, with change management and compliance):** name the release managers and add them as required reviewers on the `prod` environment, as the README's deploy section describes. `.agents/hooks/agent-production-gate.sh` blocks an agent's shell commands that dispatch a `prod` deploy, run a Railway command with `prod` as its environment, or push a release tag. It does not read MCP tools. A release manager whose own agent session must do one of these starts the agent with `RELEASE_APPROVAL` set to the approval record, for example `RELEASE_APPROVAL=CHG-123 claude`. The value lifts the gate only when it matches the extended regular expression on the first line of `.agents/release-approval-form`, shipped as `^[A-Z]+-[0-9]+$`; set that line to the form of your organization's approval records. Each gate hook appends its decisions to `.agents/logs/gate-decisions.jsonl`, which git ignores: the time, the hook, the decision, and the reason for a block, and, when the production gate is lifted, the approval value and the Git user name.
|
|
96
96
|
- **Review (tech lead):** `.agents/review.md` names this stack's generated files to skip; add a path when the project gains a generated file, then run `pnpm rules:sync`, which renders it to `REVIEW.md` for Claude Code Review. Once a month, rate the review findings and tune `.agents/review.md`.
|
|
97
97
|
- **People without Git experience:** connect GitHub to Claude (claude.ai or Cowork), so Claude commits `intent.md` for them.
|
|
98
98
|
|
|
@@ -9,7 +9,7 @@ This playbook turns a merged spec into a plan the engineer accepts, and then int
|
|
|
9
9
|
|
|
10
10
|
When the request is a bug fix with no spec, none of these cases applies: follow `playbooks/fix.md` instead.
|
|
11
11
|
|
|
12
|
-
2. When `intent/<change>/plan.md` is on the default branch, the engineer accepted it by merging its pull request: go to step
|
|
12
|
+
2. When `intent/<change>/plan.md` is on the default branch, the engineer accepted it by merging its pull request: go to step 7. When it exists only on a branch that is not merged, check out that branch, show that plan, and go to step 5.
|
|
13
13
|
3. Read `intent.md`, `spec.md`, the four policies, found as `playbooks/design.md` step 2 says, and the code the change touches. Start from the accepted spec, in the agent tool's plan mode when it has one, and give the plan the change's `intent.md` and `spec.md`. Then interview the engineer until they have said four things: the files the change touches, the order of the work, the tests that prove it, and each option they rule out.
|
|
14
14
|
- **When all four are already said, in the request or in the files, go to step 4 in the same turn.**
|
|
15
15
|
- **When one is missing, ask and stop.** Write no plan in that turn. Ask in rounds, as step 3 of `playbooks/plan.md` does: numbered questions, each with a recommended answer or "No recommendation". Wait for the answers, and build the next round on them.
|
|
@@ -21,13 +21,14 @@ This playbook turns a merged spec into a plan the engineer accepts, and then int
|
|
|
21
21
|
|
|
22
22
|
Show the whole plan and name the file only as `intent/<change>/plan.md`. In plan mode you cannot write the file. Show the plan as the plan.
|
|
23
23
|
|
|
24
|
-
5.
|
|
25
|
-
6.
|
|
26
|
-
7.
|
|
27
|
-
8.
|
|
28
|
-
9.
|
|
24
|
+
5. Commit `intent/<change>/plan.md` on a new branch, unless step 2 checked one out, with the `Accepted by:` line as the template has it. In that commit, set the spec's status line to `Status: accepted.`, because its pull request is merged; when an area of concern of that spec has no `Decision:` line, add it there with the decision you propose, as `playbooks/design.md` step 3 says. Push the branch and open a pull request that changes no file outside `intent/`, as the opening paragraph of `playbooks/open-pr.md` says for branches and pull requests. When the branch already has a pull request, update that one. In plan mode, the engineer's approval lets you write the file and do this step; it is not the acceptance.
|
|
25
|
+
6. **Gate: the engineer accepts the plan.** The engineer merges that pull request to accept the plan, or closes it to reject it. You never merge it, and you change no file outside `intent/` before it is merged. Revise the plan as the engineer asks; each revision is a commit on that branch. When the spec classes the change as higher risk, say that a tech lead or an architect approves that pull request before it is merged. Report the pull request's URL, or the pushed branch's name when you could not open one, keep it green as `playbooks/review.md` says, and wait.
|
|
26
|
+
7. When the plan's pull request is merged, create a new branch as `playbooks/open-pr.md` says. In its first commit, set the plan's `Accepted by:` line, under its title, to the account that merged that pull request, read from the host. When that pull request has an approving review from a second person, add `Also accepted by: @<handle>.` on the next line. When you cannot read the host, confirm with `git fetch` that the plan is on the default branch, and write the handle the engineer gives; ask for it when they gave none. Never write a handle the host or the engineer did not give.
|
|
27
|
+
8. Implement the plan in its order. After each step, run the check that proves it and fix what fails. For a bug fix, follow `playbooks/fix.md` steps 8 and 9: commit the failing test on a `fix/` branch, and the gate then blocks test edits. When the work departs from the plan, change `plan.md` in the same commit. When the change meets the last requirement of `spec.md`, set `Status: done.` in `intent.md` and `spec.md`.
|
|
28
|
+
9. Run every check the project's agent instructions name and keep the output. Every check must pass: fix the code, and never skip, delete, or weaken a test. Then run the `verifier` subagent and fix what it reports. Start it on the model that `.agents/sdlc-models.md` names after `verify:`, at the effort on that line when the session can set one; when you cannot start a subagent, do what `../../../agents/verifier.md`, relative to this playbook, says yourself. For UI work, when the session has a browser tool, also close the loop with a visual check: start the app, give the browser tool the page and the mock the spec or the request names, screenshot, compare, and adjust, and repeat until it matches; two or three rounds is normal. When a check cannot run in this session, say which one and why, and never report it as passed.
|
|
29
|
+
10. Go on in the same turn, without asking: follow `playbooks/open-pr.md`, and then `playbooks/review.md`. Pushing the branch and opening the pull request are part of this task.
|
|
29
30
|
|
|
30
|
-
**Next:** `playbooks/open-pr.md`; an agent; in the same turn, as soon as step
|
|
31
|
+
**Next:** `playbooks/open-pr.md`; an agent; in the same turn, as soon as step 9 passes.
|
|
31
32
|
|
|
32
33
|
## Template
|
|
33
34
|
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
This playbook takes a defect in behaviour that already exists to a pull request. It has no intent and no spec: its plan is the only file it adds under `intent/`.
|
|
4
4
|
|
|
5
|
-
1. Decide that the request qualifies. It qualifies only when the request is a defect in behaviour that already exists, and the fix adds no new behaviour and no new dependency and changes no schema and no public interface. When a condition fails, say which one in two lines and follow `playbooks/plan.md` instead.
|
|
5
|
+
1. Decide that the request qualifies. It qualifies only when the request is a defect in behaviour that already exists, and the fix adds no new behaviour and no new dependency and changes no schema and no public interface. When a condition fails, say which one in two lines and follow `playbooks/plan.md` instead. When `intent/<short-description>/plan.md` for this defect is already on the default branch, the engineer accepted it by merging its pull request: go to step 7.
|
|
6
6
|
2. Reproduce the defect yourself by running the code, and keep the output. Ask the person only when you can name the specific reason you cannot reach it, such as a credential or a service this session cannot use.
|
|
7
7
|
3. Find the cause from what running the code shows. List the candidate causes, rule each out with a command or an observation, and never guess. Name the one cause the evidence leaves. When it leaves none, or more than one, say so and ask for what is missing.
|
|
8
8
|
4. Write the plan from the template in `playbooks/build.md`. The title is `# Plan: <title> (fix)`. Use exactly the template's four headings, and keep the plan short. Name the file `intent/<short-description>/plan.md`; the folder holds only this file.
|
|
@@ -13,11 +13,12 @@ This playbook takes a defect in behaviour that already exists to a pull request.
|
|
|
13
13
|
|
|
14
14
|
Show the whole plan and name the file only as `intent/<short-description>/plan.md`. In plan mode you cannot write the file. Show the plan as the plan.
|
|
15
15
|
|
|
16
|
-
5.
|
|
17
|
-
6.
|
|
18
|
-
7.
|
|
19
|
-
8.
|
|
20
|
-
9.
|
|
21
|
-
10.
|
|
16
|
+
5. Commit `intent/<short-description>/plan.md` on a new branch, with the `Accepted by:` line as the template has it, push it, and open a pull request that changes no file outside `intent/`, as the opening paragraph of `playbooks/open-pr.md` says for branches and pull requests. In plan mode, the engineer's approval lets you write the file and do this step; it is not the acceptance.
|
|
17
|
+
6. **Gate: the engineer accepts the plan.** The engineer merges that pull request to accept the plan, or closes it to reject it. You never merge it, and you change no file outside `intent/` before it is merged. Revise the plan as the engineer asks; each revision is a commit on that branch. Report the pull request's URL, or the pushed branch's name when you could not open one, keep it green as `playbooks/review.md` says, and wait.
|
|
18
|
+
7. When the plan's pull request is merged, create the branch `fix/<short-description>` as `playbooks/open-pr.md` says. In its first commit, set the plan's `Accepted by:` line, under its title, to the account that merged that pull request, read from the host. When you cannot read the host, confirm with `git fetch` that the plan is on the default branch, and write the handle the engineer gives; ask for it when they gave none. Never write a handle the host or the engineer did not give.
|
|
19
|
+
8. Reproduce the defect as a test. Run it and check that it fails for the reason the cause gives. Commit the failing test before any fix.
|
|
20
|
+
9. Make the test pass without editing it.
|
|
21
|
+
10. Run every check the project's agent instructions name. Keep the output. When one fails, fix the code, and never skip, delete, or weaken a test. When a check cannot run in this session, say which one and why, and never report it as passed.
|
|
22
|
+
11. Go on in the same turn, without asking. Follow `playbooks/open-pr.md`, and then `playbooks/review.md`.
|
|
22
23
|
|
|
23
|
-
**Next:** `playbooks/open-pr.md`; an agent; in the same turn, as soon as step
|
|
24
|
+
**Next:** `playbooks/open-pr.md`; an agent; in the same turn, as soon as step 10 passes.
|
|
@@ -9,7 +9,7 @@ This playbook turns a merged spec into a plan the engineer accepts, and then int
|
|
|
9
9
|
|
|
10
10
|
When the request is a bug fix with no spec, none of these cases applies: follow `playbooks/fix.md` instead.
|
|
11
11
|
|
|
12
|
-
2. When `intent/<change>/plan.md` is on the default branch, the engineer accepted it by merging its pull request: go to step
|
|
12
|
+
2. When `intent/<change>/plan.md` is on the default branch, the engineer accepted it by merging its pull request: go to step 7. When it exists only on a branch that is not merged, check out that branch, show that plan, and go to step 5.
|
|
13
13
|
3. Read `intent.md`, `spec.md`, the four policies, found as `playbooks/design.md` step 2 says, and the code the change touches. Start from the accepted spec, in the agent tool's plan mode when it has one, and give the plan the change's `intent.md` and `spec.md`. Then interview the engineer until they have said four things: the files the change touches, the order of the work, the tests that prove it, and each option they rule out.
|
|
14
14
|
- **When all four are already said, in the request or in the files, go to step 4 in the same turn.**
|
|
15
15
|
- **When one is missing, ask and stop.** Write no plan in that turn. Ask in rounds, as step 3 of `playbooks/plan.md` does: numbered questions, each with a recommended answer or "No recommendation". Wait for the answers, and build the next round on them.
|
|
@@ -21,13 +21,14 @@ This playbook turns a merged spec into a plan the engineer accepts, and then int
|
|
|
21
21
|
|
|
22
22
|
Show the whole plan and name the file only as `intent/<change>/plan.md`. In plan mode you cannot write the file. Show the plan as the plan.
|
|
23
23
|
|
|
24
|
-
5.
|
|
25
|
-
6.
|
|
26
|
-
7.
|
|
27
|
-
8.
|
|
28
|
-
9.
|
|
24
|
+
5. Commit `intent/<change>/plan.md` on a new branch, unless step 2 checked one out, with the `Accepted by:` line as the template has it. In that commit, set the spec's status line to `Status: accepted.`, because its pull request is merged; when an area of concern of that spec has no `Decision:` line, add it there with the decision you propose, as `playbooks/design.md` step 3 says. Push the branch and open a pull request that changes no file outside `intent/`, as the opening paragraph of `playbooks/open-pr.md` says for branches and pull requests. When the branch already has a pull request, update that one. In plan mode, the engineer's approval lets you write the file and do this step; it is not the acceptance.
|
|
25
|
+
6. **Gate: the engineer accepts the plan.** The engineer merges that pull request to accept the plan, or closes it to reject it. You never merge it, and you change no file outside `intent/` before it is merged. Revise the plan as the engineer asks; each revision is a commit on that branch. When the spec classes the change as higher risk, say that a tech lead or an architect approves that pull request before it is merged. Report the pull request's URL, or the pushed branch's name when you could not open one, keep it green as `playbooks/review.md` says, and wait.
|
|
26
|
+
7. When the plan's pull request is merged, create a new branch as `playbooks/open-pr.md` says. In its first commit, set the plan's `Accepted by:` line, under its title, to the account that merged that pull request, read from the host. When that pull request has an approving review from a second person, add `Also accepted by: @<handle>.` on the next line. When you cannot read the host, confirm with `git fetch` that the plan is on the default branch, and write the handle the engineer gives; ask for it when they gave none. Never write a handle the host or the engineer did not give.
|
|
27
|
+
8. Implement the plan in its order. After each step, run the check that proves it and fix what fails. For a bug fix, follow `playbooks/fix.md` steps 8 and 9: commit the failing test on a `fix/` branch, and the gate then blocks test edits. When the work departs from the plan, change `plan.md` in the same commit. When the change meets the last requirement of `spec.md`, set `Status: done.` in `intent.md` and `spec.md`.
|
|
28
|
+
9. Run every check the project's agent instructions name and keep the output. Every check must pass: fix the code, and never skip, delete, or weaken a test. Then run the `verifier` subagent and fix what it reports. Start it on the model that `.agents/sdlc-models.md` names after `verify:`, at the effort on that line when the session can set one; when you cannot start a subagent, do what `../../../agents/verifier.md`, relative to this playbook, says yourself. For UI work, when the session has a browser tool, also close the loop with a visual check: start the app, give the browser tool the page and the mock the spec or the request names, screenshot, compare, and adjust, and repeat until it matches; two or three rounds is normal. When a check cannot run in this session, say which one and why, and never report it as passed.
|
|
29
|
+
10. Go on in the same turn, without asking: follow `playbooks/open-pr.md`, and then `playbooks/review.md`. Pushing the branch and opening the pull request are part of this task.
|
|
29
30
|
|
|
30
|
-
**Next:** `playbooks/open-pr.md`; an agent; in the same turn, as soon as step
|
|
31
|
+
**Next:** `playbooks/open-pr.md`; an agent; in the same turn, as soon as step 9 passes.
|
|
31
32
|
|
|
32
33
|
## Template
|
|
33
34
|
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
This playbook takes a defect in behaviour that already exists to a pull request. It has no intent and no spec: its plan is the only file it adds under `intent/`.
|
|
4
4
|
|
|
5
|
-
1. Decide that the request qualifies. It qualifies only when the request is a defect in behaviour that already exists, and the fix adds no new behaviour and no new dependency and changes no schema and no public interface. When a condition fails, say which one in two lines and follow `playbooks/plan.md` instead.
|
|
5
|
+
1. Decide that the request qualifies. It qualifies only when the request is a defect in behaviour that already exists, and the fix adds no new behaviour and no new dependency and changes no schema and no public interface. When a condition fails, say which one in two lines and follow `playbooks/plan.md` instead. When `intent/<short-description>/plan.md` for this defect is already on the default branch, the engineer accepted it by merging its pull request: go to step 7.
|
|
6
6
|
2. Reproduce the defect yourself by running the code, and keep the output. Ask the person only when you can name the specific reason you cannot reach it, such as a credential or a service this session cannot use.
|
|
7
7
|
3. Find the cause from what running the code shows. List the candidate causes, rule each out with a command or an observation, and never guess. Name the one cause the evidence leaves. When it leaves none, or more than one, say so and ask for what is missing.
|
|
8
8
|
4. Write the plan from the template in `playbooks/build.md`. The title is `# Plan: <title> (fix)`. Use exactly the template's four headings, and keep the plan short. Name the file `intent/<short-description>/plan.md`; the folder holds only this file.
|
|
@@ -13,11 +13,12 @@ This playbook takes a defect in behaviour that already exists to a pull request.
|
|
|
13
13
|
|
|
14
14
|
Show the whole plan and name the file only as `intent/<short-description>/plan.md`. In plan mode you cannot write the file. Show the plan as the plan.
|
|
15
15
|
|
|
16
|
-
5.
|
|
17
|
-
6.
|
|
18
|
-
7.
|
|
19
|
-
8.
|
|
20
|
-
9.
|
|
21
|
-
10.
|
|
16
|
+
5. Commit `intent/<short-description>/plan.md` on a new branch, with the `Accepted by:` line as the template has it, push it, and open a pull request that changes no file outside `intent/`, as the opening paragraph of `playbooks/open-pr.md` says for branches and pull requests. In plan mode, the engineer's approval lets you write the file and do this step; it is not the acceptance.
|
|
17
|
+
6. **Gate: the engineer accepts the plan.** The engineer merges that pull request to accept the plan, or closes it to reject it. You never merge it, and you change no file outside `intent/` before it is merged. Revise the plan as the engineer asks; each revision is a commit on that branch. Report the pull request's URL, or the pushed branch's name when you could not open one, keep it green as `playbooks/review.md` says, and wait.
|
|
18
|
+
7. When the plan's pull request is merged, create the branch `fix/<short-description>` as `playbooks/open-pr.md` says. In its first commit, set the plan's `Accepted by:` line, under its title, to the account that merged that pull request, read from the host. When you cannot read the host, confirm with `git fetch` that the plan is on the default branch, and write the handle the engineer gives; ask for it when they gave none. Never write a handle the host or the engineer did not give.
|
|
19
|
+
8. Reproduce the defect as a test. Run it and check that it fails for the reason the cause gives. Commit the failing test before any fix.
|
|
20
|
+
9. Make the test pass without editing it.
|
|
21
|
+
10. Run every check the project's agent instructions name. Keep the output. When one fails, fix the code, and never skip, delete, or weaken a test. When a check cannot run in this session, say which one and why, and never report it as passed.
|
|
22
|
+
11. Go on in the same turn, without asking. Follow `playbooks/open-pr.md`, and then `playbooks/review.md`.
|
|
22
23
|
|
|
23
|
-
**Next:** `playbooks/open-pr.md`; an agent; in the same turn, as soon as step
|
|
24
|
+
**Next:** `playbooks/open-pr.md`; an agent; in the same turn, as soon as step 10 passes.
|
|
@@ -94,8 +94,8 @@ const alsoAcceptedByPrefix = "Also accepted by: ";
|
|
|
94
94
|
const hostTokenVariable = "GH_TOKEN";
|
|
95
95
|
const hostRepositoryPath = "repos/{owner}/{repo}";
|
|
96
96
|
const authorPrefix = "Author: ";
|
|
97
|
-
const authorPattern = /^Author: @[\dA-Za-z][\
|
|
98
|
-
const alsoAcceptedByPattern = /^Also accepted by: @([\dA-Za-z][\
|
|
97
|
+
const authorPattern = /^Author: @[\dA-Za-z][\w-]*[ .]/;
|
|
98
|
+
const alsoAcceptedByPattern = /^Also accepted by: @([\dA-Za-z][\w-]*)\.$/;
|
|
99
99
|
|
|
100
100
|
type BranchChanges = {
|
|
101
101
|
changedPaths: string[];
|
|
@@ -195,28 +195,25 @@ function findAuthorProblems(intentText: string): string[] {
|
|
|
195
195
|
* Ask the host who merged the pull request that last changed a plan on the default branch, and who approved it.
|
|
196
196
|
* @param mergeBase The commit this branch left the default branch at.
|
|
197
197
|
* @param planPath Path of the plan.
|
|
198
|
-
* @returns The merging account and the approving accounts, or undefined when
|
|
198
|
+
* @returns The merging account and the approving accounts, or undefined when no host token is set.
|
|
199
|
+
* @throws {Error} When a token is set and git or the host's tool fails.
|
|
199
200
|
*/
|
|
200
201
|
function readPlanMerge(mergeBase: string, planPath: string): PlanMerge | undefined {
|
|
201
202
|
if (process.env[hostTokenVariable] === undefined || process.env[hostTokenVariable] === "") {
|
|
202
203
|
return undefined;
|
|
203
204
|
}
|
|
204
205
|
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
const approvers = runHost(`${pullRequestPath}/reviews`, approvedFilter);
|
|
206
|
+
const commit = runGit(["log", "-1", "--format=%H", mergeBase, "--", planPath]);
|
|
207
|
+
const pullRequest = runHost(`${hostRepositoryPath}/commits/${commit}/pulls`, ".[0].number");
|
|
208
|
+
const pullRequestPath = `${hostRepositoryPath}/pulls/${pullRequest}`;
|
|
209
|
+
const mergedBy = runHost(pullRequestPath, ".merged_by.login");
|
|
210
|
+
const approvedFilter = '.[] | select(.state == "APPROVED") | .user.login';
|
|
211
|
+
const approvers = runHost(`${pullRequestPath}/reviews`, approvedFilter);
|
|
212
212
|
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
} catch {
|
|
218
|
-
return undefined;
|
|
219
|
-
}
|
|
213
|
+
return {
|
|
214
|
+
mergedBy,
|
|
215
|
+
approvers: approvers.split("\n").filter(approver => approver !== ""),
|
|
216
|
+
};
|
|
220
217
|
}
|
|
221
218
|
|
|
222
219
|
/**
|
|
@@ -249,7 +246,7 @@ const intentFileName = "intent.md";
|
|
|
249
246
|
const proofHeading = "## Proof";
|
|
250
247
|
const requirementsHeading = "## Requirements";
|
|
251
248
|
const acceptancePlaceholder = "@<engineer>";
|
|
252
|
-
const acceptedByPattern = /^Accepted by: @[\dA-Za-z][\
|
|
249
|
+
const acceptedByPattern = /^Accepted by: @[\dA-Za-z][\w-]*\.$/;
|
|
253
250
|
const requiredHeadings = ["## Files that change", "## Order of work", "## Risks", proofHeading];
|
|
254
251
|
|
|
255
252
|
/**
|
|
@@ -62,6 +62,9 @@ jobs:
|
|
|
62
62
|
if: needs.changes.outputs.full_verification == 'true'
|
|
63
63
|
runs-on: ubuntu-latest
|
|
64
64
|
timeout-minutes: 20
|
|
65
|
+
permissions:
|
|
66
|
+
contents: read
|
|
67
|
+
pull-requests: read # Needed by plan:check to read who merged the plan's pull request.
|
|
65
68
|
steps:
|
|
66
69
|
- name: Checkout repository
|
|
67
70
|
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
|
|
@@ -78,6 +81,8 @@ jobs:
|
|
|
78
81
|
- name: Check agent gates
|
|
79
82
|
run: pnpm gates:check
|
|
80
83
|
- name: Check plans
|
|
84
|
+
env:
|
|
85
|
+
GH_TOKEN: ${{ github.token }} # plan:check reads who merged the plan's pull request.
|
|
81
86
|
run: pnpm plan:check
|
|
82
87
|
- name: Check bands
|
|
83
88
|
run: pnpm bands:check
|
|
@@ -34,7 +34,7 @@ The `verifier` subagent starts the app with `pnpm start:dev`. It exercises the c
|
|
|
34
34
|
1. **Put unit tests next to the code as `src/**/*.test.ts` and end-to-end tests in `test/` as `*.e2e.test.ts`.** `vitest.config.ts` and `vitest.e2e.config.ts` collect only those patterns.
|
|
35
35
|
2. **Read configuration from environment variables and fail when one is missing**, as `parsePort` does. Document each variable in `.env.example`.
|
|
36
36
|
3. **Log through Nest's `Logger`.** It goes to the `ConsoleLogger` set in `src/main.ts`.
|
|
37
|
-
4. **Start from the accepted spec, in plan mode** (Cursor: Plan Mode). Give the plan the change's `intent/<change>/intent.md` and `spec.md`.
|
|
37
|
+
4. **Start from the accepted spec, in plan mode** (Cursor: Plan Mode). Give the plan the change's `intent/<change>/intent.md` and `spec.md`. The plan, `intent/<change>/plan.md`, gets a pull request of its own, and the engineer accepts it by merging that pull request, as `playbooks/build.md` of the `sdlc-mode` skill in `plugins/sdlc/claude-code/` describes.
|
|
38
38
|
5. **Start a bug fix with a failing test.** A bug fix has no intent and no spec; its plan, `intent/<short-description>/plan.md`, is accepted by an engineer before any code changes. Reproduce the bug as a test, confirm it fails for the reason you expect, and commit it on a `fix/` branch. Then `.agents/hooks/agent-test-edit-gate.sh` blocks test edits by itself: make the test pass without editing it. On a branch with another name, create `.git/bug-fix-in-progress` first, and delete it once the test passes.
|
|
39
39
|
6. **Do not start work a person did not ask for.** When a message reports a problem without asking for work, answer in a few lines and end with the message that would start it: `/sdlc:sdlc-mode` followed by their own words.
|
|
40
40
|
7. **Branch from the latest `origin/main`, and open the pull request ready for review.** Name the branch `<type>/<short-description>` and fill the body from `.github/pull_request_template.md`. `.github/workflows/ci.yml` runs full verification only on a pull request that is not a draft. Never merge a pull request: a person merges it with `--squash` after code owner approval, bottom-up for a stack of pull requests.
|
|
@@ -62,6 +62,9 @@ jobs:
|
|
|
62
62
|
if: needs.changes.outputs.full_verification == 'true'
|
|
63
63
|
runs-on: ubuntu-latest
|
|
64
64
|
timeout-minutes: 20
|
|
65
|
+
permissions:
|
|
66
|
+
contents: read
|
|
67
|
+
pull-requests: read # Needed by plan:check to read who merged the plan's pull request.
|
|
65
68
|
steps:
|
|
66
69
|
- name: Checkout repository
|
|
67
70
|
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
|
|
@@ -78,6 +81,8 @@ jobs:
|
|
|
78
81
|
- name: Check agent gates
|
|
79
82
|
run: pnpm gates:check
|
|
80
83
|
- name: Check plans
|
|
84
|
+
env:
|
|
85
|
+
GH_TOKEN: ${{ github.token }} # plan:check reads who merged the plan's pull request.
|
|
81
86
|
run: pnpm plan:check
|
|
82
87
|
- name: Check bands
|
|
83
88
|
run: pnpm bands:check
|
|
@@ -34,7 +34,7 @@ The `verifier` subagent starts the app with `pnpm dev`. It exercises the changed
|
|
|
34
34
|
1. **Put unit tests next to the code as `app/**/*.test.{ts,tsx}` and Playwright end-to-end tests in `test/` as `*.e2e.test.ts`.** Vitest collects only the first pattern.
|
|
35
35
|
2. **Component tests need a DOM test environment, and Vitest runs in Node.js.** Add that environment with the first component test.
|
|
36
36
|
3. **Read configuration from environment variables and fail when one is missing.** Document each variable in `.env.example`.
|
|
37
|
-
4. **Start from the accepted spec, in plan mode** (Cursor: Plan Mode). Give the plan the change's `intent/<change>/intent.md` and `spec.md`.
|
|
37
|
+
4. **Start from the accepted spec, in plan mode** (Cursor: Plan Mode). Give the plan the change's `intent/<change>/intent.md` and `spec.md`. The plan, `intent/<change>/plan.md`, gets a pull request of its own, and the engineer accepts it by merging that pull request, as `playbooks/build.md` of the `sdlc-mode` skill in `plugins/sdlc/claude-code/` describes.
|
|
38
38
|
5. **Start a bug fix with a failing test.** A bug fix has no intent and no spec; its plan, `intent/<short-description>/plan.md`, is accepted by an engineer before any code changes. Reproduce the bug as a test, confirm it fails for the reason you expect, and commit it on a `fix/` branch. Then `.agents/hooks/agent-test-edit-gate.sh` blocks test edits by itself: make the test pass without editing it. On a branch with another name, create `.git/bug-fix-in-progress` first, and delete it once the test passes.
|
|
39
39
|
6. **Do not start work a person did not ask for.** When a message reports a problem without asking for work, answer in a few lines and end with the message that would start it: `/sdlc:sdlc-mode` followed by their own words.
|
|
40
40
|
7. **Branch from the latest `origin/main`, and open the pull request ready for review.** Name the branch `<type>/<short-description>` and fill the body from `.github/pull_request_template.md`. `.github/workflows/ci.yml` runs full verification only on a pull request that is not a draft. Never merge a pull request: a person merges it with `--squash` after code owner approval, bottom-up for a stack of pull requests.
|
|
@@ -62,6 +62,9 @@ jobs:
|
|
|
62
62
|
if: needs.changes.outputs.full_verification == 'true'
|
|
63
63
|
runs-on: ubuntu-latest
|
|
64
64
|
timeout-minutes: 20
|
|
65
|
+
permissions:
|
|
66
|
+
contents: read
|
|
67
|
+
pull-requests: read # Needed by plan:check to read who merged the plan's pull request.
|
|
65
68
|
steps:
|
|
66
69
|
- name: Checkout repository
|
|
67
70
|
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
|
|
@@ -78,6 +81,8 @@ jobs:
|
|
|
78
81
|
- name: Check agent gates
|
|
79
82
|
run: pnpm gates:check
|
|
80
83
|
- name: Check plans
|
|
84
|
+
env:
|
|
85
|
+
GH_TOKEN: ${{ github.token }} # plan:check reads who merged the plan's pull request.
|
|
81
86
|
run: pnpm plan:check
|
|
82
87
|
- name: Check bands
|
|
83
88
|
run: pnpm bands:check
|
|
@@ -33,7 +33,7 @@ The `verifier` subagent starts the app with `pnpm start:dev`. It exercises the c
|
|
|
33
33
|
|
|
34
34
|
1. **Put tests next to the code as `src/**/*.test.ts`.** Vitest collects only that pattern.
|
|
35
35
|
2. **Read configuration from environment variables and fail when one is missing**, as `parsePort` does. Document each variable in `.env.example`; `pnpm start` and `pnpm start:dev` load `.env`.
|
|
36
|
-
3. **Start from the accepted spec, in plan mode** (Cursor: Plan Mode). Give the plan the change's `intent/<change>/intent.md` and `spec.md`.
|
|
36
|
+
3. **Start from the accepted spec, in plan mode** (Cursor: Plan Mode). Give the plan the change's `intent/<change>/intent.md` and `spec.md`. The plan, `intent/<change>/plan.md`, gets a pull request of its own, and the engineer accepts it by merging that pull request, as `playbooks/build.md` of the `sdlc-mode` skill in `plugins/sdlc/claude-code/` describes.
|
|
37
37
|
4. **Start a bug fix with a failing test.** A bug fix has no intent and no spec; its plan, `intent/<short-description>/plan.md`, is accepted by an engineer before any code changes. Reproduce the bug as a test, confirm it fails for the reason you expect, and commit it on a `fix/` branch. Then `.agents/hooks/agent-test-edit-gate.sh` blocks test edits by itself: make the test pass without editing it. On a branch with another name, create `.git/bug-fix-in-progress` first, and delete it once the test passes.
|
|
38
38
|
5. **Do not start work a person did not ask for.** When a message reports a problem without asking for work, answer in a few lines and end with the message that would start it: `/sdlc:sdlc-mode` followed by their own words.
|
|
39
39
|
6. **Branch from the latest `origin/main`, and open the pull request ready for review.** Name the branch `<type>/<short-description>` and fill the body from `.github/pull_request_template.md`. `.github/workflows/ci.yml` runs full verification only on a pull request that is not a draft. Never merge a pull request: a person merges it with `--squash` after code owner approval, bottom-up for a stack of pull requests.
|
|
@@ -79,6 +79,9 @@ jobs:
|
|
|
79
79
|
DATABASE_URL: postgres://postgres:postgres@localhost:5432/payload
|
|
80
80
|
PAYLOAD_SECRET: ci-only-secret
|
|
81
81
|
APP_URL: http://localhost:3000
|
|
82
|
+
permissions:
|
|
83
|
+
contents: read
|
|
84
|
+
pull-requests: read # Needed by plan:check to read who merged the plan's pull request.
|
|
82
85
|
steps:
|
|
83
86
|
- name: Checkout repository
|
|
84
87
|
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
|
|
@@ -95,6 +98,8 @@ jobs:
|
|
|
95
98
|
- name: Check agent gates
|
|
96
99
|
run: pnpm gates:check
|
|
97
100
|
- name: Check plans
|
|
101
|
+
env:
|
|
102
|
+
GH_TOKEN: ${{ github.token }} # plan:check reads who merged the plan's pull request.
|
|
98
103
|
run: pnpm plan:check
|
|
99
104
|
- name: Check bands
|
|
100
105
|
run: pnpm bands:check
|
|
@@ -37,7 +37,7 @@ The `verifier` subagent starts the app with `pnpm dev`, which needs a PostgreSQL
|
|
|
37
37
|
2. **Put unit tests next to the code as `src/**/*.test.{ts,tsx}` and Playwright end-to-end tests in `test/` as `*.e2e.test.ts`.** Vitest collects only the first pattern.
|
|
38
38
|
3. **Component tests need a DOM test environment, and Vitest runs in Node.js.** Add that environment with the first component test.
|
|
39
39
|
4. **Read configuration through `requireEnvironment` in `src/environment.ts`.** Document each variable in `.env.example`.
|
|
40
|
-
5. **Start from the accepted spec, in plan mode** (Cursor: Plan Mode). Give the plan the change's `intent/<change>/intent.md` and `spec.md`.
|
|
40
|
+
5. **Start from the accepted spec, in plan mode** (Cursor: Plan Mode). Give the plan the change's `intent/<change>/intent.md` and `spec.md`. The plan, `intent/<change>/plan.md`, gets a pull request of its own, and the engineer accepts it by merging that pull request, as `playbooks/build.md` of the `sdlc-mode` skill in `plugins/sdlc/claude-code/` describes.
|
|
41
41
|
6. **Start a bug fix with a failing test.** A bug fix has no intent and no spec; its plan, `intent/<short-description>/plan.md`, is accepted by an engineer before any code changes. Reproduce the bug as a test, confirm it fails for the reason you expect, and commit it on a `fix/` branch. Then `.agents/hooks/agent-test-edit-gate.sh` blocks test edits by itself: make the test pass without editing it. On a branch with another name, create `.git/bug-fix-in-progress` first, and delete it once the test passes.
|
|
42
42
|
7. **Do not start work a person did not ask for.** When a message reports a problem without asking for work, answer in a few lines and end with the message that would start it: `/sdlc:sdlc-mode` followed by their own words.
|
|
43
43
|
8. **Branch from the latest `origin/main`, and open the pull request ready for review.** Name the branch `<type>/<short-description>` and fill the body from `.github/pull_request_template.md`. `.github/workflows/ci.yml` runs full verification only on a pull request that is not a draft. Never merge a pull request: a person merges it with `--squash` after code owner approval, bottom-up for a stack of pull requests.
|
|
@@ -104,6 +104,7 @@ jobs:
|
|
|
104
104
|
permissions:
|
|
105
105
|
contents: read
|
|
106
106
|
id-token: write # Needed to exchange GitHub OIDC for a Turborepo Remote Cache token.
|
|
107
|
+
pull-requests: read # Needed by plan:check to read who merged the plan's pull request.
|
|
107
108
|
services:
|
|
108
109
|
postgres:
|
|
109
110
|
image: postgres:17.11-alpine@sha256:266d3c257594e195b309ae9d1805e54c788f1d7b375f56bf6c367aac6c917e7b
|
|
@@ -156,6 +157,8 @@ jobs:
|
|
|
156
157
|
- name: Check agent gates
|
|
157
158
|
run: pnpm gates:check
|
|
158
159
|
- name: Check plans
|
|
160
|
+
env:
|
|
161
|
+
GH_TOKEN: ${{ github.token }} # plan:check reads who merged the plan's pull request.
|
|
159
162
|
run: pnpm plan:check
|
|
160
163
|
- name: Check bands
|
|
161
164
|
run: pnpm bands:check
|
|
@@ -39,7 +39,7 @@ The `verifier` subagent starts the app with `pnpm dev`, which needs a PostgreSQL
|
|
|
39
39
|
2. **Put unit tests next to the code and Playwright end-to-end tests in `apps/app/test/` and `apps/backoffice/test/` as `*.e2e.test.ts`.** Vitest collects `apps/app/app/**/*.test.{ts,tsx}` and `apps/backoffice/src/**/*.test.{ts,tsx}`.
|
|
40
40
|
3. **Component tests need a DOM test environment, and Vitest runs in Node.js.** Add that environment with the first component test.
|
|
41
41
|
4. **Read backoffice configuration through `requireEnvironment` in `apps/backoffice/src/environment.ts`.** Document each variable in `.env.example`.
|
|
42
|
-
5. **Start from the accepted spec, in plan mode** (Cursor: Plan Mode). Give the plan the change's `intent/<change>/intent.md` and `spec.md`.
|
|
42
|
+
5. **Start from the accepted spec, in plan mode** (Cursor: Plan Mode). Give the plan the change's `intent/<change>/intent.md` and `spec.md`. The plan, `intent/<change>/plan.md`, gets a pull request of its own, and the engineer accepts it by merging that pull request, as `playbooks/build.md` of the `sdlc-mode` skill in `plugins/sdlc/claude-code/` describes.
|
|
43
43
|
6. **Start a bug fix with a failing test.** A bug fix has no intent and no spec; its plan, `intent/<short-description>/plan.md`, is accepted by an engineer before any code changes. Reproduce the bug as a test, confirm it fails for the reason you expect, and commit it on a `fix/` branch. Then `.agents/hooks/agent-test-edit-gate.sh` blocks test edits by itself: make the test pass without editing it. On a branch with another name, create `.git/bug-fix-in-progress` first, and delete it once the test passes.
|
|
44
44
|
7. **Do not start work a person did not ask for.** When a message reports a problem without asking for work, answer in a few lines and end with the message that would start it: `/sdlc:sdlc-mode` followed by their own words.
|
|
45
45
|
8. **Branch from the latest `origin/main`, and open the pull request ready for review.** Name the branch `<type>/<short-description>` and fill the body from `.github/pull_request_template.md`. `.github/workflows/ci.yml` runs full verification only on a pull request that is not a draft. Never merge a pull request: a person merges it with `--squash` after code owner approval, bottom-up for a stack of pull requests.
|