Project instructions for Claude Code when working inside this repo.
Note: per the Claude Code plugin docs, this root
CLAUDE.mdis NOT loaded as plugin context when theappos-devplugin is installed — it exists for contributors editing THIS repo. Knowledge meant for plugin consumers belongs in the skills/agents/commands underplugins/appos-dev/.
A Claude Code plugin that gives Claude Code the skills, commands, and agents needed to create, build, test, and deploy AppOS workspace manager plugins. Canonical references: the developer docs at https://docs.appos.space (always reachable) and the flagship plugin https://github.com/appos/appos-plugin-ytdlp (public as of AppOS launch) — the plugin that exercises every supported SDK feature.
This plugin is versioned at 3.x (current: see .claude-plugin/marketplace.json, the repo's ONLY manifest — both metadata.version and plugins[0].version), deliberately aligned with the @appos.space SDK major it teaches. That alignment is versioning convenience, NOT a minHostVersion — the host version stays 1.0.0 (see Conventions). The v2.x line was the SDK+WebView rewrite; the legacy ViewDescriptor-only model is still supported but is no longer the primary pattern.
appos-dev-plugin/
├── .claude-plugin/
│ └── marketplace.json # Marketplace catalog (the ONLY manifest — no plugin.json exists) — points at ./plugins/appos-dev
├── plugins/
│ └── appos-dev/ # The actual Claude Code plugin
│ ├── commands/
│ │ ├── new-plugin.md # /appos-dev:new-plugin
│ │ ├── build.md # /appos-dev:build
│ │ ├── deploy.md # /appos-dev:deploy
│ │ └── validate.md # /appos-dev:validate
│ ├── agents/
│ │ ├── plugin-architect.md # Designs plugin architecture from requirements
│ │ ├── viewdescriptor-builder.md # Builds ViewDescriptor UI trees
│ │ └── webview-panel-builder.md # Builds WebView panels end-to-end
│ ├── skills/
│ │ ├── appos-plugin-dev/
│ │ │ ├── SKILL.md # Main SDK+WebView skill
│ │ │ └── reference/ # API reference, patterns, plugin-api/ d.ts mirror (generated)
│ │ ├── viewdescriptor-authoring/
│ │ │ └── SKILL.md # ViewDescriptor authoring skill
│ │ └── webview-panels/
│ │ └── SKILL.md # Focused WebView authoring skill
│ └── compiled/ # GENERATED context artifacts for the AppOS host — do not hand-edit
├── scripts/ # verify-knowledge.mjs + check-sdk-freshness.sh + check-compiled-freshness.sh (CI gates)
├── package.json # exact-pinned toolchain for the gates (npm ci)
├── package-lock.json
├── README.md
└── LICENSE
plugins/appos-dev/skills/appos-plugin-dev/reference/plugin-api/is a byte-verbatim mirror of the published@appos.space/plugin-typestarball'sdist/*.d.ts, regenerated withscripts/check-sdk-freshness.sh --updateand verified against the npm registry on CI. Never edit by hand.plugins/appos-dev/compiled/is generated by the AppOS-Desktop repo'sscripts/compile-factory-context.sh, which concatenates this repo's skill sources into the context artifacts the host bundles for its in-app AI features. Regenerate via that script (it writes both the Desktop-side copy and this repo's copy); the artifacts are validated by freshness manifests, not byverify-knowledge.mjs.
Before editing anything, be aware of these external sources of truth:
- Developer docs: https://docs.appos.space — the canonical AppOS plugin developer documentation.
- Flagship reference plugin: https://github.com/appos/appos-plugin-ytdlp — all patterns in the skills match this plugin's implementation. When in doubt, read its source files, in this order: (1) a local clone if one exists (preferred); (2) the GitHub repo — public as of AppOS launch; fetch raw files from
https://raw.githubusercontent.com/appos/appos-plugin-ytdlp/main/<path>; (3) https://docs.appos.space — always reachable; its getting-started/first-plugin pages carry the same canonical patterns. - SDK source: https://github.com/appos/plugin-sdk (
packages/plugin-types) — the current declaration-only TypeScript types, also published on npm as@appos.space/plugin-types. Use for reference when validating API shapes in skills or commands. - Host version: read
/Applications/AppOS.app/Contents/Info.plist→CFBundleShortVersionString(currently1.0.0). The host version is whatplugin.jsonminHostVersionis compared against, NOT the SDK package version.
- Plugin IDs: use
space.appos.*for flagship plugins (the ones shipped with AppOS),com.community.*for community plugins, other reverse-domain for private/personal plugins. - minHostVersion: always default to
"1.0.0". The single biggest cause of "plugin installed but not appearing in Settings" is conflating the SDK version (3.0.x— or the older2.4.x) with the host version (1.0.x). Theappos-plugin-devskill has a "minHostVersion landmine" section; keep it prominent. - tsconfig: always include
verbatimModuleSyntax: true. Without it, TypeScript emits broken runtime imports from the declaration-only@appos.space/plugin-typespackage. - Entry point: always
globalThis.activate = activate+globalThis.deactivate = deactivate, never ESMexport. ESM exports disappear inside the IIFE closure and the host can't find them. - Parameter naming: always
ctx, neverpluginContext. Matchesappos-plugin-ytdlpand every reference plugin. - rsync deploy: always use
--delete-excludedand a comprehensive exclude list. Without--delete-excluded, files added to the exclude list after a previous deploy linger on the destination forever.
- Read the corresponding code in
appos-plugin-ytdlpfirst — that's the ground truth (local clone preferred; see Key references for the fallback order). - If the SDK surface changed, check https://github.com/appos/plugin-sdk (
packages/plugin-types) — or the published@appos.space/plugin-typesnpm package — for the current type definitions. - Keep examples copyable — prefer full working snippets over fragments.
- When documenting a gotcha, include a
**Why**:line with the root cause so future-you can judge edge cases. - Run the CI gates before committing:
npm cionce, thennpm run check— the same sequence CI runs:scripts/check-sdk-freshness.sh(mirror byte-equality),node scripts/verify-knowledge.mjs(type-checks everytsfence against the pinned SDK, plus a stale-identifier denylist and count-string consistency; opt-out convention documented in the script header), andscripts/check-compiled-freshness.sh(compiled/ artifacts match their manifest, both directions).
Follow Claude Code plugin conventions:
- Commands go in
plugins/appos-dev/commands/*.mdwith frontmatter declaringallowed-toolsandargument-hint - Agents go in
plugins/appos-dev/agents/*.mdwith frontmatter declaringname,description,whenToUse,tools - Skills go in
plugins/appos-dev/skills/{name}/SKILL.mdwith frontmatter declaringdescription(include the trigger phrases that should activate it)
From the repo root (the plugin lives at plugins/appos-dev, not the repo root):
claude --plugin-dir ./plugins/appos-devThen verify:
/appos-dev:new-pluginscaffolds a plugin using the SDK pattern- The main skill triggers when asked something like "create an AppOS plugin that downloads with yt-dlp"
- The
webview-panelsskill triggers when asked aboutregisterWebPanelorpipeShellToWebPanel - The
plugin-architectagent triggers when asked to design a new plugin - The
webview-panel-builderagent triggers when asked to build a WebView panel
- Do NOT copy from the legacy community-plugin template — it's the ViewDescriptor-only model and should not be used for new plugins
- Do NOT recommend ESM
exportfor activate/deactivate - Do NOT set
minHostVersionto anything other than"1.0.0"without a documented reason - Do NOT add inline
<script>/<style>/on*=to WebView HTML examples (CSP blocks them) - Do NOT recommend
ctx.shell.pipeShellToWebPanel— that's stale documentation; the correct path isctx.ui.pipeShellToWebPanel