fprime-component-design-fpp
它能做什么
它指导 AI 编写 FPP 接口模型,用于生成 F Prime 组件的 C++ 基础代码。适用于设计飞行软件组件的工程师。
适用场景
- ✓当 F Prime 组件的需求已获批准,需要编写其接口时。
- ✓当你需要为组件选择端口、命令、事件或遥测时。
- ✓当你想在组件中复用标准的 F Prime 设计模式时。
技能链接
https://github.com/nasa/fprime/blob/devel/.github/skills/fprime-component-design-fpp/SKILL.md复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。
使用方法
最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 AI
“我们的需求已经批准。请帮我为这个 F Prime 组件编写 FPP 模型。”
每周 5 个新技能,1 分钟读完。
工作原理
AI 会把已批准的需求转化为 FPP 文件,对任何不清楚的端口或命令选择提出询问,然后编译器会生成基础代码。
技术内容(原始 SKILL.md)
作者在 GitHub 上的英文原文。
Skill: F Prime Component Design (FPP)
The design phase codifies requirements into an FPP model — the single source of truth for the component's interface. The FPP compiler generates C++ base classes, test harnesses, and dictionaries from this model.
For FPP syntax and modeling details, see the FPP User's Guide. For component/port/command kinds, see Selecting Component, Port, and Command Kinds.
Reference the 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 - Hub Pattern —
docs/user-manual/design-patterns/hub-pattern.md - Subtopologies —
docs/user-manual/design-patterns/subtopologies.md
STOP — Confirm Before Designing
Before writing any FPP:
- Requirements must be confirmed (see
fprime-component-requirements). - Ask the user about any ambiguity in:
- Port types (does a suitable port already exist, or do we need a new one?)
- Command argument types and names
- Telemetry channel update frequency semantics (on-change vs. periodic)
- Event severity levels (DIAGNOSTIC, ACTIVITY_LO, ACTIVITY_HI, WARNING_LO, WARNING_HI, FATAL)
- Parameter default values
- Whether to use existing F Prime standard ports (
Fw.Signal,Svc.Sched,Svc.Ping, etc.)
Step-by-Step Process
Step 0 — Scaffold with fprime-util
Start with fprime-util new --component for the base structure. This
generates the initial directory layout, CMakeLists.txt, and FPP stub.
Step 1 — Choose Component Kind
Based on requirements (see
docs/user-manual/framework/component-and-port-selection.md for the
full decision guide):
| Work Type | Component Kind | When to Use |
|---|---|---|
| Cyclic (hard deadline) | passive |
Rate-group driven, no own thread |
| Cyclic with internal queue | queued |
Deferred work within a cycle |
| Event-driven | active |
Owns a thread, processes async messages |
Ask the user if unsure. The component kind determines thread ownership and port synchronization semantics.
Step 2 — Define Ports
For each interface requirement, define input/output ports. Port kinds:
sync input— executes in caller's threadasync input— enqueued, executes in component's threadguarded input— sync with component-wide mutex
See the FPP User's Guide for port definition syntax.
Standard framework ports to consider including:
| Need | Port | Import |
|---|---|---|
| Rate-group scheduling | sync input port run: Svc.Sched |
import Svc.Sched |
| Health ping | async input port pingIn: Svc.Ping drop |
import Svc.Ping |
| Time access | time get port timeCaller |
(special port) |
| Command handling | command recv port cmdIn |
(special port) |
| Event logging | event port eventOut |
(special port) |
| Telemetry | telemetry port tlmOut |
(special port) |
If the component is
active, it probably needs health-ping support. Requirements should imply whether rate-group scheduling is needed. Ask the user only if unsure about which standard services to connect to.
Step 3 — Define Commands, Telemetry, Events, Parameters
Follow the FPP User's Guide for syntax. Follow F Prime Style Guidelines for naming conventions:
- Commands:
UPPER_SNAKE_CASE - Telemetry channels:
PascalCase - Events:
PascalCase - Parameters:
PascalCase
For each construct, derive names, types, and semantics from the confirmed requirements. Define an event for each command that describes what the command did, including the command arguments, so the implementation can emit it (CPP-37). Every event emission must be traceable to a single call site (CPP-36): give each site its own event, or an argument (typically an enum) whose value differs at every site. Ask the user if:
- The command kind (sync/async/guarded) is
常见问题
它会不提问就直接设计吗?
不会。该技能要求在设计前先询问不清楚的端口类型和接口细节。
FPP 文件会生成什么?
FPP 编译器会据此生成 C++ 基类、测试框架和字典。
它提到了哪些设计模式?
它提到了速率组、健康检查、管理者-工作者和中枢等模式。
详情
作者的原始描述
FPP design phase of F Prime component development. Guides the agent through creating the FPP model that codifies the component's interface — ports, commands, events, telemetry, and parameters. Trigger when the requirements are confirmed and the next step is to write the .fpp file. Keywords: F Prime, FPP, design, model, ports, commands, telemetry, events, parameters, component definition.
repo: nasa/fprime
热度
- GitHub 星标
- 12k
- 排名
- #11494
- 许可证
- Apache-2.0
- 更新时间
- 2026/11/2
评论
- …
同一仓库的更多技能
fprime-cmake-build-system
12k帮你的智能体通过 F Prime 项目的 CMake 层,为飞行软件项目添加模块、构建目标和平台设置。
fprime-component-development
12k帮你的智能体引导 F Prime 组件经历每个开发阶段,从需求一直到集成测试。
fprime-component-implementation
12k帮你的智能体按照项目规则,编写 F Prime 组件自动生成的处理函数背后的 C++ 代码。
fprime-component-integration-test
12k帮你的智能体为 F Prime 组件编写可复用的 pytest 集成测试,并在实时部署环境中运行。