Skip to content

abso-core

Public

abso is version control for agents: the client, the engine and a server you can run on your own Cloudflare account.

Check passed

Versions 21 to 22

Compare

+58 −0 in 1 place
new file, 58 lines
1+// abso skill: the skill the client carries, and where install
2+// writes it.
3+
4+import assert from "node:assert/strict";
5+import { mkdtempSync, readdirSync, readFileSync, rmSync, writeFileSync } from "node:fs";
6+import { tmpdir } from "node:os";
7+import { join, resolve } from "node:path";
8+import { after, describe, it } from "node:test";
9+import { main } from "../src/main.ts";
10+import { installSkill, SKILL, skillPath } from "../src/skill.ts";
12+const dir = mkdtempSync(join(tmpdir(), "abso-skill-"));
13+after(() => rmSync(dir, { recursive: true, force: true }));
15+describe("abso skill", () => {
16+ it("carries client/skills/abso/SKILL.md word for word", () => {
17+ assert.equal(SKILL, readFileSync(new URL("../skills/abso/SKILL.md", import.meta.url), "utf8"));
18+ });
20+ it("is instructions only: named abso, with no tools to allow", () => {
21+ const front = /^---\n([\s\S]*?)\n---\n/.exec(SKILL)?.[1];
22+ assert.ok(front, "the skill starts with its frontmatter");
23+ assert.match(front, /^name: abso$/m);
24+ assert.match(front, /^description: .+/m);
25+ assert.doesNotMatch(SKILL, /allowed-tools/i);
26+ });
28+ it("goes to ~/.claude/skills/abso/SKILL.md, or under the skills folder --dir names", () => {
29+ assert.equal(skillPath(undefined, "/work", "/home/a"), join("/home/a", ".claude", "skills", "abso", "SKILL.md"));
30+ assert.equal(skillPath("skills", "/work", "/home/a"), join(resolve("/work"), "skills", "abso", "SKILL.md"));
31+ });
33+ it("installs, says when it's already current, updates, and leaves the rest of the folder alone", () => {
34+ const skills = join(dir, "skills");
35+ const path = skillPath(skills, dir);
36+ assert.equal(installSkill(path), "installed");
37+ assert.equal(readFileSync(path, "utf8"), SKILL);
38+ assert.equal(installSkill(path), "current");
39+ writeFileSync(join(skills, "abso", "notes.md"), "mine");
40+ writeFileSync(path, "an older skill");
41+ assert.equal(installSkill(path), "updated");
42+ assert.equal(readFileSync(path, "utf8"), SKILL);
43+ assert.deepEqual(readdirSync(join(skills, "abso")).sort(), ["SKILL.md", "notes.md"]);
44+ });
46+ it("runs outside an abso folder, and shows the skill", async () => {
47+ const run = (...argv: string[]) => main(argv, { cwd: dir, env: {}, write: () => {} });
48+ const installed = await run("skill", "install", "--dir", "elsewhere");
49+ assert.equal(installed.exit, 0, installed.stderr);
50+ assert.match(installed.stdout, /^Installed the abso skill at .*SKILL\.md\. New Claude Code sessions load it\./);
51+ assert.equal(readFileSync(join(dir, "elsewhere", "abso", "SKILL.md"), "utf8"), SKILL);
52+ const shown = await run("skill", "show");
53+ assert.equal(shown.stdout.trimEnd(), SKILL.trimEnd());
54+ const wrong = await run("skill", "remove");
55+ assert.notEqual(wrong.exit, 0);
56+ assert.match(wrong.stderr, /abso skill install \[--dir <skills folder>\] \| abso skill show/);
57+ });
58+});
MCP
compare on this site's /mcp
CLI
abso diff 21 22 client/test/skill.test.ts --json
JSON
/christopher/abso-core/compare/21..22?file=client%2Ftest%2Fskill.test.ts&format=json