code-flow-scope-colors
Adds reusable scope-based color labels to MongoDB code-flow explanations.
Skill by enricogolfieri
Install
Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.
npx agentmarket install skill/enricogolfieri-code-flow-scope-colors
Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.
Get the weekly diff
The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.
About
Use cases: design
Reviews
Write a reviewNo reviews yet. Installed it? Reviews come from verified installers only. How reviews work
Permissions
What this skill can do and what it asks for, from its SKILL.md. Checked Oct 25, 2026.
- Tools
- No tools found
- Secrets
- None asked for
- Install scripts
- None found
Network hosts it talks to 1
codeload.github.com· found in install command
Files it touches
~/.claude/skills/code-flow-scope-colors
What's inside
- Skill name
code-flow-scope-colors- Description
- Adds reusable scope-based color labels to MongoDB code-flow explanations. Diagrams must use abstract assignment notation (colored lhs = rhs, gates, scope open/close) for every flow—not only oplog timestamps. Use for OperationContext, WUOW, RecoveryUnit, oplog, catalog, routing, yield, acquisition, multikey, or any scope boundary.
- License
- Unlicense
- Instructions
- 514 lines in SKILL.md · view on GitHub
Agent Skills spec issues
- name: "code-flow-scope-colors" does not match folder "color-flow-scope-colors"
- body: 514 lines (spec recommends under 500)
Files (1)
- SKILL.md
SKILL.md (first lines)
# Code Flow Scope Colors
## Mandatory Output Rule
**Every response using this skill MUST:**
1. Begin with an **Adapted Scope Palette** (only colors used in this flow).
2. Include **abstract assignment blocks** (`coloredField = expr`, gates, scope open/close) for the
whole flow — not only timestamp or oplog sections.
3. End with the **Invariant Prompt**.
Do not dump the full canonical palette unless all nine colors appear. Never assign a color without
saying what scope it denotes. Never explain a flow with call names and arrows alone.
## Core Rule
Color by **owning scope / lifetime**, not by function name or call site.
**Diagrams are abstract assignment code**, not narrated call graphs. Show what gets stored where,
with `=` for every mutation or scope crossing. Use `->` only for sequencing (open WUOW, then
commit), never as a substitute for `dest = source`.
**Do not color a function call** unless you are naming the scope it establishes. Prefer the state
the call creates:
```text
// Wrong
⚪ acquireCollection() -> applyOperation_inlock()
// Right
🟢 TransactionResources += CollectionAcquisition request // extends 🟢 opCtx bundle
⚪ collHandle = view into 🟢 TransactionResources // stack-local ref
```
## Canonical Scope Palette
Reference definitions. Copy only the entries you use into the Adapted Scope Palette and adjust
wording when the flow needs a sharper label.
```text
⚫ black = durable/on-disk state
RecordStore bytes, SortedDataInterface entries, _mdb_catalog records,
durable oplog records, persisted config collections.
🔴 red = in-memory catalog / metadata view
CollectionCatalog, IndexCatalog, IndexCatalogEntry, CollectionPtr metadata,
in-memory multikey state, in-memory routing-independent catalog metadata.
🟡 yellow = oplog / replicated payload
OplogEntry, DurableOplogEntry, applyOps payload, prepare/commit oplog entries,
op.timestamp, op.object, op.nss, op.uuid.
🟢 green = OperationContext scope and opCtx decorations
MultikeyPathTracker, Locker, CurOp, RecoveryUnit access through opCtx,
TransactionResources, OperationShardingState, request-local state
attached to the current operation.
🟠 orange = ServiceContext / process-global service scope and decorations
StorageEngine, ReplicationCoordinator, OpObserver, global services,
server-wide feature flags, failpoints, service-level registries,
CursorManager stashed resources.
⚪ white = WriteUnitOfWork / local lexical scope
WUOW lifetime, variables created inside the WUOW, rollback hooks,
scoped guards, stack-local temporaries, per-WUOW derived state.
NOT opCtx decorations, NOT acquisition handles, NOT API entry points.
🟣 purple = RecoveryUnit / storage transaction in-memory state
RU timestamp, commit timestamp, prepare timestamp, snapshot state,
WiredTiger transaction state before durability.
🟤 brown = routing / sharding / placement metadata
ShardVersion, DatabaseVersion, ChunkManager, CatalogCache,
placement info, routing table state, ownership filter, RangePreserver.
🔵 blue = client request / command payload before it becomes oplog
InsertCommandRequest, UpdateRequest, DeleteRequest, parsed command,
query specs, update specs, router-attached version fields.
```
## Adapted Scope Palette
Build this at the top of every response. Include only colors used below. Extend or narrow canonical
definitions when the flow requires it.
Example for shard-role acquisition:
```text
Adapted palette (shard role acquisition):
🔵 Incoming command + router-attached ShardVersion / DatabaseVersion
🟢 OperationContext decorations: OperationShardingState, TransactionResources,
locks; CollectionAcquisition is a ref-counted view into this scope
🔴 In-memory local catalog snapshot: CollectionCatalog, CollectionPtr
🟤 Sharding placement: PlacementConcern, ownership filter, RangePreserver
🟣 Storage snapshot opened to match the catalog read
⚫ Durable bytes read/written through the pinned catalog view
⚪ WriteUnitOfWork wrapping individual document writes (separate from acquisition)
```
## Assignment & Scope-Change Notation (mandatory — all flows)
**Every diagram** for any topic (oplog, yield, acquisition, multikey, sharding, commands) must use
this notation. Specialized sections below are **templates**, not exceptions.
### Required elements
| Element | Syntax | When |
| ----------------- | ------------------------------------------------ | --------------------------------------------------- |
| Copy / promote | `🟢 dst = 🟡 src` | Value crosses scope; recolor on RHS if type changes |
| In-place mutate | `🔴 entry.flags \|= MULTIKEY` | Field updated inside same scope |
| Gate | `canX = false — because <scope condition>` | Branch chooses which assignments run |
| Conditional write | `if canX: 🟣 field = expr` | Write may be skipped; say who owns it when false |
| Scope open | `⚪ wuow = WriteUnitOfWork { open }` | New lexical lifetime |
| Scope close | `⚪ wuow.commit()` / `destroy` | End lifetime; show what 🟣/⚫ gains |
| Detach | `⚪ bundle = 🟢 resources; 🟢 resources = empty` | Ownership leaves opCtx |
| Attach | `🟢 resources = ⚪ bundle` | Restore |
| Derive | `🟡 subOpᵢ = extract(🟡 parent)` | New objects in same or new scope |
| Invalidate | `🔴 CollectionPtr = UNSAFE` | Handle outlives valid view |From enricogolfieri/workspace-mongo, Unlicense.
More from enricogolfieri/workspace-mongo
- 0.552score
trace-function
enricogolfieri
Statically trace what happens when a C++ function is called, including verified call edges, max-depth stack trace, and branch gates.
SkillBFreshness: B★ 1Claude Code +9 - 0.547score
ticket-implement
enricogolfieri
Implement an approved SERVER ticket plan: create branch, code+tests, validate, open a draft PR.
SkillBFreshness: B★ 1Claude Code +9 - 0.547score
ticket-plan
enricogolfieri
Start and plan a Jira ticket: load context, summarize scope, evaluate split, and produce an approved plan.
SkillBFreshness: B★ 1Claude Code +9 - 0.547score
ticket-resume
enricogolfieri
Resume a ticket from durable state and continue from its recorded phase.
SkillBFreshness: B★ 1Claude Code +9 - 0.547score
ticket-flush
enricogolfieri
Persist durable ticket session truth mid-chat: update state.json and create any memory files needed (context, session notes, experiment notes), indexed from…
SkillBFreshness: B★ 1Claude Code +9 - 0.547score
ticket-analyse
enricogolfieri
Analyse PERF tickets and register each new experiment in state.json (patch, comparison links, notes paths).
SkillBFreshness: B★ 1Claude Code +9 - 0.547score
write-mongo-jstests
enricogolfieri
Write focused MongoDB jstests with explicit mocha cases, small mechanical topology helpers, purposeful comments, robust teardown, and correct ownership.
SkillBFreshness: B★ 1Claude Code +9 - 0.544score
ticket-shared
enricogolfieri
Shared reference and state_memory.py for ticket-plan, ticket-implement, ticket-analyse, ticket-resume, and ticket-flush.
SkillBFreshness: B★ 1Claude Code +9 - 0.497score
mongo-pr-review
enricogolfieri
Performs deep pull request reviews by quickly explaining code changes and identifying potential bugs grouped by severity (critical, non-critical, nit).
SkillCFreshness: C★ 1Claude Code +9 - 0.497score
distributed-code-flow-diagrams
enricogolfieri
Generate scoped Mermaid diagrams for distributed code flows.
SkillCFreshness: C★ 1Claude Code +9 - 0.497score
extract-author-changes
enricogolfieri
Loads context for the current branch's PR-scope changes (merge-base to HEAD), including uncommitted edits, then confirms without summarizing.
SkillCFreshness: C★ 1Claude Code +9 - 0.497score
hot-bf-pings
enricogolfieri
Drafts Slack ping messages for hot Build Failures (BFs) from a Jira filter, listing the assignee, the SERVER dependency ticket, the GitHub PR, and a one-line…
SkillCFreshness: C★ 1Claude Code +9
Signals
- Stars
- 1
- Forks
- 0
- Open issues
- 0
- Last commit (this folder)
- Jun 15, 2026 (4 months ago)
From GitHub (fetched Oct 24, 2026).
Details
- License
- Unlicense
- First seen
- Oct 24, 2026
- Last checked
- Oct 24, 2026
- Source
- GitHubgithub-graphql
More from enricogolfieri
- 0.552score
trace-function
enricogolfieri
Statically trace what happens when a C++ function is called, including verified call edges, max-depth stack trace, and branch gates.
SkillBFreshness: B★ 1Claude Code +9 - 0.547score
ticket-resume
enricogolfieri
Resume a ticket from durable state and continue from its recorded phase.
SkillBFreshness: B★ 1Claude Code +9 - 0.547score
ticket-analyse
enricogolfieri
Analyse PERF tickets and register each new experiment in state.json (patch, comparison links, notes paths).
SkillBFreshness: B★ 1Claude Code +9 - 0.547score
ticket-flush
enricogolfieri
Persist durable ticket session truth mid-chat: update state.json and create any memory files needed (context, session notes, experiment notes), indexed from…
SkillBFreshness: B★ 1Claude Code +9 - 0.547score
ticket-plan
enricogolfieri
Start and plan a Jira ticket: load context, summarize scope, evaluate split, and produce an approved plan.
SkillBFreshness: B★ 1Claude Code +9 - 0.547score
ticket-implement
enricogolfieri
Implement an approved SERVER ticket plan: create branch, code+tests, validate, open a draft PR.
SkillBFreshness: B★ 1Claude Code +9
Cite this page
code-flow-scope-colors skill. Agent Mart. https://agentmart.dev/skills/enricogolfieri-code-flow-scope-colors (last updated 2026-10-24)