jpskill.com
📦 その他 コミュニティ

specalign

仕様ファイルと実装の間のずれを検出し、不一致を表面化させることで、ユーザーが仕様またはコードを更新するかどうかを決定するためのSkill。

📜 元の英語説明(参考)

Align spec files with implementation. Detects drift between spec and code, surfaces discrepancies, user decides whether to update spec or code. Use when both a spec file and its implementation are in context.

🇯🇵 日本人クリエイター向け解説

一言でいうと

仕様ファイルと実装の間のずれを検出し、不一致を表面化させることで、ユーザーが仕様またはコードを更新するかどうかを決定するためのSkill。

※ jpskill.com 編集部が日本のビジネス現場向けに補足した解説です。Skill本体の挙動とは独立した参考情報です。

⚡ おすすめ: コマンド1行でインストール(60秒)

下記のコマンドをコピーしてターミナル(Mac/Linux)または PowerShell(Windows)に貼り付けてください。 ダウンロード → 解凍 → 配置まで全自動。

🍎 Mac / 🐧 Linux
mkdir -p ~/.claude/skills && cd ~/.claude/skills && curl -L -o specalign.zip https://jpskill.com/download/5887.zip && unzip -o specalign.zip && rm specalign.zip
🪟 Windows (PowerShell)
$d = "$env:USERPROFILE\.claude\skills"; ni -Force -ItemType Directory $d | Out-Null; iwr https://jpskill.com/download/5887.zip -OutFile "$d\specalign.zip"; Expand-Archive "$d\specalign.zip" -DestinationPath $d -Force; ri "$d\specalign.zip"

完了後、Claude Code を再起動 → 普通に「動画プロンプト作って」のように話しかけるだけで自動発動します。

💾 手動でダウンロードしたい(コマンドが難しい人向け)
  1. 1. 下の青いボタンを押して specalign.zip をダウンロード
  2. 2. ZIPファイルをダブルクリックで解凍 → specalign フォルダができる
  3. 3. そのフォルダを C:\Users\あなたの名前\.claude\skills\(Win)または ~/.claude/skills/(Mac)へ移動
  4. 4. Claude Code を再起動

⚠️ ダウンロード・利用は自己責任でお願いします。当サイトは内容・動作・安全性について責任を負いません。

🎯 このSkillでできること

下記の説明文を読むと、このSkillがあなたに何をしてくれるかが分かります。Claudeにこの分野の依頼をすると、自動で発動します。

📦 インストール方法 (3ステップ)

  1. 1. 上の「ダウンロード」ボタンを押して .skill ファイルを取得
  2. 2. ファイル名の拡張子を .skill から .zip に変えて展開(macは自動展開可)
  3. 3. 展開してできたフォルダを、ホームフォルダの .claude/skills/ に置く
    • · macOS / Linux: ~/.claude/skills/
    • · Windows: %USERPROFILE%\.claude\skills\

Claude Code を再起動すれば完了。「このSkillを使って…」と話しかけなくても、関連する依頼で自動的に呼び出されます。

詳しい使い方ガイドを見る →
最終更新
2026-05-17
取得日時
2026-05-17
同梱ファイル
1

📖 Skill本文(日本語訳)

※ 原文(英語/中国語)を Gemini で日本語化したものです。Claude 自身は原文を読みます。誤訳がある場合は原文をご確認ください。

スペックアラインメント

原則(常に有効)

これらは、スペックファイルとそれに対応する実装の両方がコンテキストにある場合に常に適用されます。

スペックとコードは一致しなければなりません

  • スペックは意図された動作を記述し、コードはそれを実装します。両者が一致しない場合、どちらかが間違っています。
  • 乖離を黙って許容してはなりません。気づいたらすぐに表面化させてください。
  • 各不一致について、どちらが信頼できる情報源であるかをユーザーが決定します。仮定しないでください。

乖離のカテゴリ

  • 型乖離: スペックが実装と一致しないフィールド/型を定義している場合
  • 動作乖離: スペックがコードが従わないロジックを記述している場合
  • 実装不足: スペックが対応するコードなしで何かを定義している場合
  • スペック不足: コードがスペックに記述されていない動作を実装している場合
  • 制約乖離: スペックがコードが強制しない不変条件を記述している場合
  • エラー処理乖離: スペックがコードが処理しないエラーケースを定義している場合(またはその逆)

変更ポリシー

  • ユーザーが不一致に対して明示的に「スペックを更新」を選択しない限り、スペックファイルを編集しないでください。
  • ユーザーが明示的に「コードを更新」を選択しない限り、実装ロジックを変更しないでください。
  • コードを更新する際は、変更後に lint/typecheck を実行してください。
  • スペックを更新する際は、無関係なセクションのフォーマットと構造を保持してください。

双方向の認識

コードを読む際は、スペックが存在するかどうかを確認し、相違点をメモしてください。 スペックを読む際は、実装が一致するかどうかを確認し、相違点をメモしてください。 この認識は受動的であるべきです。乖離が直接関連する場合を除き、ユーザーの主要なタスクを中断することなく、応答で乖離を指摘してください。

ワークフロー(明示的にアラインメントを行う場合)

ステップ 1: スペックファイルを特定する

スペックファイルが必要です。以下を検索してください。

  • *.spec.md*-spec.mdSPEC.md
  • spec/*.mddocs/*.spec.md

複数のスペックが存在する場合は、どれをアラインメントするかを尋ねてください。存在しない場合は停止してください。このワークフローには既存のスペックが必要です。

スペックファイルを完全に読み込んでください。

ステップ 2: スペックをコードにマッピングする

各スペックセクションについて、対応する実装を特定してください。

スペックセクション ソースファイル ステータス
## Types src/types.ts:10-40 aligned / drifted / missing-impl / missing-spec

評価する前に、マッピングされた各ソースファイルを読み込んでください。

ステップ 3: 不一致を提示する

各不一致について:

### DRIFT-01: <短い説明>

**スペックの記述** (spec-file.md:L42):
> <引用されたスペックテキスト>

**コードの動作** (src/module.ts:L87):
> <要約されたコードの動作>

**影響**: <何が壊れるか、または一貫性がないか>

安定した ID (DRIFT-NN) で番号を振ってください。根本原因を共有する関連する不一致をまとめてください。

ステップ 4: ユーザーの決定

各不一致について、以下を尋ねてください。

  • スペックを更新 - コードが正しいので、スペックをコードに合わせて更新します
  • コードを更新 - スペックが正しいので、コードをスペックに合わせて更新します
  • スキップ - この不一致を後回しにします

ステップ 5: 変更を適用する

スペックの更新:

  • 修正されたテキストでスペックファイルを編集します
  • 無関係なセクションのフォーマットと構造を保持します

コードの更新:

  • 実装をスペックに合わせて修正します
  • 変更後に lint/typecheck を実行します
  • 些細な変更でない場合は、変更の概要を説明し、編集前に確認します
  • 影響を受けるコードの単体テストが存在する場合は、それらを実行します
  • 単体テストが存在せず、スペックがテスト可能な動作を定義している場合は、それを指摘します

ステップ 6: 要約

## スペックアラインメント: <ファイル>

**見つかった不一致**: N
**解決済み**: X (スペック: A, コード: B, スキップ: C)

### 残り
- DRIFT-04: <説明> (スキップ済み)
📜 原文 SKILL.md(Claudeが読む英語/中国語)を展開

Spec Alignment

Principles (Always Active)

These apply whenever a spec file and its corresponding implementation are both in context:

Spec and Code Must Agree

  • A spec describes intended behavior; code implements it. When they disagree, one is wrong.
  • Never silently tolerate drift - surface it immediately when noticed.
  • The user decides which is the source of truth for each discrepancy. Do not assume.

Drift Categories

  • Type drift: spec defines fields/types that don't match the implementation
  • Behavior drift: spec describes logic the code doesn't follow
  • Missing implementation: spec defines something with no corresponding code
  • Missing spec: code implements behavior not described in the spec
  • Constraint drift: spec states invariants the code doesn't enforce
  • Error handling drift: spec defines error cases the code doesn't handle (or vice versa)

Mutation Policy

  • Do not edit spec files unless the user explicitly chooses "update spec" for a discrepancy.
  • Do not change implementation logic unless the user explicitly chooses "update code".
  • When updating code, run lint/typecheck after changes.
  • When updating spec, preserve formatting and structure of unrelated sections.

Bidirectional Awareness

When reading code, check if a spec exists and note divergences. When reading a spec, check if the implementation matches and note divergences. This awareness should be passive - flag drift in your responses without interrupting the user's primary task, unless the drift is directly relevant.

Workflow (When Explicitly Aligning)

Step 1: Locate the Spec

A spec file is required. Search for:

  • *.spec.md, *-spec.md, SPEC.md
  • spec/*.md, docs/*.spec.md

If multiple specs exist, ask which to align. If none exist, stop - this workflow requires an existing spec.

Read the spec file completely.

Step 2: Map Spec to Code

For each spec section, identify the corresponding implementation:

Spec Section Source File(s) Status
## Types src/types.ts:10-40 aligned / drifted / missing-impl / missing-spec

Read each mapped source file before assessing.

Step 3: Present Discrepancies

For each discrepancy:

### DRIFT-01: <short description>

**Spec says** (spec-file.md:L42):
> <quoted spec text>

**Code does** (src/module.ts:L87):
> <summarized code behavior>

**Impact**: <what breaks or is inconsistent>

Number with stable IDs (DRIFT-NN). Batch related discrepancies that share a root cause.

Step 4: User Decision

For each discrepancy, ask:

  • Update spec - the code is correct, update the spec to match
  • Update code - the spec is correct, update the code to match
  • Skip - defer this discrepancy

Step 5: Apply Changes

Spec updates:

  • Edit the spec file with corrected text
  • Preserve formatting and structure of unrelated sections

Code updates:

  • Fix the implementation to match the spec
  • Run lint/typecheck after changes
  • If non-trivial, outline the change and confirm before editing
  • If unit tests exist for the affected code, run them
  • If unit tests don't exist and the spec defines testable behavior, flag it

Step 6: Summary

## Spec Alignment: <file>

**Discrepancies found**: N
**Resolved**: X (spec: A, code: B, skipped: C)

### Remaining
- DRIFT-04: <description> (skipped)