The Problem

AI skills (SKILL.md instruction files) are easy to write and dangerous to distribute. Without governance, orgs get skills with embedded credentials, stale versions, and no audit trail. Skill Foundry replaces ad-hoc distribution with a repeatable pipeline: an AI agent drives intake, packaging, and PR creation; one human approves the merge; CI enforces policy.

What This Does

Skill Foundry is a template repository that turns loose skill files into versioned, security-scanned Claude plugins. The pipeline lives in .github/scripts/ — a set of shell scripts that validate frontmatter, scan for secrets (via gitleaks), check PII against a configurable domain, verify action pinning, and enforce workflow permissions. All findings emit uniform JSONL; hard findings block the merge.

The orchestrator is .claude/skills/ship-plugin/SKILL.md, a playbook Claude Code executes: preflight audit, intake guards, README sync, semver bump, build via scripts/build-org-skills.sh, and a run report. The human's only decision point is the merge.

How It Is Wired

Execution starts in .github/scripts/run-checks.sh, the entry point for the policy gate. It calls lint_structure.sh, validate_frontmatter.sh, check_secrets.sh, check_pii.sh, check_action_pins.sh, and check_workflow_permissions.sh, all sourcing shared helpers from lib.sh. Results render through render_comment.sh into a PR comment.

The same gate runs in CI via .github/workflows/skill-policy.yml. A second workflow, check-dist.yml, verifies dist/ packages stay in sync with source. The lint-skills action in .github/actions/ wraps the gate for reuse. scripts/sync-from-template.sh propagates machinery updates to downstream repos without touching their skills or identity.

The measured import graph shows no internal modules or cycles — all 14 code files are shell, and the dependency chain is shallow. The widest blast radius is run-checks.sh: every gate routes through it, and a failure there blocks all merges.

How To Use It

Setup: Clone and host in your org: git clone https://github.com/moses-y/skill-foundry. No build step exists — the repo is shell scripts and YAML workflows.

Configuration: Edit .github/skill-policy.md for policy rules, and .gitleaks.toml for secret patterns. PII domain config lives in policy-config.sh.

Running it: Open the repo in Claude Code and say: "Package this skill file into this plugin and ship it: ~/Downloads/their-skill.skill. Name the plugin acme-general." The agent handles placement, README, version, build, gate, branch, and PR. For manual gating, run .github/scripts/run-checks.sh from the repo root.

Real-World Use

A department maintains a fleet of plugin repos. A non-engineer submits a skill file. Claude Code runs the ship-plugin playbook: validates frontmatter, builds the .skill package, runs the gate, and opens a PR. CI re-runs the gate. A maintainer reviews the JSONL output and merges. The plugin ships to every member on their next update.

Code Health & Issues

Static analysis (measured, not opinion) reports 6 findings: 0 high, 6 medium.

  • Med - Duplicated code blocks.github/scripts/check_action_pins.sh and check_workflow_permissions.sh share a 6-line block. Extract to lib.sh.
  • Med - High branching density (×5)lint_structure.sh, run-checks.sh, validate_frontmatter.sh have up to 18 branch points over 44 lines. Consider table-driven dispatch.

Beyond measured findings, from the file structure:

  • High - CI never runs the test suite — 34 test files exist in tests/, but no workflow invokes tests/run-tests.sh. A green check currently proves nothing.
  • Low - No job timeouts — 3 workflows lack timeout-minutes; a wedged job runs to the six-hour platform default.

The Bottom Line

Skill Foundry is a well-structured governance scaffold with a clear philosophy: automate everything except the merge. The shell-based gate is simple and auditable, and the test fixtures cover each check. The critical gap is CI not running those tests — fix that before trusting the pipeline. Best for orgs already using Claude Code and wanting controlled skill distribution.