Commit 7532d36

mo khan <mo@mokhan.ca>
2026-01-29 21:42:10
chore: add user story for documentation
1 parent 4f39780
.elelem/backlog/archive/013-editor-integration-for-prompts.md
@@ -0,0 +1,98 @@
+# Editor Integration for Prompts
+
+As a **power user**, I want to open my `$EDITOR` from the prompt to compose long messages, so that I have a full editing environment for complex prompts.
+
+## SYNOPSIS
+
+Press `CTRL+x CTRL+e` at the prompt to open `$EDITOR`, compose text, and return to the prompt for review before sending.
+
+## DESCRIPTION
+
+When composing long or complex prompts, the terminal input line is limiting. Users need the ability to:
+- Write multi-line text comfortably
+- Paste content from other sources
+- Use familiar editor keybindings (vim, emacs, etc.)
+- Review and edit before sending
+
+### Keybinding
+
+`CTRL+x CTRL+e` - Standard Bash/Zsh binding for `edit-and-execute-command`
+
+This is the most intuitive choice for Linux/Bash/Vim/Tmux users as it matches their existing muscle memory.
+
+### Flow
+
+```
+> partial text█              # User types some text
+                             # User presses CTRL+x CTRL+e
+                             # Editor opens with "partial text" pre-populated
+                             # User edits, saves, quits
+> partial text               # Text appears at prompt
+  plus more content          # (multi-line if applicable)
+  from the editor█           # Cursor at end, ready to review
+                             # User presses Enter to send
+```
+
+### Edge Cases
+
+| Scenario | Behavior |
+|----------|----------|
+| Empty file saved | Return to prompt, no input |
+| Editor exits non-zero | Return to prompt, preserve original text |
+| `$EDITOR` not set | Fall back to `$VISUAL`, then `vi` |
+| Multi-line text | Display all lines, submit as single message |
+
+## SEE ALSO
+
+* [ ] lib/elelem/terminal.rb - `ask` method, Reline configuration
+* [ ] Reline documentation for custom key bindings
+* [ ] Bash `edit-and-execute-command` (CTRL+x CTRL+e)
+
+## Tasks
+
+* [ ] TBD (filled in design mode)
+
+## Acceptance Criteria
+
+* [ ] `CTRL+x CTRL+e` opens `$EDITOR` (or `$VISUAL`, or `vi`)
+* [ ] Editor pre-populates with any text already typed at the prompt
+* [ ] After saving and quitting, text appears at the prompt for review
+* [ ] User must press Enter to send (no auto-submit)
+* [ ] Empty file returns to prompt with no input (cancel)
+* [ ] Non-zero editor exit preserves original text
+* [ ] Temp file is created in appropriate location and cleaned up after
+* [ ] Multi-line text from editor displays correctly at prompt
+* [ ] Works with common editors: vim, nvim, nano, emacs
+
+## Implementation Notes
+
+```ruby
+# In Terminal, bind CTRL+x CTRL+e
+Reline::LineEditor.bind_key("\C-x\C-e") do |line_editor|
+  # 1. Get current line content
+  current_text = line_editor.line
+
+  # 2. Create temp file with content
+  require "tempfile"
+  file = Tempfile.new(["elelem-prompt-", ".md"])
+  file.write(current_text)
+  file.close
+
+  # 3. Open editor
+  editor = ENV["VISUAL"] || ENV["EDITOR"] || "vi"
+  system("#{editor} #{file.path}")
+
+  # 4. Read result
+  if $?.success?
+    new_text = File.read(file.path).strip
+    line_editor.replace_line(new_text) unless new_text.empty?
+  end
+
+  # 5. Cleanup
+  file.unlink
+end
+```
+
+### Multi-line Display
+
+Reline supports multi-line input. The edited text should be inserted and displayed across multiple lines if it contains newlines.
.elelem/backlog/014-documentation-website.md
@@ -0,0 +1,85 @@
+# Documentation Website
+
+As a **user discovering elelem**, I want comprehensive documentation on a website, so that I can learn how to configure and use elelem effectively.
+
+As a **plugin author**, I want documentation with examples, so that I can extend elelem for my workflows.
+
+## SYNOPSIS
+
+Create a minimal, fast documentation website with no JavaScript or cookies.
+
+## DESCRIPTION
+
+Build a static documentation site that serves as the primary reference for elelem.
+The site should have a man-page-style minimal aesthetic - clean, fast, focused on content.
+
+### Content Structure
+
+```
+/                     # Overview, what is elelem
+/getting-started/     # Installation, first run, basic usage
+/workflow/            # Plan → Design → Build → Review → Verify loop
+/configuration/       # Config files, environment variables, XDG paths
+/modes/               # Detailed explanation of each mode
+  /plan/
+  /design/
+  /build/
+  /review/
+  /verify/
+/plugins/             # Plugin system overview
+  /authoring/         # How to write plugins
+  /examples/          # Example plugins with explanations
+/mcp/                 # MCP integration guide
+/reference/           # Command reference, tool schemas
+```
+
+### Design Principles
+
+- **No JavaScript** - Content works without JS
+- **No cookies** - No tracking, no consent banners
+- **Fast** - Minimal CSS, no frameworks
+- **Accessible** - Semantic HTML, good contrast, works with screen readers
+- **Unix aesthetic** - Clean, monospace-friendly, man-page inspired
+
+### Workflow Diagram
+
+Include the development workflow prominently:
+
+```
+┌─────────┐   ┌─────────┐   ┌─────────┐   ┌─────────┐   ┌─────────┐
+│  PLAN   │ → │ DESIGN  │ → │  BUILD  │ → │ REVIEW  │ → │ VERIFY  │ → done
+│ draft   │   │ ready   │   │designing│   │building │   │reviewing│
+│         │   │         │   │→building│   │→reviewing│  │→verifying│
+└─────────┘   └─────────┘   └─────────┘   └─────────┘   └─────────┘
+ Interview     Research      Execute       Code          Smoke test
+ stories       create tasks  tasks         review        demo
+```
+
+## SEE ALSO
+
+* [ ] https://www.mokhan.ca/ - Style reference
+* [ ] Existing README.md content to migrate
+
+## Research (Design Phase)
+
+- [ ] Evaluate static site generators (Hugo, Zola, Eleventy, plain HTML+Make)
+- [ ] Determine hosting approach (self-hosted server)
+- [ ] Design information architecture
+- [ ] Create minimal CSS theme
+
+## Tasks
+
+* [ ] TBD (filled in design mode)
+
+## Acceptance Criteria
+
+* [ ] Site builds with no JavaScript dependencies in output
+* [ ] Site includes no cookies or tracking
+* [ ] Site loads in < 1 second on slow connections
+* [ ] All pages pass WAVE accessibility checker
+* [ ] Getting started guide enables new user to run elelem
+* [ ] Plugin authoring guide includes working example
+* [ ] Workflow diagram is prominently displayed
+* [ ] Site renders well on mobile (responsive, no horizontal scroll)
+* [ ] Site works with JavaScript disabled
+* [ ] All code examples are syntax highlighted (CSS only, no JS)