patina
patina — a deterministic, auditable AI-writing humanizer for Korean, English, Chinese, and Japanese.
Safety scan
A static text scan, not a guarantee. Select the badge to see what was scanned and every finding.
Badge for your README
Markdown
[](/listings/devswha--patina)HTML
<a href="/listings/devswha--patina"><img src="/api/listings/devswha--patina/badge.svg" alt="findsafeskills safety rating" /></a>Install
Install instructions from the README
As written by the repo's author. findsafeskills has not verified these steps.
**Version: 9.1.0.** npm publication is a separate, explicitly authorized step. See [release channels](docs/integrations/release.md).
**Browser — nothing to install.** Open **[patina.vibetip.help](https://patina.vibetip.help/?lang=en&utm_source=github&utm_campaign=multilingual-20260907)** and paste text. Rewrites run server-side with the MPS/fidelity gates; API mode forwards your own key per request (never stored or logged).
[Hosted API (Pro)](docs/HTTP-API.md)
**Agent skill — paste this into Claude Code, Codex CLI, Cursor, or any agent:**
Install patina by following https://raw.githubusercontent.com/devswha/patina/main/INSTALLATION.md
**Agent skill — already using the skills.sh CLI:** `npx skills add devswha/patina` (installs the whole checkout for 75+ agents; entries on [skills.sh](https://skills.sh) come from install telemetry — no listing to submit). patina is a meaning-preserving editor (MPS-verified; KO·EN·ZH·JA), not a detector bypass.
Then use it:
/patina --lang en [paste your text here]
**CLI — Node >= 18:**
npx patina-cli --lang en input.txt # rewrite npx patina-cli doctor # check backends and keys
A logged-in `codex`, `claude`, or `gemini` CLI works with no API key: add `--backend codex-cli`. Full install options: [INSTALLATION.md](INSTALLATION.md).
What was scanned
The files the safety scan read, as written by the repository's author and shown as plain text. Lines with a finding are marked.
.claude-plugin/marketplace.json · Manifest · 32 lines
View this file on GitHub (read at the repository's current version: the scan did not record which commit it read)
- {
- "$schema": "https://www.schemastore.org/claude-code-marketplace.json",
- "name": "patina",
- "description": "patina — a deterministic, auditable AI-writing humanizer for Korean, English, Chinese, and Japanese.",
- "owner": {
- "name": "devswha",
- "url": "https://github.com/devswha"
- },
- "plugins": [
- {
- "name": "patina",
- "source": "./",
- "version": "9.1.0",
- "description": "Strip the AI packaging, keep the meaning. Detect and rewrite AI writing patterns across KO/EN/ZH/JA with MPS/fidelity checks. Runs the root SKILL.md as the /patina skill.",
- "homepage": "https://github.com/devswha/patina",
- "repository": "https://github.com/devswha/patina",
- "license": "MIT",
- "keywords": [
- "humanize",
- "ai-writing",
- "ai-detector",
- "translationese",
- "korean",
- "english",
- "chinese",
- "japanese",
- "윤문",
- "번역투"
- ]
- }
- ]
- }
README.md · README · 149 lines
View this file on GitHub (read at the repository's current version: the scan did not record which commit it read)
- <p align="center">
- <img src="assets/brand/patina-mark.svg" alt="patina mark" width="172">
- </p>
- <h1 align="center">patina</h1>
- <p align="center">
- <strong>Strip the AI packaging. Keep the meaning.</strong>
- </p>
- <p align="center">
- <a href="README_KR.md"><b>한국어</b></a> ·
- <a href="README_ZH.md"><b>中文</b></a> ·
- <a href="README_JA.md"><b>日本語</b></a> ·
- <b>English</b>
- </p>
- <p align="center">
- <a href="https://github.com/devswha/patina/actions/workflows/test.yml"><img alt="Tests" src="https://github.com/devswha/patina/actions/workflows/test.yml/badge.svg"></a>
- <a href="https://opensource.org/licenses/MIT"><img alt="License: MIT" src="https://img.shields.io/badge/License-MIT-yellow.svg"></a>
- <a href="#quick-start"><img alt="Skill: Claude Code | Codex | Cursor | OpenCode" src="https://img.shields.io/badge/Skill-Claude%20Code%20%7C%20Codex%20%7C%20Cursor%20%7C%20OpenCode-blueviolet"></a>
- <a href="https://github.com/devswha/patina"><img alt="Languages: KO | EN | ZH | JA" src="https://img.shields.io/badge/Languages-KO%20%7C%20EN%20%7C%20ZH%20%7C%20JA-green"></a>
- <a href="CHANGELOG.md"><img alt="Version" src="https://img.shields.io/badge/version-9.1.0-blue"></a>
- </p>
- <p align="center">
- <a href="https://patina.vibetip.help/?lang=en&utm_source=github&utm_campaign=multilingual-20260907"><b>Try it in the browser — no install</b></a>
- </p>
- **An illustrative email edit**
- **Before**
- > I'm writing to let you know that the launch review is scheduled for Friday at 2 p.m. The draft is 6 pages long, and two questions about pricing are still open.
- **After**
- > The launch review is Friday at 2 p.m. The draft has 6 pages and two open pricing questions.
- A curated excerpt from [the English email showcase](playground/examples/en.js). This is a synthetic example, not a live run or a measured score.
- patina is a deterministic, pattern-based humanizer for Korean, English, Chinese, and Japanese. It finds AI-sounding phrasing and rewrites it **without changing the claim, numbers, polarity, or causation** — built for allowed AI-assisted drafting, not for evading detectors.
- - **Auditable, not a black box** — 189 named patterns drive every edit; `--diff` shows exactly what changed and why.
- - **Meaning verified on the web** — web gates each rewrite with MPS/fidelity floors, rejecting drift; CLI `--verify` and `/patina --strict` add checks.
- - **Three independent axes** — Document Type owns genre, Persona owns voice, Register owns delivery. Omit any axis to preserve the source.
- - **Every surface** — agent skill (Claude Code · Codex · Cursor · OpenCode), Node CLI, and a [browser playground](https://patina.vibetip.help/?lang=en&utm_source=github&utm_campaign=multilingual-20260907).
- - **Honest about limits** — scores are editing signals, not authorship proof; our own [pre-registered study](docs/research/2026-rewrite-efficacy-study1.md) publishes where rewriting fails alongside where it works.
- ## Quick Start
- **Version: 9.1.0.** npm publication is a separate, explicitly authorized step. See [release channels](docs/integrations/release.md).
- **Browser — nothing to install.** Open **[patina.vibetip.help](https://patina.vibetip.help/?lang=en&utm_source=github&utm_campaign=multilingual-20260907)** and paste text. Rewrites run server-side with the MPS/fidelity gates; API mode forwards your own key per request (never stored or logged).
- [Hosted API (Pro)](docs/HTTP-API.md)
- **Agent skill — paste this into Claude Code, Codex CLI, Cursor, or any agent:**
- ```text
- Install patina by following https://raw.githubusercontent.com/devswha/patina/main/INSTALLATION.md
- ```
- **Agent skill — already using the skills.sh CLI:** `npx skills add devswha/patina` (installs the whole checkout for 75+ agents; entries on [skills.sh](https://skills.sh) come from install telemetry — no listing to submit). patina is a meaning-preserving editor (MPS-verified; KO·EN·ZH·JA), not a detector bypass.
- Then use it:
- ```text
- /patina --lang en
- [paste your text here]
- ```
- **CLI — Node >= 18:**
- ```bash
- npx patina-cli --lang en input.txt # rewrite
- npx patina-cli doctor # check backends and keys
- ```
- A logged-in `codex`, `claude`, or `gemini` CLI works with no API key: add `--backend codex-cli`. Full install options: [INSTALLATION.md](INSTALLATION.md).
- ## Three Independent Axes
- patina does not infer one axis from another. Omit Persona and Register to keep the source voice and register.
- | Axis | Controls | Does not control | Select with |
- |---|---|---|---|
- | **Document Type** | Genre, purpose, structural conventions, pattern policy | Voice, casual/professional delivery, meaning floors | `--document-type` · config `document-type` · Playground "Document Type" |
- | **Persona** | Reusable voice fingerprint: vocabulary, rhythm, explanation habits | Genre, pattern policy, register, meaning floors | `--persona` · config `persona` · Playground "Persona" |
- | **Register** | `casual` or `professional` delivery | Genre, persona identity, pattern policy | `--register` · config `register` · Playground "Register" |
- Meaning preservation is the outer guard; an explicit value never fills an omitted axis.
- ## Commands
- ```bash
- patina input.txt # rewrite with defaults
- patina --audit input.txt # detect patterns only
- patina --score --offline --exit-on 30 input.txt # deterministic CI gate, no API key
- patina --diff input.txt # pattern-by-pattern changes
- patina --verify input.txt # rewrite + MPS/fidelity floor check
- patina --document-type email --register professional input.txt
- patina persona new my-voice --from-sample past-posts.txt # learn a reusable voice
- patina --persona my-voice draft.md
- patina --batch docs/*.md --outdir cleaned/
- ```
- `patina --help` prints the full flag list. CI wrapper for GitHub Actions: [devswha/patina-action](https://github.com/devswha/patina-action) — plus [pre-commit](docs/integrations/pre-commit.md), [Docker](docs/integrations/docker.md), and [release](docs/integrations/release.md) guides.
- Editor clients: the VS Code, Obsidian and Gmail preview clients are retired. See the [historical record](docs/integrations/editors.md).
- Model evidence: [writing/scoring guide (Korean)](docs/research/model-guide-20260905.md), [rewrite confirmation](docs/research/model-rewrite-confirmation-20260905.md), and [live scoring diagnostics](docs/benchmarks/live-rebaseline-20260905.md).
- Project config lives in `.patina.yaml`:
- ```yaml
- version: "9.1.0"
- language: ko # ko | en | zh | ja
- document-type: default # genre/purpose + pattern policy
- persona: # optional reusable voice; omit to preserve source
- register: # casual | professional; omit to preserve source
- ```
- ## Facts
- | | |
- |---|---|
- | **189 patterns** | 41 rewrite-capable (KO) / 38 (EN) / 37 (ZH, JA) + 9 score-only viral-hook per language — see the full 189-pattern catalog in [PATTERNS.md](docs/PATTERNS.md) |
- | **Modes** | rewrite · verify · audit · score · diff |
- | **Calibration** | 67.3% editing-hotspot catch [63.5–71.0%] across GPT-5.5 / Claude Sonnet 4.6 / Gemini 2.5 Pro (n=600, KO+EN); 16.0% false positives [11.6–21.7%] on KO+EN human controls (n=200) |
- | **License** | MIT |
- Scores are editing signals with false positives and false negatives, not proof of authorship. See [Ethics](docs/ETHICS.md).
- ## Documentation
- [Historical English playground recording](https://raw.githubusercontent.com/devswha/patina/main/assets/demo/patina-demo-live-en.gif) · [recording context](assets/demo/README.md). The recording is an earlier run, separate from the curated examples above.
- - [Cookbook](docs/COOKBOOK.md) — common recipes · [CLI contract](docs/CLI.md) — flags, gates, exit codes
- - [Before/After gallery](docs/EXAMPLES.md) ([한국어](docs/EXAMPLES_KR.md)) · [Pattern catalog](docs/PATTERNS.md)
- - [Architecture](docs/ARCHITECTURE.md) · [Configuration & authentication](docs/AUTHENTICATION.md)
- - [Benchmarks](docs/benchmarks/latest.md) · [Research](docs/research/2026-rewrite-efficacy-study1.md) · [FAQ](docs/FAQ.md) ([한국어](docs/FAQ_KR.md))
- - [Contributing](CONTRIBUTING.md) ([한국어](CONTRIBUTING_KR.md)) · [Changelog](CHANGELOG.md)
- To submit a pattern, use [CONTRIBUTING.md](CONTRIBUTING.md). Open a [pattern proposal](https://github.com/devswha/patina/issues/new?template=pattern_proposal.yml) ([`.github/ISSUE_TEMPLATE/pattern_proposal.yml`](.github/ISSUE_TEMPLATE/pattern_proposal.yml)), then add the pack from the template in `patterns/{lang}-*.md`. See [pattern of the week](docs/community/pattern-of-the-week.md) for one worked pair.
- ## License
- MIT. See [LICENSE](LICENSE) and [NOTICE](NOTICE). Inspired by [oh-my-zsh](https://github.com/ohmyzsh/ohmyzsh), [Wikipedia's "Signs of AI writing"](https://en.wikipedia.org/wiki/Wikipedia:Signs_of_AI_writing), and [blader/humanizer](https://github.com/blader/humanizer).
install.sh · Bundled script · 324 lines · 1 finding marked
- #!/bin/sh
- # install.sh - Install patina for Claude Code and other AI agents
- # Usage: curl -fsSL https://raw.githubusercontent.com/devswha/patina/main/install.sh | bash
- Note: Pipes a downloaded script directly into a shell (curl | sh / wget | bash)
- Line 3 on GitHub
- set -e
- # Agent targets (set env vars to enable; all enabled by default if none specified)
- INSTALL_CLAUDE="${INSTALL_CLAUDE:-true}"
- INSTALL_CODEX="${INSTALL_CODEX:-true}"
- INSTALL_CURSOR="${INSTALL_CURSOR:-true}"
- INSTALL_OPCODE="${INSTALL_OPCODE:-true}"
- CLAUDE_SKILLS_DIR="${HOME}/.claude/skills"
- CODEX_SKILLS_DIR="${HOME}/.codex/skills"
- CURSOR_RULES_DIR="${HOME}/.cursor/rules"
- OPCODE_SKILLS_DIR="${HOME}/.config/opencode/skills"
- PATINA_DIR="${CLAUDE_SKILLS_DIR}/patina"
- REPO_URL="https://github.com/devswha/patina.git"
- # Pin the installed checkout to a concrete ref. If unset, resolve the current
- # remote HEAD once and check out that commit instead of tracking main.
- PATINA_REF="${PATINA_REF:-}"
- PATINA_REPO_READY=""
- # Colors (only when outputting to a terminal)
- if [ -t 1 ] && [ -z "${NO_COLOR:-}" ]; then
- GREEN='\033[0;32m'
- YELLOW='\033[0;33m'
- RED='\033[0;31m'
- BOLD='\033[1m'
- RESET='\033[0m'
- else
- GREEN=''
- YELLOW=''
- RED=''
- BOLD=''
- RESET=''
- fi
- info() {
- printf "%b\n" "${BOLD}$1${RESET}"
- }
- warn() {
- printf "%b\n" "${YELLOW}$1${RESET}"
- }
- success() {
- printf "%b\n" "${GREEN}$1${RESET}"
- }
- error() {
- printf "%b\n" "${RED}Error: $1${RESET}" >&2
- exit 1
- }
- is_cursor_product_rule() {
- awk '
- NR == 1 && $0 == "---" { next }
- NR == 2 && $0 == "description: Apply Patina product instructions when humanizing text." { next }
- NR == 3 && $0 == "alwaysApply: false" { next }
- NR == 4 && $0 == "---" { next }
- NR == 5 && $0 == "" { next }
- NR == 6 && $0 == "<!-- patina-cursor-product-adapter -->" { found = 1; exit 0 }
- { exit 1 }
- END { if (!found) exit 1 }
- ' "$1"
- }
- cursor_target_replaceable() {
- target="$1"
- if [ ! -e "${target}" ] && [ ! -L "${target}" ]; then
- return 0
- fi
- if [ -L "${target}" ]; then
- return 1
- fi
- [ -f "${target}" ] && is_cursor_product_rule "${target}"
- }
- # Check prerequisites
- command -v git >/dev/null 2>&1 || error "git is not installed. Please install git first."
- resolve_install_ref() {
- if [ -n "${PATINA_REF}" ]; then
- printf "%s" "${PATINA_REF}"
- return 0
- fi
- git ls-remote "${REPO_URL}" HEAD 2>/dev/null | awk 'NR == 1 { print $1 }'
- }
- checkout_install_ref() {
- dir="$1"
- ref="$2"
- set +e
- (
- cd "${dir}"
- git fetch --depth=1 origin "${ref}" || exit 10
- git checkout --detach FETCH_HEAD >/dev/null 2>&1 || exit 11
- )
- rc="$?"
- set -e
- if [ "${rc}" = "10" ]; then
- error "Failed to fetch patina ref '${ref}'. Use PATINA_REF=<tag-or-full-sha>."
- fi
- if [ "${rc}" = "11" ]; then
- error "Failed to check out patina ref '${ref}'."
- fi
- if [ "${rc}" != "0" ]; then
- error "Failed to install patina ref '${ref}'."
- fi
- }
- # Runtime readiness belongs to this checkout, not a dependency marker or a
- # globally linked CLI. Prepare dependencies only when actual startup fails.
- install_runtime_deps() {
- info "Skill files installed at ${PATINA_DIR}."
- info "Backend readiness: not checked. Installation does not select or authenticate a backend."
- command -v node >/dev/null 2>&1 || error "Runtime not ready: install Node.js >=18.1.0 and rerun the installer."
- if ! node -e 'const [major, minor] = process.versions.node.split(".").map(Number); process.exit(major > 18 || (major === 18 && minor >= 1) ? 0 : 1)'; then
- error "Runtime not ready: Node.js >=18.1.0 is required."
- fi
- if ! node "${PATINA_DIR}/bin/patina.js" --version >/dev/null 2>&1; then
- command -v npm >/dev/null 2>&1 || error "Runtime not ready: npm is required to prepare dependencies in ${PATINA_DIR}. Install npm and rerun the installer."
- info "Installing patina runtime dependencies from the lockfile..."
- if ! ( cd "${PATINA_DIR}" && npm ci --omit=dev --no-audit --no-fund ); then
- error "Runtime not ready: dependency installation failed in ${PATINA_DIR}. Resolve the npm error and rerun the installer."
- fi
- node "${PATINA_DIR}/bin/patina.js" --version || error "Runtime not ready: the installed CLI failed to start after dependency preparation."
- fi
- success "Local CLI runtime ready: node \"${PATINA_DIR}/bin/patina.js\" --version"
- }
- # Materialize Cursor's user rule from the canonical product skill. Cursor's
- # @file references are project-relative, so a symlinked adapter cannot safely
- # point back to this checkout from ~/.cursor/rules. Keep the Cursor frontmatter
- # separate, record the absolute installed skill paths, and copy the current
- # SKILL.md body verbatim.
- install_cursor_rule() {
- source="$1"
- target="$2"
- skill_dir="$(dirname "${source}")"
- helper="${skill_dir}/bin/patina-skill.js"
- tmp="${target}.tmp.$$"
- if ! cursor_target_replaceable "${target}"; then
- error "Cursor target exists but was not installed by patina: ${target}."
- fi
- if ! {
- printf '%s\n' \
- '---' \
- 'description: Apply Patina product instructions when humanizing text.' \
- 'alwaysApply: false' \
- '---' \
- '' \
- '<!-- patina-cursor-product-adapter -->' \
- 'Patina product integration context (generated from the canonical skill):' \
- "- Canonical product instructions: \"${source}\"" \
- "- Patina skill directory: \"${skill_dir}\"" \
- "- CLI-first helper: \`node \"${helper}\" --input <source-file> ...\`" \
- '- This generated Cursor adapter is not the canonical skill file. Resolve any skill-directory references using the absolute path above.'
- printf '%s' ''
- awk '
- NR == 1 && $0 == "---" {
- in_frontmatter = 1
- saw_frontmatter = 1
- next
- }
- in_frontmatter && $0 == "---" {
- in_frontmatter = 0
- saw_end = 1
- next
- }
- in_frontmatter { next }
- { print }
- END {
- if (!saw_frontmatter || !saw_end) exit 1
- }
- ' "${source}"
- } > "${tmp}"; then
- rm -f "${tmp}"
- error "Cursor product instructions could not be generated from ${source}."
- fi
- if ! cursor_target_replaceable "${target}"; then
- rm -f "${tmp}"
- error "Cursor target changed and was not installed by patina: ${target}."
- fi
- if ! mv -f "${tmp}" "${target}"; then
- rm -f "${tmp}"
- error "Cursor product instructions could not be installed at ${target}."
- fi
- }
- # Ensure the patina repo checkout exists at PATINA_DIR (clone or update once).
- # Idempotent and tool-neutral so any single agent can be installed on its own,
- # without requiring Claude Code to be installed first.
- ensure_patina_repo() {
- if [ -n "${PATINA_REPO_READY}" ]; then
- return 0
- fi
- if [ -d "${PATINA_DIR}/.git" ]; then
- info "Updating existing patina installation..."
- checkout_install_ref "${PATINA_DIR}" "${INSTALL_REF}"
- else
- if [ -d "${PATINA_DIR}" ]; then
- error "${PATINA_DIR} exists but is not a git repo. Remove it and try again."
- fi
- mkdir -p "$(dirname "${PATINA_DIR}")"
- info "Cloning patina at ${INSTALL_REF}..."
- git clone --depth=1 "${REPO_URL}" "${PATINA_DIR}" || error "Failed to clone patina. Check your network connection."
- checkout_install_ref "${PATINA_DIR}" "${INSTALL_REF}"
- fi
- install_runtime_deps
- PATINA_REPO_READY=1
- }
- INSTALL_REF="$(resolve_install_ref)"
- if [ -z "${INSTALL_REF}" ]; then
- error "Failed to resolve patina install ref. Set PATINA_REF=<tag-or-full-sha> and retry."
- fi
- # --- Claude Code ---
- if [ "${INSTALL_CLAUDE}" = "true" ]; then
- info "Installing for Claude Code..."
- ensure_patina_repo
- success "Claude Code: skill files installed"
- else
- warn "Skipping Claude Code installation (INSTALL_CLAUDE=false)"
- fi
- # --- Codex CLI ---
- if [ "${INSTALL_CODEX}" = "true" ]; then
- info "Installing for Codex CLI..."
- if [ ! -d "${CODEX_SKILLS_DIR}" ]; then
- info "Creating ${CODEX_SKILLS_DIR}..."
- mkdir -p "${CODEX_SKILLS_DIR}"
- fi
- ensure_patina_repo
- ln -snf "${PATINA_DIR}" "${CODEX_SKILLS_DIR}/patina"
- success "Codex: /patina linked to ${CODEX_SKILLS_DIR}"
- else
- warn "Skipping Codex installation (INSTALL_CODEX=false)"
- fi
- # --- Cursor ---
- if [ "${INSTALL_CURSOR}" = "true" ]; then
- info "Installing for Cursor..."
- if [ ! -d "${CURSOR_RULES_DIR}" ]; then
- info "Creating ${CURSOR_RULES_DIR}..."
- mkdir -p "${CURSOR_RULES_DIR}"
- fi
- # Generate the product adapter from the canonical skill, not the
- # repository-development Cursor rule.
- ensure_patina_repo
- if [ ! -f "${PATINA_DIR}/SKILL.md" ]; then
- error "Cursor product instructions not found at ${PATINA_DIR}/SKILL.md."
- fi
- install_cursor_rule "${PATINA_DIR}/SKILL.md" "${CURSOR_RULES_DIR}/patina.mdc"
- success "Cursor: product rules installed at ${CURSOR_RULES_DIR}/patina.mdc"
- else
- warn "Skipping Cursor installation (INSTALL_CURSOR=false)"
- fi
- # --- OpenCode / Sisyphus ---
- if [ "${INSTALL_OPCODE}" = "true" ]; then
- info "Installing for OpenCode / Sisyphus..."
- if [ ! -d "${OPCODE_SKILLS_DIR}" ]; then
- info "Creating ${OPCODE_SKILLS_DIR}..."
- mkdir -p "${OPCODE_SKILLS_DIR}"
- fi
- ensure_patina_repo
- # OpenCode loads the linked checkout's SKILL.md as the skill interface
- ln -snf "${PATINA_DIR}" "${OPCODE_SKILLS_DIR}/patina"
- success "OpenCode: skill linked to ${OPCODE_SKILLS_DIR}/patina"
- else
- warn "Skipping OpenCode installation (INSTALL_OPCODE=false)"
- fi
- # Done
- printf "\n"
- if [ -n "${PATINA_REPO_READY}" ]; then
- success "✓ patina skill files installed; local CLI runtime ready. Backend readiness not checked."
- else
- info "No agent targets enabled; nothing installed and runtime/backend readiness not checked."
- fi
- info " If it saves you edits, a star helps others find it → https://github.com/devswha/patina"
- printf "\n"
- info "Usage:"
- if [ "${INSTALL_CLAUDE}" = "true" ]; then
- printf " Claude Code:\n"
- printf " /patina Humanize Korean text\n"
- printf " /patina --lang en Humanize English text\n"
- fi
- if [ "${INSTALL_CODEX}" = "true" ]; then
- printf " Codex CLI:\n"
- printf " /patina Humanize Korean text\n"
- printf " /patina --lang en Humanize English text\n"
- fi
- if [ "${INSTALL_CURSOR}" = "true" ]; then
- printf " Cursor:\n"
- printf " Product rules loaded from ~/.cursor/rules/patina.mdc\n"
- fi
- if [ "${INSTALL_OPCODE}" = "true" ]; then
- printf " OpenCode / Sisyphus:\n"
- printf " Skill loaded from ~/.config/opencode/skills/patina\n"
- printf " Instructions: SKILL.md\n"
- fi
- printf "\n"
- info "Environment variables to control installation:"
- printf " PATINA_REF=<tag-or-full-sha> Pin installed checkout (default: resolved remote HEAD SHA)\n"
- printf " INSTALL_CLAUDE=true|false (default: true)\n"
- printf " INSTALL_CODEX=true|false (default: true)\n"
- printf " INSTALL_CURSOR=true|false (default: true)\n"
- printf " INSTALL_OPCODE=true|false (default: true)\n"
- printf "\n"
uninstall.sh · Bundled script · 135 lines · 1 finding marked
- #!/bin/sh
- # uninstall.sh - Remove patina from Claude Code and other AI agents
- # Usage: curl -fsSL https://raw.githubusercontent.com/devswha/patina/main/uninstall.sh | bash
- Note: Pipes a downloaded script directly into a shell (curl | sh / wget | bash)
- Line 3 on GitHub
- #
- # This only removes what install.sh creates. If you installed via the Claude Code
- # plugin marketplace (/plugin install patina@patina), uninstall with:
- # /plugin uninstall patina@patina
- set -e
- # Agent targets (set env vars to disable individually; all enabled by default)
- UNINSTALL_CLAUDE="${UNINSTALL_CLAUDE:-true}"
- UNINSTALL_CODEX="${UNINSTALL_CODEX:-true}"
- UNINSTALL_CURSOR="${UNINSTALL_CURSOR:-true}"
- UNINSTALL_OPCODE="${UNINSTALL_OPCODE:-true}"
- CLAUDE_SKILLS_DIR="${HOME}/.claude/skills"
- CODEX_SKILLS_DIR="${HOME}/.codex/skills"
- CURSOR_RULES_DIR="${HOME}/.cursor/rules"
- OPCODE_SKILLS_DIR="${HOME}/.config/opencode/skills"
- PATINA_DIR="${CLAUDE_SKILLS_DIR}/patina"
- # Colors (only when outputting to a terminal)
- if [ -t 1 ] && [ -z "${NO_COLOR:-}" ]; then
- BOLD="$(printf '\033[1m')"
- GREEN="$(printf '\033[32m')"
- YELLOW="$(printf '\033[33m')"
- RED="$(printf '\033[31m')"
- RESET="$(printf '\033[0m')"
- else
- BOLD=""
- GREEN=""
- YELLOW=""
- RED=""
- RESET=""
- fi
- info() {
- printf "%b\n" "${BOLD}$1${RESET}"
- }
- warn() {
- printf "%b\n" "${YELLOW}$1${RESET}"
- }
- success() {
- printf "%b\n" "${GREEN}$1${RESET}"
- }
- is_cursor_product_rule() {
- awk '
- NR == 1 && $0 == "---" { next }
- NR == 2 && $0 == "description: Apply Patina product instructions when humanizing text." { next }
- NR == 3 && $0 == "alwaysApply: false" { next }
- NR == 4 && $0 == "---" { next }
- NR == 5 && $0 == "" { next }
- NR == 6 && $0 == "<!-- patina-cursor-product-adapter -->" { found = 1; exit 0 }
- { exit 1 }
- END { if (!found) exit 1 }
- ' "$1"
- }
- error() {
- printf "%b\n" "${RED}$1${RESET}" >&2
- exit 1
- }
- REMOVED=0
- # --- Codex CLI (symlink) ---
- if [ "${UNINSTALL_CODEX}" = "true" ]; then
- TARGET="${CODEX_SKILLS_DIR}/patina"
- if [ -L "${TARGET}" ]; then
- rm -f "${TARGET}"
- success "Codex: removed ${TARGET}"
- REMOVED=1
- elif [ -e "${TARGET}" ]; then
- warn "Codex: ${TARGET} exists but is not a symlink; leaving it untouched."
- fi
- fi
- # --- Cursor (generated rule) ---
- if [ "${UNINSTALL_CURSOR}" = "true" ]; then
- TARGET="${CURSOR_RULES_DIR}/patina.mdc"
- if [ -L "${TARGET}" ]; then
- warn "Cursor: ${TARGET} is a symlink; leaving it untouched."
- elif [ -f "${TARGET}" ] && is_cursor_product_rule "${TARGET}"; then
- rm -f "${TARGET}"
- success "Cursor: removed ${TARGET}"
- REMOVED=1
- elif [ -e "${TARGET}" ]; then
- warn "Cursor: ${TARGET} exists but was not installed by patina; leaving it untouched."
- fi
- fi
- # --- OpenCode / Sisyphus (symlink) ---
- if [ "${UNINSTALL_OPCODE}" = "true" ]; then
- TARGET="${OPCODE_SKILLS_DIR}/patina"
- if [ -L "${TARGET}" ]; then
- rm -f "${TARGET}"
- success "OpenCode: removed ${TARGET}"
- REMOVED=1
- elif [ -e "${TARGET}" ]; then
- warn "OpenCode: ${TARGET} exists but is not a symlink; leaving it untouched."
- fi
- fi
- # --- Claude Code (cloned repo) ---
- # Remove last so the symlinks above are cleared before their target disappears.
- if [ "${UNINSTALL_CLAUDE}" = "true" ]; then
- if [ -L "${PATINA_DIR}" ]; then
- rm -f "${PATINA_DIR}"
- success "Claude Code: removed symlink ${PATINA_DIR}"
- REMOVED=1
- elif [ -d "${PATINA_DIR}/.git" ]; then
- rm -rf "${PATINA_DIR}"
- success "Claude Code: removed ${PATINA_DIR}"
- REMOVED=1
- elif [ -d "${PATINA_DIR}" ]; then
- error "${PATINA_DIR} exists but is not a patina git clone. Remove it manually if you are sure."
- fi
- fi
- printf "\n"
- if [ "${REMOVED}" = "1" ]; then
- success "✓ patina uninstalled."
- else
- warn "Nothing to remove. patina was not found in the standard install locations."
- info "If you installed via the Claude Code plugin marketplace, run: /plugin uninstall patina@patina"
- fi
- printf "\n"
- info "Environment variables to control uninstallation:"
- printf " UNINSTALL_CLAUDE=true|false (default: true)\n"
- printf " UNINSTALL_CODEX=true|false (default: true)\n"
- printf " UNINSTALL_CURSOR=true|false (default: true)\n"
- printf " UNINSTALL_OPCODE=true|false (default: true)\n"
Ratings and comments
Sign in to rate this skill.
Sign inFree to use. If it’s helped, pass it on.