Skip to content

feat: auto-generate Agent Skills from schema registry#44

Open
steve-calvert-glean wants to merge 2 commits intomainfrom
feat/generate-skills
Open

feat: auto-generate Agent Skills from schema registry#44
steve-calvert-glean wants to merge 2 commits intomainfrom
feat/generate-skills

Conversation

@steve-calvert-glean
Copy link
Collaborator

Summary

  • Adds glean generate-skills command that deterministically generates Agent Skills from the CLI's schema registry
  • Replaces 5 hand-written flat skill files with 18 structured, folder-based skills covering all namespace commands
  • Adds CI workflow (.github/workflows/generate-skills.yml) that auto-regenerates skills on push to main when command or schema code changes
  • Updates README with npx skills add installation instructions

How it works

The generator reads from the same schema registry that powers glean schema, ensuring skills are always in sync with the CLI's actual flags, subcommands, and examples. When someone adds a new command or changes a flag, re-running glean generate-skills updates the corresponding SKILL.md.

Inspired by Google Workspace CLI's approach.

Install skills

# All skills
npx skills add https://github.com/gleanwork/glean-cli

# Individual skill
npx skills add https://github.com/gleanwork/glean-cli/tree/main/skills/glean-search

Test plan

  • go test ./... passes
  • golangci-lint run clean
  • glean generate-skills produces idempotent output
  • Generated skills match the Agent Skills spec (name, description frontmatter)
  • Binary builds and runs

🤖 Generated with Claude Code

Add `glean generate-skills` command that deterministically generates
SKILL.md files (following the agentskills.io spec) from the CLI's own
schema registry. This ensures skills stay in sync with commands — when
a flag or subcommand changes, re-running the generator updates the
corresponding skill.

What's included:
- `internal/skills/generator.go` — template-based renderer that reads
  from the schema registry and produces per-command SKILL.md files
- `cmd/generate_skills.go` — hidden `generate-skills` command
- 17 generated skills + 1 shared skill covering all namespace commands
- `.github/workflows/generate-skills.yml` — CI workflow that regenerates
  skills on push to main when cmd/ or schema code changes
- Updated README with `npx skills add` installation instructions

Replaces the previous hand-written flat skill files with structured,
folder-based skills installable via:
  npx skills add https://github.com/gleanwork/glean-cli

Inspired by Google Workspace CLI's generate-skills approach.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
git diff --quiet only sees modifications to tracked files. New skills
(from new commands) would be untracked and silently ignored. Add
git status --porcelain check to catch both cases.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@steve-calvert-glean steve-calvert-glean added the enhancement New feature or request label Mar 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants