Skip to content

feat: slim generated SKILL.md to a group routing index#57

Merged
rodaddy merged 6 commits into
mainfrom
feat/slim-generated-skills
Jun 28, 2026
Merged

feat: slim generated SKILL.md to a group routing index#57
rodaddy merged 6 commits into
mainfrom
feat/slim-generated-skills

Conversation

@rodaddy

@rodaddy rodaddy commented Jun 28, 2026

Copy link
Copy Markdown
Owner

What

generate-skills was inlining a full per-tool | Tool | Description | table in the front SKILL.md, pushing large services well over the 300-token target — Open Brain came out at ~1100 tokens. The per-tool detail already lives in references/*.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

File Change
src/generation/templates.ts generateSkillMd emits a group index (Group / Tools / Reference rows linking to references/*.md) instead of the flat description table. Flat tool-name fallback when no groups.
src/generation/types.ts Added groups?: ToolGroup[] to SkillTemplateInput.
src/cli/commands/generate-skills.ts Passes already-computed groups into the template.
src/generation/diff.ts parseExistingTools reads names from the new group-index and flat-fallback formats; legacy quick-reference table still parsed for migration, so --diff/drift keep working.
tests Updated old-shape assertions; added group-index + flat-fallback coverage for template and parser.

schema_hash in 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 typecheck clean
  • bun test — 1038 pass / 0 fail
  • Integration test's existing tokenEstimate <= 300 assertion 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.md vs entity-ops.md plural-normalization bug in grouping.ts — separate fix.
  • 8-category trigger prose / whenToUse parity — follow-up if wanted.

🤖 Generated with Claude Code

rodaddy and others added 6 commits June 11, 2026 21:28
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>
@rodaddy rodaddy merged commit 3879204 into main Jun 28, 2026
4 checks passed
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.

1 participant