跳到正文
Skillpedia
通用编程12k · #11501

fprime-maintenance

它能做什么

它教 AI 只做缺陷修复或更新所需的最小改动,并在任何较大的重新设计之前先询问。适用于维护现有 F Prime 飞行软件的工程师。

适用场景

  • ✓当你需要以最小的安全改动修复现有 F Prime 代码中的缺陷时。
  • ✓当你更新 F Prime 组件中的 API 或依赖时。
  • ✓当代码审查要求对现有代码做一个小的后续修改时。

技能链接

https://github.com/nasa/fprime/blob/devel/.github/skills/fprime-maintenance/SKILL.md

复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。

使用方法

最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。

可直接粘贴的消息

请用这个技能帮我:https://github.com/nasa/fprime/blob/devel/.github/skills/fprime-maintenance/SKILL.md 阅读该链接中的 SKILL.md 文件,并在我的任务中按照它的说明来做。
想让你的 AI 自己找到这样的技能吗?安装免费的 Skillpedia MCP:只需一行,每次任务前它都会在 15,000+ 个技能中搜索。1 分钟完成安装 →

可以这样问 AI

“请用尽可能小的改动,修复这个 F Prime 组件中的缺陷。”

每周 5 个新技能,1 分钟读完。

工作原理

AI 会说明任务及其验收测试,找出需要修改的最少文件,只做必要的编辑,并在任何较大的重做之前先询问工程师。

技术内容(原始 SKILL.md)

作者在 GitHub 上的英文原文。

Skill: F Prime maintenance — the doctrine of minimal effect

When maintaining existing code the goal is the minimal change necessary to complete the task. Focus explicitly on the task at hand and on low-hanging-fruit technical-debt cleanup. Do not rework the design, the architecture, or anything else. If a larger rework appears necessary (for example, to avoid adding technical debt), propose it and obtain an engineer's approval before doing it.

Creating new components, topologies, or build modules is not maintenance; follow .github/agents/fprime-development.agent.md for that work. This skill applies alongside the phase skills whenever the task touches code that already exists.


1. Scope the task before touching code

  • State the task in one sentence: the defect, behavior change, or update, and its acceptance criterion (the test that fails today, the warning that must go away, the API that must be adopted).
  • Identify the smallest set of files and symbols that must change to meet it. That set is the scope; everything else is out of scope unless §3 or §4 admits it.
  • Read the surrounding code and the component docs/sdd.md first. The change must fit the existing design, not the design you would have chosen.

2. Make the minimal change

  • Change only what the task requires. Preserve existing interfaces (ports, commands, events, telemetry, parameters, public signatures), file layout, naming, and all behavior outside the task.
  • Follow the surrounding conventions even where they differ from newer code elsewhere. fprime-cpp-design still governs every line you write.
  • Do not rename, reorder, move, or reformat code the task does not touch. Run clang-format on changed files only.
  • Do not modernize, generalize, or add abstraction, configuration, or features "while you are here".
  • Update only the artifacts the change invalidates: unit tests for the changed behavior, the component docs/sdd.md, and the docs/ pages that describe it.
  • Fit the tests to the change: a regression test for the defect and one test per behavior the task added or changed. Do not add tests for behavior the task did not touch; record coverage gaps as future work (§5). Once the new tests pass, run the consolidation step in fprime-unit-testing §1 so shared sequences become helpers or rules.
  • Keep comments short and about the code as it now is. Do not add comments that narrate the change, describe the old behavior, or justify the new code against it; that context belongs in the PR description.
  • Keep the diff reviewable: every hunk must map to the task statement or to a cleanup item declared under §3.

3. Low-hanging fruit — permitted cleanup

Technical-debt cleanup is permitted only when it is adjacent to the task (a function or file you are already editing), mechanical and behavior-preserving, and small enough to verify by inspection. Examples:

  • a typo, stale comment, or outdated doc line the change made you read
  • a magic literal on a touched line replaced with the existing named constant
  • dead code or an unused include the change makes obviously dead
  • a missing override, const, nullptr, or fixed-width type on a touched declaration
  • an unchecked return code on a call you are already modifying

Anything larger is not low-hanging fruit, however beneficial. List each cleanup item in the PR description so reviewers can separate it from the task itself.

4. Rework requires engineer approval

Sometimes the minimal change would add technical debt, or the task cannot be completed within the existing design. Do not decide this alone:

  1. Stop before starting the rework. Leave the minimal change, if one exists, in a clearly described state.
  2. Write a short proposal: why the minimal approach is inadequate, the rework and its extent (files, interfaces, behavior affected), alternatives considered, and the risk.
  3. Present it to the responsible engineer — the requesting user, the component maintainer (maintainer-lookup), or an issue for CCB review per GOVERNANCE.md — and wait for explicit approval. Silence is not approval.
  4. Once approved, deliver the rework separately from the fix (its own PR, or clearly separated commits) so each can be reviewed and reverted independently.

Rework includes changing an FPP interface, restructuring a component or its state, changing a framework type or OSAL contract, movin

常见问题

AI 能在修复缺陷时重新设计代码吗?

不能。该技能要求避免重做设计,并把较大的改动先提交审批。

它涵盖构建新组件吗?

不涵盖。新组件、拓扑和构建模块由开发类技能负责。

它能顺便清理它修改的代码吗?

只允许清理与本任务相关的、显而易见的技术债。

详情

作者的原始描述

Use when modifying pre-existing F Prime code — bug fixes, small behavior changes, API or dependency updates, review follow-ups, or cleanup — as opposed to creating new components, topologies, or build modules. Applies the doctrine of minimal effect: make the smallest change that completes the task, take only low-hanging technical-debt cleanup along the way, and obtain engineer approval before any rework of design or architecture. Keywords: F Prime, maintenance, bug fix, minimal change, scope, technical debt, refactor, rework.

repo: nasa/fprime

热度

GitHub 星标
12k
排名
#11501
许可证
Apache-2.0
更新时间
2026/11/2

这个技能有用吗?

0

登录 后即可投票。

评论

  • …

同一仓库的更多技能

相似技能