Skip to content

Practical patterns, starters & CLI tools for loop engineering with AI coding agents. Design systems that prompt and orchestrate agents (inspired by Addy Osmani and Boris Cherny). Includes loop-audit, loop-init, loop-cost.

fix: publish readiness-core to npm

THRISHAL123450792e03b3be9
diff --git a/.github/workflows/release-goal-audit.yml b/.github/workflows/release-goal-audit.yml
index aa25531..7935474 100644
--- a/.github/workflows/release-goal-audit.yml
+++ b/.github/workflows/release-goal-audit.yml
@@ -28,7 +28,19 @@ jobs:
- name: Install, build, test
working-directory: tools/goal-audit
run: |
- npm ci
+ # Build monorepo sibling first — declared ^range may not be on npm yet
+ (cd ../readiness-core && npm ci && npm run build)
+ cp package.json package.json.release-bak
+ cp package-lock.json package-lock.json.release-bak
+ node -e "
+ const fs = require('fs');
+ const p = JSON.parse(fs.readFileSync('package.json', 'utf8'));
+ p.dependencies['@cobusgreyling/readiness-core'] = 'file:../readiness-core';
+ fs.writeFileSync('package.json', JSON.stringify(p, null, 2) + '\n');
+ "
+ npm install
+ mv package.json.release-bak package.json
+ mv package-lock.json.release-bak package-lock.json
npm run build
npm test
diff --git a/.github/workflows/release-loop-audit.yml b/.github/workflows/release-loop-audit.yml
index 23ef88f..a6ea923 100644
--- a/.github/workflows/release-loop-audit.yml
+++ b/.github/workflows/release-loop-audit.yml
@@ -38,7 +38,19 @@ jobs:
- name: Install, build, test
working-directory: tools/loop-audit
run: |
- npm ci
+ # Build monorepo sibling first — declared ^range may not be on npm yet
+ (cd ../readiness-core && npm ci && npm run build)
+ cp package.json package.json.release-bak
+ cp package-lock.json package-lock.json.release-bak
+ node -e "
+ const fs = require('fs');
+ const p = JSON.parse(fs.readFileSync('package.json', 'utf8'));
+ p.dependencies['@cobusgreyling/readiness-core'] = 'file:../readiness-core';
+ fs.writeFileSync('package.json', JSON.stringify(p, null, 2) + '\n');
+ "
+ npm install
+ mv package.json.release-bak package.json
+ mv package-lock.json.release-bak package-lock.json
npm run build
npm test
diff --git a/.github/workflows/release-readiness-core.yml b/.github/workflows/release-readiness-core.yml
new file mode 100644
index 0000000..a79fc65
--- /dev/null
+++ b/.github/workflows/release-readiness-core.yml
@@ -0,0 +1,49 @@
+name: Release readiness-core
+
+on:
+ push:
+ tags:
+ - 'readiness-core-v*'
+ workflow_dispatch:
+ inputs:
+ tag:
+ description: 'Tag to publish (e.g. readiness-core-v1.0.0)'
+ required: true
+ type: string
+
+permissions:
+ contents: read
+ id-token: write
+
+jobs:
+ test-and-publish:
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v7
+ with:
+ ref: ${{ github.event_name == 'workflow_dispatch' && format('refs/tags/{0}', github.event.inputs.tag) || github.ref }}
+
+ - uses: actions/setup-node@v7
+ with:
+ node-version: '22'
+ registry-url: 'https://registry.npmjs.org'
+ cache: 'npm'
+ cache-dependency-path: tools/readiness-core/package-lock.json
+
+ - name: Ensure npm supports trusted publishing (OIDC)
+ run: |
+ npm install -g npm@latest
+ npm install -g sigstore
+
+ - name: Install, build, test
+ working-directory: tools/readiness-core
+ run: |
+ npm ci
+ npm run build
+ npm test
+
+ - name: Publish to npm
+ working-directory: tools/readiness-core
+ run: npm publish --access public --provenance
+ env:
+ NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
diff --git a/docs/RELEASE.md b/docs/RELEASE.md
index 31acca7..14ea3e7 100644
--- a/docs/RELEASE.md
+++ b/docs/RELEASE.md
@@ -1,9 +1,10 @@
# Release playbook — npm packages
-This repo ships nine public npm packages from `tools/`:
+This repo ships ten public npm packages from `tools/`:
| Package | Directory | Release tag |
|---------|-----------|-------------|
+| `@cobusgreyling/readiness-core` | `tools/readiness-core` | `readiness-core-v*` |
| `@cobusgreyling/loop-audit` | `tools/loop-audit` | `loop-audit-v*` |
| `@cobusgreyling/loop-init` | `tools/loop-init` | `loop-init-v*` |
| `@cobusgreyling/loop-cost` | `tools/loop-cost` | `loop-cost-v*` |
@@ -20,6 +21,7 @@ Link npm to GitHub, then for **each package** on [npmjs.com](https://www.npmjs.c
| Package | Repository | Workflow filename |
|---------|--------------|-------------------|
+| `@cobusgreyling/readiness-core` | `cobusgreyling/loop-engineering` | `release-readiness-core.yml` |
| `@cobusgreyling/loop-audit` | `cobusgreyling/loop-engineering` | `release-loop-audit.yml` |
| `@cobusgreyling/loop-init` | `cobusgreyling/loop-engineering` | `release-loop-init.yml` |
| `@cobusgreyling/loop-cost` | `cobusgreyling/loop-engineering` | `release-loop-cost.yml` |
@@ -47,6 +49,10 @@ Edit `version` in the package `package.json`, update that package's `CHANGELOG.m
Tag pushes trigger the release workflows:
```bash
+# readiness-core (MUST be published before loop-audit and goal-audit)
+git tag readiness-core-v1.0.0
+git push origin readiness-core-v1.0.0
+
# loop-audit (runs tests before publish)
git tag loop-audit-v1.6.0
git push origin loop-audit-v1.6.0
@@ -84,7 +90,7 @@ git tag goal-audit-v1.0.2
git push origin goal-audit-v1.0.2
```
-Workflows: `.github/workflows/release-loop-audit.yml`, `.github/workflows/release-loop-init.yml`, `.github/workflows/release-loop-cost.yml`, `.github/workflows/release-loop-sync.yml`, `.github/workflows/release-loop-context.yml`, `.github/workflows/release-loop-mcp-server.yml`, `.github/workflows/release-loop-worktree.yml`, `.github/workflows/release-loop-gate.yml`, `.github/workflows/release-goal-audit.yml`.
+Workflows: `.github/workflows/release-readiness-core.yml`, `.github/workflows/release-loop-audit.yml`, `.github/workflows/release-loop-init.yml`, `.github/workflows/release-loop-cost.yml`, `.github/workflows/release-loop-sync.yml`, `.github/workflows/release-loop-context.yml`, `.github/workflows/release-loop-mcp-server.yml`, `.github/workflows/release-loop-worktree.yml`, `.github/workflows/release-loop-gate.yml`, `.github/workflows/release-goal-audit.yml`.
## Verify after publish
diff --git a/package.json b/package.json
index 1adab32..43f2356 100644
--- a/package.json
+++ b/package.json
@@ -15,8 +15,9 @@
"test:loop-worktree": "cd tools/loop-worktree && npm test",
"test:goal-init": "cd tools/goal-init && npm test",
"test:readiness-core": "cd tools/readiness-core && npm test",
- "test:tools": "npm run test:readiness-core && npm run test:loop-audit && npm run test:loop-init && npm run test:loop-cost && npm run test:loop-sync && npm run test:loop-context && npm run test:loop-gate && npm run test:mcp-server && npm run test:loop-worktree && npm run test:goal-init",
- "build:tools": "cd tools/readiness-core && npm run build && cd ../loop-audit && npm run build && cd ../loop-init && npm run build && cd ../loop-cost && npm run build && cd ../loop-sync && npm run build && cd ../loop-context && npm run build && cd ../loop-gate && npm run build && cd ../mcp-server && npm run build && cd ../loop-worktree && npm run build && cd ../goal-init && npm run build",
+ "test:goal-audit": "cd tools/goal-audit && npm test",
+ "test:tools": "npm run test:readiness-core && npm run test:loop-audit && npm run test:loop-init && npm run test:loop-cost && npm run test:loop-sync && npm run test:loop-context && npm run test:loop-gate && npm run test:mcp-server && npm run test:loop-worktree && npm run test:goal-audit && npm run test:goal-init",
+ "build:tools": "cd tools/readiness-core && npm run build && cd ../loop-audit && npm run build && cd ../loop-init && npm run build && cd ../loop-cost && npm run build && cd ../loop-sync && npm run build && cd ../loop-context && npm run build && cd ../loop-gate && npm run build && cd ../mcp-server && npm run build && cd ../loop-worktree && npm run build && cd ../goal-audit && npm run build && cd ../goal-init && npm run build",
"contributors:generate": "node scripts/generate-contributors.mjs",
"contributors:check": "node scripts/generate-contributors.mjs --check"
},
diff --git a/scripts/ci-audit-gates.sh b/scripts/ci-audit-gates.sh
index 0b770fd..f0a30e2 100755
--- a/scripts/ci-audit-gates.sh
+++ b/scripts/ci-audit-gates.sh
@@ -12,7 +12,17 @@ echo "Building readiness-core…"
)
cd "$REPO_ROOT/tools/loop-audit"
-npm ci
+cp package.json package.json.ci-bak
+cp package-lock.json package-lock.json.ci-bak
+node -e "
+ const fs = require('fs');
+ const p = JSON.parse(fs.readFileSync('package.json', 'utf8'));
+ p.dependencies['@cobusgreyling/readiness-core'] = 'file:../readiness-core';
+ fs.writeFileSync('package.json', JSON.stringify(p, null, 2) + '\n');
+"
+npm install
+mv package.json.ci-bak package.json
+mv package-lock.json.ci-bak package-lock.json
npm test
echo "=== Audit of repo root ==="
node dist/cli.js "$REPO_ROOT" --json > /tmp/root-audit.json
diff --git a/scripts/ci-validate-gates.sh b/scripts/ci-validate-gates.sh
index b1b843f..5a21799 100755
--- a/scripts/ci-validate-gates.sh
+++ b/scripts/ci-validate-gates.sh
@@ -34,20 +34,40 @@ echo "Building and testing readiness-core…"
(
cd tools/readiness-core
npm ci
- npm run build
+ npm test
)
echo "Building and testing loop-audit…"
(
cd tools/loop-audit
- npm ci
+ cp package.json package.json.ci-bak
+ cp package-lock.json package-lock.json.ci-bak
+ node -e "
+ const fs = require('fs');
+ const p = JSON.parse(fs.readFileSync('package.json', 'utf8'));
+ p.dependencies['@cobusgreyling/readiness-core'] = 'file:../readiness-core';
+ fs.writeFileSync('package.json', JSON.stringify(p, null, 2) + '\n');
+ "
+ npm install
+ mv package.json.ci-bak package.json
+ mv package-lock.json.ci-bak package-lock.json
npm test
)
echo "Building and testing goal-audit…"
(
cd tools/goal-audit
- npm ci
+ cp package.json package.json.ci-bak
+ cp package-lock.json package-lock.json.ci-bak
+ node -e "
+ const fs = require('fs');
+ const p = JSON.parse(fs.readFileSync('package.json', 'utf8'));
+ p.dependencies['@cobusgreyling/readiness-core'] = 'file:../readiness-core';
+ fs.writeFileSync('package.json', JSON.stringify(p, null, 2) + '\n');
+ "
+ npm install
+ mv package.json.ci-bak package.json
+ mv package-lock.json.ci-bak package-lock.json
npm test
)
diff --git a/tools/goal-audit/package.json b/tools/goal-audit/package.json
index 72d0a66..ef19ac8 100644
--- a/tools/goal-audit/package.json
+++ b/tools/goal-audit/package.json
@@ -47,6 +47,6 @@
"typescript": "^5.0.0"
},
"dependencies": {
- "@cobusgreyling/readiness-core": "file:../readiness-core"
+ "@cobusgreyling/readiness-core": "^1.0.0"
}
}
diff --git a/tools/loop-audit/package.json b/tools/loop-audit/package.json
index df389a6..e8bf724 100644
--- a/tools/loop-audit/package.json
+++ b/tools/loop-audit/package.json
@@ -52,6 +52,6 @@
"typescript": "^7.0.2"
},
"dependencies": {
- "@cobusgreyling/readiness-core": "file:../readiness-core"
+ "@cobusgreyling/readiness-core": "^1.0.0"
}
}
diff --git a/tools/readiness-core/README.md b/tools/readiness-core/README.md
new file mode 100644
index 0000000..dcc918c
--- /dev/null
+++ b/tools/readiness-core/README.md
@@ -0,0 +1,7 @@
+# @cobusgreyling/readiness-core
+
+Core types and utilities for `loop-audit` and `goal-audit`.
+
+## Usage
+
+This package is intended for internal use within the `loop-engineering` monorepo. It exports shared types like `BaseAuditResult`, `Finding`, and core heuristics for auditing file existence and skill directories.
diff --git a/tools/readiness-core/package.json b/tools/readiness-core/package.json
index 2d5740f..95c9eb3 100644
--- a/tools/readiness-core/package.json
+++ b/tools/readiness-core/package.json
@@ -1,13 +1,13 @@
{
"name": "@cobusgreyling/readiness-core",
"version": "1.0.0",
- "description": "Shared readiness types and utilities for loop audits.",
- "private": true,
+ "description": "Core types and utilities for loop and goal audits.",
"type": "module",
"main": "dist/index.js",
"types": "dist/index.d.ts",
"files": [
- "dist"
+ "dist",
+ "README.md"
],
"scripts": {
"build": "tsc",
@@ -23,6 +23,13 @@
"url": "git+https://github.com/cobusgreyling/loop-engineering.git",
"directory": "tools/readiness-core"
},
+ "homepage": "https://cobusgreyling.github.io/loop-engineering/",
+ "bugs": {
+ "url": "https://github.com/cobusgreyling/loop-engineering/issues"
+ },
+ "publishConfig": {
+ "access": "public"
+ },
"devDependencies": {
"@types/node": "^22.0.0",
"typescript": "^5.0.0"
diff --git a/tools/readiness-core/test/index.test.mjs b/tools/readiness-core/test/index.test.mjs
index 3a446fb..812e3d7 100644
--- a/tools/readiness-core/test/index.test.mjs
+++ b/tools/readiness-core/test/index.test.mjs
@@ -17,6 +17,20 @@ test('fileExists returns false for missing file', async () => {
test('scanSkillDirectories finds skills in target directory', async () => {
// We can test this by running it on a known directory or setting up a mock
// For simplicity, let's scan the current directory and ensure it handles empty or missing gracefully.
- const skills = await scanSkillDirectories(path.join(process.cwd(), 'test-data-missing'));
- assert.deepStrictEqual(skills, []);
+ const missingSkills = await scanSkillDirectories(path.join(process.cwd(), 'test-data-missing'));
+ assert.deepStrictEqual(missingSkills, []);
+
+ // Setup a mock fixture
+ const fixtureDir = path.join(process.cwd(), '.test-fixture');
+ await fs.rm(fixtureDir, { recursive: true, force: true });
+ await fs.mkdir(path.join(fixtureDir, '.grok', 'skills', 'foo'), { recursive: true });
+ await fs.mkdir(path.join(fixtureDir, 'skills', 'bar'), { recursive: true });
+ await fs.writeFile(path.join(fixtureDir, 'skills', 'SKILL.md'), '# root-skill\n');
+
+ const skills = await scanSkillDirectories(fixtureDir);
+ assert.ok(skills.includes('foo'), 'Should detect tool-specific skill foo');
+ assert.ok(skills.includes('bar'), 'Should detect generic skill bar');
+ assert.ok(skills.includes('root-skill'), 'Should detect root SKILL.md');
+
+ await fs.rm(fixtureDir, { recursive: true, force: true });
});