fprime-component-implementation
できること
承認されたFPPモデルから生成されたハンドラー関数を埋める手順を、AIに案内します。F PrimeのコンポーネントのC++を書くエンジニア向けです。
使う場面
- ✓F PrimeのコンポーネントのFPPモデルが承認され、C++のコードを書く必要があるとき。
- ✓コンポーネントのコマンドやポートのハンドラー関数を埋める必要があるとき。
- ✓F Primeのスタイルと設計ルールに沿ったC++のコードがほしいとき。
スキルのリンク
https://github.com/nasa/fprime/blob/devel/.github/skills/fprime-component-implementation/SKILL.mdコピーしてAI(Claude、ChatGPT、Cursor)に貼り付け、指示に従うよう頼んでください。
使い方
いちばん簡単な方法:メッセージをコピーしてAIに貼り付けるだけ。AIがスキルを読んで指示に従います。
貼り付け用メッセージ
Claude Code、Codex、Cursorの場合:プロジェクトのフォルダで実行するとスキルがインストールされます。
SKILL.mdをダウンロードして、エージェントのスキル用フォルダに入れてください。
AIへの頼み方の例
“FPPモデルは承認されました。このF PrimeのコンポーネントのC++ハンドラーを書いてもらえますか。”
毎週5つの新しいスキル。1分で読めます。
仕組み
AIは、F Primeのスタイルガイドラインと設計ルールに従い、コンポーネント自身のクラスで、生成されたハンドラー関数を実装します。
技術的な内容(元のSKILL.md)
作者による元のテキスト(英語)をGitHubからそのまま表示しています。
Skill: F Prime Component Implementation (C++)
Implementation fills in the handler stubs generated from the FPP model. The autocoder produces base classes with pure-virtual handlers; you implement the derived class.
For the full reference on autocoded functions (port handlers, command handlers, telemetry, events, parameters, initialization), see Autocoded Functions and Component Classes.
Use F Prime design patterns where possible — standard solutions exist for common needs:
- Rate Group Pattern —
docs/user-manual/design-patterns/rate-group.md - Health Checking —
docs/user-manual/design-patterns/health-checking.md - Manager-Worker —
docs/user-manual/design-patterns/manager-worker.md - Application-Manager-Driver —
docs/user-manual/design-patterns/app-man-drv.md - Common Port Patterns —
docs/user-manual/design-patterns/common-port-patterns.md
Follow F Prime Style Guidelines for naming and code style.
Prerequisites
The FPP model must be confirmed (see
fprime-component-design-fpp) and C++ design rules
(fprime-cpp-design, CPP-1 through CPP-37) are mandatory.
The confirmed requirements and FPP model should provide all the
information needed for implementation.
Step-by-Step Process
Step 1 — Generate Implementation Stubs
fprime-util impl
This produces <Component>-template.cpp and <Component>-template.hpp
files. If this is the first time:
mv <Component>-template.cpp <Component>.cpp
mv <Component>-template.hpp <Component>.hpp
If iterating on an existing design, copy new handler stubs from the template into your existing files.
Step 2 — Implement Handlers
Implement all pure-virtual handlers generated from the FPP model. See Autocoded Functions for handler naming conventions, argument types, and the full API provided by the base class.
Key rules to follow during implementation:
- No dynamic memory after construction (CPP-1) — size all arrays at compile time
- Fixed-size types:
U32,FwSizeType, etc. (CPP-3, CPP-28) - No STL containers — use
Fw/DataStructuresor fixed arrays (CPP-22, CPP-25) - No
FW_ASSERTon untrusted inputs (CPP-4) — validate and return an error response instead - All variables initialized (CPP-19)
Fw::Stringoverchar*(CPP-24)- Every command handler must call
cmdResponse_out— omitting it hangs the command in the dispatcher - Events for each command (CPP-37) — add an event that describes what the command did, including the command arguments. This is frequently forgotten and is very useful for recreating what happened.
- One event emission per call site (CPP-36) — never emit the same event with the same argument set from two places; use a distinct event or a site-identifying argument.
- Mark copy/move as deleted for components (CPP-17)
Step 3 — Build and Fix Errors
fprime-util build
Iterate until compilation succeeds. Common issues:
- Missing
#includefor types used in handlers - Incorrect argument types (check the generated base class)
- Missing
cmdResponse_outcall in command handlers
Step 4 — Review Against C++ Design Rules
Before considering implementation complete, verify compliance with
fprime-cpp-design (CPP-1 through CPP-37).
Anti-Patterns
- Using
FW_ASSERTon command arguments or hardware inputs - Forgetting
cmdResponse_out(command will hang in dispatcher) - Command handlers that emit no event describing what the command did (CPP-37)
- The same event emitted from several sites with indistinguishable arguments (CPP-36)
- Using
new/deletein handler code - Using
std::string,std::vector, or other STL containers - Leaving member variables uninitialized
- Implementing behavior not covered by a requirement
よくある質問
ハンドラー関数とは何ですか?
オートコーダーが生成するスタブで、あなたがコンポーネントの実際の動作を埋めて完成させます。
コードはどのルールに従う必要がありますか?
このスキルは、F PrimeのC++の設計ルールを実装に必須としています。
FPPモデルを飛ばせますか?
いいえ。このスキルは、実装を始める前に、確定したFPPモデルを必要としています。
詳細
作者による元の説明
C++ implementation phase of F Prime component development. Guides the agent through implementing handler functions generated from the FPP model. Must follow fprime-cpp-design rules (CPP-1 through CPP-37). Trigger when the FPP model is confirmed and the next step is to write the C++ implementation. Keywords: F Prime, C++, implementation, handler, component, flight software, autocoded.
repo: nasa/fprime
人気
- GitHubのスター
- 12k
- ランキング
- #11496
- ライセンス
- Apache-2.0
- 更新日
- 2026/11/2
コメント
- …
このリポジトリの他のスキル
fprime-cmake-build-system
12kエージェントが、CMakeの層を通じて、F Primeの飛行ソフトウェアのプロジェクトにモジュール、ビルドのターゲット、プラットフォームの設定を追加できるよう支援します。
fprime-component-design-fpp
12kエージェントが、承認されたF Primeのコンポーネント要件を、ポート、コマンド、イベント、テレメトリのFPPモデルに変換できるよう支援します。
fprime-component-development
12kエージェントが、要件からインテグレーションテストまで、F Primeのコンポーネントを各開発フェーズで進められるよう支援します。
fprime-component-integration-test
12kエージェントが、実行中のデプロイに対して動く、再利用できるF Primeのコンポーネント用のpytestインテグレーションテストを書けるよう支援します。
似ているスキル
api-connector-builder
280kエージェントが既存のパターンに従って、新しいAPI連携を構築します。新しい方式を作らずに、もう一つ連携を追加したいときに使います。
api-design
280kエージェントがベストプラクティスに沿ってREST APIを設計できるようにします。APIの通信方法、エラーの表示方法、データの整理方法を決めるのに役立ちます。
backend-patterns
280kエージェントのサーバーサイドのアーキテクチャパターンとデータベースの最適化を支援します。サーバー上で動くコードを作成またはレビューするときに役立ちます。