-
Notifications
You must be signed in to change notification settings - Fork 1
Feat/iii directory support global skills #162
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
0a25ff5
feat(directory): alias SKILLS.md to index.md in skill scanner
guibeira 7b982d9
test(directory): rename SKILLS.md alias tests to snake_case
guibeira 755f74c
feat(directory): accept .md file-path form in directory::skills::get
guibeira 7b85bf9
feat(directory): emit file-path pointer from directory::skills::index
guibeira 599236d
test(directory): smoke-assert SKILLS.md round-trip via local registry
guibeira 0d4efaf
style(iii-directory): apply cargo fmt + sync lockfile version
guibeira 789f4ac
docs(iii-directory): add skill.md required by bundled worker validator
guibeira 3e23290
test(iii-directory): cover SKILLS.md alias + file-path pointer in BDD
guibeira faf4e10
feat(directory): dual-emit file-path + legacy iii:// pointer in skill…
guibeira e2627ea
test(directory): pin iii:// back-compat — alias composition + output↔…
guibeira 92828f0
ci(skill-check): disable auto-write to stop bot from removing skills/…
guibeira 6895469
docs(iii-directory): drop docs/ partials, keep skill.md hand-maintained
guibeira File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -6,7 +6,7 @@ on: | |
| branches: [main] | ||
|
|
||
| permissions: | ||
| contents: write # for auto-fix mode (commits the rendered diff back) | ||
| contents: read # report-only; the action no longer commits back | ||
| pull-requests: write # for the sticky PR comment | ||
| actions: write # for the persistent AI skip-cache (v0.3+) | ||
|
|
||
|
|
@@ -19,6 +19,6 @@ jobs: | |
| ref: ${{ github.head_ref }} # check out the PR branch directly | ||
| - uses: iii-hq/[email protected] | ||
| with: | ||
| write: true | ||
| write: false | ||
| scope: pr-diff | ||
| anthropic-api-key: ${{ secrets.ANTHROPIC_API_KEY }} | ||
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,70 @@ | ||
| use iii_directory::fs_source::{scan_prompts, scan_skills}; | ||
| use iii_directory::sources::registry::{download, VersionSpec}; | ||
|
|
||
| #[tokio::main] | ||
| async fn main() -> Result<(), String> { | ||
| let registry = | ||
| std::env::var("REGISTRY").unwrap_or_else(|_| "http://localhost:3111".to_string()); | ||
| let worker = std::env::var("WORKER").unwrap_or_else(|_| "hello-worker".to_string()); | ||
| let tag = std::env::var("TAG").unwrap_or_else(|_| "latest".to_string()); | ||
|
|
||
| let tmp = tempfile::tempdir().unwrap(); | ||
| let skills_folder = tmp.path(); | ||
|
|
||
| println!("→ Downloading {worker} (tag={tag}) from {registry}"); | ||
| println!(" skills_folder = {}", skills_folder.display()); | ||
|
|
||
| let spec = VersionSpec::Tag(tag); | ||
| let result = download(®istry, &worker, &spec, skills_folder, 30_000).await?; | ||
|
|
||
| println!("\n[download result]"); | ||
| println!(" namespace = {}", result.namespace); | ||
| println!(" skills_written = {:?}", result.skills_written); | ||
| println!(" prompts_written = {:?}", result.prompts_written); | ||
|
|
||
| let (skills, skill_skipped) = scan_skills(skills_folder); | ||
| let (prompts, prompt_skipped) = scan_prompts(skills_folder); | ||
|
|
||
| println!("\n[scan_skills]"); | ||
| for s in &skills { | ||
| println!(" id={:<40} path={}", s.id, s.abs_path.display()); | ||
| } | ||
| if !skill_skipped.is_empty() { | ||
| println!("\n[skill skips]"); | ||
| for s in &skill_skipped { | ||
| println!(" {} → {}", s.path.display(), s.reason); | ||
| } | ||
| } | ||
|
|
||
| println!("\n[scan_prompts]"); | ||
| for p in &prompts { | ||
| println!(" name={:<30} path={}", p.name, p.abs_path.display()); | ||
| } | ||
| if !prompt_skipped.is_empty() { | ||
| println!("\n[prompt skips]"); | ||
| for s in &prompt_skipped { | ||
| println!(" {} → {}", s.path.display(), s.reason); | ||
| } | ||
| } | ||
|
|
||
| println!( | ||
| "\nDONE — skills scanned={}, prompts scanned={}", | ||
| skills.len(), | ||
| prompts.len() | ||
| ); | ||
|
|
||
| // Soft assertions so the example doubles as a smoke test. | ||
| let any_index = skills.iter().any(|s| s.id.ends_with("/index")); | ||
| if !any_index { | ||
| eprintln!("FAIL: no skill with id ending in /index was scanned"); | ||
| std::process::exit(1); | ||
| } | ||
| for s in &skills { | ||
| if s.id.chars().any(|c| c.is_ascii_uppercase()) { | ||
| eprintln!("FAIL: skill id leaked uppercase: {}", s.id); | ||
| std::process::exit(1); | ||
| } | ||
| } | ||
| println!("smoke: at least one /index id present, no uppercase leaks"); | ||
| Ok(()) | ||
| } |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| # iii-directory | ||
|
|
||
| Engine introspection, workers registry proxy, and filesystem-backed skill + prompt reader for the iii engine. Every public function sits under a single `directory::*` namespace, split into four MCP-agnostic surfaces (`skills`, `prompts`, `engine`, and `registry`), so callers learn one envelope across local files, the running engine, and the public workers registry. | ||
|
|
||
| Skills and prompts are sourced from a single configured folder on disk (`skills_folder`). The only write path is `directory::skills::download`, which pulls markdown into `skills_folder` from either the workers registry or a GitHub repo. `directory::skills::list` returns one row per markdown file with `title` (preferring the YAML frontmatter `title:` over the body H1) and `type` lifted from frontmatter. `directory::skills::get` accepts a bare id, a `<id>.md` file-path form, or the legacy `iii://<id>` URI. `SKILLS.md` is aliased to `index.md` at scan time so the new convention round-trips through both filesystem and parser. `directory::skills::index` renders a short per-worker overview that emits both relative file-path pointers (`Read [<ns>/index.md](<ns>/index.md)`) and the legacy `iii://<ns>/index` form side by side for back-compat. | ||
|
|
||
| `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 | ||
| ``` | ||
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
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