---
name: isv-slot-scaffolder
description: Scaffolds new ISV slots — generates crates/.../spN_isv_slots.rs with named constants in [START..END), bumps ISV_TOTAL_DIM at canonical location, registers slots for fold-boundary reset, emits the canonical commit message shape. Use when adding ISV-driven adaptive bounds for a new SP.
---

# Foxhunt ISV Slot Scaffolder

Templatizes the ISV-slot scaffolding step that runs early in every SP that introduces adaptive bounds.

## When to invoke

- "Add ISV slots for SP-N".
- "Scaffold spN_isv_slots.rs".

## Reference: canonical example

The most recent example is commit `c146c4fff`:

```
feat(sp15): scaffold sp15_isv_slots.rs with 46 slots [397..443) — ISV_TOTAL_DIM 396→443
```

Reproduce that shape exactly. The plan must:

1. Discover the current `ISV_TOTAL_DIM` value (grep for `ISV_TOTAL_DIM` in `crates/`).
2. Discover the next free index (= current `ISV_TOTAL_DIM`).
3. Receive a list of `(SLOT_NAME, purpose)` from the user.
4. Compute the new range `[START..END)` and new `ISV_TOTAL_DIM`.

## Inputs you must collect first

1. SP number (N).
2. List of slot names + purposes. Names are `SCREAMING_SNAKE_CASE`.
3. Optional: explicit indices (else assigned sequentially from current `ISV_TOTAL_DIM`).

## What this skill produces

1. New file `crates/<crate>/src/isv/sp<N>_isv_slots.rs`:

```rust
//! SP-<N> ISV slots — [<START>..<END>)
//!
//! Adaptive bounds and signals for SP-<N>.
//! Source pearl: <link to spec §5>.

pub const ISV_<NAME_1>: usize = <S>;
pub const ISV_<NAME_2>: usize = <S>+1;
// ...

pub const SP<N>_SLOTS_START: usize = <S>;
pub const SP<N>_SLOTS_END: usize = <E>;
```

2. Edit at canonical `ISV_TOTAL_DIM` site:

```rust
pub const ISV_TOTAL_DIM: usize = <NEW>;  // bumped from <OLD> by SP-<N> (+<K> slots)
```

3. Edit at fold-boundary reset registration site to register `SP<N>_SLOTS_START..SP<N>_SLOTS_END`.

4. Suggested commit message (use heredoc):

```
feat(sp<N>): scaffold sp<N>_isv_slots.rs with <K> slots [<S>..<E>) — ISV_TOTAL_DIM <OLD>→<NEW>
```

## Discipline

- All slots must be referenced by at least one consumer in a follow-up commit (per `feedback_wire_everything_up.md`).
- Slot names must be domain-meaningful — no `SP15_X1`, `SP15_X2` placeholders.
- ISV_TOTAL_DIM bump must match the slot count exactly. Verify before committing.

## After scaffolding

Suggest invoking `foxhunt-isv-discipline-auditor` to verify the new slots aren't shadowing existing ones with semantically-similar purposes.
