Skip to content

Add progressive-disclosure build123d skill layer#18

Merged
SmartAI merged 4 commits into
mainfrom
build123d-skill-set
Jul 12, 2026
Merged

Add progressive-disclosure build123d skill layer#18
SmartAI merged 4 commits into
mainfrom
build123d-skill-set

Conversation

@SmartAI

@SmartAI SmartAI commented Jul 12, 2026

Copy link
Copy Markdown
Owner

What this does

Adds a progressive-disclosure skill layer that teaches the agent build123d modeling technique beyond what doc search can provide, plus the ablation framework to measure it.

Three tiers of disclosure:

  1. Catalog (always on): the system prompt carries an agentskills.io-format skill list (name + description + location), generated with pi-agent-core's formatSkillsForSystemPrompt, plus the core invariant summary.
  2. Skill body (pulled): a new load_skill(name) tool returns the full SKILL.md, wrapped in pi's formatSkillInvocation block.
  3. Resources (pulled deeper): load_skill(name, resource) returns files the skill references by relative path (e.g. a diagnostic probe script).

Mechanism

  • Skills live in packages/client/src/agent/skills/<name>/SKILL.md (pi/agentskills.io frontmatter convention) with snippets/*.py, bundled via import.meta.glob + ?raw. {{snippet:...}} markers interpolate snippet files into the body, so every inline code example is the exact bytes that py-tests/test_skill_snippets.py executes against real build123d.
  • Loads are pinned for the whole conversation: repeats dedupe into a one-line notice, and loads that fall behind the compaction boundary are re-injected after the summary from the bundled registry (byte-stable for the prompt cache), so the compaction cut stays free to move past them.
  • Deterministic verify-gate nudge: the second same-pattern failure in a turn appends one Skill hint: load_skill("...") line to the failing run result; suppressed once loaded, silent for unmapped failures.
  • Ablation treatments are now none / core / catalog (default) / full, where full inlines every skill body as the preloaded upper bound that the pull-based catalog arm is measured against. The eval runner accepts the new conditions and hashes the whole skills tree.

Seed skill

sweep-and-loft: profile framing (Plane(origin=path @ 0, z_dir=path % 0)), bend-radius and path-connectivity invariants, loft section ordering, failure signatures, and three executable snippets (sweep recipe, loft recipe, diagnostic probe resource). The remaining five planned skills land in a follow-up PR.

Fixes along the way

Validation

  • npm run typecheck, npm test (399 tests), npm run build green.
  • py-tests/ (148 tests) green, including the new snippet suite that executes all three skill snippets against real build123d 0.11.1.
  • New e2e/skill-loop.spec.ts (fake LLM): load -> resource fetch -> dedupe notice, asserted on the persisted transcript.
  • Full fake-LLM e2e suite green locally (CI does not run e2e).

Human validation

A live smoke session (real LLM, sweep-heavy prompt) is the next step after merge to confirm the agent voluntarily loads from the catalog; the full ablation matrix (4 conditions x N trials) runs after that via packages/client/eval/run-build123d-ablation.mjs.

🤖 Generated with Claude Code

SmartAI added 4 commits July 12, 2026 00:25
Skills live as skills/<name>/SKILL.md (pi/agentskills.io convention) with
executable snippets, bundled into the client via raw glob imports. The
system prompt carries only the catalog (pi formatSkillsForSystemPrompt);
a new load_skill(name, resource?) tool pulls full bodies and referenced
resource files on demand. Loads dedupe against the transcript and stay
pinned across compaction by re-injection after the summary, keeping the
compaction cut free to move. A deterministic verify-gate nudge points at
the mapped skill on the second matching failure of a turn.

Ablation treatments become none/core/catalog/full, with catalog the
default and full (all bodies inlined) the preloaded upper bound. The
sweep-and-loft seed skill ships with three snippets executed against
real build123d by py-tests/test_skill_snippets.py.

Also fixes the fake LLM title branch, which matched any system prompt
containing the substring "title" and hijacked every e2e scenario once
the prompt gained the phrase "titled results".
TypeBox Type.Tuple emits draft-07 tuple syntax (items as an array plus
additionalItems), which the Anthropic API now rejects with "input_schema:
JSON schema is invalid. It must match JSON Schema draft 2020-12". That
made every live update_plan-bearing request fail with a 400. Replace the
tuples with fixed-length homogeneous arrays, which validate identically
for these coordinate and range fields.

Caught by the live smoke session for the skill layer; the fake LLM never
validates schemas, so no scripted test could see it.
@SmartAI SmartAI merged commit dcd1989 into main Jul 12, 2026
1 check passed
@SmartAI SmartAI deleted the build123d-skill-set branch July 12, 2026 08:40
SmartAI added a commit that referenced this pull request Jul 12, 2026
Pure content on the #18 mechanism: placement-and-frames,
booleans-and-features, selectors-and-patterns, holes-and-threads, and
surgical-edits, each with the fixed template and executable snippets.
All snippets run against real build123d in py-tests, asserting volume
deltas, solid counts, and topology, including a measurable demo of the
Hole-drills-both-directions gotcha and a surgical edit whose collateral
alarms are the assertions.

The verify-gate nudge table gains four conservative mappings (first
match wins); surgical-edits stays unmapped because a regression is not
recognizable from a single failure text.
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.

1 participant