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

test-local-twoliter

ローカルの twoliter ソースをビルドし、キットでそのバイナリを使ってテストするためのスキル

test-local-twoliter とは?

このスキルは、twoliter ツールのローカル変更をリリース前にテストするための手順を提供します。開発者は、twoliter リポジトリ内のソースコードを編集し、`cargo build --release` でビルドした後、キットの Makefile に `TWOLITER_DIR` 環境変数を指定してローカルバイナリを指すことで、実際のビルドプロセスでその変更を検証できます。主な用途は、twoliter の変更やバグ修正の確認、PR 作成前の動作検証です。対応プラットフォームは、Rust ツールチェーンがインストールされた環境で、bottlerocket-core-kit など任意のキットリポジトリで利用できます。このワークフローにより、リリース版に影響を与えずに安全に変更を反復・テストでき、`TWOLITER_DIR` を省略するだけで簡単にリリース版に戻せます。

対応~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/cbgbt/bottlerocket-forest/tree/main/skills/test-local-twoliter

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

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

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

ドキュメント

スキル: ローカルでの Twoliter 変更のテスト

目的

ローカルソースから twoliter をビルドし、キットがローカルでビルドされたバイナリを使用するように構成して、リリース前に変更をテストします。

使用するタイミング

  • twoliter ソースコードを変更しているとき
  • PR を作成する前に twoliter の修正をテストするとき
  • twoliter の動作をデバッグするとき
  • twoliter の修正を検証するとき

前提条件

  • フォレスト内に twoliter リポジトリがクローンされていること
  • Rust ツールチェーンがインストールされていること
  • テスト用のキットリポジトリが少なくとも1つあること

手順

1. twoliter ソースを変更する

twoliter/twoliter/src/ または twoliter/twoliter/embedded/ 内のファイルを編集します。

2. twoliter をビルドする

cd twoliter
cargo build --release

バイナリは target/release/twoliter に配置されます。

3. 変更をテストする

TWOLITER_DIR を上書きして、ローカルのビルドディレクトリを指定します。

cd kits/bottlerocket-core-kit
make build TWOLITER_DIR=./twoliter/target/release

4. 繰り返す

さらに変更を加えた後:

# twoliter を再ビルド
cd ./twoliter
cargo build --release

# 再テスト
cd kits/bottlerocket-core-kit
make build TWOLITER_DIR=./twoliter/target/release

検証

パスを確認して、ローカルの twoliter が使用されていることを確認します:

cd kits/bottlerocket-core-kit
make build TWOLITER_DIR=./twoliter/target/release 2>&1 | head -5

変更を加えた twoliter が呼び出されていることを確認できます。

一般的な問題

変更が反映されない:

  • 変更後に cargo build --release を実行したことを確認してください
  • TWOLITER_DIR のパスが正しいことを確認してください
  • バイナリが存在することを確認してください: ls -lh ./twoliter/target/release/twoliter

twoliter でのビルドエラー:

  • cargo check を実行して詳細なエラーメッセージを確認してください
  • cargo clippy を実行して一般的な問題を検出してください
  • cargo test を実行してテストが合格することを確認してください

ローカルの twoliter を使用してキットのビルドが失敗する:

  • twoliter の出力でエラーメッセージを確認してください
  • Makefile を一時的に変更するか、twoliter バイナリを直接使用して --log-level debug を追加してください

リリースバージョンへの復帰

リリースバージョンの使用に戻すには、単に TWOLITER_DIR の上書きを省略します:

cd kits/bottlerocket-core-kit
make build

これにより、リリースバージョンのデフォルトの tools/twoliter/twoliter が使用されます。

関連スキル

Individual skills in this repo

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

ad-hoc-implementation-plan

Transform a rough plan into implement-commit ready artifacts. Allows rigorous review while implementing.

build-kit-locally

Build a kit and publish it to a locally hosted registry for development testing

build-variant-from-local-kits

Build a variant using locally published kits for development validation

deep-research

Create educational documents that build understanding progressively with citations

edit-spec-file

Edit Bottlerocket RPM spec files following project style conventions

fact-find

Quick lookup of specific facts about Bottlerocket with citations

idea-honing

Clarify feature ideas through iterative Q&A, recording insights to guide concept development

implement-commit

Implement commits from an implementation plan using a TDD pipeline

local-registry

Start and manage a local OCI registry for Bottlerocket kit development

prepare-core-kit-release

Prepare bottlerocket-core-kit for release by bumping version and updating changelog

propose-feature-concept

Create a new feature concept document to pitch the idea and explain the problem/solution

propose-feature-design

Create or update feature technical design document with architecture and implementation guidance

propose-feature-requirements

Create or update feature requirements specification using EARS notation with examples and appendices

propose-feature-test-plan

Create a test plan mapping EARS requirements and Critical Constraints to specific tests

propose-implementation-plan

Create an implementation plan with atomic commits that build toward a complete feature

review-code

Deep code review generating PR comments via principled question-driven analysis

review-scope

Verify code changes match intended scope and requirements without exceeding boundaries

review-style

Verify code follows project style guides without providing improvement suggestions

update-twoliter

Update all Bottlerocket repositories to a new Twoliter version

関連スキル