create-agdf 0.6.7 → 0.6.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.
package/README.md CHANGED
@@ -51,9 +51,9 @@ If no language is provided, `create-agdf` derives the preference from the local
51
51
  - `codex-repo` writes a repository-local Codex marketplace under `.agents/plugins/` and a local AGDF plugin copy under `plugins/agdf/`
52
52
  - `claude` installs the AGDF plugin globally for Claude Code
53
53
  - `copilot` writes `AGENTS.md`, Copilot custom instructions under `.github/`, visible repository skills under `.github/skills/`, and AGDF control templates under `.agdf/control/`
54
- - `opencode` installs the AGDF npm plugin as a user-wide OpenCode hook
55
- - `opencode-status` reports OpenCode global config, package loadability, session signals and repository surface presence
56
- - `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/`
54
+ - `opencode` installs the AGDF npm plugin and nine native skills as a user-wide OpenCode surface
55
+ - `opencode-status` reports OpenCode global config, package loadability, global native-skill completeness, session signals and repository surface presence
56
+ - `opencode-repo` writes `opencode.json`, `.opencode/AGDF.md`, prefixed native OpenCode skills under `.opencode/skills/`, explicit edit/bash/skill permissions, and AGDF control templates under `.agdf/control/`
57
57
  - `both` writes the Codex repository-local marketplace plus the Copilot-facing repository files
58
58
  - `config` writes or updates only `.agdf/control/config.json` for an already installed plugin or an existing repository
59
59
 
@@ -75,7 +75,8 @@ Then verify the visible installation state:
75
75
  npx --yes @agdf/cli@latest opencode-status --json
76
76
  ```
77
77
 
78
- The status command reports global configuration, whether `create-agdf` is loadable from the OpenCode config directory, whether the current process exposes AGDF session signals, and whether the current repository has `.opencode/AGDF.md` plus the `agdf-gate-check` surface. It does not infer an active OpenCode session from config alone.
78
+ The status command reports global configuration, package loadability, global native-skill completeness, session signals and whether the current repository has `.opencode/AGDF.md` plus the `agdf-gate-check` surface. It does not infer an active OpenCode session from config alone.
79
+ In JSON schema version 1, `repository_surface.gate_check_agent` remains a deprecated compatibility alias for the native `gate_check_skill` path so existing status consumers keep working during the agent-to-skill migration.
79
80
 
80
81
  Use the `opencode-repo` target when AGDF should be available to OpenCode from repository files:
81
82
 
@@ -83,10 +84,10 @@ Use the `opencode-repo` target when AGDF should be available to OpenCode from re
83
84
  npm create agdf@latest -- opencode-repo
84
85
  ```
85
86
 
86
- 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.
87
- 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.
87
+ OpenCode loads the AGDF npm plugin and global native skills from global OpenCode config, plus repository instructions from `.opencode/AGDF.md`, explicit `edit`/`bash`/`skill` permissions and canonical `agdf-` project skills under `.opencode/skills/`. Global adapters use the collision-safe `agdf-global-` prefix. AGDF for OpenCode has a global discoverability layer installed with `npx --yes @agdf/cli@latest opencode` and a repository-local governance surface generated by `opencode-repo`.
88
+ Those generated skills load on demand through OpenCode's native `skill` tool. Use `agdf-gate-check` first for new build/change intent or unclear approval.
88
89
  If `opencode.json` already exists, AGDF keeps it unchanged and writes `opencode.agdf.json` as a merge fragment.
89
- 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.
90
+ The global layer makes the nine native AGDF skills discoverable, but does not activate repository governance by itself. Global skills fail closed until the current repository has `.opencode/AGDF.md`, `.opencode/skills/agdf-gate-check/SKILL.md` and `.agdf/control/`. Use `opencode-repo` to write that repository surface.
90
91
 
91
92
  ## Control scaffold
92
93
 
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env node
2
2
 
3
- import { existsSync, mkdirSync, readFileSync, writeFileSync } from "node:fs";
3
+ import { existsSync, mkdirSync, readFileSync, readdirSync, rmSync, writeFileSync } from "node:fs";
4
4
  import { execFileSync } from "node:child_process";
5
5
  import { homedir } from "node:os";
6
6
  import { dirname, join, posix, resolve } from "node:path";
@@ -80,6 +80,10 @@ const gateProgressOrder = [
80
80
  const codexSkillNames = pluginDefinition.skillSet.map((skill) => `${pluginDefinition.codex.skillPrefix}${skill.slug}`);
81
81
  const copilotSkillNames = pluginDefinition.skillSet.map((skill) => `${pluginDefinition.copilot.skillPrefix}${skill.slug}`);
82
82
  const openCodeSkillNames = pluginDefinition.skillSet.map((skill) => `${pluginDefinition.opencode.skillPrefix}${skill.slug}`);
83
+ const globalOpenCodeSkillNames = pluginDefinition.skillSet.map((skill) => `${pluginDefinition.opencode.globalSkillPrefix}${skill.slug}`);
84
+ const globalOpenCodeSkillOwnershipMarker = "<!-- AGDF-GLOBAL-SKILL: ";
85
+ const globalOpenCodeInstructionsOwnershipMarker = "<!-- AGDF-GLOBAL-INSTRUCTIONS -->";
86
+ const globalOpenCodeRuntimeContractOwnershipMarker = "<!-- AGDF-GLOBAL-RUNTIME-CONTRACT -->";
83
87
  const codexPluginFiles = [
84
88
  join(".agents", "plugins", "marketplace.json"),
85
89
  join("plugins", "agdf", ".codex-plugin", "plugin.json"),
@@ -173,7 +177,7 @@ const openCodeFiles = [
173
177
  join(".opencode", pluginDefinition.opencode.instructionsFileName),
174
178
  join(".opencode", "README.md"),
175
179
  join(".opencode", pluginDefinition.opencode.runtimeContractFileName),
176
- ...openCodeSkillNames.map((skillName) => join(".opencode", "agents", `${skillName}.md`)),
180
+ ...openCodeSkillNames.map((skillName) => join(".opencode", "skills", skillName, "SKILL.md")),
177
181
  ];
178
182
 
179
183
  function printUsage() {
@@ -476,6 +480,7 @@ function defaultOpenCodeConfigDir() {
476
480
  }
477
481
 
478
482
  function installOpenCodeGlobalPlugin(configDir) {
483
+ assertGlobalOpenCodeSurfaceWritable(configDir);
479
484
  const configPath = join(configDir, "opencode.json");
480
485
  let config = {};
481
486
 
@@ -503,6 +508,24 @@ function installOpenCodeGlobalPlugin(configDir) {
503
508
  plugin: plugins,
504
509
  };
505
510
 
511
+ if (nextConfig.instructions !== undefined && !Array.isArray(nextConfig.instructions)) {
512
+ throw new Error(`Refusing to update OpenCode config with non-array instructions field: ${configPath}`);
513
+ }
514
+ nextConfig.instructions = [...(nextConfig.instructions ?? [])];
515
+ if (!nextConfig.instructions.includes("AGDF.md")) nextConfig.instructions.push("AGDF.md");
516
+
517
+ if (nextConfig.permission === undefined) {
518
+ nextConfig.permission = { skill: { "agdf-*": "allow" } };
519
+ } else if (nextConfig.permission && typeof nextConfig.permission === "object" && !Array.isArray(nextConfig.permission)) {
520
+ nextConfig.permission = { ...nextConfig.permission };
521
+ if (nextConfig.permission.skill === undefined) {
522
+ nextConfig.permission.skill = { "agdf-*": "allow" };
523
+ } else if (nextConfig.permission.skill && typeof nextConfig.permission.skill === "object" && !Array.isArray(nextConfig.permission.skill)) {
524
+ nextConfig.permission.skill = { ...nextConfig.permission.skill };
525
+ if (nextConfig.permission.skill["agdf-*"] === undefined) nextConfig.permission.skill["agdf-*"] = "allow";
526
+ }
527
+ }
528
+
506
529
  mkdirSync(configDir, { recursive: true });
507
530
  try {
508
531
  execFileSync(npmCommand, [...npmPrefixArgs, "install", "--silent", "--save-prod", "--prefix", configDir, packageRoot], { stdio: "pipe" });
@@ -517,6 +540,110 @@ function installOpenCodeGlobalPlugin(configDir) {
517
540
  };
518
541
  }
519
542
 
543
+ function globalOpenCodeConfigPaths(configDir) {
544
+ return {
545
+ instructions: join(configDir, pluginDefinition.opencode.instructionsFileName),
546
+ runtimeContract: join(configDir, pluginDefinition.opencode.runtimeContractFileName),
547
+ skills: join(configDir, "skills"),
548
+ };
549
+ }
550
+
551
+ function globalOpenCodeOwnershipMarkerIsValid(content, marker, placement) {
552
+ const lines = content.split(/\r?\n/);
553
+ if (placement === "first-line") return lines[0] === marker;
554
+ const frontmatterEnd = lines.findIndex((line, index) => index > 0 && line === "---");
555
+ return frontmatterEnd >= 0 && lines[frontmatterEnd + 1] === marker;
556
+ }
557
+
558
+ function assertGlobalOpenCodeFileWritable(path, marker, placement) {
559
+ if (!existsSync(path)) return;
560
+ const existing = readFileSync(path, "utf8");
561
+ if (!globalOpenCodeOwnershipMarkerIsValid(existing, marker, placement)) {
562
+ throw new Error(`Refusing to overwrite unowned global OpenCode file: ${path}`);
563
+ }
564
+ }
565
+
566
+ function assertGlobalOpenCodeSurfaceWritable(configDir) {
567
+ const paths = globalOpenCodeConfigPaths(configDir);
568
+ assertGlobalOpenCodeFileWritable(paths.instructions, globalOpenCodeInstructionsOwnershipMarker, "first-line");
569
+ assertGlobalOpenCodeFileWritable(paths.runtimeContract, globalOpenCodeRuntimeContractOwnershipMarker, "first-line");
570
+ for (const skillName of globalOpenCodeSkillNames) {
571
+ assertGlobalOpenCodeFileWritable(
572
+ join(paths.skills, skillName, "SKILL.md"),
573
+ `${globalOpenCodeSkillOwnershipMarker}${skillName} -->`,
574
+ "after-frontmatter",
575
+ );
576
+ }
577
+ }
578
+
579
+ function writeOwnedGlobalOpenCodeFile(path, content, marker, placement) {
580
+ if (existsSync(path)) {
581
+ assertGlobalOpenCodeFileWritable(path, marker, placement);
582
+ }
583
+ mkdirSync(dirname(path), { recursive: true });
584
+ writeFileSync(path, content, "utf8");
585
+ }
586
+
587
+ function globalOpenCodeBoundary() {
588
+ return [
589
+ "## Global OpenCode Surface Boundary",
590
+ "",
591
+ "This skill is globally discoverable, but global plugin or skill presence is not repository governance activation.",
592
+ "Before applying AGDF gates, later artefacts or implementation guidance, inspect the current repository for `.opencode/AGDF.md`, `.opencode/skills/agdf-gate-check/SKILL.md` and `.agdf/control/`.",
593
+ "If the repository surface is absent, stop and direct the user to `npx --yes @agdf/cli@latest opencode-repo` in this repository.",
594
+ "When the repository surface exists, its local instructions, native skills and `.agdf/control/` state are authoritative.",
595
+ "",
596
+ ].join("\n");
597
+ }
598
+
599
+ function toGlobalOpenCodeContent(content) {
600
+ let next = content;
601
+ for (const skill of pluginDefinition.skillSet) {
602
+ const localName = `${pluginDefinition.opencode.skillPrefix}${skill.slug}`;
603
+ const globalName = `${pluginDefinition.opencode.globalSkillPrefix}${skill.slug}`;
604
+ next = next.replaceAll(localName, globalName);
605
+ }
606
+ return next;
607
+ }
608
+
609
+ function installOpenCodeGlobalSurface(configDir) {
610
+ const paths = globalOpenCodeConfigPaths(configDir);
611
+ const generatedOpenCodeRoot = join(generatedRoot, ".opencode");
612
+ const generatedInstructions = readFileSync(join(generatedOpenCodeRoot, pluginDefinition.opencode.instructionsFileName), "utf8");
613
+ const generatedRuntimeContract = readFileSync(join(generatedOpenCodeRoot, pluginDefinition.opencode.runtimeContractFileName), "utf8");
614
+ const globalInstructions = [
615
+ globalOpenCodeInstructionsOwnershipMarker,
616
+ "# AGDF Global OpenCode instructions",
617
+ "",
618
+ "AGDF native skills are globally discoverable through OpenCode.",
619
+ "",
620
+ globalOpenCodeBoundary(),
621
+ "The repository-local `.opencode/AGDF.md`, `.opencode/skills/` and `.agdf/control/` files remain the source of truth for active governance.",
622
+ "",
623
+ toGlobalOpenCodeContent(generatedInstructions),
624
+ ].join("\n");
625
+ const globalRuntimeContract = `${globalOpenCodeRuntimeContractOwnershipMarker}\n${generatedRuntimeContract}`;
626
+
627
+ writeOwnedGlobalOpenCodeFile(paths.instructions, globalInstructions, globalOpenCodeInstructionsOwnershipMarker, "first-line");
628
+ writeOwnedGlobalOpenCodeFile(paths.runtimeContract, globalRuntimeContract, globalOpenCodeRuntimeContractOwnershipMarker, "first-line");
629
+
630
+ for (let index = 0; index < openCodeSkillNames.length; index += 1) {
631
+ const sourceName = openCodeSkillNames[index];
632
+ const skillName = globalOpenCodeSkillNames[index];
633
+ const sourcePath = join(generatedOpenCodeRoot, "skills", sourceName, "SKILL.md");
634
+ const sourceContent = readFileSync(sourcePath, "utf8");
635
+ const marker = `${globalOpenCodeSkillOwnershipMarker}${skillName} -->`;
636
+ const content = toGlobalOpenCodeContent(sourceContent).replace(/^(---[\s\S]*?\n---\n)/, `$1${marker}\n\n${globalOpenCodeBoundary()}`);
637
+ writeOwnedGlobalOpenCodeFile(join(paths.skills, skillName, "SKILL.md"), content, marker, "after-frontmatter");
638
+ }
639
+
640
+ return {
641
+ instructions: paths.instructions,
642
+ runtimeContract: paths.runtimeContract,
643
+ skills: paths.skills,
644
+ };
645
+ }
646
+
520
647
  function readOpenCodeConfig(configPath) {
521
648
  if (!existsSync(configPath)) return { exists: false, parseError: "", config: {} };
522
649
  try {
@@ -528,7 +655,7 @@ function readOpenCodeConfig(configPath) {
528
655
 
529
656
  function isOpenCodeRepositorySurfacePresent(targetDir) {
530
657
  return existsSync(join(targetDir, ".opencode", pluginDefinition.opencode.instructionsFileName))
531
- && existsSync(join(targetDir, ".opencode", "agents", `${pluginDefinition.opencode.skillPrefix}gate-check.md`));
658
+ && existsSync(join(targetDir, ".opencode", "skills", `${pluginDefinition.opencode.skillPrefix}gate-check`, "SKILL.md"));
532
659
  }
533
660
 
534
661
  function resolveOpenCodePackage(configDir) {
@@ -552,12 +679,27 @@ function resolveOpenCodePackage(configDir) {
552
679
  }
553
680
  }
554
681
 
682
+ function evaluateGlobalOpenCodeSurface(configDir) {
683
+ const paths = globalOpenCodeConfigPaths(configDir);
684
+ const skillCount = globalOpenCodeSkillNames.filter((skillName) => existsSync(join(paths.skills, skillName, "SKILL.md"))).length;
685
+ return {
686
+ path: paths.skills,
687
+ instructions: paths.instructions,
688
+ runtime_contract: paths.runtimeContract,
689
+ expected_skill_count: globalOpenCodeSkillNames.length,
690
+ skill_count: skillCount,
691
+ present: existsSync(paths.skills),
692
+ complete: existsSync(paths.instructions) && existsSync(paths.runtimeContract) && skillCount === openCodeSkillNames.length,
693
+ };
694
+ }
695
+
555
696
  function evaluateOpenCodeStatus(targetDir, configDir = defaultOpenCodeConfigDir()) {
556
697
  const configPath = join(configDir, "opencode.json");
557
698
  const configState = readOpenCodeConfig(configPath);
558
699
  const plugins = Array.isArray(configState.config.plugin) ? configState.config.plugin : [];
559
700
  const globalConfigured = plugins.includes(pluginDefinition.opencode.npmPackage);
560
701
  const packageState = resolveOpenCodePackage(configDir);
702
+ const globalNativeSurface = evaluateGlobalOpenCodeSurface(configDir);
561
703
  const sessionSignals = {
562
704
  active: process.env.AGDF_PLUGIN_ACTIVE === "1",
563
705
  version: process.env.AGDF_PLUGIN_VERSION || "",
@@ -565,12 +707,14 @@ function evaluateOpenCodeStatus(targetDir, configDir = defaultOpenCodeConfigDir(
565
707
  repository_surface: process.env.AGDF_OPENCODE_REPOSITORY_SURFACE === "1",
566
708
  };
567
709
  const repositorySurface = isOpenCodeRepositorySurfacePresent(targetDir);
710
+ const gateCheckSkillPath = join(targetDir, ".opencode", "skills", `${pluginDefinition.opencode.skillPrefix}gate-check`, "SKILL.md");
568
711
 
569
712
  const findings = [];
570
713
  if (!configState.exists) findings.push("OpenCode global config not found.");
571
714
  if (configState.parseError) findings.push(`OpenCode global config is not valid JSON: ${configState.parseError}`);
572
715
  if (!globalConfigured) findings.push(`OpenCode global config does not include ${pluginDefinition.opencode.npmPackage}.`);
573
716
  if (!packageState.loadable) findings.push(`${pluginDefinition.opencode.npmPackage} is not loadable from the OpenCode config directory.`);
717
+ if (!globalNativeSurface.complete) findings.push(`Global OpenCode native skill surface is incomplete (${globalNativeSurface.skill_count}/${globalNativeSurface.expected_skill_count} skills).`);
574
718
  if (!sessionSignals.active) findings.push("No active AGDF OpenCode session signal is visible in this process.");
575
719
  if (!repositorySurface) findings.push("Current repository does not contain the AGDF OpenCode surface.");
576
720
 
@@ -589,17 +733,21 @@ function evaluateOpenCodeStatus(targetDir, configDir = defaultOpenCodeConfigDir(
589
733
  resolved_path: packageState.path,
590
734
  error: packageState.error,
591
735
  },
736
+ global_native_surface: globalNativeSurface,
592
737
  session: sessionSignals,
593
738
  repository_surface: {
594
739
  path: targetDir,
595
740
  present: repositorySurface,
596
741
  instructions: join(targetDir, ".opencode", pluginDefinition.opencode.instructionsFileName),
597
- gate_check_agent: join(targetDir, ".opencode", "agents", `${pluginDefinition.opencode.skillPrefix}gate-check.md`),
742
+ gate_check_agent: gateCheckSkillPath,
743
+ gate_check_skill: gateCheckSkillPath,
598
744
  },
599
- visible_entrypoint: repositorySurface ? `@${pluginDefinition.opencode.skillPrefix}gate-check` : "none until opencode-repo is installed for this repository",
745
+ visible_entrypoint: repositorySurface ? `${pluginDefinition.opencode.skillPrefix}gate-check (native skill)` : "none until opencode-repo is installed for this repository",
600
746
  findings,
601
- next_step: repositorySurface
602
- ? `Restart OpenCode if needed, then use @${pluginDefinition.opencode.skillPrefix}gate-check for new build/change intent.`
747
+ next_step: !globalNativeSurface.complete
748
+ ? "Run npx --yes @agdf/cli@latest opencode to install or repair the global native OpenCode skill surface."
749
+ : repositorySurface
750
+ ? `Restart OpenCode if needed, then load ${pluginDefinition.opencode.skillPrefix}gate-check through the native skill tool for new build/change intent.`
603
751
  : "Run npx --yes @agdf/cli@latest opencode-repo in repositories where AGDF governance should be active and reviewable.",
604
752
  };
605
753
  }
@@ -616,6 +764,8 @@ function printOpenCodeStatus(report, json) {
616
764
  if (report.global_config.parse_error) console.log(`Config parse error: ${report.global_config.parse_error}`);
617
765
  console.log(`Package loadable: ${report.package.loadable ? "yes" : "no"}`);
618
766
  if (report.package.resolved_path) console.log(`Package path: ${report.package.resolved_path}`);
767
+ console.log(`Global native skills: ${report.global_native_surface.complete ? "complete" : "incomplete"} (${report.global_native_surface.skill_count}/${report.global_native_surface.expected_skill_count})`);
768
+ console.log(`Global skill path: ${report.global_native_surface.path}`);
619
769
  console.log(`Session active signal: ${report.session.active ? "yes" : "no"}`);
620
770
  if (report.session.version) console.log(`Session plugin version: ${report.session.version}`);
621
771
  if (report.session.control_dir) console.log(`Session control dir: ${report.session.control_dir}`);
@@ -713,6 +863,29 @@ function writeGeneratedFile(targetDir, relativePath, content, force, allowOverwr
713
863
  writeFileSync(outputPath, content, "utf8");
714
864
  }
715
865
 
866
+ function removeOwnedLegacyOpenCodeAgents(targetDir) {
867
+ const agentsDir = join(targetDir, ".opencode", "agents");
868
+ if (!existsSync(agentsDir)) return [];
869
+
870
+ const removed = [];
871
+ for (const skill of pluginDefinition.skillSet) {
872
+ const skillName = `${pluginDefinition.opencode.skillPrefix}${skill.slug}`;
873
+ const relativePath = join(".opencode", "agents", `${skillName}.md`);
874
+ const agentPath = join(targetDir, relativePath);
875
+ if (!existsSync(agentPath)) continue;
876
+
877
+ const content = readFileSync(agentPath, "utf8");
878
+ const ownedHeader = `---\ndescription: ${skill.useFor}\nmode: subagent\n---`;
879
+ if (!content.startsWith(ownedHeader) || !content.includes(`# ${skill.slug}`)) continue;
880
+
881
+ rmSync(agentPath);
882
+ removed.push(relativePath);
883
+ }
884
+
885
+ if (readdirSync(agentsDir).length === 0) rmSync(agentsDir, { recursive: true });
886
+ return removed;
887
+ }
888
+
716
889
  function assertGeneratedWritePlan(targetDir, files, force) {
717
890
  const blocked = files.find((file) => existsSync(join(targetDir, file.path)) && !force && !file.allowOverwrite);
718
891
  if (blocked) {
@@ -873,7 +1046,7 @@ function generatedFilesForTarget(target, targetDir, force, languagePreference) {
873
1046
  return files;
874
1047
  }
875
1048
 
876
- function printNextSteps(target, destination, files, wroteAgentsFragment, wroteOpenCodeConfigFragment) {
1049
+ function printNextSteps(target, destination, files, wroteAgentsFragment, wroteOpenCodeConfigFragment, removedOpenCodeAgents = []) {
877
1050
  console.log("");
878
1051
  console.log(`AGDF bootstrap complete in ${destination}`);
879
1052
  console.log("");
@@ -883,6 +1056,12 @@ function printNextSteps(target, destination, files, wroteAgentsFragment, wroteOp
883
1056
  console.log(`- ${action}${file.path}`);
884
1057
  }
885
1058
 
1059
+ if (removedOpenCodeAgents.length > 0) {
1060
+ console.log("");
1061
+ console.log("Removed generated legacy OpenCode agents:");
1062
+ for (const relativePath of removedOpenCodeAgents) console.log(`- ${relativePath}`);
1063
+ }
1064
+
886
1065
  const preservedFiles = [...new Set(files.map((file) => file.preserved).filter(Boolean))];
887
1066
  if (preservedFiles.length > 0) {
888
1067
  console.log("");
@@ -924,10 +1103,9 @@ function printNextSteps(target, destination, files, wroteAgentsFragment, wroteOp
924
1103
  }
925
1104
  console.log(`- OpenCode will install the ${pluginDefinition.opencode.npmPackage} npm plugin from opencode.json at startup.`);
926
1105
  console.log("- Optional: also add create-agdf to ~/.config/opencode/opencode.json plugin[] for a user-wide OpenCode hook.");
927
- console.log("- The global hook does not replace repository instructions or subagents; this repository's .opencode files remain the AGDF source of truth.");
928
- console.log("- Start OpenCode in this repository; it will load opencode.json, .opencode/AGDF.md and the AGDF subagents.");
929
- console.log("- AGDF OpenCode agents are mode: subagent workflow controls; they are not .opencode/skills entries or primary menu agents.");
930
- console.log("- Use @agdf-gate-check as the visible entry point for new build/change intent or unclear approval before later artefacts or implementation.");
1106
+ console.log("- The global hook does not replace repository instructions or native skills; this repository's .opencode files remain the AGDF source of truth.");
1107
+ console.log("- Start OpenCode in this repository; it will load opencode.json, .opencode/AGDF.md and the native AGDF skills.");
1108
+ console.log("- Load agdf-gate-check through OpenCode's native skill tool for new build/change intent or unclear approval before later artefacts or implementation.");
931
1109
  console.log("- Run npx --yes @agdf/cli@latest init when the repository needs live AGDF control files.");
932
1110
  }
933
1111
  if (target === "copilot" || target === "both") {
@@ -2467,6 +2645,7 @@ async function main() {
2467
2645
  const configDir = options.dirExplicit ? options.dir : defaultOpenCodeConfigDir();
2468
2646
  try {
2469
2647
  const result = installOpenCodeGlobalPlugin(configDir);
2648
+ installOpenCodeGlobalSurface(configDir);
2470
2649
  console.log(`AGDF OpenCode global plugin ${result.added ? "installed" : "already present"}: ${result.configPath}`);
2471
2650
  const report = evaluateOpenCodeStatus(options.dir, configDir);
2472
2651
  printOpenCodeStatus(report, false);
@@ -2481,18 +2660,22 @@ async function main() {
2481
2660
  const files = generatedFilesForTarget(options.target, options.dir, options.force, options.language);
2482
2661
  const wroteAgentsFragment = files.some(file => file.path === agdfFragmentPath);
2483
2662
  const wroteOpenCodeConfigFragment = files.some(file => file.path === openCodeConfigFragmentPath);
2663
+ let removedOpenCodeAgents = [];
2484
2664
 
2485
2665
  try {
2486
2666
  assertGeneratedWritePlan(options.dir, files, options.force);
2487
2667
  for (const file of files) {
2488
2668
  writeGeneratedFile(options.dir, file.path, file.content, options.force, file.allowOverwrite);
2489
2669
  }
2670
+ if (options.target === "opencode-repo") {
2671
+ removedOpenCodeAgents = removeOwnedLegacyOpenCodeAgents(options.dir);
2672
+ }
2490
2673
  } catch (error) {
2491
2674
  console.error(error.message);
2492
2675
  process.exit(1);
2493
2676
  }
2494
2677
 
2495
- printNextSteps(options.target, options.dir, files, wroteAgentsFragment, wroteOpenCodeConfigFragment);
2678
+ printNextSteps(options.target, options.dir, files, wroteAgentsFragment, wroteOpenCodeConfigFragment, removedOpenCodeAgents);
2496
2679
  }
2497
2680
 
2498
2681
  await main();
@@ -3,13 +3,13 @@
3
3
  ## Role
4
4
  You are operating in an OpenCode project configured with AGDF.
5
5
 
6
- Use the AGDF agents as workflow controls, not as documentation shortcuts.
6
+ Use the native AGDF skills as workflow controls, not as documentation shortcuts.
7
7
  Your goal is trustworthy progress: reduce uncertainty, establish evidence, preserve artefacts, verify outcomes and make the next allowed step explicit.
8
8
 
9
9
  ## Surface Convention
10
- OpenCode project agents do not have a plugin namespace.
10
+ OpenCode project skills do not have a plugin namespace.
11
11
 
12
- Therefore generated OpenCode agent names use the AGDF prefix:
12
+ Therefore generated OpenCode skill names use the AGDF prefix:
13
13
 
14
14
  - `agdf-delivery-path-search`
15
15
  - `agdf-brownfield-analysis`
@@ -21,7 +21,7 @@ Therefore generated OpenCode agent names use the AGDF prefix:
21
21
  - `agdf-release-or`
22
22
  - `agdf-task-plan-review`
23
23
 
24
- Do not remove that prefix in OpenCode-facing repository agents.
24
+ Do not remove that prefix in OpenCode-facing repository skills.
25
25
  Codex and Claude Code plugin surfaces use unprefixed skill names because their plugin namespace already carries `agdf`.
26
26
  ## Mode Selection
27
27
  Default entry rule: a new user intent to build, add, change, extend, refactor or otherwise deliver something starts with `agdf-gate-check` unless it is clearly only a question, explanation, local inspection, or explicitly scoped review.
@@ -101,13 +101,13 @@ For relevant runs that change durable state, code, artefacts or gate status:
101
101
  ## OpenCode Files
102
102
 
103
103
  - OpenCode loads this file through `opencode.json` `instructions`.
104
- - AGDF for OpenCode has two layers: an optional global npm plugin hook and this repository-local governance surface.
105
- - The global plugin hook does not replace this file, `.opencode/agents/` or `.agdf/control/`; repository files remain the AGDF source of truth.
106
- - OpenCode agents live under `.opencode/agents/` and use the `agdf-` prefix.
107
- - 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.
108
- - 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.
104
+ - AGDF for OpenCode has a global npm/native-skill discoverability layer and this repository-local governance surface.
105
+ - The global plugin and skills do not replace this file, `.opencode/skills/` or `.agdf/control/`; repository files remain the AGDF source of truth.
106
+ - Native OpenCode skills live under `.opencode/skills/` and use the `agdf-` prefix.
107
+ - The generated AGDF skills are loaded on demand through OpenCode's native `skill` tool; they are not parallel subagents or primary menu agents.
108
+ - For new build/change intent or unclear approval, load the `agdf-gate-check` skill before later artefacts or implementation.
109
109
  - The AGDF OpenCode plugin is loaded from npm through `opencode.json` `plugin: ["create-agdf"]`.
110
- - Use `npx --yes @agdf/cli@latest opencode-status --json` to verify global config, package loadability, active session signals and repository surface presence separately.
111
- - OpenCode permissions keep `edit` and `bash` on explicit approval by default.
110
+ - Use `npx --yes @agdf/cli@latest opencode-status --json` to verify global config, package loadability, global native-skill completeness, active session signals and repository surface presence separately.
111
+ - OpenCode permissions keep `edit` and `bash` on explicit approval and allow the generated `agdf-*` skills explicitly; global adapters use the `agdf-global-*` namespace.
112
112
  - Shared output and gate rules live in `.opencode/agdf-runtime-contract.md`.
113
113
  - Do not paste full control files, templates or artefact bodies into chat unless the user explicitly asks for the full content; summarize and link paths instead.
@@ -3,17 +3,16 @@
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.
8
- - `opencode.json` keeps `edit` and `bash` on `ask` so execution remains permissioned.
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.
12
- - Use `npx --yes @agdf/cli@latest opencode-status --json` to distinguish global hook configuration, package loadability, session activity and this repository surface.
6
+ - AGDF for OpenCode has a global npm/native-skill discoverability layer and this repository-local governance surface.
7
+ - The global plugin and skills do not replace `.opencode/AGDF.md`, `.opencode/skills/` or `.agdf/control/`; repository files remain the AGDF source of truth.
8
+ - `opencode.json` keeps `edit` and `bash` on `ask` and explicitly allows the generated `agdf-*` skills; global adapters use `agdf-global-*` to avoid same-name masking.
9
+ - `.opencode/skills/` contains native OpenCode skills generated from the canonical AGDF skills.
10
+ - For new build/change intent or unclear approval, load `agdf-gate-check` through OpenCode's native `skill` tool.
11
+ - Use `npx --yes @agdf/cli@latest opencode-status --json` to distinguish global hook/native-skill configuration, package loadability, session activity and this repository surface.
13
12
  - Use `npx --yes @agdf/cli@latest gate-check --status-card` for compact interactive gate state; reserve full `--json` output for automation or audit evidence.
14
13
  - `.opencode/agdf-runtime-contract.md` is the shared gate and output contract.
15
14
 
16
- ## Agents
15
+ ## Skills
17
16
 
18
17
  - `agdf-brownfield-analysis`
19
18
  - `agdf-clean-implementation-review`
@@ -1,6 +1,6 @@
1
1
  ---
2
- description: after gate-check permits Brownfield Review or implementation preparation, before non-trivial changes in existing systems
3
- mode: subagent
2
+ name: agdf-brownfield-analysis
3
+ 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."
4
4
  ---
5
5
 
6
6
  # brownfield-analysis
@@ -19,7 +19,7 @@ The skill answers:
19
19
  - whether Context Graph impact exists without automatically creating a node
20
20
 
21
21
  ## Runtime Contract
22
- Use `../agdf-runtime-contract.md` for Quality Contract output, Context Graph fields, gate terms, and non-duplication rules.
22
+ Use `../../agdf-runtime-contract.md` for Quality Contract output, Context Graph fields, gate terms, and non-duplication rules.
23
23
 
24
24
  Brownfield-specific output must make evidence, missing existing-system view, parallel-structure risk, reuse strategy, and the minimal next step visible.
25
25
  When `.agdf/control/` is present, persist or link `post_ur_review` output under `.agdf/control/artefacts/<key>/BROWNFIELD_REVIEW.md`.
@@ -96,7 +96,7 @@ When used as Brownfield Review after `Approval: UR`, do not recommend PRD, SD, T
96
96
  7. Check SoT/runtime/product-semantics drift.
97
97
  8. Check primary visible ownership for UI/status/recovery paths.
98
98
  9. Check UI monolith risk for large surfaces or central hooks.
99
- 10. Check Context Graph impact according to `../agdf-runtime-contract.md`.
99
+ 10. Check Context Graph impact according to `../../agdf-runtime-contract.md`.
100
100
  11. Recommend the minimal clean implementation path.
101
101
 
102
102
  ## Output
@@ -134,4 +134,3 @@ This skill must not:
134
134
  - create Context Graph nodes automatically
135
135
  - treat archive links as active current specification signals
136
136
  - recommend broad PRD/SD/TP or implementation by reflex before Mode/Slice Decision is recorded
137
-
@@ -1,6 +1,6 @@
1
1
  ---
2
- description: inspect workarounds, fallbacks, parallel structures or symptom fixes
3
- mode: subagent
2
+ name: agdf-clean-implementation-review
3
+ 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.
4
4
  ---
5
5
 
6
6
  # clean-implementation-review
@@ -18,7 +18,7 @@ This skill answers:
18
18
  - is it maintainable or workaround-heavy
19
19
 
20
20
  ## Runtime Contract
21
- Use `../agdf-runtime-contract.md` for Quality Contract output, Context Graph fields, gate terms, and non-duplication rules.
21
+ Use `../../agdf-runtime-contract.md` for Quality Contract output, Context Graph fields, gate terms, and non-duplication rules.
22
22
 
23
23
  Clean-review-specific output must make the primary solution, fallbacks, workarounds, parallel structures, exit criteria, and next cleanup/review step visible.
24
24
 
@@ -98,4 +98,3 @@ This skill must not:
98
98
  - hide unjustified workarounds
99
99
  - treat green tests as proof of solution integrity
100
100
  - decide final QA
101
-
@@ -1,6 +1,6 @@
1
1
  ---
2
- description: mandatory CR step after code changes, focused on defects, regression and security findings
3
- mode: subagent
2
+ name: agdf-code-review
3
+ 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.
4
4
  ---
5
5
 
6
6
  # code-review
@@ -17,7 +17,7 @@ It answers:
17
17
  - whether Brownfield, TP, or clean-review follow-up remains open
18
18
 
19
19
  ## Runtime Contract
20
- Use `../agdf-runtime-contract.md` for Quality Contract output, Context Graph fields, gate terms, and non-duplication rules.
20
+ Use `../../agdf-runtime-contract.md` for Quality Contract output, Context Graph fields, gate terms, and non-duplication rules.
21
21
 
22
22
  Code-review-specific output must make actual findings, missing review scope, evidence strength, and the next required step visible.
23
23
 
@@ -92,4 +92,3 @@ This skill must not:
92
92
  - hide missing review scope
93
93
  - generate style-only findings
94
94
  - duplicate TP Review or QA as if they were the same step
95
-
@@ -1,6 +1,6 @@
1
1
  ---
2
- description: commit/PR-near handoff after QA/OR/UAT
3
- mode: subagent
2
+ name: agdf-delivery-closeout
3
+ 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.
4
4
  ---
5
5
 
6
6
  # delivery-closeout
@@ -20,7 +20,7 @@ It answers:
20
20
  This skill does not replace `agdf-qa-gate`, `agdf-release-or`, user approvals, or gate decisions.
21
21
 
22
22
  ## Runtime Contract
23
- Use `../agdf-runtime-contract.md` for closeout discipline, gate terms, Context Graph fields, and non-duplication rules.
23
+ Use `../../agdf-runtime-contract.md` for closeout discipline, gate terms, Context Graph fields, and non-duplication rules.
24
24
 
25
25
  ## Rules
26
26
  1. Delivery follows gate clarity.
@@ -112,4 +112,3 @@ This skill must not:
112
112
  - execute commit, push, or PR
113
113
  - invent a commit handoff for non-code runs
114
114
  - imply new gate approvals
115
-
@@ -1,6 +1,6 @@
1
1
  ---
2
- description: high-impact planning decisions with several plausible next delivery steps before implementation
3
- mode: subagent
2
+ name: agdf-delivery-path-search
3
+ description: Use this skill for high-impact planning decisions when several materially different next delivery steps are plausible and comparing scope, risk, evidence, tests, cost and gate readiness would reduce expensive rework. Do not use for routine tasks, during implementation, or as gate permission.
4
4
  ---
5
5
 
6
6
  # Delivery Path Search
@@ -13,7 +13,7 @@ The search is advisory and read-only. Canonical AGDF `agdf-gate-check` remains t
13
13
 
14
14
  ## Runtime Contract
15
15
 
16
- Use `../agdf-runtime-contract.md` for canonical gate state, output discipline and Delivery Path Search boundaries. This skill must not maintain a second gate or scoring model.
16
+ Use `../../agdf-runtime-contract.md` for canonical gate state, output discipline and Delivery Path Search boundaries. This skill must not maintain a second gate or scoring model.
17
17
 
18
18
  ## Trigger
19
19
 
@@ -87,4 +87,3 @@ Persist only the redacted decision summary when durable evidence is required. Do
87
87
  - Do not replace deterministic candidates with generated proposals.
88
88
  - Do not send secrets, full artefacts, source snapshots, raw prompts or hidden reasoning to a generator.
89
89
  - Do not claim executable generation for instruction-only surfaces.
90
-
@@ -1,6 +1,6 @@
1
1
  ---
2
- description: new build/change intent, unclear approval, Structured Delivery, later-gate artefact requested
3
- mode: subagent
2
+ name: agdf-gate-check
3
+ 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.
4
4
  ---
5
5
 
6
6
  # gate-check
@@ -18,7 +18,7 @@ Determine the earliest blocking user approval gate and derive:
18
18
  This skill must not create later artefacts such as PRD, SD, TP, CD, CR, QA, or UAT when the gate does not allow them.
19
19
 
20
20
  ## Runtime Contract
21
- Use `../agdf-runtime-contract.md` for gate terms, closeout discipline, and non-duplication rules.
21
+ Use `../../agdf-runtime-contract.md` for gate terms, closeout discipline, and non-duplication rules.
22
22
  The canonical gate order and transition model live only in the Runtime Contract. This skill evaluates the current state against that model; it must not maintain a second complete gate table.
23
23
 
24
24
  ## Agent-Native Control Path
@@ -159,4 +159,3 @@ This skill must not:
159
159
  - paste full `.agdf/control/` files, templates or artefact bodies into the chat unless the user explicitly asks for the full content
160
160
  - present QA or UAT as passed without evidence
161
161
  - present release as allowed without QA pass and UAT approval where required
162
-
@@ -1,6 +1,6 @@
1
1
  ---
2
- description: final QA decision
3
- mode: subagent
2
+ name: agdf-qa-gate
3
+ 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.
4
4
  ---
5
5
 
6
6
  # qa-gate
@@ -22,7 +22,7 @@ It answers:
22
22
  - whether blockers, critical risks, or missing evidence remain
23
23
 
24
24
  ## Runtime Contract
25
- Use `../agdf-runtime-contract.md` for Quality Contract output, Context Graph fields, gate terms, and non-duplication rules.
25
+ Use `../../agdf-runtime-contract.md` for Quality Contract output, Context Graph fields, gate terms, and non-duplication rules.
26
26
 
27
27
  QA-specific `decision` is exactly `pass | revise | block`.
28
28
  `pass` is allowed only when TP coverage, Brownfield fit, solution integrity, and relevant documentation/Context Graph impact are sufficiently evidenced.
@@ -93,7 +93,7 @@ Use this shape:
93
93
  - impact_codes:
94
94
  ```
95
95
 
96
- If Context Graph impact is relevant, include the fields from `../agdf-runtime-contract.md`.
96
+ If Context Graph impact is relevant, include the fields from `../../agdf-runtime-contract.md`.
97
97
 
98
98
  ## Decision Guidance
99
99
  - `pass`: required TP tasks are done, evidence is strong, no blocking Brownfield or solution-integrity risk remains.
@@ -108,4 +108,3 @@ This skill must not:
108
108
  - replace UAT
109
109
  - treat missing reviews as completed
110
110
  - downgrade SoT drift to harmless warning
111
-
@@ -1,6 +1,6 @@
1
1
  ---
2
- description: auditable closeout for every relevant run
3
- mode: subagent
2
+ name: agdf-release-or
3
+ 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.
4
4
  ---
5
5
 
6
6
  # release-or
@@ -25,7 +25,7 @@ It reports:
25
25
  - whether further quality follow-up or a separate delivery closeout is useful
26
26
 
27
27
  ## Runtime Contract
28
- Use `../agdf-runtime-contract.md` for Quality Contract output, Context Graph fields, gate terms, and non-duplication rules.
28
+ Use `../../agdf-runtime-contract.md` for Quality Contract output, Context Graph fields, gate terms, and non-duplication rules.
29
29
 
30
30
  OR-specific output must make gate status, delivered and intentionally not delivered content, missing approvals, missing evidence, risks, retained fallbacks, and the next permissible step visible.
31
31
  When `.agdf/control/` is present, persist or link the OR under `.agdf/control/artefacts/<key>/OR.md` and reference it from the selected canonical `RUN_STATE.md` or `MASTER_BACKLOG.md` when it is steering-relevant.
@@ -117,7 +117,7 @@ Use a compact structure:
117
117
  - quality_outlook:
118
118
  ```
119
119
 
120
- When Context Graph impact is relevant, include the fields from `../agdf-runtime-contract.md`.
120
+ When Context Graph impact is relevant, include the fields from `../../agdf-runtime-contract.md`.
121
121
  Include `context_graph_reconciliation` whenever Context Graph impact is present. If the value is `open_gap`, required next step must resolve or explicitly retain that gap before commit-ready or release-ready handoff.
122
122
 
123
123
  ## Forbidden
@@ -129,4 +129,3 @@ This skill must not:
129
129
  - provide later-gate content while an earlier gate blocks
130
130
  - produce the operative commit/PR handoff owned by `agdf-delivery-closeout`
131
131
  - execute commit, push, or PR actions
132
-
@@ -1,6 +1,6 @@
1
1
  ---
2
- description: after implementation and before QA, verify TP coverage
3
- mode: subagent
2
+ name: agdf-task-plan-review
3
+ 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.
4
4
  ---
5
5
 
6
6
  # task-plan-review
@@ -19,7 +19,7 @@ For each relevant task, this skill determines:
19
19
  This skill provides TP coverage. It is not the final QA decision.
20
20
 
21
21
  ## Runtime Contract
22
- Use `../agdf-runtime-contract.md` for Quality Contract output, Context Graph fields, gate terms, and non-duplication rules.
22
+ Use `../../agdf-runtime-contract.md` for Quality Contract output, Context Graph fields, gate terms, and non-duplication rules.
23
23
 
24
24
  TP-specific output must evaluate every relevant `task_id` with completion status, AC coverage, evidence, missing evidence, and QA-relevant gaps.
25
25
  If `context_graph_required_action` is not `none`, the affected task is complete only if follow-up, evidence, or an intentionally open gap is visible.
@@ -113,4 +113,3 @@ This skill must not:
113
113
  - hide partial work
114
114
  - upgrade missing evidence into confidence
115
115
  - reinterpret the TP scope
116
-
@@ -8,6 +8,9 @@
8
8
  ],
9
9
  "permission": {
10
10
  "edit": "ask",
11
- "bash": "ask"
11
+ "bash": "ask",
12
+ "skill": {
13
+ "agdf-*": "allow"
14
+ }
12
15
  }
13
16
  }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agdf",
3
- "version": "0.6.7",
3
+ "version": "0.6.9",
4
4
  "description": "Codex-first operating system for governed AI-assisted delivery.",
5
5
  "author": {
6
6
  "name": "Arndt Gold",
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "schemaVersion": 1,
3
3
  "id": "agdf",
4
- "version": "0.6.7",
4
+ "version": "0.6.9",
5
5
  "displayName": "AI Governance & Delivery Framework",
6
6
  "developerName": "Arndt Gold",
7
7
  "description": "Codex-first operating system for governed AI-assisted delivery.",
@@ -52,12 +52,16 @@
52
52
  },
53
53
  "opencode": {
54
54
  "skillPrefix": "agdf-",
55
+ "globalSkillPrefix": "agdf-global-",
55
56
  "runtimeContractFileName": "agdf-runtime-contract.md",
56
57
  "instructionsFileName": "AGDF.md",
57
58
  "npmPackage": "create-agdf",
58
59
  "permissions": {
59
60
  "edit": "ask",
60
- "bash": "ask"
61
+ "bash": "ask",
62
+ "skill": {
63
+ "agdf-*": "allow"
64
+ }
61
65
  }
62
66
  },
63
67
  "skillSet": [
@@ -4,7 +4,7 @@ const packageJson = JSON.parse(readFileSync(new URL("./package.json", import.met
4
4
 
5
5
  export const AGDFPlugin = async ({ directory, client }) => {
6
6
  const controlDir = `${directory}/.agdf/control`;
7
- const hasRepositorySurface = () => existsSync(`${directory}/.opencode/AGDF.md`) && existsSync(`${directory}/.opencode/agents`);
7
+ const hasRepositorySurface = () => existsSync(`${directory}/.opencode/AGDF.md`) && existsSync(`${directory}/.opencode/skills/agdf-gate-check/SKILL.md`);
8
8
  const status = () => ({
9
9
  active: true,
10
10
  version: packageJson.version,
@@ -40,7 +40,7 @@ export const AGDFPlugin = async ({ directory, client }) => {
40
40
  output.context.push([
41
41
  "## AGDF Plugin Notice",
42
42
  "The AGDF OpenCode npm plugin is loaded, but this repository does not contain the AGDF OpenCode surface.",
43
- "Do not apply AGDF gates from the global plugin alone; repository instructions, subagents and control files are the source of truth.",
43
+ "Do not apply AGDF gates from the global plugin alone; repository instructions, native skills and control files are the source of truth.",
44
44
  "Run `npx --yes @agdf/cli@latest opencode-repo` in this repository when AGDF governance should be active here.",
45
45
  ].join("\n"));
46
46
  return;
@@ -48,8 +48,8 @@ export const AGDFPlugin = async ({ directory, client }) => {
48
48
 
49
49
  output.context.push([
50
50
  "## AGDF Runtime Reminder",
51
- "Use `.opencode/AGDF.md`, `.opencode/agents/` and `.agdf/control/` as the AGDF source for this OpenCode session.",
52
- "For new build/change intent or unclear approval, route first to `agdf-gate-check` before later artefacts or implementation.",
51
+ "Use `.opencode/AGDF.md`, `.opencode/skills/` and `.agdf/control/` as the AGDF source for this OpenCode session.",
52
+ "For new build/change intent or unclear approval, load the native `agdf-gate-check` skill before later artefacts or implementation.",
53
53
  "Use `npx --yes @agdf/cli@latest gate-check --status-card` for compact interactive status. Use `--json` only as deterministic proof for automation or audit evidence, and summarize it instead of mirroring full JSON into chat.",
54
54
  ].join("\n"));
55
55
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-agdf",
3
- "version": "0.6.7",
3
+ "version": "0.6.9",
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": [