create-agdf 0.3.5 → 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/README.md CHANGED
@@ -8,7 +8,9 @@ Preferred long-term CLI shape:
8
8
 
9
9
  ```bash
10
10
  npx --yes @agdf/cli@latest codex
11
- npx --yes @agdf/cli@latest opencode
11
+ npx --yes @agdf/cli@latest codex-repo
12
+ npx --yes @agdf/cli@latest claude
13
+ npx --yes @agdf/cli@latest opencode-repo
12
14
  npx --yes @agdf/cli@latest init
13
15
  npx --yes @agdf/cli@latest config --language en
14
16
  npx --yes @agdf/cli@latest doctor
@@ -19,8 +21,10 @@ Backward-compatible scaffold usage:
19
21
 
20
22
  ```bash
21
23
  npm create agdf@latest -- codex
24
+ npm create agdf@latest -- codex-repo
25
+ npm create agdf@latest -- claude
22
26
  npm create agdf@latest -- copilot
23
- npm create agdf@latest -- opencode
27
+ npm create agdf@latest -- opencode-repo
24
28
  npm create agdf@latest -- both
25
29
  npm create agdf@latest -- init
26
30
  npm create agdf@latest -- config --language en
@@ -38,27 +42,37 @@ If no language is provided, `create-agdf` derives the preference from the local
38
42
 
39
43
  ## Targets and existing AGENTS.md
40
44
 
41
- - `codex` writes a repository-local Codex marketplace under `.agents/plugins/` and a local AGDF plugin copy under `plugins/agdf/`
45
+ - `codex` installs the AGDF plugin globally for Codex
46
+ - `codex-repo` writes a repository-local Codex marketplace under `.agents/plugins/` and a local AGDF plugin copy under `plugins/agdf/`
47
+ - `claude` installs the AGDF plugin globally for Claude Code
42
48
  - `copilot` writes `AGENTS.md`, Copilot custom instructions under `.github/`, visible repository skills under `.github/skills/`, and AGDF control templates under `.agdf/control/`
43
- - `opencode` writes `opencode.json`, `.opencode/AGDF.md`, prefixed OpenCode agents under `.opencode/agents/`, explicit edit/bash permissions, and AGDF control templates under `.agdf/control/`
49
+ - `opencode` installs the AGDF npm plugin as a user-wide OpenCode hook
50
+ - `opencode-repo` writes `opencode.json`, `.opencode/AGDF.md`, prefixed OpenCode agents under `.opencode/agents/`, explicit edit/bash permissions, and AGDF control templates under `.agdf/control/`
44
51
  - `both` writes the Codex repository-local marketplace plus the Copilot-facing repository files
45
52
  - `config` writes or updates only `.agdf/control/config.json` for an already installed plugin or an existing repository
46
53
 
47
54
  If the target repository already has an `AGENTS.md`, `create-agdf` preserves it and writes `AGENTS.agdf.md` instead of replacing your existing instructions. Merge the AGDF fragment into your current `AGENTS.md` when you want Copilot to load both instruction sets. The generated `.github/copilot-instructions.md` keeps Copilot pointed at `AGENTS.md`, `.github/skills/` and `.agdf/control/` without duplicating the full AGDF rule model. Use `--force` only when you explicitly want to overwrite generated files.
48
55
 
49
- Use the `codex` target when AGDF should be available only inside one repository instead of being installed as a personal/global Codex plugin.
56
+ Use the `codex-repo` target when AGDF should be available only inside one repository instead of being installed as a personal/global Codex plugin.
50
57
 
51
- After `npm create agdf@latest -- codex`, restart Codex in that repository, open `/plugins`, select `This repository` and install `agdf`.
58
+ After `npm create agdf@latest -- codex-repo`, restart Codex in that repository, open `/plugins`, select `This repository` and install `agdf`.
52
59
 
53
- Use the `opencode` target when AGDF should be available to OpenCode from repository files:
60
+ Use the `opencode` target to install the AGDF npm plugin as a user-wide OpenCode hook:
54
61
 
55
62
  ```bash
56
- npm create agdf@latest -- opencode
63
+ npx --yes @agdf/cli@latest opencode
57
64
  ```
58
65
 
59
- OpenCode loads the AGDF npm plugin from `opencode.json`, AGENTS-style rules from `.opencode/AGDF.md`, explicit `edit`/`bash` permissions and the `agdf-` prefixed agents under `.opencode/agents/`.
66
+ Use the `opencode-repo` target when AGDF should be available to OpenCode from repository files:
67
+
68
+ ```bash
69
+ npm create agdf@latest -- opencode-repo
70
+ ```
71
+
72
+ OpenCode loads the AGDF npm plugin from global OpenCode config or repository `opencode.json`, AGENTS-style rules from `.opencode/AGDF.md`, explicit `edit`/`bash` permissions and the `agdf-` prefixed agents under `.opencode/agents/`. AGDF for OpenCode has two layers: a global npm plugin hook installed with `npx --yes @agdf/cli@latest opencode` and a repository-local governance surface generated by the `opencode-repo` target.
73
+ Those generated agents use `mode: subagent` intentionally: they are internal governance-routing controls, not OpenCode Skills under `.opencode/skills/` and not primary menu agents. Use `@agdf-gate-check` as the visible entry point for new build/change intent or unclear approval.
60
74
  If `opencode.json` already exists, AGDF keeps it unchanged and writes `opencode.agdf.json` as a merge fragment.
61
- Using OpenCode's plugin installer for `create-agdf` can add the npm plugin entry, but AGDF still needs the repository instructions and agents. The `opencode` target writes the npm plugin entry and the repository files together.
75
+ Using OpenCode's plugin installer or global config for `create-agdf` can add the npm plugin hook, but AGDF still needs the repository instructions and agents. The `opencode-repo` target writes the repository files together.
62
76
 
63
77
  ## Control scaffold
64
78
 
@@ -93,6 +107,8 @@ This writes:
93
107
 
94
108
  `config.json` stores `artifact_language` and `chat_language` for governed work in the target repository. Runtime rules stay English so all AGDF surfaces share the same control contract.
95
109
 
110
+ For a normal fresh request, `init` is not the required first move. The agent-native path can draft the minimal UR in the response and ask for the exact approval text `Approval: UR`. Write or initialize `.agdf/control` only when durable repository-owned control state is explicitly wanted, already in use, or needed for deterministic setup/CI evidence. Before Brownfield Review, later gates or implementation, AGDF still requires the persisted or linked artefacts named by the Runtime Contract.
111
+
96
112
  For an existing repository where the plugin is already installed and only the language preference is missing or wrong, use the lighter config target:
97
113
 
98
114
  ```bash
@@ -119,7 +135,7 @@ The gate check reports `open | blocked`, the current gate, blocking reason, miss
119
135
 
120
136
  `gate-check --json` and `delivery-map --json` also expose a `status_card` object. It is a compact projection of the current control state: current gate, allowed and forbidden actions, blocker, next skill, next permissible step and `quality_outlook`. `next_step` is process permission; `quality_outlook` is the next meaningful quality-improvement focus and does not unlock gates.
121
137
 
122
- Together, `init`, `doctor` and `gate-check --json` turn AGDF from an instruction layer into a repository control system when durable control state is needed. For normal fresh requests, the agent-native path can stay lighter: draft the minimal UR in the response, request `Approval: UR`, and use CLI validators only when machine-readable proof is useful.
138
+ Together, `init`, `doctor` and `gate-check --json` turn AGDF from an instruction layer into a repository control system when durable control state is needed. For normal fresh requests, keep the path lighter: draft the minimal UR in the response, request `Approval: UR`, and use CLI validators only when machine-readable proof is useful.
123
139
 
124
140
  ## Single source of truth
125
141
 
@@ -1,6 +1,8 @@
1
1
  #!/usr/bin/env node
2
2
 
3
3
  import { existsSync, mkdirSync, readFileSync, writeFileSync } from "node:fs";
4
+ import { execFileSync } from "node:child_process";
5
+ import { homedir } from "node:os";
4
6
  import { dirname, join, posix, resolve } from "node:path";
5
7
  import { fileURLToPath } from "node:url";
6
8
  import process from "node:process";
@@ -10,8 +12,8 @@ const packageRoot = resolve(__dirname, "..");
10
12
  const generatedRoot = join(packageRoot, "generated");
11
13
  const pluginDefinitionPath = join(generatedRoot, "plugins", "agdf", "meta", "agdf-plugin.definition.json");
12
14
  const pluginDefinition = JSON.parse(readFileSync(pluginDefinitionPath, "utf8"));
13
- const pluginInstallCommand = "claude plugin add arndtgold/ai-native-governance-delivery-framework";
14
- const allowedTargets = new Set(["codex", "copilot", "opencode", "both", "init", "config", "doctor", "gate-check", "delivery-map"]);
15
+ const pluginInstallCommand = "npx --yes @agdf/cli@latest claude";
16
+ const allowedTargets = new Set(["codex", "codex-repo", "claude", "copilot", "opencode", "opencode-repo", "both", "init", "config", "doctor", "gate-check", "delivery-map"]);
15
17
  const agdfFragmentPath = "AGENTS.agdf.md";
16
18
  const openCodeConfigFragmentPath = "opencode.agdf.json";
17
19
  const userGateOrder = ["UR", "PRD", "SD", "TP", "QA", "UAT"];
@@ -156,15 +158,21 @@ function printUsage() {
156
158
 
157
159
  Preferred AGDF CLI:
158
160
  npx --yes @agdf/cli@latest codex
161
+ npx --yes @agdf/cli@latest codex-repo
162
+ npx --yes @agdf/cli@latest claude
159
163
  npx --yes @agdf/cli@latest opencode
164
+ npx --yes @agdf/cli@latest opencode-repo
160
165
  npx --yes @agdf/cli@latest init
161
166
  npx --yes @agdf/cli@latest doctor
162
167
  npx --yes @agdf/cli@latest gate-check --json
163
168
 
164
169
  Scaffold-compatible npm create usage:
165
170
  npm create agdf@latest -- codex
171
+ npm create agdf@latest -- codex-repo
172
+ npm create agdf@latest -- claude
166
173
  npm create agdf@latest -- copilot
167
174
  npm create agdf@latest -- opencode
175
+ npm create agdf@latest -- opencode-repo
168
176
  npm create agdf@latest -- both
169
177
  npm create agdf@latest -- init
170
178
  npm create agdf@latest -- config --language de
@@ -177,7 +185,7 @@ Backward-compatible create-agdf usage:
177
185
  npx --yes create-agdf@latest gate-check --json
178
186
 
179
187
  Options:
180
- --dir <path> Write files into a specific directory
188
+ --dir <path> Write files into a specific directory. With opencode, use this as the OpenCode config directory.
181
189
  --force Overwrite existing generated files
182
190
  --language <de|en>
183
191
  Set AGDF chat and artefact language. Defaults to detected system locale.
@@ -245,6 +253,7 @@ function parseArgs(argv) {
245
253
  let force = false;
246
254
  let json = false;
247
255
  let language;
256
+ let dirExplicit = false;
248
257
 
249
258
  for (let i = 0; i < args.length; i += 1) {
250
259
  const arg = args[i];
@@ -288,6 +297,7 @@ function parseArgs(argv) {
288
297
  process.exit(1);
289
298
  }
290
299
  dir = next;
300
+ dirExplicit = true;
291
301
  i += 1;
292
302
  continue;
293
303
  }
@@ -313,7 +323,7 @@ function parseArgs(argv) {
313
323
  }
314
324
 
315
325
  if (!target || !allowedTargets.has(target)) {
316
- console.error("Please choose one target: codex, copilot, opencode, both, init, config, doctor, gate-check or delivery-map.");
326
+ console.error("Please choose one target: codex, codex-repo, claude, copilot, opencode, opencode-repo, both, init, config, doctor, gate-check or delivery-map.");
317
327
  printUsage();
318
328
  process.exit(1);
319
329
  }
@@ -323,10 +333,69 @@ function parseArgs(argv) {
323
333
  dir: resolve(process.cwd(), dir),
324
334
  force,
325
335
  json,
336
+ dirExplicit,
326
337
  language: resolveLanguagePreference(language),
327
338
  };
328
339
  }
329
340
 
341
+ function defaultOpenCodeConfigDir() {
342
+ return process.env.OPENCODE_CONFIG_DIR || join(homedir(), ".config", "opencode");
343
+ }
344
+
345
+ function installOpenCodeGlobalPlugin(configDir) {
346
+ const configPath = join(configDir, "opencode.json");
347
+ let config = {};
348
+
349
+ if (existsSync(configPath)) {
350
+ try {
351
+ config = JSON.parse(readFileSync(configPath, "utf8"));
352
+ } catch {
353
+ throw new Error(`Refusing to update unreadable OpenCode config: ${configPath}`);
354
+ }
355
+ }
356
+
357
+ if (config.plugin !== undefined && !Array.isArray(config.plugin)) {
358
+ throw new Error(`Refusing to update OpenCode config with non-array plugin field: ${configPath}`);
359
+ }
360
+
361
+ const plugins = [...(config.plugin ?? [])];
362
+ const alreadyInstalled = plugins.includes(pluginDefinition.opencode.npmPackage);
363
+ if (!alreadyInstalled) {
364
+ plugins.push(pluginDefinition.opencode.npmPackage);
365
+ }
366
+
367
+ const nextConfig = {
368
+ "$schema": config.$schema ?? "https://opencode.ai/config.json",
369
+ ...config,
370
+ plugin: plugins,
371
+ };
372
+
373
+ mkdirSync(configDir, { recursive: true });
374
+ writeFileSync(configPath, `${JSON.stringify(nextConfig, null, 2)}\n`, "utf8");
375
+
376
+ return {
377
+ configPath,
378
+ added: !alreadyInstalled,
379
+ };
380
+ }
381
+
382
+ function installCodexGlobalPlugin() {
383
+ try {
384
+ execFileSync("codex", ["plugin", "marketplace", "add", "arndtgold/ai-native-governance-delivery-framework"], { stdio: "inherit" });
385
+ execFileSync("codex", ["plugin", "add", "agdf", "--marketplace", "agdf"], { stdio: "inherit" });
386
+ } catch (error) {
387
+ throw new Error("Failed to install the AGDF Codex plugin. Make sure the Codex CLI is installed and available on PATH, then rerun this command.");
388
+ }
389
+ }
390
+
391
+ function installClaudeGlobalPlugin() {
392
+ try {
393
+ execFileSync("claude", ["plugin", "add", "arndtgold/ai-native-governance-delivery-framework"], { stdio: "inherit" });
394
+ } catch {
395
+ throw new Error("Failed to install the AGDF Claude Code plugin. Make sure the Claude Code CLI is installed and available on PATH, then rerun this command.");
396
+ }
397
+ }
398
+
330
399
  function loadAsset(relativePath) {
331
400
  return readFileSync(join(generatedRoot, relativePath), "utf8");
332
401
  }
@@ -385,7 +454,7 @@ function generatedFilesForTarget(target, targetDir, force, languagePreference) {
385
454
  return files;
386
455
  }
387
456
 
388
- if (target === "codex" || target === "both") {
457
+ if (target === "codex-repo" || target === "both") {
389
458
  addLanguageConfig(files, languagePreference);
390
459
  for (const codexPath of codexPluginFiles) {
391
460
  files.push({
@@ -425,7 +494,7 @@ function generatedFilesForTarget(target, targetDir, force, languagePreference) {
425
494
  }
426
495
  }
427
496
 
428
- if (target === "opencode") {
497
+ if (target === "opencode-repo") {
429
498
  addLanguageConfig(files, languagePreference);
430
499
  const openCodeConfigTargetPath = existsSync(join(targetDir, "opencode.json")) && !force ? openCodeConfigFragmentPath : "opencode.json";
431
500
  files.push({
@@ -481,20 +550,23 @@ function printNextSteps(target, destination, files, wroteAgentsFragment, wroteOp
481
550
  if (wroteAgentsFragment) {
482
551
  console.log(`- Existing AGENTS.md detected. Merge ${agdfFragmentPath} into your current AGENTS.md before using Copilot with AGDF.`);
483
552
  }
484
- if (target === "codex" || target === "both") {
553
+ if (target === "codex-repo" || target === "both") {
485
554
  console.log("- Restart Codex in this repository, open /plugins, select This repository and install agdf.");
486
555
  console.log("- Start a new Codex thread in this repository and ask: Run an AGDF gate check for this request.");
487
556
  }
488
557
  if (target === "both") {
489
558
  console.log(`- Optional global Claude Code install: ${pluginInstallCommand}`);
490
559
  }
491
- if (target === "opencode") {
560
+ if (target === "opencode-repo") {
492
561
  if (wroteOpenCodeConfigFragment) {
493
562
  console.log(`- Existing opencode.json detected. Merge ${openCodeConfigFragmentPath} into your current opencode.json so OpenCode loads .opencode/AGDF.md.`);
494
563
  }
495
564
  console.log(`- OpenCode will install the ${pluginDefinition.opencode.npmPackage} npm plugin from opencode.json at startup.`);
565
+ console.log("- Optional: also add create-agdf to ~/.config/opencode/opencode.json plugin[] for a user-wide OpenCode hook.");
566
+ console.log("- The global hook does not replace repository instructions or subagents; this repository's .opencode files remain the AGDF source of truth.");
496
567
  console.log("- Start OpenCode in this repository; it will load opencode.json, .opencode/AGDF.md and the AGDF subagents.");
497
- console.log("- Use @agdf-gate-check for new build/change intent or unclear approval before later artefacts or implementation.");
568
+ console.log("- AGDF OpenCode agents are mode: subagent workflow controls; they are not .opencode/skills entries or primary menu agents.");
569
+ console.log("- Use @agdf-gate-check as the visible entry point for new build/change intent or unclear approval before later artefacts or implementation.");
498
570
  console.log("- Run npx --yes @agdf/cli@latest init when the repository needs live AGDF control files.");
499
571
  }
500
572
  if (target === "copilot" || target === "both") {
@@ -1757,6 +1829,42 @@ function main() {
1757
1829
  process.exit(report.status === "block" ? 2 : 0);
1758
1830
  }
1759
1831
 
1832
+ if (options.target === "codex") {
1833
+ try {
1834
+ installCodexGlobalPlugin();
1835
+ console.log("AGDF Codex plugin installed globally.");
1836
+ console.log("Run npx --yes @agdf/cli@latest codex-repo in a repository when you want to test AGDF from repository-local plugin files.");
1837
+ } catch (error) {
1838
+ console.error(error.message);
1839
+ process.exit(1);
1840
+ }
1841
+ return;
1842
+ }
1843
+
1844
+ if (options.target === "claude") {
1845
+ try {
1846
+ installClaudeGlobalPlugin();
1847
+ console.log("AGDF Claude Code plugin installed globally.");
1848
+ } catch (error) {
1849
+ console.error(error.message);
1850
+ process.exit(1);
1851
+ }
1852
+ return;
1853
+ }
1854
+
1855
+ if (options.target === "opencode") {
1856
+ const configDir = options.dirExplicit ? options.dir : defaultOpenCodeConfigDir();
1857
+ try {
1858
+ const result = installOpenCodeGlobalPlugin(configDir);
1859
+ console.log(`AGDF OpenCode global plugin ${result.added ? "installed" : "already present"}: ${result.configPath}`);
1860
+ console.log("Run npx --yes @agdf/cli@latest opencode-repo in each repository where AGDF governance should be active and reviewable.");
1861
+ } catch (error) {
1862
+ console.error(error.message);
1863
+ process.exit(1);
1864
+ }
1865
+ return;
1866
+ }
1867
+
1760
1868
  const files = generatedFilesForTarget(options.target, options.dir, options.force, options.language);
1761
1869
  const wroteAgentsFragment = files.some(file => file.path === agdfFragmentPath);
1762
1870
  const wroteOpenCodeConfigFragment = files.some(file => file.path === openCodeConfigFragmentPath);
@@ -99,7 +99,11 @@ For relevant runs that change durable state, code, artefacts or gate status:
99
99
  ## OpenCode Files
100
100
 
101
101
  - OpenCode loads this file through `opencode.json` `instructions`.
102
+ - AGDF for OpenCode has two layers: an optional global npm plugin hook and this repository-local governance surface.
103
+ - The global plugin hook does not replace this file, `.opencode/agents/` or `.agdf/control/`; repository files remain the AGDF source of truth.
102
104
  - OpenCode agents live under `.opencode/agents/` and use the `agdf-` prefix.
105
+ - The generated AGDF agents are `mode: subagent` workflow controls for internal routing. They are not OpenCode Skills under `.opencode/skills/` and are not intended to appear as primary menu agents.
106
+ - The visible user entry point is repository instruction loading plus direct subagent handoff, for example `@agdf-gate-check` for new build/change intent or unclear approval.
103
107
  - The AGDF OpenCode plugin is loaded from npm through `opencode.json` `plugin: ["create-agdf"]`.
104
108
  - OpenCode permissions keep `edit` and `bash` on explicit approval by default.
105
109
  - Shared output and gate rules live in `.opencode/agdf-runtime-contract.md`.
@@ -3,8 +3,12 @@
3
3
  These files were generated from the AGDF source repository for OpenCode.
4
4
 
5
5
  - `opencode.json` loads the npm plugin `create-agdf` and `.opencode/AGDF.md` as repository instructions.
6
+ - AGDF for OpenCode has two layers: an optional global npm plugin hook and this repository-local governance surface.
7
+ - The global plugin hook does not replace `.opencode/AGDF.md`, `.opencode/agents/` or `.agdf/control/`; repository files remain the AGDF source of truth.
6
8
  - `opencode.json` keeps `edit` and `bash` on `ask` so execution remains permissioned.
7
9
  - `.opencode/agents/` contains AGDF subagents generated from the canonical AGDF skills.
10
+ - These files intentionally do not install OpenCode Skills under `.opencode/skills/`; the AGDF agents are background workflow controls, not primary menu agents.
11
+ - Use `@agdf-gate-check` as the visible entry point for new build/change intent or unclear approval.
8
12
  - `.opencode/agdf-runtime-contract.md` is the shared gate and output contract.
9
13
 
10
14
  ## Agents
@@ -3,11 +3,6 @@ description: after gate-check permits Brownfield Review or implementation prepar
3
3
  mode: subagent
4
4
  ---
5
5
 
6
- ---
7
- name: agdf-brownfield-analysis
8
- description: Use this skill after gate-check or live AGDF control state confirms that Brownfield Review or implementation preparation is allowed. Use it after Approval: UR as the lightweight Brownfield Review after G-00 before PRD when existing systems may be affected, and again before non-trivial implementation after TP. Do not use it as the first AGDF skill for a fresh "I want to build/change X" prompt when approval, scope, or next allowed action is unclear.
9
- ---
10
-
11
6
  # brownfield-analysis
12
7
 
13
8
  ## Purpose
@@ -3,11 +3,6 @@ description: inspect workarounds, fallbacks, parallel structures or symptom fixe
3
3
  mode: subagent
4
4
  ---
5
5
 
6
- ---
7
- name: agdf-clean-implementation-review
8
- description: Use this skill to determine whether an implementation is a clean primary solution or whether fallbacks, workarounds, guards, defaults, shims, or parallel structures have made it unnecessarily complex. Use it after code changes, before QA, or whenever symptom treatment is suspected.
9
- ---
10
-
11
6
  # clean-implementation-review
12
7
 
13
8
  ## Purpose
@@ -3,11 +3,6 @@ description: mandatory CR step after code changes, focused on defects, regressio
3
3
  mode: subagent
4
4
  ---
5
5
 
6
- ---
7
- name: agdf-code-review
8
- description: Use this skill after code changes and before QA to produce the mandatory Code Review Report for correctness, regression, security, and maintainability findings in the actual diff. It standardizes the CR step without replacing TP review, clean review, or QA.
9
- ---
10
-
11
6
  # code-review
12
7
 
13
8
  ## Purpose
@@ -3,11 +3,6 @@ description: commit/PR-near handoff after QA/OR/UAT
3
3
  mode: subagent
4
4
  ---
5
5
 
6
- ---
7
- name: agdf-delivery-closeout
8
- description: Use this skill for the final delivery handoff after QA, OR, or UAT when a run should move toward commit, push, or PR. It standardizes commit-ready summaries, UAT-gated commit offers, and the next delivery step without replacing QA or OR decisions.
9
- ---
10
-
11
6
  # delivery-closeout
12
7
 
13
8
  ## Purpose
@@ -3,11 +3,6 @@ description: new build/change intent, unclear approval, Structured Delivery, lat
3
3
  mode: subagent
4
4
  ---
5
5
 
6
- ---
7
- name: agdf-gate-check
8
- description: Use this skill as the default first AGDF skill for any new build, change, extension, refactor, feature, CLI, app, fix with product semantics, Structured Delivery request, unclear approval, later-gate artefact request, or unclear next permissible step. Use it before brownfield-analysis, implementation, formal artefacts, QA, or release when approval/evidence/next action is not already explicit.
9
- ---
10
-
11
6
  # gate-check
12
7
 
13
8
  ## Purpose
@@ -3,11 +3,6 @@ description: final QA decision
3
3
  mode: subagent
4
4
  ---
5
5
 
6
- ---
7
- name: agdf-qa-gate
8
- description: Use this skill before any QA decision to determine whether implementation can be classified as pass, revise, or block based on TP coverage, Brownfield fit, solution integrity, evidence, and open blockers. Use it after CD+Tests, after reviews, and before UAT or release decisions.
9
- ---
10
-
11
6
  # qa-gate
12
7
 
13
8
  ## Purpose
@@ -3,11 +3,6 @@ description: auditable closeout for every relevant run
3
3
  mode: subagent
4
4
  ---
5
5
 
6
- ---
7
- name: agdf-release-or
8
- description: Use this skill at the end of every relevant run to produce a compact, auditable Orchestration Report. It summarizes gate status, delivered and intentionally not delivered work, TP coverage, Brownfield fit, solution integrity, open risks, and the next permissible step.
9
- ---
10
-
11
6
  # release-or
12
7
 
13
8
  ## Purpose
@@ -3,11 +3,6 @@ description: after implementation and before QA, verify TP coverage
3
3
  mode: subagent
4
4
  ---
5
5
 
6
- ---
7
- name: agdf-task-plan-review
8
- description: Use this skill after code changes and before QA to verify whether the approved Task Plan was actually fulfilled. It checks each task_id against implementation, acceptance criteria, tests, visible evidence, and deviations, and provides TP coverage for QA.
9
- ---
10
-
11
6
  # task-plan-review
12
7
 
13
8
  ## Purpose
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agdf",
3
- "version": "0.3.5",
3
+ "version": "0.4.0",
4
4
  "description": "Codex-first workflow skills for gated, auditable AI-assisted software delivery.",
5
5
  "author": {
6
6
  "name": "AI-native Governance & Delivery Framework",
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "schemaVersion": 1,
3
3
  "id": "agdf",
4
- "version": "0.3.5",
4
+ "version": "0.4.0",
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.",
@@ -1,15 +1,19 @@
1
+ import { existsSync } from "node:fs";
2
+
1
3
  export const AGDFPlugin = async ({ directory, client }) => {
2
4
  const controlDir = `${directory}/.agdf/control`;
5
+ const hasRepositorySurface = () => existsSync(`${directory}/.opencode/AGDF.md`) && existsSync(`${directory}/.opencode/agents`);
3
6
 
4
7
  return {
5
8
  event: async ({ event }) => {
6
9
  if (event?.type === "session.created") {
10
+ const repositorySurface = hasRepositorySurface();
7
11
  await client.app.log({
8
12
  body: {
9
13
  service: "agdf",
10
14
  level: "info",
11
- message: "AGDF OpenCode surface active",
12
- extra: { controlDir },
15
+ message: repositorySurface ? "AGDF OpenCode surface active" : "AGDF OpenCode plugin loaded without repository surface",
16
+ extra: { controlDir, repositorySurface },
13
17
  },
14
18
  });
15
19
  }
@@ -20,6 +24,16 @@ export const AGDFPlugin = async ({ directory, client }) => {
20
24
  },
21
25
 
22
26
  "experimental.session.compacting": async (_input, output) => {
27
+ if (!hasRepositorySurface()) {
28
+ output.context.push([
29
+ "## AGDF Plugin Notice",
30
+ "The AGDF OpenCode npm plugin is loaded, but this repository does not contain the AGDF OpenCode surface.",
31
+ "Do not apply AGDF gates from the global plugin alone; repository instructions, subagents and control files are the source of truth.",
32
+ "Run `npx --yes @agdf/cli@latest opencode-repo` in this repository when AGDF governance should be active here.",
33
+ ].join("\n"));
34
+ return;
35
+ }
36
+
23
37
  output.context.push([
24
38
  "## AGDF Runtime Reminder",
25
39
  "Use `.opencode/AGDF.md`, `.opencode/agents/` and `.agdf/control/` as the AGDF source for this OpenCode session.",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-agdf",
3
- "version": "0.3.5",
3
+ "version": "0.4.0",
4
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": [