patch-creation

Featured

Create and register new patches for tweakcc. Use when adding new customizations to Claude Code.

AI & Automation 2,494 stars 201 forks Updated today MIT

Install

View on GitHub

Quality Score: 93/100

Stars 20%
100
Recency 20%
100
Frontmatter 20%
70
Documentation 15%
100
Issue Health 10%
50
License 10%
100
Description 5%
100

Skill Content

# Patch Creation & Registration ## Overview Patches are code modifications applied to Claude Code's `cli.js` (or native binary). Each patch finds specific patterns in the minified code and replaces/injects new behavior. ## Creating a New Patch ### 1. Create the patch file Create `src/patches/myPatch.ts`: ````typescript // Please see the note about writing patches in ./index import { showDiff } from './index'; /** * Description of what this patch does. * * CC X.Y.Z: * ```diff * // Show before/after of the code change * -oldCode * +newCode * ``` */ export const writeMyPatch = ( file: string, configValue: string // Add parameters as needed ): string | null => { // Pattern to find in minified code // IMPORTANT: Use [$\w]+ for identifiers (not \w+) because $ is valid in JS identifiers // IMPORTANT: Start patterns with a boundary char (,;}{) for HIGH performance (e.g. 1.5s -> 30ms) const pattern = /,somePattern([$\w]+)/; const match = file.match(pattern); if (!match || match.index === undefined) { console.error('patch: myPatch: failed to find pattern'); return null; } const replacement = `,newCode${match[1]}`; const startIndex = match.index; const endIndex = startIndex + match[0].length; const newFile = file.slice(0, startIndex) + replacement + file.slice(endIndex); showDiff(file, newFile, replacement, startIndex, endIndex); return newFile; }; ```` ### 2. Add config type (if patch is configurable) Edit `src/types....

Details

Author
Piebald-AI
Repository
Piebald-AI/tweakcc
Created
1 years ago
Last Updated
today
Language
TypeScript
License
MIT

Integrates with

Similar Skills

Semantically similar based on skill content — not just same category

Code & Development Solid

generating-patches

Generates git patch files from codebase modifications for local application. Use when user mentions patch, diff, export changes, bring changes back, apply locally, or after editing uploaded codebases.

148 Updated today
oaustegard
AI & Automation Listed

new-patch

Scaffold the four files for a new cc-enhanced patch (src/patches/<tag>.ts, <tag>.test.ts, the export-barrel entry, and the BY_TAG metadata record). Scaffold-only; the complete implementation procedure lives in docs/maintainer-reference.md > Adding Patches. Recommend by name when the user wants to add a new patch behavior. Triggers on "new patch", "add a patch", "scaffold a patch", "create a patch for X", "start a patch". Argument is the patch tag (e.g. "my-feature"). If the tag, one-line purpose, or group (Prompt, Tooling, Agent, System, UX, Metadata) is missing, ask before scaffolding. NOT for editing an existing patch directly and NOT for end-to-end implementation; this skill stops at scaffolding and hands off to the implementation workflow.

6 Updated today
camjac251
Code & Development Listed

ce-patch

Make one low-risk change on a bounded lane that touches at most two candidate files, proves it with behavior red→green or a deterministic content/config before→after check, and ends at one human acceptance gate. Any uncertain, sensitive, dependency, durable-state, schema, public-contract, destructive, colliding, or wider change routes to /core-engineering:ce-plan; this skill never commits, pushes, opens a PR, or merges. Triggers: a typo, localized bug fix, or small behavior change with a known test. Multi-file, contract, schema, dependency, security-sensitive, or exploratory work → /core-engineering:ce-plan.

0 Updated 1 months ago
relusion