Skip to content

Support applying individual patches by ID and listing available patches#442

Merged
bl-ue merged 1 commit intomainfrom
support-listing-and-applying-individual-patches
Jan 31, 2026
Merged

Support applying individual patches by ID and listing available patches#442
bl-ue merged 1 commit intomainfrom
support-listing-and-applying-individual-patches

Conversation

@bl-ue
Copy link
Member

@bl-ue bl-ue commented Jan 31, 2026

Summary by CodeRabbit

  • New Features
    • Introduced three new CLI options (--patches, --list-patches, --list-system-prompt-patches) to manage patch selection and listing
    • Added capability to filter and apply only selected patches
    • Enabled listing of available patches with their IDs
    • Added listing of system prompts for specific versions
    • Enhanced user messaging to reflect partial success scenarios

✏️ Tip: You can customize this high-level summary in your review settings.

@bl-ue bl-ue enabled auto-merge (squash) January 31, 2026 00:38
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 31, 2026

Caution

Review failed

The pull request is closed.

📝 Walkthrough

Walkthrough

This PR introduces a data-driven patch system with filtering capabilities, expanding CLI options to include --patches, --list-patches, and --list-system-prompt-patches for managing patch selection and enumeration. The patch application flow now propagates an optional filter through patch and system prompt processing.

Changes

Cohort / File(s) Summary
Patch System Refactor
src/patches/index.ts, src/patches/systemPrompts.ts
Replaces static patch structures with centralized PATCH_DEFINITIONS array containing metadata (id, name, group, description). Adds patchFilter parameter to applyCustomization() and applySystemPrompts() to filter which patches/prompts are applied, marking non-selected items as skipped. Introduces PatchDefinition type and getAllPatchDefinitions() API.
CLI and Patch Listing
src/index.tsx, src/systemPromptSync.ts
Adds --patches, --list-patches, and --list-system-prompt-patches CLI options with new handlers handleListPatches() and handleListSystemPrompts(). Updates printPatchResults() and handleApplyMode() signatures to accept and propagate patchFilter. Introduces SystemPromptDefinition interface and getSystemPromptDefinitions() to enumerate system prompts per CC version.
Changelog and Dependencies
CHANGELOG.md, package.json
Documents new CLI patch-management options in unreleased section. Updates package.json (28 lines added).

Sequence Diagram(s)

sequenceDiagram
    actor User
    participant CLI as CLI Handler
    participant ApplyFn as applyCustomization()
    participant PatchImpl as Patch Implementations
    participant SysPrompt as applySystemPrompts()
    participant Config as Config Writer

    User->>CLI: Invoke with --patches [filter]
    CLI->>ApplyFn: Call with patchFilter
    ApplyFn->>PatchImpl: Apply patches (data-driven)
    PatchImpl->>PatchImpl: Check patchFilter, skip if not matching
    PatchImpl-->>ApplyFn: Return results (applied/skipped)
    ApplyFn->>SysPrompt: Apply prompts with patchFilter
    SysPrompt->>SysPrompt: Check patchFilter, skip non-matching
    SysPrompt-->>ApplyFn: Return prompt results
    ApplyFn->>Config: Write updated config
    Config-->>ApplyFn: Success
    ApplyFn-->>CLI: Return ApplyCustomizationResult
    CLI->>CLI: printPatchResults(results, patchFilter)
    CLI-->>User: Display filtered results
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Possibly related PRs

Poem

🐰 Patches now dance in data's array,
Filtered flows light up the way,
Lists appear with --patches command,
System prompts, oh so grand!
From chaos blooms a tidy land!

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch support-listing-and-applying-individual-patches

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

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