feat(mentat): skill distribution to agent-specific paths#19
Closed
feat(mentat): skill distribution to agent-specific paths#19
Conversation
Add distributor package that copies generated SKILL.md content to the
directory layouts expected by pi/Miles, Claude Code, Codex, Cursor, and
a combined AGENTS.md at repo root.
Targets:
pi — .agents/skills/{domain}/SKILL.md (as-is)
claude — .claude/commands/{domain}.md (frontmatter stripped)
codex — .codex/skills/{domain}.md (frontmatter stripped)
cursor — .cursor/rules/{domain}.mdc (description-only frontmatter)
agents-md — AGENTS.md (all domains, ## sections, sorted)
Wire distributor.DistributeAll into syncCmd after generator.GenerateAll.
Add --no-distribute flag to skip distribution (useful for fast stale-only
regeneration runs).
Tests: 23 new cases covering all five targets, frontmatter handling,
dry-run, disabled targets, and deterministic alpha-sorted AGENTS.md output.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
After
mentat syncgenerates per-domain SKILL.md files, the new distributor package copies each skill to every agent toolchain's expected location in a single pass.What's added
mentat/internal/distributor/distributor.goFive distribution targets (all enabled by default via
DefaultConfig()):pi.agents/skills/{domain}/SKILL.mdclaude.claude/commands/{domain}.mdcodex.codex/skills/{domain}.mdcursor.cursor/rules/{domain}.mdc.mdcextensionagents-mdAGENTS.md(repo root)## {domain}sections, no frontmatterPublic API:
Distribute(repoPath, domain, content string, cfg Config, log *slog.Logger) error— single domain, all targets except agents-mdDistributeAll(repoPath string, skills []SkillContent, cfg Config, log *slog.Logger) error— full set, then regenerates AGENTS.mdclix.DryRun; logs intent without writingmentat/internal/distributor/distributor_test.go23 table-driven tests covering: all five target paths, frontmatter stripping/rewriting, Cursor description extraction, AGENTS.md ## sections + no-frontmatter + alpha sort, disabled targets, dry-run (no writes), and content with no frontmatter.
mentat/cmd/mentat/commands.godistributor.DistributeAllintosyncCmdaftergenerator.GenerateAllreturns[]distributor.SkillContentto the distributor--no-distributeflag to skip distribution (useful for quick stale-file reruns)docs/exec-plans/active/mentat-skill-distribution.mdExec plan per AGENTS.md convention (3+ files changed).
Verification