fprime-component-design-fpp
Skill này làm gì
Skill hướng dẫn AI viết mô hình giao diện FPP, từ đó sinh ra mã cơ sở C++ cho một thành phần F Prime. Dành cho kỹ sư thiết kế thành phần phần mềm bay.
Khi nào nên dùng
- ✓Khi yêu cầu cho một thành phần F Prime đã được duyệt và cần viết phần giao diện.
- ✓Khi bạn cần chọn port, lệnh, sự kiện hoặc telemetry cho một thành phần.
- ✓Khi bạn muốn tái sử dụng một mẫu thiết kế chuẩn của F Prime trong thành phần.
Liên kết skill
https://github.com/nasa/fprime/blob/devel/.github/skills/fprime-component-design-fpp/SKILL.mdSao chép rồi dán vào AI của bạn (Claude, ChatGPT hoặc Cursor) và nhờ nó làm theo hướng dẫn.
Cách dùng
Cách dễ nhất: sao chép tin nhắn và dán vào AI của bạn. AI sẽ đọc skill và làm theo hướng dẫn.
Tin nhắn có sẵn để dán
Dành cho Claude Code, Codex hoặc Cursor: chạy lệnh trong thư mục dự án của bạn và skill sẽ được cài đặt.
Tải tệp SKILL.md về và thả vào thư mục skill của agent.
Ví dụ cách nhờ AI
“Yêu cầu đã được duyệt. Bạn có thể viết mô hình FPP cho thành phần F Prime này không?”
5 skill mới mỗi tuần. Đọc chỉ 1 phút.
Cách hoạt động
AI chuyển các yêu cầu đã duyệt thành file FPP, hỏi bạn về các lựa chọn port hoặc lệnh chưa rõ, rồi trình biên dịch sinh ra mã cơ sở.
Nội dung kỹ thuật (SKILL.md gốc)
Lấy nguyên văn từ GitHub, do tác giả viết bằng tiếng Anh.
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
Câu hỏi thường gặp
Nó có thiết kế mà không hỏi lại không?
Không. Skill yêu cầu hỏi về các kiểu port và chi tiết giao diện chưa rõ trước khi thiết kế.
File FPP sinh ra những gì?
Trình biên dịch FPP sinh ra lớp cơ sở C++, khung kiểm thử và từ điển từ file đó.
Skill nhắc đến những mẫu thiết kế nào?
Skill nêu tên các mẫu như rate group, kiểm tra sức khỏe, manager-worker và hub.
Chi tiết
Mô tả gốc của tác giả
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
Độ phổ biến
- Sao GitHub
- 12k
- Vị trí xếp hạng
- #11494
- Giấy phép
- Apache-2.0
- Cập nhật
- 2/11/2026
Bình luận
- …
Thêm skill từ kho mã này
fprime-cmake-build-system
12kGiúp agent của bạn thêm module, build target và cài đặt nền tảng vào dự án phần mềm bay F Prime thông qua lớp CMake của nó.
fprime-component-development
12kGiúp agent của bạn hướng dẫn một thành phần F Prime qua từng giai đoạn phát triển, từ yêu cầu đến kiểm thử tích hợp.
fprime-component-implementation
12kGiúp agent của bạn viết mã C++ phía sau các hàm xử lý được sinh tự động của một thành phần F Prime, theo đúng quy tắc của dự án.
fprime-component-integration-test
12kGiúp agent của bạn viết các bài kiểm thử tích hợp pytest dùng lại được cho thành phần F Prime, chạy trên một triển khai đang hoạt động.
Skill tương tự
api-connector-builder
280kGiúp agent của bạn xây dựng kết nối API mới theo đúng mẫu đã có, dùng khi bạn cần thêm một tích hợp mà không tạo cách làm mới.
api-design
280kGiúp agent của bạn thiết kế REST API theo các thực hành tốt nhất, hữu ích để định nghĩa cách API giao tiếp, hiển thị lỗi và tổ chức dữ liệu.
backend-patterns
280kGiúp agent của bạn với các mẫu kiến trúc phía máy chủ và tối ưu cơ sở dữ liệu, hữu ích khi xây dựng hoặc rà soát code chạy trên máy chủ.