Skip to content

Implementation Plan: open-pr Skill Strips PART X ONLY Suffix from PR Title#492

Merged
Trecek merged 4 commits intointegrationfrom
open-pr-skill-copies-part-x-only-suffix-into-pr-title-even-w/488
Mar 23, 2026
Merged

Implementation Plan: open-pr Skill Strips PART X ONLY Suffix from PR Title#492
Trecek merged 4 commits intointegrationfrom
open-pr-skill-copies-part-x-only-suffix-into-pr-title-even-w/488

Conversation

@Trecek
Copy link
Copy Markdown
Collaborator

@Trecek Trecek commented Mar 23, 2026

Summary

The open-pr skill's Step 2 extracts the first # heading from the plan file verbatim and uses it as the PR title. Because make-plan and rectify mandate that multi-part plan files include — PART X ONLY in their heading (e.g., # Implementation Plan: Foo — PART A ONLY), this internal scope marker leaks directly into the PR title — making PRs appear partial when all parts are implemented.

The fix is two-part: (1) update the bash block at Step 2 to pipe through a sed that strips the suffix from the extracted heading, and (2) update the Step 2 prose to explicitly instruct stripping the suffix before passing headings to the multi-plan subagent synthesis path. A contract test is added to guard against regression.

Architecture Impact

Process Flow Diagram

%%{init: {'flowchart': {'nodeSpacing': 50, 'rankSpacing': 60, 'curve': 'basis'}}}%%
flowchart TB
    %% CLASS DEFINITIONS %%
    classDef terminal fill:#1a237e,stroke:#7986cb,stroke-width:2px,color:#fff;
    classDef stateNode fill:#004d40,stroke:#4db6ac,stroke-width:2px,color:#fff;
    classDef handler fill:#e65100,stroke:#ffb74d,stroke-width:2px,color:#fff;
    classDef phase fill:#6a1b9a,stroke:#ba68c8,stroke-width:2px,color:#fff;
    classDef detector fill:#b71c1c,stroke:#ef5350,stroke-width:2px,color:#fff;
    classDef output fill:#00695c,stroke:#4db6ac,stroke-width:2px,color:#fff;
    classDef newComponent fill:#2e7d32,stroke:#81c784,stroke-width:2px,color:#fff;

    START([START])
    END([END])

    subgraph Extract ["● Step 2: Title Extraction (open-pr/SKILL.md)"]
        direction TB
        HeadExtract["Extract heading<br/>━━━━━━━━━━<br/>head -1 {plan_path}<br/>sed 's/^# //'"]
        StripSuffix["● Strip PART X ONLY suffix<br/>━━━━━━━━━━<br/>sed 's/ *— *PART [A-Z] ONLY$//'<br/>guards against scope-marker leakage"]
    end

    subgraph PlanRoute ["Plan Count Routing"]
        PlanCount{"single or<br/>multiple plans?"}
        SingleUse["Use directly<br/>━━━━━━━━━━<br/>BASE_TITLE = stripped heading"]
        MultiSynth["Subagent synthesis<br/>━━━━━━━━━━<br/>sonnet subagent<br/>synthesizes clean title"]
    end

    subgraph PrefixApply ["Step 2b: run_name Prefix"]
        RunNameCheck{"run_name<br/>switch"}
        FeaturePrefix["[FEATURE] BASE_TITLE<br/>━━━━━━━━━━<br/>run_name starts with 'feature'"]
        FixPrefix["[FIX] BASE_TITLE<br/>━━━━━━━━━━<br/>run_name starts with 'fix'"]
        NoPrefix["BASE_TITLE unchanged<br/>━━━━━━━━━━<br/>any other run_name (e.g. 'impl')"]
    end

    PRCreate["gh pr create<br/>━━━━━━━━━━<br/>--title TITLE"]

    ContractTests["● Contract Tests<br/>━━━━━━━━━━<br/>test_part_suffix_stripped_in_bash_block<br/>test_step2_prose_instructs_suffix_stripping"]

    START --> HeadExtract
    HeadExtract --> StripSuffix
    StripSuffix --> PlanCount
    PlanCount -->|"single"| SingleUse
    PlanCount -->|"multiple"| MultiSynth
    SingleUse --> RunNameCheck
    MultiSynth --> RunNameCheck
    RunNameCheck -->|"feature*"| FeaturePrefix
    RunNameCheck -->|"fix*"| FixPrefix
    RunNameCheck -->|"other"| NoPrefix
    FeaturePrefix --> PRCreate
    FixPrefix --> PRCreate
    NoPrefix --> PRCreate
    PRCreate --> END

    ContractTests -.->|"guards"| StripSuffix

    class START,END terminal;
    class HeadExtract handler;
    class StripSuffix newComponent;
    class PlanCount,RunNameCheck detector;
    class SingleUse,MultiSynth phase;
    class FeaturePrefix,FixPrefix,NoPrefix stateNode;
    class PRCreate output;
    class ContractTests newComponent;
Loading

Color Legend:

Color Category Description
Dark Blue Terminal Start and end points
Orange Handler Heading extraction processing
Green Modified ● Nodes modified by this PR (suffix strip, contract tests)
Red Detector Decision points (plan count, run_name switch)
Purple Phase Synthesis paths (direct use, subagent)
Teal State Prefix variant state nodes
Dark Teal Output gh pr create invocation

Closes #488

Implementation Plan

Plan file: /home/talon/projects/autoskillit-runs/impl-20260322-203748-209804/temp/make-plan/open_pr_part_suffix_plan_2026-03-22_000000.md

🤖 Generated with Claude Code via AutoSkillit

Pipes the BASE_TITLE extraction through an additional sed that removes
the trailing '— PART X ONLY' scope marker before it is used as the PR
title. Updates Step 2 prose to document the stripping for the
multi-plan synthesis path. Adds two contract tests to guard against
regression.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Copy link
Copy Markdown
Collaborator Author

@Trecek Trecek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AutoSkillit PR Review — Verdict: changes_requested (COMMENT event used — cannot request_changes on own PR)

Copy link
Copy Markdown
Collaborator Author

@Trecek Trecek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AutoSkillit review found 3 blocking issues (changes_requested verdict). See inline comments above for details.

Copy link
Copy Markdown
Collaborator Author

@Trecek Trecek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AutoSkillit review found 3 blocking issues (verdict: changes_requested). See inline comments for details.

Trecek and others added 3 commits March 22, 2026 22:02
…regex

The first assert checked that "PART [A-Z] ONLY" appeared anywhere in
SKILL.md, which was trivially satisfied by the Step 2 prose (line 120)
rather than proving bash-block presence. The regex pattern lacked a pipe
requirement, so sed and the PART pattern could appear on the same line in
an unrelated context and still pass.

Removes the redundant first assert and tightens the pattern to
r"BASE_TITLE=.*\|.*sed.*PART \[A-Z\] ONLY" which requires the pipe
from head, matching the actual SKILL.md bash block.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Checking "PART" and "ONLY" as independent substrings could pass if
the words appeared in unrelated sentences. Replace with re.search
to require the phrase as a unit.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
The sed pattern uses a literal U+2014 em-dash. On systems with non-UTF-8
locale (LANG=C), GNU sed processes bytes and may fail to match the
multi-byte sequence, silently leaving the PART X ONLY suffix in the
PR title. Prefixing with LC_ALL=en_US.UTF-8 ensures consistent UTF-8
byte interpretation regardless of the ambient locale.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@Trecek Trecek added this pull request to the merge queue Mar 23, 2026
Merged via the queue into integration with commit 179cf5a Mar 23, 2026
2 checks passed
@Trecek Trecek deleted the open-pr-skill-copies-part-x-only-suffix-into-pr-title-even-w/488 branch March 23, 2026 05:18
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