Skip to content

Feature/58eaf20d ai markdown guidance#13

Merged
jpicklyk merged 5 commits intomainfrom
feature/58eaf20d-ai-markdown-guidance
Oct 10, 2025
Merged

Feature/58eaf20d ai markdown guidance#13
jpicklyk merged 5 commits intomainfrom
feature/58eaf20d-ai-markdown-guidance

Conversation

@jpicklyk
Copy link
Owner

@jpicklyk jpicklyk commented Oct 9, 2025


Add Markdown Transformation Tools for Entity Export

Overview

Adds three new MCP tools for transforming tasks, features, and projects into markdown documents with YAML frontmatter. This enables AI agents to export entities to human-readable,
documentation-friendly formats suitable for file export, wikis, and version control.

Problem Statement

Users need to export task orchestrator entities (tasks, features, projects) to markdown format for:

  • Documentation generation and maintenance
  • File export to wikis, static site generators, or documentation systems
  • Version control and diff-friendly storage
  • Human-readable archives and reports
  • Display in markdown-capable systems

Initial exploration considered adding an includeMarkdownView parameter to existing Get* tools, but this approach would:

  • Double response size when combined with includeSections=true
  • Create unclear use cases (when to use vs not use the parameter)
  • Display poorly in terminal environments (escaped strings instead of rendered markdown)
  • Mix inspection concerns with transformation concerns

Solution

Added 3 dedicated markdown transformation tools:

  • task_to_markdown - Transform tasks to markdown format
  • feature_to_markdown - Transform features to markdown format
  • project_to_markdown - Transform projects to markdown format

Key Design Principles:

  • Separation of Concerns: Inspection tools (get_) return JSON for terminal/API use; transformation tools (_to_markdown) return markdown for export/rendering
  • No Content Duplication: Avoids doubling response size by having separate tools
  • Clear Use Cases: Tool names explicitly indicate transformation intent
  • AI-Friendly: Easier for AI agents to understand when to use each tool

What's Included

Core Implementation:

  • MarkdownRenderer - Domain-layer renderer supporting multiple content formats (markdown, JSON, code, plain text)
  • MarkdownOptions - Configurable rendering options (line endings, code language, heading offsets, etc.)
  • MarkdownRendererTest - Comprehensive test suite (23 tests, 100% passing)

MCP Tools:

  • TaskToMarkdownTool - Retrieves task + sections, renders to markdown
  • FeatureToMarkdownTool - Retrieves feature + sections, renders to markdown
  • ProjectToMarkdownTool - Retrieves project + sections, renders to markdown

MCP Resources:

  • MarkdownResourceProvider - Provides documentation resource explaining markdown capabilities

Documentation:

  • Updated API reference (37 → 40 tools)
  • Updated tool category counts
  • Added "Markdown Transformation" section with usage patterns
  • Updated CHANGELOG with unreleased changes

Markdown Output Format

Each transformation tool produces a markdown document with:

YAML Frontmatter:

id: 550e8400-e29b-41d4-a716-446655440000
type: task
title: Task Title
status: in-progress
priority: high
complexity: 7
tags:
- tag1
- tag2
created: 2025-05-10T14:30:00Z
modified: 2025-05-10T14:30:00Z

Markdown Content:

Task Title

Task summary describing what needs to be done.

Section Title

Section content rendered according to format (markdown, JSON, code, or plain text).

Another Section

More section content...

Testing

  • ✅ All 23 MarkdownRenderer tests passing
  • ✅ Build successful with no errors
  • ✅ No changes to existing Get* tools (verified against main)
  • ✅ All existing functionality preserved

Breaking Changes

None. This is a purely additive change:

  • No modifications to existing tools
  • No schema changes
  • No behavior changes to existing functionality

Tool Count

  • Before: 37 MCP tools
  • After: 40 MCP tools
    • Task Management: 6 → 7 tools
    • Feature Management: 5 → 6 tools
    • Project Management: 5 → 6 tools

Future Considerations

The current implementation renders entities as standalone documents without cross-linking to related entities (e.g., projects don't link to features, features don't link to tasks).
This keeps the output format-agnostic and doesn't assume:

  • File naming conventions
  • Directory structures
  • Link formats (relative/absolute/URI schemes)
  • Whether files will exist on disk

Cross-linking could be added in a future enhancement if specific use cases emerge.


Generated with https://claude.com/claude-code

Co-Authored-By: Claude noreply@anthropic.com

jpicklyk and others added 5 commits October 9, 2025 15:24
Enhance tool descriptions, CLAUDE.md, and MCP resources with markdown
formatting guidance to help AI agents write proper markdown syntax
(headings, lists, bold, code blocks, links) when creating sections.

Updates:
- AddSectionTool.kt: Added "Writing Markdown Content" section with examples
- BulkCreateSectionsTool.kt: Added markdown formatting guidance
- CLAUDE.md: Added "Section Content Formatting Guidelines" section
- TaskOrchestratorResources.kt: Added markdown best practice to guidelines

This provides clear before/after examples showing plain text vs proper
markdown formatting, ensuring content is directly readable and ready for
markdown export features.

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

Co-Authored-By: Claude <noreply@anthropic.com>
- Create MarkdownRendererTest with 23 test cases covering:
  * Task/Feature/Project rendering with frontmatter
  * All ContentFormat types (MARKDOWN, PLAIN_TEXT, JSON, CODE)
  * YAML special character escaping (quotes, backslashes, colons, etc.)
  * Section ordering by ordinal
  * All status types and priority levels
  * MarkdownOptions configurations (frontmatter, code language, heading offset, line endings)
  * Edge cases (empty tags, multiline content, trailing whitespace)

- Fix MarkdownOptions validation to use isNotEmpty() instead of isNotBlank()
  for line ending validation (line endings are intentionally whitespace)

- Fix MarkdownRenderer escapeYamlString to include quotes (") and backslashes (\)
  in special characters set for proper YAML escaping

All tests passing (100% success rate)

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

Co-Authored-By: Claude <noreply@anthropic.com>
…ools

Replace the includeMarkdownView parameter on Get* tools with three dedicated
markdown transformation tools for improved use case clarity and separation
of concerns.

Changes:
- Remove includeMarkdownView parameter from GetTaskTool, GetFeatureTool, GetProjectTool
- Create TaskToMarkdownTool for transforming tasks to markdown
- Create FeatureToMarkdownTool for transforming features to markdown
- Create ProjectToMarkdownTool for transforming projects to markdown
- Register new tools in McpServer
- Update MarkdownResourceProvider documentation to reflect new tools

Benefits:
- Clear separation between inspection (get_*) and transformation (*_to_markdown)
- Avoids content duplication in responses
- Better tool naming that indicates transformation intent
- More intuitive for AI agents and users to understand use cases

All 23 existing tests passing.

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

Co-Authored-By: Claude <noreply@anthropic.com>
Update api-reference.md to document the three new markdown transformation
tools and their use cases:
- Update tool count from 37 to 40
- Update Task Management from 6 to 7 tools
- Update Feature Management from 5 to 6 tools
- Update Project Management from 5 to 6 tools
- Add new "Markdown Transformation" section with usage patterns

The documentation now clearly explains:
- When to use get_* tools (JSON inspection) vs *_to_markdown (export/rendering)
- Use cases for markdown transformation
- Pattern for avoiding content duplication

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

Co-Authored-By: Claude <noreply@anthropic.com>
Add Unreleased section documenting:
- Three new markdown transformation tools
- Removal of includeMarkdownView parameter
- Updated tool counts and category organization
- Technical rationale for design decisions

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

Co-Authored-By: Claude <noreply@anthropic.com>
@jpicklyk jpicklyk merged commit 727f804 into main Oct 10, 2025
1 check passed
@jpicklyk jpicklyk deleted the feature/58eaf20d-ai-markdown-guidance branch October 10, 2025 00:00
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.

1 participant