From cc01df9fecda4dcc5190fbf466f47ed3ea8a5965 Mon Sep 17 00:00:00 2001 From: tommy0103 Date: Thu, 16 Jul 2026 20:51:58 +0800 Subject: [PATCH] fix(cli): clarify skill scope and stabilize Node 22 tests MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Require the bootstrap agent to ask whether the skill should be installed locally or globally, and suppress only SQLite’s ExperimentalWarning in CLI test processes. --- README.md | 5 +++-- SKILL.md | 29 ++++++++++++++++++++++++---- packaging/skill-README.md | 3 ++- skills-lock.json | 11 +++++++++++ tests/cli-bootstrap-install.test.mjs | 4 ++++ tests/cli-package.test.mjs | 18 +++++++++++++++++ tests/cli-test-helpers.mjs | 6 +++++- 7 files changed, 68 insertions(+), 8 deletions(-) create mode 100644 skills-lock.json diff --git a/README.md b/README.md index 5fb821b..b224544 100644 --- a/README.md +++ b/README.md @@ -65,8 +65,9 @@ curl -fsSL https://raw.githubusercontent.com/tommy0103/obelisk/main/SKILL.md ``` The agent will ask before changing your machine, install and verify the CLI, -then install the formal `/obelisk` skill. The bootstrap guide is only for -one-time setup; it is not the query skill itself. +then ask whether the formal `/obelisk` skill should be installed for the current +project or globally. The bootstrap guide is only for one-time setup; it is not +the query skill itself. #### Install manually diff --git a/SKILL.md b/SKILL.md index 725b730..4d68f3a 100644 --- a/SKILL.md +++ b/SKILL.md @@ -46,15 +46,36 @@ Verify the result: obelisk --version ``` -## 3. Install the official skill +## 3. Choose the skill installation scope + +The standard skills installer defaults to the current project. Before running +it, tell the user about that default and ask whether `/obelisk` should be +installed: + +- **For the current project only** — available only in the project where the + installer runs. +- **Globally** — available across the user's projects. + +Do not silently choose the current-project default. If the user already stated +the scope explicitly, use that choice without asking again. + +Run the command that matches the user's answer: + +Current project: ```bash obelisk install ``` -Pass through any target or scope options the user requested. The command uses -the standard skills installer, so follow its prompts instead of copying skill -files by hand. +Global: + +```bash +obelisk install --global +``` + +Pass through any additional target options the user requested. The command +uses the standard skills installer, so follow its prompts instead of copying +skill files by hand. After installation, tell the user to reload their agent if the new `/obelisk` skill is not discovered immediately. This bootstrap document is not the query diff --git a/packaging/skill-README.md b/packaging/skill-README.md index cb047c1..6595c66 100644 --- a/packaging/skill-README.md +++ b/packaging/skill-README.md @@ -12,7 +12,8 @@ Install Obelisk by fetching and following this guide: curl -fsSL https://raw.githubusercontent.com/tommy0103/obelisk/main/SKILL.md ``` -The agent installs and verifies the CLI first, then installs this skill. +The agent installs and verifies the CLI first, then asks whether this skill +should be installed for the current project or globally. ## Install manually diff --git a/skills-lock.json b/skills-lock.json new file mode 100644 index 0000000..06fc862 --- /dev/null +++ b/skills-lock.json @@ -0,0 +1,11 @@ +{ + "version": 1, + "skills": { + "obelisk": { + "source": "tommy0103/obelisk-skill", + "sourceType": "github", + "skillPath": "skills/obelisk/SKILL.md", + "computedHash": "3f8e5bd50cd3bdfe6658243a3379bf4c44379a60bed3c1c946195529db1b8dfd" + } + } +} diff --git a/tests/cli-bootstrap-install.test.mjs b/tests/cli-bootstrap-install.test.mjs index 647ffd3..bf56883 100644 --- a/tests/cli-bootstrap-install.test.mjs +++ b/tests/cli-bootstrap-install.test.mjs @@ -21,6 +21,10 @@ test('root SKILL.md bootstraps the CLI before installing the official skill', () assert.match(source, /install\.sh/); assert.match(source, /obelisk --version/); assert.match(source, /obelisk install/); + assert.match(source, /defaults to the current project/i); + assert.match(source, /ask whether .*should be\s+installed/is); + assert.match(source, /obelisk install --global/); + assert.match(source, /Do not silently choose the current-project default/); assert.doesNotMatch(source, /obelisk --query/); }); diff --git a/tests/cli-package.test.mjs b/tests/cli-package.test.mjs index dd05abd..75d5549 100644 --- a/tests/cli-package.test.mjs +++ b/tests/cli-package.test.mjs @@ -30,6 +30,24 @@ test('obelisk --version reports the installed CLI package version', () => { assert.equal(result.stderr, ''); }); +test('CLI test process suppresses only Node ExperimentalWarning output', () => { + const home = mkdtempSync(join(tmpdir(), 'obelisk-cli-warning-')); + const preload = join(home, 'warnings.cjs'); + writeFileSync(preload, ` + process.emitWarning('simulated SQLite warning', 'ExperimentalWarning'); + process.emitWarning('ordinary warning stays visible', 'ObeliskTestWarning'); + `); + + const result = runCli(['--version'], { + home, + env: { NODE_OPTIONS: `--require=${preload}` }, + }); + + assert.equal(result.status, 0, result.stderr || result.stdout); + assert.doesNotMatch(result.stderr, /simulated SQLite warning/); + assert.match(result.stderr, /ordinary warning stays visible/); +}); + test('obelisk install delegates official skill installation to the skills CLI', () => { const home = mkdtempSync(join(tmpdir(), 'obelisk-cli-install-')); const fakeBin = join(home, 'bin'); diff --git a/tests/cli-test-helpers.mjs b/tests/cli-test-helpers.mjs index f934217..d80b903 100644 --- a/tests/cli-test-helpers.mjs +++ b/tests/cli-test-helpers.mjs @@ -6,7 +6,11 @@ export const repoRoot = resolve(dirname(fileURLToPath(import.meta.url)), '..'); export const cliEntry = join(repoRoot, 'packages', 'cli', 'dist', 'cli', 'src', 'obelisk.js'); export function runCli(args, { home, env = {}, cwd = repoRoot } = {}) { - return spawnSync(process.execPath, [cliEntry, ...args], { + return spawnSync(process.execPath, [ + '--disable-warning=ExperimentalWarning', + cliEntry, + ...args, + ], { cwd, env: { ...process.env,