Repository navigation
Skill guidance: teach relationship recognition and document decomposition - #2466
Merged
mstomar125 merged 1 commit intoSep 8, 2026
Merged
Conversation
…tion Two of the four skill-guidance defects from real external-agent sessions on a clean install (collections and the JSON property shape were already fixed by prior PRs): - Person/team/entity fields default to text, not a relationship, even when the agent has read the existing (terse) relationship-vs-field rule -- recognizing that a field like "deciders" or "assignee" is a reference is the hard step, and the rule presumed it. Added worked examples and a false-friends list to references/cli.md's schema section, and fixed SKILL.md's own worked example, which declared exactly this kind of field (assignee: text) uncorrected. - A ~40-line document (ADR, spec, plan) gets authored as a single node's content instead of decomposing into a root plus one child per section -- every `node create` example in SKILL.md was a one-liner, so the working template never showed the alternative. Added a decomposition worked example to cli.md and reframed SKILL.md's bulk import section to state the "headings become a tree" rule plainly, applicable to any multi-section content, not only migration. SKILL.md's body was already at ~4992 of its 5000-token budget before this change (from a concurrent PR), leaving near-zero room -- detail for both fixes went into references/cli.md (no cap; the standard's own on-demand tier) instead, with SKILL.md keeping only the minimal worked-example fix and a cross-reference. Verified via `cargo test -p nodespace-cli --test skill_md_generation`, including the body-size-recommendation test, after several rounds of trimming.
Contributor
Author
|
Addressed: this PR is scoped to the markdown skill (cli.md's prose form) consumed by external PTY agents — updated the PR description to state that explicitly. The parallel Other findings from the review were nits (no other blockers). Merging. |
mstomar125
deleted the
issue-2383-skill-relationship-and-document-guidance
branch
September 8, 2026 10:08
28 tasks
mstomar125
added a commit
that referenced
this pull request
Sep 8, 2026
…e summary (#2470) * Accept multiple directories in nodespace import dir, combined into one summary import dir took exactly one directory, forcing a shell loop to import several unrelated folders -- one process, one connection, one result set per directory, with no combined summary. The RPC layer already batches an arbitrary file list into one call; the CLI's own base_directory handling (needed for --auto-collection-routing to stay relative to each directory's own root) is what kept it to one directory at a time. A single directory keeps behaving exactly as before (same code path, unmodified, including a scan failure aborting the whole command). Two or more route through a new aggregating path: each directory is walked and imported against its own base_directory, results combine into one summary, and a per-directory scan or import failure is recorded without stopping the rest. Co-Authored-By: Claude <[email protected]> * Trim SKILL.md wording to stay under the body token budget after rebase Co-Authored-By: Claude <[email protected]> * Restore the exact SKILL.md phrase an agent-side interaction rule requires Trimming for the token budget had reworded "don't follow up with search calls to verify" away, which broke skill_rules::tests::skill_md_still_mentions_every_interaction_rule (bulk-import-no-followup-search's skill_md_key_phrase). Restored the sentence introduced by #2466 verbatim instead of layering more prose on top of an already near-full budget; the multi-directory form is taught by the worked example already in this section plus the dedicated "Import markdown files" section in references/cli.md. Co-Authored-By: Claude <[email protected]> * Fix linting and formatting Co-Authored-By: Claude <[email protected]> * Address review: refuse cross-directory identity collisions, propagate exit failure - Two directories in one `import dir A B` call that each contain a same-named file (e.g. both have a top-level README.md) compute the identical deterministic root id server-side (derived from each file's path relative to that call's own base_directory). Silently proceeding either skips the second file as "already imported" or, with --replace, overwrites the first's content with the second's -- confirmed via a mutation test that reproduces exactly this collision when the new pre-flight check is disabled. Now scans every directory before issuing any RPC and refuses the whole call, loudly, if any two files would collide, so nothing is written rather than something being silently lost or corrupted. - run_multi_dir returned Ok(()) even when every directory failed, breaking the exit-code contract run_one_dir already had (a scan failure there propagates via `?` to a non-zero process exit). Now returns Err when any directory failed, after printing the combined summary/JSON, so a caller checking the exit code notices. - Removed two GitHub issue numbers embedded in doc comments (CLAUDE.md rule). Co-Authored-By: Claude <[email protected]> --------- Co-authored-by: Claude <[email protected]>
5 tasks done
mstomar125
added a commit
that referenced
this pull request
Sep 15, 2026
…les' imperative form (#2467) (#2628) RELATIONSHIP_VS_FIELD's imperative field (read by the in-app local agent via seed_skill_nodes()) still carried only the terse original rule after #2383/#2466 added worked examples and a false-friends list to cli.md's prose form for external PTY agents. The in-app agent got none of that benefit and would still default fields like deciders/assignee to text. Port the same worked-examples + false-friends content into the imperative field, mirroring how GROUPING_IS_COLLECTIONS already keeps both forms in sync. Regenerate the affected prompt-assembly golden (stage2_candidate_block) to match. Co-authored-by: Claude Sonnet 5 <[email protected]>
Closed
5 tasks done
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Addresses 2 of the 4 skill-guidance defects from issue #2383 (real external-agent sessions on a clean install). The other 2 (collections, JSON property shape) were already fixed by prior PRs (#2450, #2423) before this one landed.
references/cli.md's schema section, and fixedSKILL.md's own worked example, which declared exactly this kind of field (assignee: text) uncorrected.contentinstead of a root + one child per section — everynode createexample inSKILL.mdwas a one-liner, so the working template never showed the alternative. Added a decomposition worked example tocli.mdand reframedSKILL.md's bulk-import section.Budget constraint:
SKILL.md's body was already at ~4992 of its 5000-token budget before this change (from a concurrent PR), leaving near-zero room. Detail for both fixes went intoreferences/cli.mdinstead (no cap — the standard's own on-demand tier), withSKILL.mdkeeping only the minimal worked-example fix and a cross-reference.Scope: markdown / external-agent guidance only. This PR touches
packages/skill/SKILL.mdandpackages/skill/references/cli.mdonly — the markdown skill consumed by external PTY agents. It deliberately does NOT touchpackages/agent/src/skill_rules.rs::RELATIONSHIP_VS_FIELD'simperativeform, which is what the in-app local agent reads from its system prompt (seed_skill_nodes()) — that's outside the packages/agent boundary for this change. The in-app local agent does not get the relationship-recognition improvement from this PR. Filed as a fast-follow: #2467.Test plan
cargo test -p nodespace-cli --test skill_md_generation— all 11 tests pass, including the body-size-recommendation test, after several rounds of trimming to fit the budget.bun run skill:check— generated regions untouched (my edits are hand-written prose only), no drift.bun run test:all— no new failures (frontend, skill, full Rust workspace).bun run quality:fix(frontend half) — clean. (Rust half had an unrelated pre-existing baseline break from Remove the per-result work from the search path #2452, since fixed by Fix clippy result_large_err in embeddings_service's search_semantic #2464.)Documentation-only change; no new test files needed beyond the existing
skill_md_generation.rssuite, which already validates the properties relevant here (generation consistency, size budget, reference-file linkage).