cadence-skill-installer 0.2.35 → 0.2.36
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/package.json
CHANGED
|
@@ -8,6 +8,9 @@ import { fileURLToPath } from "node:url";
|
|
|
8
8
|
import { stdin as input, stdout as output } from "node:process";
|
|
9
9
|
|
|
10
10
|
const CADENCE_SKILL_NAME = "cadence";
|
|
11
|
+
const SCRIPT_PATH = fileURLToPath(import.meta.url);
|
|
12
|
+
const SCRIPT_DIR = path.dirname(SCRIPT_PATH);
|
|
13
|
+
const PACKAGE_JSON_PATH = path.resolve(SCRIPT_DIR, "..", "package.json");
|
|
11
14
|
|
|
12
15
|
const TOOL_TARGETS = [
|
|
13
16
|
{ key: "codex", label: "Codex", relPath: [".codex", "skills", CADENCE_SKILL_NAME] },
|
|
@@ -87,10 +90,12 @@ function colorizeAsciiBanner() {
|
|
|
87
90
|
});
|
|
88
91
|
}
|
|
89
92
|
|
|
90
|
-
function printHelp(binName) {
|
|
93
|
+
function printHelp(binName, installerVersion) {
|
|
91
94
|
const validTools = TOOL_TARGETS.map((tool) => tool.key).join(",");
|
|
92
95
|
output.write(
|
|
93
96
|
[
|
|
97
|
+
`Cadence Skill Installer v${installerVersion}`,
|
|
98
|
+
"",
|
|
94
99
|
`Usage: ${binName} [options]`,
|
|
95
100
|
"",
|
|
96
101
|
"Options:",
|
|
@@ -148,10 +153,21 @@ function parseArgs(argv) {
|
|
|
148
153
|
return parsed;
|
|
149
154
|
}
|
|
150
155
|
|
|
156
|
+
async function readInstallerVersion() {
|
|
157
|
+
try {
|
|
158
|
+
const raw = await fs.readFile(PACKAGE_JSON_PATH, "utf8");
|
|
159
|
+
const pkg = JSON.parse(raw);
|
|
160
|
+
if (typeof pkg.version === "string" && pkg.version.trim()) {
|
|
161
|
+
return pkg.version.trim();
|
|
162
|
+
}
|
|
163
|
+
} catch {
|
|
164
|
+
// Use fallback when package metadata is unavailable.
|
|
165
|
+
}
|
|
166
|
+
return "unknown";
|
|
167
|
+
}
|
|
168
|
+
|
|
151
169
|
function resolveSourceDir() {
|
|
152
|
-
|
|
153
|
-
const scriptDir = path.dirname(scriptPath);
|
|
154
|
-
return path.resolve(scriptDir, "..", "skill");
|
|
170
|
+
return path.resolve(SCRIPT_DIR, "..", "skill");
|
|
155
171
|
}
|
|
156
172
|
|
|
157
173
|
async function ensureSourceDir(sourceDir) {
|
|
@@ -510,18 +526,19 @@ async function confirmInstall(parsed, selectedTargets) {
|
|
|
510
526
|
|
|
511
527
|
async function main() {
|
|
512
528
|
const binName = path.basename(process.argv[1] || "cadence-install");
|
|
529
|
+
const installerVersion = await readInstallerVersion();
|
|
513
530
|
let parsed;
|
|
514
531
|
try {
|
|
515
532
|
parsed = parseArgs(process.argv.slice(2));
|
|
516
533
|
} catch (error) {
|
|
517
534
|
output.write(`Error: ${error.message}\n\n`);
|
|
518
|
-
printHelp(binName);
|
|
535
|
+
printHelp(binName, installerVersion);
|
|
519
536
|
process.exitCode = 1;
|
|
520
537
|
return;
|
|
521
538
|
}
|
|
522
539
|
|
|
523
540
|
if (parsed.help) {
|
|
524
|
-
printHelp(binName);
|
|
541
|
+
printHelp(binName, installerVersion);
|
|
525
542
|
return;
|
|
526
543
|
}
|
|
527
544
|
|
|
@@ -553,13 +570,19 @@ async function main() {
|
|
|
553
570
|
return;
|
|
554
571
|
}
|
|
555
572
|
|
|
573
|
+
output.write(
|
|
574
|
+
style(`\nInstalling Cadence skill version ${installerVersion}...\n`, ANSI.bold, ANSI.brightCyan)
|
|
575
|
+
);
|
|
576
|
+
|
|
556
577
|
for (const target of selectedTargetsWithState) {
|
|
557
578
|
await copySkillContents(sourceDir, target.targetDir);
|
|
558
579
|
const action = target.installState?.exists ? "Updated" : "Installed";
|
|
559
580
|
output.write(`${style(action, ANSI.bold, ANSI.brightGreen)} ${style(target.label, ANSI.bold, ANSI.white)}: ${style(target.targetDir, ANSI.periwinkle)}\n`);
|
|
560
581
|
}
|
|
561
582
|
|
|
562
|
-
output.write(
|
|
583
|
+
output.write(
|
|
584
|
+
style(`\nCadence skill installation complete (version ${installerVersion}).\n`, ANSI.bold, ANSI.brightGreen)
|
|
585
|
+
);
|
|
563
586
|
}
|
|
564
587
|
|
|
565
588
|
main().catch((error) => {
|
|
@@ -5,7 +5,7 @@ description: Initialize Cadence project scaffolding for first-time setup. Use wh
|
|
|
5
5
|
|
|
6
6
|
# Scaffold
|
|
7
7
|
|
|
8
|
-
1. Resolve project root by running `python3 ../../scripts/resolve-project-root.py` and store stdout in `PROJECT_ROOT`.
|
|
8
|
+
1. Resolve project root by running `python3 ../../scripts/resolve-project-root.py --project-root "$PWD"` and store stdout in `PROJECT_ROOT`.
|
|
9
9
|
- Never manually edit `.cadence/cadence.json`; all Cadence state writes must go through Cadence scripts.
|
|
10
10
|
2. Run `python3 ../../scripts/run-scaffold-gate.py --project-root "$PROJECT_ROOT"` (resolve this relative path from this sub-skill directory) and parse the JSON response.
|
|
11
11
|
3. `run-scaffold-gate.py` performs workflow route assertion internally; if it errors, stop and surface the exact error to the user.
|
|
@@ -25,12 +25,15 @@ description: Initialize Cadence project scaffolding for first-time setup. Use wh
|
|
|
25
25
|
- Keep local-only mode (`state.repo-enabled=false`) and continue until the user configures a GitHub repo later.
|
|
26
26
|
8. Ask the user: `Do you want .cadence tracked in git history? (yes/no)`.
|
|
27
27
|
9. If the user answers yes:
|
|
28
|
-
- Run `
|
|
29
|
-
- At end of this skill conversation, run `
|
|
28
|
+
- Run `python3 "$CADENCE_SCRIPTS_DIR/configure-cadence-gitignore.py" --mode track --gitignore-path "$PROJECT_ROOT/.gitignore"`.
|
|
29
|
+
- At end of this skill conversation, run `python3 "$CADENCE_SCRIPTS_DIR/finalize-skill-checkpoint.py" --scope scaffold --checkpoint cadence-tracked --paths . --project-root "$PROJECT_ROOT"`.
|
|
30
30
|
10. If the user answers no:
|
|
31
|
-
- Run `
|
|
32
|
-
- At end of this skill conversation, run `
|
|
33
|
-
11.
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
31
|
+
- Run `python3 "$CADENCE_SCRIPTS_DIR/configure-cadence-gitignore.py" --mode ignore --gitignore-path "$PROJECT_ROOT/.gitignore"`.
|
|
32
|
+
- At end of this skill conversation, run `python3 "$CADENCE_SCRIPTS_DIR/finalize-skill-checkpoint.py" --scope scaffold --checkpoint cadence-ignored --paths . --project-root "$PROJECT_ROOT"`.
|
|
33
|
+
11. Argument contract guardrail:
|
|
34
|
+
- `configure-cadence-gitignore.py` accepts `--mode` and optional `--gitignore-path`; do not pass `--project-root`.
|
|
35
|
+
- `finalize-skill-checkpoint.py` supports `--project-root`; always pass it explicitly.
|
|
36
|
+
12. If `finalize-skill-checkpoint.py` returns `status=no_changes`, continue without failure.
|
|
37
|
+
13. If `finalize-skill-checkpoint.py` reports an error, stop and surface it verbatim.
|
|
38
|
+
14. Execute scaffold actions serially. Do not run this flow in parallel with other setup gates.
|
|
39
|
+
15. In user-facing replies, summarize only the result. Do not expose internal command lines, skill chains, or execution traces unless explicitly requested.
|
|
@@ -3,14 +3,16 @@ interface:
|
|
|
3
3
|
short_description: "Initialize Cadence project scaffolding for first-time setup"
|
|
4
4
|
default_prompt: >-
|
|
5
5
|
Follow skills/scaffold/SKILL.md for exact scaffold and policy behavior.
|
|
6
|
-
Resolve PROJECT_ROOT with scripts/resolve-project-root.py, run
|
|
6
|
+
Resolve PROJECT_ROOT with scripts/resolve-project-root.py --project-root "$PWD", run
|
|
7
7
|
scripts/run-scaffold-gate.py --project-root "$PROJECT_ROOT", then run
|
|
8
8
|
scripts/run-skill-entry-gate.py --project-root "$PROJECT_ROOT" --require-cadence and use its JSON output for
|
|
9
9
|
CADENCE_SCRIPTS_DIR (cadence_scripts_dir) and push/local-only mode (repo_enabled).
|
|
10
|
+
For .cadence policy updates, run scripts/configure-cadence-gitignore.py with --mode and
|
|
11
|
+
--gitignore-path "$PROJECT_ROOT/.gitignore" only (do not pass --project-root).
|
|
10
12
|
Never edit .cadence/cadence.json manually.
|
|
11
13
|
Only rerun repo-status after remote setup to confirm repo_enabled=true; do not run an extra write pass
|
|
12
14
|
just to persist false in local-only mode.
|
|
13
|
-
Finalize
|
|
15
|
+
Finalize with scripts/finalize-skill-checkpoint.py --paths . --project-root "$PROJECT_ROOT" and the scope/checkpoint
|
|
14
16
|
that matches the selected policy (scaffold/cadence-tracked or scaffold/cadence-ignored), allowing
|
|
15
17
|
status=no_changes and treating failures as blocking.
|
|
16
18
|
Keep replies outcome-focused and hide internal traces unless asked.
|