Skill porting

From lza6/Armor-piercing-system-prompts · View interactive version

Skill porting is an AI agent skill from the GitHub repository lza6/Armor-piercing-system-prompts. Install skills from external ecosystems into this agent's agent_state/skills/ — resolve Claude Code plugin marketplaces, the Codex plugin repo, skills.sh registry names, GitHub repos, or local folders to their skill directories, review every file, and normalize SKILL.md frontmatter to the Penguin fo

How to use this skill

Skill file

Skill Porting

Penguin has no plugin mechanism and needs none: the wider ecosystem's plugins are wrappers around plain skill directories — a SKILL.md plus support files — which is exactly the shape Penguin installs. This skill turns any common external source into installed skills: locate the source, fetch it at a pinned revision, review everything, normalize the frontmatter, copy into agent_state/skills/<name>/, verify.

Before you start

If the user's message only invokes this skill (e.g. "use skill-porting skill") without naming a skill or a source, ask what skill they want and where it comes from (a marketplace plugin name, a repo URL, a skills add spec, or a local path).

Safety is non-negotiable — an installed skill becomes durable instructions this agent follows in every future session:

Target layout: what Penguin expects

Installed skills live in the current agent's state (paths from your Environment section):

<app_data_dir>/agents/<agent_id>/agent_state/skills/<skill_name>/
├── SKILL.md      # frontmatter + instructions (required)
├── icon.svg      # optional line icon; the UI falls back to a book icon
└── ...           # optional support files (scripts, references, templates)

Penguin frontmatter:

---
name: <skill_name>                        # must equal the directory name
description: <one line, English>          # injected into the prompt; keep it specific
short_description: <shorter than description>  # optional UI blurb
short_description_zh: <its Chinese variant>    # optional
version: 1                                # natural number; bump on every content change
updated: 2026-08-04T11:40:00Z             # ISO 8601 UTC; move it together with version
---

The SKILL.md convention in the wild

Every source below follows the Agent Skills convention (agentskills.io): a skill is a directory whose SKILL.md opens with YAML frontmatter. The portable core is two fields:

| Field | Spec constraint (agentskills.io) |

| -------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------- |

| name | required; 1–64 chars; lowercase a-z0-9 and -; no leading/trailing/double hyphen; must match the directory name |

| description | required; 1–1024 chars; what the skill does and when to use it |

| license / compatibility / metadata / allowed-tools | optional; metadata is a string map, allowed-tools a space-separated string (experimental) |

Claude Code layers more optional fields on top (when_to_use, argument-hint, arguments, allowed-tools, disallowed-tools, disable-model-invocation, user-invocable, model, effort, context: fork, agent, hooks, paths, shell). None of these have a Penguin runtime — see Normalize below. Conventional support directories are scripts/, references/, assets/.

Schemas evolve. The tables in this skill were verified against files fetched on 2026-08-04; always trust the JSON you actually fetched over this snapshot.

Fetch toolbox (GitHub, used by every flow below)

Work in a scratch directory, never directly in agent_state/skills/. Prefer a pinned <ref> (sha or tag) over a branch name.

WORK="$(mktemp -d)"

# 1) Tarball — grabs a repo (or subdirectory) without git history
curl -sL "https://codeload.github.com/<owner>/<repo>/tar.gz/<ref>" -o "$WORK/src.tgz"
tar -tzf "$WORK/src.tgz" | head -50           # inspect the tree first
tar -xzf "$WORK/src.tgz" -C "$WORK" --strip-components=1   # top dir is <repo>-<ref>/

# 2) Sparse checkout — when you know the subdirectory path
git clone --depth 1 --filter=blob:none --sparse "https://github.com/<owner>/<repo>.git" "$WORK/repo"
git -C "$WORK/repo" sparse-checkout set <subdir>
# pinning a sha instead of a branch: clone without --depth, then `git checkout <sha>`

# 3) Directory listing without cloning
curl -sL "https://api.github.com/repos/<owner>/<repo>/contents/<path>?ref=<ref>"

# 4) Single raw file
curl -sL "https://raw.githubusercontent.com/<owner>/<repo>/<ref>/<path>/SKILL.md"

gh repo clone <owner>/<repo> and gh api ... are equivalents when gh is available and authenticated.

Source: Claude Code plugin marketplaces

A marketplace is any repo carrying .claude-plugin/marketplace.json. The official one:

curl -sL "https://raw.githubusercontent.com/anthropics/claude-plugins-official/main/.claude-plugin/marketplace.json" -o "$WORK/marketplace.json"

Top level: $schema, name, description, owner {name, email}, renames (old plugin name → new name map — check it when a requested name is missing), plugins[]. Entry fields, from the 2026-08 snapshot (278 plugins; count = entries carrying the field): name, description, source (all 278); category (264); homepage (262); author {name, email?} (193); strict (15); version (14); lspServers (12); skills (4, an array of ./<dir> paths relative to the plugin root); displayName, tags, keywords (few).

Look up the plugin, then resolve its source — four verified forms:

NAME="$(jq -r '.renames["<requested>"] // "<requested>"' "$WORK/marketplace.json")"
jq --arg n "$NAME" '.plugins[] | select(.name == $n)' "$WORK/marketplace.json"

| source form | Example | Fetch |

| -------------------------------------------- | ------------------------------------------------------------------------------------------------ | ---------------------------------------------------------------- |

| relative path string | "./plugins/agent-sdk-dev" | that path inside the marketplace repo itself |

| {source: "url", url, sha} | {"source":"url","url":"https://github.com/org/repo.git","sha":"…"} | clone url at sha; the whole repo is the plugin |

| {source: "git-subdir", url, path, ref, sha} | {"source":"git-subdir","url":"…/claude-plugins.git","path":"plugins/api-security-testing","ref":"v1.5.5","sha":"…"} | clone url at sha; the plugin is path inside |

| {source: "github", repo, commit, sha} | {"source":"github","repo":"fullstorydev/fullstory-skills","commit":"…","sha":"…"} | https://github.com/<repo> at the pinned commit |

Inside the plugin directory, locate the actual skills — check all of these:

  1. skills/<skill>/SKILL.md — the default location.
  2. Custom paths in .claude-plugin/plugin.json under skills (string or array; adds to the default scan). The manifest is optional and its only required field is name; other fields are npm-style metadata plus component paths (commands, agents, hooks, mcpServers, lspServers, …).
  3. The marketplace entry's own skills array (paths relative to the plugin root).
  4. A single SKILL.md at the plugin root.
  5. commands/*.md — flat one-file skills (older convention): each file is frontmatter + body without a directory.

agents/, hooks/, scripts/, .mcp.json and ${CLAUDE_PLUGIN_ROOT} references are plugin machinery, not skills — see Normalize.

Source: Codex (OpenAI) plugin marketplace

Same idea, different paths. The curated file:

curl -sL "https://raw.githubusercontent.com/openai/plugins/main/.agents/plugins/marketplace.json" -o "$WORK/codex-marketplace.json"

Top level: name ("openai-curated"), interface {displayName}, plugins[] (180 in the 2026-08 snapshot). Every entry has exactly four fields:

| Field | Notes |

| ---------- | ------------------------------------------------------------------------------------------------------ |

| name | plugin id |

| source | always {"source": "local", "path": "./plugins/<name>"} — a path inside the same repo |

| policy | {installation, authentication: "ON_INSTALL" or "ON_USE", products?: ["CODEX"]} — irrelevant for porting |

| category | display category |

Because every source is local, one tarball of openai/plugins covers everything:

curl -sL "https://codeload.github.com/openai/plugins/tar.gz/refs/heads/main" -o "$WORK/codex.tgz"
tar -xzf "$WORK/codex.tgz" -C "$WORK" "plugins-main/plugins/<name>"
ls "$WORK/plugins-main/plugins/<name>/skills/"

Plugin layout at plugins/<name>/: .codex-plugin/plugin.json (npm-style manifest — name, version, description, author, license, keywords, pointers skills: "./skills/", apps: "./.app.json", mcpServers: "./.mcp.json", and a rich interface display block), skills/<skill>/SKILL.md (frontmatter is plain name + description), .app.json (hosted connector ids), .mcp.json, assets/. Differences from the Claude layout: manifest dir .codex-plugin/ vs .claude-plugin/, marketplace at .agents/plugins/marketplace.json vs .claude-plugin/marketplace.json.

Watch for skill bodies that say "use the X app from this plugin": those depend on .app.json hosted connectors with no Penguin equivalent. Port such a skill only if its body still stands on generic tools (shell, curl, official CLIs) after you rewrite or strip the connector references.

Source: skills.sh registries (`npx skills add`)

npx skills add <spec> is the skills npm package (repo vercel-labs/skills; directory site https://skills.sh). Do not run the installer to port: it targets other tools' config dirs (project .claude/skills/ or .agents/skills/, global ~/.claude/skills/ etc.) and defaults to symlinks. GitHub is its registry — resolve the spec yourself:

| Spec the user gives | Resolves to |

| ------------------------------------------------------ | ------------------------------------------- |

| owner/repo | https://github.com/owner/repo |

| https://github.com/o/r/tree/<ref>/<subpath> | that subdirectory at <ref> |

| GitLab / git@… URL | that repo |

| archive URL (.zip, .tar.gz, .tgz) or a SKILL.md URL | direct download |

| local path | that folder |

The CLI selects skills with --skill <name> (--skill '*' for all); a skills.sh page shows the same spec it would install. After fetching, scan the tree in the CLI's discovery order: root SKILL.md; skills/*/SKILL.md (plus skills/.curated/, skills/.experimental/, skills/.system/); agent dirs .claude/skills/, .agents/skills/; catalog repos may nest one extra level.

find "$WORK" -name SKILL.md -maxdepth 5 | sort
awk '/^---$/{n++} n<2' "<dir>/SKILL.md"    # print just the frontmatter of a hit

Source: plain GitHub repo, subdirectory, or local folder

Normalize to the Penguin format

Shape each skill in $WORK, then copy the finished directory into agent_state/skills/:

  1. Directory name: keep the upstream name when it already matches [A-Za-z0-9_-]+ (lowercase-hyphen preferred); otherwise rename and note it. One directory per skill — a plugin with several skills becomes several installs (or one merged skill if the user prefers).
  2. Keep name (set it to the directory name) and description (flatten to one line; keep or make it English).
  3. Add short_description and short_description_zh (write them yourself, each shorter than the description), version: 1 (bump on every later edit), and updated: from date -u +%Y-%m-%dT%H:%M:%SZ.
  4. Drop foreign frontmatter fields (allowed-tools, disable-model-invocation, context, model, hooks, license, metadata, when_to_use, …). Penguin ignores unknown single-line keys, but multi-line values corrupt the parse — flattening is mandatory, dropping keeps files honest. When a dropped field carries real information — required tools, trigger phrases — move it into the body text (when_to_use usually merges into description).
  5. Components with no Penguin runtime:
  1. Support files (scripts/, references/, assets/): copy alongside SKILL.md so relative paths keep working; scripts get the strictest review.
  2. icon.svg is optional: draw a simple 24×24 line icon (viewBox="0 0 24 24", stroke="currentColor", fill="none", no scripts or event handlers) or omit it for the default book icon.

Install:

SKILLS_DIR="<app_data_dir>/agents/<agent_id>/agent_state/skills"
cp -r "$WORK/<skill_name>" "$SKILLS_DIR/"

Verify and report

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.