Skip to content

perf(security): bring the remaining security skills under the always-on budget - #1447

Merged
potiuk merged 1 commit into
perf/security-batch-fetchesfrom
perf/security-frontmatter
Sep 28, 2026
Merged

potiuk merged 1 commit into
perf/security-batch-fetchesfrom
perf/security-frontmatter

Conversation

@potiuk

@potiuk potiuk commented Sep 28, 2026

Copy link
Copy Markdown
Member

Stacked on the P6 batching PR. Part of the security family optimization (#1344).

Summary

description + when_to_use load in every session, for every installed skill, whether it runs or not. The budget is 200 tokens per skill. Eight security skills were over it. Each now states its purpose, its main trigger phrases and where to route instead, and leaves the procedure and rationale to the body.

skill always-on tokens (chars ÷ 4)
issue-import-via-forwarder ~291 → ~128
issue-import ~280 → ~109
issue-triage ~278 → ~112
issue-invalidate ~251 → ~101
issue-import-from-pr ~239 → ~104
issue-import-from-scan ~237 → ~100
issue-fix ~214 → ~104
cve-allocate ~203 → ~100

With #1438's three security-model-* skills, every security skill is now within the always-on budget. The family's total drops from ~1.6k to ~1.1k tokens, and docs/setup/marketplace.md is updated to match.

security-issue-fix's description and golden rules no longer say public PR content must not link back to the tracker. AGENTS.md makes tracker identifiers public-safe as long as no security framing surrounds them, and the skill's own 5c rule already said so.

Test plan

  • prek run --all-files, including check-doc-sync
  • skill-and-tool-validate
  • Eval inputs: frontmatter is not extracted, and the two issue-fix golden-rule lines sit outside every eval step section. All 71 security eval step inputs are byte-identical to the base.

Part of #1344.

Generated-by: Claude Code (Opus 5.5)

🤖 Generated with Claude Code

…on budget

Eight security skills spent 203-291 tokens on `description` +
`when_to_use`, which load in every session whether the skill runs or
not. Each now states its purpose, its main trigger phrases and where to
route instead, in about 100-130 tokens, leaving the procedure and the
rationale to the body.

security-issue-fix no longer says public PR content must not link back
to the tracker, in its description or its golden rules: tracker
identifiers are public-safe per AGENTS.md, as long as no security
framing surrounds them, and the skill's own 5c rule already says so.

The family's always-on total drops from ~1.6k to ~1.1k tokens
(docs/setup/marketplace.md updated).

Generated-by: Claude Code (Opus 5.5)
@potiuk potiuk added the family:security security-* skills label Sep 28, 2026
@potiuk
potiuk merged commit 2e29d5b into perf/security-batch-fetches Sep 28, 2026
7 checks passed
@potiuk
potiuk deleted the perf/security-frontmatter branch September 28, 2026 08:56
potiuk added a commit that referenced this pull request Sep 28, 2026
…on budget (#1447)

Eight security skills spent 203-291 tokens on `description` +
`when_to_use`, which load in every session whether the skill runs or
not. Each now states its purpose, its main trigger phrases and where to
route instead, in about 100-130 tokens, leaving the procedure and the
rationale to the body.

security-issue-fix no longer says public PR content must not link back
to the tracker, in its description or its golden rules: tracker
identifiers are public-safe per AGENTS.md, as long as no security
framing surrounds them, and the skill's own 5c rule already says so.

The family's always-on total drops from ~1.6k to ~1.1k tokens
(docs/setup/marketplace.md updated).

Generated-by: Claude Code (Opus 5.5)
potiuk added a commit that referenced this pull request Sep 28, 2026
* perf(security): fetch once per run instead of once per item

The security skills re-ran the same reads per candidate, per tracker or
per finding. They now fetch each shared set once and reuse it, without
changing which items are processed or how each one is decided. Every
batched list call keeps an explicit --limit and says what to do when
the cap is hit.

- security-issue-import: each mail thread is read in full once
  (Step 2a) and reused by Steps 3-4. Step 7 keeps one fresh read,
  because a draft or reporter reply can land between scan and apply
  (4 reads per candidate -> 2). The semantic-sweep list, the
  collaborator list and the rejections-ledger number are fetched once
  per run. Thread-id dedup searches run 6 ids per query.
- security-issue-import-from-md sets labels at creation (one call per
  finding instead of two). security-issue-import-from-pr's two
  duplicate searches are one. security-issue-import-from-scan fetches
  the open-tracker list once for all findings.
- security-issue-triage gathers body, comments and linked PRs for up to
  20 trackers per GraphQL query instead of one `gh issue view` each.
- security-issue-invalidate `invalidate proposed`: one GraphQL query per
  20 matches replaces a reactions call plus an issue view per tracker.
  The list limit is aligned with triage (1000, stop when capped).
- security-issue-sync reads each surface once per run: linked PRs in one
  query, PR authors from that result, and the hand-off comment and
  milestone bullet from the first issue read (3 calls -> 1 and
  4 calls -> 0).
- security-issue-fix: one collaborator list per run.
  security-issue-deduplicate: no redundant existence probes.
  security-cve-allocate: no title re-fetch.
  security-model-verify: one query for every repository's AGENTS.md and
  SECURITY.md.
  workflow-security-audit: zizmor runs over up to 50 repositories per
  invocation, and a failed batch is re-run per repository so a failure
  is never reported as clean.
- security-tracker-stats-dashboard takes issue bodies and linked PRs
  from the one list call instead of one `gh issue view` per issue, and
  warns when the list hits its cap.

Along the way, several `gh` calls wrapped in `$(…)` or piped were made
plain commands, which the secure setup needs. import Step 2c also asked
`gh search prs` for a `mergedAt` field that does not exist, and used
GNU-only `date -d`.

Generated-by: Claude Code (Opus 5.5)

* perf(security): bring the remaining security skills under the always-on budget (#1447)

Eight security skills spent 203-291 tokens on `description` +
`when_to_use`, which load in every session whether the skill runs or
not. Each now states its purpose, its main trigger phrases and where to
route instead, in about 100-130 tokens, leaving the procedure and the
rationale to the body.

security-issue-fix no longer says public PR content must not link back
to the tracker, in its description or its golden rules: tracker
identifiers are public-safe per AGENTS.md, as long as no security
framing surrounds them, and the skill's own 5c rule already says so.

The family's always-on total drops from ~1.6k to ~1.1k tokens
(docs/setup/marketplace.md updated).

Generated-by: Claude Code (Opus 5.5)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

family:security security-* skills

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant