Skip to content

Latest commit

 

History

History
95 lines (72 loc) · 1.93 KB

File metadata and controls

95 lines (72 loc) · 1.93 KB

Contributing Guide

Development Workflow

git clone <repo>
cd mcp
npm ci
npm run dev

Adding a New Tool

  1. Create src/tools/new.tools.ts:
export const myTool: Tool = {
  name: 'platformos.my.tool',
  description: 'Does X',
  inputSchema: z.object({ foo: z.string() }),
  handler: async (input) => ({ result: input.foo.toUpperCase() })
};
export const myTools = [myTool];
  1. Register in src/tools/index.ts:
export const allTools = [
  ...environmentTools,
  ...myTools,
  // ...
];
  1. Add tests src/__tests__/my.tools.test.ts
  2. Update TOOLS.md

Developing with Local platformos-tools

When working on @platformos/* packages (linter, LSP, parser, etc.) you can link a local platformos-tools checkout into pos-cli so that changes are picked up immediately without publishing to npm.

Link

# Build platformos-tools first
cd /path/to/platformos-tools
yarn build

# Link all @platformos packages into pos-cli
npm run link:tools -- /path/to/platformos-tools

Unlink

# Restore the npm-published versions
npm run unlink:tools

After linking, both pos-cli check and pos-cli lsp will use your local package code. Remember to rebuild platformos-tools (yarn build) after making changes there.

Pre-commit Hooks

npm run lint
npm run test
npm run build

Release Process

  1. npm version patch/minor/major
  2. npm publish
  3. Update CHANGELOG.md

Code Standards

  • TypeScript strict
  • Zod for all schemas
  • 90%+ test coverage
  • No any types
  • JSDoc for complex functions

Testing Layers

Type Command Purpose
Unit npm test Tool handlers, wrappers
Integration npm test Express endpoints
E2E Manual nock + real flows

Questions? Open an issue!","path":"CONTRIBUTING.md