Skip to content

Conversation

@mattpodwysocki
Copy link
Contributor

Summary

Implements three high-value MCP prompts that orchestrate multiple tools to guide AI assistants through complex multi-step workflows with built-in best practices.

Addresses the need for automatic token management when creating and previewing styles (as discussed in #45).

New Prompts

1. create-and-preview-style

Create a map style with automatic token management:

  • ✅ Checks for existing public token with styles:read scope
  • ✅ Creates new public token if needed
  • ✅ Creates the map style
  • ✅ Generates preview link

2. build-custom-map

Use conversational AI to build themed map styles:

  • ✅ Leverages Style Builder tool for AI-powered styling
  • ✅ Supports themes like "dark cyberpunk", "nature-focused", "minimal monochrome"
  • ✅ Can emphasize specific features (parks, transit, roads, etc.)
  • ✅ Creates and previews the styled map

3. analyze-geojson

Complete GeoJSON analysis workflow:

  • ✅ Validates GeoJSON format
  • ✅ Calculates bounding boxes
  • ✅ Provides coordinate conversion examples
  • ✅ Generates interactive visualizations

Infrastructure

  • BasePrompt: Abstract base class for all prompts with argument validation
  • promptRegistry: Centralized prompt management and discovery
  • MCP Integration: Automatic registration with proper Zod schema conversion
  • Full Test Coverage: 37 new tests, all passing ✅

Changes

  • Added src/prompts/ directory with prompt implementations
  • Added test/prompts/ directory with comprehensive test coverage
  • Updated src/index.ts to register prompts with MCP server
  • Updated README.md with prompts documentation and examples
  • Updated CLAUDE.md with prompt architecture patterns

Testing

All 323 tests pass including 37 new prompt tests.

Test Files  33 passed (33)
     Tests  323 passed (323)

Documentation

Complete documentation added to README.md with:

  • Prompt descriptions
  • Argument specifications
  • Usage examples
  • Workflow explanations

🤖 Generated with Claude Code

Implement three high-value prompts that orchestrate multiple tools:

1. create-and-preview-style: Create a map style with automatic token
   management. Checks for existing public tokens, creates one if needed,
   then creates the style and generates a preview link.

2. build-custom-map: Use conversational AI to build themed map styles
   (e.g., "dark cyberpunk", "nature-focused"). Leverages the Style
   Builder tool for AI-powered style generation.

3. analyze-geojson: Complete GeoJSON analysis workflow with validation,
   bounding box calculation, coordinate conversion, and visualization.

Infrastructure:
- BasePrompt abstract class for all prompts
- promptRegistry for centralized prompt management
- Integration with MCP server using Zod schemas
- Full test coverage (37 new tests, all passing)

Documentation updated in README.md and CLAUDE.md with usage examples.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
@mattpodwysocki mattpodwysocki requested a review from a team as a code owner December 18, 2025 23:08
Adds three essential workflow prompts to complement the existing three:

New Prompts:
- setup-mapbox-project: Complete project initialization with tokens,
  styles, and integration guidance. Handles web, mobile, backend, and
  fullstack projects with proper security (URL restrictions, secret
  token management).

- debug-mapbox-integration: Systematic 6-phase troubleshooting workflow.
  Diagnoses token issues, style problems, and API errors. Provides
  specific solutions for 401, 403, and layer/source errors.

- design-data-driven-style: Guide for creating styles with data-driven
  expressions. Supports color/size/heatmap visualizations with sequential,
  diverging, and categorical color schemes. Includes advanced expressions
  and best practices.

Test Coverage:
- 3 new prompt implementation files
- 3 new comprehensive test files (44 tests total)
- Updated promptRegistry test (now validates 6 prompts)
- All 370 tests passing ✅

Documentation:
- Updated README with detailed prompt descriptions, arguments, and examples
- Each prompt includes workflow steps and example usage

🤖 Generated with Claude Code
Copy link
Member

@zmofei zmofei left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice prompt implementation, good for multi-step workflows.

  • [NIT] BasePrompt.ts:24 mentions "snake_case", but the prompts use kebab-case. Not blocking.

*/
export abstract class BasePrompt {
/**
* Unique identifier for the prompt (snake_case)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[Nit] Here we mentioned snake_case but actually the prompt uses kebab-case , e..g create-and-preview-style

@mattpodwysocki mattpodwysocki merged commit 83dff66 into main Dec 19, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants