Files
make-cad/test/test_drawing_skill_integration.py
T
NiJingzhe 0b95ad0765 skill: a router with read sets, unattended as a mode, pages that load in one batch
The skill entry is rebuilt around how an agent reads: SKILL.md is a 94-line router whose route
table gives the batch to read for each workflow; the first batch is 488-881 compiled lines
(was a median of 1,493). Long workflows are split into role pages (single-part 1157 -> outline
+ role pages, drawing-reconstruction 586 -> outline + stage pages); ql-playbook and
notebook-runtime are split by job. Every workflow has Read now / Read when / Unattended mode,
and discipline/operating-modes.md says what replaces each gate when nobody can answer.
New: scan-reconstruction workflow, core-rules.md (rule IDs), parallel-read blocks for
claudecode, zcode, opencode and codex.

docs/skill-design.md is the contract; skillbuild --check enforces it (src/simplecadapi/skill/lint.py,
opt in through [lint] in skillproj.toml).

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-01 01:18:39 +08:00

42 lines
1.8 KiB
Python

"""The drawing workflow and exact API pages ship for every dev skill target."""
from dataclasses import replace
from pathlib import Path
import pytest
from simplecadapi.inspect import drawing
from test_skill_build import skillbuild
ROOT = Path(__file__).resolve().parents[1]
PROJECT = skillbuild.load_project(ROOT)
@pytest.mark.parametrize("target", PROJECT.targets)
def test_drawing_workflow_is_complete_in_each_host_build(target, tmp_path):
sources = skillbuild.collect_source_files(
PROJECT.source, frozenset(PROJECT.targets), PROJECT.root
)
project = replace(
PROJECT,
root=tmp_path,
outputs={name: tmp_path / name for name in PROJECT.targets},
)
output = skillbuild.build_target(project, sources, target)
router = (output / "SKILL.md").read_text(encoding="utf-8")
assert "references/workflows/drawing-reconstruction.md" in router
assert "references/domains/addon-development.md" in router
# the workflow is an outline plus one page per stage (docs/skill-design.md)
pages = [output / "references/workflows/drawing-reconstruction.md"]
pages += sorted((output / "references/workflows/drawing-reconstruction").glob("*.md"))
pages += [output / "references/domains/drawing-inspection-evidence.md"]
workflow = "\n".join(page.read_text(encoding="utf-8") for page in pages)
assert "section_checks" in workflow and "measurement_contract" in workflow
assert "Host binding:" in workflow
assert "<!-- skill:" not in workflow
assert (output / "references/domains/drawing-inspection.md").is_file()
for name in drawing.__all__:
page = output / "references/docs/api" / f"{name}.md"
assert page.is_file(), f"{target}: missing {name} API page"
assert "drawing-inspection namespace" in page.read_text(encoding="utf-8")