Skip to content

Feat/iii directory support global skills#162

Merged
guibeira merged 12 commits into
mainfrom
feat/iii-directory-support-global-skills
May 19, 2026
Merged

Feat/iii directory support global skills#162
guibeira merged 12 commits into
mainfrom
feat/iii-directory-support-global-skills

Conversation

@guibeira
Copy link
Copy Markdown
Collaborator

@guibeira guibeira commented May 19, 2026

Summary by CodeRabbit

Release Notes

  • New Features

    • Skills can now be accessed using multiple ID formats: bare paths, file paths with .md extension, and legacy URI format.
    • SKILLS.md files are now recognized as skill index aliases.
  • Documentation

    • Added comprehensive introduction and quickstart guides.
    • Updated documentation with clarified skill download and retrieval behavior.
  • Tests

    • Extended test coverage for new skill ID format support and SKILLS.md aliasing.

Review Change Stack


What this PR does

Two coordinated changes in iii-directory, with the old surface kept fully working:

  1. SKILLS.md becomes a namespace entry-point. The filesystem scanner (fs_source::rel_to_id) and the directory::skills::get input parser (normalize_get_id) both alias the literal filename SKILLS.md to index.md, so a file at <ns>/SKILLS.md produces the id <ns>/index. The download path on the registry side was already byte-passthrough, so the new convention round-trips end to end without touching the registry.
  2. directory::skills::index dual-emits the pointer. The rendered overview now reads Read [<ns>/index.md](<ns>/index.md) (legacy iii://<ns>/index). New consumers grab the markdown link target; harnesses that still grep for iii:// keep finding it. The input parser accepts all three forms (<id>, <id>.md, iii://<id>), so any caller can use whichever it prefers.

Function URIs in skill bodies (iii://fn/<dotted>, in how_to.rs) are deliberately out of scope, as they point at function ids, not files, so the file-path mapping does not apply.

End-to-end demo

Publish a SKILLS.md payload to the local registry, then run the bundled smoke example. It downloads the file, runs scan_skills, and asserts the id surfaces as <ns>/index with no uppercase leaks.

End-to-end smoke via local registry

Unit-test coverage

New tests in fs_source (alias + duplicate handling) and functions::skills (parser + emitter dual-emit). Full lib suite is green (172/172).

Unit tests for SKILLS.md alias, .md path form, and dual-emit pointer

BDD coverage

Five new scenarios in tests/features/read.feature exercise the alias on list, the .md path form on get (including iii:// + .md composition), and the dual-emit pointer in the rendered index body.

BDD scenarios + pure tape

Back-compat matrix

Input Old behavior New behavior
directory::skills::get { id: "hello/index" } works works
directory::skills::get { id: "hello/index.md" } rejected works (.md stripped)
directory::skills::get { id: "hello/SKILLS.md" } rejected works (alias to hello/index)
directory::skills::get { id: "iii://hello/index" } works works (legacy prefix kept)
directory::skills::get { id: "iii://hello/index.md" } rejected works (prefix + suffix composed)
directory::skills::index output Read [iii://...](iii://...) Read [<id>.md](<id>.md) (legacy iii://<id>) — both forms emitted

Test plan

  • cargo test --lib (172/172 green)
  • cargo test --test bdd -- --tags @pure (pure scenarios green; @engine scenarios require a live engine and run in operator setups)
  • cargo run --example test_registry against the local registry with SKILLS.md published, smoke assertions pass
  • cargo fmt --all -- --check clean

@vercel
Copy link
Copy Markdown

vercel Bot commented May 19, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
workers Ready Ready Preview, Comment May 19, 2026 10:29pm

Request Review

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 19, 2026

Warning

Rate limit exceeded

@guibeira has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 52 minutes and 53 seconds before requesting another review.

You’ve run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 8864d416-be29-455c-9732-ef64af050461

📥 Commits

Reviewing files that changed from the base of the PR and between 92828f0 and 6895469.

📒 Files selected for processing (1)
  • iii-directory/skill.md
📝 Walkthrough

Walkthrough

This PR implements SKILLS.md filesystem aliasing, updates the skills API to normalize .md-suffixed and legacy iii:// URI forms, migrates the index renderer from legacy iii:// links to file-path <id>.md links (preserving legacy text for back-compat), and adds comprehensive documentation, feature test coverage, and a test example demonstrating the behavior.

Changes

SKILLS.md alias and file-path link migration

Layer / File(s) Summary
Filesystem SKILLS.md alias support
iii-directory/src/fs_source.rs
Module comment, rel_to_id helper, and scan tests ensure SKILLS.md in a directory (root or nested) maps to the same normalized ID as index.md; duplicate-id conflicts are recorded as skips.
API ID normalization and input documentation
iii-directory/src/functions/skills.rs
normalize_get_id rewritten to trim whitespace, optionally strip iii:// prefix, reject other :// schemes, map SKILLS.md<stem>/index, and strip trailing .md suffix. Registration docs for directory::skills::get/index and SkillGetInput updated; extended tests cover all paths including nested and legacy round-trip.
Markdown index renderer file-path links
iii-directory/src/functions/skills.rs
render_index_markdown emits <id>.md file-path read-more links instead of iii:// URIs, with legacy iii://<id> preserved as plain text in parentheses. Renderer tests updated to verify new format and confirm absence of links for filtered-out skills.
Feature test coverage for ID forms and aliasing
iii-directory/tests/features/read.feature
Scenarios updated to expect <ns>/index.md links; new scenarios verify SKILLS.md aliasing at root and nested directories; directory::skills::get extended to accept <id>.md, direct SKILLS.md, and iii:// variants; round-trip test confirms legacy link resolves.
Documentation and test example
iii-directory/docs/intro.md, iii-directory/docs/companions.md, iii-directory/docs/quickstart.md, iii-directory/skill.md, iii-directory/examples/test_registry.rs
New/rewritten docs describe the four-surface directory namespace, SKILLS.md aliasing, accepted id forms, and download/list/get/index semantics. New async Tokio example demonstrates registry download, filesystem scanning with smoke assertions on skill IDs, and result reporting.
Registry formatting and workflow permissions
iii-directory/src/functions/registry.rs, .github/workflows/skill-check.yml
Minor formatting in registry cache-key and test assertions; workflow permissions changed from write to read and action write option disabled.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

  • iii-hq/workers#131: Both PRs modify directory::skills::get normalization and related index/link expectations; main PR's SKILLS.md aliasing changes build on the retrieved PR's refactor.
  • iii-hq/workers#133: Both PRs modify directory::skills::index and render_index_markdown with shared skills-index rendering and get/ID-handling updates.
  • iii-hq/workers#124: Main PR's SKILLS.md aliasing in fs_source.rs and normalize_get_id rework are layered onto the earlier feat: iii directory implementation in those same files.

Suggested reviewers

  • ytallo
  • andersonleal

Poem

🐰 A rabbit hops through SKILLS.md,
Renames it index with a bound,
File-paths now shine where old iii:// was,
Links point home, the tests all abound!

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Title check ❓ Inconclusive The title 'Feat/iii directory support global skills' is partially related to the changeset; it mentions the iii directory feature but is vague and overly broad regarding the actual scope of changes (SKILLS.md aliasing, id normalization, documentation). Consider a more specific title like 'Support SKILLS.md as namespace entry point in iii directory' to better reflect the primary change of aliasing SKILLS.md to index.md.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/iii-directory-support-global-skills

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 19, 2026

skill-check — worker

0 verified, 10 skipped (no docs/).

Layer Result
structure
vale
ai

Three for three. Nicely done.

@guibeira guibeira marked this pull request as ready for review May 19, 2026 19:43
guibeira added 2 commits May 19, 2026 16:48
The PR-checks workflow requires iii-directory/skill.md per
.github/scripts/validate_worker.py (BOOTSTRAP_WORKERS). skill.md is
rendered from docs/{intro,quickstart,companions}.md via iii-skill-render,
which becomes the source-of-truth going forward — README and
skills/index.md remain unchanged for now to preserve existing content.
read.feature additions:
- SKILLS.md at namespace root aliased to <ns>/index
- nested SKILLS.md aliased to <ns>/<sub>/index
- directory::skills::get accepts <id>.md file-path form
- directory::skills::get accepts SKILLS.md filename
- directory::skills::get accepts iii:// + .md combined form

Updated the existing index scenario to assert the new file-path
pointer (Read [<ns>/index.md](<ns>/index.md)) and explicitly check
that the rendered body no longer contains the iii:// scheme.

docs/intro.md: replaced em dashes with parens/periods to pass the
skill-check Vale rule (Terminology.EmDash). skill.md re-rendered.
Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@iii-directory/README.md`:
- Around line 21-23: Remove the duplicated install command block containing "iii
worker add iii-directory" that appears after the configuration discussion;
locate the second occurrence of the fenced bash block with that exact command
and delete the entire code fence so the only remaining instance is the one in
the Install section, leaving the surrounding headers (e.g., "## Quickstart")
intact.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 95b6e36e-0430-45e8-9f1f-cd8f4a4404e2

📥 Commits

Reviewing files that changed from the base of the PR and between 599236d and 6198786.

⛔ Files ignored due to path filters (1)
  • iii-directory/Cargo.lock is excluded by !**/*.lock
📒 Files selected for processing (10)
  • iii-directory/README.md
  • iii-directory/docs/companions.md
  • iii-directory/docs/intro.md
  • iii-directory/docs/quickstart.md
  • iii-directory/examples/test_registry.rs
  • iii-directory/skill.md
  • iii-directory/skills/index.md
  • iii-directory/src/fs_source.rs
  • iii-directory/src/functions/registry.rs
  • iii-directory/tests/features/read.feature
💤 Files with no reviewable changes (1)
  • iii-directory/skills/index.md
✅ Files skipped from review due to trivial changes (5)
  • iii-directory/skill.md
  • iii-directory/docs/intro.md
  • iii-directory/docs/companions.md
  • iii-directory/src/functions/registry.rs
  • iii-directory/docs/quickstart.md
🚧 Files skipped from review as they are similar to previous changes (2)
  • iii-directory/examples/test_registry.rs
  • iii-directory/src/fs_source.rs

Comment thread iii-directory/README.md
Comment on lines 21 to 23
```bash
iii worker add iii-directory
```
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Remove duplicate install command.

The iii worker add iii-directory command block is already present in the Install section (lines 13-15). This duplicate appears out of context after the configuration discussion and should be removed.

🧹 Proposed fix
 `directory::skills::download` pulls bundles from the public workers registry (`api.workers.iii.dev` by default). For self-hosted setups, repoint `registry_url` in `config.yaml` at your own registry. The `directory::registry::*` proxies share their envelope with `directory::engine::workers::*`, so a single parser handles both local and remote worker discovery.
 
-```bash
-iii worker add iii-directory
-```
-
 ## Quickstart
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
```bash
iii worker add iii-directory
```
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@iii-directory/README.md` around lines 21 - 23, Remove the duplicated install
command block containing "iii worker add iii-directory" that appears after the
configuration discussion; locate the second occurrence of the fenced bash block
with that exact command and delete the entire code fence so the only remaining
instance is the one in the Install section, leaving the surrounding headers
(e.g., "## Quickstart") intact.

Comment on lines -206 to +207
And the index response body contains "Read [`iii://team-a/index`](iii://team-a/index) for the full worker reference."
And the index response body contains "Read [`iii://team-b/index`](iii://team-b/index) for the full worker reference."
And the index response body contains "Read [`team-a/index.md`](team-a/index.md) (legacy `iii://team-a/index`) for the full worker reference."
And the index response body contains "Read [`team-b/index.md`](team-b/index.md) (legacy `iii://team-b/index`) for the full worker reference."
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we have tests to ensure iii:// still works?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure!

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@@ -1,67 +0,0 @@
---
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why did remove this? this is critical

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It was not me, was the pipeline, see this commit:
6198786
Let me check why

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see what happened. Since this project does not have a docs folder, the pipeline was never triggered, as soon i move the files, it generates this commit. This ci pipeline was added here

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let's disable this pipeline then, it cannot delete this md, it's important

Comment thread iii-directory/skill.md Outdated
guibeira added 3 commits May 19, 2026 19:21
…s::index

Output now reads:
  Read [`<id>.md`](<id>.md) (legacy `iii://<id>`) for the full worker reference.

Both forms travel together so harnesses that grep for the old URI
scheme keep working alongside new consumers that prefer the markdown
link target. The parser already accepted all three input forms
(bare id, .md path, iii:// URI), so dual-emit closes the loop for
back-compat with existing prompts and tooling.

Updated unit test (render_index_emits_both_file_path_and_iii_pointer)
and BDD scenario (read.feature) to assert both forms appear in the
rendered body.
…input round-trip

Adds explicit coverage for the legacy iii:// URI form on the input
side and proves the dual-emit output round-trips:

Unit tests (functions::skills):
- normalize_iii_prefix_with_skills_md_aliases_to_index
- normalize_iii_prefix_with_nested_skills_md_aliases_to_index
- normalize_iii_prefix_round_trips_with_render_emitted_id

BDD scenarios (read.feature):
- directory::skills::get accepts the iii:// + SKILLS.md combined form
- the legacy iii:// pointer emitted by skills::index round-trips
  through skills::get (proves the dual-emit output remains a valid
  get input)
…index.md

skill-check ran iii-hq/skills-and-validation@v0.4 with write: true, which
auto-committed a re-render that deletes any skills/ artifact the renderer
classifies as stale. On this PR it removed iii-directory/skills/index.md
(content was hand-maintained, not generated from docs/) and rewrote the
README.

Set write: false so the action runs in report-only mode: the sticky PR
comment still surfaces diffs, but no commit lands automatically. The
contents permission drops to read since the action no longer pushes.
@guibeira guibeira force-pushed the feat/iii-directory-support-global-skills branch from b32ea08 to 92828f0 Compare May 19, 2026 22:22
The skill-check action (iii-hq/skills-and-validation@v0.4) skips a
worker entirely when `<worker>/docs/intro.md` is missing — that gates
the renderer's drift detection. Without those partials, the action no
longer races to re-render and remove skills/index.md or rewrite the
README on every push.

skill.md stays in tree (required by BOOTSTRAP_WORKERS in the worker
validator) but loses the "DO NOT EDIT" header and the now-broken
docs/* pointer. The content was carried over verbatim and updated to
mention the dual-emit pointer behavior added in this PR.
Comment thread iii-directory/skill.md
@@ -0,0 +1,11 @@
# iii-directory
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i dont think we need this

@guibeira guibeira merged commit 01f7358 into main May 19, 2026
11 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.

2 participants