Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

dry-run

БесплатноБез исполняемых скриптовНе проверен

Preview command effects without making changes. Simulates file writes, git operations, agent spawns, and state changes. All reads execute normally for…

marcusgollот marcusgoll★ 97 звёзд на GitHub20 установок в других каталогах

Об этом скилле

The dry-run skill enables safe command testing by simulating all side effects without execution.

Problem: Commands make real changes - creating files, spawning agents, modifying state, executing git operations. Testing commands on production workflows risks unintended modifications.

Solution: Add --dry-run flag that:

  1. Executes all read operations (for accurate analysis)
  2. Simulates all write operations (shows what would change)
  3. Previews agent spawns (shows what Task() calls would occur)
  4. Reports state changes (shows YAML mutations)
  5. Outputs standardized summary (consistent format across commands)

The result: Safe command testing with full visibility into intended effects.

**Detect --dry-run in command arguments:**
# In command process section
DRY_RUN=false
if echo "$ARGUMENTS" | grep -q -- "--dry-run"; then
  DRY_RUN=true
  # Remove flag from arguments for processing
  ARGUMENTS=$(echo "$ARGUMENTS" | sed 's/--dry-run//g' | xargs)
fi

Checking in command logic:

If DRY_RUN is true:
  - Collect intended operations in simulation log
  - Skip actual Write/Edit tool calls
  - Skip actual Task() spawns (log them instead)
  - Skip actual Bash commands with side effects
  - Execute Read/Grep/Glob normally
  - Output dry-run summary at end
**Standard dry-run output format:**
════════════════════════════════════════════════════════════════════════════════
DRY-RUN MODE: No changes will be made
════════════════════════════════════════════════════════════════════════════════

📁 FILES THAT WOULD BE CREATED:
  ✚ specs/004-auth/spec.md (estimated ~150 lines)
  ✚ specs/004-auth/state.yaml (workflow state)
  ✚ specs/004-auth/NOTES.md (session notes)

📝 FILES THAT WOULD BE MODIFIED:
  ✎ specs/004-auth/state.yaml
    - phase: init → spec
    - status: pending → in_progress

🤖 AGENTS THAT WOULD BE SPAWNED:
  1. spec-phase-agent: "Execute spec phase for user authentication"
  2. clarify-phase-agent: "Clarify requirements"
  3. plan-phase-agent: "Generate implementation plan"

🔀 GIT OPERATIONS THAT WOULD OCCUR:
  • git checkout -b feature/004-auth
  • git add specs/004-auth/
  • git commit -m "feat: initialize auth feature workspace"

📊 STATE CHANGES:
  state.yaml:
    phase: spec → plan → tasks → implement
    status: pending → in_progress → completed

════════════════════════════════════════════════════════════════════════════════
DRY-RUN COMPLETE: 0 actual changes made
Run without --dry-run to execute these operations
════════════════════════════════════════════════════════════════════════════════
**Why use dry-run:**
Scenario Without --dry-run With --dry-run
Testing new feature Creates real workspace Shows what would be created
Debugging workflow May corrupt state Safe preview of operations
Learning commands Trial and error cleanup Zero-risk exploration
CI/CD validation Real side effects Validates without changes
Training/demos Need fresh environment Repeatable demonstrations
**Detect dry-run flag**

At command start, check for --dry-run in arguments:

### Step 0: Dry-Run Detection

Check for --dry-run flag:
```bash
DRY_RUN="false"
if "$ARGUMENTS" == *"--dry-run"*; then
  DRY_RUN="true"
  echo "DRY-RUN MODE ENABLED"
fi

If DRY_RUN is true:

  • Initialize simulation log array
  • Proceed with analysis but skip execution
  • Collect all intended operations

**Important**: Remove `--dry-run` from arguments before parsing other flags to avoid conflicts.
</step>

<step number="2">
**Execute reads normally**

Read operations are safe and necessary for accurate simulation:

```markdown
**Safe operations (execute normally in dry-run):**
- Read tool: `Read file_path=...`
- Grep tool: `Grep pattern=...`
- Glob tool: `Glob pattern=...`
- Bash (read-only): `ls`, `cat`, `git status`, `git log`, `test -f`
- WebFetch: Documentation/API lookups
- WebSearch: Research queries

**Why**: Accurate simulation requires understanding current state.
**Simulate write operations**

Intercept and log write operations without executing:

**Write operations to simulate:**

**File writes** (Write tool):

Instead of: Write file_path="specs/001/spec.md" content="..." Log: "WOULD CREATE: specs/001/spec.md (~150 lines)"


**File edits** (Edit tool):

Instead of: Edit file_path="state.yaml" old_string="..." new_string="..." Log: "WOULD MODIFY: state.yaml (phase: init → spec)"


**Bash writes** (Bash tool with side effects):

Instead of: Bash command="mkdir -p specs/001" Log: "WOULD EXECUTE: mkdir -p specs/001"

Instead of: Bash command="git commit -m '...'" Log: "WOULD EXECUTE: git commit

Полный SKILL.md на GitHub

Установить dry-run в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

FAQ

Что делает скилл dry-run?

Preview command effects without making changes. Simulates file writes, git operations, agent spawns, and state changes. All reads execute normally for accurate preview. Use --dry-run flag on any command.

Как установить скилл dry-run?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл dry-run запускает скрипты?

Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.

Похожие скиллы

Сравнить dry-run с