This document outlines structured formats for providing instructions to Claude that maximize clarity, reliability, and successful execution, especially for complex technical tasks.
## PHASE: Analysis [NO CODE CHANGES]
TASK: Analyze all custom types in file X
REQUIREMENTS:
- List each type name
- For each type, identify where it's used
- For each type, find if equivalent exists in reference code
OUTPUT FORMAT:
| Type | Used In | Equivalent In Reference | Notes |
## PHASE: Planning [NO CODE CHANGES]
TASK: Create plan based on analysis
REQUIREMENTS:
- For each type, define specific action (keep/remove/modify)
- Include reasoning for each decision
WAIT FOR APPROVAL: Yes
## PHASE: Implementation
TASK: Execute approved plan
REQUIREMENTS:
- Process ONE type at a time
- Show diff after each change
- Verify code compiles after each change
## ANALYSIS: Custom Schema Types
FOCUS: File path/to/CustomTypes.kt
COLLECT:
1. List all type names in the file
2. For each type:
- Identify all references in the codebase
- Check if equivalent exists in Swift counterpart at path/to/SwiftTypes.swift
FORMAT OUTPUT AS:
| Type Name | References in Kotlin | Equivalent in Swift | Action Needed |
## STEP 1: Examine file X
EXECUTE: Read file X
ANALYZE: Identify all methods that match pattern Y
VERIFY: Show output before proceeding
## STEP 2: Cross-reference with reference implementation
EXECUTE: For each method identified in Step 1
ANALYZE: Find matching method in reference file
VERIFY: Show match status before proceeding
## STEP 3: Implement changes
EXECUTE: Only after Step 2 verification
CHANGE: Apply specific modifications based on analysis
VERIFY: Test each change before proceeding to next
## TASK: Fix Schema Type Mismatches
FOR EACH type in CustomTypes.kt:
IF type exists in SwiftTypes.swift:
IF signatures match exactly:
ACTION: Keep as is
ELSE:
ACTION: Modify to match Swift signature
ELSE IF type is used in Kotlin implementation:
IF matching functionality exists in Swift:
ACTION: Rename and restructure to match Swift pattern
ELSE:
ACTION: Keep but mark as Kotlin-specific extension
ELSE:
ACTION: Remove unused type
## TASK: Update API Implementation
STATUS: [IN PROGRESS | COMPLETE | BLOCKED]
COMPLETED:
- ✅ Step 1: Analysis of types
- ✅ Step 2: Identified mismatches
IN PROGRESS:
- 🔄 Step 3: Fixing parameter types in Method X
PENDING:
- ⏱️ Step 4: Fix return types
- ⏱️ Step 5: Final verification
BLOCKERS:
- 🛑 Need clarification on Type X implementation
## VALIDATION: API Implementation
TEST CASES:
1. Function X with parameter Y
- Expected: Z
- Actual: [PASS|FAIL] with details
2. Function A with parameter B
- Expected: C
- Actual: [PASS|FAIL] with details
ISSUES FOUND:
1. Method D fails when...
- Root cause: ...
- Fix plan: ...
- Explicit Verification Points: Always include points where Claude should pause and verify before proceeding
- Single Responsibility: Each instruction should do one thing clearly
- Clear Input/Output: Specify exact format for output
- Measurable Completion: Define what "done" looks like
- Context Preservation: Reference specific lines/files
- Checkpointing: Save progress regularly
- Iterative Approach: Break complex tasks into smaller, verifiable units
When using task lists:
## TASK LIST: API Implementation [CURRENT STATUS: 2/5 COMPLETE]
- [x] Analyze schema types
- [x] Create mapping document
- [ ] UPDATE NEXT: Implement parameter type fixes
- [ ] Fix return types
- [ ] Remove unused methods
- Always mark the NEXT task to be executed with "UPDATE NEXT" to clearly signal which task should be worked on
- Always update the status count in the heading
- Check off tasks as they are completed
- Only proceed to the next task when the current one is fully completed and verified