From firefox-wiki
Extract and store knowledge from a Firefox bug investigation into the wiki. Run after landing a patch. Supports --auto flag for non-interactive hook-triggered operation.
How this skill is triggered — by the user, by Claude, or both
Slash command
/firefox-wiki:ingestThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
At the start of every ingest run, set:
At the start of every ingest run, set:
export WIKI_SKIP_HOOKS=1
This prevents the ingest skill's own wiki reads from being logged as investigation hits.
Apply these rules before writing anything to the wiki:
Never include:
Security bug rule — when the bug has a sec-* keyword or is still restricted:
bugs/<id>.md page for it<!-- source: sec bug, <YYYY-MM-DD> --> with no bug numberFor non-security bugs, the full bugs/<id>.md page and explicit bug number citations are appropriate.
When this skill is invoked, follow the protocol below exactly. First, detect the operating mode:
$ARGUMENTS contains --auto: run in auto mode (non-interactive, never prompts, make best-effort decisions at every step).In auto mode, verify this is a Firefox repository commit before doing anything else:
Run git remote get-url origin in the current working directory.
If the remote URL does not contain any of mozilla-central, firefox, or gecko, exit silently. This commit is not in the Firefox repository and no ingest is needed.
Determine the bug ID:
Bug XXXXXXX pattern. If no bug ID is found, exit silently.Gather source material:
~/firefox-bug-investigation/bug-{id}-investigation.md exists, read it.git log -1 --stat and git show HEAD to understand what changed and use that as the source.From the source material, extract the following:
MediaFormatReader, AudioSink)In interactive mode, print the full extraction summary and give the user a chance to review it before continuing. In auto mode, proceed directly to Step 2.
Determine WIKI_PATH: use the $WIKI_PATH environment variable if set, otherwise default to ~/firefox-wiki/. Verify that INDEX.md exists inside it.
For each component identified in Step 1:
components/<Name>.md if it exists.For each cross-component interaction:
relations/MFR-MDSM.md).In interactive mode, show a diff summary ("Will create X, update Y, skip Z — proceed?") and wait for explicit confirmation before writing anything.
In auto mode, proceed without confirmation.
For each item marked as "create" or "update", write or modify the file as described below.
Component page (components/<Name>.md):
[High] (it comes from a verified investigation).<!-- source: bug {id}, {date} -->Relation page (relations/<A>-<B>.md):
[[wiki-links]] for all component references throughout.Bug learning page (bugs/{id}-{slug}.md):
[[links]]), Patches (hash + one-line description).Pattern page (patterns/<name>.md):
Wiki-link rules that apply to all content:
[[PageName]].Append the following block to log.md:
## {date} — Bug {id}: {title}
**Context**: Landed patches {hashes}.
**Pages created**: [[page1]], [[page2]]
**Pages updated**: [[page3]], [[page4]]
**Key insight**: {1-2 sentence summary of the most important thing learned}
---
Append a single JSON object (one line) to usage-log.jsonl:
{"date": "<ISO timestamp>", "event_type": "ingest", "user": "<git -C $WIKI_PATH config user.email>", "trigger": "<hook|user>", "bug_id": <number>, "pages_created": ["bugs/...", "patterns/..."], "pages_updated": ["components/...", "relations/..."], "hypothesis_from_wiki": <true|false>, "hypothesis_term": "<term if applicable>", "hypothesis_correct": null}
To populate hypothesis_from_wiki and hypothesis_term, prefer instance-based correlation over time-window matching — the 8-hour fallback below loses precision when ingests are batched or backfilled.
Primary path (precise, when the hooks recorded an instance):
usage-log.jsonl. Find every session_start event with skill == "bug-start" AND args == "<bug_id>" (or args containing the bug_id as a substring — bug-start sometimes accepts extra arguments).instance_id of each match into a set. Call it BUG_INSTANCES.wiki_read and pre_lookup events whose instance_id is in BUG_INSTANCES.pre_lookup in that set has wiki_hit: true → set hypothesis_from_wiki: true and hypothesis_term to its term.wiki_read in that set exists (the engineer opened a wiki page) → set hypothesis_from_wiki: true and hypothesis_term to the file field of the most recent such read (basename minus .md).hypothesis_from_wiki: false and hypothesis_term: "".This is reliable because every wiki event during a /bug-start session is tagged with that session's instance_id by the wiki-plugin hooks — no timestamp guessing.
Fallback (8-hour window, only when no session_start event matches this bug):
If BUG_INSTANCES is empty (this can happen for ingests triggered via hook on commits without a preceding /bug-start), fall back to the legacy scan: any pre_lookup with wiki_hit: true in the last 8 hours sets hypothesis_from_wiki: true. Otherwise false.
hypothesis_correct is always written as null at ingest time — it will be backfilled automatically by the verify skill when it later verifies the pages listed in pages_created and pages_updated.
Open INDEX.md. For each new page created in Step 3:
| [[Name]] | <one-line role> | [[Relation1]], [[Relation2]] || [[Name]] | <what it captures> |Update the "Last updated" date at the top of INDEX.md to today's date.
If $WIKI_PATH/index.json exists, keep it fresh by upserting a record for each
new page (the full rebuild happens at the next /firefox-wiki:lint --full; this
just avoids staleness in between). For each new page:
TMP=$(mktemp)
jq --arg name "$NAME" --arg path "$REL" --arg dir "$DIR" \
--arg summary "$ONELINE" --arg conf "$CONF" \
'.pages |= ((map(select(.name != $name))) +
[{name:$name, path:$path, dir:$dir, summary:$summary, aliases:[],
confidence:(if $conf=="" then null else $conf end)}])
| .source_index_mtime = (env.IDX_MTIME | tonumber)' \
"$WIKI_PATH/index.json" > "$TMP" && mv "$TMP" "$WIKI_PATH/index.json"
where IDX_MTIME is the new mtime of INDEX.md (stat -f %m / stat -c %Y),
so the freshness guard in lookup stays valid. Skip silently if index.json
is absent.
For every file created or modified during this ingest:
[[...]] patterns.WIKI_PATH.In interactive mode: report broken links to the user and offer to fix them before finishing.
In auto mode: append a warning entry to log.md listing each broken link, then continue without blocking.
Run:
cd $WIKI_PATH && git add -A && git commit -m "wiki: ingest bug {id} — {one-line summary}" && git push
In auto mode: run silently, do not print git output unless it fails.
After pushing, check lint-log.json for pages overdue for correctness verification.
Verify intervals by directory:
components/: 30 daysrelations/: 90 daysarchitecture/: 90 dayspatterns/: 180 daysspecs/: 365 daysbugs/: neverTODAY=$(date +%Y-%m-%d)
cat $WIKI_PATH/lint-log.json 2>/dev/null | jq -r '
to_entries[] |
select(.value["verify-last"] == null or
(now - (.value["verify-last"] | strptime("%Y-%m-%d") | mktime)) > (
if (.key | startswith("components/")) then 30
elif (.key | startswith("relations/")) then 90
elif (.key | startswith("architecture/")) then 90
elif (.key | startswith("patterns/")) then 180
elif (.key | startswith("specs/")) then 365
else 99999 end * 86400
)
) | .key'
If any pages are returned, print (in both auto and interactive mode):
Note: <n> page(s) are overdue for correctness verification:
components/: <n> (interval: 30 days)
relations/: <n> (interval: 90 days)
...
Run /firefox-wiki:verify to check them.
If nothing is overdue: print nothing.
After all steps are complete, print:
Ingest complete — Bug {id}
Created: {list}
Updated: {list}
Skipped (already known): {list}
Broken links: {list or "none"}
Key insight logged: {one sentence}
Pushed to remote.
Fetches up-to-date documentation from Context7 for libraries and frameworks like React, Next.js, Prisma. Use for setup questions, API references, and code examples.
Applies a firm's KYC/AML rules grid to parsed onboarding records: assigns risk rating, checks required documents, outputs rule outcomes with citations, and routes for escalation.
Generates daily or weekly digests of activity from connected sources (chat, email, docs, tasks, CRM), highlighting action items, decisions, mentions, and project updates.
npx claudepluginhub alastor0325/firefox-wiki-plugin --plugin firefox-wiki