# Insights Workflow configuration template - docs/insights.yaml
kind: insights
version: "1"
updated_at: "{{ today }}"

# Insight Accumulation System Configuration
enabled: {{ config.insight.enabled | default(true) }}

# Purpose
purpose: |
  Every dialogue may produce experience worth accumulating.
  The Insight system is the project's "organizational memory" --
  it extracts experience scattered across dialogues, code, and documentation
  into structured knowledge for future developers to retrieve and reuse.

# Accumulation Scenarios
accumulation_scenarios:
  - scenario: "Solved a tricky bug"
    example: "Found GBK encoding causes emoji crash"
    category: "debug"
  - scenario: "Discovered a better approach"
    example: "Using dataclass instead of dict for type safety"
    category: "technique"
  - scenario: "Made an important architecture/design decision"
    example: "Chose Jinja2 over Mako as template engine"
    category: "decision"
  - scenario: "Summarized tool/framework experience"
    example: "pytest fixture scope selection strategy"
    category: "tool"
  - scenario: "Established a reusable workflow"
    example: "CI/CD config checklist for upgrading from 3.8 to 3.9+"
    category: "workflow"
  - scenario: "Found cross-module integration points"
    example: "EventLog and InsightManager collaboration pattern"
    category: "integration"

# Accumulation Flow
accumulation_flow:
  ide_dialogue_mode:
    steps:
      - "Review the main outcomes of this dialogue"
      - "Determine if there is experience worth accumulating"
      - "If yes -> Use vibecollab insight add to create an Insight"
      - "If no -> Skip, continue normal dialogue end flow"
  agent_autonomous_mode:
    description: "Agent automatically evaluates and accumulates insights after completing tasks"

# Dialogue End Checklist
dialogue_end_checklist:
  - item: "Experience check"
    description: "Did this dialogue produce new experience worth accumulating?"
  - item: "Existing search"
    description: "Is there already a similar Insight? (avoid duplicate accumulation)"
  - item: "Accumulation execution"
    description: "If new experience -> vibecollab insight add"

tips:
  - "Better to over-accumulate than to miss"
  - "Insights have automatic decay mechanism"
  - "Infrequently retrieved experience will naturally decrease in weight"

# CLI Commands Reference
cli_commands:
  list: "vibecollab insight list [--active-only]"
  show: "vibecollab insight show <id>"
  add: "vibecollab insight add --title ... --tags ..."
  search: "vibecollab insight search --tags t1,t2"
  use: "vibecollab insight use <id>"
  decay: "vibecollab insight decay [--dry-run]"
  check: "vibecollab insight check [--json]"
  graph: "vibecollab insight graph --show-derivation"
  stats: "vibecollab insight stats"
