Skip to content

Commit 7ef27df

Browse files
jpicklykclaude
andcommitted
refactor: integrate template guidance into tool descriptions
- Enhanced ApplyTemplateTool description with template combination patterns and context efficiency techniques - Updated UpdateSectionTextTool description with targeted update strategies and usage examples - Removed TemplateMgtGuidance.kt prompts that were not user-invokable - Integrated template selection strategies and multi-template application guidance directly into tool descriptions - Added category-based template organization and workflow integration patterns - Improved context efficiency guidance for AI agents using template tools This makes template usage patterns automatically available to AI agents rather than requiring manual prompt invocation. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent b41837d commit 7ef27df

File tree

4 files changed

+84
-734
lines changed

4 files changed

+84
-734
lines changed

src/main/kotlin/io/github/jpicklyk/mcptask/application/tools/section/UpdateSectionTextTool.kt

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,29 @@ class UpdateSectionTextTool : BaseToolDefinition() {
2424
This tool allows changing portions of section content by providing the text to replace
2525
and its replacement.
2626
27-
This is particularly useful for large section contents where sending the entire
28-
content for small changes would be inefficient for context usage.
27+
## Context Efficiency Strategy
28+
29+
**PREFERRED** for targeted content updates in large sections:
30+
- Only send the specific text segment to replace and its replacement
31+
- Much more efficient than sending entire content for small changes
32+
- Ideal for correcting typos, updating specific paragraphs, or modifying parts of documentation
33+
- Significantly reduces token usage compared to full content updates
34+
35+
**When to Use**:
36+
- Correcting typos in template-generated content
37+
- Updating specific values or references within larger documentation
38+
- Making incremental improvements to existing sections
39+
- Modifying parts of sections without affecting the overall structure
40+
41+
**Usage Examples**:
42+
- Fixing typos: `oldText: "straegy"` → `newText: "strategy"`
43+
- Updating references: `oldText: "version 1.0"` → `newText: "version 2.0"`
44+
- Modifying template placeholders: `oldText: "[Insert details here]"` → `newText: "Actual implementation details"`
45+
46+
**Compared to Other Update Tools**:
47+
- Use `update_section_text` for content changes (most efficient for partial updates)
48+
- Use `update_section_metadata` for title, format, ordinal, or tag changes
49+
- Use `update_section` for complete content replacement (less efficient)
2950
3051
Parameters:
3152
- id (required): UUID of the section to update

src/main/kotlin/io/github/jpicklyk/mcptask/application/tools/template/ApplyTemplateTool.kt

Lines changed: 60 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,66 @@ class ApplyTemplateTool(
3131

3232
override val description: String = """Apply one or more templates to create sections for a task or feature.
3333
34-
Templates provide a standardized structure for task and feature documentation.
35-
This tool applies templates to an entity, creating sections based on the templates' section definitions.
34+
## Purpose
35+
Templates provide standardized structure for task and feature documentation.
36+
This tool applies templates to an entity, creating sections based on template section definitions.
37+
38+
## Template Application Strategies
39+
40+
**Multiple Template Support**:
41+
- Apply multiple templates in single operation using templateIds array
42+
- Templates applied in array order (later templates' sections appear after earlier ones)
43+
- Use single-item array for one template: ["template-uuid"]
44+
- Use multiple templates for comprehensive coverage: ["uuid1", "uuid2", "uuid3"]
45+
46+
**Template Combination Patterns**:
47+
The template system is organized into composable categories:
48+
49+
**AI Workflow Instructions** (process guidance):
50+
- Local Git Branching Workflow, GitHub PR Workflow
51+
- Task Implementation Workflow, Bug Investigation Workflow
52+
53+
**Documentation Properties** (information capture):
54+
- Technical Approach, Requirements Specification, Context & Background
55+
56+
**Process & Quality** (standards and completion):
57+
- Testing Strategy, Definition of Done
58+
59+
**Recommended Combinations**:
60+
- **Development Task**: Technical Approach + Task Implementation Workflow + Testing Strategy
61+
- **Bug Fix**: Bug Investigation Workflow + Technical Approach + Definition of Done
62+
- **Feature Planning**: Requirements Specification + Context & Background + Testing Strategy
63+
- **Complex Implementation**: Technical Approach + Local Git Branching + GitHub PR + Definition of Done
64+
65+
## Context Efficiency Techniques
66+
67+
**ALWAYS PREFER** direct creation with templates over separate operations:
68+
```
69+
// EFFICIENT
70+
create_task(title: "X", templateIds: ["Y"])
71+
72+
// LESS EFFICIENT
73+
id = create_task(title: "X")
74+
apply_template(entityId: id, templateIds: ["Y"])
75+
```
76+
77+
**Multiple Templates in One Call**:
78+
```
79+
// EFFICIENT
80+
apply_template(entityId: id, templateIds: ["A", "B", "C"])
81+
82+
// LESS EFFICIENT
83+
apply_template(entityId: id, templateIds: ["A"])
84+
apply_template(entityId: id, templateIds: ["B"])
85+
apply_template(entityId: id, templateIds: ["C"])
86+
```
87+
88+
**Template Sequence Optimization**:
89+
1. Start with Context: Context & Background, Requirements Specification
90+
2. Add Technical Detail: Technical Approach for implementation guidance
91+
3. Include Process Guidance: Task Implementation, Bug Investigation workflows
92+
4. Add Git Workflow: Local Git Branching, GitHub PR workflows
93+
5. Ensure Quality: Testing Strategy, Definition of Done
3694
3795
You can apply one or more templates by providing a templateIds array parameter.
3896
Use a single-item array for applying just one template.

src/main/kotlin/io/github/jpicklyk/mcptask/interfaces/mcp/McpServerAiGuidance.kt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,7 @@ object McpServerAiGuidance {
2828
// Add server overview prompt for users
2929
addServerOverviewPrompt(this)
3030

31-
// Add template management guidance
32-
TemplateMgtGuidance.configureTemplateManagementGuidance(this)
31+
// Template management guidance now integrated into tool descriptions
3332

3433
// Add workflow prompts for common task orchestrator workflows
3534
WorkflowPromptsGuidance.configureWorkflowPrompts(this)

0 commit comments

Comments
 (0)