Read plans/2026-04-10-plan-skills-native-read-tool.md and implement as planned
Rate quality
Private research annotation
Sign in to add a private research label or note.
- User
Read plans/2026-04-10-plan-skills-native-read-tool.md and implement as planned
Assistant
Now let me look at the skills crate structure, types, and gateway server tool registration.
Assistant
Now I have enough context. Let me look at the parse.rs module for validate_name and parse_metadata.
Assistant
Let me look at how moltis_tools exports Error and check for any skills-related test setup pattern.
Assistant
Let me start by creating the safety module for the prompt-injection scanner (moltis-5xp). I'll claim that issue in parallel since step 4 is independent:
Assistant
Now let me add the
ReadSkillTooltoskill_tools.rs. First, I need to add the imports and the tool itself.Assistant
Now insert the
ReadSkillToolstruct and impl right after theDeleteSkillToolsection (beforeWriteSkillFilesTool):Assistant
Now add unit tests for
ReadSkillToolat the end of the existingtestsmodule. Let me check the last few lines:Assistant
Let me verify the crate compiles, then tackle the prompt_gen update and gateway registration in parallel.
Assistant
Good, compiles. Let me run the tests for the skill_tools module:
Assistant
All 32 tests pass. Fix the unused import warning:
Assistant
Also run the safety tests:
Assistant
Close both issues and move on.
Assistant
Now step 2 (gateway registration) and step 3 (prompt rewrite). Let me claim and tackle:
Assistant
Now rewrite prompt_gen:
Assistant
Now look at the
prompt.rstest around line 1082 anddocs/src/system-prompt.md:Assistant
Now update the docs:
Assistant
Now check for stale copies of the old instruction text:
Assistant
Only the plan mentions it, which is fine. Let me run the skills + agents tests:
Assistant
Now let me verify the gateway still compiles:
Assistant
Now I need the integration-level assertion that
read_skillis present. Let me look for existing services-test harness:Assistant
Let me create a gateway integration test that exercises the registered read_skill tool against a seeded skill directory:
Assistant
All 5 integration tests pass. Close the remaining three issues (0vb, hjy, mcv):
Assistant
Now let me run the format and lint checks per CLAUDE.md:
Assistant
Format check passed (empty output). Now run the full test suite for affected crates and then clippy:
Assistant
While lint is running, let me also run tests for moltis-skills and moltis-agents in parallel:
Assistant
All relevant tests pass. Let me check lint progress:
Assistant
Known pre-existing macOS CUDA build issue (moltis-csq). Let me run clippy on the specific crates we changed:
Assistant
Clippy clean on skills + tools. Let me also clippy agents and run the gateway-specific targeted lint:
Assistant
Clippy clean on gateway too. Let me re-run the gateway integration test post-format:
Assistant
All good. Let me verify the git status and commit:
Assistant
Plan implemented and committed as
66ad3c22. Summary:Closed beads issues: moltis-6p0, moltis-5xp, moltis-0vb, moltis-hjy, moltis-mcv (5/6 children of epic moltis-1sk). Follow-up moltis-avv (token-budget fallback) left open as the plan specifies.
Code changes:
crates/tools/src/skill_tools.rs— newReadSkillToolwith primary + sidecar read paths, containment guards (reuses ), 128 KB cap, symlink-escape rejection, sidecar listing under //. 11 new unit tests (happy, sidecar-listing, unknown-name-with-hint, sidecar-happy, traversal, absolute-path, symlink escape, oversized, SKILL.md-via-sidecar rejection, schema shape, injection-warn passthrough).
Assistant
Notifications noted. The three background task outputs confirm what I already verified:
bu7qqcis2(integration test) — 5/5 passing.b0c07x0e5(gateway clippy withlocal-llm-metal) — clean.bcalmwoi9(just lint) — actually exit code 101 (the notification summary is mislabeled); it hit the pre-existing macOS llama-cpp-sys CUDA build error tracked in moltis-csq, unrelated to these changes. The targeted clippy runs I did onmoltis-skills,moltis-tools,moltis-agents, andmoltis-gatewayare the equivalent coverage and all passed.
No further action needed — the commit
66ad3c22still stands.- User
commit push create a PR
Assistant
Commit is already made. Pushing and creating the PR now.
Assistant
Clean — only the one commit ahead of main. Pushing:
Assistant
Pushed and PR opened: https://github.com/moltis-org/moltis/pull/630
Now let me address the follow-up request. First, explore hermes-agent's skill system to see what's worth porting.
Assistant
Now I have a clear picture of hermes. Let me identify what's worth porting vs. out-of-scope, create a beads issue for this follow-up, and get to work.
Assistant
Now let me refactor
ReadSkillToolto add the hermes-inspired features. First, let me look at the current state of the read paths:Assistant
Now let me replace the
read_primary,read_sidecar, andlist_skill_sidecar_fileswith more robust versions:Assistant
Now update
read_sidecarto handle binary files and missing-file cases gracefully:Assistant
Now update
list_skill_sidecar_filesto includeassets/and sort the output:Assistant
Now let me compile and run the existing tests to ensure nothing regressed:
Assistant
All 11 existing tests still pass. Now let me add the new robustness tests:
Assistant
Now let me find the end of the test module and add new tests:
Assistant
All 34 read_skill tests pass (23 new + 11 existing). Let me also add a couple of gateway integration tests for
assets/and binary handling:Assistant
All 8 gateway integration tests pass. Let me run clippy + the full tool tests to confirm nothing regressed:
Assistant
55/55 passing. Now wait for clippy:
Assistant
34/34 read_skill tests pass. Re-run clippy:
Assistant
Clippy clean on gateway too. Let me also re-run the gateway integration tests and full skill_tools:
Assistant
All green: 55 tool tests, 8 gateway integration tests. Close the beads issue and commit:
Assistant
Pushed. PR #630 now has both commits. Let me update the PR description to cover the follow-up work:
Assistant
Done. Commit
212c39ebpushed to PR #630, description updated.PR: https://github.com/moltis-org/moltis/pull/630
Follow-up commit summary:
Hermes-agent features ported (the parts users love, per your ask):
assets/sidecar directory (agentskills.io standard)- Sorted sidecar listings for deterministic output
- Binary-file detection — returns
{ is_binary: true, bytes, file_type, note }instead of erroring on non-UTF-8 - Helpful sidecar-not-found errors that list what's actually available
Assistant
Noted — both background clippy runs are confirmed complete. Nothing further to act on:
boxig0s5z— the initial clippy that caught theexpect_usedlint in my first draft ofread_primary. Already fixed in the follow-up commit by rebuilding the response as aserde_json::Mapdirectly.bx6gxflmr— the re-run against the fixed code, clean.
PR #630 still stands with two commits (
66ad3c22+212c39eb), all tests passing, targeted clippy clean.- User
Fix and solve PR comments
Assistant
I've got 4 actionable review comments. Let me check one detail before fixing:
Assistant
Let me add a tolerant
strip_optional_frontmatterhelper toparse.rs:Assistant
I'll invoke
/greploopas requested — it will iterate over the PR's Greptile comments until they're all resolved.Assistant
Starting iteration 1. Platform is GitHub, PR is #630. I have Greptile's 4 actionable comments already identified. Fixing them now.
Fix 1: Use
strip_optional_frontmatterin the plugin path (skill_tools.rs)Assistant
Fix 2: Reject symlinked skill directory in
read_sidecarAssistant
Fix 3: Add
assets/to activation instruction inprompt_gen.rsAssistant
Fix 4: Tighten the
||assertion in the path-leak testAssistant
Now let me add tests for each fix and verify everything compiles & passes.
Assistant
Now let me add regression tests for the fixes:
Assistant
Now add a unit test for plugin-frontmatter stripping and symlinked skill-dir rejection on reads. I also need a prompt_gen test for the assets/ mention:
Assistant
Now tests for the skill_tools fixes (plugin frontmatter stripping + symlinked skill dir rejection on read):
Assistant
All 37 tests pass (3 new regression tests added). Let me also run clippy+fmt and the gateway integration test, then format, commit, and push:
Assistant
Clippy clean on skills+tools. Run the gateway integration test too, then commit and push:
Assistant
All green: 58 skill_tools tests, 109 skills tests, 8 gateway integration tests. Commit and push:
Assistant
Pushed. Now resolve the addressed Greptile review threads via GraphQL, then re-trigger Greptile and poll for the next review.
Assistant
The unresolved thread is the
||assertion comment — fixed incc7d0412. Resolve it:Assistant
Now trigger Greptile and wait for its next review:
Assistant
Greptile check passed. Now fetch the new review score and any remaining comments:
Assistant
Greptile left a fresh comment on my latest commit at
crates/tools/src/skill_tools.rs:574. Let me fetch the full body:Assistant
Greptile's updated summary shows 4/5 confidence with 2 remaining P2 findings (both new):
collect_sidecar_entrieshas blockingis_dir()in an async functionread_primaryis missing the symlink-rejection guard thatread_sidecarnow has
Let me fix both. Starting iteration 2.
Assistant
Let me apply both fixes:
Assistant
Now fix the blocking
is_dir()incollect_sidecar_entries:Assistant
All 37 pass. Now add a test for the new
read_primarysymlink rejection:Assistant
Now format + clippy + run full suites:
Assistant
Clippy clean, 59 tests pass. Run gateway integration test too and the safety/prompt_gen suites:
Assistant
59 skill_tools + 109 skills + 8 gateway integration — all green. Commit and push iteration 2:
Assistant
Re-trigger Greptile and poll:
Assistant
Greptile review complete. Fetch the updated summary and any remaining comments:
Assistant
5/5 confidence! But the summary mentions one P2 — plugin path missing the 128KB cap. Let me check for unresolved inline comments:
Assistant
All 3 existing inline threads are resolved. Let me also check for any new inline comments posted on the latest commit:
Assistant
5/5 confidence and zero unresolved inline comments — greploop exit condition is technically met. But the summary names one more actionable P2: the plugin primary read lacks the 128KB cap. Let me address it in one more iteration so the PR is truly clean.
Assistant
Add tests for both cap paths (plugin + directory-backed):
Assistant
40 pass. Clippy and full verification:
Assistant
Clippy clean, 61 tests passing. Commit and push:
Assistant
Greptile done. Fetch the updated summary:
Assistant
Greptile is at 4/5 with two new P2 findings. Starting iteration 4:
- Shared 16-file cap can silently drop entire sidecar subdirectories
ReadSkillToolin server.rs usesdefault_paths()while other skill tools usedata_dir— latent inconsistency
Let me fix both:
Assistant
Now update server.rs to use the data_dir-scoped helper:
Assistant
Now fix the sidecar cap — introduce a per-subdir quota so no sidecar subdirectory can be silently swallowed:
Assistant
Now update
collect_sidecar_entriesto enforce the per-subdir cap:Assistant
Both new tests pass. Now run the full suite + clippy + gateway integration:
Assistant
62 skill_tools + 109 skills + 8 gateway integration, all green. Commit and push iteration 4:
Assistant
Done. Fetch the summary:
Assistant
5/5! Now check for unresolved inline comments to confirm greploop exit condition:
Assistant
All 3 existing threads are resolved, no new inline comments posted on the latest commit. Greptile is at 5/5 confidence with zero unresolved comments — greploop exit condition met.
Assistant
Greploop complete.
codeGreploop complete. Platform: GitHub PR: #630 (moltis-org/moltis) Iterations: 4 Confidence: 5/5 Resolved: 9 comments Remaining: 0Summary of iterations:
Iter Commit What was fixed 1 cc7d0412Added assets/to prompt instruction;strip_optional_frontmatterhelper for plugin.mdfiles;read_sidecarsymlink rejection; tightened the!A || !Bpath-leak assertion2 f7627dd2Assistant
All background polling commands have completed — these are stragglers from the greploop iterations. They confirm what I already verified in the direct status checks: Greptile finished each review cycle successfully. No action needed.
PR #630 still stands at 5/5 Greptile confidence, 0 unresolved review threads, ready to merge.
- User
How has skills ever worked before then? Can you check git history and figure that out? Has it ever worked at all?
Assistant
Good question. Let me dig through git history to figure out whether skills ever actually worked end-to-end.
Assistant
No prior
read_skilltool existed. Let me check the gateway's skill tool registration history:Assistant
Now I have the full picture. Let me verify one more thing — what tools ship in a default install:
Assistant
- User
Have you added tests to ensure it works in all conditions and no regression ever?
Assistant
Good question. Let me audit what's actually covered vs. what a real regression might look like, then fill the gaps.
Assistant
Let me audit the invariants we rely on and add tests for the ones that aren't covered yet.
Gaps I've identified:
- Discoverer↔prompt parity — no test asserts that every skill name listed in the prompt is actually resolvable by
read_skill. This is the whole point of the PR and has no regression test. - Tool name parity — if someone renames the tool or edits the prompt instruction, the link silently breaks. No test cross-checks them.
- Hot-discovery — when a skill is added after the tool is constructed, does the next read see it? Not explicitly tested.
CreateSkillTool→ReadSkillToolround-trip — no test proves the create and read sides share a consistent data layout.WriteSkillFilesTool→ReadSkillToolround-trip (for sidecars) — same.FsSkillDiscoverer::default_paths_for— new API with no direct unit test.
- Discoverer↔prompt parity — no test asserts that every skill name listed in the prompt is actually resolvable by
Assistant
Now update
prompt_gen.rsto generate the sidecar-dir list from the shared constant:Assistant
Now I'll tighten
test_activation_instruction_mentions_all_sidecar_dirsto iterate over the shared constant and fix the plugin-as-file sidecar dispatch issue (Greptile's remaining P2):Assistant
Now fix the plugin-as-file sidecar dispatch. If
meta.pathis a.mdfile and the agent calls withfile_path, the current code joins a relative path to a file — nonsense. It should return an error explaining that plugin-backed.mdskills have no sidecar directory:Assistant
Now add all the new tests. First the
skill_tools.rsunit tests (hot-discovery, plugin-as-file sidecar rejection):Assistant
Now add the
default_paths_forunit test in discover.rs:Assistant
Now add the gateway integration tests (discoverer↔prompt parity, tool-name parity, create→read round-trip, write_files→read round-trip):
Assistant
I need
WriteSkillFilesToolin the registry for the sidecar round-trip test. Let me add it plus all the new gateway tests:Assistant
Now append the new parity + round-trip integration tests at the end:
Assistant
Now format, run all affected suites, and fix any breakage:
Assistant
112 skills tests pass (was 109, 3 new: 2
default_paths_for+ 1test_activation_instruction_uses_read_skill_tool_name_constant). Now tools:Assistant
65 skill_tools tests (was 62, 3 new). Now the gateway integration tests:
Assistant
14/14 integration tests pass (was 8, 6 new). Now clippy and format verification:
Assistant
Clippy clean on all three. Commit and push:
Assistant