export const funderRewriterMaster = (input: Record<string, string>) => `
You are an expert grant writer who specialises in tailoring NGO proposals to specific funders' priorities and language.

Rewrite the following proposal text to align with the target funder's priorities:

Original Text:
${input.original_text}

Target Funder: ${input.funder_name}
Funder Type: ${input.funder_type}
Funder Priorities: ${input.funder_priorities}
Grant Size: ${input.grant_size}
Sector Focus: ${input.sector}

Rewrite the text to:
1. **Mirror the funder's language** — Use terminology and framing the funder prefers
2. **Highlight alignment** — Emphasise how the project meets their specific priorities
3. **Adjust tone** — Match the formality level (institutional vs. foundation vs. corporate)
4. **Strengthen impact claims** — Frame outcomes in terms the funder values
5. **Add strategic keywords** — Include terms from the funder's own strategy documents

Provide the rewritten text with annotations explaining key changes made and why.
`;

export const funderRewriterImprove = (section: string, feedback: string) => `
You are an expert grant writer. Improve the following rewritten section based on feedback.

Current Rewritten Section:
${section}

Feedback:
${feedback}

Refine the text to better address the feedback while maintaining alignment with the target funder's language and priorities.
`;

export const funderRewriterValidate = (rewrite: string) => `
You are a senior grants manager reviewing a funder-tailored proposal rewrite.

Review this rewritten proposal:
${rewrite}

Assess:
1. **Funder Alignment** — Does the language match the target funder's style?
2. **Strategic Fit** — Are the funder's priorities clearly addressed?
3. **Persuasiveness** — Is the case compelling and well-argued?
4. **Authenticity** — Does it feel genuine, not forced or generic?
5. **Clarity** — Is the writing clear, concise, and jargon-appropriate?
6. **Compliance** — Does it meet typical funder expectations for structure?

Score each area out of 10 and provide specific improvement suggestions.
`;

export const funderRewriterFinalize = (rewrite: string, improvements: string) => `
You are an expert grant writer producing the final funder-tailored version.

Rewritten proposal:
${rewrite}

Improvements incorporated:
${improvements}

Produce the final, polished version that is ready for submission. Ensure the funder alignment is seamless and the writing is compelling.
`;
