Dev Reset Workspaceのロゴ

Dev Reset Workspace

コミュニティ
Nebulavenus
dev-reset-workspace

Clean the workspace of finished-work vestiges so new work can start from a fresh main branch

概要

公開者Nebulavenus
リポジトリforge-gpu
スキル名dev-reset-workspace
スター
46
フォーク
7
同梱ファイル
指示のみ
ライセンスZlib
リンク
  • Markdown形式の指示

    モデルが必要に応じて読み込むSKILL.mdファイルです。関連するリクエストがあったときだけトークンを消費します。

  • どのLLMでも利用可能

    AIスキルはプロバイダー固有のコードではなく、通常のMarkdownなので、GPT、Claude、Gemini、Grok、ローカルモデルで利用できます。

  • 指示だけで完結

    モデルに必要なものはすべて指示に含まれているため、別途同期するファイルはありません。

  • オープンソース

    NebulavenusがGitHubで公開しています。インストールする前にソースを確認してください。

インストール

AIスキルDev Reset WorkspaceをTypingMindにインストールすれば、どのLLMでも利用できます。SKILL.mdを読み取れる別のAIエージェントに追加することもできます。

1

TypingMindにインストール

TypingMindはGitHubフォルダから直接スキルをインストールします。SKILL.mdを読み取り、リソースファイルをまとめてローカルに保存します。

  1. アプリを開き、「プラグイン」→「スキル」に移動します。
  2. 「GitHubからインストール」を選択します。
  3. 以下のスキルフォルダのURLを貼り付けて確定します。
    https://github.com/Nebulavenus/forge-gpu/tree/main/.claude/skills/dev-reset-workspace
  4. スキルを利用したいチャットごとに、そのスキルを有効にしてください。
「プラグイン」→「スキル」→「スキルを追加」→「GitHubのURLから」を選択し、フォルダのURLを貼り付けて「続行」を押します。
2

別のAIエージェントにインストール

Agent Skills形式を読み取れるAIエージェントなら、このスキルを利用できます。フォルダをそのAIエージェントのスキルディレクトリにコピーしてください。

Claude Code — .claude/skills
git clone --depth 1 https://github.com/Nebulavenus/forge-gpu.git /tmp/forge-gpu
mkdir -p .claude/skills
cp -r /tmp/forge-gpu/.claude/skills/dev-reset-workspace .claude/skills/dev-reset-workspace
コピー後、新しいスキルを読み込むためにClaude Codeを再起動してください。

TypingMindで使用

TypingMindのチャットでDev Reset Workspaceを有効にするだけで、あとはモデルが対応します。名前と説明がシステムプロンプトに含まれ、関連するリクエストがあると、モデルが指示の全文を自動で読み込みます。手動で呼び出す必要はなく、実際に使用されるまでトークンを消費しません。

関連するリクエストがあると、モデルが自動的にDev Reset Workspaceを読み込みます。

どのAIモデルでも利用可能

AIスキルはプロバイダー固有のコードではなく、通常のMarkdownで書かれた指示です。そのため、Dev Reset Workspaceは作成時に想定されたモデルに縛られません。TypingMindに一度インストールすれば、ご自身のAPIキーを使って、GPT-5、Claude、Gemini、Grok、DeepSeek、Mistral、Llama、またはご自身で実行するローカルモデルで利用できます。

  • 必要なときだけ読み込み

    システムプロンプトには名前と説明だけが含まれます。関連するリクエストが初めてあったときに指示を取得するため、未使用のスキルにはコストがかかりません。

  • チャットの途中でモデルを切り替え

    スキルはコードではなく指示なので、モデルを切り替えてもそのまま使えます。次のモデルも同じSKILL.mdを読み込みます。

スキルの指示

モデルが読み込むSKILL.mdの内容です。スキルはモデルが従う指示なので、インストールする前に確認してください。

Reset the workspace to a clean state on main with no leftover branches, uncommitted files, or background agents from previous work. Run this between tasks to start fresh.

When to use this skill:

  • After merging a PR and before starting new work
  • When the workspace has accumulated stale branches or uncommitted files
  • When background agents from a previous session may still be running
  • Any time git status or git diff is not clean and you want a fresh start

Arguments

  • --force (optional): Skip interactive prompts — auto-delete safe-to-remove files and stale branches without asking. Still preserves files that appear to contain meaningful uncommitted work.

Workflow

Work through each phase in order. Report findings at each phase before acting. Unless --force is given, ask the user before destructive actions.


Phase 1 — Stop background agents

Check for running background tasks (agents, shells, builds) from previous work.

  1. List running tasks: Use the TaskList tool (or /tasks output) to find any in-progress background agents or shells.

  2. For each running task:

    • Identify what it is doing (build, test, agent work, etc.)
    • Determine if it is safe to stop — a task is safe to stop if:
      • It belongs to a completed/merged PR
      • It is idle or stuck
      • It is a stale monitoring or polling loop
    • A task is NOT safe to stop if:
      • It is actively writing files that haven't been committed
      • It is mid-push or mid-merge
  3. Stop safe tasks using TaskStop. Report any tasks you chose not to stop and why.

  4. If no tasks are running, report "No background tasks found" and proceed.


Phase 2 — Analyze uncommitted changes

Examine the working tree for any modifications or untracked files.

  1. Run diagnostics in parallel:

    bash
    git status --short
    git diff --stat
    git diff --cached --stat
    git log --oneline -10
    git branch -vv
  2. If the working tree is clean (no output from status/diff), skip to Phase 3.

  3. For each uncommitted or untracked file, classify it:

    ClassificationActionExamples
    Belongs to a merged PRShould have been committed — warn userSource files matching recent PR topics
    Build artifact / generated fileSafe to delete or add to .gitignorebuild/, *.o, *.spv, shaders/compiled/
    Editor / OS junkAdd to .git/info/exclude (local only).DS_Store, *.swp, .vscode/settings.json
    Meaningful new workStash or warn — do NOT deleteNew lesson files, library changes
    UnknownAsk the userAnything ambiguous
  4. To classify files, check recent context:

    bash
    # Recent merged PRs
    gh pr list --state merged --limit 5
    
    # Recent branches (local and remote)
    git branch -a --sort=-committerdate | head -20
    
    # What the current branch was working on
    git log --oneline HEAD...origin/main 2>/dev/null
  5. Report findings in a table:

    text
    Uncommitted files analysis:
    ──────────────────────────────────────────────
    M  lessons/gpu/17-normal-maps/main.c   → Belongs to merged PR #42 (stale edit)
    ?? build/CMakeCache.txt                 → Build artifact (safe to delete)
    ?? .DS_Store                            → OS junk (add to local exclude)
    A  lessons/gpu/30-new-lesson/main.c     → New work (stash? ask user)
  6. Take action per classification:

    • Merged-PR leftovers: Warn the user. These may be edits that should have been in the PR. Offer to discard them (git checkout -- <file>) or stash them.
    • Build artifacts already in .gitignore: Delete with git clean -fd for those paths only (not a blanket clean).
    • Build artifacts NOT in .gitignore: Offer to add them to .gitignore and then delete.
    • Editor/OS junk: Add patterns to .git/info/exclude (not .gitignore, since these are personal and shouldn't be committed).
    • Meaningful new work: git stash push -m "dev-reset: uncommitted work". Report the stash entry so the user can recover it.
    • Unknown: Ask the user with AskUserQuestion (options: delete, stash, gitignore, local exclude, skip).

Phase 3 — Switch to main and pull latest

  1. If not on main:

    bash
    git checkout main

    If checkout fails due to uncommitted changes, go back to Phase 2 — something was missed.

  2. Pull latest:

    bash
    git pull origin main
  3. Verify:

    bash
    git status --short
    git diff --stat

    Both should produce no output. If not, investigate and resolve.


Phase 4 — Remove stale local branches

Find and delete local branches whose work has been merged into origin/main.

  1. Fetch latest remote state:

    bash
    git fetch --prune origin
  2. Find merged branches:

    bash
    git branch --merged origin/main \
      | sed 's/^[* ]*//' \
      | grep -v '^main$'
  3. Find branches whose remote tracking branch is gone (PR was merged and remote branch deleted):

    bash
    git branch -vv | grep ': gone]' | awk '{print $1}'
  4. Combine both lists (deduplicate). For each branch:

    • Confirm it is not the current branch

    • Confirm it has been merged or its remote is gone

    • Delete it:

      bash
      git branch -d <branch-name>
    • If -d fails (not fully merged), report it and skip — do NOT use -D unless the user explicitly confirms or --force was given AND the remote tracking branch is gone (meaning the PR was merged and the remote branch was deleted by GitHub).

  5. Report what was removed:

    text
    Removed stale branches:
      ✓ lesson-17-normal-maps (merged, remote deleted)
      ✓ lesson-18-scene-loading (merged, remote deleted)
      ⏭ experiment-wip (not merged, kept)

Phase 5 — Clean up worktrees

Check for leftover Claude Code worktrees from previous sessions.

bash
git worktree list

If any worktrees exist under .claude/worktrees/:

  • Check if they have uncommitted changes (git -C <path> status --short)
  • If clean: git worktree remove <path>
  • If dirty: warn the user and skip

Phase 6 — Final verification

Run a final check to confirm everything is clean.

bash
git status
git diff
git branch
git log --oneline -3

Expected state:

  • On branch main
  • Working tree clean (nothing to commit)
  • git diff produces no output
  • Only main (and any intentionally kept branches) remain
  • HEAD matches origin/main

Report final state:

text
Workspace Reset Complete
════════════════════════
Branch:          main (up to date with origin/main)
Working tree:    clean
Stale branches:  3 removed, 0 kept
Background tasks: 0 running
Stashed work:    1 entry (use `git stash list` to see)

Ready for new work.

Error handling

  • Merge conflicts during pull: Report the conflict and exit — user must resolve manually.
  • Protected branches: Never force-delete main or master.
  • Network errors on fetch/pull: Report and continue with local cleanup.
  • gh CLI not authenticated: Skip PR-related analysis, proceed with git-only checks.

Safety guarantees

  • Never runs git clean -fdx on the entire repo. Only cleans specific identified paths.
  • Never runs git reset --hard unless the user explicitly confirms.
  • Never deletes branches with -D without user confirmation (or --force with remote-gone confirmation).
  • Always stashes rather than deletes when in doubt about uncommitted work.
  • Never modifies .gitignore without showing the user what will be added.
  • Reports everything before acting — the user sees the plan first.

よくある質問

AIスキル「Dev Reset Workspace」では何ができますか?

Clean the workspace of finished-work vestiges so new work can start from a fresh main branch

TypingMindでDev Reset Workspaceを使うメリットは何ですか?

一度インストールすれば、どのモデルでも使えるからです。Dev Reset Workspaceはプロバイダー固有のコードではなく、通常のMarkdownで記述されているため、同じスキルをGPT-5、Claude、Gemini、Grok、ローカルモデルで利用できます。チャットの途中でモデルを切り替えても、そのまま使い続けられます。TypingMindは自分のAPIキーで動作するため、シート単位のサブスクリプションではなく、プロバイダーに直接料金を支払います。スキルとチャットは自分のストレージに保持されます。

TypingMindにDev Reset Workspaceをインストールするにはどうすればよいですか?

TypingMindで「プラグイン」→「スキル」→「GitHubからインストール」を開き、https://github.com/Nebulavenus/forge-gpu/tree/main/.claude/skills/dev-reset-workspaceを貼り付けてください。TypingMindがSKILL.mdを読み込み、チャットごとに有効にできるスキルとしてインストールします。

Dev Reset Workspaceを使えるAIモデルはどれですか?

TypingMindに接続したどのモデルでも利用できます。AIスキルはプロバイダー固有のコードではなく、通常のMarkdownで書かれた指示です。そのため、GPT、Claude、Gemini、Grok、ローカルモデルのいずれも、リクエストが合致したときにこのスキルを読み込めます。

Dev Reset Workspaceは何個のAIモデルで使えますか?

数に制限はありません。スキルに対応したモデルであれば、GPT、Claude、Gemini、Grok、DeepSeek、Mistral、Llamaなど、どのモデルでもDev Reset Workspaceを利用できます。すべてTypingMind上で、自分のAPIキーを使って利用できます。

AIスキル「Dev Reset Workspace」は無料ですか?

はい。NebulavenusがGitHubでZlibライセンスの下で公開しています。支払いが必要なのは、利用したトークンに対する、ご自身が契約するAIプロバイダーへの料金だけです。

AIスキルとは何ですか?

AIスキルは、特定のタスクの実行方法をAIモデルに教える、再利用可能な指示のセットです。オープンなAgent Skills形式に従い、名前と説明を含むSKILL.mdファイルに加え、モデルが必要とするスクリプト、テンプレート、参照ファイルで構成されます。モデルはリクエストがスキルに合致したときだけ指示を読み込むため、インストール済みのスキルも、使うまでは費用がかかりません。

AIスキルは、プラグインやMCPサーバーとどう違いますか?

プラグインやMCPサーバーは、モデルが呼び出せる新しいツールを提供します。ツールとは、どこかで実行され、結果を返すコードです。一方、AIスキルは、タスクへの取り組み方、従うべき手順、望ましい出力の例といった知識や進め方をモデルに伝えます。スキルは通常のMarkdownで記述されているため、サーバー、APIキー、実行環境は不要で、どのモデルでも利用できます。

すべて見る

今すぐ自分専用のAIワークスペースを作成

ニュースレターに登録すると、新機能や今後のプレゼント企画のお知らせが届きます👇