Agent skill

Add Pattern

by devlint in devlint/GitWand

Add a new conflict-resolution pattern to GitWand core. An agent skill from devlint/GitWand.

MITAuto-check passedBackend & APIs

Install Add Pattern

skills CLI
$ npx skills add devlint/GitWand --skill add-pattern -a claude-code

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

GitHub CLI
$ gh skill install devlint/GitWand add-pattern --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/devlint/GitWand.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.claude/skills/add-pattern .claude/skills/add-pattern && 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
add-pattern
GitHub stars
180
Token cost
~2.3k tokens
SKILL.md length
566 words
Files
1
Skills in repo
5
Repo updated
First seen
Licence
MIT

At a glance

Add a new conflict-resolution pattern to GitWand core. An agent skill from devlint/GitWand.

  • Works in 8 steps: Gather information before writing any code → Add the ConflictType to types.ts → Create the pattern file → …
  • Someone wants to add a pattern
  • SKILL.md covers Step 1 — Gather information…, Step 2 — Add the ConflictType…, Step 3 — Create the pattern file and Step 4 — Register the pattern…, plus 4 more sections
  • Calls pnpm

What it does

Add Pattern is an agent skill from devlint/GitWand. Add a new conflict-resolution pattern to GitWand core. Use this skill whenever someone wants to add a pattern, resolution rule, new conflict case, new heuristic, teach the resolver to handle a new kind of conflict automatically, or extend the pattern registry with a new ConflictType.

Its SKILL.md is about 2.3k 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 Backend & APIs, covering GraphQL. It works with Git. The repository describes itself as: The Git client that actually resolves conflicts: 8 deterministic patterns auto-resolve the ones that were never decisions, full trace on the rest. Native (Tauri 2 + Rust), free… The licence is MIT.

When your agent uses it

  • Someone wants to add a pattern
  • Resolution rule
  • New conflict case
  • Teach the resolver to handle a new kind of conflict automatically

Example prompts

  • “/add-pattern”

Workflow steps

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

  1. Gather information before writing any code
  2. Add the ConflictType to types.ts
  3. Create the pattern file
  4. Register the pattern in classifier.ts
  5. Add a resolution case in resolver/assemble.ts
  6. Write the tests
  7. Check Rust parity
  8. Validation

What it can do on your machine

Read from SKILL.md and the folder at commit 20114ac. 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

    Shell commands in SKILL.md call:

    • pnpm

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

  • Network

    No URLs in SKILL.md. Its commands use pnpm, which can reach the network depending on how they are called.

    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

Add Pattern loads about 2.3k tokens when it runs. Until then it costs about 74 tokens; SKILL.md has 566 words of instructions outside code blocks.

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

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 devlint/GitWand at commit 20114ac, republished under its MIT licence (© devlint). 566 words, ~2,283 tokens.

Download SKILL.mdSave it as .claude/skills/add-pattern/SKILL.md (or your agent's skills folder).
name
add-pattern
description
Add a new conflict-resolution pattern to GitWand core. Use this skill whenever someone wants to add a pattern, resolution rule, new conflict case, new heuristic, teach the resolver to handle a new kind of conflict automatically, or extend the pattern registry with a new ConflictType.

Skill: add-pattern

Guide the agent through every step needed to add a new conflict-resolution pattern from end to end, touching all four required locations in the right order.


Step 1 — Gather information before writing any code

Ask the following questions up front. Do not start editing files until you have clear answers.

  1. Name — What is the snake_case name for this pattern? (e.g. comment_only_change, empty_block_insertion)

  2. Trigger condition — In plain English, when does this pattern apply? Be precise: what must be true of oursLines, theirsLines, and optionally baseLines for the pattern to fire?

  3. Resolution strategy — What should the merged output look like when this pattern fires? (accept ours, accept theirs, union, base + additions, etc.)

  4. Confidence score — What typeClassification value (0–100) do you propose, and why? What dataRisk value (0–100, where 0 = safe)? Use the existing patterns as a reference:

    • same_change / one_side_change / delete_no_change → typeClassification 100, dataRisk 0
    • non_overlapping → typeClassification 90, dataRisk 20
    • whitespace_only / reorder_only / insertion_at_boundary → typeClassification 85–90, dataRisk 8–20
    • value_only_change → typeClassification 72–88, dataRisk 25
  5. Priority — What numeric priority should this pattern have? Lower = evaluated earlier. Current assignments:

    • 10 same_change, 20 delete_no_change, 30 one_side_change
    • 40 non_overlapping, 50 whitespace_only, 55 reorder_only
    • 57 insertion_at_boundary, 60 value_only_change, 999 complex Pick a value that places it at the right point in the evaluation chain.
  6. requires — Does the pattern need the base (diff3), work without it (diff2), or both? Use "diff3", "diff2", or "both".


Step 2 — Add the ConflictType to types.ts

packages/core/src/types.ts contains the ConflictType union. Add the new type name there before creating the pattern file — TypeScript will then flag every location that needs updating.

typescript
// packages/core/src/types.ts
export type ConflictType =
  | "same_change"
  | "one_side_change"
  // ... existing types ...
  | "my_new_pattern"   // ← add here, with a short comment
  | "complex";

Also add a readable summary string for it in the buildSummary() switch inside packages/core/src/classifier.ts:

typescript
case "my_new_pattern":
  return "One-line human-readable description of the resolution.";

Step 3 — Create the pattern file

Create packages/core/src/patterns/<name>.ts.

The file must export a default PatternPlugin object — not a plain function. Copy the structure below and fill in every field.

typescript
/**
 * Pattern `my_new_pattern`
 *
 * <Two-sentence description of what this pattern detects and why it is safe
 * to auto-resolve.>
 *
 * Priority: <N> (<before/after which existing pattern>)
 * Requires: <diff3 | diff2 | both>
 */

import type { ClassifyInput, ConfidenceScore, PatternPlugin } from "../types.js";
import { scopeImpact, makeScore } from "./utils.js";

const myNewPattern: PatternPlugin = {
  type: "my_new_pattern",
  priority: <N>,
  requires: "<diff3|diff2|both>",

  detect(h: ClassifyInput): boolean {
    // Return true when this pattern applies.
    // Be conservative — false positives are worse than false negatives.
    return false; // replace with real logic
  },

  confidence(h: ClassifyInput): ConfidenceScore {
    const totalLines = Math.max(h.oursLines.length, h.theirsLines.length);
    return makeScore(
      <typeClassification>,  // 0–100, certainty of the classification
      <dataRisk>,            // 0–100, 0 = no data loss risk
      scopeImpact(totalLines),
      ["<booster: why we are confident>"],
      ["<penalty: why we are cautious, or empty array>"],
    );
  },

  explanation(h: ClassifyInput): string {
    return "Human-readable explanation shown in the UI (explain mode).";
  },

  passReason(h: ClassifyInput): string {
    return "Shown in DecisionTrace when this pattern matched.";
  },

  failReason(h: ClassifyInput): string {
    return "Shown in DecisionTrace when this pattern was tested but did not match.";
  },
};

export default myNewPattern;
Critical: context-line detection

If your detect() function ever inspects raw diff lines for context vs. added/removed:

typescript
// CORRECT — empty strings do NOT become phantom context lines
const isContext = (line: string) => line.startsWith(' ');

// WRONG — empty string passes this test and produces phantom context lines
const isContext = (line: string) => !line.startsWith('\\');

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

Step 4 — Register the pattern in classifier.ts

packages/core/src/classifier.ts owns the pattern registry. Add an import and add the plugin to the PATTERNS array in priority order.

typescript
// 1. Add the import near the other pattern imports
import myNewPattern from "./patterns/my-new-pattern.js";

// 2. Add to PATTERNS array — the array order is cosmetic (sort is by .priority),
//    but keep it in priority order for readability
const PATTERNS: PatternPlugin[] = [
  sameChange,           // priority 10
  // ...
  myNewPattern,         // priority <N>  ← add here
  // ...
  complex,              // priority 999 — MUST stay last
];

complex must always remain the last entry (priority 999, detect() always returns true) — it is the fallback for every unrecognized conflict.


Step 5 — Add a resolution case in resolver/assemble.ts

packages/core/src/resolver/assemble.ts contains the assembleResolution() function, which switches on hunk.type to produce merged lines. Every new ConflictType needs a case here, otherwise the pattern will be classified correctly but its resolution will never be assembled.

typescript
case "my_new_pattern": {
  // Produce the merged lines according to the resolution strategy.
  const merged = /* ... */;
  return {
    lines: merged,
    reason: "Short one-line reason logged in verbose mode.",
  };
}

Place the new case near the patterns of similar priority. Return { lines: null, reason: "..." } if under certain option flags the pattern should refuse to auto-resolve (see whitespace_only for an example).


Step 6 — Write the tests

Create packages/core/src/__tests__/patterns/<name>.test.ts.

Minimum coverage: 10 test cases.

typescript
import { describe, it, expect } from "vitest";
import { resolve } from "../../resolver.js";

describe("<name> — should resolve", () => {
  // At least 5 cases where the pattern fires and produces the expected output.
  // Include at least one diff3 case (with ||||||| base section) and one diff2.
  // Include at least one case with empty strings.
  it("resolves <scenario>", () => {
    const input = [
      "<<<<<<< ours",
      /* ours lines */
      "||||||| base",
      /* base lines */
      "=======",
      /* theirs lines */
      ">>>>>>> theirs",
    ].join("\n");
    const result = resolve(input, "src/file.ts");
    expect(result.hunks[0].type).toBe("<name>");
    expect(result.stats.autoResolved).toBe(1);
    expect(result.mergedContent).toBe(/* expected output */);
  });
});

describe("<name> — should NOT resolve", () => {
  // At least 5 cases where the pattern must NOT fire (returns null / classified
  // as a different type). These guard against false positives.
  // Include at least one edge case (single line, all-empty lines, etc.).
  it("does not resolve when <counter-scenario>", () => {
    const input = [
      "<<<<<<< ours",
      /* ours lines that look similar but must not match */
      "=======",
      /* theirs lines */
      ">>>>>>> theirs",
    ].join("\n");
    const result = resolve(input, "src/file.ts");
    expect(result.hunks[0].type).not.toBe("<name>");
  });
});

Step 7 — Check Rust parity

Open apps/desktop/src-tauri/examples/parity_probe.rs and check whether the new pattern corresponds to a conflict type that the Rust side also classifies.

The parity probe binary is compiled and run by pnpm test:parity (from apps/desktop/). If the Rust classifier uses a matching concept, add the equivalent classification logic there and update the parity fixtures.

If the new pattern is purely a TypeScript-side heuristic with no Rust equivalent, add a comment in parity_probe.rs documenting that this type is TS-only.


Step 8 — Validation

Run both suites before marking the task done:

bash
# TypeScript unit tests
cd packages/core && pnpm test

# Rust ↔ TypeScript parity tests
cd apps/desktop && pnpm test:parity

Both must pass with zero failures. If the parity suite fails, the Rust implementation is out of sync — fix it before merging.

© devlint, MIT. 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 .claude/skills/add-pattern of devlint/GitWand.

Open the folder on GitHubat commit 20114ac

Compare with similar skills

Add Pattern 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.

Add Pattern compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Add Pattern this skilldevlint/GitWand180—~2.3kAutomated safety check: PassMIT
GitHub Opsdaymade/claude-code-skills1.4k—~3.7kAutomated safety check: PassMIT
Deskcomm Contribuirmelgarafael/DeskcommCRM4.5k—~3.6kAutomated safety check: NotesMIT
Qodo PR Resolversbusso/claudeclaw194—~4kAutomated safety check: PassMIT
Flow Next Resolve PRgmickel/flow-next706—~1.1kAutomated safety check: PassMIT
Oidc ReleaseH2CK/oidc134—~2kAutomated safety check: PassAGPL-3.0

Similar skills

  • GitHub Ops

    daymade/claude-code-skills

    Operates GitHub via gh CLI and REST/GraphQL — PRs, issues, Actions, repos, collaborators, org permissions, 2FA — with explicit target, authorization, and independent readback.

    1.4k GitHub stars~3.7k tokensUpdated today
    Backend & APIsAuto-check passed
  • Deskcomm Contribuir

    melgarafael/DeskcommCRM

    Guia de contribuição ao DeskcommCRM para quem vai mexer no código e abrir um pull request, sobretudo de um fork.

    4.5k GitHub stars~3.6k tokensUpdated today
    DevelopmentAuto-check: notes
  • Qodo PR Resolver

    sbusso/claudeclaw

    Review and resolve PR issues with Qodo - get AI-powered code review issues and fix them interactively (GitHub, GitLab, Bitbucket, Azure DevOps)

    194 GitHub stars~4k tokensUpdated 1 mo ago
    DevelopmentAuto-check passed
  • Flow Next Resolve PR

    gmickel/flow-next

    Resolve PR review feedback. An agent skill from gmickel/flow-next.

    706 GitHub stars~1.1k tokensUpdated yesterday
    Backend & APIsAuto-check passed
  • Oidc Release

    H2CK/oidc

    Prepare and verify a new release for the Nextcloud OIDC Identity Provider app.

    134 GitHub stars~2k tokensUpdated today
    Backend & APIsAuto-check passed
  • Squash Bugbot

    LFDT-Lineth/lineth-monorepo

    Triage unresolved bot review comments on a GitHub PR. An agent skill from LFDT-Lineth/lineth-monorepo.

    126 GitHub stars~3.3k tokensUpdated yesterday
    Backend & APIsAuto-check passed

More from devlint/GitWand

  • Add Resolver

    devlint/GitWand

    Add a format-specific resolver to GitWand core. An agent skill from devlint/GitWand.

    180 GitHub stars~1.6k tokensUpdated today
    Auto-check passed
  • Add Tauri Command

    devlint/GitWand

    A skill your agent uses when the user wants to expose a Rust feature to the Vue frontend, add a Tauri IPC command, invoke something from a Vue component, or wire up any backend/frontend…

    180 GitHub stars~1.5k tokensUpdated today
    Auto-check passed
  • Release

    devlint/GitWand

    Guide a clean GitWand release end-to-end: bump version, update CHANGELOG, commit, tag, and push.

    180 GitHub stars~1.8k tokensUpdated today
    Auto-check passed
  • I18n Sync

    devlint/GitWand

    Synchronise les fichiers de locale GitWand. An agent skill from devlint/GitWand.

    180 GitHub stars~1.1k tokensUpdated today
    Auto-check passed

Works with

Questions about Add Pattern

What does Add Pattern do?

Add a new conflict-resolution pattern to GitWand core. An agent skill from devlint/GitWand. Add Pattern is an agent skill from devlint/GitWand. Add a new conflict-resolution pattern to GitWand core.

When should I use Add Pattern?

Add Pattern fits situations like: someone wants to add a pattern; resolution rule; new conflict case; teach the resolver to handle a new kind of conflict automatically.

How do I install Add Pattern in Claude Code?

Run `npx skills add devlint/GitWand --skill add-pattern -a claude-code`. Or copy the skill folder (.claude/skills/add-pattern in devlint/GitWand) into .claude/skills/add-pattern in your project. Claude Code loads it when a task matches its description.

How do I install Add Pattern in Codex?

Run `npx skills add devlint/GitWand --skill add-pattern -a codex`. Or copy the skill folder (.claude/skills/add-pattern in devlint/GitWand) into .agents/skills/add-pattern in your project. Codex loads it when a task matches its description.

Can I use Add Pattern 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 devlint/GitWand --skill add-pattern -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/add-pattern, .gemini/skills/add-pattern, .github/skills/add-pattern and .opencode/skills/add-pattern in your project.

What does Add Pattern need to run?

Going by SKILL.md and its folder, Add Pattern needs the command-line tools its instructions call (pnpm).

Does Add Pattern 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 Add Pattern 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 Add Pattern use?

Add Pattern is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Add Pattern use?

About 2.3k tokens (SKILL.md is roughly 9.1k 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 Add Pattern?

Skills that share tags, products or a category with Add Pattern: GitHub Ops (daymade/claude-code-skills, 1.4k stars), Deskcomm Contribuir (melgarafael/DeskcommCRM, 4.5k stars), Qodo PR Resolver (sbusso/claudeclaw, 194 stars) and Flow Next Resolve PR (gmickel/flow-next, 706 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Add Pattern?

devlint (a GitHub user) maintains it in devlint/GitWand, which has 180 GitHub stars. The repository holds 5 skills in this directory. The repository was last updated on October 7, 2026.

Source: devlint/GitWand on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.