- Check the destination pages'
sources:frontmatter -- if the ingest slug is already listed there, that source is done; skip it. (Thesources:list is the dedup mechanism; there is no separateingested.mdtracker.) - Look up slug in
raw/manifest.mdfor exact file path. Read all markdown files in the module. Skip image references. - Write
wiki/courses/<slug>.md. For each technique/tool page: read frontmatter only -- skip if slug already insources:, otherwise read and update. Add slug tosources:list. - Update
wiki/overview.mdand regeneratewiki/index.md(scripts/gen_index.py). Append a one-line entry tosession/log.md.
When the user asks you to ingest a THM section or room:
- Check the destination pages'
sources:frontmatter -- if the slug is already listed, that source is done; skip it. - Look up the slug in
raw/manifest.mdto get file paths and dedup notes. Check for any [warn] skip warnings before reading files. - Read the markdown files. Strip all
![[...]]andimage references. - For each technique/tool page to update: read frontmatter only. Skip if slug already in
sources:. - Update or create technique pages directly -- no course page per room. Add slug to
sources:. - Update or create tool pages if new tools appear. Add slug to
sources:. - Update
wiki/overview.mdandwiki/index.md. - Record the slug in each updated page's
sources:list (the dedup marker). - Append a single log entry to
session/log.mdcovering all rooms in the slug -- don't log each room individually.
When the user drops a CVE writeup, blog post, or advisory into raw/research/, or provides a URL to ingest:
- Fetch the source. If it's a URL (not a local
.mdfile), preferdefuddle parse <url> --mdfor clean markdown output (install:npm install -g defuddle). Fall back to WebFetch if defuddle is unavailable. - Update the relevant technique page(s) -- add the new payload, bypass, or finding.
- Update or create a tool page if a new tool is introduced.
- Create a course page only if the source is course material -- otherwise just update technique/tool pages.
- Regenerate
wiki/index.md(scripts/gen_index.py) and append a one-line entry tosession/log.md.
At close-out of a completed box/bugbounty/pentest/CTF, harvest the GENERIC knowledge the
engagement produced that the wiki does not already have. This is the mirror image of
research ingest (external source -> wiki): the source here is the finished engagement.
Use Skill(learn) at close-out, once the engagement is SOLVED and its walkthrough is
assembled.
- Inventory what the engagement taught from
state/loot/Approach/Deadends/ Vuln-index/walkthrough/hot; pentest/bugbounty addKillchain/log, while ctf keeps its chain instate.md's## Chainsection instead. - Generalize each lesson (product + technique/cred/endpoint + impact); strip every client host/IP/domain/cred value.
- Dedup vs wiki with
qmd_query/qmd_search-- keep only what the home page does not already cover. - Stage each survivor (
scripts/wiki-stage.py --kind default-cred|api-pattern| technique); a genuinely new class gets a content-free scaffold page first so its substance still arrives through the gate. - Promote through the leak gate (
scripts/wiki-promote.py --promote all, runscheck-leaks.sh, fails closed, re-indexes), thenlint-wiki.py -qand, for a new page,gen_index.py+build_moc.py+qmd update. - Self-clear + log:
touch targets/<eng>/.learn-done; one generic line tosession/log.md. Never write client specifics intosession/*orwiki/.
When the user provides a GitHub URL to clone and analyse:
- Clone the repo. Use WSL (
wsl -d kali-linux -u kali -- git clone <url> /home/kali/<reponame>). Do not clone directly to the Windowsraw/git/path --git clonefails on Windows filesystem mounts due to achmoderror on.git/config.lock. After cloning, record the WSL path inraw/manifest.md(e.g./home/kali/<reponame>). - Read all relevant source files (code, README, headers).
- Register the slug
git-<reponame>inraw/manifest.mdunder## Git Research Repositories-- include path, file count, and key topics. - Create or update the relevant technique page(s) with mechanisms, code examples, detection notes, and real-world context drawn from the code.
- Update or create a tool page if the repo is a standalone tool.
- Regenerate
wiki/index.md(scripts/gen_index.py), updatewiki/overview.md, append tosession/log.md, and updateCLAUDE.mdif the vault structure changed. - No
wiki/courses/page is needed for git repos -- synthesise directly into technique/tool pages.
When the user starts working on a target, follow the state-first discipline (full schema in targets/TARGETS.md; the engagement file set is self-healed by the engagement-init hook).
-
Load engagement context -- read the active engagement's state files at session start, so no documented work is repeated:
scope.md-- in/out-of-scope + RoE flags; read before ANY actionstate.md-- hosts/services/access (and owned status)loot.md-- captured credentials + reuse mapKillchain.md-- the evolving attack chain: open/blocked attack-path rows + the Confirmed-chain headerDeadends.md-- exhausted vectors (do not re-test without new input)Approach.md-- the plan board: phase checklist + per-asset vuln classes already tested (the### 4atable)Vuln-index.md-- confirmed findings and chains;hot.md-- rolling session cache
-
Search wiki before each attack phase:
- Run
qmd query "<service or technique>"before attacking any service - Read the matching technique page for methodology, payloads, and bypass variants
- Read the relevant tool page before running a tool (e.g.
wiki/tools/sqlmap.md)
- Run
-
Capture as you go (prose in chat is lost; the tables persist across sessions and devices):
state.md/loot.md-- new hosts/services/access + credentials (drop raw tool output iningest/and run the ingest skill, or edit the tables directly)Killchain.md-- update when an attack path opens or blocksVulns/+Vuln-index.md-- write each finding asFIND-NNN-SEVERITY-title.md; runscripts/find-lint.pybefore /evidence- record a tested vuln class in the Approach.md 4a table (add a row with status
[x]) sonext_move/coveragestop re-surfacing it Deadends.md-- log a bounded-out vector immediately, one line, then switch vector
-
After the session: run
gsd:pause-work-- append a named entry to the engagementlog.md(audit) and refreshhot.md(rolling cache). Generic/framework learnings (no client specifics) go tosession/log.md+session/hot.md. -
Feed reusable knowledge back to wiki -- after a novel bypass, payload, or CVE chain, update the relevant
wiki/techniques/page in generic form (no client specifics). Do not create per-finding wiki pages.
When the user asks a question:
- Search first using the
wiki-searchMCP tool (qmd_queryfor semantic search,qmd_searchfor keyword). This replaces readingwiki/index.mdmanually. - Read the pages returned by the search in full.
- Synthesise an answer with inline
[[wiki links]]as citations. - Offer to file the answer as a wiki page if it's a non-trivial synthesis -- e.g. a comparison of techniques, a methodology walkthrough, or a cheatsheet.
If the wiki-search MCP is unavailable, fall back to reading wiki/index.md to identify relevant pages.
After writing new or updated wiki pages, run qmd update via the Bash tool to keep the search index current. Do this once at the end of an ingest session, not after every file.
session/hot.md is a rolling session summary read at startup. At the end of every ingest, query, or target session, append a brief update:
## [YYYY-MM-DD] <ingest|query|target>
- <what was ingested or answered>
- <pages created or updated>
- <gaps identified or next steps>
Keep only the three most recent entries -- delete older ones when adding a new one.
Health check is script-driven. The SessionStart hook surfaces a one-line summary automatically; run the full check on demand (or every ~15 ingests):
python3 scripts/lint-wiki.py(-vfor every offender) - broken wikilinks (code blocks ignored), deadscripts/*references in docs/CLAUDE.md/skills, frontmatter gaps, staleindex.md, and the leanest technique areas. Exits 1 on hard problems.python3 scripts/gen_index.py- regeneratewiki/index.mdwhenever lint reports it stale (or after adding/renaming any page). It is auto-generated; never hand-edit it.python3 scripts/build_moc.py- regenerate graph hubs after adding pages so every page stays reachable (replaces the manual orphan scan).python3 scripts/wiki-gaps.py -v- technique pages referenced by hunt skills / FIND files but missing.- Pick the next build-out target from the leanest-areas note in step 1; append a one-line lint entry to
session/log.md. - Re-index search after page changes with
qmd update(see### Re-index search).
After touching many wiki pages, run qmd update on the host where the wiki-search collection is registered (often WSL Kali for this vault).