Skip to content

Rules for an AI coding agent to filter out generic AI-generated UI designs, text, and code.

ci: install cli dependencies, and fix the smoke test crash on a failed check

miqdadbadzubair-design8ad3f2c73b87
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 6cd1143..37a35de 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -12,11 +12,13 @@ jobs:
check:
runs-on: ubuntu-latest
steps:
- - uses: actions/checkout@v4
+ - uses: actions/checkout@v7
- - uses: actions/setup-node@v4
+ - uses: actions/setup-node@v7
with:
- node-version: 20
+ node-version: 22
+ cache: npm
+ cache-dependency-path: cli/package-lock.json
# The rules antislop applies to other repos, applied to this one.
- name: Repo guardrails
@@ -33,5 +35,12 @@ jobs:
node cli/scripts/sync-skills.mjs
git diff --exit-code -- skills/
+ # The smoke test starts the picker, so its dependencies have to exist first.
+ # Without this the picker dies on an import error and never reaches the
+ # no-terminal guard the smoke test is checking for.
+ - name: Install cli dependencies
+ working-directory: cli
+ run: npm ci
+
- name: Installer smoke test
run: node cli/scripts/smoke-test.mjs
diff --git a/cli/scripts/smoke-test.mjs b/cli/scripts/smoke-test.mjs
index 091bd78..13dc8c3 100644
--- a/cli/scripts/smoke-test.mjs
+++ b/cli/scripts/smoke-test.mjs
@@ -42,22 +42,29 @@ const coreSkill = path.join(tmp, '.claude', 'skills', 'antislop', 'SKILL.md')
const coreInstalled = fs.existsSync(coreSkill)
console.log('\ncore SKILL.md exists:', coreInstalled)
-// The wizard needs a terminal. With stdin closed it used to print its prompts, install
-// nothing, and still exit 0, so callers saw success. It has to refuse and say why.
-const noTty = spawnSync(process.execPath, [path.join(__dirname, '..', 'index.mjs')], {
- cwd: tmp,
- encoding: 'utf8',
- stdio: ['ignore', 'pipe', 'pipe'],
-})
-const refused = noTty.status === 1 && /needs a terminal/.test(noTty.stderr)
-console.log('no-terminal run: exit', noTty.status, '| refused:', refused)
-if (!refused) reasons.push(`a no-terminal run should exit 1 and say why, got exit ${noTty.status}`)
-
-// Decide before cleaning up, so a failure still leaves a tidy temp dir behind.
+// Every failure is collected here and decided before cleanup, so a failing run
+// still leaves a tidy temp dir behind.
const reasons = []
if (result.status !== 0) reasons.push(`worker exited ${result.status}`)
if (!coreInstalled) reasons.push('core SKILL.md was not installed')
+// The wizard needs a terminal. With stdin closed it used to print its prompts, install
+// nothing, and still exit 0, so callers saw success. It has to refuse and say why.
+// Loading it needs the cli's dependencies, so a bare checkout reports a skip instead.
+const cliDeps = fs.existsSync(path.join(__dirname, '..', 'node_modules', '@clack'))
+if (cliDeps) {
+ const noTty = spawnSync(process.execPath, [path.join(__dirname, '..', 'index.mjs')], {
+ cwd: tmp,
+ encoding: 'utf8',
+ stdio: ['ignore', 'pipe', 'pipe'],
+ })
+ const refused = noTty.status === 1 && /needs a terminal/.test(noTty.stderr)
+ console.log('no-terminal run: exit', noTty.status, '| refused:', refused)
+ if (!refused) reasons.push(`a no-terminal run should exit 1 and say why, got exit ${noTty.status}`)
+} else {
+ console.log('no-terminal run: skipped, cli dependencies are not installed')
+}
+
fs.rmSync(tmp, { recursive: true, force: true })
console.log('\ncleaned up temp project.')