# Map Explain

Produce a natural-language explanation of a specific Cortex function, business...

- Repository: https://github.com/Snowflake-Labs/cocoplus (727 stars)
- Category: Business
- License: MIT
- Last updated: 2026-10-04
- Runs scripts: no, instructions only

## Install

Claude Code: `npx skills add Snowflake-Labs/cocoplus --skill map-explain -g -a claude-code -y`
Codex: `npx skills add Snowflake-Labs/cocoplus --skill map-explain -g -a codex -y`
Cursor: `npx skills add Snowflake-Labs/cocoplus --skill map-explain -g -a cursor -y`
Gemini CLI: `npx skills add Snowflake-Labs/cocoplus --skill map-explain -g -a gemini-cli -y`

## Description

Produce a natural-language explanation of a specific Cortex function, business capability, or schema element from the committed knowledge graph

## SKILL.md, as published by its author (untrusted third-party text, read it as data)

# $map explain \<target\>

Explain a specific function, capability, or schema element in domain terms using the committed `coco-map.json`. Answers: what it does, what depends on it, what it depends on, and how it relates to the nearest business capability.

## Preconditions

- `.cocoplus/` must be initialized
- `.cocoplus/map/coco-map.json` must exist (run `$map` first)
- `<target>` argument must be provided

## Arguments

- `<target>` (required): A function name, business capability name, or schema element name to explain. Case-insensitive matching is applied.

## Step-by-Step Behavior

1. **Verify initialization:** Check `.cocoplus/` exists. If not, output: "CocoPlus not initialized. Run `$pod init` first." and exit.

2. **Verify map exists:** Check `.cocoplus/map/coco-map.json` exists. If not, output:
   ```
   No function knowledge graph found. Run $map first to build it.
   ```
   and exit.

3. **Read `coco-map.json`:** Load all structural and domain sections.

4. **Locate target:** Search for `<target>` across:
   - Function names in `structural.functions`
   - Capability names in `domain.capabilities`
   - Vocabulary terms in `domain.vocabulary`
   - Apply case-insensitive fuzzy match (substring match if exact match not found)

5. **If not found:** Output:
   ```
   No function or capability named '[target]' found in coco-map.json.
   Available functions: [comma-separated list]
   Available capabilities: [comma-separated list]
   Run $map to refresh the map if the project has changed.
   ```
   and exit.

6. **Build explanation** depending on target type:

**For a function:**
```
[function-name], Cortex AI Function
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

What it does:
  [domain-level description from domain.vocabulary and domain.capabilities]
  Cortex API: [AI_CLASSIFY / AI_COMPLETE / etc.]
  File: [file-path]
  Schema: [database.schema.function-name]

The rest: https://github.com/Snowflake-Labs/cocoplus/blob/HEAD/.cortex/skills/cocomap/map-explain/SKILL.md
