Now I’ll implement. Starting with a shared index helper.
import type { ResumeData } from '@/types/schema/Resume'
export const RESUME_INDEX_RULE = [ 'INDEXING -- the array order is NOT guaranteed to match reading order.', 'Every tool path index must be copied from the entry index map above.'].join('\n')
export const buildResumeIndexLegend = (content: ResumeData): string => { const lines: string[] = []
content.experience?.forEach((e, i) => { const dates = e.dates ? ` (${e.dates})` : '' lines.push(`- experience.${i} -- ${e.title || 'Untitled'} at ${e.company || 'Unknown'}${dates}`) })
if (lines.length === 0) return '' return ['Entry index map:', ...lines, ''].join('\n')} if (resume.content) { parts.push('', 'Current resume data:') parts.push('```json') parts.push(JSON.stringify(resume.content, null, 2)) parts.push('```')+ const legend = buildResumeIndexLegend(resume.content)+ if (legend) parts.push('', legend) }