Skip to main content

Enterprise-grade prompt structuring tool for Claude - converts plain text prompts to XML-tagged format

Project description

Claude Tagger (ctag)

Enterprise-grade prompt structuring tool for Claude AI

Convert plain text prompts into XML-tagged prompts following Anthropic's official best practices.

Installation

pip install prompt-xmlifier

Quick Start

# Basic conversion
ctag "Help me write a Python function that calculates fibonacci"

# With labeled sections
ctag "Task: Create a REST API Context: Using FastAPI Do Not: Hardcode credentials"

# From file
ctag --file prompt.txt --output result.xml

# Interactive mode
ctag --interactive

Features

  • Intelligent Parsing: Automatically detects sections and assigns appropriate XML tags
  • Platform Optimization: Optimized outputs for Claude Web, Code CLI, and VS Code
  • Bilingual Support: Works with English and Spanish labels
  • 22 Standard Tags: Full coverage of Anthropic's recommended XML tags
  • Templates: Pre-built templates for common tasks (code review, debugging, etc.)

Supported Platforms

Platform Command
Claude.ai Web ctag -p claude_web "..."
Claude Code Web ctag -p claude_code_web "..."
Claude Code CLI ctag -p claude_code_cli "..."
VS Code Extension ctag -p claude_code_vscode "..."

Available Tags

Directive: <task>, <instructions>, <do>, <do_not>

Context: <context>, <background>

Input: <input>, <code>, <document>, <data>

Output: <output>, <format>

Constraints: <constraints>, <rules>

Persona: <role>, <tone>, <audience>

Learning: <example>, <examples>

Reasoning: <thinking>, <analysis>

Example

Input:

Task: Create a REST API for authentication
Context: FastAPI with PostgreSQL backend
Do Not: Hardcode credentials
Output: Complete Python code

Output:

<task>
  Create a REST API for authentication
</task>

<context>
  FastAPI with PostgreSQL backend
</context>

<do_not>
  Hardcode credentials
</do_not>

<output>
  Complete Python code
</output>

Command Reference

ctag [OPTIONS] [PROMPT]

Input Options:
  PROMPT              Plain text prompt to convert
  -f, --file FILE     Read prompt from file
  -i, --interactive   Enter prompt interactively

Platform Options:
  -p, --platform      Target platform (default: claude_code_cli)
  -t, --template      Use a pre-built template
  --tips              Include platform tips

Output Options:
  -o, --output FILE   Write to file
  --format            Output format: xml, json, both
  --wrap              Wrap in <prompt> tags

Information:
  --list-tags         Show available XML tags
  --list-platforms    Show supported platforms
  --list-templates    Show available templates
  --help              Show help message

Python API

from prompt_xmlifier import PromptXMLifier

xmlifier = PromptXMLifier()
result = xmlifier.convert("Your prompt here")
print(result.to_xml())

License

MIT License

Author

Fuad Oñate - Senior Data Engineer

Links

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

prompt_xmlifier-1.0.0.tar.gz (21.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

prompt_xmlifier-1.0.0-py3-none-any.whl (22.8 kB view details)

Uploaded Python 3

File details

Details for the file prompt_xmlifier-1.0.0.tar.gz.

File metadata

  • Download URL: prompt_xmlifier-1.0.0.tar.gz
  • Upload date:
  • Size: 21.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.0

File hashes

Hashes for prompt_xmlifier-1.0.0.tar.gz
Algorithm Hash digest
SHA256 686c6eed96f90f382b90ded9efea9c62c61891f63c1f0ae570fad61639e03def
MD5 9809442929821c2a55bb80088bf07ba1
BLAKE2b-256 357d31ada70b043f9e7ae15468e3e8850fe9730b573cd1da3fed2e30c5223fa5

See more details on using hashes here.

File details

Details for the file prompt_xmlifier-1.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for prompt_xmlifier-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c569ef3d5ea0d44ea5ab7ad29c13c8d27d0e861e2a3e9453460c4609dd780ba9
MD5 b6d6eee5f2a3d495a3f758861d985aae
BLAKE2b-256 b98a137d4e8a4e31ca3dbc287ccd5687a9f5eb76e987ed940efa1466550266cf

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page