@ambystech/ambykit 0.1.1 → 1.0.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 +49 -33
- package/dist/cli/add.js +3 -3
- package/dist/cli/add.js.map +1 -1
- package/dist/cli/base-command.d.ts +15 -1
- package/dist/cli/base-command.js +44 -1
- package/dist/cli/base-command.js.map +1 -1
- package/dist/cli/check.js +2 -2
- package/dist/cli/check.js.map +1 -1
- package/dist/cli/dashboard.js +1 -1
- package/dist/cli/dashboard.js.map +1 -1
- package/dist/cli/index.js +45 -17
- package/dist/cli/index.js.map +1 -1
- package/dist/cli/init.d.ts +2 -0
- package/dist/cli/init.js +21 -8
- package/dist/cli/init.js.map +1 -1
- package/dist/cli/io/fsops.d.ts +42 -0
- package/dist/cli/io/fsops.js +174 -0
- package/dist/cli/io/fsops.js.map +1 -0
- package/dist/cli/io/version-check.d.ts +18 -0
- package/dist/cli/io/version-check.js +73 -0
- package/dist/cli/io/version-check.js.map +1 -0
- package/dist/cli/restore.d.ts +12 -0
- package/dist/cli/restore.js +51 -0
- package/dist/cli/restore.js.map +1 -0
- package/dist/cli/sync.js +2 -2
- package/dist/cli/sync.js.map +1 -1
- package/dist/cli/{banner.d.ts → ui/banner.d.ts} +1 -1
- package/dist/cli/{banner.js → ui/banner.js} +2 -2
- package/dist/cli/ui/banner.js.map +1 -0
- package/dist/cli/ui/callout.d.ts +15 -0
- package/dist/cli/ui/callout.js +47 -0
- package/dist/cli/ui/callout.js.map +1 -0
- package/dist/cli/ui/theme.d.ts +10 -0
- package/dist/cli/ui/theme.js +17 -0
- package/dist/cli/ui/theme.js.map +1 -1
- package/dist/cli/{tool-options.d.ts → ui/tool-options.d.ts} +1 -1
- package/dist/cli/{tool-options.js → ui/tool-options.js} +1 -1
- package/dist/cli/ui/tool-options.js.map +1 -0
- package/dist/cli/update.d.ts +26 -0
- package/dist/cli/update.js +78 -0
- package/dist/cli/update.js.map +1 -0
- package/dist/core/classify.d.ts +4 -0
- package/dist/core/classify.js +86 -0
- package/dist/core/classify.js.map +1 -0
- package/dist/{cli → core}/emit.d.ts +1 -1
- package/dist/{cli → core}/emit.js +8 -3
- package/dist/core/emit.js.map +1 -0
- package/dist/core/merge.d.ts +37 -0
- package/dist/core/merge.js +146 -0
- package/dist/core/merge.js.map +1 -0
- package/dist/core/paths.d.ts +7 -0
- package/dist/core/paths.js +18 -1
- package/dist/core/paths.js.map +1 -1
- package/dist/core/rules.d.ts +14 -0
- package/dist/core/rules.js +33 -9
- package/dist/core/rules.js.map +1 -1
- package/dist/core/scaffold.js +3 -3
- package/dist/core/scaffold.js.map +1 -1
- package/dist/core/types.d.ts +46 -1
- package/dist/core/version.d.ts +10 -0
- package/dist/core/version.js +33 -0
- package/dist/core/version.js.map +1 -0
- package/dist/emitters/antigravity.js +1 -1
- package/dist/emitters/antigravity.js.map +1 -1
- package/dist/emitters/base-emitter.js +1 -1
- package/dist/emitters/base-emitter.js.map +1 -1
- package/dist/emitters/claude.js +7 -12
- package/dist/emitters/claude.js.map +1 -1
- package/dist/emitters/codex.d.ts +20 -0
- package/dist/emitters/codex.js +32 -0
- package/dist/emitters/codex.js.map +1 -0
- package/dist/emitters/copilot-cli.js +1 -1
- package/dist/emitters/copilot-cli.js.map +1 -1
- package/dist/emitters/copilot.js +7 -9
- package/dist/emitters/copilot.js.map +1 -1
- package/dist/emitters/cursor.js +7 -6
- package/dist/emitters/cursor.js.map +1 -1
- package/dist/emitters/index.d.ts +1 -0
- package/dist/emitters/index.js +4 -0
- package/dist/emitters/index.js.map +1 -1
- package/dist/emitters/opencode.js +1 -1
- package/dist/emitters/opencode.js.map +1 -1
- package/package.json +4 -3
- package/src/prompts/revise.md +35 -0
- package/dist/cli/banner.js.map +0 -1
- package/dist/cli/emit.js.map +0 -1
- package/dist/cli/fsops.d.ts +0 -21
- package/dist/cli/fsops.js +0 -58
- package/dist/cli/fsops.js.map +0 -1
- package/dist/cli/tool-options.js.map +0 -1
- package/dist/cli/upgrade.d.ts +0 -7
- package/dist/cli/upgrade.js +0 -27
- package/dist/cli/upgrade.js.map +0 -1
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { spawnSync } from "node:child_process";
|
|
2
|
+
import { BaseCommand } from "./base-command.js";
|
|
3
|
+
import { applyFiles } from "./io/fsops.js";
|
|
4
|
+
import { buildEmittedFiles } from "../core/emit.js";
|
|
5
|
+
import { loadConfig } from "../core/config.js";
|
|
6
|
+
import { isOutdated } from "../core/version.js";
|
|
7
|
+
import { packageVersion, projectAtCwd } from "../core/paths.js";
|
|
8
|
+
import { refreshLatest } from "./io/version-check.js";
|
|
9
|
+
const PACKAGE = "@ambystech/ambykit";
|
|
10
|
+
/**
|
|
11
|
+
* `ambykit update` (feature 010). Updates the CLI when it is behind the latest published version and —
|
|
12
|
+
* on a re-run once current — refreshes the project's tool prompts (US-3). The CLI self-update and the
|
|
13
|
+
* latest-version lookup are `protected` seams so tests can drive them without spawning npm or hitting
|
|
14
|
+
* the network.
|
|
15
|
+
*/
|
|
16
|
+
export class UpdateCommand extends BaseCommand {
|
|
17
|
+
name = "update";
|
|
18
|
+
summary = "Update the AmbyKit CLI, then refresh this project's tool prompts.";
|
|
19
|
+
usage = "ambykit update";
|
|
20
|
+
requiresProject = false;
|
|
21
|
+
async execute(opts) {
|
|
22
|
+
const installed = packageVersion();
|
|
23
|
+
const latest = await this.latestVersion();
|
|
24
|
+
if (latest !== null && isOutdated(installed, latest)) {
|
|
25
|
+
return this.updateCli(installed, latest);
|
|
26
|
+
}
|
|
27
|
+
// CLI is current (or latest unknown) → refresh the project's prompts (US-3) and report (US-4).
|
|
28
|
+
return this.refreshProject(opts, installed);
|
|
29
|
+
}
|
|
30
|
+
/** Attempt a global install of the latest; on success, stop and ask the user to re-run (R-5). */
|
|
31
|
+
updateCli(installed, latest) {
|
|
32
|
+
this.info(`AmbyKit ${installed} → ${latest}: updating the CLI…`);
|
|
33
|
+
if (this.installCli()) {
|
|
34
|
+
this.success(`Updated AmbyKit to ${latest}.`);
|
|
35
|
+
this.info("Re-run `ambykit update` to refresh this project's prompts with the new version.");
|
|
36
|
+
return 0;
|
|
37
|
+
}
|
|
38
|
+
// Ephemeral npx run or a permissions error (EACCES): leave the install intact, print the command.
|
|
39
|
+
this.error("Could not update the CLI automatically.", `Run: npm install -g ${PACKAGE}@latest`);
|
|
40
|
+
return 1;
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* The CLI is current: refresh the project's emitted prompts if we're in an AmbyKit project at the
|
|
44
|
+
* invocation dir (`.amby/` AND `specs/`), reusing the `sync` pipeline (US-3, Principle 1/2). Skips
|
|
45
|
+
* cleanly outside a project (FR-010). Reports the outcome, incl. the exact up-to-date message (US-4).
|
|
46
|
+
*/
|
|
47
|
+
refreshProject(opts, installed) {
|
|
48
|
+
const root = opts.cwd;
|
|
49
|
+
if (!projectAtCwd(root)) {
|
|
50
|
+
this.info(`AmbyKit ${installed} is current. Not in an AmbyKit project — no prompts to refresh.`);
|
|
51
|
+
return 0;
|
|
52
|
+
}
|
|
53
|
+
const config = loadConfig(root);
|
|
54
|
+
const files = buildEmittedFiles(root, config);
|
|
55
|
+
const result = applyFiles(root, files, { dryRun: this.dryRun, includeUser: false });
|
|
56
|
+
const changed = this.dryRun ? result.wouldChange.length : result.written.length;
|
|
57
|
+
if (changed === 0) {
|
|
58
|
+
this.success("Everything is up to date.");
|
|
59
|
+
return 0;
|
|
60
|
+
}
|
|
61
|
+
this.success(`${this.dryRun ? "Would refresh" : "Refreshed"} ${changed} prompt file(s).`);
|
|
62
|
+
this.printSummary(result);
|
|
63
|
+
return 0;
|
|
64
|
+
}
|
|
65
|
+
/** The latest published version (awaited, since the user explicitly asked). Overridable in tests. */
|
|
66
|
+
async latestVersion() {
|
|
67
|
+
return refreshLatest(3000);
|
|
68
|
+
}
|
|
69
|
+
/** Run the global install; return whether it succeeded. Overridable in tests. */
|
|
70
|
+
installCli() {
|
|
71
|
+
const res = spawnSync("npm", ["install", "-g", `${PACKAGE}@latest`], {
|
|
72
|
+
stdio: "inherit",
|
|
73
|
+
shell: true,
|
|
74
|
+
});
|
|
75
|
+
return res.status === 0;
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
//# sourceMappingURL=update.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"update.js","sourceRoot":"","sources":["../../src/cli/update.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAC/C,OAAO,EAAE,WAAW,EAAmB,MAAM,mBAAmB,CAAC;AACjE,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AACpD,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAChD,OAAO,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAChE,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAEtD,MAAM,OAAO,GAAG,oBAAoB,CAAC;AAErC;;;;;GAKG;AACH,MAAM,OAAO,aAAc,SAAQ,WAAW;IACnC,IAAI,GAAG,QAAQ,CAAC;IAChB,OAAO,GAAG,mEAAmE,CAAC;IAC9E,KAAK,GAAG,gBAAgB,CAAC;IACf,eAAe,GAAG,KAAK,CAAC;IAEjC,KAAK,CAAC,OAAO,CAAC,IAAgB;QACtC,MAAM,SAAS,GAAG,cAAc,EAAE,CAAC;QACnC,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,aAAa,EAAE,CAAC;QAE1C,IAAI,MAAM,KAAK,IAAI,IAAI,UAAU,CAAC,SAAS,EAAE,MAAM,CAAC,EAAE,CAAC;YACrD,OAAO,IAAI,CAAC,SAAS,CAAC,SAAS,EAAE,MAAM,CAAC,CAAC;QAC3C,CAAC;QACD,+FAA+F;QAC/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I,CAAC,OAAO,CAAC,2BAA2B,CAAC,CAAC;YAC1C,OAAO,CAAC,CAAC;QACX,CAAC;QACD,IAAI,CAAC,OAAO,CAAC,GAAG,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,eAAe,CAAC,CAAC,CAAC,WAAW,IAAI,OAAO,kBAAkB,CAAC,CAAC;QAC1F,IAAI,CAAC,YAAY,CAAC,MAAM,CAAC,CAAC;QAC1B,OAAO,CAAC,CAAC;IACX,CAAC;IAED,qGAAqG;IAC3F,KAAK,CAAC,aAAa;QAC3B,OAAO,aAAa,CAAC,IAAI,CAAC,CAAC;IAC7B,CAAC;IAED,iFAAiF;IACvE,UAAU;QAClB,MAAM,GAAG,GAAG,SAAS,CAAC,KAAK,EAAE,CAAC,SAAS,EAAE,IAAI,EAAE,GAAG,OAAO,SAAS,CAAC,EAAE;YACnE,KAAK,EAAE,SAAS;YAChB,KAAK,EAAE,IAAI;SACZ,CAAC,CAAC;QACH,OAAO,GAAG,CAAC,MAAM,KAAK,CAAC,CAAC;IAC1B,CAAC;CACF"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { ProjectClassification, ProjectSignals } from "./types.js";
|
|
2
|
+
export declare function classifyProject(root: string): ProjectClassification;
|
|
3
|
+
/** Human-readable list of the signals that fired, for CLI reporting. */
|
|
4
|
+
export declare function describeSignals(signals: ProjectSignals): string;
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import { spawnSync } from "node:child_process";
|
|
2
|
+
import { existsSync, readdirSync } from "node:fs";
|
|
3
|
+
import { join } from "node:path";
|
|
4
|
+
/**
|
|
5
|
+
* Classify a project as greenfield or brownfield (feature 008 / FR-008). A project is brownfield when
|
|
6
|
+
* ANY signal fires — an existing supported rules file, non-AmbyKit source files, or a VCS history with
|
|
7
|
+
* commits — otherwise greenfield. Detection is only informational: the write path is always
|
|
8
|
+
* non-destructive, so an uncertain read still lands on the safe behavior (FR-009).
|
|
9
|
+
*/
|
|
10
|
+
/** Supported rules files whose presence marks an existing agent-docs setup. */
|
|
11
|
+
const RULES_FILES = [
|
|
12
|
+
"AGENTS.md",
|
|
13
|
+
"CLAUDE.md",
|
|
14
|
+
join(".github", "copilot-instructions.md"),
|
|
15
|
+
join(".cursor", "rules", "ambykit.mdc"),
|
|
16
|
+
];
|
|
17
|
+
/** Entries that don't count as "source": AmbyKit's own output, VCS, tool dirs, and common noise. */
|
|
18
|
+
const IGNORED_ENTRIES = new Set([
|
|
19
|
+
".amby",
|
|
20
|
+
".git",
|
|
21
|
+
".github",
|
|
22
|
+
".claude",
|
|
23
|
+
".cursor",
|
|
24
|
+
".opencode",
|
|
25
|
+
".agents",
|
|
26
|
+
"node_modules",
|
|
27
|
+
"dist",
|
|
28
|
+
"build",
|
|
29
|
+
...RULES_FILES,
|
|
30
|
+
]);
|
|
31
|
+
function hasRulesFile(root) {
|
|
32
|
+
return RULES_FILES.some((rel) => existsSync(join(root, rel)));
|
|
33
|
+
}
|
|
34
|
+
/** Any tracked-looking file that AmbyKit did not create → treat as an existing codebase. */
|
|
35
|
+
function hasSourceFiles(root) {
|
|
36
|
+
let entries;
|
|
37
|
+
try {
|
|
38
|
+
entries = readdirSync(root);
|
|
39
|
+
}
|
|
40
|
+
catch {
|
|
41
|
+
return false;
|
|
42
|
+
}
|
|
43
|
+
return entries.some((name) => {
|
|
44
|
+
if (IGNORED_ENTRIES.has(name))
|
|
45
|
+
return false;
|
|
46
|
+
if (name.startsWith("."))
|
|
47
|
+
return false; // dotfiles (configs) are not "source"
|
|
48
|
+
return true;
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
/** True when `root` is a git repo with at least one commit. Guarded — never throws (R-4). */
|
|
52
|
+
function hasGitHistory(root) {
|
|
53
|
+
if (!existsSync(join(root, ".git")))
|
|
54
|
+
return false;
|
|
55
|
+
try {
|
|
56
|
+
const res = spawnSync("git", ["rev-parse", "--verify", "HEAD"], {
|
|
57
|
+
cwd: root,
|
|
58
|
+
stdio: "ignore",
|
|
59
|
+
});
|
|
60
|
+
return res.status === 0;
|
|
61
|
+
}
|
|
62
|
+
catch {
|
|
63
|
+
return false;
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
export function classifyProject(root) {
|
|
67
|
+
const signals = {
|
|
68
|
+
rulesFile: hasRulesFile(root),
|
|
69
|
+
sourceFiles: hasSourceFiles(root),
|
|
70
|
+
gitHistory: hasGitHistory(root),
|
|
71
|
+
};
|
|
72
|
+
const brownfield = signals.rulesFile || signals.sourceFiles || signals.gitHistory;
|
|
73
|
+
return { mode: brownfield ? "brownfield" : "greenfield", signals };
|
|
74
|
+
}
|
|
75
|
+
/** Human-readable list of the signals that fired, for CLI reporting. */
|
|
76
|
+
export function describeSignals(signals) {
|
|
77
|
+
const parts = [];
|
|
78
|
+
if (signals.rulesFile)
|
|
79
|
+
parts.push("existing agent docs");
|
|
80
|
+
if (signals.sourceFiles)
|
|
81
|
+
parts.push("existing source files");
|
|
82
|
+
if (signals.gitHistory)
|
|
83
|
+
parts.push("git history");
|
|
84
|
+
return parts.join(", ");
|
|
85
|
+
}
|
|
86
|
+
//# sourceMappingURL=classify.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"classify.js","sourceRoot":"","sources":["../../src/core/classify.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAC/C,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAClD,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAGjC;;;;;GAKG;AAEH,+EAA+E;AAC/E,MAAM,WAAW,GAAG;IAClB,WAAW;IACX,WAAW;IACX,IAAI,CAAC,SAAS,EAAE,yBAAyB,CAAC;IAC1C,IAAI,CAAC,SAAS,EAAE,OAAO,EAAE,aAAa,CAAC;CACxC,CAAC;AAEF,oGAAoG;AACpG,MAAM,eAAe,GAAG,IAAI,GAAG,CAAC;IAC9B,OAAO;IACP,MAAM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AU,eAAe,CAAC,IAAY;IAC1C,MAAM,OAAO,GAAmB;QAC9B,SAAS,EAAE,YAAY,CAAC,IAAI,CAAC;QAC7B,WAAW,EAAE,cAAc,CAAC,IAAI,CAAC;QACjC,UAAU,EAAE,aAAa,CAAC,IAAI,CAAC;KAChC,CAAC;IACF,MAAM,UAAU,GAAG,OAAO,CAAC,SAAS,IAAI,OAAO,CAAC,WAAW,IAAI,OAAO,CAAC,UAAU,CAAC;IAClF,OAAO,EAAE,IAAI,EAAE,UAAU,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,YAAY,EAAE,OAAO,EAAE,CAAC;AACrE,CAAC;AAED,wEAAwE;AACxE,MAAM,UAAU,eAAe,CAAC,OAAuB;IACrD,MAAM,KAAK,GAAa,EAAE,CAAC;IAC3B,IAAI,OAAO,CAAC,SAAS;QAAE,KAAK,CAAC,IAAI,CAAC,qBAAqB,CAAC,CAAC;IACzD,IAAI,OAAO,CAAC,WAAW;QAAE,KAAK,CAAC,IAAI,CAAC,uBAAuB,CAAC,CAAC;IAC7D,IAAI,OAAO,CAAC,UAAU;QAAE,KAAK,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;IAClD,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC1B,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { AmbyConfig, EmittedFile } from "
|
|
1
|
+
import type { AmbyConfig, EmittedFile } from "./types.js";
|
|
2
2
|
/**
|
|
3
3
|
* Build the full set of files to emit for a project's configured tools. The shared AGENTS.md is
|
|
4
4
|
* added once here; each emitter contributes its own commands and tool-specific rules (e.g. Claude's
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { basename } from "node:path";
|
|
2
|
-
import { loadCommandSpecs } from "
|
|
3
|
-
import { buildAgentsMd } from "
|
|
2
|
+
import { loadCommandSpecs } from "./command-spec.js";
|
|
3
|
+
import { buildAgentsMd } from "./rules.js";
|
|
4
4
|
import { emittersForTargets } from "../emitters/index.js";
|
|
5
5
|
/**
|
|
6
6
|
* Build the full set of files to emit for a project's configured tools. The shared AGENTS.md is
|
|
@@ -14,7 +14,12 @@ export function buildEmittedFiles(projectRoot, config) {
|
|
|
14
14
|
const ctx = { projectName, specs, manageRules };
|
|
15
15
|
const files = [];
|
|
16
16
|
if (manageRules) {
|
|
17
|
-
files.push({
|
|
17
|
+
files.push({
|
|
18
|
+
path: "AGENTS.md",
|
|
19
|
+
contents: buildAgentsMd(projectName, specs),
|
|
20
|
+
scope: "project",
|
|
21
|
+
merge: "region", // preserve any user-authored AGENTS.md content (feature 008 / FR-001)
|
|
22
|
+
});
|
|
18
23
|
}
|
|
19
24
|
for (const emitter of emittersForTargets(config.tools)) {
|
|
20
25
|
files.push(...emitter.emit(specs, ctx));
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"emit.js","sourceRoot":"","sources":["../../src/core/emit.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAErC,OAAO,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AACrD,OAAO,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAC3C,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAE1D;;;;GAIG;AACH,MAAM,UAAU,iBAAiB,CAAC,WAAmB,EAAE,MAAkB;IACvE,MAAM,KAAK,GAAG,gBAAgB,EAAE,CAAC;IACjC,MAAM,WAAW,GAAG,MAAM,CAAC,WAAW,KAAK,KAAK,CAAC;IACjD,MAAM,WAAW,GAAG,QAAQ,CAAC,WAAW,CAAC,CAAC;IAC1C,MAAM,GAAG,GAAG,EAAE,WAAW,EAAE,KAAK,EAAE,WAAW,EAAE,CAAC;IAEhD,MAAM,KAAK,GAAkB,EAAE,CAAC;IAChC,IAAI,WAAW,EAAE,CAAC;QAChB,KAAK,CAAC,IAAI,CAAC;YACT,IAAI,EAAE,WAAW;YACjB,QAAQ,EAAE,aAAa,CAAC,WAAW,EAAE,KAAK,CAAC;YAC3C,KAAK,EAAE,SAAS;YAChB,KAAK,EAAE,QAAQ,EAAE,sEAAsE;SACxF,CAAC,CAAC;IACL,CAAC;IACD,KAAK,MAAM,OAAO,IAAI,kBAAkB,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC;QACvD,KAAK,CAAC,IAAI,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC,CAAC;IAC1C,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import type { MergePlan, RulesRegion } from "./types.js";
|
|
2
|
+
/** Options for a region merge. */
|
|
3
|
+
export interface MergeOptions {
|
|
4
|
+
/** A line that must be the file's first line even on merge, e.g. Claude's `@AGENTS.md` bridge. */
|
|
5
|
+
requiredPrefix?: string;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* Non-destructive region merge for brownfield rules files (feature 008).
|
|
9
|
+
*
|
|
10
|
+
* The AmbyKit-owned region is a Markdown section that opens with `### AmbyKit usage` and runs until
|
|
11
|
+
* the next heading of the same or higher level (`#`, `##`, `###`) or end-of-file (FR-003). A short
|
|
12
|
+
* fingerprint of the region's own body is embedded in a footer comment so a later run can tell
|
|
13
|
+
* whether a human edited the region since AmbyKit wrote it (FR-008a).
|
|
14
|
+
*
|
|
15
|
+
* Pure — no file-system or process access (side effects stay at the CLI edge, per the constitution).
|
|
16
|
+
*/
|
|
17
|
+
/** Heading line that opens the AmbyKit-owned region. */
|
|
18
|
+
export declare const REGION_HEADING = "### AmbyKit usage";
|
|
19
|
+
/** Short, non-cryptographic-strength content fingerprint (collision risk is immaterial here). */
|
|
20
|
+
export declare function fingerprint(regionCore: string): string;
|
|
21
|
+
/**
|
|
22
|
+
* Build a complete AmbyKit region from its core content (which must start with `REGION_HEADING`),
|
|
23
|
+
* appending the fingerprint footer. The returned block ends with a single trailing newline.
|
|
24
|
+
*/
|
|
25
|
+
export declare function buildRegion(core: string): string;
|
|
26
|
+
/**
|
|
27
|
+
* Locate the single AmbyKit region in `text`. Returns null when absent. Throws when more than one
|
|
28
|
+
* `### AmbyKit usage` heading is present (malformed — the caller aborts that file, FR-007).
|
|
29
|
+
*/
|
|
30
|
+
export declare function findRegion(text: string): RulesRegion | null;
|
|
31
|
+
/**
|
|
32
|
+
* Plan a merge of `emitted` — a full greenfield rules file that contains exactly one AmbyKit region —
|
|
33
|
+
* into `existing` (null when the target file does not exist). On create, `emitted` is written whole
|
|
34
|
+
* (FR-002); on merge, only its `### AmbyKit usage` region is spliced into `existing`, preserving every
|
|
35
|
+
* other byte (FR-001). Pure — returns a plan; the caller performs any I/O.
|
|
36
|
+
*/
|
|
37
|
+
export declare function mergeRegion(existing: string | null, emitted: string, opts?: MergeOptions): MergePlan;
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
import { createHash } from "node:crypto";
|
|
2
|
+
/**
|
|
3
|
+
* Non-destructive region merge for brownfield rules files (feature 008).
|
|
4
|
+
*
|
|
5
|
+
* The AmbyKit-owned region is a Markdown section that opens with `### AmbyKit usage` and runs until
|
|
6
|
+
* the next heading of the same or higher level (`#`, `##`, `###`) or end-of-file (FR-003). A short
|
|
7
|
+
* fingerprint of the region's own body is embedded in a footer comment so a later run can tell
|
|
8
|
+
* whether a human edited the region since AmbyKit wrote it (FR-008a).
|
|
9
|
+
*
|
|
10
|
+
* Pure — no file-system or process access (side effects stay at the CLI edge, per the constitution).
|
|
11
|
+
*/
|
|
12
|
+
/** Heading line that opens the AmbyKit-owned region. */
|
|
13
|
+
export const REGION_HEADING = "### AmbyKit usage";
|
|
14
|
+
const FINGERPRINT_RE = /^<!--\s*ambykit:fingerprint\s+(\S+)\s*-->\s*$/;
|
|
15
|
+
const HEADING_RE = /^#{1,3}\s/;
|
|
16
|
+
/** Normalize to LF line endings. */
|
|
17
|
+
function toLf(text) {
|
|
18
|
+
return text.replace(/\r\n/g, "\n");
|
|
19
|
+
}
|
|
20
|
+
/** Canonical form used for hashing/comparison: LF endings, no trailing whitespace. */
|
|
21
|
+
function canonical(text) {
|
|
22
|
+
return toLf(text).replace(/\s+$/, "");
|
|
23
|
+
}
|
|
24
|
+
/** Short, non-cryptographic-strength content fingerprint (collision risk is immaterial here). */
|
|
25
|
+
export function fingerprint(regionCore) {
|
|
26
|
+
return createHash("sha256").update(canonical(regionCore)).digest("hex").slice(0, 12);
|
|
27
|
+
}
|
|
28
|
+
/** Split a region body into its content core (heading + body, no footer) and its footer fingerprint. */
|
|
29
|
+
function splitFingerprint(body) {
|
|
30
|
+
const lines = toLf(body).split("\n");
|
|
31
|
+
// Find the last non-empty line; if it is a fingerprint footer, peel it off.
|
|
32
|
+
let last = lines.length - 1;
|
|
33
|
+
while (last >= 0 && lines[last].trim() === "")
|
|
34
|
+
last--;
|
|
35
|
+
if (last >= 0) {
|
|
36
|
+
const m = FINGERPRINT_RE.exec(lines[last]);
|
|
37
|
+
if (m) {
|
|
38
|
+
return { core: canonical(lines.slice(0, last).join("\n")), fingerprint: m[1] };
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
return { core: canonical(body), fingerprint: null };
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Build a complete AmbyKit region from its core content (which must start with `REGION_HEADING`),
|
|
45
|
+
* appending the fingerprint footer. The returned block ends with a single trailing newline.
|
|
46
|
+
*/
|
|
47
|
+
export function buildRegion(core) {
|
|
48
|
+
const body = canonical(core);
|
|
49
|
+
return `${body}\n\n<!-- ambykit:fingerprint ${fingerprint(body)} -->\n`;
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Locate the single AmbyKit region in `text`. Returns null when absent. Throws when more than one
|
|
53
|
+
* `### AmbyKit usage` heading is present (malformed — the caller aborts that file, FR-007).
|
|
54
|
+
*/
|
|
55
|
+
export function findRegion(text) {
|
|
56
|
+
const lines = toLf(text).split("\n");
|
|
57
|
+
const starts = lines.flatMap((l, i) => (l.trimEnd() === REGION_HEADING ? [i] : []));
|
|
58
|
+
if (starts.length === 0)
|
|
59
|
+
return null;
|
|
60
|
+
if (starts.length > 1) {
|
|
61
|
+
throw new Error(`found ${starts.length} "${REGION_HEADING}" regions; expected at most one`);
|
|
62
|
+
}
|
|
63
|
+
const startLine = starts[0];
|
|
64
|
+
let endLine = lines.length;
|
|
65
|
+
for (let i = startLine + 1; i < lines.length; i++) {
|
|
66
|
+
if (HEADING_RE.test(lines[i])) {
|
|
67
|
+
endLine = i;
|
|
68
|
+
break;
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
const body = lines.slice(startLine, endLine).join("\n");
|
|
72
|
+
return { startLine, endLine, body, fingerprint: splitFingerprint(body).fingerprint };
|
|
73
|
+
}
|
|
74
|
+
/** Ensure exactly one trailing newline. */
|
|
75
|
+
function withTrailingNewline(text) {
|
|
76
|
+
return `${text.replace(/\n+$/, "")}\n`;
|
|
77
|
+
}
|
|
78
|
+
/** Ensure `prefix` is the first line of `text`, inserting it (plus a blank line) if missing (FR-011). */
|
|
79
|
+
function ensurePrefix(text, prefix) {
|
|
80
|
+
if (!prefix)
|
|
81
|
+
return text;
|
|
82
|
+
const lines = toLf(text).split("\n");
|
|
83
|
+
if (lines[0].trim() === prefix.trim())
|
|
84
|
+
return text;
|
|
85
|
+
return `${prefix}\n\n${text.replace(/^\n+/, "")}`;
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
* Plan a merge of `emitted` — a full greenfield rules file that contains exactly one AmbyKit region —
|
|
89
|
+
* into `existing` (null when the target file does not exist). On create, `emitted` is written whole
|
|
90
|
+
* (FR-002); on merge, only its `### AmbyKit usage` region is spliced into `existing`, preserving every
|
|
91
|
+
* other byte (FR-001). Pure — returns a plan; the caller performs any I/O.
|
|
92
|
+
*/
|
|
93
|
+
export function mergeRegion(existing, emitted, opts = {}) {
|
|
94
|
+
const { requiredPrefix } = opts;
|
|
95
|
+
// File absent → write the emitted greenfield file verbatim (FR-002).
|
|
96
|
+
if (existing === null) {
|
|
97
|
+
return { action: "created", contents: withTrailingNewline(toLf(emitted)) };
|
|
98
|
+
}
|
|
99
|
+
// Extract the fresh region from the emitted file (everything AmbyKit contributes on merge).
|
|
100
|
+
let fresh;
|
|
101
|
+
try {
|
|
102
|
+
fresh = findRegion(emitted);
|
|
103
|
+
}
|
|
104
|
+
catch (err) {
|
|
105
|
+
return { action: "aborted", reason: err.message };
|
|
106
|
+
}
|
|
107
|
+
if (fresh === null) {
|
|
108
|
+
return { action: "aborted", reason: `emitted content has no "${REGION_HEADING}" region` };
|
|
109
|
+
}
|
|
110
|
+
const freshRegion = canonical(fresh.body);
|
|
111
|
+
const existingLf = toLf(existing);
|
|
112
|
+
let found;
|
|
113
|
+
try {
|
|
114
|
+
found = findRegion(existingLf);
|
|
115
|
+
}
|
|
116
|
+
catch (err) {
|
|
117
|
+
return { action: "aborted", reason: err.message };
|
|
118
|
+
}
|
|
119
|
+
let mergedNoPrefix;
|
|
120
|
+
if (found === null) {
|
|
121
|
+
// No region yet: preserve every existing byte, append the region after a blank line (FR-001).
|
|
122
|
+
const base = existingLf.replace(/\n+$/, "");
|
|
123
|
+
mergedNoPrefix = base === "" ? freshRegion : `${base}\n\n${freshRegion}`;
|
|
124
|
+
}
|
|
125
|
+
else {
|
|
126
|
+
// Region present: skip if a human edited it since AmbyKit last wrote it (FR-008a).
|
|
127
|
+
const { core, fingerprint: stored } = splitFingerprint(found.body);
|
|
128
|
+
if (stored !== null && fingerprint(core) !== stored) {
|
|
129
|
+
return { action: "skipped", reason: "AmbyKit region was hand-edited" };
|
|
130
|
+
}
|
|
131
|
+
// Splice the fresh region in place; never create a second region (FR-004).
|
|
132
|
+
const lines = existingLf.split("\n");
|
|
133
|
+
const regionLines = freshRegion.split("\n");
|
|
134
|
+
const after = lines.slice(found.endLine);
|
|
135
|
+
// Keep a blank line between the region and a following heading, for readability + stable re-runs.
|
|
136
|
+
const separator = after.length > 0 && HEADING_RE.test(after[0]) ? [""] : [];
|
|
137
|
+
const newLines = [...lines.slice(0, found.startLine), ...regionLines, ...separator, ...after];
|
|
138
|
+
mergedNoPrefix = newLines.join("\n");
|
|
139
|
+
}
|
|
140
|
+
const merged = withTrailingNewline(ensurePrefix(mergedNoPrefix, requiredPrefix));
|
|
141
|
+
if (merged === withTrailingNewline(existingLf)) {
|
|
142
|
+
return { action: "unchanged" };
|
|
143
|
+
}
|
|
144
|
+
return { action: "updated", contents: merged };
|
|
145
|
+
}
|
|
146
|
+
//# sourceMappingURL=merge.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"merge.js","sourceRoot":"","sources":["../../src/core/merge.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AASzC;;;;;;;;;GASG;AAEH,wDAAwD;AACxD,MAAM,CAAC,MAAM,cAAc,GAAG,mBAAmB,CAAC;AAElD,MAAM,cAAc,GAAG,+CAA+C,CAAC;AACvE,MAAM,UAAU,GAAG,WAAW,CAAC;AAE/B,oCAAoC;AACpC,SAAS,IAAI,CAAC,IAAY;IACxB,OAAO,IAAI,CAAC,OAAO,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;AACrC,CAAC;AAED,sFAAsF;AACtF,SAAS,SAAS,CAAC,IAAY;IAC7B,OAAO,IAAI,CAAC,IAAI,CAAC,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;AACxC,CAAC;AAED,iGAAiG;AACjG,MAAM,UAAU,WAAW,CAAC,UAAkB;IAC5C,OAAO,UAAU,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,SAAS,CAAC,UAAU,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;AACvF,CAAC;AAED,wGAAwG;AACxG,SAAS,gBAAgB,CAAC,IAAY;IACpC,MAAM,KAAK,GAAG,IAAI,CA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AY,CAAC,cAAc,EAAE,cAAc,CAAC,CAAC,CAAC;IACjF,IAAI,MAAM,KAAK,mBAAmB,CAAC,UAAU,CAAC,EAAE,CAAC;QAC/C,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,CAAC;IACjC,CAAC;IACD,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,EAAE,CAAC;AACjD,CAAC"}
|
package/dist/core/paths.d.ts
CHANGED
|
@@ -3,11 +3,18 @@
|
|
|
3
3
|
* Works both from compiled dist/ and when run through a loader against src/.
|
|
4
4
|
*/
|
|
5
5
|
export declare function packageRoot(): string;
|
|
6
|
+
/** The installed package version, read from package.json. */
|
|
7
|
+
export declare function packageVersion(): string;
|
|
6
8
|
/** Directory containing the neutral phase prompts. */
|
|
7
9
|
export declare function promptsDir(): string;
|
|
8
10
|
/** Directory containing the neutral artifact templates. */
|
|
9
11
|
export declare function templatesDir(): string;
|
|
10
12
|
/** Directory containing on-demand reference docs (loaded by phases when needed). */
|
|
11
13
|
export declare function referenceDir(): string;
|
|
14
|
+
/**
|
|
15
|
+
* Whether `cwd` is itself an AmbyKit project root: a `.amby/` AND a `specs/` directory directly at the
|
|
16
|
+
* invocation dir (feature 010 / FR-007). Deliberately NOT a walk-up like `findProjectRoot`.
|
|
17
|
+
*/
|
|
18
|
+
export declare function projectAtCwd(cwd: string): boolean;
|
|
12
19
|
/** Find the project root by walking up from `start` looking for an `.amby` dir. */
|
|
13
20
|
export declare function findProjectRoot(start?: string): string | null;
|
package/dist/core/paths.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { fileURLToPath } from "node:url";
|
|
2
2
|
import { dirname, join, resolve } from "node:path";
|
|
3
|
-
import { existsSync } from "node:fs";
|
|
3
|
+
import { existsSync, readFileSync } from "node:fs";
|
|
4
4
|
/**
|
|
5
5
|
* Resolve the installed package root (where src/prompts and src/templates live).
|
|
6
6
|
* Works both from compiled dist/ and when run through a loader against src/.
|
|
@@ -18,6 +18,16 @@ export function packageRoot() {
|
|
|
18
18
|
// fallback: two levels up from core/
|
|
19
19
|
return resolve(here, "..", "..");
|
|
20
20
|
}
|
|
21
|
+
/** The installed package version, read from package.json. */
|
|
22
|
+
export function packageVersion() {
|
|
23
|
+
try {
|
|
24
|
+
const pkg = JSON.parse(readFileSync(join(packageRoot(), "package.json"), "utf8"));
|
|
25
|
+
return pkg.version ?? "0.0.0";
|
|
26
|
+
}
|
|
27
|
+
catch {
|
|
28
|
+
return "0.0.0";
|
|
29
|
+
}
|
|
30
|
+
}
|
|
21
31
|
/** Directory containing the neutral phase prompts. */
|
|
22
32
|
export function promptsDir() {
|
|
23
33
|
return join(packageRoot(), "src", "prompts");
|
|
@@ -30,6 +40,13 @@ export function templatesDir() {
|
|
|
30
40
|
export function referenceDir() {
|
|
31
41
|
return join(packageRoot(), "src", "reference");
|
|
32
42
|
}
|
|
43
|
+
/**
|
|
44
|
+
* Whether `cwd` is itself an AmbyKit project root: a `.amby/` AND a `specs/` directory directly at the
|
|
45
|
+
* invocation dir (feature 010 / FR-007). Deliberately NOT a walk-up like `findProjectRoot`.
|
|
46
|
+
*/
|
|
47
|
+
export function projectAtCwd(cwd) {
|
|
48
|
+
return existsSync(join(cwd, ".amby")) && existsSync(join(cwd, "specs"));
|
|
49
|
+
}
|
|
33
50
|
/** Find the project root by walking up from `start` looking for an `.amby` dir. */
|
|
34
51
|
export function findProjectRoot(start = process.cwd()) {
|
|
35
52
|
let dir = resolve(start);
|
package/dist/core/paths.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"paths.js","sourceRoot":"","sources":["../../src/core/paths.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACnD,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"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U,YAAY;IAC1B,OAAO,IAAI,CAAC,WAAW,EAAE,EAAE,KAAK,EAAE,WAAW,CAAC,CAAC;AACjD,CAAC;AAED,oFAAoF;AACpF,MAAM,UAAU,YAAY;IAC1B,OAAO,IAAI,CAAC,WAAW,EAAE,EAAE,KAAK,EAAE,WAAW,CAAC,CAAC;AACjD,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,YAAY,CAAC,GAAW;IACtC,OAAO,UAAU,CAAC,IAAI,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC,IAAI,UAAU,CAAC,IAAI,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC,CAAC;AAC1E,CAAC;AAED,mFAAmF;AACnF,MAAM,UAAU,eAAe,CAAC,QAAgB,OAAO,CAAC,GAAG,EAAE;IAC3D,IAAI,GAAG,GAAG,OAAO,CAAC,KAAK,CAAC,CAAC;IACzB,SAAS,CAAC;QACR,IAAI,UAAU,CAAC,IAAI,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC;YAAE,OAAO,GAAG,CAAC;QAC/C,MAAM,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC,CAAC;QAC5B,IAAI,MAAM,KAAK,GAAG;YAAE,OAAO,IAAI,CAAC;QAChC,GAAG,GAAG,MAAM,CAAC;IACf,CAAC;AACH,CAAC"}
|
package/dist/core/rules.d.ts
CHANGED
|
@@ -1,6 +1,20 @@
|
|
|
1
1
|
import type { CommandSpec } from "./types.js";
|
|
2
|
+
/**
|
|
3
|
+
* Build the AmbyKit-owned **region** (feature 008): a `### AmbyKit usage` section carrying the
|
|
4
|
+
* workflow command list and agent rules, plus a fingerprint footer. Authored once here (Principle 1)
|
|
5
|
+
* and reused by every rules file — the shared AGENTS.md and each tool's rules file splice this same
|
|
6
|
+
* region into an existing document, preserving the user's own content around it (FR-001/003/006).
|
|
7
|
+
*/
|
|
8
|
+
export declare function buildAmbyRegion(specs: CommandSpec[]): string;
|
|
9
|
+
/**
|
|
10
|
+
* Build a short `### AmbyKit usage` **pointer** region for a per-tool rules file. Unlike the full
|
|
11
|
+
* region (which carries the workflow table), pointer regions defer to `AGENTS.md` and just note where
|
|
12
|
+
* the `/amby.*` commands live — `commandNote` supplies that tool-specific sentence.
|
|
13
|
+
*/
|
|
14
|
+
export declare function buildPointerRegion(commandNote: string): string;
|
|
2
15
|
/**
|
|
3
16
|
* Build the shared, tool-neutral AGENTS.md for a consumer project. Natively read by OpenCode,
|
|
4
17
|
* Copilot, Cursor, and Antigravity; Claude Code reads it via a CLAUDE.md `@AGENTS.md` bridge.
|
|
18
|
+
* The AmbyKit body is the region from `buildAmbyRegion`, under a project title.
|
|
5
19
|
*/
|
|
6
20
|
export declare function buildAgentsMd(projectName: string, specs: CommandSpec[]): string;
|
package/dist/core/rules.js
CHANGED
|
@@ -1,40 +1,64 @@
|
|
|
1
|
+
import { buildRegion, REGION_HEADING } from "./merge.js";
|
|
1
2
|
/**
|
|
2
|
-
* Build the
|
|
3
|
-
*
|
|
3
|
+
* Build the AmbyKit-owned **region** (feature 008): a `### AmbyKit usage` section carrying the
|
|
4
|
+
* workflow command list and agent rules, plus a fingerprint footer. Authored once here (Principle 1)
|
|
5
|
+
* and reused by every rules file — the shared AGENTS.md and each tool's rules file splice this same
|
|
6
|
+
* region into an existing document, preserving the user's own content around it (FR-001/003/006).
|
|
4
7
|
*/
|
|
5
|
-
export function
|
|
8
|
+
export function buildAmbyRegion(specs) {
|
|
6
9
|
const rows = specs
|
|
7
10
|
.slice()
|
|
8
11
|
.sort((a, b) => phaseOrder(a.phase) - phaseOrder(b.phase))
|
|
9
12
|
.map((s) => `| \`/${s.name}\` | ${s.description} |`)
|
|
10
13
|
.join("\n");
|
|
11
|
-
|
|
14
|
+
const core = `${REGION_HEADING}
|
|
12
15
|
|
|
13
16
|
This project uses **AmbyKit** for Spec-Driven Development. Build features by producing structured
|
|
14
17
|
artifacts before code: a constitution, specs (user stories + EARS requirements), UI design, a plan,
|
|
15
18
|
and an ordered task list.
|
|
16
19
|
|
|
17
|
-
|
|
20
|
+
**Workflow commands**
|
|
18
21
|
|
|
19
22
|
| Command | Purpose |
|
|
20
23
|
|---|---|
|
|
21
24
|
${rows}
|
|
22
25
|
|
|
23
|
-
|
|
26
|
+
**Rules for agents**
|
|
24
27
|
|
|
25
28
|
- Read \`.amby/constitution.md\` and honor its principles in every phase.
|
|
26
29
|
- Specs (\`specs/NNN-*/spec.md\`) capture WHAT/WHY with **no technology choices**; plans capture HOW.
|
|
27
30
|
- Requirements use EARS (WHEN/WHILE/IF…THE SYSTEM SHALL…) with Given/When/Then acceptance criteria.
|
|
28
31
|
- Reference artifacts by stable id (US-#, FR-###, SC-###); don't restate them. Patch in place.
|
|
29
|
-
- Task checkboxes in \`tasks.md\` are the source of truth for progress (\`ambykit dashboard\`)
|
|
32
|
+
- Task checkboxes in \`tasks.md\` are the source of truth for progress (\`ambykit dashboard\`).`;
|
|
33
|
+
return buildRegion(core);
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Build a short `### AmbyKit usage` **pointer** region for a per-tool rules file. Unlike the full
|
|
37
|
+
* region (which carries the workflow table), pointer regions defer to `AGENTS.md` and just note where
|
|
38
|
+
* the `/amby.*` commands live — `commandNote` supplies that tool-specific sentence.
|
|
39
|
+
*/
|
|
40
|
+
export function buildPointerRegion(commandNote) {
|
|
41
|
+
const core = `${REGION_HEADING}
|
|
42
|
+
|
|
43
|
+
This project uses **AmbyKit** for Spec-Driven Development. Follow the workflow and rules in
|
|
44
|
+
\`AGENTS.md\`. ${commandNote}`;
|
|
45
|
+
return buildRegion(core);
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Build the shared, tool-neutral AGENTS.md for a consumer project. Natively read by OpenCode,
|
|
49
|
+
* Copilot, Cursor, and Antigravity; Claude Code reads it via a CLAUDE.md `@AGENTS.md` bridge.
|
|
50
|
+
* The AmbyKit body is the region from `buildAmbyRegion`, under a project title.
|
|
51
|
+
*/
|
|
52
|
+
export function buildAgentsMd(projectName, specs) {
|
|
53
|
+
return `# AGENTS.md — ${projectName}
|
|
30
54
|
|
|
31
|
-
|
|
32
|
-
`;
|
|
55
|
+
${buildAmbyRegion(specs)}`;
|
|
33
56
|
}
|
|
34
57
|
const PHASE_SEQUENCE = [
|
|
35
58
|
"constitution",
|
|
36
59
|
"specify",
|
|
37
60
|
"clarify",
|
|
61
|
+
"revise",
|
|
38
62
|
"design",
|
|
39
63
|
"plan",
|
|
40
64
|
"tasks",
|
package/dist/core/rules.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rules.js","sourceRoot":"","sources":["../../src/core/rules.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"rules.js","sourceRoot":"","sources":["../../src/core/rules.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAGzD;;;;;GAKG;AACH,MAAM,UAAU,eAAe,CAAC,KAAoB;IAClD,MAAM,IAAI,GAAG,KAAK;SACf,KAAK,EAAE;SACP,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,UAAU,CAAC,CAAC,CAAC,KAAK,CAAC,GAAG,UAAU,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC;SACzD,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,QAAQ,CAAC,CAAC,IAAI,QAAQ,CAAC,CAAC,WAAW,IAAI,CAAC;SACnD,IAAI,CAAC,IAAI,CAAC,CAAC;IAEd,MAAM,IAAI,GAAG,GAAG,cAAc;;;;;;;;;;EAU9B,IAAI;;;;;;;;gGAQ0F,CAAC;IAE/F,OAAO,WAAW,CAAC,IAAI,CAAC,CAAC;AAC3B,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,kBAAkB,CAAC,WAAmB;IACpD,MAAM,IAAI,GAAG,GAAG,cAAc;;;iBAGf,WAAW,EAAE,CAAC;IAC7B,OAAO,WAAW,CAAC,IAAI,CAAC,CAAC;AAC3B,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,aAAa,CAAC,WAAmB,EAAE,KAAoB;IACrE,OAAO,iBAAiB,WAAW;;EAEnC,eAAe,CAAC,KAAK,CAAC,EAAE,CAAC;AAC3B,CAAC;AAED,MAAM,cAAc,GAAG;IACrB,cAAc;IACd,SAAS;IACT,SAAS;IACT,QAAQ;IACR,QAAQ;IACR,MAAM;IACN,OAAO;IACP,SAAS;IACT,WAAW;CACZ,CAAC;AAEF,SAAS,UAAU,CAAC,KAAa;IAC/B,MAAM,CAAC,GAAG,cAAc,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;IACxC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC;AAC9C,CAAC"}
|
package/dist/core/scaffold.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { existsSync, mkdirSync, readFileSync, writeFileSync } from "node:fs";
|
|
2
|
-
import { dirname, join } from "node:path";
|
|
2
|
+
import { dirname, join, posix } from "node:path";
|
|
3
3
|
import { referenceDir, templatesDir } from "./paths.js";
|
|
4
4
|
/** Artifact templates installed into a consumer's `.amby/templates/` (referenced by the prompts). */
|
|
5
5
|
export const ARTIFACT_TEMPLATES = [
|
|
@@ -33,10 +33,10 @@ export function installArtifactTemplates(projectRoot, dryRun = false) {
|
|
|
33
33
|
result.created.push(destRel);
|
|
34
34
|
};
|
|
35
35
|
for (const name of ARTIFACT_TEMPLATES) {
|
|
36
|
-
copy(join(templatesDir(), name), join(".amby", "templates", name));
|
|
36
|
+
copy(join(templatesDir(), name), posix.join(".amby", "templates", name));
|
|
37
37
|
}
|
|
38
38
|
for (const name of REFERENCE_DOCS) {
|
|
39
|
-
copy(join(referenceDir(), name), join(".amby", "reference", name));
|
|
39
|
+
copy(join(referenceDir(), name), posix.join(".amby", "reference", name));
|
|
40
40
|
}
|
|
41
41
|
return result;
|
|
42
42
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scaffold.js","sourceRoot":"","sources":["../../src/core/scaffold.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAC7E,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"scaffold.js","sourceRoot":"","sources":["../../src/core/scaffold.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAC7E,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,WAAW,CAAC;AACjD,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAExD,qGAAqG;AACrG,MAAM,CAAC,MAAM,kBAAkB,GAAG;IAChC,iBAAiB;IACjB,SAAS;IACT,OAAO;IACP,oBAAoB;IACpB,SAAS;IACT,UAAU;CACF,CAAC;AAEX,+EAA+E;AAC/E,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,uBAAuB,CAAU,CAAC;AAOjE;;;;;GAKG;AACH,MAAM,UAAU,wBAAwB,CAAC,WAAmB,EAAE,MAAM,GAAG,KAAK;IAC1E,MAAM,MAAM,GAAkB,EAAE,OAAO,EAAE,EAAE,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC;IAE3D,MAAM,IAAI,GAAG,CAAC,MAAc,EAAE,OAAe,EAAE,EAAE;QAC/C,MAAM,OAAO,GAAG,IAAI,CAAC,WAAW,EAAE,OAAO,CAAC,CAAC;QAC3C,IAAI,UAAU,CAAC,OAAO,CAAC,EAAE,CAAC;YACxB,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;YAC7B,OAAO;QACT,CAAC;QACD,IAAI,CAAC,MAAM,EAAE,CAAC;YACZ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