xml-context-engineering
USE WHEN: writing system prompts, structuring complex instructions, engineering context for Claude agents, optimizing attention efficiency in long prompts.
Skill by mahidalhan
Install
Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.
npx agentmarket install skill/mahidalhan-xml-context-engineering
Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.
Get the weekly diff
The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.
About
Use cases: documents, writing
Reviews
Write a reviewNo reviews yet. Installed it? Reviews come from verified installers only. How reviews work
Permissions
What this skill can do and what it asks for, from its SKILL.md. Checked Oct 25, 2026.
- Tools
- No tools found
- Secrets
- None asked for
- Install scripts
- None found
Network hosts it talks to 1
codeload.github.com· found in install command
Files it touches
~/.claude/skills/xml-context-engineering
What's inside
- Skill name
xml-context-engineering- Description
- USE WHEN: writing system prompts, structuring complex instructions, engineering context for Claude agents, optimizing attention efficiency in long prompts. DO NOT USE WHEN: writing regular code, simple messages, or content where Markdown suffices. For optimal context architecture, trigger deep thinking with "think harder" or "ultrathink" to analyze attention economics thoroughly.
- License
- MIT
- Instructions
- 36 lines in SKILL.md · view on GitHub
Files (1)
- SKILL.md
SKILL.md (first lines)
Transform unstructured prompt content into XML-tagged context that maximizes LLM comprehension. The user provides raw instructions, data, or prompt content needing structure. ## Context Thinking Before tagging anything, analyze the attention economics: - **Boundaries**: Where does one semantic unit end and another begin? Tags mark cognitive boundaries, not arbitrary divisions. - **Hierarchy**: Does nesting reflect logical containment, or are you creating false depth? Flatten unless parent-child relationship is real. - **Retrieval**: Will the model need to reference this section? Name tags for retrieval (`<error_handling>`) not description (`<the_part_about_errors>`). - **Density**: Is this content high-signal enough to warrant its own tag? Low-value content dilutes attention—exclude rather than tag. **CRITICAL**: XML tags are attention anchors, not decorations. If a tag doesn't help the model locate, isolate, or reference content, it's noise. Every tag must earn its tokens. Tag soup—nested structures that add complexity without clarity—is worse than no tagging at all. ## Context Engineering Guidelines Focus on: - **Semantic naming**: Use domain-native tag names (`<constraints>`, `<examples>`, `<tool_guidance>`) that create instant comprehension. Avoid generic names like `<section1>` or `<info>`. - **Flat-first structure**: Default to siblings, not children. Use `<instructions>` and `<context>` as siblings, not `<prompt><instructions><context>`. Nest only when content genuinely belongs inside another. - **Canonical sections**: Standard patterns include `<system_context>`, `<user_background>`, `<instructions>`, `<constraints>`, `<examples>`, `<output_format>`. Deviate only with clear purpose. - **Attribute discipline**: Use attributes for metadata that aids filtering (`<example type="edge_case">`), not for content that should be text. Attributes are invisible to casual scanning. - **Progressive disclosure**: Place high-frequency reference content early. Put `<instructions>` before `<background>`. The model's attention favors content closer to the query. NEVER create nested tags more than 2 levels deep (tag soup destroys readability), use XML for content that Markdown handles better (headers, lists, emphasis), tag every paragraph individually (over-segmentation fragments attention), use closing tags that don't match openers, create tags without content between them, or name tags with verbs (`<process_this>`) instead of nouns (`<processing_rules>`). Match tag density to content criticality. Dense XML for complex multi-part instructions. Light XML (or pure Markdown) for conversational context. System prompts benefit from heavy structure; user messages rarely need any. **IMPORTANT**: Anthropic's research shows context rot increases with token count. XML tags fight this by creating scannable landmarks—but only if used sparingly. The goal is minimum viable structure: just enough tags to create clear boundaries, no more. ## Deep Thinking Mode For complex context architecture, activate extended thinking: - **"think harder"** or **"ultrathink"** triggers maximum reasoning depth (31,999 tokens) - Use for: system prompts >2000 tokens, multi-agent coordination, attention-critical applications - Enables thorough analysis of semantic boundaries, retrieval patterns, and attention economics - Recommended when: prompt engineering for production agents or high-stakes LLM applications
From mahidalhan/claude-hacks, MIT.
More from mahidalhan/claude-hacks
- 0.502score
swift-concurrency-expert
mahidalhan
Swift Concurrency review and remediation for Swift 6.2+.
SkillDFreshness: D★ 33Claude Code +9 - 0.502score
architecture-introspector
mahidalhan
USE WHEN: analyzing existing architectures, evaluating architectural decisions, identifying technical debt, planning refactoring, assessing whether patterns…
SkillDFreshness: D★ 33Claude Code +9 - 0.502score
skill-creator
mahidalhan
USE WHEN: user asks to create a skill, scaffold a new capability, codify expertise into reusable instructions, or says "create skill", "new skill", "make a…
SkillDFreshness: D★ 33Claude Code +9 - 0.502score
threaded-explainer
mahidalhan
USE WHEN: teaching complex topics requiring chunked delivery, handling mid-explanation questions, preserving context across interrupts, deep-dive explanations…
SkillDFreshness: D★ 33Claude Code +9 - 0.502score
exa-code-context
mahidalhan
USE WHEN: needing real code examples from GitHub, finding API usage patterns, looking up framework setup, verifying library implementations, eliminating…
SkillDFreshness: D★ 33Claude Code +9 - 0.497score
mermaid-diagrams
mahidalhan
USE WHEN: user needs diagrams, flowcharts, ERDs, sequence diagrams, state machines, architecture visualizations, or says "visualize", "diagram", "chart"…
SkillDFreshness: D★ 33Claude Code +9 - 0.497score
task-orchestrator
mahidalhan
USE WHEN: planning complex multi-step tasks, organizing work with dependencies, identifying parallelization opportunities, breaking down large features into…
SkillDFreshness: D★ 33Claude Code +9 - 0.497score
algorithmic-art
mahidalhan
USE WHEN: user requests generative art, algorithmic art, procedural visuals, flow fields, particle systems, creative coding, or says "create art"…
SkillDFreshness: D★ 33Claude Code +9 - 0.497score
standup
mahidalhan
USE WHEN: returning to a project after time away (1 day to 30 days), needing project status briefing, understanding where work left off, determining next steps.
SkillDFreshness: D★ 33Claude Code +9 - 0.497score
ascii-art-explainer
mahidalhan
USE WHEN: visualizing algorithms, data structures, architecture, control flow with ASCII art, or when terminal-friendly diagrams are needed.
SkillDFreshness: D★ 33Claude Code +9 - 0.497score
frontend-design
mahidalhan
USE WHEN: building web components, pages, or applications requiring distinctive visual design, user says "design", "UI", "frontend", "interface", or wants…
SkillDFreshness: D★ 33Claude Code +9 - 0.497score
explainer
mahidalhan
USE WHEN: user asks "explain", "teach me", "how does X work", "help me understand", or wants to learn concepts from first principles with interactive…
SkillDFreshness: D★ 33Claude Code +9
Signals
- Stars
- 33
- Forks
- 5
- Open issues
- 1
- Last commit (this folder)
- Jan 8, 2026 (9 months ago)
From GitHub (fetched Oct 24, 2026).
Details
- License
- MIT
- Repository
- github.com/mahidalhan/claude-hacks
- First seen
- Oct 24, 2026
- Last checked
- Oct 24, 2026
- Source
- GitHubgithub-graphql
More from mahidalhan
- 0.502score
skill-creator
mahidalhan
USE WHEN: user asks to create a skill, scaffold a new capability, codify expertise into reusable instructions, or says "create skill", "new skill", "make a…
SkillDFreshness: D★ 33Claude Code +9 - 0.502score
swift-concurrency-expert
mahidalhan
Swift Concurrency review and remediation for Swift 6.2+.
SkillDFreshness: D★ 33Claude Code +9 - 0.502score
exa-code-context
mahidalhan
USE WHEN: needing real code examples from GitHub, finding API usage patterns, looking up framework setup, verifying library implementations, eliminating…
SkillDFreshness: D★ 33Claude Code +9 - 0.502score
architecture-introspector
mahidalhan
USE WHEN: analyzing existing architectures, evaluating architectural decisions, identifying technical debt, planning refactoring, assessing whether patterns…
SkillDFreshness: D★ 33Claude Code +9 - 0.502score
threaded-explainer
mahidalhan
USE WHEN: teaching complex topics requiring chunked delivery, handling mid-explanation questions, preserving context across interrupts, deep-dive explanations…
SkillDFreshness: D★ 33Claude Code +9 - 0.497score
publish-skill
mahidalhan
USE WHEN: user wants to publish, port, or share a skill to a marketplace repo.
SkillDFreshness: D★ 33Claude Code +9
Cite this page
xml-context-engineering skill. Agent Mart. https://agentmart.dev/skills/mahidalhan-xml-context-engineering (last updated 2026-10-24)