create-agdf 0.2.7 → 0.2.9

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.
@@ -6,12 +6,32 @@ SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
6
6
  META_DIR="$(cd "${SCRIPT_DIR}/../meta" && pwd)"
7
7
  ROUTER="${META_DIR}/agdf-agent-router.md"
8
8
  CONSTITUTION="${META_DIR}/agdf-constitution.md"
9
+ CONFIG_PATH="${PWD}/.agdf/control/config.json"
10
+
11
+ CONFIG_HINT="Project config: .agdf/control/config.json not found. Use npm create agdf@latest -- config --language de|en to persist the project language."
12
+ if [[ -f "${CONFIG_PATH}" ]]; then
13
+ CONFIG_HINT="$(CONFIG_PATH="${CONFIG_PATH}" node <<'NODE' 2>/dev/null || true
14
+ const fs = require("node:fs");
15
+ const path = process.env.CONFIG_PATH;
16
+ try {
17
+ const config = JSON.parse(fs.readFileSync(path, "utf8"));
18
+ const artefacts = config.artifact_language || "unset";
19
+ const chat = config.chat_language || "unset";
20
+ const runtime = config.runtime_language || "en";
21
+ console.log(`Project config: .agdf/control/config.json (artefacts=${artefacts}, chat=${chat}, runtime=${runtime}).`);
22
+ } catch {
23
+ console.log("Project config: .agdf/control/config.json exists but is not valid JSON. Run npm create agdf@latest -- doctor.");
24
+ }
25
+ NODE
26
+ )"
27
+ fi
9
28
 
10
29
  cat <<EOF
11
30
  AGDF active.
12
31
 
13
32
  Use the installed AGDF skills as workflow controls.
14
33
  For a new build, change, extension, refactor, CLI, app, fix with product semantics, unclear approval, or unclear next step, use gate-check before implementation or later-gate artefacts.
34
+ ${CONFIG_HINT}
15
35
 
16
36
  Do not print the full router or constitution unless the user asks for them.
17
37
  Source of truth:
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "schemaVersion": 1,
3
3
  "id": "agdf",
4
- "version": "0.2.7",
4
+ "version": "0.2.9",
5
5
  "displayName": "AI Governance & Delivery Framework",
6
6
  "developerName": "AI-native Governance & Delivery Framework",
7
7
  "description": "Codex-first workflow skills for gated, auditable AI-assisted software delivery.",
@@ -39,6 +39,16 @@
39
39
  "skillPrefix": "agdf-",
40
40
  "runtimeContractFileName": "agdf-runtime-contract.md"
41
41
  },
42
+ "opencode": {
43
+ "skillPrefix": "agdf-",
44
+ "runtimeContractFileName": "agdf-runtime-contract.md",
45
+ "instructionsFileName": "AGDF.md",
46
+ "npmPackage": "create-agdf",
47
+ "permissions": {
48
+ "edit": "ask",
49
+ "bash": "ask"
50
+ }
51
+ },
42
52
  "skillSet": [
43
53
  {
44
54
  "slug": "brownfield-analysis",
@@ -41,10 +41,10 @@ Use `init` only when the user explicitly asks for durable AGDF control state, th
41
41
  Use the executable control path when a machine-readable check is requested, when the gate state is ambiguous, when CI or PR evidence is needed, or when a repository-local automation needs JSON output:
42
42
 
43
43
  ```bash
44
- npm create agdf@latest init
45
- npm create agdf@latest doctor --json
46
- npm create agdf@latest gate-check --json
47
- npm create agdf@latest delivery-map --json
44
+ npm create agdf@latest -- init
45
+ npx --yes create-agdf@latest doctor --json
46
+ npx --yes create-agdf@latest gate-check --json
47
+ npx --yes create-agdf@latest delivery-map --json
48
48
  ```
49
49
 
50
50
  `init` creates the control scaffold. `doctor` checks whether `.agdf/control/` is actionable. `gate-check` consumes that result and `AGDF_RUN.md` to report the operative process decision: `open | blocked`, current gate, blocking reason, missing approval, allowed outputs, forbidden outputs, next allowed action and evidence references.
@@ -0,0 +1,33 @@
1
+ export const AGDFPlugin = async ({ directory, client }) => {
2
+ const controlDir = `${directory}/.agdf/control`;
3
+
4
+ return {
5
+ event: async ({ event }) => {
6
+ if (event?.type === "session.created") {
7
+ await client.app.log({
8
+ body: {
9
+ service: "agdf",
10
+ level: "info",
11
+ message: "AGDF OpenCode surface active",
12
+ extra: { controlDir },
13
+ },
14
+ });
15
+ }
16
+ },
17
+
18
+ "shell.env": async (_input, output) => {
19
+ output.env.AGDF_CONTROL_DIR = controlDir;
20
+ },
21
+
22
+ "experimental.session.compacting": async (_input, output) => {
23
+ output.context.push([
24
+ "## AGDF Runtime Reminder",
25
+ "Use `.opencode/AGDF.md`, `.opencode/agents/` and `.agdf/control/` as the AGDF source for this OpenCode session.",
26
+ "For new build/change intent or unclear approval, route first to `agdf-gate-check` before later artefacts or implementation.",
27
+ "Use `npx --yes create-agdf@latest gate-check --json` only as deterministic proof, not as a replacement for AGDF judgement.",
28
+ ].join("\n"));
29
+ },
30
+ };
31
+ };
32
+
33
+ export default AGDFPlugin;
package/package.json CHANGED
@@ -1,13 +1,19 @@
1
1
  {
2
2
  "name": "create-agdf",
3
- "version": "0.2.7",
4
- "description": "Bootstrap AGDF repository-local plugin files, Copilot instructions, skills, control files and machine-readable checks.",
3
+ "version": "0.2.9",
4
+ "description": "Bootstrap AGDF repository-local plugin files, Copilot/OpenCode instructions, skills, control files and machine-readable checks.",
5
5
  "type": "module",
6
6
  "files": [
7
7
  "bin",
8
8
  "generated",
9
- "README.md"
9
+ "opencode-plugin.js",
10
+ "README.md",
11
+ "NOTICE"
10
12
  ],
13
+ "exports": {
14
+ ".": "./opencode-plugin.js",
15
+ "./opencode-plugin": "./opencode-plugin.js"
16
+ },
11
17
  "bin": {
12
18
  "create-agdf": "./bin/create-agdf.js"
13
19
  },
@@ -22,6 +28,7 @@
22
28
  "copilot",
23
29
  "claude-code",
24
30
  "codex",
31
+ "opencode",
25
32
  "control",
26
33
  "scaffold",
27
34
  "bootstrap"