Skip to content
Back to skills

Workspace

ASecurity

Craft phase 1 - create the feature branch and worktree, install dependencies in-worktree, establish repo tooling preconditions.

  • 2 stars
  • 0 votes
  • 0 copies
  • 3 views
  • Added September 6, 2026
ai-agentsbashgit

Works with

  • claude code

Security analysis

A100/100

Scanned November 21, 2026

npx -y skills add scolladon/craft --skill workspace --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Workspace?

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

Security grade badge for Workspace
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/scolladon-workspace/badge)](https://www.skillsdirectory.com/skills/scolladon-workspace)

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: workspace
description: Craft phase 1 - create the feature branch and worktree, install dependencies in-worktree, establish repo tooling preconditions.
---

# craft:workspace

## Preamble (always runs — non-overridable)

1. `"${CRAFT_ROOT:-${CLAUDE_PLUGIN_ROOT}}/scripts/manifest-lint.sh"` must pass; read the manifest.
2. Probe: git repo present (else STOP — craft needs one); default branch
   (`origin/HEAD` → `main` → `master` → ask once).
3. **Memory read/write surface (advisory).**
   READS: last `toolchain` entry for this repo (ecosystem + lockfile fingerprint). If the
   fingerprint matches the current lockfile, skip re-detection for the already-known
   ecosystem — still re-detect on a miss or a changed fingerprint.
   WRITES (appended to the run record as produced; saved to the store once at `Done`):
   the detected ecosystem + lockfile fingerprint produced by `scripts/worktree-setup.sh`
   lockfile detection. The hint never gates — a miss falls through to full detection.

## Procedure (default body — a manifest `override:` replaces everything below)

1. Infer the branch type from the brief (`feat`/`fix`/`chore`, default `feat`).
2. **Consult `isolate` action** (default `always`, R-127 — proceeds silently unless
   policy forbids it; see `docs/contributing/specs/policy.md` for surface semantics). Then,
   strategy `worktree` (default), as **one** Bash call — a compaction cannot split the
   two:
   ```bash
   git worktree add ../<repo>-<slug> -b <type>/<slug> && \
   "${CRAFT_ROOT:-${CLAUDE_PLUGIN_ROOT}}/scripts/worktree-setup.sh" <abs-worktree-path> [manifest scripts.post-setup]
   ```
   The run ledger stays where §0 opened it, in the git common dir: nothing moves.
   Strategy `in-place` (manifest `workspace: { strategy: in-place }`): create the branch
   in the current checkout (`git switch -c <type>/<slug>`); deps assumed present or
   installed in place; later phases use the checkout root wherever they'd use the
   worktree (the run-lock path resolves from it too). **In a Claude Code background
   session (`CLAUDE_JOB_DIR` set) → STOP before `git switch`**: the Bash call that would run
   it tests `[ -n "${CLAUDE_JOB_DIR:-}" ]` first. The session's edit guard refuses
   Write/Edit in the shared checkout until the session isolates (`worktree.bgIsolation`), so
   an in-place run could not edit. Reason: `in-place strategy cannot run in a background
   session; use strategy worktree or run attended`. The STOP holds even where a repo turned
   `worktree.bgIsolation` off: Craft does not read that setting, because it merges across
   the user, project, local, managed and `--settings` layers, so the session's effective
   value is not observable from the run. Nothing was switched, so nothing needs undoing.
3. Branch or worktree path collision → STOP and ask; never reuse silently.
4. Apply the manifest's global/workspace `context:` file now: perform any tooling
   activation it declares (the session does this — agents will receive the same file
   and must find the tooling already active). Its teardown counterpart runs at integrate.
5. All subsequent work happens ONLY in this worktree/branch, reached by its **absolute path**:
   Bash as `cd <abs-worktree-path> && …`, file tools at `<abs-worktree-path>/…`, agents spawned
   with it as their working directory. Never move the session itself with a working-directory
   relocation tool (Claude Code's `EnterWorktree`): for a worktree outside `.claude/worktrees/`
   it raises a permission prompt that auto mode cannot approve, which halts a background
   session, and a background session's edit guard already accepts edits at the worktree's
   absolute path.

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.

View all in ai-agents →

Comments

Loading comments…

Newsletter

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