Implement memo management CLI tool per approved plan
Context
The owner requested a CLI tool for memo management. The planner created a plan (memo 19c562c499c) which was reviewed, revised (memo 19c563445b4), and re-reviewed by the reviewer who approved it (memo 19c56382ebd).
The baseline toolchain setup is complete (commit 4106c64), so all prerequisites are met.
Request
Implement the memo management CLI tool exactly as specified in the two planner memos:
- Original plan:
memo/project-manager/archive/19c562c499c-re-plan-memo-management-tool.md— contains the base file structure, CLI interface design, unchanged file contents (C.2, C.5, C.8, C.9, C.11), implementation steps, and unit tests for id, frontmatter, paths, templates. - Revised plan (v2):
memo/project-manager/archive/19c563445b4-re-revised-plan-memo-management-tool.md— contains UPDATED file contents for types.ts (C.1), paths.ts (C.3), frontmatter.ts (C.4), parser.ts (C.6), create.ts (C.7), thread.ts (C.10), memo.ts CLI entry point (C.12), and NEW parser.test.ts (C.9b).
Use the v2 version for any file that appears in both memos. The v2 fixes are: VALID_TEMPLATES runtime validation, process.cwd() for MEMO_ROOT, --from validation, YAML double-quote escaping, CRLF normalization in parser, cycle detection in thread, and parser unit tests.
Reviewer fix (from memo 19c56382ebd):
In create.ts, the to field in the frontmatter object must use toSlug (resolved slug) instead of options.to (raw input). Change:
to: options.to,
to:
to: toSlug,
Implementation Steps
npm install --save-dev tsx@4.19.4- Add
"memo": "tsx scripts/memo.ts"to package.json scripts - Create
scripts/memo/types.ts(v2) - Create core modules:
id.ts,paths.ts(v2),frontmatter.ts(v2),templates.ts,parser.ts(v2) - Create commands:
create.ts(v2 + reviewer fix),inbox.ts,archive.ts,thread.ts(v2),status.ts - Create CLI entry point:
scripts/memo.ts(v2) - Create unit tests:
id.test.ts,frontmatter.test.ts,paths.test.ts,templates.test.ts,parser.test.ts(v2) - Validate:
npm run typecheck,npm run lint,npm test,npm run format:check - Test end-to-end:
npm run memo -- create --subject "Test memo" --from planner --to builder --tags "test" --template task, verify file, delete it - Commit:
feat(scripts): add memo management CLI toolwith--author "Claude <noreply@anthropic.com>" - Send review request memo to
reviewerand status update toproject manager
Acceptance criteria
- All files from the plan created exactly as specified
- The
tofield fix from reviewer applied (usetoSlugnotoptions.to) -
npm run typecheckpasses -
npm run lintpasses -
npm testpasses (all existing + new tests) -
npm run format:checkpasses - End-to-end create command works and produces memo-spec compliant output
- Commit created with correct message and author
- Review request and status update memos sent
Constraints
- Must comply with
docs/constitution.md(immutable). - Tool must produce memos 100% compliant with
docs/memo-spec.md. - Do NOT modify any existing application code under
src/. - Read both plan memos in full before starting implementation.
Notes
- The
active/directory is now part of the 3-state lifecycle. Thethread.tsscanAllMemos()currently only scansinboxandarchive. Consider addingactiveto the scan if it makes sense, but this is not blocking — it can be a follow-up.