Communityコーディング&開発github.com

alfathafp/portofolio-web-design

実装が完了し、すべてのテストが合格した後、作業を統合する方法を決定するために使用します

portofolio-web-design とは?

このスキルは、開発ブランチを完了させるための体系的なワークフローを提供します。テストの検証、環境の検出、オプションの提示、選択の実行、クリーンアップのステップを順に実行します。主にGitワークフローの統合プロセスを自動化・標準化し、開発者が自信を持って作業をマージ、プッシュ、または破棄できるようにします。通常のリポジトリ、名前付きブランチのワークツリー、デタッチドHEADの各環境に対応したメニューを表示し、人間のパートナーに明確な選択肢を提示します。このスキルはClaude Code、Cursor、CodexなどのAIエージェントと連携し、ユーザーの明示的な確認を待ってから操作を実行するため、誤った操作を防止します。

対応~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/alfathafp/portofolio-web-design/tree/HEAD/.agents/skills/finishing-a-development-branch

Installed? Explore more コーディング&開発 skills: steipete/bluebubbles, steipete/eightctl, steipete/blucli · View all 6 →

お気に入りのAIに質問する

このエージェントスキルを事前に読み込んだ状態で新しいチャットを開きます。

ドキュメント

開発ブランチの完了

概要

中核原則: テストの検証 → 環境の検出 → オプションの提示 → 選択の実行 → クリーンアップ。

開始時の宣言: 「開発ブランチ完了スキルを使用して、この作業を完了します。」

ステップ1: テストの検証

プロジェクトの全テストスイートを実行します(npm test / cargo test / pytest / go test ./...)。

テストが失敗した場合、失敗を報告して停止します。メニューはテストがすべて合格した後に表示されます。

テスト失敗(<N>件の失敗)。完了前に修正が必要です:

[失敗内容を表示]

テストが合格した場合: ステップ2に進みます。

ステップ2: 環境の検出

GIT_DIR=$(cd "$(git rev-parse --git-dir)" 2>/dev/null && pwd -P)
GIT_COMMON=$(cd "$(git rev-parse --git-common-dir)" 2>/dev/null && pwd -P)
# ワークスペース内にいる今のうちに取得 — ステップ5でディレクトリが変更されるため、
# クリーンアップ(ステップ6)でこの値が必要
WORKTREE_PATH=$(git rev-parse --show-toplevel)

これにより、表示するメニューとクリーンアップの動作が決まります。

状態メニュークリーンアップ
GIT_DIR == GIT_COMMON(通常のリポジトリ)標準3オプションクリーンアップ不要
GIT_DIR != GIT_COMMON、名前付きブランチ標準3オプション来歴ベース(ステップ6参照)
GIT_DIR != GIT_COMMON、デタッチドHEAD縮小2オプション(マージなし)外部管理 — そのまま維持

ステップ3: ベースブランチの決定

ベースブランチは、この作業が分岐した元のブランチです。通常は計画、会話、またはブランチの上流で指定されています。不明な場合は、「このブランチは <あなたの最良の推測> から分岐しましたか?」と質問して確認してください。間違ったベースにマージすると、元に戻すのに大きなコストがかかります。

ステップ4: オプションの提示

通常のリポジトリおよび名前付きブランチのワークツリー — 次の3つのオプションを正確に提示:

実装が完了しました。何をしますか?

1. <ベースブランチ> にローカルでマージする
2. プッシュしてプルリクエストを作成する
3. ブランチをそのまま維持する(後で対応します)

どのオプションにしますか?

デタッチドHEAD — 次の2つのオプションを正確に提示:

実装が完了しました。デタッチドHEAD(外部管理のワークスペース)にいます。

1. 新しいブランチとしてプッシュし、プルリクエストを作成する
2. そのまま維持する(後で対応します)

どのオプションにしますか?

メニューは上記の通り正確に提示してください。作業の破棄は、人間のパートナーが明示的に要求した場合のみ行われます(下記「人間のパートナーが作業の破棄を要求した場合」を参照)。回答を待ちます。統合の決定はパートナーに委ねられます。

ステップ5: 選択の実行

オプション1: ローカルでマージ

# CWDの安全性のため、メインリポジトリのルートを取得
MAIN_ROOT=$(git -C "$(git rev-parse --git-common-dir)/.." rev-parse --show-toplevel)
cd "$MAIN_ROOT"

# 先にマージ — 何かを削除する前に成功を確認
git checkout <ベースブランチ>
git pull
git merge <フィーチャーブランチ>

# マージ結果のテストを検証
<テストコマンド>

マージ結果でテストが失敗した場合: 停止し、ワークツリーとブランチをそのまま残して調査します。何もプッシュされていないため、マージはローカルで回復可能です。

マージ結果が合格したら: ワークツリーをクリーンアップ(ステップ6)し、ブランチを削除します。

git branch -d <フィーチャーブランチ>

オプション2: プッシュしてPRを作成

git push -u origin <フィーチャーブランチ>
# デタッチドHEADからは、リモートに新しいブランチを命名:
# git push origin HEAD:refs/heads/<新しいブランチ>

次に、<ベースブランチ> に対するプル/マージリクエストを、フォージのツール(CLIがあればそれ、なければプッシュ時にほとんどのフォージが表示する作成URL)を使用して作成します。リポジトリのPRテンプレートと規約があればそれに従い、URLを人間のパートナーに報告します。

ワークツリーはそのまま維持します。人間のパートナーがPRフィードバックに対してそこで作業を繰り返します。

オプション3: そのまま維持

報告: 「ブランチ <名前> を維持します。ワークツリーは <パス> に保存されています。」

人間のパートナーが作業の破棄を要求した場合

このパスは、作業を破棄するという明示的な要求への応答としてのみ存在します。先に確認します。

これにより、以下が完全に削除されます:
- ブランチ <名前>
- すべてのコミット: <コミットリスト>
- ワークツリー: <パス>

確認するには 'discard' と入力してください。

正確な確認を待ちます。確認がきたら:

MAIN_ROOT=$(git -C "$(git rev-parse --git-common-dir)/.." rev-parse --show-toplevel)
cd "$MAIN_ROOT"

その後、ワークツリーをクリーンアップ(ステップ6)し、ブランチを強制削除します。

git branch -D <フィーチャーブランチ>

ステップ6: ワークスペースのクリーンアップ

オプション1および確認済みの破棄で実行されます。 オプション2と3は常にワークツリーを維持します。両方の呼び出し元はすでにメインリポジトリのルートにディレクトリを変更しており(ワークツリーの削除はワークツリーの外部から実行する必要があります)、ステップ2で取得した GIT_DIR/GIT_COMMON/WORKTREE_PATH の値(ディレクトリ変更前の値)を使用します。

GIT_DIR == GIT_COMMON の場合: 通常のリポジトリ、クリーンアップするワークツリーはありません。完了。

WORKTREE_PATH が .worktrees/ または worktrees/ の下にある場合: スーパーパワーズがこのワークツリーを作成しました。クリーンアップは当スキルが行います。

git worktree remove "$WORKTREE_PATH"
git worktree prune  # 自己修復: 古い登録をクリーンアップ

削除が拒否された場合(modified or untracked filesが含まれる): ワークツリーには他のどこにも存在しないファイル(未コミットの計画、メモ、スクラッチ作業)が含まれています。自分の判断で --force を使用しないでください。何が問題かを人間のパートナーに示し、尋ねます。

git -C "$WORKTREE_PATH" status --porcelain -uall
ワークツリーの削除が拒否されました — これらのファイルは一度もコミットされていません:

<ファイルリスト>

1. クリーンアップ前に <ブランチ> にコミットする
2. <メインリポジトリルート> に移動する
3. 削除する(復元不可)

どれにしますか?

選択を実行し、ワークツリーを削除します。

それ以外の場合: ホスト環境がこのワークスペースを所有しています。そのまま維持します。プラットフォームがワークスペース終了ツールを提供している場合は、それを使用します。

クイックリファレンス

オプションマージプッシュワークツリー維持ブランチクリーンアップ
1. ローカルマージはい--はい
2. PR作成-はいはい-
3. そのまま維持--はい-
破棄(明示的依頼のみ)---はい(強制)

よくある言い訳

言い訳現実
「このセッション中にテストは合格していた」統合しようとしているツリーでスイートを実行してください。合格はそのツリーでしか証明できません。
「明らかにマージしたいはずだ」統合は人間のパートナーの決定です。メニューを提示して待ちましょう。
「この機能は完了したようだ — 破棄を提案しよう」メニューは書かれた通り完全です。破棄は人間のパートナーが明示的に要求した場合のみ行われます。
「「ああ、消して」は確認とみなされる」削除を許可するのは、入力された単語 discard だけです。
「PRが作成されたので、ワークツリーはもはや不要だ」PRフィードバックはそのワークツリーで修正されます。作業が完了するまで維持されます。
「この他のワークツリーは古そうだ — 一緒に掃除しよう」.worktrees/ または worktrees/ の下にあるワークツリーのみをクリーンアップします。それ以外はすべてホストのものです。
「削除が拒否された — --force はクリーンアップの完了だ」拒否は、ファイルがそのワークツリーにしか存在しないことを意味します。--force はそれらを完全に破壊します。人間のパートナーに示して尋ねましょう。
「マージ結果の失敗はおそらくフレーキーだ」マージ結果の失敗はすべてを停止します。ブランチとワークツリーはそのまま残し、調査します。
「ベースブランチは明らかにmainだ」分岐点を確認するか、質問してください。間違ったベースにマージすると、元に戻すのに大きなコストがかかります。
「プッシュが拒否された — フォースプッシュで修正しよう」プッシュの拒否はリモートが動いたことを意味します。調査し、フォースプッシュは人間のパートナーの明示的な要求がある場合のみ行います。

Individual skills in this repo

This repo contains 20 individual skills — each has its own dedicated page.

alfathafp/portofolio-web-design

You MUST use this before any creative work - creating features, building components, adding functionality, modifying behavior, or planning anything new, in software or out of it (a talk, a business, a renovation).

alfathafp/portofolio-web-design

Tests in real browsers via Chrome DevTools MCP. Use when building or debugging anything that runs in a browser. Use when you need to inspect the DOM, capture console errors, analyze network requests, profile performance, or verify visual output with real runtime data. Requires the chrome-devtools MCP server to be configured.

alfathafp/portofolio-web-design

Automates CI/CD pipeline setup. Use when setting up or modifying build and deployment pipelines. Use when you need to automate quality gates, configure test runners in CI, or establish deployment strategies.

alfathafp/portofolio-web-design

Conducts multi-axis code review. Use before merging any change. Use when reviewing code written by yourself, another agent, or a human. Use when you need to assess code quality across multiple dimensions before it enters the main branch. Use when asked to review a diff or a pull request, even when the diff is pasted inline.

alfathafp/portofolio-web-design

Simplifies code for clarity. Use when refactoring code for clarity without changing behavior. Use when code works but is harder to read, maintain, or extend than it should be. Use when reviewing code that has accumulated unnecessary complexity.

alfathafp/portofolio-web-design

Establishes a project's quality bar as a written contract and stops agents quietly lowering it. Interviews the user on which dimensions matter, supplies sane default thresholds when they have no number in mind, records everything in CONSTRAINTS.md, and watches the diff for a weakened bar — new @ts-ignore or eslint-disable suppressions, skipped or deleted tests, assertions stripped out, unimplemented stubs, thresholds edited down. Use when no quality bar is written down, when the user says "set up constraints" or "define our standards", when the user wants dimensions they care about — accessibility, web performance, coverage — set up as enforced constraints, when an agent keeps silencing checks or skipping tests to get to green, when you need a coverage or performance threshold and don't know what number to pick, or when an agent writes more code than anyone will read.

alfathafp/portofolio-web-design

Optimizes agent context setup. Use when starting a new session, when agent output quality degrades, when switching between tasks, or when you need to configure rules files and context for a project.

alfathafp/portofolio-web-design

Guides systematic root-cause debugging. Use when tests fail, builds break, something that worked yesterday broke, behavior doesn't match expectations, or you encounter any unexpected error. Use when you need to figure out what broke and why — a systematic approach to finding and fixing the root cause rather than guessing.

alfathafp/portofolio-web-design

Deploy applications and websites to Vercel. Use when the user requests deployment actions like "deploy my app", "deploy and give me the link", "push this live", or "create a preview deployment".

alfathafp/portofolio-web-design

Manages deprecation and migration. Use when removing old systems, APIs, or features. Use when migrating users from one implementation to another. Use when migrating a database schema in production, such as renaming or dropping a column without downtime (expand/contract). Use when deciding whether to maintain or sunset existing code.

alfathafp/portofolio-web-design

Use when a superpowers session went wrong and your human partner wants to know why — repeated work, ignored plans, stumbles, poor results, a skill that didn't fire, "it took too long", "why is it so expensive", "what is it doing" — or wants to build a bug report for the superpowers maintainers, for the current session or a past one identified by id or path, on any harness.

alfathafp/portofolio-web-design

Use when facing 2+ independent tasks that can be worked on without shared state or sequential dependencies

alfathafp/portofolio-web-design

Records decisions and documentation. Use when you need to document an architecture decision (ADR) or the reasoning behind a design choice, when changing public APIs, shipping features, or when you need to record context that future engineers and agents will need to understand the codebase.

alfathafp/portofolio-web-design

Subjects every non-trivial decision to a fresh-context adversarial review before it stands. Use when you want every assumption cross-examined before proceeding, when stress-testing a plan for hidden failure modes, when correctness matters more than speed, when working in unfamiliar code, when stakes are high (production auth, security-sensitive logic, a high-stakes migration, irreversible operations), or any time a confident output would be cheaper to verify now than to debug later.

alfathafp/portofolio-web-design

Use when executing an implementation plan in the current session as the implementer yourself — your human partner chose inline execution, or no subagent tool is available

alfathafp/portofolio-web-design

Builds production-quality, accessible, responsive user-facing UIs. Use when building or modifying interfaces and pages, creating components, implementing layouts, meeting WCAG accessibility requirements, managing state, or when the output needs to look and feel production-quality rather than AI-generated.

alfathafp/portofolio-web-design

Structures git workflow practices. Use when making any code change. Use when committing, branching, resolving conflicts, splitting uncommitted work in a messy working tree into clean atomic commits, opening or reviewing a pull request (PR), pushing to a remote, or when you need to organize work across multiple parallel streams. Use when cutting a release, choosing a semantic version bump, tagging, or writing a changelog.

alfathafp/portofolio-web-design

Refines raw ideas into sharp, actionable concepts through structured divergent and convergent thinking. Use when an idea is still vague, when you need to stress-test assumptions before committing to a plan, or when you want to expand options before converging on one. Triggers on "ideate", "refine this idea", or "stress-test my plan".

alfathafp/portofolio-web-design

Delivers changes incrementally in thin, verifiable slices. Use when implementing any feature or change that touches more than one file, or when picking up the next task from a plan. Use when rolling a change out behind a feature flag, when you're about to write a large amount of code at once, or when a task feels too big to land in one step.

alfathafp/portofolio-web-design

Guides stable API and interface design. Use when designing APIs, module boundaries, or any public interface. Use when creating REST or GraphQL endpoints, defining type contracts between modules, or establishing boundaries between frontend and backend.

関連スキル