poml-mcp
v0.1.0
Published
MCP server that enhances user prompts using POML-style structure
Maintainers
Readme
poml-mcp
MCP (Model Context Protocol) server to improve and structure prompts using POML best practices, optimized so code agents can solve tasks with more context and reliability.
✨ Goal: clear prompts + executable POML for reproducible flows.
🧠 Works for LLMs/Agents and humans (documentation and action).
🛡️ Stable approach: minimally sufficient, robust POML subset.
Provides
enhance_promptto improve briefs and generate POML.Provides
poml_translateto discover.md/configs and convert them to.pomlwith professional templates (task, output-format, cp, optional stepwise, aggregatedindex.poml).Exposes
.pomlexamples as dynamic resourcespoml-example://{name}.
📚 Table of Contents
- Why this MCP (vision and goal)
- Flow Diagram (high-level)
- Tools Summary
- YAML Configuration (profiles and triggers)
- LLM Auto-configuration
- Quick usage (Inspector CLI)
- POML Integration (optional rendering)
- Gemini Integration (ADK + Gemini CLI)
- Registered tools
- Conversion of Windsurf Workflows (.windsurf/workflows) to POML
- CI (GitHub Actions)
- Environment variables
- Design analysis and decisions
- Development
- Roadmap and Backlog
- License
Why this MCP (vision and goal)
This server pursues two complementary goals:
- Standardize prompts in POML so they are auditable, composable, and executable by agents.
- Reduce initial friction: discover repository documentation/configuration and convert it into POML ready to operate.
Benefits:
- ✅ Clarity and consistency: prompts with explicit sections (
<task>,<output-format>,Style/Include/Constraints). - 🔁 Reproducibility: reusable POML flows in CI/IDE (Windsurf) or agents.
- 📈 Continuous improvement: automated tests (mcp-jest), documented conventions, and YAML configuration.
Flow Diagram (high-level)
flowchart LR
A[User/Agent] -- user_request --> B[enhance_prompt]
B -- enhanced + POML --> C[Client/IDE]
C -- optional: read/render --> D[(POML lib)]
A2[Repo] -- .md / configs --> E[poml_translate]
E -- discover/plan/apply --> F[.poml outputs + index]
A3[Repo] -- error signals --> G[incident_discovery]
G -- plan/apply --> H[Triage POML]Tools Summary
| Tool | Purpose | Modes | Key args | Output |
|---|---|---|---|---|
| enhance_prompt | Improve a brief and generate a POML template | — | user_request, audience, style, output_format, include, constraints | enhanced, poml, rendered? |
| poml_translate | Discover/plan/apply .poml conversions | discover/plan/apply | includeGlobs, excludeGlobs, selections, outputDir, stepwise, aggregateIndex | discovered, proposals, wrote, notes, warnings |
| incident_discovery | Discover incident signals and a triage plan | discover/plan/apply | query, errorTerms, includeGlobs, maxFiles | findings or poml |
| windsurf_to_poml | Alias for Windsurf workflows | discover/plan/apply | selections, outputDir, aggregateIndex, indexName | same as poml_translate |
| auto_configure | LLM-driven auto-configuration | detect/plan/apply | preferLanguage, projectKind | config, notes, warnings |
| generate_docs | Scaffold PLANNING.md, TASK.md, AI_RULES.md | plan/apply | outputDir, planning, task, rules, overwrite, ideRules[], projectName, format?, includePrpSkeleton? | proposals, wrote, warnings, notes |
| generate_prp | Generate Product Requirements Prompt (PRP) from INITIAL and context | apply | initialPath, outputDir, format, docsLinks[], examples[], overwrite, projectName? | wrote, warnings, notes |
| execute_prp | Parse PRP and output execution steps | plan/apply | prpPath, mode, root? | steps, warnings, notes |
| pm_sync | Sync docs/TASK.md with GitHub Issues | plan/apply | provider=github, repo, token?, docsPath?, labels[] | proposals, wrote, warnings, notes |
Recommended POML Workflow (for agents)
Purpose
Use POML MCP to turn free‑text prompts into structured POML for reliable, portable agent execution. Keep team docs human‑friendly in Markdown; use POML when you want executable, composable prompts.
Where POML fits vs Markdown
- Docs (human):
PLANNING.md,TASK.md,AI_RULES.mdremain Markdown. - Prompts (agent/executable): POML via tools like
enhance_prompt,poml_translate,windsurf_to_poml,generate_prp --tool-arg format=poml|both.
End‑to‑end flow
- Send free‑form prompt →
enhance_prompt. - You receive:
enhanced(text),poml(structure),rendered?(text rendered from POML). - Consume in your agent:
- If the agent supports POML: pass
pomldirectly. - If not: use
renderedor render client-side with a POML library.
- If the agent supports POML: pass
- Optional: convert workflows
.windsurf/workflows/*.mdto.pomlwithwindsurf_to_poml/poml_translatefor automation.
Agent integration (quick)
- Case A (native POML): send the
pomlfield fromenhance_prompt. - Case B (text-only): use
rendered. If missing, renderpomlto text using a POML renderer.
Examples
# 1) Enhance a prompt and obtain POML
npx @modelcontextprotocol/inspector --cli node index.mjs --method tools/call \
--tool-name enhance_prompt --tool-arg user_request="Generate a migration plan to PostgreSQL"
# 2) Convert Windsurf workflows to POML
npx @modelcontextprotocol/inspector --cli node index.mjs --method tools/call \
--tool-name windsurf_to_poml --tool-arg mode=plan --tool-arg selections=.windsurf/workflows/generate-docs.md
# 3) Generate a PRP also in .poml
npx @modelcontextprotocol/inspector --cli node index.mjs --method tools/call \
--tool-name generate_prp --tool-arg outputDir=PRPs --tool-arg format=bothRepo pointers
- POML Conventions:
spec/POML_CONVENTIONS.md - Tools:
enhance_prompt,poml_translate,windsurf_to_poml,generate_prpinindex.mjs - Workflows:
.windsurf/workflows/
Global AI Rules recommendation (auto‑generated)
generate_docs now produces AI_RULES.md with rules to:
- Prefer POML-structured prompts via the POML MCP.
- Use
enhance_promptto transform free text into POML. - When an agent does not support POML, use the MCP
renderedoutput.
Requirements
- Node.js 18+
- npm or pnpm
Installation (options)
A) Via npm (recommended for Windsurf/Cascade)
Publish this package to npm (see “Publishing” section) and use npx in your mcp_config.json:
{
"mcpServers": {
"poml-mcp": {
"command": "npx",
"args": ["-y", "<package-name>"]
}
}
}Short alias for dev:
{
"mcpServers": {
"poml-dev": {
"command": "node",
"args": ["E:/scripts-python/POML-MCP/index.mjs"],
"env": { "NODE_ENV": "production" }
}
}
}Notes:
- Replace
<package-name>with the real npm name (e.g.,poml-mcp). - Windsurf looks for this file at
~/.codeium/mcp_config.json.
Alias (short name): you can also register the server key as poml to keep the UI concise, while still installing poml-mcp:
{
"mcpServers": {
"poml": {
"command": "npx",
"args": ["-y", "poml-mcp"]
}
}
}B) Local (development)
At project root:
npm install
npm startTo use it in Windsurf via stdio, you can point to index.mjs with an absolute path from mcp_config.json on Windows/macOS/Linux:
{
"mcpServers": {
"poml-dev": {
"command": "node",
"args": ["E:/scripts-python/POML-MCP/index.mjs"],
"env": { "NODE_ENV": "production" }
}
}
}Tip: Locally, prefer using npm (Option A) once published, to avoid absolute paths.
🧩 YAML Configuration (profiles and triggers)
The server optionally loads poml-mcp.config.yml from the project root (or poml-mcp.config.yaml). This file lets you:
- Define profiles (
profiles) with defaults forenhance_prompt. - Enable
triggersbased onuser_requestcontent (includes/regex) that dynamically adjust style/include/constraints.
Example file: poml-mcp.config.example.yml.
Minimal example:
profiles:
default:
enhance:
audience: "Technical Team"
style: "Professional and concise"
constraints:
- "Do not include sensitive data"
- "Cite evidence when using numbers"
error:
enhance:
audience: "On-call / SRE"
include:
- "Incident context"
- "Steps to reproduce"
- "Relevant logs and stack traces"
output_format: |
Summary
Evidence
Impact
Next steps
Owner
triggers:
- match:
includesAny: ["error", "exception", "stack trace", "traceback"]
profile: error
enhance:
style: "Technical and actionable"🤖 LLM Auto-configuration
The first-run flow can be 100% LLM-assisted using the auto_configure tool:
detectmode: detects project type via signals (package.json,pyproject.toml,go.mod,Cargo.toml,pom.xml,*.csproj|*.sln).planmode: generates an onboarding POML to review/adjust.applymode: writes initial files (non-destructive):poml-mcp.config.yml(default profiles/triggers).- Onboarding workflow at
.windsurf/workflows/llm-auto-config.md.
Examples with Inspector:
npx @modelcontextprotocol/inspector --cli node index.mjs --method tools/call --tool-name auto_configure --tool-arg mode=detect
npx @modelcontextprotocol/inspector --cli node index.mjs --method tools/call --tool-name auto_configure --tool-arg mode=plan
npx @modelcontextprotocol/inspector --cli node index.mjs --method tools/call --tool-name auto_configure --tool-arg mode=applyNotes:
- If your repo does not yet contain
.windsurf/workflows/, the workflow is created to guide you in the IDE. - You can force language or type with
preferLanguageandprojectKind.
Quick usage (Inspector CLI)
List tools and run basic checks without writing your own client:
npx @modelcontextprotocol/inspector --cli node index.mjs --method tools/list
npx @modelcontextprotocol/inspector --cli node index.mjs --method tools/call --tool-name enhance_prompt --tool-arg user_request=Hello
# Discover/plan/apply translation to POML
npx @modelcontextprotocol/inspector --cli node index.mjs --method tools/call --tool-name poml_translate --tool-arg mode=discover
npx @modelcontextprotocol/inspector --cli node index.mjs --method tools/call --tool-name poml_translate --tool-arg mode=plan
npx @modelcontextprotocol/inspector --cli node index.mjs --method tools/call --tool-name poml_translate --tool-arg mode=apply --tool-arg outputDir=poml-output --tool-arg stepwise=true --tool-arg aggregateIndex=trueYou also have npm scripts:
npm run test:inspector:tools
npm run test:inspector:enhance
npm run test:inspector:poml:discover
npm run test:inspector:poml:plan
npm run test:inspector:poml:apply🔎 Sequence Diagram (client-server interaction)
sequenceDiagram
participant IDE as IDE/Inspector
participant MCP as POML (stdio)
participant FS as Filesystem
IDE->>MCP: tools/list
MCP-->>IDE: [enhance_prompt, poml_translate, incident_discovery, ...]
IDE->>MCP: tools/call enhance_prompt { user_request }
MCP-->>IDE: structuredContent { enhanced, poml, rendered? }
IDE->>MCP: tools/call poml_translate { mode: apply, outputDir }
MCP->>FS: write *.poml (+ index.poml if aggregate)
MCP-->>IDE: structuredContent { wrote, notes, warnings }POML Integration (optional rendering)
The server attempts to integrate the actual POML library to render to text:
- Dynamic
importof../packages/poml/index.jsor../packages/poml/dist/index.js. - If no JS build is available,
renderedis omitted in the output. - To enable rendering, build the POML library or provide an accessible JS entry.
🤝 Gemini Integration (ADK + Gemini CLI)
This server supports Google's “vibe building” flow (ADK + Gemini CLI) and uses the llms-full.txt context file from the official ADK repo.
Reference: “Simplify your Agent "vibe building" flow with ADK and Gemini CLI” (Google Developers Blog)
Suggested steps:
- Step 0: Download
llms-full.txtfromgoogle/adk-pythonand place it in your working directory. - Step 1: Ideate a plan with Gemini CLI, referencing
@llms-full.txtso the CLI understands ADK primitives and suggests the right structure. - Step 2: Convert the plan to an ADK agent (the CLI generates ADK code/requirements and tools like
github_tools.py). - Step 3/4: Test and iterate within the CLI loop.
- Step 5: Repeat and improve with short cycles.
How it fits with poml-mcp:
- Design strong briefs with
enhance_prompt, producing clear POML (task/output-format/style/include/constraints) you can port to your ADK agent system prompts/instructions. - Discover docs/configs with
poml_translateand convert them to.pomlto provide structured context to Gemini CLI or as a base specification. - Auto-onboarding with
auto_configure: generate initial config and an onboarding workflow so you can iterate quickly with Gemini CLI in your IDE. - Windsurf: translate
.windsurf/workflows/*.mdto executable POML; use it as a contract for what the agent should automate/build.
Recommended YAML profile snippet for Gemini projects:
profiles:
gemini:
enhance:
audience: "Agent Team (ADK)"
style: "Clear, ADK-idiomatic, actionable steps"
constraints:
- "If llms-full.txt exists, use it as the framework guide"
- "Avoid implicit deps; cite ADK modules/classes explicitly"ADK Overview and Best Practices
The Agent Development Kit (ADK, Python) is a code‑first toolkit for building, evaluating, and deploying sophisticated AI agents with explicit control over tools, orchestration, and state.
When to use ADK
- Complex multi‑step tasks and multi‑agent handoffs.
- Reliability (timeouts, retries, rate limiting) and governance.
- Production use: background workers, APIs, observability, persistence.
Core building blocks
- Agents (behavior + model + tools), tools as first‑class functions.
- Runner and SessionService to execute flows and persist state.
- Orchestrator patterns and agent handoff (
transfer_to_agent).
Best practices
- Strong system prompts/guardrails; follow
spec/POML_CONVENTIONS.mdwhen generating instructions. - Deterministic, idempotent tools with validated inputs and typed outputs.
- Resilience: retries/backoff, timeouts, rate limits, circuit breakers.
- Persist state (sessions, checkpoints) for long workflows.
- Observability: structured logs, metrics, traces.
- Isolation: Python
venv/conda; secrets from.env; containerize for prod.
- Strong system prompts/guardrails; follow
Using ADK with Gemini (Recommended Workflow)
Pair Gemini CLI (for ideation/generation/iteration) with ADK (for runtime robustness):
- Place
llms-full.txt(fromgoogle/adk-python) at the repo root. - In Gemini CLI, ideate a plan referencing
@llms-full.txtso the CLI understands ADK primitives. - Ask the CLI to convert the plan to ADK code (Python modules, tools, requirements).
- Run locally, test, and iterate quickly inside the CLI loop.
- Promote to a service/worker (FastAPI, cron/queues). Add persistence/observability.
Example use cases:
- GitHub triage: orchestrator agent + repo tools; background worker consumes a queue of issues.
- Incident response: parsing logs, root‑cause analysis sub‑agents, remediation proposal; persisted sessions.
- Code refactors: analyze → propose diffs → apply with review “hold points.”
Gemini CLI‑only configuration (no ADK required)
You can use Gemini CLI with this MCP without ADK installed in the project. Configure MCP servers in ~/.gemini/settings.json:
"poml": {
"command": "npx",
"args": ["-y", "poml-mcp"],
"env": { "POML_ENABLE_EXAMPLES": "1" },
"trust": false
}Local/dev alternative:
"poml-dev": {
"command": "node",
"args": ["E:/scripts-python/POML-MCP/index.mjs"],
"env": { "NODE_ENV": "production", "POML_ENABLE_EXAMPLES": "1" },
"trust": false
}Tips:
- Run in the project directory (
gemini). - Use server tools:
enhance_prompt,poml_translate,incident_discovery,windsurf_to_poml. - Non‑interactive:
gemini -p "Summarize architecture". - Include directories:
--include-directories src,docs. - Pick model:
-m gemini-2.5-flash(adjust as needed).
Background agents and multi‑agent patterns (viable architecture)
Gemini CLI is a developer assistant, not a background scheduler. Run agents as services/workers:
- Python ADK service: FastAPI + Runner + SessionService; deploy via Docker/PM2/k8s/Cloud Run; schedule with cron/queues (Pub/Sub, SQS, Redis).
- Node service (no ADK): use the Gemini JS SDK; same service/worker patterns.
- MCP integration: expose management tools to control/observe background agents.
Multi‑agent orchestration:
- Orchestrator agent with sub‑agents and explicit handoffs.
- Persist state; add timeouts and retries between handoffs.
Proposed sibling MCP: background‑orchestrator‑mcp
Purpose: manage background agents/services via MCP so IDE/CLI can control them safely.
- Tools (initial):
agents/list,agents/start,agents/stop,agents/submit_task,agents/logs,agents/health(optionalagents/scale). - Transports: local spawn/PM2/systemd and/or remote HTTP/queues.
- Security: tokens, allowlists; never expose raw shell without confirmations.
- Complements
poml-mcpfor end‑to‑end build + operate in IDE.
Community & Support
- Code of Conduct:
CODE_OF_CONDUCT.md - Contributing:
CONTRIBUTING.md - Security Policy:
SECURITY.md - Support:
SUPPORT.md - Changelog:
CHANGELOG.md
References
- Google Developers Blog: Simplify your Agent “vibe building” flow with ADK and Gemini CLI
- ADK Python
- Repo: https://github.com/google/adk-python
llms-full.txt: https://github.com/google/adk-python/blob/main/llms-full.txt- Multi‑agent FastAPI discussion: https://github.com/google/adk-python/discussions/1241
- Handoff behavior: https://github.com/google/adk-python/issues/714
- Tool use in sub_agents: https://github.com/google/adk-python/issues/53
- Gemini CLI
- Repo: https://github.com/google-gemini/gemini-cli
- Authentication: https://github.com/google-gemini/gemini-cli/blob/main/docs/cli/authentication.md
- Configuration: https://github.com/google-gemini/gemini-cli/blob/main/docs/cli/configuration.md
- MCP servers: https://github.com/google-gemini/gemini-cli/blob/main/docs/tools/mcp-server.md
- Sandboxing: https://github.com/google-gemini/gemini-cli/blob/main/docs/sandbox.md
🧪 Useful scripts (npm)
| Script | Description |
|---|---|
| start | Starts the MCP server over stdio |
| test | Simple test client (client.mjs) |
| test:inspector:* | Examples with Inspector (tools/list, enhance, translate) |
| test:mcpjest:* | MCP protocol tests (CLI and Node API) |
| test:ci | Combined suite for CI |
Registered tools
enhance_prompt
- Description: Improves a brief and returns an enhanced prompt + POML template.
- Input (Zod raw shape):
user_request?: string(default"Test request")audience?: stringstyle?: stringtarget_language?: stringdomain?: stringoutput_format?: string(one item per line)include?: string[]constraints?: string[]examples?: string[]
- Output (outputSchema):
enhanced: stringpoml: stringrendered?: stringmessages?: any[]
poml_translate
- Description: Discovers
.md/configs, proposes, and generates.pomlfollowing POML best practices. - Input (Zod raw shape):
mode: "discover" | "plan" | "apply"root?: string(default: repository root)includeGlobs?: string[]excludeGlobs?: string[]selections?: string[](paths relative toroot)outputDir?: string(defaultpoml-output/)stepwise?: boolean(adds<stepwise-instructions>)interpretWindsurf?: boolean(defaulttrue, interprets Windsurf workflows)aggregateIndex?: boolean(generatesindex.pomlwith<let src=.../>)indexName?: string(defaultindex.poml)
- Output:
discovered?(indiscovermode)proposals?(inplanmode)wrote?: string[](inapplymode)
The Markdown template includes: <task>, <output-format>, <cp caption="Style">, and <code><document parser="txt"/></code>. Config files generate a template focused on intent/rules/parameterization.
incident_discovery
- Description: Searches for error signals in the repository and generates a POML triage plan.
- Input:
mode?: "discover" | "plan" | "apply"(defaultdiscover)root?: stringquery?: string(to narrow the search)includeGlobs?: string[],excludeGlobs?: string[]errorTerms?: string[],maxFiles?: number
- Output:
findings?: { file, hits }[](discover)poml?: string(plan/apply)
Example (plan):
npx @modelcontextprotocol/inspector --cli node index.mjs --method tools/call --tool-name incident_discovery --tool-arg mode=planadk_scaffold_from_poml
- Description: Generates an ADK (Gemini) project skeleton from a POML brief (file path) or inline content. Creates minimal files to bootstrap an agent.
- Input:
pomlPath?: stringpomlContent?: stringoutputDir?: string(defaultadk-agent)agentName?: string(defaultagent)language?: "python"(currently supported)toolset?: "none" | "github"(adds example tools for issues)force?: boolean(overwrite)
- Output:
wrote?: string[]warnings?: string[]notes?: string[]
Example (generate skeleton with GitHub tools):
npx @modelcontextprotocol/inspector --cli node index.mjs \
--method tools/call --tool-name adk_scaffold_from_poml \
--tool-arg outputDir=adk-agent --tool-arg toolset=githubwindsurf_to_poml (alias)
- Description: Shortcut to
poml_translatefocused on.windsurf/workflows/*.md. - Input and Output: identical to
poml_translate, with default globs pointing to the.windsurf/workflows/directory.
generate_docs
- Description: Scans the repository and scaffolds three project docs under an output folder:
PLANNING.md— vision, architecture, constraints, stack, tools.TASK.md— active tasks, milestones, debt, discovered during development.AI_RULES.md— global rules for AI IDEs (Windsurf, Gemini CLI, Cursor, Cline, Roo), with reference links.
- Modes:
plan(dry-run listing) andapply(write files). Non-destructive by default unlessoverwrite=true. - Input:
mode?: "plan" | "apply"(defaultplan)root?: string(default: repository root)outputDir?: string(defaultdocs)planning?: boolean(defaulttrue)task?: boolean(defaulttrue)rules?: boolean(defaulttrue)overwrite?: boolean(defaultfalse)ideRules?: ("windsurf"|"gemini"|"cursor"|"cline"|"roo")[]projectName?: string
- Output:
proposals?(inplan)wrote?: string[](inapply)warnings?: string[],notes?: string[]
Examples with Inspector:
npx @modelcontextprotocol/inspector --cli node index.mjs --method tools/call --tool-name generate_docs --tool-arg mode=plan
npx @modelcontextprotocol/inspector --cli node index.mjs --method tools/call --tool-name generate_docs --tool-arg mode=apply --tool-arg outputDir=docs --tool-arg overwrite=trueGemini CLI tips:
- Add
pomlin~/.gemini/settings.jsonand call the tool from the CLI session. - Run from the project root so relative paths resolve as expected.
Attribution and Inspiration
- Parts of our global AI IDE rules (
docs/AI_RULES.md) and the overall context-engineering approach were inspired by the excellent template by Cole Medin:- https://github.com/coleam00/context-engineering-intro
- That repo demonstrates a strong pattern of:
- Project-wide global rules (
CLAUDE.md) - An explicit feature brief (
INITIAL.md) - Generating a Product Requirements Prompt (PRP) and executing it via custom commands.
- Project-wide global rules (
- POML adapts these ideas for a multi-IDE, MCP-centric workflow. We keep human-first Markdown (
PLANNING.md,TASK.md,AI_RULES.md) for IDE compatibility, and provide.pomloutputs viapoml_translatewhen agents need structured inputs.
Automated tests (mcp-jest)
Run MCP protocol tests with the CLI and Node API:
npm run test:mcpjest:tools # CLI: connection, tools, basic execution
npm run test:mcpjest:api # API: detailed asserts (discover/plan/apply, Windsurf)
npm run test:ci # Combined suite for CIAPI tests validate nested shapes (structuredContent) and write controlled outputs to poml-test-output/.
Conversion of Windsurf Workflows (.windsurf/workflows) to POML
poml_translate detects workflows under .windsurf/workflows/ and, with interpretWindsurf (true by default), applies a specialized POML template that:
- Extracts steps, automation flags (
// turbo,// turbo-all), commands, and artifacts. - Generates clear sections: Title/Summary, Ordered Steps, Flags, Commands, Artifacts, Completion criteria, etc.
Example (included in the repo): .windsurf/workflows/convert-windsurf-to-poml.md.
Apply directly to POML:
npx @modelcontextprotocol/inspector --cli node index.mjs --method tools/call --tool-name poml_translate \
--tool-arg mode=apply \
--tool-arg selections=.windsurf/workflows/convert-windsurf-to-poml.md \
--tool-arg interpretWindsurf=true \
--tool-arg outputDir=poml-test-output-windsurf \
--tool-arg aggregateIndex=trueOutput: .poml files under poml-test-output-windsurf/ and an index.poml with <let src="..."/> if aggregateIndex is enabled.
CI (GitHub Actions)
Includes an example workflow that runs the combined suite:
name: mcp-tests
on: [push, pull_request]
jobs:
test:
runs-on: ubuntu-latest
defaults:
run:
working-directory: .
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'
cache-dependency-path: package-lock.json
- run: npm ci
- run: npm run test:ciEnvironment variables
DEBUG=1: enables extra logging (decisions, globs, counts, paths). Useful for local diagnostics.POML_ENABLE_EXAMPLES=1: exposespoml-example://{name}resources frompoml/examples/. Typically disabled in production.POML_ROOT: forces a project root different fromprocess.cwd(); by default a heuristic is used (findProjectRoot()).
🧠 Design analysis and decisions
- Stable POML subset (
spec/POML_CONVENTIONS.md): minimal tags (<task>,<output-format>,Style/Include/Constraints) for compatibility and predictable DX. - Zod + MCP SDK:
inputSchema/outputSchemaas the SDK’s expected “raw” shapes (Zod v3), keeping contracts clear. - Register before
server.connect(): register all capabilities before opening stdio; avoids race conditions. - Default root (
process.cwd()+ heuristic): detect.git,.windsurf,package.jsonto work without prior config. - Opt-in YAML configuration:
poml-mcp.config.ymlallows profiles and triggers; deterministic deep-merge with defaults. - Opt-in example resources: decouples the package from the examples repository in real deployments.
- Windsurf-first: shortcuts for
.windsurf/workflows/*.mdandwindsurf_to_pomlalias.
What was extracted (and why):
spec/POML_CONVENTIONS.md: base convention to avoid conceptual sprawl and enable compatible evolution.src/conventions.mjs: centralizes templates and default values (e.g.,DEFAULT_OUTPUT_FORMAT, styles, constraints) for consistency.- Optional POML integration: dynamically loads the JS build if present; avoids hard failures when no bundle is available.
- Root heuristics (
findProjectRoot()): supports monorepos and repositories without explicit configuration. - Windsurf translation: interprets
.windsurf/workflows/*.md(honors// turbo/// turbo-all) into executable POML.
See
spec/LLM_AUTO_CONFIG_PROMPT.mdfor the template used byauto_configure.
Registered prompts
poml/enhance
- Guides an LLM to refine the brief and produce POML.
Resources
poml-example://{name}: lists.pomlunderpoml/examples/.gemini-adk://{name}: exposesllms-full.txt(if present at project root). List:llms-full.windsurf-workflow://{name}: lists and reads local.windsurf/workflows/*.md.poml-generated://{path}: reads POML generated underpoml-output/.
MCP Clients
- Transport: stdio (local). SSE/HTTP not included currently.
- Test client:
client.mjs.
Publishing to npm (for distribution)
Recommended steps:
- Define the package name in
package.json(e.g.,poml-mcp). - Remove
"private": trueand add"files"to publish only what’s needed:"files": ["index.mjs", "client.mjs", "README.md"]
- Ensure
"bin": { "poml-mcp": "index.mjs" }(already present) and"engines": { "node": ">=18" }. npm login(if applicable) andnpm publish --access public(for public scopes).- In Windsurf, use Option A (npx) with the published name.
Development
- Dependencies:
@modelcontextprotocol/sdk@^1.4.0,zod@^3.23.8,fast-glob@^3.3.2. - Zod/SDK notes:
- Use “raw” shapes in
inputSchema/outputSchema. - If you define
outputSchema, returnstructuredContentthat validates against the schema.
- Use “raw” shapes in
Roadmap and Backlog
Current status: mcp-jest tests (CLI + API) are green. Windsurf workflow translation to POML is implemented and documented.
Milestone 1 — Windsurf Integration + Packaging
- [ ] Validate connection from Windsurf IDE and verify tools list
- [ ] Provide final
mcp_config.jsonexamples for bothnpxand local (Win/macOS/Linux) - [x] Prepare npm package metadata: set
private=false, ensurefilesandengines - [ ] Publish to npm and verify
npxexecution
Milestone 2 — UX and Discoverability
- [x]
windsurf_to_pomltool (alias ofpoml_translatewithinterpretWindsurfdefaults) - [x]
windsurf-workflow://{name}resource (list.windsurf/workflows/*.md) - [x] Resource for generated
.pomloutputs underpoml-output/
Milestone 3 — Quality and Testing
- [ ] Snapshot/golden tests for
.pomloutputs (regression) - [ ] CI matrix (Ubuntu/Windows/macOS) on Node 18/20/22
- [ ] Lint in CI:
markdownlintfor README andeslintfor code - [ ] Coverage reporting (optional)
Milestone 4 — Tooling Robustness
- [ ] Improve
vendorOf()and heuristics by doc type (mkdocs/sphinx/docusaurus) - [ ] Specialized POML templates by document type: guide, changelog, ADR, config, etc.
- [ ] Automatic suggestions for
includeGlobs/excludeGlobsand detailedwarnings - [ ] Optional logging with
DEBUG=1(decisions, globs, counts, paths)
Milestone 5 — Documentation and Examples
- [ ] Expand
.windsurf/workflows/examples - [ ] Step-by-step tutorial (end-to-end with Inspector and Windsurf)
- [ ] Changelog and
CONTRIBUTING.md
Milestone 6 — Background Orchestrator MCP
- [ ] Implement sibling MCP (
background-orchestrator-mcp) with tools: list/start/stop/submit_task/logs/health - [ ] Local process manager (spawn/PM2) and health probes
- [ ] Optional remote backends (HTTP/queues) with auth
- [ ] Safety: allowlists/tokens; no raw shell exposure by default
- [ ] Docs + examples integrating Gemini CLI and ADK services through MCP
Done
- [x]
poml_translatewithinterpretWindsurfand.windsurf/workflows/support - [x] mcp-jest tests (CLI+API) for
discover/plan/applyincluding the Windsurf case - [x] README updated with tests, CI, and examples
License
MIT
