agentleFS
stacklokstacklok/toolhive-studio/.github/copilot-instructions.md

toolhive-studio

Copilot instructions170 starsChanged 5 months agoApache-2.0View on GitHub

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 will be done with @tanstack/react-query & the browser fetch API All data fetching will be centralized in src/common/hooks, e.g.: API responses are mocked using MSW with AutoAPIMock fixtures. See docs/mocks.md for full documentation and…

The file

We split this copilot-instructions.md into the rules it gives an agent

3 rules. About 0 are common, 1 is distinctive, and 2 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈1

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 2

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Before writing any UI code ALWAYS consult the MCP server to get a good understanding of how the library works.

    line 7
  2. Very specific:

    All data fetching will be centralized in src/common/hooks, e.g.:

    line 12
  3. Very specific:

    Use recordRequests() from @/common/mocks/node to assert on API calls

    line 54

≈ “Common” is an estimate: at least 1 in 5 of the 1,644 Copilot instructions files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
copilot-instructions.md

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' })
)

Project structure

Most of the code lives in the src/ folder and looks something like this:

src
+-- app                 # application layer containing:
|   +-- routes          # directory containing application routes / can also be pages
|   +-- app.tsx         # main application component
|   +-- router.tsx      # application router configuration
+-- common              # the common folder contains all common code for the application
    +-- assets          # assets folder can contain all the static files such as images, fonts, etc.
    +-- components      # shared components used across the entire application
    +-- config          # global configurations, exported env variables etc.
    +-- hooks           # shared hooks used across the entire application
    +-- lib             # reusable libraries preconfigured for the application
    +-- testing         # test utilities and mocks
    +-- mocks           # mock service worker route handlers
    +-- types           # shared types used across the application
    +-- utils           # shared utility functions
+-- features            # feature based modules
    +-- {feature_name}  # each feature has its own folder containing all the code related to that feature
        +-- assets      # assets folder can contain all the static files for a specific feature
        +-- components  # components scoped to a specific feature
        +-- hooks       # hooks scoped to a specific feature
        +-- stores      # state stores for a specific feature
        +-- types       # typescript types used within the feature
        +-- utils       # utility functions for a specific feature

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.