skills/prompts/SKILL.md
Version and manage your agent's prompts with LangWatch Prompts CLI. Use for both onboarding (set up prompt versioning for an entire codebase) and targeted operations (version a specific prompt, create a new prompt version). Supports Python and TypeScript.
npx skillsauth add langwatch/langwatch promptsInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
If the user's request is general ("set up prompt versioning", "version my prompts"):
langwatch.prompts.get()If the user's request is specific ("version this prompt", "create a new prompt version"):
langwatch.prompts.get()This skill is primarily code-path (CLI + SDK). If the user has no codebase and wants to create prompts on the platform, use the langwatch CLI (langwatch prompt list, langwatch prompt create, etc.). MCP tools are available as a fallback.
See Plan Limits for how to handle free plan limits gracefully. The free plan has a limited number of prompts. Work within the limits and show value before suggesting an upgrade. Do NOT try to work around limits.
See CLI Setup for installation. The CLI provides all prompt management commands:
langwatch prompt list # List prompts
langwatch prompt init # Initialize prompts project
langwatch prompt create <name> # Create a prompt YAML
langwatch prompt sync # Sync local ↔ remote
langwatch prompt push # Push local to server
langwatch prompt pull # Pull remote to local
langwatch prompt versions <handle> # View version history
langwatch prompt restore <handle> <versionId> # Rollback to a version
langwatch prompt tag assign <prompt> <tag> # Tag a version
If the CLI is not available, set up the MCP as a fallback: See MCP Setup for installation instructions.
Use langwatch prompt --help to see all available commands, or fetch documentation:
fetch_langwatch_docs (MCP) to read the full Prompts CLI documentationCRITICAL: Do NOT guess how to use the Prompts CLI. Read the actual documentation or --help output first.
npm install -g langwatch
langwatch login
langwatch prompt init
This creates a prompts.json config and a prompts/ directory in the project root.
Scan the codebase for hardcoded prompt strings (system messages, instructions, etc.) and create a managed prompt for each one:
langwatch prompt create <name>
This creates a .prompt.yaml file inside the prompts/ directory.
Replace every hardcoded prompt string with a call to langwatch.prompts.get().
agent = Agent(instructions="You are a helpful assistant.")
import langwatch
prompt = langwatch.prompts.get("my-agent")
agent = Agent(instructions=prompt.compile().messages[0]["content"])
const systemPrompt = "You are a helpful assistant.";
const langwatch = new LangWatch();
const prompt = await langwatch.prompts.get("my-agent");
CRITICAL: Do NOT wrap langwatch.prompts.get() in a try/catch with a hardcoded fallback string. The entire point of prompt versioning is that prompts are managed externally. A fallback defeats this by silently reverting to a stale hardcoded copy.
langwatch prompt sync
This pushes your local prompt definitions to the LangWatch platform.
Tags let you label specific prompt versions for deployment stages. Three built-in tags exist:
Update application code to fetch by tag instead of bare slug:
Python:
prompt = langwatch.prompts.get("my-agent", tag="production")
TypeScript:
const prompt = await langwatch.prompts.get("my-agent", { tag: "production" });
Use the Deploy dialog in the LangWatch UI to assign production or staging tags to a version. For programmatic assignment, use the CLI or REST API:
curl -X PUT -H "X-Auth-Token: $LANGWATCH_API_KEY" \
-H "Content-Type: application/json" \
-d '{"versionId": "version-id-here"}' \
"https://app.langwatch.ai/api/prompts/my-agent/tags/production"
In config files or anywhere a prompt identifier is accepted, you can use shorthand: my-agent:production instead of passing a separate tag parameter.
Create custom tags via langwatch prompt tag create <name> (or POST /api/prompts/tags) for workflows like canary releases or blue-green deployments.
Check that your prompts appear on https://app.langwatch.ai in the Prompts section.
langwatch.prompts.get() to fetch managed promptsprompts.get with a hardcoded string) — this silently defeats versioningprompts.json — use the CLI commands (langwatch prompt init, langwatch prompt create, langwatch prompt sync)langwatch prompt sync — prompts must be synced to the platform after creationdevelopment
Add LangWatch tracing and observability to your code. Use for both onboarding (instrument an entire codebase) and targeted operations (add tracing to a specific function or module). Supports Python and TypeScript with all major frameworks.
tools
Test your AI agent with simulation-based scenarios. Covers writing scenario test code (Scenario SDK), creating platform scenarios (CLI or MCP), and red teaming for security vulnerabilities. Auto-detects whether to use code or platform approach based on context.
testing
Test that your AI agent stays observational and doesn't give prescriptive advice in regulated domains (healthcare, finance, legal). Creates scenario tests for boundary enforcement and red team tests for adversarial probing. Use when your agent advises but must not prescribe.
tools
Write scenario tests that verify your CLI tool is usable by AI agents. Ensures commands work non-interactively, provide clear output, and don't hang on prompts. Use when you want to prove your CLI is agent-friendly.