Skills

Map Explain

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

Install

npx skills add Snowflake-Labs/cocoplus --skill map-explain -g -a claude-code -y
Category
Business
Updated
1mo ago
License
MIT
Context cost
Lightabout 1,023 tokens
Runs scripts
No, instructions only

What it does

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

$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]
Read the whole SKILL.md on GitHub

More in Business