Skip to content

feat: tag-based skill composition#12

Merged
aniongithub merged 3 commits into
mainfrom
skill-composition
May 9, 2026
Merged

feat: tag-based skill composition#12
aniongithub merged 3 commits into
mainfrom
skill-composition

Conversation

@aniongithub
Copy link
Copy Markdown
Owner

Summary

Replace the hardcoded fragment list and WSL special-casing in build.rs with a generic tag-based composition system.

How it works

Each skill fragment and tool list now has YAML frontmatter:

---
tags: [core]      # required tags (AND logic)
order: 50         # sort order in assembled output
---

build.rs resolves active tags from CARGO_CFG_TARGET_OS:

Platform Active tags
Linux core, linux
macOS core, macos, docker-desktop
Windows core, windows, docker-desktop, wsl

Inclusion rule: fragment tags ⊆ active tags (AND — all required tags must be active)

What this enables

  • Platform-specific skill variations — e.g. a tags: [docker-desktop] fragment with Docker Desktop caveats appears on both macOS and Windows but not Linux
  • Intersectionstags: [docker-desktop, macos] for macOS-specific Docker Desktop tips
  • Zero-touch additions — drop a new .md file in skills/ with frontmatter, no build.rs changes needed
  • Future feature-gated backends — add Cargo feature tags to active_tags()

Verification

  • cargo check / cargo test / cargo clippy / cargo fmt
  • ✅ WSL correctly excluded on Linux build
  • ✅ Fragment ordering preserved via order field

Replace hardcoded fragment list and WSL special-casing in build.rs with
a generic tag-based composition system.

Each skill fragment and tool list now has YAML frontmatter:
  ---
  tags: [core]      # required tags (AND logic)
  order: 50         # sort order in assembled output
  ---

Build.rs resolves active tags from CARGO_CFG_TARGET_OS:
  linux   → {core, linux}
  macos   → {core, macos, docker-desktop}
  windows → {core, windows, docker-desktop, wsl}

A fragment is included when all its required tags are present in the
active set (subset check). Fragments are auto-discovered from skills/
directory — no code changes needed to add new fragments.

This enables platform-specific skill variations (e.g. Docker Desktop
caveats on macOS/Windows) and future feature-gated backends, all
without touching build.rs.
The minimal single-quote escaper only handled single quotes. The
shell-escape crate properly handles spaces, dollar signs, backticks,
backslashes, and all other shell metacharacters.
Add explicit 'use only MCP tools' constraint to core rules (early in
prompt) and per-workflow reminders before each example section. Agents
were bypassing MCP tools and invoking docker/devcontainer/gh CLIs
directly.

Constraints now appear at three reinforcement points:
- Core rules (order 20) — primary constraint, seen first
- Each workflow section — reminder before examples
- Footer checklist — summary reinforcement at end
@aniongithub aniongithub merged commit a0a3c45 into main May 9, 2026
1 check passed
@aniongithub aniongithub deleted the skill-composition branch May 9, 2026 17:03
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