Agent skill

Morphe Patcher

by kveld9 in kveld9/kveld-morphe-patches

Architecture, patch typology (bytecodePatch, resourcePatch, rawResourcePatch), universal patches, stringOption DSL, fingerprint resolution, compatibility contracts (Constants.kt), and diagnostic…

GPL-3.0Auto-check passedMobile

Install Morphe Patcher

skills CLI
$ npx skills add kveld9/kveld-morphe-patches --skill morphe-patcher -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install kveld9/kveld-morphe-patches morphe-patcher --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/kveld9/kveld-morphe-patches.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.agents/skills/morphe-patcher .claude/skills/morphe-patcher && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
morphe-patcher
GitHub stars
113
Token cost
~2.4k tokens
SKILL.md length
649 words
Files
1
Skills in repo
4
Repo updated
First seen
Licence
GPL-3.0

At a glance

Architecture, patch typology (bytecodePatch, resourcePatch, rawResourcePatch), universal patches, stringOption DSL, fingerprint resolution, compatibility contracts (Constants.kt), and diagnostic…

  • Works in 7 steps: Patch DSL & Typology → Compatibility Scope & Universal Patches → User Configurable Options (stringOption… → …
  • Mobile work in your project
  • SKILL.md covers 1. Patch DSL & Typology, 2. Compatibility Scope &…, 3. User Configurable Options… and 4. Fingerprint Resolution…, plus 3 more sections
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

Morphe Patcher is an agent skill from kveld9/kveld-morphe-patches. Architecture, patch typology (bytecodePatch, resourcePatch, rawResourcePatch), universal patches, stringOption DSL, fingerprint resolution, compatibility contracts (Constants.kt), and diagnostic telemetry invariants.

Its SKILL.md is about 2.4k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in Mobile. It works with Android. The repository describes itself as: Custom Morphe patches on Android. The licence is GPL-3.0.

When your agent uses it

  • Mobile work in your project

Example prompts

  • “/morphe-patcher”

Workflow steps

7 steps, taken from the step headings in SKILL.md.

  1. Patch DSL & Typology
  2. Compatibility Scope & Universal Patches
  3. User Configurable Options (stringOption DSL)
  4. Fingerprint Resolution Strategies
  5. Metadata Contracts (Constants.kt)
  6. Diagnostic Telemetry Invariants & Harness Compliance
  7. Mandatory Verification Gate

What it can do on your machine

Read from SKILL.md and the folder at commit 32e9c2f. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md (its code samples are kotlin).

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Morphe Patcher loads about 2.4k tokens when it runs. Until then it costs about 58 tokens; SKILL.md has 649 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~58
When it runs · the whole SKILL.md, loaded when a task matches
~2.4k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from kveld9/kveld-morphe-patches at commit 32e9c2f, republished under its GPL-3.0 licence (© kveld9). 649 words, ~2,352 tokens.

Download SKILL.mdSave it as .claude/skills/morphe-patcher/SKILL.md (or your agent's skills folder).
name
morphe-patcher
description
Architecture, patch typology (bytecodePatch, resourcePatch, rawResourcePatch), universal patches, stringOption DSL, fingerprint resolution, compatibility contracts (Constants.kt), and diagnostic telemetry invariants.
<!-- Mirror: this skill also exists in kveld-extra-morphe-patches/.agents/skills (hardlinked to its .claude/skills). When editing shared core guidance, replicate the change there. -->

Morphe Patcher Architectural Guidelines

1. Patch DSL & Typology

Morphe patches are declared using functional Kotlin builder DSLs provided by app.morphe.patcher.patch:

A. bytecodePatch

Primary tool for Dalvik/Smali AST bytecode transformations via dexlib2 fingerprints and instructions.

kotlin
val myPatch = bytecodePatch(
    name = "Unique Patch Name",
    description = "Concise technical description of the modification.",
    default = true // Whether enabled by default in Morphe Manager
) {
    compatibleWith(Constants.COMPATIBILITY_BRAVE)
    dependsOn(companionResourcePatch) // Optional dependency execution

    execute {
        // Fingerprinting and instruction insertion
    }
}
B. resourcePatch

Used for parsing and transforming decompiled Android resource XML files prior to DEX assembly.

kotlin
val myResourcePatch = resourcePatch(
    name = "Resource Defaults Patch",
    description = "Overwrites default XML attributes.",
    default = false
) {
    compatibleWith(Constants.COMPATIBILITY_BRAVE)

    execute {
        val targetFile = get("res/xml").listFiles()
            ?.firstOrNull { it.extension == "xml" && it.readText().contains("target_key") }
            ?: return@execute

        document(targetFile.absolutePath).use { doc ->
            val nodes = doc.getElementsByTagName("SwitchPreference")
            for (i in 0 until nodes.length) {
                val elem = nodes.item(i) as? Element ?: continue
                if (elem.getAttribute("android:key") == "target_key") {
                    elem.setAttribute("android:defaultValue", "true")
                }
            }
        }
    }
}
C. rawResourcePatch

Direct byte-level modification of bundled binary shared libraries (.so) or uncompressed assets (assets/index.android.bundle).

kotlin
val myNativePatch = rawResourcePatch(
    name = "Native Hardening Patch",
    description = "Direct binary patching of libchrome.so",
    default = false
) {
    compatibleWith(Constants.COMPATIBILITY_BRAVE)

    execute {
        val soFile = get("lib/arm64-v8a/libchrome.so")
        if (!soFile.exists()) return@execute
        // Validate offsets and mutate bytes via RandomAccessFile
    }
}

2. Compatibility Scope & Universal Patches

Compatibility is configured via compatibleWith(...):

  • Single Target:
    kotlin
    compatibleWith(Constants.COMPATIBILITY_BRAVE)
  • Multi-Compatibility Varargs: Accepts multiple Compatibility contracts for cross-target or dual-package applications:
    kotlin
    compatibleWith(targetA, targetB)
  • Universal Patches: Omitting compatibleWith(...) entirely produces a universal patch (e.g. LocaleResourceSlimmerPatch, DpiResourceSlimmerPatch). Universal patches are offered across all target applications in Morphe Manager and the CLI patcher. Universal patch sources live in app.morphe.patches.universal; app.morphe.patches.shared holds only contracts and helpers.

3. User Configurable Options (stringOption DSL)

Patches can expose configurable settings to users in Morphe Manager or CLI using the stringOption property delegate:

kotlin
import app.morphe.patcher.patch.stringOption

val targetLocales by stringOption(
    key = "locales",
    title = "Locales to keep",
    description = "Comma-separated language codes to preserve (e.g. 'en, es, pt, fr, de'). English fallback is always retained.",
    default = "en",
    required = false,
)
Metadata Synchronization Rule

When patch options, descriptions, titles, or defaults are added or modified in Kotlin code, verify catalog registration by running the patch list generator against the built .mpp from a temporary working directory outside the repository, and confirm the expected entries appear. Do NOT run ./gradlew generatePatchesList in the repository checkout: it rewrites the tracked patches-list.json, which the release pipeline regenerates (see AGENTS.md, rule 11).


4. Fingerprint Resolution Strategies

Fingerprints locate target methods across obfuscated versions without hardcoding method names:

  1. String Literals: Most resilient anchor. Locate methods referencing unique log strings or preference keys.

    kotlin
    Fingerprint(
        returnType = "V",
        strings = listOf("brave.origin.package_name_android", "brave.origin.product_id_android")
    )
  2. Signature & Parameter Filtering: Match methods by strict parameter and return type signatures.

    kotlin
    Fingerprint(
        returnType = "Z",
        parameters = listOf("Lorg/chromium/chrome/browser/profiles/Profile;"),
        strings = listOf("getIsSubscriptionActive profile is null")
    )
  3. Instruction Filters & Register Sniffing:

    kotlin
    val fp = Fingerprint(
        definingClass = "Lorg/chromium/chrome/browser/settings/BraveOriginPreferences;",
        returnType = "V",
        parameters = listOf("Ljava/lang/String;", "Landroid/os/Bundle;"),
        filters = listOf(
            methodCall(definingClass = "Lcom/target/Class;", name = "predicate", returnType = "Z")
        )
    )
    val matchIndex = fp.instructionMatches.first().index
    val targetReg = fp.method.getInstruction<OneRegisterInstruction>(matchIndex + 1).registerA

    Runtime safety (device-proven): never remove+replace a lone invoke and never grow the register frame. Both cause device-only VerifyError boot crashes that a green runPatchTest does not catch. Insert-only after move-result, reusing existing registers. See agy-orchestrator references/observations.md:40-41.


5. Metadata Contracts (Constants.kt)

Every patch must reference the shared compatibility object defined centrally in Constants.kt. Never inline Compatibility(...) objects.

Active targets defined in Constants.kt:

  1. Brave: Constants.COMPATIBILITY_BRAVE (com.brave.browser)
  2. Gboard Lite: Constants.COMPATIBILITY_GBOARD (com.google.android.inputmethod.latin)
  3. Hevy: Constants.COMPATIBILITY_HEVY (com.hevy)
  4. TikTok: Constants.COMPATIBILITY_TIKTOK (com.zhiliaoapp.musically)
  5. NokoPrint: Constants.COMPATIBILITY_NOKOPRINT (com.nokoprint)
  6. Xiaomi Earbuds: Constants.COMPATIBILITY_XIAOMI_EARBUDS (com.mi.earphone)

Single Target Version Invariant: Every target app maintains strictly ONE active version (the latest supported release) in targets = listOf(AppTarget(...)). Never retain older versions or multi-version entries in targets.


Show full SKILL.md (299 more words)Show less

6. Diagnostic Telemetry Invariants & Harness Compliance

Every patch execution must emit concise, high-signal diagnostic telemetry captured by Morphe Manager / CLI logs ([WARN] [STDIO]: [...]). Patches must satisfy the following invariants tested by RE and audit harnesses:

  1. Standardized Prefix: Every log line must start with the bracketed patch name prefix: println("[Patch Name] ...").
  2. Dynamic Mutation Counter: Track injected modifications with a local counter:
    kotlin
    var patched = 0
  3. Development Triage vs Final Zero-Mismatch Gate: Wrap risky hook/fingerprint blocks in try/catch during development to allow partial degradation and pinpoint shifting targets without halting the suite prematurely:
    kotlin
    try {
        // fingerprint resolution and hook injection
        patched++
    } catch (e: Exception) {
        println("[Patch Name] Component note: ${e.message}")
    }
    CRITICAL GATE: Prior to final verification, committing, or release, every single fingerprint failure (Failed to match the fingerprint) MUST be resolved to the new shifted target or pruned if the feature was deleted upstream. Retaining failing fingerprints in production/committed code is strictly forbidden.
  4. Consolidated Summary Log: Emit a quantifiable summary upon completing operations:
    kotlin
    println("[Patch Name] Successfully applied $patched hooks across target components.")
  5. Anti-Spam & Bounded Output: Never dump thousands of lines or unbounded file trees. Repetitive items must be summarized or bounded to short representative samples (e.g. .take(6)).
  6. Failure & Guard Transparency: If an operation is skipped or safely aborted (e.g. missing targets or preconditions), log an explicit descriptive reason so issues can be immediately diagnosed from user-submitted logs.
  7. Zero Emojis Policy: Never use emojis in telemetry logs, exceptions, or console output. All logging must use clean, standard ASCII / plain-text formatting (e.g. [INFO], [WARN], [PASS], [FAIL]).

7. Mandatory Verification Gate

Static checks are never enough. Run the in-situ patching gate defined in AGENTS.md (Section 3, Step 4): ./gradlew runPatchTest -Papp=<targetApp> (targets: gboard, tiktok, brave, hevy, nokoprint, xiaomi_earbuds), adding -PallOptions=true when the change sits behind an option.

© kveld9, GPL-3.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in .agents/skills/morphe-patcher of kveld9/kveld-morphe-patches.

Open the folder on GitHubat commit 32e9c2f

Compare with similar skills

Morphe Patcher next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Morphe Patcher compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Morphe Patcher this skillkveld9/kveld-morphe-patches113—~2.4kAutomated safety check: PassGPL-3.0
Compose Multiplatform Patternsmonta-app/ocpp-emulator1805 repos~2kAutomated safety check: PassApache-2.0
Phone HarnessShawnPana/phone-harness3.2k—~4.3kAutomated safety check: PassMIT
Stylesarindamxd/camerax-android1324 repos~2.3kAutomated safety check: PassApache-2.0
Verified Emailarindamxd/camerax-android1324 repos~4.7kAutomated safety check: PassApache-2.0
Argent Metro Debuggerbbplayer-app/BBPlayer1.2k—~3.4kAutomated safety check: PassMIT

Similar skills

  • Compose Multiplatform Patterns

    monta-app/ocpp-emulator

    Compose Multiplatform and Jetpack Compose patterns for KMP projects — state management, navigation, theming, performance, and platform-specific UI.

    180 GitHub starsUsed in 5 repos~2k tokens
    MobileAuto-check passed
  • Phone Harness

    ShawnPana/phone-harness

    Control the user's phone — an iPhone through the Mac's iPhone Mirroring window, an Android over adb, or a rented cloud Android: open apps, tap, type, swipe, read the screen.

    3.2k GitHub stars~4.3k tokensUpdated today
    MobileAuto-check passed
  • Styles

    arindamxd/camerax-android

    A skill your agent uses to integrate the Jetpack Compose Styles API into an Android project.

    132 GitHub starsUsed in 4 repos~2.3k tokens
    MobileAuto-check passed
  • Verified Email

    arindamxd/camerax-android

    Provides a complete workflow for implementing verified email retrieval on Android Credential Manager API.

    132 GitHub starsUsed in 4 repos~4.7k tokens
    MobileAuto-check passed
  • Argent Metro Debugger

    bbplayer-app/BBPlayer

    Debug a JS runtime via CDP using argent debugger tools. An agent skill from bbplayer-app/BBPlayer.

    1.2k GitHub stars~3.4k tokensUpdated 2 days ago
    MobileAuto-check passed
  • 统一 Android XML 资源命名:layout、drawable、mipmap、color、values、id 的前缀与 snakecase 规则;把颜色/圆角/描边/状态编码进文件名(bg、border、textcolor…selector)。

    1.6k GitHub stars~1.3k tokensUpdated 1 mo ago
    MobileAuto-check passed

More from kveld9/kveld-morphe-patches

  • Native Binary Patching

    kveld9/kveld-morphe-patches

    ARM64 ELF and binary asset patching guidelines covering libchrome.so host redirection, multi-candidate offset resolution, companion .so trimming, and Hermes bytecode patching.

    113 GitHub stars~1.6k tokensUpdated today
    Auto-check passed
  • Smali Bytecode Hooks

    kveld9/kveld-morphe-patches

    Smali and Dalvik bytecode hooking guidelines, register architecture conventions, multi-return reverse traversal, TwoRegisterInstruction extraction, reflection bridges, and obfuscation guidelines.

    113 GitHub stars~1.7k tokensUpdated today
    Auto-check passed
  • Release Conventions

    kveld9/kveld-morphe-patches

    Semantic release and CI/CD lifecycle, conventional commit standards, release pipeline chain (release.yml and .releaserc), and git branching strategy.

    113 GitHub stars~1k tokensUpdated today
    Auto-check passed

Works with

Categories

Questions about Morphe Patcher

What does Morphe Patcher do?

Architecture, patch typology (bytecodePatch, resourcePatch, rawResourcePatch), universal patches, stringOption DSL, fingerprint resolution, compatibility contracts (Constants.kt), and diagnostic…. Morphe Patcher is an agent skill from kveld9/kveld-morphe-patches.kt), and diagnostic telemetry invariants.

When should I use Morphe Patcher?

Morphe Patcher fits situations like: mobile work in your project.

How do I install Morphe Patcher in Claude Code?

Run `npx skills add kveld9/kveld-morphe-patches --skill morphe-patcher -a claude-code`. Or copy the skill folder (.agents/skills/morphe-patcher in kveld9/kveld-morphe-patches) into .claude/skills/morphe-patcher in your project. Claude Code loads it when a task matches its description.

How do I install Morphe Patcher in Codex?

Run `npx skills add kveld9/kveld-morphe-patches --skill morphe-patcher -a codex`. Or copy the skill folder (.agents/skills/morphe-patcher in kveld9/kveld-morphe-patches) into .agents/skills/morphe-patcher in your project. Codex loads it when a task matches its description.

Can I use Morphe Patcher in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add kveld9/kveld-morphe-patches --skill morphe-patcher -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/morphe-patcher, .gemini/skills/morphe-patcher, .github/skills/morphe-patcher and .opencode/skills/morphe-patcher in your project.

What does Morphe Patcher need to run?

SKILL.md names no scripts, command-line tools or credentials: Morphe Patcher is instructions for the agent only.

Does Morphe Patcher access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Morphe Patcher safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Morphe Patcher use?

Morphe Patcher is published under the GPL-3.0 licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Morphe Patcher use?

About 2.4k tokens (SKILL.md is roughly 9.4k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Morphe Patcher?

Skills that share tags, products or a category with Morphe Patcher: Compose Multiplatform Patterns (monta-app/ocpp-emulator, 180 stars), Phone Harness (ShawnPana/phone-harness, 3.2k stars), Styles (arindamxd/camerax-android, 132 stars) and Verified Email (arindamxd/camerax-android, 132 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Morphe Patcher?

kveld9 (a GitHub user) maintains it in kveld9/kveld-morphe-patches, which has 113 GitHub stars. The repository holds 4 skills in this directory. The repository was last updated on October 10, 2026.

Source: kveld9/kveld-morphe-patches on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.