Skip to content

Commit 2b97691

Browse files
authored
Merge pull request #4905 from modelcontextprotocol/v2/feat/4870-security-advisory
Agentic software factory Part 10: security-advisory skill; rewrite SECURITY.md
2 parents 574cba8 + ac4612f commit 2b97691

6 files changed

Lines changed: 539 additions & 15 deletions

File tree

‎.claude/skills/board-ops/SKILL.md‎

Lines changed: 62 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,9 @@ takes `--owner modelcontextprotocol`. The board is **private**: treat a dump of
3030
its items as private data (see the snapshot section below).
3131

3232
**Only issues go on the board, never PRs, never draft cards.** A PR is tracked
33-
through the card of the issue it closes.
33+
through the card of the issue it closes. The one exception is a security
34+
advisory's `[GHSA-…]` draft card; see
35+
[Advisory draft cards](#advisory-draft-cards).
3436

3537
## IDs
3638

@@ -243,6 +245,65 @@ gh api repos/modelcontextprotocol/servers/issues/<N> -X PATCH \
243245
(or "Mark as duplicate" in the web UI, which additionally records a
244246
duplicate-of link).
245247

248+
### Advisory draft cards
249+
250+
A private security advisory is tracked by a **draft card** titled with the bare
251+
id, `[GHSA-xxxx-yyyy-zzzz]`, because a real issue would disclose it before a fix
252+
exists. No summary goes in the title until the advisory is published. What goes on the card, and when it moves, is the
253+
`/security-advisory` flow; these are only the mechanics.
254+
255+
⚠️ **A draft card has no repository and no issue number**, so the issue-side
256+
lookup above cannot find one. Look it up by its **bracketed GHSA id** in the
257+
full listing, checked for truncation, then feed that item id to `item-edit` or
258+
`item-delete` exactly as usual:
259+
260+
```sh
261+
GHSA=GHSA-xxxx-yyyy-zzzz # the advisory's real id
262+
ITEM_ID= # never let an earlier lookup's id survive a failed one
263+
LOOKED= # set only by a lookup over a COMPLETE listing
264+
BOARD=$(gh project item-list 43 --owner modelcontextprotocol --format json --limit 2000)
265+
if jq -e '(.items | length) == .totalCount' <<<"$BOARD" >/dev/null; then
266+
ITEM_ID=$(jq -r --arg p "[$GHSA]" '.items[] | select(.content.type=="DraftIssue")
267+
| select(.content.title | startswith($p)) | .id' <<<"$BOARD") && LOOKED=1
268+
[ -n "$ITEM_ID" ] || echo "no draft card titled [$GHSA] on #43" >&2
269+
else
270+
echo "item-list incomplete or failed — raise --limit; not concluding anything" >&2
271+
fi
272+
```
273+
274+
**Create** one only when that lookup ran over a complete listing **and** found
275+
none (a second card for the same advisory is a duplicate). Run it in the same
276+
shell, straight after the lookup: it refuses on a missing `LOOKED` or a found
277+
`ITEM_ID`. It is the add-card recipe with `item-create` in place of `item-add`,
278+
Status `Incoming`, and the provisional Priority:
279+
280+
```sh
281+
STATUS_OPT=$(opt Status "Incoming")
282+
PRIORITY_OPT=$(opt Priority "<provisional level>")
283+
if [ "$LOOKED" != 1 ] || [ -n "$ITEM_ID" ]; then
284+
echo "lookup incomplete, or [$GHSA] already has a card ($ITEM_ID) — not creating" >&2
285+
elif [ -n "$STATUS_OPT" ] && [ -n "$PRIORITY_OPT" ]; then
286+
ITEM_ID=$(gh project item-create 43 --owner modelcontextprotocol \
287+
--title "[$GHSA]" --body "<link and triage lines only>" \
288+
--format json --jq '.id') || ITEM_ID=
289+
fi
290+
# Then the two chained item-edit calls from "Add a card and set its fields".
291+
```
292+
293+
**Convert** it to an issue only after the advisory is **published**. The web UI
294+
has "Convert to issue" on the card; the API equivalent is:
295+
296+
```sh
297+
REPO_ID=$(gh api repos/modelcontextprotocol/servers --jq .node_id) || REPO_ID=
298+
[ -n "$ITEM_ID" ] && [ -n "$REPO_ID" ] && gh api graphql \
299+
-f item="$ITEM_ID" -f repo="$REPO_ID" -f query='mutation($item:ID!,$repo:ID!){
300+
convertProjectV2DraftIssueItemToIssue(input:{itemId:$item,repositoryId:$repo}){
301+
item{id content{... on Issue{number url}}}}}'
302+
```
303+
304+
The card keeps its place and its field values; the new issue takes the card's
305+
title and body.
306+
246307
## ⚠️ The option-deletion hazard
247308

248309
This section and its two subsections are copied verbatim from the MCP

‎.claude/skills/issue-create/SKILL.md‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,8 @@ unlabeled issue appears in no `v2`-filtered query, and an unmilestoned one drops
3131
out of release planning silently.
3232

3333
**Never create a duplicate.** **Never create a draft card** (a board card with
34-
no issue number): every board item is a real GitHub issue.
34+
no issue number): every board item is a real GitHub issue. The one exception, a
35+
private security advisory's `[GHSA-…]` card, is the `security-advisory` skill's.
3536

3637
## 0. Check for an existing issue first
3738

0 commit comments

Comments
 (0)