Instructions and files
Ship always-on instructions and companion files alongside generated artifacts.
On this page
A plugin can include global instructions plus arbitrary files. Instructions become native context files (CLAUDE.md, AGENTS.md, GEMINI.md) and installs merge them as id-keyed blocks; files are copied verbatim into build trees.
plugin.ts
import { definePlugin, defineSkill, readDir, readTextFrom } from "@jalco/ap-sdk";
const read = readTextFrom(import.meta.url);
export default definePlugin({
id: "repo-playbook",
description: "Repository-specific playbook.",
instructions: read("./AGENTS.md"),
skills: [
defineSkill({
name: "release-check",
description: "Use before preparing a release.",
instructions: read("./skills/release/SKILL.md"),
resources: [{ path: "checklist.md", content: read("./skills/release/checklist.md") }],
}),
],
files: readDir("./hooks", import.meta.url, "hooks"),
});Fields and helpers
instructionsis always-on guidance. Install uses an id-keyed markdown block so re-installs update the SDK-managed section without clobbering foreign text.filescontainsPluginFileentries emitted into every build tree;executablepreserves script bits.SkillResourcefiles live inside a skill directory.PluginFilefiles live at the plugin root for scripts, templates, and shared assets.readText,readTextFrom, andreadDirkeep content on disk and avoid giant inline strings.- Plugin-root variables such as
${CLAUDE_PLUGIN_ROOT}/hooks/notify.shlet native configs reference emitted companion files.
Next: skills, porting, and the support matrix.
On this page