spec-kitty-bulk-edit-classification

Recognize when a mission is a bulk edit and drive the occurrence-classification guardrail on the user's behalf. Triggers: user says any variant of "rename X to Y", "change the terminology", "migrate all occurrences", "replace across the codebase", "the X feature is now the Y feature", "sed everywhere", or any request that touches the same identifier/path/key in many files. Also triggers on gate errors mentioning "change_mode", "occurrence_map.yaml", "Bulk Edit Gate: BLOCKED", or "Bulk Edit Review: Diff Compliance". Does NOT handle: line-level semantic refactors inside one file, adding a new feature that creates new identifiers without changing existing ones, or reviewing finished missions for fidelity.

1,029 stars

Best use case

spec-kitty-bulk-edit-classification is best used when you need a repeatable AI agent workflow instead of a one-off prompt.

Recognize when a mission is a bulk edit and drive the occurrence-classification guardrail on the user's behalf. Triggers: user says any variant of "rename X to Y", "change the terminology", "migrate all occurrences", "replace across the codebase", "the X feature is now the Y feature", "sed everywhere", or any request that touches the same identifier/path/key in many files. Also triggers on gate errors mentioning "change_mode", "occurrence_map.yaml", "Bulk Edit Gate: BLOCKED", or "Bulk Edit Review: Diff Compliance". Does NOT handle: line-level semantic refactors inside one file, adding a new feature that creates new identifiers without changing existing ones, or reviewing finished missions for fidelity.

Teams using spec-kitty-bulk-edit-classification should expect a more consistent output, faster repeated execution, less prompt rewriting.

When to use this skill

  • You want a reusable workflow that can be run more than once with consistent structure.

When not to use this skill

  • You only need a quick one-off answer and do not need a reusable workflow.
  • You cannot install or maintain the underlying files, dependencies, or repository context.

Installation

Claude Code / Cursor / Codex

$curl -o ~/.claude/skills/spec-kitty-bulk-edit-classification/SKILL.md --create-dirs "https://raw.githubusercontent.com/Priivacy-ai/spec-kitty/main/src/doctrine/skills/spec-kitty-bulk-edit-classification/SKILL.md"

Manual Installation

  1. Download SKILL.md from GitHub
  2. Place it in .claude/skills/spec-kitty-bulk-edit-classification/SKILL.md inside your project
  3. Restart your AI agent — it will auto-discover the skill

How spec-kitty-bulk-edit-classification Compares

Feature / Agentspec-kitty-bulk-edit-classificationStandard Approach
Platform SupportNot specifiedLimited / Varies
Context Awareness High Baseline
Installation ComplexityUnknownN/A

Frequently Asked Questions

What does this skill do?

Recognize when a mission is a bulk edit and drive the occurrence-classification guardrail on the user's behalf. Triggers: user says any variant of "rename X to Y", "change the terminology", "migrate all occurrences", "replace across the codebase", "the X feature is now the Y feature", "sed everywhere", or any request that touches the same identifier/path/key in many files. Also triggers on gate errors mentioning "change_mode", "occurrence_map.yaml", "Bulk Edit Gate: BLOCKED", or "Bulk Edit Review: Diff Compliance". Does NOT handle: line-level semantic refactors inside one file, adding a new feature that creates new identifiers without changing existing ones, or reviewing finished missions for fidelity.

Where can I find the source code?

You can find the source code on GitHub using the link provided at the top of the page.

Related Guides

SKILL.md Source

# spec-kitty-bulk-edit-classification

Drive the occurrence-classification guardrail (shipped in #393, DIRECTIVE_035)
so users never have to know it exists. A bulk edit is any change that touches
the **same string** in many places — a rename, a terminology migration, a
package-path move, a feature-label swap. Those changes look mechanical but
aren't: the same token carries different meaning depending on where it appears
(code symbol, import path, filesystem literal, serialized key, CLI command,
user-facing string, test fixture, log/telemetry label). Treating them uniformly
is how silent breakage happens.

**The user will not say "bulk edit".** They will say "rename Coffee to Tea" or
"the Blue feature is now the Red feature." Your job is to recognize that
shape, turn on `change_mode: bulk_edit`, and drive the classification workflow
before any code changes.

---

## When to activate

Apply this skill during **specify** or **plan** when the user's description
matches any of these patterns:

| Pattern | Example phrasing |
|---|---|
| Explicit rename | "Rename `Customer` to `Account` across the codebase" |
| Terminology migration | "We're calling it 'channels' now, not 'streams'" |
| Feature relabel | "The Blue feature is now the Red feature" |
| Path/module move | "Move `src/legacy/auth` to `src/auth`" |
| API surface rename | "Rename the `/users` endpoint to `/accounts`" |
| Config key rename | "Change `max_connections` to `connection_limit` everywhere" |
| Brand / product rename | "Replace ACME with GlobalCorp in all docs and UI" |

Also apply when the implement or review command prints a message starting
with **"Bulk Edit Gate: BLOCKED"** or **"Bulk Edit Review: Diff Compliance"** —
these are the runtime gates' failure output; this skill tells you how to
respond.

**Do NOT apply when** the user is:

- Adding a genuinely new feature (new identifiers, new files) — no existing
  identifiers change
- Refactoring the internals of one file or one function — no cross-cutting
  string change
- Fixing a bug where the surface names stay the same

---

## The core decision tree

At the start of `specify` or `plan`, after you understand the user's intent,
ask yourself this one question:

> Does fulfilling this request require changing the **same existing string**
> (identifier, path, key, label) in more than one file?

If **yes**: this is a bulk edit. Set `change_mode: bulk_edit` and run the
classification workflow below.

If **no**: proceed normally. The guardrail stays dormant.

If **uncertain**: treat as bulk edit. The cost of a false positive is drafting
an occurrence map the user can approve in one pass. The cost of a false
negative is the silent-breakage class of bugs #393 was created to prevent.

---

## What to do during specify

1. **Detect intent.** Read the user's feature description. If it matches the
   patterns above, you have a bulk edit.

2. **Set `change_mode` in `meta.json`.** Use the CLI helper — do not hand-edit
   JSON:

   ```python
   from specify_cli.mission_metadata import set_change_mode
   set_change_mode(feature_dir, "bulk_edit")
   ```

   Or via shell after `mission create`:

   ```bash
   python -c "from specify_cli.mission_metadata import set_change_mode; \
              set_change_mode('<feature_dir>', 'bulk_edit')"
   ```

3. **Name the target in the spec.** In `spec.md`, state explicitly what's
   being renamed and to what:

   > "This mission renames `Customer` (old term) to `Account` (new term)
   > across the codebase, with per-category rules captured in
   > `occurrence_map.yaml`."

   Do NOT rely on the reviewer inferring the rename from prose. Make it an
   explicit claim that the occurrence map must satisfy.

4. **Tell the user, briefly**, that you're turning on the classification
   workflow. Use plain language — they don't need to know the field name:

   > "This is a cross-cutting rename, so I'm going to produce an
   > `occurrence_map.yaml` during planning that decides which kinds of
   > occurrences get renamed vs. left alone (API response keys, CLI commands,
   > and metric labels are typically left alone to avoid breaking consumers).
   > You'll review and approve that map before any code changes."

---

## What to do during plan

Produce `kitty-specs/<mission>/occurrence_map.yaml` with **all 8 standard
categories present**. Leaving a category out is an error the gate rejects —
every standard risk surface must have an explicit action assignment.

### The template to fill

The starter template lives in `src/doctrine/templates/occurrence-map-template.yaml`
and the machine-enforced schema lives in `src/doctrine/schemas/occurrence-map.schema.yaml`.
Do not copy the shape from prose — load the actual file so you never drift from
the contract that the runtime gate enforces:

```python
from specify_cli.bulk_edit.occurrence_map import (
    load_template_text,     # starter YAML text to seed occurrence_map.yaml
    load_schema,             # JSON Schema dict (Draft 2020-12)
    validate_against_schema, # raw dict -> ValidationResult
)

# Seed the file:
(feature_dir / "occurrence_map.yaml").write_text(load_template_text())
```

The template is a complete, syntactically valid occurrence map with sane
category defaults and placeholders only for `target.term`/`target.replacement`.
Adjust per-category actions to fit the mission, then validate:

```python
import yaml
from specify_cli.bulk_edit.occurrence_map import validate_against_schema

raw = yaml.safe_load((feature_dir / "occurrence_map.yaml").read_text())
result = validate_against_schema(raw)
assert result.valid, result.errors
```

### Valid actions (exact strings — the gate rejects typos)

| Action | When to use |
|---|---|
| `rename` | Safe to mechanically replace old → new |
| `manual_review` | Each occurrence needs case-by-case judgment |
| `do_not_change` | Must not be modified; renaming breaks external consumers |
| `rename_if_user_visible` | Rename where the string is shown to a user; preserve otherwise |

### Default posture per category

This is a starting point to propose to the user. Tune per-project.

| Category | Typical default | Why |
|---|---|---|
| `code_symbols` | `rename` | Internal implementation — safe to change |
| `import_paths` | `rename` | Must track symbol renames |
| `filesystem_paths` | `manual_review` | On-disk locations may be referenced externally |
| `serialized_keys` | `do_not_change` | API/schema/config keys are contracts |
| `cli_commands` | `do_not_change` | Users have scripts; need deprecation cycle |
| `user_facing_strings` | `rename_if_user_visible` | Rename in UI/docs, preserve internal labels |
| `tests_fixtures` | `rename` | Tests should reflect new terminology |
| `logs_telemetry` | `do_not_change` | Dashboards and alerts depend on exact label strings |

### Interviewing the user

The user knows the domain; you know the mechanics. For each category where the
default is not obviously right, ask one concrete question. Keep the
conversation short — for a typical rename, you need 2–4 questions.

Good question style:

> "The rename will touch `Customer` inside API response bodies — e.g.,
> `{\"customer_id\": ...}`. Changing those keys would break any client
> that has already integrated. I'd recommend keeping the JSON keys as
> `customer_id` (do_not_change) and only renaming the Python class. Sound
> right, or should we also do a versioned API migration?"

Bad question style:

> "What action should I set for serialized_keys?"
> — (jargon the user doesn't have)

---

## What to do when the gate blocks at implement time

If the user runs `spec-kitty agent action implement WP##` and sees a
**"Bulk Edit Gate: BLOCKED"** panel, this means either:

- the occurrence map is missing (the author never set `change_mode` or skipped
  planning), or
- it fails structural validation (malformed YAML, missing required sections), or
- it fails admissibility (placeholder target, < 3 categories, missing any of
  the 8 standard categories).

Read the error panel. It names the specific problem. Fix the map, save, rerun
the command. Do not use `--force` or any bypass.

## What to do when diff compliance blocks at review time

If you're reviewing a WP and the command rejects with **"Bulk Edit Review:
Diff Compliance Violations"**, read the table. Each row shows one changed
file, the category our path heuristic inferred, the action the map specified,
and the verdict. `BLOCK` rows are the ones you need to address.

Three remediations, in order of preference:

1. **Revert the offending change.** If the file genuinely shouldn't have been
   touched (API schema, metric labels, historical migration), the
   implementation is wrong. Revert, rebuild, resubmit.

2. **Narrow or add an exception** in the occurrence map. When the category
   rule is too coarse (e.g., `migrations/*.py: do_not_change` blocks the new
   migration that implements the rename), refine the exception and re-commit
   the map.

3. **Change the category rule.** Only when the original category-level
   decision was genuinely wrong. Requires reviewer + user agreement;
   document the reason in `exceptions[].reason`.

Never:

- Edit the diff check to skip files (the check is the contract).
- Use `git commit --no-verify`-style bypasses (the gate lives at review claim,
  not at commit).
- Silently work around by splitting into smaller WPs so each one stays under
  the radar. The map applies across the whole mission.

---

## Relationship to the inference warning

At `implement` time, if a mission is **not** marked `bulk_edit` but the spec
content matches rename/migration keywords, the system prints a
`Bulk Edit Inference Warning`. This is a nudge, not a block. If you see this
warning, treat it as a signal that **you (the agent) missed the detection
during specify/plan** and should have set `change_mode` earlier. Two options:

1. **Upgrade the mission.** Set `change_mode: bulk_edit`, draft the occurrence
   map, and ask the user to review before implementation resumes. This is
   usually the right call.

2. **Explicitly dismiss** only when you have read the spec and are certain
   this is NOT a bulk edit (e.g., the inference fired on a spec that happens
   to mention "rename" incidentally — "users can rename their own profile"
   describes a product feature, not a codebase rename). Pass
   `--acknowledge-not-bulk-edit` to proceed.

Dismissing carelessly defeats the guardrail. When in doubt, upgrade.

---

## Quick reference

| Question | Answer |
|---|---|
| Who decides to turn on bulk_edit? | The agent, during specify/plan. Users don't know this flag exists. |
| Where is it set? | `meta.json` via `set_change_mode(feature_dir, "bulk_edit")`. |
| What artifact is required? | `kitty-specs/<mission>/occurrence_map.yaml` |
| How many categories must the map classify? | All 8 standard categories. |
| What blocks implement? | Missing, malformed, or inadmissible map. |
| What blocks review? | Any changed file classified into a `do_not_change` category, or any file matching no category and no exception. |
| How do I respond to a diff-check block? | Revert, refine exception, or (last resort) change category rule. |
| What if I'm not sure this is a bulk edit? | Treat as bulk edit. Cost of false positive is small. |

---

## Files you'll touch

| File | Role |
|---|---|
| `kitty-specs/<mission>/meta.json` | Set `change_mode: bulk_edit` |
| `kitty-specs/<mission>/occurrence_map.yaml` | The classification artifact (required) |
| `kitty-specs/<mission>/spec.md` | Name the rename target explicitly |
| `kitty-specs/<mission>/plan.md` | Note the classification workflow was run |

## Related skills

- `spec-kitty-runtime-next` — the loop that runs implement/review; this skill
  produces the prerequisites it checks.
- `spec-kitty-runtime-review` — the review workflow that invokes the diff
  compliance check this skill's artifact governs.
- `spec-kitty-glossary-context` — closely related for terminology normalization;
  the glossary tells you what the canonical terms are, this skill governs how
  you migrate *to* them.

Related Skills

spec-kitty-setup-doctor

1029
from Priivacy-ai/spec-kitty

Install, verify, and recover the modern Spec Kitty 2.0.11+ operating surface. Triggers: "set up Spec Kitty", "skills missing", "next is blocked", "runtime is broken", "doctrine assets are missing", "my agent can't find the skills". Does NOT handle: generic coding questions with no Spec Kitty context, direct runtime loop advancement, or editorial glossary maintenance.

spec-kitty-runtime-review

1029
from Priivacy-ai/spec-kitty

Review runtime-owned outputs using the Spec Kitty review workflow surface, then direct approval or rejection with structured feedback. Triggers: "review this work package", "check runtime output", "approve this step", "review WP", "is this WP ready to approve", "check this implementation". Does NOT handle: setup-only repair requests, direct implementation work, editorial glossary maintenance, or runtime loop advancement.

spec-kitty-runtime-next

1029
from Priivacy-ai/spec-kitty

Drive the canonical spec-kitty next --agent <name> control loop for mission advancement. Load agent profiles at init, apply action-scoped doctrine context at each step boundary, and pull specific tactics/directives on demand. Triggers: "run the next step", "what should runtime do next", "advance the mission", "what is the next task", "continue the workflow", "what step comes next". Does NOT handle: setup or repair requests, purely editorial glossary or doctrine maintenance, or direct code review.

spec-kitty-orchestrator-api-operator

1029
from Priivacy-ai/spec-kitty

Teach agents and external systems how to use spec-kitty orchestrator-api to drive workflows from outside the host CLI. Triggers: "use orchestrator-api", "build a custom orchestrator", "automate externally", "integrate CI with spec-kitty", "call spec-kitty from another tool", "orchestrator contract", "external automation". Does NOT handle: host-internal lane mutation (use the host CLI directly), runtime loop advancement (use spec-kitty next), mission sequencing logic (the mission state machine owns that), or setup/repair diagnostics.

spec-kitty-mission-system

1029
from Priivacy-ai/spec-kitty

Understand how Spec Kitty missions work: the 4 built-in mission types, how they define workflows via step contracts and action indices, how missions and work packages relate, how templates are resolved through the 5-tier chain, and how doctrine artifacts (procedures, tactics, directives) compose mission behavior. Triggers: "what missions are available", "how do missions work", "which mission should I use", "explain the mission system", "what is a mission", "change the mission", "mission templates", "step contracts", "action index", "mission procedures". Does NOT handle: runtime loop advancement (use runtime-next), setup or repair (use setup-doctor), governance (use charter-doctrine), or glossary curation (use glossary-context).

spec-kitty-mission-review

1029
from Priivacy-ai/spec-kitty

Review a fully merged Spec Kitty mission post-merge (all WPs done/approved) to verify spec→code fidelity, FR coverage, drift, risks, and security. Triggers: "review the merged mission", "post-merge mission review", "verify the completed mission", "audit the mission implementation", "mission-level acceptance review", "is this mission releasable", "final review before tagging", "cross-WP coverage audit". Does NOT handle: per-WP review during implementation (use spec-kitty-runtime-review), implement-review loop orchestration (use spec-kitty-implement-review), setup or repair (use spec-kitty-setup-doctor), or glossary maintenance (use spec-kitty-glossary-context).

spec-kitty-implement-review

1029
from Priivacy-ai/spec-kitty

Orchestrate the implement-review loop for Spec Kitty work packages using any configured agent. Covers agent dispatch, state transitions, rejection cycles, arbiter escalation, and dependency-aware sequencing across all 13 supported coding agents. Triggers: "implement and review WPs", "run the implement-review loop", "orchestrate WP implementation", "dispatch agents for WPs", "coordinate implement and review", "sprint through WPs". Does NOT handle: specify/plan/tasks phases, setup or repair, glossary maintenance, or direct code editing by the orchestrator.

spec-kitty-glossary-context

1029
from Priivacy-ai/spec-kitty

Curate and apply canonical terminology across Spec Kitty missions. Triggers: "update the glossary", "use canonical terms", "check terminology", "add a term", "fix term drift", "glossary conflicts", "resolve ambiguity", "review terminology consistency". Does NOT handle: runtime loop advancement, setup or repair requests, agent configuration, or direct code implementation tasks.

spec-kitty-git-workflow

1029
from Priivacy-ai/spec-kitty

Understand how Spec Kitty manages git: what git operations Python handles automatically, what agents must do manually, worktree lifecycle, auto-commit behavior, merge execution, and the safe-commit pattern. Triggers: "how does spec-kitty use git", "worktree management", "auto-commit", "who commits what", "git workflow", "merge workflow", "rebase WPs", "worktree cleanup", "safe commit". Does NOT handle: runtime loop advancement (use runtime-next), setup or repair (use setup-doctor), mission selection (use mission-system).

spec-kitty-charter-doctrine

1029
from Priivacy-ai/spec-kitty

Run charter interview, generation, context, and sync workflows for project governance in Spec Kitty 3.x. Access doctrine artifacts programmatically via DoctrineService. Resolve agent profiles. Load action-scoped governance context iteratively, not all at once. Triggers: "interview for charter", "generate charter", "sync charter", "use doctrine", "set up governance", "charter status", "extract governance config", "load doctrine", "agent profile", "DoctrineService", "action index". Does NOT handle: generic spec writing not tied to governance, direct runtime loop advancement, setup/repair diagnostics, or editorial glossary maintenance.

spec-kitty-constitution-doctrine

1012
from Priivacy-ai/spec-kitty

Run constitution interview, generation, context, and sync workflows for project governance in Spec Kitty 2.x. Triggers: "interview for constitution", "generate constitution", "sync constitution", "use doctrine", "set up governance", "constitution status", "extract governance config". Does NOT handle: generic spec writing not tied to governance, direct runtime loop advancement, setup/repair diagnostics, or editorial glossary maintenance.

ad-hoc-profile-load

1029
from Priivacy-ai/spec-kitty

Load an agent profile on demand to adopt a specific role for the current session. Applies the profile's identity, governance scope, boundaries, and initialization declaration without requiring a running mission. Triggers: "act as the architect", "load the reviewer profile", "switch to implementer", "use the researcher persona", "start a session as planner", "adopt the curator role", "initialize profile", "assume the designer identity". Does NOT handle: mission advancement (use runtime-next), charter interview/generation (use charter-doctrine), or profile creation (use spec-kitty agent profile create).