Skip to content

feat(install): native skill pointers for the Kiro harnesses - #113

Closed
knihit wants to merge 4 commits into
mainfrom
feat/native-skill-pointers
Closed

knihit wants to merge 4 commits into
mainfrom
feat/native-skill-pointers

Conversation

@knihit

@knihit knihit commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

Description

CLI:

  • Added install/kiro_cli/skill_pointers.rs: writes a ks-<name>/SKILL.md pointer per skill into .kiro/skills/, built from the staged skill's frontmatter, so Kiro lists every skill by name and description
  • Pointer text: call get_skill on the konductor-skills server first (load the tool if it is not loaded yet); read <target>/.konductor/skills/<name>/SKILL.md only if that server is not connected; if get_skill says the skill is not found, stop and do not read the file. The fallback path is absolute because ~ expansion by fs_read was not confirmed
  • Every Kiro agent also gets a skill://.kiro/skills/ks-*/SKILL.md resource, added by a new resource-rewrite pass for kiro-cli-v2 and kiro-v3
  • install --no-skill-pointers skips the pointers and the resource, removes ones an earlier install wrote, and is recorded in .konductor/no-skill-pointers, so update keeps it. A later install without the flag turns pointers back on. Claude installs ignore the flag
  • Descriptions are flattened, stripped of control characters, and cut to 200 characters (POINTER_DESCRIPTION_MAX_CHARS). An unreadable SKILL.md fails the install; a missing or non-string description warns and skips that pointer
  • update removes the pointer of a skill the source dropped (manifest-tracked paths only); uninstall removes them all, and the opt-out marker on a full uninstall
  • Pointers have their own install phase (skill-pointers) and no longer count as skills in the install summary (a kiro-v3 install of this repo reported 183 skills before, now 101: 82 skills + 19 sop-*)
  • Claude harness behaviour and the MCP server are untouched

Tests:

  • tests/kiro_skill_pointers_e2e.rs (real binary, scratch HOME): pointers, tracked in the manifest, restored by update, removed by uninstall; every Kiro agent lists the glob; the summary count excludes pointers; --no-skill-pointers survives update, is undone by a plain install, and is cleared by uninstall; update prunes a dropped skill's pointer; no pointers and no marker on a Claude install
  • Unit tests for the pointer wording (order, stop on not-found, no ~), truncation, control characters, list-valued description, unreadable SKILL.md, pruning, and the new rewrite pass
  • The guard that fails if the real ~/.konductor/installs changes is kept. It watches only that index, so it is a tripwire
  • Existing assertions on an agent's resources now expect the added glob

Docs: README.md, cli/README.md (new "Skill pointers" section), docs/user-guide/{reference,agents,appendix/contributing}.md, CHANGELOG.md

Type of Change

  • CLI (cli/) change — Rust or Python
  • Documentation

Testing

  • npm test passes: not run green; two suites fail on main too because scripts/brand-config/lib/constants.js is not tracked
  • If cli/ changed: make test from the repo root passes with TMPDIR=/tmp: cli 1810 (1759 unit + 51 integration), mcp 318, shared 76; includes the __dump_schema smoke check
  • Live probe, kiro-cli 2.35.0, scratch HOME, install --harness kiro-v3, kiro-cli chat --v3 --agent k-developer --no-interactive: the agent listed 82 ks-* skills, also from an unrelated working directory. Loading ks-backend-review ran disclose_context (the pointer), then tool_load, then get_skill backend-review, and returned # Backend Review. Same listing on a kiro-cli-v2 install with the default engine
  • Control: with the ks-* glob removed from k-developer.json, the v3 agent still listed all 82. So for a home install Kiro already scans ~/.kiro/skills; the glob makes discovery explicit and covers other scopes. I did not test a project-scope install
  • cargo clippy -- -D warnings and cargo fmt --check pass (rustup stable 1.97.1 with a separate target dir; make lint hits a local clippy/rustc version mismatch). --all-targets shows 7 warnings in files this PR does not touch, the same 7 without it
  • New code files carry the SPDX header

Checklist

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own changes
  • I have commented my code where necessary
  • I have made corresponding changes to the documentation
  • I have added or updated tests that prove my change works

Agents Affected

  • All agents on the Kiro harnesses: each lists every skill's name and description. Skill bodies still load through konductor-skills.

Notes for Reviewers

  • Size: the 82 pointers add 17,354 characters of name + description to each agent's prompt (about 4.3k tokens at 4 characters per token), down from about 23.6k with full descriptions. A home install puts the pointers in ~/.kiro/skills/, where other Kiro agents see them too; --no-skill-pointers avoids that.
  • Name: the pointer is listed as ks-<name>, not <name>. I kept the prefix because many of these names already exist in .kiro/skills/ from other tools, and a pointer with the same name would clash. The pointer text names the real skill, so "apply backend-review" resolves through it.
  • Telemetry: not weakened. A get_skill load is counted as before. A load through the file fallback is not counted. I did not add hook-based counting: hooks fire on every call and would need filtering.
  • Path in project installs: the fallback path is absolute, so a project install writes the local path into .kiro/skills/ks-*/SKILL.md. The docs say not to commit that directory.
  • Existing gap, not changed here: in the probe, get_skill returned skills outside the agent's --skill-name-filter (k-developer got adr-generator). The server reads a top-level files array from .konductor/manifest (mcp/lib/skill-lookup-core/src/install_manifest.rs), but the manifest nests files under strategies[]. Every skill then counts as not installed by Konductor, and the filter keeps all of them. So the "stop on not-found" line only matters once that is fixed. It needs its own issue.
  • Not verified: whether fs_read expands ~ (hence the absolute path), and the file fallback with the server disconnected.

Each skill gets a small ks-<name>/SKILL.md under .kiro/skills/ carrying its
name and description, so Kiro lists it natively. The pointer loads the body
through the konductor-skills get_skill tool and falls back to reading
.konductor/skills/<name>/SKILL.md. Pointers are tracked in the manifest;
Claude installs are unchanged.
Discovery: every Kiro agent now lists skill://.kiro/skills/ks-*/SKILL.md,
added through a resource-rewrite pass for both Kiro harnesses.

Pointer text: call get_skill first, read the file only when the
konductor-skills server is not connected, and stop on a not-found answer.
The fallback path is absolute. Descriptions are cut to 200 characters,
stripped of control characters, and an unreadable SKILL.md fails the
install while a missing description warns.

Opt-out: install --no-skill-pointers skips pointers and the agent
resource, prunes earlier ones, and is recorded in .konductor so update
keeps it. update also prunes pointers for skills the source dropped.

Pointers get their own install phase, and the install summary no longer
counts them as skills.
…inters

Drop --no-skill-pointers and its .konductor/no-skill-pointers marker.
Pointers are always written for the Kiro harnesses. With telemetry on a
pointer calls get_skill; with --no-telemetry it reads the skill file
directly. pointer_instructions picks the text from the install's
telemetry setting, and install --no-telemetry over a telemetry-on target
at the same version is no longer skipped as already-at-version, so the
pointers are rewritten.
@knihit

knihit commented Oct 27, 2026

Copy link
Copy Markdown
Contributor Author

Closing in favor of #119 and #120 (stacked). We kept the skills MCP server so skill loads stay counted, and fixed discovery there instead of adding native pointer skills:

On the same tasks, scored from logs, the right skill loaded in 9 of 12 Kiro v3 runs with #120 against 3 of 12 on main. That matches this PR plus a use rule (9 of 12), at about a quarter of the prompt cost, and without writing into ~/.kiro/skills where other Kiro agents see it. This PR alone reached 6 of 12. Thanks for the pointer probe and for finding the filter bug.

@knihit knihit closed this Oct 27, 2026
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