Skip to content
Open
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
25 changes: 3 additions & 22 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,25 +83,6 @@ Test-first; see [`docs/SPEC.md`](./docs/SPEC.md) §7.

### Updating skills

`renderinc/skills` is the source of truth. Copybara mirrors its distributable files to
[`render-oss/skills`](https://github.com/render-oss/skills), and this repository syncs from that
public mirror. `.github/workflows/sync-skills.yml` checks daily at 06:00 UTC and can also be run
manually; it verifies changes before opening a `skills-sync` pull request.

Run the same sync locally:

```bash
npm run sync-skills
npm run sync-skills -- --ref <commit-or-tag>
npm run sync-skills -- --repo ../../skills --ref main # local source-of-truth clone
npm run verify
```

The script applies the public mirror's source-only eval exclusions and records the resolved source,
ref, and commit in `skills/.sync-source`. Never edit vendored skills by hand. Keep auto-merge
disabled unless the repository requires the verify check; then set the
`SKILLS_SYNC_AUTOMERGE=true` repository Actions variable to allow squash auto-merge.

The public mirror is the release input. Public contributions can temporarily lead the internal
clone until their reverse-Copybara PR is merged, so compare local-clone output with
`render-oss/skills` before using it in a release.
This repository is published automatically. Don't edit it directly; vendored skills in `skills/`
match [`render-oss/skills`](https://github.com/render-oss/skills), and `skills/.sync-source`
records the release they came from. Report problems as issues.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
"files": [
"src",
"skills",
"shared/references",
"README.md",
"LICENSE",
"CHANGELOG.md"
Expand All @@ -38,8 +39,7 @@
"lint": "biome check .",
"format": "biome format --write .",
"test": "vitest run",
"verify": "npm run typecheck && npm run lint && npm run test",
"sync-skills": "bash scripts/sync-skills.sh"
"verify": "npm run typecheck && npm run lint && npm run test"
},
"dependencies": {
"pi-mcp-adapter": "2.19.0"
Expand Down
19 changes: 3 additions & 16 deletions tests/package/lockfile.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,15 @@ import { describe, expect, it } from "vitest";
* a lockfile that does not already satisfy package.json instead of resolving the difference.
*
* The npm major matters too. A lockfile written by npm 11 can be unusable by the npm 10 bundled
* with the `engines` floor, so `.nvmrc` pins the floor and both workflows read it — that is what
* makes CI exercise the oldest supported npm. The dry run below only covers whatever npm is
* running it, which is why the pin is asserted rather than assumed.
* with the `engines` floor, so `.nvmrc` pins the floor and CI reads it — that is what makes CI
* exercise the oldest supported npm. The dry run below only covers whatever npm is running it,
* which is why the pin is asserted rather than assumed.
*/
const repoRoot = fileURLToPath(new URL("../..", import.meta.url));
const pkg = JSON.parse(readFileSync(join(repoRoot, "package.json"), "utf8")) as {
engines?: { node?: string };
};
const nvmrc = readFileSync(join(repoRoot, ".nvmrc"), "utf8").trim();
const workflows = ["verify.yml", "sync-skills.yml"].map((name) => ({
name,
body: readFileSync(join(repoRoot, ".github/workflows", name), "utf8"),
}));

describe("dependency lockfile", () => {
it("is installable by npm ci, not just npm install", () => {
Expand All @@ -38,13 +34,4 @@ describe("dependency lockfile", () => {
it("pins the toolchain to the engines floor so CI installs on the oldest supported npm", () => {
expect(pkg.engines?.node).toBe(`>=${nvmrc}`);
});

it("makes every workflow resolve Node from the single .nvmrc pin", () => {
for (const { name, body } of workflows) {
expect(body, `${name} must read node-version-file`).toContain("node-version-file: .nvmrc");
expect(body, `${name} must not pin node-version separately`).not.toMatch(
/node-version:\s*\d/,
);
}
});
});
5 changes: 3 additions & 2 deletions tests/package/manifest.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ describe("package manifest", () => {
expect(pkg.files, `${excluded} must not be in files`).not.toContain(excluded);
}
for (const rel of pkg.files ?? []) {
if (rel === "shared/references") continue; // Generated only when skills share references.
expect(existsSync(join(repoRoot, rel)), `files entry missing: ${rel}`).toBe(true);
}
});
Expand All @@ -105,9 +106,9 @@ describe("package manifest", () => {
}
});

it("carries the metadata for the v0.2.0 GitHub release", () => {
it("carries the metadata for a versioned GitHub release", () => {
expect(pkg.name).toBe("@render/pi-render");
expect(pkg.version).toBe("0.2.0");
expect(pkg.version).toMatch(/^\d+\.\d+\.\d+$/);
expect(pkg.license).toBe("MIT");
expect(readFileSync(join(repoRoot, "LICENSE"), "utf8")).toContain("MIT License");
expect(pkg.description?.length ?? 0).toBeGreaterThan(20);
Expand Down
9 changes: 8 additions & 1 deletion tests/package/pack.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { execFileSync } from "node:child_process";
import { readdirSync, statSync } from "node:fs";
import { existsSync, readdirSync, statSync } from "node:fs";
import { join } from "node:path";
import { fileURLToPath } from "node:url";
import { beforeAll, describe, expect, it } from "vitest";
Expand Down Expand Up @@ -57,6 +57,13 @@ describe("npm pack tarball", () => {
expect(assets.length).toBeGreaterThan(0);
});

it("includes every generated shared reference", () => {
const shared = join(repoRoot, "shared/references");
if (existsSync(shared)) {
for (const name of readdirSync(shared)) expect(packed).toContain(`shared/references/${name}`);
}
});

it("records the vendored-skill provenance", () => {
expect(packed).toContain("skills/.sync-source");
});
Expand Down
4 changes: 2 additions & 2 deletions tests/package/skills.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ describe("vendored Render skills", () => {
for (const file of markdownFiles(root)) {
const text = readFileSync(file, "utf8");
const links = text.matchAll(
/(?:\]\(|`)(?:\.\/)?((?:references|assets)\/[A-Za-z0-9._\-/]+\.(?:md|ya?ml|json))/g,
/(?:\]\(|`)(?:\.\/)?((?:(?:\.\.\/)+shared\/references|references|assets)\/[A-Za-z0-9._\-/]+\.(?:md|ya?ml|json))/g,
);
for (const [, target] of links) {
checked++;
Expand Down Expand Up @@ -143,7 +143,7 @@ describe("vendored Render skills", () => {
const commit = record.match(/^commit: ([0-9a-f]{40})$/m)?.[1];

expect(source).toBe("https://github.com/render-oss/skills");
expect(ref).toMatch(/^(main|skills-v\d+\.\d+\.\d+)$/);
expect(ref).toMatch(/^([0-9a-f]{40}|main|skills-v\d+\.\d+\.\d+)$/);
expect(commit, "no 40-char commit recorded in .sync-source").toBeDefined();
expect(record).not.toMatch(/^synced:/m);
});
Expand Down
Loading