Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/workflows/gate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ jobs:
node-version: 22
- name: Test the gate
run: node --test gate/steerloop-gate.test.mjs
- name: Validate skills and stack.json
run: node scripts/validate-skills.mjs
- name: Check the pull request body
env:
BODY: ${{ github.event.pull_request.body }}
Expand Down
18 changes: 17 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,20 @@ git config core.hooksPath .githooks # from a clone of this repo

or copy `gate/steerloop-gate.mjs` into your own tooling and call it from a `commit-msg` hook or CI step.

## Profiles

Not every project needs fourteen skills. `stack.json` is the machine-readable list; these are the same groups as commands:

| Profile | What it covers | Install |
| --- | --- | --- |
| core | Gates, method, deepening | `npx skills add lukavtz/steerloop --skill steerloop --skill craftloop --skill be-ambitious` |
| web | Core plus performance and a landing page | `npx skills add lukavtz/steerloop --skill steerloop --skill craftloop --skill webperf --skill landing-page-design` |
| design | Page, Figma, anti-slop pass, figures, README | `npx skills add lukavtz/steerloop --skill landing-page-design --skill figma-designer --skill hallmark --skill anatomy --skill beautify-github-readme` |
| text | English and Russian prose | `npx skills add lukavtz/steerloop --skill stop-slop --skill ru-text --skill ru-check --skill ru-score --skill humanizer-ru` |
| full | All fourteen | `npx skills add lukavtz/steerloop` |

`npm test` validates every `SKILL.md` frontmatter and checks that `stack.json` matches the tree, so a skill cannot be added without being listed.

## The gate

| Check | Rejects |
Expand Down Expand Up @@ -141,7 +155,9 @@ skills/craftloop/SKILL.md the method
skills/craftloop/references/ security rules, loaded on demand
skills/webperf/SKILL.md web performance router
skills/webperf/references/ 31 recipes, one per symptom
skills/* five original, five vendored
skills/* fourteen skills, five original
scripts/validate-skills.mjs frontmatter and stack.json check
stack.json skills, profiles, origins, licenses
THIRD_PARTY_LICENSES/ MIT texts for the vendored skills
gate/steerloop-gate.mjs the report validator
gate/steerloop-gate.test.mjs 26 tests, run by npm test
Expand Down
9 changes: 6 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "steerloop",
"version": "0.2.0",
"version": "0.3.0",
"description": "Two agent skills that keep a coding agent on one slice: ask before coding, red-first tests, stop gates, honest reports — plus a commit gate that enforces the report.",
"license": "MIT",
"repository": {
Expand All @@ -22,14 +22,17 @@
"steerloop-gate": "./gate/steerloop-gate.mjs"
},
"scripts": {
"test": "node --test gate/steerloop-gate.test.mjs",
"test": "node --test gate/steerloop-gate.test.mjs && node scripts/validate-skills.mjs",
"gate:install": "git config core.hooksPath .githooks",
"gate:check": "node gate/steerloop-gate.mjs --body-file"
"gate:check": "node gate/steerloop-gate.mjs --body-file",
"validate": "node scripts/validate-skills.mjs"
},
"files": [
"skills",
"gate",
"scripts",
".githooks",
"stack.json",
"THIRD_PARTY_NOTICE.md",
"THIRD_PARTY_LICENSES",
"README.md",
Expand Down
91 changes: 91 additions & 0 deletions scripts/validate-skills.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
#!/usr/bin/env node
// Validates every skills/<name>/SKILL.md against the Agent Skills frontmatter rules,
// and checks stack.json against the tree.
// Usage: node scripts/validate-skills.mjs

import { existsSync, readFileSync, readdirSync } from "node:fs";
import { dirname, join } from "node:path";
import { fileURLToPath } from "node:url";

const ROOT = join(dirname(fileURLToPath(import.meta.url)), "..");
const SKILLS = join(ROOT, "skills");
const NAME = /^[a-z0-9]+(-[a-z0-9]+)*$/;
const LIMITS = { name: 64, description: 1024, compatibility: 500 };

function frontmatter(raw) {
const lines = raw.replace(/^\uFEFF/, "").replace(/\r\n?/g, "\n").split("\n");
if (lines[0]?.trim() !== "---") return null;
const end = lines.findIndex((line, index) => index > 0 && line.trim() === "---");
return end < 0 ? null : parseBlock(lines.slice(1, end));
}

function parseBlock(lines) {
const out = {};
for (let i = 0; i < lines.length; i += 1) {
const match = lines[i].match(/^([a-z0-9-]+):\s*(.*)$/);
if (!match) continue;
const key = match[1];
const rest = match[2];
if (rest === ">" || rest === "|") {
const parts = [];
while (i + 1 < lines.length && /^\s+\S/.test(lines[i + 1])) parts.push(lines[++i].trim());
out[key] = parts.join(" ");
} else {
out[key] = rest.replace(/^["']|["']$/g, "").trim();
}
}
return out;
}

function skillProblems(dir) {
const file = join(SKILLS, dir, "SKILL.md");
if (!existsSync(file)) return [`${dir}: SKILL.md is missing`];
const data = frontmatter(readFileSync(file, "utf8"));
if (!data) return [`${dir}: no frontmatter block`];
const problems = [];
if (!data.name) problems.push(`${dir}: name is missing`);
else if (data.name !== dir) problems.push(`${dir}: name "${data.name}" does not match the folder`);
else if (!NAME.test(data.name)) problems.push(`${dir}: name must be lowercase words joined by single hyphens`);
if (!data.description) problems.push(`${dir}: description is missing`);
for (const [key, max] of Object.entries(LIMITS)) {
if (data[key] && data[key].length > max) problems.push(`${dir}: ${key} is ${data[key].length} chars, limit ${max}`);
}
return problems;
}

function listingProblems(skills, stack) {
const listed = Object.keys(stack.skills ?? {});
const missingFromStack = skills.filter((name) => !listed.includes(name)).map((n) => `stack.json: ${n} is not listed in skills`);
const missingFromTree = listed.filter((name) => !skills.includes(name)).map((n) => `stack.json: ${n} has no skills/${n}/SKILL.md`);
return [...missingFromStack, ...missingFromTree];
}

function profileProblems(skills, stack) {
return Object.entries(stack.profiles ?? {}).flatMap(([profile, names]) =>
names.filter((name) => !skills.includes(name)).map((name) => `stack.json: profile ${profile} names unknown skill ${name}`),
);
}

function stackProblems(skills) {
const file = join(ROOT, "stack.json");
if (!existsSync(file)) return ["stack.json is missing"];
const stack = JSON.parse(readFileSync(file, "utf8"));
return [...listingProblems(skills, stack), ...profileProblems(skills, stack)];
}

function main() {
const skills = readdirSync(SKILLS, { withFileTypes: true })
.filter((entry) => entry.isDirectory())
.map((entry) => entry.name)
.sort();
const problems = [...skills.flatMap(skillProblems), ...stackProblems(skills)];
if (problems.length === 0) {
console.log(`skills: ${skills.length} valid, stack.json consistent`);
return 0;
}
for (const problem of problems) console.error(` - ${problem}`);
console.error(`\n${problems.length} problem(s)`);
return 1;
}

process.exit(main());
45 changes: 45 additions & 0 deletions stack.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
{
"name": "steerloop",
"version": "0.3.0",
"license": "MIT",
"install": "npx skills add lukavtz/steerloop",
"gate": "git config core.hooksPath .githooks",
"profiles": {
"core": ["steerloop", "craftloop", "be-ambitious"],
"web": ["steerloop", "craftloop", "webperf", "landing-page-design"],
"design": ["landing-page-design", "figma-designer", "hallmark", "anatomy", "beautify-github-readme"],
"text": ["stop-slop", "ru-text", "ru-check", "ru-score", "humanizer-ru"],
"full": [
"steerloop",
"craftloop",
"be-ambitious",
"webperf",
"landing-page-design",
"figma-designer",
"hallmark",
"anatomy",
"beautify-github-readme",
"stop-slop",
"ru-text",
"ru-check",
"ru-score",
"humanizer-ru"
]
},
"skills": {
"steerloop": { "origin": "original", "license": "MIT" },
"craftloop": { "origin": "original", "license": "MIT" },
"webperf": { "origin": "original", "license": "MIT" },
"landing-page-design": { "origin": "elayadesign/ai-design-skills@456d9e0", "license": "MIT" },
"figma-designer": { "origin": "elayadesign/ai-design-skills@456d9e0", "license": "MIT" },
"be-ambitious": { "origin": "DannyMac180/skills@7dc63b7", "license": "MIT" },
"hallmark": { "origin": "nutlope/hallmark@407fa68", "license": "MIT" },
"stop-slop": { "origin": "hardikpandya/stop-slop@8da1f03", "license": "MIT" },
"anatomy": { "origin": "wheresryan22/anatomy@1482e84", "license": "MIT" },
"beautify-github-readme": { "origin": "oil-oil/beautify-github-readme@d6562a5", "license": "MIT" },
"ru-text": { "origin": "talkstream/ru-text@e398aec", "license": "MIT" },
"ru-check": { "origin": "talkstream/ru-text@e398aec", "license": "MIT" },
"ru-score": { "origin": "talkstream/ru-text@e398aec", "license": "MIT" },
"humanizer-ru": { "origin": "ilyautov/humanizer-ru@b6df5d9", "license": "MIT" }
}
}
Loading