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
12 changes: 1 addition & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -181,17 +181,7 @@ You can also run:

## Maintainer workflow

Refresh bundled skills from `render-oss/skills`:

```bash
./scripts/sync-skills.sh
```

Use a different source repo or subdirectory:

```bash
./scripts/sync-skills.sh --repo https://github.com/render-oss/skills --subdir skills
```
This repository is published automatically. Don't edit it directly; bundled skills in `assets/opencode/skills/` match [render-oss/skills](https://github.com/render-oss/skills). Report problems as issues.

Verify the package before publishing:

Expand Down
6 changes: 3 additions & 3 deletions assets/setup.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { fileURLToPath } from "node:url"

const moduleDir = dirname(fileURLToPath(import.meta.url))
const MANIFEST_NAME = ".render-opencode-manifest.json"
const ASSET_DIRECTORIES = ["skills", "commands", "agents", "plugins"]
const ASSET_DIRECTORIES = ["skills", "commands", "agents", "plugins", "shared/references"]
const RENDER_MCP_CONFIG = {
type: "remote",
url: "https://mcp.render.com/mcp",
Expand All @@ -32,7 +32,7 @@ export async function installOpenCodeAssets(options = {}) {
const previous = await readManifest(manifestPath)
const legacy = await readManifest(join(moduleDir, "legacy-assets.json"))
const directories = ASSET_DIRECTORIES.filter((name) => name !== "plugins" || options.includePlugin)
const belongsToInstall = (path) => directories.includes(path.split("/")[0])
const belongsToInstall = (path) => directories.some((dir) => path.startsWith(dir + "/"))
const next = { ...previous.files }
const bundled = new Map()

Expand Down Expand Up @@ -128,7 +128,7 @@ async function readManifest(path) {
const value = JSON.parse(await readFile(path, "utf8"))
if (value?.version !== 1 || !isRecord(value.files)) throw new Error(`Invalid Render installation manifest: ${path}`)
for (const [file, hash] of Object.entries(value.files)) {
if (isAbsolute(file) || file.includes("\\") || file.split("/").some((part) => part === ".." || part === "" || part === ".") || !ASSET_DIRECTORIES.includes(file.split("/")[0]) || !/^[a-f0-9]{64}$/.test(hash)) {
if (isAbsolute(file) || file.includes("\\") || file.split("/").some((part) => part === ".." || part === "" || part === ".") || !ASSET_DIRECTORIES.some((dir) => file.startsWith(dir + "/")) || !/^[a-f0-9]{64}$/.test(hash)) {
throw new Error(`Invalid Render installation manifest entry: ${file}`)
}
}
Expand Down
13 changes: 13 additions & 0 deletions tests/setup.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,19 @@ describe("installOpenCodeAssets", () => {
expect(result.skipped.length).toBe(0)
})

it("installs shared references beside skills and removes obsolete managed copies", async () => {
const targetConfigDir = await tempDir()
const sourceAssetsDir = await tempDir()
const ref = "shared/references/deployments.md"
await mkdir(join(sourceAssetsDir, "shared/references"), { recursive: true })
await writeFile(join(sourceAssetsDir, ref), "Deployments")
await installOpenCodeAssets({ sourceAssetsDir, targetConfigDir })
expect(await readFile(join(targetConfigDir, ref), "utf8")).toBe("Deployments")
await rm(join(sourceAssetsDir, ref))
const result = await installOpenCodeAssets({ sourceAssetsDir, targetConfigDir })
expect(result.removed).toContain(join(targetConfigDir, ref))
})

it("does not overwrite existing files unless force is enabled", async () => {
const targetConfigDir = await tempDir()
const sourceAssetsDir = await tempDir()
Expand Down
Loading