Implementation specifications for Hanawa CMS enterprise features. These documents provide detailed technical guidance for building out Hanawa's core capabilities.
Hanawa needs to evolve from a rich-text editor into a full-featured headless CMS. This roadmap prioritizes features based on compliance requirements and competitive positioning.
┌─────────────────────────────────────────────────────────────────┐
│ HANAWA EVOLUTION │
├─────────────────────────────────────────────────────────────────┤
│ │
│ TODAY TOMORROW │
│ ───── ──────── │
│ Tiptap editor Full CMS platform │
│ Custom extensions + Real-time collaboration │
│ Manual saves + Audit trails │
│ Single user + Approval workflows │
│ + Version control │
│ + Scheduled publishing │
│ + Localization (EN/JA) │
│ │
└─────────────────────────────────────────────────────────────────┘
Core infrastructure that everything else depends on.
| Feature | Document | Effort | Dependencies |
|---|---|---|---|
| Audit Logging | 01-audit-system.md | 3-4 days | None |
| Version History | 02-version-control.md | 3-4 days | Audit system |
Multi-user editing and communication.
| Feature | Document | Effort | Dependencies |
|---|---|---|---|
| Real-time Presence | 03-realtime-collaboration.md | 4-5 days | Durable Objects |
| Comments & Threads | 04-comments-system.md | 3-4 days | Audit system |
Content governance and publishing controls.
| Feature | Document | Effort | Dependencies |
|---|---|---|---|
| Workflow Engine | 05-workflow-engine.md | 4-5 days | Audit, Versions |
| Scheduled Publishing | 06-scheduled-publishing.md | 2-3 days | Workflow engine |
Bilingual content management.
| Feature | Document | Effort | Dependencies |
|---|---|---|---|
| Field-level i18n | 07-localization.md | 4-5 days | Schema updates |
AI-powered features and Codex integration.
| Feature | Document | Effort | Dependencies |
|---|---|---|---|
| AI Writing Assistant | 08-ai-assistant.md | 3-4 days | Claude API |
| Codex Sync | 09-codex-integration.md | 4-5 days | Vectorize |
Features that elevate user experience and developer integration.
| Feature | Document | Effort | Dependencies |
|---|---|---|---|
| Media Library | 10-media-library.md | 4-5 days | R2, CF Images |
| Webhooks & Integrations | 11-webhooks-integrations.md | 2-3 days | Queues |
| Editor Productivity | 12-editor-productivity.md | 2-3 days | None |
| Content Intelligence | 13-content-intelligence.md | 3-4 days | Workers AI |
| Preview Deployments | 14-preview-deployments.md | 2-3 days | Pages |
| Delivery API | 15-delivery-api.md | 3-4 days | KV Cache |
For collaboration features, we need a real-time layer. Options considered:
| Option | Pros | Cons | Verdict |
|---|---|---|---|
| Cloudflare Durable Objects | Native to platform, WebSocket support, consistent state | Learning curve, DO-specific patterns | ✅ Selected |
| PartyKit | Great DX, Cloudflare-hosted | Additional service, cost | Considered for future |
| Liveblocks | Feature-rich, easy integration | External dependency, recurring cost | Too heavy |
| Supabase Realtime | PostgreSQL sync, auth integration | Different stack, latency | Wrong platform |
Decision: Durable Objects for presence and collaboration state. Each document gets a DO instance that coordinates connected editors.
For concurrent editing:
| Approach | Description | Best For |
|---|---|---|
| Last-write-wins | Simple timestamp comparison | Field-level edits |
| Operational Transform (OT) | Transform operations for consistency | Real-time character-by-character |
| CRDT | Conflict-free data types | Offline-first, complex merging |
Decision: Tiptap already uses ProseMirror's OT-like collaboration protocol via @tiptap/extension-collaboration. We'll leverage that with a Durable Object as the authority.
All new features extend the existing D1 schema. Key additions:
-- Core tables (new)
audit_log -- All actions logged
document_versions -- Full snapshots
workflow_stages -- Stage definitions
workflow_state -- Current state per document
comments -- Inline and document comments
scheduled_jobs -- Publish queue
-- Extended columns (existing tables)
documents.locale -- Language code
documents.localized_fields -- JSON of field→content per locale
documents.workflow_stage_id -- Current workflow position┌─────────────────────────────────────────────────────────────────┐
│ HANAWA vs. MARKET LEADERS │
├─────────────────────────────────────────────────────────────────┤
│ │
│ UNIQUE TO HANAWA (Differentiators) │
│ ├── Built for compliance documentation │
│ ├── Privacy masking for PII/financial data │
│ ├── Evidence linking with R2 document storage │
│ ├── Status badges for control tracking │
│ ├── Shareable preview with watermarking │
│ ├── Direct pipeline to Codex/Miko knowledge base │
│ └── Bilingual-first (EN/JA) architecture │
│ │
│ MATCH THE MARKET (Core features) │
│ ├── Real-time collaboration (à la Sanity) │
│ ├── Comprehensive audit trails (à la Contentstack) │
│ ├── Multi-step workflows (à la dotCMS) │
│ ├── Version control with diff (à la Kontent.ai) │
│ └── Scheduled publishing (à la Storyblok) │
│ │
│ POLISH FEATURES (Knockout details) │
│ ├── Media library with focal points (à la Cloudinary) │
│ ├── Command palette & keyboard shortcuts (à la Linear) │
│ ├── SEO & readability scoring (à la Yoast) │
│ ├── Webhooks & Slack integration (à la Contentful) │
│ ├── Preview deployments (à la Vercel) │
│ └── REST + GraphQL API with SDK (à la Prismic) │
│ │
└─────────────────────────────────────────────────────────────────┘
Each specification follows a consistent structure:
- Overview — What and why
- Data Model — D1 schema additions
- API Design — Endpoints and contracts
- UI Components — Svelte component specifications
- Implementation Notes — Cloudflare-specific considerations
- Testing Strategy — How to verify correctness
- Migration Path — Upgrading existing content
| # | Document | Status | Category |
|---|---|---|---|
| 01 | Audit System | ✅ Implemented | Foundation |
| 02 | Version Control | ✅ Implemented | Foundation |
| 03 | Real-time Collaboration | ⏳ Planned | Collaboration |
| 04 | Comments System | ✅ Implemented | Collaboration |
| 05 | Workflow Engine | ✅ Implemented | Workflow |
| 06 | Scheduled Publishing | ✅ Implemented | Workflow |
| 07 | Localization | ✅ Implemented | Localization |
| 08 | AI Assistant | ✅ Implemented | Intelligence |
| 09 | Codex Integration | ✅ Implemented | Intelligence |
| 10 | Media Library | ✅ Implemented | Polish |
| 11 | Webhooks & Integrations | ✅ Implemented | Polish |
| 12 | Editor Productivity | ✅ Implemented | Polish |
| 13 | Content Intelligence | ✅ Implemented | Polish |
| 14 | Preview Deployments | ✅ Implemented | Polish |
| 15 | Delivery API | ✅ Implemented | Polish |
| 16 | Block Editor | ✅ Implemented | Core |
These specifications are designed to be shared with Claude Code for implementation. Recommended workflow:
# Share a spec for implementation
claude "Read /docs/hanawa-specs/01-audit-system.md and implement the audit logging system"
# Implement a specific component
claude "Based on 03-realtime-collaboration.md, create the PresenceIndicator component"
# Generate migrations
claude "Create D1 migrations for the schema in 05-workflow-engine.md"Each document is self-contained with enough context for focused implementation.
Document version: 1.2 Last updated: December 2025
- Dec 2025: Implemented Webhooks & Integrations (spec 11) with HMAC signing, retry logic, and delivery tracking
- Dec 2025: Implemented Delivery API (spec 15) with API keys, rate limiting, and content caching
- ✅ Implemented — Feature is complete and in production
- 🔶 Partial — Some components implemented, others planned
- ⏳ Planned — Specification ready, awaiting implementation