Skip to content
Back to skills

Pr

ASecurity

Open or write a KoFEM pull request that is fast to review: a diagram or diff sketch of the key change, before/after proof that it fixes the problem, and the merge danger. Use when opening a PR, writing or rewriting a PR body, or asked to 'make a PR' for a Linear issue.

  • 17 stars
  • 0 votes
  • 0 copies
  • 2 views
  • Added November 17, 2026
developmentjavascriptrustgojavashellangularnodegitapi

Works with

  • cli
  • api

Security analysis

A100/100

Pro scans all 3 files and shows the line behind each finding

Scanned December 3, 2026

npx -y skills add mkofler96/KoFEM --skill pr --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Pr?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Pr
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/mkofler96-kofem/badge)](https://www.skillsdirectory.com/skills/mkofler96-kofem)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: pr
description: "Open or write a KoFEM pull request that is fast to review: a diagram or diff sketch of the key change, before/after proof that it fixes the problem, and the merge danger. Use when opening a PR, writing or rewriting a PR body, or asked to 'make a PR' for a Linear issue."
license: MIT
metadata:
  upstream: "https://github.com/mattpocock/skills/tree/main/skills/engineering/pr"
  credits:
    skill: show-me
    author: Dex Horthy
    organisation: Humanlayer
    url: "https://github.com/humanlayer/skills/blob/main/plugins/show-me/skills/show-me/SKILL.md"
---

# PR

A reviewer should understand the change from the Summary visual, trust it from
the Evidence, and judge the risk from Merge Danger, before opening the diff.

## Workflow

1. **Start** by moving the Linear issue to **In Progress**. Then branch from
   `develop`; the PR targets `develop` (see `AGENTS.md`).
2. **Capture the red run first.** Before changing code, run the test or repro
   that shows the problem on the base and save the trimmed output. If no test
   can show it, write one. A fix without a failing-then-passing run is a claim,
   not evidence.
3. Make the change, then run the repo checks for the areas you touched
   (`AGENTS.md` → Build and checks). Re-run the step-2 test and save the green
   output.
4. **Build the review HTML before the PR, not after review.** Every PR for a
   KOF issue gets one self-contained HTML page with its evidence, uploaded to
   the issue's Resources, where the maintainer reviews it in the Operations
   Desk. See [Review HTML](#review-html). If a user can see the change, it
   must hold before/after screenshots taken with Playwright (the `run` skill,
   or `web/tests/*.spec.ts` patterns) at desktop and phone width (about 1440
   and 390 px), the "before" from `develop`. Look at each screenshot; they
   have found layout bugs that the tests did not. Two cases change the PR's
   `## Interactive review` section, and both mark its checklist item N/A
   with the reason:
   - **No Linear issue:** there is nowhere to upload the page. Delete the
     section and give the evidence in the PR body alone.
   - **Upload failed or the Linear tools are missing:** replace the section's
     marker and filename line with `Not uploaded: <reason>`, and send the
     file to the user so they can attach it.
5. Write the body with the template below and open the PR against `develop`.
   Title: imperative, user-facing, no issue key. Do not touch `CHANGELOG.md`.
   Open it only once step 4 is done, including either case above.
6. **After every push**, update the `kofem-pr-head` marker to the new head
   SHA; the Desk refuses a review whose marker is stale. If the evidence
   changed, publish a new revision of the HTML first.

## Template

~~~markdown
## Summary

<one or two sentences: what changes for the user, and why>

<diagram, diff-sketch, or tree>

Fixes KOF-nn

## Evidence

**Before** (`develop` @ <short sha>): <failing test / wrong output>

```text
<command>
<trimmed output showing the failure>
```

**After** (this branch):

```text
<same command>
<trimmed output showing the pass>
```

<checks run: e.g. `just check && just test-web && just test-e2e` — pass>

## Interactive review

<!-- kofem-pr-head: FULL_HEAD_SHA -->

`kof-nn-review-<short sha>.html` in [KOF-nn](https://linear.app/kofem/issue/KOF-nn)'s Resources.

## Key Changes

- **engine:** …
- **web:** …

## Sources

- <what in the diff relies on it>: <author, title, year, equation or section> — <open link>

## Merge Danger

**Door:** <one-way or two-way>

<optional: description>

**Blast Radius:** <one word>

<optional: what could break: solver paths, per-body materials, saved .kofem files, WASM exports, layout>

## Checklist

- [ ] **No silent fallbacks** — no code path substitutes a plausible default when data is missing, invalid, or mismatched, instead of raising a clear error.
- [ ] Every input accepted by the UI or an API is actually consumed downstream
- [ ] All applicable solver paths covered (solid / shell / coupled), or N/A
- [ ] **Sources:** every paper, book, standard or other implementation the change relies on is listed above and cited where it is used, or N/A
- [ ] Review HTML for the current head is in the Linear issue's Resources and referenced above, or N/A with the reason
- [ ] **UI change:** the review HTML holds before/after screenshots at desktop and phone width, or N/A
~~~

Write `Fixes KOF-nn` for every issue whose scope the PR delivers, even when
follow-ups are split into new issues. Write `Refs KOF-nn` for an issue that
stays open because work in its own scope remains; nothing closes it.

Before writing `Fixes`, check the issue's attachments with `get_issue`. If
one is a GitHub issue (`github.com/mkofler96/KoFEM/issues/…`), write
`Refs KOF-nn`: Linear would close the GitHub issue on merge, and only the
maintainer closes GitHub issues. Never write `Fixes #nn` or `Closes #nn`.

Keep the Checklist from `.github/pull_request_template.md` in sync with this
template if either changes.

## Sections

Skip all preambles and keep prose brief. Use KoFEM's domain language from
`AGENTS.md`: tessellation is for display; surface and volume meshes are FEM
discretisations. Say "body", "face", "BC group", "load group", "solid",
"shell", "coupled".

### Summary

Pick the smallest view that makes the key point clear.

- Show logic or an algorithm as pseudocode:

```text
on(save)
  if content is unchanged
    return cached result
  write new content
  return fresh result
```

- Show runtime control flow as a call tree:

```text
solver.worker onmessage("solve")
  routeSolve
  handleSolidSolve
    weldTies
    solveSolidInRust
      rustSolidBoundaryConditions
        groupDirichlet
```

- Show UI structure as a component tree, including state and module boundaries that matter:

```text
<StatusBar> (web/src/components/statusbar/StatusBar.tsx)
  useModelStore(loads, surfaceLoads)
  <LoadStat>
```

- Show file responsibility or a broad refactor as a shallow file tree:

```text
web/src/components/viewport/
├── BoundaryConditionLayer.tsx   # composes the layers below
├── BcFaceHighlights.tsx         # selected / pending / BC / load faces
└── LoadArrows.tsx               # face and nodal load arrows
```

- Show component interaction, control flow, or data flow with Mermaid:

```mermaid
sequenceDiagram
    participant UI
    participant Worker as solver.worker
    participant Fem as Rust module
    UI->>Worker: solve(model)
    Worker->>Fem: ElasticModel.startSolve(fixedDofs, forces)
    Fem-->>Worker: displacement, stress
    Worker-->>UI: results
```

- Use `diff` when the point is what changes and the surrounding shape already exists. Match the diff shape to the topic. **This is the preferred view for most bug fixes**: show the few lines that carry the fix, not the whole patch.

For a code change, quote only the decisive lines:

```diff
 VDir& vd = vdir[vi];
+if (vd.set[c] && vd.value[c] != value)
+  throw std::runtime_error("vertex " + std::to_string(vi) + " has conflicting BCs");
 vd.set[c] = true;
 vd.value[c] = value;
```

For a component change:

```diff
 <SessionPage>
   useSessionEvents()
   <SessionToolbar>
+    <RunSkillButton />
   <SessionTimeline>
+    <SkillResultCard />
```

For a file-layout change:

```diff
 src/
 ├── commands/
+│   └── show-me.ts       # expands the slash command
 ├── sessions/
-└── transport.ts
+└── transport/
+    ├── client.ts
+    └── stream.ts
```

For a call-tree or call-stack change:

```diff
 submitForm
   createSession
     persistPrompt
+    expandSkillMention
     launchAgent
-  navigateToSession
+  navigateToSession
+    subscribeToEvents
```

For a state or control-flow change:

```diff
 on(save)
-  write content
+  if content is unchanged
+    return cached result
+  write new content
+  invalidate cache
```

- Show the whole block when most of it is new, when omitted context would hide ownership or order, or when the user needs a copyable target shape:

```ts
function loadsSummary(nodalLoadDofs: number, faceLoads: number): string {
  // ...
}
```

#### Guidance

Place each visual next to the short text it supports. Keep only the calls,
files, props, states, and boundaries needed to answer the reviewer's question.

You may use one of these, you may use several, it is unlikely you will use all
of them. Use your judgement and don't overwhelm the reviewer.

### Evidence

Concrete evidence that the change works. Always show a before and after, and
name the base commit the "before" ran on.

Screenshots are S-tier when the change is visual, and required for any UI
change. Put them in the review HTML; do not rely on images in the PR body.
The PR body carries the trimmed text proof too, for GitHub readers.

Execution-based evidence is A-tier: test results, console output, solver logs.
Show the exact test that failed on `develop` and passes on the branch. Trim
output to the lines that prove the point; never paste a whole log.

For pure refactors, the evidence is that behaviour is unchanged: the same
specs pass before and after, plus a size or structure comparison
(`wc -l`, file tree).

For dead-code removal, show the search that proves nothing calls it, and the
green build and tests after removal.

Never claim a check passed that you did not run. If a check could not run in
your environment (e.g. no WASM build), say so in Evidence.

### Review HTML

One page per revision, holding the evidence a reviewer needs and nothing the
Desk already shows. It is the only evidence record on the issue.

1. **Write it.** One UTF-8 `.html` file under 5 MB, saved in the scratchpad,
   never committed. Inline all CSS and JavaScript and embed images as `data:`
   URIs (use JPEG if PNG screenshots push it past 5 MB); the Desk's sandbox
   blocks every network request. Keep interactive state in memory. Start with
   the first substantive section: no page header, PR stats, footer or files
   table, since the Desk renders those from GitHub. It must read well at
   phone width.
2. **Fill it.** For each piece of evidence, say what the reader is looking at
   and what it proves, for example: "Auto-shell now detects the I-beam
   flanges as thin-walled (t/L = 0.04, below the 0.1 threshold). Left:
   previous solid mesh, 48k tets. Right: mixed CTRIA3+CTETRA, 3.1k elements,
   tip deflection within 2% of the solid reference." Include the red and
   green runs, the numbers that show the fix, and for a UI change the
   before/after screenshots side by side at both widths. A slider or toggle
   between before and after is welcome where it makes the difference easier
   to see. Leave out progress narration, routine green-run screenshots and CI
   failure screenshots (those stay as the run's GitHub Actions artifact).
3. **Name it** `kof-nn-review-<short sha>.html`, with the 7-character SHA of
   the commit the evidence ran on: lowercase letters, digits, `.`, `_` and
   `-` only. Every revision gets a new name.
4. **Upload it** to the KOF issue's Resources, preparing, uploading and
   finalizing in one go, because the signed URL expires after 60 seconds:
   - `prepare_attachment_upload` with the issue, the filename, `text/html`
     and the exact byte size (`wc -c < file`).
   - PUT the raw bytes to `uploadRequest.url`, sending every header in
     `uploadRequest.headers` verbatim:
     `curl --fail -X PUT --data-binary @file -H '<name>: <value>' … '<url>'`.
   - `create_attachment_from_upload` with the returned `assetUrl`, the issue,
     and the exact filename as the title.

   If this fails, follow the upload-failed case in workflow step 4.
5. **Remove the previous revision** from Resources with `delete_attachment`
   (the attachment ID from `get_issue`), so the issue holds one current
   review.
6. **Point the PR at it** with the `## Interactive review` section in the
   template: the full 40-character head SHA in the marker, then the exact
   filename and the issue link on one line. The Desk matches both exactly.
7. **Check the links.** Once the PR is open, `get_issue` must show the PR
   link and the HTML among the issue's attachments; the Desk only opens a
   review on an issue linked to the PR.

### Sources

List every paper, book, standard, website or other implementation that the
code, a test or a page in the diff relies on: an equation, an algorithm, a
reference value, a benchmark. Name it precisely enough to find the exact
place (equation, table, section or file at a commit), say which part of the
diff relies on it, and link an openly accessible copy (open access, author
copy, preprint, open repository). If the only copy is closed, say so instead
of a link; never link a copy that gets around a paywall or licence. The same
source must also be cited where the code uses it (`AGENTS.md` → Implementation).

Write `None` with the reason when nothing in the diff rests on an outside
source, for example UI wiring or a refactor that keeps the maths unchanged.
A source the PR only moves, unchanged, need not be listed.

```markdown
- `crates/kofem-fem/src/topology/filter.rs` density filter: Andreassen et al.,
  "Efficient topology optimization in MATLAB using 88 lines of code", 2011,
  their H and Hs — <open link to the authors' copy>
- `crates/kofem-fem/src/shell/element.rs` DKT bending: Batoz, Bathe & Ho,
  "A study of three-node triangular plate bending elements", 1980 — closed
  (publisher only)
```

### Merge Danger

Describe whether it's a one-way or two-way door. You can walk back through
two-way doors, but not one-way doors. A PR that is cheap to roll back is lower
risk. In KoFEM, one-way doors include: changing the saved `.kofem` file format,
removing a WASM export that published builds or examples rely on, and changing
default analysis settings that alter existing results.

The blast radius is the potential impact or scope of the changes introduced by
this PR. Consider all possibilities: which solver paths (solid, shell,
coupled), per-body materials, saved models, gallery examples, layout and mobile
width, and analytics.

Files in this skill

  • LICENSE1 KB
  • SKILL.md8.4 KB
  • SOURCE.md1 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in development →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.