From 9aa06844829e690c2485531fd7e0dc813d99ebac Mon Sep 17 00:00:00 2001 From: Ludmil Simeonov Date: Tue, 17 Nov 2026 16:04:30 +0200 Subject: [PATCH] feat(plugin): 1.1.0 with Pricemind charts, quiet approvals, workflow skills and Codex packaging - Charts: a Pricemind chart page in the price-intelligence skill, the same renderer the Pricemind server shows inside the chat in the Claude apps. - Quiet approvals: the four 1.0 skills now ask once per job and report every change with how to undo it; they use the one-call execute and batch tools. - New skills: setup, weekly-review, management-report, promo-watch, price-check and own-brand-vs-market. - Codex packaging (preview), README sections per client, CHANGELOG. - CI: plugin validation, manifest consistency and a tool-name drift check. Co-Authored-By: Claude Fable 5.2 Co-Authored-By: Claude Opus 5.5 --- .agents/plugins/marketplace.json | 20 + .claude-plugin/marketplace.json | 6 +- .claude-plugin/plugin.json | 6 +- .codex-plugin/plugin.json | 50 + .github/workflows/validate.yml | 43 + CHANGELOG.md | 37 + README.md | 142 +- logo.png => assets/logo.png | Bin mcp.json | 9 + plugin.json | 54 + scripts/check-manifests.mjs | 144 ++ scripts/check-tool-names.mjs | 95 + scripts/lib/mcp-tools.mjs | 66 + scripts/sync-chart.sh | 36 + scripts/update-tools-lock.mjs | 44 + skills/competitor-alternatives/SKILL.md | 42 +- .../agents/openai.yaml | 14 + skills/management-report/SKILL.md | 44 + skills/management-report/agents/openai.yaml | 14 + .../references/kpi-glossary.md | 49 + .../management-report/references/queries.md | 93 + .../references/report-template.md | 43 + skills/matching-review/SKILL.md | 43 +- skills/matching-review/agents/openai.yaml | 14 + skills/own-brand-vs-market/SKILL.md | 46 + skills/own-brand-vs-market/agents/openai.yaml | 14 + .../references/kpi-glossary.md | 49 + .../own-brand-vs-market/references/queries.md | 84 + .../references/report-template.md | 25 + skills/price-check/SKILL.md | 48 + skills/price-check/agents/openai.yaml | 14 + skills/price-check/references/kpi-glossary.md | 49 + skills/price-check/references/queries.md | 58 + .../price-check/references/report-template.md | 23 + skills/price-intelligence/SKILL.md | 38 +- skills/price-intelligence/agents/openai.yaml | 14 + skills/price-intelligence/assets/README.md | 42 + skills/price-intelligence/assets/chart.html | 1939 +++++++++++++++++ skills/pricing-strategies/SKILL.md | 32 +- skills/pricing-strategies/agents/openai.yaml | 14 + skills/promo-watch/SKILL.md | 47 + skills/promo-watch/agents/openai.yaml | 14 + skills/promo-watch/references/kpi-glossary.md | 49 + skills/promo-watch/references/queries.md | 102 + .../promo-watch/references/report-template.md | 28 + skills/setup/SKILL.md | 67 + skills/setup/agents/openai.yaml | 14 + skills/setup/references/allow-read-tools.md | 74 + skills/weekly-review/SKILL.md | 47 + skills/weekly-review/agents/openai.yaml | 14 + .../weekly-review/references/kpi-glossary.md | 49 + skills/weekly-review/references/queries.md | 104 + .../references/report-template.md | 39 + tools.lock.json | 91 + 54 files changed, 4260 insertions(+), 76 deletions(-) create mode 100644 .agents/plugins/marketplace.json create mode 100644 .codex-plugin/plugin.json create mode 100644 .github/workflows/validate.yml create mode 100644 CHANGELOG.md rename logo.png => assets/logo.png (100%) create mode 100644 mcp.json create mode 100644 plugin.json create mode 100644 scripts/check-manifests.mjs create mode 100644 scripts/check-tool-names.mjs create mode 100644 scripts/lib/mcp-tools.mjs create mode 100755 scripts/sync-chart.sh create mode 100644 scripts/update-tools-lock.mjs create mode 100644 skills/competitor-alternatives/agents/openai.yaml create mode 100644 skills/management-report/SKILL.md create mode 100644 skills/management-report/agents/openai.yaml create mode 100644 skills/management-report/references/kpi-glossary.md create mode 100644 skills/management-report/references/queries.md create mode 100644 skills/management-report/references/report-template.md create mode 100644 skills/matching-review/agents/openai.yaml create mode 100644 skills/own-brand-vs-market/SKILL.md create mode 100644 skills/own-brand-vs-market/agents/openai.yaml create mode 100644 skills/own-brand-vs-market/references/kpi-glossary.md create mode 100644 skills/own-brand-vs-market/references/queries.md create mode 100644 skills/own-brand-vs-market/references/report-template.md create mode 100644 skills/price-check/SKILL.md create mode 100644 skills/price-check/agents/openai.yaml create mode 100644 skills/price-check/references/kpi-glossary.md create mode 100644 skills/price-check/references/queries.md create mode 100644 skills/price-check/references/report-template.md create mode 100644 skills/price-intelligence/agents/openai.yaml create mode 100644 skills/price-intelligence/assets/README.md create mode 100644 skills/price-intelligence/assets/chart.html create mode 100644 skills/pricing-strategies/agents/openai.yaml create mode 100644 skills/promo-watch/SKILL.md create mode 100644 skills/promo-watch/agents/openai.yaml create mode 100644 skills/promo-watch/references/kpi-glossary.md create mode 100644 skills/promo-watch/references/queries.md create mode 100644 skills/promo-watch/references/report-template.md create mode 100644 skills/setup/SKILL.md create mode 100644 skills/setup/agents/openai.yaml create mode 100644 skills/setup/references/allow-read-tools.md create mode 100644 skills/weekly-review/SKILL.md create mode 100644 skills/weekly-review/agents/openai.yaml create mode 100644 skills/weekly-review/references/kpi-glossary.md create mode 100644 skills/weekly-review/references/queries.md create mode 100644 skills/weekly-review/references/report-template.md create mode 100644 tools.lock.json diff --git a/.agents/plugins/marketplace.json b/.agents/plugins/marketplace.json new file mode 100644 index 0000000..4ec9d51 --- /dev/null +++ b/.agents/plugins/marketplace.json @@ -0,0 +1,20 @@ +{ + "name": "pricemind", + "interface": { + "displayName": "Pricemind" + }, + "plugins": [ + { + "name": "pricemind", + "source": { + "source": "local", + "path": "./" + }, + "policy": { + "installation": "AVAILABLE", + "authentication": "ON_INSTALL" + }, + "category": "Productivity" + } + ] +} diff --git a/.claude-plugin/marketplace.json b/.claude-plugin/marketplace.json index 7dcbf41..95bf70b 100644 --- a/.claude-plugin/marketplace.json +++ b/.claude-plugin/marketplace.json @@ -5,13 +5,15 @@ "url": "https://pricemind.ai" }, "metadata": { - "description": "The official Pricemind plugin for Claude." + "description": "The official Pricemind plugin for Claude.", + "version": "1.1.0" }, "plugins": [ { "name": "pricemind", "source": "./", - "description": "Competitive price intelligence, product matching, competitor alternatives and repricing strategies from your Pricemind account." + "description": "Competitive price intelligence, product matching, competitor alternatives and repricing strategies from your Pricemind account.", + "version": "1.1.0" } ] } diff --git a/.claude-plugin/plugin.json b/.claude-plugin/plugin.json index 7066a49..70b657a 100644 --- a/.claude-plugin/plugin.json +++ b/.claude-plugin/plugin.json @@ -1,8 +1,8 @@ { "name": "pricemind", "displayName": "Pricemind", - "version": "1.0.0", - "description": "Competitive price intelligence in Claude: see where your prices sit against competitors, review product matches, research competitor alternatives and manage repricing strategies in Pricemind. Sign in with your Pricemind account.", + "version": "1.1.0", + "description": "Competitive price intelligence in Claude: see where your prices sit against competitors as Pricemind charts, run weekly reviews, management reports and promo watches, review product matches, research competitor alternatives and manage repricing strategies. Sign in with your Pricemind account.", "author": { "name": "Pricemind", "url": "https://pricemind.ai" @@ -20,7 +20,7 @@ "product-matching", "mcp" ], - "icon": "./logo.png", + "icon": "./assets/logo.png", "documentationUrl": "https://pricemind.ai/docs", "supportUrl": "https://pricemind.ai/contact", "privacyPolicyUrl": "https://pricemind.ai/privacy", diff --git a/.codex-plugin/plugin.json b/.codex-plugin/plugin.json new file mode 100644 index 0000000..53b74e1 --- /dev/null +++ b/.codex-plugin/plugin.json @@ -0,0 +1,50 @@ +{ + "name": "pricemind", + "version": "1.1.0", + "description": "Competitive price intelligence from your Pricemind account: see where your prices sit against competitors as Pricemind charts, run weekly reviews, management reports and promo watches, review product matches, research competitor alternatives and manage repricing strategies.", + "author": { + "name": "Pricemind", + "url": "https://pricemind.ai" + }, + "homepage": "https://pricemind.ai", + "repository": "https://github.com/pricemind/agent-plugins", + "license": "MIT", + "keywords": [ + "pricing", + "price-intelligence", + "competitor-prices", + "repricing", + "ecommerce", + "retail", + "product-matching", + "mcp" + ], + "skills": "./skills/", + "mcpServers": "./.mcp.json", + "interface": { + "displayName": "Pricemind", + "shortDescription": "Competitor prices and charts", + "longDescription": "Ask about your prices and competitors in plain language and get answers from live Pricemind data. Pricemind shows where each product sits against every competitor, who changed prices and when, and draws the result as a Pricemind chart. Packaged workflows run a weekly review, a management report, a promo watch, a single-product price check and an own-brand vs. market comparison in one step. You can also review and fix product matches, research comparable products from other brands and inspect or change repricing strategies. The assistant asks once per job before it removes anything or changes prices, then reports every change and how to undo it. Sign in with your Pricemind account; no API key is stored on your computer.", + "developerName": "Pricemind", + "category": "Productivity", + "capabilities": [ + "Interactive", + "Read", + "Write" + ], + "websiteURL": "https://pricemind.ai", + "supportURL": "https://pricemind.ai/contact", + "privacyPolicyURL": "https://pricemind.ai/privacy", + "termsOfServiceURL": "https://pricemind.ai/terms", + "defaultPrompt": [ + "How do my prices compare with my competitors this week?", + "Run my weekly pricing review and show the top products to act on.", + "Have competitors started cutting prices? Show who, how deep and since when." + ], + "brandColor": "#5B2D92", + "brandColorDark": "#9D7BE0", + "composerIcon": "./assets/logo.png", + "logo": "./assets/logo.png", + "screenshots": [] + } +} diff --git a/.github/workflows/validate.yml b/.github/workflows/validate.yml new file mode 100644 index 0000000..274bdd4 --- /dev/null +++ b/.github/workflows/validate.yml @@ -0,0 +1,43 @@ +name: Validate plugin + +on: + push: + pull_request: + workflow_dispatch: + +permissions: + contents: read + +jobs: + validate: + runs-on: ubuntu-latest + timeout-minutes: 10 + steps: + - uses: actions/checkout@v4 + + - uses: actions/setup-node@v4 + with: + node-version: 22 + + - name: Install Claude Code CLI + run: npm install -g @anthropic-ai/claude-code@2.1.319 + + - name: Claude plugin (strict) + run: claude plugin validate --strict . + + - name: Agent Plugins schemas (plugin.json, mcp.json) + run: | + mkdir -p "$RUNNER_TEMP/schemas" + curl -fsSL -o "$RUNNER_TEMP/schemas/plugin.schema.json" https://agent-plugins.org/schemas/1.0.0/plugin.schema.json + curl -fsSL -o "$RUNNER_TEMP/schemas/mcp.schema.json" https://agent-plugins.org/schemas/1.0.0/mcp.schema.json + npx --yes ajv-cli@5.0.0 validate --spec=draft2020 --strict=false -s "$RUNNER_TEMP/schemas/plugin.schema.json" -d plugin.json + npx --yes ajv-cli@5.0.0 validate --spec=draft2020 --strict=false -s "$RUNNER_TEMP/schemas/mcp.schema.json" -d mcp.json + + - name: Codex manifests, marketplaces and skill metadata + run: node scripts/check-manifests.mjs + + - name: Tool-name drift check + # With the secret set, also checks against the live tools/list. + env: + PRICEMIND_MCP_TOKEN: ${{ secrets.PRICEMIND_MCP_TOKEN }} + run: node scripts/check-tool-names.mjs diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..f4998de --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,37 @@ +# Changelog + +All notable changes to the Pricemind plugin. Versions follow [Semantic Versioning](https://semver.org/). + +## 1.1.0 (2026-11-17) + +Pricemind in an AI assistant should feel like a product, not a tool list. + +### Charts + +- Pricemind-styled, explorable charts (hover values, show or hide shops, own shop highlighted, chart/table switch). In the Claude apps they open inside the chat as an MCP App served by the Pricemind server; in Claude Code and Codex the assistant fills the same renderer, shipped as a chart page in the `price-intelligence` skill. + +### Quiet approvals + +- The assistant asks once per job, never per step: reads never ask, additive or reversible changes run and are reported with how to undo them, removals and price changes get one approval for the whole plan, and only a Pricemind `decision_required` stops a job midway. +- The four 1.0 skills are rewritten to this model. +- Skills use only the one-call `*_execute_*` tools and the new batch tools (`matching_execute_unmatch_batch`, `product_discovery_execute_attach_batch`, `product_discovery_execute_detach_batch`). The legacy preview-token tools are gone from the server. + +### Workflows + +- New skills: `weekly-review`, `management-report`, `promo-watch`, `price-check` and `own-brand-vs-market`, each ending in Pricemind charts, with report templates and a KPI glossary. +- New `setup` skill: checks sign-in, lists your channels and suggests three first questions for your data, so you never need a channel ID or a tool name. + +### Codex + +- One repository and one set of skills for Claude and Codex (preview): an Agent Plugins `plugin.json` and `mcp.json`, a `.codex-plugin/plugin.json` fallback for older Codex builds, `.agents/plugins/marketplace.json`, and `agents/openai.yaml` per skill. +- README sections per client. + +### Repository + +- GitHub Actions run `claude plugin validate --strict .`, the Agent Plugins schemas, a manifest consistency check and a tool-name drift check (`scripts/check-tool-names.mjs` against `tools.lock.json`, and against the live server when `PRICEMIND_MCP_TOKEN` is set). +- The logo moved to `assets/logo.png`. +- Version 1.1.0 in every manifest. + +## 1.0.0 (2026-11-17) + +- First public release: the Pricemind MCP connection with OAuth sign-in and four skills (`price-intelligence`, `matching-review`, `competitor-alternatives`, `pricing-strategies`). diff --git a/README.md b/README.md index fe0e7db..5c83b43 100644 --- a/README.md +++ b/README.md @@ -1,12 +1,12 @@

- Pricemind + Pricemind

-

Pricemind for Claude

+

Pricemind for Claude and Codex

Live market prices, in every conversation.
- Ask Claude about your prices and competitors in plain language. It answers from your Pricemind data and draws the charts in the chat. + Ask about your prices and competitors in plain language. The answer comes from your Pricemind data, drawn as a Pricemind chart.

@@ -17,7 +17,9 @@ ▶ Watch with sound · demo data

-The official [Pricemind](https://pricemind.ai) plugin for Claude. It connects Claude to your Pricemind account, so you can ask about your prices and competitors in plain language and act on the answers. +The official [Pricemind](https://pricemind.ai) plugin for AI assistants. It connects Claude or Codex to your Pricemind account, so you can ask about your prices and competitors in plain language, get the answer as a Pricemind chart, and act on it. + +One plugin, one source: the same skills and the same connection work in Claude and in Codex. ## See it in action @@ -28,29 +30,48 @@ The official [Pricemind](https://pricemind.ai) plugin for Claude. It connects Cl The videos use fictional demo data. -## What you can do +## What you get -- **Price intelligence**: "Which of my Bosch drills are more expensive than at Shop X?", "Who changed prices on coffee machines this week?", "Show the price history of SKU 12345." -- **Matching review**: find and fix competitor listings that are matched to the wrong product. Claude shows a preview before any change. -- **Competitor alternatives**: research comparable models from other brands and add them as comparison products under your own product. -- **Pricing strategies**: understand your repricing rules, draft new ones and change them safely. Claude previews every change before applying it. +**Charts that look like Pricemind.** Price positions, price histories, competitor moves and price ladders come back as Pricemind charts you can explore: hover for values, show or hide shops, switch between chart and table. -## What's inside +- In the **Claude apps** (web and desktop) the chart opens interactively inside the chat. +- In **Claude Code** and **Codex**, the assistant fills a ready-made Pricemind chart page from the plugin and opens it in your browser. It looks the same, and the assistant writes no chart code. -| Part | What it does | +**Quiet approvals.** The assistant asks at most once per job, never once per step: + +| What it does | Examples | Does it ask? | +|---|---|---| +| Reads | search, price history, match context | Never | +| Adds or changes something reversible | approve matches, attach offers, start a crawl or run | No: it does what you asked, then reports what changed and how to undo it | +| Removes something or moves prices | unmatch, detach, remove a comparison product, create or change a pricing strategy | Once, for the whole plan, then it runs to the end. If your request already spells out the exact change, that is the approval | +| Pricemind flags a problem | a material warning, data changed since the plan, wider scope than asked | Only then does it stop mid-job | + +Every change is reported at the end, with how to undo it. + +Your client may still show its own permission prompt when the assistant calls a tool that changes data: one prompt per call, and a call can carry up to 25 changes. The `setup` skill can allow the read-only tools so lookups never prompt. + +**Workflows in one request.** Run a whole pricing workflow by name or just ask the question. + +## Skills + +| Skill | Ask, for example | |---|---| -| `.mcp.json` | Connects to the Pricemind MCP server at `https://mcp.pricemind.io/mcp`. | -| `skills/price-intelligence` | How to answer pricing questions with Pricemind search. | -| `skills/matching-review` | A safe review-preview-apply workflow for product matches. | -| `skills/competitor-alternatives` | Research and recording of cross-brand comparable products. | -| `skills/pricing-strategies` | Inspecting and safely changing repricing strategies. | -| `assets/` | The demo GIF and video posters shown in this README. Claude does not load them. | +| `setup` | "Get me started with Pricemind." Checks your sign-in, finds your channels and suggests first questions for your data. | +| `price-intelligence` | "Which of my Bosch drills are more expensive than at Shop X?", "Who changed prices on coffee machines this week?" | +| `price-check` | "Price check SKU 12345: every competitor's price, stock and history." | +| `weekly-review` | "Run my weekly pricing review." Price moves, lost and gained positions, new out-of-stocks, top 10 products to act on. | +| `management-report` | "Prepare the Q2 pricing review for Monday's management meeting." | +| `promo-watch` | "Have competitors started cutting prices? Show who, how deep and since when." | +| `own-brand-vs-market` | "How do our own-brand prices compare with the cheapest alternatives?" | +| `matching-review` | "Find competitor offers matched to the wrong product and fix them." | +| `competitor-alternatives` | "Find comparable models from other brands for this drill and add them as comparison products." | +| `pricing-strategies` | "Explain my repricing strategies and lower the margin floor for garden tools to 12%." | -The plugin contains no code that runs on your machine. It only adds the connection above and these instructions. +In Claude, run a skill by name with `/pricemind:` (for example `/pricemind:weekly-review`). In Codex, type `$` and pick the Pricemind skill. In both, a plain question is enough: the assistant picks the right skill itself. -## Install +## Claude Code -In Claude Code: +Install: ```bash claude plugin marketplace add pricemind/agent-plugins @@ -60,29 +81,94 @@ claude plugin marketplace add pricemind/agent-plugins claude plugin install pricemind@pricemind ``` -Or, inside a Claude Code session, run `/plugin marketplace add pricemind/agent-plugins`, then `/plugin install pricemind@pricemind`. +Or, inside a session, run `/plugin marketplace add pricemind/agent-plugins`, then `/plugin install pricemind@pricemind`. + +Sign in: in a session, run `/mcp`, choose the Pricemind server and select **Authenticate**. **Sign in with Pricemind** opens in your browser. Then run `/pricemind:setup`. + +Charts open as a Pricemind chart page in your browser. -## Sign in +## Claude apps (web and desktop) -After installing, sign in once. In Claude Code, run `/mcp`, choose the Pricemind server and select **Authenticate**. In the Claude apps, connect Pricemind from the connector's settings. Either way, **Sign in with Pricemind** opens in your browser. You need: +Add Pricemind from the Claude connector directory once it is listed, or install the plugin as above. Then connect Pricemind in the connector's settings; **Sign in with Pricemind** opens in your browser. + +Charts open interactively inside the chat. + +## Codex (preview) + +Codex support is new in 1.1. Installing the plugin is verified with the Codex CLI; sign-in, the skills and the chart page are still being tested in Codex, so please report anything that behaves differently from Claude. + +Install: + +```bash +codex plugin marketplace add pricemind/agent-plugins +``` + +```bash +codex plugin add pricemind@pricemind +``` + +Sign in: + +```bash +codex mcp login pricemind +``` + +**Sign in with Pricemind** opens in your browser. Then ask Codex to run `$setup`. + +Charts open as a Pricemind chart page in your browser. + +## Sign-in and permissions + +You need: - a Pricemind account; - an account administrator role (connecting an app acts for the whole account). -On the consent page, choose what Claude may do: +On the consent page, choose what the assistant may do: -- **Read and make changes** (default): read everything, plus run crawls and matching, approve matches and edit pricing strategies. Claude previews every change. +- **Read and make changes** (default): read everything, plus run crawls and matching, approve matches and edit pricing strategies. It asks before removing things or changing prices, and reports every change it makes. - **Read only**: products, competitor prices, price history, matches and pricing strategies. No changes. -No API key is stored in the plugin or on your computer. Pricemind issues a short-lived access token and renews it automatically. You can disconnect Claude at any time in Pricemind under **Profile → Security → Connected AI apps**, and access stops immediately. +No API key is stored in the plugin or on your computer. Pricemind issues a short-lived access token and renews it automatically. You can disconnect an assistant at any time in Pricemind under **Profile → Security → Connected AI apps**, and access stops immediately. + +## What's inside + +| Part | What it does | +|---|---| +| `.mcp.json`, `mcp.json` | Connect to the Pricemind MCP server at `https://mcp.pricemind.io/mcp` (`.mcp.json` for Claude and older Codex builds, `mcp.json` for the Agent Plugins layout). | +| `.claude-plugin/` | Claude plugin manifest and marketplace. | +| `plugin.json`, `.codex-plugin/`, `.agents/plugins/` | Codex manifest (Agent Plugins layout, with the older `.codex-plugin` layout as a fallback) and marketplace. | +| `skills//SKILL.md` | The ten skills above. Plain instructions, the same for every client. | +| `skills//agents/openai.yaml` | Display names and the server dependency for Codex. | +| `skills/price-intelligence/assets/` | The Pricemind chart page the assistant fills in where the chat cannot show charts itself. | +| `assets/` | The logo, the demo GIF and the video posters shown in this README. | +| `scripts/`, `tools.lock.json` | Repository checks only: manifest consistency and a check that every tool a skill names exists on the server. They are not part of what the assistant runs. | + +The plugin runs no code on your machine. It adds the connection above, the skills and the chart page. ## Data and privacy -- **What Claude sends:** when you use the plugin, Claude sends the requests it makes on your behalf, such as search filters, product IDs and approved changes, to Pricemind at `mcp.pricemind.io`. +- **What the assistant sends:** when you use the plugin, the assistant sends the requests it makes on your behalf, such as search filters, product IDs and changes you asked for, to Pricemind at `mcp.pricemind.io`. - **What Pricemind returns:** data from your own Pricemind account. -- **What the plugin itself does:** it collects nothing and contacts no other service. +- **What the plugin itself does:** it collects nothing and contacts no other service. The chart page loads no external code. - **Policies:** Pricemind processes your data under its [Privacy Policy](https://pricemind.ai/privacy) and [Terms](https://pricemind.ai/terms). +## Development + +```bash +claude plugin validate --strict . +``` + +```bash +node scripts/check-manifests.mjs +``` + +```bash +node scripts/check-tool-names.mjs +``` + +Set `PRICEMIND_MCP_TOKEN` to also check tool names against the live server, and run `node scripts/update-tools-lock.mjs` after the server's tools change. CI runs all three on every push. See [CHANGELOG.md](CHANGELOG.md) for releases. + ## Support Questions or problems: [pricemind.ai/contact](https://pricemind.ai/contact). Documentation: [pricemind.ai/docs](https://pricemind.ai/docs). diff --git a/logo.png b/assets/logo.png similarity index 100% rename from logo.png rename to assets/logo.png diff --git a/mcp.json b/mcp.json new file mode 100644 index 0000000..71d9f38 --- /dev/null +++ b/mcp.json @@ -0,0 +1,9 @@ +{ + "$schema": "https://agent-plugins.org/schemas/1.0.0/mcp.schema.json", + "mcpServers": { + "pricemind": { + "type": "streamable-http", + "url": "https://mcp.pricemind.io/mcp" + } + } +} diff --git a/plugin.json b/plugin.json new file mode 100644 index 0000000..92dd5fa --- /dev/null +++ b/plugin.json @@ -0,0 +1,54 @@ +{ + "$schema": "https://agent-plugins.org/schemas/1.0.0/plugin.schema.json", + "name": "pricemind", + "version": "1.1.0", + "description": "Competitive price intelligence from your Pricemind account: see where your prices sit against competitors as Pricemind charts, run weekly reviews, management reports and promo watches, review product matches, research competitor alternatives and manage repricing strategies.", + "author": { + "name": "Pricemind", + "url": "https://pricemind.ai" + }, + "homepage": "https://pricemind.ai", + "repository": "https://github.com/pricemind/agent-plugins", + "license": "MIT", + "keywords": [ + "pricing", + "price-intelligence", + "competitor-prices", + "repricing", + "ecommerce", + "retail", + "product-matching", + "mcp" + ], + "extensions": { + "com.openai": { + "onboardingSkill": "./skills/setup/SKILL.md", + "interface": { + "displayName": "Pricemind", + "shortDescription": "Competitor prices and charts", + "longDescription": "Ask about your prices and competitors in plain language and get answers from live Pricemind data. Pricemind shows where each product sits against every competitor, who changed prices and when, and draws the result as a Pricemind chart. Packaged workflows run a weekly review, a management report, a promo watch, a single-product price check and an own-brand vs. market comparison in one step. You can also review and fix product matches, research comparable products from other brands and inspect or change repricing strategies. The assistant asks once per job before it removes anything or changes prices, then reports every change and how to undo it. Sign in with your Pricemind account; no API key is stored on your computer.", + "developerName": "Pricemind", + "category": "Productivity", + "capabilities": [ + "Interactive", + "Read", + "Write" + ], + "websiteURL": "https://pricemind.ai", + "supportURL": "https://pricemind.ai/contact", + "privacyPolicyURL": "https://pricemind.ai/privacy", + "termsOfServiceURL": "https://pricemind.ai/terms", + "defaultPrompt": [ + "How do my prices compare with my competitors this week?", + "Run my weekly pricing review and show the top products to act on.", + "Have competitors started cutting prices? Show who, how deep and since when." + ], + "brandColor": "#5B2D92", + "brandColorDark": "#9D7BE0", + "composerIcon": "./assets/logo.png", + "logo": "./assets/logo.png", + "screenshots": [] + } + } + } +} diff --git a/scripts/check-manifests.mjs b/scripts/check-manifests.mjs new file mode 100644 index 0000000..d5bc5cc --- /dev/null +++ b/scripts/check-manifests.mjs @@ -0,0 +1,144 @@ +#!/usr/bin/env node +// Consistency checks for the client manifests that `claude plugin validate` +// does not cover: the Codex / Agent Plugins manifests, the two MCP files, the +// marketplaces and each skill's agents/openai.yaml. No dependencies. + +import { existsSync, readFileSync, readdirSync, statSync } from "node:fs"; +import { join } from "node:path"; +import { fileURLToPath } from "node:url"; + +const root = fileURLToPath(new URL("..", import.meta.url)); +const errors = []; +const fail = (msg) => errors.push(msg); +const read = (p) => readFileSync(join(root, p), "utf8"); +const json = (p) => { + try { + return JSON.parse(read(p)); + } catch (e) { + fail(`${p}: ${e.message}`); + return {}; + } +}; + +const claude = json(".claude-plugin/plugin.json"); +const claudeMarket = json(".claude-plugin/marketplace.json"); +const portable = json("plugin.json"); +const codex = json(".codex-plugin/plugin.json"); +const agentsMarket = json(".agents/plugins/marketplace.json"); +const dotMcp = json(".mcp.json"); +const portableMcp = json("mcp.json"); + +// One version everywhere. +const version = claude.version; +const versions = { + ".claude-plugin/plugin.json": claude.version, + ".claude-plugin/marketplace.json metadata": claudeMarket.metadata?.version, + ".claude-plugin/marketplace.json plugins[0]": claudeMarket.plugins?.[0]?.version, + "plugin.json": portable.version, + ".codex-plugin/plugin.json": codex.version, +}; +if (!/^\d+\.\d+\.\d+$/.test(version ?? "")) fail(`.claude-plugin/plugin.json: version ${version} is not semver`); +for (const [where, v] of Object.entries(versions)) if (v !== version) fail(`${where}: version ${v} != ${version}`); + +// Same identity. +for (const [where, m] of [["plugin.json", portable], [".codex-plugin/plugin.json", codex]]) { + if (m.name !== claude.name) fail(`${where}: name ${m.name} != ${claude.name}`); + if (m.repository !== claude.repository) fail(`${where}: repository differs from .claude-plugin/plugin.json`); + if (!m.description) fail(`${where}: description is empty`); +} +if (portable.$schema !== "https://agent-plugins.org/schemas/1.0.0/plugin.schema.json") fail("plugin.json: unexpected $schema"); +const portableAllowed = new Set(["$schema", "name", "version", "description", "author", "homepage", "repository", "license", "keywords", "extensions"]); +for (const key of Object.keys(portable)) if (!portableAllowed.has(key)) fail(`plugin.json: field ${key} is not in the Agent Plugins 1.0.0 schema`); + +// Both MCP files point at the same server. +const dotServers = dotMcp.mcpServers ?? {}; +const portableServers = portableMcp.mcpServers ?? {}; +if (portableMcp.$schema !== "https://agent-plugins.org/schemas/1.0.0/mcp.schema.json") fail("mcp.json: unexpected $schema"); +for (const [name, server] of Object.entries(dotServers)) { + const other = portableServers[name]; + if (!other) fail(`mcp.json: missing server ${name} that .mcp.json declares`); + else if (other.url !== server.url) fail(`mcp.json: ${name} url ${other.url} != .mcp.json ${server.url}`); + if (other && other.type !== "streamable-http") fail(`mcp.json: ${name} type must be streamable-http`); + if (server.headers && Object.keys(server.headers).length) fail(`.mcp.json: ${name} has headers (public submission rejects them)`); +} +for (const name of Object.keys(portableServers)) if (!dotServers[name]) fail(`.mcp.json: missing server ${name} that mcp.json declares`); +if (codex.mcpServers !== "./.mcp.json") fail(`.codex-plugin/plugin.json: mcpServers should be ./.mcp.json`); +const mcpUrl = Object.values(dotServers)[0]?.url; + +// OpenAI listing limits (developers.openai.com/plugins/deploy/submission). +const hex = /^#[0-9A-Fa-f]{6}$/; +const checkInterface = (where, i) => { + if (!i) return fail(`${where}: interface missing`); + for (const key of ["displayName", "shortDescription", "longDescription", "developerName", "category", "websiteURL", "supportURL", "privacyPolicyURL", "termsOfServiceURL", "composerIcon", "logo"]) { + if (!i[key]) fail(`${where}: interface.${key} missing`); + } + if ((i.displayName ?? "").length > 30) fail(`${where}: displayName over 30 characters`); + if ((i.shortDescription ?? "").length > 30) fail(`${where}: shortDescription over 30 characters`); + if ((i.longDescription ?? "").length > 4000) fail(`${where}: longDescription over 4000 characters`); + if ((i.developerName ?? "").length > 80) fail(`${where}: developerName over 80 characters`); + for (const key of ["websiteURL", "supportURL", "privacyPolicyURL", "termsOfServiceURL"]) { + if (i[key] && !i[key].startsWith("https://")) fail(`${where}: ${key} must be https`); + } + for (const key of ["brandColor", "brandColorDark"]) if (i[key] && !hex.test(i[key])) fail(`${where}: ${key} must be #RRGGBB`); + const prompts = i.defaultPrompt ?? []; + if (prompts.length > 3) fail(`${where}: more than 3 defaultPrompt entries`); + for (const p of prompts) if (p.length > 128) fail(`${where}: defaultPrompt over 128 characters: ${p}`); + for (const key of ["composerIcon", "logo", "composerIconDark", "logoDark"]) { + const p = i[key]; + if (!p) continue; + if (!p.startsWith("./") || p.includes("..")) fail(`${where}: ${key} must start with ./ and stay in the plugin`); + else if (!existsSync(join(root, p))) fail(`${where}: ${key} ${p} does not exist`); + } +}; +const openai = portable.extensions?.["com.openai"] ?? {}; +checkInterface("plugin.json extensions.com.openai", openai.interface); +checkInterface(".codex-plugin/plugin.json", codex.interface); +if (JSON.stringify(openai.interface) !== JSON.stringify(codex.interface)) fail("plugin.json and .codex-plugin/plugin.json interfaces differ"); +if (openai.onboardingSkill && !existsSync(join(root, openai.onboardingSkill))) { + console.warn(`warning: onboardingSkill ${openai.onboardingSkill} does not exist yet`); +} + +// Marketplaces list this plugin from the repo root. +const agentsEntry = agentsMarket.plugins?.find((p) => p.name === claude.name); +if (!agentsEntry) fail(".agents/plugins/marketplace.json: plugin entry missing"); +else if (agentsEntry.source?.path !== "./" && agentsEntry.source !== "./") fail(".agents/plugins/marketplace.json: source should be the repo root"); +if (!claudeMarket.plugins?.some((p) => p.name === claude.name && p.source === "./")) fail(".claude-plugin/marketplace.json: plugin entry missing"); + +// Every skill: client-neutral SKILL.md frontmatter and an agents/openai.yaml. +const skillsDir = join(root, "skills"); +for (const skill of readdirSync(skillsDir)) { + const dir = join(skillsDir, skill); + if (!statSync(dir).isDirectory()) continue; + const where = `skills/${skill}`; + const skillMd = join(dir, "SKILL.md"); + if (!existsSync(skillMd)) { + fail(`${where}: SKILL.md missing`); + } else { + const front = readFileSync(skillMd, "utf8").match(/^---\n([\s\S]*?)\n---/); + if (!front) fail(`${where}/SKILL.md: frontmatter missing`); + else { + const keys = front[1].split("\n").filter((l) => /^[A-Za-z_-]+:/.test(l)).map((l) => l.split(":")[0]); + for (const k of keys) if (!["name", "description"].includes(k)) fail(`${where}/SKILL.md: frontmatter key ${k} (keep skills client-neutral: name + description only)`); + const name = front[1].match(/^name:\s*(.+)$/m)?.[1]?.trim().replace(/^["']|["']$/g, ""); + if (name !== skill) fail(`${where}/SKILL.md: name ${name} != folder ${skill}`); + } + } + const yamlPath = join(dir, "agents", "openai.yaml"); + if (!existsSync(yamlPath)) { + fail(`${where}: agents/openai.yaml missing`); + continue; + } + const yaml = readFileSync(yamlPath, "utf8"); + if (/\t/.test(yaml)) fail(`${where}/agents/openai.yaml: tabs are not valid YAML indentation`); + for (const key of ["interface:", "display_name:", "short_description:"]) { + if (!yaml.includes(key)) fail(`${where}/agents/openai.yaml: ${key} missing`); + } + const color = yaml.match(/brand_color:\s*"([^"]*)"/)?.[1]; + if (color && !hex.test(color)) fail(`${where}/agents/openai.yaml: brand_color ${color} is not #RRGGBB`); + const url = yaml.match(/url:\s*"([^"]*)"/)?.[1]; + if (url && url !== mcpUrl) fail(`${where}/agents/openai.yaml: url ${url} != ${mcpUrl}`); +} + +for (const e of errors) console.error(`error: ${e}`); +console.log(errors.length ? `${errors.length} manifest error(s)` : `manifests consistent (version ${version})`); +process.exit(errors.length ? 1 : 0); diff --git a/scripts/check-tool-names.mjs b/scripts/check-tool-names.mjs new file mode 100644 index 0000000..09bc20d --- /dev/null +++ b/scripts/check-tool-names.mjs @@ -0,0 +1,95 @@ +#!/usr/bin/env node +// Drift check: every Pricemind tool a skill names must exist. +// +// node scripts/check-tool-names.mjs # against tools.lock.json +// PRICEMIND_MCP_TOKEN=... node scripts/check-tool-names.mjs +// # also against live tools/list +// +// Fails when a skill names a tool that is not in the lock (or not live), or +// names one of the removed legacy tools. Prefixed identifiers that do not look +// like tools (error codes such as pricing_strategy_feature_disabled) only warn +// unless listed in tools.lock.json `nonTools`. Warns when the lock and the +// live server disagree. No dependencies. + +import { readFileSync, readdirSync, statSync } from "node:fs"; +import { join, relative } from "node:path"; +import { fileURLToPath } from "node:url"; +import { listLiveTools, DEFAULT_SERVER } from "./lib/mcp-tools.mjs"; + +const root = fileURLToPath(new URL("..", import.meta.url)); +const lock = JSON.parse(readFileSync(join(root, "tools.lock.json"), "utf8")); +const known = new Set(lock.tools); +const legacy = new Set(lock.legacy ?? []); +// Identifiers with a tool prefix that are not tools (error codes, fields). +const nonTools = new Set(lock.nonTools ?? []); +const PREFIXES = ["product_discovery", "pricing_strategy", "matching", "search", "crawl", "pricemind"]; +// Second word of every tool name ("matching_execute_...", "search_query"). +const TOOL_VERBS = new Set(["get", "list", "query", "preview", "execute", "start", "stop", "create", "update", "add", "link", "remove", "attach", "detach", "explain", "analyze", "match", "unmatch", "search"]); +const looksLikeTool = (name) => { + const prefix = PREFIXES.find((p) => name.startsWith(p + "_")); + return TOOL_VERBS.has(name.slice(prefix.length + 1).split("_")[0]); +}; + +// Tool names start with one of the server's tool-group prefixes. +const TOOL_NAME = /\b(?:search|matching|product_discovery|pricing_strategy|crawl|pricemind)_[a-z0-9_]*[a-z0-9]\b/g; + +function* markdownFiles(dir) { + for (const entry of readdirSync(dir)) { + const path = join(dir, entry); + if (statSync(path).isDirectory()) yield* markdownFiles(path); + else if (entry.endsWith(".md")) yield path; + } +} + +// name -> list of "file:line" +const referenced = new Map(); +for (const file of markdownFiles(join(root, "skills"))) { + readFileSync(file, "utf8") + .split("\n") + .forEach((line, i) => { + // Strip client prefixes such as `mcp__plugin_pricemind_pricemind__` so + // permission entries are checked like bare tool names. + const bare = line.replace(/mcp__[a-z0-9_]*?__(?=[a-z])/g, " "); + for (const [name] of bare.matchAll(TOOL_NAME)) { + const where = `${relative(root, file)}:${i + 1}`; + if (!referenced.has(name)) referenced.set(name, []); + referenced.get(name).push(where); + } + }); +} + +const errors = []; +const warnings = []; + +for (const [name, places] of [...referenced].sort()) { + if (legacy.has(name)) { + errors.push(`legacy tool ${name} (removed from the server) at ${places.join(", ")}`); + } else if (!known.has(name) && !nonTools.has(name)) { + const msg = `unknown tool ${name} at ${places.join(", ")} (fix the name, or add it to nonTools in tools.lock.json if it is an error code or field)`; + if (looksLikeTool(name)) errors.push(msg); + else warnings.push(msg); + } +} + +const credential = process.env.PRICEMIND_MCP_TOKEN; +if (credential) { + const url = process.env.PRICEMIND_MCP_URL || lock.server || DEFAULT_SERVER; + const live = new Set(await listLiveTools(credential, url)); + for (const [name, places] of referenced) { + if (known.has(name) && !live.has(name) && !(lock.principalSpecific ?? []).includes(name)) { + errors.push(`tool ${name} is in tools.lock.json but not on ${url} at ${places.join(", ")}`); + } + } + // Principal-specific tools (staff vs account) legitimately differ; only warn. + for (const name of known) if (!live.has(name)) warnings.push(`lock has ${name}; this connection's tools/list does not`); + for (const name of live) if (!known.has(name) && !legacy.has(name)) warnings.push(`server has ${name}; tools.lock.json does not (run scripts/update-tools-lock.mjs)`); + for (const name of legacy) if (live.has(name)) warnings.push(`legacy tool ${name} is still live on ${url}`); + console.log(`checked against live tools/list (${live.size} tools)`); +} else { + console.log("PRICEMIND_MCP_TOKEN not set: checked against tools.lock.json only"); +} + +for (const w of warnings) console.warn(`warning: ${w}`); +for (const e of errors) console.error(`error: ${e}`); +console.log(`${referenced.size} tool names referenced in skills, ${known.size} in the lock, ${errors.length} error(s)`); +process.exit(errors.length ? 1 : 0); diff --git a/scripts/lib/mcp-tools.mjs b/scripts/lib/mcp-tools.mjs new file mode 100644 index 0000000..2be39d1 --- /dev/null +++ b/scripts/lib/mcp-tools.mjs @@ -0,0 +1,66 @@ +// Minimal MCP client (streamable HTTP, JSON-RPC) that lists the tools a +// Pricemind connection can see. No dependencies; Node 20+ (global fetch). + +export const DEFAULT_SERVER = "https://mcp.pricemind.io/mcp"; + +async function rpc(url, credential, sessionId, body) { + const headers = { + "content-type": "application/json", + accept: "application/json, text/event-stream", + authorization: `Bearer ${credential}`, + "mcp-protocol-version": "2025-06-18", + }; + if (sessionId) headers["mcp-session-id"] = sessionId; + const res = await fetch(url, { method: "POST", headers, body: JSON.stringify(body) }); + if (!res.ok && res.status !== 202) { + throw new Error(`${body.method}: HTTP ${res.status} ${(await res.text()).slice(0, 300)}`); + } + const session = res.headers.get("mcp-session-id") ?? sessionId; + if (body.id === undefined) return { session, message: null }; + const text = await res.text(); + const type = res.headers.get("content-type") ?? ""; + let message = null; + if (type.includes("text/event-stream")) { + // Take the JSON-RPC response with our id from the SSE stream. + for (const line of text.split(/\r?\n/)) { + if (!line.startsWith("data:")) continue; + const parsed = JSON.parse(line.slice(5).trim()); + if (parsed.id === body.id) message = parsed; + } + } else { + message = JSON.parse(text); + } + if (!message) throw new Error(`${body.method}: no response in stream`); + if (message.error) throw new Error(`${body.method}: ${JSON.stringify(message.error)}`); + return { session, message }; +} + +/** Returns the sorted tool names from tools/list, following pagination. */ +export async function listLiveTools(credential, url = DEFAULT_SERVER) { + const init = await rpc(url, credential, null, { + jsonrpc: "2.0", + id: 1, + method: "initialize", + params: { + protocolVersion: "2025-06-18", + capabilities: {}, + clientInfo: { name: "agent-plugins-ci", version: "1.0.0" }, + }, + }); + const session = init.session; + await rpc(url, credential, session, { jsonrpc: "2.0", method: "notifications/initialized" }); + const names = []; + let cursor; + let id = 2; + do { + const { message } = await rpc(url, credential, session, { + jsonrpc: "2.0", + id: id++, + method: "tools/list", + params: cursor ? { cursor } : {}, + }); + for (const tool of message.result.tools ?? []) names.push(tool.name); + cursor = message.result.nextCursor; + } while (cursor); + return [...new Set(names)].sort(); +} diff --git a/scripts/sync-chart.sh b/scripts/sync-chart.sh new file mode 100755 index 0000000..f15cc4a --- /dev/null +++ b/scripts/sync-chart.sh @@ -0,0 +1,36 @@ +#!/usr/bin/env bash +# Copies the Pricemind chart renderer from a checkout of the Pricemind MCP +# server into the price-intelligence skill. The server's ui/chart.html is the +# single source (it is also the MCP App ui://pricemind/chart); never edit the +# copy here. +# +# Usage: scripts/sync-chart.sh /path/to/mcp-server-checkout [--check] +# --check exit 1 when the copy differs from the source instead of copying. +set -euo pipefail + +if [[ $# -lt 1 ]]; then + echo "usage: $0 /path/to/mcp-server-checkout [--check]" >&2 + exit 2 +fi + +source_file="$1/internal/mcpserver/ui/chart.html" +repo_root="$(cd "$(dirname "$0")/.." && pwd)" +target_file="$repo_root/skills/price-intelligence/assets/chart.html" + +if [[ ! -f "$source_file" ]]; then + echo "not found: $source_file" >&2 + exit 2 +fi + +if [[ "${2:-}" == "--check" ]]; then + if cmp -s "$source_file" "$target_file"; then + echo "chart.html is in sync" + exit 0 + fi + echo "chart.html differs from $source_file; run scripts/sync-chart.sh $1" >&2 + exit 1 +fi + +cp "$source_file" "$target_file" +size=$(wc -c < "$target_file" | tr -d ' ') +echo "copied chart.html ($size bytes) from $source_file" diff --git a/scripts/update-tools-lock.mjs b/scripts/update-tools-lock.mjs new file mode 100644 index 0000000..3a56189 --- /dev/null +++ b/scripts/update-tools-lock.mjs @@ -0,0 +1,44 @@ +#!/usr/bin/env node +// Refresh tools.lock.json from the live server. +// +// PRICEMIND_MCP_TOKEN=... node scripts/update-tools-lock.mjs [--merge] +// +// Without --merge the lock becomes exactly this connection's tools/list. +// Use --merge to keep names the connection cannot see (for example +// staff-only tools when refreshing with an account-scoped token). +// Legacy names are never written into `tools`. + +import { readFileSync, writeFileSync } from "node:fs"; +import { join } from "node:path"; +import { fileURLToPath } from "node:url"; +import { listLiveTools, DEFAULT_SERVER } from "./lib/mcp-tools.mjs"; + +const credential = process.env.PRICEMIND_MCP_TOKEN; +if (!credential) { + console.error("Set PRICEMIND_MCP_TOKEN to a Pricemind MCP access token."); + process.exit(2); +} + +const path = join(fileURLToPath(new URL("..", import.meta.url)), "tools.lock.json"); +const lock = JSON.parse(readFileSync(path, "utf8")); +const url = process.env.PRICEMIND_MCP_URL || lock.server || DEFAULT_SERVER; +const live = await listLiveTools(credential, url); +const legacy = new Set(lock.legacy ?? []); + +const next = new Set(live.filter((name) => !legacy.has(name))); +if (process.argv.includes("--merge")) for (const name of lock.tools) next.add(name); + +const before = new Set(lock.tools); +const added = [...next].filter((n) => !before.has(n)); +const removed = [...before].filter((n) => !next.has(n)); + +lock.tools = [...next].sort(); +lock.updated = new Date().toISOString().slice(0, 10); +lock.source = `tools/list from ${url}${process.argv.includes("--merge") ? " merged with the previous lock" : ""}`; +writeFileSync(path, JSON.stringify(lock, null, 2) + "\n"); + +console.log(`tools.lock.json: ${lock.tools.length} tools (+${added.length} -${removed.length})`); +for (const n of added) console.log(` + ${n}`); +for (const n of removed) console.log(` - ${n}`); +const stillLive = live.filter((n) => legacy.has(n)); +if (stillLive.length) console.warn(`legacy tools still live: ${stillLive.join(", ")}`); diff --git a/skills/competitor-alternatives/SKILL.md b/skills/competitor-alternatives/SKILL.md index 210db37..8a9578e 100644 --- a/skills/competitor-alternatives/SKILL.md +++ b/skills/competitor-alternatives/SKILL.md @@ -1,13 +1,24 @@ --- name: competitor-alternatives -description: Research comparable competitor models for one of the user's products (substitutes and analogs from other brands, not the identical product), record each real model in Pricemind as a comparison product under the user's product, and attach already-tracked retailer offers of those models. Use for "what are the alternatives to X", competitor-brand discovery, building product groups or comparing cross-brand price positioning in Pricemind. +description: Research comparable competitor models for one of the user's products (substitutes and analogs from other brands, not the identical product), record each real model in Pricemind as a comparison product under the user's product, and attach already-tracked retailer offers of those models. Use for "what are the alternatives to X", competitor-brand discovery, or building and maintaining product groups in Pricemind. --- # Competitor alternatives (cross-vendor comparables) Two products are *comparable* when a shopper would choose between them, for example two 2 L stand mixers from different brands with similar specs. A comparable is **not** the same product, so never record it as a match. Pricemind stores each real comparable model as a *comparison product definition* placed beneath the user's own product. Grouped Prices views can show it even before any retailer offer is attached. -## Hard rules +## How changes work: ask once per job, never per step + +| What | Examples | What you do | +| -- | -- | -- | +| Research and reads | context, groups, web research | Never ask. Research requests stay research: nothing is saved. | +| Add | add or link a comparable, attach a tracked offer, fix a comparable's details | When the user asked for that outcome ("add the alternatives", "build the group"), do it, then report what changed and how to undo it. | +| Remove | detach an offer, remove a comparable | Show the whole plan once and ask one question. After the yes, run it all without asking again. | +| The server returns `decision_required` | changed identity or version, material warning | The only mid-job stop. Explain, ask once, continue. | + +Stay within the scope the user gave (that product, those brands). Never widen it on your own. + +## Facts and identity rules - Base every decision on verified facts: specs from the manufacturer or reputable retailer pages, with the source URL recorded as `research_evidence`. - Create one definition per real model. Never create one per listing, search result or brand family. @@ -15,7 +26,6 @@ Two products are *comparable* when a shopper would choose between them, for exam - If the exact model already exists at account level, call `product_discovery_link_existing_comparable` with its `comparison_product_definition_id` as `definition_id`. - Never create an enriched duplicate. - When a source has a stable HTTP(S) product image, record it as `image_url`. -- Research and review requests stay read-only. Create, link, attach or remove only what the user explicitly asked for, within that scope. Use preview tools to show the effect first when the user is reviewing. ## Workflow @@ -24,25 +34,35 @@ Two products are *comparable* when a shopper would choose between them, for exam - the user's product (`product_domain_id`, or a title or code to resolve); - the market or locale; - an optional allow-list of competitor brands; - - whether the user wants research only or persistence. + - whether the user wants research only or wants the result saved in Pricemind. + + Ask only for what you cannot infer, in one question. 2. **Context.** `product_discovery_get_context` shows the product and the existing comparables and groups. `product_discovery_get_group` shows the current group. 3. **Research.** - Use your web search and fetch tools to find the 3–8 strongest comparable models. - For each, note: brand, exact model name and code, key specs that make it comparable, typical price, source URLs and an image URL. - Drop anything you cannot verify. -4. **Propose.** Show a table of the proposed comparables with the evidence and how close each one is. Ask for confirmation unless the user already authorized creation. -5. **Persist** (when authorized): +4. **Show.** A table of the comparables with the evidence and how close each one is. If the user asked for research only, stop here. +5. **Save** (when the user asked for it): - New model: `product_discovery_add_comparable`, with `research_evidence` and `image_url`. - Existing model: `product_discovery_link_existing_comparable`. - Fix details: `product_discovery_update_comparable`. - - Remove: preview with `product_discovery_preview_remove_comparable`, then call `product_discovery_execute_remove_comparable`. -6. **Attach tracked offers** of a comparable model that Pricemind already loads from retailers: - - Use direct mode: `product_discovery_preview_attach` with `group_id`, `definition_id`, `product_domain_id` and a concrete exact-identity reason, then `product_discovery_execute_attach` with a stable `idempotency_key`. +6. **Attach tracked offers** of a comparable model that Pricemind already loads from retailers (direct mode): + - One offer: `product_discovery_execute_attach` with `intent` = `channel_id`, `group_id`, `definition_id`, `product_domain_id` and a concrete exact-identity `reason`. + - Several offers: `product_discovery_execute_attach_batch` with `intent` = `channel_id` plus `items` (1 to 25, each with `group_id`, `definition_id`, `product_domain_id` and `reason`); split longer lists into several calls. + - Pass a stable `idempotency_key` with every call and reuse it on retries. - Candidate mode (`identity_id` + `discovery_run_id`, `discovery_item_id`, `candidate_id`) is a different flow. Never mix the two. - Do not use normal matching here: matching links retailer listings to the user's own product, not to a comparable. -7. **Report.** List what was created, linked and attached, and what was skipped and why. +7. **Remove** (one approval for the whole plan): + - detach offers: `product_discovery_execute_detach` for one (`channel_id`, `identity_id`, `observation_id`), or `product_discovery_execute_detach_batch` for several (`channel_id` plus `items`, 1 to 25, each with `identity_id` and `observation_id`); the ids come from `product_discovery_get_group`; + - remove a comparable from the group: `product_discovery_execute_remove_comparable` with `group_id` and `definition_id`. +8. **Report.** One summary: what was created, linked, attached, detached or removed, what was skipped and why, and how to undo it: + - an attach is undone with a detach of the same offer, a detach with an attach; + - an added or linked comparable is undone with `product_discovery_execute_remove_comparable`, and a removed one can be linked again with `product_discovery_link_existing_comparable`. + +The preview tools (`product_discovery_preview_attach`, `product_discovery_preview_detach`, `product_discovery_preview_remove_comparable`) are for review-only requests. Do not call them as an extra step before a job the user already asked for. ## Retailer coverage runs - `product_discovery_start`, `product_discovery_list_runs`, `product_discovery_get_run`, `product_discovery_list_items` and `product_discovery_list_candidates` run a different pipeline. It finds more retailer listings of the *same* product, not alternatives from other brands. -- Use it only when the user asks to find more shops selling their product. Never describe it as cross-brand research. +- Use it when the user asks to find more shops selling their product; start it without asking again and report the run. Never describe it as cross-brand research. diff --git a/skills/competitor-alternatives/agents/openai.yaml b/skills/competitor-alternatives/agents/openai.yaml new file mode 100644 index 0000000..098a90f --- /dev/null +++ b/skills/competitor-alternatives/agents/openai.yaml @@ -0,0 +1,14 @@ +interface: + display_name: "Competitor alternatives" + short_description: "Research comparable products from other brands" + brand_color: "#5B2D92" + default_prompt: "Use $competitor-alternatives to find comparable models from other brands for this product." +policy: + allow_implicit_invocation: true +dependencies: + tools: + - type: "mcp" + value: "pricemind" + description: "Pricemind MCP server (sign in with your Pricemind account)" + transport: "streamable_http" + url: "https://mcp.pricemind.io/mcp" diff --git a/skills/management-report/SKILL.md b/skills/management-report/SKILL.md new file mode 100644 index 0000000..1e956e0 --- /dev/null +++ b/skills/management-report/SKILL.md @@ -0,0 +1,44 @@ +--- +name: management-report +description: Period-over-period pricing review for management from Pricemind data - price index against the market, share of products at or below market, price position by brand or category and competitor (heatmap), and competitor price activity, in a fixed report structure with charts. Use when the user asks for a management report, a quarterly or monthly pricing review, a board or leadership update, "prepare the Q2 pricing review", or how our price position changed between two periods. +--- + +# Management pricing report + +A fixed, read-only report that compares two periods for one channel and is ready to present. Use `search_get_schema` and `search_query` only. Never guess numbers. + +Definitions: [references/kpi-glossary.md](references/kpi-glossary.md). Output shape: [references/report-template.md](references/report-template.md). Query shapes: [references/queries.md](references/queries.md). + +## Before you start + +- Reads never need approval. Run every query in this workflow without asking. +- **Channel:** if the user named one, use it. Otherwise call `pricemind_list_channels`: one channel → use it without asking; several → ask once which one and keep it for the rest of the conversation. Pricemind staff connected with "All accounts" start with `pricemind_search_accounts`, then `pricemind_list_account_channels`. +- Call `search_get_schema` once for the channel and cache it by `version`. Use only fields and competitor keys it returns. Note `channel_type`, `price_basis`, and whether competitor fields are present (they need `competitor_prices:read`; without them say so and report only own-price figures). +- **Periods:** take them from the user ("Q2" = 1 April – 30 June of the current year, "last month", explicit dates). Default: the last full calendar quarter against the quarter before. Compare equal-length periods. History datasets cover at most 400 days. + +## Steps + +1. **Price index trend.** If the channel has tier analytics (`tier_analytics_daily` returns rows), chart the index over both periods: group by `snapshot_date:week` with `avg` of `price_index`, and per period the share of products with `price_index ≤ 100`. If it returns nothing, the channel has no index history: say so plainly, and give the **current** index vs the cheapest competitor from `products` (sum of `price` ÷ sum of `lowest_competitor_price` × 100) and the current share with `price_diff ≥ 0`. Never present a snapshot as a trend. +2. **Competitor activity.** `price_changes` for each period, competitor rows only, grouped by `shop` and `direction`: count of cuts and increases per competitor and the ratio between periods ("2.1× Q1"). Name the two or three competitors that lead it. +3. **Position by brand or category × competitor (heatmap).** `offers` on my enabled products with a fresh, in-stock price, grouped by `own_brand` (or `categories` when the user thinks in categories, or when the channel has no brands) and `competitor`, with `avg` of `price_vs_own_pct` and a `count`; keep groups with at least 20 offers (`having`). Limit to the 10 largest brands or categories and the channel's main competitors. This is the current position; say so. +4. **Own price moves.** `price_changes` with `is_own` true per period: how often and in which direction we changed prices, so the reader sees whether the index moved because of us or the market. +5. **Write it up** with the template: KPI tiles, the charts, a short "what changed and why", and up to three recommendations. + +## Charts + +1. If your client shows Pricemind's interactive chart view for a `search_query` result, that view is the chart. Do not draw another one; add the written summary. +2. Otherwise use the chart template shipped with the price-intelligence skill: [../price-intelligence/assets/chart.html](../price-intelligence/assets/chart.html). Copy it, replace the JSON inside ` + ``` -- Lead with the answer in one or two sentences, then a compact table (at most about 15 rows), then caveats. -- When `search_query` returns a `visual` hint and the client can draw charts, draw exactly that chart from `data.rows`, following the hint's chart kind, colours, muted shops and notes, and add a short written summary. + Then open the file or publish it as a page, whichever the client supports. Keep the hint as returned: it already carries the Pricemind colours, the own-shop highlight and the muted shops. The workflow skills change it only where they say so (for example switching a grouped bar to a heatmap). +3. **The client cannot show HTML at all.** Give the table and the written summary only. + +## 5. Answer + +- Lead with the answer in one or two sentences, then the chart, then a compact table (at most about 15 rows), then caveats. - Be honest about coverage: unmatched products, out-of-stock offers, stale observation dates and price basis. Large jumps (for example 90% down) may be pack-size or mismatched offers; flag them instead of reporting them as market moves. - Never show more than the user asked for, and never expose another account's data. +## Refreshing data + +When the user asks to refresh prices, start the crawl without asking again: `crawl_list_targets`, then `crawl_start`, then report progress with `crawl_get`. A crawl only adds fresh observations; nothing needs undoing. + ## Out of scope - Fixing wrong competitor matches: use the `matching-review` skill. - Changing repricing rules: use the `pricing-strategies` skill. -- Starting new crawls: only when the user explicitly asks to refresh data. Use `crawl_list_targets`, then `crawl_start`, and report progress with `crawl_get`. diff --git a/skills/price-intelligence/agents/openai.yaml b/skills/price-intelligence/agents/openai.yaml new file mode 100644 index 0000000..6873b28 --- /dev/null +++ b/skills/price-intelligence/agents/openai.yaml @@ -0,0 +1,14 @@ +interface: + display_name: "Price intelligence" + short_description: "Answer price and competitor questions with charts" + brand_color: "#5B2D92" + default_prompt: "Use $price-intelligence to show where my prices sit against competitors." +policy: + allow_implicit_invocation: true +dependencies: + tools: + - type: "mcp" + value: "pricemind" + description: "Pricemind MCP server (sign in with your Pricemind account)" + transport: "streamable_http" + url: "https://mcp.pricemind.io/mcp" diff --git a/skills/price-intelligence/assets/README.md b/skills/price-intelligence/assets/README.md new file mode 100644 index 0000000..3c0590f --- /dev/null +++ b/skills/price-intelligence/assets/README.md @@ -0,0 +1,42 @@ +# Pricemind chart template + +`chart.html` draws a Pricemind chart from a `search_query` result in the Pricemind chart style, light and dark, with no libraries and no network access. It is the fallback for clients that cannot show the Pricemind chart view (the MCP App `ui://pricemind/chart`), such as Claude Code in a terminal or Codex CLI. Both draw from the same file, so the chart looks the same everywhere. + +Do not edit it here. The source is the Pricemind MCP server, which serves the same file as its chart view; `scripts/sync-chart.sh` copies it from a server checkout. + +## Use + +1. Copy `chart.html` to a new file. +2. Replace `null` inside `` with one JSON object (below). Escape ` + + + + + + +Pricemind chart + + + +
+ + + + diff --git a/skills/pricing-strategies/SKILL.md b/skills/pricing-strategies/SKILL.md index 37f735d..6aae6f0 100644 --- a/skills/pricing-strategies/SKILL.md +++ b/skills/pricing-strategies/SKILL.md @@ -1,31 +1,35 @@ --- name: pricing-strategies -description: Inspect, explain, draft and safely change competitive pricing strategies (repricing rules) for a Pricemind channel - for example "match the cheapest competitor but never below cost plus 10%" or "stay 2% under Shop X for brand Y". Use when the user asks how their repricing works, wants a new pricing rule, or wants to change an existing one. +description: Inspect, explain, draft and change competitive pricing strategies (repricing rules) for a Pricemind channel - for example "match the cheapest competitor but never below cost plus 10%" or "stay 2% under Shop X for brand Y". Use when the user asks how their repricing works, wants a new pricing rule, or wants to change an existing one. --- # Pricing strategies in Pricemind -A pricing strategy is a typed rule that turns competitor prices into a recommended or applied price for products in one channel. Changes can move real shelf prices, so be precise and always preview. +A pricing strategy is a typed rule that turns competitor prices into a recommended or applied price for products in one channel. Creating or changing one can move real shelf prices. -## Hard rules +## How changes work: one approval per job + +- **Reading and explaining** strategies never needs a question. +- **Creating or changing** a strategy moves prices, so show the plan once: the affected products (count and a few examples), the old and new rule, the expected price moves and any warnings. Ask one question. After the yes, execute and report; do not ask again for the same job. +- If the user already approved an exact change in their request ("create this rule: ..."), the plan is the approval: execute, then report. +- **The server returns `decision_required`** (version conflict, scope expansion, material warning): the only mid-job stop. Explain the reason, ask once, continue with the answer. +- A read-only connection cannot change strategies. Tell the user to reconnect with "Read and make changes". + +## Rules - Work in exactly one `channel_id`. - Start with `pricing_strategy_get_context`. Call `pricing_strategy_get_schema` only when its version is new to you, and build drafts strictly from that schema. - Never send `enabled`, `priority`, raw `rule_logic`, account scope or any provider secrets. Those stay with the user in the Pricemind app. -- Before an update, read the exact current strategy with `pricing_strategy_get`, so the draft starts from its current version. -- Preview first: - - new strategy: `pricing_strategy_preview_create`; - - change: `pricing_strategy_preview_update`. - - Show the user the preview: which products are affected, the old and new rule, and warnings. Then execute the approved draft with `pricing_strategy_execute_create` or `pricing_strategy_execute_update`, using the preparation token. -- Stop and report on a version conflict, missing permissions, a scope expansion or an unacknowledged material warning. Re-prepare an expired token only within the same approved scope. -- A read-only connection cannot change strategies. Tell the user to reconnect with "Read and make changes". +- Before an update, read the exact current strategy with `pricing_strategy_get`, so the draft starts from its current version. Keep that version: it is the undo. ## Workflow 1. **Understand.** `pricing_strategy_list` shows the channel's strategies. Explain them in plain language: which products, which competitors, which target position, which limits (floor and ceiling, cost or margin guards, rounding). -2. **Draft.** Turn the user's goal into the schema's fields. Ask only about decisions the schema needs and the user has not given, such as the floor price basis or rounding. -3. **Check impact.** Optionally use the `price-intelligence` skill (`search_query`) to show how many products would move and roughly by how much. -4. **Preview, confirm, execute, verify.** After executing, read the strategy back and report its version. +2. **Draft.** Turn the user's goal into the schema's fields. Ask only about decisions the schema needs and the user has not given, such as the floor price basis or rounding. Collect those in the same single question as the approval. +3. **Plan.** Call `pricing_strategy_preview_create` or `pricing_strategy_preview_update` once to get the affected products and warnings for the plan. Optionally use the `price-intelligence` skill (`search_query`) to show how many products would move and roughly by how much. +4. **Execute.** After the approval, call `pricing_strategy_execute_create` or `pricing_strategy_execute_update` with the approved draft as `intent`, a stable `idempotency_key` (reuse it on retries) and `acknowledgements` only for the warnings the user's approval covered. +5. **Report.** Read the strategy back with `pricing_strategy_get` and report its version, what changed and how to undo it: + - an update is undone by applying the previous version's values with `pricing_strategy_execute_update`; + - a new strategy is switched off or removed by the user in the Pricemind app (this connection does not change `enabled`). If pricing strategies are not enabled for the channel (`pricing_strategy_feature_disabled`), say so and point the user to Pricemind support or their account settings. Do not try to work around it. diff --git a/skills/pricing-strategies/agents/openai.yaml b/skills/pricing-strategies/agents/openai.yaml new file mode 100644 index 0000000..299a1ed --- /dev/null +++ b/skills/pricing-strategies/agents/openai.yaml @@ -0,0 +1,14 @@ +interface: + display_name: "Pricing strategies" + short_description: "Inspect, draft and change repricing strategies" + brand_color: "#5B2D92" + default_prompt: "Use $pricing-strategies to explain my repricing strategies and suggest changes." +policy: + allow_implicit_invocation: true +dependencies: + tools: + - type: "mcp" + value: "pricemind" + description: "Pricemind MCP server (sign in with your Pricemind account)" + transport: "streamable_http" + url: "https://mcp.pricemind.io/mcp" diff --git a/skills/promo-watch/SKILL.md b/skills/promo-watch/SKILL.md new file mode 100644 index 0000000..fbc1ce8 --- /dev/null +++ b/skills/promo-watch/SKILL.md @@ -0,0 +1,47 @@ +--- +name: promo-watch +description: Watch for competitor price-cutting campaigns in Pricemind data - which competitors started cutting prices, how deep, since when and in which categories, compared with their normal rhythm, with charts. Use before or during sales events (Black Friday, Cyber Monday, seasonal sales, a competitor's promotion), or when the user asks "have competitors started cutting prices", "who is discounting", "is there a price war", or "which shops are running promotions". +--- + +# Promo watch + +A read-only check for unusual competitor price cutting on one channel: who, how deep, since when and where. Use `search_get_schema` and `search_query` only. Never guess numbers. + +Definitions: [references/kpi-glossary.md](references/kpi-glossary.md). Output shape: [references/report-template.md](references/report-template.md). Query shapes: [references/queries.md](references/queries.md). + +## Before you start + +- Reads never need approval. Run every query in this workflow without asking. +- **Channel:** if the user named one, use it. Otherwise call `pricemind_list_channels`: one channel → use it without asking; several → ask once which one and keep it for the rest of the conversation. Pricemind staff connected with "All accounts" start with `pricemind_search_accounts`, then `pricemind_list_account_channels`. +- Call `search_get_schema` once for the channel and cache it by `version`. Competitor changes need `competitor_prices:read`; without it there is nothing to watch, so say so and stop. +- **Window:** the last 14 days against the 14 days before (the baseline), unless the user names an event or dates. For a named event, also count the days left until it. + +## Steps + +1. **Is something happening?** Count competitor cuts (`price_changes`, `is_own` false, `direction` down) in the window and in the baseline. A cut rate clearly above the baseline (say 1.5× or more) is a campaign signal; if it is not, say so first and keep the rest short. +2. **Cuts per day.** Group the window plus baseline by `changed_at:day`. Point out the day the wave started and any spikes. A spike on one day from one shop is often a catalogue-wide repricing, not a promotion: check step 3. +3. **Who and how deep.** Group the window by `shop` with `count`, `avg` and `min` of `change_pct`. Call a shop **deep** when its average cut is −15% or deeper. Report " of tracked shops are cutting", the deepest average and the biggest volume. +4. **Since when.** For each of the leading shops (up to five), group its cuts by `changed_at:day` and give the first day of the current run. +5. **Where.** Group the window's cuts by `categories` (or `brand` when the channel has no categories) with `count` and `avg` of `change_pct`; name the top three categories per leading shop when the user asks for detail. +6. **What it means for me.** For the leading shops, find my products they now undercut: `offers` with that `competitor`, `is_cheaper_than_own` true, in stock and not stale, sorted by `price_vs_own_pct`. Give the count and the five largest gaps. +7. **Charts:** cuts per day, then cuts by shop. + +## Reading the data honestly + +- Use `price_changes` for "started cutting". `in_promotion` or a special price is not proof of a campaign: shops often show a crossed-out RRP permanently, which Pricemind stores as regular price plus special price. +- Treat cuts beyond about −70% as suspected mismatches or pack-size changes. Exclude them from averages and mention how many you excluded. +- Changes are recorded even while an offer is out of stock: a "cut" on an out-of-stock offer is not a price a shopper can pay. Say so if it matters for a shop. + +## Charts + +1. If your client shows Pricemind's interactive chart view for a `search_query` result, that view is the chart. Do not draw another one; add the written summary. +2. Otherwise use the chart template shipped with the price-intelligence skill: [../price-intelligence/assets/chart.html](../price-intelligence/assets/chart.html). Copy it, replace the JSON inside `