# LLM Skill

If you use an AI to write code to wrangle or query AEMO data, you can use a 'skill' to tell it how to search an AI-optimised version of this website.

This skill does not use MCP. You do not need to install a cli or plugin.
As long as your clanker can browse the web, it can *probably* use this skill.
(Free-tier plans may have overly restrictive sandboxes.)

???+ note "Example Conversation"
    Prompt:
    
    > Write me a query to calculate the volume-weighted average price across each region of the NEM.

    Response:
    > Here's a SQL query using DISPATCHPRICE (prices) joined to DISPATCHREGIONSUM (demand as the volume weight), per the intervention rule: prices from INTERVENTION = 0, power/energy from the highest INTERVENTION value present.
    > 
    > ```sql
    > WITH price AS (
    >     -- Prices: pricing run only (INTERVENTION = 0)
    >     SELECT SETTLEMENTDATE, REGIONID, RRP
    >     FROM DISPATCHPRICE
    >     WHERE INTERVENTION = 0
    >       AND SETTLEMENTDATE >= :start_date
    >       AND SETTLEMENTDATE <  :end_date
    > ),
    > demand AS (
    >     -- Power: prefer INTERVENTION = 1 rows where present (actual dispatch)
    >     SELECT SETTLEMENTDATE, REGIONID, TOTALDEMAND
    >     FROM DISPATCHREGIONSUM
    >     WHERE SETTLEMENTDATE >= :start_date
    >       AND SETTLEMENTDATE <  :end_date
    >     QUALIFY INTERVENTION = MAX(INTERVENTION) OVER (
    >         PARTITION BY SETTLEMENTDATE, REGIONID
    >     )
    > )
    > SELECT
    >     p.REGIONID,
    >     SUM(p.RRP * d.TOTALDEMAND) / NULLIF(SUM(d.TOTALDEMAND), 0) AS VWAP,  -- $/MWh
    >     SUM(d.TOTALDEMAND) / 12 AS ENERGY_MWh   -- 5-min MW → MWh (cancels out of VWAP anyway)
    > FROM price p
    > JOIN demand d
    >   ON  d.SETTLEMENTDATE = p.SETTLEMENTDATE
    >   AND d.REGIONID       = p.REGIONID
    > GROUP BY p.REGIONID
    > ORDER BY VWAP DESC;
    > ```
    > 
    > Notes:
    > 
    > - Weights by `TOTALDEMAND` (MW, "demand less loads") from `DISPATCHREGIONSUM` — the standard proxy for volume. The `/12` MWh conversion is shown for completeness but cancels out of the VWAP ratio.
    > - If you're loading the raw CSVs rather than a PDR-loaded database, deduplicate on `LASTCHANGED` (latest row per `SETTLEMENTDATE`/`REGIONID`/`INTERVENTION`) first, as `DISPATCHPRICE` is append-only and republishes revised prices to `RRP`.
    > - Pre-October 2021, trading was on 30-minute prices — check granularity if querying older data.
    > - If you'd rather weight by cleared generation (`CLEAREDSUPPLY`) or actual metered volume (`DISPATCH_UNIT_SCADA` via `DISPATCHLOAD`), swap the demand CTE accordingly.
    > 
    > Sources: [DISPATCHPRICE](../tables/DISPATCHPRICE.md) · [DISPATCHREGIONSUM](../tables/DISPATCHREGIONSUM.md) · [Querying guide (intervention, dedup, timestamps)](../../guide/querying.md)

By directing your agent towards markdown and json versions of the site, you can save tokens.
That leads to a better experience for you, and lower carbon emissions, compared to having it just search the web for the HTML. (Of course not using LLMs at all uses less carbon.)

## Setup

<!-- Shares .copy-markdown-button / .copy-markdown-icon with the "Copy as
     Markdown" button in overrides/main.html, so the styling lives once in
     css/custom.css. Centered here (the main button is right-aligned). -->
<div class="copy-markdown-container" style="justify-content: center;">
    <button id="copy-skill-btn" class="copy-markdown-button" type="button"
            onclick="copySkillMarkdown(this)">
        <span class="copy-markdown-icon" id="copy-skill-icon">📋</span>
        <span>Copy SKILL.md</span>
    </button>
</div>

===+ "GreenPT"
    If you're not already familiar, [GreenPT](https://greenpt.com/) is an alternative to Claude/ChatGPT/Copilot/Gemini.
    It runs with a far lower carbon footprint than the diesel-hungry name-brand ones. (By my estimate, two orders of magnitude lower.)
    It also shows you your carbon footprint on a per-conversation bases (inference only).
    If you're an energy nerd, you need to try GreenPT.

    Their general instructions for adding skills are [here](https://greenpt.com/help/using-skills-in-chat#create-and-test-a-skill).
      
    ![Screenshot of skill creation page](screenshots/greenpt.png)

    Feel free to adjust to suit your needs:

    * Copy-paste [`SKILL.md`](../../SKILL.md) into "Instructions".
    * Cut the first few metadata lines (between `---`, inclusive), moving `name` into the `Name` field, and `description` into the `When should GreenPT use it?` field.

=== "Claude Chat"

    Search Settings for "Skill". In "Upload a skill", upload [`SKILL.md`](../../SKILL.md).

    !!! danger "Free Tier Sandboxing Issue"
        If you are on the **free tier** of Claude chat, then the sandboxing permissions are too strict, so this skill will not work well.
        The purpose of this skill is so that Claude can independently figure out which URLs on this site to get information from.
        However, on the free tier, Claude is not allowed to download URLs unless you type them in the chat first.
        The workaround is for you to tell Claude to tell you what URLs it needs, so that you can copy-paste those URLs into the chat, 
        thus telling Claude to download the URLs it just told you. Yes, this is silly. I recommend switching to [GreenPT](#__tabbed_1_1), where this skill 'just works'.

=== "Claude Code"
    Find your `.claude` folder. (On Linux it's at `~/.claude`).
    Save [`SKILL.md`](../../SKILL.md) at `.claude/skills/nsm-schema/SKILL.md`.

=== "ChatGPT"

    !!! danger "Sandboxing Issue"
        If you are on the **free tier** of ChatGPT, then the sandboxing permissions are too strict, so this skill will not work.
        ChatGPT is unable to fetch URLs for this site.
        I recommend switching to [GreenPT](#__tabbed_1_1), where this skill 'just works'.

    If you have a paid ChatGPT plan, use [`SKILL.md`](../../SKILL.md).

=== "Copilot"

    The free tier does not support `SKILL.md` files.
    The paid tier might, but I have not tested this.

    Save [`SKILL.md`](../../SKILL.md) at `.claude/skills/nsm-schema/SKILL.md`.

=== "Other"
    Copy-paste [`SKILL.md`](../../SKILL.md).
    You may need to delete the first few metadata lines (between `---`, inclusive).

    If you have success, or not, please [let me know](../../about/contact.md).

## Testing The Setup

Once you have installed the skill, test the bot's permissions by asking it to fetch the markdown and json files for a given table (e.g. `DISPATCHPRICE`). 
It should be able to download the URL successfully, using its normal URL fetch tool, or `curl`.
Some providers, particularly on the free-tier, will block this traffic. (e.g. direct permission error, or DNS errors.)
Ask the bot whether it resorted to a web search instead of a direct URL fetch. If so, this skill is not compatible with your bot/harness.
