toolhive-studio copilot-instructions.md

Coding instructions for ToolHive Studio’s React and TypeScript interface, including its component library, data-fetching approach, file naming rules, and tests.

In plain words
What is it for?
Use it when building UI components, fetching data, naming files, writing Vitest or React Testing Library tests, or deciding where hooks and components belong.
Why use it?
It keeps new interface code consistent with the project’s design system and prevents scattered data access or naming and testing differences.

Instructions file for GitHub Copilot

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add instructions/stacklok/toolhive-studio/copilot-instructions
Clone the repo
git clone --depth 1 https://github.com/stacklok/toolhive-studio

Made for: GitHub Copilot.

Per session 976 This file is loaded in full into every session.
When invoked 976 The same file — it is already loaded in full.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00976 $0.00976
Opus 5 $0.00488 $0.00488
Sonnet 5 $0.00195 $0.00195
Haiku 4.5 $0.00098 $0.00098

Measured 2d ago against content hash 9a6f834b9a32, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

toolhive-studio copilot-instructions.md scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.github/copilot-instructions.md · 109 lines

How it starts

The opening of the file, as written. The whole thing — 109 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Instructions for Copilot

UI components

We will use @ui-kit.ai/components as the UI framework of choice. An MCP server is provided that explains how to use specific components from @ui-kit.ai/components. Before writing any UI code ALWAYS consult the MCP server to get a good understanding of how the library works.

Data fetching

Data fetching will be done with @tanstack/react-query & the browser fetch API All data fetching will be centralized in src/common/hooks, e.g.:

src
+-- common
    +-- hooks
        +-- useGetMcpServers.ts
        +-- useCreateMcpServer.ts

File naming conventions

  • We always use kebab-case for all filenames, never camelCase or PascalCase
  • We name components with the most generic term left to right, e.g.:
    • card-mcp-server-details.tsx for a card component that displays an MCP server
    • table-mcp-servers.tsx for a table component that displays a list of MCP servers
    • select-mcp-servers.tsx for a select component that allows the user to select an MCP server

Testing

  • We use vitest for testing
  • We use @testing-library/react for testing React components
  • Tests are placed in the same folder as the component they are testing, in a directory called __tests__, e.g.:
src
+-- common
    +-- components
        +-- __tests__
            +-- component-a.test.tsx
            +-- component-b.test.tsx
        +-- component-a.ts
        +-- component-b.ts

API Mocking

API responses are mocked using MSW with AutoAPIMock fixtures. See docs/mocks.md for full documentation and renderer/src/common/mocks/ for implementation.

  • Fixtures are in renderer/src/common/mocks/fixtures/ and use named exports
  • Override responses in tests with .override() or .overrideHandler()
  • Overrides reset automatically before each test
  • Use recordRequests() from @/common/mocks/node to assert on API calls
import { mockedGetApiV1BetaGroups } from '@mocks/fixtures/groups/get'
import { recordRequests } from '@/common/mocks/node'
import { HttpResponse } from 'msw'

// Override data (type-safe)
mockedGetApiV1BetaGroups.override(() => ({ groups: [] }))

// Return errors
mockedGetApiV1BetaGroups.overrideHandler(() =>
  HttpResponse.json({ error: 'Server error' }, { status: 500 })
)

// Access default data
const defaultData = mockedGetApiV1BetaGroups.defaultValue

// Record and assert on requests
const rec = recordRequests()
// ... actions ...
expect(rec.recordedRequests).toContainEqual(
  expect.objectContaining({ method: 'POST', pathname: '/api/v1beta/groups' })
)

Read the full file on GitHub · 109 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 109 lines · 976 tokens per session scan A 9a6f834b9a32

Subscribe to this mod's changes

toolhive-studio copilot-instructions.md is an instructions file published in the GitHub repository stacklok/toolhive-studio (163 stars, last pushed 4d ago), licensed Apache-2.0. It adds 976 tokens to every session, about $0.0049 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.