Summary
Replace the plain textarea for editing CLAUDE.md and agent instructions with a rich Markdown editor that shows only the rendered preview and provides a formatting toolbar for basic Markdown operations (similar to StackEdit but preview-only mode).
Current State
- CLAUDE.md editing: Plain
<textarea> in TeamBuilderPage.tsx (lines 659-668) with no preview
- Step 3 preview: Uses
<pre> tag — shows raw text, NOT rendered Markdown (lines 1142-1145)
- Markdown renderer exists:
MarkdownRenderer component using react-markdown + remark-gfm (Markdown.tsx) but is only used for chat messages, schedule responses, and webhook responses
- No visual editor anywhere in the application
Proposed Solution
Design Approach: Preview-Only with Formatting Toolbar
Instead of a split-pane editor (like StackEdit), show only the rendered preview with a formatting toolbar that lets users insert Markdown syntax without seeing raw Markdown.
Toolbar Actions
┌────────────────────────────────────────────────────────┐
│ B I S H1 H2 H3 • 1. "" <> 🔗 ─ │ Raw ✏️ │
│ ───────────────────────────────────────────────────── │
│ │
│ Welcome to My Agent │
│ │
│ This agent specializes in... │
│ │
│ • First capability │
│ • Second capability │
│ │
│ Important Notes │
│ > Always verify before executing │
│ │
└────────────────────────────────────────────────────────┘
Toolbar buttons:
- B — Bold (
**text**)
- I — Italic (
*text*)
- S — Strikethrough (
~~text~~)
- H1/H2/H3 — Headings
- • — Unordered list
- 1. — Ordered list
- "" — Blockquote
- <> — Code block
- 🔗 — Link
- ─ — Horizontal rule
- Raw ✏️ — Toggle to raw Markdown view (for advanced users)
Implementation Options
- Option A: Use a library like
@uiw/react-md-editor — Full-featured MD editor with preview
- Option B: Use Tiptap — Headless rich text editor, highly customizable, supports Markdown input/output
- Option C: Custom implementation — Hidden textarea + toolbar + MarkdownRenderer for preview, with cursor/selection management
Recommended: Option B (Tiptap) — Most flexible, good Markdown serialization, customizable toolbar, active community.
Where to Apply
- TeamBuilderPage Step 2 — CLAUDE.md editor (leader instructions)
- TeamBuilderPage Step 3 — Preview should use
MarkdownRenderer instead of <pre>
- Agent instructions editor (if/when editing subagent instructions post-creation)
Affected Files
src/pages/TeamBuilderPage.tsx — Replace textarea with editor (lines 659-668), fix preview (lines 1142-1145)
src/components/Markdown.tsx — May need to extend for editor integration
- New component:
src/components/MarkdownEditor.tsx
package.json — New dependency (tiptap or similar)
Acceptance Criteria
Summary
Replace the plain textarea for editing CLAUDE.md and agent instructions with a rich Markdown editor that shows only the rendered preview and provides a formatting toolbar for basic Markdown operations (similar to StackEdit but preview-only mode).
Current State
<textarea>in TeamBuilderPage.tsx (lines 659-668) with no preview<pre>tag — shows raw text, NOT rendered Markdown (lines 1142-1145)MarkdownRenderercomponent usingreact-markdown+remark-gfm(Markdown.tsx) but is only used for chat messages, schedule responses, and webhook responsesProposed Solution
Design Approach: Preview-Only with Formatting Toolbar
Instead of a split-pane editor (like StackEdit), show only the rendered preview with a formatting toolbar that lets users insert Markdown syntax without seeing raw Markdown.
Toolbar Actions
Toolbar buttons:
**text**)*text*)~~text~~)Implementation Options
@uiw/react-md-editor— Full-featured MD editor with previewRecommended: Option B (Tiptap) — Most flexible, good Markdown serialization, customizable toolbar, active community.
Where to Apply
MarkdownRendererinstead of<pre>Affected Files
src/pages/TeamBuilderPage.tsx— Replace textarea with editor (lines 659-668), fix preview (lines 1142-1145)src/components/Markdown.tsx— May need to extend for editor integrationsrc/components/MarkdownEditor.tsxpackage.json— New dependency (tiptap or similar)Acceptance Criteria
instructions_md)