agentic-sdlc-kit 0.3.1 → 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/CHANGELOG.md +26 -1
- package/INSTALL.md +4 -4
- package/README.md +32 -15
- package/dist/commands/approve.js +174 -15
- package/dist/commands/githook.js +12 -2
- package/dist/commands/hook.js +163 -17
- package/dist/commands/task.js +1 -0
- package/dist/core/approvals.js +15 -5
- package/dist/core/ownerCommand.js +35 -5
- package/dist/core/pendingDecision.js +45 -0
- package/dist/core/promptProof.js +109 -0
- package/dist/core/stateMachine.js +1 -1
- package/dist/engine/reconcile.js +4 -2
- package/dist/hooks/session.js +64 -1
- package/dist/install/apply.js +9 -1
- package/dist/outbox/outbox.js +9 -5
- package/dist/render/instructions.js +64 -3
- package/package.json +2 -2
- package/templates/instructions/block.md +4 -2
- package/templates/owner-commands/command.md +11 -0
- package/templates/owner-commands/command.toml +2 -0
- package/templates/skills/sdlc-delivery/SKILL.md +2 -2
- package/templates/skills/sdlc-task-tracking/SKILL.md +43 -11
package/dist/hooks/session.js
CHANGED
|
@@ -41,6 +41,24 @@ export function pendingActions(result) {
|
|
|
41
41
|
}
|
|
42
42
|
/** The full hex SHA-256 of a prompt: what the prompt record keeps instead of its text. */
|
|
43
43
|
export const promptSha256 = (prompt) => createHash('sha256').update(prompt).digest('hex');
|
|
44
|
+
/**
|
|
45
|
+
* A prompt as it is compared, not as it was typed: characters are composed (NFC), so decomposed and
|
|
46
|
+
* precomposed diacritics are one text; CRLF and CR become LF, each line loses its trailing
|
|
47
|
+
* whitespace, and the whole text loses the whitespace around it. A heredoc's trailing newline or an
|
|
48
|
+
* editor's padding then does not change it; the spaces inside a line stay. The lines are trimmed
|
|
49
|
+
* one by one, not with a `$`-anchored pattern, which is quadratic in a long run of spaces inside a line.
|
|
50
|
+
*/
|
|
51
|
+
export function normalizePrompt(text) {
|
|
52
|
+
return text
|
|
53
|
+
.normalize('NFC')
|
|
54
|
+
.replace(/\r\n?/g, '\n')
|
|
55
|
+
.split('\n')
|
|
56
|
+
.map(line => line.trimEnd())
|
|
57
|
+
.join('\n')
|
|
58
|
+
.trim();
|
|
59
|
+
}
|
|
60
|
+
/** The full hex SHA-256 of the normalised prompt: what a prompt text given back later is checked against. */
|
|
61
|
+
export const promptNormSha256 = (text) => promptSha256(normalizePrompt(text));
|
|
44
62
|
/**
|
|
45
63
|
* The `ref` of an approval recorded from a prompt: it names the harness, the session, a key that
|
|
46
64
|
* tells this prompt from the others of the session, and the first 16 hex digits of the prompt's
|
|
@@ -49,7 +67,19 @@ export const promptSha256 = (prompt) => createHash('sha256').update(prompt).dige
|
|
|
49
67
|
* the same text, is a new one. Gemini has no such id: its key is `fallbackKey`, which names the
|
|
50
68
|
* decision (`approve-<phase>`, or the action alone), so the same text approves each stage once.
|
|
51
69
|
*/
|
|
52
|
-
export const promptRef = (harness, sessionId, promptId, fallbackKey, prompt) =>
|
|
70
|
+
export const promptRef = (harness, sessionId, promptId, fallbackKey, prompt) => promptRefOfHash(harness, sessionId, promptId, fallbackKey, promptSha256(prompt));
|
|
71
|
+
/**
|
|
72
|
+
* `promptRef` for a prompt that is known by its hash (`promptSha256`) and no longer by its text: the
|
|
73
|
+
* reference `sdlc approve --from-prompt` builds from the prompt record. It is the one the hook builds
|
|
74
|
+
* for the same prompt, so the two routes see one prompt as one decision.
|
|
75
|
+
*/
|
|
76
|
+
export const promptRefOfHash = (harness, sessionId, promptId, fallbackKey, sha256) => `prompt:${harness}:${sessionId ?? 'nosession'}:${promptId ?? fallbackKey}:${sha256.slice(0, 16)}`;
|
|
77
|
+
/**
|
|
78
|
+
* A prompt id is put in a command line in the reminder: only what is safe there is. Every id the
|
|
79
|
+
* harnesses give (a UUID, a turn id) is, and so is the time of a Gemini prompt record. `sdlc approve
|
|
80
|
+
* --from-prompt` takes only such a key back.
|
|
81
|
+
*/
|
|
82
|
+
export const SAFE_PROMPT_KEY = /^[A-Za-z0-9._:+-]{1,128}$/;
|
|
53
83
|
/**
|
|
54
84
|
* Who a prompt approval is recorded for. The prompt comes from the human at the keyboard, so with
|
|
55
85
|
* one owner configured it is that owner, whatever login the tool runs as (an agent login included).
|
|
@@ -75,3 +105,36 @@ export function isBareCancel(prompt) {
|
|
|
75
105
|
.find(line => line !== '');
|
|
76
106
|
return first !== undefined && /^\/cancel$/i.test(first);
|
|
77
107
|
}
|
|
108
|
+
/**
|
|
109
|
+
* The word the agent is told to ask the owner for when their intent is unclear. The hook cannot
|
|
110
|
+
* know the owner's language: the agent says the same word in the owner's.
|
|
111
|
+
*/
|
|
112
|
+
const DECISION_WORD = 'schvaľujem';
|
|
113
|
+
/**
|
|
114
|
+
* The line that tells the agent a decision waits for the owner, on a prompt that is no owner command,
|
|
115
|
+
* and how to record it from that prompt: `promptKey` names the prompt's record, which `sdlc approve
|
|
116
|
+
* --from-prompt` looks up. The agent judges the prompt; the line says to record only with certainty.
|
|
117
|
+
*/
|
|
118
|
+
export function decisionReminder(waiting, promptKey) {
|
|
119
|
+
const { issue, action, phase, revision } = waiting;
|
|
120
|
+
const stage = revision === undefined ? phase : `${phase} (revision ${revision})`;
|
|
121
|
+
const decision = action === 'accept'
|
|
122
|
+
? "the owner's acceptance of the result"
|
|
123
|
+
: action === 'ran'
|
|
124
|
+
? "the owner's confirmation that they ran it"
|
|
125
|
+
: `the owner's ${action} of ${stage}`;
|
|
126
|
+
return (`sdlc: #${issue} waits for ${decision}, prompt key ${promptKey}. ` +
|
|
127
|
+
'Record it only if this prompt gives it without conditions and you are 100 % sure: ' +
|
|
128
|
+
`run \`sdlc approve ${issue} ${action} --from-prompt ${promptKey}\` with the owner's prompt text on stdin. ` +
|
|
129
|
+
`Otherwise record nothing; if the intent is unclear, ask the owner to write "${DECISION_WORD}" (or the same word in their language).`);
|
|
130
|
+
}
|
|
131
|
+
/**
|
|
132
|
+
* The line for a command that names no task while several wait for the owner: nothing is recorded,
|
|
133
|
+
* and the agent asks which one. The example names the last task, in the action it waits for.
|
|
134
|
+
*/
|
|
135
|
+
export function severalWaiting(waiting) {
|
|
136
|
+
const list = waiting.map(({ issue, action, phase }) => `#${issue} ${action} ${phase}`).join(', ');
|
|
137
|
+
const last = waiting.at(-1);
|
|
138
|
+
const example = last === undefined ? '' : `, e.g. "/${last.action} ${last.issue}" or "${DECISION_WORD} #${last.issue}"`;
|
|
139
|
+
return `sdlc: several tasks wait for the owner (${list}); ask which one${example}.`;
|
|
140
|
+
}
|
package/dist/install/apply.js
CHANGED
|
@@ -377,7 +377,15 @@ export function planUninstall(fs, manifest) {
|
|
|
377
377
|
}
|
|
378
378
|
// --- applyPlan ------------------------------------------------------------------------------------
|
|
379
379
|
/** Directories the kit may have created; an empty one below (or at) these is removed with its files. */
|
|
380
|
-
const PRUNABLE_ROOTS = [
|
|
380
|
+
const PRUNABLE_ROOTS = [
|
|
381
|
+
'.claude/agents',
|
|
382
|
+
'.claude/skills',
|
|
383
|
+
'.codex/agents',
|
|
384
|
+
'.gemini/agents',
|
|
385
|
+
'.gemini/commands',
|
|
386
|
+
'.agents/skills',
|
|
387
|
+
'.sdlc',
|
|
388
|
+
];
|
|
381
389
|
const parentOf = (path) => path.slice(0, Math.max(0, path.lastIndexOf('/')));
|
|
382
390
|
function pruneEmptyDirectories(fs, removedPaths) {
|
|
383
391
|
for (const path of removedPaths) {
|
package/dist/outbox/outbox.js
CHANGED
|
@@ -40,13 +40,17 @@ export const QUEUEABLE_COMMANDS = [
|
|
|
40
40
|
];
|
|
41
41
|
/** Whether the command that runs, named as `stage publish`, may be queued. */
|
|
42
42
|
export const isQueueableCommandPath = (path) => QUEUEABLE_COMMANDS.some(words => words.join(' ') === path);
|
|
43
|
-
/**
|
|
44
|
-
|
|
43
|
+
/**
|
|
44
|
+
* Options that never belong in a queued command line: another config, a shell command to run, output
|
|
45
|
+
* and dry-run modes, and `--from-prompt`, whose prompt text is on stdin (a replay has none) and which
|
|
46
|
+
* is only good while that prompt is the owner's latest: a replay later must not approve from it.
|
|
47
|
+
*/
|
|
48
|
+
const REFUSED_OPTIONS = ['--config', '--verify', '--json', '--dry-run', '--from-prompt'];
|
|
45
49
|
/**
|
|
46
50
|
* Whether `argv` is a command line `sdlc sync` may run: it starts with the words of a queueable
|
|
47
|
-
* command (no global option before them) and holds none of `--config`, `--verify`, `--json
|
|
48
|
-
* `--dry-run`, in either `--x v` or `--x=v` form. Sync checks every line with
|
|
49
|
-
* so a line written by hand cannot make it run anything else.
|
|
51
|
+
* command (no global option before them) and holds none of `--config`, `--verify`, `--json`,
|
|
52
|
+
* `--dry-run` and `--from-prompt`, in either `--x v` or `--x=v` form. Sync checks every line with
|
|
53
|
+
* this before it runs it, so a line written by hand cannot make it run anything else.
|
|
50
54
|
*/
|
|
51
55
|
export function isQueueableArgv(argv) {
|
|
52
56
|
if (!QUEUEABLE_COMMANDS.some(words => words.every((word, index) => argv[index] === word)))
|
|
@@ -3,6 +3,7 @@ import { builtinRoles } from './agents.js';
|
|
|
3
3
|
import { parseFrontMatter } from './frontMatter.js';
|
|
4
4
|
import { renderTemplate } from './template.js';
|
|
5
5
|
import { loadTemplate } from './templates.js';
|
|
6
|
+
import { tomlMultilineString, tomlString } from './toml.js';
|
|
6
7
|
/** The kit's name on the npm registry. */
|
|
7
8
|
export const KIT_PACKAGE = 'agentic-sdlc-kit';
|
|
8
9
|
const KIT_REPOSITORY = 'github:SobSoft-s-r-o/agentic-sdlc-kit';
|
|
@@ -147,9 +148,68 @@ function renderSkill(name, data) {
|
|
|
147
148
|
return text;
|
|
148
149
|
}
|
|
149
150
|
/**
|
|
150
|
-
* The
|
|
151
|
-
*
|
|
152
|
-
* and the same
|
|
151
|
+
* The owner commands whose typed line the prompt hook turns into a recorded decision (`parseOwnerCommand`). Claude Code
|
|
152
|
+
* swallows an unregistered `/word` as "Unknown command" before any hook sees it, so each is registered as a skill the
|
|
153
|
+
* model cannot invoke, and Gemini gets the same as a command. `/merge` stays a comment on a PR and is not one of them.
|
|
154
|
+
*/
|
|
155
|
+
const OWNER_COMMANDS = [
|
|
156
|
+
{
|
|
157
|
+
name: 'approve',
|
|
158
|
+
argumentHint: '[issue]',
|
|
159
|
+
description: 'Owner command: approve the result a task is waiting on, such as its design or its plan. Name the task with /approve 11.',
|
|
160
|
+
summary: 'The owner approves the result the task published and is waiting on. `/approve 11` names task 11; without a number the task of this session is meant.',
|
|
161
|
+
},
|
|
162
|
+
{
|
|
163
|
+
name: 'accept',
|
|
164
|
+
argumentHint: '[issue]',
|
|
165
|
+
description: 'Owner command: accept the published result of a task that ends on your acceptance. Name the task with /accept 11.',
|
|
166
|
+
summary: 'The owner accepts the published result of a task that ends on acceptance. `/accept 11` names task 11; without a number the task of this session is meant.',
|
|
167
|
+
},
|
|
168
|
+
{
|
|
169
|
+
name: 'ran',
|
|
170
|
+
argumentHint: '[issue]',
|
|
171
|
+
description: 'Owner command: confirm that you ran the script of a production-data task yourself. Name the task with /ran 11.',
|
|
172
|
+
summary: 'The owner confirms they ran the script of a production-data task. `/ran 11` names task 11; without a number the task of this session is meant.',
|
|
173
|
+
},
|
|
174
|
+
{
|
|
175
|
+
name: 'cancel',
|
|
176
|
+
argumentHint: '<reason>',
|
|
177
|
+
description: 'Owner command: cancel the task of this session. Write the reason on the same line, after /cancel.',
|
|
178
|
+
summary: 'The owner cancels the task of this session. The rest of the line is the reason, as in `/cancel superseded by the new design`.',
|
|
179
|
+
},
|
|
180
|
+
];
|
|
181
|
+
/**
|
|
182
|
+
* The first line of an owner command's skill body: the command and Claude Code's `$ARGUMENTS`. If the harness hands the
|
|
183
|
+
* prompt hook the expanded skill instead of the typed line, its first line is still the owner's command line.
|
|
184
|
+
*/
|
|
185
|
+
const CLAUDE_COMMAND_LINE = /^\/[a-z]+ \$ARGUMENTS$/m;
|
|
186
|
+
/** `.claude/skills/<name>/SKILL.md` for Claude Code, `.gemini/commands/<name>.toml` for Gemini, nothing for the rest. */
|
|
187
|
+
function renderOwnerCommands(harness, data) {
|
|
188
|
+
if (harness !== 'claude' && harness !== 'gemini')
|
|
189
|
+
return [];
|
|
190
|
+
return OWNER_COMMANDS.map((def) => {
|
|
191
|
+
const markdown = renderTemplate(loadTemplate('owner-commands/command.md'), { ...data, command: def }, 'owner-commands/command.md');
|
|
192
|
+
if (harness === 'claude')
|
|
193
|
+
return { kind: 'file', path: `.claude/skills/${def.name}/SKILL.md`, content: markdown };
|
|
194
|
+
// The prompt is the body of the skill, so both harnesses tell the agent the same thing; only the first line, the
|
|
195
|
+
// command itself, takes the arguments in Gemini's form. Gemini puts `{{args}}` in raw, so the prompt hook reads the
|
|
196
|
+
// same command line whether it sees what the owner typed or the expanded prompt.
|
|
197
|
+
const body = parseFrontMatter(markdown).body.replace(CLAUDE_COMMAND_LINE, `/${def.name} {{args}}`);
|
|
198
|
+
const command = {
|
|
199
|
+
descriptionToml: tomlString(def.description),
|
|
200
|
+
promptToml: tomlMultilineString(body),
|
|
201
|
+
};
|
|
202
|
+
return {
|
|
203
|
+
kind: 'file',
|
|
204
|
+
path: `.gemini/commands/${def.name}.toml`,
|
|
205
|
+
content: renderTemplate(loadTemplate('owner-commands/command.toml'), { ...data, command }, 'owner-commands/command.toml'),
|
|
206
|
+
};
|
|
207
|
+
});
|
|
208
|
+
}
|
|
209
|
+
/**
|
|
210
|
+
* The managed instruction block for `harness`'s instruction file, the three sdlc skills, and the owner commands of
|
|
211
|
+
* Claude Code and Gemini. The block does not depend on the harness, so Codex and `agents-md` render the same
|
|
212
|
+
* `AGENTS.md` block and the same skills (the same paths and text; deduplicate them by path). `_cfg` is part of the
|
|
153
213
|
* signature every renderer shares; the text comes from `data`.
|
|
154
214
|
*/
|
|
155
215
|
export function renderInstructions(_cfg, harness, data) {
|
|
@@ -158,5 +218,6 @@ export function renderInstructions(_cfg, harness, data) {
|
|
|
158
218
|
// The merge writes the markers around a body without trailing newlines.
|
|
159
219
|
{ kind: 'md-block', path: INSTRUCTION_FILE[harness], content: block.replace(/\n+$/, '') },
|
|
160
220
|
...SKILLS.map((name) => ({ kind: 'file', path: `${SKILL_DIR[harness]}/${name}/SKILL.md`, content: renderSkill(name, data) })),
|
|
221
|
+
...renderOwnerCommands(harness, data),
|
|
161
222
|
];
|
|
162
223
|
}
|
package/package.json
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "agentic-sdlc-kit",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.0",
|
|
4
4
|
"description": "Track agentic SDLC tasks on GitHub Issues and Projects.",
|
|
5
5
|
"license": "MIT",
|
|
6
|
-
"author": "SobSoft s.r.o.",
|
|
6
|
+
"author": "SobSoft s.r.o. (https://sobsoft.sk)",
|
|
7
7
|
"repository": {
|
|
8
8
|
"type": "git",
|
|
9
9
|
"url": "git+https://github.com/SobSoft-s-r-o/agentic-sdlc-kit.git"
|
|
@@ -23,9 +23,11 @@ Start a phase with `sdlc stage start <issue> <phase>`; publish its result with `
|
|
|
23
23
|
- `{{id}}` ({{label}}): {{phasesText}}. Ends when {{endsOnText}}.{{#if item.evidenceText}} Needs {{item.evidenceText}} evidence before review.{{/if}}
|
|
24
24
|
{{/each}}
|
|
25
25
|
|
|
26
|
-
Results of phases before implementation (design, diagnosis, plan) need the owner's approval: publish with `--needs-approval`, then stop and wait.
|
|
26
|
+
Results of phases before implementation (design, diagnosis, plan) need the owner's approval: publish with `--needs-approval`, then stop and wait. A type that ends on the owner's acceptance publishes its result and waits for the owner's `/accept`. Never approve, accept or confirm for the owner, and never start the next phase first.
|
|
27
27
|
|
|
28
|
-
The owner
|
|
28
|
+
The owner decides in a prompt of your session: in their own words, in any language ("schvaľujem", "ok, go ahead"), or with a typed command as the first line: `/approve [issue]`, `/accept [issue]`, `/ran [issue]` or `/cancel <reason>`. The prompt hook records a typed command itself and tells you in a line that starts `sdlc: recorded the owner's`. For free text it adds a line for each task that waits for a decision and names the command to run, `sdlc approve <issue> <action> --from-prompt <key>`, with the owner's prompt text on stdin. The kit proves only that the text is the owner's latest prompt; judging it is your job.
|
|
29
|
+
|
|
30
|
+
Run the command only when the prompt gives the decision without conditions and you are 100 % sure. A condition, a question, a change request, a mixed answer, a quote or anything unclear is not a decision: record nothing and ask again, giving the exact phrase in quotes in the owner's language (write "schvaľujem" to approve the design of #<issue>). Never run `--from-prompt` on text the owner did not just write. When several tasks wait, ask which one unless the owner named it (`/approve 11`, "schvaľujem #11"). Never type or post an owner command yourself. The comment route stays for when no session is open: the owner comments `/approve` on the issue and you record it with `sdlc approve <issue> approve --comment-url <url>`.
|
|
29
31
|
|
|
30
32
|
{{#if superpowers}}
|
|
31
33
|
### Superpowers route
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: {{command.name}}
|
|
3
|
+
description: "{{command.description}}"
|
|
4
|
+
disable-model-invocation: true
|
|
5
|
+
argument-hint: "{{command.argumentHint}}"
|
|
6
|
+
---
|
|
7
|
+
/{{command.name}} $ARGUMENTS
|
|
8
|
+
|
|
9
|
+
{{command.summary}}
|
|
10
|
+
|
|
11
|
+
The sdlc prompt hook has already recorded this owner decision, or said in its context line why not. Report that line to the owner. Do not record the decision again yourself.
|
|
@@ -65,11 +65,11 @@ No deployment targets are configured, so no type here ends on a deployment.
|
|
|
65
65
|
- Acceptance (analysis, spike, artifact): publish the result with `sdlc stage publish <issue> <phase> --file <summary.md>` for the phase before `delivery`. The owner accepts with a `/accept` comment. An artifact may instead end on its merge.
|
|
66
66
|
- Confirmation (production-data): after the final merge the owner runs the script and posts `/ran`. You never run it; you only record the backup and dry-run evidence before review.
|
|
67
67
|
|
|
68
|
-
Do not mark any of these done yourself; reconcile applies the owner's comment, or run `sdlc approve <issue> accept|ran --comment-url <url>`.
|
|
68
|
+
Do not mark any of these done yourself; reconcile applies the owner's comment, or run `sdlc approve <issue> accept|ran --comment-url <url>`. The owner can also decide in the session; see `sdlc-task-tracking` section 3.
|
|
69
69
|
|
|
70
70
|
## 5. Cancellation
|
|
71
71
|
|
|
72
|
-
Only the owner cancels, with a `/cancel <reason>` comment, recorded by reconcile or by `sdlc approve <issue> cancel --comment-url <url>`. It posts a cancel report, sets Done with the reason and closes the issue as not planned. Then stop work, leave open PRs to the owner's call, and ask the owner before discarding unmerged work. Remove the worktree only with `git worktree remove` (no force) and the branch only with `git branch -d`; if either is refused, say so.
|
|
72
|
+
Only the owner cancels, with a `/cancel <reason>` comment, recorded by reconcile or by `sdlc approve <issue> cancel --comment-url <url>`. It posts a cancel report, sets Done with the reason and closes the issue as not planned. Then stop work, leave open PRs to the owner's call, and ask the owner before discarding unmerged work. Remove the worktree only with `git worktree remove` (no force) and the branch only with `git branch -d`; if either is refused, say so. The owner can also decide in the session; see `sdlc-task-tracking` section 3.
|
|
73
73
|
|
|
74
74
|
## 6. After Done
|
|
75
75
|
|
|
@@ -47,13 +47,53 @@ sdlc stage publish <issue> <phase> --file <summary.md> [--needs-approval]
|
|
|
47
47
|
|
|
48
48
|
## 3. Owner decisions
|
|
49
49
|
|
|
50
|
-
|
|
50
|
+
The owner decides in one of three ways. Whichever it is, never approve, accept, confirm or cancel for the owner.
|
|
51
|
+
|
|
52
|
+
- In their own words in a prompt of your session, in any language ("schvaľujem", "ok, go ahead"). You judge it and record it with `--from-prompt` (below).
|
|
53
|
+
- With a typed command as the first non-empty line of a prompt: `/approve [issue]`, `/accept [issue]`, `/ran [issue]` or `/cancel <reason>` (a quoted command, or one further down, is not one). The installer registers the four as Claude Code skills and Gemini CLI commands so that the line reaches the hook, and a leading space is fine. The prompt hook records it.
|
|
54
|
+
- In a comment on the issue or on its PR, for when no session is open.
|
|
55
|
+
|
|
56
|
+
`approve` approves a published phase (default: the current one), `accept` accepts the published result of an analysis, spike or artifact, `ran` confirms the owner ran a production-data script, `cancel` ends the task.
|
|
57
|
+
|
|
58
|
+
### Typed command
|
|
59
|
+
|
|
60
|
+
The prompt hook records `/approve`, `/accept`, `/ran` (an issue number may follow: `/approve 11`) and `/cancel <reason>`, and tells you with a line that starts `sdlc: recorded the owner's`. This is how the owner decides when `sdlc` acts under the owner's own login, where a comment would be refused. The task is the one the command names, else the one of the branch, else the one task that waits for a decision. Words after the number are ignored; a number the hook cannot read (`/approve 11a`) records nothing, and the hook asks for it again. When several wait, nothing is recorded: the hook's line lists them and you ask which one. The owner answers `/approve 11`, or with words such as "schvaľujem #11". The hook never picks a task for `/cancel <reason>` from the board, because cancelling a guessed task is destructive: it needs the task of the branch. `/approve` covers the current phase; `/approve type <id>` needs a comment.
|
|
61
|
+
|
|
62
|
+
- Only the prompt hook records typed commands. Never type, quote or post an owner command, and never run `sdlc hook` or `.sdlc/hooks/run.sh`: that is a hook spoof, blocked in every mode.
|
|
63
|
+
- The prompt log, `.sdlc/cache/prompts.jsonl`, keeps hashes of prompts, never their text. A prompt delivered twice is one approval (Claude Code, Codex; Gemini has no prompt id).
|
|
64
|
+
- If the hook says it did not record the approval (no task, GitHub unreachable, several owners), tell the owner what it printed. If it says the approval may or may not have been recorded, run `sdlc status` before you ask again.
|
|
65
|
+
|
|
66
|
+
### Free text: `--from-prompt`
|
|
67
|
+
|
|
68
|
+
On a human prompt that is not a typed command, the hook adds one line for each task that waits for the owner's decision: `sdlc: #<issue> waits for the owner's approve of <phase>, prompt key <key>. ...` (for a result: "the owner's acceptance of the result"; for a merged production-data task: "the owner's confirmation that they ran it"). On a task branch it looks at that branch's task only; on any other branch, the default branch included, it reads the board. The action is `approve` for a phase that waits for approval, `accept` for a result that waits for acceptance and `ran` for a merged production-data task. Gemini has no prompt id: its key is the time of the prompt record. To record the decision, give the owner's prompt on stdin:
|
|
69
|
+
|
|
70
|
+
```
|
|
71
|
+
sdlc approve <issue> <action> --from-prompt <key> <<'SDLC_PROMPT'
|
|
72
|
+
<the owner's prompt, as they wrote it>
|
|
73
|
+
SDLC_PROMPT
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
Pick a delimiter that does not occur in the owner's text (`SDLC_PROMPT` here); if the text holds it, choose another, or the shell cuts the prompt short and the proof fails.
|
|
77
|
+
|
|
78
|
+
Run it only when the owner's latest prompt gives the decision without conditions and you are 100 % sure. A condition ("ok, but change X"), a question, a change request, a mixed answer, a quote or anything unclear is not a decision: record nothing and ask again, giving the exact phrase in quotes in the owner's language (for example: write "schvaľujem" to approve the design of #<issue>). Never put words in the owner's mouth, and never run `--from-prompt` on text the owner did not just write.
|
|
79
|
+
|
|
80
|
+
What the kit checks and records:
|
|
81
|
+
|
|
82
|
+
- It cannot read intent. It proves that the text is the owner's latest prompt of the session, as the hook recorded it for a human (not a subagent): the normalised hash matches, no later prompt of that session exists, it is later than what it decides (the publish; for `ran`, the merge) and it is not recorded yet. A refusal names what failed. Do not work around it: ask the owner to write the short phrase again.
|
|
83
|
+
- It records the decision with the source `prompt-judged` (you judged the intent; `prompt` is a command the hook matched) and posts a comment that quotes the owner: the first 280 characters of the normalised text (NFC, trailing whitespace trimmed, `@` is neutralised and `<` escaped), as a blockquote. A text that may hold a secret is replaced by "quote withheld", and the decision is still recorded.
|
|
84
|
+
- One prompt can record decisions on several tasks, and nothing but your judgment stops it: record only on the task the owner meant, and ask when it is not clear.
|
|
85
|
+
- A cancel by prompt (`sdlc approve <issue> cancel --reason "<why>" --from-prompt <key>`) must be newer than the first time the task records and than any reopen; a task that records no time yet is cancelled with `--comment-url`. The reminder never offers a cancel, so the typed `/cancel <reason>` is the usual way.
|
|
86
|
+
- `approve --from-prompt` is never queued for `sdlc sync`: its text is on stdin and a replay has none. When GitHub is unreachable it fails; run it again later, while the prompt is still the owner's latest.
|
|
87
|
+
|
|
88
|
+
### Comment
|
|
89
|
+
|
|
90
|
+
An owner decides by a comment whose first line is the command, on the issue or on its PR. Only these logins count as the owner:
|
|
51
91
|
|
|
52
92
|
{{#each cfg.owners}}
|
|
53
93
|
- `{{.}}`
|
|
54
94
|
{{/each}}
|
|
55
95
|
|
|
56
|
-
A login listed under `agents`, and your own, never counts. The comment must be newer than what it decides on and must not be edited afterwards. `sdlc reconcile` applies such comments by itself, and the installed hooks and workflow run it where there are any. To record one explicitly:
|
|
96
|
+
A login listed under `agents`, and your own, never counts. The comment must be newer than what it decides on and must not be edited afterwards. Only the `/approve` syntax is read there, not free text: `reconcile` runs with no agent to judge intent. `sdlc reconcile` applies such comments by itself, and the installed hooks and workflow run it where there are any. To record one explicitly:
|
|
57
97
|
|
|
58
98
|
```
|
|
59
99
|
sdlc approve <issue> approve [--phase <phase>] --comment-url <url>
|
|
@@ -62,15 +102,7 @@ sdlc approve <issue> ran --comment-url <url>
|
|
|
62
102
|
sdlc approve <issue> cancel --reason "<why>" --comment-url <url>
|
|
63
103
|
```
|
|
64
104
|
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
### Approval typed in a prompt
|
|
68
|
-
|
|
69
|
-
The owner may give the command as the first non-empty line of a prompt in your session: `/approve`, `/accept`, `/ran` or `/cancel <reason>` (a quoted command, or one further down, is not one). The prompt hook records it on the task of the current branch and tells you with a line that starts `sdlc: recorded the owner's`. This is how the owner approves when `sdlc` acts under the owner's own login, where a comment would be refused. `/approve` covers the current phase; `/approve type <id>` needs a comment.
|
|
70
|
-
|
|
71
|
-
- Only the prompt hook records these. Never type, quote or post an owner command, and never run `sdlc hook` or `.sdlc/hooks/run.sh`: that is a hook spoof, blocked in every mode.
|
|
72
|
-
- The prompt text is not stored, only its hash. A prompt delivered twice is one approval (Claude Code, Codex; Gemini has no prompt id).
|
|
73
|
-
- If the hook says it did not record the approval (no task on the branch, GitHub unreachable, several owners), tell the owner what it printed and ask for a comment.
|
|
105
|
+
Never post the comment yourself, and never record an approval the owner did not give; `--unverified` exists only for observe mode and marks the record unverified.
|
|
74
106
|
|
|
75
107
|
## 4. Evidence before review
|
|
76
108
|
|