extract-protocols-and-state

extract-protocols-and-state is a skill for Claude Code, Codex from HuginnIndustries/CodeCartographer. It costs 62 tokens per session (759 once invoked), scanned A, original, MIT.

A method for documenting how parts of a software system exchange messages, store data, and move between states. A protocol is the agreed format and behavior used at a boundary, such as a JSON or remote-procedure-call interface.

In plain words
What is it for?
Use it to document event streams, session files, JSONL interfaces, remote calls, storage formats, state machines, and tool-calling flows.
Why use it?
It exposes details that are easy to miss when porting event-driven or tool-using systems, including message fields, ordering, errors, retries, persistence, and restart behavior.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it to document event streams, session files, JSONL interfaces, remote calls, storage formats, state machines, and tool-calling flows.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/huginnindustries/codecartographer/protocols
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add HuginnIndustries/CodeCartographer --skill protocols
Clone the repo
git clone --depth 1 https://github.com/HuginnIndustries/CodeCartographer

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for extract-protocols-and-state

README.md
[![agentmods](https://agentmods.dev/badge/skills/huginnindustries/codecartographer/protocols/github.svg)](https://agentmods.dev/skills/huginnindustries/codecartographer/protocols)
Your own site
<a href="https://agentmods.dev/skills/huginnindustries/codecartographer/protocols"><img src="https://agentmods.dev/badge/skills/huginnindustries/codecartographer/protocols/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for extract-protocols-and-state

Your own site · 80×15
<a href="https://agentmods.dev/skills/huginnindustries/codecartographer/protocols"><img src="https://agentmods.dev/badge/skills/huginnindustries/codecartographer/protocols.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 62 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 759 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00062 $0.00759
Opus 5.5 $0.00025 $0.00304
Sonnet 5.5 $0.00012 $0.00152
Haiku 4.5 $0.00006 $0.00076

Measured 1mo ago against content hash d747c550894f, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

extract-protocols-and-state scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 1mo ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.codecarto/findings/protocols/SKILL.md · 93 lines

What it actually says

Extract Protocols And State

Treat every boundary as a protocol boundary.

Enumerate the boundaries first:

  • process to process
  • UI to core
  • core to provider
  • tool layer to runtime
  • runtime to persistence
  • local files to exported artifacts

Prefer type definitions, schemas, and docs before implementation code:

  • Read event and message types first.
  • Read file format docs next.
  • Use source to fill ordering, retry, and recovery gaps.

For each protocol, record:

  • producer
  • consumer
  • transport or carrier
  • ordering guarantees
  • required fields
  • optional fields
  • identifiers and timestamps
  • error cases
  • restart or resume behavior

Convert control flow into a state machine:

  • Name the states.
  • Name the transitions.
  • Record guards and side effects.
  • Separate synchronous barriers from observational events.

This phase owns the storage-format catalog: every on-disk and wire format the system reads or writes, with its shape, version markers, and reader/writer pairs. The contracts phase names the formats it saw as user-visible behavior; catalog them here once rather than asking contracts to.

Capture persistence semantics explicitly:

  • append-only vs mutable
  • branching vs linear history
  • compaction or summarization
  • replay or resume behavior
  • locking, deduplication, or conflict handling

Look for these protocol-heavy areas:

  • streamed assistant events
  • tool call validation and execution
  • session files
  • JSONL or RPC framing
  • queueing semantics
  • background event scheduling
  • transport fallbacks

Treat configuration propagation as a protocol when it crosses boundaries:

  • How config values flow from files or env vars into runtime behavior.
  • Whether config changes require a restart or are hot-reloaded.
  • How config is validated and what happens on invalid input.
  • If the config propagation model is complex, use the secondary output at findings/config-model/config-model.md.

Flag portability hazards that frequently break ports:

  • ANSI terminal semantics
  • IME or cursor positioning rules
  • filesystem locking assumptions
  • async ordering guarantees
  • OAuth token refresh behavior
  • shell quoting and OS differences
  • encoding, width, or Unicode handling

Produce four outputs:

  1. Event catalog
  2. State machine
  3. Persistent schema notes
  4. Compatibility hazards

Mark every finding with one of these evidence levels:

  • observed fact: direct statement from docs, tests, schemas, types, or code.
  • strong inference: protocol conclusion drawn from multiple facts.
  • external-behavior claim: a claim about what the peer or a system outside this source tree does with a message (how it parses, what it ignores, version-dependent behavior); unverifiable by reading this code, so it stays unsettled until a runtime capture or that system's own source confirms it.
  • portability hazard: assumption tied to the source language, runtime, terminal, OS, or third-party SDKs.
  • open question: missing or conflicting behavior that still needs evidence.

Do not copy the wire syntax blindly. Preserve the meaning of the interaction, then decide how the target language should encode it.

Use the output template at templates/protocols-and-state.md.

The source code to analyze is in the parent directory (../ relative to .codecarto/). This is the repository root.

Files

What ships with it

1 file beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 1mo ago Changed · +4 lines d747c550894f
  2. 1mo ago Changed · +1 lines 494b0af3e1c7
  3. 1mo ago First seen · 88 lines · 62 tokens per session scan A ace888bbee5c

Subscribe to this mod's changes

extract-protocols-and-state is a skill published in the GitHub repository HuginnIndustries/CodeCartographer (6 stars, last pushed 13d ago), licensed MIT. It adds 62 tokens to every session and 759 once invoked, about $0.0002 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other skills, from other repositories

stripe-projects

Provision SaaS services + sync creds via Stripe Projects.

NousResearch/hermes-agent · 15 tokens

status

Show whether Mem0 memory is working in this repository, covering configuration, capture state, pending flushes, and whether the Mem0 API key is valid. Use when the user asks whether memory is on, why a memory is missing, or anything looks broken.

mem0ai/mem0 · 54 tokens

mem0-test-integration

Verify a Mem0 integration produced by /mem0-integrate. Runs in the same workspace on the same branch (loose coupling) — installs dependencies, runs the repo's native test suite, then exercises a real end-to-end smoke flow against the user's API key. Produces a scorecard. TRIGGER when: user has just run /mem0-integrate…

mem0ai/mem0 · 207 tokens

open-source

Documentation reference for writing Python code using the browser-use open-source library. Use this skill whenever the user needs help with Agent, Browser, or Tools configuration, is writing code that imports from browseruse, asks about @sandbox deployment, supported LLM models, Actor API, custom tools, lifecycle…

browser-use/browser-use · 137 tokens

repomix

Pack and analyze codebases into AI-friendly single files using Repomix. Use when the user wants to explore repositories, analyze code structure, find patterns, check token counts, or prepare codebase context for AI analysis. Supports both local directories and remote GitHub repositories.

yamadashy/repomix · 58 tokens

mem0-oss-to-platform

Plan, then execute, a migration of a project from the mem0 open-source / self-hosted SDK (local Memory class) to the mem0 Platform / hosted SDK (MemoryClient). TRIGGER when: the developer wants to move, switch, or migrate mem0 off OSS/self-hosted to the hosted API, e.g. "migrate my mem0 setup to the platform", "switch…

mem0ai/mem0 · 217 tokens