Agent Skillsnasa/fprime › fprime-component-implementation

fprime-component-implementation

GitHub

指导Agent基于已确认的FPP模型,遵循C++设计规范(如禁用动态内存、固定大小类型),实现F Prime组件的处理器函数。流程包括生成存根、编写逻辑及编译修复,适用于飞行软件组件开发。

.github/skills/fprime-component-implementation/SKILL.md nasa/fprime

Trigger Scenarios

需要为F Prime组件编写C++实现代码 FPP模型已确认,需进行代码实现阶段 调用fprime-util impl生成并填充handler

Install

npx skills add nasa/fprime --skill fprime-component-implementation -g -y
More Options

Non-standard path

npx skills add https://github.com/nasa/fprime/tree/devel/.github/skills/fprime-component-implementation -g -y

Use without installing

npx skills use nasa/fprime@fprime-component-implementation

指定 Agent (Claude Code)

npx skills add nasa/fprime --skill fprime-component-implementation -a claude-code -g -y

安装 repo 全部 skill

npx skills add nasa/fprime --all -g -y

预览 repo 内 skill

npx skills add nasa/fprime --list

SKILL.md

Frontmatter
{
    "name": "fprime-component-implementation",
    "description": "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-34). 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."
}

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-34) 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
  • 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-34).


Anti-Patterns

  • Using FW_ASSERT on command arguments or hardware inputs
  • Forgetting cmdResponse_out (command will hang in dispatcher)
  • 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

Version History

  • 7d8f579 Current 2026-08-20 11:33

Same Skill Collection

.github/skills/agent-skill-authoring/SKILL.md
.github/skills/ci-test-runtime-policy/SKILL.md
.github/skills/fprime-cmake-build-system/SKILL.md
.github/skills/fprime-component-design-fpp/SKILL.md
.github/skills/fprime-component-development/SKILL.md
.github/skills/fprime-component-integration-test/SKILL.md
.github/skills/fprime-component-requirements/SKILL.md
.github/skills/fprime-component-unit-test/SKILL.md
.github/skills/fprime-ground-input-tracing/SKILL.md
.github/skills/fprime-hardware-input-tracing/SKILL.md
.github/skills/fprime-topology-development/SKILL.md
.github/skills/fprime-unit-testing/SKILL.md
.github/skills/jpl-design-principles/SKILL.md
.github/skills/maintainer-lookup/SKILL.md
.github/skills/post-inline-review/SKILL.md
.github/skills/pr-diff-scoping/SKILL.md
.github/skills/prompt-injection-precheck/SKILL.md
.github/skills/re-review-state/SKILL.md
.github/skills/triage-classifier/SKILL.md
.github/skills/write-system-functional-doc/SKILL.md
.github/skills/fprime-cpp-design/SKILL.md

Metadata

Files
0
Version
efce12d
Hash
e0c6d577
Indexed
2026-08-20 11:33

inicio - Wiki
Copyright © 2011-2026 iteam. Current version is 2.155.2. UTC+08:00, 2026-09-17 05:31
浙ICP备14020137号-1