Skip to content

shrink: SKILL.md 1,587 → 1,062 lines (Claude draft for #58)#59

Merged
earino merged 5 commits into
mainfrom
feature/skill-md-shrink
Apr 27, 2026
Merged

shrink: SKILL.md 1,587 → 1,062 lines (Claude draft for #58)#59
earino merged 5 commits into
mainfrom
feature/skill-md-shrink

Conversation

@earino

@earino earino commented Apr 27, 2026

Copy link
Copy Markdown
Owner

Summary

Claude Opus 4.7 draft for the multi-LLM simplification pipeline laid out in #58. Marked draft because GPT-5 Pro and Kimi K2 are producing parallel independent rewrites; final synthesis happens after cross-review + qwen audience poll.

  • SKILL.md: 1,587 → 1,062 lines (-525 lines, -33%). Six cuts in three commits, each commit one category for bisectability.
  • Every "do X / NOT Y" prescription preserved. Verified by test_skill_md_weak_model_guards.py (Phase 0 mkdir + Phase 2 heredoc), test_opencode_command_shim.py, test_skill_md_prologue.py (rewritten for one prologue), test_extractors_tolerate_markdown_bold_around_keys, plus full pytest suite (459 passing — was 460; lost one prologue-drift test that's no longer applicable since the second prologue went away with Cut C).
  • New: docs/DEBUGGING.md (the moved playbook).

The cuts

# What Lines Risk What survived
A Drop "Usage analytics (telemetry)" reference section (add0d6d) -200 Low 12-line behavior summary; inline "$TEL" calls in each phase ARE the docs
B Move "Debugging this skill" → docs/DEBUGGING.md (add0d6d) -135 Low One-paragraph SKILL.md pointer naming the 7 steps + don'ts
C Fold "Re-rendering PDFs" into Phase 8 (5a0602c) -75 Low 25-line subsection covering the differential constraints
D Phase 0: 9 expanded question shapes → 1 + field list (5a0602c) -65 Med GDPR consent block verbatim, photo-position 3-option, photo path file-existence verify, Phone special-case
E Trim run-citation parentheticals (130e07d) -20 Med Each rule + bug description; just the verbose (observed under qwen3.6-35b on OpenCode, run ses_236d — Qwen rewrote …) attribution gone
F Prose tightening on longest paragraphs (130e07d) -30 Med Same prescriptions, shorter framing

Verification

  • pytest tests/ -q → 459 passed in 239s (was 460; one prologue-drift test deleted as no-longer-applicable per Cut C)
  • All weak-model guard prescriptions present:
    • mkdir -p "$STUDENT_CWD/.resumasher" before cat > config.json
    • << 'HEREDOC' byte-literal pattern for cache.txt ✓
    • "Pass $PROMPT AS-IS" sub-agent prescription ✓
    • extract-fit-fields pipe (3 occurrences) ✓
    • fit-extracted.env shell-source forbidden ✓
    • /tmp forbidden for prompt staging ✓
    • cleanup-stray-prompts + cleanup-stray-outputs
    • PHOTO_ARGS=() bash-array pattern ✓
    • GDPR off-as-default (3 occurrences) ✓
    • Photo path ls -la file-existence verify ✓

Multi-LLM pipeline (per #58)

This PR is stage 1 of 3:

  1. Stage 1 (this PR) — Claude Opus 4.7 draft. ✅ done.
  2. Stage 2 — GPT-5 Pro and Kimi K2 produce independent drafts from the same brief. The maintainer drives this part (paste original SKILL.md + brief into ChatGPT Pro and Kimi). The interesting signal is what all three of us cut in common (high-confidence filler) vs. cuts only one made (need scrutiny).
  3. Stage 3 — Cross-model adversarial review (each draft reviewed by a model that didn't write it) + qwen3.6-35b audience poll on the maintainer's local Ollama. The qwen poll asks "given this SKILL.md, walk me through what you'd do for /resumasher /tmp/job.md" — pass = right phases, files, dispatch shape; fail = cut a load-bearing prescription. Final synthesis merges back into a single SKILL.md after audience-poll passes.

Do not merge until the synthesis is in hand.

Test plan

  • GPT-5 Pro draft collected
  • Kimi K2 draft collected
  • Cross-model adversarial reviews complete
  • qwen3.6-35b audience poll passes against the synthesized draft
  • qwen3.6-35b full end-to-end run (PDFs render, fit fields populate, telemetry fires)

🤖 Generated with Claude Code

earino and others added 5 commits April 27, 2026 10:28
…#58)

Cut A: dropped the 250-line "Usage analytics (telemetry)" reference
section. The 8 telemetry call-sites it duplicated already live inline
in Phase 0/1/3/5/7/9; reproducing them once per phase is the actual
documentation. Replaced with a 12-line bullet list of behavior worth
knowing (no-op when off, sync semantics, error-class enum, field
whitelist constraint).

Cut B: moved the 135-line "Debugging this skill" playbook into
docs/DEBUGGING.md. Self-contained workflow triggered by a different
user intent (debugging vs running) — belongs in its own doc, not in
the load-every-time SKILL.md. Frontmatter pointer updated. SKILL.md
keeps a one-paragraph summary that names the seven steps + the
anonymization rules + the don'ts so a model reading SKILL.md still
knows the playbook exists and what shape it has.

Per issue #58: every "do X / NOT Y" prescription preserved. Test
suite green (460/460). SKILL.md now 1229 lines (was 1587, -358).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…apes (#58)

Cut C: dropped the standalone "Re-rendering PDFs after manual edits"
section (~100 lines). Most of it was duplication — the path prologue
was an exact repeat of Phase 0's prologue, and the three render
commands were byte-identical to Phase 8's renders. Replaced with a
~25-line subsection inside Phase 8 that names only what differs from
the main render flow: don't re-run sub-agents, only re-render what was
edited, warn on remaining `[INSERT]` placeholders, fire rerender_used
telemetry. Updated stale "see ... near the end of SKILL.md" pointers.

Cut D: compressed Phase 0's nine expanded question shapes (~115 lines)
to ~50 lines. Pattern A and Pattern B already live in the "Interactive
prompt pattern" section; reproducing them per-field for name/email/
phone/linkedin/location was pure repetition. Kept verbatim: the GDPR
telemetry-consent block (legal compliance, not optional), the photo-
position three-option choice (config keys load-bearing), the photo-
path file-existence verification, and the Phone special-case for when
PDF extraction returns nothing.

tests/test_skill_md_prologue.py rewritten to assert ONE prologue
(was: TWO). Folding re-rendering into Phase 8 removed the second
prologue and the cross-prologue drift class of bug along with it. The
POSIX + Windows venv-layout checks survived (still required on the
single remaining prologue).

Per issue #58: every "do X / NOT Y" prescription preserved. Tests
green (3 SKILL.md guard suites, 11/11). SKILL.md now 1071 lines
(was 1587, -516 = 32% smaller).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Cut E: trimmed verbose run citations from 4 places. Each prescription
that referenced a real failure mode kept the description of the bug
but dropped the "(observed under qwen3.6-35b on OpenCode, run ses_236d
— Qwen rewrote the cover-letter prompt and inverted...)" run-citation
prose. The rule itself stays; the rule's rationale stays; only the
verbose attribution goes. The run transcripts and CHANGELOG entries
remain the canonical archive.

Cut F: tightened the longest prose paragraphs:
- $MODEL/$HOST telemetry-identifier section: 5 paragraphs → 2.
- Sub-agent prompt-pattern intro: dropped the "previous design had
  the orchestrator LLM substitute tokens" framing; kept the failure
  example + the "use build-prompt" prescription.
- /tmp-forbidden-for-prompt-staging block: condensed the three-clause
  enumeration into a single sentence with the same content.
- Cleanup defense-in-depth paragraph: tightened scope description.

Per issue #58: every "do X / NOT Y" prescription preserved. Tests
green (459/459 — was 460, lost one prologue-drift test that's no
longer applicable since cut C eliminated the second prologue).
SKILL.md now 1062 lines (was 1587, -525 = 33% smaller).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Two improvements surfaced by GPT-5's parallel draft of the same
brief — both real bugs/gaps, not stylistic choices:

(1) Phase 1 `run_started` telemetry referenced `$RESUME_FORMAT` but
that variable is computed in Phase 2 (after `discover-resume`), not
Phase 1. Original SKILL.md had this backwards: the call would fire
with `--resume-format ""` or with a fabricated value. Moved the call
to right after Phase 2's resume-discovery + read, where
`$RESUME_FORMAT` is actually known. Phase 1 still generates and
persists `$RUN_ID` and `$START_TS`; just doesn't fire telemetry yet.

(2) The Phase 2 heredoc-with-quoted-delimiter prescription (apostrophes
in sub-agent text break single-quoted shell vars) was applied only at
cache.txt. The same risk applies to every sub-agent output save — fit
assessments contain "client's", company research contains "OpenAI's",
tailored resumes have possessives + metric dollar signs, cover letters
have contractions, interview-prep contains SQL backticks. Generalized
the prescription to fit-assessment.md / company-research.md /
tailored-resume.md / cover-letter.md / interview-prep.md with explicit
heredoc examples at each save site.

`tests/test_skill_md_phase6.py` updated: the Phase 6 save-prescription
test now asserts BOTH "Write tool" AND "heredoc" appear (was: just
"use the Write tool to save it" exact-string). Issue #29 was about
ambiguous "save the outputs" wording — both Write and heredoc satisfy
that; the test was over-specific.

SKILL.md: 1062 → 1104 lines (+42). Adds back ~40 lines of explicit
heredoc examples at 5 save sites — the trade-off is a slightly larger
file for a uniformly applied prescription rather than one applied only
at Phase 2. Tests green (459/459).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@earino

earino commented Apr 27, 2026

Copy link
Copy Markdown
Owner Author

Two fixes surfaced by GPT-5 Pro's parallel draft applied (66aff74):

  1. Phase 1 run_started deferral. Original SKILL.md (and my first draft) fired run_started telemetry with $RESUME_FORMAT before resume discovery — $RESUME_FORMAT doesn't exist until Phase 2. Moved the call to right after Phase 2's resume-discovery + read.

  2. Uniform quoted-heredoc on every sub-agent output save. I'd applied the heredoc prescription only at Phase 2's cache.txt. The same apostrophe/dollar-sign/backtick risk applies to fit-assessment.md, company-research.md, tailored-resume.md, cover-letter.md, interview-prep.md. Generalized.

Net: +42 lines (1,062 → 1,104). The shrink is now 1,587 → 1,104, -30.5% from main. Slightly less aggressive than my initial draft, but the saved bytes are at choice points where weak models needed the extra prescription.

test_skill_md_phase6 updated: was pinning the exact string "use the Write tool to save it"; now asserts BOTH "Write tool" AND "heredoc" appear (the new wording prescribes both).

Status: ready for testing on weak model, not ready for merge. Per #58 stage 3, the PR sits in draft until the qwen3.6-35b end-to-end on Eduardo's local OpenCode passes:

  • Phase walk-through poll: "given this SKILL.md, what's your plan for /resumasher /tmp/job.md?"
  • Full pipeline run: PDFs render, fit fields populate via extract-fit-fields, telemetry fires, no improvisation.

GPT-5's structural moves (Section 0 "Non-negotiable rules" preamble, weak-model lessons recap, retry/fallback table) are taste choices, not bugs — defer until a future qwen run says they'd help.

@earino earino marked this pull request as ready for review April 27, 2026 14:39
@earino earino merged commit da03430 into main Apr 27, 2026
6 checks passed
@earino earino deleted the feature/skill-md-shrink branch April 27, 2026 14:39
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