impl

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

実装ワークフロー (Implementation Workflow)

Implementation Workflow

/spec
で作成されたTODOリストに基づき、順番に実装を進めるスキル。
A skill that proceeds with implementation in order based on the TODO list created in
/spec
.

前提条件

Prerequisites

  • /spec
    によりSpec.mdが作成済み
  • TodoWriteでタスクが登録済み

  • Spec.md has been created via
    /spec
  • Tasks have been registered in TodoWrite

Step 0: 初期設定(初回のみ)

Step 0: Initial Setup (First-time only)

実装を開始する前に、AskUserQuestion でreviewとcheckの方法を確認する。
Before starting implementation, confirm the review and check methods using AskUserQuestion.

質問1: Review方法

Question 1: Review Method

header: "Review"
question: "コードレビューはどのように行いますか?"
options:
  - label: "セルフレビュー(デフォルト)"
    description: "DRY、複雑性、仕様準拠、セキュリティの観点でチェック"
  - label: "/review スキルを使用"
    description: "プロジェクトのreviewスキルを呼び出す"
  - label: "スキップ"
    description: "レビューせずに進める"
header: "Review"
question: "How will code reviews be conducted?"
options:
  - label: "Self-review (Default)"
    description: "Check from the perspectives of DRY, complexity, specification compliance, and security"
  - label: "/review スキルを使用"
    description: "Invoke the project's review skill"
  - label: "Skip"
    description: "Proceed without review"

質問2: Check方法

Question 2: Check Method

header: "Check"
question: "コミット前のチェックコマンドを教えてください"
options:
  - label: "自動検出"
    description: "package.json, Makefile等から検出"
  - label: "npm run lint && npm run test"
    description: "標準的なnpmスクリプト"
  - label: "make check"
    description: "Makefileのcheckターゲット"
ユーザーが「Other」を選んだ場合は、具体的なコマンドを入力してもらう。

header: "Check"
question: "Please provide the pre-commit check command"
options:
  - label: "Auto-detection"
    description: "Detect from package.json, Makefile, etc."
  - label: "npm run lint && npm run test"
    description: "Standard npm scripts"
  - label: "make check"
    description: "check target in Makefile"
If the user selects "Other", ask them to enter the specific command.

ワークフロー

Workflow

各TODOに対して以下のサイクルを実行:
implement → review → check → commit → next
Execute the following cycle for each TODO:
implement → review → check → commit → next

1. Implement(実装)

1. Implement

  • TodoWriteの次のpendingタスクをin_progressに変更
  • Spec.mdの該当Acceptance Criteriaを参照
  • 必要なコードを実装
  • Change the next pending task in TodoWrite to in_progress
  • Refer to the corresponding Acceptance Criteria in Spec.md
  • Implement the required code

2. Review(レビュー)

2. Review

Step 0で選択された方法に従う:
Follow the method selected in Step 0:

セルフレビュー(デフォルト)

Self-review (Default)

観点チェック内容
DRYコードを無駄にコピペしていないか
複雑性やりたいことに対して複雑すぎる手段ではないか
仕様準拠Spec.mdの要件を満たしているか
Adhoc回避場当たり的な対応になっていないか
セキュリティOWASP Top 10等のアンチパターンを踏んでいないか
AspectCheck Items
DRYIs there any unnecessary code duplication?
ComplexityIs the approach overly complex for the intended purpose?
Specification ComplianceDoes it meet the requirements in Spec.md?
Avoid Ad-hoc SolutionsIs it not an ad-hoc fix?
SecurityDoes it avoid anti-patterns such as those in OWASP Top 10?

/review スキル使用

Use /review Skill

/review
スキルを呼び出す。
Invoke the
/review
skill.

3. Check(検証)

3. Check

Step 0で指定されたコマンドを実行。
判断基準:
  • エラー → 修正して再実行
  • 以下は許容(ただしcommitメッセージに明記):
    • ハリボテ実装による一時的な失敗
    • TDDのRed状態(テスト先行で実装がまだ)
    • 後続タスクで解決予定のエラー
Execute the command specified in Step 0.
Judgment Criteria:
  • Error → Fix and re-run
  • The following are allowed (but must be clearly stated in the commit message):
    • Temporary failures due to mock implementation
    • TDD Red state (tests written first, implementation not yet complete)
    • Errors scheduled to be resolved in subsequent tasks

4. Commit(コミット)

4. Commit

/commit
スキルを呼び出してコミット。
Checkでエラーを許容した場合のコミットメッセージ例:
feat(auth): ログイン画面の雛形を追加

WIP: テストは後続タスクで実装予定のため一部失敗
Invoke the
/commit
skill to commit.
Example commit message when errors are allowed in Check:
feat(auth): Add login screen prototype

WIP: Some tests fail as implementation is scheduled for subsequent tasks

5. Next(次へ)

5. Next

  • 完了したタスクをcompletedに更新
  • 次のpendingタスクへ進む
  • 全タスク完了まで繰り返す

  • Update the completed task to completed status
  • Proceed to the next pending task
  • Repeat until all tasks are completed

実行例

Execution Example

/impl
/impl

中断・再開

Pause/Resume

  • 途中で中断してもTodoWriteの状態は保持される
  • 再度
    /impl
    を呼び出すと、in_progressまたは次のpendingから再開
  • 再開時はStep 0の設定を再度確認する
  • The state in TodoWrite is preserved even if interrupted midway
  • When
    /impl
    is invoked again, resume from the in_progress task or the next pending task
  • Reconfirm the Step 0 settings when resuming

Check コマンドの自動検出(参考)

Auto-detection of Check Commands (Reference)

「自動検出」を選んだ場合の検出元:
ファイル検出するコマンド
package.json
scripts内のlint, typecheck, build, test
Makefile
lint, check, build, test ターゲット
pyproject.toml
ruff, mypy, pytest等
Cargo.toml
cargo check, cargo test, cargo clippy
Detection sources when "Auto-detection" is selected:
FileCommands to Detect
package.json
lint, typecheck, build, test in scripts
Makefile
lint, check, build, test targets
pyproject.toml
ruff, mypy, pytest, etc.
Cargo.toml
cargo check, cargo test, cargo clippy