create-agdf 0.2.5 → 0.2.7

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
@@ -17,6 +17,9 @@ Optional flags:
17
17
 
18
18
  - `--dir <path>` write into a specific directory
19
19
  - `--force` overwrite existing generated files
20
+ - `--language <de|en>` or `--lang <de|en>` persist the preferred AGDF artefact and chat language
21
+
22
+ If no language is provided, `create-agdf` derives the preference from the local system locale (`LC_ALL`, `LC_MESSAGES`, `LANG`, `LANGUAGE` or the Node.js runtime locale) and falls back to `en`.
20
23
 
21
24
  ## Targets and existing AGENTS.md
22
25
 
@@ -41,7 +44,7 @@ The generated `.agdf/control/templates/` files are reusable starting points for
41
44
  - `CONTEXT_GRAPH.md` for durable Brownfield findings, decisions, risks, evidence and exit criteria
42
45
  - `AGENT_QUALITY_CONTRACTS.json` for reusable block, revise and warning conditions
43
46
 
44
- Use `init` to promote those templates into live control files:
47
+ Use `init` to promote those templates into live control files when the repository should own durable AGDF control state:
45
48
 
46
49
  ```bash
47
50
  npm create agdf@latest init
@@ -51,6 +54,7 @@ This writes:
51
54
 
52
55
  - `.agdf/control/AGDF_RUN.md`
53
56
  - `.agdf/control/MASTER_BACKLOG.md`
57
+ - `.agdf/control/config.json`
54
58
  - `.agdf/control/templates/artefacts/UR.md`
55
59
  - `.agdf/control/templates/artefacts/PRD.md`
56
60
  - `.agdf/control/templates/artefacts/SD.md`
@@ -60,6 +64,8 @@ This writes:
60
64
  - `.agdf/control/CONTEXT_GRAPH.md`
61
65
  - `.agdf/control/AGENT_QUALITY_CONTRACTS.json`
62
66
 
67
+ `config.json` stores `artifact_language` and `chat_language` for governed work in the target repository. Runtime rules stay English so all AGDF surfaces share the same control contract.
68
+
63
69
  Use `doctor` to check whether the live control state is actionable:
64
70
 
65
71
  ```bash
@@ -78,7 +84,7 @@ npm create agdf@latest gate-check --json
78
84
 
79
85
  The gate check reports `open | blocked`, the current gate, blocking reason, missing exact approval, allowed outputs, forbidden outputs, next allowed action, evidence references and the embedded doctor report.
80
86
 
81
- Together, `init`, `doctor` and `gate-check --json` turn AGDF from an instruction layer into a repository control system: the agent can be guided by rules, and the repository state can be checked before the next governed step.
87
+ Together, `init`, `doctor` and `gate-check --json` turn AGDF from an instruction layer into a repository control system when durable control state is needed. For normal fresh requests, the agent-native path can stay lighter: draft the minimal UR in the response, request `Approval: UR`, and use CLI validators only when machine-readable proof is useful.
82
88
 
83
89
  ## Single source of truth
84
90
 
@@ -128,17 +128,72 @@ Usage:
128
128
  Options:
129
129
  --dir <path> Write files into a specific directory
130
130
  --force Overwrite existing generated files
131
+ --language <de|en>
132
+ Set AGDF chat and artefact language. Defaults to detected system locale.
133
+ --lang <de|en> Alias for --language
131
134
  --json Print doctor, gate-check or delivery-map output as JSON
132
135
  --help Show this help
133
136
  `);
134
137
  }
135
138
 
139
+ function normalizeLanguage(value) {
140
+ const normalized = String(value ?? "").trim().toLowerCase().replace("_", "-");
141
+ if (!normalized) return "";
142
+ if (normalized.startsWith("de")) return "de";
143
+ if (normalized.startsWith("en")) return "en";
144
+ return "";
145
+ }
146
+
147
+ function detectSystemLocale() {
148
+ const envLocale = process.env.LC_ALL || process.env.LC_MESSAGES || process.env.LANG || process.env.LANGUAGE || "";
149
+ if (envLocale) return envLocale;
150
+ try {
151
+ return Intl.DateTimeFormat().resolvedOptions().locale || "";
152
+ } catch {
153
+ return "";
154
+ }
155
+ }
156
+
157
+ function resolveLanguagePreference(explicitLanguage) {
158
+ const explicit = normalizeLanguage(explicitLanguage);
159
+ if (explicit) {
160
+ return {
161
+ artifact_language: explicit,
162
+ chat_language: explicit,
163
+ runtime_language: "en",
164
+ source: "parameter",
165
+ detected_locale: detectSystemLocale() || "unknown",
166
+ };
167
+ }
168
+
169
+ const detectedLocale = detectSystemLocale();
170
+ const detected = normalizeLanguage(detectedLocale) || "en";
171
+ return {
172
+ artifact_language: detected,
173
+ chat_language: detected,
174
+ runtime_language: "en",
175
+ source: detectedLocale ? "system_locale" : "default",
176
+ detected_locale: detectedLocale || "unknown",
177
+ };
178
+ }
179
+
180
+ function languageConfigContent(languagePreference) {
181
+ return `${JSON.stringify({
182
+ artifact_language: languagePreference.artifact_language,
183
+ chat_language: languagePreference.chat_language,
184
+ runtime_language: languagePreference.runtime_language,
185
+ source: languagePreference.source,
186
+ detected_locale: languagePreference.detected_locale,
187
+ }, null, 2)}\n`;
188
+ }
189
+
136
190
  function parseArgs(argv) {
137
191
  const args = [...argv];
138
192
  let target;
139
193
  let dir = ".";
140
194
  let force = false;
141
195
  let json = false;
196
+ let language;
142
197
 
143
198
  for (let i = 0; i < args.length; i += 1) {
144
199
  const arg = args[i];
@@ -159,6 +214,22 @@ function parseArgs(argv) {
159
214
  continue;
160
215
  }
161
216
 
217
+ if (arg === "--language" || arg === "--lang") {
218
+ const next = args[i + 1];
219
+ if (!next) {
220
+ console.error(`Missing value for ${arg}`);
221
+ process.exit(1);
222
+ }
223
+ const normalized = normalizeLanguage(next);
224
+ if (!normalized) {
225
+ console.error("Unsupported language. Use --language de or --language en.");
226
+ process.exit(1);
227
+ }
228
+ language = normalized;
229
+ i += 1;
230
+ continue;
231
+ }
232
+
162
233
  if (arg === "--dir") {
163
234
  const next = args[i + 1];
164
235
  if (!next) {
@@ -201,6 +272,7 @@ function parseArgs(argv) {
201
272
  dir: resolve(process.cwd(), dir),
202
273
  force,
203
274
  json,
275
+ language: resolveLanguagePreference(language),
204
276
  };
205
277
  }
206
278
 
@@ -219,10 +291,18 @@ function writeGeneratedFile(targetDir, relativePath, content, force) {
219
291
  writeFileSync(outputPath, content, "utf8");
220
292
  }
221
293
 
222
- function generatedFilesForTarget(target, targetDir, force) {
294
+ function addLanguageConfig(files, languagePreference) {
295
+ files.push({
296
+ path: join(".agdf", "control", "config.json"),
297
+ content: languageConfigContent(languagePreference),
298
+ });
299
+ }
300
+
301
+ function generatedFilesForTarget(target, targetDir, force, languagePreference) {
223
302
  const files = [];
224
303
 
225
304
  if (target === "init") {
305
+ addLanguageConfig(files, languagePreference);
226
306
  files.push({
227
307
  path: join(".agdf", "control", "README.md"),
228
308
  content: loadAsset(join(".agdf", "control", "README.md")),
@@ -246,6 +326,7 @@ function generatedFilesForTarget(target, targetDir, force) {
246
326
  }
247
327
 
248
328
  if (target === "codex" || target === "both") {
329
+ addLanguageConfig(files, languagePreference);
249
330
  for (const codexPath of codexPluginFiles) {
250
331
  files.push({
251
332
  path: codexPath,
@@ -255,6 +336,7 @@ function generatedFilesForTarget(target, targetDir, force) {
255
336
  }
256
337
 
257
338
  if (target === "copilot" || target === "both") {
339
+ if (target !== "both") addLanguageConfig(files, languagePreference);
258
340
  const agentsTargetPath = existsSync(join(targetDir, "AGENTS.md")) && !force ? agdfFragmentPath : "AGENTS.md";
259
341
  files.push({
260
342
  path: agentsTargetPath,
@@ -297,6 +379,11 @@ function printNextSteps(target, destination, files, wroteAgentsFragment) {
297
379
 
298
380
  console.log("");
299
381
  console.log("Next steps:");
382
+ const languageConfig = files.find((file) => file.path === join(".agdf", "control", "config.json"));
383
+ if (languageConfig) {
384
+ const language = JSON.parse(languageConfig.content);
385
+ console.log(`- AGDF language preference: artefacts=${language.artifact_language}, chat=${language.chat_language}, runtime=${language.runtime_language}.`);
386
+ }
300
387
  if (target === "init") {
301
388
  console.log("- Fill .agdf/control/AGDF_RUN.md with the current gate, evidence and next allowed action.");
302
389
  console.log("- Run npm create agdf@latest doctor to check the control state before the next agent run.");
@@ -419,7 +506,7 @@ function evaluateDoctor(targetDir) {
419
506
  ? "Live control file is missing; only the template exists."
420
507
  : "Required live control file is missing.",
421
508
  relativePath,
422
- "Run npm create agdf@latest init, then fill the live control files with the current repository state.",
509
+ "Run npm create agdf@latest init only when the repository should own durable AGDF control state or deterministic setup is explicitly needed.",
423
510
  );
424
511
  }
425
512
 
@@ -1026,18 +1113,32 @@ function evaluateGateCheck(targetDir) {
1026
1113
  ? transitionDecision.next_allowed_action
1027
1114
  : runState.next_allowed_action;
1028
1115
 
1029
- if (doctorBlocker) {
1116
+ if (doctorBlocker?.code === "AGDF_CONTROL_FILE_MISSING") {
1117
+ status = "blocked";
1118
+ blockingReason = doctorBlocker.code;
1119
+ currentGate = "UR";
1120
+ missingApproval = "Approval: UR";
1121
+ allowed = [
1122
+ "draft the minimal UR for the requested change in the response",
1123
+ "request exact approval: Approval: UR",
1124
+ "run npm create agdf@latest init only when durable control state or deterministic setup is explicitly needed",
1125
+ ];
1126
+ forbidden = ["create PRD", "create SD", "create TP", "run Brownfield Analysis", "implement code", "claim QA or release readiness"];
1127
+ nextAllowedAction = "Draft the minimal UR for the request in the response, then ask for exact approval: Approval: UR. Do not write a full .agdf/control scaffold unless durable control state or deterministic setup is explicitly needed.";
1128
+ } else if (doctorBlocker) {
1030
1129
  status = "blocked";
1031
1130
  blockingReason = doctorBlocker.code;
1032
- allowed = ["repair the AGDF control scaffold", "run doctor again"];
1033
- forbidden = ["continue governed delivery", "create later-gate artefacts", "implement gated work"];
1131
+ allowed = ["repair the AGDF control scaffold", ...transitionDecision.allowed, "run doctor again"];
1132
+ forbidden = ["create later-gate artefacts beyond the current allowed gate", "implement gated work", "claim QA or release readiness"];
1034
1133
  nextAllowedAction = doctorBlocker.next_step;
1035
1134
  } else if (doctorRevise) {
1036
1135
  status = "blocked";
1037
1136
  blockingReason = doctorRevise.code;
1038
- allowed = [...new Set(["repair the incomplete control state", ...transitionDecision.allowed, "run doctor again"])];
1039
- forbidden = ["continue governed delivery", "create later-gate artefacts", "implement gated work"];
1040
- nextAllowedAction = doctorRevise.next_step;
1137
+ allowed = [...new Set(["complete the current control-state fields", ...transitionDecision.allowed, "run doctor again"])];
1138
+ forbidden = ["create later-gate artefacts beyond the current allowed gate", "implement gated work before the gate allows it", "claim QA or release readiness"];
1139
+ nextAllowedAction = transitionDecision.current_gate === "UR"
1140
+ ? "Fill the current UR control state, persist the UR draft, and request exact approval: Approval: UR."
1141
+ : doctorRevise.next_step;
1041
1142
  }
1042
1143
 
1043
1144
  return {
@@ -1183,7 +1284,7 @@ function main() {
1183
1284
  process.exit(report.status === "block" ? 2 : 0);
1184
1285
  }
1185
1286
 
1186
- const files = generatedFilesForTarget(options.target, options.dir, options.force);
1287
+ const files = generatedFilesForTarget(options.target, options.dir, options.force, options.language);
1187
1288
  const wroteAgentsFragment = files.some(file => file.path === agdfFragmentPath);
1188
1289
 
1189
1290
  try {
@@ -8,6 +8,7 @@ Use this scaffold when a target repository should keep AGDF state outside chat h
8
8
 
9
9
  | File | Purpose |
10
10
  |---|---|
11
+ | `config.json` | Project language preference for generated AGDF artefacts and user-facing chat |
11
12
  | `templates/AGDF_RUN.md` | Template for current run state: mode, gate, approvals, evidence, risks, next allowed action |
12
13
  | `templates/MASTER_BACKLOG.md` | Template for the living backlog pointer: active initiatives and current UR/Brownfield/PRD/SD/TP/QA/OR artefacts |
13
14
  | `templates/artefacts/UR.md` | Template for the durable user requirement artefact of a work item |
@@ -26,6 +27,7 @@ Use this scaffold when a target repository should keep AGDF state outside chat h
26
27
  ```text
27
28
  .agdf/
28
29
  control/
30
+ config.json
29
31
  AGDF_RUN.md
30
32
  MASTER_BACKLOG.md
31
33
  artefacts/
@@ -64,6 +66,7 @@ npm create agdf@latest gate-check --json
64
66
  ## Operating Rules
65
67
 
66
68
  - `AGDF_RUN.md` is the current run dashboard.
69
+ - `config.json` stores the project preference for artefact and chat language; runtime rules stay English.
67
70
  - `MASTER_BACKLOG.md` points to active delivery work; detailed artefacts live beside the work item.
68
71
  - Brownfield Review records the post-UR Mode/Slice Decision before PRD depth or Quick Task execution is chosen.
69
72
  - UR, PRD, SD, TP and QA decisions require durable artefacts or links to the authoritative repository source of truth before the next gate can open.
@@ -5,9 +5,11 @@ AGDF is active in this repository.
5
5
  - Treat `AGENTS.md` as the primary repository instruction source.
6
6
  - Use `.github/skills/` for AGDF task workflows instead of inventing parallel process rules.
7
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.
8
9
  - Apply AGDF natively from `AGENTS.md`, repository skills and live `.agdf/control/` state before reaching for helper commands.
9
10
  - Before non-trivial implementation or formal delivery work, determine whether the request is a Quick Task or Structured Delivery.
10
11
  - If approval, evidence, ownership or the next allowed action is unclear, run the AGDF gate-check workflow before creating later artefacts or code.
11
- - Use machine-readable checks such as `doctor --json`, `gate-check --json` or `delivery-map --json` as validators, not as the primary workflow.
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.
12
13
  - Do not infer gate approval from generic consent such as "ok", "go ahead", "do it", "continue", "leg los" or "approved".
13
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.
@@ -21,9 +21,10 @@ This skill must not create later artefacts such as PRD, SD, TP, CD, CR, QA, or U
21
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
- ## Native Control Path
24
+ ## Agent-Native Control Path
25
25
 
26
- AGDF is applied natively through this skill, the agent router, and live `.agdf/control/` state.
26
+ AGDF is agent-native first and CLI-verifiable by design.
27
+ This skill is the primary operating path for gate judgement.
27
28
 
28
29
  First inspect the durable control state directly:
29
30
 
@@ -33,18 +34,23 @@ First inspect the durable control state directly:
33
34
  - `.agdf/control/CONTEXT_GRAPH.md`
34
35
  - `.agdf/control/AGENT_QUALITY_CONTRACTS.json`
35
36
 
36
- Use the executable control path when a machine-readable check is requested, when the gate state is ambiguous, or when a repository-local automation needs JSON evidence:
37
+ If required control files are missing, do not automatically create a full `.agdf/control/` scaffold for a fresh small request.
38
+ The default first action is to draft the minimal UR in the response and request `Approval: UR`.
39
+ Use `init` only when the user explicitly asks for durable AGDF control state, the repository already uses `.agdf/control/` as its live working state, or a deterministic CLI/CI setup path is being executed.
40
+
41
+ Use the executable control path when a machine-readable check is requested, when the gate state is ambiguous, when CI or PR evidence is needed, or when a repository-local automation needs JSON output:
37
42
 
38
43
  ```bash
44
+ npm create agdf@latest init
39
45
  npm create agdf@latest doctor --json
40
46
  npm create agdf@latest gate-check --json
41
47
  npm create agdf@latest delivery-map --json
42
48
  ```
43
49
 
44
- `doctor` checks whether `.agdf/control/` is actionable. `agdf-gate-check` consumes that result and `AGDF_RUN.md` to report the operative process decision: `open | blocked`, current gate, blocking reason, missing approval, allowed outputs, forbidden outputs, next allowed action and evidence references.
50
+ `init` creates the control scaffold. `doctor` checks whether `.agdf/control/` is actionable. `agdf-gate-check` consumes that result and `AGDF_RUN.md` to report the operative process decision: `open | blocked`, current gate, blocking reason, missing approval, allowed outputs, forbidden outputs, next allowed action and evidence references.
45
51
  `delivery-map` reports the durable delivery picture: active artefacts, approvals, Artefact Chain relationships, evidence refs, missing evidence, risks, Context Graph gate effect and machine-readable findings.
46
52
 
47
- The CLI reports are validators and JSON evidence, not the primary user experience and not a second rule system. If a report says `blocked`, do not continue with later-gate artefacts until the reported blocker is resolved.
53
+ The CLI reports are validators and JSON evidence, not the primary user experience, not a required ritual for normal work and not a second rule system. If a report says `blocked`, do not continue with later-gate artefacts until the reported blocker is resolved.
48
54
 
49
55
  ## Rules
50
56
  1. Fail closed when a required approval or artefact status is missing.
@@ -61,6 +67,7 @@ The CLI reports are validators and JSON evidence, not the primary user experienc
61
67
  12. Approval text and durable artefact presence are separate requirements for UR, PRD, SD, TP and QA report decisions. Approval text without the corresponding persisted or linked artefact keeps the current gate at that gate.
62
68
  13. After Brownfield Review, decide the process size before drafting PRD or implementing: `quick_task | structured_slice | structured_delivery | block`.
63
69
  14. The Mode/Slice Decision must be visible and evidenced before any Quick Task execution, PRD shortcut or implementation. A decision value without scope reason and evidence is still missing.
70
+ 15. Missing or incomplete control state must not push setup work back to the user. For a fresh request, draft the current minimal artefact in the response and request the exact approval. Initialize or write `.agdf/control/` only when durable control state is explicitly requested, already live for the repository, or required for a deterministic CLI/CI setup path. Implementation remains forbidden.
64
71
 
65
72
  ## Gate Evaluation
66
73
 
@@ -107,6 +114,7 @@ If a status is not explicit, do not assume it is satisfied.
107
114
  8. Treat a generic "start", "continue" or "leg los" request as a request to perform only the current next allowed action.
108
115
  9. After Brownfield Review, choose the smallest safe process path before creating later artefacts.
109
116
  10. If the selected path is not visibly recorded with scope reason and evidence, keep the run at `Mode/Slice Decision`.
117
+ 11. When `.agdf/control/` is missing or incomplete, make the next allowed artefact action explicit. For a fresh request, that means draft the minimal UR in the response, then request `Approval: UR`. Do not write a full control scaffold unless durable control state was explicitly requested or is already the repository's live AGDF working state.
110
118
 
111
119
  ## Output
112
120
  Keep the result short and operational:
@@ -118,6 +126,9 @@ Keep the result short and operational:
118
126
  - **Missing approval:** `Approval: <GateName> | none`
119
127
  - **Next step:** `<single permissible next step>`
120
128
 
129
+ If this skill creates or updates control artefacts, do not paste full file bodies into the chat.
130
+ List paths, summarize the decision, name the blocker or approval needed, and keep the durable content in the files.
131
+
121
132
  ## Forbidden
122
133
  This skill must not:
123
134
 
@@ -133,5 +144,6 @@ This skill must not:
133
144
  - treat "ok", "leg los", "go ahead", "approved" or similar wording as gate approval
134
145
  - perform full Brownfield Analysis unless explicitly requested
135
146
  - provide implementation snippets while implementation is gated
147
+ - paste full `.agdf/control/` files, templates or artefact bodies into the chat unless the user explicitly asks for the full content
136
148
  - present QA or UAT as passed without evidence
137
149
  - present release as allowed without QA pass and UAT approval where required
@@ -25,6 +25,21 @@ Use this compact output shape when no formal gate artefact is required:
25
25
  - `risk`: remaining risk or `none`
26
26
  - `next_step`: the single next useful action or `none`
27
27
 
28
+ Do not add a separate `Quality outlook` line for pure Quick Tasks unless the task became a relevant run.
29
+
30
+ ## Chat Output Discipline
31
+
32
+ Durable artefacts are for the repository, not for flooding the chat.
33
+ When a skill creates or updates `.agdf/control/` files, gate artefacts, reviews, QA reports or OR reports, the chat response must stay compact:
34
+
35
+ - name the artefact path and status
36
+ - summarize the decision or content in a few lines
37
+ - state the current gate, forbidden work and next permissible step
38
+ - mention validation evidence when available
39
+
40
+ Do not paste full control files, full artefact bodies, full templates or full generated reports into the chat unless the user explicitly asks to see the full content.
41
+ For larger or more formal work, create or update the durable artefacts fully, then reference them by path and summarize what changed.
42
+
28
43
  ## Relevant Run
29
44
 
30
45
  A relevant run is any run that changes durable state, creates or updates an AGDF artefact, changes code or runtime behaviour, performs a gate decision, blocks on a governance condition, produces QA/UAT/release evidence, or closes a delivery slice.
@@ -43,6 +58,7 @@ When in doubt, use a short OR-lite only if it clarifies gate state, evidence, ri
43
58
  - For UR, PRD, SD, TP and QA, approval and durable artefact presence are separate requirements. A gate is not satisfied by approval text alone when its artefact is missing from `.agdf/control/` or not linked to the authoritative repository SoT.
44
59
  - Approval of one user gate permits work on the next allowed gate artefact or required internal step only. It does not permit implementation unless the approved gate is `TP` and required internal implementation prerequisites are satisfied.
45
60
  - Gates must never be skipped or inferred from urgency, tone, chat history, task wording or an instruction to "start". The next allowed action is always the next unsatisfied gate or internal mandatory step.
61
+ - Missing control files or missing current-state fields do not forbid the agent from preparing the current allowed artefact. They forbid later-gate work and implementation. For a fresh request, the default allowed work is to draft a minimal UR in the response and request `Approval: UR`. Initialize or write `.agdf/control/` only when the user explicitly asks for durable AGDF control state, the repository already uses `.agdf/control/` as its live working state, or a deterministic CLI/CI setup path is being executed.
46
62
  - `Approval: UR` permits Brownfield Review after G-00 first, then a Mode/Slice Decision. It never permits implementation by itself.
47
63
  - PRD, SD and TP depth is chosen after Brownfield Review through the Mode/Slice Decision, not before existing-system impact is understood.
48
64
  - The Mode/Slice Decision must be visible before any PRD shortcut, Quick Task execution or implementation: record the decision, required next gate, scope reason and evidence in `AGDF_RUN.md` or an equivalent linked control artefact.
@@ -137,6 +153,7 @@ Do not create a new node for a mere version, a general chat summary, or a local
137
153
 
138
154
  When a repository needs durable AGDF state, use the plugin-local `control/` scaffold as the starting point.
139
155
 
156
+ - `config.json` stores project language preferences. Use `artifact_language` for generated AGDF artefacts and `chat_language` for user-facing responses unless the user explicitly asks otherwise. Runtime rules remain English.
140
157
  - `AGDF_RUN.md` is the current run dashboard.
141
158
  - `MASTER_BACKLOG.md` is the living pointer for active delivery work.
142
159
  - `BROWNFIELD_REVIEW.md` records the post-UR existing-system view and Mode/Slice Decision before PRD depth or Quick Task execution is chosen.
@@ -147,12 +164,23 @@ When a repository needs durable AGDF state, use the plugin-local `control/` scaf
147
164
 
148
165
  The scaffold is not a second documentation site. Link to authoritative artefacts instead of copying them.
149
166
 
150
- ## Native Runtime
167
+ ## Agent-Native Runtime And CLI Verification
168
+
169
+ AGDF is agent-native first and CLI-verifiable by design.
170
+
171
+ The primary operating path is the active skill plus the live `.agdf/control/` artefacts.
172
+ Agents should read the repository state, apply this Runtime Contract, create or update only the currently allowed artefact, and make the next permissible step explicit.
173
+ When control state is missing for a fresh request, keep the first step lightweight: draft the minimal UR in the response and request `Approval: UR`.
174
+ Initialize a control scaffold only when durable AGDF control state is explicitly requested, already used by the repository, or required by a deterministic CLI/CI setup path.
175
+
176
+ Helper commands are deterministic proof and automation interfaces, not the normal-work ritual:
151
177
 
152
- AGDF must work natively through the plugin router, skills and live `.agdf/control/` artefacts.
153
- Agents should read the live control state and apply the gate model directly before reaching for helper commands.
178
+ - `init` creates the machine-readable control scaffold.
179
+ - `doctor --json` checks whether `.agdf/control/` is consistent and actionable; it is not the reviewer.
180
+ - `gate-check --json` reports reproducible gate state; it does not replace the gate-check skill judgement.
181
+ - `delivery-map --json` reports the delivery picture for CI, PRs, regression checks and audit trails.
154
182
 
155
- Machine-readable commands such as `doctor --json`, `gate-check --json` and `delivery-map --json` are validators and automation interfaces.
183
+ Machine-readable outputs should stay agent-friendly: stable decisions, blocking gate or current gate, missing approval, allowed outputs, forbidden outputs, next step, evidence and findings.
156
184
  They make the repository state checkable, but they do not replace the native skill workflow or the durable control artefacts.
157
185
 
158
186
  ## Delivery Map
@@ -72,11 +72,19 @@ Use templates as starting points only.
72
72
 
73
73
  Do not let chat history become the source of truth for gate state, approvals, evidence, backlog status or durable Brownfield knowledge.
74
74
 
75
- AGDF is a native agent workflow first: read the live control state, apply the active skill and make the next allowed step explicit.
76
- Use `doctor`, `gate-check --json` or `delivery-map --json` as validators when a machine-readable proof is useful, not as a substitute for the router or skills.
75
+ 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.
76
+ 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.
77
+ 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.
77
78
 
78
79
  ## Closeout
79
- After relevant code, documentation, skill or governance changes:
80
+ For Quick Task Mode, close with the Runtime Contract mini-output only:
81
+
82
+ - `result`
83
+ - `evidence`
84
+ - `risk`
85
+ - `next_step`
86
+
87
+ For relevant runs that change durable state, code, artefacts or gate status:
80
88
 
81
89
  - run relevant checks or state the test gap
82
90
  - never commit, push or open a PR automatically
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agdf",
3
- "version": "0.2.5",
3
+ "version": "0.2.7",
4
4
  "description": "Codex-first workflow skills for gated, auditable AI-assisted software delivery.",
5
5
  "author": {
6
6
  "name": "AI-native Governance & Delivery Framework",
@@ -8,6 +8,7 @@ Use this scaffold when a target repository should keep AGDF state outside chat h
8
8
 
9
9
  | File | Purpose |
10
10
  |---|---|
11
+ | `config.json` | Project language preference for generated AGDF artefacts and user-facing chat |
11
12
  | `templates/AGDF_RUN.md` | Template for current run state: mode, gate, approvals, evidence, risks, next allowed action |
12
13
  | `templates/MASTER_BACKLOG.md` | Template for the living backlog pointer: active initiatives and current UR/Brownfield/PRD/SD/TP/QA/OR artefacts |
13
14
  | `templates/artefacts/UR.md` | Template for the durable user requirement artefact of a work item |
@@ -26,6 +27,7 @@ Use this scaffold when a target repository should keep AGDF state outside chat h
26
27
  ```text
27
28
  .agdf/
28
29
  control/
30
+ config.json
29
31
  AGDF_RUN.md
30
32
  MASTER_BACKLOG.md
31
33
  artefacts/
@@ -64,6 +66,7 @@ npm create agdf@latest gate-check --json
64
66
  ## Operating Rules
65
67
 
66
68
  - `AGDF_RUN.md` is the current run dashboard.
69
+ - `config.json` stores the project preference for artefact and chat language; runtime rules stay English.
67
70
  - `MASTER_BACKLOG.md` points to active delivery work; detailed artefacts live beside the work item.
68
71
  - Brownfield Review records the post-UR Mode/Slice Decision before PRD depth or Quick Task execution is chosen.
69
72
  - UR, PRD, SD, TP and QA decisions require durable artefacts or links to the authoritative repository source of truth before the next gate can open.
@@ -1,16 +1,20 @@
1
1
  #!/usr/bin/env bash
2
2
  # AGDF Session Start Hook
3
- # Loads the AGDF plugin router and constitution into the agent session.
3
+ # Activates a compact AGDF runtime reminder for the agent session.
4
4
 
5
5
  SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
6
- ROUTER="${SCRIPT_DIR}/../meta/agdf-agent-router.md"
7
- CONSTITUTION="${SCRIPT_DIR}/../meta/agdf-constitution.md"
6
+ META_DIR="$(cd "${SCRIPT_DIR}/../meta" && pwd)"
7
+ ROUTER="${META_DIR}/agdf-agent-router.md"
8
+ CONSTITUTION="${META_DIR}/agdf-constitution.md"
8
9
 
9
- if [ -f "$ROUTER" ]; then
10
- cat "$ROUTER"
11
- printf "\n\n"
12
- fi
10
+ cat <<EOF
11
+ AGDF active.
13
12
 
14
- if [ -f "$CONSTITUTION" ]; then
15
- cat "$CONSTITUTION"
16
- fi
13
+ Use the installed AGDF skills as workflow controls.
14
+ For a new build, change, extension, refactor, CLI, app, fix with product semantics, unclear approval, or unclear next step, use gate-check before implementation or later-gate artefacts.
15
+
16
+ Do not print the full router or constitution unless the user asks for them.
17
+ Source of truth:
18
+ - ${ROUTER}
19
+ - ${CONSTITUTION}
20
+ EOF
@@ -73,11 +73,19 @@ Use templates as starting points only.
73
73
 
74
74
  Do not let chat history become the source of truth for gate state, approvals, evidence, backlog status or durable Brownfield knowledge.
75
75
 
76
- AGDF is a native agent workflow first: read the live control state, apply the active skill and make the next allowed step explicit.
77
- Use `doctor`, `gate-check --json` or `delivery-map --json` as validators when a machine-readable proof is useful, not as a substitute for the router or skills.
76
+ 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.
77
+ 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.
78
+ 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.
78
79
 
79
80
  ## Closeout
80
- After relevant code, documentation, skill or governance changes:
81
+ For Quick Task Mode, close with the Runtime Contract mini-output only:
82
+
83
+ - `result`
84
+ - `evidence`
85
+ - `risk`
86
+ - `next_step`
87
+
88
+ For relevant runs that change durable state, code, artefacts or gate status:
81
89
 
82
90
  - run relevant checks or state the test gap
83
91
  - never commit, push or open a PR automatically
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "schemaVersion": 1,
3
3
  "id": "agdf",
4
- "version": "0.2.5",
4
+ "version": "0.2.7",
5
5
  "displayName": "AI Governance & Delivery Framework",
6
6
  "developerName": "AI-native Governance & Delivery Framework",
7
7
  "description": "Codex-first workflow skills for gated, auditable AI-assisted software delivery.",
@@ -25,6 +25,21 @@ Use this compact output shape when no formal gate artefact is required:
25
25
  - `risk`: remaining risk or `none`
26
26
  - `next_step`: the single next useful action or `none`
27
27
 
28
+ Do not add a separate `Quality outlook` line for pure Quick Tasks unless the task became a relevant run.
29
+
30
+ ## Chat Output Discipline
31
+
32
+ Durable artefacts are for the repository, not for flooding the chat.
33
+ When a skill creates or updates `.agdf/control/` files, gate artefacts, reviews, QA reports or OR reports, the chat response must stay compact:
34
+
35
+ - name the artefact path and status
36
+ - summarize the decision or content in a few lines
37
+ - state the current gate, forbidden work and next permissible step
38
+ - mention validation evidence when available
39
+
40
+ Do not paste full control files, full artefact bodies, full templates or full generated reports into the chat unless the user explicitly asks to see the full content.
41
+ For larger or more formal work, create or update the durable artefacts fully, then reference them by path and summarize what changed.
42
+
28
43
  ## Relevant Run
29
44
 
30
45
  A relevant run is any run that changes durable state, creates or updates an AGDF artefact, changes code or runtime behaviour, performs a gate decision, blocks on a governance condition, produces QA/UAT/release evidence, or closes a delivery slice.
@@ -43,6 +58,7 @@ When in doubt, use a short OR-lite only if it clarifies gate state, evidence, ri
43
58
  - For UR, PRD, SD, TP and QA, approval and durable artefact presence are separate requirements. A gate is not satisfied by approval text alone when its artefact is missing from `.agdf/control/` or not linked to the authoritative repository SoT.
44
59
  - Approval of one user gate permits work on the next allowed gate artefact or required internal step only. It does not permit implementation unless the approved gate is `TP` and required internal implementation prerequisites are satisfied.
45
60
  - Gates must never be skipped or inferred from urgency, tone, chat history, task wording or an instruction to "start". The next allowed action is always the next unsatisfied gate or internal mandatory step.
61
+ - Missing control files or missing current-state fields do not forbid the agent from preparing the current allowed artefact. They forbid later-gate work and implementation. For a fresh request, the default allowed work is to draft a minimal UR in the response and request `Approval: UR`. Initialize or write `.agdf/control/` only when the user explicitly asks for durable AGDF control state, the repository already uses `.agdf/control/` as its live working state, or a deterministic CLI/CI setup path is being executed.
46
62
  - `Approval: UR` permits Brownfield Review after G-00 first, then a Mode/Slice Decision. It never permits implementation by itself.
47
63
  - PRD, SD and TP depth is chosen after Brownfield Review through the Mode/Slice Decision, not before existing-system impact is understood.
48
64
  - The Mode/Slice Decision must be visible before any PRD shortcut, Quick Task execution or implementation: record the decision, required next gate, scope reason and evidence in `AGDF_RUN.md` or an equivalent linked control artefact.
@@ -137,6 +153,7 @@ Do not create a new node for a mere version, a general chat summary, or a local
137
153
 
138
154
  When a repository needs durable AGDF state, use the plugin-local `control/` scaffold as the starting point.
139
155
 
156
+ - `config.json` stores project language preferences. Use `artifact_language` for generated AGDF artefacts and `chat_language` for user-facing responses unless the user explicitly asks otherwise. Runtime rules remain English.
140
157
  - `AGDF_RUN.md` is the current run dashboard.
141
158
  - `MASTER_BACKLOG.md` is the living pointer for active delivery work.
142
159
  - `BROWNFIELD_REVIEW.md` records the post-UR existing-system view and Mode/Slice Decision before PRD depth or Quick Task execution is chosen.
@@ -147,12 +164,23 @@ When a repository needs durable AGDF state, use the plugin-local `control/` scaf
147
164
 
148
165
  The scaffold is not a second documentation site. Link to authoritative artefacts instead of copying them.
149
166
 
150
- ## Native Runtime
167
+ ## Agent-Native Runtime And CLI Verification
168
+
169
+ AGDF is agent-native first and CLI-verifiable by design.
170
+
171
+ The primary operating path is the active skill plus the live `.agdf/control/` artefacts.
172
+ Agents should read the repository state, apply this Runtime Contract, create or update only the currently allowed artefact, and make the next permissible step explicit.
173
+ When control state is missing for a fresh request, keep the first step lightweight: draft the minimal UR in the response and request `Approval: UR`.
174
+ Initialize a control scaffold only when durable AGDF control state is explicitly requested, already used by the repository, or required by a deterministic CLI/CI setup path.
175
+
176
+ Helper commands are deterministic proof and automation interfaces, not the normal-work ritual:
151
177
 
152
- AGDF must work natively through the plugin router, skills and live `.agdf/control/` artefacts.
153
- Agents should read the live control state and apply the gate model directly before reaching for helper commands.
178
+ - `init` creates the machine-readable control scaffold.
179
+ - `doctor --json` checks whether `.agdf/control/` is consistent and actionable; it is not the reviewer.
180
+ - `gate-check --json` reports reproducible gate state; it does not replace the gate-check skill judgement.
181
+ - `delivery-map --json` reports the delivery picture for CI, PRs, regression checks and audit trails.
154
182
 
155
- Machine-readable commands such as `doctor --json`, `gate-check --json` and `delivery-map --json` are validators and automation interfaces.
183
+ Machine-readable outputs should stay agent-friendly: stable decisions, blocking gate or current gate, missing approval, allowed outputs, forbidden outputs, next step, evidence and findings.
156
184
  They make the repository state checkable, but they do not replace the native skill workflow or the durable control artefacts.
157
185
 
158
186
  ## Delivery Map
@@ -21,9 +21,10 @@ This skill must not create later artefacts such as PRD, SD, TP, CD, CR, QA, or U
21
21
  Use `../../meta/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
- ## Native Control Path
24
+ ## Agent-Native Control Path
25
25
 
26
- AGDF is applied natively through this skill, the agent router, and live `.agdf/control/` state.
26
+ AGDF is agent-native first and CLI-verifiable by design.
27
+ This skill is the primary operating path for gate judgement.
27
28
 
28
29
  First inspect the durable control state directly:
29
30
 
@@ -33,18 +34,23 @@ First inspect the durable control state directly:
33
34
  - `.agdf/control/CONTEXT_GRAPH.md`
34
35
  - `.agdf/control/AGENT_QUALITY_CONTRACTS.json`
35
36
 
36
- Use the executable control path when a machine-readable check is requested, when the gate state is ambiguous, or when a repository-local automation needs JSON evidence:
37
+ If required control files are missing, do not automatically create a full `.agdf/control/` scaffold for a fresh small request.
38
+ The default first action is to draft the minimal UR in the response and request `Approval: UR`.
39
+ Use `init` only when the user explicitly asks for durable AGDF control state, the repository already uses `.agdf/control/` as its live working state, or a deterministic CLI/CI setup path is being executed.
40
+
41
+ Use the executable control path when a machine-readable check is requested, when the gate state is ambiguous, when CI or PR evidence is needed, or when a repository-local automation needs JSON output:
37
42
 
38
43
  ```bash
44
+ npm create agdf@latest init
39
45
  npm create agdf@latest doctor --json
40
46
  npm create agdf@latest gate-check --json
41
47
  npm create agdf@latest delivery-map --json
42
48
  ```
43
49
 
44
- `doctor` checks whether `.agdf/control/` is actionable. `gate-check` consumes that result and `AGDF_RUN.md` to report the operative process decision: `open | blocked`, current gate, blocking reason, missing approval, allowed outputs, forbidden outputs, next allowed action and evidence references.
50
+ `init` creates the control scaffold. `doctor` checks whether `.agdf/control/` is actionable. `gate-check` consumes that result and `AGDF_RUN.md` to report the operative process decision: `open | blocked`, current gate, blocking reason, missing approval, allowed outputs, forbidden outputs, next allowed action and evidence references.
45
51
  `delivery-map` reports the durable delivery picture: active artefacts, approvals, Artefact Chain relationships, evidence refs, missing evidence, risks, Context Graph gate effect and machine-readable findings.
46
52
 
47
- The CLI reports are validators and JSON evidence, not the primary user experience and not a second rule system. If a report says `blocked`, do not continue with later-gate artefacts until the reported blocker is resolved.
53
+ The CLI reports are validators and JSON evidence, not the primary user experience, not a required ritual for normal work and not a second rule system. If a report says `blocked`, do not continue with later-gate artefacts until the reported blocker is resolved.
48
54
 
49
55
  ## Rules
50
56
  1. Fail closed when a required approval or artefact status is missing.
@@ -61,6 +67,7 @@ The CLI reports are validators and JSON evidence, not the primary user experienc
61
67
  12. Approval text and durable artefact presence are separate requirements for UR, PRD, SD, TP and QA report decisions. Approval text without the corresponding persisted or linked artefact keeps the current gate at that gate.
62
68
  13. After Brownfield Review, decide the process size before drafting PRD or implementing: `quick_task | structured_slice | structured_delivery | block`.
63
69
  14. The Mode/Slice Decision must be visible and evidenced before any Quick Task execution, PRD shortcut or implementation. A decision value without scope reason and evidence is still missing.
70
+ 15. Missing or incomplete control state must not push setup work back to the user. For a fresh request, draft the current minimal artefact in the response and request the exact approval. Initialize or write `.agdf/control/` only when durable control state is explicitly requested, already live for the repository, or required for a deterministic CLI/CI setup path. Implementation remains forbidden.
64
71
 
65
72
  ## Gate Evaluation
66
73
 
@@ -107,6 +114,7 @@ If a status is not explicit, do not assume it is satisfied.
107
114
  8. Treat a generic "start", "continue" or "leg los" request as a request to perform only the current next allowed action.
108
115
  9. After Brownfield Review, choose the smallest safe process path before creating later artefacts.
109
116
  10. If the selected path is not visibly recorded with scope reason and evidence, keep the run at `Mode/Slice Decision`.
117
+ 11. When `.agdf/control/` is missing or incomplete, make the next allowed artefact action explicit. For a fresh request, that means draft the minimal UR in the response, then request `Approval: UR`. Do not write a full control scaffold unless durable control state was explicitly requested or is already the repository's live AGDF working state.
110
118
 
111
119
  ## Output
112
120
  Keep the result short and operational:
@@ -118,6 +126,9 @@ Keep the result short and operational:
118
126
  - **Missing approval:** `Approval: <GateName> | none`
119
127
  - **Next step:** `<single permissible next step>`
120
128
 
129
+ If this skill creates or updates control artefacts, do not paste full file bodies into the chat.
130
+ List paths, summarize the decision, name the blocker or approval needed, and keep the durable content in the files.
131
+
121
132
  ## Forbidden
122
133
  This skill must not:
123
134
 
@@ -133,5 +144,6 @@ This skill must not:
133
144
  - treat "ok", "leg los", "go ahead", "approved" or similar wording as gate approval
134
145
  - perform full Brownfield Analysis unless explicitly requested
135
146
  - provide implementation snippets while implementation is gated
147
+ - paste full `.agdf/control/` files, templates or artefact bodies into the chat unless the user explicitly asks for the full content
136
148
  - present QA or UAT as passed without evidence
137
149
  - present release as allowed without QA pass and UAT approval where required
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-agdf",
3
- "version": "0.2.5",
3
+ "version": "0.2.7",
4
4
  "description": "Bootstrap AGDF repository-local plugin files, Copilot instructions, skills, control files and machine-readable checks.",
5
5
  "type": "module",
6
6
  "files": [