Skip to content

Bug: instinct-cli.py import loses content after frontmatter #148

@ericcai0814

Description

@ericcai0814

Hi! First of all, thank you so much for creating this amazing plugin - the continuous learning system is really impressive! 🙏

I encountered an issue with the /instinct-import command and wanted to share my findings in case it helps.

Issue Summary

When importing instinct files using instinct-cli.py import, only the frontmatter metadata is preserved. The actual content (Action, Evidence, Examples sections) after the closing --- is lost.

Steps to Reproduce

  1. Create an instinct file with full content:
---
id: my-instinct
trigger: "when doing something"
confidence: 0.9
domain: git
---

# My Instinct Title

## Action
Do this specific thing...

## Evidence
- Observed 10 times
  1. Run /instinct-import path/to/instinct.yaml

  2. Check the imported file in ~/.claude/homunculus/instincts/inherited/

Expected Result

The imported file should contain the complete content including Action, Evidence, and Examples sections.

Actual Result

The imported file only contains the frontmatter, missing everything after the second ---:

---
id: my-instinct
trigger: "when doing something"
confidence: 0.9
domain: git
source: inherited
---

Analysis

I traced the issue to parse_instinct_file() in skills/continuous-learning-v2/scripts/instinct-cli.py (around line 43-86).

The current logic appends the instinct immediately when the frontmatter ends (second ---), before any content has been collected. The content that follows gets collected into content_lines, but by then current has already been reset to {}.

I believe the fix would be to defer appending the instinct until the next --- is encountered (start of a new instinct) or at EOF, rather than at the end of frontmatter.

Workaround

For now, I'm manually copying the full instinct files:

cp project/.claude/instincts/*.yaml ~/.claude/homunculus/instincts/inherited/

Environment

  • Plugin version: 1.2.0
  • macOS

Thanks again for all your work on this plugin! Happy to help test a fix if needed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingquestionFurther information is requested

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions