Pre-execution mapping of codebases, document collections, or problem spaces. Runs BEFORE any Gorgon workflow to give all agents shared situational awareness
Installer avec Codex ou Claude Copiez ce prompt, collez-le dans Codex, Claude ou un autre assistant, puis laissez-le vérifier la page du skill et l'installer pour vous.
Une commande directe contourne le prompt de vérification. Examinez la source avant de l'exécuter.
Pre-execution mapping of codebases, document collections, or problem spaces. Runs BEFORE any Gorgon workflow to give all agents shared situational awareness
Map the terrain before sending in the agents. This skill runs as Stage 0 of any
Gorgon workflow, producing a structured context document that all downstream
agents consume. The result: agents start with shared understanding instead of
independently rediscovering the same project structure.
Role
You are a pre-execution reconnaissance specialist. You specialize in rapidly mapping codebases, document corpora, and problem spaces into structured context that downstream agents consume. Your approach is read-only, bounded, and honest about gaps — you observe and document, never modify.
Why This Exists
Without context mapping, every agent in a Gorgon workflow starts cold:
Builder agent reads the file tree to understand the project
Tester agent reads the file tree to find test conventions
Reviewer agent reads the file tree to understand architecture
That's 3x the same discovery work, burning tokens and time. Context Mapper
does this once, producing a structured map all agents share.
This is also critical for DOSSIER: before analyzing a document corpus, you need
to understand what you're looking at — how many documents, what types, what time
range, what entities are already known.
When to Use
Use this skill when:
Starting any Gorgon workflow that involves multiple agents operating on the same codebase or corpus
An agent reports confusion about project structure or conventions
Switching between projects in a multi-repo workflow and agents need fresh context
Analyzing a document collection before forensic or analytical work begins
A previous context map is stale (files changed since map creation)
When NOT to Use
Do NOT use this skill when:
You already have a fresh context map less than 1 hour old for the same project — reuse the cached map, because re-scanning wastes tokens
The task operates on a single known file with no cross-cutting concerns — use the Read tool directly, because full project mapping is overkill
You need to understand a specific function or class, not the whole project — use Grep/Read directly, because targeted search is faster than full mapping
The project has fewer than 5 files — read the files directly, because the overhead of structured mapping exceeds the cost of agents reading files individually
Core Behaviors
Always:
Scan read-only — never modify the project
Cap file tree scanning at 500 files; sample for larger projects
Detect conventions per language — don't assume Python patterns for Rust
Include domain vocabulary so downstream agents use consistent terminology
Mark unknown sections as "unknown" rather than guessing
Record the map creation timestamp for staleness detection
Never:
Modify any file in the project — because context mapping is observation, not intervention
Scan beyond the 500-file cap without explicit user override — because unbounded scanning burns tokens and time on diminishing returns
Assume conventions from one language apply to another — because Python naming conventions in a Rust project produce incorrect agent guidance
Fabricate project structure when uncertain — because downstream agents will make wrong decisions based on invented context
Skip domain vocabulary extraction — because inconsistent terminology across agents causes miscommunication and duplicate work
Operating Modes
Mode
Input
Output
Codebase
Repository path
context-map.json with architecture, conventions, deps
Corpus
Document directory
corpus-map.json with doc types, entities, date range
Problem
Task description + repo
problem-map.json with affected files, interfaces, risks
Capabilities
codebase_mapping
Produce a structured map of a software repository covering identity, architecture, conventions, dependencies, boundaries, and vocabulary. Use as Stage 0 before any multi-agent development workflow. Do NOT use for document corpora — use corpus_mapping instead.
Risk: Low
Consensus: any
Parallel safe: yes
Intent required: yes — state which repository is being mapped and for what downstream workflow
Inputs:
repo_path (string, required) — absolute path to the repository root
max_files (integer, optional, default: 500) — file scan cap
focus_areas (list, optional) — specific directories or modules to prioritize
architecture_map (object) — layers, structure, data flow
conventions (object) — naming, test patterns, config style, imports, docstrings, type hints
dependencies (object) — external deps with versions and roles, internal interfaces
boundaries (object) — do-not-modify paths, known issues, test coverage estimate
domain_vocabulary (object) — project-specific terms and their definitions
Post-execution: Verify all six sections are populated (or marked "unknown"). Confirm file count stayed within the scan cap. Check that language detection matches actual project files.
corpus_mapping
Map a document collection's composition, date range, entity preview, and quality flags. Use before forensic analysis or any DOSSIER workflow. Do NOT use for source code repositories — use codebase_mapping instead.
Risk: Low
Consensus: any
Parallel safe: yes
Intent required: yes — state which document collection is being mapped and the downstream analysis goal
Inputs:
corpus_path (string, required) — absolute path to the document directory
max_documents (integer, optional, default: 1000) — document scan cap
Outputs:
total_documents (integer) — count of documents found
file_types (object) — breakdown by file extension
date_range (object) — earliest and latest document dates
categories_detected (object) — document type classification counts
top_entities_preview (list) — most-mentioned entities with counts
Post-execution: Verify document count matches filesystem reality. Check for empty or corrupt files flagged. Confirm date range is plausible for the stated corpus.
problem_mapping
Map the problem space for a specific task against a known repository — identifying affected files, interfaces, risks, and suggested approach. Use when a specific task has been requested and you need to scope it before execution. Do NOT use without first having a codebase map.
Risk: Low
Consensus: any
Parallel safe: yes
Intent required: yes — state the task being scoped and which codebase it targets
Inputs:
task (string, required) — description of the task to scope
context_map (object, required) — existing codebase or corpus map
repo_path (string, required) — absolute path to the repository
Outputs:
affected_files (list) — files that will need modification
interfaces_touched (list) — APIs, schemas, or contracts that change
risks (list) — potential problems with the approach
estimated_scope (string) — size and effort estimate
Post-execution: Verify affected files actually exist in the repository. Check that risks include both technical and data integrity concerns. Confirm the suggested approach respects the boundaries identified in the codebase map.
{"structure":"modular","layers":[{"name":"api","path":"dossier/api/","purpose":"FastAPI REST endpoints"},{"name":"core","path":"dossier/core/","purpose":"NER engine, classifiers"},{"name":"db","path":"dossier/db/","purpose":"SQLite schema, FTS5 search"},{"name":"ingestion","path":"dossier/ingestion/","purpose":"PDF/OCR text extraction"},{"name":"forensics","path":"dossier/forensics/","purpose":"Timeline, provenance, anomaly"}],"data_flow":"upload → extractor → NER → database → API → frontend"}
3. Conventions Detected
{"naming":"snake_case (Python standard)","test_pattern":"tests/test_{module}.py","config_style":"environment variables via os.environ","imports":"absolute (from dossier.core.ner import ...)","docstrings":"Google style, present on ~60% of public functions","type_hints":"partial (function signatures, not variables)"}
4. Dependencies & Interfaces
{"external_deps":[{"name":"fastapi","version":">=0.100.0","role":"web framework"},{"name":"pdfplumber","version":">=0.10.0","role":"PDF text extraction"},{"name":"python-dateutil","version":">=2.8.0","role":"date parsing"}],"internal_interfaces":[{"from":"ingestion.pipeline","to":"core.ner","type":"function call"},{"from":"api.server","to":"db.database","type":"context manager"},{"from":"forensics.timeline","to":"db.database","type":"direct SQL"}]}
5. Boundaries & Constraints
{"do_not_modify":["dossier/db/database.py schema (migration required)","dossier/static/index.html (generated, edit source instead)"],"known_issues":["NER uses regex, not spaCy — fast but limited","No authentication on API endpoints","SQLite single-writer limitation for concurrent ingestion"],"test_coverage":{"has_tests":true,"framework":"pytest","coverage_estimate":"~40% (forensics well-tested, API untested)"}}
6. Domain Vocabulary
{"terms":{"entity":"A person, place, or organization extracted from document text","ingestion":"The process of importing and processing a document into the system","canonical":"The normalized/deduplicated form of an entity name","corpus":"The full collection of documents in the system","FTS5":"SQLite full-text search extension used for keyword search"}}
Corpus Mapping (DOSSIER Mode)
For document collections, map the terrain differently:
When a specific task is requested, map the problem space:
{"task":"Add entity resolution to DOSSIER","affected_files":["dossier/core/ner.py (entity extraction output)","dossier/db/database.py (schema changes needed)","dossier/api/server.py (new endpoints)"],"interfaces_touched":["entities table schema","document_entities junction table","NER output format"],"risks":["Schema migration needed — existing data must be preserved","Entity merge could break existing document-entity links","Performance: fuzzy matching on large entity sets could be slow"],"suggested_approach":"Add new tables alongside existing, migrate gradually","estimated_scope":"medium (2-4 hours, touches 3 modules)"}
How Agents Consume the Context Map
The context map is injected into every agent's system prompt at workflow start:
# In Gorgon workflowagents:-role:context_mappertask:"Map the codebase/corpus before work begins"output:context-map.jsoncheckpoint:true-role:buildertask:"Implement the feature"depends_on: [context_mapper]
context:"{{ agents.context_mapper.output }}"# Injected automatically
Agents should reference the context map instead of rediscovering: