Skip to content

feat(skill): add a kit skill command to install the kit agent skill#1252

Open
youdie006 wants to merge 1 commit into
kitops-ml:mainfrom
youdie006:feat/kit-skill-command
Open

feat(skill): add a kit skill command to install the kit agent skill#1252
youdie006 wants to merge 1 commit into
kitops-ml:mainfrom
youdie006:feat/kit-skill-command

Conversation

@youdie006

Copy link
Copy Markdown

Description

Coding agents (Claude Code, Codex, Cursor, ...) learn kit only from flag-oriented --help, which says nothing about workflows. This adds a kit skill command that installs an embedded SKILL.md — covering Kitfile authoring and the pack/tag/login/push/pull/unpack workflow, plus common errors — into the agent skills directories.

  • New pkg/cmd/skill command, registered in cmd/root.go alongside the other subcommands.
  • The SKILL.md is go:embed'd so it always matches the installed kit version and works air-gapped, exactly as the issue asks.
  • It reuses the existing --as-skill installer (libskill.InstallSkill) and agent-directory resolution, so it lands in .claude/skills, the shared .agents/skills, etc., with the same --agents / -d / -o / -i flags as kit unpack --as-skill. No agent-dir logic is duplicated.
  • Every section of the embedded SKILL.md is grounded in the real command implementations and Kitfile validation rules (no invented flags/behavior).
  • docs/src/docs/cli/cli-reference.md regenerated via the repo's own docs/src/docs/cli/generate.sh.

Scoped to the core command per the small-PR principle. The issue's secondary ask — publishing the skill as a ModelKit — is left to a follow-up.

Tests (pkg/cmd/skill/cmd_test.go): installs the embedded skill to .claude/skills/kitops/SKILL.md; multi-agent install; unknown-agent error; a frontmatter drift guard. go build ./..., go vet, go test, and gofmt all pass; also smoke-tested with the built binary (writes the skill, overwrite / ignore-existing guards work, --help renders).

Design note: I named the skill/dir kitops; if you'd prefer something more action-oriented (e.g. using-kit) it's a one-line change to the skillName const + the frontmatter name (a test guards they stay equal).

Linked issues

Refs #1249

AI-Assisted Code

  • This PR contains AI-generated code that I have reviewed and tested
  • I take full responsibility for all code in this PR, regardless of how it was created

Coding agents learn kit only from flag-oriented --help. Add a kit skill
command that installs an embedded SKILL.md - covering Kitfile authoring
and the pack/tag/login/push/pull/unpack workflow - into the agent skills
directories, reusing the existing --as-skill installer so it lands in
.claude/skills, the shared .agents/skills, etc. The SKILL.md is go:embed'd
so it always matches the installed kit version and works air-gapped.

Scopes to the command only; publishing the skill as a ModelKit is left to
a follow-up.

Refs kitops-ml#1249.

Signed-off-by: youdie006 <youdie006@users.noreply.github.com>
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, add credits to your account and enable them for code reviews in your settings.

@amisevsk amisevsk left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nicely done @youdie006, thank you!

I have one note on the cli-reference.md file, but apart from that it looks good to me. I'd like @gorkem's review on the SKILL.md, though I have no concerns personally and think it's a solid starting point.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A bit of a strange feature in this repository: this CLI reference doc is served at https://kitops.org/docs/cli/cli-reference/ based on the repository HEAD (i.e. not the last release). As a result, merging this update to the cli-reference.md file will update the public docs immediately, even though the skill command is not yet released.

Please revert this change in the PR; instead, this file will be automatically updated on the next Kit release through CI actions.

Comment thread pkg/cmd/skill/SKILL.md

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@gorkem I'd like your opinion on this SKILL.md for KitOps -- you're better at writing these than I am.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants