mirror of
https://github.com/mvanhorn/cli-printing-press.git
synced 2026-09-14 15:38:08 +08:00
c31632b3fb
* feat(cli): add verify-internal-skill subcommand
Lints internal-skill SKILL.md files (frontmatter + canonical sections).
Distinct from verify-skill, which validates a printed CLI's SKILL.md
against its Go source — internal skills (polish, retro, publish, amend)
have no internal/cli/ to verify against.
Checks: frontmatter-parse, frontmatter-required (name, description,
allowed-tools), name-matches-dir, allowed-tools-shape, body-has-heading
(warn). All three existing internal skills pass cleanly.
* feat(skills): scaffold printing-press-amend skill
New skill that wraps the dogfood-to-PR loop for a printed CLI in
mvanhorn/printing-press-library. Mines the active session transcript
for friction, scopes with the user, plans + executes the fix, scrubs
PII, opens a PR. Two user-in-loop checkpoints (scope, PR draft).
This commit lands the SKILL.md skeleton (frontmatter + setup contract +
phase-header placeholders) plus the brainstorm requirements doc and
implementation plan that drove it. Phase bodies (U2-U7) land in
follow-up commits.
Adds skills/printing-press-amend/SKILL.md to the
TestSkillSetupBlocksMatchWorkspaceContract test slice — setup-contract
parity with publish/score/catalog enforced.
* fix(cli): use strings.SplitSeq in verify-internal-skill
Satisfies golangci-lint modernize hint. Pure refactor — same behavior,
no test changes needed.
* feat(skills): flesh out printing-press-amend phase bodies + references
Adds the substantive Phase 1-7 bodies to skills/printing-press-amend/
SKILL.md, plus three reference files:
- transcript-parsing.md (Phase 1: read active session transcript,
extract friction signals, classify bug-vs-feature, auto-detect
target CLI, confirm with user)
- pii-scrubbing.md (Phase 5: three-layer scrub — credentials reused
from retro/secret-scrubbing.md, entities from a user-maintained
stop-list at ~/.printing-press/amend-config.yaml, plus first-mention
defense for unrecognized capitalized phrases)
- library-pr-plumbing.md (Phase 6+7: managed-clone bootstrap, branch
collision detection, issue ownership, push + gh pr create with
durable HEAD_SHA evidence URLs — adapted from publish Steps 5/7/8)
Phase 4 operates directly on the managed clone of mvanhorn/printing-
press-library at $PRESS_HOME/.publish-repo-$PRESS_SCOPE (per the
plan's pre-implementation decision), enforces the public library's
mandatory `// PATCH(...)` source-comment + .printing-press-patches.json
contract, and runs `printing-press publish validate` with up-to-3
retry iterations.
Two user-in-loop checkpoints: scope confirmation after capture (U4),
PR draft review before any gh command fires (U7).
* docs(cli): add /printing-press-amend to README skill catalog
One-line entry under Publish, in the same details/summary shape as the
other skills.
* feat(skills): expand printing-press-amend frontmatter for direct-input mode
Broaden description to cover both dogfood and direct-input input modes.
Add trigger phrases for user-supplied asks (rename, add feeds, sniff for
new APIs, amend with these ideas).
U1 of docs/plans/2026-05-16-001-feat-printing-press-amend-direct-input-mode-plan.md
* feat(skills): add Phase 0 input mode detection to printing-press-amend
Insert a new "## Phase 0 — Input Mode Detection" section between Setup
and Phase 1. Documents the detection rubric (dogfood, direct, both,
ambiguous), the AskUserQuestion fallback, the default-dogfood preservation
rule, and the runstate persistence path. Phase 1's existing dogfood body
is untouched; U3 introduces the direct-input sub-section.
U2 of docs/plans/2026-05-16-001-feat-printing-press-amend-direct-input-mode-plan.md
* feat(skills): split printing-press-amend Phase 1 into mode-conditional sub-sections
Rename "## Phase 1 — Friction Capture" to "## Phase 1 — Capture" and
split into ### 1a (dogfood, existing body lifted verbatim) and ### 1b
(direct-input, new). Document the shared typed finding list shape with
new "provenance" field. Reserve ### 1b.i for the sniff subroutine
(filled in by U4).
transcript-parsing.md gets a scope note pointing to direct-input-parsing.md
for the new mode; its body is unchanged.
U3 of docs/plans/2026-05-16-001-feat-printing-press-amend-direct-input-mode-plan.md
* feat(skills): add sniff finding subroutine to printing-press-amend Phase 1b
Document the opt-in sniff path that runs printing-press crowd-sniff (and
optionally browser-sniff with a user-supplied HAR) against the target
CLI's source URL, then converts each discovered candidate endpoint to a
Tier-3 add-endpoint finding with provenance: sniff.
Includes the six steps (resolve URL, crowd-sniff, optional browser-sniff,
convert to findings, degraded-path table, provenance surface at Phase 3).
Sniff is gated on an explicit kind: sniff ask — never auto-invoked.
U4 of docs/plans/2026-05-16-001-feat-printing-press-amend-direct-input-mode-plan.md
* feat(skills): add direct-input-parsing reference for printing-press-amend
New reference doc loaded by Phase 1b. Documents the ask-to-finding
parsing rubric (six finding kinds), the finding shape (with new
provenance field), target-CLI resolution rules (regex extraction + Phase 0
fallback), and edge cases (multi-CLI, ambiguous verbs, bare URLs,
conflicting kinds, combined-mode merging).
Mirrors transcript-parsing.md structure so Phase 1a and Phase 1b reference
docs feel parallel.
U5 of docs/plans/2026-05-16-001-feat-printing-press-amend-direct-input-mode-plan.md
* docs(skills): v0.2 addenda to amend brainstorm + plan; add direct-input plan
Append a v0.2 amendment section to the original brainstorm and original
v0.1 plan pointing at the new direct-input plan. Preserves both originals
as the dogfood-mode design record; the v0.2 design (input-mode detection,
direct-input parsing, sniff finding type) lives in its own plan file.
Add docs/plans/2026-05-16-002-feat-printing-press-amend-direct-input-mode-plan.md
covering U1-U6 of the v0.2 expansion. Sequence number 002 to avoid
collision with the parallel-session bugbounty-goat plan filed today.
U6 of docs/plans/2026-05-16-002-feat-printing-press-amend-direct-input-mode-plan.md
* fix(skills): count only newly-added PATCH markers in printing-press-amend parity check
Greptile P1: the parity check used grep -rc to count // PATCH(...) markers
across all Go files in $CLI_DIR, including markers from prior amend runs.
That cumulative count compared against the per-run declared patch_count
silently passed when prior history made the running total meet or exceed
the declared count, even with zero new markers added.
Switch to git format-patch --stdout + grep '^+.*// PATCH(' so the count
reflects only newly-added markers in this run's diff against upstream.
format-patch is used over git diff to stay robust against environments
where git diff is intercepted by a pager/shim that reformats unified-diff
output.
Resolves Greptile finding on PR #1490.
* fix(skills): relabel printing-press-amend PR-body Evidence block
Greptile P1: the Evidence block labeled .printing-press-patches.json as
"Plan doc" and the next line said "see the plan doc at the path above"
- the URL points at the patches JSON, not the plan doc, which lives
locally at $PRESS_MANUSCRIPTS/<slug>/<run-id>/proofs/... and is never
committed to the public library.
Relabel the URL as "Patch record", point per-finding rationale at the
Findings table + patch record, and note the local plan doc location as
context for the original printer (not as a clickable artifact for
external reviewers). The plan doc stays local by design - it's a
PII-scrubbed audit record, not part of the PR contract.
Resolves Greptile finding on PR #1490. Origin R27's requirement for a
full GitHub URL to the plan doc is unsatisfiable as written and is
silently revised here; flag for retro follow-up.
* fix(skills): hard-stop existing-open-PR path in library-pr-plumbing
Greptile P2: when existing_open was non-empty the snippet printed a
warning and a # AskUserQuestion: ... shell comment, then unconditionally
ran git checkout -b "$BRANCH_NAME" - which fails with a confusing
already-exists error because the local branch from the open PR exists.
Replace the inert comment with a hard exit 1, a concrete two-option
resolution menu printed to the user, and a follow-up prose block that
documents the AskUserQuestion-then-re-enter contract the skill driver
must honor. Literal shell-flow execution now stops at the right place
with an actionable message.
Resolves Greptile finding on PR #1490.
* fix(cli): mark --dir as required on verify-internal-skill
Greptile P2: --dir was validated via a manual `if dir == ""` check in
RunE, which works but doesn't surface the constraint in Cobra's --help
output and runs the validation later than necessary.
Replace with cmd.MarkFlagRequired("dir") after the StringVar
declaration. Missing --dir now produces "required flag(s) \"dir\" not
set" via Cobra's standard flow and the flag is annotated as required
in --help output. The manual check is removed as redundant.
Resolves Greptile finding on PR #1490.
* fix(skills): make 90-days-ago date portable in printing-press-amend
Greptile P1: `date -v-90d` is BSD/macOS-only. On Linux it emits
"date: invalid option -- 'v'" to stderr and produces empty stdout,
leaving the GitHub search qualifier as `merged:>` with no value.
The recently-merged-PR dedup guard then silently returned no results,
defeating Phase 2a's purpose on any non-macOS machine.
Replace with a three-way fallback: GNU `date -d '90 days ago'` first,
BSD `date -v-90d` second, python3 timezone-aware UTC date as final
fallback. Hard exit 1 if all three fail rather than letting the dedup
guard silently drop out.
Resolves Greptile finding on PR #1490.
* fix(skills): assign dogfood_status=N/A in direct-input mode
Greptile P1 (re-review 18:50): the PR body template printed `- Dogfood:
$dogfood_status` and the Phase 8 RESULT block included `dogfood_status:
<PASS|FAIL|N/A>`, but Phase 4's output spec omitted the variable
entirely and no phase instruction assigned it in direct-input mode.
Every PR from a direct-input run would show an empty `- Dogfood:` line.
Add dogfood_status to Phase 4's output spec with a per-mode contract:
- MODE=dogfood: PASS|FAIL from the dogfood validation step
- MODE=direct: always N/A (no transcript to dogfood against)
- MODE=both: PASS|FAIL on the transcript half of the findings
Default must be set by end of Phase 4 so Phase 7/8 never see empty.
Also add defensive ${dogfood_status:-N/A} in the PR body template as
belt-and-suspenders against any future phase forgetting to assign it.
Resolves Greptile finding on PR #1490.
* fix(skills): force-checkout main on managed-clone refresh
Greptile P1 (x2, SKILL.md:460 + library-pr-plumbing.md:86): if a prior
run aborted between Phase 4's file edits and Phase 7's commit, the
managed clone is left on an amend branch with uncommitted changes in
$CLI_DIR. The refresh block's `git checkout main` then fails because
those edits would be overwritten, and the subsequent `git reset --hard
upstream/main` never runs - leaving the clone stuck in a broken state.
Add -f to discard local edits. The managed clone is documented as a
scratch surface owned by the skill; any leftover edits are by definition
abort residue that must be discarded before the next run reuses it.
This is consistent with the existing reset --hard immediately after.
Resolves Greptile finding on PR #1490.
* fix(skills): use working-tree git diff for parity check (not format-patch)
Greptile P1: my prior G1 fix used git format-patch --stdout
upstream/main..HEAD, but the parity check runs in Phase 4 Step 6 -
BEFORE Phase 7's commit. The edits live only in the working tree, so
upstream/main..HEAD is an empty commit range and format-patch emits
nothing. new_patch_markers is always 0:
- When patches_entry > 0 (any real patch run): 0 < patches_entry is
true and exit 1 fires unconditionally, blocking every valid run.
- When patches_entry = 0: the check silently passes regardless.
Switch back to working-tree git diff (the right tool for pre-commit
state). Add --no-pager + --no-color + --no-ext-diff to defeat
colorized output and any configured diff.external tool that would
reformat the diff away from unified-diff shape.
Smoke-tested the corrected snippet against a fresh repo with uncommitted
PATCH-bearing edits: returns 1 for the 1 new marker, as expected.
Resolves Greptile finding on PR #1490 (refines G1's prior fix).
---------
Co-authored-by: Matt Van Horn <455140+mvanhorn@users.noreply.github.com>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>