clementine-agent 1.1.26 → 1.1.27

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -812,11 +812,34 @@ export class SelfImproveLoop {
812
812
  ? metrics.advisorInsights.map(a => `- ${a}`).join('\n')
813
813
  : '(no advisor data yet)';
814
814
  const areas = this.config.areas.map(a => `'${a}'`).join(', ');
815
+ // For per-agent cycles, also pull the agent's CURRENT instructions
816
+ // (agent.md body) so the LLM proposes changes informed by what's there
817
+ // rather than blind. Without this, "improve agent X" was generating
818
+ // proposals that contradicted or duplicated standing instructions.
819
+ let agentBodyText = '';
820
+ if (this.config.agentSlug) {
821
+ try {
822
+ const agentFile = path.join(AGENTS_DIR, this.config.agentSlug, 'agent.md');
823
+ if (existsSync(agentFile)) {
824
+ const raw = readFileSync(agentFile, 'utf-8');
825
+ // Cap to keep the prompt tractable — agent.md can be 10K+ chars.
826
+ // The first 4K covers the role, personality, and most standing
827
+ // instructions; deeper sections (long examples, references) are
828
+ // less important for "what should change" decisions.
829
+ const trimmed = raw.length > 4000 ? raw.slice(0, 4000) + '\n\n[...truncated, full file at agents/' + this.config.agentSlug + '/agent.md]' : raw;
830
+ agentBodyText = `\n\n## CURRENT agent.md for "${this.config.agentSlug}"\n` +
831
+ `These are the agent's existing standing instructions — your proposals should refine or extend these, not contradict or duplicate them.\n\n` +
832
+ '```markdown\n' + trimmed + '\n```\n';
833
+ }
834
+ }
835
+ catch { /* non-fatal — fall through with empty body text */ }
836
+ }
815
837
  const agentFocusText = this.config.agentSlug
816
838
  ? `\n\n## AGENT FOCUS: ${this.config.agentSlug}\nThis is a focused improvement cycle for agent "${this.config.agentSlug}" ONLY.\n` +
817
839
  `- You MUST target area "agent" with target "${this.config.agentSlug}", OR area "cron" targeting a cron job that this agent runs.\n` +
818
840
  `- Do NOT propose changes to SOUL.md, AGENTS.md, source code, or other agents.\n` +
819
- `- Focus on improving this agent's personality, instructions, and task execution quality.\n`
841
+ `- Focus on improving this agent's personality, instructions, and task execution quality.\n` +
842
+ agentBodyText
820
843
  : '';
821
844
  // Read SOUL.md evolution candidates from FEEDBACK.md (written by synthesizeFeedbackPatterns)
822
845
  let soulCandidatesText = '';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "clementine-agent",
3
- "version": "1.1.26",
3
+ "version": "1.1.27",
4
4
  "description": "Clementine — Personal AI Assistant (TypeScript)",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",