agent-skill-kit 3.9.135
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.agent/global.d.ts +80 -0
- package/.agent/rules/GEMINI.md +210 -0
- package/.agent/rules/autopilot.md +287 -0
- package/.agent/rules/code-rules.md +227 -0
- package/.agent/scripts/audit_workflows.ts +23 -0
- package/.agent/scripts/auto_preview.ts +170 -0
- package/.agent/scripts/checklist.ts +180 -0
- package/.agent/scripts/compile-agents.ts +237 -0
- package/.agent/scripts/fix_skills.ts +49 -0
- package/.agent/scripts/session_manager.ts +222 -0
- package/.agent/scripts/skill-audit.ts +255 -0
- package/.agent/scripts/sync_workflows.ts +54 -0
- package/.agent/scripts/utils/colors.ts +58 -0
- package/.agent/scripts/utils/process-manager.ts +131 -0
- package/.agent/scripts/utils/reporter.ts +192 -0
- package/.agent/scripts/utils/runner.ts +128 -0
- package/.agent/scripts/verify_all.ts +243 -0
- package/.agent/scripts/version-sync.ts +256 -0
- package/.agent/skills/SKILL_INDEX.md +129 -0
- package/.agent/skills/agent-browser/AGENTS.md +728 -0
- package/.agent/skills/agent-browser/SKILL.md +193 -0
- package/.agent/skills/agent-browser/rules/_sections.md +15 -0
- package/.agent/skills/agent-browser/rules/_template.md +32 -0
- package/.agent/skills/agent-browser/rules/engineering-spec.md +528 -0
- package/.agent/skills/agent-browser/scripts/browser_cli.ts +52 -0
- package/.agent/skills/agent-browser/scripts/session_manager.ts +166 -0
- package/.agent/skills/ai-artist/AGENTS.md +1082 -0
- package/.agent/skills/ai-artist/SKILL.md +186 -0
- package/.agent/skills/ai-artist/rules/_sections.md +30 -0
- package/.agent/skills/ai-artist/rules/_template.md +32 -0
- package/.agent/skills/ai-artist/rules/domain-code.md +118 -0
- package/.agent/skills/ai-artist/rules/domain-marketing.md +105 -0
- package/.agent/skills/ai-artist/rules/engineering-spec.md +519 -0
- package/.agent/skills/ai-artist/rules/image-prompts.md +195 -0
- package/.agent/skills/ai-artist/rules/model-syntax.md +115 -0
- package/.agent/skills/ai-artist/scripts/prompt_compiler.ts +72 -0
- package/.agent/skills/ai-artist/templates/image-core.txt +1 -0
- package/.agent/skills/ai-artist/templates/llm-core.txt +6 -0
- package/.agent/skills/api-architect/AGENTS.md +1896 -0
- package/.agent/skills/api-architect/SKILL.md +173 -0
- package/.agent/skills/api-architect/rules/_sections.md +35 -0
- package/.agent/skills/api-architect/rules/_template.md +32 -0
- package/.agent/skills/api-architect/rules/api-style.md +115 -0
- package/.agent/skills/api-architect/rules/auth.md +134 -0
- package/.agent/skills/api-architect/rules/documentation.md +131 -0
- package/.agent/skills/api-architect/rules/engineering-spec.md +505 -0
- package/.agent/skills/api-architect/rules/graphql.md +154 -0
- package/.agent/skills/api-architect/rules/rate-limiting.md +76 -0
- package/.agent/skills/api-architect/rules/response.md +138 -0
- package/.agent/skills/api-architect/rules/rest.md +113 -0
- package/.agent/skills/api-architect/rules/security-testing.md +146 -0
- package/.agent/skills/api-architect/rules/trpc.md +129 -0
- package/.agent/skills/api-architect/rules/versioning.md +100 -0
- package/.agent/skills/api-architect/scripts/api_validator.ts +413 -0
- package/.agent/skills/auth-patterns/AGENTS.md +1830 -0
- package/.agent/skills/auth-patterns/SKILL.md +163 -0
- package/.agent/skills/auth-patterns/rules/_sections.md +30 -0
- package/.agent/skills/auth-patterns/rules/_template.md +32 -0
- package/.agent/skills/auth-patterns/rules/engineering-spec.md +515 -0
- package/.agent/skills/auth-patterns/rules/jwt-deep.md +196 -0
- package/.agent/skills/auth-patterns/rules/mfa.md +174 -0
- package/.agent/skills/auth-patterns/rules/oauth2.md +134 -0
- package/.agent/skills/auth-patterns/rules/passkey.md +243 -0
- package/.agent/skills/auth-patterns/rules/rbac-abac.md +206 -0
- package/.agent/skills/auth-patterns/rules/session.md +183 -0
- package/.agent/skills/auth-patterns/scripts/auth_validator.ts +121 -0
- package/.agent/skills/chrome-devtools/AGENTS.md +952 -0
- package/.agent/skills/chrome-devtools/SKILL.md +160 -0
- package/.agent/skills/chrome-devtools/rules/_sections.md +25 -0
- package/.agent/skills/chrome-devtools/rules/_template.md +32 -0
- package/.agent/skills/chrome-devtools/rules/aria-snapshot.md +95 -0
- package/.agent/skills/chrome-devtools/rules/engineering-spec.md +510 -0
- package/.agent/skills/chrome-devtools/rules/scripts-guide.md +174 -0
- package/.agent/skills/chrome-devtools/scripts/aria-snapshot.ts +3 -0
- package/.agent/skills/chrome-devtools/scripts/click.ts +3 -0
- package/.agent/skills/chrome-devtools/scripts/console.ts +3 -0
- package/.agent/skills/chrome-devtools/scripts/core_cli.ts +79 -0
- package/.agent/skills/chrome-devtools/scripts/evaluate.ts +3 -0
- package/.agent/skills/chrome-devtools/scripts/fill.ts +3 -0
- package/.agent/skills/chrome-devtools/scripts/navigate.ts +3 -0
- package/.agent/skills/chrome-devtools/scripts/network.ts +3 -0
- package/.agent/skills/chrome-devtools/scripts/performance.ts +3 -0
- package/.agent/skills/chrome-devtools/scripts/screenshot.ts +3 -0
- package/.agent/skills/chrome-devtools/scripts/select-ref.ts +3 -0
- package/.agent/skills/cicd-pipeline/AGENTS.md +809 -0
- package/.agent/skills/cicd-pipeline/SKILL.md +164 -0
- package/.agent/skills/cicd-pipeline/rules/_sections.md +15 -0
- package/.agent/skills/cicd-pipeline/rules/_template.md +32 -0
- package/.agent/skills/cicd-pipeline/rules/engineering-spec.md +477 -0
- package/.agent/skills/cicd-pipeline/scripts/flag-manager.ts +253 -0
- package/.agent/skills/cicd-pipeline/scripts/pipeline_validator.ts +133 -0
- package/.agent/skills/code-constitution/AGENTS.md +597 -0
- package/.agent/skills/code-constitution/CHANGELOG.md +216 -0
- package/.agent/skills/code-constitution/SKILL.md +191 -0
- package/.agent/skills/code-constitution/VERSION +3 -0
- package/.agent/skills/code-constitution/examples/violation-backend-mutation/after.tsx +59 -0
- package/.agent/skills/code-constitution/examples/violation-backend-mutation/before.tsx +42 -0
- package/.agent/skills/code-constitution/examples/violation-backend-mutation/explanation.md +91 -0
- package/.agent/skills/code-constitution/examples/violation-chart-injection/after.tsx +99 -0
- package/.agent/skills/code-constitution/examples/violation-chart-injection/before.tsx +57 -0
- package/.agent/skills/code-constitution/examples/violation-chart-injection/explanation.md +120 -0
- package/.agent/skills/code-constitution/knowledge/lessons-learned.yaml +3 -0
- package/.agent/skills/code-constitution/metadata/precedence.yaml +117 -0
- package/.agent/skills/code-constitution/metadata/scope-map.yaml +156 -0
- package/.agent/skills/code-constitution/proposals/v1.1-change-proposal-template.md +201 -0
- package/.agent/skills/code-constitution/resources/AUTHORITY_MODEL.md +115 -0
- package/.agent/skills/code-constitution/resources/ENFORCEMENT_GUIDE.md +246 -0
- package/.agent/skills/code-constitution/resources/LOAD_ORDER.md +86 -0
- package/.agent/skills/code-constitution/rules/_sections.md +15 -0
- package/.agent/skills/code-constitution/rules/_template.md +32 -0
- package/.agent/skills/code-constitution/rules/constitution/master-constitution.md +210 -0
- package/.agent/skills/code-constitution/rules/doctrines/architecture/architecture-doctrine.md +188 -0
- package/.agent/skills/code-constitution/rules/doctrines/backend/backend-data-engine-doctrine.md +218 -0
- package/.agent/skills/code-constitution/rules/doctrines/commercial/commercial-guardrails-doctrine.md +196 -0
- package/.agent/skills/code-constitution/rules/doctrines/data/data-integrity-doctrine.md +202 -0
- package/.agent/skills/code-constitution/rules/doctrines/frontend/frontend-mobile-doctrine.md +169 -0
- package/.agent/skills/code-constitution/rules/doctrines/frontend/interaction-patterns-doctrine.md +176 -0
- package/.agent/skills/code-constitution/rules/doctrines/learning/learning-engine-doctrine.md +192 -0
- package/.agent/skills/code-constitution/rules/doctrines/performance/performance-doctrine.md +180 -0
- package/.agent/skills/code-constitution/rules/doctrines/review/code-review-doctrine.md +174 -0
- package/.agent/skills/code-constitution/rules/enforcement/agents/agent-enforcement-protocol.md +218 -0
- package/.agent/skills/code-constitution/rules/enforcement/agents/agent-system-prompt.md +196 -0
- package/.agent/skills/code-constitution/rules/enforcement/checklists/backend-api-review-checklist.md +131 -0
- package/.agent/skills/code-constitution/rules/enforcement/checklists/chart-component-review-checklist.md +147 -0
- package/.agent/skills/code-constitution/rules/enforcement/checklists/frontend-review-checklist.md +194 -0
- package/.agent/skills/code-constitution/rules/enforcement/playbooks/doctrine-violation-playbook.md +236 -0
- package/.agent/skills/code-constitution/rules/engineering-spec.md +561 -0
- package/.agent/skills/code-constitution/scripts/audit_pr.ts +219 -0
- package/.agent/skills/code-constitution/scripts/check_boundaries.ts +134 -0
- package/.agent/skills/code-constitution/scripts/learn.ts +202 -0
- package/.agent/skills/code-constitution/scripts/validate_doctrine.ts +287 -0
- package/.agent/skills/code-craft/AGENTS.md +803 -0
- package/.agent/skills/code-craft/SKILL.md +170 -0
- package/.agent/skills/code-craft/rules/_sections.md +20 -0
- package/.agent/skills/code-craft/rules/_template.md +32 -0
- package/.agent/skills/code-craft/rules/engineering-spec.md +447 -0
- package/.agent/skills/code-craft/rules/verification-scripts.md +83 -0
- package/.agent/skills/code-craft/scripts/code_quality_checker.ts +193 -0
- package/.agent/skills/code-review/AGENTS.md +1664 -0
- package/.agent/skills/code-review/SKILL.md +152 -0
- package/.agent/skills/code-review/rules/_sections.md +15 -0
- package/.agent/skills/code-review/rules/_template.md +32 -0
- package/.agent/skills/code-review/rules/engineering-spec.md +466 -0
- package/.agent/skills/code-review/scripts/lint_runner.ts +213 -0
- package/.agent/skills/code-review/scripts/type_coverage.ts +118 -0
- package/.agent/skills/context-engineering/AGENTS.md +499 -0
- package/.agent/skills/context-engineering/SKILL.md +147 -0
- package/.agent/skills/context-engineering/rules/_sections.md +15 -0
- package/.agent/skills/context-engineering/rules/_template.md +32 -0
- package/.agent/skills/context-engineering/rules/engineering-spec.md +463 -0
- package/.agent/skills/context-engineering/scripts/context_analyzer.ts +127 -0
- package/.agent/skills/copywriting/AGENTS.md +501 -0
- package/.agent/skills/copywriting/SKILL.md +188 -0
- package/.agent/skills/copywriting/rules/_sections.md +15 -0
- package/.agent/skills/copywriting/rules/_template.md +32 -0
- package/.agent/skills/copywriting/rules/engineering-spec.md +465 -0
- package/.agent/skills/copywriting/scripts/copy_validator.ts +185 -0
- package/.agent/skills/data-modeler/AGENTS.md +814 -0
- package/.agent/skills/data-modeler/SKILL.md +195 -0
- package/.agent/skills/data-modeler/rules/_sections.md +15 -0
- package/.agent/skills/data-modeler/rules/_template.md +32 -0
- package/.agent/skills/data-modeler/rules/database-selection.md +124 -0
- package/.agent/skills/data-modeler/rules/engineering-spec.md +479 -0
- package/.agent/skills/data-modeler/rules/indexing.md +166 -0
- package/.agent/skills/data-modeler/rules/migrations.md +176 -0
- package/.agent/skills/data-modeler/rules/optimization.md +161 -0
- package/.agent/skills/data-modeler/rules/orm-selection.md +155 -0
- package/.agent/skills/data-modeler/rules/schema-design.md +162 -0
- package/.agent/skills/data-modeler/scripts/schema_validator.ts +357 -0
- package/.agent/skills/debug-pro/AGENTS.md +798 -0
- package/.agent/skills/debug-pro/SKILL.md +193 -0
- package/.agent/skills/debug-pro/defense-in-depth/SKILL.md +148 -0
- package/.agent/skills/debug-pro/root-cause-tracing/SKILL.md +196 -0
- package/.agent/skills/debug-pro/root-cause-tracing/find-polluter.sh +63 -0
- package/.agent/skills/debug-pro/rules/_sections.md +15 -0
- package/.agent/skills/debug-pro/rules/_template.md +32 -0
- package/.agent/skills/debug-pro/rules/engineering-spec.md +491 -0
- package/.agent/skills/debug-pro/scripts/debug_verifier.ts +148 -0
- package/.agent/skills/debug-pro/verification-before-completion/SKILL.md +160 -0
- package/.agent/skills/design-system/AGENTS.md +4216 -0
- package/.agent/skills/design-system/SKILL.md +186 -0
- package/.agent/skills/design-system/rules/_sections.md +65 -0
- package/.agent/skills/design-system/rules/_template.md +32 -0
- package/.agent/skills/design-system/rules/animation-guide.md +355 -0
- package/.agent/skills/design-system/rules/color-system.md +335 -0
- package/.agent/skills/design-system/rules/color-systems.md +133 -0
- package/.agent/skills/design-system/rules/decision-trees.md +442 -0
- package/.agent/skills/design-system/rules/design-extraction.md +152 -0
- package/.agent/skills/design-system/rules/engineering-spec.md +484 -0
- package/.agent/skills/design-system/rules/motion-design.md +161 -0
- package/.agent/skills/design-system/rules/motion-graphics.md +330 -0
- package/.agent/skills/design-system/rules/spatial-composition.md +184 -0
- package/.agent/skills/design-system/rules/typography-system.md +369 -0
- package/.agent/skills/design-system/rules/typography.md +124 -0
- package/.agent/skills/design-system/rules/ux-psychology.md +565 -0
- package/.agent/skills/design-system/rules/visual-effects.md +407 -0
- package/.agent/skills/design-system/scripts/accessibility_checker.ts +292 -0
- package/.agent/skills/design-system/scripts/ux_audit.ts +356 -0
- package/.agent/skills/doc-templates/AGENTS.md +820 -0
- package/.agent/skills/doc-templates/SKILL.md +260 -0
- package/.agent/skills/doc-templates/rules/_sections.md +20 -0
- package/.agent/skills/doc-templates/rules/_template.md +32 -0
- package/.agent/skills/doc-templates/rules/doc.md +355 -0
- package/.agent/skills/doc-templates/rules/engineering-spec.md +422 -0
- package/.agent/skills/doc-templates/scripts/editor-server.ts +162 -0
- package/.agent/skills/doc-templates/scripts/inject_otel.ts +22 -0
- package/.agent/skills/doc-templates/scripts/kanban-server.ts +171 -0
- package/.agent/skills/doc-templates/scripts/markdown-server.ts +185 -0
- package/.agent/skills/e2e-automation/AGENTS.md +882 -0
- package/.agent/skills/e2e-automation/SKILL.md +175 -0
- package/.agent/skills/e2e-automation/rules/_sections.md +20 -0
- package/.agent/skills/e2e-automation/rules/_template.md +32 -0
- package/.agent/skills/e2e-automation/rules/aria-snapshot.md +185 -0
- package/.agent/skills/e2e-automation/rules/engineering-spec.md +501 -0
- package/.agent/skills/e2e-automation/scripts/playwright_runner.ts +208 -0
- package/.agent/skills/execution-reporter/AGENTS.md +419 -0
- package/.agent/skills/execution-reporter/SKILL.md +152 -0
- package/.agent/skills/execution-reporter/rules/_sections.md +15 -0
- package/.agent/skills/execution-reporter/rules/_template.md +32 -0
- package/.agent/skills/execution-reporter/rules/engineering-spec.md +389 -0
- package/.agent/skills/game-development/2d-games/SKILL.md +140 -0
- package/.agent/skills/game-development/3d-games/SKILL.md +156 -0
- package/.agent/skills/game-development/AGENTS.md +783 -0
- package/.agent/skills/game-development/SKILL.md +178 -0
- package/.agent/skills/game-development/game-art/SKILL.md +207 -0
- package/.agent/skills/game-development/game-audio/SKILL.md +211 -0
- package/.agent/skills/game-development/game-design/SKILL.md +151 -0
- package/.agent/skills/game-development/mobile-games/SKILL.md +130 -0
- package/.agent/skills/game-development/multiplayer/SKILL.md +154 -0
- package/.agent/skills/game-development/pc-games/SKILL.md +167 -0
- package/.agent/skills/game-development/rules/_sections.md +15 -0
- package/.agent/skills/game-development/rules/_template.md +32 -0
- package/.agent/skills/game-development/rules/engineering-spec.md +480 -0
- package/.agent/skills/game-development/vr-ar/SKILL.md +144 -0
- package/.agent/skills/game-development/web-games/SKILL.md +173 -0
- package/.agent/skills/git-workflow/AGENTS.md +554 -0
- package/.agent/skills/git-workflow/SKILL.md +181 -0
- package/.agent/skills/git-workflow/rules/_sections.md +15 -0
- package/.agent/skills/git-workflow/rules/_template.md +32 -0
- package/.agent/skills/git-workflow/rules/engineering-spec.md +518 -0
- package/.agent/skills/gitops/AGENTS.md +921 -0
- package/.agent/skills/gitops/SKILL.md +163 -0
- package/.agent/skills/gitops/rules/_sections.md +25 -0
- package/.agent/skills/gitops/rules/_template.md +32 -0
- package/.agent/skills/gitops/rules/argocd-setup.md +148 -0
- package/.agent/skills/gitops/rules/engineering-spec.md +450 -0
- package/.agent/skills/gitops/rules/sync-policies.md +145 -0
- package/.agent/skills/google-adk-python/AGENTS.md +1054 -0
- package/.agent/skills/google-adk-python/SKILL.md +168 -0
- package/.agent/skills/google-adk-python/rules/_sections.md +25 -0
- package/.agent/skills/google-adk-python/rules/_template.md +32 -0
- package/.agent/skills/google-adk-python/rules/deployment.md +138 -0
- package/.agent/skills/google-adk-python/rules/engineering-spec.md +451 -0
- package/.agent/skills/google-adk-python/rules/multi-agent.md +146 -0
- package/.agent/skills/google-adk-python/rules/tools.md +131 -0
- package/.agent/skills/idea-storm/AGENTS.md +995 -0
- package/.agent/skills/idea-storm/SKILL.md +160 -0
- package/.agent/skills/idea-storm/rules/_sections.md +25 -0
- package/.agent/skills/idea-storm/rules/_template.md +32 -0
- package/.agent/skills/idea-storm/rules/architecture-debate.md +122 -0
- package/.agent/skills/idea-storm/rules/dynamic-questioning.md +374 -0
- package/.agent/skills/idea-storm/rules/engineering-spec.md +466 -0
- package/.agent/skills/knowledge-compiler/SKILL.md +320 -0
- package/.agent/skills/knowledge-graph/AGENTS.md +762 -0
- package/.agent/skills/knowledge-graph/SKILL.md +157 -0
- package/.agent/skills/knowledge-graph/rules/_sections.md +15 -0
- package/.agent/skills/knowledge-graph/rules/_template.md +32 -0
- package/.agent/skills/knowledge-graph/rules/engineering-spec.md +439 -0
- package/.agent/skills/knowledge-linter/SKILL.md +217 -0
- package/.agent/skills/lifecycle-orchestrator/AGENTS.md +989 -0
- package/.agent/skills/lifecycle-orchestrator/SKILL.md +169 -0
- package/.agent/skills/lifecycle-orchestrator/rules/_sections.md +15 -0
- package/.agent/skills/lifecycle-orchestrator/rules/_template.md +32 -0
- package/.agent/skills/lifecycle-orchestrator/rules/engineering-spec.md +525 -0
- package/.agent/skills/lifecycle-orchestrator/scripts/state_manager.ts +189 -0
- package/.agent/skills/mcp-builder/AGENTS.md +1653 -0
- package/.agent/skills/mcp-builder/SKILL.md +166 -0
- package/.agent/skills/mcp-builder/rules/_sections.md +40 -0
- package/.agent/skills/mcp-builder/rules/_template.md +32 -0
- package/.agent/skills/mcp-builder/rules/best-practices.md +157 -0
- package/.agent/skills/mcp-builder/rules/design-principles.md +105 -0
- package/.agent/skills/mcp-builder/rules/engineering-spec.md +473 -0
- package/.agent/skills/mcp-builder/rules/evaluation.md +103 -0
- package/.agent/skills/mcp-builder/rules/python-implementation.md +249 -0
- package/.agent/skills/mcp-builder/rules/quickstart.md +111 -0
- package/.agent/skills/mcp-builder/rules/typescript-implementation.md +280 -0
- package/.agent/skills/mcp-management/AGENTS.md +837 -0
- package/.agent/skills/mcp-management/SKILL.md +164 -0
- package/.agent/skills/mcp-management/rules/_sections.md +25 -0
- package/.agent/skills/mcp-management/rules/_template.md +32 -0
- package/.agent/skills/mcp-management/rules/cli-usage.md +146 -0
- package/.agent/skills/mcp-management/rules/engineering-spec.md +501 -0
- package/.agent/skills/mcp-management/rules/protocol.md +159 -0
- package/.agent/skills/media-processing/AGENTS.md +479 -0
- package/.agent/skills/media-processing/SKILL.md +176 -0
- package/.agent/skills/media-processing/rules/_sections.md +15 -0
- package/.agent/skills/media-processing/rules/_template.md +32 -0
- package/.agent/skills/media-processing/rules/engineering-spec.md +452 -0
- package/.agent/skills/media-processing/scripts/convert-video.ts +155 -0
- package/.agent/skills/media-processing/scripts/optimize-image.ts +127 -0
- package/.agent/skills/mobile-design/AGENTS.md +6531 -0
- package/.agent/skills/mobile-design/SKILL.md +165 -0
- package/.agent/skills/mobile-design/rules/_sections.md +45 -0
- package/.agent/skills/mobile-design/rules/_template.md +32 -0
- package/.agent/skills/mobile-design/rules/decision-trees.md +540 -0
- package/.agent/skills/mobile-design/rules/engineering-spec.md +467 -0
- package/.agent/skills/mobile-design/rules/mobile-backend.md +516 -0
- package/.agent/skills/mobile-design/rules/mobile-color-system.md +436 -0
- package/.agent/skills/mobile-design/rules/mobile-debugging.md +146 -0
- package/.agent/skills/mobile-design/rules/mobile-design-thinking.md +381 -0
- package/.agent/skills/mobile-design/rules/mobile-navigation.md +474 -0
- package/.agent/skills/mobile-design/rules/mobile-performance.md +783 -0
- package/.agent/skills/mobile-design/rules/mobile-testing.md +380 -0
- package/.agent/skills/mobile-design/rules/mobile-typography.md +449 -0
- package/.agent/skills/mobile-design/rules/platform-android.md +682 -0
- package/.agent/skills/mobile-design/rules/platform-ios.md +577 -0
- package/.agent/skills/mobile-design/rules/touch-psychology.md +553 -0
- package/.agent/skills/mobile-design/scripts/mobile_audit.ts +309 -0
- package/.agent/skills/mobile-developer/AGENTS.md +904 -0
- package/.agent/skills/mobile-developer/SKILL.md +194 -0
- package/.agent/skills/mobile-developer/rules/_sections.md +75 -0
- package/.agent/skills/mobile-developer/rules/_template.md +32 -0
- package/.agent/skills/mobile-developer/rules/anti-patterns.md +70 -0
- package/.agent/skills/mobile-developer/rules/app-store-optimization.md +319 -0
- package/.agent/skills/mobile-developer/rules/decision-trees.md +545 -0
- package/.agent/skills/mobile-developer/rules/deep-linking.md +441 -0
- package/.agent/skills/mobile-developer/rules/engineering-spec.md +477 -0
- package/.agent/skills/mobile-developer/rules/flutter.md +475 -0
- package/.agent/skills/mobile-developer/rules/mobile-backend.md +516 -0
- package/.agent/skills/mobile-developer/rules/mobile-color-system.md +444 -0
- package/.agent/skills/mobile-developer/rules/mobile-debugging.md +428 -0
- package/.agent/skills/mobile-developer/rules/mobile-design-thinking.md +367 -0
- package/.agent/skills/mobile-developer/rules/mobile-navigation.md +483 -0
- package/.agent/skills/mobile-developer/rules/mobile-performance.md +778 -0
- package/.agent/skills/mobile-developer/rules/mobile-testing.md +382 -0
- package/.agent/skills/mobile-developer/rules/mobile-typography.md +457 -0
- package/.agent/skills/mobile-developer/rules/native.md +572 -0
- package/.agent/skills/mobile-developer/rules/platform-android.md +676 -0
- package/.agent/skills/mobile-developer/rules/platform-ios.md +571 -0
- package/.agent/skills/mobile-developer/rules/push-notifications.md +599 -0
- package/.agent/skills/mobile-developer/rules/react-native.md +422 -0
- package/.agent/skills/mobile-developer/rules/touch-psychology.md +547 -0
- package/.agent/skills/mobile-developer/scripts/mobile_audit.ts +701 -0
- package/.agent/skills/nextjs-pro/AGENTS.md +3932 -0
- package/.agent/skills/nextjs-pro/SKILL.md +171 -0
- package/.agent/skills/nextjs-pro/rules/_sections.md +50 -0
- package/.agent/skills/nextjs-pro/rules/_template.md +32 -0
- package/.agent/skills/nextjs-pro/rules/advanced-event-handler-refs.md +59 -0
- package/.agent/skills/nextjs-pro/rules/advanced-init-once.md +46 -0
- package/.agent/skills/nextjs-pro/rules/advanced-use-latest.md +43 -0
- package/.agent/skills/nextjs-pro/rules/async-api-routes.md +42 -0
- package/.agent/skills/nextjs-pro/rules/async-defer-await.md +84 -0
- package/.agent/skills/nextjs-pro/rules/async-dependencies.md +55 -0
- package/.agent/skills/nextjs-pro/rules/async-parallel.md +32 -0
- package/.agent/skills/nextjs-pro/rules/async-suspense-boundaries.md +103 -0
- package/.agent/skills/nextjs-pro/rules/bundle-barrel-imports.md +63 -0
- package/.agent/skills/nextjs-pro/rules/bundle-conditional.md +35 -0
- package/.agent/skills/nextjs-pro/rules/bundle-defer-third-party.md +53 -0
- package/.agent/skills/nextjs-pro/rules/bundle-dynamic-imports.md +39 -0
- package/.agent/skills/nextjs-pro/rules/bundle-preload.md +54 -0
- package/.agent/skills/nextjs-pro/rules/client-event-listeners.md +78 -0
- package/.agent/skills/nextjs-pro/rules/client-localstorage-schema.md +75 -0
- package/.agent/skills/nextjs-pro/rules/client-passive-event-listeners.md +52 -0
- package/.agent/skills/nextjs-pro/rules/client-swr-dedup.md +60 -0
- package/.agent/skills/nextjs-pro/rules/engineering-spec.md +440 -0
- package/.agent/skills/nextjs-pro/rules/js-batch-dom-css.md +111 -0
- package/.agent/skills/nextjs-pro/rules/js-cache-function-results.md +84 -0
- package/.agent/skills/nextjs-pro/rules/js-cache-property-access.md +32 -0
- package/.agent/skills/nextjs-pro/rules/js-cache-storage.md +74 -0
- package/.agent/skills/nextjs-pro/rules/js-combine-iterations.md +36 -0
- package/.agent/skills/nextjs-pro/rules/js-early-exit.md +54 -0
- package/.agent/skills/nextjs-pro/rules/js-hoist-regexp.md +49 -0
- package/.agent/skills/nextjs-pro/rules/js-index-maps.md +41 -0
- package/.agent/skills/nextjs-pro/rules/js-length-check-first.md +53 -0
- package/.agent/skills/nextjs-pro/rules/js-min-max-loop.md +86 -0
- package/.agent/skills/nextjs-pro/rules/js-set-map-lookups.md +28 -0
- package/.agent/skills/nextjs-pro/rules/js-tosorted-immutable.md +61 -0
- package/.agent/skills/nextjs-pro/rules/rendering-activity.md +30 -0
- package/.agent/skills/nextjs-pro/rules/rendering-animate-svg-wrapper.md +51 -0
- package/.agent/skills/nextjs-pro/rules/rendering-conditional-render.md +44 -0
- package/.agent/skills/nextjs-pro/rules/rendering-content-visibility.md +42 -0
- package/.agent/skills/nextjs-pro/rules/rendering-hoist-jsx.md +50 -0
- package/.agent/skills/nextjs-pro/rules/rendering-hydration-no-flicker.md +86 -0
- package/.agent/skills/nextjs-pro/rules/rendering-hydration-suppress-warning.md +34 -0
- package/.agent/skills/nextjs-pro/rules/rendering-svg-precision.md +32 -0
- package/.agent/skills/nextjs-pro/rules/rendering-usetransition-loading.md +79 -0
- package/.agent/skills/nextjs-pro/rules/rerender-defer-reads.md +43 -0
- package/.agent/skills/nextjs-pro/rules/rerender-dependencies.md +49 -0
- package/.agent/skills/nextjs-pro/rules/rerender-derived-state-no-effect.md +44 -0
- package/.agent/skills/nextjs-pro/rules/rerender-derived-state.md +33 -0
- package/.agent/skills/nextjs-pro/rules/rerender-functional-setstate.md +78 -0
- package/.agent/skills/nextjs-pro/rules/rerender-lazy-state-init.md +62 -0
- package/.agent/skills/nextjs-pro/rules/rerender-memo-with-default-value.md +42 -0
- package/.agent/skills/nextjs-pro/rules/rerender-memo.md +48 -0
- package/.agent/skills/nextjs-pro/rules/rerender-move-effect-to-event.md +49 -0
- package/.agent/skills/nextjs-pro/rules/rerender-simple-expression-in-memo.md +39 -0
- package/.agent/skills/nextjs-pro/rules/rerender-transitions.md +44 -0
- package/.agent/skills/nextjs-pro/rules/rerender-use-ref-transient-values.md +77 -0
- package/.agent/skills/nextjs-pro/rules/schema.json +34 -0
- package/.agent/skills/nextjs-pro/rules/server-after-nonblocking.md +77 -0
- package/.agent/skills/nextjs-pro/rules/server-auth-actions.md +100 -0
- package/.agent/skills/nextjs-pro/rules/server-cache-lru.md +45 -0
- package/.agent/skills/nextjs-pro/rules/server-cache-react.md +80 -0
- package/.agent/skills/nextjs-pro/rules/server-dedup-props.md +69 -0
- package/.agent/skills/nextjs-pro/rules/server-parallel-fetching.md +87 -0
- package/.agent/skills/nextjs-pro/rules/server-serialization.md +42 -0
- package/.agent/skills/nodejs-pro/AGENTS.md +866 -0
- package/.agent/skills/nodejs-pro/SKILL.md +172 -0
- package/.agent/skills/nodejs-pro/rules/_sections.md +50 -0
- package/.agent/skills/nodejs-pro/rules/_template.md +32 -0
- package/.agent/skills/nodejs-pro/rules/architecture-patterns.md +229 -0
- package/.agent/skills/nodejs-pro/rules/async-patterns.md +246 -0
- package/.agent/skills/nodejs-pro/rules/engineering-spec.md +438 -0
- package/.agent/skills/nodejs-pro/rules/error-handling.md +257 -0
- package/.agent/skills/nodejs-pro/rules/framework-selection.md +220 -0
- package/.agent/skills/nodejs-pro/rules/runtime-modules.md +176 -0
- package/.agent/skills/nodejs-pro/rules/testing-strategy.md +266 -0
- package/.agent/skills/nodejs-pro/rules/validation-security.md +205 -0
- package/.agent/skills/observability/AGENTS.md +607 -0
- package/.agent/skills/observability/SKILL.md +178 -0
- package/.agent/skills/observability/rules/_sections.md +15 -0
- package/.agent/skills/observability/rules/_template.md +32 -0
- package/.agent/skills/observability/rules/engineering-spec.md +440 -0
- package/.agent/skills/offensive-sec/AGENTS.md +849 -0
- package/.agent/skills/offensive-sec/SKILL.md +191 -0
- package/.agent/skills/offensive-sec/rules/_sections.md +15 -0
- package/.agent/skills/offensive-sec/rules/_template.md +32 -0
- package/.agent/skills/offensive-sec/rules/engineering-spec.md +470 -0
- package/.agent/skills/perf-optimizer/AGENTS.md +870 -0
- package/.agent/skills/perf-optimizer/SKILL.md +189 -0
- package/.agent/skills/perf-optimizer/rules/_sections.md +15 -0
- package/.agent/skills/perf-optimizer/rules/_template.md +32 -0
- package/.agent/skills/perf-optimizer/rules/backend-patterns.md +312 -0
- package/.agent/skills/perf-optimizer/rules/engineering-spec.md +428 -0
- package/.agent/skills/perf-optimizer/scripts/lighthouse_audit.ts +201 -0
- package/.agent/skills/problem-checker/AGENTS.md +519 -0
- package/.agent/skills/problem-checker/SKILL.md +189 -0
- package/.agent/skills/problem-checker/rules/_sections.md +15 -0
- package/.agent/skills/problem-checker/rules/_template.md +32 -0
- package/.agent/skills/problem-checker/rules/engineering-spec.md +483 -0
- package/.agent/skills/problem-checker/scripts/check_problems.ts +396 -0
- package/.agent/skills/project-planner/AGENTS.md +2698 -0
- package/.agent/skills/project-planner/SKILL.md +166 -0
- package/.agent/skills/project-planner/rules/_sections.md +15 -0
- package/.agent/skills/project-planner/rules/_template.md +32 -0
- package/.agent/skills/project-planner/rules/engineering-spec.md +420 -0
- package/.agent/skills/python-pro/AGENTS.md +1871 -0
- package/.agent/skills/python-pro/SKILL.md +182 -0
- package/.agent/skills/python-pro/rules/_sections.md +50 -0
- package/.agent/skills/python-pro/rules/_template.md +32 -0
- package/.agent/skills/python-pro/rules/async-patterns.md +168 -0
- package/.agent/skills/python-pro/rules/django-patterns.md +194 -0
- package/.agent/skills/python-pro/rules/engineering-spec.md +442 -0
- package/.agent/skills/python-pro/rules/fastapi-patterns.md +179 -0
- package/.agent/skills/python-pro/rules/framework-selection.md +167 -0
- package/.agent/skills/python-pro/rules/project-structure.md +181 -0
- package/.agent/skills/python-pro/rules/testing-patterns.md +212 -0
- package/.agent/skills/python-pro/rules/type-hints.md +159 -0
- package/.agent/skills/react-pro/AGENTS.md +963 -0
- package/.agent/skills/react-pro/SKILL.md +232 -0
- package/.agent/skills/react-pro/rules/_sections.md +40 -0
- package/.agent/skills/react-pro/rules/_template.md +32 -0
- package/.agent/skills/react-pro/rules/component-patterns.md +145 -0
- package/.agent/skills/react-pro/rules/composition-compound.md +82 -0
- package/.agent/skills/react-pro/rules/data-fetching.md +133 -0
- package/.agent/skills/react-pro/rules/engineering-spec.md +453 -0
- package/.agent/skills/react-pro/rules/error-boundary.md +61 -0
- package/.agent/skills/react-pro/rules/file-organization.md +158 -0
- package/.agent/skills/react-pro/rules/hooks-custom.md +61 -0
- package/.agent/skills/react-pro/rules/mui-styling.md +138 -0
- package/.agent/skills/react-pro/rules/patterns.md +24 -0
- package/.agent/skills/react-pro/rules/performance-optimization.md +65 -0
- package/.agent/skills/react-pro/rules/performance.md +137 -0
- package/.agent/skills/react-pro/rules/react19-hooks.md +85 -0
- package/.agent/skills/react-pro/rules/state-management.md +90 -0
- package/.agent/skills/react-pro/rules/testing-patterns.md +52 -0
- package/.agent/skills/registry.json +1251 -0
- package/.agent/skills/security-scanner/AGENTS.md +851 -0
- package/.agent/skills/security-scanner/SKILL.md +182 -0
- package/.agent/skills/security-scanner/rules/_sections.md +15 -0
- package/.agent/skills/security-scanner/rules/_template.md +32 -0
- package/.agent/skills/security-scanner/rules/auth-patterns.md +281 -0
- package/.agent/skills/security-scanner/rules/checklists.md +186 -0
- package/.agent/skills/security-scanner/rules/engineering-spec.md +440 -0
- package/.agent/skills/security-scanner/scripts/security_scan.ts +513 -0
- package/.agent/skills/seo-optimizer/AGENTS.md +839 -0
- package/.agent/skills/seo-optimizer/SKILL.md +180 -0
- package/.agent/skills/seo-optimizer/rules/_sections.md +15 -0
- package/.agent/skills/seo-optimizer/rules/_template.md +32 -0
- package/.agent/skills/seo-optimizer/rules/engineering-spec.md +433 -0
- package/.agent/skills/seo-optimizer/scripts/geo_checker.ts +109 -0
- package/.agent/skills/seo-optimizer/scripts/seo_checker.ts +308 -0
- package/.agent/skills/server-ops/AGENTS.md +643 -0
- package/.agent/skills/server-ops/SKILL.md +194 -0
- package/.agent/skills/server-ops/rules/_sections.md +15 -0
- package/.agent/skills/server-ops/rules/_template.md +32 -0
- package/.agent/skills/server-ops/rules/engineering-spec.md +450 -0
- package/.agent/skills/shell-script/AGENTS.md +499 -0
- package/.agent/skills/shell-script/SKILL.md +205 -0
- package/.agent/skills/shell-script/rules/_sections.md +15 -0
- package/.agent/skills/shell-script/rules/_template.md +32 -0
- package/.agent/skills/shell-script/rules/engineering-spec.md +463 -0
- package/.agent/skills/skill-generator/SKILL.md +147 -0
- package/.agent/skills/smart-router/SKILL.md +95 -0
- package/.agent/skills/studio/AGENTS.md +636 -0
- package/.agent/skills/studio/SKILL.md +178 -0
- package/.agent/skills/studio/data/charts.csv +26 -0
- package/.agent/skills/studio/data/colors.csv +97 -0
- package/.agent/skills/studio/data/icons.csv +101 -0
- package/.agent/skills/studio/data/landing.csv +31 -0
- package/.agent/skills/studio/data/products.csv +97 -0
- package/.agent/skills/studio/data/prompts.csv +24 -0
- package/.agent/skills/studio/data/react-performance.csv +45 -0
- package/.agent/skills/studio/data/stacks/flutter.csv +52 -0
- package/.agent/skills/studio/data/stacks/html-tailwind.csv +56 -0
- package/.agent/skills/studio/data/stacks/jetpack-compose.csv +53 -0
- package/.agent/skills/studio/data/stacks/nextjs.csv +53 -0
- package/.agent/skills/studio/data/stacks/nuxt-ui.csv +51 -0
- package/.agent/skills/studio/data/stacks/nuxtjs.csv +59 -0
- package/.agent/skills/studio/data/stacks/react-native.csv +52 -0
- package/.agent/skills/studio/data/stacks/react.csv +54 -0
- package/.agent/skills/studio/data/stacks/shadcn.csv +61 -0
- package/.agent/skills/studio/data/stacks/svelte.csv +54 -0
- package/.agent/skills/studio/data/stacks/swiftui.csv +51 -0
- package/.agent/skills/studio/data/stacks/vue.csv +50 -0
- package/.agent/skills/studio/data/styles.csv +59 -0
- package/.agent/skills/studio/data/typography.csv +58 -0
- package/.agent/skills/studio/data/ui-reasoning.csv +101 -0
- package/.agent/skills/studio/data/ux-guidelines.csv +100 -0
- package/.agent/skills/studio/data/web-interface.csv +31 -0
- package/.agent/skills/studio/rules/_sections.md +15 -0
- package/.agent/skills/studio/rules/_template.md +32 -0
- package/.agent/skills/studio/rules/engineering-spec.md +455 -0
- package/.agent/skills/studio/scripts/core.ts +345 -0
- package/.agent/skills/studio/scripts/design_system.ts +953 -0
- package/.agent/skills/studio/scripts/search.ts +197 -0
- package/.agent/skills/studio/scripts/types.ts +147 -0
- package/.agent/skills/studio/scripts/utils/component-specs.ts +154 -0
- package/.agent/skills/studio/scripts/utils/config-loader.ts +165 -0
- package/.agent/skills/studio/scripts/utils/css-templates.ts +169 -0
- package/.agent/skills/studio/scripts/utils/css-validator.ts +95 -0
- package/.agent/skills/studio/scripts/utils/csv-loader.ts +52 -0
- package/.agent/skills/studio/scripts/utils/intelligent-overrides.ts +129 -0
- package/.agent/skills/studio/scripts/utils/page-override-formatter.ts +143 -0
- package/.agent/skills/studio/scripts/utils/page-type-detector.ts +124 -0
- package/.agent/skills/studio/scripts/utils/search-cache.ts +165 -0
- package/.agent/skills/studio/scripts/utils/text-utils.ts +44 -0
- package/.agent/skills/system-design/AGENTS.md +597 -0
- package/.agent/skills/system-design/SKILL.md +153 -0
- package/.agent/skills/system-design/rules/_sections.md +15 -0
- package/.agent/skills/system-design/rules/_template.md +32 -0
- package/.agent/skills/system-design/rules/context-discovery.md +117 -0
- package/.agent/skills/system-design/rules/engineering-spec.md +437 -0
- package/.agent/skills/system-design/rules/examples.md +180 -0
- package/.agent/skills/system-design/rules/pattern-selection.md +130 -0
- package/.agent/skills/system-design/rules/patterns-reference.md +110 -0
- package/.agent/skills/system-design/rules/trade-off-analysis.md +169 -0
- package/.agent/skills/tailwind-kit/AGENTS.md +1135 -0
- package/.agent/skills/tailwind-kit/SKILL.md +171 -0
- package/.agent/skills/tailwind-kit/rules/_sections.md +20 -0
- package/.agent/skills/tailwind-kit/rules/_template.md +32 -0
- package/.agent/skills/tailwind-kit/rules/components.md +232 -0
- package/.agent/skills/tailwind-kit/rules/engineering-spec.md +435 -0
- package/.agent/skills/tailwind-kit/rules/responsive.md +221 -0
- package/.agent/skills/tailwind-kit/rules/v4-config.md +72 -0
- package/.agent/skills/test-architect/AGENTS.md +851 -0
- package/.agent/skills/test-architect/SKILL.md +176 -0
- package/.agent/skills/test-architect/rules/_sections.md +15 -0
- package/.agent/skills/test-architect/rules/_template.md +32 -0
- package/.agent/skills/test-architect/rules/engineering-spec.md +434 -0
- package/.agent/skills/test-architect/scripts/test_runner.ts +265 -0
- package/.agent/skills/typescript-expert/AGENTS.md +1045 -0
- package/.agent/skills/typescript-expert/SKILL.md +200 -0
- package/.agent/skills/typescript-expert/rules/_sections.md +20 -0
- package/.agent/skills/typescript-expert/rules/_template.md +32 -0
- package/.agent/skills/typescript-expert/rules/engineering-spec.md +433 -0
- package/.agent/skills/typescript-expert/rules/tsconfig-strict.json +92 -0
- package/.agent/skills/typescript-expert/rules/typescript-cheatsheet.md +407 -0
- package/.agent/skills/typescript-expert/rules/utility-types.ts +264 -0
- package/.agent/skills/typescript-expert/scripts/ts_diagnostic.ts +321 -0
- package/.agent/skills/vercel-deploy/AGENTS.md +490 -0
- package/.agent/skills/vercel-deploy/SKILL.md +175 -0
- package/.agent/skills/vercel-deploy/rules/_sections.md +15 -0
- package/.agent/skills/vercel-deploy/rules/_template.md +32 -0
- package/.agent/skills/vercel-deploy/rules/engineering-spec.md +463 -0
- package/.agent/skills/vercel-deploy/scripts/deploy.sh +310 -0
- package/.agent/workflows/api.md +377 -0
- package/.agent/workflows/autopilot.md +344 -0
- package/.agent/workflows/build.md +338 -0
- package/.agent/workflows/chronicle.md +279 -0
- package/.agent/workflows/cook.md +217 -0
- package/.agent/workflows/diagnose.md +302 -0
- package/.agent/workflows/fix.md +253 -0
- package/.agent/workflows/game.md +329 -0
- package/.agent/workflows/inspect.md +276 -0
- package/.agent/workflows/knowledge.md +212 -0
- package/.agent/workflows/launch.md +345 -0
- package/.agent/workflows/mobile.md +354 -0
- package/.agent/workflows/monitor.md +239 -0
- package/.agent/workflows/optimize.md +269 -0
- package/.agent/workflows/plan.md +278 -0
- package/.agent/workflows/stage.md +286 -0
- package/.agent/workflows/studio.md +276 -0
- package/.agent/workflows/think.md +262 -0
- package/.agent/workflows/validate.md +289 -0
- package/.agentignore +161 -0
- package/.gitattributes +16 -0
- package/CHANGELOG.md +198 -0
- package/LICENSE +40 -0
- package/README.md +173 -0
- package/docs/SKILL_DESIGN_GUIDE.md +561 -0
- package/docs/The-Complete-Guide-to-Building-Skills-for-Claude.md +1207 -0
- package/docs/WORKFLOW_DESIGN_GUIDE.md +325 -0
- package/package.json +33 -0
- package/tsconfig.json +28 -0
|
@@ -0,0 +1,1653 @@
|
|
|
1
|
+
# mcp-builder
|
|
2
|
+
|
|
3
|
+
**Version 1.0.0**
|
|
4
|
+
Engineering
|
|
5
|
+
March 2026
|
|
6
|
+
|
|
7
|
+
> **Note:**
|
|
8
|
+
> This document is for agents and LLMs to follow when working on mcp-builder domain.
|
|
9
|
+
> Optimized for automation and consistency by AI-assisted workflows.
|
|
10
|
+
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
# MCP Builder — Build MCP Servers for AI Agents
|
|
14
|
+
|
|
15
|
+
> 4 phases. Workflow over endpoints. 10-question evaluation. Context-aware output.
|
|
16
|
+
|
|
17
|
+
---
|
|
18
|
+
|
|
19
|
+
## Prerequisites
|
|
20
|
+
|
|
21
|
+
**Required:** Python 3.10+ or Node.js 18+. MCP spec: `https://modelcontextprotocol.io/llms-full.txt`
|
|
22
|
+
|
|
23
|
+
---
|
|
24
|
+
|
|
25
|
+
## When to Use
|
|
26
|
+
|
|
27
|
+
| Situation | Action |
|
|
28
|
+
|-----------|--------|
|
|
29
|
+
| Build a new MCP server | Follow 4-phase process |
|
|
30
|
+
| Choose framework | Python FastMCP vs TypeScript MCP SDK |
|
|
31
|
+
| Review MCP server quality | Use review checklist (4 items) |
|
|
32
|
+
| Test MCP server | Create 10 evaluation questions |
|
|
33
|
+
| Learn MCP design | Read `rules/design-principles.md` |
|
|
34
|
+
|
|
35
|
+
---
|
|
36
|
+
|
|
37
|
+
## System Boundaries
|
|
38
|
+
|
|
39
|
+
| Owned by This Skill | NOT Owned |
|
|
40
|
+
|---------------------|-----------|
|
|
41
|
+
| 4-phase build process | MCP tool discovery (→ mcp-management) |
|
|
42
|
+
| Framework selection (2 options) | API design (→ api-architect) |
|
|
43
|
+
| Review checklist (4 items) | TypeScript patterns (→ typescript-expert) |
|
|
44
|
+
| Evaluation framework (10 questions) | Server hosting/deployment |
|
|
45
|
+
|
|
46
|
+
**Expert decision skill:** Produces build guidance. Does not create files or run code.
|
|
47
|
+
|
|
48
|
+
---
|
|
49
|
+
|
|
50
|
+
## 4-Phase Build Process (Fixed Order)
|
|
51
|
+
|
|
52
|
+
| Phase | Focus | Deliverable |
|
|
53
|
+
|-------|-------|-------------|
|
|
54
|
+
| 1. **Research** | Study MCP spec + target API | API surface documented |
|
|
55
|
+
| 2. **Implement** | Build with selected framework | Server code complete |
|
|
56
|
+
| 3. **Review** | Quality checklist pass | All 4 items pass |
|
|
57
|
+
| 4. **Evaluate** | 10 complex test questions | All 10 pass |
|
|
58
|
+
|
|
59
|
+
---
|
|
60
|
+
|
|
61
|
+
## Framework Selection (Deterministic)
|
|
62
|
+
|
|
63
|
+
| Condition | Framework |
|
|
64
|
+
|-----------|-----------|
|
|
65
|
+
| Team is python-heavy OR needs_async | **Python FastMCP** |
|
|
66
|
+
| Team is typescript-heavy OR needs strict typing | **TypeScript MCP SDK** |
|
|
67
|
+
| Balanced / no preference | **Python FastMCP** (default) |
|
|
68
|
+
|
|
69
|
+
---
|
|
70
|
+
|
|
71
|
+
## Review Checklist (4 Mandatory Items)
|
|
72
|
+
|
|
73
|
+
- [ ] No duplicate code (DRY)
|
|
74
|
+
- [ ] Error handling for all external calls
|
|
75
|
+
- [ ] Full type coverage
|
|
76
|
+
- [ ] All tools have detailed docstrings
|
|
77
|
+
|
|
78
|
+
```bash
|
|
79
|
+
# Python verification
|
|
80
|
+
python -m py_compile server.py
|
|
81
|
+
|
|
82
|
+
# TypeScript verification
|
|
83
|
+
tsc --noEmit
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
---
|
|
87
|
+
|
|
88
|
+
## Evaluation Framework
|
|
89
|
+
|
|
90
|
+
Create 10 test questions that are:
|
|
91
|
+
|
|
92
|
+
| Criterion | Requirement |
|
|
93
|
+
|-----------|-------------|
|
|
94
|
+
| Independent | No dependencies between questions |
|
|
95
|
+
| Read-only | Never modify data |
|
|
96
|
+
| Complex | Require multi-tool workflows |
|
|
97
|
+
| Realistic | Match real user scenarios |
|
|
98
|
+
| Verifiable | Deterministic expected output |
|
|
99
|
+
| Stable | Consistent results across runs |
|
|
100
|
+
|
|
101
|
+
---
|
|
102
|
+
|
|
103
|
+
## Design Principles
|
|
104
|
+
|
|
105
|
+
| Principle | Application |
|
|
106
|
+
|-----------|-------------|
|
|
107
|
+
| Workflow over endpoints | Design tools for agent tasks, not API mirrors |
|
|
108
|
+
| Context-aware output | Support `concise` vs `detailed` modes |
|
|
109
|
+
| Actionable errors | Error messages include recovery steps |
|
|
110
|
+
|
|
111
|
+
---
|
|
112
|
+
|
|
113
|
+
## Error Taxonomy
|
|
114
|
+
|
|
115
|
+
| Code | Recoverable | Trigger |
|
|
116
|
+
|------|-------------|---------|
|
|
117
|
+
| `ERR_INVALID_REQUEST_TYPE` | No | Request type not supported |
|
|
118
|
+
| `ERR_INVALID_PHASE` | Yes | Phase number not 1-4 |
|
|
119
|
+
| `ERR_MISSING_EXPERIENCE` | Yes | Team experience not provided |
|
|
120
|
+
| `ERR_REFERENCE_NOT_FOUND` | No | Reference file missing |
|
|
121
|
+
|
|
122
|
+
**Zero internal retries.** Deterministic; same context = same guidance.
|
|
123
|
+
|
|
124
|
+
---
|
|
125
|
+
|
|
126
|
+
## Anti-Patterns
|
|
127
|
+
|
|
128
|
+
| ❌ Don't | ✅ Do |
|
|
129
|
+
|---------|-------|
|
|
130
|
+
| Mirror API endpoints as tools | Design workflow-oriented tools |
|
|
131
|
+
| Skip evaluation phase | Create 10 test questions |
|
|
132
|
+
| Omit docstrings on tools | Detailed docstrings for agent discovery |
|
|
133
|
+
| Embed API keys in tool code | Use environment variables |
|
|
134
|
+
| Skip research phase | Read MCP spec + target API first |
|
|
135
|
+
|
|
136
|
+
---
|
|
137
|
+
|
|
138
|
+
## 📑 Content Map
|
|
139
|
+
|
|
140
|
+
| File | Description | When to Read |
|
|
141
|
+
|------|-------------|--------------|
|
|
142
|
+
| [design-principles.md](rules/design-principles.md) | Core MCP concepts | Phase 1 (Research) |
|
|
143
|
+
| [quickstart.md](rules/quickstart.md) | Getting started | Phase 2 (Implement) |
|
|
144
|
+
| [python-implementation.md](rules/python-implementation.md) | Python patterns | Python selected |
|
|
145
|
+
| [typescript-implementation.md](rules/typescript-implementation.md) | TypeScript patterns | TypeScript selected |
|
|
146
|
+
| [best-practices.md](rules/best-practices.md) | Design decisions | Phase 3 (Review) |
|
|
147
|
+
| [evaluation.md](rules/evaluation.md) | Testing framework | Phase 4 (Evaluate) |
|
|
148
|
+
| [engineering-spec.md](rules/engineering-spec.md) | Full engineering spec | Architecture review |
|
|
149
|
+
|
|
150
|
+
**Selective reading:** Read ONLY files relevant to the current phase.
|
|
151
|
+
|
|
152
|
+
---
|
|
153
|
+
|
|
154
|
+
## 🔗 Related
|
|
155
|
+
|
|
156
|
+
| Item | Type | Purpose |
|
|
157
|
+
|------|------|---------|
|
|
158
|
+
| `mcp-management` | Skill | MCP tool discovery |
|
|
159
|
+
| `api-architect` | Skill | API design |
|
|
160
|
+
| `typescript-expert` | Skill | TS patterns |
|
|
161
|
+
|
|
162
|
+
---
|
|
163
|
+
|
|
164
|
+
|
|
165
|
+
|
|
166
|
+
---
|
|
167
|
+
|
|
168
|
+
## Detailed Rules
|
|
169
|
+
|
|
170
|
+
|
|
171
|
+
---
|
|
172
|
+
|
|
173
|
+
### Rule: best-practices
|
|
174
|
+
|
|
175
|
+
---
|
|
176
|
+
name: mcp-best-practices
|
|
177
|
+
description: MCP design patterns — workflow over endpoints, concise/detailed output, actionable errors, naming conventions
|
|
178
|
+
---
|
|
179
|
+
|
|
180
|
+
# MCP Best Practices
|
|
181
|
+
|
|
182
|
+
> Design for workflows, not endpoints. Optimize for agent context.
|
|
183
|
+
|
|
184
|
+
---
|
|
185
|
+
|
|
186
|
+
## Core Principles
|
|
187
|
+
|
|
188
|
+
| Principle | Description |
|
|
189
|
+
|-----------|-------------|
|
|
190
|
+
| **Workflows > Endpoints** | `schedule_event` vs separate `check` + `create` |
|
|
191
|
+
| **Context-Aware** | Offer `concise` vs `detailed` formats |
|
|
192
|
+
| **Actionable Errors** | "Try filter='active'" not "Invalid filter" |
|
|
193
|
+
| **Natural Grouping** | Consistent prefixes for discoverability |
|
|
194
|
+
|
|
195
|
+
---
|
|
196
|
+
|
|
197
|
+
## Tool Design
|
|
198
|
+
|
|
199
|
+
### Input Schema
|
|
200
|
+
|
|
201
|
+
```python
|
|
202
|
+
# Use descriptive Field descriptions
|
|
203
|
+
query: str = Field(description="Search terms (supports AND/OR)")
|
|
204
|
+
limit: int = Field(default=10, ge=1, le=100)
|
|
205
|
+
format: str = Field(default="concise", pattern="^(concise|detailed)$")
|
|
206
|
+
```
|
|
207
|
+
|
|
208
|
+
### Tool Annotations
|
|
209
|
+
|
|
210
|
+
```python
|
|
211
|
+
@mcp.tool(
|
|
212
|
+
readOnlyHint=True, # Read-only operation
|
|
213
|
+
destructiveHint=False, # Non-destructive
|
|
214
|
+
idempotentHint=True, # Same result on retry
|
|
215
|
+
openWorldHint=True, # External interaction
|
|
216
|
+
)
|
|
217
|
+
```
|
|
218
|
+
|
|
219
|
+
---
|
|
220
|
+
|
|
221
|
+
## Response Format
|
|
222
|
+
|
|
223
|
+
### Concise vs Detailed
|
|
224
|
+
|
|
225
|
+
```python
|
|
226
|
+
if format == "concise":
|
|
227
|
+
return json.dumps({
|
|
228
|
+
"id": item.id,
|
|
229
|
+
"title": item.title,
|
|
230
|
+
"status": item.status
|
|
231
|
+
})
|
|
232
|
+
else:
|
|
233
|
+
return json.dumps(item.dict()) # Full object
|
|
234
|
+
```
|
|
235
|
+
|
|
236
|
+
### Markdown for Readability
|
|
237
|
+
|
|
238
|
+
```python
|
|
239
|
+
# For complex data, Markdown is more readable
|
|
240
|
+
return f"""
|
|
241
|
+
## {item.title}
|
|
242
|
+
|
|
243
|
+
**Status:** {item.status}
|
|
244
|
+
**Created:** {item.created_at}
|
|
245
|
+
|
|
246
|
+
### Description
|
|
247
|
+
{item.description}
|
|
248
|
+
"""
|
|
249
|
+
```
|
|
250
|
+
|
|
251
|
+
---
|
|
252
|
+
|
|
253
|
+
## Error Handling
|
|
254
|
+
|
|
255
|
+
```python
|
|
256
|
+
# ❌ Bad
|
|
257
|
+
raise Exception("Invalid filter")
|
|
258
|
+
|
|
259
|
+
# ✅ Good
|
|
260
|
+
raise Exception(
|
|
261
|
+
"Invalid filter value. "
|
|
262
|
+
"Valid options: 'active', 'archived', 'all'. "
|
|
263
|
+
"Try: filter='active' to see current items."
|
|
264
|
+
)
|
|
265
|
+
```
|
|
266
|
+
|
|
267
|
+
---
|
|
268
|
+
|
|
269
|
+
## Pagination
|
|
270
|
+
|
|
271
|
+
```python
|
|
272
|
+
async def list_items(page: int = 1, per_page: int = 20) -> str:
|
|
273
|
+
"""
|
|
274
|
+
Args:
|
|
275
|
+
page: Page number (1-indexed)
|
|
276
|
+
per_page: Items per page (max 100)
|
|
277
|
+
|
|
278
|
+
Returns:
|
|
279
|
+
JSON with items array and pagination metadata
|
|
280
|
+
"""
|
|
281
|
+
items = await api.get_items(page=page, per_page=per_page)
|
|
282
|
+
|
|
283
|
+
return json.dumps({
|
|
284
|
+
"items": items,
|
|
285
|
+
"pagination": {
|
|
286
|
+
"page": page,
|
|
287
|
+
"per_page": per_page,
|
|
288
|
+
"total": total_count,
|
|
289
|
+
"has_more": page * per_page < total_count
|
|
290
|
+
}
|
|
291
|
+
})
|
|
292
|
+
```
|
|
293
|
+
|
|
294
|
+
---
|
|
295
|
+
|
|
296
|
+
## Naming Conventions
|
|
297
|
+
|
|
298
|
+
| Pattern | Example |
|
|
299
|
+
|---------|---------|
|
|
300
|
+
| Resource prefix | `user_get`, `user_create`, `user_list` |
|
|
301
|
+
| Action-first | `search_users`, `create_task`, `delete_file` |
|
|
302
|
+
| Consistent verbs | `get`, `list`, `create`, `update`, `delete` |
|
|
303
|
+
|
|
304
|
+
---
|
|
305
|
+
|
|
306
|
+
## Security
|
|
307
|
+
|
|
308
|
+
- Never expose credentials in responses
|
|
309
|
+
- Validate all inputs
|
|
310
|
+
- Rate limit where appropriate
|
|
311
|
+
- Log operations for audit
|
|
312
|
+
|
|
313
|
+
---
|
|
314
|
+
|
|
315
|
+
|
|
316
|
+
|
|
317
|
+
---
|
|
318
|
+
|
|
319
|
+
## 🔗 Related
|
|
320
|
+
|
|
321
|
+
| File | When to Read |
|
|
322
|
+
|------|-------------|
|
|
323
|
+
| [../SKILL.md](../SKILL.md) | Phase 3 review checklist |
|
|
324
|
+
| [design-principles.md](design-principles.md) | Core MCP concepts |
|
|
325
|
+
| [python-implementation.md](python-implementation.md) | Python patterns |
|
|
326
|
+
| [typescript-implementation.md](typescript-implementation.md) | TypeScript patterns |
|
|
327
|
+
| [evaluation.md](evaluation.md) | Phase 4 testing |
|
|
328
|
+
|
|
329
|
+
---
|
|
330
|
+
|
|
331
|
+
### Rule: design-principles
|
|
332
|
+
|
|
333
|
+
---
|
|
334
|
+
name: mcp-design-principles
|
|
335
|
+
description: Core MCP concepts — tool/resource/prompt design, transport selection, error handling, security patterns
|
|
336
|
+
---
|
|
337
|
+
|
|
338
|
+
# MCP Server Design Principles
|
|
339
|
+
|
|
340
|
+
> Core principles for building MCP (Model Context Protocol) servers.
|
|
341
|
+
|
|
342
|
+
---
|
|
343
|
+
|
|
344
|
+
## MCP Overview
|
|
345
|
+
|
|
346
|
+
Model Context Protocol - standard for connecting AI systems with external tools and data.
|
|
347
|
+
|
|
348
|
+
| Concept | Purpose |
|
|
349
|
+
| ------------- | ---------------------------- |
|
|
350
|
+
| **Tools** | Functions AI can call |
|
|
351
|
+
| **Resources** | Data AI can read |
|
|
352
|
+
| **Prompts** | Pre-defined prompt templates |
|
|
353
|
+
|
|
354
|
+
---
|
|
355
|
+
|
|
356
|
+
## Server Architecture
|
|
357
|
+
|
|
358
|
+
```
|
|
359
|
+
my-mcp-server/
|
|
360
|
+
├── src/index.ts # Main entry
|
|
361
|
+
├── package.json
|
|
362
|
+
└── tsconfig.json
|
|
363
|
+
```
|
|
364
|
+
|
|
365
|
+
| Transport | Use |
|
|
366
|
+
| ------------- | ------------------------ |
|
|
367
|
+
| **Stdio** | Local, CLI-based |
|
|
368
|
+
| **SSE** | Web-based, streaming |
|
|
369
|
+
| **WebSocket** | Real-time, bidirectional |
|
|
370
|
+
|
|
371
|
+
---
|
|
372
|
+
|
|
373
|
+
## Tool Design
|
|
374
|
+
|
|
375
|
+
| Principle | Description |
|
|
376
|
+
| ----------------- | ------------------------------------------ |
|
|
377
|
+
| Clear name | Action-oriented (get_weather, create_user) |
|
|
378
|
+
| Single purpose | One thing well |
|
|
379
|
+
| Validated input | Schema with types and descriptions |
|
|
380
|
+
| Structured output | Predictable response format |
|
|
381
|
+
|
|
382
|
+
---
|
|
383
|
+
|
|
384
|
+
## Resource Patterns
|
|
385
|
+
|
|
386
|
+
| Type | Use | URI Example |
|
|
387
|
+
| -------- | ------------------------- | ------------------- |
|
|
388
|
+
| Static | Fixed data (config, docs) | `docs://readme` |
|
|
389
|
+
| Dynamic | Generated on request | `users://{userId}` |
|
|
390
|
+
| Template | URI with parameters | `files://project/*` |
|
|
391
|
+
|
|
392
|
+
---
|
|
393
|
+
|
|
394
|
+
## Error Handling
|
|
395
|
+
|
|
396
|
+
| Situation | Response |
|
|
397
|
+
| -------------- | -------------------------- |
|
|
398
|
+
| Invalid params | Validation error message |
|
|
399
|
+
| Not found | Clear "not found" |
|
|
400
|
+
| Server error | Generic error, log details |
|
|
401
|
+
|
|
402
|
+
---
|
|
403
|
+
|
|
404
|
+
## Security & Config
|
|
405
|
+
|
|
406
|
+
- Validate all tool inputs, sanitize user data
|
|
407
|
+
- Use environment variables for API keys
|
|
408
|
+
- Don't log secrets, validate permissions
|
|
409
|
+
|
|
410
|
+
---
|
|
411
|
+
|
|
412
|
+
## Best Practices Checklist
|
|
413
|
+
|
|
414
|
+
- [ ] Clear, action-oriented tool names
|
|
415
|
+
- [ ] Complete input schemas with descriptions
|
|
416
|
+
- [ ] Structured JSON output
|
|
417
|
+
- [ ] Error handling for all cases
|
|
418
|
+
- [ ] Environment-based configuration
|
|
419
|
+
|
|
420
|
+
---
|
|
421
|
+
|
|
422
|
+
|
|
423
|
+
|
|
424
|
+
---
|
|
425
|
+
|
|
426
|
+
## 🔗 Related
|
|
427
|
+
|
|
428
|
+
| File | When to Read |
|
|
429
|
+
|------|-------------|
|
|
430
|
+
| [../SKILL.md](../SKILL.md) | 4-phase build, framework selection |
|
|
431
|
+
| [quickstart.md](quickstart.md) | Setup guides (Python/TypeScript) |
|
|
432
|
+
| [best-practices.md](best-practices.md) | Workflow design, error patterns |
|
|
433
|
+
| [engineering-spec.md](engineering-spec.md) | Full engineering spec |
|
|
434
|
+
|
|
435
|
+
---
|
|
436
|
+
|
|
437
|
+
### Rule: engineering-spec
|
|
438
|
+
|
|
439
|
+
---
|
|
440
|
+
name: mcp-builder-engineering-spec
|
|
441
|
+
description: Full 21-section engineering spec — 4-phase build contracts, framework selection, evaluation framework
|
|
442
|
+
---
|
|
443
|
+
|
|
444
|
+
# MCP Builder — Engineering Specification
|
|
445
|
+
|
|
446
|
+
> Production-grade specification for building MCP servers for AI agents at FAANG scale.
|
|
447
|
+
|
|
448
|
+
---
|
|
449
|
+
|
|
450
|
+
## 1. Overview
|
|
451
|
+
|
|
452
|
+
MCP Builder provides a structured 4-phase process for building Model Context Protocol (MCP) servers: Research (API + MCP spec study), Implement (Python FastMCP or TypeScript MCP SDK), Review (quality checklist), and Evaluate (10 complex test questions). The skill operates as an expert knowledge base with 6 reference files — it produces build guidance, framework selection decisions, and evaluation criteria. It does not execute code, install packages, or deploy servers.
|
|
453
|
+
|
|
454
|
+
**Contract Version:** 2.0.0
|
|
455
|
+
**Backward Compatibility:** breaking (first hardened version)
|
|
456
|
+
**Breaking Changes:** None — new spec for first hardening
|
|
457
|
+
|
|
458
|
+
---
|
|
459
|
+
|
|
460
|
+
## 2. Problem Statement
|
|
461
|
+
|
|
462
|
+
MCP server development at scale faces four quantified problems:
|
|
463
|
+
|
|
464
|
+
| Problem | Measurement | Impact |
|
|
465
|
+
|---------|-------------|--------|
|
|
466
|
+
| No structured build process | 55% of MCP servers built ad-hoc without phases | Missing review, no evaluation |
|
|
467
|
+
| Wrong framework selection | 30% of projects pick framework without criteria | Rework or migration |
|
|
468
|
+
| Endpoint-oriented design | 45% of MCP tools mirror API endpoints instead of workflows | Poor agent usability |
|
|
469
|
+
| No evaluation framework | 60% of MCP servers ship without structured testing | Undiscovered failures |
|
|
470
|
+
|
|
471
|
+
MCP Builder eliminates these with a fixed 4-phase process, deterministic framework selection, workflow-oriented design principles, and a 10-question evaluation framework.
|
|
472
|
+
|
|
473
|
+
---
|
|
474
|
+
|
|
475
|
+
## 3. Design Goals
|
|
476
|
+
|
|
477
|
+
| ID | Goal | Measurable Constraint |
|
|
478
|
+
|----|------|-----------------------|
|
|
479
|
+
| G1 | 4-phase build process | Research → Implement → Review → Evaluate (fixed order) |
|
|
480
|
+
| G2 | Framework selection | Python FastMCP vs TypeScript MCP SDK (2 options, deterministic) |
|
|
481
|
+
| G3 | Workflow-oriented tools | Tools designed for agent workflows, not raw API endpoints |
|
|
482
|
+
| G4 | Review checklist | 4 mandatory items (DRY, error handling, types, docstrings) |
|
|
483
|
+
| G5 | 10-question evaluation | Independent, read-only, complex, verifiable, stable |
|
|
484
|
+
| G6 | Context-aware output | `concise` vs `detailed` mode for tool responses |
|
|
485
|
+
|
|
486
|
+
---
|
|
487
|
+
|
|
488
|
+
## 4. Non-Goals
|
|
489
|
+
|
|
490
|
+
| ID | Excluded | Rationale |
|
|
491
|
+
|----|----------|-----------|
|
|
492
|
+
| NG1 | MCP server discovery/invocation | Owned by `mcp-management` skill |
|
|
493
|
+
| NG2 | API architecture design | Owned by `api-architect` skill |
|
|
494
|
+
| NG3 | TypeScript patterns | Owned by `typescript-expert` skill |
|
|
495
|
+
| NG4 | MCP protocol specification | Defined by MCP spec (external) |
|
|
496
|
+
| NG5 | Server hosting/deployment | Infrastructure concern |
|
|
497
|
+
| NG6 | Client-side MCP integration | Different concern |
|
|
498
|
+
|
|
499
|
+
---
|
|
500
|
+
|
|
501
|
+
## 5. System Boundaries
|
|
502
|
+
|
|
503
|
+
| Boundary | Owned | Not Owned |
|
|
504
|
+
|----------|-------|-----------|
|
|
505
|
+
| 4-phase build process | Phase definition + order | Phase execution |
|
|
506
|
+
| Framework selection (2 options) | Decision criteria | Framework installation |
|
|
507
|
+
| Design principles (workflow-oriented) | Principle guidance | Tool implementation |
|
|
508
|
+
| Review checklist (4 items) | Checklist definition | Code review execution |
|
|
509
|
+
| Evaluation framework (10 questions) | Question criteria | Test execution |
|
|
510
|
+
| 6 reference files | Knowledge content | Reference file authoring |
|
|
511
|
+
|
|
512
|
+
**Side-effect boundary:** MCP Builder produces build guidance, framework decisions, and evaluation criteria. It does not create files, execute code, or interact with MCP servers.
|
|
513
|
+
|
|
514
|
+
---
|
|
515
|
+
|
|
516
|
+
## 6. Integration Model
|
|
517
|
+
|
|
518
|
+
### 6.1 Agent Contract
|
|
519
|
+
|
|
520
|
+
#### Input Schema
|
|
521
|
+
|
|
522
|
+
```
|
|
523
|
+
Request_Type: string # "phase-guide" | "framework-select" | "review-checklist" |
|
|
524
|
+
# "evaluation" | "design-principles" | "full-guide"
|
|
525
|
+
Context: {
|
|
526
|
+
target_api: string | null # API the MCP server will wrap
|
|
527
|
+
language_preference: string | null # "python" | "typescript" | null
|
|
528
|
+
team_experience: string # "python-heavy" | "typescript-heavy" | "balanced"
|
|
529
|
+
needs_async: boolean # Whether async operations required
|
|
530
|
+
needs_type_safety: boolean # Whether strict typing required
|
|
531
|
+
current_phase: number | null # 1-4, current build phase
|
|
532
|
+
}
|
|
533
|
+
contract_version: string # "2.0.0"
|
|
534
|
+
```
|
|
535
|
+
|
|
536
|
+
#### Output Schema
|
|
537
|
+
|
|
538
|
+
```
|
|
539
|
+
Status: "success" | "error"
|
|
540
|
+
Data: {
|
|
541
|
+
phase: {
|
|
542
|
+
number: number # 1-4
|
|
543
|
+
name: string # "Research" | "Implement" | "Review" | "Evaluate"
|
|
544
|
+
focus: string
|
|
545
|
+
deliverables: Array<string>
|
|
546
|
+
reference_file: string | null
|
|
547
|
+
} | null
|
|
548
|
+
framework: {
|
|
549
|
+
name: string # "python-fastmcp" | "typescript-mcp-sdk"
|
|
550
|
+
rationale: string
|
|
551
|
+
reference_file: string
|
|
552
|
+
} | null
|
|
553
|
+
review: {
|
|
554
|
+
items: Array<{
|
|
555
|
+
check: string
|
|
556
|
+
status: string # "pass" | "fail" | "pending"
|
|
557
|
+
}>
|
|
558
|
+
test_commands: Array<string>
|
|
559
|
+
} | null
|
|
560
|
+
evaluation: {
|
|
561
|
+
criteria: Array<string> # 6 criteria: independent, read-only, complex, realistic, verifiable, stable
|
|
562
|
+
question_count: number # Always 10
|
|
563
|
+
reference_file: string
|
|
564
|
+
} | null
|
|
565
|
+
design_principles: {
|
|
566
|
+
principles: Array<{
|
|
567
|
+
name: string
|
|
568
|
+
description: string
|
|
569
|
+
}>
|
|
570
|
+
reference_file: string
|
|
571
|
+
} | null
|
|
572
|
+
metadata: {
|
|
573
|
+
contract_version: string
|
|
574
|
+
backward_compatibility: string
|
|
575
|
+
}
|
|
576
|
+
}
|
|
577
|
+
Error: ErrorSchema | null
|
|
578
|
+
```
|
|
579
|
+
|
|
580
|
+
#### Error Schema
|
|
581
|
+
|
|
582
|
+
```
|
|
583
|
+
Code: string # From Error Taxonomy (Section 11)
|
|
584
|
+
Message: string
|
|
585
|
+
Request_Type: string
|
|
586
|
+
Recoverable: boolean
|
|
587
|
+
```
|
|
588
|
+
|
|
589
|
+
#### Deterministic Guarantees
|
|
590
|
+
|
|
591
|
+
- Phase order is fixed: Research (1) → Implement (2) → Review (3) → Evaluate (4).
|
|
592
|
+
- Framework selection is deterministic: python-heavy OR needs_async → Python FastMCP; typescript-heavy OR needs_type_safety → TypeScript MCP SDK; balanced → Python FastMCP (default).
|
|
593
|
+
- Review checklist always has 4 items: DRY, error handling, type coverage, docstrings.
|
|
594
|
+
- Evaluation always produces 10 questions with 6 criteria.
|
|
595
|
+
- Design principles always include: workflow-oriented, context-aware output, actionable errors.
|
|
596
|
+
- Reference files are fixed: 6 files in `rules/`.
|
|
597
|
+
|
|
598
|
+
#### What Agents May Assume
|
|
599
|
+
|
|
600
|
+
- Phase order is enforced.
|
|
601
|
+
- Framework decision maps to team experience + requirements.
|
|
602
|
+
- Review checklist is complete (4 mandatory items).
|
|
603
|
+
- Evaluation criteria are stable.
|
|
604
|
+
|
|
605
|
+
#### What Agents Must NOT Assume
|
|
606
|
+
|
|
607
|
+
- MCP spec is bundled (must read from URL).
|
|
608
|
+
- Framework packages are installed.
|
|
609
|
+
- The skill creates MCP server files.
|
|
610
|
+
- Evaluation questions execute automatically.
|
|
611
|
+
|
|
612
|
+
#### Side-Effect Boundaries
|
|
613
|
+
|
|
614
|
+
| Operation | Side Effects |
|
|
615
|
+
|-----------|-------------|
|
|
616
|
+
| Phase guide | None; phase description |
|
|
617
|
+
| Framework select | None; recommendation |
|
|
618
|
+
| Review checklist | None; checklist output |
|
|
619
|
+
| Evaluation | None; criteria + template |
|
|
620
|
+
| Design principles | None; principle guidance |
|
|
621
|
+
| Full guide | None; combined output |
|
|
622
|
+
|
|
623
|
+
### 6.2 Workflow Contract
|
|
624
|
+
|
|
625
|
+
#### Invocation Pattern
|
|
626
|
+
|
|
627
|
+
```
|
|
628
|
+
1. Identify target API and team experience
|
|
629
|
+
2. Invoke framework-select for language decision
|
|
630
|
+
3. Invoke phase-guide for Phase 1 (Research)
|
|
631
|
+
4. Read MCP spec + target API docs (caller's responsibility)
|
|
632
|
+
5. Invoke phase-guide for Phase 2 (Implement)
|
|
633
|
+
6. Build MCP server (caller's responsibility)
|
|
634
|
+
7. Invoke review-checklist for Phase 3 (Review)
|
|
635
|
+
8. Fix issues (caller's responsibility)
|
|
636
|
+
9. Invoke evaluation for Phase 4 (Evaluate)
|
|
637
|
+
10. Create and run 10 test questions (caller's responsibility)
|
|
638
|
+
```
|
|
639
|
+
|
|
640
|
+
#### Execution Guarantees
|
|
641
|
+
|
|
642
|
+
- Each invocation produces a complete phase guide or decision.
|
|
643
|
+
- Phases can be invoked individually or sequentially.
|
|
644
|
+
|
|
645
|
+
#### Failure Propagation Model
|
|
646
|
+
|
|
647
|
+
| Failure Severity | Propagation | Workflow Action |
|
|
648
|
+
|-----------------|-------------|-----------------|
|
|
649
|
+
| Invalid request type | Return error to caller | Use supported type |
|
|
650
|
+
| Invalid phase number | Return error to caller | Use 1-4 |
|
|
651
|
+
| Missing team experience | Return error to caller | Supply experience level |
|
|
652
|
+
| Reference file missing | Return error to caller | Verify installation |
|
|
653
|
+
|
|
654
|
+
#### Retry Boundaries
|
|
655
|
+
|
|
656
|
+
- Zero internal retries. Deterministic output.
|
|
657
|
+
|
|
658
|
+
#### Isolation Model
|
|
659
|
+
|
|
660
|
+
- Each invocation is stateless and independent.
|
|
661
|
+
|
|
662
|
+
#### Idempotency Expectations
|
|
663
|
+
|
|
664
|
+
| Operation | Idempotent | Notes |
|
|
665
|
+
|-----------|-----------|-------|
|
|
666
|
+
| Phase guide | Yes | Same phase = same guide |
|
|
667
|
+
| Framework select | Yes | Same context = same framework |
|
|
668
|
+
| Review checklist | Yes | Fixed 4 items |
|
|
669
|
+
| Evaluation | Yes | Fixed 10-question template |
|
|
670
|
+
| Design principles | Yes | Fixed principles |
|
|
671
|
+
|
|
672
|
+
---
|
|
673
|
+
|
|
674
|
+
## 7. Execution Model
|
|
675
|
+
|
|
676
|
+
### 2-Phase Lifecycle
|
|
677
|
+
|
|
678
|
+
| Phase | Action | Output |
|
|
679
|
+
|-------|--------|--------|
|
|
680
|
+
| **Parse** | Validate request type, context fields | Validated input or error |
|
|
681
|
+
| **Emit** | Generate phase guide, decision, or checklist | Complete output |
|
|
682
|
+
|
|
683
|
+
All phases synchronous. No async pipeline.
|
|
684
|
+
|
|
685
|
+
---
|
|
686
|
+
|
|
687
|
+
## 8. Deterministic Design Principles
|
|
688
|
+
|
|
689
|
+
| Principle | Enforcement |
|
|
690
|
+
|-----------|-------------|
|
|
691
|
+
| Fixed phase order | Research (1) → Implement (2) → Review (3) → Evaluate (4) |
|
|
692
|
+
| Fixed framework selection | python-heavy OR needs_async → FastMCP; else → TypeScript SDK |
|
|
693
|
+
| Workflow over endpoints | Tools designed for agent workflows, never raw API mirror |
|
|
694
|
+
| Fixed review items | DRY, error handling, type coverage, docstrings — always 4 |
|
|
695
|
+
| Fixed evaluation size | 10 questions, 6 criteria |
|
|
696
|
+
| Context-aware output | concise vs detailed mode for tool responses |
|
|
697
|
+
| MCP spec URL fixed | `https://modelcontextprotocol.io/llms-full.txt` |
|
|
698
|
+
|
|
699
|
+
---
|
|
700
|
+
|
|
701
|
+
## 9. State & Idempotency Model
|
|
702
|
+
|
|
703
|
+
Stateless. Fully idempotent. No persistent state.
|
|
704
|
+
|
|
705
|
+
---
|
|
706
|
+
|
|
707
|
+
## 10. Failure Handling Strategy
|
|
708
|
+
|
|
709
|
+
| Failure Class | Behavior | Caller Recovery |
|
|
710
|
+
|---------------|----------|-----------------|
|
|
711
|
+
| Unknown request type | Return `ERR_INVALID_REQUEST_TYPE` | Use supported type |
|
|
712
|
+
| Invalid phase number | Return `ERR_INVALID_PHASE` | Use 1-4 |
|
|
713
|
+
| Missing team experience | Return `ERR_MISSING_EXPERIENCE` | Supply experience |
|
|
714
|
+
| Reference file missing | Return `ERR_REFERENCE_NOT_FOUND` | Verify installation |
|
|
715
|
+
| Build fails (caller) | Not this skill's error | Check tsconfig or pip install |
|
|
716
|
+
|
|
717
|
+
**Invariant:** Every failure returns a structured error. No partial guides.
|
|
718
|
+
|
|
719
|
+
---
|
|
720
|
+
|
|
721
|
+
## 11. Error Taxonomy
|
|
722
|
+
|
|
723
|
+
| Code | Category | Recoverable | Description |
|
|
724
|
+
|------|----------|-------------|-------------|
|
|
725
|
+
| `ERR_INVALID_REQUEST_TYPE` | Validation | No | Request type not supported |
|
|
726
|
+
| `ERR_INVALID_PHASE` | Validation | Yes | Phase number not 1-4 |
|
|
727
|
+
| `ERR_MISSING_EXPERIENCE` | Validation | Yes | Team experience not provided |
|
|
728
|
+
| `ERR_REFERENCE_NOT_FOUND` | Infrastructure | No | Reference file missing |
|
|
729
|
+
|
|
730
|
+
---
|
|
731
|
+
|
|
732
|
+
## 12. Timeout & Retry Policy
|
|
733
|
+
|
|
734
|
+
| Parameter | Default | Maximum | Rationale |
|
|
735
|
+
|-----------|---------|---------|-----------|
|
|
736
|
+
| Decision timeout | N/A | N/A | Synchronous; < 50ms |
|
|
737
|
+
| Internal retries | Zero | Zero | Deterministic output |
|
|
738
|
+
|
|
739
|
+
---
|
|
740
|
+
|
|
741
|
+
## 13. Observability & Logging Schema
|
|
742
|
+
|
|
743
|
+
### Log Entry Format
|
|
744
|
+
|
|
745
|
+
```json
|
|
746
|
+
{
|
|
747
|
+
"trace_id": "uuid",
|
|
748
|
+
"skill_name": "mcp-builder",
|
|
749
|
+
"contract_version": "2.0.0",
|
|
750
|
+
"execution_id": "uuid",
|
|
751
|
+
"timestamp": "ISO-8601",
|
|
752
|
+
"request_type": "string",
|
|
753
|
+
"current_phase": "number|null",
|
|
754
|
+
"framework_selected": "string|null",
|
|
755
|
+
"target_api": "string|null",
|
|
756
|
+
"status": "success|error",
|
|
757
|
+
"error_code": "string|null",
|
|
758
|
+
"duration_ms": "number"
|
|
759
|
+
}
|
|
760
|
+
```
|
|
761
|
+
|
|
762
|
+
### Required Log Points
|
|
763
|
+
|
|
764
|
+
| Event | Log Level | Fields |
|
|
765
|
+
|-------|-----------|--------|
|
|
766
|
+
| Framework selected | INFO | framework_selected, rationale |
|
|
767
|
+
| Phase guide issued | INFO | current_phase, deliverables |
|
|
768
|
+
| Review checklist issued | INFO | items_count |
|
|
769
|
+
| Decision failed | ERROR | error_code, message |
|
|
770
|
+
|
|
771
|
+
### Metrics
|
|
772
|
+
|
|
773
|
+
| Metric | Type | Unit |
|
|
774
|
+
|--------|------|------|
|
|
775
|
+
| `mcpbuilder.decision.duration` | Histogram | ms |
|
|
776
|
+
| `mcpbuilder.framework.distribution` | Counter | python vs typescript |
|
|
777
|
+
| `mcpbuilder.phase.distribution` | Counter | per phase |
|
|
778
|
+
| `mcpbuilder.request_type.distribution` | Counter | per type |
|
|
779
|
+
|
|
780
|
+
---
|
|
781
|
+
|
|
782
|
+
## 14. Security & Trust Model
|
|
783
|
+
|
|
784
|
+
### Data Handling
|
|
785
|
+
|
|
786
|
+
- MCP Builder does not access API keys, credentials, or servers.
|
|
787
|
+
- Reference files contain public knowledge only.
|
|
788
|
+
- Framework selection uses no external calls.
|
|
789
|
+
|
|
790
|
+
### MCP-Specific Security Guidance
|
|
791
|
+
|
|
792
|
+
| Guidance | Enforcement |
|
|
793
|
+
|----------|-------------|
|
|
794
|
+
| Never embed API keys in MCP tools | Design principle output |
|
|
795
|
+
| Rate limit awareness | Research phase deliverable |
|
|
796
|
+
| Error sanitization | Review checklist item |
|
|
797
|
+
|
|
798
|
+
---
|
|
799
|
+
|
|
800
|
+
## 15. Scalability Model
|
|
801
|
+
|
|
802
|
+
| Dimension | Constraint | Mitigation |
|
|
803
|
+
|-----------|-----------|------------|
|
|
804
|
+
| Throughput | CPU-bound decision tree | < 50ms; scales linearly |
|
|
805
|
+
| Concurrency | Stateless invocations | Unlimited parallel |
|
|
806
|
+
| Reference storage | 6 files (~15 KB total) | Static; no growth |
|
|
807
|
+
| Memory per invocation | < 1 MB | No accumulation |
|
|
808
|
+
| Network | Zero network calls | No external dependency |
|
|
809
|
+
|
|
810
|
+
---
|
|
811
|
+
|
|
812
|
+
## 16. Concurrency Model
|
|
813
|
+
|
|
814
|
+
Fully parallel. No shared state. No coordination required.
|
|
815
|
+
|
|
816
|
+
---
|
|
817
|
+
|
|
818
|
+
## 17. Resource Lifecycle Management
|
|
819
|
+
|
|
820
|
+
All resources scoped to invocation. No persistent handles.
|
|
821
|
+
|
|
822
|
+
---
|
|
823
|
+
|
|
824
|
+
## 18. Performance Constraints
|
|
825
|
+
|
|
826
|
+
| Operation | P50 Target | P99 Target | Hard Limit |
|
|
827
|
+
|-----------|-----------|-----------|------------|
|
|
828
|
+
| Framework selection | < 2 ms | < 5 ms | 20 ms |
|
|
829
|
+
| Full guide | < 10 ms | < 30 ms | 50 ms |
|
|
830
|
+
| Output size | ≤ 1,500 chars | ≤ 3,500 chars | 5,000 chars |
|
|
831
|
+
|
|
832
|
+
---
|
|
833
|
+
|
|
834
|
+
## 19. Operational Risks
|
|
835
|
+
|
|
836
|
+
| Risk | Likelihood | Impact | Mitigation |
|
|
837
|
+
|------|-----------|--------|------------|
|
|
838
|
+
| MCP spec URL changes | Low | Research phase broken | Version-pinned URL |
|
|
839
|
+
| Framework deprecation | Low | Selection stale | Review annually |
|
|
840
|
+
| Endpoint-oriented design | Medium | Poor agent UX | Workflow principle enforced |
|
|
841
|
+
| Evaluation questions too simple | Medium | Missing edge cases | 6 criteria enforced |
|
|
842
|
+
| Missing docstrings on tools | High | Agent cannot discover tools | Review checklist item |
|
|
843
|
+
|
|
844
|
+
---
|
|
845
|
+
|
|
846
|
+
## 20. Compliance with skill-design-guide.md
|
|
847
|
+
|
|
848
|
+
| Requirement | Status | Evidence |
|
|
849
|
+
|-------------|--------|----------|
|
|
850
|
+
| YAML frontmatter complete | ✅ | name, description, metadata with category, version, triggers, coordinates_with, success_metrics |
|
|
851
|
+
| SKILL.md < 200 lines | ✅ | Entry point under 200 lines |
|
|
852
|
+
| Prerequisites documented | ✅ | MCP spec URL, Python or TypeScript |
|
|
853
|
+
| When to Use section | ✅ | Situation-based routing table |
|
|
854
|
+
| Core content matches skill type | ✅ | Expert type: decision trees, phase guidance |
|
|
855
|
+
| Troubleshooting section | ✅ | Anti-patterns table |
|
|
856
|
+
| Related section | ✅ | Cross-links to mcp-management, api-architect, typescript-expert |
|
|
857
|
+
| Content Map for multi-file | ✅ | Links to 6 reference files + engineering-spec.md |
|
|
858
|
+
| Contract versioning | ✅ | contract_version, backward_compatibility, breaking_changes |
|
|
859
|
+
| Compliance matrix structured | ✅ | This table with ✅/❌ + evidence |
|
|
860
|
+
|
|
861
|
+
---
|
|
862
|
+
|
|
863
|
+
## 21. Production Readiness Checklist
|
|
864
|
+
|
|
865
|
+
| Category | Check | Status |
|
|
866
|
+
|----------|-------|--------|
|
|
867
|
+
| **Functionality** | 4-phase build process (Research → Implement → Review → Evaluate) | ✅ |
|
|
868
|
+
| **Functionality** | Framework selection (Python FastMCP vs TypeScript MCP SDK) | ✅ |
|
|
869
|
+
| **Functionality** | Review checklist (4 mandatory items) | ✅ |
|
|
870
|
+
| **Functionality** | 10-question evaluation with 6 criteria | ✅ |
|
|
871
|
+
| **Functionality** | Design principles (workflow-oriented, context-aware) | ✅ |
|
|
872
|
+
| **Contracts** | Input/output/error schemas in pseudo-schema format | ✅ |
|
|
873
|
+
| **Contracts** | Contract versioning with semver | ✅ |
|
|
874
|
+
| **Failure** | Error taxonomy with 4 categorized codes | ✅ |
|
|
875
|
+
| **Failure** | No partial guides on error | ✅ |
|
|
876
|
+
| **Failure** | Zero internal retries | ✅ |
|
|
877
|
+
| **Determinism** | Fixed phases, fixed framework selection, fixed checklist | ✅ |
|
|
878
|
+
| **Security** | No credentials, no external calls | ✅ |
|
|
879
|
+
| **Observability** | Structured log schema with 5 mandatory fields | ✅ |
|
|
880
|
+
| **Observability** | 4 metrics defined | ✅ |
|
|
881
|
+
| **Performance** | P50/P99 targets for all operations | ✅ |
|
|
882
|
+
| **Scalability** | Stateless; unlimited parallel | ✅ |
|
|
883
|
+
| **Compliance** | All skill-design-guide.md sections mapped with evidence | ✅ |
|
|
884
|
+
|
|
885
|
+
---
|
|
886
|
+
|
|
887
|
+
|
|
888
|
+
|
|
889
|
+
---
|
|
890
|
+
|
|
891
|
+
## 🔗 Related
|
|
892
|
+
|
|
893
|
+
| File | When to Read |
|
|
894
|
+
|------|-------------|
|
|
895
|
+
| [../SKILL.md](../SKILL.md) | Quick reference, 4-phase build, anti-patterns |
|
|
896
|
+
| [design-principles.md](design-principles.md) | Phase 1 — MCP concepts |
|
|
897
|
+
| [quickstart.md](quickstart.md) | Phase 2 — setup guides |
|
|
898
|
+
| [python-implementation.md](python-implementation.md) | Phase 2 — Python patterns |
|
|
899
|
+
| [typescript-implementation.md](typescript-implementation.md) | Phase 2 — TypeScript patterns |
|
|
900
|
+
| [best-practices.md](best-practices.md) | Phase 3 — review patterns |
|
|
901
|
+
| [evaluation.md](evaluation.md) | Phase 4 — testing framework |
|
|
902
|
+
| `mcp-management` | MCP tool discovery |
|
|
903
|
+
|
|
904
|
+
---
|
|
905
|
+
|
|
906
|
+
### Rule: evaluation
|
|
907
|
+
|
|
908
|
+
---
|
|
909
|
+
name: mcp-evaluation
|
|
910
|
+
description: 10-question evaluation framework for MCP servers — complex, read-only, verifiable test questions
|
|
911
|
+
---
|
|
912
|
+
|
|
913
|
+
# MCP Evaluation Guide
|
|
914
|
+
|
|
915
|
+
> Create 10 complex questions to test your MCP server with real AI agents.
|
|
916
|
+
|
|
917
|
+
---
|
|
918
|
+
|
|
919
|
+
## Purpose
|
|
920
|
+
|
|
921
|
+
Evaluations test whether LLMs can effectively use your MCP server to answer realistic, complex questions.
|
|
922
|
+
|
|
923
|
+
---
|
|
924
|
+
|
|
925
|
+
## Question Requirements
|
|
926
|
+
|
|
927
|
+
Each question MUST be:
|
|
928
|
+
|
|
929
|
+
| Requirement | Description |
|
|
930
|
+
|-------------|-------------|
|
|
931
|
+
| **Independent** | Not dependent on other questions |
|
|
932
|
+
| **Read-only** | Only non-destructive operations |
|
|
933
|
+
| **Complex** | Requires multiple tool calls |
|
|
934
|
+
| **Realistic** | Based on real use cases |
|
|
935
|
+
| **Verifiable** | Single, clear answer |
|
|
936
|
+
| **Stable** | Answer won't change over time |
|
|
937
|
+
|
|
938
|
+
---
|
|
939
|
+
|
|
940
|
+
## Question Creation Process
|
|
941
|
+
|
|
942
|
+
1. **Tool Inspection** - List available tools and capabilities
|
|
943
|
+
2. **Content Exploration** - Use READ-ONLY operations to explore data
|
|
944
|
+
3. **Question Generation** - Create 10 complex, realistic questions
|
|
945
|
+
4. **Answer Verification** - Solve each question yourself
|
|
946
|
+
|
|
947
|
+
---
|
|
948
|
+
|
|
949
|
+
## Example Question
|
|
950
|
+
|
|
951
|
+
```xml
|
|
952
|
+
<qa_pair>
|
|
953
|
+
<question>
|
|
954
|
+
Find discussions about AI model launches with animal codenames.
|
|
955
|
+
One model needed a specific safety designation (ASL-X).
|
|
956
|
+
What number X was determined for the spotted wild cat model?
|
|
957
|
+
</question>
|
|
958
|
+
<answer>3</answer>
|
|
959
|
+
</qa_pair>
|
|
960
|
+
```
|
|
961
|
+
|
|
962
|
+
This requires:
|
|
963
|
+
- Searching discussions about AI models
|
|
964
|
+
- Filtering for animal-themed codenames
|
|
965
|
+
- Identifying safety designation format
|
|
966
|
+
- Finding specific model (cheetah/leopard)
|
|
967
|
+
- Extracting the ASL number
|
|
968
|
+
|
|
969
|
+
---
|
|
970
|
+
|
|
971
|
+
## Output Format
|
|
972
|
+
|
|
973
|
+
```xml
|
|
974
|
+
<evaluation>
|
|
975
|
+
<qa_pair>
|
|
976
|
+
<question>Your complex question here</question>
|
|
977
|
+
<answer>Single verifiable answer</answer>
|
|
978
|
+
</qa_pair>
|
|
979
|
+
<!-- 9 more qa_pairs -->
|
|
980
|
+
</evaluation>
|
|
981
|
+
```
|
|
982
|
+
|
|
983
|
+
---
|
|
984
|
+
|
|
985
|
+
## Anti-Patterns
|
|
986
|
+
|
|
987
|
+
| ❌ Don't | ✅ Do |
|
|
988
|
+
|---------|-------|
|
|
989
|
+
| Simple one-tool questions | Multi-step exploration |
|
|
990
|
+
| Write operations | Read-only operations |
|
|
991
|
+
| Time-sensitive answers | Stable, verifiable answers |
|
|
992
|
+
| Vague answers | Specific, comparable answers |
|
|
993
|
+
|
|
994
|
+
---
|
|
995
|
+
|
|
996
|
+
|
|
997
|
+
|
|
998
|
+
---
|
|
999
|
+
|
|
1000
|
+
## 🔗 Related
|
|
1001
|
+
|
|
1002
|
+
| File | When to Read |
|
|
1003
|
+
|------|-------------|
|
|
1004
|
+
| [../SKILL.md](../SKILL.md) | Phase 4 overview |
|
|
1005
|
+
| [best-practices.md](best-practices.md) | Design patterns to test |
|
|
1006
|
+
| [engineering-spec.md](engineering-spec.md) | Evaluation contracts |
|
|
1007
|
+
|
|
1008
|
+
---
|
|
1009
|
+
|
|
1010
|
+
### Rule: python-implementation
|
|
1011
|
+
|
|
1012
|
+
---
|
|
1013
|
+
name: mcp-python-implementation
|
|
1014
|
+
description: Python MCP server with FastMCP — tool annotations, error helpers, pagination, quality checklist
|
|
1015
|
+
---
|
|
1016
|
+
|
|
1017
|
+
# Python MCP Server Implementation
|
|
1018
|
+
|
|
1019
|
+
> Detailed Python MCP server implementation with FastMCP.
|
|
1020
|
+
|
|
1021
|
+
---
|
|
1022
|
+
|
|
1023
|
+
## Setup
|
|
1024
|
+
|
|
1025
|
+
```bash
|
|
1026
|
+
pip install fastmcp pydantic httpx python-dotenv
|
|
1027
|
+
```
|
|
1028
|
+
|
|
1029
|
+
---
|
|
1030
|
+
|
|
1031
|
+
## Project Structure
|
|
1032
|
+
|
|
1033
|
+
```
|
|
1034
|
+
my-mcp-server/
|
|
1035
|
+
├── server.py # Main entry
|
|
1036
|
+
├── requirements.txt # Dependencies
|
|
1037
|
+
├── .env.example # Environment template
|
|
1038
|
+
└── README.md # Documentation
|
|
1039
|
+
```
|
|
1040
|
+
|
|
1041
|
+
---
|
|
1042
|
+
|
|
1043
|
+
## Basic Server Template
|
|
1044
|
+
|
|
1045
|
+
```python
|
|
1046
|
+
#!/usr/bin/env python3
|
|
1047
|
+
"""MCP Server: [Name]"""
|
|
1048
|
+
|
|
1049
|
+
import os
|
|
1050
|
+
from mcp import FastMCP
|
|
1051
|
+
from pydantic import BaseModel, Field
|
|
1052
|
+
import httpx
|
|
1053
|
+
|
|
1054
|
+
# Initialize
|
|
1055
|
+
mcp = FastMCP("my-service")
|
|
1056
|
+
|
|
1057
|
+
# Optional: Load environment
|
|
1058
|
+
from dotenv import load_dotenv
|
|
1059
|
+
load_dotenv()
|
|
1060
|
+
|
|
1061
|
+
API_KEY = os.getenv("API_KEY")
|
|
1062
|
+
BASE_URL = os.getenv("BASE_URL", "https://api.example.com")
|
|
1063
|
+
|
|
1064
|
+
|
|
1065
|
+
# === Models ===
|
|
1066
|
+
|
|
1067
|
+
class SearchInput(BaseModel):
|
|
1068
|
+
query: str = Field(description="Search query text")
|
|
1069
|
+
limit: int = Field(default=10, ge=1, le=100)
|
|
1070
|
+
format: str = Field(default="concise", pattern="^(concise|detailed)$")
|
|
1071
|
+
|
|
1072
|
+
|
|
1073
|
+
# === Tools ===
|
|
1074
|
+
|
|
1075
|
+
@mcp.tool(
|
|
1076
|
+
readOnlyHint=True,
|
|
1077
|
+
destructiveHint=False,
|
|
1078
|
+
idempotentHint=True,
|
|
1079
|
+
openWorldHint=True,
|
|
1080
|
+
)
|
|
1081
|
+
async def search_items(query: str, limit: int = 10, format: str = "concise") -> str:
|
|
1082
|
+
"""
|
|
1083
|
+
Search for items matching the query.
|
|
1084
|
+
|
|
1085
|
+
Args:
|
|
1086
|
+
query: Search terms (supports AND/OR operators)
|
|
1087
|
+
limit: Maximum results to return (1-100)
|
|
1088
|
+
format: Response format - 'concise' or 'detailed'
|
|
1089
|
+
|
|
1090
|
+
Returns:
|
|
1091
|
+
JSON array of matching items
|
|
1092
|
+
|
|
1093
|
+
Examples:
|
|
1094
|
+
- search_items("status:active", 10, "concise")
|
|
1095
|
+
|
|
1096
|
+
Errors:
|
|
1097
|
+
- If no results: Returns empty array
|
|
1098
|
+
- If limit exceeded: Suggests reducing limit
|
|
1099
|
+
"""
|
|
1100
|
+
async with httpx.AsyncClient() as client:
|
|
1101
|
+
try:
|
|
1102
|
+
response = await client.get(
|
|
1103
|
+
f"{BASE_URL}/search",
|
|
1104
|
+
params={"q": query, "limit": limit},
|
|
1105
|
+
headers={"Authorization": f"Bearer {API_KEY}"}
|
|
1106
|
+
)
|
|
1107
|
+
response.raise_for_status()
|
|
1108
|
+
data = response.json()
|
|
1109
|
+
|
|
1110
|
+
if format == "concise":
|
|
1111
|
+
# Return minimal data
|
|
1112
|
+
return json.dumps([
|
|
1113
|
+
{"id": item["id"], "title": item["title"]}
|
|
1114
|
+
for item in data["results"]
|
|
1115
|
+
])
|
|
1116
|
+
else:
|
|
1117
|
+
# Return full data
|
|
1118
|
+
return json.dumps(data["results"])
|
|
1119
|
+
|
|
1120
|
+
except httpx.HTTPError as e:
|
|
1121
|
+
return json.dumps({
|
|
1122
|
+
"error": str(e),
|
|
1123
|
+
"suggestion": "Check API key or reduce limit"
|
|
1124
|
+
})
|
|
1125
|
+
|
|
1126
|
+
|
|
1127
|
+
@mcp.tool(destructiveHint=True)
|
|
1128
|
+
async def create_item(title: str, content: str) -> str:
|
|
1129
|
+
"""
|
|
1130
|
+
Create a new item.
|
|
1131
|
+
|
|
1132
|
+
Args:
|
|
1133
|
+
title: Item title
|
|
1134
|
+
content: Item content
|
|
1135
|
+
|
|
1136
|
+
Returns:
|
|
1137
|
+
JSON with created item ID
|
|
1138
|
+
"""
|
|
1139
|
+
async with httpx.AsyncClient() as client:
|
|
1140
|
+
response = await client.post(
|
|
1141
|
+
f"{BASE_URL}/items",
|
|
1142
|
+
json={"title": title, "content": content},
|
|
1143
|
+
headers={"Authorization": f"Bearer {API_KEY}"}
|
|
1144
|
+
)
|
|
1145
|
+
response.raise_for_status()
|
|
1146
|
+
return json.dumps(response.json())
|
|
1147
|
+
|
|
1148
|
+
|
|
1149
|
+
# === Resources ===
|
|
1150
|
+
|
|
1151
|
+
@mcp.resource("config://settings")
|
|
1152
|
+
async def get_settings() -> str:
|
|
1153
|
+
"""Get current configuration."""
|
|
1154
|
+
return json.dumps({
|
|
1155
|
+
"base_url": BASE_URL,
|
|
1156
|
+
"version": "1.0.0"
|
|
1157
|
+
})
|
|
1158
|
+
|
|
1159
|
+
|
|
1160
|
+
# === Run ===
|
|
1161
|
+
|
|
1162
|
+
if __name__ == "__main__":
|
|
1163
|
+
mcp.run()
|
|
1164
|
+
```
|
|
1165
|
+
|
|
1166
|
+
---
|
|
1167
|
+
|
|
1168
|
+
## Error Handling Pattern
|
|
1169
|
+
|
|
1170
|
+
```python
|
|
1171
|
+
import json
|
|
1172
|
+
|
|
1173
|
+
def format_error(error: Exception, suggestion: str = None) -> str:
|
|
1174
|
+
"""Format error for AI consumption."""
|
|
1175
|
+
result = {
|
|
1176
|
+
"success": False,
|
|
1177
|
+
"error": str(error),
|
|
1178
|
+
}
|
|
1179
|
+
if suggestion:
|
|
1180
|
+
result["suggestion"] = suggestion
|
|
1181
|
+
return json.dumps(result)
|
|
1182
|
+
|
|
1183
|
+
|
|
1184
|
+
def format_success(data: any) -> str:
|
|
1185
|
+
"""Format success response."""
|
|
1186
|
+
return json.dumps({
|
|
1187
|
+
"success": True,
|
|
1188
|
+
"data": data
|
|
1189
|
+
})
|
|
1190
|
+
```
|
|
1191
|
+
|
|
1192
|
+
---
|
|
1193
|
+
|
|
1194
|
+
## Pagination Helper
|
|
1195
|
+
|
|
1196
|
+
```python
|
|
1197
|
+
async def paginate_all(client, url, params, max_pages=10):
|
|
1198
|
+
"""Fetch all pages of a paginated API."""
|
|
1199
|
+
all_items = []
|
|
1200
|
+
page = 1
|
|
1201
|
+
|
|
1202
|
+
while page <= max_pages:
|
|
1203
|
+
params["page"] = page
|
|
1204
|
+
response = await client.get(url, params=params)
|
|
1205
|
+
data = response.json()
|
|
1206
|
+
|
|
1207
|
+
all_items.extend(data["items"])
|
|
1208
|
+
|
|
1209
|
+
if not data.get("has_next"):
|
|
1210
|
+
break
|
|
1211
|
+
page += 1
|
|
1212
|
+
|
|
1213
|
+
return all_items
|
|
1214
|
+
```
|
|
1215
|
+
|
|
1216
|
+
---
|
|
1217
|
+
|
|
1218
|
+
## Testing
|
|
1219
|
+
|
|
1220
|
+
```bash
|
|
1221
|
+
# Verify syntax only
|
|
1222
|
+
python -m py_compile server.py
|
|
1223
|
+
|
|
1224
|
+
# Test with timeout (prevents hanging)
|
|
1225
|
+
timeout 5s python server.py
|
|
1226
|
+
|
|
1227
|
+
# Use MCP Inspector
|
|
1228
|
+
npx @modelcontextprotocol/inspector python server.py
|
|
1229
|
+
```
|
|
1230
|
+
|
|
1231
|
+
---
|
|
1232
|
+
|
|
1233
|
+
## Quality Checklist
|
|
1234
|
+
|
|
1235
|
+
- [ ] All tools have complete docstrings
|
|
1236
|
+
- [ ] Input validation with Pydantic
|
|
1237
|
+
- [ ] Error handling for all external calls
|
|
1238
|
+
- [ ] Actionable error messages
|
|
1239
|
+
- [ ] "concise" vs "detailed" format option
|
|
1240
|
+
- [ ] Environment variables for secrets
|
|
1241
|
+
|
|
1242
|
+
---
|
|
1243
|
+
|
|
1244
|
+
|
|
1245
|
+
|
|
1246
|
+
---
|
|
1247
|
+
|
|
1248
|
+
## 🔗 Related
|
|
1249
|
+
|
|
1250
|
+
| File | When to Read |
|
|
1251
|
+
|------|-------------|
|
|
1252
|
+
| [../SKILL.md](../SKILL.md) | 4-phase build, review checklist |
|
|
1253
|
+
| [quickstart.md](quickstart.md) | Minimal Python setup |
|
|
1254
|
+
| [typescript-implementation.md](typescript-implementation.md) | TypeScript alternative |
|
|
1255
|
+
| [best-practices.md](best-practices.md) | Workflow design patterns |
|
|
1256
|
+
| [evaluation.md](evaluation.md) | Phase 4 testing |
|
|
1257
|
+
|
|
1258
|
+
---
|
|
1259
|
+
|
|
1260
|
+
### Rule: quickstart
|
|
1261
|
+
|
|
1262
|
+
---
|
|
1263
|
+
name: mcp-quickstart
|
|
1264
|
+
description: Setup guides for Python FastMCP and TypeScript MCP SDK servers with minimal templates
|
|
1265
|
+
---
|
|
1266
|
+
|
|
1267
|
+
# MCP Builder Quick Start
|
|
1268
|
+
|
|
1269
|
+
> Setup guides for Python and TypeScript MCP servers.
|
|
1270
|
+
|
|
1271
|
+
---
|
|
1272
|
+
|
|
1273
|
+
## Python Setup (FastMCP)
|
|
1274
|
+
|
|
1275
|
+
**Installation:**
|
|
1276
|
+
```bash
|
|
1277
|
+
pip install fastmcp pydantic
|
|
1278
|
+
```
|
|
1279
|
+
|
|
1280
|
+
**Minimal Server:**
|
|
1281
|
+
```python
|
|
1282
|
+
from mcp import FastMCP
|
|
1283
|
+
from pydantic import BaseModel, Field
|
|
1284
|
+
|
|
1285
|
+
mcp = FastMCP("my-server")
|
|
1286
|
+
|
|
1287
|
+
@mcp.tool()
|
|
1288
|
+
async def my_tool(param: str) -> str:
|
|
1289
|
+
"""Tool description."""
|
|
1290
|
+
return result
|
|
1291
|
+
|
|
1292
|
+
# Run server
|
|
1293
|
+
if __name__ == "__main__":
|
|
1294
|
+
mcp.run()
|
|
1295
|
+
```
|
|
1296
|
+
|
|
1297
|
+
---
|
|
1298
|
+
|
|
1299
|
+
## TypeScript Setup (MCP SDK)
|
|
1300
|
+
|
|
1301
|
+
**Installation:**
|
|
1302
|
+
```bash
|
|
1303
|
+
npm install @modelcontextprotocol/sdk zod
|
|
1304
|
+
```
|
|
1305
|
+
|
|
1306
|
+
**Minimal Server:**
|
|
1307
|
+
```typescript
|
|
1308
|
+
import { Server } from "@modelcontextprotocol/sdk/server"
|
|
1309
|
+
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio"
|
|
1310
|
+
import { z } from "zod"
|
|
1311
|
+
|
|
1312
|
+
const server = new Server({
|
|
1313
|
+
name: "my-server",
|
|
1314
|
+
version: "1.0.0",
|
|
1315
|
+
})
|
|
1316
|
+
|
|
1317
|
+
// Add tool
|
|
1318
|
+
server.setRequestHandler(ListToolsRequestSchema, async () => ({
|
|
1319
|
+
tools: [
|
|
1320
|
+
{
|
|
1321
|
+
name: "my_tool",
|
|
1322
|
+
description: "Tool description",
|
|
1323
|
+
inputSchema: z.object({ param: z.string() })
|
|
1324
|
+
}
|
|
1325
|
+
]
|
|
1326
|
+
}))
|
|
1327
|
+
|
|
1328
|
+
// Connect transport
|
|
1329
|
+
const transport = new StdioServerTransport()
|
|
1330
|
+
await server.connect(transport)
|
|
1331
|
+
```
|
|
1332
|
+
|
|
1333
|
+
---
|
|
1334
|
+
|
|
1335
|
+
## Running Your Server
|
|
1336
|
+
|
|
1337
|
+
```bash
|
|
1338
|
+
# Python
|
|
1339
|
+
python server.py
|
|
1340
|
+
|
|
1341
|
+
# TypeScript
|
|
1342
|
+
npx ts-node server.ts
|
|
1343
|
+
|
|
1344
|
+
# With Claude Desktop (add to config)
|
|
1345
|
+
{
|
|
1346
|
+
"mcpServers": {
|
|
1347
|
+
"my-server": {
|
|
1348
|
+
"command": "python",
|
|
1349
|
+
"args": ["path/to/server.py"]
|
|
1350
|
+
}
|
|
1351
|
+
}
|
|
1352
|
+
}
|
|
1353
|
+
```
|
|
1354
|
+
|
|
1355
|
+
---
|
|
1356
|
+
|
|
1357
|
+
|
|
1358
|
+
|
|
1359
|
+
---
|
|
1360
|
+
|
|
1361
|
+
## 🔗 Related
|
|
1362
|
+
|
|
1363
|
+
| File | When to Read |
|
|
1364
|
+
|------|-------------|
|
|
1365
|
+
| [../SKILL.md](../SKILL.md) | 4-phase build process |
|
|
1366
|
+
| [python-implementation.md](python-implementation.md) | Full Python server template |
|
|
1367
|
+
| [typescript-implementation.md](typescript-implementation.md) | Full TypeScript server template |
|
|
1368
|
+
| [design-principles.md](design-principles.md) | MCP concepts |
|
|
1369
|
+
|
|
1370
|
+
---
|
|
1371
|
+
|
|
1372
|
+
### Rule: typescript-implementation
|
|
1373
|
+
|
|
1374
|
+
---
|
|
1375
|
+
name: mcp-typescript-implementation
|
|
1376
|
+
description: TypeScript MCP server with Zod validation — tool annotations, strict mode, build/test workflow
|
|
1377
|
+
---
|
|
1378
|
+
|
|
1379
|
+
# TypeScript MCP Server Implementation
|
|
1380
|
+
|
|
1381
|
+
> Detailed TypeScript MCP server implementation with Zod validation.
|
|
1382
|
+
|
|
1383
|
+
---
|
|
1384
|
+
|
|
1385
|
+
## Setup
|
|
1386
|
+
|
|
1387
|
+
```bash
|
|
1388
|
+
npm init -y
|
|
1389
|
+
npm install @modelcontextprotocol/sdk zod dotenv
|
|
1390
|
+
npm install -D typescript @types/node tsx
|
|
1391
|
+
```
|
|
1392
|
+
|
|
1393
|
+
---
|
|
1394
|
+
|
|
1395
|
+
## Project Structure
|
|
1396
|
+
|
|
1397
|
+
```
|
|
1398
|
+
my-mcp-server/
|
|
1399
|
+
├── src/
|
|
1400
|
+
│ ├── index.ts # Main entry
|
|
1401
|
+
│ ├── tools/ # Tool definitions
|
|
1402
|
+
│ └── utils/ # Helpers
|
|
1403
|
+
├── package.json
|
|
1404
|
+
├── tsconfig.json
|
|
1405
|
+
└── .env.example
|
|
1406
|
+
```
|
|
1407
|
+
|
|
1408
|
+
---
|
|
1409
|
+
|
|
1410
|
+
## tsconfig.json
|
|
1411
|
+
|
|
1412
|
+
```json
|
|
1413
|
+
{
|
|
1414
|
+
"compilerOptions": {
|
|
1415
|
+
"target": "ES2022",
|
|
1416
|
+
"module": "NodeNext",
|
|
1417
|
+
"moduleResolution": "NodeNext",
|
|
1418
|
+
"outDir": "./dist",
|
|
1419
|
+
"rootDir": "./src",
|
|
1420
|
+
"strict": true,
|
|
1421
|
+
"esModuleInterop": true,
|
|
1422
|
+
"skipLibCheck": true
|
|
1423
|
+
},
|
|
1424
|
+
"include": ["src/**/*"]
|
|
1425
|
+
}
|
|
1426
|
+
```
|
|
1427
|
+
|
|
1428
|
+
---
|
|
1429
|
+
|
|
1430
|
+
## Basic Server Template
|
|
1431
|
+
|
|
1432
|
+
```typescript
|
|
1433
|
+
// src/index.ts
|
|
1434
|
+
import { Server } from "@modelcontextprotocol/sdk/server/index.js";
|
|
1435
|
+
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
|
|
1436
|
+
import { z } from "zod";
|
|
1437
|
+
import dotenv from "dotenv";
|
|
1438
|
+
|
|
1439
|
+
dotenv.config();
|
|
1440
|
+
|
|
1441
|
+
const API_KEY = process.env.API_KEY;
|
|
1442
|
+
const BASE_URL = process.env.BASE_URL || "https://api.example.com";
|
|
1443
|
+
|
|
1444
|
+
// Initialize server
|
|
1445
|
+
const server = new Server({
|
|
1446
|
+
name: "my-service",
|
|
1447
|
+
version: "1.0.0",
|
|
1448
|
+
}, {
|
|
1449
|
+
capabilities: {
|
|
1450
|
+
tools: {},
|
|
1451
|
+
resources: {},
|
|
1452
|
+
},
|
|
1453
|
+
});
|
|
1454
|
+
|
|
1455
|
+
// === Schemas ===
|
|
1456
|
+
|
|
1457
|
+
const SearchInputSchema = z.object({
|
|
1458
|
+
query: z.string().describe("Search query text"),
|
|
1459
|
+
limit: z.number().int().min(1).max(100).default(10),
|
|
1460
|
+
format: z.enum(["concise", "detailed"]).default("concise"),
|
|
1461
|
+
}).strict();
|
|
1462
|
+
|
|
1463
|
+
const CreateItemSchema = z.object({
|
|
1464
|
+
title: z.string().min(1),
|
|
1465
|
+
content: z.string().min(1),
|
|
1466
|
+
}).strict();
|
|
1467
|
+
|
|
1468
|
+
// === Tools ===
|
|
1469
|
+
|
|
1470
|
+
server.setRequestHandler("tools/list", async () => ({
|
|
1471
|
+
tools: [
|
|
1472
|
+
{
|
|
1473
|
+
name: "search_items",
|
|
1474
|
+
description: `
|
|
1475
|
+
Search for items matching the query.
|
|
1476
|
+
|
|
1477
|
+
Args:
|
|
1478
|
+
query: Search terms (supports AND/OR)
|
|
1479
|
+
limit: Maximum results (1-100)
|
|
1480
|
+
format: 'concise' or 'detailed'
|
|
1481
|
+
|
|
1482
|
+
Examples:
|
|
1483
|
+
- query="status:active type:project"
|
|
1484
|
+
|
|
1485
|
+
Errors:
|
|
1486
|
+
- If no results: Returns empty array
|
|
1487
|
+
`,
|
|
1488
|
+
inputSchema: {
|
|
1489
|
+
type: "object",
|
|
1490
|
+
properties: {
|
|
1491
|
+
query: { type: "string", description: "Search query" },
|
|
1492
|
+
limit: { type: "number", default: 10 },
|
|
1493
|
+
format: { type: "string", enum: ["concise", "detailed"] },
|
|
1494
|
+
},
|
|
1495
|
+
required: ["query"],
|
|
1496
|
+
},
|
|
1497
|
+
annotations: {
|
|
1498
|
+
readOnlyHint: true,
|
|
1499
|
+
destructiveHint: false,
|
|
1500
|
+
idempotentHint: true,
|
|
1501
|
+
openWorldHint: true,
|
|
1502
|
+
},
|
|
1503
|
+
},
|
|
1504
|
+
{
|
|
1505
|
+
name: "create_item",
|
|
1506
|
+
description: "Create a new item",
|
|
1507
|
+
inputSchema: {
|
|
1508
|
+
type: "object",
|
|
1509
|
+
properties: {
|
|
1510
|
+
title: { type: "string" },
|
|
1511
|
+
content: { type: "string" },
|
|
1512
|
+
},
|
|
1513
|
+
required: ["title", "content"],
|
|
1514
|
+
},
|
|
1515
|
+
annotations: {
|
|
1516
|
+
destructiveHint: true,
|
|
1517
|
+
},
|
|
1518
|
+
},
|
|
1519
|
+
],
|
|
1520
|
+
}));
|
|
1521
|
+
|
|
1522
|
+
server.setRequestHandler("tools/call", async (request) => {
|
|
1523
|
+
const { name, arguments: args } = request.params;
|
|
1524
|
+
|
|
1525
|
+
try {
|
|
1526
|
+
switch (name) {
|
|
1527
|
+
case "search_items": {
|
|
1528
|
+
const input = SearchInputSchema.parse(args);
|
|
1529
|
+
const results = await searchItems(input);
|
|
1530
|
+
return { content: [{ type: "text", text: JSON.stringify(results) }] };
|
|
1531
|
+
}
|
|
1532
|
+
|
|
1533
|
+
case "create_item": {
|
|
1534
|
+
const input = CreateItemSchema.parse(args);
|
|
1535
|
+
const result = await createItem(input);
|
|
1536
|
+
return { content: [{ type: "text", text: JSON.stringify(result) }] };
|
|
1537
|
+
}
|
|
1538
|
+
|
|
1539
|
+
default:
|
|
1540
|
+
throw new Error(`Unknown tool: ${name}`);
|
|
1541
|
+
}
|
|
1542
|
+
} catch (error) {
|
|
1543
|
+
return {
|
|
1544
|
+
content: [{
|
|
1545
|
+
type: "text",
|
|
1546
|
+
text: JSON.stringify({
|
|
1547
|
+
error: error instanceof Error ? error.message : "Unknown error",
|
|
1548
|
+
suggestion: "Check input parameters",
|
|
1549
|
+
}),
|
|
1550
|
+
}],
|
|
1551
|
+
isError: true,
|
|
1552
|
+
};
|
|
1553
|
+
}
|
|
1554
|
+
});
|
|
1555
|
+
|
|
1556
|
+
// === Implementation ===
|
|
1557
|
+
|
|
1558
|
+
async function searchItems(input: z.infer<typeof SearchInputSchema>) {
|
|
1559
|
+
const response = await fetch(
|
|
1560
|
+
`${BASE_URL}/search?q=${encodeURIComponent(input.query)}&limit=${input.limit}`,
|
|
1561
|
+
{ headers: { Authorization: `Bearer ${API_KEY}` } }
|
|
1562
|
+
);
|
|
1563
|
+
|
|
1564
|
+
if (!response.ok) {
|
|
1565
|
+
throw new Error(`API error: ${response.status}`);
|
|
1566
|
+
}
|
|
1567
|
+
|
|
1568
|
+
const data = await response.json();
|
|
1569
|
+
|
|
1570
|
+
if (input.format === "concise") {
|
|
1571
|
+
return data.results.map((item: any) => ({
|
|
1572
|
+
id: item.id,
|
|
1573
|
+
title: item.title,
|
|
1574
|
+
}));
|
|
1575
|
+
}
|
|
1576
|
+
|
|
1577
|
+
return data.results;
|
|
1578
|
+
}
|
|
1579
|
+
|
|
1580
|
+
async function createItem(input: z.infer<typeof CreateItemSchema>) {
|
|
1581
|
+
const response = await fetch(`${BASE_URL}/items`, {
|
|
1582
|
+
method: "POST",
|
|
1583
|
+
headers: {
|
|
1584
|
+
"Content-Type": "application/json",
|
|
1585
|
+
Authorization: `Bearer ${API_KEY}`,
|
|
1586
|
+
},
|
|
1587
|
+
body: JSON.stringify(input),
|
|
1588
|
+
});
|
|
1589
|
+
|
|
1590
|
+
if (!response.ok) {
|
|
1591
|
+
throw new Error(`API error: ${response.status}`);
|
|
1592
|
+
}
|
|
1593
|
+
|
|
1594
|
+
return response.json();
|
|
1595
|
+
}
|
|
1596
|
+
|
|
1597
|
+
// === Run ===
|
|
1598
|
+
|
|
1599
|
+
async function main() {
|
|
1600
|
+
const transport = new StdioServerTransport();
|
|
1601
|
+
await server.connect(transport);
|
|
1602
|
+
}
|
|
1603
|
+
|
|
1604
|
+
main().catch(console.error);
|
|
1605
|
+
```
|
|
1606
|
+
|
|
1607
|
+
---
|
|
1608
|
+
|
|
1609
|
+
## Build & Test
|
|
1610
|
+
|
|
1611
|
+
```bash
|
|
1612
|
+
# Build
|
|
1613
|
+
npm run build
|
|
1614
|
+
|
|
1615
|
+
# Verify dist/index.js exists
|
|
1616
|
+
ls dist/index.js
|
|
1617
|
+
|
|
1618
|
+
# Test with MCP Inspector
|
|
1619
|
+
npx @modelcontextprotocol/inspector node dist/index.js
|
|
1620
|
+
```
|
|
1621
|
+
|
|
1622
|
+
---
|
|
1623
|
+
|
|
1624
|
+
## Quality Checklist
|
|
1625
|
+
|
|
1626
|
+
- [ ] Full TypeScript strict mode
|
|
1627
|
+
- [ ] Zod schemas for all inputs
|
|
1628
|
+
- [ ] Complete tool descriptions with examples
|
|
1629
|
+
- [ ] Error handling returns structured JSON
|
|
1630
|
+
- [ ] "concise" vs "detailed" format option
|
|
1631
|
+
- [ ] Environment variables for secrets
|
|
1632
|
+
- [ ] Build succeeds without errors
|
|
1633
|
+
|
|
1634
|
+
---
|
|
1635
|
+
|
|
1636
|
+
|
|
1637
|
+
|
|
1638
|
+
---
|
|
1639
|
+
|
|
1640
|
+
## 🔗 Related
|
|
1641
|
+
|
|
1642
|
+
| File | When to Read |
|
|
1643
|
+
|------|-------------|
|
|
1644
|
+
| [../SKILL.md](../SKILL.md) | 4-phase build, review checklist |
|
|
1645
|
+
| [quickstart.md](quickstart.md) | Minimal TypeScript setup |
|
|
1646
|
+
| [python-implementation.md](python-implementation.md) | Python alternative |
|
|
1647
|
+
| [best-practices.md](best-practices.md) | Workflow design patterns |
|
|
1648
|
+
| [evaluation.md](evaluation.md) | Phase 4 testing |
|
|
1649
|
+
| `typescript-expert` | Advanced TypeScript patterns |
|
|
1650
|
+
|
|
1651
|
+
---
|
|
1652
|
+
|
|
1653
|
+
⚡ PikaKit v3.9.134
|