agentleFS
structured-worldstructured-world/gitlab-mcp/.github/copilot-instructions.md

gitlab-mcp

Copilot instructions8 starsChanged 26 days agoApache-2.0View on GitHub

This is a GitLab MCP (Model Context Protocol) server that provides GitLab API access through standardized MCP tools. The project uses TypeScript, Yarn 4, and follows strict coding standards. ALL commits MUST follow Conventional Commits format: These patterns will FAIL CI validation: For complex changes, use body to explain what and why: - src/entities/ - Entity modules (labels, webhooks, etc.) - src/entities/*/schema.ts - Zod schemas for write operations - src/entities/*/schema-readonly.ts - Zod schemas for read operations -

  • Where files are headingNew Copilot instructions files have more rules about branches and pull requests, and fewer about code style.

    Of the Copilot instructions files we read, the 2,349 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.

  • In this repositoryOne other file it gives its agents.

The file

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

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

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈5

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 1

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Type is REQUIRED: - Never omit the type prefix

    line 33
  2. Very specific:

    ESM imports: - Do NOT use .js extensions in import paths (some legacy files still have .js — new code must use extensionless imports)

    line 79
  3. Distinctive:

    Zod schemas: - All external data validated

    line 80
  4. Distinctive:

    Jest tests: - All features must have tests

    line 82
  5. Distinctive:

    All commits must pass conventional commits validation

    line 110
  6. Distinctive:

    All tests must pass

    line 111

≈ “Common” is an estimate: at least 1 in 5 of the 3,779 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

GitHub Copilot Instructions for gitlab-mcp

Project Overview

This is a GitLab MCP (Model Context Protocol) server that provides GitLab API access through standardized MCP tools. The project uses TypeScript, Yarn 4, and follows strict coding standards.

Commit Message Rules (CRITICAL)

ALL commits MUST follow Conventional Commits format:

<type>(scope): <description>

Required Commit Types

TypeDescriptionVersion Bump
featNew feature or capabilityMinor
fixBug fixPatch
docsDocumentation onlyNone
styleCode style/formattingNone
refactorCode restructuringPatch
perfPerformance improvementPatch
testAdding/fixing testsNone
choreMaintenance tasksNone
ciCI/CD changesNone
buildBuild system changesNone
revertRevert previous commitPatch

Commit Message Guidelines

  1. Type is REQUIRED - Never omit the type prefix
  2. Use imperative mood - "Add feature" not "Added feature"
  3. Keep subject under 72 characters
  4. Do NOT end with period
  5. Scope is optional but recommended - e.g., feat(webhooks):, fix(mrs):

FORBIDDEN Commit Messages

These patterns will FAIL CI validation:

  • Initial plan - Missing type
  • Update file.ts - Missing type
  • WIP - Use wip: type instead
  • Fix stuff - Too vague, needs scope
  • Any message starting with emoji without type

Good Examples

feat(webhooks): add webhook management tools
fix(labels): resolve null pointer in label handler
test(integration): add CRUD lifecycle tests for webhooks
refactor(schemas): extract validation to shared utility
docs(readme): document webhook event types
chore(deps): update dependencies
ci(workflows): add conventional commits validation

Multi-line Commit Messages

For complex changes, use body to explain what and why:

feat(webhooks): add webhook management entity

- Add list_webhooks and manage_webhook tools
- Support project and group scopes
- Include all GitLab webhook event types
- Add comprehensive unit tests

Closes #5

Code Standards

  • TypeScript strict mode - No any types
  • ESM imports - Do NOT use .js extensions in import paths (some legacy files still have .js — new code must use extensionless imports)
  • Zod schemas - All external data validated
  • CQRS pattern - browse_* for queries, manage_* for commands
  • Jest tests - All features must have tests

Testing Conventions

  • Jest mock hoisting is intentional - jest.mock() calls are hoisted above imports by Jest's babel transform. Placing jest.mock('module') after import { thing } from 'module' is standard Jest usage, NOT a bug. Do NOT flag this as "import before mock" or "relies on hoisting" — it is the documented Jest API behavior used across all 148+ test suites in this project
  • jest.fn() for partial Response mocks - Tests mock fetch/enhancedFetch return values with partial objects ({ ok: true, json: jest.fn() }) cast via as jest.Mock. Do NOT flag missing Response properties — this is standard Jest mock pattern
  • undici is mocked via jest.mock('undici') - The project uses undici.fetch() instead of global fetch(). Test mocks replace the undici module, not global.fetch

Build and Test Commands

yarn build      # Compile TypeScript
yarn lint       # Run ESLint
yarn test       # Run all tests
yarn test:cov   # Run tests with coverage

File Organization

  • src/entities/ - Entity modules (labels, webhooks, etc.)
  • src/entities/*/schema.ts - Zod schemas for write operations
  • src/entities/*/schema-readonly.ts - Zod schemas for read operations
  • src/entities/*/registry.ts - Tool handlers
  • tests/unit/ - Unit tests
  • tests/integration/ - Integration tests with real GitLab

Pull Request Guidelines

  1. All commits must pass conventional commits validation
  2. All tests must pass
  3. Coverage must not decrease
  4. Lint must pass with 0 errors

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.