@stdd/plugin 0.9.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/.claude-plugin/plugin.json +9 -0
- package/.codex-plugin/plugin.json +21 -0
- package/LICENSE +21 -0
- package/README.md +47 -0
- package/extensions/stdd.mjs +77 -0
- package/hooks/claude-hooks.json +28 -0
- package/hooks/codex-hooks.json +28 -0
- package/package.json +38 -0
- package/runtime/adapters/README.md +158 -0
- package/runtime/cli/check.mjs +555 -0
- package/runtime/cli/ci.mjs +190 -0
- package/runtime/cli/claude-hooks.mjs +689 -0
- package/runtime/cli/config.mjs +27 -0
- package/runtime/cli/evidence.mjs +249 -0
- package/runtime/cli/generated-files.mjs +1693 -0
- package/runtime/cli/held-fs.mjs +415 -0
- package/runtime/cli/init.mjs +883 -0
- package/runtime/cli/ledger.mjs +1470 -0
- package/runtime/cli/lib.mjs +909 -0
- package/runtime/cli/path-bytes.mjs +83 -0
- package/runtime/cli/policy.mjs +112 -0
- package/runtime/cli/recorders.mjs +188 -0
- package/runtime/cli/review-fs.mjs +825 -0
- package/runtime/cli/review.mjs +1065 -0
- package/runtime/cli/runtime.mjs +32 -0
- package/runtime/cli/scope.mjs +185 -0
- package/runtime/cli/snapshot.mjs +897 -0
- package/runtime/cli/state-validation.mjs +168 -0
- package/runtime/cli/status.mjs +580 -0
- package/runtime/cli/stdd.mjs +536 -0
- package/runtime/cli/worker-fs.mjs +971 -0
- package/runtime/cli/worker-metadata.mjs +139 -0
- package/runtime/cli/worker.mjs +779 -0
- package/runtime/method/README.md +634 -0
- package/runtime/method/reference-commands.md +147 -0
- package/runtime/method/reference-generated-state.md +151 -0
- package/runtime/method/reference-integration.md +233 -0
- package/runtime/package.json +65 -0
- package/runtime/playbooks/brainstorming.md +46 -0
- package/runtime/playbooks/debugging.md +36 -0
- package/runtime/playbooks/delegate-slice.md +129 -0
- package/runtime/playbooks/finish-change.md +46 -0
- package/runtime/playbooks/implement.md +26 -0
- package/runtime/playbooks/investigation.md +33 -0
- package/runtime/playbooks/managed-playbooks.json +14 -0
- package/runtime/playbooks/planning.md +177 -0
- package/runtime/playbooks/pr-green.md +50 -0
- package/runtime/playbooks/start-change.md +37 -0
- package/runtime/playbooks/worktrees.md +45 -0
- package/runtime/prebuilds/stdd-fs/darwin-arm64/stdd-fs +0 -0
- package/runtime/prebuilds/stdd-fs/darwin-x64/stdd-fs +0 -0
- package/runtime/prebuilds/stdd-fs/linux-arm64/stdd-fs +0 -0
- package/runtime/prebuilds/stdd-fs/linux-x64/stdd-fs +0 -0
- package/runtime/prebuilds/stdd-fs/manifest.json +47 -0
- package/runtime/prebuilds/stdd-fs/win32-arm64/stdd-fs.exe +0 -0
- package/runtime/prebuilds/stdd-fs/win32-x64/stdd-fs.exe +0 -0
- package/runtime/sdk/adapters.mjs +279 -0
- package/runtime/sdk/file-observation.mjs +12 -0
- package/runtime/sdk/index.d.ts +140 -0
- package/runtime/sdk/index.mjs +31 -0
- package/runtime/sdk/native-fs.mjs +1235 -0
- package/runtime/sdk/path.mjs +71 -0
- package/runtime/sdk/text.mjs +42 -0
- package/runtime/sdk/workflow.mjs +294 -0
- package/runtime/templates/deferred-design.md +47 -0
- package/runtime/templates/github-stdd.yml +42 -0
- package/runtime/templates/gitlab-stdd.yml +72 -0
- package/runtime/templates/pr-description.md +35 -0
- package/scripts/adopting-root.mjs +42 -0
- package/scripts/stdd-hook.mjs +72 -0
- package/skills/stdd-brainstorming/SKILL.md +48 -0
- package/skills/stdd-debugging/SKILL.md +38 -0
- package/skills/stdd-delegate-slice/SKILL.md +118 -0
- package/skills/stdd-finish-change/SKILL.md +40 -0
- package/skills/stdd-implement/SKILL.md +28 -0
- package/skills/stdd-investigation/SKILL.md +35 -0
- package/skills/stdd-planning/SKILL.md +165 -0
- package/skills/stdd-pr-green/SKILL.md +52 -0
- package/skills/stdd-start-change/SKILL.md +39 -0
- package/skills/stdd-worktrees/SKILL.md +46 -0
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "stdd",
|
|
3
|
+
"version": "0.9.0",
|
|
4
|
+
"description": "Native STDD workflow skills and lifecycle context for Codex",
|
|
5
|
+
"author": {
|
|
6
|
+
"name": "Azamat Almazbek uulu"
|
|
7
|
+
},
|
|
8
|
+
"skills": "./skills/",
|
|
9
|
+
"hooks": "./hooks/codex-hooks.json",
|
|
10
|
+
"interface": {
|
|
11
|
+
"displayName": "STDD",
|
|
12
|
+
"shortDescription": "Spec + Test Driven Development workflows.",
|
|
13
|
+
"longDescription": "Adds STDD change routing, planning, implementation, review, and delivery skills with a self-contained lifecycle runtime. Repository state and optional enforcement remain project-owned.",
|
|
14
|
+
"developerName": "Azamat Almazbek uulu",
|
|
15
|
+
"category": "Productivity",
|
|
16
|
+
"capabilities": [],
|
|
17
|
+
"defaultPrompt": [
|
|
18
|
+
"Use STDD to classify and execute this repository change."
|
|
19
|
+
]
|
|
20
|
+
}
|
|
21
|
+
}
|
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Azamat Almazbek uulu
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
# STDD universal plugin
|
|
2
|
+
|
|
3
|
+
This directory is the self-contained STDD distribution for Codex, Claude Code,
|
|
4
|
+
and Pi. Every host loads the same conservative-profile skills and bundled CLI
|
|
5
|
+
runtime; adopting repositories do not need a local `@stdd/cli` dependency.
|
|
6
|
+
|
|
7
|
+
## Install
|
|
8
|
+
|
|
9
|
+
- **Codex:** install `stdd` from a Codex marketplace that points at this
|
|
10
|
+
directory.
|
|
11
|
+
- **Claude Code:** install `stdd` from a Claude Code marketplace that points at
|
|
12
|
+
this directory.
|
|
13
|
+
- **Pi:** `pi install npm:@stdd/plugin@<version>`. For a source checkout, use
|
|
14
|
+
`pi install ./plugins/stdd`.
|
|
15
|
+
|
|
16
|
+
The source tree is a distribution input, not proof that a registry release has
|
|
17
|
+
occurred. Publishers must run the repository build and verification commands
|
|
18
|
+
before releasing it.
|
|
19
|
+
|
|
20
|
+
## Activation and ownership
|
|
21
|
+
|
|
22
|
+
Installing the bundle changes no repository. Skills are available globally,
|
|
23
|
+
but lifecycle integration stays dormant unless the current checkout contains
|
|
24
|
+
`.stdd/`. Run `stdd init` separately when a repository adopts the shared
|
|
25
|
+
contract. Repository state, policy, generated native routing, and optional CI
|
|
26
|
+
remain repository-owned.
|
|
27
|
+
|
|
28
|
+
Codex and Claude Code use fail-open SessionStart and Stop command hooks. Pi
|
|
29
|
+
restores successful local status output at session start and after compaction,
|
|
30
|
+
and may queue one corrective follow-up after a blocked settled turn. Runtime
|
|
31
|
+
errors do not trap the host or enter model context. If the bundle cannot read
|
|
32
|
+
an adopted contract, update the bundle or re-run initialization with a
|
|
33
|
+
compatible STDD CLI.
|
|
34
|
+
|
|
35
|
+
## Build
|
|
36
|
+
|
|
37
|
+
From the STDD source root:
|
|
38
|
+
|
|
39
|
+
```bash
|
|
40
|
+
npm run build:plugin
|
|
41
|
+
npm pack --dry-run --json ./plugins/stdd
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
The build regenerates skills, the Pi extension, and the bundled runtime;
|
|
45
|
+
version-aligns all host manifests; and rejects unsafe or stale publication
|
|
46
|
+
paths. Building currently requires Linux held-directory support. The generated
|
|
47
|
+
bundle itself remains portable to supported Codex, Claude Code, and Pi hosts.
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import { execFile } from "node:child_process";
|
|
2
|
+
import fs from "node:fs";
|
|
3
|
+
import { fileURLToPath } from "node:url";
|
|
4
|
+
import { resolveAdoptingRoot } from "../scripts/adopting-root.mjs";
|
|
5
|
+
|
|
6
|
+
const RUNTIME = fileURLToPath(new URL("../runtime/cli/stdd.mjs", import.meta.url));
|
|
7
|
+
const COMMAND_TIMEOUT_MS = 10_000;
|
|
8
|
+
const MAX_OUTPUT_BYTES = 1024 * 1024;
|
|
9
|
+
const SESSION_RUNTIME_FAILURE =
|
|
10
|
+
"STDD bundled runtime failed. Update the STDD plugin or re-run `stdd init`.";
|
|
11
|
+
|
|
12
|
+
function exec(command, args, cwd) {
|
|
13
|
+
return new Promise((resolve) => {
|
|
14
|
+
const child = execFile(
|
|
15
|
+
command,
|
|
16
|
+
args,
|
|
17
|
+
{
|
|
18
|
+
cwd,
|
|
19
|
+
encoding: "utf8",
|
|
20
|
+
timeout: COMMAND_TIMEOUT_MS,
|
|
21
|
+
maxBuffer: MAX_OUTPUT_BYTES,
|
|
22
|
+
},
|
|
23
|
+
(error, stdout, stderr) => {
|
|
24
|
+
const exitCode = error ? (typeof error.code === "number" ? error.code : null) : 0;
|
|
25
|
+
resolve({ exitCode, stdout, stderr });
|
|
26
|
+
},
|
|
27
|
+
);
|
|
28
|
+
child.stdin?.end();
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
async function runStdd(cwd, args) {
|
|
33
|
+
const root = resolveAdoptingRoot(cwd);
|
|
34
|
+
if (!root || !fs.existsSync(RUNTIME)) return null;
|
|
35
|
+
return exec(process.execPath, [RUNTIME, ...args], root);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export default function stddPlugin(pi) {
|
|
39
|
+
const restore = async (_event, ctx) => {
|
|
40
|
+
const result = await runStdd(ctx.cwd, ["status", "--local"]);
|
|
41
|
+
if (!result) return;
|
|
42
|
+
if (result.exitCode !== 0) {
|
|
43
|
+
if (ctx.hasUI) ctx.ui.notify(SESSION_RUNTIME_FAILURE, "warning");
|
|
44
|
+
return;
|
|
45
|
+
}
|
|
46
|
+
if (result.stdout.trim() === "") return;
|
|
47
|
+
pi.sendMessage(
|
|
48
|
+
{
|
|
49
|
+
customType: "stdd-status",
|
|
50
|
+
content: result.stdout,
|
|
51
|
+
display: false,
|
|
52
|
+
},
|
|
53
|
+
{ deliverAs: "nextTurn" },
|
|
54
|
+
);
|
|
55
|
+
};
|
|
56
|
+
pi.on("session_start", restore);
|
|
57
|
+
pi.on("session_compact", restore);
|
|
58
|
+
|
|
59
|
+
let skipNextGate = false;
|
|
60
|
+
pi.on("agent_settled", async (_event, ctx) => {
|
|
61
|
+
if (skipNextGate) {
|
|
62
|
+
skipNextGate = false;
|
|
63
|
+
return;
|
|
64
|
+
}
|
|
65
|
+
const result = await runStdd(ctx.cwd, ["stop-hook"]);
|
|
66
|
+
if (result?.exitCode !== 2 || result.stderr.trim() === "") return;
|
|
67
|
+
skipNextGate = true;
|
|
68
|
+
pi.sendMessage(
|
|
69
|
+
{
|
|
70
|
+
customType: "stdd-stop-gate",
|
|
71
|
+
content: result.stderr,
|
|
72
|
+
display: true,
|
|
73
|
+
},
|
|
74
|
+
{ deliverAs: "followUp", triggerTurn: true },
|
|
75
|
+
);
|
|
76
|
+
});
|
|
77
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
{
|
|
2
|
+
"description": "Surface local STDD task state with the bundled runtime when the repository contains .stdd.",
|
|
3
|
+
"hooks": {
|
|
4
|
+
"SessionStart": [
|
|
5
|
+
{
|
|
6
|
+
"matcher": "startup|resume|clear|compact",
|
|
7
|
+
"hooks": [
|
|
8
|
+
{
|
|
9
|
+
"type": "command",
|
|
10
|
+
"command": "node \"$CLAUDE_PLUGIN_ROOT/scripts/stdd-hook.mjs\" session",
|
|
11
|
+
"timeout": 10
|
|
12
|
+
}
|
|
13
|
+
]
|
|
14
|
+
}
|
|
15
|
+
],
|
|
16
|
+
"Stop": [
|
|
17
|
+
{
|
|
18
|
+
"hooks": [
|
|
19
|
+
{
|
|
20
|
+
"type": "command",
|
|
21
|
+
"command": "node \"$CLAUDE_PLUGIN_ROOT/scripts/stdd-hook.mjs\" stop-claude",
|
|
22
|
+
"timeout": 10
|
|
23
|
+
}
|
|
24
|
+
]
|
|
25
|
+
}
|
|
26
|
+
]
|
|
27
|
+
}
|
|
28
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
{
|
|
2
|
+
"description": "Surface local STDD task state with the plugin's bundled runtime when the repository contains .stdd.",
|
|
3
|
+
"hooks": {
|
|
4
|
+
"SessionStart": [
|
|
5
|
+
{
|
|
6
|
+
"matcher": "startup|resume|clear|compact",
|
|
7
|
+
"hooks": [
|
|
8
|
+
{
|
|
9
|
+
"type": "command",
|
|
10
|
+
"command": "node \"$CLAUDE_PLUGIN_ROOT/scripts/stdd-hook.mjs\" session",
|
|
11
|
+
"timeout": 10
|
|
12
|
+
}
|
|
13
|
+
]
|
|
14
|
+
}
|
|
15
|
+
],
|
|
16
|
+
"Stop": [
|
|
17
|
+
{
|
|
18
|
+
"hooks": [
|
|
19
|
+
{
|
|
20
|
+
"type": "command",
|
|
21
|
+
"command": "node \"$CLAUDE_PLUGIN_ROOT/scripts/stdd-hook.mjs\" stop",
|
|
22
|
+
"timeout": 10
|
|
23
|
+
}
|
|
24
|
+
]
|
|
25
|
+
}
|
|
26
|
+
]
|
|
27
|
+
}
|
|
28
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@stdd/plugin",
|
|
3
|
+
"version": "0.9.0",
|
|
4
|
+
"description": "Universal STDD workflow skills and lifecycle integration for Codex, Claude Code, and Pi",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"license": "MIT",
|
|
7
|
+
"author": "Azamat Almazbek uulu",
|
|
8
|
+
"keywords": [
|
|
9
|
+
"stdd",
|
|
10
|
+
"pi-package",
|
|
11
|
+
"codex-plugin",
|
|
12
|
+
"claude-code-plugin"
|
|
13
|
+
],
|
|
14
|
+
"files": [
|
|
15
|
+
".codex-plugin/",
|
|
16
|
+
".claude-plugin/",
|
|
17
|
+
"extensions/",
|
|
18
|
+
"hooks/",
|
|
19
|
+
"scripts/",
|
|
20
|
+
"skills/",
|
|
21
|
+
"runtime/",
|
|
22
|
+
"README.md",
|
|
23
|
+
"LICENSE"
|
|
24
|
+
],
|
|
25
|
+
"pi": {
|
|
26
|
+
"skills": [
|
|
27
|
+
"./skills"
|
|
28
|
+
],
|
|
29
|
+
"extensions": [
|
|
30
|
+
"./extensions/stdd.mjs"
|
|
31
|
+
]
|
|
32
|
+
},
|
|
33
|
+
"repository": {
|
|
34
|
+
"type": "git",
|
|
35
|
+
"url": "git+https://github.com/vsem-azamat/stdd.git",
|
|
36
|
+
"directory": "plugins/stdd"
|
|
37
|
+
}
|
|
38
|
+
}
|
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
# Adapters
|
|
2
|
+
|
|
3
|
+
Playbooks are agent-neutral markdown with frontmatter (`name`, `description`,
|
|
4
|
+
`when`). Adapters compile them into what each agent consumes. `stdd init`
|
|
5
|
+
runs the adapters; re-run it after upgrading stdd to refresh the output.
|
|
6
|
+
|
|
7
|
+
## Common output
|
|
8
|
+
|
|
9
|
+
Every init installs `.stdd/` into the target repo:
|
|
10
|
+
|
|
11
|
+
```
|
|
12
|
+
.stdd/
|
|
13
|
+
├── method.md # the STDD contract plus the repository-policy preamble
|
|
14
|
+
├── playbooks/ # agent-neutral playbooks
|
|
15
|
+
├── config.json # stdd check configuration
|
|
16
|
+
└── manifest.json # generated-file hashes and stdd version
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
The generated method, playbooks, config, and manifest under `.stdd/` are
|
|
20
|
+
committed methodology. Per-checkout `.stdd/ledger.jsonl` and
|
|
21
|
+
`.stdd/plan.md` are working artifacts and stay ignored by default. The
|
|
22
|
+
user-owned `projectLog.enabled` policy is compiled into both the installed
|
|
23
|
+
method preamble and each agent's managed routing: enabled keeps the default
|
|
24
|
+
authority-aware retrieval rule; disabled explicitly forbids creating or
|
|
25
|
+
searching a project log.
|
|
26
|
+
|
|
27
|
+
A plain `init` does not add a package dependency or CI adapter. The universal
|
|
28
|
+
Codex/Claude/Pi bundle carries its own version-aligned lifecycle runtime, so an
|
|
29
|
+
adopting repository needs only `.stdd/` and no local `@stdd/cli`.
|
|
30
|
+
|
|
31
|
+
Install `@stdd/cli` as an exact project development dependency only when the
|
|
32
|
+
repository itself owns generated pre-push/session/stop hooks or imports the
|
|
33
|
+
JavaScript SDK. That generated automation uses `npm exec --offline
|
|
34
|
+
--package=@stdd/cli@<generated-version> -- stdd`, resolving the scoped package
|
|
35
|
+
offline and never falling back to an unscoped registry package. This
|
|
36
|
+
repository's own dogfood output runs its checked-out `cli/stdd.mjs` directly
|
|
37
|
+
through the git root, so testing an unpublished source version never depends
|
|
38
|
+
on npm cache state.
|
|
39
|
+
|
|
40
|
+
## claude (Claude Code)
|
|
41
|
+
|
|
42
|
+
Writes one skill per playbook to `.claude/skills/<name>/SKILL.md`:
|
|
43
|
+
frontmatter maps `name` directly; `description` carries the playbook's
|
|
44
|
+
description plus its `when:` line ("… Use when: …"), because the
|
|
45
|
+
description is the only always-visible routing surface — a trigger
|
|
46
|
+
condition that lives only in the body is invisible at the moment the
|
|
47
|
+
agent picks its next action. The body is the playbook body. Skills are
|
|
48
|
+
self-contained copies — regenerate, never hand-edit. A short managed block in
|
|
49
|
+
`CLAUDE.md` carries only always-on invariants and points to the method; its
|
|
50
|
+
generated source is `.stdd/CLAUDE-snippet.md`.
|
|
51
|
+
|
|
52
|
+
## codex
|
|
53
|
+
|
|
54
|
+
Writes the same skill contract to `.agents/skills/<name>/SKILL.md`. Codex can
|
|
55
|
+
select a skill from its description or the user can invoke it as `$<name>`.
|
|
56
|
+
The adapter also writes `.stdd/AGENTS-snippet.md` and maintains the repo's
|
|
57
|
+
`AGENTS.md` in place. The snippet is written between
|
|
58
|
+
`stdd:begin`/`stdd:end` marker comments; content outside the markers is never
|
|
59
|
+
touched. `AGENTS.md` is user-owned and never manifest-tracked.
|
|
60
|
+
|
|
61
|
+
## pi
|
|
62
|
+
|
|
63
|
+
Pi natively discovers the Agent Skills standard registry under
|
|
64
|
+
`.agents/skills/`, so its adapter deliberately shares those generated skill
|
|
65
|
+
files with Codex. Both hosts resolve the cross-CLI reviewer token to Claude and
|
|
66
|
+
therefore produce byte-identical skills; selecting both does not create a
|
|
67
|
+
duplicate registry. Pi exposes them as `/skill:<name>`.
|
|
68
|
+
|
|
69
|
+
Pi's always-on router is different and stays host-local:
|
|
70
|
+
`.pi/APPEND_SYSTEM.md` carries the managed STDD section with `/skill:` routing,
|
|
71
|
+
while `.stdd/PI-snippet.md` is its generated source. Using Pi's append-system
|
|
72
|
+
file avoids a last-writer-wins conflict with Codex's managed `AGENTS.md`
|
|
73
|
+
section.
|
|
74
|
+
|
|
75
|
+
## Lifecycle hooks
|
|
76
|
+
|
|
77
|
+
`--session-hook` and `--stop-hook` target every selected native agent:
|
|
78
|
+
|
|
79
|
+
- Claude: `.claude/settings.json`, with one `SessionStart` hook for
|
|
80
|
+
`startup|resume|clear|compact` and optional `Stop`;
|
|
81
|
+
- Codex: `.codex/hooks.json`, with one `SessionStart` hook for
|
|
82
|
+
`startup|resume|clear|compact` and optional `Stop`.
|
|
83
|
+
- Pi: `.pi/extensions/stdd.js`, with `session_start` plus `session_compact`
|
|
84
|
+
restore handlers and an optional `agent_settled` gate.
|
|
85
|
+
|
|
86
|
+
Session hooks run only `stdd status --local`. Stop hooks use an
|
|
87
|
+
agent-specific output protocol over the same `status --gate` judgment.
|
|
88
|
+
Generated hooks never contain the full method or perform network work. On
|
|
89
|
+
re-init, the `compact` source is the single context-restoration path: older
|
|
90
|
+
managed Claude `PostCompact` entries are removed, while unrelated user hooks
|
|
91
|
+
are preserved.
|
|
92
|
+
|
|
93
|
+
Pi does not expose a pre-stop veto. When its gate reports broken review claims,
|
|
94
|
+
the extension queues one corrective follow-up model turn and then fails open;
|
|
95
|
+
it never creates an unbounded continuation loop. A conflicting user-owned
|
|
96
|
+
`.pi/extensions/stdd.js` is not overwritten.
|
|
97
|
+
|
|
98
|
+
## CI
|
|
99
|
+
|
|
100
|
+
CI adapters only transport provider state into portable CLI commands:
|
|
101
|
+
|
|
102
|
+
- GitHub writes `.github/workflows/stdd.yml`;
|
|
103
|
+
- GitLab writes `.gitlab/stdd.gitlab-ci.yml`; same-project MRs authenticate
|
|
104
|
+
with `CI_JOB_TOKEN`, while a fork source project must be on the target's
|
|
105
|
+
CI job-token allowlist. A trusted controlled fork may instead provide a
|
|
106
|
+
masked and hidden `STDD_GITLAB_READ_API_TOKEN` scoped to target-project
|
|
107
|
+
`read_api`; target secrets must never be exposed to untrusted fork code;
|
|
108
|
+
- generic prints the `check` and `check-pr` command contract without writing
|
|
109
|
+
provider configuration.
|
|
110
|
+
|
|
111
|
+
The public SDK exposes the built-in adapter registry and render functions so
|
|
112
|
+
other packages can add a host without importing `cli/` internals.
|
|
113
|
+
`defineAgentAdapter()` returns an adapter object accepted directly by
|
|
114
|
+
`renderAgentInstructions()`; registration in the immutable built-in registry
|
|
115
|
+
is not required for third-party composition.
|
|
116
|
+
|
|
117
|
+
Host-dependent commands stay as renderer tokens in the shared playbook source.
|
|
118
|
+
When the `crossCli` block is active, the agent adapter resolves its reviewer
|
|
119
|
+
token to another native host: Claude skills name `--via codex`, while Codex
|
|
120
|
+
and Pi skills name `--via claude`. The first selected native host is the driver
|
|
121
|
+
for the repository-level `review.via` default, so a cross-CLI init records its
|
|
122
|
+
opposite; each host skill still names its own explicit override. A profile
|
|
123
|
+
without any dispatch route removes the `[review:]` tag and every review
|
|
124
|
+
command — it never substitutes a manual self-review.
|
|
125
|
+
|
|
126
|
+
The profile-agnostic universal bundle is built with the conservative default
|
|
127
|
+
capabilities (`subagents` on, `crossCli` off). Its planning skill names
|
|
128
|
+
`--via subagent`; it never names a cross-CLI reviewer, emits a renderer token,
|
|
129
|
+
or falls back to manual self-review.
|
|
130
|
+
|
|
131
|
+
## Plugin distribution
|
|
132
|
+
|
|
133
|
+
`plugins/stdd/` is one generated distribution for Codex, Claude Code, and Pi.
|
|
134
|
+
Codex and Claude Code consume host-native manifests and protocol-specific
|
|
135
|
+
command-hook metadata backed by one helper; Pi consumes the root package
|
|
136
|
+
manifest, shared skills, and a package extension. `scripts/build-plugin.mjs` regenerates skills from
|
|
137
|
+
`playbooks/`, the Pi lifecycle extension from its maintained source, and
|
|
138
|
+
runtime files from the CLI package's supported distribution surface. Generated
|
|
139
|
+
output is never an independent source.
|
|
140
|
+
|
|
141
|
+
Rebuild validates and version-aligns every host manifest, removes deleted or
|
|
142
|
+
renamed skills, repairs changed extension/runtime bytes, and rejects stale
|
|
143
|
+
extra output paths. Every lifecycle adapter acts only when it finds an adopting
|
|
144
|
+
repository with `.stdd/`, then calls the shared bundled runtime. No
|
|
145
|
+
repository-local npm package is required. Session failures report fixed
|
|
146
|
+
update-or-reinitialize guidance outside model context; Stop/gate failures stay
|
|
147
|
+
fail-open and never forward arbitrary child output.
|
|
148
|
+
|
|
149
|
+
## Design rules for adapters
|
|
150
|
+
|
|
151
|
+
- One source of truth: adapters copy or point, never fork playbook content.
|
|
152
|
+
- Always-on instructions contain invariants and routing only; detailed
|
|
153
|
+
workflows live in lazy skills.
|
|
154
|
+
- No agent-specific incantations inside `playbooks/` — if an agent needs
|
|
155
|
+
special framing, that framing lives in the adapter.
|
|
156
|
+
- Provider YAML owns transport, never method semantics.
|
|
157
|
+
- Calm imperative prose. No all-caps compliance shouting: if a rule needs
|
|
158
|
+
shouting to be followed, it needs a `stdd check` rule instead.
|