@christang/keel 5.201.0 → 5.202.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude-plugin/plugin.json +1 -1
- package/README.md +6 -10
- package/README.zh-CN.md +6 -10
- package/assets/bootstrap/AGENTS.md +1 -1
- package/assets/openspec/schemas/keel-spec-driven/schema.yaml +2 -2
- package/bin/keel.js +14 -15
- package/npm-shrinkwrap.json +2 -2
- package/package.json +1 -1
- package/plugins/keel/.claude-plugin/plugin.json +1 -1
- package/plugins/keel/.codex-plugin/plugin.json +1 -1
- package/plugins/keel/commands/chat.md +17 -0
- package/plugins/keel/commands/context.md +18 -0
- package/plugins/keel/commands/done.md +25 -0
- package/plugins/keel/commands/start.md +23 -0
- package/plugins/keel/skills/{keel-align-expectations → align-expectations}/SKILL.md +4 -3
- package/plugins/keel/skills/{keel-debug-failure → debug-failure}/SKILL.md +3 -2
- package/plugins/keel/skills/{keel-handoff → handoff}/SKILL.md +3 -2
- package/plugins/keel/skills/{keel-review-checklist → review-checklist}/SKILL.md +3 -2
- package/plugins/keel/skills/{keel-review-checklist → review-checklist}/conditional-checks.md +1 -1
- package/plugins/keel/skills/{keel-tdd-or-test-first → tdd-or-test-first}/SKILL.md +3 -2
- package/plugins/keel/skills/{keel-tdd-or-test-first → tdd-or-test-first}/guidance.md +1 -1
- package/scripts/install_to_repo.py +1 -1
- package/scripts/validation/baseline.py +5 -7
- package/scripts/validation/chat.py +1 -1
- package/scripts/validation/common.py +31 -10
- package/scripts/validation/contract.py +22 -21
- package/scripts/validation/docs.py +17 -16
- package/scripts/validation/export.py +37 -430
- package/scripts/validation/guard.py +13 -12
- package/scripts/validation/hosts.py +110 -9
- package/scripts/validation/install.py +14 -13
- package/scripts/validation/registry.py +2 -4
- package/scripts/validation/selfcheck.py +4 -4
- package/src/core/gates.js +1 -1
- package/plugins/keel/skills/keel-md-docx/SKILL.md +0 -51
- package/plugins/keel/skills/keel-md-docx/scripts/fonts-macos.conf +0 -10
- package/plugins/keel/skills/keel-md-docx/scripts/md2word.py +0 -359
- package/plugins/keel/skills/keel-md-docx/scripts/package.json +0 -8
- package/plugins/keel/skills/keel-md-docx/scripts/requirements.txt +0 -3
- package/plugins/keel/skills/keel-md-docx/scripts/runtime.mjs +0 -31
- package/src/core/docx.js +0 -211
|
@@ -22,6 +22,7 @@ from concurrent.futures import ThreadPoolExecutor, as_completed
|
|
|
22
22
|
from pathlib import Path
|
|
23
23
|
|
|
24
24
|
from validation.common import (
|
|
25
|
+
portable_projection_bytes,
|
|
25
26
|
HANDOFF_STUB,
|
|
26
27
|
OPENSPEC_CONFIG_PATH,
|
|
27
28
|
OPENSPEC_SURFACE_OVERLAY_START,
|
|
@@ -793,15 +794,115 @@ def validate_runtime_versions_are_checked_scenario() -> int:
|
|
|
793
794
|
|
|
794
795
|
|
|
795
796
|
PLUGIN_SKILLS = (
|
|
796
|
-
"
|
|
797
|
-
"
|
|
798
|
-
"
|
|
799
|
-
"
|
|
800
|
-
"
|
|
801
|
-
"keel-tdd-or-test-first",
|
|
797
|
+
"align-expectations",
|
|
798
|
+
"debug-failure",
|
|
799
|
+
"handoff",
|
|
800
|
+
"review-checklist",
|
|
801
|
+
"tdd-or-test-first",
|
|
802
802
|
)
|
|
803
803
|
|
|
804
804
|
|
|
805
|
+
SLASH_SKILLS = ("align-expectations", "debug-failure", "handoff", "review-checklist", "tdd-or-test-first")
|
|
806
|
+
MODEL_ONLY_SKILLS = ("debug-failure", "review-checklist", "tdd-or-test-first")
|
|
807
|
+
|
|
808
|
+
|
|
809
|
+
def skill_frontmatter(path: Path) -> dict[str, str]:
|
|
810
|
+
text = path.read_text(encoding="utf-8")
|
|
811
|
+
match = re.match(r"---\n(.*?)\n---\n", text, re.S)
|
|
812
|
+
fields: dict[str, str] = {}
|
|
813
|
+
for line in (match.group(1).splitlines() if match else []):
|
|
814
|
+
key, _, value = line.partition(":")
|
|
815
|
+
if key and not key.startswith(" "):
|
|
816
|
+
fields[key.strip()] = value.strip().strip('"')
|
|
817
|
+
return fields
|
|
818
|
+
|
|
819
|
+
|
|
820
|
+
def validate_slash_menu_ships_scenario() -> int:
|
|
821
|
+
"""Issue #464 (owner, 2026-10-25): the slash menu offers what a person runs.
|
|
822
|
+
|
|
823
|
+
Every skill read as `/keel:keel-<name>`, and the three the protocol has the
|
|
824
|
+
model run at fixed points sat in the menu beside the two a person may want.
|
|
825
|
+
The skills drop the repeated prefix; the model-only ones declare
|
|
826
|
+
`user-invocable: false`; the others declare an `argument-hint`; and no
|
|
827
|
+
shipped file still names a skill the old way.
|
|
828
|
+
"""
|
|
829
|
+
label = "slash-menu-ships:"
|
|
830
|
+
skills_root = ROOT / PLUGIN_ROOT / "skills"
|
|
831
|
+
found = sorted(entry.name for entry in skills_root.iterdir() if entry.is_dir())
|
|
832
|
+
if found != sorted(SLASH_SKILLS):
|
|
833
|
+
report(f"{label} the plugin's skills are {found!r}, not {sorted(SLASH_SKILLS)!r}.")
|
|
834
|
+
return 1
|
|
835
|
+
for name in SLASH_SKILLS:
|
|
836
|
+
fields = skill_frontmatter(skills_root / name / "SKILL.md")
|
|
837
|
+
if fields.get("name") != name:
|
|
838
|
+
report(f"{label} {name}/SKILL.md names itself {fields.get('name')!r}.")
|
|
839
|
+
return 1
|
|
840
|
+
hidden = fields.get("user-invocable") == "false"
|
|
841
|
+
if name in MODEL_ONLY_SKILLS and not hidden:
|
|
842
|
+
report(f"{label} {name} is the model's, yet does not declare `user-invocable: false`.")
|
|
843
|
+
return 1
|
|
844
|
+
if name not in MODEL_ONLY_SKILLS and hidden:
|
|
845
|
+
report(f"{label} {name} is a person's, yet declares `user-invocable: false`.")
|
|
846
|
+
return 1
|
|
847
|
+
if name not in MODEL_ONLY_SKILLS and not fields.get("argument-hint"):
|
|
848
|
+
report(f"{label} {name} stays in the menu without an `argument-hint`.")
|
|
849
|
+
return 1
|
|
850
|
+
# The old names, built here so this file does not name them itself. An
|
|
851
|
+
# archived evidence file keeps its name (`…-v1.md`), as does the
|
|
852
|
+
# `keel-handoff/v1` format.
|
|
853
|
+
prefix = "keel" + "-"
|
|
854
|
+
old = re.compile(re.escape(prefix) + r"(?:" + "|".join(re.escape(n) for n in SLASH_SKILLS if n != "handoff") + r")\b(?!-v\d)|"
|
|
855
|
+
+ re.escape(prefix) + r"handoff(?!/v1)(?!-)")
|
|
856
|
+
tracked = subprocess.run(["git", "ls-files", "-z"], cwd=ROOT, text=True, capture_output=True, check=True).stdout.split("\0")
|
|
857
|
+
stale = []
|
|
858
|
+
for relative in tracked:
|
|
859
|
+
if not relative or relative == "keel/CHANGELOG.md" or relative.startswith(("openspec/specs/", "openspec/changes/", "keel/archive/")):
|
|
860
|
+
continue
|
|
861
|
+
path = ROOT / relative
|
|
862
|
+
if not path.is_file():
|
|
863
|
+
continue
|
|
864
|
+
try:
|
|
865
|
+
if old.search(path.read_text(encoding="utf-8")):
|
|
866
|
+
stale.append(relative)
|
|
867
|
+
except UnicodeDecodeError:
|
|
868
|
+
continue
|
|
869
|
+
if stale:
|
|
870
|
+
report(f"{label} these files still name a skill the old way: {stale!r}")
|
|
871
|
+
return 1
|
|
872
|
+
# The four everyday flows a person runs, each naming the keel command it orders.
|
|
873
|
+
commands_root = ROOT / PLUGIN_ROOT / "commands"
|
|
874
|
+
commands = sorted(path.stem for path in commands_root.glob("*.md"))
|
|
875
|
+
expected = {"context": "keel context", "start": "keel gate task-start", "done": "keel gate task-complete", "chat": "keel chat unread"}
|
|
876
|
+
if commands != sorted([*expected, "shift"]):
|
|
877
|
+
report(f"{label} the plugin's commands are {commands!r}, not {sorted([*expected, 'shift'])!r}.")
|
|
878
|
+
return 1
|
|
879
|
+
for name, command in expected.items():
|
|
880
|
+
if command not in (commands_root / f"{name}.md").read_text(encoding="utf-8"):
|
|
881
|
+
report(f"{label} commands/{name}.md does not name `{command}`.")
|
|
882
|
+
return 1
|
|
883
|
+
invocable = [*sorted([*expected, "shift"]), *(name for name in SLASH_SKILLS if name not in MODEL_ONLY_SKILLS)]
|
|
884
|
+
for doc in ("docs/commands.md", "docs/commands.zh-CN.md"):
|
|
885
|
+
path = ROOT / doc
|
|
886
|
+
if not path.is_file():
|
|
887
|
+
report(f"{label} {doc} does not exist.")
|
|
888
|
+
return 1
|
|
889
|
+
missing = [name for name in invocable if f"/keel:{name}" not in path.read_text(encoding="utf-8")]
|
|
890
|
+
if missing:
|
|
891
|
+
report(f"{label} {doc} does not list {', '.join(f'/keel:{name}' for name in missing)}.")
|
|
892
|
+
return 1
|
|
893
|
+
claude = shutil.which("claude")
|
|
894
|
+
if claude:
|
|
895
|
+
validated = subprocess.run([claude, "plugin", "validate", str(ROOT / PLUGIN_ROOT)], text=True, capture_output=True, timeout=120)
|
|
896
|
+
if validated.returncode != 0:
|
|
897
|
+
report(f"{label} `claude plugin validate` failed: {(validated.stdout + validated.stderr).strip()[-400:]}")
|
|
898
|
+
return 1
|
|
899
|
+
if "slash-menu-ships" not in {name for name, _ in registry.SCENARIOS}:
|
|
900
|
+
report(f"{label} scenario is not registered.")
|
|
901
|
+
return 1
|
|
902
|
+
report("slash-menu-ships scenario passed.")
|
|
903
|
+
return 0
|
|
904
|
+
|
|
905
|
+
|
|
805
906
|
def strict_semver(version: str) -> bool:
|
|
806
907
|
return bool(re.fullmatch(r"\d+\.\d+\.\d+(?:-[0-9A-Za-z.-]+)?", version or ""))
|
|
807
908
|
|
|
@@ -885,7 +986,7 @@ def validate_native_plugin_manifests_scenario() -> int:
|
|
|
885
986
|
report(f"native-plugin-manifests plugin copy of {skill_name} has {extra}, which the source does not")
|
|
886
987
|
return 1
|
|
887
988
|
for name in canonical_files:
|
|
888
|
-
if (plugin_dir / name)
|
|
989
|
+
if portable_projection_bytes(plugin_dir / name) != (canonical_dir / name).read_bytes():
|
|
889
990
|
report(f"native-plugin-manifests plugin copy diverges from canonical source: {skill_name}/{name}")
|
|
890
991
|
return 1
|
|
891
992
|
lenses_root = ROOT / "assets/lenses"
|
|
@@ -4353,8 +4454,8 @@ def validate_native_plugin_marketplaces_scenario() -> int:
|
|
|
4353
4454
|
missing = [
|
|
4354
4455
|
needle
|
|
4355
4456
|
for needle in (
|
|
4356
|
-
"
|
|
4357
|
-
"
|
|
4457
|
+
"align-expectations",
|
|
4458
|
+
"review-checklist",
|
|
4358
4459
|
"SessionStart",
|
|
4359
4460
|
"PreToolUse",
|
|
4360
4461
|
)
|
|
@@ -22,6 +22,7 @@ from concurrent.futures import ThreadPoolExecutor, as_completed
|
|
|
22
22
|
from pathlib import Path
|
|
23
23
|
|
|
24
24
|
from validation.common import (
|
|
25
|
+
portable_projection_bytes,
|
|
25
26
|
BOOTSTRAP_BLOCK_BYTE_BUDGET,
|
|
26
27
|
LEGACY_PROFILE_SKILLS,
|
|
27
28
|
MANAGED_END,
|
|
@@ -302,7 +303,7 @@ def validate_target_surface_scenario() -> int:
|
|
|
302
303
|
|
|
303
304
|
def validate_domain_lenses_scenario() -> int:
|
|
304
305
|
plugin_skills_root = ROOT / PLUGIN_ROOT / "skills"
|
|
305
|
-
if not (plugin_skills_root / "
|
|
306
|
+
if not (plugin_skills_root / "align-expectations/SKILL.md").is_file():
|
|
306
307
|
report("domain-lenses scenario plugin misses the alignment skill")
|
|
307
308
|
return 1
|
|
308
309
|
lenses_root = ROOT / "assets/lenses"
|
|
@@ -459,7 +460,7 @@ def assert_openspec_overlay(path: Path, action: str) -> str | None:
|
|
|
459
460
|
required.extend(
|
|
460
461
|
[
|
|
461
462
|
"keel gate change-close --action archive",
|
|
462
|
-
"
|
|
463
|
+
"review-checklist",
|
|
463
464
|
"critical expectation",
|
|
464
465
|
"behavior evidence",
|
|
465
466
|
"durable follow-up owner",
|
|
@@ -745,7 +746,7 @@ def validate_sync_surface_overlay_scenario() -> int:
|
|
|
745
746
|
"""The surface that performs a gated action never named its gate.
|
|
746
747
|
|
|
747
748
|
AGENTS.md gates sync and archive identically — `keel gate change-close
|
|
748
|
-
--action sync|archive` plus `
|
|
749
|
+
--action sync|archive` plus `review-checklist`. Archive's command
|
|
749
750
|
surface carries a Keel overlay saying so; sync's carried none, because
|
|
750
751
|
`OPENSPEC_OVERLAY_ACTIONS` listed only propose, apply, and archive. An
|
|
751
752
|
agent invoking `/opsx:sync` read generic upstream instructions and was told
|
|
@@ -800,7 +801,7 @@ def validate_sync_surface_overlay_scenario() -> int:
|
|
|
800
801
|
# M2 — and it says the things that change behavior.
|
|
801
802
|
for needle, why in (
|
|
802
803
|
("keel gate change-close --action sync", "the gate"),
|
|
803
|
-
("
|
|
804
|
+
("review-checklist", "the semantic review"),
|
|
804
805
|
("keel openspec", "how to invoke OpenSpec off PATH"),
|
|
805
806
|
("--skip-specs", "that a following archive must skip specs"),
|
|
806
807
|
):
|
|
@@ -1435,10 +1436,10 @@ def validate_uninstall_scenario() -> int:
|
|
|
1435
1436
|
if not (repo / "keel/templates/TASK.lite.md").is_file():
|
|
1436
1437
|
report("uninstall scenario deleted user-edited Lite TASK template.")
|
|
1437
1438
|
return 1
|
|
1438
|
-
if (repo / ".claude/skills/
|
|
1439
|
+
if (repo / ".claude/skills/handoff/SKILL.md").exists():
|
|
1439
1440
|
report("uninstall scenario did not remove packaged Claude skill.")
|
|
1440
1441
|
return 1
|
|
1441
|
-
if (repo / ".claude/skills/
|
|
1442
|
+
if (repo / ".claude/skills/review-checklist/SKILL.md").exists():
|
|
1442
1443
|
report("uninstall scenario did not remove packaged Claude review skill.")
|
|
1443
1444
|
return 1
|
|
1444
1445
|
if not (repo / OPENSPEC_CONFIG_PATH).is_file():
|
|
@@ -2938,10 +2939,10 @@ def validate_thin_native_install_scenario() -> int:
|
|
|
2938
2939
|
tmp = Path(raw_tmp)
|
|
2939
2940
|
|
|
2940
2941
|
forbidden_copies = (
|
|
2941
|
-
".claude/skills/
|
|
2942
|
-
".claude/skills/
|
|
2942
|
+
".claude/skills/review-checklist",
|
|
2943
|
+
".claude/skills/align-expectations",
|
|
2943
2944
|
".claude/hooks/keel-gate",
|
|
2944
|
-
".agents/skills/
|
|
2945
|
+
".agents/skills/review-checklist",
|
|
2945
2946
|
"keel/adapters",
|
|
2946
2947
|
)
|
|
2947
2948
|
|
|
@@ -3163,9 +3164,9 @@ def validate_thin_native_install_scenario() -> int:
|
|
|
3163
3164
|
|
|
3164
3165
|
def validate_domain_execution_references_scenario() -> int:
|
|
3165
3166
|
consuming_skills = (
|
|
3166
|
-
"
|
|
3167
|
-
"
|
|
3168
|
-
"
|
|
3167
|
+
"tdd-or-test-first",
|
|
3168
|
+
"debug-failure",
|
|
3169
|
+
"review-checklist",
|
|
3169
3170
|
)
|
|
3170
3171
|
templates = ("web.md", "hardware.md", "hardware-dsl.md")
|
|
3171
3172
|
roots = (ROOT / "src/skills", ROOT / PLUGIN_ROOT / "skills")
|
|
@@ -3219,7 +3220,7 @@ def validate_domain_execution_references_scenario() -> int:
|
|
|
3219
3220
|
|
|
3220
3221
|
for skill in consuming_skills:
|
|
3221
3222
|
src_text = (roots[0] / skill / "SKILL.md").read_bytes()
|
|
3222
|
-
shipped_text = (roots[1] / skill / "SKILL.md")
|
|
3223
|
+
shipped_text = portable_projection_bytes(roots[1] / skill / "SKILL.md")
|
|
3223
3224
|
if src_text != shipped_text:
|
|
3224
3225
|
report(
|
|
3225
3226
|
f"domain-execution-references: shipped {skill} copy diverges "
|
|
@@ -388,6 +388,7 @@ SCENARIOS: tuple = (
|
|
|
388
388
|
),
|
|
389
389
|
("authoring-alignment-overlay", contract.validate_authoring_alignment_overlay_scenario),
|
|
390
390
|
("native-plugin-manifests", hosts.validate_native_plugin_manifests_scenario),
|
|
391
|
+
("slash-menu-ships", hosts.validate_slash_menu_ships_scenario),
|
|
391
392
|
("native-plugin-session-start", hosts.validate_native_plugin_session_start_scenario),
|
|
392
393
|
("runtime-version-drift", hosts.validate_runtime_version_drift_scenario),
|
|
393
394
|
("session-start-source-repo-protocol", hosts.validate_session_start_source_repo_protocol_scenario),
|
|
@@ -660,8 +661,5 @@ SCENARIOS: tuple = (
|
|
|
660
661
|
"a-count-is-derived-from-what-it-counts",
|
|
661
662
|
docs.validate_a_count_is_derived_from_what_it_counts_scenario,
|
|
662
663
|
),
|
|
663
|
-
("docx-
|
|
664
|
-
("docx-setup-asks-first", export.validate_docx_setup_asks_first_scenario),
|
|
665
|
-
("docx-convert-refuses-first", export.validate_docx_convert_refuses_first_scenario),
|
|
666
|
-
("docx-converts-markdown-with-svg", export.validate_docx_converts_markdown_with_svg_scenario),
|
|
664
|
+
("docx-retired", export.validate_docx_retired_scenario),
|
|
667
665
|
)
|
|
@@ -470,7 +470,7 @@ def validate_resident_topic_matching_scenario() -> int:
|
|
|
470
470
|
|
|
471
471
|
# The one-message-many-failures shape, counted rather than forbidden.
|
|
472
472
|
#
|
|
473
|
-
# Issue #43 records it caught by `
|
|
473
|
+
# Issue #43 records it caught by `review-checklist` in three consecutive
|
|
474
474
|
# changes, every time in this file: `if <the run did not work> or <the output
|
|
475
475
|
# lacks a specific thing>:` followed by one `report(...)` describing only the
|
|
476
476
|
# second operand. When the first fires the sentence is false, and it sends the
|
|
@@ -479,7 +479,7 @@ def validate_resident_topic_matching_scenario() -> int:
|
|
|
479
479
|
# This number bounds a SHAPE. It is not a count of defects: many of the sites
|
|
480
480
|
# it counts carry a message that genuinely covers every operand, and deciding
|
|
481
481
|
# whether a particular sentence misleads needs a model, so that judgment stays
|
|
482
|
-
# in `
|
|
482
|
+
# in `review-checklist`. What the number does is make a *new* one visible
|
|
483
483
|
# when it is written, which is earlier than a review that only runs at a
|
|
484
484
|
# completion gate.
|
|
485
485
|
#
|
|
@@ -630,7 +630,7 @@ def probe():
|
|
|
630
630
|
def validate_assertion_shape_count_scenario() -> int:
|
|
631
631
|
"""Issue #43: one condition guarding two failures, caught three times.
|
|
632
632
|
|
|
633
|
-
`
|
|
633
|
+
`review-checklist` catches it, but only at a completion gate and only
|
|
634
634
|
because a human wrote a checklist entry pointing the model at it. This
|
|
635
635
|
counts the shape so a new one is visible when it is written.
|
|
636
636
|
"""
|
|
@@ -1170,7 +1170,7 @@ def validate_authored_scenario_names_scenario() -> int:
|
|
|
1170
1170
|
"--scenario gate-diagnostics` passes\n"
|
|
1171
1171
|
" - M2 (regression): `core-gates` and `target-surface-doctor` stay "
|
|
1172
1172
|
"green\n"
|
|
1173
|
-
" - M3 (regression): `task-start`, `
|
|
1173
|
+
" - M3 (regression): `task-start`, `review-checklist`, "
|
|
1174
1174
|
"`contract-drift`, `subagent-stop`, and `keel-task-capsule` are "
|
|
1175
1175
|
"unchanged\n"
|
|
1176
1176
|
" - M4: `cli` and "
|
package/src/core/gates.js
CHANGED
|
@@ -1023,7 +1023,7 @@ function transientOwnerMessage(candidate) {
|
|
|
1023
1023
|
// A finding has three dispositions and the gate recognized two. One found and
|
|
1024
1024
|
// fixed inside the task recording it has no owner to name and nothing to
|
|
1025
1025
|
// discard, so the only text that passed was `Discard reason:` — filing a repair
|
|
1026
|
-
// as a dismissal. This capability and `
|
|
1026
|
+
// as a dismissal. This capability and `review-checklist` both already
|
|
1027
1027
|
// scoped the ownership requirement to an *unresolved* finding; only the
|
|
1028
1028
|
// implementation applied it to all of them. `## Invalidates` has carried the
|
|
1029
1029
|
// same third slot since it shipped, where `Updated by:` names tasks of this
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: keel-md-docx
|
|
3
|
-
description: Export a local Markdown file that contains SVG diagrams to one Word (.docx) document, keeping the SVG as vector images with PNG fallbacks. Use when the user asks to export, convert, or deliver Markdown with SVG as Word or .docx. Do not use for other document formats, for Markdown without a Word request, or for editing an existing Word file.
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
# keel-md-docx
|
|
7
|
-
|
|
8
|
-
## Purpose
|
|
9
|
-
|
|
10
|
-
Turn one local Markdown file into one `.docx`: headings, paragraphs, inline formatting, lists, quotes, code blocks, and tables stay editable; every SVG becomes a vector image with an embedded PNG fallback, scaled to fit the page; every image ends up inside the document. The converter is `scripts/md2word.py` with the helper `scripts/runtime.mjs`, run by `keel docx convert` in an environment Keel manages. Nothing here runs unless the user asks for this export.
|
|
11
|
-
|
|
12
|
-
## Steps
|
|
13
|
-
|
|
14
|
-
1. **Check the environment.** Run `keel docx setup`. Without `--yes` it installs nothing: it prints each package, its licence and size, and where the environment would go (`~/.keel/docx/`, or `$KEEL_HOME/docx/`). If it reports the environment ready, go to step 3.
|
|
15
|
-
2. **Ask before installing.** Show the user that list in plain terms and ask whether to install. Only after they agree, run `keel docx setup --yes`. It installs into the Keel-managed environment, never into system Python or Node, and downloads no fonts or runtimes. If the user declines, stop and say the export needs it.
|
|
16
|
-
3. **State the output path.** Tell the user where the document will be written: by default the input's name with `.docx`, or the path they gave. If a file is already there, ask whether to replace it; `keel docx convert` refuses an existing output unless `--replace` is given.
|
|
17
|
-
4. **Convert.** Run `keel docx convert <input.md> [-o <output.docx>] [--template <template.docx>] [--replace]`. A template contributes its styles, headers, and page settings; its body is discarded.
|
|
18
|
-
5. **Report the result.** Relay the output path and image count on success, and every `Warning:` line. On failure relay the `Conversion failed:` reason; the previous output, if any, is untouched.
|
|
19
|
-
|
|
20
|
-
## What converts
|
|
21
|
-
|
|
22
|
-
- A standalone `<svg>…</svg>` block, a fenced code block labelled `svg`, and image references to local `.svg` files, resolved relative to the Markdown file. SVG inside ordinary code stays code.
|
|
23
|
-
- Local raster images (PNG, JPEG) and `data:` URIs.
|
|
24
|
-
- Headings, paragraphs, bold, italic, strikethrough, links, lists, quotes, code blocks, and tables.
|
|
25
|
-
|
|
26
|
-
## Limits
|
|
27
|
-
|
|
28
|
-
- An SVG stays an image; it is not split into editable Word shapes.
|
|
29
|
-
- `foreignObject`, scripts, external fonts, external images, and external stylesheets inside an SVG fail the conversion with the reason; use SVG `text` and `path`, and embed bitmaps as `data:` URIs.
|
|
30
|
-
- A remote image fails the conversion: save it locally first. Nothing is downloaded during conversion.
|
|
31
|
-
- Mermaid, math, footnotes, a table of contents, internal bookmark links, and HTML/CSS page layout are not converted. Lists use explicit numbers and bullets, not Word numbering. A tall diagram is scaled down rather than split across pages; a wide table may need a template or a landscape page.
|
|
32
|
-
- Inline HTML styling is dropped with a warning; an unsupported Markdown block stops the conversion.
|
|
33
|
-
- The default page is A4 with 2 cm margins, Arial with Heiti SC for Chinese. On macOS Keel points the SVG renderer at the system font folders for this process only; on other systems install the fonts the document needs or supply a template.
|
|
34
|
-
|
|
35
|
-
## Dependencies
|
|
36
|
-
|
|
37
|
-
Installed only by `keel docx setup --yes`, into `~/.keel/docx/` (`python/` is a virtual environment, `node/` holds the npm packages). Sizes are from the registries on 2026-10-21 for macOS arm64, not measured from an install.
|
|
38
|
-
|
|
39
|
-
| Package | Version | Licence | Size |
|
|
40
|
-
| --- | --- | --- | --- |
|
|
41
|
-
| python-docx | `>=1.1,<2` (1.2.0) | MIT | 0.25 MB wheel |
|
|
42
|
-
| lxml | `>=5,<7` (6.0.2) | BSD-3-Clause | 8.6 MB wheel |
|
|
43
|
-
| Pillow | `>=10,<13` (12.0.0) | MIT-CMU | 4.65 MB wheel |
|
|
44
|
-
| marked | 17.0.5 | MIT | 0.44 MB |
|
|
45
|
-
| sharp | 0.35.5 | Apache-2.0 | 0.96 MB, plus its platform binary (0.29 MB, Apache-2.0) and libvips 1.3.4 (18.2 MB, LGPL-3.0-or-later) |
|
|
46
|
-
|
|
47
|
-
The version lists are `scripts/requirements.txt` and `scripts/package.json`. Python 3.10 or newer and the Node that runs `keel` are used.
|
|
48
|
-
|
|
49
|
-
## Verification status
|
|
50
|
-
|
|
51
|
-
As of the release that added this skill (#405), the setup plan, the consent flow, the refusals, and the hand-off to the converter are tested with stand-in installers. The real conversion, every failure case against real SVG, and the page-by-page rendering of a Chinese mixed-text example are **unverified** in Keel: the converter was verified as the #405 prototype on macOS arm64 only (Python 3.12, marked 17.0.5, sharp 0.35.5), outside Keel. Linux, Windows, Codex, and Microsoft Word itself are unverified.
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
<?xml version="1.0"?>
|
|
2
|
-
<!DOCTYPE fontconfig SYSTEM "urn:fontconfig:fonts.dtd">
|
|
3
|
-
<fontconfig>
|
|
4
|
-
<!-- Only used by this process; makes macOS CJK fonts visible to libvips/LO. -->
|
|
5
|
-
<dir>/System/Library/Fonts</dir>
|
|
6
|
-
<dir>/System/Library/Fonts/Supplemental</dir>
|
|
7
|
-
<dir>/Library/Fonts</dir>
|
|
8
|
-
<cachedir prefix="xdg">fontconfig</cachedir>
|
|
9
|
-
<alias><family>sans-serif</family><prefer><family>Arial</family><family>Heiti SC</family></prefer></alias>
|
|
10
|
-
</fontconfig>
|