create-agdf 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md ADDED
@@ -0,0 +1,30 @@
1
+ # create-agdf
2
+
3
+ Bootstrap AGDF for one repository.
4
+
5
+ ## Usage
6
+
7
+ ```bash
8
+ npm create agdf@latest copilot
9
+ npm create agdf@latest claude
10
+ npm create agdf@latest both
11
+ ```
12
+
13
+ Optional flags:
14
+
15
+ - `--dir <path>` write into a specific directory
16
+ - `--force` overwrite existing generated files
17
+
18
+ ## Targets
19
+
20
+ - `copilot` writes `AGENTS.md` and `.github/copilot-instructions.md`
21
+ - `claude` writes `AGENTS.md` and prints the Claude plugin installation step
22
+ - `both` writes both instruction files and prints both next steps
23
+
24
+ ## Publishing
25
+
26
+ The repository publishes this package from `create-agdf/` via the GitHub Actions workflow `.github/workflows/publish-create-agdf.yml`.
27
+
28
+ - Create or update the version in `create-agdf/package.json`
29
+ - Push a matching git tag in the form `create-agdf-v<version>`
30
+ - Ensure the repository secret `NPM_TOKEN` exists with publish rights for `create-agdf`
@@ -0,0 +1,162 @@
1
+ #!/usr/bin/env node
2
+
3
+ import { existsSync, mkdirSync, readFileSync, writeFileSync } from "node:fs";
4
+ import { dirname, join, resolve } from "node:path";
5
+ import { fileURLToPath } from "node:url";
6
+ import process from "node:process";
7
+
8
+ const __dirname = dirname(fileURLToPath(import.meta.url));
9
+ const packageRoot = resolve(__dirname, "..");
10
+ const templatesRoot = join(packageRoot, "templates");
11
+ const pluginInstallCommand = "claude plugin add arndtgold/ai-native-governance-delivery-framework";
12
+ const allowedTargets = new Set(["copilot", "claude", "both"]);
13
+
14
+ function printUsage() {
15
+ console.log(`create-agdf
16
+
17
+ Usage:
18
+ npm create agdf@latest copilot
19
+ npm create agdf@latest claude
20
+ npm create agdf@latest both
21
+
22
+ Options:
23
+ --dir <path> Write files into a specific directory
24
+ --force Overwrite existing generated files
25
+ --help Show this help
26
+ `);
27
+ }
28
+
29
+ function parseArgs(argv) {
30
+ const args = [...argv];
31
+ let target;
32
+ let dir = ".";
33
+ let force = false;
34
+
35
+ for (let i = 0; i < args.length; i += 1) {
36
+ const arg = args[i];
37
+ if (!arg) continue;
38
+
39
+ if (arg === "--help" || arg === "-h") {
40
+ printUsage();
41
+ process.exit(0);
42
+ }
43
+
44
+ if (arg === "--force") {
45
+ force = true;
46
+ continue;
47
+ }
48
+
49
+ if (arg === "--dir") {
50
+ const next = args[i + 1];
51
+ if (!next) {
52
+ console.error("Missing value for --dir");
53
+ process.exit(1);
54
+ }
55
+ dir = next;
56
+ i += 1;
57
+ continue;
58
+ }
59
+
60
+ if (arg === "--target" || arg === "-t") {
61
+ const next = args[i + 1];
62
+ if (!next) {
63
+ console.error("Missing value for --target");
64
+ process.exit(1);
65
+ }
66
+ target = next;
67
+ i += 1;
68
+ continue;
69
+ }
70
+
71
+ if (!arg.startsWith("-") && !target) {
72
+ target = arg;
73
+ continue;
74
+ }
75
+
76
+ console.error(`Unknown argument: ${arg}`);
77
+ process.exit(1);
78
+ }
79
+
80
+ if (!target || !allowedTargets.has(target)) {
81
+ console.error("Please choose one target: copilot, claude, or both.");
82
+ printUsage();
83
+ process.exit(1);
84
+ }
85
+
86
+ return {
87
+ target,
88
+ dir: resolve(process.cwd(), dir),
89
+ force,
90
+ };
91
+ }
92
+
93
+ function loadTemplate(relativePath) {
94
+ return readFileSync(join(templatesRoot, relativePath), "utf8");
95
+ }
96
+
97
+ function writeGeneratedFile(targetDir, relativePath, content, force) {
98
+ const outputPath = join(targetDir, relativePath);
99
+ mkdirSync(dirname(outputPath), { recursive: true });
100
+
101
+ if (existsSync(outputPath) && !force) {
102
+ throw new Error(`Refusing to overwrite existing file: ${relativePath}. Re-run with --force if you want to replace it.`);
103
+ }
104
+
105
+ writeFileSync(outputPath, content, "utf8");
106
+ }
107
+
108
+ function generatedFilesForTarget(target) {
109
+ const files = [
110
+ {
111
+ path: "AGENTS.md",
112
+ content: loadTemplate("AGENTS.md"),
113
+ },
114
+ ];
115
+
116
+ if (target === "copilot" || target === "both") {
117
+ files.push({
118
+ path: join(".github", "copilot-instructions.md"),
119
+ content: loadTemplate(join(".github", "copilot-instructions.md")),
120
+ });
121
+ }
122
+
123
+ return files;
124
+ }
125
+
126
+ function printNextSteps(target, destination, files) {
127
+ console.log("");
128
+ console.log(`AGDF bootstrap complete in ${destination}`);
129
+ console.log("");
130
+ console.log("Generated:");
131
+ for (const file of files) {
132
+ console.log(`- ${file.path}`);
133
+ }
134
+
135
+ console.log("");
136
+ console.log("Next steps:");
137
+ if (target === "claude" || target === "both") {
138
+ console.log(`- Install the Claude Code plugin: ${pluginInstallCommand}`);
139
+ }
140
+ if (target === "copilot" || target === "both") {
141
+ console.log("- In GitHub Copilot CLI, run /instructions to confirm that the repository instructions are loaded.");
142
+ }
143
+ console.log("- Commit the generated files so the repository becomes the source of truth.");
144
+ }
145
+
146
+ function main() {
147
+ const options = parseArgs(process.argv.slice(2));
148
+ const files = generatedFilesForTarget(options.target);
149
+
150
+ try {
151
+ for (const file of files) {
152
+ writeGeneratedFile(options.dir, file.path, file.content, options.force);
153
+ }
154
+ } catch (error) {
155
+ console.error(error.message);
156
+ process.exit(1);
157
+ }
158
+
159
+ printNextSteps(options.target, options.dir, files);
160
+ }
161
+
162
+ main();
package/package.json ADDED
@@ -0,0 +1,34 @@
1
+ {
2
+ "name": "create-agdf",
3
+ "version": "0.1.0",
4
+ "description": "Bootstrap AGDF for GitHub Copilot, Claude Code, or both.",
5
+ "type": "module",
6
+ "files": [
7
+ "bin",
8
+ "templates",
9
+ "README.md"
10
+ ],
11
+ "bin": {
12
+ "create-agdf": "./bin/create-agdf.js"
13
+ },
14
+ "scripts": {
15
+ "smoke-test": "node ./scripts/smoke-test.js"
16
+ },
17
+ "keywords": [
18
+ "agdf",
19
+ "copilot",
20
+ "claude-code",
21
+ "scaffold",
22
+ "bootstrap"
23
+ ],
24
+ "license": "Apache-2.0",
25
+ "publishConfig": {
26
+ "access": "public"
27
+ },
28
+ "repository": {
29
+ "type": "git",
30
+ "url": "git+https://github.com/ArndtGold/ai-native-governance-delivery-framework.git",
31
+ "directory": "create-agdf"
32
+ },
33
+ "homepage": "https://github.com/ArndtGold/ai-native-governance-delivery-framework/tree/main/create-agdf"
34
+ }
@@ -0,0 +1,31 @@
1
+ # AGDF for GitHub Copilot
2
+
3
+ This repository supports GitHub Copilot CLI and the Copilot Coding Agent through checked-in repository instructions.
4
+
5
+ ## Primary instruction sources
6
+
7
+ 1. Follow `AGENTS.md` as the main operating model.
8
+ 2. Use `plugin/meta/agdf-runtime-contract.md` for repeated gate, quality-contract, and closeout output rules when this repository also contains the AGDF runtime files.
9
+ 3. Reuse the AGDF skill names as prompt entrypoints: `agdf-gate-check`, `agdf-brownfield-analysis`, `agdf-task-plan-review`, `agdf-clean-implementation-review`, `agdf-qa-gate`, `agdf-release-or`, `agdf-delivery-closeout`.
10
+
11
+ ## Working mode
12
+
13
+ - Default to **Quick Task Mode** for small questions, reviews, debugging, and local fixes without new product semantics.
14
+ - Escalate to **Structured Delivery Mode** for new capabilities, architecture or policy changes, persistence changes, release-critical work, or formal artefacts.
15
+
16
+ ## Copilot prompt entrypoints
17
+
18
+ Use natural-language prompts such as:
19
+
20
+ - `Run an AGDF gate check for this request.`
21
+ - `Perform an AGDF brownfield analysis before implementation.`
22
+ - `Review the completed work against the AGDF task plan expectations.`
23
+ - `Make the AGDF QA gate decision from the available evidence.`
24
+
25
+ ## Rules
26
+
27
+ - Respect the gate order and exact approval formula from `AGENTS.md`.
28
+ - Do not treat implicit consent as approval.
29
+ - Prefer evidence over assumptions.
30
+ - In brownfield work, reuse before create and avoid silent parallel structures.
31
+ - After relevant work, include exactly one `Next step:` and exactly one `Quality outlook:`.
@@ -0,0 +1,64 @@
1
+ # AGENTS.md
2
+
3
+ ## Role
4
+ You are an autonomous agent operating in an AGDF-governed delivery system.
5
+ Your goal is not to produce answers. Your goal is to create trustworthy progress:
6
+ reduce uncertainty, establish evidence, maintain artefacts, verify outcomes, and make the next step explicit.
7
+
8
+ ## Operating Modes
9
+ | Mode | Use When | Required |
10
+ |---|---|---|
11
+ | Quick Task Mode | Questions, short reviews, local debugging, small fixes without new product semantics | Understand the local context, cite evidence, run relevant checks or name the gap, close briefly |
12
+ | Structured Delivery Mode | New user capability, architecture/policy/persistence impact, release-critical work, formal artefacts, or explicit approvals | Respect gates, separate artefacts, make internal reviews visible, do not merge QA and OR |
13
+
14
+ Quick Task Mode remains the default unless the request creates new product scope or asks for formal gate artefacts.
15
+
16
+ ## Operating Model
17
+ Work in this order:
18
+
19
+ `Uncertainty Reduction -> Evidence -> Artefacts -> Verification -> Outcome`
20
+
21
+ Evidence overrides assumptions and memory. If evidence is missing, state the uncertainty instead of smoothing it over.
22
+
23
+ ## Gates
24
+ - User gates: `UR -> PRD -> SD -> TP -> QA -> UAT`.
25
+ - A user approval is valid only in this exact format: `Approval: <GateName>`.
26
+ - Legacy German runs may be interpreted if they use `Freigabe: <GateName>`, but new artefacts must show `Approval: <GateName>`.
27
+ - Implicit consent such as `ok`, `go`, `approved`, or similar wording is not approval.
28
+ - Internal mandatory steps: `Brownfield Analysis -> CD+Tests -> CR -> OR`.
29
+ - `CD+Tests` is not a done, QA, or release signal.
30
+ - `agdf-qa-gate` is the only final QA decision for `pass | revise | block`.
31
+ - `agdf-release-or` is mandatory at the end of relevant runs.
32
+
33
+ ## Brownfield Rules
34
+ - Brownfield is the normal case.
35
+ - Before non-trivial implementation in an existing system, inspect existing artefacts, ownership, behaviour, and tests.
36
+ - Reuse-before-create and minimal clean slice take precedence over new structure.
37
+ - No silent parallel structures, no second SoT, no unjustified fallbacks.
38
+ - SoT/runtime/product-semantics drift must be named explicitly and can trigger an early product gate.
39
+
40
+ ## Skill Routing
41
+ | Skill | Use For | Boundary |
42
+ |---|---|---|
43
+ | `agdf-gate-check` | unclear approval, Structured Delivery, later-gate artefact requested | does not create later artefacts |
44
+ | `agdf-brownfield-analysis` | before non-trivial implementation in existing systems | clarifies reuse, owners, risks |
45
+ | `agdf-task-plan-review` | after implementation and before QA, verify TP coverage | no final QA decision |
46
+ | `agdf-clean-implementation-review` | inspect workarounds, fallbacks, parallel structures, or symptom fixes | not a TP or QA substitute |
47
+ | `agdf-qa-gate` | final QA decision | only instance for `pass | revise | block` |
48
+ | `agdf-release-or` | auditable closeout for every relevant run | not a QA substitute |
49
+ | `agdf-delivery-closeout` | commit/PR-near handoff after QA/OR/UAT | never performs VCS actions automatically |
50
+
51
+ Select exactly one primary skill first. Add more only when they cover a distinct concrete risk dimension.
52
+
53
+ ## Skill Contract
54
+ For repeated output, gate, Quality Contract, and Context Graph rules, use:
55
+ `plugin/meta/agdf-runtime-contract.md`
56
+
57
+ Skills may include short runtime reminders, but must not carry a second complete rule or code table.
58
+
59
+ ## Closeout
60
+ After relevant code, documentation, skill, or governance changes:
61
+ - run relevant checks or state the test gap
62
+ - never commit, push, or open a PR automatically
63
+ - include exactly one `Next step:`
64
+ - include exactly one `Quality outlook:`