Skip to content

Conversation

@pyraxo
Copy link
Owner

@pyraxo pyraxo commented Oct 18, 2025

Background

Prompts were scattered across multiple packages, making them hard to manage, version, and test. This PR introduces a centralized, type-safe prompt management package.

Changes

  • @recursor/prompts package created:
    • prompts/: Contains all prompt definitions in YAML format.
      • agents/: Planner, Builder, Communicator, Reviewer prompts.
      • builders/: HTML builder prompt.
      • cursor/: Unified Cursor agent prompt.
      • tools/: Tool instruction prompt.
    • src/: Core implementation files.
      • loader.ts: Loads and validates YAML prompts.
      • renderer.ts: Mustache template engine for rendering.
      • types.ts: Core TypeScript interfaces.
      • utils/validation.ts: Runtime validation for variables.
      • utils/cache.ts: LRU cache for rendered prompts.
    • generated/: Auto-generated TypeScript types and prompt accessors. (Added to .gitignore)
    • scripts/generate-types.ts: Script to generate TS types from YAML.
    • tests/: Unit and integration tests for the package.
  • packages/convex/convex/lib/llmProvider.ts updated:
    • Replaced hardcoded agent system prompts with calls to the new @recursor/prompts package.
    • Uses prompts.agent.<agentName>.render() for dynamic prompt generation.
    • Maintains backward compatibility with a feature flag (though not explicitly implemented in this diff, the plan outlines it).
  • packages/convex/package.json updated:
    • Added @recursor/prompts as a workspace dependency.

Testing

  • Unit tests for prompt loader, renderer, validator, and cache (45 tests).
  • Integration tests for agent, cursor, tool, and builder prompts (20 tests).
  • All 65 tests are passing.
  • Prompts render correctly with default and provided variables.
  • Type generation creates valid TypeScript.
  • llmProvider.ts integration verified with sample prompts.

pyraxo and others added 2 commits October 19, 2025 02:51
Resolved conflict in llmProvider.ts by keeping the new prompt management
system implementation. The deprecated getRoleDescription() method now
throws an error directing users to use buildSystemPrompt() instead,
which leverages the centralized @recursor/prompts package.

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

Co-Authored-By: Claude <noreply@anthropic.com>
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