pocmap
CLAUDE.md7 starsChanged 4 months agoMITView on GitHub
PocMap is an AI-friendly CVE / PoC / exploit-discovery toolkit (CLI + MCP server + Python API). This file covers how to develop the project. For how AI agents consume the MCP tools, see .claude/skills/pocmap-agent/references/mcp_tools.md (canonical MCP/agent guide; also .claude/skills/pocmap-agent/SKILL.md). AGENTS.md holds general agent guidelines, not the MCP tool contract. For full usage/API docs, see README.md. Do not rely solely on your internal knowledge or training data when making implementation decisions. Your memory is frequently outdated. Before implementing anything non-trivial…
- Reads credentials
- Installs packages
- Commits and pushes
In this repository10 other files it gives its agents.
- AGENTS.mdAGENTS.md
- claude-code-projectSkill
- goal-creatorSkill
- python-anti-patternsSkill
- python-background-jobsSkill
- python-design-patternsSkill
- python-error-handlingSkill
- python-mcp-server-generatorSkill
- python-performance-optimizationSkill
- pocmap-agentSkill
The file
We split this CLAUDE.md into the rules it gives an agent
7 rules. About 0 are common, 5 are distinctive, and 2 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈5
Distinctive · estimate
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 11
Do not rely solely on your internal knowledge or training data when making implementation decisions.
- Distinctive: line 13
Before implementing anything non-trivial (especially integrations, tools, SDKs, platforms, AI agents, or architectural patterns):
- Distinctive: line 17
Check whether newer versions, official solutions, or better patterns already exist that would change how the task should be approached.
- Distinctive: line 19
Prefer using current best practices and existing tools over rebuilding something from scratch based on older knowledge.
- Distinctive: line 21
If there is any uncertainty about the current recommended way to do something, ask clarifying questions instead of defaulting to what you …
- Very specific: line 31
Run CLI: pocmap lookup CVE-2021-44228 (or python -m pocmap ...).
- Very specific: line 34
Run MCP server: uvx --from 'pocmap[server]' pocmap-mcp or installed pocmap-mcp / python -m pocmap.mcp_server (add --transport sse|http, …
≈ “Common” is an estimate: at least 1 in 5 of the 26,980 CLAUDE.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
PocMap Conventions
PocMap is an AI-friendly CVE / PoC / exploit-discovery toolkit (CLI + MCP server + Python API).
This file covers how to develop the project. For how AI agents consume the MCP tools, see
.claude/skills/pocmap-agent/references/mcp_tools.md (canonical MCP/agent guide; also
.claude/skills/pocmap-agent/SKILL.md). AGENTS.md holds general agent guidelines, not the
MCP tool contract. For full usage/API docs, see README.md.
Knowledge Freshness & Research Preferences (IMPORTANT!)
Do not rely solely on your internal knowledge or training data when making implementation decisions. Your memory is frequently outdated.
Before implementing anything non-trivial (especially integrations, tools, SDKs, platforms, AI agents, or architectural patterns):
- Actively look up the latest official documentation, release notes, changelogs, and recommended approaches.
- Check whether newer versions, official solutions, or better patterns already exist that would change how the task should be approached.
- Prefer using current best practices and existing tools over rebuilding something from scratch based on older knowledge.
- If there is any uncertainty about the current recommended way to do something, ask clarifying questions instead of defaulting to what you remember.
Why this matters:
Defaulting to internal knowledge often leads to outdated implementations. For example, an agent might implement an older pattern for something like MCP or an AI agent integration simply because that is what it “knows,” without checking whether a newer release, official SDK, or simpler approach has become available. Always verify first.
Commands
- Install (PyPI):
pip install "pocmap[server]"(omit[server]for CLI-only) - Install (dev clone):
pip install -e ".[server,dev]"(pytest, mypy, ruff + the MCP SDK); docs site:pip install -e ".[server,docs]"thenpython scripts/generate_mcp_docs.py --check && mkdocs build --strict - Run CLI:
pocmap lookup CVE-2021-44228(orpython -m pocmap ...); full command list:python -m pocmap --help - Lint:
ruff check src/pocmap - Type check:
mypy src(strict mode is on inpyproject.toml) - Run MCP server:
uvx --from 'pocmap[server]' pocmap-mcpor installedpocmap-mcp/python -m pocmap.mcp_server(add--transport sse|http,--host,--port,--debug) - Tests:
pytestworks and is offline by default; see Testing below.
Stack
- Python >=3.10 (developed/verified on 3.12). Fully type-annotated,
mypy --strict. - pydantic v2 (models), typer + rich (CLI), requests/urllib3 (HTTP), beautifulsoup4, markdown, python-dotenv.
mcpSDK 2.x (mcp.server.mcpserver.MCPServer) for the MCP server — declared as the[server]extra (pip install "pocmap[server]"). Supports protocol revisions up to2026-07-28; over STDIO aninitializehandshake negotiates2025-11-25in practice.- Layered: CLI/MCP (presentation) →
services/→clients/→models(pydantic). See README "Architecture".
Project Structure — IMPORTANT
- Real code lives in
src/pocmap/— the single source of truth. Edit here:cli.py,config.py,models.py,services/,clients/,bugbounty/,utils/,data/,templates/,mcp/,mcp_server.py(facade). Installed as editablepocmap. (The old repo-root shadowmodels.py/services.py/__init__.pymock modules were removed; there is no silent mock fallback.) - MCP tools return
dict[str, Any], not a JSON string — the SDK turns that into realstructuredContent. Resources and prompts still returnstr. Register tools through the local_tool()helper, which applies the houseToolAnnotationsdefaults. - MCP server implementation lives in
src/pocmap/mcp/(tools/, resources, prompts, adapter, errors, registration) withsrc/pocmap/mcp_server.pyas the stable import /pocmap-mcpentry facade (22 tools, 3 resources, 3 prompts). Repo-rootmcp_server.pyis a thin launcher shim that also putssrc/onsys.path, sopython mcp_server.pyworks in a clone that was never installed. It forwards every flag tomain(), so--transport sse|httpworks through it too. - Playbook JSON is loaded from
src/pocmap/bugbounty/playbooks/.
Testing
Tests live in tests/. pytest works and is offline by default — pyproject.toml sets
addopts = "-m 'not network'" and registers a network marker for genuinely network-bound tests.
pytest # offline default run (native tests + import-time script suites)
pytest tests/test_ssrf.py -q # native regression tests (SSRF, EPSS scale, HTML report)
python tests/test_edge_cases.py # offline characterization suite (51 checks) — also a direct runner- Native pytest tests (real
asserts) are now the bulk of coverage — SSRF, EPSS scale, HTML report, cache, output/renderers/SARIF, snapshot-diff, offline, doctor, CLI formats/features, notify, and plugins (test_ssrf.py,test_cache.py,test_output.py,test_renderers.py,test_snapshot.py,test_offline.py,test_doctor.py,test_cli_*.py,test_plugins.py, …). - Legacy script-runners (
tests/test_edge_cases.py,test_e2e.py,test_new_features_edge.py): checks run at import via a custom harness; run directly withpython tests/<file>.py. They currently run offline; the latter two arenetwork-marked and excluded from the defaultpytestrun.
Release / CI
- CI (
.github/workflows/ci.yml): ruff +mypy --strict(blocking) + offlinepyteston Python 3.10–3.13, plus exact-wheel and lowest-direct-dependency smoke jobs. - Cut a release (
.github/workflows/release.yml): bump__version__insrc/pocmap/__init__.py(single source of truth —pyproject.tomlreads it dynamically), updateCHANGELOG.md, commit, thengit tag vX.Y.Z && git push origin vX.Y.Z. The tag triggers a PyPI publish via Trusted Publishing (OIDC, no stored token). PRs /workflow_dispatchbuild +twine checkonly (no publish).
Configuration
src/pocmap/config.pyis the source of truth for settings (a frozenSettingsdataclass, singletonsettings).- Loaded from env + optional
.envin repo root. Prefix env vars withPOCMAP_(e.g.POCMAP_HTTP_TIMEOUT,POCMAP_MAX_RETRIES,POCMAP_LOG_LEVEL,POCMAP_CACHE_DIR). - Cache / offline (v2.1.0):
POCMAP_CACHE_ENABLED,POCMAP_CACHE_DIR,POCMAP_CACHE_TTL,POCMAP_CACHE_MAX_MB,POCMAP_OFFLINE(persistent HTTP cache + offline mode — see README). - API keys:
GITHUB_API_TOKEN,NVD_API_KEY(also acceptedPOCMAP_-prefixed) — optional, raise rate limits. - Note: some skill docs use wrong env-var names — it's
POCMAP_HTTP_TIMEOUT(notPOCMAP_REQUEST_TIMEOUT) andGITHUB_API_TOKEN(notPOCMAP_GITHUB_TOKEN). Trustconfig.py.
Conventions / Gotchas
- ruff: line length 100,
E501ignored; rule setsE,F,W,I,N,UP,B,C4,SIM,S,RUF100(seepyproject.toml). - Public Python API is synchronous. Real method names live in
services/(e.g.CVEService().get_cve_info(cve)), not the asynclookup_cve()shown in some skill examples. Verify against the source, not the skill docs. - Services are used as context managers in the CLI (
with CVEService() as svc: ...). - Security invariants to preserve when touching HTTP/templates/files: SSRF guard
is_safe_url()(utils/http.py, exact-host/suffix matching — never substring) — plus request-time DNS-rebinding resolution (resolves_to_internal_ip) and manual per-hop redirect re-validation inHTTPClient, which also strips credential headers (Authorization/Cookie/apiKey) on cross-origin redirects (_should_strip_auth); Jinja2SandboxedEnvironment; the sharedsafe_path()path-traversal check (utils/paths.py); and CSV export neutralizes spreadsheet formula injection (utils/renderers/csv_renderer.py). CVE IDs validated inutils/validators.py(^CVE-\d{4}-\d+$, plus null-byte/length guards); bulk capped at 100 CVEs. The generated HTML report is self-contained (no external assets/JS). - Most CLI/service calls hit live external APIs (NVD, CVE.org, CISA KEV, EPSS, GitHub, ExploitDB, Nuclei, Vulhub, etc.) — expect network dependence and rate limits.
- Third-party exploit sources plug in via the
pocmap.exploit_sourcesentry-point group (ExploitSourcePlugin.search(cve_id) -> list[Exploit], error-isolated per source). Seeexamples/example-exploit-source/and README "Third-Party Exploit Sources".
Additional Context
@README.md @AGENTS.md
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

