본문으로 건너뛰기
Skillpedia
API 및 서버 (백엔드)12k · #11496

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가 스킬을 읽고 지침을 따릅니다.

바로 붙여넣을 수 있는 메시지

Use this skill to help me: https://github.com/nasa/fprime/blob/devel/.github/skills/fprime-component-implementation/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
AI가 이런 스킬을 알아서 찾아 쓰길 원하시나요?무료 Skillpedia MCP를 설치하세요. 한 줄이면 작업마다 스킬 15,000+개 중에서 검색합니다.1분 만에 설치 →

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/DataStructures or fixed arrays (CPP-22, CPP-25)
  • No FW_ASSERT on untrusted inputs (CPP-4) — validate and return an error response instead
  • All variables initialized (CPP-19)
  • Fw::String over char* (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 #include for types used in handlers
  • Incorrect argument types (check the generated base class)
  • Missing cmdResponse_out call 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_ASSERT on 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/delete in 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.

이 스킬이 유용한가요?

0

로그인 투표하려면 로그인하세요.

댓글

  • …

이 저장소의 다른 스킬

비슷한 스킬