Skip to content
Automation
Skill

/setup

Scaffold .nightshift/ and propose quality gates for this stack; asks, never imposes.

From plugin
nightshift
6113 skills
Install
$ npx -y skills add orwa-mahmoud/claude-nightshift --skill setup --agent claude-code

How it fires

How this skill gets triggered: by you, by Claude, or both.

  • Fires itselfAuto-invocation. Claude auto-loads it when your prompt matches the work.Auto-invocation is when the right skill fires by itself at the right moment, driven by a FLOW.md router and a hook, instead of you invoking it by name. It is the difference between a skill being installed and a skill actually getting used.Read the full definition →
  • You can call itInvoke it directly when you want it.
  • Slash command/setup

Context preview

The summary Claude sees to decide when to auto-load this skill.

Scaffold .nightshift/ and propose quality gates for this stack; asks, never imposes.

SKILL.md

setup.SKILL.md
name: setup
description: Scaffold .nightshift/ and propose quality gates for this stack; asks, never imposes.
license: MIT

Set up Nightshift in this project. Do the scaffolding first, then the gates conversation, then print a summary.

The four state files and what each holds are in `$NIGHTSHIFT_PLUGIN_ROOT/skills/nightshift/references/shift/state-map.md`. Ordinary plans belong in the drafting table, never in Hunt or the parking lot.

Resolve the installed plugin root to an absolute `$NIGHTSHIFT_PLUGIN_ROOT` — `${CLAUDE_PLUGIN_ROOT}` on Claude Code, `$PLUGIN_ROOT` on Codex when set, otherwise the absolute path this skill was attached from (`skills/setup/SKILL.md`). Run every command below through `"$NIGHTSHIFT_PLUGIN_ROOT/runtime/ns"` — native Windows: `& "$NIGHTSHIFT_PLUGIN_ROOT\runtime\windows\ns.ps1"` in the PowerShell tool, same verbs — which resolves the host and the workspace; `ns help` lists the verbs, and `ns bind` prints the six resolved facts (`TASK_ROOT`, `NIGHTSHIFT_WORKSPACE`, `NS`, `NIGHTSHIFT_PLUGIN_ROOT`, `HOST`, `SOURCE`); `$NS` below is that `NS`. Never a bare relative path: the working directory persists between calls.

Once the workspace and work target are resolved, the bundled mechanical scaffold is `ns setup --work-target "$WORK_TARGET" --mode "$WORK_MODE"`, which exists on native Windows only; on every other host this skill writes the same templates itself, as below. It copies only absent files, writes state version 1 for a new site, persists the work target and work mode (`-Mode repository` or `-Mode artifact`), and keeps `$NS/` private. It refuses a notes folder under default repository mode: `pass -Mode artifact for a notes folder that is not a Git repository`. Read its output back rather than restating it. The skill still owns every owner choice below; the script asks nothing and never invents gates, permissions, profiles, migration approval, a receipts choice, or a tooling policy.

If the user explicitly identifies a different existing workspace containing `.nightshift/`, show both absolute paths and ask for confirmation. On yes, run `"$NIGHTSHIFT_PLUGIN_ROOT/runtime/ns" link-workspace --host-root "$TASK_ROOT" --workspace "$PROPOSED_WORKSPACE"`. The pointer is local-only and state remains in the authoritative workspace; never copy it.

0. Reject disposable ChatGPT scratch workspaces

Before creating or changing any file, resolve the project root to an absolute path. If it is under `/workspace/scratch/`, this is a disposable ChatGPT scratch workspace that cannot affect the user's repository. **Stop immediately: create no `$NS/` directory, rules, settings, receipts repo, or other files.** Tell the user directly:

> Nightshift needs a persistent software project workspace. This ChatGPT conversation is using a > temporary workspace, so files created here will not affect your repository. > > Open your project in Codex (a Git repository or a persistent local folder), or start Codex connected to its GitHub repository. Then mention > Nightshift and say: “Set up Nightshift in this project.”

Do not mention Claude Code in this ChatGPT-specific redirect: the user is already in an OpenAI product, so give them the shortest OpenAI-native route. Do not infer “temporary” merely because the project is not a git repository — local non-git projects and the recommended parent-workspace layout remain valid. The explicit disposable scratch path is the stop signal.

Detect the work mode, explain it, and ask before persisting it. Use `ns_propose_work_mode` (POSIX) or `Get-NSProposedWorkMode` after importing `Nightshift.psm1` (native Windows):

  • `repository` — the workspace is a Git repository, or exactly one immediate non-hidden child is. Skip a symlink or reparse child; it is not a nested checkout.

several child repositories still mean repository mode; show the choices and require an explicit target, never guess.

  • `artifact` — there is no Git repository here. The persistent folder itself is the work target

(research, docs, audits, planning). Say so plainly: gates, commits, and stack detection that require Git do not apply; complete each item with a receipt under `$NS/receipts/`. Completion in that folder is `$NS/receipts/`, not a git log. When `$NS/receipts` exists but is not a usable directory, say so and do not treat artifact setup as complete.

  • scratch (`ns_propose_work_mode` status 2, or `Get-NSProposedWorkMode` throwing) — stop; create

nothing.

Never persist a mode until the owner confirms. Never `git init` a notes folder to change an artifact proposal into repository mode. Then write `$NS/work-mode` as `repository` or `artifact` (one word, one newline) and `$NS/work-target` as the absolute canonical path of the chosen folder. On POSIX: `ns_record_work_target "$NIGHTSHIFT_WORKSPACE" "$WORK_TARGET" "$WORK_MODE"`. On later setup runs, validate and retain that mode and target unless the owner explicitly changes them. Repository mode: stack detection, Git checks, gates, commits, and verification operate in the work target. Artifact mode: inspection, edits, and verification operate in that folder without pretending it is a repository.

1. Scaffold `$NS/` (never clobber an existing shift)

"$NIGHTSHIFT_PLUGIN_ROOT/runtime/ns" scaffold

It writes each state file that is not already there and reports `wrote <name>` or `kept <name>`, so a name the owner already has is left exactly as it is and a second run is a safe repair. Read its output back. The copies carry resolved absolute paths — a person pasting a command out of their own punch list has no `$NS` — and the shipped templates are unchanged. Never write those tokens into `rules.json`: revival and clock-out text stay owner-editable, and the gate qualifies bare `.nightshift/` mentions at injection time.

Create `$NS/shift-log.md` with a one-line header if absent.

**State version.** `$NS/state-version` is the schema marker. This plugin supports integer `1`. If this run created `$NS/` (the

Read more
Ships withnightshift

Give the agent a shift. Come back to work you can review. Nightshift gives Claude Code, OpenAI Codex, and Cursor a durable work contract for long coding runs. Bring a task list, choose a ready-made shift, or give your agent an objective and hours to work.

Get the whole plugin
Stats
61
Stars
3
Forks
Active
Maintenance
Shell
Language
MIT
License
1d ago
Last commit
2mo ago
Created

Repo: orwa-mahmoud/claude-nightshift

Other skills on nightshift.