{"owner":"stoplightio","repo":"prism","hasSkills":true,"hasMcp":false,"mcpConfig":null,"found":["CLAUDE.md"],"skills":{"CLAUDE.md":"# CLAUDE.md\n\nThis file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.\n\n## Overview\n\nPrism is an open-source API mocking and contract testing platform supporting OpenAPI v2/v3.0/v3.1 and Postman Collections. It provides a mock server and validation proxy.\n\n## Common Commands\n\n```bash\n# Install dependencies\nnpm ci\n\n# Build (clean + compile TypeScript)\nnpm run build\n\n# Run all tests\nnpm test\n\n# Run tests for a specific package or file\nnpm test -- --testPathPattern=\"core\"\nnpm test -- packages/http/src/__tests__/client.spec.ts\n\n# Lint\nnpm run lint\nnpm run lint.fix\n\n# Run CLI directly during development (from packages/cli)\ncd packages/cli && npm run cli -- mock openapi.yaml\n\n# Debug CLI (attaches Node inspector)\ncd packages/cli && npm run cli:debug -- mock file.oas.yml\n\n# Build binary\nnpm run build.binary\n\n# Integration/harness tests (requires build.binary first)\nnpm run test.harness\n```\n\n## Architecture\n\nThis is a **Lerna monorepo** with npm workspaces. Packages have a strict layering:\n\n```\npackages/\n├── core/         # Base abstractions: routing, validation, mocking contracts\n├── http/         # HTTP-specific: mocker, validator, forwarder, router, negotiator\n├── http-server/  # HTTP server using Micri; wires http/ into a running server\n└── cli/          # CLI entry point using Yargs; commands: mock, proxy\n```\n\n**Data flow**: CLI → HTTP-Server → HTTP (mocker/validator/forwarder/router) → Core\n\n### Key Design Patterns\n\n- **fp-ts throughout**: The codebase uses `Either`, `TaskEither`, `Reader`, and `Option` from fp-ts for error handling and dependency injection. Expect functional-style pipelines via `pipe()`.\n- **IPrismConfig / IHttpConfig**: Central config objects passed as dependencies control behavior (dynamic mocking, validation strictness, proxy mode).\n- **Pino structured logging**: A logger instance is passed as a context through nearly all operations.\n- **Mocker pipeline** (`packages/http/src/mocker/`): Negotiates content type → selects example or generates with `json-schema-faker` → applies callbacks.\n- **Validator pipeline** (`packages/http/src/validator/`): AJV-based validation for request/response bodies, headers, path/query params.\n\n### Important Files\n\n| File                                   | Purpose                                        |\n| -------------------------------------- | ---------------------------------------------- |\n| `packages/core/src/factory.ts`         | Creates Prism instances                        |\n| `packages/http/src/client.ts`          | HTTP client factory                            |\n| `packages/http/src/mocker/index.ts`    | Mock response generation entrypoint            |\n| `packages/http/src/validator/index.ts` | Validation entrypoint                          |\n| `packages/http/src/router/index.ts`    | Matches requests to OpenAPI operations         |\n| `packages/http/src/forwarder/index.ts` | Upstream proxy forwarding                      |\n| `packages/cli/src/commands/`           | `mock` and `proxy` CLI command implementations |\n| `packages/http-server/src/index.ts`    | HTTP server setup                              |\n\n## Testing\n\n- Tests live in `__tests__/` directories alongside source files, named `*.spec.ts` or `*.test.ts`\n- Jest projects are scoped per package: `HTTP-SERVER`, `HTTP`, `CORE`, `CLI`\n- `nock` is used for HTTP mocking in tests\n- Harness tests (`packages/cli/src/__tests__/harness/`) test the compiled binary end-to-end\n\n## Code Style\n\n- Prettier: 120-char line width, single quotes, trailing commas (es5)\n- ESLint with `@typescript-eslint` — `lint-staged` auto-fixes on commit via Husky\n- Arrow functions: omit parens for single parameter\n- TypeScript strict mode; `ttypescript` (ttsc) is used for compilation with custom transformers\n\n## Branch & Release\n\n- Feature branches: `feature/*`, `chore/*`, `fix/*`\n- Releases managed via Lerna (`npm run release`)\n- Node.js minimum: 18.20.1\n"},"files":{"CLAUDE.md":"# CLAUDE.md\n\nThis file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.\n\n## Overview\n\nPrism is an open-source API mocking and contract testing platform supporting OpenAPI v2/v3.0/v3.1 and Postman Collections. It provides a mock server and validation proxy.\n\n## Common Commands\n\n```bash\n# Install dependencies\nnpm ci\n\n# Build (clean + compile TypeScript)\nnpm run build\n\n# Run all tests\nnpm test\n\n# Run tests for a specific package or file\nnpm test -- --testPathPattern=\"core\"\nnpm test -- packages/http/src/__tests__/client.spec.ts\n\n# Lint\nnpm run lint\nnpm run lint.fix\n\n# Run CLI directly during development (from packages/cli)\ncd packages/cli && npm run cli -- mock openapi.yaml\n\n# Debug CLI (attaches Node inspector)\ncd packages/cli && npm run cli:debug -- mock file.oas.yml\n\n# Build binary\nnpm run build.binary\n\n# Integration/harness tests (requires build.binary first)\nnpm run test.harness\n```\n\n## Architecture\n\nThis is a **Lerna monorepo** with npm workspaces. Packages have a strict layering:\n\n```\npackages/\n├── core/         # Base abstractions: routing, validation, mocking contracts\n├── http/         # HTTP-specific: mocker, validator, forwarder, router, negotiator\n├── http-server/  # HTTP server using Micri; wires http/ into a running server\n└── cli/          # CLI entry point using Yargs; commands: mock, proxy\n```\n\n**Data flow**: CLI → HTTP-Server → HTTP (mocker/validator/forwarder/router) → Core\n\n### Key Design Patterns\n\n- **fp-ts throughout**: The codebase uses `Either`, `TaskEither`, `Reader`, and `Option` from fp-ts for error handling and dependency injection. Expect functional-style pipelines via `pipe()`.\n- **IPrismConfig / IHttpConfig**: Central config objects passed as dependencies control behavior (dynamic mocking, validation strictness, proxy mode).\n- **Pino structured logging**: A logger instance is passed as a context through nearly all operations.\n- **Mocker pipeline** (`packages/http/src/mocker/`): Negotiates content type → selects example or generates with `json-schema-faker` → applies callbacks.\n- **Validator pipeline** (`packages/http/src/validator/`): AJV-based validation for request/response bodies, headers, path/query params.\n\n### Important Files\n\n| File                                   | Purpose                                        |\n| -------------------------------------- | ---------------------------------------------- |\n| `packages/core/src/factory.ts`         | Creates Prism instances                        |\n| `packages/http/src/client.ts`          | HTTP client factory                            |\n| `packages/http/src/mocker/index.ts`    | Mock response generation entrypoint            |\n| `packages/http/src/validator/index.ts` | Validation entrypoint                          |\n| `packages/http/src/router/index.ts`    | Matches requests to OpenAPI operations         |\n| `packages/http/src/forwarder/index.ts` | Upstream proxy forwarding                      |\n| `packages/cli/src/commands/`           | `mock` and `proxy` CLI command implementations |\n| `packages/http-server/src/index.ts`    | HTTP server setup                              |\n\n## Testing\n\n- Tests live in `__tests__/` directories alongside source files, named `*.spec.ts` or `*.test.ts`\n- Jest projects are scoped per package: `HTTP-SERVER`, `HTTP`, `CORE`, `CLI`\n- `nock` is used for HTTP mocking in tests\n- Harness tests (`packages/cli/src/__tests__/harness/`) test the compiled binary end-to-end\n\n## Code Style\n\n- Prettier: 120-char line width, single quotes, trailing commas (es5)\n- ESLint with `@typescript-eslint` — `lint-staged` auto-fixes on commit via Husky\n- Arrow functions: omit parens for single parameter\n- TypeScript strict mode; `ttypescript` (ttsc) is used for compilation with custom transformers\n\n## Branch & Release\n\n- Feature branches: `feature/*`, `chore/*`, `fix/*`\n- Releases managed via Lerna (`npm run release`)\n- Node.js minimum: 18.20.1\n"},"items":[{"name":"CLAUDE.md","path":"CLAUDE.md","title":"CLAUDE.md","content":"# CLAUDE.md\n\nThis file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.\n\n## Overview\n\nPrism is an open-source API mocking and contract testing platform supporting OpenAPI v2/v3.0/v3.1 and Postman Collections. It provides a mock server and validation proxy.\n\n## Common Commands\n\n```bash\n# Install dependencies\nnpm ci\n\n# Build (clean + compile TypeScript)\nnpm run build\n\n# Run all tests\nnpm test\n\n# Run tests for a specific package or file\nnpm test -- --testPathPattern=\"core\"\nnpm test -- packages/http/src/__tests__/client.spec.ts\n\n# Lint\nnpm run lint\nnpm run lint.fix\n\n# Run CLI directly during development (from packages/cli)\ncd packages/cli && npm run cli -- mock openapi.yaml\n\n# Debug CLI (attaches Node inspector)\ncd packages/cli && npm run cli:debug -- mock file.oas.yml\n\n# Build binary\nnpm run build.binary\n\n# Integration/harness tests (requires build.binary first)\nnpm run test.harness\n```\n\n## Architecture\n\nThis is a **Lerna monorepo** with npm workspaces. Packages have a strict layering:\n\n```\npackages/\n├── core/         # Base abstractions: routing, validation, mocking contracts\n├── http/         # HTTP-specific: mocker, validator, forwarder, router, negotiator\n├── http-server/  # HTTP server using Micri; wires http/ into a running server\n└── cli/          # CLI entry point using Yargs; commands: mock, proxy\n```\n\n**Data flow**: CLI → HTTP-Server → HTTP (mocker/validator/forwarder/router) → Core\n\n### Key Design Patterns\n\n- **fp-ts throughout**: The codebase uses `Either`, `TaskEither`, `Reader`, and `Option` from fp-ts for error handling and dependency injection. Expect functional-style pipelines via `pipe()`.\n- **IPrismConfig / IHttpConfig**: Central config objects passed as dependencies control behavior (dynamic mocking, validation strictness, proxy mode).\n- **Pino structured logging**: A logger instance is passed as a context through nearly all operations.\n- **Mocker pipeline** (`packages/http/src/mocker/`): Negotiates content type → selects example or generates with `json-schema-faker` → applies callbacks.\n- **Validator pipeline** (`packages/http/src/validator/`): AJV-based validation for request/response bodies, headers, path/query params.\n\n### Important Files\n\n| File                                   | Purpose                                        |\n| -------------------------------------- | ---------------------------------------------- |\n| `packages/core/src/factory.ts`         | Creates Prism instances                        |\n| `packages/http/src/client.ts`          | HTTP client factory                            |\n| `packages/http/src/mocker/index.ts`    | Mock response generation entrypoint            |\n| `packages/http/src/validator/index.ts` | Validation entrypoint                          |\n| `packages/http/src/router/index.ts`    | Matches requests to OpenAPI operations         |\n| `packages/http/src/forwarder/index.ts` | Upstream proxy forwarding                      |\n| `packages/cli/src/commands/`           | `mock` and `proxy` CLI command implementations |\n| `packages/http-server/src/index.ts`    | HTTP server setup                              |\n\n## Testing\n\n- Tests live in `__tests__/` directories alongside source files, named `*.spec.ts` or `*.test.ts`\n- Jest projects are scoped per package: `HTTP-SERVER`, `HTTP`, `CORE`, `CLI`\n- `nock` is used for HTTP mocking in tests\n- Harness tests (`packages/cli/src/__tests__/harness/`) test the compiled binary end-to-end\n\n## Code Style\n\n- Prettier: 120-char line width, single quotes, trailing commas (es5)\n- ESLint with `@typescript-eslint` — `lint-staged` auto-fixes on commit via Husky\n- Arrow functions: omit parens for single parameter\n- TypeScript strict mode; `ttypescript` (ttsc) is used for compilation with custom transformers\n\n## Branch & Release\n\n- Feature branches: `feature/*`, `chore/*`, `fix/*`\n- Releases managed via Lerna (`npm run release`)\n- Node.js minimum: 18.20.1\n","category":"root","tokens":988}]}