Files
Story Crater Bot b54585d8f4 feat(M4.1): Add mem skill draft CLI command with integration tests
Adds  command to generate SKILL.md drafts from memory notes:

Files modified:
  crates/mem-cli/src/main.rs
    - Add SkillCommand enum with Draft variant
    - Add Commands::Skill variant to Commands enum
    - Add cmd_skill_draft() handler function
    - Parse project/query-id input
    - Generate SKILL.md with YAML frontmatter
    - Include name, description, when_to_use fields
    - Include generated_from: <sha> provenance
    - Include generated_at: <timestamp>
    - Support --dry-run flag (print without writing)
    - Enforce _drafts/ directory (no direct skills/ writes)
    - Create directory structure automatically

Files created:
  tests/it_skill_draft.rs
    - 7 unit tests (all passing):
      a1: Parses input format (project/query-id)
      a2: Rejects invalid formats (wrong separators, empty)
      a3: Creates _drafts directory structure
      a4: Generates YAML frontmatter with all required fields
      a5: Includes generated_from provenance link
      a6: Enforces _drafts/ directory (not skills/)
      a7: Dry-run mode doesn't write files

Status:
  ✓ All 7 tests pass
  ✓ Command works end-to-end (tested manually)
  ✓ Dry-run mode verified
  ✓ Directory enforcement working

Next (TODO in code):
  - Read L1/L2 memory node from database
  - Use LLM to convert descriptive → procedural memory
  - Retrieve real sha256 from memory_node (replace placeholder)
  - Skill authoring rubric in LLM prompt (name, description, when_to_use)

Blocks: M4.2 (cycle guard), M4.3 (gate)
Depends: M3.4 ✓ (composition gate)
2026-08-25 12:27:29 -07:00
..