Skip to content
Back to skills

Safe Experiment

ASecurity

Experiment with code changes in an isolated worktree. Changes can be reviewed and merged or discarded.

  • 2 stars
  • 0 votes
  • 0 copies
  • 5 views
  • Added May 28, 2026
ai-agentsbashgit

Security analysis

A100/100

Scanned May 28, 2026

npx -y skills add speson/not-my-reforge --skill safe-experiment --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Safe Experiment?

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

Security grade badge for Safe Experiment
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/speson-safe-experiment/badge)](https://www.skillsdirectory.com/skills/speson-safe-experiment)

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: safe-experiment
description: Experiment with code changes in an isolated worktree. Changes can be reviewed and merged or discarded.
user-invocable: true
allowed-tools: Read, Glob, Grep, Bash, Write, Edit, Task
---

You have the safe-experiment skill. When invoked, create an isolated worktree for experimental code changes.

## Usage
```
/not-my-reforge:safe-experiment <description of experiment>
```

## Protocol

### Phase 1 — Setup Isolation
1. Ensure the current working tree is clean (commit or stash pending changes)
2. Create a new worktree:
   ```bash
   git worktree add -b experiment/<timestamp> .claude/worktrees/experiment-<timestamp> HEAD
   ```
3. Switch to the worktree directory for all subsequent operations

### Phase 2 — Experiment
1. Implement the requested changes in the worktree
2. Run build/test/lint to verify the changes work
3. Document what was changed and why

### Phase 3 — Review
Present results to the user:
```markdown
## Experiment Results

### Changes Made
- file1.ts: description of change
- file2.ts: description of change

### Verification
- Build: PASS/FAIL
- Tests: PASS/FAIL (N tests)
- Lint: PASS/FAIL

### Diff Summary
(show `git diff --stat` from the worktree)
```

### Phase 4 — Decision
Ask the user:
- **Merge**: Cherry-pick or merge changes back to the main branch
- **Discard**: Remove the worktree and branch cleanly

## Merge Commands (if approved)
```bash
cd <original-cwd>
git merge experiment/<timestamp>
git worktree remove .claude/worktrees/experiment-<timestamp>
git branch -d experiment/<timestamp>
```

## Discard Commands
```bash
git worktree remove .claude/worktrees/experiment-<timestamp> --force
git branch -D experiment/<timestamp>
```

## Rules
- NEVER modify files in the main working tree
- ALL changes happen in the worktree
- Always verify with build/test before presenting results
- Clean up worktree after merge or discard
- If the experiment fails, explain why and suggest alternatives

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.