feat: slim generated SKILL.md to a group routing index#57
Merged
Conversation
Add authenticated remote service discovery and remote-only CLI routing for hub-hosted services. Add sanitized private registry import/export, Vaultwarden secret refs, safe config/token watch reloads, caller-aware metrics/audit logging, token refresh/rotation, and macOS upgrade docs. Validation: bun run typecheck; bun test; git diff --check; ggshield secret scan repo .
generate-skills inlined a full per-tool description table in the front SKILL.md, pushing large services well over the 300-token target (Open Brain was ~1100 tokens). The per-tool detail already lived in references/*.md, so the front skill was duplicating a flat index. generateSkillMd now emits a progressive-disclosure front skill: a routing index of tool groups, each linking to its reference file, with a flat tool-name fallback when no grouping is available. parseExistingTools reads names from both new formats (legacy quick-reference table still parsed for migration) so --diff and drift detection keep working. schema_hash in frontmatter remains the drift signal. Bump 0.3.3 -> 0.3.4. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…kills # Conflicts: # VERSION # agents.md # package.json # src/config/loader.ts # src/config/schema.ts # src/process/client.ts # tests/config/loader.test.ts # tests/config/schema.test.ts # tests/daemon/pool.test.ts # tests/process/client-remote.test.ts
…ps on auto-regen Review-swarm findings on #57 (both reviewers converged on the diff bug): - parseExistingTools scanned the WHOLE SKILL.md, so YAML frontmatter `triggers:` bullets (and single-word Notes bullets) parsed as phantom tools. Round-tripping a generated grouped skill back through the diff reported the trigger keywords as "removed" and -- because the slim group index carries no per-tool descriptions -- flagged every real tool as "modified". `--diff` was useless for the exact format this PR introduces. Fix: scope the parse to the AUTO-GENERATED block (markers now exported from templates.ts), with a whole-file fallback when markers are absent; and skip the description comparison when the existing description is empty (empty == "unknown", not "changed to empty"). - Added a generate -> parse -> diff round-trip regression test (grouped and flat fallback). The existing diff tests used hand-crafted snippets without frontmatter, so the bug shipped green; the round-trip test would have caught it. - auto-regen.ts (drift-hook regeneration) computed `groups` but called generateSkillMd before that, without passing them, so the drift hook emitted the flat fallback while a manual generate-skills emitted the grouped index. Moved grouping ahead of input construction and pass `groups` so both paths produce the same slim routing index. Verified: bun run typecheck clean; full suite 1055 pass / 0 fail (deterministic across repeat runs). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.
What
generate-skillswas inlining a full per-tool| Tool | Description |table in the frontSKILL.md, pushing large services well over the 300-token target — Open Brain came out at ~1100 tokens. The per-tool detail already lives inreferences/*.md, so the front skill was duplicating a flat index.This reworks the generator to emit the progressive-disclosure shape the PAI skill-creator standard mandates: slim front skill, color in the files behind it.
Changes
src/generation/templates.tsgenerateSkillMdemits a group index (Group / Tools / Referencerows linking toreferences/*.md) instead of the flat description table. Flat tool-name fallback when no groups.src/generation/types.tsgroups?: ToolGroup[]toSkillTemplateInput.src/cli/commands/generate-skills.tsgroupsinto the template.src/generation/diff.tsparseExistingToolsreads names from the new group-index and flat-fallback formats; legacy quick-reference table still parsed for migration, so--diff/drift keep working.schema_hashin frontmatter remains the drift signal. Token budget enforcement stays warn-only (no change to behavior, no risk to the existing service rollout).Verification
bun run typecheckcleanbun test— 1038 pass / 0 failtokenEstimate <= 300assertion now passes with the new shape (direct proof the front skill is back under budget)Bump 0.3.3 → 0.3.4 (patch).
Not included (separate boundaries)
entitie-ops.mdvsentity-ops.mdplural-normalization bug ingrouping.ts— separate fix.whenToUseparity — follow-up if wanted.🤖 Generated with Claude Code