create-agdf 0.13.8 → 0.14.1

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.
Files changed (70) hide show
  1. package/README.md +7 -9
  2. package/generated/plugins/agdf/.claude-plugin/plugin.json +1 -1
  3. package/generated/plugins/agdf/.codex-plugin/plugin.json +2 -4
  4. package/generated/plugins/agdf/hooks/copilot-hooks.json +15 -0
  5. package/generated/plugins/agdf/meta/agdf-plugin.definition.json +21 -2
  6. package/generated/plugins/agdf/plugin.json +22 -0
  7. package/generated/plugins/agdf/runtime/agdf-local.js +1 -1
  8. package/generated/plugins/agdf/runtime/agdf-session-check.js +10 -5
  9. package/generated/plugins/agdf/runtime/create-agdf/generated/plugins/agdf/meta/agdf-plugin.definition.json +21 -2
  10. package/generated/plugins/agdf/runtime/create-agdf/lib/cli/command-registry.js +6 -7
  11. package/generated/plugins/agdf/runtime/create-agdf/lib/runtime-check-consent/contract.js +3 -1
  12. package/generated/plugins/agdf/runtime/create-agdf/package.json +1 -1
  13. package/generated/plugins/agdf/runtime/runtime-manifest.json +2 -2
  14. package/generated/plugins/agdf/scripts/check-runtime-integrity.mjs +31 -3
  15. package/generated/plugins/agdf/submission/openai/availability.md +1 -1
  16. package/generated/plugins/agdf/submission/openai/capability-matrix.json +1 -1
  17. package/generated/plugins/agdf/submission/openai/release-notes.md +1 -1
  18. package/generated/plugins/agdf/submission/openai/reviewer-cases.json +1 -1
  19. package/generated/submissions/openai/agdf/.codex-plugin/plugin.json +1 -2
  20. package/generated/submissions/openai/agdf/meta/agdf-plugin.definition.json +21 -2
  21. package/generated/submissions/openai/agdf/submission/openai/availability.md +1 -1
  22. package/generated/submissions/openai/agdf/submission/openai/capability-matrix.json +1 -1
  23. package/generated/submissions/openai/agdf/submission/openai/inventory.json +9 -9
  24. package/generated/submissions/openai/agdf/submission/openai/listing.json +1 -1
  25. package/generated/submissions/openai/agdf/submission/openai/readiness.json +2 -2
  26. package/generated/submissions/openai/agdf/submission/openai/readiness.md +2 -2
  27. package/generated/submissions/openai/agdf/submission/openai/release-notes.md +1 -1
  28. package/generated/submissions/openai/agdf/submission/openai/reviewer-cases.json +1 -1
  29. package/lib/cli/application.js +64 -8
  30. package/lib/cli/command-registry.js +6 -7
  31. package/lib/installers/copilot-precedence.js +34 -0
  32. package/lib/installers/copilot-settings.js +84 -0
  33. package/lib/installers/plugin-installers.js +147 -4
  34. package/lib/lifecycle/operations.js +3 -0
  35. package/lib/lifecycle/result.js +1 -0
  36. package/lib/lifecycle/status.js +3 -3
  37. package/lib/public-plugin/manifest.js +34 -2
  38. package/lib/public-plugin/validator.js +1 -1
  39. package/lib/release/version-coherence.js +1 -0
  40. package/lib/runtime-check-consent/contract.js +3 -1
  41. package/lib/runtime-check-consent/coordinator.js +1 -0
  42. package/lib/runtime-check-consent/service.js +1 -1
  43. package/lib/runtime-check-consent/state.js +3 -3
  44. package/lib/scaffold/plan.js +3 -89
  45. package/lib/scaffold/presentation.js +3 -22
  46. package/package.json +5 -3
  47. package/generated/.github/copilot-instructions.md +0 -16
  48. package/generated/.github/instructions/agdf-governance.instructions.md +0 -14
  49. package/generated/.github/skills/README.md +0 -20
  50. package/generated/AGENTS.md +0 -113
  51. /package/generated/{.github/skills → plugins/agdf/copilot-skills}/agdf-brownfield-analysis/SKILL.md +0 -0
  52. /package/generated/{.github/skills → plugins/agdf/copilot-skills}/agdf-clean-implementation-review/SKILL.md +0 -0
  53. /package/generated/{.github/skills → plugins/agdf/copilot-skills}/agdf-code-review/SKILL.md +0 -0
  54. /package/generated/{.github/skills → plugins/agdf/copilot-skills}/agdf-delivery-closeout/SKILL.md +0 -0
  55. /package/generated/{.github/skills → plugins/agdf/copilot-skills}/agdf-delivery-path-search/SKILL.md +0 -0
  56. /package/generated/{.github/skills → plugins/agdf/copilot-skills}/agdf-gate-check/SKILL.md +0 -0
  57. /package/generated/{.github/skills → plugins/agdf/copilot-skills}/agdf-interaction-locales.json +0 -0
  58. /package/generated/{.github/skills → plugins/agdf/copilot-skills}/agdf-qa-gate/SKILL.md +0 -0
  59. /package/generated/{.github/skills → plugins/agdf/copilot-skills}/agdf-release-or/SKILL.md +0 -0
  60. /package/generated/{.github/skills → plugins/agdf/copilot-skills}/agdf-runtime-contract.md +0 -0
  61. /package/generated/{.github/skills → plugins/agdf/copilot-skills}/agdf-task-plan-review/SKILL.md +0 -0
  62. /package/generated/{.github/skills → plugins/agdf/copilot-skills}/agdf-ux-intent-definition/SKILL.md +0 -0
  63. /package/generated/{.github/skills → plugins/agdf/copilot-skills}/contracts/closeout.md +0 -0
  64. /package/generated/{.github/skills → plugins/agdf/copilot-skills}/contracts/context-graph.md +0 -0
  65. /package/generated/{.github/skills → plugins/agdf/copilot-skills}/contracts/control-scaffold.md +0 -0
  66. /package/generated/{.github/skills → plugins/agdf/copilot-skills}/contracts/gate-transition.md +0 -0
  67. /package/generated/{.github/skills → plugins/agdf/copilot-skills}/contracts/interaction.md +0 -0
  68. /package/generated/{.github/skills → plugins/agdf/copilot-skills}/contracts/modes.md +0 -0
  69. /package/generated/{.github/skills → plugins/agdf/copilot-skills}/contracts/quality.md +0 -0
  70. /package/generated/{.github/skills → plugins/agdf/copilot-skills}/contracts/task-target-resolution.md +0 -0
@@ -63,7 +63,7 @@ function inspectInstallation(surface, targetDir, options, deps, exec) {
63
63
  evidence: [report.global_config.path],
64
64
  };
65
65
  }
66
- if (["codex", "claude"].includes(surface)) return deps.inspectPluginSurface(surface, exec);
66
+ if (["codex", "claude", "copilot"].includes(surface)) return deps.inspectPluginSurface(surface, exec);
67
67
  return { status: "unknown", surface, version: null, evidence: [`unsupported_status_probe:${surface}`] };
68
68
  }
69
69
 
@@ -79,7 +79,7 @@ export function evaluateGeneralStatus(targetDir, options = {}, dependencies = {}
79
79
  if (surface) {
80
80
  installation = inspectInstallation(surface, targetDir, options, deps, dependencies.exec);
81
81
  } else {
82
- const probes = ["codex", "claude", "opencode"].map((candidate) => inspectInstallation(candidate, targetDir, options, deps, dependencies.exec));
82
+ const probes = ["codex", "claude", "copilot", "opencode"].map((candidate) => inspectInstallation(candidate, targetDir, options, deps, dependencies.exec));
83
83
  const observed = probes.filter((probe) => ["healthy", "degraded"].includes(probe.status));
84
84
  if (observed.length === 1) {
85
85
  installation = observed[0];
@@ -96,7 +96,7 @@ export function evaluateGeneralStatus(targetDir, options = {}, dependencies = {}
96
96
  }
97
97
  const repository = repositoryStatus(targetDir, surface);
98
98
  const delivery = deliveryStatus(targetDir, { runId: options.runId }, deps);
99
- const runtimeChecks = ["codex", "claude", "opencode"].includes(surface)
99
+ const runtimeChecks = ["codex", "claude", "copilot", "opencode"].includes(surface)
100
100
  ? runtimeCheckStatus(options.dataRoot, surface)
101
101
  : { requested: "unknown", effective: "unavailable", reason: "unsupported_host_capability" };
102
102
  const nextText = surface === "multiple"
@@ -39,14 +39,12 @@ export function createCodexPluginManifest(definition, { publicCandidate = false
39
39
  websiteURL: distribution.urls.website,
40
40
  privacyPolicyURL: distribution.urls.privacy,
41
41
  termsOfServiceURL: distribution.urls.terms,
42
- supportURL: distribution.urls.support,
43
42
  composerIcon: definition.codex.composerIcon,
44
43
  logo: definition.codex.logo,
45
44
  defaultPrompt: pluginInterface.defaultPrompt,
46
45
  brandColor: definition.brandColor,
47
46
  },
48
47
  };
49
- if (!publicCandidate) manifest.hooks = `./${definition.codex.hooks}`;
50
48
  return manifest;
51
49
  }
52
50
 
@@ -70,3 +68,37 @@ export function createClaudePluginManifest(definition) {
70
68
  export function renderClaudePluginManifest(definition) {
71
69
  return `${JSON.stringify(createClaudePluginManifest(definition), null, 2)}\n`;
72
70
  }
71
+
72
+ function requireCopilotPath(value, field) {
73
+ if (typeof value !== "string" || !value || value.startsWith("/") || value.includes("..") || value.includes("\\")) {
74
+ throw new Error(`AGDF_COPILOT_PLUGIN_CONTRACT_INVALID: ${field} must be a relative POSIX path`);
75
+ }
76
+ return value;
77
+ }
78
+
79
+ export function createCopilotPluginManifest(definition) {
80
+ if (!/^[a-z0-9]+(?:-[a-z0-9]+)*$/.test(definition.id ?? "") || definition.id.length > 64) {
81
+ throw new Error("AGDF_COPILOT_PLUGIN_CONTRACT_INVALID: kebab-case name is required");
82
+ }
83
+ if (!/^\d+\.\d+\.\d+(?:-[0-9A-Za-z.-]+)?$/.test(definition.version ?? "")) {
84
+ throw new Error("AGDF_COPILOT_PLUGIN_CONTRACT_INVALID: semantic version is required");
85
+ }
86
+ const copilot = definition.copilot ?? {};
87
+ return {
88
+ name: definition.id,
89
+ version: definition.version,
90
+ description: definition.description,
91
+ author: definition.author,
92
+ homepage: definition.homepage,
93
+ repository: definition.repository,
94
+ license: definition.license,
95
+ keywords: definition.keywords,
96
+ category: definition.category,
97
+ skills: requireCopilotPath(copilot.skills, "skills"),
98
+ hooks: requireCopilotPath(copilot.hooks, "hooks"),
99
+ };
100
+ }
101
+
102
+ export function renderCopilotPluginManifest(definition) {
103
+ return `${JSON.stringify(createCopilotPluginManifest(definition), null, 2)}\n`;
104
+ }
@@ -80,7 +80,7 @@ export function validateCandidate(root) {
80
80
  if (unicodeLength(manifest.interface?.developerName) > LISTING_LIMITS.developerName) throw new Error("AGDF_PUBLIC_PLUGIN_LISTING_LIMIT_EXCEEDED: developerName");
81
81
  const prompts = manifest.interface?.defaultPrompt ?? [];
82
82
  if (prompts.length !== LISTING_LIMITS.promptCount || prompts.some((prompt) => unicodeLength(prompt) > LISTING_LIMITS.promptLength)) throw new Error("AGDF_PUBLIC_PLUGIN_LISTING_LIMIT_EXCEEDED: defaultPrompt");
83
- for (const field of ["websiteURL", "privacyPolicyURL", "termsOfServiceURL", "supportURL"]) {
83
+ for (const field of ["websiteURL", "privacyPolicyURL", "termsOfServiceURL"]) {
84
84
  let url;
85
85
  try { url = new URL(manifest.interface?.[field]); } catch { throw new Error(`AGDF_PUBLIC_PLUGIN_CONTRACT_INVALID: ${field}`); }
86
86
  if (url.protocol !== "https:") throw new Error(`AGDF_PUBLIC_PLUGIN_CONTRACT_INVALID: ${field} must use HTTPS`);
@@ -32,6 +32,7 @@ const VERSION_SURFACES = [
32
32
  jsonVersion("create-agdf/generated/plugins/agdf/meta/agdf-plugin.definition.json"),
33
33
  jsonVersion("create-agdf/generated/plugins/agdf/.codex-plugin/plugin.json"),
34
34
  jsonVersion("create-agdf/generated/plugins/agdf/.claude-plugin/plugin.json"),
35
+ jsonVersion("create-agdf/generated/plugins/agdf/plugin.json"),
35
36
  jsonVersion("create-agdf/generated/plugins/agdf/runtime/runtime-manifest.json"),
36
37
  jsonVersion("create-agdf/generated/plugins/agdf/runtime/create-agdf/package.json"),
37
38
  jsonVersion("create-agdf/generated/submissions/openai/agdf/meta/agdf-plugin.definition.json"),
@@ -32,6 +32,7 @@ export function validateRuntimeCheckCapability(capability) {
32
32
  }
33
33
  const surfaces = capability.surfaces ?? {};
34
34
  if (surfaces.codex !== "native-hook-review" || surfaces.claude !== "exact-command-rule"
35
+ || surfaces.copilot !== "plugin-hook-review"
35
36
  || surfaces.opencode !== "plugin-internal"
36
37
  || surfaces["portable-skills"] !== "manual-external-required") {
37
38
  throw new Error("AGDF_RUNTIME_CHECK_CAPABILITY_INVALID: surface contract");
@@ -41,7 +42,7 @@ export function validateRuntimeCheckCapability(capability) {
41
42
 
42
43
  export function runtimeCheckCapabilityIdentity({ capability, surface, runtimeDigest, sourceDigest, command }) {
43
44
  validateRuntimeCheckCapability(capability);
44
- if (!["codex", "claude", "opencode"].includes(surface)) throw new Error("AGDF_RUNTIME_CHECK_SURFACE_INVALID");
45
+ if (!["codex", "claude", "copilot", "opencode"].includes(surface)) throw new Error("AGDF_RUNTIME_CHECK_SURFACE_INVALID");
45
46
  for (const [name, value] of Object.entries({ runtimeDigest, sourceDigest })) {
46
47
  if (typeof value !== "string" || !/^[a-f0-9]{64}$/.test(value)) throw new Error(`AGDF_RUNTIME_CHECK_IDENTITY_INVALID: ${name}`);
47
48
  }
@@ -59,6 +60,7 @@ export function runtimeCheckCapabilityIdentity({ capability, surface, runtimeDig
59
60
 
60
61
  export function fixedRuntimeCheckCommand(surface, pluginRoot, platform = process.platform) {
61
62
  if (surface === "opencode") return "plugin:agdf:automatic-runtime-checks";
63
+ if (surface === "copilot") return 'node "${PLUGIN_ROOT}/runtime/agdf-session-check.js"';
62
64
  if (surface === "codex" || surface === "claude") {
63
65
  return platform === "win32"
64
66
  ? "node \"$([Environment]::GetEnvironmentVariable('PLUGIN_ROOT') + [Environment]::GetEnvironmentVariable('CLAUDE_PLUGIN_ROOT'))\\runtime\\agdf-session-check.js\""
@@ -18,6 +18,7 @@ export function resolveRuntimeCheckDecision({ explicitValue, interactive = false
18
18
  export function consentDisclosure(surface) {
19
19
  const permissionOwner = surface === "codex" ? "Codex native hook trust"
20
20
  : surface === "claude" ? "Claude Code user permission settings"
21
+ : surface === "copilot" ? "GitHub Copilot plugin hook review"
21
22
  : "OpenCode plugin and explicit permission configuration";
22
23
  return Object.freeze({
23
24
  surface,
@@ -35,7 +35,7 @@ function prospectiveRuntimeCheckIdentity(surface, platform = process.platform) {
35
35
  command: fixedRuntimeCheckCommand(surface, installed.root, platform),
36
36
  });
37
37
  }
38
- if (!["codex", "claude"].includes(surface)) return null;
38
+ if (!["codex", "claude", "copilot"].includes(surface)) return null;
39
39
  const pluginRoot = join(generatedRoot, "plugins", "agdf");
40
40
  let runtimeManifest;
41
41
  try { runtimeManifest = JSON.parse(readFileSync(join(pluginRoot, "runtime", "runtime-manifest.json"), "utf8")); } catch { return null; }
@@ -4,12 +4,12 @@ import { dirname, join, resolve } from "node:path";
4
4
  import { renameSyncWithRetry } from "../fs-swap.js";
5
5
 
6
6
  export function runtimeCheckReceiptPath(dataRoot, surface) {
7
- if (!["codex", "claude", "opencode"].includes(surface)) throw new Error("AGDF_RUNTIME_CHECK_RECEIPT_SURFACE_INVALID");
7
+ if (!["codex", "claude", "copilot", "opencode"].includes(surface)) throw new Error("AGDF_RUNTIME_CHECK_RECEIPT_SURFACE_INVALID");
8
8
  return join(resolve(dataRoot), "runtime-checks", `${surface}.json`);
9
9
  }
10
10
 
11
11
  export function createRuntimeCheckReceipt({ surface, decision, capabilityIdentity, command }) {
12
- if (!["codex", "claude", "opencode"].includes(surface)) throw new Error("AGDF_RUNTIME_CHECK_RECEIPT_SURFACE_INVALID");
12
+ if (!["codex", "claude", "copilot", "opencode"].includes(surface)) throw new Error("AGDF_RUNTIME_CHECK_RECEIPT_SURFACE_INVALID");
13
13
  if (!["enable", "manual"].includes(decision)) throw new Error("AGDF_RUNTIME_CHECK_RECEIPT_DECISION_INVALID");
14
14
  if (!/^[a-f0-9]{64}$/.test(capabilityIdentity)) throw new Error("AGDF_RUNTIME_CHECK_RECEIPT_IDENTITY_INVALID");
15
15
  return Object.freeze({
@@ -26,7 +26,7 @@ export function createRuntimeCheckReceipt({ surface, decision, capabilityIdentit
26
26
  export function validateRuntimeCheckReceipt(receipt) {
27
27
  if (receipt?.schema_version !== 1 || receipt.owner !== "create-agdf"
28
28
  || receipt.capability_id !== "automatic-runtime-checks") return { status: "receipt_unowned", receipt: null };
29
- if (!["codex", "claude", "opencode"].includes(receipt.surface)
29
+ if (!["codex", "claude", "copilot", "opencode"].includes(receipt.surface)
30
30
  || !["enabled", "manual"].includes(receipt.requested_state)
31
31
  || !/^[a-f0-9]{64}$/.test(receipt.capability_identity)
32
32
  || typeof receipt.command !== "string" || !receipt.command.trim()) {
@@ -1,11 +1,9 @@
1
- import { existsSync, readFileSync } from "node:fs";
1
+ import { readFileSync } from "node:fs";
2
2
  import { join } from "node:path";
3
3
  import { generatedRoot, languageConfigContent, pluginDefinition } from "../cli/runtime-context.js";
4
4
  export { doctorRequiredFiles } from "../control-evaluation/required-files.js";
5
5
 
6
- export const agdfFragmentPath = "AGENTS.agdf.md";
7
6
  const codexSkillNames = pluginDefinition.skillSet.map((skill) => `${pluginDefinition.codex.skillPrefix}${skill.slug}`);
8
- const copilotSkillNames = pluginDefinition.skillSet.map((skill) => `${pluginDefinition.copilot.skillPrefix}${skill.slug}`);
9
7
  const globalOpenCodeSkillNames = pluginDefinition.skillSet.map((skill) => `${pluginDefinition.opencode.globalSkillPrefix}${skill.slug}`);
10
8
  const contractModules = [
11
9
  "gate-transition.md",
@@ -96,63 +94,11 @@ const artefactTemplateFiles = [
96
94
  join(".agdf", "control", "templates", "artefacts", "QA_REPORT.md"),
97
95
  join(".agdf", "control", "templates", "artefacts", "OR.md"),
98
96
  ];
99
- const copilotInstructionFiles = [
100
- join(".github", "copilot-instructions.md"),
101
- join(".github", "instructions", "agdf-governance.instructions.md"),
102
- ];
103
- const copilotSkillFiles = [
104
- join(".github", "skills", "README.md"),
105
- join(".github", "skills", pluginDefinition.copilot.runtimeContractFileName),
106
- ...contractModules.map((moduleName) => join(".github", "skills", "contracts", moduleName)),
107
- ...copilotSkillNames.map((skillName) => join(".github", "skills", skillName, "SKILL.md")),
108
- ];
109
97
 
110
98
  function loadAsset(relativePath) {
111
99
  return readFileSync(join(generatedRoot, relativePath), "utf8");
112
100
  }
113
101
 
114
- function isAgdfOwnedAgentsFile(content) {
115
- return content.includes("## Surface Convention")
116
- && content.includes("GitHub Copilot repository skills do not have a plugin namespace")
117
- && content.includes("AGDF is agent-native first and CLI-verifiable by design");
118
- }
119
-
120
- function addCopilotAgentsFile(files, targetDir, force) {
121
- const agentsPath = join(targetDir, "AGENTS.md");
122
- if (!existsSync(agentsPath) || force) {
123
- files.push({
124
- path: "AGENTS.md",
125
- content: loadAsset("AGENTS.md"),
126
- });
127
- return;
128
- }
129
-
130
- const existingAgents = readFileSync(agentsPath, "utf8");
131
- if (isAgdfOwnedAgentsFile(existingAgents)) {
132
- files.push({
133
- path: "AGENTS.md",
134
- content: loadAsset("AGENTS.md"),
135
- allowOverwrite: true,
136
- action: "refreshed",
137
- });
138
- return;
139
- }
140
-
141
- files.push({
142
- path: agdfFragmentPath,
143
- content: loadAsset("AGENTS.md"),
144
- allowOverwrite: true,
145
- action: "refreshed",
146
- preserved: "AGENTS.md",
147
- });
148
- }
149
-
150
- function shouldWriteLanguageConfig(target, targetDir, force) {
151
- if (force) return true;
152
- if ((target === "copilot" || target === "both") && existsSync(join(targetDir, ".agdf", "control", "config.json"))) return false;
153
- return true;
154
- }
155
-
156
102
  function addLanguageConfig(files, languagePreference) {
157
103
  files.push({
158
104
  path: join(".agdf", "control", "config.json"),
@@ -196,8 +142,8 @@ export function generatedFilesForTarget(target, targetDir, force, languagePrefer
196
142
  return files;
197
143
  }
198
144
 
199
- if (target === "codex-repo" || target === "both") {
200
- if (shouldWriteLanguageConfig(target, targetDir, force)) addLanguageConfig(files, languagePreference);
145
+ if (target === "codex-repo") {
146
+ addLanguageConfig(files, languagePreference);
201
147
  for (const codexPath of codexPluginFiles) {
202
148
  files.push({
203
149
  path: codexPath,
@@ -206,38 +152,6 @@ export function generatedFilesForTarget(target, targetDir, force, languagePrefer
206
152
  }
207
153
  }
208
154
 
209
- if (target === "copilot" || target === "both") {
210
- if (target !== "both" && shouldWriteLanguageConfig(target, targetDir, force)) addLanguageConfig(files, languagePreference);
211
- addCopilotAgentsFile(files, targetDir, force);
212
-
213
- for (const controlPath of controlFiles) {
214
- files.push({
215
- path: controlPath,
216
- content: loadAsset(controlPath),
217
- allowOverwrite: true,
218
- action: "refreshed",
219
- });
220
- }
221
-
222
- for (const instructionPath of copilotInstructionFiles) {
223
- files.push({
224
- path: instructionPath,
225
- content: loadAsset(instructionPath),
226
- allowOverwrite: true,
227
- action: "refreshed",
228
- });
229
- }
230
-
231
- for (const skillPath of copilotSkillFiles) {
232
- files.push({
233
- path: skillPath,
234
- content: loadAsset(skillPath),
235
- allowOverwrite: true,
236
- action: "refreshed",
237
- });
238
- }
239
- }
240
-
241
155
  if (target === "opencode-repo") {
242
156
  addLanguageConfig(files, languagePreference);
243
157
  for (const controlPath of controlFiles) {
@@ -3,12 +3,9 @@ import { join } from "node:path";
3
3
  import { pluginDefinition } from "../cli/runtime-context.js";
4
4
  import { printLifecycleResult } from "../lifecycle/presentation.js";
5
5
  import { createLifecycleResult } from "../lifecycle/result.js";
6
- import { agdfFragmentPath } from "./plan.js";
7
6
 
8
- const pluginInstallCommand = "npx --yes @agdf/cli@latest claude";
9
-
10
- export function printNextSteps(target, destination, files, wroteAgentsFragment, removedOpenCodeAgents = [], { verbose = false, json = false, io = console } = {}) {
11
- const repositorySurface = { "codex-repo": "codex", "opencode-repo": "opencode", copilot: "copilot" }[target];
7
+ export function printNextSteps(target, destination, files, removedOpenCodeAgents = [], { verbose = false, json = false, io = console } = {}) {
8
+ const repositorySurface = { "codex-repo": "codex", "opencode-repo": "opencode" }[target];
12
9
  const verified = files.every((file) => {
13
10
  const path = join(destination, file.path);
14
11
  return existsSync(path) && readFileSync(path, "utf8") === file.content;
@@ -16,9 +13,7 @@ export function printNextSteps(target, destination, files, wroteAgentsFragment,
16
13
  if (repositorySurface) {
17
14
  const nextAction = repositorySurface === "codex"
18
15
  ? "Restart Codex, open /plugins, select This repository and install agdf; then start a new task with: Run an AGDF gate check for this request."
19
- : repositorySurface === "opencode"
20
- ? "Restart OpenCode in this repository so the global AGDF plugin observes the durable control configuration."
21
- : "Run /instructions in GitHub Copilot CLI to confirm that the generated AGDF repository instructions are visible.";
16
+ : "Restart OpenCode in this repository so the global AGDF plugin observes the durable control configuration.";
22
17
  printLifecycleResult(createLifecycleResult({
23
18
  operation: "repository_setup",
24
19
  result: verified ? "success" : "partial",
@@ -79,25 +74,11 @@ export function printNextSteps(target, destination, files, wroteAgentsFragment,
79
74
  io.log("- Run the installed `agdf doctor` when this repository also uses durable AGDF control state.");
80
75
  return;
81
76
  }
82
- if (wroteAgentsFragment) {
83
- io.log(`- Existing AGENTS.md detected. Merge ${agdfFragmentPath} into your current AGENTS.md before using Copilot with AGDF.`);
84
- }
85
- if (target === "both") {
86
- io.log("- Restart Codex in this repository, open /plugins, select This repository and install agdf.");
87
- io.log("- Start a new Codex thread in this repository and ask: Run an AGDF gate check for this request.");
88
- }
89
- if (target === "both") {
90
- io.log(`- Optional global Claude Code install: ${pluginInstallCommand}`);
91
- }
92
77
  if (target === "opencode-repo") {
93
78
  io.log("- Install the global OpenCode surface once with npx --yes @agdf/cli@latest opencode if it is not already installed.");
94
79
  io.log("- Start or restart OpenCode in this repository; valid .agdf/control/config.json activates the global AGDF runtime here.");
95
80
  io.log("- Load agdf-global-gate-check through OpenCode's native skill tool for new build/change intent or unclear approval before later artefacts or implementation.");
96
81
  io.log("- Existing .opencode files are left untouched as a compatibility path; this command does not copy a second runtime surface.");
97
82
  }
98
- if (target === "copilot" || target === "both") {
99
- io.log("- In GitHub Copilot CLI, run /instructions after the AGENTS.md step is complete to confirm that AGDF instructions and the repository skills are visible.");
100
- io.log("- Run npx --yes @agdf/cli@latest init when the repository needs live AGDF control files.");
101
- }
102
83
  io.log("- Commit the generated files so the repository becomes the source of truth.");
103
84
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "create-agdf",
3
- "version": "0.13.8",
4
- "description": "Bootstrap AGDF repository-local plugin files, Copilot/OpenCode instructions, skills, control files and machine-readable checks.",
3
+ "version": "0.14.1",
4
+ "description": "Install AGDF plugins, bootstrap supported repository surfaces and validate durable governance state.",
5
5
  "type": "module",
6
6
  "files": [
7
7
  "bin",
@@ -24,6 +24,7 @@
24
24
  "build:public-plugin": "node ./scripts/build-public-plugin.js",
25
25
  "install:claude": "node ./scripts/install-local-plugin.js claude",
26
26
  "install:codex": "node ./scripts/install-local-plugin.js codex",
27
+ "install:copilot": "node ./scripts/install-local-plugin.js copilot",
27
28
  "install:opencode": "node ./scripts/install-local-plugin.js opencode",
28
29
  "test:release-version-coherence": "node ./scripts/release-version-coherence-test.js",
29
30
  "test:public-plugin": "node ./scripts/public-plugin-test.js",
@@ -40,6 +41,7 @@
40
41
  "test:package-contents": "node ./scripts/package-contents-test.js",
41
42
  "test:package-build": "node ./scripts/package-build-test.js",
42
43
  "test:lifecycle": "node ./scripts/lifecycle-test.js",
44
+ "test:copilot-repository-retention": "node ./scripts/copilot-repository-retention-test.js",
43
45
  "test:control-state": "node ./scripts/control-state-test.js",
44
46
  "test:parent-reconciliation": "node ./scripts/parent-reconciliation-test.js",
45
47
  "test:interaction-presentation": "node ./scripts/interaction-presentation-test.js",
@@ -55,7 +57,7 @@
55
57
  "test:proportionality": "node ./scripts/proportionality-benchmark-test.js",
56
58
  "test:release-bootstrap": "node ./scripts/release-bootstrap-smoke-test.js",
57
59
  "test:routing": "npm run sync-package-assets && node ./scripts/test-routing.js",
58
- "smoke-test": "npm run release:prepare && npm run test:cli-modularization && npm run test:local-validator && npm run test:local-marketplace && npm run test:local-development-install && npm run test:package-build && npm run test:package-contents && npm run test:lifecycle && npm run test:control-state && npm run test:parent-reconciliation && npm run test:interaction-presentation && npm run test:verified-change && npm run test:runtime-integrity-layout && npm run test:runtime-integrity-negative && npm run test:agent-skills-conformance && npm run test:skill-evals && npm run eval:skills && npm run test:proportionality && npm run test:delivery-path-search && npm run test:delivery-path-search-unit && npm run test:delivery-path-search-generator && npm run test:opencode-hardening && node ./scripts/smoke-test.js && node ./scripts/test-routing.js",
60
+ "smoke-test": "npm run release:prepare && npm run test:cli-modularization && npm run test:local-validator && npm run test:local-marketplace && npm run test:local-development-install && npm run test:package-build && npm run test:package-contents && npm run test:lifecycle && npm run test:copilot-repository-retention && npm run test:control-state && npm run test:parent-reconciliation && npm run test:interaction-presentation && npm run test:verified-change && npm run test:runtime-integrity-layout && npm run test:runtime-integrity-negative && npm run test:agent-skills-conformance && npm run test:skill-evals && npm run eval:skills && npm run test:proportionality && npm run test:delivery-path-search && npm run test:delivery-path-search-unit && npm run test:delivery-path-search-generator && npm run test:opencode-hardening && node ./scripts/smoke-test.js && node ./scripts/test-routing.js",
59
61
  "prepack": "npm run release:prepare"
60
62
  },
61
63
  "keywords": [
@@ -1,16 +0,0 @@
1
- # AGDF Copilot instructions
2
-
3
- AGDF is active in this repository.
4
-
5
- - Treat `AGENTS.md` as the primary repository instruction source.
6
- - Use `.github/skills/` for AGDF task workflows instead of inventing parallel process rules.
7
- - Use `.agdf/control/` for durable run state, backlog pointers, source-of-truth ownership, Context Graph knowledge and quality contracts.
8
- - AGDF is agent-native first and CLI-verifiable by design.
9
- - Apply AGDF natively from `AGENTS.md`, repository skills and live `.agdf/control/` state before reaching for helper commands.
10
- - Before non-trivial implementation or formal delivery work, determine whether the request is a Quick Task or Structured Delivery.
11
- - If approval, evidence, ownership or the next allowed action is unclear, run the AGDF gate-check workflow before creating later artefacts or code.
12
- - Use `doctor --json`, `gate-check --json` or `delivery-map --json` as deterministic validators for CI, PR evidence, regression checks and audit trails, not as the primary workflow.
13
- - Do not infer gate approval from generic consent such as "ok", "go ahead", "do it", "continue", "leg los" or "approved".
14
- - Do not treat chat history as the source of truth for gate state, approvals, evidence or delivery status.
15
- - 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.
16
- - For deterministic ready-gate rendering, prefer an installed `agdf gate-check --approval-envelope`; use `agdf gate-check --json` for native-adapter input, automation or audit evidence. Reserve `npx ...@latest` for bootstrap, installation, refresh or a missing local executable.
@@ -1,14 +0,0 @@
1
- ---
2
- applyTo: "AGENTS.md,AGENTS.agdf.md,.agdf/**,.github/skills/**,.github/copilot-instructions.md,.github/instructions/**"
3
- ---
4
-
5
- # AGDF governance artefacts
6
-
7
- These files are control artefacts, not general documentation.
8
-
9
- - Keep AGDF rules sourced from `AGENTS.md`, `.github/skills/` and `.github/skills/agdf-runtime-contract.md`.
10
- - Do not duplicate the full gate model, Quality Contract table or Context Graph relationship language in new files.
11
- - Keep generated AGDF files small, reviewable and linked to the owning source of truth.
12
- - Preserve the rule that missing approval, missing evidence or unclear ownership blocks later delivery steps.
13
- - Preserve the rule that gates cannot be skipped by generic consent, urgency or a request to start.
14
- - If changing AGDF bootstrap behaviour, update the generated files, smoke test and affected setup documentation together.
@@ -1,20 +0,0 @@
1
- # AGDF repository skills
2
-
3
- These repository skills were generated from the AGDF source repository and are intended to be checked into this repository.
4
-
5
- ## Skills
6
-
7
- - `agdf-brownfield-analysis`
8
- - `agdf-clean-implementation-review`
9
- - `agdf-code-review`
10
- - `agdf-delivery-closeout`
11
- - `agdf-delivery-path-search`
12
- - `agdf-gate-check`
13
- - `agdf-qa-gate`
14
- - `agdf-release-or`
15
- - `agdf-task-plan-review`
16
- - `agdf-ux-intent-definition`
17
-
18
- ## Runtime contract
19
-
20
- Shared output and gate rules for this checkout live in `agdf-runtime-contract.md`.
@@ -1,113 +0,0 @@
1
- # AGENTS.md
2
-
3
- ## Role
4
- You are an autonomous agent operating in an AGDF-governed delivery system.
5
-
6
- Use the plugin skills as workflow controls, not as documentation shortcuts.
7
- Your goal is trustworthy progress: reduce uncertainty, establish evidence, preserve artefacts, verify outcomes and make the next allowed step explicit.
8
-
9
- ## Surface Convention
10
- GitHub Copilot repository skills do not have a plugin namespace.
11
-
12
- Therefore generated Copilot skill names use the AGDF prefix:
13
-
14
- - `agdf-delivery-path-search`
15
- - `agdf-brownfield-analysis`
16
- - `agdf-ux-intent-definition`
17
- - `agdf-clean-implementation-review`
18
- - `agdf-code-review`
19
- - `agdf-delivery-closeout`
20
- - `agdf-gate-check`
21
- - `agdf-qa-gate`
22
- - `agdf-release-or`
23
- - `agdf-task-plan-review`
24
-
25
- Do not remove that prefix in Copilot-facing repository skills.
26
- Codex and Claude Code plugin surfaces use the same canonical router with unprefixed skill names because their plugin namespace already carries `agdf`.
27
- ## Mode Selection
28
- 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.
29
-
30
- Use Quick Task Mode for questions, small reviews, local debugging and narrow fixes without new product semantics. Use Verified Change only after approved UR and Brownfield Review when the Runtime Contract's compact record can prove bounded ownership, clean-at-baseline paths, prohibited-impact absence and deterministic validation.
31
-
32
- Use Structured Delivery Mode for new capabilities, architecture, policy, persistence, release-critical work, formal artefacts or explicit approvals.
33
-
34
- Any new product semantics, functional change or user-visible behaviour change requires a durable UR first.
35
- Persist it in `.agdf/control/` or link it from there to the target repository's authoritative source of truth before PRD, SD, TP, Brownfield Analysis or implementation.
36
- Treat approval text and durable artefact presence as separate checks for UR, PRD, SD, TP and QA report decisions.
37
- Do not infer approval from "ok", "go ahead", "do it", "approved", "continue", "leg los" or similar wording.
38
- Those phrases may express intent to proceed, but they do not unlock a gate unless the exact gate formula is present.
39
- Do not infer active scope from branch names, uncommitted workspace deltas, chat history or generated summaries when durable artefacts point elsewhere.
40
- If multiple active scopes are plausible, list the evidenced lines and route to `agdf-gate-check` or workstate clarification instead of choosing silently.
41
- After `Approval: UR`, run lightweight Brownfield Review before PRD when Brownfield, ownership, runtime, policy, persistence, architecture, UI or UX impact is possible.
42
- Brownfield Review must produce a Mode/Slice Decision: `quick_task`, `verified_change`, `structured_slice`, `structured_delivery` or `block`.
43
- That same review records the shared UI/UX impact classification. Run `agdf-ux-intent-definition` before
44
- PRD readiness for medium/high impact and for low impact with ambiguous mandatory PRD semantics. It is
45
- an internal analytical step, not a gate or product authority; a required blocked result keeps PRD
46
- readiness closed.
47
- Make that decision visible before coding or drafting later artefacts: state the selected path, scope reason, evidence and next required gate in the live control state or linked artefact.
48
- Do not assume the full PRD/SD/TP chain before that decision; use only as much gate depth as the reviewed change size justifies. A user-visible change is not automatically Verified Change eligible; any missing or ambiguous record condition escalates to the declared structured target before implementation.
49
-
50
- Quick Task Mode must still use the Runtime Contract mini-output: `result`, `evidence`, `risk`, `next_step`.
51
- Narrow defect work may use the Runtime Contract's Bug Lightweight Track only when a durable bug artefact or linked authoritative issue carries reproduction, actual behavior, expected behavior, fix boundary and evidence plan.
52
- Structured Delivery Mode must respect gates, reviews and closeout discipline.
53
-
54
- ## Skill Routing
55
- | Skill | Use For | Boundary |
56
- |---|---|---|
57
- | `agdf-delivery-path-search` | high-impact planning decisions with several plausible next delivery steps before implementation | read-only advisory search; never grants gate permission or replaces gate-check |
58
- | `agdf-brownfield-analysis` | after gate-check permits Brownfield Review or implementation preparation, before non-trivial changes in existing systems | clarifies reuse, owners, risks and Mode/Slice Decision; never bypasses gate-check; Brownfield Review is not implementation permission |
59
- | `agdf-ux-intent-definition` | after approved UR and post-UR routing for medium/high UI/UX impact or ambiguous low-impact product semantics before PRD readiness | non-authorizing analytical PRD input; never creates product intent, gate permission, technical design or a parallel product source of truth |
60
- | `agdf-clean-implementation-review` | evidence dimension: inspect whether the solution is structurally clean | supports Quality Readiness; not a TP or QA substitute |
61
- | `agdf-code-review` | evidence dimension: review the actual diff for defects, regression and security findings | supports Quality Readiness; does not replace QA |
62
- | `agdf-delivery-closeout` | commit/PR-near handoff after QA/OR/UAT | never performs VCS actions automatically |
63
- | `agdf-gate-check` | new build/change intent, unclear approval, Structured Delivery, later-gate artefact requested | does not create later artefacts or skip Mode/Slice Decision after Brownfield Review |
64
- | `agdf-qa-gate` | sole final Quality Readiness decision | only instance for `pass | revise | block` |
65
- | `agdf-release-or` | auditable closeout for every relevant run | not a QA substitute |
66
- | `agdf-task-plan-review` | evidence dimension: verify whether the approved Task Plan was fulfilled | supports Quality Readiness; no final QA decision |
67
-
68
- Select exactly one primary skill first.
69
- Add more only when they cover a distinct concrete risk dimension.
70
- Do not choose `agdf-brownfield-analysis` as the first primary skill for a fresh "I want to build/change X" prompt unless `agdf-gate-check` or existing live AGDF control state already makes implementation preparation the next allowed action.
71
- Never jump directly from `Approval: UR`, implicit consent, or a generic "start" request to implementation. Route to Brownfield Review, then a visible Mode/Slice Decision with evidence, then the smallest safe next gate or Quick Task execution.
72
-
73
- ## Runtime Contract
74
- For repeated output, gate, Quality Contract and Context Graph rules, use:
75
-
76
- - `contracts/task-target-resolution.md` for primary target authority before repository activation
77
- - `contracts/gate-transition.md` for gate terms, Brownfield routing and transition rules
78
- - `contracts/interaction.md` for status cards, approval orientation and native interaction
79
- - `contracts/modes.md` for delivery-mode boundaries
80
- - `contracts/quality.md` for quality and output discipline
81
- - `contracts/context-graph.md` for persistence and reconciliation
82
- - `contracts/control-scaffold.md` for run state, CLI verification and Delivery Map
83
- - `contracts/closeout.md` for relevant-run and closeout boundaries
84
-
85
- `agdf-runtime-contract.md` remains the compatibility manifest for these modules.
86
-
87
- Skills may include short reminders, but they must not carry a second complete rule or code table.
88
-
89
- ## Durable Control State
90
- When the target repository uses the AGDF control scaffold, keep live control files under `.agdf/control/`.
91
- Use templates as starting points only.
92
-
93
- Do not let chat history become the source of truth for gate state, approvals, evidence, backlog status or durable Brownfield knowledge.
94
-
95
- AGDF is agent-native first and CLI-verifiable by design: read the live control state, apply the active skill and make the next allowed step explicit.
96
- Use `init` only when durable control state is explicitly requested, the repository already uses `.agdf/control/` as its live AGDF working state, or a deterministic CLI/CI setup path is being executed.
97
- Use `doctor --json`, `gate-check --json` or `delivery-map --json` as deterministic validators for CI, PR evidence, regression checks or audit trails, not as a substitute for the router or skills.
98
- At run closeout, route new durable knowledge explicitly as `context_graph`, `sot_registry`, `scope_artifact`, `open_questions` or `none`.
99
-
100
- ## Closeout
101
- For Quick Task Mode, close with the Runtime Contract mini-output only:
102
-
103
- - `result`
104
- - `evidence`
105
- - `risk`
106
- - `next_step`
107
-
108
- For relevant runs that change durable state, code, artefacts or gate status:
109
-
110
- - run relevant checks or state the test gap
111
- - never commit, push or open a PR automatically
112
- - include exactly one `Next step:`
113
- - include exactly one `Quality outlook:`