Repository navigation
Unify skill/prompt seeding with markdown import pipeline - #1096
Conversation
Replaces the ad-hoc SeedSkill / SeedGuidancePrompt / SeedPrompt structs and their bespoke to_node() conversions with a single NodeTemplate abstraction backed by the existing prepare_nodes_from_markdown pipeline. ## What changed ### packages/core/src/mcp/handlers/markdown.rs - Add `NodeTemplate` struct: title, optional content override, markdown_content, root_node_type, root_properties, child_node_type, child_properties - Add `prepare_nodes_from_template()`: expands a template into a flat PreparedNode list (root + children) using the existing markdown parser ### packages/core/src/services/node_service.rs - Add `seed_nodes_from_templates()`: inserts template-expanded node groups with the same type-level idempotency guarantee as the old seeding path - Delete unused `seed_nodes_if_needed()` (replaced entirely) ### packages/agent/src/skill_pipeline.rs - `seed_skill_nodes()` now returns `Vec<NodeTemplate>` instead of `Vec<SeedSkill>` - Guidance text moves into `markdown_content`; skill metadata moves into `root_properties` (description, tool_whitelist, max_iterations, output_format) - Delete `SeedSkill`, `SeedGuidancePrompt` structs and their impl blocks - Tests updated to use NodeTemplate field access + prepare_nodes_from_template ### packages/agent/src/prompt_assembler.rs - `seed_prompt_nodes()` now returns `Vec<NodeTemplate>` instead of `Vec<SeedPrompt>` - Prompt body text stored in `content` field (overrides title as node content) - `assemble_static()` updated to read priority/template_syntax from root_properties - Delete `SeedPrompt` struct and its `to_node()` impl - Tests updated accordingly ### packages/desktop-app/src-tauri/src/commands/db.rs - Seeding block unified: expands all templates via prepare_nodes_from_template, inserts via seed_nodes_from_templates (single pass, no separate child loop) - Prompt content diff-check preserved using template.content field ### packages/agent/tests/ollama_integration.rs - tools_for_skill() and build_schema_creation_prompt() updated to use NodeTemplate field access (.title, .root_properties, .markdown_content) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
Code Review — PR #1096: Unify skill/prompt seeding with markdown import pipelineBranch: `feature/issue-1056-unify-seed-with-markdown-pipeline` SummaryThis PR delivers a clean unification of three ad-hoc seeding structs ( The architectural intent is correct and well-executed. There is one functional regression worth addressing before merge, one minor structural concern, and a handful of nits. Findings[Improvement] Skill guidance content drift is now silently ignoredFile: The old seeding block included a per-guidance-prompt diff-check loop: it queried each skill node's children, compared content against the seed string, and called The new code drops this loop entirely. Only root The issue description says "Eliminates Options:
Given this is a greenfield project with no live installations, option 2 is acceptable in the short term, but the misleading comment needs to be corrected now. [Improvement] Stale test comment contradicts the assertion it introducesFile: The comment reads: But line 483 asserts [Improvement]
|
- Fix stale comment "all 7 skills" → "all 8 skills" in skill_pipeline.rs tests - Fix misleading comment in db.rs: clarify only prompt roots are diff-checked after seed, skill guidance children are intentionally user-editable - Update NodeTemplate doc example to include `content: None` for skill pattern and add second example showing `content: Some(...)` for prompt pattern - Add 7 unit tests for `prepare_nodes_from_template` in markdown_test.rs covering: no-child skill, guidance children, child_properties merge, prompt content override, title fallback, property replacement, root_properties Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
Address Review SummaryAll reviewer recommendations addressed. Changes pushed in commit ✅ Addressed (4 items)🟡 Fix stale comment in skill_pipeline.rs 🟡 Fix misleading comment in db.rs 🟢 Improve NodeTemplate doc example 🟢 Add unit tests for
⏭️ Skipped (1 item)🟢 Set Test StatusAll tests pass: 1170 core + 284 agent = 1454 total (no regressions). |
Resolved conflict in skill_pipeline.rs: kept main branch's expanded markdown_content for Research & Search skill which adds PARAMETER GUIDANCE and LISTING BY TYPE OR PROPERTY sections. Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
…ompilation - Merge split doc comment on ensure_model_ready so rustdoc sees a single block - Add clarifying comment on explicit drop(guard) explaining lock ordering - Extract build_noop_service() helper to deduplicate no-op construction - Add doc comment on test explaining runtime difference from production path - Fix agent_e2e skill pipeline tests: update NodeTemplate API (name→title, to_node()→prepare_nodes_from_template, extract whitelist/iterations from root_properties) after #1096 refactored NodeTemplate struct Co-Authored-By: Claude <[email protected]>
…ompilation (#1100) - Merge split doc comment on ensure_model_ready so rustdoc sees a single block - Add clarifying comment on explicit drop(guard) explaining lock ordering - Extract build_noop_service() helper to deduplicate no-op construction - Add doc comment on test explaining runtime difference from production path - Fix agent_e2e skill pipeline tests: update NodeTemplate API (name→title, to_node()→prepare_nodes_from_template, extract whitelist/iterations from root_properties) after #1096 refactored NodeTemplate struct Co-authored-by: Claude <[email protected]>
…ompilation (#1103) - Merge split doc comment on ensure_model_ready so rustdoc sees a single block - Add clarifying comment on explicit drop(guard) explaining lock ordering - Extract build_noop_service() helper to deduplicate no-op construction - Add doc comment on test explaining runtime difference from production path - Fix agent_e2e skill pipeline tests: update NodeTemplate API (name→title, to_node()→prepare_nodes_from_template, extract whitelist/iterations from root_properties) after #1096 refactored NodeTemplate struct Co-authored-by: Claude <[email protected]>
- Add additionalProperties hint to property_filters schema in def_search_semantic (guides LLM to generate string-valued objects) - Add reverse parity check to search_semantic_schema_parity_with_params test (bidirectional guard against drift) - Add doc comments to tmpl_* helper functions in agent_e2e.rs explaining they are adapters for NodeTemplate API change in #1096 Co-Authored-By: Claude <[email protected]>
- Add additionalProperties hint to property_filters schema in def_search_semantic (guides LLM to generate string-valued objects) - Add reverse parity check to search_semantic_schema_parity_with_params test (bidirectional guard against drift) - Add doc comments to tmpl_* helper functions in agent_e2e.rs explaining they are adapters for NodeTemplate API change in #1096 Co-authored-by: Claude <[email protected]>
* Unify skill/prompt seeding with markdown import pipeline (#1056) Replaces the ad-hoc SeedSkill / SeedGuidancePrompt / SeedPrompt structs and their bespoke to_node() conversions with a single NodeTemplate abstraction backed by the existing prepare_nodes_from_markdown pipeline. ## What changed ### packages/core/src/mcp/handlers/markdown.rs - Add `NodeTemplate` struct: title, optional content override, markdown_content, root_node_type, root_properties, child_node_type, child_properties - Add `prepare_nodes_from_template()`: expands a template into a flat PreparedNode list (root + children) using the existing markdown parser ### packages/core/src/services/node_service.rs - Add `seed_nodes_from_templates()`: inserts template-expanded node groups with the same type-level idempotency guarantee as the old seeding path - Delete unused `seed_nodes_if_needed()` (replaced entirely) ### packages/agent/src/skill_pipeline.rs - `seed_skill_nodes()` now returns `Vec<NodeTemplate>` instead of `Vec<SeedSkill>` - Guidance text moves into `markdown_content`; skill metadata moves into `root_properties` (description, tool_whitelist, max_iterations, output_format) - Delete `SeedSkill`, `SeedGuidancePrompt` structs and their impl blocks - Tests updated to use NodeTemplate field access + prepare_nodes_from_template ### packages/agent/src/prompt_assembler.rs - `seed_prompt_nodes()` now returns `Vec<NodeTemplate>` instead of `Vec<SeedPrompt>` - Prompt body text stored in `content` field (overrides title as node content) - `assemble_static()` updated to read priority/template_syntax from root_properties - Delete `SeedPrompt` struct and its `to_node()` impl - Tests updated accordingly ### packages/desktop-app/src-tauri/src/commands/db.rs - Seeding block unified: expands all templates via prepare_nodes_from_template, inserts via seed_nodes_from_templates (single pass, no separate child loop) - Prompt content diff-check preserved using template.content field ### packages/agent/tests/ollama_integration.rs - tools_for_skill() and build_schema_creation_prompt() updated to use NodeTemplate field access (.title, .root_properties, .markdown_content) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]> * Address review: fix stale comment, improve docs, add template unit tests - Fix stale comment "all 7 skills" → "all 8 skills" in skill_pipeline.rs tests - Fix misleading comment in db.rs: clarify only prompt roots are diff-checked after seed, skill guidance children are intentionally user-editable - Update NodeTemplate doc example to include `content: None` for skill pattern and add second example showing `content: Some(...)` for prompt pattern - Add 7 unit tests for `prepare_nodes_from_template` in markdown_test.rs covering: no-child skill, guidance children, child_properties merge, prompt content override, title fallback, property replacement, root_properties Co-Authored-By: Claude Sonnet 4.6 <[email protected]> --------- Co-authored-by: Michael Libio <[email protected]> Co-authored-by: Claude <[email protected]>
…ompilation (#1100) - Merge split doc comment on ensure_model_ready so rustdoc sees a single block - Add clarifying comment on explicit drop(guard) explaining lock ordering - Extract build_noop_service() helper to deduplicate no-op construction - Add doc comment on test explaining runtime difference from production path - Fix agent_e2e skill pipeline tests: update NodeTemplate API (name→title, to_node()→prepare_nodes_from_template, extract whitelist/iterations from root_properties) after #1096 refactored NodeTemplate struct Co-authored-by: Claude <[email protected]>
…ompilation (#1103) - Merge split doc comment on ensure_model_ready so rustdoc sees a single block - Add clarifying comment on explicit drop(guard) explaining lock ordering - Extract build_noop_service() helper to deduplicate no-op construction - Add doc comment on test explaining runtime difference from production path - Fix agent_e2e skill pipeline tests: update NodeTemplate API (name→title, to_node()→prepare_nodes_from_template, extract whitelist/iterations from root_properties) after #1096 refactored NodeTemplate struct Co-authored-by: Claude <[email protected]>
- Add additionalProperties hint to property_filters schema in def_search_semantic (guides LLM to generate string-valued objects) - Add reverse parity check to search_semantic_schema_parity_with_params test (bidirectional guard against drift) - Add doc comments to tmpl_* helper functions in agent_e2e.rs explaining they are adapters for NodeTemplate API change in #1096 Co-authored-by: Claude <[email protected]>
Closes #1056