diff --git a/.claude/skills/map-efficient/SKILL.md b/.claude/skills/map-efficient/SKILL.md index 9331d20..b986b52 100644 --- a/.claude/skills/map-efficient/SKILL.md +++ b/.claude/skills/map-efficient/SKILL.md @@ -480,16 +480,15 @@ Set final status from verifier and gates: ```bash RUN_HEALTH_STATUS="${RUN_HEALTH_STATUS:?set from final decision}" -python3 .map/scripts/map_step_runner.py write_run_health_report \ - map-efficient \ - "$RUN_HEALTH_STATUS" +python3 .map/scripts/map_step_runner.py write_run_health_report map-efficient "$RUN_HEALTH_STATUS" +python3 .map/scripts/map_step_runner.py write_learning_handoff map-efficient "" "$RUN_HEALTH_STATUS" "Run /map-learn to preserve patterns, then /map-review" "" ``` -This writes `.map//run_health_report.json`, updates `run_health`, and gives reviewers a machine-readable terminal snapshot. +This writes `run_health_report.json` (machine-readable run snapshot) plus `learning-handoff.md`/`.json`, so a later zero-argument `/map-learn` auto-loads this run instead of reconstructing it from memory. ## Step 4: Summary -Report completed subtasks, files changed, checks run, final status, remaining issues, and next command (`/map-review` or the owning fix workflow). +Report completed subtasks, files changed, checks run, final status, remaining issues, and next command (`/map-review`, the owning fix workflow, or optional `/map-learn` to preserve patterns). ## Examples diff --git a/src/mapify_cli/templates/skills/map-efficient/SKILL.md b/src/mapify_cli/templates/skills/map-efficient/SKILL.md index 9331d20..b986b52 100644 --- a/src/mapify_cli/templates/skills/map-efficient/SKILL.md +++ b/src/mapify_cli/templates/skills/map-efficient/SKILL.md @@ -480,16 +480,15 @@ Set final status from verifier and gates: ```bash RUN_HEALTH_STATUS="${RUN_HEALTH_STATUS:?set from final decision}" -python3 .map/scripts/map_step_runner.py write_run_health_report \ - map-efficient \ - "$RUN_HEALTH_STATUS" +python3 .map/scripts/map_step_runner.py write_run_health_report map-efficient "$RUN_HEALTH_STATUS" +python3 .map/scripts/map_step_runner.py write_learning_handoff map-efficient "" "$RUN_HEALTH_STATUS" "Run /map-learn to preserve patterns, then /map-review" "" ``` -This writes `.map//run_health_report.json`, updates `run_health`, and gives reviewers a machine-readable terminal snapshot. +This writes `run_health_report.json` (machine-readable run snapshot) plus `learning-handoff.md`/`.json`, so a later zero-argument `/map-learn` auto-loads this run instead of reconstructing it from memory. ## Step 4: Summary -Report completed subtasks, files changed, checks run, final status, remaining issues, and next command (`/map-review` or the owning fix workflow). +Report completed subtasks, files changed, checks run, final status, remaining issues, and next command (`/map-review`, the owning fix workflow, or optional `/map-learn` to preserve patterns). ## Examples diff --git a/tests/test_skills.py b/tests/test_skills.py index 30fbecb..44856a0 100644 --- a/tests/test_skills.py +++ b/tests/test_skills.py @@ -1161,14 +1161,20 @@ def test_closeout_prompts_write_run_health_report( content = skill_md.read_text(encoding="utf-8") assert "write_run_health_report" in content - expected_invocation = f'''write_run_health_report \\ - {skill_name} \\ - "$RUN_HEALTH_STATUS"''' - assert expected_invocation in content - hardcoded_complete = f"""write_run_health_report \\ - {skill_name} \\ - complete""" - assert hardcoded_complete not in content + # Accept both single-line and backslash-continued invocations (map-efficient + # is line-budget-gated and uses the compact single-line form), but still + # require the status variable rather than a hardcoded literal in either form. + token_gap = r"\s+\\?\s*" + assert re.search( + "write_run_health_report" + token_gap + re.escape(skill_name) + + token_gap + r'"\$RUN_HEALTH_STATUS"', + content, + ), f"{skill_name} must invoke write_run_health_report with $RUN_HEALTH_STATUS" + assert not re.search( + "write_run_health_report" + token_gap + re.escape(skill_name) + + token_gap + r"""["']?(?:complete|pending|blocked|won't_do|superseded)\b""", + content, + ), f"{skill_name} must not hardcode a literal status into write_run_health_report" assert "run_health_report.json" in content assert "run_health" in content assert "RUN_HEALTH_STATUS" in content