Skip to content
Back to skills

Patch

ASecurity

Lightweight task mode for bug fixes, config changes, and small features. Supports --no-review and --discuss flags.

  • 7 stars
  • 0 votes
  • 0 copies
  • 1 view
  • Added May 26, 2026
developmentbashcode-reviewgitapifrontend

Works with

  • api

Security analysis

A100/100

Scanned May 27, 2026

npx -y skills add OrodruinLabs/nazgul --skill patch --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Patch?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Patch
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/orodruinlabs-patch/badge)](https://www.skillsdirectory.com/skills/orodruinlabs-patch)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: nazgul:patch
description: "Lightweight task mode for bug fixes, config changes, and small features. Supports --no-review and --discuss flags."
context: fork
allowed-tools: Read, Write, Edit, Bash, Glob, Grep, Agent
metadata:
  author: Jose Mejia
  version: 1.2.2
---

# Nazgul Patch

## Examples
- `/nazgul:patch "fix CORS headers on API"` — Quick patch with single reviewer
- `/nazgul:patch --no-review "update README badges"` — Skip review, just implement
- `/nazgul:patch --discuss "add rate limiting"` — Discuss gray areas first, then patch
- `/nazgul:patch` — Interactive mode, prompts for description

## Arguments
$ARGUMENTS

## Current State
- Config: !`cat nazgul/config.json 2>/dev/null | head -3 || echo "NOT_INITIALIZED"`
- Existing patches: !`ls nazgul/tasks/patches/PATCH-*.md 2>/dev/null | wc -l || echo "0"`
- Active reviewers: !`jq -r '.agents.reviewers // [] | join(", ")' nazgul/config.json 2>/dev/null || echo "none"`

## Instructions

### Pre-flight
1. Check if `nazgul/config.json` exists. If not: "Nazgul not initialized. Run `/nazgul:init` first." and STOP.
2. Parse `$ARGUMENTS` for flags:
   - `--no-review` → skip review step
   - `--discuss` → run gray area discussion before planning
   - Remaining text → patch description
3. If no description after parsing, ask interactively: "What do you want to patch?"

### Display Banner
Output per references/ui-brand.md:
```
─── ◈ NAZGUL ▸ PATCHING ────────────────────────────────
```

### Step 1: Create Patch Task
1. Scan `nazgul/tasks/patches/` for next available PATCH-NNN number (create directory if needed)
2. Create `nazgul/tasks/patches/PATCH-NNN.md`:

```markdown
# PATCH-NNN: [description]

## Metadata
- **Status**: IN_PROGRESS
- **Created**: [ISO 8601 timestamp]
- **Source**: /nazgul:patch
- **Flags**: [--no-review, --discuss, or none]

## Description
[full description from user]

## Subtasks
[Generated by planner in Step 3]

## Implementation Log
[Filled during execution]
```

### Step 2: Discuss (if --discuss flag)
Only if `--discuss` was passed:
1. Analyze the patch description for gray areas based on domain:
   - Code changes → scope, backwards compatibility, edge cases
   - Config changes → environments affected, rollback plan
   - Bug fixes → root cause, regression test needed
2. Ask the user about each gray area (one at a time)
3. Lock decisions into the patch task manifest under `## Decisions`

### Step 3: Plan
Use the planner agent to generate 1-3 subtasks for the patch:
- Dispatch planner with a simplified prompt: "Generate 1-3 small subtasks for this patch. No research, no docs. Just implementation steps."
- Planner reads the patch description (and decisions if --discuss was used)
- Subtasks are written into the patch manifest under `## Subtasks`

### Step 4: Implement
Use the implementer agent to execute each subtask:
- Dispatch implementer with the patch manifest
- Implementer follows existing patterns (reads CLAUDE.md, follows conventions)
- Each subtask gets an atomic git commit with prefix: `patch(PATCH-NNN):`
- Update patch manifest with implementation log

### Step 5: Review (unless --no-review)
If `--no-review` was NOT passed:
1. Auto-select a single reviewer based on file types changed:
   - `.ts/.tsx/.js/.jsx` → frontend-reviewer (if available) or code-reviewer
   - `.py` → code-reviewer
   - `.md/.json/.yaml` → skip review (docs/config only)
   - Mixed → code-reviewer
2. Run the selected reviewer on the changed files
3. If APPROVED: mark patch DONE
4. If CHANGES_REQUESTED: show feedback, implementer fixes, re-review (max 2 retries)

If `--no-review` was passed:
- Mark patch DONE immediately after implementation

### Step 6: Complete
1. Update patch manifest status to DONE
2. Append to `nazgul/plan.md` under `## Patches` section (create section if it doesn't exist):
   ```
   - [x] PATCH-NNN: [description] (sha: [commit])
   ```
3. Display completion with Next Up block per ui-brand.md:
   ```
   ─── ◈ NAZGUL ▸ COMPLETE ✦ ──────────────────────────────

   ✦ PATCH-NNN: [description]
     Commits: [N] | Files changed: [N] | Review: [approved/skipped]

   ─── ◈ NEXT ─────────────────────────────────────────────
     /nazgul:start to continue main objective
     /nazgul:patch for another quick fix
   ────────────────────────────────────────────────────────
   ```

### Error Handling
- If planner fails to generate subtasks: "Could not plan this patch. Try providing more detail or use `/nazgul:start` for a full task."
- If implementer fails: Mark patch BLOCKED with error details
- If reviewer rejects after max retries: Mark patch BLOCKED, show consolidated feedback

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.