AI-native design editor. Open-source Figma alternative.
Remove OpenSpec workflow files
Danila Poyarkov25788dae3610
diff --git a/.pi/prompts/opsx-apply.md b/.pi/prompts/opsx-apply.mddeleted file mode 100644index 494e10e99..000000000--- a/.pi/prompts/opsx-apply.md+++ /dev/null@@ -1,149 +0,0 @@-----description: Implement tasks from an OpenSpec change (Experimental)------Implement tasks from an OpenSpec change.--**Input**: Optionally specify a change name (e.g., `/opsx:apply add-auth`). If omitted, check if it can be inferred from conversation context. If vague or ambiguous you MUST prompt for available changes.--**Steps**--1. **Select the change**-- If a name is provided, use it. Otherwise:- - Infer from conversation context if the user mentioned a change- - Auto-select if only one active change exists- - If ambiguous, run `openspec list --json` to get available changes and use the **AskUserQuestion tool** to let the user select-- Always announce: "Using change: <name>" and how to override (e.g., `/opsx:apply <other>`).--2. **Check status to understand the schema**- ```bash- openspec status --change "<name>" --json- ```- Parse the JSON to understand:- - `schemaName`: The workflow being used (e.g., "spec-driven")- - Which artifact contains the tasks (typically "tasks" for spec-driven, check status for others)--3. **Get apply instructions**-- ```bash- openspec instructions apply --change "<name>" --json- ```-- This returns:- - Context file paths (varies by schema)- - Progress (total, complete, remaining)- - Task list with status- - Dynamic instruction based on current state-- **Handle states:**- - If `state: "blocked"` (missing artifacts): show message, suggest using `/opsx:continue`- - If `state: "all_done"`: congratulate, suggest archive- - Otherwise: proceed to implementation--4. **Read context files**-- Read the files listed in `contextFiles` from the apply instructions output.- The files depend on the schema being used:- - **spec-driven**: proposal, specs, design, tasks- - Other schemas: follow the contextFiles from CLI output--5. **Show current progress**-- Display:- - Schema being used- - Progress: "N/M tasks complete"- - Remaining tasks overview- - Dynamic instruction from CLI--6. **Implement tasks (loop until done or blocked)**-- For each pending task:- - Show which task is being worked on- - Make the code changes required- - Keep changes minimal and focused- - Mark task complete in the tasks file: `- [ ]` → `- [x]`- - Continue to next task-- **Pause if:**- - Task is unclear → ask for clarification- - Implementation reveals a design issue → suggest updating artifacts- - Error or blocker encountered → report and wait for guidance- - User interrupts--7. **On completion or pause, show status**-- Display:- - Tasks completed this session- - Overall progress: "N/M tasks complete"- - If all done: suggest archive- - If paused: explain why and wait for guidance--**Output During Implementation**--```-## Implementing: <change-name> (schema: <schema-name>)--Working on task 3/7: <task description>-[...implementation happening...]-✓ Task complete--Working on task 4/7: <task description>-[...implementation happening...]-✓ Task complete-```--**Output On Completion**--```-## Implementation Complete--**Change:** <change-name>-**Schema:** <schema-name>-**Progress:** 7/7 tasks complete ✓--### Completed This Session-- [x] Task 1-- [x] Task 2-...--All tasks complete! You can archive this change with `/opsx:archive`.-```--**Output On Pause (Issue Encountered)**--```-## Implementation Paused--**Change:** <change-name>-**Schema:** <schema-name>-**Progress:** 4/7 tasks complete--### Issue Encountered-<description of the issue>--**Options:**-1. <option 1>-2. <option 2>-3. Other approach--What would you like to do?-```--**Guardrails**-- Keep going through tasks until done or blocked-- Always read context files before starting (from the apply instructions output)-- If task is ambiguous, pause and ask before implementing-- If implementation reveals issues, pause and suggest artifact updates-- Keep code changes minimal and scoped to each task-- Update task checkbox immediately after completing each task-- Pause on errors, blockers, or unclear requirements - don't guess-- Use contextFiles from CLI output, don't assume specific file names--**Fluid Workflow Integration**--This skill supports the "actions on a change" model:--- **Can be invoked anytime**: Before all artifacts are done (if tasks exist), after partial implementation, interleaved with other actions-- **Allows artifact updates**: If implementation reveals design issues, suggest updating artifacts - not phase-locked, work fluidlydiff --git a/.pi/prompts/opsx-archive.md b/.pi/prompts/opsx-archive.mddeleted file mode 100644index 1163776da..000000000--- a/.pi/prompts/opsx-archive.md+++ /dev/null@@ -1,154 +0,0 @@-----description: Archive a completed change in the experimental workflow------Archive a completed change in the experimental workflow.--**Input**: Optionally specify a change name after `/opsx:archive` (e.g., `/opsx:archive add-auth`). If omitted, check if it can be inferred from conversation context. If vague or ambiguous you MUST prompt for available changes.--**Steps**--1. **If no change name provided, prompt for selection**-- Run `openspec list --json` to get available changes. Use the **AskUserQuestion tool** to let the user select.-- Show only active changes (not already archived).- Include the schema used for each change if available.-- **IMPORTANT**: Do NOT guess or auto-select a change. Always let the user choose.--2. **Check artifact completion status**-- Run `openspec status --change "<name>" --json` to check artifact completion.-- Parse the JSON to understand:- - `schemaName`: The workflow being used- - `artifacts`: List of artifacts with their status (`done` or other)-- **If any artifacts are not `done`:**- - Display warning listing incomplete artifacts- - Prompt user for confirmation to continue- - Proceed if user confirms--3. **Check task completion status**-- Read the tasks file (typically `tasks.md`) to check for incomplete tasks.-- Count tasks marked with `- [ ]` (incomplete) vs `- [x]` (complete).-- **If incomplete tasks found:**- - Display warning showing count of incomplete tasks- - Prompt user for confirmation to continue- - Proceed if user confirms-- **If no tasks file exists:** Proceed without task-related warning.--4. **Assess delta spec sync state**-- Check for delta specs at `openspec/changes/<name>/specs/`. If none exist, proceed without sync prompt.-- **If delta specs exist:**- - Compare each delta spec with its corresponding main spec at `openspec/specs/<capability>/spec.md`- - Determine what changes would be applied (adds, modifications, removals, renames)- - Show a combined summary before prompting-- **Prompt options:**- - If changes needed: "Sync now (recommended)", "Archive without syncing"- - If already synced: "Archive now", "Sync anyway", "Cancel"-- If user chooses sync, use Task tool (subagent_type: "general-purpose", prompt: "Use Skill tool to invoke openspec-sync-specs for change '<name>'. Delta spec analysis: <include the analyzed delta spec summary>"). Proceed to archive regardless of choice.--5. **Perform the archive**-- Create the archive directory if it doesn't exist:- ```bash- mkdir -p openspec/changes/archive- ```-- Generate target name using current date: `YYYY-MM-DD-<change-name>`-- **Check if target already exists:**- - If yes: Fail with error, suggest renaming existing archive or using different date- - If no: Move the change directory to archive-- ```bash- mv openspec/changes/<name> openspec/changes/archive/YYYY-MM-DD-<name>- ```--6. **Display summary**-- Show archive completion summary including:- - Change name- - Schema that was used- - Archive location- - Spec sync status (synced / sync skipped / no delta specs)- - Note about any warnings (incomplete artifacts/tasks)--**Output On Success**--```-## Archive Complete--**Change:** <change-name>-**Schema:** <schema-name>-**Archived to:** openspec/changes/archive/YYYY-MM-DD-<name>/-**Specs:** ✓ Synced to main specs--All artifacts complete. All tasks complete.-```--**Output On Success (No Delta Specs)**--```-## Archive Complete--**Change:** <change-name>-**Schema:** <schema-name>-**Archived to:** openspec/changes/archive/YYYY-MM-DD-<name>/-**Specs:** No delta specs--All artifacts complete. All tasks complete.-```--**Output On Success With Warnings**--```-## Archive Complete (with warnings)--**Change:** <change-name>-**Schema:** <schema-name>-**Archived to:** openspec/changes/archive/YYYY-MM-DD-<name>/-**Specs:** Sync skipped (user chose to skip)--**Warnings:**-- Archived with 2 incomplete artifacts-- Archived with 3 incomplete tasks-- Delta spec sync was skipped (user chose to skip)--Review the archive if this was not intentional.-```--**Output On Error (Archive Exists)**--```-## Archive Failed--**Change:** <change-name>-**Target:** openspec/changes/archive/YYYY-MM-DD-<name>/--Target archive directory already exists.--**Options:**-1. Rename the existing archive-2. Delete the existing archive if it's a duplicate-3. Wait until a different date to archive-```--**Guardrails**-- Always prompt for change selection if not provided-- Use artifact graph (openspec status --json) for completion checking-- Don't block archive on warnings - just inform and confirm-- Preserve .openspec.yaml when moving to archive (it moves with the directory)-- Show clear summary of what happened-- If sync is requested, use the Skill tool to invoke `openspec-sync-specs` (agent-driven)-- If delta specs exist, always run the sync assessment and show the combined summary before promptingdiff --git a/.pi/prompts/opsx-explore.md b/.pi/prompts/opsx-explore.mddeleted file mode 100644index 492e55f78..000000000--- a/.pi/prompts/opsx-explore.md+++ /dev/null@@ -1,170 +0,0 @@-----description: "Enter explore mode - think through ideas, investigate problems, clarify requirements"------Enter explore mode. Think deeply. Visualize freely. Follow the conversation wherever it goes.--**IMPORTANT: Explore mode is for thinking, not implementing.** You may read files, search code, and investigate the codebase, but you must NEVER write code or implement features. If the user asks you to implement something, remind them to exit explore mode first and create a change proposal. You MAY create OpenSpec artifacts (proposals, designs, specs) if the user asks—that's capturing thinking, not implementing.--**This is a stance, not a workflow.** There are no fixed steps, no required sequence, no mandatory outputs. You're a thinking partner helping the user explore.--**Input**: The argument after `/opsx:explore` is whatever the user wants to think about. Could be:-- A vague idea: "real-time collaboration"-- A specific problem: "the auth system is getting unwieldy"-- A change name: "add-dark-mode" (to explore in context of that change)-- A comparison: "postgres vs sqlite for this"-- Nothing (just enter explore mode)-------## The Stance--- **Curious, not prescriptive** - Ask questions that emerge naturally, don't follow a script-- **Open threads, not interrogations** - Surface multiple interesting directions and let the user follow what resonates. Don't funnel them through a single path of questions.-- **Visual** - Use ASCII diagrams liberally when they'd help clarify thinking-- **Adaptive** - Follow interesting threads, pivot when new information emerges-- **Patient** - Don't rush to conclusions, let the shape of the problem emerge-- **Grounded** - Explore the actual codebase when relevant, don't just theorize-------## What You Might Do--Depending on what the user brings, you might:--**Explore the problem space**-- Ask clarifying questions that emerge from what they said-- Challenge assumptions-- Reframe the problem-- Find analogies--**Investigate the codebase**-- Map existing architecture relevant to the discussion-- Find integration points-- Identify patterns already in use-- Surface hidden complexity--**Compare options**-- Brainstorm multiple approaches-- Build comparison tables-- Sketch tradeoffs-- Recommend a path (if asked)--**Visualize**-```-┌─────────────────────────────────────────┐-│ Use ASCII diagrams liberally │-├─────────────────────────────────────────┤-│ │-│ ┌────────┐ ┌────────┐ │-│ │ State │────────▶│ State │ │-│ │ A │ │ B │ │-│ └────────┘ └────────┘ │-│ │-│ System diagrams, state machines, │-│ data flows, architecture sketches, │-│ dependency graphs, comparison tables │-│ │-└─────────────────────────────────────────┘-```--**Surface risks and unknowns**-- Identify what could go wrong-- Find gaps in understanding-- Suggest spikes or investigations-------## OpenSpec Awareness--You have full context of the OpenSpec system. Use it naturally, don't force it.--### Check for context--At the start, quickly check what exists:-```bash-openspec list --json-```--This tells you:-- If there are active changes-- Their names, schemas, and status-- What the user might be working on--If the user mentioned a specific change name, read its artifacts for context.--### When no change exists--Think freely. When insights crystallize, you might offer:--- "This feels solid enough to start a change. Want me to create a proposal?"-- Or keep exploring - no pressure to formalize--### When a change exists--If the user mentions a change or you detect one is relevant:--1. **Read existing artifacts for context**- - `openspec/changes/<name>/proposal.md`- - `openspec/changes/<name>/design.md`- - `openspec/changes/<name>/tasks.md`- - etc.--2. **Reference them naturally in conversation**- - "Your design mentions using Redis, but we just realized SQLite fits better..."- - "The proposal scopes this to premium users, but we're now thinking everyone..."--3. **Offer to capture when decisions are made**-- | Insight Type | Where to Capture |- |--------------|------------------|- | New requirement discovered | `specs/<capability>/spec.md` |- | Requirement changed | `specs/<capability>/spec.md` |- | Design decision made | `design.md` |- | Scope changed | `proposal.md` |- | New work identified | `tasks.md` |- | Assumption invalidated | Relevant artifact |-- Example offers:- - "That's a design decision. Capture it in design.md?"- - "This is a new requirement. Add it to specs?"- - "This changes scope. Update the proposal?"--4. **The user decides** - Offer and move on. Don't pressure. Don't auto-capture.-------## What You Don't Have To Do--- Follow a script-- Ask the same questions every time-- Produce a specific artifact-- Reach a conclusion-- Stay on topic if a tangent is valuable-- Be brief (this is thinking time)-------## Ending Discovery--There's no required ending. Discovery might:--- **Flow into a proposal**: "Ready to start? I can create a change proposal."-- **Result in artifact updates**: "Updated design.md with these decisions"-- **Just provide clarity**: User has what they need, moves on-- **Continue later**: "We can pick this up anytime"--When things crystallize, you might offer a summary - but it's optional. Sometimes the thinking IS the value.-------## Guardrails--- **Don't implement** - Never write code or implement features. Creating OpenSpec artifacts is fine, writing application code is not.-- **Don't fake understanding** - If something is unclear, dig deeper-- **Don't rush** - Discovery is thinking time, not task time-- **Don't force structure** - Let patterns emerge naturally-- **Don't auto-capture** - Offer to save insights, don't just do it-- **Do visualize** - A good diagram is worth many paragraphs-- **Do explore the codebase** - Ground discussions in reality-- **Do question assumptions** - Including the user's and your owndiff --git a/.pi/prompts/opsx-propose.md b/.pi/prompts/opsx-propose.mddeleted file mode 100644index cf30b2a55..000000000--- a/.pi/prompts/opsx-propose.md+++ /dev/null@@ -1,103 +0,0 @@-----description: Propose a new change - create it and generate all artifacts in one step------Propose a new change - create the change and generate all artifacts in one step.--I'll create a change with artifacts:-- proposal.md (what & why)-- design.md (how)-- tasks.md (implementation steps)--When ready to implement, run /opsx:apply-------**Input**: The argument after `/opsx:propose` is the change name (kebab-case), OR a description of what the user wants to build.--**Steps**--1. **If no input provided, ask what they want to build**-- Use the **AskUserQuestion tool** (open-ended, no preset options) to ask:- > "What change do you want to work on? Describe what you want to build or fix."-- From their description, derive a kebab-case name (e.g., "add user authentication" → `add-user-auth`).-- **IMPORTANT**: Do NOT proceed without understanding what the user wants to build.--2. **Create the change directory**- ```bash- openspec new change "<name>"- ```- This creates a scaffolded change at `openspec/changes/<name>/` with `.openspec.yaml`.--3. **Get the artifact build order**- ```bash- openspec status --change "<name>" --json- ```- Parse the JSON to get:- - `applyRequires`: array of artifact IDs needed before implementation (e.g., `["tasks"]`)- - `artifacts`: list of all artifacts with their status and dependencies--4. **Create artifacts in sequence until apply-ready**-- Use the **TodoWrite tool** to track progress through the artifacts.-- Loop through artifacts in dependency order (artifacts with no pending dependencies first):-- a. **For each artifact that is `ready` (dependencies satisfied)**:- - Get instructions:- ```bash- openspec instructions <artifact-id> --change "<name>" --json- ```- - The instructions JSON includes:- - `context`: Project background (constraints for you - do NOT include in output)- - `rules`: Artifact-specific rules (constraints for you - do NOT include in output)- - `template`: The structure to use for your output file- - `instruction`: Schema-specific guidance for this artifact type- - `outputPath`: Where to write the artifact- - `dependencies`: Completed artifacts to read for context- - Read any completed dependency files for context- - Create the artifact file using `template` as the structure- - Apply `context` and `rules` as constraints - but do NOT copy them into the file- - Show brief progress: "Created <artifact-id>"-- b. **Continue until all `applyRequires` artifacts are complete**- - After creating each artifact, re-run `openspec status --change "<name>" --json`- - Check if every artifact ID in `applyRequires` has `status: "done"` in the artifacts array- - Stop when all `applyRequires` artifacts are done-- c. **If an artifact requires user input** (unclear context):- - Use **AskUserQuestion tool** to clarify- - Then continue with creation--5. **Show final status**- ```bash- openspec status --change "<name>"- ```--**Output**--After completing all artifacts, summarize:-- Change name and location-- List of artifacts created with brief descriptions-- What's ready: "All artifacts created! Ready for implementation."-- Prompt: "Run `/opsx:apply` to start implementing."--**Artifact Creation Guidelines**--- Follow the `instruction` field from `openspec instructions` for each artifact type-- The schema defines what each artifact should contain - follow it-- Read dependency artifacts for context before creating new ones-- Use `template` as the structure for your output file - fill in its sections-- **IMPORTANT**: `context` and `rules` are constraints for YOU, not content for the file- - Do NOT copy `<context>`, `<rules>`, `<project_context>` blocks into the artifact- - These guide what you write, but should never appear in the output--**Guardrails**-- Create ALL artifacts needed for implementation (as defined by schema's `apply.requires`)-- Always read dependency artifacts before creating a new one-- If context is critically unclear, ask the user - but prefer making reasonable decisions to keep momentum-- If a change with that name already exists, ask if user wants to continue it or create a new one-- Verify each artifact file exists after writing before proceeding to nextdiff --git a/.pi/skills/openspec-apply-change/SKILL.md b/.pi/skills/openspec-apply-change/SKILL.mddeleted file mode 100644index d474dc135..000000000--- a/.pi/skills/openspec-apply-change/SKILL.md+++ /dev/null@@ -1,156 +0,0 @@-----name: openspec-apply-change-description: Implement tasks from an OpenSpec change. Use when the user wants to start implementing, continue implementation, or work through tasks.-license: MIT-compatibility: Requires openspec CLI.-metadata:- author: openspec- version: "1.0"- generatedBy: "1.2.0"------Implement tasks from an OpenSpec change.--**Input**: Optionally specify a change name. If omitted, check if it can be inferred from conversation context. If vague or ambiguous you MUST prompt for available changes.--**Steps**--1. **Select the change**-- If a name is provided, use it. Otherwise:- - Infer from conversation context if the user mentioned a change- - Auto-select if only one active change exists- - If ambiguous, run `openspec list --json` to get available changes and use the **AskUserQuestion tool** to let the user select-- Always announce: "Using change: <name>" and how to override (e.g., `/opsx:apply <other>`).--2. **Check status to understand the schema**- ```bash- openspec status --change "<name>" --json- ```- Parse the JSON to understand:- - `schemaName`: The workflow being used (e.g., "spec-driven")- - Which artifact contains the tasks (typically "tasks" for spec-driven, check status for others)--3. **Get apply instructions**-- ```bash- openspec instructions apply --change "<name>" --json- ```-- This returns:- - Context file paths (varies by schema - could be proposal/specs/design/tasks or spec/tests/implementation/docs)- - Progress (total, complete, remaining)- - Task list with status- - Dynamic instruction based on current state-- **Handle states:**- - If `state: "blocked"` (missing artifacts): show message, suggest using openspec-continue-change- - If `state: "all_done"`: congratulate, suggest archive- - Otherwise: proceed to implementation--4. **Read context files**-- Read the files listed in `contextFiles` from the apply instructions output.- The files depend on the schema being used:- - **spec-driven**: proposal, specs, design, tasks- - Other schemas: follow the contextFiles from CLI output--5. **Show current progress**-- Display:- - Schema being used- - Progress: "N/M tasks complete"- - Remaining tasks overview- - Dynamic instruction from CLI--6. **Implement tasks (loop until done or blocked)**-- For each pending task:- - Show which task is being worked on- - Make the code changes required- - Keep changes minimal and focused- - Mark task complete in the tasks file: `- [ ]` → `- [x]`- - Continue to next task-- **Pause if:**- - Task is unclear → ask for clarification- - Implementation reveals a design issue → suggest updating artifacts- - Error or blocker encountered → report and wait for guidance- - User interrupts--7. **On completion or pause, show status**-- Display:- - Tasks completed this session- - Overall progress: "N/M tasks complete"- - If all done: suggest archive- - If paused: explain why and wait for guidance--**Output During Implementation**--```-## Implementing: <change-name> (schema: <schema-name>)--Working on task 3/7: <task description>-[...implementation happening...]-✓ Task complete--Working on task 4/7: <task description>-[...implementation happening...]-✓ Task complete-```--**Output On Completion**--```-## Implementation Complete--**Change:** <change-name>-**Schema:** <schema-name>-**Progress:** 7/7 tasks complete ✓--### Completed This Session-- [x] Task 1-- [x] Task 2-...--All tasks complete! Ready to archive this change.-```--**Output On Pause (Issue Encountered)**--```-## Implementation Paused--**Change:** <change-name>-**Schema:** <schema-name>-**Progress:** 4/7 tasks complete--### Issue Encountered-<description of the issue>--**Options:**-1. <option 1>-2. <option 2>-3. Other approach--What would you like to do?-```--**Guardrails**-- Keep going through tasks until done or blocked-- Always read context files before starting (from the apply instructions output)-- If task is ambiguous, pause and ask before implementing-- If implementation reveals issues, pause and suggest artifact updates-- Keep code changes minimal and scoped to each task-- Update task checkbox immediately after completing each task-- Pause on errors, blockers, or unclear requirements - don't guess-- Use contextFiles from CLI output, don't assume specific file names--**Fluid Workflow Integration**--This skill supports the "actions on a change" model:--- **Can be invoked anytime**: Before all artifacts are done (if tasks exist), after partial implementation, interleaved with other actions-- **Allows artifact updates**: If implementation reveals design issues, suggest updating artifacts - not phase-locked, work fluidlydiff --git a/.pi/skills/openspec-archive-change/SKILL.md b/.pi/skills/openspec-archive-change/SKILL.mddeleted file mode 100644index 9b1f851aa..000000000--- a/.pi/skills/openspec-archive-change/SKILL.md+++ /dev/null@@ -1,114 +0,0 @@-----name: openspec-archive-change-description: Archive a completed change in the experimental workflow. Use when the user wants to finalize and archive a change after implementation is complete.-license: MIT-compatibility: Requires openspec CLI.-metadata:- author: openspec- version: "1.0"- generatedBy: "1.2.0"------Archive a completed change in the experimental workflow.--**Input**: Optionally specify a change name. If omitted, check if it can be inferred from conversation context. If vague or ambiguous you MUST prompt for available changes.--**Steps**--1. **If no change name provided, prompt for selection**-- Run `openspec list --json` to get available changes. Use the **AskUserQuestion tool** to let the user select.-- Show only active changes (not already archived).- Include the schema used for each change if available.-- **IMPORTANT**: Do NOT guess or auto-select a change. Always let the user choose.--2. **Check artifact completion status**-- Run `openspec status --change "<name>" --json` to check artifact completion.-- Parse the JSON to understand:- - `schemaName`: The workflow being used- - `artifacts`: List of artifacts with their status (`done` or other)-- **If any artifacts are not `done`:**- - Display warning listing incomplete artifacts- - Use **AskUserQuestion tool** to confirm user wants to proceed- - Proceed if user confirms--3. **Check task completion status**-- Read the tasks file (typically `tasks.md`) to check for incomplete tasks.-- Count tasks marked with `- [ ]` (incomplete) vs `- [x]` (complete).-- **If incomplete tasks found:**- - Display warning showing count of incomplete tasks- - Use **AskUserQuestion tool** to confirm user wants to proceed- - Proceed if user confirms-- **If no tasks file exists:** Proceed without task-related warning.--4. **Assess delta spec sync state**-- Check for delta specs at `openspec/changes/<name>/specs/`. If none exist, proceed without sync prompt.-- **If delta specs exist:**- - Compare each delta spec with its corresponding main spec at `openspec/specs/<capability>/spec.md`- - Determine what changes would be applied (adds, modifications, removals, renames)- - Show a combined summary before prompting-- **Prompt options:**- - If changes needed: "Sync now (recommended)", "Archive without syncing"- - If already synced: "Archive now", "Sync anyway", "Cancel"-- If user chooses sync, use Task tool (subagent_type: "general-purpose", prompt: "Use Skill tool to invoke openspec-sync-specs for change '<name>'. Delta spec analysis: <include the analyzed delta spec summary>"). Proceed to archive regardless of choice.--5. **Perform the archive**-- Create the archive directory if it doesn't exist:- ```bash- mkdir -p openspec/changes/archive- ```-- Generate target name using current date: `YYYY-MM-DD-<change-name>`-- **Check if target already exists:**- - If yes: Fail with error, suggest renaming existing archive or using different date- - If no: Move the change directory to archive-- ```bash- mv openspec/changes/<name> openspec/changes/archive/YYYY-MM-DD-<name>- ```--6. **Display summary**-- Show archive completion summary including:- - Change name- - Schema that was used- - Archive location- - Whether specs were synced (if applicable)- - Note about any warnings (incomplete artifacts/tasks)--**Output On Success**--```-## Archive Complete--**Change:** <change-name>-**Schema:** <schema-name>-**Archived to:** openspec/changes/archive/YYYY-MM-DD-<name>/-**Specs:** ✓ Synced to main specs (or "No delta specs" or "Sync skipped")--All artifacts complete. All tasks complete.-```--**Guardrails**-- Always prompt for change selection if not provided-- Use artifact graph (openspec status --json) for completion checking-- Don't block archive on warnings - just inform and confirm-- Preserve .openspec.yaml when moving to archive (it moves with the directory)-- Show clear summary of what happened-- If sync is requested, use openspec-sync-specs approach (agent-driven)-- If delta specs exist, always run the sync assessment and show the combined summary before promptingdiff --git a/.pi/skills/openspec-explore/SKILL.md b/.pi/skills/openspec-explore/SKILL.mddeleted file mode 100644index ffa10cad7..000000000--- a/.pi/skills/openspec-explore/SKILL.md+++ /dev/null@@ -1,288 +0,0 @@-----name: openspec-explore-description: Enter explore mode - a thinking partner for exploring ideas, investigating problems, and clarifying requirements. Use when the user wants to think through something before or during a change.-license: MIT-compatibility: Requires openspec CLI.-metadata:- author: openspec- version: "1.0"- generatedBy: "1.2.0"------Enter explore mode. Think deeply. Visualize freely. Follow the conversation wherever it goes.--**IMPORTANT: Explore mode is for thinking, not implementing.** You may read files, search code, and investigate the codebase, but you must NEVER write code or implement features. If the user asks you to implement something, remind them to exit explore mode first and create a change proposal. You MAY create OpenSpec artifacts (proposals, designs, specs) if the user asks—that's capturing thinking, not implementing.--**This is a stance, not a workflow.** There are no fixed steps, no required sequence, no mandatory outputs. You're a thinking partner helping the user explore.-------## The Stance--- **Curious, not prescriptive** - Ask questions that emerge naturally, don't follow a script-- **Open threads, not interrogations** - Surface multiple interesting directions and let the user follow what resonates. Don't funnel them through a single path of questions.-- **Visual** - Use ASCII diagrams liberally when they'd help clarify thinking-- **Adaptive** - Follow interesting threads, pivot when new information emerges-- **Patient** - Don't rush to conclusions, let the shape of the problem emerge-- **Grounded** - Explore the actual codebase when relevant, don't just theorize-------## What You Might Do--Depending on what the user brings, you might:--**Explore the problem space**-- Ask clarifying questions that emerge from what they said-- Challenge assumptions-- Reframe the problem-- Find analogies--**Investigate the codebase**-- Map existing architecture relevant to the discussion-- Find integration points-- Identify patterns already in use-- Surface hidden complexity--**Compare options**-- Brainstorm multiple approaches-- Build comparison tables-- Sketch tradeoffs-- Recommend a path (if asked)--**Visualize**-```-┌─────────────────────────────────────────┐-│ Use ASCII diagrams liberally │-├─────────────────────────────────────────┤-│ │-│ ┌────────┐ ┌────────┐ │-│ │ State │────────▶│ State │ │-│ │ A │ │ B │ │-│ └────────┘ └────────┘ │-│ │-│ System diagrams, state machines, │-│ data flows, architecture sketches, │-│ dependency graphs, comparison tables │-│ │-└─────────────────────────────────────────┘-```--**Surface risks and unknowns**-- Identify what could go wrong-- Find gaps in understanding-- Suggest spikes or investigations-------## OpenSpec Awareness--You have full context of the OpenSpec system. Use it naturally, don't force it.--### Check for context--At the start, quickly check what exists:-```bash-openspec list --json-```--This tells you:-- If there are active changes-- Their names, schemas, and status-- What the user might be working on--### When no change exists--Think freely. When insights crystallize, you might offer:--- "This feels solid enough to start a change. Want me to create a proposal?"-- Or keep exploring - no pressure to formalize--### When a change exists--If the user mentions a change or you detect one is relevant:--1. **Read existing artifacts for context**- - `openspec/changes/<name>/proposal.md`- - `openspec/changes/<name>/design.md`- - `openspec/changes/<name>/tasks.md`- - etc.--2. **Reference them naturally in conversation**- - "Your design mentions using Redis, but we just realized SQLite fits better..."- - "The proposal scopes this to premium users, but we're now thinking everyone..."--3. **Offer to capture when decisions are made**-- | Insight Type | Where to Capture |- |--------------|------------------|- | New requirement discovered | `specs/<capability>/spec.md` |- | Requirement changed | `specs/<capability>/spec.md` |- | Design decision made | `design.md` |- | Scope changed | `proposal.md` |- | New work identified | `tasks.md` |- | Assumption invalidated | Relevant artifact |-- Example offers:- - "That's a design decision. Capture it in design.md?"- - "This is a new requirement. Add it to specs?"- - "This changes scope. Update the proposal?"--4. **The user decides** - Offer and move on. Don't pressure. Don't auto-capture.-------## What You Don't Have To Do--- Follow a script-- Ask the same questions every time-- Produce a specific artifact-- Reach a conclusion-- Stay on topic if a tangent is valuable-- Be brief (this is thinking time)-------## Handling Different Entry Points--**User brings a vague idea:**-```-User: I'm thinking about adding real-time collaboration--You: Real-time collab is a big space. Let me think about this...-- COLLABORATION SPECTRUM- ════════════════════════════════════════════-- Awareness Coordination Sync- │ │ │- ▼ ▼ ▼- ┌────────┐ ┌────────┐ ┌────────┐- │Presence│ │Cursors │ │ CRDT │- │ "3 │ │ Multi │ │Conflict│- │online" │ │ select │ │ free │- └────────┘ └────────┘ └────────┘- │ │ │- trivial moderate complex-- Where's your head at?-```--**User brings a specific problem:**-```-User: The auth system is a mess--You: [reads codebase]-- ┌─────────────────────────────────────────────┐- │ CURRENT AUTH FLOW │- └─────────────────────────────────────────────┘- │- ┌─────────────┼─────────────┐- ▼ ▼ ▼- ┌─────────┐ ┌─────────┐ ┌─────────┐- │ Google │ │ GitHub │ │ Email │- │ OAuth │ │ OAuth │ │ Magic │- └────┬────┘ └────┬────┘ └────┬────┘- │ │ │- └─────────────┼─────────────┘- ▼- ┌───────────┐- │ Session │- └─────┬─────┘- │- ▼- ┌───────────┐- │ Perms │- └───────────┘-- I see three tangles. Which one's burning?-```--**User is stuck mid-implementation:**-```-User: /opsx:explore add-auth-system- The OAuth integration is more complex than expected--You: [reads change artifacts]-- You're on task 4: "Implement OAuth flow"-- Let me trace what's involved...-- [draws diagram, explores options, suggests paths]-- Want to update the design to reflect this?- Or add a spike task to investigate?-```--**User wants to compare options:**-```-User: Should we use Postgres or SQLite?--You: Generic answer is boring. What's the context?--User: A CLI tool that tracks local dev environments--You: That changes everything.-- ┌─────────────────────────────────────────────────┐- │ CLI TOOL DATA STORAGE │- └─────────────────────────────────────────────────┘-- Key constraints:- • No daemon running- • Must work offline- • Single user-- SQLite Postgres- Deployment embedded ✓ needs server ✗- Offline yes ✓ no ✗- Single file yes ✓ no ✗-- SQLite. Not even close.-- Unless... is there a sync component?-```-------## Ending Discovery--There's no required ending. Discovery might:--- **Flow into a proposal**: "Ready to start? I can create a change proposal."-- **Result in artifact updates**: "Updated design.md with these decisions"-- **Just provide clarity**: User has what they need, moves on-- **Continue later**: "We can pick this up anytime"--When it feels like things are crystallizing, you might summarize:--```-## What We Figured Out--**The problem**: [crystallized understanding]--**The approach**: [if one emerged]--**Open questions**: [if any remain]--**Next steps** (if ready):-- Create a change proposal-- Keep exploring: just keep talking-```--But this summary is optional. Sometimes the thinking IS the value.-------## Guardrails--- **Don't implement** - Never write code or implement features. Creating OpenSpec artifacts is fine, writing application code is not.-- **Don't fake understanding** - If something is unclear, dig deeper-- **Don't rush** - Discovery is thinking time, not task time-- **Don't force structure** - Let patterns emerge naturally-- **Don't auto-capture** - Offer to save insights, don't just do it-- **Do visualize** - A good diagram is worth many paragraphs-- **Do explore the codebase** - Ground discussions in reality-- **Do question assumptions** - Including the user's and your owndiff --git a/.pi/skills/openspec-propose/SKILL.md b/.pi/skills/openspec-propose/SKILL.mddeleted file mode 100644index d27bc5312..000000000--- a/.pi/skills/openspec-propose/SKILL.md+++ /dev/null@@ -1,110 +0,0 @@-----name: openspec-propose-description: Propose a new change with all artifacts generated in one step. Use when the user wants to quickly describe what they want to build and get a complete proposal with design, specs, and tasks ready for implementation.-license: MIT-compatibility: Requires openspec CLI.-metadata:- author: openspec- version: "1.0"- generatedBy: "1.2.0"------Propose a new change - create the change and generate all artifacts in one step.--I'll create a change with artifacts:-- proposal.md (what & why)-- design.md (how)-- tasks.md (implementation steps)--When ready to implement, run /opsx:apply-------**Input**: The user's request should include a change name (kebab-case) OR a description of what they want to build.--**Steps**--1. **If no clear input provided, ask what they want to build**-- Use the **AskUserQuestion tool** (open-ended, no preset options) to ask:- > "What change do you want to work on? Describe what you want to build or fix."-- From their description, derive a kebab-case name (e.g., "add user authentication" → `add-user-auth`).-- **IMPORTANT**: Do NOT proceed without understanding what the user wants to build.--2. **Create the change directory**- ```bash- openspec new change "<name>"- ```- This creates a scaffolded change at `openspec/changes/<name>/` with `.openspec.yaml`.--3. **Get the artifact build order**- ```bash- openspec status --change "<name>" --json- ```- Parse the JSON to get:- - `applyRequires`: array of artifact IDs needed before implementation (e.g., `["tasks"]`)- - `artifacts`: list of all artifacts with their status and dependencies--4. **Create artifacts in sequence until apply-ready**-- Use the **TodoWrite tool** to track progress through the artifacts.-- Loop through artifacts in dependency order (artifacts with no pending dependencies first):-- a. **For each artifact that is `ready` (dependencies satisfied)**:- - Get instructions:- ```bash- openspec instructions <artifact-id> --change "<name>" --json- ```- - The instructions JSON includes:- - `context`: Project background (constraints for you - do NOT include in output)- - `rules`: Artifact-specific rules (constraints for you - do NOT include in output)- - `template`: The structure to use for your output file- - `instruction`: Schema-specific guidance for this artifact type- - `outputPath`: Where to write the artifact- - `dependencies`: Completed artifacts to read for context- - Read any completed dependency files for context- - Create the artifact file using `template` as the structure- - Apply `context` and `rules` as constraints - but do NOT copy them into the file- - Show brief progress: "Created <artifact-id>"-- b. **Continue until all `applyRequires` artifacts are complete**- - After creating each artifact, re-run `openspec status --change "<name>" --json`- - Check if every artifact ID in `applyRequires` has `status: "done"` in the artifacts array- - Stop when all `applyRequires` artifacts are done-- c. **If an artifact requires user input** (unclear context):- - Use **AskUserQuestion tool** to clarify- - Then continue with creation--5. **Show final status**- ```bash- openspec status --change "<name>"- ```--**Output**--After completing all artifacts, summarize:-- Change name and location-- List of artifacts created with brief descriptions-- What's ready: "All artifacts created! Ready for implementation."-- Prompt: "Run `/opsx:apply` or ask me to implement to start working on the tasks."--**Artifact Creation Guidelines**--- Follow the `instruction` field from `openspec instructions` for each artifact type-- The schema defines what each artifact should contain - follow it-- Read dependency artifacts for context before creating new ones-- Use `template` as the structure for your output file - fill in its sections-- **IMPORTANT**: `context` and `rules` are constraints for YOU, not content for the file- - Do NOT copy `<context>`, `<rules>`, `<project_context>` blocks into the artifact- - These guide what you write, but should never appear in the output--**Guardrails**-- Create ALL artifacts needed for implementation (as defined by schema's `apply.requires`)-- Always read dependency artifacts before creating a new one-- If context is critically unclear, ask the user - but prefer making reasonable decisions to keep momentum-- If a change with that name already exists, ask if user wants to continue it or create a new one-- Verify each artifact file exists after writing before proceeding to nextdiff --git a/openspec/changes/archive/2026-02-28-add-comparison-page/.openspec.yaml b/openspec/changes/archive/2026-02-28-add-comparison-page/.openspec.yamldeleted file mode 100644index 34b5b2315..000000000--- a/openspec/changes/archive/2026-02-28-add-comparison-page/.openspec.yaml+++ /dev/null@@ -1,2 +0,0 @@-schema: spec-driven-created: 2026-02-28diff --git a/openspec/changes/archive/2026-02-28-add-comparison-page/design.md b/openspec/changes/archive/2026-02-28-add-comparison-page/design.mddeleted file mode 100644index 3534cd88d..000000000--- a/openspec/changes/archive/2026-02-28-add-comparison-page/design.md+++ /dev/null@@ -1,26 +0,0 @@-## Context--`COMPARISON.md` in the project root contains an in-depth OpenPencil vs Penpot comparison: architecture, rendering, data model, layout engine, file format, state management, DX, performance. 10 sections, summary table. Not linked from docs.--## Goals / Non-Goals--**Goals:**-- Make comparison accessible in the VitePress docs under Guide section-- Preserve all content and formatting from the source--**Non-Goals:**-- No rewriting or restructuring the comparison content-- No removal of root `COMPARISON.md`-- No new pages beyond comparison--## Decisions--### Place after Tech Stack in Guide sidebar-The comparison is an architectural evaluation document. It logically follows Tech Stack (which explains choices) with Comparison (which justifies them against alternatives).--### Copy content, adapt title for docs context-The root file title is "Open Pencil vs Penpot: Architecture & Performance Comparison". For docs, keep content identical but ensure VitePress compatibility (code blocks, tables).--## Risks / Trade-offs--- [Content drift] Root COMPARISON.md and docs copy may diverge → acceptable, docs is the living versiondiff --git a/openspec/changes/archive/2026-02-28-add-comparison-page/proposal.md b/openspec/changes/archive/2026-02-28-add-comparison-page/proposal.mddeleted file mode 100644index 147c18d7f..000000000--- a/openspec/changes/archive/2026-02-28-add-comparison-page/proposal.md+++ /dev/null@@ -1,24 +0,0 @@-## Why--A detailed architecture and performance comparison document (`COMPARISON.md`, 277 lines) exists in the project root but is not accessible via the VitePress docs site. Users evaluating OpenPencil vs Penpot have no way to find this content through the documentation.--## What Changes--- Create `docs/guide/comparison.md` adapted from root `COMPARISON.md`-- Add sidebar and nav entry for the comparison page in VitePress config-- No source code changes--## Capabilities--### New Capabilities--(none)--### Modified Capabilities--- `vitepress-docs`: add comparison page to docs site with sidebar navigation--## Impact--- `docs/.vitepress/config.ts` — new sidebar item in Guide section-- `docs/guide/comparison.md` — new documentation pagediff --git a/openspec/changes/archive/2026-02-28-add-comparison-page/specs/vitepress-docs/spec.md b/openspec/changes/archive/2026-02-28-add-comparison-page/specs/vitepress-docs/spec.mddeleted file mode 100644index 86b704d4b..000000000--- a/openspec/changes/archive/2026-02-28-add-comparison-page/specs/vitepress-docs/spec.md+++ /dev/null@@ -1,15 +0,0 @@-## ADDED Requirements--### Requirement: Comparison page-The docs site SHALL include a comparison page at `/guide/comparison` documenting architecture, rendering, data model, layout, file format, state management, developer experience, and performance differences between OpenPencil and Penpot.--#### Scenario: Comparison page renders-- **WHEN** user navigates to /guide/comparison-- **THEN** a page with all 10 comparison sections and the summary table is displayed--### Requirement: Comparison in sidebar navigation-The VitePress sidebar SHALL include a "Comparison" link in the Guide section after Tech Stack.--#### Scenario: Sidebar shows comparison-- **WHEN** user views the Guide sidebar-- **THEN** a "Comparison" entry appears after "Tech Stack" linking to /guide/comparisondiff --git a/openspec/changes/archive/2026-02-28-add-comparison-page/tasks.md b/openspec/changes/archive/2026-02-28-add-comparison-page/tasks.mddeleted file mode 100644index 54d2d446a..000000000--- a/openspec/changes/archive/2026-02-28-add-comparison-page/tasks.md+++ /dev/null@@ -1,11 +0,0 @@-## 1. Create comparison page--- [x] 1.1 Create docs/guide/comparison.md with content from root COMPARISON.md--## 2. Update VitePress config--- [x] 2.1 Add "Comparison" sidebar entry in Guide section after Tech Stack--## 3. Verify--- [x] 3.1 Run docs:build — no errorsdiff --git a/openspec/changes/archive/2026-02-28-add-vitepress-docs/.openspec.yaml b/openspec/changes/archive/2026-02-28-add-vitepress-docs/.openspec.yamldeleted file mode 100644index 34b5b2315..000000000--- a/openspec/changes/archive/2026-02-28-add-vitepress-docs/.openspec.yaml+++ /dev/null@@ -1,2 +0,0 @@-schema: spec-driven-created: 2026-02-28diff --git a/openspec/changes/archive/2026-02-28-add-vitepress-docs/design.md b/openspec/changes/archive/2026-02-28-add-vitepress-docs/design.mddeleted file mode 100644index 108291b8e..000000000--- a/openspec/changes/archive/2026-02-28-add-vitepress-docs/design.md+++ /dev/null@@ -1,70 +0,0 @@-## Context--The project uses Vite 7, Vue 3, and TypeScript. VitePress (Vue's official static site generator) fits naturally — it shares the Vite build pipeline and Vue component ecosystem. The existing documentation is:-- `PLAN.md` — 1565-line comprehensive design doc with architecture, tools, phases, keyboard shortcuts, technical deep dives-- `README.md` — project overview, features, tech stack, getting started, project structure-- `openspec/specs/` — 19 capability specs with requirements and scenarios--The editor app runs on port 1420. VitePress should use a different port for its dev server.--## Goals / Non-Goals--**Goals:**-- Browsable documentation site generated from Markdown-- Content restructured from existing PLAN.md, README, and openspec specs-- Sidebar navigation with logical grouping-- Dark theme matching editor aesthetic-- `docs:dev` / `docs:build` / `docs:preview` scripts--**Non-Goals:**-- Custom VitePress theme (use default theme)-- API documentation auto-generation from source code-- Deployment configuration (CI/CD, hosting)-- i18n / localization-- Search integration beyond VitePress built-in--## Decisions--### 1. VitePress in `docs/` directory (separate from app)--VitePress runs as an independent project in `docs/` with its own `.vitepress/config.ts`. It does NOT share the app's `vite.config.ts` — they are completely separate build pipelines.--**Why:** VitePress has its own Vite instance. Mixing with the app config would cause conflicts (different plugins, different entry points). Standard convention across all major VitePress projects.--### 2. Content structure: guide / reference / development--```-docs/- index.md — landing page (from README)- guide/- getting-started.md — installation, dev server, desktop app- features.md — feature overview with screenshots- architecture.md — system architecture diagram and explanation- tech-stack.md — tech choices and rationale- reference/- keyboard-shortcuts.md — full shortcut table from PLAN.md- node-types.md — 29 node types with properties- mcp-tools.md — 118 MCP tools reference- scene-graph.md — scene graph technical details- file-format.md — .fig/.openpencil format details- development/- contributing.md — how to contribute- testing.md — test setup and running- openspec.md — spec-driven development workflow- roadmap.md — phases and current progress-```--**Why:** Three-tier structure (guide → reference → development) is the standard pattern used by Vue, Vite, Pinia, and Nuxt documentation. Users discover via guides, look up via reference, and contribute via development docs.--### 3. VitePress as devDependency only--VitePress is added as a devDependency — it's a development tool, not shipped with the editor.--### 4. Port 5173 for docs dev server--VitePress defaults to 5173. The editor uses 1420. No conflict.--## Risks / Trade-offs--- **Content staleness** → Mitigation: docs pages are Markdown in-repo, reviewed alongside code changes. Openspec specs are the source of truth for capabilities.-- **Maintenance burden** → Mitigation: minimal custom configuration. Default VitePress theme. Content is restructured from existing artifacts, not written from scratch.diff --git a/openspec/changes/archive/2026-02-28-add-vitepress-docs/proposal.md b/openspec/changes/archive/2026-02-28-add-vitepress-docs/proposal.mddeleted file mode 100644index 241788a5d..000000000--- a/openspec/changes/archive/2026-02-28-add-vitepress-docs/proposal.md+++ /dev/null@@ -1,29 +0,0 @@-## Why--OpenPencil has extensive knowledge spread across PLAN.md (1565 lines), README.md, and 19 openspec specs — but no browsable documentation site. Contributors and users have to read raw Markdown in the repo. PLAN.md Phase 6 lists "documentation" as a deliverable. VitePress is a natural fit: same Vite ecosystem, Vue-native, generates static sites from Markdown, zero config out of the box.--## What Changes--- Add VitePress as dev dependency-- Create `docs/` directory with documentation site structure-- Content sourced from existing artifacts: PLAN.md sections, README.md, openspec specs-- Add `docs:dev` and `docs:build` scripts to package.json-- VitePress config with sidebar navigation, dark theme matching the editor--## Capabilities--### New Capabilities--- `vitepress-docs`: VitePress documentation site at `docs/` with content derived from PLAN.md, README, and openspec specs. Includes guide pages (getting started, architecture, tech stack), reference pages (keyboard shortcuts, node types, MCP tools), and development pages (contributing, testing, openspec workflow).--### Modified Capabilities--- `tooling`: Adding VitePress dependency and docs scripts to the build toolchain--## Impact--- `docs/` — new directory with VitePress config and Markdown pages-- `docs/.vitepress/config.ts` — VitePress configuration-- `package.json` — new `docs:dev`, `docs:build`, `docs:preview` scripts + vitepress devDependency-- `.gitignore` — add `docs/.vitepress/dist` and `docs/.vitepress/cache`-- No changes to the editor application itselfdiff --git a/openspec/changes/archive/2026-02-28-add-vitepress-docs/specs/tooling/spec.md b/openspec/changes/archive/2026-02-28-add-vitepress-docs/specs/tooling/spec.mddeleted file mode 100644index ddd09f161..000000000--- a/openspec/changes/archive/2026-02-28-add-vitepress-docs/specs/tooling/spec.md+++ /dev/null@@ -1,20 +0,0 @@-## MODIFIED Requirements--### Requirement: Vite 7 build system-The project SHALL use Vite 7 as the build tool with dev server at port 1420 and HMR support. VitePress SHALL be installed as a devDependency for the documentation site. The `docs:dev`, `docs:build`, and `docs:preview` scripts SHALL be added to package.json.--#### Scenario: Dev server-- **WHEN** `bun run dev` is executed-- **THEN** Vite dev server starts at http://localhost:1420 with hot module replacement--#### Scenario: Docs scripts available-- **WHEN** `bun run docs:dev` is executed-- **THEN** VitePress dev server starts for the documentation site--#### Scenario: Docs build-- **WHEN** `bun run docs:build` is executed-- **THEN** VitePress builds the documentation site to `docs/.vitepress/dist/`--#### Scenario: Docs preview-- **WHEN** `bun run docs:preview` is executed-- **THEN** a static server previews the built documentation sitediff --git a/openspec/changes/archive/2026-02-28-add-vitepress-docs/specs/vitepress-docs/spec.md b/openspec/changes/archive/2026-02-28-add-vitepress-docs/specs/vitepress-docs/spec.mddeleted file mode 100644index d44f990fb..000000000--- a/openspec/changes/archive/2026-02-28-add-vitepress-docs/specs/vitepress-docs/spec.md+++ /dev/null@@ -1,69 +0,0 @@-## ADDED Requirements--### Requirement: VitePress documentation site-The project SHALL have a VitePress documentation site in the `docs/` directory with its own `.vitepress/config.ts` configuration, independent from the app's Vite config.--#### Scenario: Docs dev server starts-- **WHEN** `bun run docs:dev` is executed-- **THEN** VitePress dev server starts and serves the documentation site--#### Scenario: Docs build succeeds-- **WHEN** `bun run docs:build` is executed-- **THEN** VitePress produces a static site in `docs/.vitepress/dist/`--### Requirement: Landing page-The docs site SHALL have an index.md landing page with project name, tagline, and quick navigation to guide and reference sections.--#### Scenario: Landing page loads-- **WHEN** user opens the docs site root URL-- **THEN** a landing page with "OpenPencil" title and feature highlights is displayed--### Requirement: Guide section-The docs site SHALL include a guide section with pages: Getting Started, Features, Architecture, Tech Stack.--#### Scenario: Getting started page-- **WHEN** user navigates to the Getting Started guide-- **THEN** installation instructions (`bun install`, `bun run dev`) and desktop app setup are displayed--#### Scenario: Architecture page-- **WHEN** user navigates to the Architecture guide-- **THEN** the system architecture diagram and component descriptions from PLAN.md are displayed--### Requirement: Reference section-The docs site SHALL include a reference section with pages: Keyboard Shortcuts, Node Types, MCP Tools, Scene Graph, File Format.--#### Scenario: Keyboard shortcuts page-- **WHEN** user navigates to Keyboard Shortcuts reference-- **THEN** the full shortcut table from PLAN.md is displayed with implementation status--#### Scenario: MCP tools page-- **WHEN** user navigates to MCP Tools reference-- **THEN** all 117 MCP tools are listed grouped by category--### Requirement: Development section-The docs site SHALL include a development section with pages: Contributing, Testing, OpenSpec Workflow, Roadmap.--#### Scenario: Roadmap page-- **WHEN** user navigates to the Roadmap development page-- **THEN** the 6 phases from PLAN.md are listed with current progress--### Requirement: Sidebar navigation-The VitePress config SHALL define a sidebar with logical grouping: Guide, Reference, Development.--#### Scenario: Sidebar groups-- **WHEN** user browses any documentation page-- **THEN** a sidebar shows three collapsible groups: Guide, Reference, Development--### Requirement: Dark theme-The docs site SHALL use dark appearance to match the editor's dark aesthetic.--#### Scenario: Dark mode-- **WHEN** user opens the documentation site-- **THEN** the site renders with VitePress dark theme--### Requirement: Build artifacts excluded from git-`docs/.vitepress/dist` and `docs/.vitepress/cache` SHALL be listed in `.gitignore`.--#### Scenario: Gitignore entries-- **WHEN** `bun run docs:build` creates output in `docs/.vitepress/dist/`-- **THEN** the output directory is not tracked by gitdiff --git a/openspec/changes/archive/2026-02-28-add-vitepress-docs/tasks.md b/openspec/changes/archive/2026-02-28-add-vitepress-docs/tasks.mddeleted file mode 100644index f1dacb75e..000000000--- a/openspec/changes/archive/2026-02-28-add-vitepress-docs/tasks.md+++ /dev/null@@ -1,35 +0,0 @@-## 1. Setup VitePress--- [x] 1.1 Install vitepress as devDependency: `bun add -D vitepress`-- [x] 1.2 Add `docs:dev`, `docs:build`, `docs:preview` scripts to package.json-- [x] 1.3 Add `docs/.vitepress/dist` and `docs/.vitepress/cache` to .gitignore-- [x] 1.4 Create `docs/.vitepress/config.ts` with: site title/description, dark appearance, sidebar (Guide/Reference/Development groups), top nav, local search, cleanUrls, socialLinks (GitHub), editLink, lastUpdated-- [x] 1.5 Create `docs/public/` with favicon (or reuse existing logo if available)--## 2. Create documentation pages — Guide--- [x] 2.1 Create `docs/index.md` — VitePress home layout with hero (title, tagline, action buttons) and features grid-- [x] 2.2 Create `docs/guide/getting-started.md` — installation, dev server, desktop app setup per platform (from README)-- [x] 2.3 Create `docs/guide/features.md` — feature overview with descriptions (from README + PLAN.md tools section)-- [x] 2.4 Create `docs/guide/architecture.md` — system architecture as Mermaid diagram + component descriptions (from PLAN.md)-- [x] 2.5 Create `docs/guide/tech-stack.md` — technology choices and rationale table (from PLAN.md + README)--## 3. Create documentation pages — Reference--- [x] 3.1 Create `docs/reference/keyboard-shortcuts.md` — full shortcut tables with implementation status (from PLAN.md)-- [x] 3.2 Create `docs/reference/node-types.md` — 29 node types table + core properties (from PLAN.md Scene Graph)-- [x] 3.3 Create `docs/reference/mcp-tools.md` — 118 MCP tools in collapsible category groups (from PLAN.md AI section)-- [x] 3.4 Create `docs/reference/scene-graph.md` — scene graph internals: storage, undo/redo, layout engine (from PLAN.md)-- [x] 3.5 Create `docs/reference/file-format.md` — .fig import pipeline, .openpencil format, Kiwi codec (from PLAN.md)--## 4. Create documentation pages — Development--- [x] 4.1 Create `docs/development/contributing.md` — project structure, code style, tooling (oxlint/oxfmt/tsgo)-- [x] 4.2 Create `docs/development/testing.md` — E2E (Playwright), unit (bun:test), Figma CDP reference tests-- [x] 4.3 Create `docs/development/openspec.md` — spec-driven workflow: propose → apply → archive-- [x] 4.4 Create `docs/development/roadmap.md` — 6 phases from PLAN.md with current progress indicators--## 5. Verify--- [x] 5.1 Run `bun run docs:dev` and confirm the site loads with all pages and sidebar navigation-- [x] 5.2 Run `bun run docs:build` and confirm it produces output without errorsdiff --git a/openspec/changes/archive/2026-02-28-document-project-history/.openspec.yaml b/openspec/changes/archive/2026-02-28-document-project-history/.openspec.yamldeleted file mode 100644index 34b5b2315..000000000--- a/openspec/changes/archive/2026-02-28-document-project-history/.openspec.yaml+++ /dev/null@@ -1,2 +0,0 @@-schema: spec-driven-created: 2026-02-28diff --git a/openspec/changes/archive/2026-02-28-document-project-history/design.md b/openspec/changes/archive/2026-02-28-document-project-history/design.mddeleted file mode 100644index 63e5d047c..000000000--- a/openspec/changes/archive/2026-02-28-document-project-history/design.md+++ /dev/null@@ -1,70 +0,0 @@-## Context--OpenPencil is an open-source Figma alternative with 92 commits of development history (2026-02-27 to 2026-02-28). The project has a detailed PLAN.md (1565 lines) covering architecture, tools, phases, and validation criteria — but no structured specs tracking. The openspec/ directory was just initialized and is empty.--The git history shows work spanning PLAN.md Phases 1-3 (core engine, editor UI, file format/import) with partial progress on later phases. We need to retroactively create baseline specs and assess documentation tooling.--## Goals / Non-Goals--**Goals:**-- Create baseline openspec specs for all 19 implemented capabilities identified from git history-- Document planned-but-unimplemented capabilities from PLAN.md as future specs with status markers-- Provide a VitePress readiness assessment-- Establish the openspec specs/ directory as the living source of truth going forward--**Non-Goals:**-- Implementing any new features or code changes-- Setting up VitePress or any documentation generation tooling-- Creating specs for capabilities from figma-use that haven't been ported yet-- Writing design system documentation or API docs--## Decisions--### 1. Spec organization: one file per capability (flat structure)--Each capability gets `openspec/specs/<capability-name>/spec.md`. No nesting by phase or module — capabilities are cross-cutting and may span multiple source directories.--**Why:** Matches openspec convention. Flat structure is easier to discover and prevents debates about categorization hierarchy.--### 2. Implemented vs planned: status field in spec header--Each spec includes a `status` field: `implemented`, `partial`, or `planned`. This lets us track what exists in code vs what's only in PLAN.md.--**Why:** We need to clearly distinguish "this works today" from "this is the vision". Avoids confusion when reading specs.--### 3. Git commit mapping: reference commits in spec scenarios--Each spec's scenarios reference the git commits that implemented them. This creates traceability from spec → code history.--**Why:** Makes it possible to understand when a capability was added and what changed. Critical for a retroactive documentation effort.--### 4. VitePress assessment: included as a standalone report, not a spec--The VitePress evaluation is a one-time assessment, not an ongoing capability. It goes into the change's design artifacts, not into openspec/specs/.--**Why:** A spec describes system behavior. "Do we have VitePress?" is an assessment question, not a capability.--## Risks / Trade-offs--- **Spec drift from code** → Mitigation: specs describe observable behavior and capabilities, not implementation details. They should stay accurate even as internals change.-- **Retroactive specs may miss edge cases** → Mitigation: focus on what git commits prove was implemented. Don't speculate about undocumented behavior.-- **Large number of specs to create at once** → Mitigation: each spec is focused and concise. Scenarios reference commits rather than rewriting commit messages.--## VitePress Assessment--**Finding: No VitePress artifacts exist in the project.**--Evidence:-- No `vitepress` dependency in package.json or bun.lock-- No `docs/` directory-- No `.vitepress/` configuration directory-- No documentation generation scripts in package.json-- No references to VitePress or documentation generation in PLAN.md, README.md, or any source files-- PLAN.md Phase 6 mentions "documentation" as a deliverable but does not specify VitePress or any specific documentation tooling--**Current documentation state:**-- `README.md` — project overview, features, tech stack, getting started, project structure (concise, well-written)-- `PLAN.md` — comprehensive 1565-line design document covering architecture, tools, phases, validation (serves as both design doc and roadmap)-- No API documentation, no user guides, no developer guides beyond README--**Recommendation:** VitePress would be a natural fit for this project when documentation becomes a priority (Phase 6). The content from PLAN.md could be restructured into VitePress pages. However, there is currently zero infrastructure for it — it would need to be built from scratch.diff --git a/openspec/changes/archive/2026-02-28-document-project-history/proposal.md b/openspec/changes/archive/2026-02-28-document-project-history/proposal.mddeleted file mode 100644index d99260ed0..000000000--- a/openspec/changes/archive/2026-02-28-document-project-history/proposal.md+++ /dev/null@@ -1,46 +0,0 @@-## Why--OpenPencil has 92 commits of implementation history and a comprehensive PLAN.md, but no structured specification tracking. The openspec/ directory is empty. To enable spec-driven development going forward, we need to retroactively document all completed work as baseline specs and capture the planned-but-not-yet-implemented capabilities from PLAN.md. This establishes the source of truth for what the system does today and what's next.--Additionally, we need to assess the current state of documentation tooling — specifically whether VitePress documentation generation has any existing artifacts or setup in the project.--## What Changes--- Create baseline openspec specs from the 92 git commits covering all implemented capabilities-- Document planned capabilities from PLAN.md phases that are not yet implemented-- Assess VitePress documentation generation readiness (no implementation — evaluation only)--## Capabilities--### New Capabilities--- `scene-graph`: Core scene graph with flat Map<GUID, Node> storage, parent-child tree via parentIndex, CRUD operations, hit testing, node types (FRAME, RECTANGLE, ELLIPSE, LINE, TEXT, VECTOR, STAR, POLYGON, GROUP, BOOLEAN_OPERATION)-- `canvas-rendering`: Skia CanvasKit WASM rendering — shapes, fills, strokes, text, effects, transforms, nested coordinate systems, selection outlines, snap guides, rulers-- `canvas-navigation`: Pan (space+drag, middle mouse, trackpad), zoom (ctrl+scroll, pinch, keyboard shortcuts), zoom-to-fit, pixel grid-- `selection-manipulation`: Click select, shift-click multi-select, marquee selection, move with drag, resize handles, rotation with 15° snap, duplicate (alt+drag, ⌘D), delete, nudge with arrows-- `undo-redo`: Inverse-command pattern undo/redo wired into all editor operations-- `text-editing`: Inline text editing with CanvasKit Paragraph API, textarea overlay, font loading (Inter default + Local Font Access API for system fonts), font weight, auto-width text boxes-- `pen-tool`: Pen tool with vector network model, bezier curves, open/closed paths, vectorNetworkBlob binary encode/decode-- `auto-layout`: Yoga WASM integration, horizontal/vertical/wrap, gap, padding, justify, align, child sizing, Shift+A toggle, drag reordering with insertion indicator, wrap selected nodes in auto-layout-- `figma-clipboard`: Bidirectional Figma clipboard — paste from Figma (Kiwi binary decode), copy for Figma (Kiwi binary encode), cut/copy between OpenPencil instances-- `fig-import`: .fig file import via Kiwi codec — header parsing, Zstd decompression, schema decode, NodeChange[] extraction, scene graph population-- `kiwi-codec`: Vendored kiwi-schema, Kiwi binary codec for Figma's 194-definition schema, ESM/CLI patching for sparse field IDs-- `editor-ui`: Vue 3 + Reka UI panels — toolbar (bottom), layers panel (tree with expand/collapse, drag reorder, visibility toggle), properties panel (appearance, fill, stroke, typography, layout, position sections), color picker (HSV, hex, opacity, alpha)-- `snap-guides`: Edge and center snapping, rotation-aware snap guides and selection bounds, sibling-based absolute coordinate snapping-- `rulers`: Canvas rulers with selection highlight, coordinate badges at selection start/end, tick label alignment, ?no-rulers URL param-- `group-ungroup`: Group/ungroup selection (⌘G / ⇧⌘G), sort nodes by position when wrapping-- `desktop-app`: Tauri v2 shell with native macOS menu bar, menu events wired to frontend, Developer Tools menu item-- `testing`: Playwright visual regression (E2E with Figma CDP reference), bun:test unit tests for SceneGraph, no-chrome test mode, data-ready optimization-- `scrub-input`: ScrubInput component — drag-to-scrub values, click-to-edit, suffix styling, used across all numeric property inputs-- `tooling`: oxlint, oxfmt, typescript-go, Vite 7, Tailwind CSS 4, unplugin-icons (Lucide via Iconify)--### Modified Capabilities--_(none — this is the initial baseline)_--## Impact--- `openspec/specs/` — populated with ~19 baseline spec files documenting current state-- `openspec/specs/` — additional specs for planned capabilities from PLAN.md marked as "planned"-- No source code changes — this is a documentation-only change-- Assessment report on VitePress readiness included in the specsdiff --git a/openspec/changes/archive/2026-02-28-document-project-history/specs/auto-layout/spec.md b/openspec/changes/archive/2026-02-28-document-project-history/specs/auto-layout/spec.mddeleted file mode 100644index 827949b12..000000000--- a/openspec/changes/archive/2026-02-28-document-project-history/specs/auto-layout/spec.md+++ /dev/null@@ -1,47 +0,0 @@-## ADDED Requirements--### Requirement: Yoga WASM layout engine-Auto-layout SHALL use Yoga WASM for flexbox-based layout computation. Frames with auto-layout SHALL have their children positioned by Yoga.--#### Scenario: Horizontal auto-layout-- **WHEN** a frame has stackMode HORIZONTAL with gap 16 and three children-- **THEN** the children are laid out horizontally with 16px between them--### Requirement: Layout properties-Auto-layout frames SHALL support: direction (horizontal/vertical/wrap), gap, padding (uniform and per-side), justify (start/center/end/space-between), align (start/center/end/stretch), and child sizing (fixed/fill/hug).--#### Scenario: Vertical layout with padding-- **WHEN** a frame has stackMode VERTICAL, padding 20, and two children-- **THEN** the children are stacked vertically with 20px padding on all sides--### Requirement: Shift+A toggle-Shift+A SHALL toggle auto-layout on the selected frame. If nodes are selected without a parent frame, Shift+A SHALL wrap them in a new auto-layout frame.--#### Scenario: Toggle auto-layout on frame-- **WHEN** user selects a frame and presses Shift+A-- **THEN** auto-layout is enabled on the frame with default settings--#### Scenario: Wrap selection in auto-layout-- **WHEN** user selects three standalone rectangles and presses Shift+A-- **THEN** the rectangles are wrapped in a new frame with auto-layout enabled--### Requirement: Drag reordering-Within an auto-layout frame, dragging a child SHALL reorder it among siblings with a visual insertion indicator.--#### Scenario: Reorder by drag-- **WHEN** user drags the second child past the third child in an auto-layout frame-- **THEN** the second child moves to position 3 with an insertion line indicating the drop position--### Requirement: Sort by position on wrap-When wrapping selected nodes in auto-layout, nodes SHALL be sorted by their visual position (left-to-right for horizontal, top-to-bottom for vertical).--#### Scenario: Wrap preserves visual order-- **WHEN** three scattered nodes are wrapped in horizontal auto-layout-- **THEN** they are ordered left-to-right based on their X position--### Requirement: Auto-layout properties panel-The properties panel SHALL show auto-layout controls (direction, gap, padding, justify, align, sizing) when an auto-layout frame is selected.--#### Scenario: Properties panel for auto-layout-- **WHEN** user selects a frame with auto-layout enabled-- **THEN** the properties panel shows the Layout section with editable direction, gap, padding, justify, and align controlsdiff --git a/openspec/changes/archive/2026-02-28-document-project-history/specs/canvas-navigation/spec.md b/openspec/changes/archive/2026-02-28-document-project-history/specs/canvas-navigation/spec.mddeleted file mode 100644index d5da9ec6b..000000000--- a/openspec/changes/archive/2026-02-28-document-project-history/specs/canvas-navigation/spec.md+++ /dev/null@@ -1,33 +0,0 @@-## ADDED Requirements--### Requirement: Pan with space+drag-The canvas SHALL support panning via space+drag, middle mouse drag, and two-finger trackpad gestures.--#### Scenario: Space+drag pan-- **WHEN** user holds space and drags on the canvas-- **THEN** the viewport pans by the drag delta--### Requirement: Zoom with scroll-The canvas SHALL support zooming via ctrl+scroll (or pinch) toward the cursor position, and via keyboard shortcuts ⌘= (zoom in), ⌘- (zoom out), ⌘0 (100%).--#### Scenario: Ctrl+scroll zoom-- **WHEN** user ctrl+scrolls up on the canvas-- **THEN** the viewport zooms in centered on the cursor position--#### Scenario: Keyboard zoom-- **WHEN** user presses ⌘0-- **THEN** the viewport resets to 100% zoom level--### Requirement: Pinch-to-zoom isolation-Browser pinch-to-zoom SHALL be prevented on UI panels while allowing canvas pinch-to-zoom.--#### Scenario: Pinch on panel-- **WHEN** user performs a pinch gesture on the properties panel-- **THEN** the browser zoom does not change--### Requirement: Hand tool-Pressing H SHALL activate the hand tool for continuous panning without holding space.--#### Scenario: Hand tool activation-- **WHEN** user presses H-- **THEN** the hand tool is active and any drag pans the canvasdiff --git a/openspec/changes/archive/2026-02-28-document-project-history/specs/canvas-rendering/spec.md b/openspec/changes/archive/2026-02-28-document-project-history/specs/canvas-rendering/spec.mddeleted file mode 100644index b098cb17c..000000000--- a/openspec/changes/archive/2026-02-28-document-project-history/specs/canvas-rendering/spec.md+++ /dev/null@@ -1,50 +0,0 @@-## ADDED Requirements--### Requirement: CanvasKit WASM rendering-The renderer SHALL use Skia CanvasKit WASM to draw all scene graph nodes onto an HTML canvas element.--#### Scenario: Canvas initialization-- **WHEN** the editor loads-- **THEN** CanvasKit WASM (canvaskit.wasm) is loaded and a GPU-accelerated surface is created--### Requirement: Shape rendering-The renderer SHALL draw RECTANGLE, ELLIPSE, LINE, STAR, POLYGON, and VECTOR nodes with their fill paints, stroke paints, opacity, and transforms.--#### Scenario: Rectangle with fill and stroke-- **WHEN** a rectangle node has a solid fill (#3B82F6) and a 2px stroke (#000)-- **THEN** the rectangle is rendered with the correct fill color, stroke color, and stroke width--### Requirement: Text rendering-The renderer SHALL render TEXT nodes using CanvasKit's Paragraph API with font family, weight, size, line height, and letter spacing.--#### Scenario: Text with Inter font-- **WHEN** a text node with fontName "Inter", fontSize 16, and characters "Hello" exists-- **THEN** the text is rendered at the correct position with the Inter font--### Requirement: Nested coordinate systems-The renderer SHALL apply parent transforms (position + rotation) when rendering child nodes, supporting arbitrary nesting depth.--#### Scenario: Rotated parent with child-- **WHEN** a frame is rotated 45° and contains a child rectangle-- **THEN** the child rectangle is rendered in the frame's rotated coordinate system--### Requirement: Selection outlines-The renderer SHALL draw selection outlines (blue rectangles) around selected nodes with resize handles at corners and edge midpoints.--#### Scenario: Select a node-- **WHEN** a node is selected-- **THEN** a blue outline with 8 resize handles appears around the node's bounds--### Requirement: Surface resize-The renderer SHALL recreate the Skia surface when the window is resized, maintaining correct dimensions.--#### Scenario: Window resize-- **WHEN** the browser window is resized-- **THEN** the canvas and Skia surface update to the new dimensions without artifacts--### Requirement: Silent crash prevention-The renderer SHALL detect and report rendering errors instead of silently failing.--#### Scenario: Rendering error-- **WHEN** a rendering operation encounters an error-- **THEN** the error is detected and reported rather than silently producing a blank canvasdiff --git a/openspec/changes/archive/2026-02-28-document-project-history/specs/desktop-app/spec.md b/openspec/changes/archive/2026-02-28-document-project-history/specs/desktop-app/spec.mddeleted file mode 100644index ada86c967..000000000--- a/openspec/changes/archive/2026-02-28-document-project-history/specs/desktop-app/spec.md+++ /dev/null@@ -1,36 +0,0 @@-## ADDED Requirements--### Requirement: Tauri v2 desktop shell-The editor SHALL run as a native desktop app via Tauri v2 with the web frontend loaded in a webview.--#### Scenario: Desktop app launch-- **WHEN** user runs `bun run tauri dev`-- **THEN** a native desktop window opens with the editor UI and CanvasKit rendering--### Requirement: Native macOS menu bar-The desktop app SHALL display a native macOS menu bar with File, Edit, View, and Window menus.--#### Scenario: Menu bar presence-- **WHEN** the desktop app launches on macOS-- **THEN** a native menu bar with standard menus is visible--### Requirement: Menu events wired to frontend-Menu item clicks SHALL fire events that the Vue frontend handles (e.g., Undo, Redo, Zoom In/Out).--#### Scenario: Menu undo-- **WHEN** user clicks Edit → Undo in the menu bar-- **THEN** the frontend receives the undo event and performs undo--### Requirement: Developer tools menu item-The menu SHALL include a Developer Tools item (⌘⌥I) that opens the webview inspector.--#### Scenario: Open dev tools-- **WHEN** user selects View → Developer Tools or presses ⌘⌥I-- **THEN** the webview developer tools panel opens--### Requirement: Desktop directory structure-The Tauri configuration and Rust source SHALL live in `desktop/` (not `src-tauri/`). Tauri CLI SHALL find it by scanning.--#### Scenario: Build from desktop directory-- **WHEN** `bun run tauri build` is run-- **THEN** Tauri finds configuration in `desktop/` and produces a native binarydiff --git a/openspec/changes/archive/2026-02-28-document-project-history/specs/editor-ui/spec.md b/openspec/changes/archive/2026-02-28-document-project-history/specs/editor-ui/spec.mddeleted file mode 100644index f1af678e0..000000000--- a/openspec/changes/archive/2026-02-28-document-project-history/specs/editor-ui/spec.md+++ /dev/null@@ -1,62 +0,0 @@-## ADDED Requirements--### Requirement: Vue 3 + Reka UI component architecture-The editor UI SHALL be built with Vue 3, VueUse composables, and Reka UI headless components. The UI framework was migrated from React to Vue 3.--#### Scenario: Editor loads-- **WHEN** user opens the editor at localhost:1420-- **THEN** the Vue 3 application renders with canvas, toolbar, layers panel, and properties panel--### Requirement: Bottom toolbar-The toolbar SHALL be positioned at the bottom of the screen (Figma UI3 style) with tool selection: Select (V), Frame (F), Rectangle (R), Ellipse (O), Line (L), Text (T), Hand (H), Pen (P).--#### Scenario: Tool selection via keyboard-- **WHEN** user presses R-- **THEN** the rectangle tool is activated and the toolbar shows R as selected--### Requirement: Layers panel with tree view-The layers panel SHALL display a tree view of the document hierarchy using Reka UI Tree with expand/collapse and drag reordering.--#### Scenario: Expand/collapse frame children-- **WHEN** user clicks the chevron next to a frame in the layers panel-- **THEN** the frame's children are shown or hidden--#### Scenario: Drag reorder layers-- **WHEN** user drags a layer to a new position in the layers panel-- **THEN** the node's z-order in the scene graph changes accordingly--#### Scenario: Visibility toggle-- **WHEN** user clicks the visibility icon next to a layer-- **THEN** the node is hidden/shown on canvas--### Requirement: Properties panel with sections-The properties panel SHALL be split into sections: Appearance (size, position, rotation, opacity, corner radius, visibility), Fill, Stroke, Typography, Layout, Position.--#### Scenario: Properties panel shows fill section-- **WHEN** user selects a rectangle with a blue fill-- **THEN** the Fill section shows the hex color #3B82F6 with opacity and visibility controls--#### Scenario: Editable hex input-- **WHEN** user types a new hex value in the fill section-- **THEN** the node's fill updates to the entered color--### Requirement: Color picker-The color picker SHALL provide HSV color selection, hue slider, alpha slider, hex input, and opacity control.--#### Scenario: Change color via HSV-- **WHEN** user moves the color picker cursor in the HSV square-- **THEN** the selected node's fill updates in real time--### Requirement: Lucide icons via Iconify-UI icons SHALL use Lucide icons loaded via unplugin-icons with Iconify, replacing inline emoji/SVG.--#### Scenario: Icon rendering-- **WHEN** the toolbar renders tool icons-- **THEN** Lucide icons are displayed via the icon auto-import resolver--### Requirement: Tailwind CSS 4 styling-The editor SHALL use Tailwind CSS 4 for all styling.--#### Scenario: Dark theme-- **WHEN** the editor renders-- **THEN** the UI uses a dark theme styled with Tailwind CSS 4 utility classesdiff --git a/openspec/changes/archive/2026-02-28-document-project-history/specs/fig-import/spec.md b/openspec/changes/archive/2026-02-28-document-project-history/specs/fig-import/spec.mddeleted file mode 100644index 2521c7fad..000000000--- a/openspec/changes/archive/2026-02-28-document-project-history/specs/fig-import/spec.md+++ /dev/null@@ -1,22 +0,0 @@-## ADDED Requirements--### Requirement: .fig file import-The editor SHALL import .fig files via the Kiwi codec pipeline: parse header (magic "fig-kiwi" + version), decompress Zstd, decode Kiwi schema, extract NodeChange[], and build the scene graph.--#### Scenario: Import a .fig file-- **WHEN** user opens a .fig file-- **THEN** all nodes from the file appear on the canvas with correct types, positions, sizes, and visual properties--### Requirement: File open via keyboard-⌘O SHALL open a file dialog for .fig import.--#### Scenario: Open file dialog-- **WHEN** user presses ⌘O-- **THEN** a file picker dialog appears filtered for .fig files--### Requirement: Blob reference resolution-The import pipeline SHALL resolve blob references (images, vector networks, font data) from the .fig file's blob section.--#### Scenario: Import with vector blobs-- **WHEN** a .fig file containing vector nodes with vectorNetworkBlob data is imported-- **THEN** the vector paths are correctly decoded and renderablediff --git a/openspec/changes/archive/2026-02-28-document-project-history/specs/figma-clipboard/spec.md b/openspec/changes/archive/2026-02-28-document-project-history/specs/figma-clipboard/spec.mddeleted file mode 100644index 28735d7ae..000000000--- a/openspec/changes/archive/2026-02-28-document-project-history/specs/figma-clipboard/spec.md+++ /dev/null@@ -1,36 +0,0 @@-## ADDED Requirements--### Requirement: Paste from Figma-The editor SHALL accept paste events containing Kiwi binary data from Figma's clipboard. Pasted nodes SHALL be decoded and added to the scene graph.--#### Scenario: Paste Figma nodes-- **WHEN** user copies a frame in Figma and pastes in OpenPencil-- **THEN** the frame and its children appear on the canvas with preserved properties--### Requirement: Copy for Figma compatibility-The editor SHALL encode selected nodes as Kiwi binary on copy, allowing paste into Figma or other OpenPencil instances.--#### Scenario: Copy to Figma-- **WHEN** user copies a rectangle in OpenPencil and pastes in Figma-- **THEN** the rectangle appears in Figma with preserved fill, stroke, and dimensions--### Requirement: Native copy/paste events-Clipboard operations SHALL use native copy/paste browser events (not async Clipboard API) and build the Kiwi binary synchronously in the event handler.--#### Scenario: Synchronous clipboard encoding-- **WHEN** user presses ⌘C with a node selected-- **THEN** the Kiwi binary is built synchronously within the copy event handler--### Requirement: Cut operation-Cut SHALL copy nodes to clipboard and delete them from the scene graph.--#### Scenario: Cut and paste-- **WHEN** user cuts a node and pastes-- **THEN** the original is removed and a copy appears at the paste position--### Requirement: Copy between instances-Copy/paste SHALL work between multiple OpenPencil browser tabs/windows.--#### Scenario: Cross-instance paste-- **WHEN** user copies a node in one OpenPencil tab and pastes in another-- **THEN** the node appears in the second tab with all properties preserveddiff --git a/openspec/changes/archive/2026-02-28-document-project-history/specs/group-ungroup/spec.md b/openspec/changes/archive/2026-02-28-document-project-history/specs/group-ungroup/spec.mddeleted file mode 100644index 0423c3f87..000000000--- a/openspec/changes/archive/2026-02-28-document-project-history/specs/group-ungroup/spec.md+++ /dev/null@@ -1,29 +0,0 @@-## ADDED Requirements--### Requirement: Group selection-⌘G SHALL group the current selection into a GROUP node. The group inherits the bounding box of its children.--#### Scenario: Group three nodes-- **WHEN** user selects three shapes and presses ⌘G-- **THEN** a GROUP node is created containing the three shapes as children--### Requirement: Ungroup selection-⇧⌘G SHALL ungroup the selected group, moving its children to the group's parent at the group's position.--#### Scenario: Ungroup-- **WHEN** user selects a group and presses ⇧⌘G-- **THEN** the group is removed and its children become siblings of the group's former parent--### Requirement: Position-based sort on wrap-When grouping or wrapping in auto-layout, nodes SHALL be sorted by their visual position to maintain reading order.--#### Scenario: Group preserves visual order-- **WHEN** three nodes at positions X=300, X=100, X=200 are grouped-- **THEN** the children are ordered by position (X=100 first, X=300 last)--### Requirement: Null node crash prevention-Group/ungroup operations SHALL handle null node references gracefully without crashing.--#### Scenario: Null node in selection-- **WHEN** a group operation encounters a null node reference in the selection-- **THEN** the operation completes without crashing, skipping the null referencediff --git a/openspec/changes/archive/2026-02-28-document-project-history/specs/kiwi-codec/spec.md b/openspec/changes/archive/2026-02-28-document-project-history/specs/kiwi-codec/spec.mddeleted file mode 100644index d70a023f9..000000000--- a/openspec/changes/archive/2026-02-28-document-project-history/specs/kiwi-codec/spec.md+++ /dev/null@@ -1,33 +0,0 @@-## ADDED Requirements--### Requirement: Vendored kiwi-schema-The project SHALL vendor kiwi-schema (from evanw/kiwi) with patches for ESM module format and sparse field ID handling.--#### Scenario: ESM import-- **WHEN** kiwi-schema is imported as an ES module-- **THEN** all encoder/decoder functions are available without CommonJS compatibility issues--### Requirement: Kiwi binary codec-The codec SHALL encode and decode Figma's 194-definition Kiwi schema including the NodeChange message type with ~390 fields.--#### Scenario: Decode a Kiwi message-- **WHEN** a compressed Kiwi binary is provided-- **THEN** the codec decodes it into a structured NodeChange[] array--#### Scenario: Encode a Kiwi message-- **WHEN** a NodeChange[] array is provided-- **THEN** the codec encodes it into Kiwi binary format--### Requirement: Sparse field ID support-The kiwi-schema parser SHALL handle sparse field IDs (non-contiguous field numbering) used by Figma's schema.--#### Scenario: Parse schema with sparse IDs-- **WHEN** a Kiwi schema definition has field IDs like 1, 2, 5, 10 (with gaps)-- **THEN** the parser correctly handles all fields without errors--### Requirement: Zstd compression-The codec layer SHALL support Zstd decompression for .fig file payloads and compression for clipboard/export.--#### Scenario: Decompress .fig payload-- **WHEN** a Zstd-compressed Kiwi payload is encountered in a .fig file-- **THEN** it is decompressed before Kiwi decodingdiff --git a/openspec/changes/archive/2026-02-28-document-project-history/specs/pen-tool/spec.md b/openspec/changes/archive/2026-02-28-document-project-history/specs/pen-tool/spec.mddeleted file mode 100644index f587763cd..000000000--- a/openspec/changes/archive/2026-02-28-document-project-history/specs/pen-tool/spec.md+++ /dev/null@@ -1,48 +0,0 @@-## ADDED Requirements--### Requirement: Pen tool with vector network model-Pressing P SHALL activate the pen tool. Clicking places corner points, click+drag places curve points with bezier handles. The underlying data model SHALL use vector networks (not simple paths).--#### Scenario: Place corner points-- **WHEN** user clicks three positions with the pen tool-- **THEN** a path with three straight-line segments is created--#### Scenario: Place curve point-- **WHEN** user clicks and drags with the pen tool-- **THEN** a bezier curve point is created with tangent handles matching the drag direction and length--### Requirement: Open and closed paths-Clicking the first point SHALL close the path. Pressing Escape SHALL commit an open path.--#### Scenario: Close path-- **WHEN** user clicks on the first point of an in-progress path-- **THEN** the path closes into a loop--#### Scenario: Open path-- **WHEN** user presses Escape during pen tool drawing-- **THEN** the current path is committed as an open path--### Requirement: Vector network blob encoding-Vector network data SHALL be encoded/decoded using the Figma vectorNetworkBlob binary format for .fig compatibility.--#### Scenario: Encode vector data-- **WHEN** a vector node is created with the pen tool-- **THEN** the vector data can be encoded to the binary vectorNetworkBlob format--#### Scenario: Decode imported vector data-- **WHEN** a .fig file containing vector nodes is imported-- **THEN** the vectorNetworkBlob is decoded into editable vector network data--### Requirement: Open path rendering-Open paths SHALL be rendered as open strokes, not closed and filled.--#### Scenario: Open path stroke-- **WHEN** an open vector path has a stroke applied-- **THEN** the path is rendered as an open stroke line, not as a closed filled shape--### Requirement: Preview line-During pen tool drawing, a preview line SHALL connect the last placed point to the current cursor position. The preview SHALL NOT start from (0,0).--#### Scenario: Preview line from last point-- **WHEN** user has placed one point and moves the cursor-- **THEN** a preview line extends from the last placed point to the cursor positiondiff --git a/openspec/changes/archive/2026-02-28-document-project-history/specs/rulers/spec.md b/openspec/changes/archive/2026-02-28-document-project-history/specs/rulers/spec.mddeleted file mode 100644index ad41deb13..000000000--- a/openspec/changes/archive/2026-02-28-document-project-history/specs/rulers/spec.md+++ /dev/null@@ -1,43 +0,0 @@-## ADDED Requirements--### Requirement: Canvas rulers-Horizontal and vertical rulers SHALL be displayed at the top and left edges of the canvas, showing coordinate scales that update with pan/zoom.--#### Scenario: Ruler display-- **WHEN** the editor loads-- **THEN** horizontal and vertical rulers are visible with tick marks and coordinate labels--### Requirement: Selection highlight on rulers-Rulers SHALL display a highlight band at the position/size of the current selection.--#### Scenario: Selection ruler highlight-- **WHEN** a 200px wide node at X=100 is selected-- **THEN** the horizontal ruler shows a translucent highlight band from 100 to 300--### Requirement: Coordinate badges-Rulers SHALL display coordinate badges at the selection's start and end positions.--#### Scenario: Coordinate badges-- **WHEN** a node spanning X 100-300, Y 50-200 is selected-- **THEN** coordinate badges show 100 and 300 on the horizontal ruler, 50 and 200 on the vertical ruler--### Requirement: Consistent text alignment-Ruler tick labels and badge text SHALL align to the same baseline for visual consistency.--#### Scenario: Label alignment-- **WHEN** rulers render tick labels and coordinate badges-- **THEN** text baselines are aligned consistently across ticks and badges--### Requirement: Vertical ruler text clipping-Vertical ruler text SHALL NOT clip or overflow outside the ruler bounds.--#### Scenario: Vertical ruler overflow-- **WHEN** the vertical ruler displays coordinate labels-- **THEN** no text is clipped or extends beyond the ruler's visible area--### Requirement: Rulers can be disabled-The URL parameter `?no-rulers` SHALL disable canvas rulers for testing or presentation.--#### Scenario: Disable rulers via URL-- **WHEN** the editor loads with `?no-rulers` in the URL-- **THEN** rulers are not rendereddiff --git a/openspec/changes/archive/2026-02-28-document-project-history/specs/scene-graph/spec.md b/openspec/changes/archive/2026-02-28-document-project-history/specs/scene-graph/spec.mddeleted file mode 100644index 6ecb9c3b2..000000000--- a/openspec/changes/archive/2026-02-28-document-project-history/specs/scene-graph/spec.md+++ /dev/null@@ -1,51 +0,0 @@-## ADDED Requirements--### Requirement: Flat node storage with GUID keys-The scene graph SHALL store all nodes in a flat `Map<string, Node>` keyed by GUID string. Tree structure SHALL be maintained via `parentIndex` references on each node.--#### Scenario: Create and retrieve a node-- **WHEN** a node is created with type RECTANGLE and a parent GUID-- **THEN** the node is stored in the map and retrievable by its GUID--#### Scenario: Parent-child relationship-- **WHEN** a child node references a parent via parentIndex-- **THEN** `getChildren(parentId)` returns the child sorted by position string--### Requirement: Node types-The scene graph SHALL support node types: FRAME, RECTANGLE, ELLIPSE, LINE, TEXT, VECTOR, STAR, POLYGON, GROUP, BOOLEAN_OPERATION, DOCUMENT, CANVAS.--#### Scenario: Create each supported node type-- **WHEN** a node of each supported type is created-- **THEN** the node is stored with the correct type enum value--### Requirement: CRUD operations-The scene graph SHALL support create, read, update, and delete operations on nodes.--#### Scenario: Delete a node-- **WHEN** a node is deleted by GUID-- **THEN** the node is removed from the map and no longer returned by queries--#### Scenario: Update node properties-- **WHEN** a node's properties (size, fill, rotation) are updated-- **THEN** subsequent reads return the updated values--### Requirement: Hit testing-The scene graph SHALL support hit testing — given a point in canvas coordinates, return the topmost visible node at that position.--#### Scenario: Hit test on overlapping nodes-- **WHEN** two rectangles overlap and a point inside the overlap area is tested-- **THEN** the node with higher z-order (later in position string sorting) is returned--### Requirement: Rectangular area query-The scene graph SHALL support querying all nodes that intersect a given rectangle (for marquee selection).--#### Scenario: Marquee selection-- **WHEN** a rectangle area query is performed-- **THEN** all nodes whose bounds intersect the rectangle are returned--### Requirement: Unit test coverage-The scene graph SHALL have bun:test unit tests covering CRUD, parent-child, z-ordering, and hit testing.--#### Scenario: Unit tests pass-- **WHEN** `bun test ./tests/engine` is run-- **THEN** all scene graph unit tests pass in <50msdiff --git a/openspec/changes/archive/2026-02-28-document-project-history/specs/scrub-input/spec.md b/openspec/changes/archive/2026-02-28-document-project-history/specs/scrub-input/spec.mddeleted file mode 100644index b4742b388..000000000--- a/openspec/changes/archive/2026-02-28-document-project-history/specs/scrub-input/spec.md+++ /dev/null@@ -1,36 +0,0 @@-## ADDED Requirements--### Requirement: Drag-to-scrub numeric input-The ScrubInput component SHALL allow users to drag anywhere on the input field to scrub (adjust) the numeric value. The entire field area SHALL be draggable.--#### Scenario: Drag to increase value-- **WHEN** user clicks and drags right on a ScrubInput with value 100-- **THEN** the value increases proportionally to the drag distance--### Requirement: Click-to-edit mode-Clicking (without dragging) a ScrubInput SHALL enter direct text editing mode where the user can type a numeric value.--#### Scenario: Click to type-- **WHEN** user clicks a ScrubInput without dragging-- **THEN** the input becomes editable and accepts keyboard input--### Requirement: Suffix styling-ScrubInput SHALL support a visual suffix (e.g., "°", "px", "%") displayed after the value.--#### Scenario: Display suffix-- **WHEN** a ScrubInput has suffix "°" and value 45-- **THEN** the input displays "45°"--### Requirement: Used across all numeric properties-ScrubInput SHALL replace plain number inputs in all property panel sections (position, size, rotation, opacity, corner radius, gap, padding, font size, stroke weight).--#### Scenario: Position input uses ScrubInput-- **WHEN** the Position section renders X and Y inputs-- **THEN** they are ScrubInput components with drag-to-scrub behavior--### Requirement: Scrub label hit area-The clickable/draggable area of the scrub label SHALL be properly sized to avoid missing clicks.--#### Scenario: Reliable click target-- **WHEN** user clicks on the scrub label text-- **THEN** the click is registered and scrub mode activatesdiff --git a/openspec/changes/archive/2026-02-28-document-project-history/specs/selection-manipulation/spec.md b/openspec/changes/archive/2026-02-28-document-project-history/specs/selection-manipulation/spec.mddeleted file mode 100644index 62a865486..000000000--- a/openspec/changes/archive/2026-02-28-document-project-history/specs/selection-manipulation/spec.md+++ /dev/null@@ -1,78 +0,0 @@-## ADDED Requirements--### Requirement: Click to select-Clicking on a node SHALL select it (deselecting all others). Clicking empty canvas SHALL deselect all.--#### Scenario: Select a single node-- **WHEN** user clicks on a rectangle-- **THEN** the rectangle is selected and all other nodes are deselected--### Requirement: Multi-select with shift-Shift+clicking a node SHALL toggle it in the current selection.--#### Scenario: Add to selection-- **WHEN** user shift+clicks a second node while one is already selected-- **THEN** both nodes are in the selection--### Requirement: Marquee selection-Dragging on empty canvas SHALL create a selection rectangle. All nodes intersecting the rectangle SHALL be selected on release.--#### Scenario: Marquee drag-- **WHEN** user drags from empty canvas across three nodes-- **THEN** all three nodes are selected when the drag ends--### Requirement: Move by dragging-Dragging a selected node SHALL move it (and all other selected nodes) by the drag delta.--#### Scenario: Drag to move-- **WHEN** user drags a selected node by 50px right-- **THEN** the node's X position increases by 50--### Requirement: Resize handles-Selected nodes SHALL display 8 resize handles (4 corners + 4 edge midpoints). Dragging a handle SHALL resize the node. Shift constrains proportions.--#### Scenario: Resize from corner-- **WHEN** user drags the bottom-right corner handle outward-- **THEN** the node's width and height increase--### Requirement: Rotation-Hovering just outside a corner handle SHALL show a rotation cursor. Dragging SHALL rotate the node. Shift SHALL snap to 15° increments.--#### Scenario: Rotate with snap-- **WHEN** user drags the rotation handle while holding shift-- **THEN** the rotation snaps to the nearest 15° increment--### Requirement: Duplicate-Alt+drag SHALL duplicate the selected node and move the duplicate. ⌘D SHALL duplicate in place.--#### Scenario: Alt+drag duplicate-- **WHEN** user alt+drags a selected rectangle-- **THEN** a copy of the rectangle is created at the drag position--### Requirement: Constrained drawing-Holding shift while drawing a shape SHALL constrain to square/circle.--#### Scenario: Shift+drag rectangle-- **WHEN** user draws a rectangle while holding shift-- **THEN** the rectangle is constrained to a square (equal width and height)--### Requirement: Nudge with arrows-Arrow keys SHALL move selected nodes by 1px. Shift+arrow SHALL move by 10px.--#### Scenario: Arrow nudge-- **WHEN** user presses the right arrow key with a node selected-- **THEN** the node moves 1px to the right--### Requirement: Delete selection-Backspace/Delete SHALL remove all selected nodes.--#### Scenario: Delete node-- **WHEN** user presses backspace with a node selected-- **THEN** the node is removed from the scene graph--### Requirement: Select all-⌘A SHALL select all nodes on the current canvas.--#### Scenario: Select all-- **WHEN** user presses ⌘A-- **THEN** all nodes on the canvas are selecteddiff --git a/openspec/changes/archive/2026-02-28-document-project-history/specs/snap-guides/spec.md b/openspec/changes/archive/2026-02-28-document-project-history/specs/snap-guides/spec.mddeleted file mode 100644index 915484306..000000000--- a/openspec/changes/archive/2026-02-28-document-project-history/specs/snap-guides/spec.md+++ /dev/null@@ -1,26 +0,0 @@-## ADDED Requirements--### Requirement: Edge and center snapping-When moving or resizing nodes, snap guides SHALL appear when edges or centers align with sibling nodes (±1px threshold).--#### Scenario: Horizontal edge snap-- **WHEN** user drags a node and its left edge aligns with another node's left edge-- **THEN** a red vertical snap guide line appears at the aligned X coordinate--#### Scenario: Center snap-- **WHEN** user drags a node and its horizontal center aligns with another node's center-- **THEN** a red snap guide line appears at the center coordinate--### Requirement: Rotation-aware snap guides-Snap guides SHALL use rotation-aware bounding boxes. Snap calculations SHALL work correctly for rotated nodes.--#### Scenario: Snap rotated node-- **WHEN** a rotated node is moved near an unrotated node-- **THEN** snap guides align to the rotated node's actual visual bounds--### Requirement: Sibling-based absolute coordinates-Snap guide calculations SHALL use sibling nodes in absolute (canvas) coordinates, not parent-relative coordinates.--#### Scenario: Snap across nesting levels-- **WHEN** a node inside a frame is moved near a node outside the frame-- **THEN** snap guides correctly compare positions in absolute canvas coordinatesdiff --git a/openspec/changes/archive/2026-02-28-document-project-history/specs/testing/spec.md b/openspec/changes/archive/2026-02-28-document-project-history/specs/testing/spec.mddeleted file mode 100644index 4f487619b..000000000--- a/openspec/changes/archive/2026-02-28-document-project-history/specs/testing/spec.md+++ /dev/null@@ -1,43 +0,0 @@-## ADDED Requirements--### Requirement: Playwright visual regression testing-E2E tests SHALL use Playwright to create shapes and compare screenshots against baseline snapshots.--#### Scenario: Visual regression test pass-- **WHEN** `bun run test` is executed-- **THEN** Playwright tests create shapes, take screenshots, and compare against baseline PNGs--### Requirement: Figma CDP reference tests-A separate Playwright project SHALL connect to Figma via Chrome DevTools Protocol (CDP) to capture reference screenshots for pixel-perfect comparison.--#### Scenario: Figma reference capture-- **WHEN** `bun run test:figma` is executed with Figma running in debug mode-- **THEN** Playwright connects to Figma via CDP and captures reference screenshots--### Requirement: No-chrome test mode-The editor SHALL support a test mode (activated via URL param or environment) that hides Chrome/UI elements for clean screenshot capture.--#### Scenario: Test mode rendering-- **WHEN** the editor loads in test mode-- **THEN** only canvas content is rendered, without toolbar, panels, or other UI chrome--### Requirement: Data-ready optimization-The editor SHALL signal readiness via a `data-ready` attribute for E2E test synchronization, replacing unreliable timeouts.--#### Scenario: Wait for ready-- **WHEN** a Playwright test waits for the data-ready attribute-- **THEN** it proceeds only when the canvas is fully rendered--### Requirement: Page reuse for speed-E2E tests SHALL reuse the browser page across test cases to minimize overhead. Target: all E2E tests complete in <3s.--#### Scenario: Fast E2E execution-- **WHEN** the full E2E test suite runs-- **THEN** it completes in under 3 seconds by reusing the page--### Requirement: bun:test unit tests-Engine unit tests SHALL use bun:test and complete in <50ms.--#### Scenario: Unit test speed-- **WHEN** `bun test ./tests/engine` is run-- **THEN** all unit tests pass in under 50msdiff --git a/openspec/changes/archive/2026-02-28-document-project-history/specs/text-editing/spec.md b/openspec/changes/archive/2026-02-28-document-project-history/specs/text-editing/spec.mddeleted file mode 100644index d42b02de3..000000000--- a/openspec/changes/archive/2026-02-28-document-project-history/specs/text-editing/spec.md+++ /dev/null@@ -1,47 +0,0 @@-## ADDED Requirements--### Requirement: Text tool creates text nodes-Pressing T SHALL activate the text tool. Clicking on canvas SHALL create a new empty text node with cursor blinking.--#### Scenario: Create text node-- **WHEN** user presses T and clicks on the canvas-- **THEN** an empty text node is created at the click position with a visible cursor--### Requirement: Inline text editing-Double-clicking a text node SHALL enter inline editing mode with a textarea overlay positioned over the canvas text. The canvas text and selection SHALL be hidden during editing.--#### Scenario: Enter edit mode-- **WHEN** user double-clicks a text node-- **THEN** a textarea overlay appears and the canvas-rendered text is hidden--### Requirement: CanvasKit Paragraph API rendering-Text nodes SHALL be rendered using CanvasKit's Paragraph API for proper text shaping, line breaking, and font metrics.--#### Scenario: Multi-line text wrapping-- **WHEN** a text node with a fixed width contains text longer than the width-- **THEN** the text wraps to multiple lines using Paragraph API layout--### Requirement: Font loading-The editor SHALL load Inter as the default font. The Local Font Access API SHALL be used to enumerate and load system fonts when available.--#### Scenario: Default font-- **WHEN** a text node is created without specifying a font-- **THEN** the Inter font is used for rendering--#### Scenario: System fonts-- **WHEN** the Local Font Access API is available-- **THEN** system fonts are enumerable in the font picker--### Requirement: Font weight support-Font weight SHALL be applied to both the CanvasKit text style and the textarea overlay during editing.--#### Scenario: Bold text rendering-- **WHEN** a text node has fontWeight 700-- **THEN** both the canvas rendering and the editing overlay display bold text--### Requirement: Blue editing outline-A blue outline SHALL appear around a text node during editing to indicate edit mode.--#### Scenario: Edit mode indicator-- **WHEN** user is editing a text node inline-- **THEN** a blue outline is visible around the text node boundsdiff --git a/openspec/changes/archive/2026-02-28-document-project-history/specs/tooling/spec.md b/openspec/changes/archive/2026-02-28-document-project-history/specs/tooling/spec.mddeleted file mode 100644index 4942a5b4a..000000000--- a/openspec/changes/archive/2026-02-28-document-project-history/specs/tooling/spec.md+++ /dev/null@@ -1,43 +0,0 @@-## ADDED Requirements--### Requirement: Vite 7 build system-The project SHALL use Vite 7 as the build tool with dev server at port 1420 and HMR support.--#### Scenario: Dev server-- **WHEN** `bun run dev` is executed-- **THEN** Vite dev server starts at http://localhost:1420 with hot module replacement--### Requirement: oxlint linting-The project SHALL use oxlint for fast linting with project-specific configuration in oxlint.json.--#### Scenario: Lint check-- **WHEN** `bun run lint` is executed-- **THEN** oxlint checks src/ for issues based on oxlint.json rules--### Requirement: oxfmt formatting-The project SHALL use oxfmt for code formatting with configuration in .oxfmtrc.json.--#### Scenario: Format code-- **WHEN** `bun run format` is executed-- **THEN** oxfmt formats all files in src/ according to project rules--### Requirement: typescript-go type checking-The project SHALL use typescript-go (tsgo) for type checking via `bun run typecheck`.--#### Scenario: Type check-- **WHEN** `bun run typecheck` is executed-- **THEN** tsgo --noEmit checks all TypeScript files for type errors--### Requirement: Combined check command-`bun run check` SHALL run both lint and typecheck sequentially.--#### Scenario: Full check-- **WHEN** `bun run check` is executed-- **THEN** oxlint runs first, then tsgo, and both must pass--### Requirement: Tailwind CSS 4 integration-Tailwind CSS 4 SHALL be integrated via @tailwindcss/vite plugin.--#### Scenario: Tailwind classes work-- **WHEN** a Vue component uses Tailwind utility classes-- **THEN** the corresponding CSS is generated and applieddiff --git a/openspec/changes/archive/2026-02-28-document-project-history/specs/undo-redo/spec.md b/openspec/changes/archive/2026-02-28-document-project-history/specs/undo-redo/spec.mddeleted file mode 100644index 3155af77d..000000000--- a/openspec/changes/archive/2026-02-28-document-project-history/specs/undo-redo/spec.md+++ /dev/null@@ -1,23 +0,0 @@-## ADDED Requirements--### Requirement: Inverse-command undo-The undo system SHALL use an inverse-command pattern where every operation records its inverse. ⌘Z SHALL undo and ⇧⌘Z SHALL redo.--#### Scenario: Undo a move-- **WHEN** user moves a node and presses ⌘Z-- **THEN** the node returns to its original position--#### Scenario: Redo after undo-- **WHEN** user undoes a move and presses ⇧⌘Z-- **THEN** the node moves back to the position after the original move--### Requirement: All operations undoable-Undo/redo SHALL be wired into all editor operations: create, delete, move, resize, rotate, property changes, reparent, layout changes.--#### Scenario: Undo node creation-- **WHEN** user creates a rectangle and presses ⌘Z-- **THEN** the rectangle is removed from the scene graph--#### Scenario: Undo property change-- **WHEN** user changes a node's fill color from blue to red and presses ⌘Z-- **THEN** the fill color reverts to bluediff --git a/openspec/changes/archive/2026-02-28-document-project-history/tasks.md b/openspec/changes/archive/2026-02-28-document-project-history/tasks.mddeleted file mode 100644index 5aa5db2a4..000000000--- a/openspec/changes/archive/2026-02-28-document-project-history/tasks.md+++ /dev/null@@ -1,10 +0,0 @@-## 1. Validate artifacts--- [x] 1.1 Run `openspec status --change document-project-history` to confirm all artifacts (proposal, design, specs, tasks) are done-- [x] 1.2 Verify all 19 spec directories exist in `changes/document-project-history/specs/`: scene-graph, canvas-rendering, canvas-navigation, selection-manipulation, undo-redo, text-editing, pen-tool, auto-layout, figma-clipboard, fig-import, kiwi-codec, editor-ui, snap-guides, rulers, group-ungroup, desktop-app, testing, scrub-input, tooling--## 2. Archive and merge--- [x] 2.1 Run `openspec archive --change document-project-history` to merge delta specs into `openspec/specs/` and move the change to archive-- [x] 2.2 Verify all 19 spec directories now exist in `openspec/specs/` with their `spec.md` files-- [x] 2.3 Verify the change was moved to `openspec/changes/archive/document-project-history/`diff --git a/openspec/changes/archive/2026-02-28-figma-feature-comparison/.openspec.yaml b/openspec/changes/archive/2026-02-28-figma-feature-comparison/.openspec.yamldeleted file mode 100644index 34b5b2315..000000000--- a/openspec/changes/archive/2026-02-28-figma-feature-comparison/.openspec.yaml+++ /dev/null@@ -1,2 +0,0 @@-schema: spec-driven-created: 2026-02-28diff --git a/openspec/changes/archive/2026-02-28-figma-feature-comparison/design.md b/openspec/changes/archive/2026-02-28-figma-feature-comparison/design.mddeleted file mode 100644index 3df502f4a..000000000--- a/openspec/changes/archive/2026-02-28-figma-feature-comparison/design.md+++ /dev/null@@ -1,46 +0,0 @@-## Context--The `../figma-docs` repo has ~90 Figma help center articles organized into categories: Tour the Interface, Create Designs (layers, vectors, text, colors, auto layout, properties), Figma Draw, Build Design Systems (styles, components, variables, libraries), Dev Mode, Create Prototypes, Import/Export, Work Together. Open Pencil's current features are documented in `docs/guide/features.md` and codified in 20 openspec specs. The existing `docs/guide/comparison.md` only compares against Penpot.--## Goals / Non-Goals--**Goals:**-- Single authoritative page mapping every Figma Design feature area to Open Pencil status-- Tables grouped by Figma's own documentation categories for intuitive navigation-- Three-tier status system: ✅ Supported, 🟡 Partial, 🔲 Not yet — with brief notes-- VitePress sidebar integration under Guide section--**Non-Goals:**-- Not replicating Figma's docs content — just referencing feature names-- Not covering Figma-specific SaaS features (team management, billing, organization admin)-- Not covering FigJam or Figma Slides — only Figma Design-- Not implementing any missing features — this is documentation only--## Decisions--### 1. Table structure: category → feature → status → notes--Each category from Figma's docs becomes a `###` heading with a markdown table. Columns: Feature | Status | Notes. This is the simplest structure that VitePress renders well and is easy to maintain.--Alternative considered: one giant flat table. Rejected — too long, harder to scan.--### 2. Feature granularity: one row per Figma help article (roughly)--Some articles cover multiple sub-features (e.g., "Explore text properties" covers font, size, weight, alignment, etc.). In those cases, split into meaningful rows where Open Pencil may have partial coverage. But don't go deeper than what's useful — keep it ~80-100 rows total.--### 3. Status assessment methodology--Map features by cross-referencing:-- Figma docs articles → what the feature does-- Open Pencil specs (`openspec/specs/*/spec.md`) → what's been specified-- Open Pencil features (`docs/guide/features.md`) → what's been built-- Source code if ambiguous--### 4. Sidebar placement--Add `figma-comparison` after `comparison` (Penpot) in the Guide section. Title: "Figma Feature Matrix".--## Risks / Trade-offs--- [Staleness] Tables become outdated as features are implemented → Add a note at the top with last-updated date; updating the table should be part of future feature completion workflows-- [Subjectivity] "Partial" vs "Not yet" can be debatable → Use "Partial" only when the core behavior exists but edge cases or advanced options are missingdiff --git a/openspec/changes/archive/2026-02-28-figma-feature-comparison/proposal.md b/openspec/changes/archive/2026-02-28-figma-feature-comparison/proposal.mddeleted file mode 100644index eb570faca..000000000--- a/openspec/changes/archive/2026-02-28-figma-feature-comparison/proposal.md+++ /dev/null@@ -1,25 +0,0 @@-## Why--The project documentation (VitePress at `docs/`) has a comparison page (`docs/guide/comparison.md`) that compares Open Pencil vs Penpot architecturally. There is no systematic feature-by-feature comparison against Figma — the product Open Pencil is cloning. The `../figma-docs` repository contains ~90 articles scraped from Figma's help center covering all Figma Design features. Mapping these against Open Pencil's current capabilities produces summary comparison tables that serve dual purpose: (1) show users/contributors exactly what works today, and (2) act as an implicit roadmap of what's missing.--## What Changes--- Add a new documentation page `docs/guide/figma-comparison.md` with comparison tables organized by Figma's own feature categories-- Each table row maps a Figma feature to Open Pencil's status: ✅ Supported, 🟡 Partial, 🔲 Not yet-- Categories follow Figma's docs structure: Interface, Layers & Shapes, Vector Tools, Text, Color & Fills, Effects & Strokes, Auto Layout, Components & Variables, Prototyping, Import/Export, Collaboration, Dev Mode-- Add navigation entry in VitePress sidebar under Guide-- Cross-reference Figma help center articles so readers can check exact feature scope--## Capabilities--### New Capabilities-- `figma-comparison-docs`: VitePress documentation page with feature-by-feature comparison tables against Figma Design, sourced from figma-docs articles and Open Pencil's existing specs/features--### Modified Capabilities-- `vitepress-docs`: Adding a new page to the sidebar config and navigation--## Impact--- `docs/guide/figma-comparison.md` — new file-- `docs/.vitepress/config.ts` — sidebar entry addition-- No code changes, no runtime impact — documentation onlydiff --git a/openspec/changes/archive/2026-02-28-figma-feature-comparison/specs/figma-comparison-docs/spec.md b/openspec/changes/archive/2026-02-28-figma-feature-comparison/specs/figma-comparison-docs/spec.mddeleted file mode 100644index 0554290f3..000000000--- a/openspec/changes/archive/2026-02-28-figma-feature-comparison/specs/figma-comparison-docs/spec.md+++ /dev/null@@ -1,43 +0,0 @@-## ADDED Requirements--### Requirement: Feature comparison page exists-The documentation site SHALL include a page at `docs/guide/figma-comparison.md` that provides feature-by-feature comparison tables mapping Figma Design features to Open Pencil status.--#### Scenario: Page is accessible-- **WHEN** user navigates to `/guide/figma-comparison` on the docs site-- **THEN** the page renders with title "Figma Feature Matrix" and contains comparison tables--### Requirement: Tables organized by Figma categories-The comparison page SHALL group features into tables by Figma's documentation categories: Interface & Navigation, Layers & Shapes, Vector Tools, Text & Typography, Color Gradients & Images, Effects & Properties, Auto Layout, Components & Design Systems, Prototyping, Import & Export, Collaboration, Dev Mode.--#### Scenario: All categories present-- **WHEN** user views the comparison page-- **THEN** each Figma documentation category has its own section heading and table--### Requirement: Three-tier status system-Each feature row SHALL use one of three status indicators: ✅ (supported — feature works), 🟡 (partial — core behavior exists but advanced options missing), 🔲 (not yet — feature not implemented).--#### Scenario: Status indicators are consistent-- **WHEN** a feature is listed in the comparison table-- **THEN** its status column contains exactly one of ✅, 🟡, or 🔲--### Requirement: Feature rows include notes-Each table row SHALL contain columns: Feature, Status, Notes. The Notes column provides brief context such as what works, what's missing, or relevant Open Pencil implementation details.--#### Scenario: Notes explain partial status-- **WHEN** a feature has 🟡 partial status-- **THEN** the Notes column explains what is supported and what is missing--### Requirement: Last-updated timestamp-The page SHALL display a last-updated date at the top so readers know the freshness of the comparison data.--#### Scenario: Date is visible-- **WHEN** user views the page-- **THEN** a "Last updated" line is visible near the top of the page--### Requirement: Sidebar integration-The VitePress config SHALL include the new page in the Guide sidebar section.--#### Scenario: Sidebar shows link-- **WHEN** user views any docs page-- **THEN** the sidebar Guide section includes a "Figma Feature Matrix" link pointing to `/guide/figma-comparison`diff --git a/openspec/changes/archive/2026-02-28-figma-feature-comparison/specs/vitepress-docs/spec.md b/openspec/changes/archive/2026-02-28-figma-feature-comparison/specs/vitepress-docs/spec.mddeleted file mode 100644index 6c9310d14..000000000--- a/openspec/changes/archive/2026-02-28-figma-feature-comparison/specs/vitepress-docs/spec.md+++ /dev/null@@ -1,12 +0,0 @@-## MODIFIED Requirements--### Requirement: Sidebar navigation-The VitePress config SHALL define a sidebar with logical grouping: Guide, Reference, Development. The Guide group SHALL include a "Figma Feature Matrix" entry after "Comparison" linking to `/guide/figma-comparison`.--#### Scenario: Sidebar groups-- **WHEN** user browses any documentation page-- **THEN** a sidebar shows three collapsible groups: Guide, Reference, Development--#### Scenario: Figma comparison in sidebar-- **WHEN** user views the Guide sidebar section-- **THEN** a "Figma Feature Matrix" entry appears after "Comparison" linking to `/guide/figma-comparison`diff --git a/openspec/changes/archive/2026-02-28-figma-feature-comparison/tasks.md b/openspec/changes/archive/2026-02-28-figma-feature-comparison/tasks.mddeleted file mode 100644index 8fe461944..000000000--- a/openspec/changes/archive/2026-02-28-figma-feature-comparison/tasks.md+++ /dev/null@@ -1,24 +0,0 @@-## 1. Create Comparison Page--- [x] 1.1 Create `docs/guide/figma-comparison.md` with frontmatter (title, description for SEO), intro paragraph explaining scope (Figma Design features only, not FigJam/Slides/SaaS-admin), status legend (✅ = works, 🟡 = partial — core behavior exists but advanced options/edge cases missing, 🔲 = not yet implemented), and a summary progress line-- [x] 1.2 Write "Interface & Navigation" table (toolbar, layers panel, pages, zoom/pan, rulers, guides, actions menu, keyboard shortcuts, background color, outlines view, find & replace)-- [x] 1.3 Write "Layers & Shapes" table (shape tools, frames, groups, sections, masks, arc tool, pencil tool, selection, alignment/position/rotation, copy/paste, lock/visibility, rename, scale, constraints, smart selection, layout guides, measure distances)-- [x] 1.4 Write "Vector Tools" table (vector networks, pen tool, edit vectors, boolean operations, flatten, stroke-to-path, text-to-path, shape builder, offset/simplify path)-- [x] 1.5 Write "Text & Typography" table (text tool, text properties, font loading, text styles, lists, links, emojis, OpenType, variable fonts, CJK, RTL, text resizing)-- [x] 1.6 Write "Color, Gradients & Images" table (color picker, solid/gradient/image/pattern fills, blend modes, images, eyedropper, mixed selection colors, color models)-- [x] 1.7 Write "Effects & Properties" table (drop shadow, inner shadow, layer blur, background blur, strokes cap/join/dash, corner radius, smoothing)-- [x] 1.8 Write "Auto Layout" table (horizontal/vertical flow, grid flow, gap, padding, alignment, child sizing, wrap, combined flows)-- [x] 1.9 Write "Components & Design Systems" table (components, instances, variants, component properties, variables, collections, modes, styles, libraries)-- [x] 1.10 Write "Prototyping" table (connections, triggers, actions, animations, overlays, scroll, smart animate, flows, variables in prototypes)-- [x] 1.11 Write "Import & Export" table (.fig import, .fig export, clipboard, Sketch import, image/SVG export, version history)-- [x] 1.12 Write "Collaboration & Dev Mode" table (comments, multiplayer, branching, cursor chat, Dev Mode inspect, code connect, MCP server)--Feature sources: `../figma-docs/` articles (~90 files). Status determined by cross-referencing Open Pencil openspec specs (20 specs in `openspec/specs/`) and `docs/guide/features.md`. Criteria: ✅ = feature works end-to-end per the spec, 🟡 = core behavior present but notable sub-features missing, 🔲 = not implemented at all.--## 2. VitePress Integration--- [x] 2.1 Add "Figma Feature Matrix" entry to the Guide sidebar section in `docs/.vitepress/config.ts` after "Comparison"--## 3. Verify--- [x] 3.1 Run `bun run docs:build` to confirm the page builds without errorsdiff --git a/openspec/changes/archive/2026-02-28-sync-master-effects-corners-ci/.openspec.yaml b/openspec/changes/archive/2026-02-28-sync-master-effects-corners-ci/.openspec.yamldeleted file mode 100644index b51d4740b..000000000--- a/openspec/changes/archive/2026-02-28-sync-master-effects-corners-ci/.openspec.yaml+++ /dev/null@@ -1 +0,0 @@-type: changediff --git a/openspec/changes/archive/2026-02-28-sync-master-effects-corners-ci/design.md b/openspec/changes/archive/2026-02-28-sync-master-effects-corners-ci/design.mddeleted file mode 100644index 99fbd93a6..000000000--- a/openspec/changes/archive/2026-02-28-sync-master-effects-corners-ci/design.md+++ /dev/null@@ -1,11 +0,0 @@-# Design: Sync Master Features into Specs & Docs--Documentation-only change — no source code modifications. Update specs and docs to match already-implemented features from master.--## Delta-Specs--- **components** — live sync, override preservation, child propagation, componentId mapping-- **scene-graph** — syncInstances, synced property list, child clone-with-mapping, independent corners-- **editor-ui** — Effects section, independent corner radius toggle, remove Create Instance button-- **desktop-app** — GitHub Actions CI/CD workflow-- **testing** — component-instance sync unit testsdiff --git a/openspec/changes/archive/2026-02-28-sync-master-effects-corners-ci/proposal.md b/openspec/changes/archive/2026-02-28-sync-master-effects-corners-ci/proposal.mddeleted file mode 100644index 23ac7f9cb..000000000--- a/openspec/changes/archive/2026-02-28-sync-master-effects-corners-ci/proposal.md+++ /dev/null@@ -1,14 +0,0 @@-# Proposal: Sync Master Features into Specs & Docs--## Context--10 commits merged from master since last docs/specs sync (68425a0..af3db9f). These introduce significant new features that are not yet reflected in OpenSpec specs, VitePress docs, or the Figma comparison matrix.--## New Features to Document--1. **Live component-instance sync** — editing a main component propagates changes to all instances. Instance children mapped via `componentId`. Override record preserves instance-level customizations.-2. **Independent corner radius controls** — per-corner radius UI in Appearance section with toggle for uniform/independent mode.-3. **Effects section in properties panel** — full effects panel: add/remove effects, type picker, inline controls.-4. **GitHub Actions CI/CD** — build workflow for Windows + macOS.-5. **Mac shortcut fixes** — ⌥⌘K/⌥⌘B/⇧⌘K/⇧⌘H/⇧⌘L.-6. **Instance tests** — unit tests for sync lifecycle.diff --git a/openspec/changes/archive/2026-02-28-sync-master-effects-corners-ci/tasks.md b/openspec/changes/archive/2026-02-28-sync-master-effects-corners-ci/tasks.mddeleted file mode 100644index 88fb5aaa6..000000000--- a/openspec/changes/archive/2026-02-28-sync-master-effects-corners-ci/tasks.md+++ /dev/null@@ -1,21 +0,0 @@-# Tasks: Sync Master Features into Specs & Docs--All tasks completed.--## 1. Merge Delta-Specs into Main Specs--- [x] 1.1 Merge components delta-spec — live sync, overrides, child propagation, componentId mapping-- [x] 1.2 Merge scene-graph delta-spec — syncInstances, synced props, clone-with-mapping, independent corners-- [x] 1.3 Merge editor-ui delta-spec — Effects section, independent corners toggle, update sections list-- [x] 1.4 Merge desktop-app delta-spec — GitHub Actions CI/CD workflow-- [x] 1.5 Merge testing delta-spec — component-instance sync unit tests--## 2. Update VitePress Docs--- [x] 2.1 Update features.md — Components sync, Effects section, CI/CD Builds-- [x] 2.2 Update figma-comparison.md — Override propagation ✅, corner radius notes, coverage ~51/90-- [x] 2.3 Update roadmap.md — Phase 4 Delivered + Phase 6 cleanup--## 3. Verify--- [x] 3.1 VitePress docs build passesdiff --git a/openspec/changes/archive/2026-02-28-sync-master-features/.openspec.yaml b/openspec/changes/archive/2026-02-28-sync-master-features/.openspec.yamldeleted file mode 100644index 34b5b2315..000000000--- a/openspec/changes/archive/2026-02-28-sync-master-features/.openspec.yaml+++ /dev/null@@ -1,2 +0,0 @@-schema: spec-driven-created: 2026-02-28diff --git a/openspec/changes/archive/2026-02-28-sync-master-features/design.md b/openspec/changes/archive/2026-02-28-sync-master-features/design.mddeleted file mode 100644index 5e354bce5..000000000--- a/openspec/changes/archive/2026-02-28-sync-master-features/design.md+++ /dev/null@@ -1,28 +0,0 @@-## Context--13 commits from master added components/instances, context menu, and rendering optimizations. The docs branch has specs and VitePress docs that predate these features. This change synchronizes documentation artifacts with the actual codebase state.--## Goals / Non-Goals--**Goals:**-- All new capabilities have corresponding spec requirements and scenarios-- VitePress docs accurately reflect current feature set-- Figma Feature Matrix reflects the new status of implemented features--**Non-Goals:**-- No source code changes-- Not adding specs for low-level implementation details (RAF coalescing, paint reuse are perf optimizations, not user-facing requirements)--## Decisions--### 1. Two new specs: `components` and `context-menu`--Components are a major feature area deserving their own spec. Context menu is a distinct UI capability with its own action set.--### 2. Viewport culling goes into `canvas-rendering` as a modified requirement--Culling changes rendering behavior (off-screen nodes are skipped) so it modifies the rendering spec.--### 3. Keyboard shortcuts documented in `editor-ui` spec, not a separate spec--The shortcuts are part of the editor UI, consistent with existing pattern where `editor-ui` covers keyboard interactions for tools and panels.diff --git a/openspec/changes/archive/2026-02-28-sync-master-features/proposal.md b/openspec/changes/archive/2026-02-28-sync-master-features/proposal.mddeleted file mode 100644index 9c7898d1b..000000000--- a/openspec/changes/archive/2026-02-28-sync-master-features/proposal.md+++ /dev/null@@ -1,31 +0,0 @@-## Why--13 commits merged from master introduce components/instances, context menu, z-order, visibility/lock, move-to-page, viewport culling, and rendering optimizations. The openspec specs and VitePress docs don't reflect these new capabilities. The Figma Feature Matrix also needs status updates.--## What Changes--- Update specs to cover: components (create, instance, detach, go-to-main, component sets), context menu, z-order (bring to front/send to back), visibility toggle, lock/unlock, move-to-page, rename node, viewport culling, rendering optimizations (RAF coalescing, paint reuse)-- Update `docs/guide/features.md` with new features-- Update `docs/guide/figma-comparison.md` statuses (components partial, z-order ✅, lock/visibility ✅, rename ✅, context menu ✅)-- Update `docs/reference/keyboard-shortcuts.md` with newly implemented shortcuts-- Update `docs/development/roadmap.md` — Phase 4 partially started--## Capabilities--### New Capabilities-- `components`: Components, component sets, instances — create, instantiate, detach, go-to-main component, component labels-- `context-menu`: Right-click context menu with clipboard, z-order, grouping, component, visibility, lock, and move-to-page actions--### Modified Capabilities-- `scene-graph`: New methods — cloneTree, createInstance, detachInstance, getMainComponent, getInstances, hitTestDeep; componentId/overrides fields on SceneNode-- `canvas-rendering`: Viewport culling, component label rendering, component set dashed border, Paint reuse, RAF coalescing-- `selection-manipulation`: Components/instances are opaque containers (click selects whole, double-click enters); z-order (bring to front, send to back); toggle visibility; toggle lock; move to page; rename node-- `editor-ui`: Context menu integration, component keyboard shortcuts (⌥⌘K, ⌥⌘B, ⇧⌘K), z-order shortcuts (], [), visibility (⇧⌘H), lock (⇧⌘L)-- `vitepress-docs`: Update features, keyboard shortcuts, roadmap, figma comparison pages-- `figma-comparison-docs`: Status updates for newly implemented features--## Impact--- `openspec/specs/` — 2 new specs, 6 modified specs-- `docs/` — 4 pages updated (features, keyboard-shortcuts, roadmap, figma-comparison)-- No source code changes — specs and docs sync onlydiff --git a/openspec/changes/archive/2026-02-28-sync-master-features/specs/canvas-rendering/spec.md b/openspec/changes/archive/2026-02-28-sync-master-features/specs/canvas-rendering/spec.mddeleted file mode 100644index 4a4933526..000000000--- a/openspec/changes/archive/2026-02-28-sync-master-features/specs/canvas-rendering/spec.md+++ /dev/null@@ -1,47 +0,0 @@-## ADDED Requirements--### Requirement: Viewport culling-The renderer SHALL skip drawing nodes whose bounding boxes are entirely outside the visible viewport. Export rendering SHALL disable culling to render all nodes.--#### Scenario: Off-screen node skipped-- **WHEN** a node is completely outside the visible viewport-- **THEN** the renderer does not draw it--#### Scenario: Export renders all nodes-- **WHEN** `renderSceneToCanvas` is called for export-- **THEN** all nodes are rendered regardless of viewport position--### Requirement: Component label rendering-The renderer SHALL draw purple labels for COMPONENT, COMPONENT_SET, and INSTANCE nodes. Labels appear above the node (or inside for COMPONENT_SET children) with a diamond icon and node name.--#### Scenario: Instance label-- **WHEN** an INSTANCE named "Button" is on canvas-- **THEN** a purple label "Button" with diamond icon is rendered above it--### Requirement: Component set border rendering-The renderer SHALL draw COMPONENT_SET nodes with a dashed purple border (6px dash, 4px gap, 1.5px stroke width).--#### Scenario: Dashed border-- **WHEN** a COMPONENT_SET is visible on canvas-- **THEN** its border is rendered as dashed purple lines--### Requirement: Component label hit testing-The renderer SHALL support `hitTestComponentLabel(graph, x, y)` returning the node whose label was clicked, enabling click-to-select via label.--#### Scenario: Click component label-- **WHEN** user clicks on a component's purple label-- **THEN** the component is selected--### Requirement: Paint object reuse-The renderer SHALL reuse Skia Paint objects across frames instead of allocating new ones per render call.--#### Scenario: Multiple renders-- **WHEN** the scene is rendered 60 times per second-- **THEN** Paint objects are reused, not reallocated each frame--### Requirement: RAF render coalescing-The renderer SHALL coalesce multiple render requests within a single frame using `requestAnimationFrame`, rendering at most once per animation frame.--#### Scenario: Rapid state changes-- **WHEN** 10 state changes trigger renders within one frame-- **THEN** only one actual render occursdiff --git a/openspec/changes/archive/2026-02-28-sync-master-features/specs/components/spec.md b/openspec/changes/archive/2026-02-28-sync-master-features/specs/components/spec.mddeleted file mode 100644index 8952c3fb4..000000000--- a/openspec/changes/archive/2026-02-28-sync-master-features/specs/components/spec.md+++ /dev/null@@ -1,65 +0,0 @@-## ADDED Requirements--### Requirement: Create component from selection-The editor SHALL convert selected frames/groups to COMPONENT type, or wrap multiple selected nodes in a new COMPONENT node (⌥⌘K). Single frame/group converts in-place; multiple nodes wraps in a bounding component.--#### Scenario: Convert frame to component-- **WHEN** user selects a single frame and presses ⌥⌘K-- **THEN** the frame's type changes to COMPONENT--#### Scenario: Wrap multiple nodes in component-- **WHEN** user selects three rectangles and presses ⌥⌘K-- **THEN** a COMPONENT node wraps them, positioned at their bounding box--### Requirement: Create component set from components-The editor SHALL combine multiple selected COMPONENT nodes into a COMPONENT_SET container (⇧⌘K). The set gets a dashed purple border and a 40px padding around its children.--#### Scenario: Create component set-- **WHEN** user selects two COMPONENT nodes and presses ⇧⌘K-- **THEN** a COMPONENT_SET wraps them with dashed purple border--### Requirement: Create instance from component-The editor SHALL create an INSTANCE node from a COMPONENT, copying its visual properties and children. The instance is placed 40px to the right of the source component.--#### Scenario: Create instance via context menu-- **WHEN** user right-clicks a component and selects "Create instance"-- **THEN** an INSTANCE appears to the right, visually identical to the component--### Requirement: Detach instance-The editor SHALL convert an INSTANCE back to a regular FRAME, clearing its componentId and overrides (⌥⌘B).--#### Scenario: Detach instance-- **WHEN** user selects an instance and presses ⌥⌘B-- **THEN** the instance becomes a FRAME with no component link--### Requirement: Go to main component-The editor SHALL navigate to and select the main COMPONENT for a selected INSTANCE, switching pages if needed.--#### Scenario: Navigate to main component-- **WHEN** user right-clicks an instance and selects "Go to main component"-- **THEN** the main component is selected and centered in the viewport--### Requirement: Component labels-The renderer SHALL draw always-visible purple labels above COMPONENT and INSTANCE nodes (or inside COMPONENT_SET children). Labels show the node name with a diamond icon.--#### Scenario: Component label visible-- **WHEN** a COMPONENT node exists on canvas-- **THEN** a purple label with the component name is rendered above it--### Requirement: Component set visual treatment-COMPONENT_SET nodes SHALL render with a dashed purple border (6px dash, 4px gap, 1.5px width) instead of a solid border.--#### Scenario: Component set border-- **WHEN** a COMPONENT_SET is on canvas-- **THEN** it renders with a dashed purple border--### Requirement: Opaque container hit testing-COMPONENT and INSTANCE nodes SHALL behave as opaque containers for hit testing — clicking selects the component/instance itself, not its children. Children are accessible only via double-click (deep hit test).--#### Scenario: Click on component child-- **WHEN** user clicks a rectangle inside a component-- **THEN** the component is selected, not the rectangle--#### Scenario: Double-click into component-- **WHEN** user double-clicks a child inside a component-- **THEN** the child is selected (deep selection)diff --git a/openspec/changes/archive/2026-02-28-sync-master-features/specs/context-menu/spec.md b/openspec/changes/archive/2026-02-28-sync-master-features/specs/context-menu/spec.mddeleted file mode 100644index 79ecba57a..000000000--- a/openspec/changes/archive/2026-02-28-sync-master-features/specs/context-menu/spec.md+++ /dev/null@@ -1,54 +0,0 @@-## ADDED Requirements--### Requirement: Right-click context menu-Right-clicking on the canvas SHALL show a context menu with Figma-style actions. If clicking on a node, that node is selected first. If clicking empty canvas, selection is cleared.--#### Scenario: Right-click on node-- **WHEN** user right-clicks on a rectangle-- **THEN** the rectangle is selected and a context menu appears with available actions--#### Scenario: Right-click on empty canvas-- **WHEN** user right-clicks on empty canvas-- **THEN** selection is cleared and a context menu appears with paste action available--### Requirement: Context menu clipboard actions-The context menu SHALL include Copy (⌘C), Cut (⌘X), Paste here (⌘V), Duplicate (⌘D), and Delete (⌫). Clipboard actions are disabled when no selection exists.--#### Scenario: Copy from context menu-- **WHEN** user right-clicks a selected node and clicks "Copy"-- **THEN** the node is copied to clipboard--### Requirement: Context menu z-order actions-The context menu SHALL include "Bring to front" (]) and "Send to back" ([), disabled when no selection exists.--#### Scenario: Bring to front via menu-- **WHEN** user right-clicks a node and selects "Bring to front"-- **THEN** the node moves to the top of its parent's child list--### Requirement: Context menu grouping actions-The context menu SHALL include Group (⌘G, requires 2+ selected), Ungroup (⇧⌘G, shown for groups), and Add auto layout (⇧A).--#### Scenario: Group from context menu-- **WHEN** user selects two nodes, right-clicks, and selects "Group"-- **THEN** the nodes are grouped--### Requirement: Context menu component actions-The context menu SHALL include component actions in purple: Create component (⌥⌘K), Create component set (⇧⌘K, when 2+ components selected), Create instance (for components), Go to main component (for instances), Detach instance (⌥⌘B, for instances).--#### Scenario: Create component from menu-- **WHEN** user right-clicks a frame and selects "Create component"-- **THEN** the frame becomes a component--### Requirement: Context menu visibility and lock actions-The context menu SHALL include "Hide/Show" (⇧⌘H) and "Lock/Unlock" (⇧⌘L) for selected nodes. Labels toggle based on current state.--#### Scenario: Hide via context menu-- **WHEN** user right-clicks a visible node and selects "Hide"-- **THEN** the node becomes invisible--### Requirement: Context menu move to page-The context menu SHALL include a "Move to page" submenu listing all pages except the current one. Selected nodes are reparented to the chosen page.--#### Scenario: Move node to another page-- **WHEN** user right-clicks a node, opens "Move to page", and selects "Page 2"-- **THEN** the node is moved to Page 2diff --git a/openspec/changes/archive/2026-02-28-sync-master-features/specs/editor-ui/spec.md b/openspec/changes/archive/2026-02-28-sync-master-features/specs/editor-ui/spec.mddeleted file mode 100644index b17e97380..000000000--- a/openspec/changes/archive/2026-02-28-sync-master-features/specs/editor-ui/spec.md+++ /dev/null@@ -1,22 +0,0 @@-## ADDED Requirements--### Requirement: Component keyboard shortcuts-The editor SHALL support keyboard shortcuts for component operations: ⌥⌘K (create component), ⌥⌘B (detach instance), ⇧⌘K (create component set).--#### Scenario: Create component shortcut-- **WHEN** user selects a frame and presses ⌥⌘K-- **THEN** the frame becomes a component--### Requirement: Z-order keyboard shortcuts-The editor SHALL support ] (bring to front) and [ (send to back) keyboard shortcuts.--#### Scenario: Bring to front shortcut-- **WHEN** user selects a node and presses ]-- **THEN** the node moves to the top of its z-order--### Requirement: Visibility and lock keyboard shortcuts-The editor SHALL support ⇧⌘H (toggle visibility) and ⇧⌘L (toggle lock) keyboard shortcuts.--#### Scenario: Toggle visibility shortcut-- **WHEN** user selects a node and presses ⇧⌘H-- **THEN** the node's visibility togglesdiff --git a/openspec/changes/archive/2026-02-28-sync-master-features/specs/figma-comparison-docs/spec.md b/openspec/changes/archive/2026-02-28-sync-master-features/specs/figma-comparison-docs/spec.mddeleted file mode 100644index 1534d95fb..000000000--- a/openspec/changes/archive/2026-02-28-sync-master-features/specs/figma-comparison-docs/spec.md+++ /dev/null@@ -1,12 +0,0 @@-## MODIFIED Requirements--### Requirement: Feature rows include notes-Each table row SHALL contain columns: Feature, Status, Notes. Statuses SHALL be updated when features are implemented. Specifically: Components (create/instance/detach) → 🟡 partial, Lock/unlock → ✅, Toggle visibility → ✅ (already was), Rename layers → 🟡, Z-order (bring to front/send to back) → ✅, Context menu → ✅ new row.--#### Scenario: Notes explain partial status-- **WHEN** a feature has 🟡 partial status-- **THEN** the Notes column explains what is supported and what is missing--#### Scenario: Component status updated-- **WHEN** user views the Components & Design Systems table-- **THEN** "Create components" shows 🟡 with note about what's implementeddiff --git a/openspec/changes/archive/2026-02-28-sync-master-features/specs/scene-graph/spec.md b/openspec/changes/archive/2026-02-28-sync-master-features/specs/scene-graph/spec.mddeleted file mode 100644index c9468928c..000000000--- a/openspec/changes/archive/2026-02-28-sync-master-features/specs/scene-graph/spec.md+++ /dev/null@@ -1,45 +0,0 @@-## MODIFIED Requirements--### Requirement: Scene node data model-The scene graph SHALL store nodes in a flat `Map<string, SceneNode>` with parent-child tree via parentIndex. Each SceneNode SHALL include `componentId` (nullable reference to main component for instances) and `overrides` (record of instance-level property overrides).--#### Scenario: Node has component fields-- **WHEN** a SceneNode is created-- **THEN** it has `componentId: null` and `overrides: {}` by default--## ADDED Requirements--### Requirement: Clone tree-The scene graph SHALL support deep-cloning a node subtree to a new parent via `cloneTree(sourceId, parentId)`, copying all properties and recursively cloning children.--#### Scenario: Clone subtree-- **WHEN** `cloneTree` is called on a frame with two children-- **THEN** a new frame with two new children is created under the target parent--### Requirement: Create instance from component-The scene graph SHALL support creating an INSTANCE node from a COMPONENT via `createInstance(componentId, parentId)`, copying visual properties and deep-cloning children.--#### Scenario: Instance copies component children-- **WHEN** `createInstance` is called for a component with three children-- **THEN** the instance has three cloned children matching the component's--### Requirement: Detach instance-The scene graph SHALL support converting an INSTANCE to FRAME via `detachInstance(instanceId)`, clearing `componentId` and `overrides`.--#### Scenario: Detach changes type-- **WHEN** `detachInstance` is called on an instance-- **THEN** its type becomes FRAME and componentId becomes null--### Requirement: Get main component-The scene graph SHALL support `getMainComponent(instanceId)` returning the source COMPONENT for an instance.--#### Scenario: Retrieve main component-- **WHEN** `getMainComponent` is called on an instance-- **THEN** the linked COMPONENT node is returned--### Requirement: Deep hit testing-The scene graph SHALL support `hitTestDeep(px, py)` that traverses into COMPONENT and INSTANCE containers, unlike standard `hitTest` which treats them as opaque.--#### Scenario: Deep hit test enters component-- **WHEN** `hitTestDeep` is called at a position inside a component's child-- **THEN** the child is returned, not the componentdiff --git a/openspec/changes/archive/2026-02-28-sync-master-features/specs/selection-manipulation/spec.md b/openspec/changes/archive/2026-02-28-sync-master-features/specs/selection-manipulation/spec.mddeleted file mode 100644index 431d43c3a..000000000--- a/openspec/changes/archive/2026-02-28-sync-master-features/specs/selection-manipulation/spec.md+++ /dev/null@@ -1,40 +0,0 @@-## ADDED Requirements--### Requirement: Z-order manipulation-The editor SHALL support bringing selected nodes to front (]) and sending to back ([). Bring to front moves node to end of parent's childIds; send to back moves to start.--#### Scenario: Bring to front-- **WHEN** user selects a node and presses ]-- **THEN** the node moves to the top of its sibling z-order--#### Scenario: Send to back-- **WHEN** user selects a node and presses [-- **THEN** the node moves to the bottom of its sibling z-order--### Requirement: Toggle visibility-The editor SHALL support toggling node visibility (⇧⌘H). Hidden nodes are not rendered but remain in the scene graph and layers panel.--#### Scenario: Hide node-- **WHEN** user selects a visible node and presses ⇧⌘H-- **THEN** the node's `visible` property becomes false--### Requirement: Toggle lock-The editor SHALL support toggling node lock state (⇧⌘L). Locked nodes cannot be selected or moved via canvas interaction.--#### Scenario: Lock node-- **WHEN** user selects a node and presses ⇧⌘L-- **THEN** the node's `locked` property becomes true--### Requirement: Move to page-The editor SHALL support moving selected nodes to a different page, reparenting them under the target page's CANVAS node.--#### Scenario: Move selection to another page-- **WHEN** user moves a node to Page 2 via context menu-- **THEN** the node is reparented under Page 2's CANVAS node and removed from the current page--### Requirement: Rename node-The editor SHALL support renaming nodes programmatically via `renameNode(id, name)`.--#### Scenario: Rename a layer-- **WHEN** `renameNode` is called with a new name-- **THEN** the node's name property is updateddiff --git a/openspec/changes/archive/2026-02-28-sync-master-features/specs/vitepress-docs/spec.md b/openspec/changes/archive/2026-02-28-sync-master-features/specs/vitepress-docs/spec.mddeleted file mode 100644index 977ecc9db..000000000--- a/openspec/changes/archive/2026-02-28-sync-master-features/specs/vitepress-docs/spec.md+++ /dev/null@@ -1,30 +0,0 @@-## MODIFIED Requirements--### Requirement: Guide section-The docs site SHALL include a guide section with pages: Getting Started, Features, Architecture, Tech Stack. The Features page SHALL document components (create, instance, detach, component sets), context menu, z-order, visibility/lock toggle, move-to-page, and rendering optimizations (viewport culling, RAF coalescing).--#### Scenario: Getting started page-- **WHEN** user navigates to the Getting Started guide-- **THEN** installation instructions (`bun install`, `bun run dev`) and desktop app setup are displayed--#### Scenario: Architecture page-- **WHEN** user navigates to the Architecture guide-- **THEN** the system architecture diagram and component descriptions from PLAN.md are displayed--#### Scenario: Features page documents components-- **WHEN** user reads the features page-- **THEN** component creation, instances, detach, component sets, and context menu are described--### Requirement: Docs reflect updated keyboard shortcuts-The keyboard shortcuts page SHALL mark newly implemented shortcuts: ⌥⌘K (Create Component), ⌥⌘B (Detach Instance), ] (Bring Forward), [ (Send Backward), ⇧⌘H (Toggle Visibility), ⇧⌘L (Toggle Lock).--#### Scenario: Component shortcuts marked-- **WHEN** user reads the keyboard shortcuts page-- **THEN** ⌥⌘K, ⌥⌘B, ], [ show ✅ status--### Requirement: Roadmap reflects current progress-The roadmap page SHALL reflect that Phase 4 (Components + Variables) has partially started, with component creation, instances, component sets, and detach delivered.--#### Scenario: Phase 4 partial progress-- **WHEN** user reads the roadmap page-- **THEN** Phase 4 shows as 🟡 In Progress with components/instances listed as delivereddiff --git a/openspec/changes/archive/2026-02-28-sync-master-features/tasks.md b/openspec/changes/archive/2026-02-28-sync-master-features/tasks.mddeleted file mode 100644index 747d073fe..000000000--- a/openspec/changes/archive/2026-02-28-sync-master-features/tasks.md+++ /dev/null@@ -1,22 +0,0 @@-## 1. Update Features Documentation--- [x] 1.1 Add "Components & Instances" section to `docs/guide/features.md` (create component ⌥⌘K, component sets ⇧⌘K, create instance, detach ⌥⌘B, go to main, purple labels, opaque container selection)-- [x] 1.2 Add "Context Menu" section to `docs/guide/features.md` (right-click actions: clipboard, z-order, group, component, visibility, lock, move-to-page)-- [x] 1.3 Add "Z-Order, Visibility & Lock" section to `docs/guide/features.md` (] bring to front, [ send to back, ⇧⌘H visibility toggle, ⇧⌘L lock toggle, move to page via context menu)-- [x] 1.4 Add rendering optimizations note to `docs/guide/features.md` (viewport culling, Paint reuse, RAF coalescing — brief, under existing Advanced Rendering section)--## 2. Update Keyboard Shortcuts--- [x] 2.1 Update `docs/reference/keyboard-shortcuts.md` — mark implemented: ⌥⌘K (Create Component ✅), ⌥⌘B (Detach Instance ✅), ⇧⌘K (Create Component Set — add new row ✅), ] (Bring to Front ✅), [ (Send to Back ✅); add new rows: ⇧⌘H (Toggle Visibility ✅), ⇧⌘L (Toggle Lock ✅)--## 3. Update Roadmap--- [x] 3.1 Update `docs/development/roadmap.md` — Phase 4 from 🔲 to 🟡 In Progress, list delivered: component creation/instantiation, component sets, detach, go-to-main, component labels, context menu--## 4. Update Figma Feature Matrix--- [x] 4.1 Update `docs/guide/figma-comparison.md` — Components & Design Systems table: create components 🟡 (basic creation works, no overrides propagation), component instances 🟡 (create/detach works, no override editing), detach instance 🟡; Layers & Shapes table: lock/unlock ✅, rename layers 🟡 (programmatic via store, no inline UI yet); add new rows: "Bring to front / Send to back" ✅ in Layers & Shapes, "Context menu" ✅ in Interface & Navigation; update coverage count in header--## 5. Verify--- [x] 5.1 Run `bun run docs:build` to confirm all pages build without errorsdiff --git a/openspec/changes/archive/2026-02-28-sync-polygon-star-panels/.openspec.yaml b/openspec/changes/archive/2026-02-28-sync-polygon-star-panels/.openspec.yamldeleted file mode 100644index b51d4740b..000000000--- a/openspec/changes/archive/2026-02-28-sync-polygon-star-panels/.openspec.yaml+++ /dev/null@@ -1 +0,0 @@-type: changediff --git a/openspec/changes/archive/2026-02-28-sync-polygon-star-panels/design.md b/openspec/changes/archive/2026-02-28-sync-polygon-star-panels/design.mddeleted file mode 100644index 8ec862919..000000000--- a/openspec/changes/archive/2026-02-28-sync-polygon-star-panels/design.md+++ /dev/null@@ -1,25 +0,0 @@-# Design: Sync Polygon/Star Tools, Resizable Panels, Code Quality--## Approach--Documentation-only change. Update specs and docs to match already-implemented features.--## Delta-Specs--### editor-ui-- Add Polygon and Star to toolbar tool list-- Add flyout shortcut labels-- Add resizable panels requirement (Splitter)-- Add throttled surface recreation during resize--### scene-graph-- Add `pointCount` and `starInnerRadius` fields to SceneNode-- Add POLYGON/STAR to Tool type--### canvas-rendering-- Add polygon/star rendering requirement (regular polygon path, star inner radius)--### tooling-- Add @/ import alias requirement-- Add shared types module requirement-- Note lint/typecheck clean state (0 warnings, 0 errors)diff --git a/openspec/changes/archive/2026-02-28-sync-polygon-star-panels/proposal.md b/openspec/changes/archive/2026-02-28-sync-polygon-star-panels/proposal.mddeleted file mode 100644index 6986b44ff..000000000--- a/openspec/changes/archive/2026-02-28-sync-polygon-star-panels/proposal.md+++ /dev/null@@ -1,19 +0,0 @@-# Proposal: Sync Polygon/Star Tools, Resizable Panels, Code Quality--## Why--12 commits merged from master (af3db9f..70c88dd) introduce new drawing tools, UI improvements, and codebase-wide quality improvements not yet reflected in specs, docs, or Figma comparison matrix.--## What Changes--### New features-1. **Polygon and Star tools** — POLYGON (triangle icon) and STAR (star icon) added to shapes flyout. Renderer draws regular polygons and stars using `pointCount` and `starInnerRadius` SceneNode properties. Polygon defaults to 3 sides, Star to 5 points with 0.38 inner ratio. Flyout shows keyboard shortcuts aligned right.-2. **Resizable panels** — left (layers) and right (properties) panels resizable via reka-ui Splitter. Default 15% width, min 10%, max 30%. Layout persists via auto-save-id. WebGL surface recreation throttled during resize.--### Code quality (no user-facing feature change)-3. **@/ import alias** — all `../` imports rewritten to `@/` paths via vite resolve alias-4. **Type consolidation** — shared types (Vector, Matrix, Rect) moved to `src/types.ts`, Window API declarations to `src/global.d.ts`-5. **Lint/typecheck clean** — 0 warnings, 0 type errors (was 66 + 30+)-6. **oxfmt formatting** — consistent code formatting across codebase-7. **Firefox number spinner fix** — global CSS for hiding spinners-8. **ScrubInput cursor fix** — pointer events moved to containerdiff --git a/openspec/changes/archive/2026-02-28-sync-polygon-star-panels/specs/canvas-rendering/spec.md b/openspec/changes/archive/2026-02-28-sync-polygon-star-panels/specs/canvas-rendering/spec.mddeleted file mode 100644index 3ad83d15c..000000000--- a/openspec/changes/archive/2026-02-28-sync-polygon-star-panels/specs/canvas-rendering/spec.md+++ /dev/null@@ -1,14 +0,0 @@-# canvas-rendering Specification (delta)--## New Requirements--### Requirement: Polygon and Star rendering-The renderer SHALL draw POLYGON and STAR nodes as regular polygon paths. For POLYGON, a path with `pointCount` vertices is generated equidistant around the node's center. For STAR, `pointCount * 2` vertices alternate between outer radius and inner radius (scaled by `starInnerRadius`). Both types support fill, stroke, hover highlight, and selection outline. The starting vertex is at the top (−π/2 rotation offset).--#### Scenario: Render polygon-- **WHEN** a POLYGON node with pointCount=3 exists on canvas-- **THEN** an equilateral triangle is rendered within the node's bounding box--#### Scenario: Render star-- **WHEN** a STAR node with pointCount=5 and starInnerRadius=0.38 exists-- **THEN** a 5-pointed star is rendered with inner points at 38% of the outer radiusdiff --git a/openspec/changes/archive/2026-02-28-sync-polygon-star-panels/specs/editor-ui/spec.md b/openspec/changes/archive/2026-02-28-sync-polygon-star-panels/specs/editor-ui/spec.mddeleted file mode 100644index b7083c1a8..000000000--- a/openspec/changes/archive/2026-02-28-sync-polygon-star-panels/specs/editor-ui/spec.md+++ /dev/null@@ -1,38 +0,0 @@-# editor-ui Specification (delta)--## Modified Requirements--### Requirement: Bottom toolbar (updated)-The toolbar SHALL include Polygon and Star in the shapes flyout alongside Rectangle, Line, and Ellipse. The flyout dropdown SHALL show keyboard shortcuts right-aligned for each tool (R, L, O). POLYGON and STAR are flyout-only — no dedicated keyboard shortcuts.--#### Scenario: Polygon tool in flyout-- **WHEN** user opens the shapes flyout-- **THEN** Polygon (triangle icon) and Star (star icon) are listed with other shape tools--#### Scenario: Draw polygon on canvas-- **WHEN** user selects Polygon tool and drags on canvas-- **THEN** a POLYGON node is created with default 3 sides--#### Scenario: Draw star on canvas-- **WHEN** user selects Star tool and drags on canvas-- **THEN** a STAR node is created with 5 points and 0.38 inner radius--## New Requirements--### Requirement: Resizable panels-The left (layers) and right (properties) panels SHALL be resizable via reka-ui Splitter components (SplitterGroup, SplitterPanel, SplitterResizeHandle). Default width: 15%, min: 10%, max: 30%. Layout SHALL persist across reloads via auto-save-id. Resize handle highlights blue on hover. The 8px-wide handle uses negative margins with a centered 1px visible line.--#### Scenario: Resize layers panel-- **WHEN** user drags the resize handle between layers panel and canvas-- **THEN** the layers panel width changes and the canvas resizes accordingly--#### Scenario: Panel size persists-- **WHEN** user resizes panels and reloads the page-- **THEN** panel widths are restored to the previous sizes--### Requirement: Throttled WebGL surface recreation-The CanvasKit surface SHALL be recreated at most once per animation frame during panel resize, coalesced via requestAnimationFrame in the ResizeObserver callback.--#### Scenario: Panel resize performance-- **WHEN** user drags a panel resize handle continuously-- **THEN** the WebGL surface is recreated at most once per frame, not on every ResizeObserver tickdiff --git a/openspec/changes/archive/2026-02-28-sync-polygon-star-panels/specs/scene-graph/spec.md b/openspec/changes/archive/2026-02-28-sync-polygon-star-panels/specs/scene-graph/spec.mddeleted file mode 100644index 0f06095f9..000000000--- a/openspec/changes/archive/2026-02-28-sync-polygon-star-panels/specs/scene-graph/spec.md+++ /dev/null@@ -1,17 +0,0 @@-# scene-graph Specification (delta)--## New Requirements--### Requirement: Polygon and Star node properties-SceneNode SHALL include `pointCount: number` (default 5) and `starInnerRadius: number` (default 0.38). POLYGON nodes use `pointCount` as the number of sides (minimum 3). STAR nodes use `pointCount` as the number of outer points and `starInnerRadius` as the ratio of inner to outer radius.--#### Scenario: Create polygon node-- **WHEN** a POLYGON node is created with pointCount=6-- **THEN** the node stores pointCount=6 and renders as a regular hexagon--#### Scenario: Create star node-- **WHEN** a STAR node is created with pointCount=5 and starInnerRadius=0.38-- **THEN** the node stores both properties and renders as a 5-pointed star--### Requirement: Tool type includes Polygon and Star-The Tool type union SHALL include POLYGON and STAR. The TOOLS array SHALL include POLYGON and STAR in the Rectangle flyout. TOOL_SHORTCUTS SHALL NOT include entries for Polygon or Star (flyout-only tools).diff --git a/openspec/changes/archive/2026-02-28-sync-polygon-star-panels/specs/tooling/spec.md b/openspec/changes/archive/2026-02-28-sync-polygon-star-panels/specs/tooling/spec.mddeleted file mode 100644index 808ced3d5..000000000--- a/openspec/changes/archive/2026-02-28-sync-polygon-star-panels/specs/tooling/spec.md+++ /dev/null@@ -1,24 +0,0 @@-# tooling Specification (delta)--## New Requirements--### Requirement: @/ import alias-The project SHALL configure a `@/` → `src/` path alias in both `vite.config.ts` (resolve.alias) and `tsconfig.json` (paths). All cross-directory imports SHALL use `@/` instead of relative `../` paths. Same-directory `./` imports are kept as-is.--#### Scenario: Import with alias-- **WHEN** a component in `src/components/` imports from `src/engine/`-- **THEN** the import uses `@/engine/` instead of `../../engine/`--### Requirement: Shared types module-Shared primitive types (Vector, Matrix, Rect) SHALL be defined in `src/types.ts` and imported across the codebase. Window API declarations (File System Access, queryLocalFonts) SHALL be in `src/global.d.ts`. Inline duplicates SHALL be eliminated.--#### Scenario: Shared Vector type-- **WHEN** multiple files need a 2D point type-- **THEN** they import `Vector` from `@/types` instead of defining their own--### Requirement: Zero lint and type errors-The codebase SHALL maintain 0 oxlint warnings and 0 tsgo type errors. `bun run check` SHALL pass cleanly.--#### Scenario: Clean check-- **WHEN** `bun run check` is executed-- **THEN** both lint and typecheck pass with zero issuesdiff --git a/openspec/changes/archive/2026-02-28-sync-polygon-star-panels/tasks.md b/openspec/changes/archive/2026-02-28-sync-polygon-star-panels/tasks.mddeleted file mode 100644index b03dccef0..000000000--- a/openspec/changes/archive/2026-02-28-sync-polygon-star-panels/tasks.md+++ /dev/null@@ -1,21 +0,0 @@-# Tasks: Sync Polygon/Star Tools, Resizable Panels, Code Quality--Reference: 12 commits from master (af3db9f..70c88dd).--## 1. Merge Delta-Specs into Main Specs--- [x] 1.1 Update `openspec/specs/editor-ui/spec.md` — add Polygon/Star to toolbar tool list in "Bottom toolbar" requirement, add flyout shortcut labels. Add "Resizable panels" requirement (Splitter, 15% default, 10–30% range, persist). Add "Throttled WebGL surface recreation" requirement.-- [x] 1.2 Update `openspec/specs/scene-graph/spec.md` — add `pointCount` and `starInnerRadius` fields. Add POLYGON/STAR to Tool type. Note flyout-only (no keyboard shortcut).-- [x] 1.3 Update `openspec/specs/canvas-rendering/spec.md` — add polygon/star rendering requirement (regular polygon path from pointCount, star inner radius, fill/stroke/hover/selection support).-- [x] 1.4 Update `openspec/specs/tooling/spec.md` — add @/ import alias requirement, shared types module (src/types.ts, src/global.d.ts), zero lint/type error maintenance requirement.--## 2. Update VitePress Docs--- [x] 2.1 Update `docs/guide/features.md` — add "Shape Tools" section covering all drawing tools including Polygon and Star. Update "Properties Panel" to mention resizable panels. Mention @/ import alias in Desktop App or add brief code quality note.-- [x] 2.2 Update `docs/guide/figma-comparison.md` — update "Shape tools" row notes to mention Polygon/Star with pointCount and starInnerRadius. Add resizable panels note under "Layers panel" or "Properties panel" rows. Update coverage count and date.-- [x] 2.3 Update `docs/reference/keyboard-shortcuts.md` — add Polygon and Star tools (no shortcut, flyout only) to Tools table.-- [x] 2.4 Update `docs/development/roadmap.md` — add Polygon/Star tools, resizable panels, @/ alias, type consolidation, lint-clean codebase to Phase 4 Delivered.--## 3. Verify--- [x] 3.1 Run `bun run docs:build` to verify VitePress build passes.diff --git a/openspec/changes/archive/2026-02-28-update-specs-and-docs-feb28/.openspec.yaml b/openspec/changes/archive/2026-02-28-update-specs-and-docs-feb28/.openspec.yamldeleted file mode 100644index 34b5b2315..000000000--- a/openspec/changes/archive/2026-02-28-update-specs-and-docs-feb28/.openspec.yaml+++ /dev/null@@ -1,2 +0,0 @@-schema: spec-driven-created: 2026-02-28diff --git a/openspec/changes/archive/2026-02-28-update-specs-and-docs-feb28/design.md b/openspec/changes/archive/2026-02-28-update-specs-and-docs-feb28/design.mddeleted file mode 100644index e03cd5865..000000000--- a/openspec/changes/archive/2026-02-28-update-specs-and-docs-feb28/design.md+++ /dev/null@@ -1,45 +0,0 @@-## Context--39 commits landed since the baseline specs and VitePress docs were created. The specs in `openspec/specs/` and docs in `docs/` are now behind the actual implementation. This is a documentation-only catchup change.--## Goals / Non-Goals--**Goals:**-- Add requirements/scenarios to 9 existing specs covering all new functionality-- Update all affected VitePress doc pages with accurate feature descriptions-- Keep specs and docs as the source of truth for the current state--**Non-Goals:**-- No source code changes-- No new specs — all new features map to existing capability domains-- No new doc pages — updates to existing ones--## Decisions--### Delta-spec approach for all 9 modified capabilities-Each modified spec gets a delta-spec in `specs/<name>/spec.md` that adds new requirements. On archive, these merge into the baseline specs.--### Docs updates derived from spec changes-Each spec update implies a corresponding docs update. The mapping:-- `scene-graph` → node-types.md, scene-graph.md-- `canvas-rendering` → features.md, architecture.md-- `editor-ui` → features.md, keyboard-shortcuts.md-- `fig-import` → file-format.md, features.md, keyboard-shortcuts.md-- `desktop-app` → features.md-- `testing` → testing.md-- `vitepress-docs` → roadmap.md--### Feature categorization-Group new features by commit clusters:-1. Sections (cadbd13..55c3ea3): SECTION node type, title pills, auto-adopt-2. Pages (1d79473..fd2e38e): multi-page, PagesPanel, viewport per page-3. Hover highlight (b10d427, adc95c7): shape-aware outlines-4. .fig export (086fb7d..edf6da6): Save/SaveAs, Kiwi encode, Zstd Rust, thumbnail-5. Rendering tier 1 (e2e0e75): gradients, images, effects, strokes, arcs-6. Fill picker (cf454a8): solid/gradient/image tabs, gradient stops-7. Tests (07f0f55, 27f83c7, layers-panel E2E): fig-import, layout, E2E--## Risks / Trade-offs--- [Spec count accuracy] Some features (like new NodeType variants) only need a mention in existing requirements rather than separate requirements → Keep granularity consistent with baseline-- [Docs staleness] Future commits will continue to drift → This is expected; periodic catchup changes are the workflowdiff --git a/openspec/changes/archive/2026-02-28-update-specs-and-docs-feb28/proposal.md b/openspec/changes/archive/2026-02-28-update-specs-and-docs-feb28/proposal.mddeleted file mode 100644index b951e5873..000000000--- a/openspec/changes/archive/2026-02-28-update-specs-and-docs-feb28/proposal.md+++ /dev/null@@ -1,33 +0,0 @@-## Why--39 new commits landed on master after the initial baseline specs and VitePress docs were created. These commits introduce sections, multi-page documents, hover highlight, .fig export, tier 1 rendering (gradients/images/effects), fill type picker, new node types, and extensive new tests. The OpenSpec specs and VitePress docs are now stale and need to reflect the current state.--## What Changes--- Update existing OpenSpec specs with new capabilities: sections, pages, hover highlight, .fig export, advanced rendering, fill picker, native dialogs, new node types, new tests-- Update VitePress docs to reflect new features: features page, keyboard shortcuts (section tool ✅), file-format (export support), architecture, roadmap, node-types, scene-graph-- No source code changes — specs and docs only--## Capabilities--### New Capabilities--(none — all functionality maps to existing spec domains)--### Modified Capabilities--- `scene-graph`: new node types (CANVAS, ROUNDED_RECTANGLE, COMPONENT, COMPONENT_SET, INSTANCE, CONNECTOR, SHAPE_WITH_TEXT), pages support, sections, hover state-- `canvas-rendering`: tier 1 rendering (gradients, images, effects, stroke cap/join/dash, arcs), hover highlight outline-- `editor-ui`: pages panel, fill type picker (solid/gradient/image tabs, gradient stops), section tool, hover highlight, canvas background color-- `fig-import`: .fig export (Save/Save As), Zstd compression via Tauri Rust, thumbnail generation, browser deflate fallback-- `desktop-app`: Tauri native Save/Open dialogs (plugin-dialog + plugin-fs)-- `selection-manipulation`: section creation with auto-adopt siblings-- `testing`: fig-import unit tests, layout unit tests, layers-panel E2E tests-- `kiwi-codec`: .fig export encoding path-- `vitepress-docs`: update all docs pages to reflect new features--## Impact--- `openspec/specs/` — 9 spec files updated with new requirements/scenarios-- `docs/` — 8+ docs pages updated with new content-- No source code, dependencies, or API changesdiff --git a/openspec/changes/archive/2026-02-28-update-specs-and-docs-feb28/specs/canvas-rendering/spec.md b/openspec/changes/archive/2026-02-28-update-specs-and-docs-feb28/specs/canvas-rendering/spec.mddeleted file mode 100644index 202bdb025..000000000--- a/openspec/changes/archive/2026-02-28-update-specs-and-docs-feb28/specs/canvas-rendering/spec.md+++ /dev/null@@ -1,61 +0,0 @@-## ADDED Requirements--### Requirement: Gradient rendering-The renderer SHALL draw gradient fills: GRADIENT_LINEAR, GRADIENT_RADIAL, GRADIENT_ANGULAR, and GRADIENT_DIAMOND using CanvasKit shaders with gradient stops and transform matrices.--#### Scenario: Linear gradient on rectangle-- **WHEN** a rectangle has a GRADIENT_LINEAR fill with stops at 0% (#FF0000) and 100% (#0000FF)-- **THEN** the rectangle renders with a smooth red-to-blue linear gradient--### Requirement: Image fill rendering-The renderer SHALL draw IMAGE fills using CanvasKit image decoding. Image transforms (scale, position) and scale modes (FILL, FIT, CROP, TILE) SHALL be applied.--#### Scenario: Image fill on frame-- **WHEN** a frame has an IMAGE fill with imageHash referencing a blob-- **THEN** the image is decoded and rendered within the frame bounds--### Requirement: Effect rendering-The renderer SHALL draw effects: DROP_SHADOW, INNER_SHADOW, LAYER_BLUR, BACKGROUND_BLUR, and FOREGROUND_BLUR using CanvasKit filters.--#### Scenario: Drop shadow on rectangle-- **WHEN** a rectangle has a DROP_SHADOW effect with offset (4, 4), radius 8, color rgba(0,0,0,0.25)-- **THEN** a shadow is rendered below the rectangle with the specified offset, blur, and color--### Requirement: Stroke cap, join, and dash rendering-The renderer SHALL apply stroke cap (NONE, ROUND, SQUARE, ARROW_LINES, ARROW_EQUILATERAL), join (MITER, BEVEL, ROUND), and dash pattern to strokes.--#### Scenario: Round cap dashed stroke-- **WHEN** a line has strokeCap ROUND and dashPattern [10, 5]-- **THEN** the line renders with rounded dash ends and 10px-on/5px-off pattern--### Requirement: Arc rendering-The renderer SHALL draw ellipses with arcData (startAngle, endAngle, innerRadius) as partial arcs or donuts.--#### Scenario: Semi-circle arc-- **WHEN** an ellipse has arcData with startAngle 0 and endAngle π-- **THEN** only the top half of the ellipse is rendered--### Requirement: Hover highlight rendering-The renderer SHALL draw a shape-aware hover outline for the node under the cursor. The outline follows the actual shape geometry (ellipses, rounded rects, vectors), not just the bounding box.--#### Scenario: Hover over ellipse-- **WHEN** the cursor hovers over an ellipse-- **THEN** a thin outline matching the ellipse shape is drawn--### Requirement: Section rendering-The renderer SHALL draw SECTION nodes with a title pill showing the section name. Title text color inverts based on pill background luminance. Frame name labels are shown for direct children of sections.--#### Scenario: Section with title-- **WHEN** a section named "Desktop" exists on the canvas-- **THEN** a title pill reading "Desktop" is rendered above the section bounds--#### Scenario: Section title luminance inversion-- **WHEN** a section has a dark fill color-- **THEN** the title text renders in white for readability--### Requirement: Canvas background color-The renderer SHALL fill the canvas background with the current page's `pageColor` property.--#### Scenario: Custom canvas background-- **WHEN** the user sets the page background color to dark gray-- **THEN** the canvas renders with a dark gray background instead of the defaultdiff --git a/openspec/changes/archive/2026-02-28-update-specs-and-docs-feb28/specs/desktop-app/spec.md b/openspec/changes/archive/2026-02-28-update-specs-and-docs-feb28/specs/desktop-app/spec.mddeleted file mode 100644index 759bc4b46..000000000--- a/openspec/changes/archive/2026-02-28-update-specs-and-docs-feb28/specs/desktop-app/spec.md+++ /dev/null@@ -1,19 +0,0 @@-## ADDED Requirements--### Requirement: Tauri native Save/Open dialogs-The desktop app SHALL use Tauri plugin-dialog and plugin-fs for native file dialogs and filesystem access. Open dialog filters for .fig files. Save dialog defaults to "Untitled.fig".--#### Scenario: Open file via native dialog-- **WHEN** user presses ⌘O in the desktop app-- **THEN** the native OS file picker opens and the selected .fig file is imported--#### Scenario: Save As via native dialog-- **WHEN** user selects File → Save As-- **THEN** a native OS save dialog opens and the file is written to the chosen path--### Requirement: Zstd compression via Rust command-The Tauri backend SHALL expose a Rust command for Zstd compression/decompression, used by .fig export for better performance than JavaScript alternatives.--#### Scenario: Zstd compress via IPC-- **WHEN** the frontend requests Zstd compression of a buffer-- **THEN** the Rust backend compresses it and returns the result via Tauri IPCdiff --git a/openspec/changes/archive/2026-02-28-update-specs-and-docs-feb28/specs/editor-ui/spec.md b/openspec/changes/archive/2026-02-28-update-specs-and-docs-feb28/specs/editor-ui/spec.mddeleted file mode 100644index ed2d4ffab..000000000--- a/openspec/changes/archive/2026-02-28-update-specs-and-docs-feb28/specs/editor-ui/spec.md+++ /dev/null@@ -1,61 +0,0 @@-## ADDED Requirements--### Requirement: Pages panel-The editor SHALL display a PagesPanel component showing all pages in the document. Users can switch pages, add pages, delete pages, and rename pages inline (blur commits, Enter/Escape just blur).--#### Scenario: Switch page-- **WHEN** user clicks a page tab in the pages panel-- **THEN** the canvas switches to that page and viewport state is restored--#### Scenario: Add page-- **WHEN** user clicks the add page button-- **THEN** a new page is created and becomes active--#### Scenario: Inline page rename-- **WHEN** user double-clicks a page name-- **THEN** an inline text input appears, blur commits the rename--### Requirement: Section tool-The toolbar SHALL include a Section tool (shortcut <kbd>S</kbd>) in the Frame flyout. Drawing on canvas creates a SECTION node.--#### Scenario: Section tool activation-- **WHEN** user presses S-- **THEN** the section tool activates and the toolbar shows Section as selected--### Requirement: Fill type picker with gradient and image support-The fill section in the properties panel SHALL provide a type picker with tabs: Solid, Gradient (Linear, Radial, Angular, Diamond), and Image. Gradient fills show editable gradient stops. Image fills show image selection.--#### Scenario: Switch fill to linear gradient-- **WHEN** user selects "Linear Gradient" from the fill type picker-- **THEN** the selected node's fill changes to GRADIENT_LINEAR with default stops and the gradient stop editor appears--#### Scenario: Edit gradient stop-- **WHEN** user drags a gradient stop to position 50%-- **THEN** the stop position updates and the node re-renders with the adjusted gradient--### Requirement: Page background color-The properties panel SHALL show a page section with canvas background color picker when no nodes are selected.--#### Scenario: Change canvas background-- **WHEN** user selects no nodes and changes the page color-- **THEN** the canvas background updates to the chosen color--### Requirement: Hover highlight in canvas-The editor SHALL highlight nodes on hover with a shape-aware outline (follows actual geometry, not just bounding box).--#### Scenario: Hover feedback-- **WHEN** user moves cursor over a node without clicking-- **THEN** a highlight outline appears around the node shape--## MODIFIED Requirements--### Requirement: Bottom toolbar-The toolbar SHALL be positioned at the bottom of the screen (Figma UI3 style) with tool selection: Select (V), Frame (F), Section (S, in Frame flyout), Rectangle (R), Ellipse (O), Line (L), Text (T), Hand (H), Pen (P).--#### Scenario: Tool selection via keyboard-- **WHEN** user presses R-- **THEN** the rectangle tool is activated and the toolbar shows R as selected--#### Scenario: Frame flyout includes Section-- **WHEN** user opens the Frame tool flyout-- **THEN** both Frame and Section tools are availablediff --git a/openspec/changes/archive/2026-02-28-update-specs-and-docs-feb28/specs/fig-import/spec.md b/openspec/changes/archive/2026-02-28-update-specs-and-docs-feb28/specs/fig-import/spec.mddeleted file mode 100644index 48300c46b..000000000--- a/openspec/changes/archive/2026-02-28-update-specs-and-docs-feb28/specs/fig-import/spec.md+++ /dev/null@@ -1,55 +0,0 @@-## ADDED Requirements--### Requirement: .fig file export-The editor SHALL export documents as .fig files. The pipeline: scene graph → Kiwi encode NodeChange[] → compress → write ZIP with Kiwi header, schema, message, and thumbnail.--#### Scenario: Save As .fig-- **WHEN** user selects File → Save As-- **THEN** a save dialog appears and the document is written as a valid .fig file--#### Scenario: Save existing file-- **WHEN** user selects File → Save (⌘S) with a previously opened file-- **THEN** the file is overwritten in place without a dialog--### Requirement: Thumbnail generation for .fig export-Exported .fig files SHALL include a thumbnail.png in the ZIP archive, as required by Figma for file preview.--#### Scenario: Thumbnail in exported file-- **WHEN** a .fig file is exported-- **THEN** the ZIP archive contains a thumbnail.png--### Requirement: Zstd compression via Tauri Rust-On the desktop app, .fig export SHALL use Zstd compression via a Tauri Rust command for performance. In the browser, deflate fallback via fflate SHALL be used.--#### Scenario: Desktop export uses Zstd-- **WHEN** a .fig file is exported in the Tauri desktop app-- **THEN** the payload is compressed with Zstd via the Rust backend--#### Scenario: Browser export uses deflate-- **WHEN** a .fig file is exported in the browser-- **THEN** the payload is compressed with deflate as a fallback--### Requirement: Tauri native file dialogs-File Open and Save dialogs SHALL use Tauri's plugin-dialog for native OS dialogs on the desktop app. Save filters for .fig files.--#### Scenario: Native open dialog-- **WHEN** user presses ⌘O in the desktop app-- **THEN** the native OS file picker opens filtered for .fig files--#### Scenario: Native save dialog-- **WHEN** user selects Save As in the desktop app-- **THEN** the native OS save dialog opens with default filename "Untitled.fig"--### Requirement: Tier 1 rendering parity for import-The .fig import pipeline SHALL correctly import and render gradient fills, image fills, effects (shadows, blurs), stroke properties (cap, join, dash), and arc data.--#### Scenario: Import file with gradients-- **WHEN** a .fig file containing nodes with gradient fills is imported-- **THEN** all gradient types (linear, radial, angular, diamond) render correctly with their stops and transforms--### Requirement: .fig import/export round-trip-A .fig file imported and then exported SHALL produce a file that Figma can open with the same visual result.--#### Scenario: Round-trip fidelity-- **WHEN** a .fig file is imported into OpenPencil and re-exported-- **THEN** the exported file opens in Figma with matching visual outputdiff --git a/openspec/changes/archive/2026-02-28-update-specs-and-docs-feb28/specs/kiwi-codec/spec.md b/openspec/changes/archive/2026-02-28-update-specs-and-docs-feb28/specs/kiwi-codec/spec.mddeleted file mode 100644index 92cc3c5f4..000000000--- a/openspec/changes/archive/2026-02-28-update-specs-and-docs-feb28/specs/kiwi-codec/spec.md+++ /dev/null@@ -1,15 +0,0 @@-## ADDED Requirements--### Requirement: Kiwi encoding for .fig export-The Kiwi codec SHALL support encoding NodeChange[] back to Kiwi binary format for .fig export. The encoding path mirrors the decoding path: scene graph → NodeChange[] → Kiwi encode → compress → ZIP with header.--#### Scenario: Encode scene graph to Kiwi binary-- **WHEN** the editor exports a document-- **THEN** all nodes are encoded as NodeChange messages using the Kiwi schema and the binary output is a valid Kiwi payload--### Requirement: .fig ZIP built in Rust-On the desktop app, the .fig ZIP archive SHALL be assembled in Rust instead of JavaScript (fflate) for better performance and correct Zstd framing (content size in header).--#### Scenario: Rust ZIP assembly-- **WHEN** a .fig file is exported on the desktop app-- **THEN** the ZIP is assembled by the Rust backend with correct Zstd frame headersdiff --git a/openspec/changes/archive/2026-02-28-update-specs-and-docs-feb28/specs/scene-graph/spec.md b/openspec/changes/archive/2026-02-28-update-specs-and-docs-feb28/specs/scene-graph/spec.mddeleted file mode 100644index 83f54c9de..000000000--- a/openspec/changes/archive/2026-02-28-update-specs-and-docs-feb28/specs/scene-graph/spec.md+++ /dev/null@@ -1,66 +0,0 @@-## ADDED Requirements--### Requirement: Multi-page document support-The scene graph SHALL support multiple CANVAS (page) nodes as children of the DOCUMENT root. Each page has its own child tree. Pages can be added, deleted, and renamed.--#### Scenario: Add a new page-- **WHEN** user adds a page-- **THEN** a new CANVAS node is created as a child of the DOCUMENT root and becomes the active page--#### Scenario: Delete a page-- **WHEN** user deletes a page and at least two pages exist-- **THEN** the page is removed and the adjacent page becomes active--#### Scenario: Rename a page-- **WHEN** user renames a page-- **THEN** the CANVAS node's name property updates--### Requirement: Section node type-The scene graph SHALL support SECTION nodes. Sections are top-level only (direct children of CANVAS), cannot nest inside frames or groups. Sections auto-adopt overlapping siblings on creation.--#### Scenario: Create section-- **WHEN** user draws a section on the canvas-- **THEN** a SECTION node is created as a direct child of the current page--#### Scenario: Section auto-adopt-- **WHEN** a section is created overlapping existing nodes-- **THEN** overlapping sibling nodes are reparented into the section--#### Scenario: Section nesting restriction-- **WHEN** user attempts to move a section inside a frame or group-- **THEN** the section remains at top-level (direct child of CANVAS)--### Requirement: Extended node type union-The NodeType union SHALL include: CANVAS, FRAME, RECTANGLE, ROUNDED_RECTANGLE, ELLIPSE, TEXT, LINE, STAR, POLYGON, VECTOR, GROUP, SECTION, COMPONENT, COMPONENT_SET, INSTANCE, CONNECTOR, SHAPE_WITH_TEXT.--#### Scenario: NodeType covers all Figma types used in import-- **WHEN** a .fig file containing ROUNDED_RECTANGLE, COMPONENT, INSTANCE, CONNECTOR, or SHAPE_WITH_TEXT nodes is imported-- **THEN** each node is created with its correct type in the scene graph--### Requirement: Hover state tracking-The scene graph state SHALL track a `hoveredNodeId` for the node currently under the cursor.--#### Scenario: Hover a node-- **WHEN** user moves the cursor over a node-- **THEN** `hoveredNodeId` updates to that node's ID and a render is requested--### Requirement: Extended fill types-The Fill interface SHALL support types: SOLID, GRADIENT_LINEAR, GRADIENT_RADIAL, GRADIENT_ANGULAR, GRADIENT_DIAMOND, IMAGE. Gradient fills include `gradientStops` and `gradientTransform`. Image fills include `imageHash`, `imageScaleMode`, and `imageTransform`.--#### Scenario: Gradient fill on a node-- **WHEN** a node has a GRADIENT_LINEAR fill with two stops-- **THEN** the fill stores both gradient stops with position and color, plus a 2×3 gradient transform--### Requirement: Extended stroke properties-The Stroke interface SHALL support `cap` (NONE, ROUND, SQUARE, ARROW_LINES, ARROW_EQUILATERAL), `join` (MITER, BEVEL, ROUND), and `dashPattern` (array of dash/gap lengths).--#### Scenario: Dashed stroke-- **WHEN** a node has a stroke with dashPattern [10, 5]-- **THEN** the stroke renders as a dashed line with 10px dashes and 5px gaps--### Requirement: Per-page viewport state-Each page SHALL maintain independent viewport state (panX, panY, zoom, pageColor). Switching pages restores the viewport.--#### Scenario: Switch page restores viewport-- **WHEN** user switches from Page 1 (zoomed to 200%) to Page 2 and back-- **THEN** Page 1's viewport returns to 200% zoom at the previous pan positiondiff --git a/openspec/changes/archive/2026-02-28-update-specs-and-docs-feb28/specs/selection-manipulation/spec.md b/openspec/changes/archive/2026-02-28-update-specs-and-docs-feb28/specs/selection-manipulation/spec.mddeleted file mode 100644index 30c290275..000000000--- a/openspec/changes/archive/2026-02-28-update-specs-and-docs-feb28/specs/selection-manipulation/spec.md+++ /dev/null@@ -1,8 +0,0 @@-## ADDED Requirements--### Requirement: Section creation with auto-adopt-Creating a section on the canvas SHALL automatically reparent overlapping sibling nodes into the section. Only nodes fully or partially within the section bounds are adopted.--#### Scenario: Draw section over existing nodes-- **WHEN** user draws a section that overlaps two rectangles-- **THEN** the two rectangles become children of the new sectiondiff --git a/openspec/changes/archive/2026-02-28-update-specs-and-docs-feb28/specs/testing/spec.md b/openspec/changes/archive/2026-02-28-update-specs-and-docs-feb28/specs/testing/spec.mddeleted file mode 100644index 3ee8e2ffd..000000000--- a/openspec/changes/archive/2026-02-28-update-specs-and-docs-feb28/specs/testing/spec.md+++ /dev/null@@ -1,22 +0,0 @@-## ADDED Requirements--### Requirement: Fig-import unit tests-Unit tests SHALL verify the .fig import pipeline: node type mapping, transform extraction, fill/stroke/effect import, gradient stops, image fills, arc data, stroke properties, and nested frame hierarchies.--#### Scenario: Run fig-import tests-- **WHEN** `bun test ./tests/engine/fig-import.test.ts` is executed-- **THEN** all import pipeline tests pass covering tier 1 rendering features--### Requirement: Layout unit tests-Unit tests SHALL verify Yoga auto-layout computation: direction, gap, padding, justify, align, child sizing (fixed/fill/hug), cross-axis sizing, wrap, and nested layouts.--#### Scenario: Run layout tests-- **WHEN** `bun test ./tests/engine/layout.test.ts` is executed-- **THEN** all layout computation tests pass--### Requirement: Layers panel E2E tests-E2E tests SHALL verify the layers panel: node visibility in tree, expand/collapse frames, selection sync between canvas and layers panel.--#### Scenario: Run layers panel E2E-- **WHEN** the layers panel E2E tests run-- **THEN** all tests pass verifying tree structure, visibility toggles, and selection syncdiff --git a/openspec/changes/archive/2026-02-28-update-specs-and-docs-feb28/specs/vitepress-docs/spec.md b/openspec/changes/archive/2026-02-28-update-specs-and-docs-feb28/specs/vitepress-docs/spec.mddeleted file mode 100644index e9fe7379e..000000000--- a/openspec/changes/archive/2026-02-28-update-specs-and-docs-feb28/specs/vitepress-docs/spec.md+++ /dev/null@@ -1,50 +0,0 @@-## ADDED Requirements--### Requirement: Docs reflect sections feature-The features page SHALL document sections: SECTION node type, title pills, auto-adopt siblings, top-level-only constraint.--#### Scenario: Sections described in features-- **WHEN** user reads the features page-- **THEN** sections are documented with their behavior--### Requirement: Docs reflect multi-page support-The features page SHALL document multi-page documents: add/delete/rename pages, per-page viewport, pages panel.--#### Scenario: Pages described in features-- **WHEN** user reads the features page-- **THEN** multi-page support is documented--### Requirement: Docs reflect .fig export-The file-format page SHALL document .fig export: Save/Save As, Kiwi encoding, Zstd compression, thumbnail generation. The features page SHALL list .fig export as a capability.--#### Scenario: Export documented in file-format-- **WHEN** user reads the file-format reference-- **THEN** the export pipeline and supported formats table shows .fig export ✅--### Requirement: Docs reflect advanced rendering-The features page SHALL document tier 1 rendering: gradients, image fills, effects (shadows, blurs), stroke properties (cap, join, dash), arcs.--#### Scenario: Rendering features documented-- **WHEN** user reads the features page-- **THEN** gradient fills, image fills, effects, and stroke properties are described--### Requirement: Docs reflect updated keyboard shortcuts-The keyboard shortcuts page SHALL mark Section tool (S) as implemented (✅) and add Save (⌘S) and Save As (⇧⌘S) as implemented.--#### Scenario: New shortcuts marked-- **WHEN** user reads the keyboard shortcuts page-- **THEN** S (Section), ⌘S (Save), ⇧⌘S (Save As) show ✅ status--### Requirement: Docs reflect updated node types-The node-types reference SHALL list the current 17 types in the NodeType union used by the scene graph.--#### Scenario: Node types are current-- **WHEN** user reads the node types page-- **THEN** CANVAS, ROUNDED_RECTANGLE, COMPONENT, COMPONENT_SET, INSTANCE, CONNECTOR, SHAPE_WITH_TEXT are all listed--### Requirement: Roadmap reflects current progress-The roadmap page SHALL reflect that .fig export, sections, pages, hover highlight, and advanced rendering are now delivered.--#### Scenario: Roadmap is current-- **WHEN** user reads the roadmap page-- **THEN** Phase 3 lists .fig export and sections and pages as delivereddiff --git a/openspec/changes/archive/2026-02-28-update-specs-and-docs-feb28/tasks.md b/openspec/changes/archive/2026-02-28-update-specs-and-docs-feb28/tasks.mddeleted file mode 100644index 4575eb159..000000000--- a/openspec/changes/archive/2026-02-28-update-specs-and-docs-feb28/tasks.md+++ /dev/null@@ -1,29 +0,0 @@-## 1. Update VitePress docs — Features page--- [x] 1.1 Add Sections feature to features.md (SECTION node, title pills, auto-adopt, top-level-only)-- [x] 1.2 Add Multi-page support to features.md (pages panel, add/delete/rename, per-page viewport)-- [x] 1.3 Add .fig Export to features.md (Save/Save As, Kiwi encode, Zstd, thumbnail)-- [x] 1.4 Add Hover Highlight to features.md (shape-aware outlines)-- [x] 1.5 Update existing features with advanced rendering (gradients, image fills, effects, stroke cap/join/dash, arcs)--## 2. Update VitePress docs — Reference pages--- [x] 2.1 Update node-types.md: change NodeType union to 17 types, update type table to match actual scene graph-- [x] 2.2 Update file-format.md: add .fig export section, update formats table (.fig export ✅)-- [x] 2.3 Update keyboard-shortcuts.md: mark S (Section) ✅, add ⌘S (Save) ✅ and ⇧⌘S (Save As) ✅ to File section-- [x] 2.4 Update scene-graph.md: add pages, sections, hover state, extended fill/stroke types--## 3. Update VitePress docs — Other pages--- [x] 3.1 Update architecture.md: add .fig export to file format layer, remove .openpencil reference, add pages panel to navigation-- [x] 3.2 Update roadmap.md: move sections, pages, hover, .fig export, advanced rendering to delivered-- [x] 3.3 Update testing.md: add fig-import unit tests, layout unit tests, layers-panel E2E tests--## 4. Update landing page--- [x] 4.1 Update index.md hero features to reflect new capabilities (sections, pages, .fig export, advanced rendering)--## 5. Verify--- [x] 5.1 Run docs:build and verify no broken links or build errors-- [x] 5.2 Validate task completion — all docs pages reflect current implementation statediff --git a/openspec/changes/archive/2026-02-28-windows-build-support/.openspec.yaml b/openspec/changes/archive/2026-02-28-windows-build-support/.openspec.yamldeleted file mode 100644index 34b5b2315..000000000--- a/openspec/changes/archive/2026-02-28-windows-build-support/.openspec.yaml+++ /dev/null@@ -1,2 +0,0 @@-schema: spec-driven-created: 2026-02-28diff --git a/openspec/changes/archive/2026-02-28-windows-build-support/design.md b/openspec/changes/archive/2026-02-28-windows-build-support/design.mddeleted file mode 100644index 6536b5efb..000000000--- a/openspec/changes/archive/2026-02-28-windows-build-support/design.md+++ /dev/null@@ -1,35 +0,0 @@-## Context--The Tauri v2 desktop app's menu setup in `desktop/src/lib.rs` uses macOS-specific `PredefinedMenuItem` variants (About, Services, Hide, Hide Others, Show All) that are unavailable on Windows and Linux. The app_menu submenu containing these items is a macOS convention (the "application name" menu left of File). Windows and Linux apps don't have this submenu.--README only documents `bun install` + `bun run dev` for the web mode. Desktop build prerequisites vary by platform and are not documented.--## Goals / Non-Goals--**Goals:**-- Desktop app compiles and runs on Windows and Linux (in addition to macOS)-- README documents platform-specific prerequisites for all three platforms--**Non-Goals:**-- Platform-specific UI adaptations beyond the menu bar-- CI/CD pipeline for cross-platform builds-- Automated testing on Windows/Linux--## Decisions--### 1. `#[cfg(target_os = "macos")]` for app_menu--Wrap the entire app_menu (OpenPencil submenu) in a compile-time conditional. On non-macOS platforms, the menu starts directly with File.--**Alternative considered:** Runtime detection via `std::env::consts::OS` — rejected because menu construction happens at build time with Tauri's type system, and conditional compilation is the idiomatic Rust/Tauri pattern used by other projects (museeks, gitbutler).--### 2. `mut builder` pattern for conditional menu assembly--Use `let mut builder = MenuBuilder::new(app)` then conditionally `builder = builder.item(&app_menu)` inside a `#[cfg]` block, followed by `.items(&[...])` for the shared menus.--**Alternative considered:** Two separate `MenuBuilder` chains (one for macOS, one for others) — rejected to avoid duplicating the shared menu list.--## Risks / Trade-offs--- **[PredefinedMenuItem::fullscreen on Windows]** The `fullscreen` item in view_menu uses a macOS predefined — may be a no-op on Windows. Low risk, Tauri handles this gracefully. → Monitor and wrap in `#[cfg]` if needed later.-- **[README link rot]** Microsoft URLs for Visual Studio Build Tools may change. → Added descriptive text as fallback.diff --git a/openspec/changes/archive/2026-02-28-windows-build-support/proposal.md b/openspec/changes/archive/2026-02-28-windows-build-support/proposal.mddeleted file mode 100644index 36948277f..000000000--- a/openspec/changes/archive/2026-02-28-windows-build-support/proposal.md+++ /dev/null@@ -1,23 +0,0 @@-## Why--The desktop app menu code uses macOS-specific items (Services, Hide, Hide Others, Show All) that don't exist on Windows/Linux, and the README lacks platform setup instructions. This blocks Windows contributors from building and running the app.--## What Changes--- Conditional compilation of the macOS app menu (`#[cfg(target_os = "macos")]`) so the desktop app compiles and runs on Windows and Linux-- Platform-specific setup instructions in README (Windows, macOS, Linux prerequisites)--## Capabilities--### New Capabilities--_(none)_--### Modified Capabilities--- `desktop-app`: Menu bar requirements change from macOS-only to cross-platform. App menu (About, Services, Hide, etc.) is macOS-only; other menus (File, Edit, View, Object, Window, Help) work on all platforms.--## Impact--- `desktop/src/lib.rs` — conditional compilation of app_menu submenu-- `README.md` — new Platform Prerequisites section with Windows, macOS, Linux instructionsdiff --git a/openspec/changes/archive/2026-02-28-windows-build-support/specs/desktop-app/spec.md b/openspec/changes/archive/2026-02-28-windows-build-support/specs/desktop-app/spec.mddeleted file mode 100644index 27bd2e7e6..000000000--- a/openspec/changes/archive/2026-02-28-windows-build-support/specs/desktop-app/spec.md+++ /dev/null@@ -1,44 +0,0 @@-## MODIFIED Requirements--### Requirement: Native macOS menu bar-The desktop app SHALL display a native menu bar. On macOS, an app-level submenu (OpenPencil) with About, Services, Hide, Hide Others, Show All, and Quit items SHALL be shown. On Windows and Linux, this submenu SHALL be omitted. File, Edit, View, Object, Window, and Help menus SHALL be present on all platforms.--#### Scenario: Menu bar on macOS-- **WHEN** the desktop app launches on macOS-- **THEN** a native menu bar with the OpenPencil app submenu and all standard menus is visible--#### Scenario: Menu bar on Windows-- **WHEN** the desktop app launches on Windows-- **THEN** a native menu bar with File, Edit, View, Object, Window, and Help menus is visible and no macOS-specific app submenu is present--#### Scenario: Menu bar on Linux-- **WHEN** the desktop app launches on Linux-- **THEN** a native menu bar with File, Edit, View, Object, Window, and Help menus is visible and no macOS-specific app submenu is present--## ADDED Requirements--### Requirement: Cross-platform build-The desktop app SHALL compile and build on macOS, Windows, and Linux without platform-specific errors.--#### Scenario: Windows build-- **WHEN** `bun run tauri build` is run on Windows with MSVC toolchain installed-- **THEN** the build completes successfully and produces a Windows executable--#### Scenario: Linux build-- **WHEN** `bun run tauri build` is run on Linux with required system libraries installed-- **THEN** the build completes successfully and produces a Linux binary--### Requirement: Platform prerequisites documentation-The README SHALL document platform-specific prerequisites for building the desktop app on macOS, Windows, and Linux.--#### Scenario: Windows prerequisites documented-- **WHEN** a developer reads the README on Windows-- **THEN** they find instructions for installing Rust (stable-msvc), Visual Studio Build Tools, and WebView2--#### Scenario: macOS prerequisites documented-- **WHEN** a developer reads the README on macOS-- **THEN** they find instructions for installing Xcode Command Line Tools--#### Scenario: Linux prerequisites documented-- **WHEN** a developer reads the README on Linux-- **THEN** they find instructions for installing required system libraries (webkit2gtk, etc.)diff --git a/openspec/changes/archive/2026-02-28-windows-build-support/tasks.md b/openspec/changes/archive/2026-02-28-windows-build-support/tasks.mddeleted file mode 100644index 92ffca8a6..000000000--- a/openspec/changes/archive/2026-02-28-windows-build-support/tasks.md+++ /dev/null@@ -1,10 +0,0 @@-## 1. Cross-platform menu compilation--- [x] 1.1 Wrap `app_menu` creation in `#[cfg(target_os = "macos")]` in `desktop/src/lib.rs`-- [x] 1.2 Use `let mut builder` pattern to conditionally include `app_menu` in `MenuBuilder`--## 2. README platform prerequisites--- [x] 2.1 Add macOS prerequisites subsection (Xcode Command Line Tools)-- [x] 2.2 Add Windows prerequisites subsection (Rust stable-msvc, Visual Studio Build Tools, WebView2)-- [x] 2.3 Add Linux prerequisites subsection (webkit2gtk and system libraries for Debian/Ubuntu, link to Tauri docs for other distros)diff --git a/openspec/changes/archive/2026-03-01-docs-motivation-sync/.openspec.yaml b/openspec/changes/archive/2026-03-01-docs-motivation-sync/.openspec.yamldeleted file mode 100644index 0b4defe0e..000000000--- a/openspec/changes/archive/2026-03-01-docs-motivation-sync/.openspec.yaml+++ /dev/null@@ -1,2 +0,0 @@-schema: spec-driven-created: 2026-03-01diff --git a/openspec/changes/archive/2026-03-01-docs-motivation-sync/design.md b/openspec/changes/archive/2026-03-01-docs-motivation-sync/design.mddeleted file mode 100644index 2a11f1b95..000000000--- a/openspec/changes/archive/2026-03-01-docs-motivation-sync/design.md+++ /dev/null@@ -1,28 +0,0 @@-## Context--The README now has a "Why" section with 5 bullet points: open source, Figma-compatible, AI-native, fully local, programmable. The docs site doesn't reflect this messaging.--## Goals / Non-Goals--**Goals:**-- Bring the motivation narrative from README into the docs site's key pages-- Consistent messaging across landing, features, comparison, and user guide--**Non-Goals:**-- Rewriting existing feature documentation-- Adding new feature coverage-- Changing the site structure--## Decisions--**Landing page**: Update hero tagline to "Figma-compatible, AI-first, fully local" (matches README). Update feature cards to emphasize the 5 pillars.--**Features page**: Add a brief "Why OpenPencil" intro section before the feature list, derived from README's Why section. Keep concise — 2-3 sentences max, not a copy of the full README section.--**Comparison page**: Add a motivation paragraph to the intro explaining why architectural comparison matters (open vs closed platform).--**User guide**: Light touch — update intro to mention "open-source, Figma-compatible" positioning.--## Risks / Trade-offs--- [Drift] README and docs could diverge again → docs reference the same narrative, not copy itdiff --git a/openspec/changes/archive/2026-03-01-docs-motivation-sync/proposal.md b/openspec/changes/archive/2026-03-01-docs-motivation-sync/proposal.mddeleted file mode 100644index 1727b108b..000000000--- a/openspec/changes/archive/2026-03-01-docs-motivation-sync/proposal.md+++ /dev/null@@ -1,29 +0,0 @@-## Why--README gained a "Why" section explaining OpenPencil's motivation (Figma closing CDP access, supply chain problem, open-source alternative). The docs landing page, comparison page, and features page don't reflect this narrative. The docs still present OpenPencil generically as "AI-native design editor" without the motivation story.--## What Changes--- Update `docs/index.md` landing page hero tagline and features to incorporate the motivation narrative (open source, Figma-compatible, AI-native, fully local, programmable)-- Update `docs/guide/comparison.md` intro to reference the motivation (why an alternative matters)-- Update `docs/guide/features.md` to add a "Why OpenPencil" section at the top, derived from README-- Update `docs/user-guide/index.md` intro to align with the motivation messaging--## Capabilities--### New Capabilities--(none)--### Modified Capabilities--- `vitepress-docs`: Landing page hero/features and comparison intro updated to reflect the README motivation section-- `userdoc-articles`: User guide landing page intro updated with motivation messaging--## Impact--- `docs/index.md` — hero text and feature cards-- `docs/guide/comparison.md` — intro paragraph-- `docs/guide/features.md` — new intro section-- `docs/user-guide/index.md` — intro text-- No code changes, no dependency changesdiff --git a/openspec/changes/archive/2026-03-01-docs-motivation-sync/specs/userdoc-articles/spec.md b/openspec/changes/archive/2026-03-01-docs-motivation-sync/specs/userdoc-articles/spec.mddeleted file mode 100644index 304beb61c..000000000--- a/openspec/changes/archive/2026-03-01-docs-motivation-sync/specs/userdoc-articles/spec.md+++ /dev/null@@ -1,8 +0,0 @@-## MODIFIED Requirements--### Requirement: User guide landing page-The docs site SHALL have an `index.md` at `docs/user-guide/` with the title "User Guide", a brief description positioning OpenPencil as an open-source, Figma-compatible design editor, and links to all user guide articles organized by category.--#### Scenario: Landing page renders-- **WHEN** user navigates to /user-guide/-- **THEN** a page with "User Guide" title, open-source/Figma-compatible positioning, and categorized links to all articles is displayeddiff --git a/openspec/changes/archive/2026-03-01-docs-motivation-sync/specs/vitepress-docs/spec.md b/openspec/changes/archive/2026-03-01-docs-motivation-sync/specs/vitepress-docs/spec.mddeleted file mode 100644index 19b30ce51..000000000--- a/openspec/changes/archive/2026-03-01-docs-motivation-sync/specs/vitepress-docs/spec.md+++ /dev/null@@ -1,34 +0,0 @@-## MODIFIED Requirements--### Requirement: Landing page-The docs site SHALL have an index.md landing page with project name, tagline "Open-source Figma alternative. Fully local, AI-native, programmable.", and quick navigation to guide and reference sections. The feature cards SHALL reflect the five pillars: open source, Figma-compatible, AI-native, fully local, programmable.--#### Scenario: Landing page loads-- **WHEN** user opens the docs site root URL-- **THEN** a landing page with "OpenPencil" title, the updated tagline, and pillar-based feature highlights is displayed--### Requirement: Guide section-The docs site SHALL include a guide section with pages: Getting Started, Features, Architecture, Tech Stack. The Features page SHALL begin with a brief motivation section explaining why OpenPencil exists (open platform vs closed tooling). The Features page SHALL document components (create, instance, detach, component sets), context menu, z-order, visibility/lock toggle, move-to-page, and rendering optimizations (viewport culling, RAF coalescing).--#### Scenario: Getting started page-- **WHEN** user navigates to the Getting Started guide-- **THEN** installation instructions (`bun install`, `bun run dev`) and desktop app setup are displayed--#### Scenario: Architecture page-- **WHEN** user navigates to the Architecture guide-- **THEN** the system architecture diagram and component descriptions from PLAN.md are displayed--#### Scenario: Features page motivation section-- **WHEN** user reads the features page-- **THEN** a brief intro explains why OpenPencil exists before the feature list--#### Scenario: Features page documents components-- **WHEN** user reads the features page-- **THEN** component creation, instances, detach, component sets, and context menu are described--### Requirement: Comparison page-The docs site SHALL include a comparison page at `/guide/comparison` documenting architecture, rendering, data model, layout, file format, state management, developer experience, and performance differences between OpenPencil and Penpot. The intro SHALL reference the motivation for an open alternative to closed design platforms.--#### Scenario: Comparison page renders-- **WHEN** user navigates to /guide/comparison-- **THEN** a page with all comparison sections, the summary table, and a motivation context intro is displayeddiff --git a/openspec/changes/archive/2026-03-01-docs-motivation-sync/tasks.md b/openspec/changes/archive/2026-03-01-docs-motivation-sync/tasks.mddeleted file mode 100644index 41325c8c8..000000000--- a/openspec/changes/archive/2026-03-01-docs-motivation-sync/tasks.md+++ /dev/null@@ -1,15 +0,0 @@-## 1. Landing Page--- [x] 1.1 Update `docs/index.md` — change hero `tagline` to "Open-source Figma alternative. Fully local, AI-native, programmable." Update `description` frontmatter to match. Replace 6 feature cards with 5 pillar-based cards: Open Source (MIT, read/modify everything), Figma-Compatible (.fig import/export, clipboard), AI-Native (built-in chat, 10 tools, no API restrictions), Fully Local (no account/server/internet, ~5MB Tauri), Programmable (headless CLI, scriptable operations, JSX renderer)--## 2. Features Page--- [x] 2.1 Update `docs/guide/features.md` — add "## Why OpenPencil" as first section with text: "Design tools are a supply chain problem. When your tool is closed-source, the vendor controls what's possible — they can break your automation overnight. OpenPencil is an open-source alternative: MIT-licensed, Figma-compatible, fully local, and programmable."--## 3. Comparison Page--- [x] 3.1 Update `docs/guide/comparison.md` — prepend a paragraph after the H1: "Why compare? OpenPencil exists because closed design platforms control what's possible. Understanding architectural differences shows what an open, local-first alternative can do differently."--## 4. User Guide Landing--- [x] 4.1 Update `docs/user-guide/index.md` — change intro from "OpenPencil is an open-source design editor with full .fig file compatibility." to "OpenPencil is an open-source, Figma-compatible design editor — fully local, AI-native, and programmable."diff --git a/openspec/changes/archive/2026-03-01-sync-agents-cli-plan/.openspec.yaml b/openspec/changes/archive/2026-03-01-sync-agents-cli-plan/.openspec.yamldeleted file mode 100644index b51d4740b..000000000--- a/openspec/changes/archive/2026-03-01-sync-agents-cli-plan/.openspec.yaml+++ /dev/null@@ -1 +0,0 @@-type: changediff --git a/openspec/changes/archive/2026-03-01-sync-agents-cli-plan/design.md b/openspec/changes/archive/2026-03-01-sync-agents-cli-plan/design.mddeleted file mode 100644index 69e77f0c7..000000000--- a/openspec/changes/archive/2026-03-01-sync-agents-cli-plan/design.md+++ /dev/null@@ -1,15 +0,0 @@-# Design: Sync AGENTS.md, CLI Plan, Identifier Fix--## Approach--Documentation-only change. Update specs and docs to match master.--## Delta-Specs--### desktop-app-- Update app identifier to `net.dannote.open-pencil`--### vitepress-docs-- Add AGENTS.md mention to contributing docs-- Add CLI & Headless Mode to roadmap as planned feature-- Update docs index hero or features to align with README messagingdiff --git a/openspec/changes/archive/2026-03-01-sync-agents-cli-plan/proposal.md b/openspec/changes/archive/2026-03-01-sync-agents-cli-plan/proposal.mddeleted file mode 100644index 520852ee3..000000000--- a/openspec/changes/archive/2026-03-01-sync-agents-cli-plan/proposal.md+++ /dev/null@@ -1,16 +0,0 @@-# Proposal: Sync AGENTS.md, CLI Plan, Identifier Fix--## Why--8 commits merged from master (70c88dd..7ff16f7) add AI agent conventions (AGENTS.md), CLI & Headless Mode plan in PLAN.md, README updates (screenshot, feature list, offline messaging), and a Tauri app identifier fix.--## What Changes--### Implemented-1. **App identifier fix** — changed from `com.dannote.open-pencil-app` to `net.dannote.open-pencil` in tauri.conf.json-2. **AGENTS.md** — coding conventions file for AI agents (commands, code style, rendering, scene graph, components, layout, UI, file format, Tauri conventions, figma-use reference, known issues)-3. **README updates** — added screenshot, components & instances in feature list, system fonts, gradients, ~5 MB offline messaging--### Planned (in PLAN.md, not yet implemented)-4. **CLI & Headless Mode** — attached mode (WebSocket to running editor) and headless mode (engine in Bun/Node without GUI). Package structure: core/, cli/, mcp/. Commands: eval, find, lint, export, node get/tree, create, set, analyze, screenshot.-5. **Yoga CSS Grid tracking** — upstream PR details (facebook/yoga#1893–#1902)diff --git a/openspec/changes/archive/2026-03-01-sync-agents-cli-plan/specs/desktop-app/spec.md b/openspec/changes/archive/2026-03-01-sync-agents-cli-plan/specs/desktop-app/spec.mddeleted file mode 100644index ceb341c29..000000000--- a/openspec/changes/archive/2026-03-01-sync-agents-cli-plan/specs/desktop-app/spec.md+++ /dev/null@@ -1,6 +0,0 @@-# desktop-app Specification (delta)--## Modified Requirements--### Requirement: Tauri v2 desktop shell (updated)-The app identifier SHALL be `net.dannote.open-pencil` (was `com.dannote.open-pencil-app`).diff --git a/openspec/changes/archive/2026-03-01-sync-agents-cli-plan/specs/vitepress-docs/spec.md b/openspec/changes/archive/2026-03-01-sync-agents-cli-plan/specs/vitepress-docs/spec.mddeleted file mode 100644index 39db5d691..000000000--- a/openspec/changes/archive/2026-03-01-sync-agents-cli-plan/specs/vitepress-docs/spec.md+++ /dev/null@@ -1,9 +0,0 @@-# vitepress-docs Specification (delta)--## New Requirements--### Requirement: AGENTS.md reference in contributing docs-The contributing documentation SHALL mention AGENTS.md as the AI agent coding conventions reference. Developers and agents working on the codebase should read AGENTS.md for rendering, scene graph, component, layout, UI, and file format conventions.--### Requirement: CLI & Headless Mode in roadmap-The roadmap SHALL include CLI & Headless Mode as a planned feature under Phase 5 (AI Integration): attached mode (WebSocket to running editor for eval, create, export, screenshot) and headless mode (engine in Bun/Node for lint, analysis, validation in CI). Package extraction: core/ (engine without rendering), cli/, mcp/.diff --git a/openspec/changes/archive/2026-03-01-sync-agents-cli-plan/tasks.md b/openspec/changes/archive/2026-03-01-sync-agents-cli-plan/tasks.mddeleted file mode 100644index b903ec76c..000000000--- a/openspec/changes/archive/2026-03-01-sync-agents-cli-plan/tasks.md+++ /dev/null@@ -1,18 +0,0 @@-# Tasks: Sync AGENTS.md, CLI Plan, Identifier Fix--Reference: 8 commits from master (70c88dd..7ff16f7).--## 1. Update OpenSpec Specs--- [x] 1.1 Update `openspec/specs/desktop-app/spec.md` — update app identifier to `net.dannote.open-pencil`.--## 2. Update VitePress Docs--- [x] 2.1 Update `docs/development/contributing.md` — add AGENTS.md reference for AI agent conventions.-- [x] 2.2 Update `docs/development/roadmap.md` — add CLI & Headless Mode to Phase 5 Planned (attached + headless modes, core/ extraction, CLI commands).-- [x] 2.3 Update `docs/guide/features.md` — add offline/lightweight messaging to Desktop App section to align with README.-- [x] 2.4 Update `docs/guide/figma-comparison.md` — update "Keyboard shortcuts" notes to reflect fixed Mac modifier shortcuts. Add AGENTS.md/CLI note under "MCP server" row.--## 3. Verify--- [x] 3.1 Run `bun run docs:build` to verify VitePress build passes.diff --git a/openspec/changes/archive/2026-03-01-sync-ai-chat-code-tab/.openspec.yaml b/openspec/changes/archive/2026-03-01-sync-ai-chat-code-tab/.openspec.yamldeleted file mode 100644index 0b4defe0e..000000000--- a/openspec/changes/archive/2026-03-01-sync-ai-chat-code-tab/.openspec.yaml+++ /dev/null@@ -1,2 +0,0 @@-schema: spec-driven-created: 2026-03-01diff --git a/openspec/changes/archive/2026-03-01-sync-ai-chat-code-tab/design.md b/openspec/changes/archive/2026-03-01-sync-ai-chat-code-tab/design.mddeleted file mode 100644index f5992628e..000000000--- a/openspec/changes/archive/2026-03-01-sync-ai-chat-code-tab/design.md+++ /dev/null@@ -1,19 +0,0 @@-# Design: Sync AI chat, Code tab--## Approach-Documentation-only. Update/create specs for AI chat and Code panel, propagate to VitePress docs and comparison matrix.--## Affected spec domains--1. **editor-ui** — Properties panel restructured to Design | Code | AI tabs, DesignPanel extraction, ChatPanel + sub-components, CodePanel, ⌘J shortcut-2. **scene-graph** (new requirement) — sceneNodeToJsx() export function-3. **testing** — Playwright chat tests with mock transport, 14 JSX export tests--## New spec domain consideration-AI chat could warrant its own spec domain, but it's tightly integrated into editor-ui (tab in properties panel, tools call editor store). Keep in editor-ui for now.--## VitePress docs updates-- features.md: add "AI Chat" section, add "Code Panel" section, update Properties Panel description-- figma-comparison.md: AI tools 🔲→🟡, Code snippets 🔲→🟡, Dev Mode 🔲→🟡-- roadmap.md: Phase 5 delivered items (AI chat, Code tab)-- keyboard-shortcuts.md: ⌘J (toggle AI chat)diff --git a/openspec/changes/archive/2026-03-01-sync-ai-chat-code-tab/proposal.md b/openspec/changes/archive/2026-03-01-sync-ai-chat-code-tab/proposal.mddeleted file mode 100644index 790919a96..000000000--- a/openspec/changes/archive/2026-03-01-sync-ai-chat-code-tab/proposal.md+++ /dev/null@@ -1,25 +0,0 @@-# Proposal: Sync AI chat, Code tab--## Why-19 commits from master (6268d8b..c59d5fc) introduce AI chat integration and a Code panel for JSX export.--## What changed--### AI chat (5d23c3e → bf8636c, 15 commits)-- ChatPanel with message list, tool timeline, typing indicator, API key setup via Tauri Stronghold-- DirectChatTransport: no backend server, calls OpenRouter directly from browser-- ToolLoopAgent with 10 AI tools (valibot schemas): create_shape, set_fill, set_stroke, update_node, set_layout, delete_node, select_nodes, get_page_tree, get_selection, rename_node-- Model selector with curated list: Claude 4.6, Gemini 3.1, GPT-5.3, DeepSeek V3.2, Qwen 3.5, Kimi K2.5, Llama-- ⌘J keyboard shortcut to toggle chat-- Properties panel restructured: Design | Code | AI tabs (reka-ui Tabs)-- DesignPanel extracted from PropertiesPanel-- ChatMessage, ChatInput, APIKeySetup sub-components-- reka-ui ScrollArea/Collapsible/Tooltip, tw-animate-css, vue-stream-markdown for streaming-- Playwright tests with mock transport, tool call e2e test-- X-OpenRouter-Title header for app identification--### Code tab / JSX export (c59d5fc)-- sceneNodeToJsx() in @open-pencil/core: converts SceneNode subtree to JSX using builder syntax-- CodePanel.vue with Prism.js syntax highlighting, line numbers, copy button-- Third tab in properties panel-- 14 new tests covering shapes, text, layout, effects, multi-selectiondiff --git a/openspec/changes/archive/2026-03-01-sync-ai-chat-code-tab/specs/editor-ui/spec.md b/openspec/changes/archive/2026-03-01-sync-ai-chat-code-tab/specs/editor-ui/spec.mddeleted file mode 100644index 7b0d17a02..000000000--- a/openspec/changes/archive/2026-03-01-sync-ai-chat-code-tab/specs/editor-ui/spec.md+++ /dev/null@@ -1,63 +0,0 @@-# editor-ui Specification (delta)--## Modified Requirements--### Requirement: Properties panel with sections (MODIFIED)-The properties panel SHALL be organized as a tabbed interface with Design | Code | AI tabs (reka-ui Tabs). The Design tab contains the existing property sections (DesignPanel). The Code tab shows JSX export. The AI tab shows the chat interface.--#### Scenario: Switch to Code tab-- **WHEN** user clicks the Code tab in the properties panel-- **THEN** the JSX code representation of the selection is displayed--#### Scenario: Switch to AI tab-- **WHEN** user clicks the AI tab-- **THEN** the AI chat interface is displayed--## New Requirements--### Requirement: AI chat panel-The editor SHALL include an AI chat panel accessible via the AI tab in properties panel or ⌘J shortcut. The panel provides: message list with streaming markdown (vue-stream-markdown), tool call timeline with collapsible details (reka-ui Collapsible), typing indicator, API key setup for OpenRouter (stored in Tauri Stronghold). Messages scroll automatically (reka-ui ScrollArea).--#### Scenario: Send message-- **WHEN** user types a message and presses Enter in the chat input-- **THEN** the message is sent to OpenRouter and a streaming response appears--#### Scenario: Toggle chat-- **WHEN** user presses ⌘J-- **THEN** the properties panel switches to the AI tab (or back to Design)--### Requirement: AI model selector-The chat input SHALL include a model selector with curated models: Claude, Gemini, GPT, DeepSeek, Qwen, Kimi, Llama. Models are stored in @open-pencil/core constants with benchmark-ranked tags.--#### Scenario: Change model-- **WHEN** user selects a different model from the selector-- **THEN** subsequent messages use the selected model--### Requirement: AI tools-The chat SHALL support 10 design tools with valibot schemas: create_shape, set_fill, set_stroke, update_node, set_layout, delete_node, select_nodes, get_page_tree, get_selection, rename_node. Tools execute against the editor store. The ToolLoopAgent calls tools automatically in a loop.--#### Scenario: AI creates a shape-- **WHEN** user asks "Create a blue rectangle 200×100"-- **THEN** the AI calls create_shape with type RECTANGLE, width 200, height 100, and set_fill with blue color--#### Scenario: Tool call visible in chat-- **WHEN** the AI executes a tool-- **THEN** a collapsible tool call section shows the tool name, input, and output--### Requirement: DirectChatTransport-The chat SHALL communicate directly with OpenRouter from the browser — no backend server required. The API key is stored securely in Tauri Stronghold (or localStorage fallback in browser). X-OpenRouter-Title header identifies the app.--#### Scenario: No backend required-- **WHEN** user configures an OpenRouter API key and sends a message-- **THEN** the request goes directly to OpenRouter without a proxy server--### Requirement: Code panel with JSX export-The properties panel Code tab SHALL display the selected node(s) as JSX code using sceneNodeToJsx(). The panel provides Prism.js syntax highlighting, line numbers, and a copy-to-clipboard button. Multi-selection shows each node's JSX.--#### Scenario: View JSX for selection-- **WHEN** user selects a frame and clicks the Code tab-- **THEN** the JSX representation of the frame and its children is displayed with syntax highlighting--#### Scenario: Copy JSX-- **WHEN** user clicks the copy button in the Code panel-- **THEN** the JSX code is copied to the clipboarddiff --git a/openspec/changes/archive/2026-03-01-sync-ai-chat-code-tab/specs/scene-graph/spec.md b/openspec/changes/archive/2026-03-01-sync-ai-chat-code-tab/specs/scene-graph/spec.mddeleted file mode 100644index 6c62cca53..000000000--- a/openspec/changes/archive/2026-03-01-sync-ai-chat-code-tab/specs/scene-graph/spec.md+++ /dev/null@@ -1,14 +0,0 @@-# scene-graph Specification (delta)--## New Requirements--### Requirement: Scene node to JSX export-@open-pencil/core SHALL export a sceneNodeToJsx() function that converts a SceneNode subtree into JSX string using builder function syntax (Frame, Text, Rectangle, etc.) with Tailwind-like shorthand props. The output is valid JSX that can be consumed by renderJsx().--#### Scenario: Export frame with children-- **WHEN** sceneNodeToJsx is called on a frame with a rectangle and text child-- **THEN** a JSX string with Frame wrapping Rectangle and Text is returned--#### Scenario: Export with effects-- **WHEN** sceneNodeToJsx is called on a node with drop shadow-- **THEN** the JSX includes shadow props in the outputdiff --git a/openspec/changes/archive/2026-03-01-sync-ai-chat-code-tab/specs/testing/spec.md b/openspec/changes/archive/2026-03-01-sync-ai-chat-code-tab/specs/testing/spec.mddeleted file mode 100644index b38da0419..000000000--- a/openspec/changes/archive/2026-03-01-sync-ai-chat-code-tab/specs/testing/spec.md+++ /dev/null@@ -1,17 +0,0 @@-# testing Specification (delta)--## New Requirements--### Requirement: AI chat Playwright tests-The test suite SHALL include Playwright e2e tests for the AI chat panel with mock transport (no real LLM calls). Tests cover: sending a message, receiving a response, tool call display. Real LLM tests available via TEST_REAL_LLM=1 flag.--#### Scenario: Chat with mock transport-- **WHEN** a Playwright test sends a message via the chat input-- **THEN** the mock transport returns a response and the message appears in the chat--### Requirement: JSX export tests-The test suite SHALL include tests for sceneNodeToJsx() covering shapes, text, layout props, effects, and multi-selection. Currently 14 tests.--#### Scenario: Export rectangle to JSX-- **WHEN** sceneNodeToJsx is called on a rectangle with blue fill-- **THEN** the output includes Rectangle component with bg propdiff --git a/openspec/changes/archive/2026-03-01-sync-ai-chat-code-tab/tasks.md b/openspec/changes/archive/2026-03-01-sync-ai-chat-code-tab/tasks.mddeleted file mode 100644index db1f2f7d6..000000000--- a/openspec/changes/archive/2026-03-01-sync-ai-chat-code-tab/tasks.md+++ /dev/null@@ -1,35 +0,0 @@-# Tasks: Sync AI chat, Code tab--Reference: 19 commits from master (6268d8b..c59d5fc).-Delta-specs in `openspec/changes/sync-ai-chat-code-tab/specs/` (editor-ui, scene-graph, testing).-Proposal: `proposal.md`, Design: `design.md` — validated and aligned with delta-specs.--Section 1 (specs) MUST complete before Section 2 (docs) — docs reference merged spec content.--## 1. Merge Delta-Specs into Main Specs--Each task merges ADDED and MODIFIED requirements from the delta-spec into the baseline at `openspec/specs/<domain>/spec.md`. Untouched baseline requirements are preserved. No conflicts between domains.--- [x] 1.1 Update `openspec/specs/editor-ui/spec.md` — MODIFIED: "Properties panel" → Design | Code | AI tabs. ADDED: "AI chat panel" (message list, streaming markdown, tool timeline, API key, ⌘J), "AI model selector" (curated models in core constants), "AI tools" (10 tools with valibot, ToolLoopAgent), "DirectChatTransport" (no backend, OpenRouter, Stronghold), "Code panel with JSX export" (Prism.js, line numbers, copy)-- [x] 1.2 Update `openspec/specs/scene-graph/spec.md` — ADDED: "Scene node to JSX export" (sceneNodeToJsx function)-- [x] 1.3 Update `openspec/specs/testing/spec.md` — ADDED: "AI chat Playwright tests" (mock transport, tool call e2e), "JSX export tests" (14 tests)--## 2. Update VitePress Docs--All target files already exist — no sidebar/nav changes needed.--- [x] 2.1 Update `docs/guide/features.md`:- - **Modify "Properties Panel" bullet list**: add Code and AI tabs to description- - **Add "AI Chat" section** (after "Code Quality"): ⌘J toggle, OpenRouter direct (no backend), Stronghold key storage, model selector (Claude/Gemini/GPT/DeepSeek/Qwen/Kimi/Llama), 10 AI tools (create_shape, set_fill, etc.), streaming markdown, tool call timeline, Playwright tests with mock transport- - **Add "Code Panel" section** (after "AI Chat"): sceneNodeToJsx() in core, Prism.js highlighting, line numbers, copy button, Design | Code | AI tabs-- [x] 2.2 Update `docs/guide/figma-comparison.md` — specific row changes:- - "AI tools" 🔲→🟡: "10 AI tools via OpenRouter (create/modify/delete shapes, set fills/strokes, layout); no AI-generated content or AI search yet"- - "Code snippets" 🔲→🟡: "JSX export from selection with syntax highlighting and copy; no CSS/Swift/Kotlin snippets"- - "Dev Mode (inspect)" 🔲→🟡: "Code tab shows JSX representation; no CSS properties or handoff specs"- - No other rows change status. After: 64✅, 19🟡, 67🔲 = 150 total. Update coverage line-- [x] 2.3 Update `docs/development/roadmap.md` — Phase 5 Delivered: add AI chat (OpenRouter, 10 tools, model selector, Stronghold, ⌘J, Playwright tests), Code panel (sceneNodeToJsx, Prism.js, 14 tests)-- [x] 2.4 Update `docs/reference/keyboard-shortcuts.md` — add ⌘J (Toggle AI chat) with ✅ status--## 3. Verify--- [x] 3.1 Run `bun run docs:build` — verify build passes. Confirm: coverage count matches actual ✅/🟡/🔲 tallies via grep -c, no broken anchor warningsdiff --git a/openspec/changes/archive/2026-03-01-sync-master-march-2/.openspec.yaml b/openspec/changes/archive/2026-03-01-sync-master-march-2/.openspec.yamldeleted file mode 100644index 0b4defe0e..000000000--- a/openspec/changes/archive/2026-03-01-sync-master-march-2/.openspec.yaml+++ /dev/null@@ -1,2 +0,0 @@-schema: spec-driven-created: 2026-03-01diff --git a/openspec/changes/archive/2026-03-01-sync-master-march-2/design.md b/openspec/changes/archive/2026-03-01-sync-master-march-2/design.mddeleted file mode 100644index 003e53f92..000000000--- a/openspec/changes/archive/2026-03-01-sync-master-march-2/design.md+++ /dev/null@@ -1,15 +0,0 @@-## Context--Retrospective doc sync — code is merged and tested. Key structural change: `docs/` → `packages/docs/` as `@open-pencil/docs` workspace package. Repo org changed: dannote/open-pencil → open-pencil/open-pencil.--## Goals / Non-Goals--**Goals:** Update specs and docs to match current codebase state. Fix stale `docs/` paths.--**Non-Goals:** Code changes. New features. Restructuring specs.--## Decisions--1. **Bulk path replacement** `docs/` → `packages/docs/` in specs — mechanical, low risk.-2. **Minimal delta specs** — only MODIFIED requirements for changed behavior, no padding.-3. **AGENTS.md updates** — new commands paths, docs package mention.diff --git a/openspec/changes/archive/2026-03-01-sync-master-march-2/proposal.md b/openspec/changes/archive/2026-03-01-sync-master-march-2/proposal.mddeleted file mode 100644index a71934532..000000000--- a/openspec/changes/archive/2026-03-01-sync-master-march-2/proposal.md+++ /dev/null@@ -1,33 +0,0 @@-## Why--Master branch advanced after our previous sync (commits 22f8599..7a2694b). Key changes: docs moved to `packages/docs/` as `@open-pencil/docs`, repo renamed to open-pencil/open-pencil, Safari compatibility fixes, .fig export bugfix, CHANGELOG.md, CI/CD for app.openpencil.dev, npm trusted publishing, download links and messaging updates. Specs and docs reference stale `docs/` paths and miss new capabilities.--## What Changes--- Update all spec and doc path references from `docs/` to `packages/docs/`-- Update tooling spec with docs package extraction and npm publishing improvements-- Update vitepress-docs spec with new location and landing page changes (download links, "Open App" nav, "no subscription" messaging)-- Add .fig export COMPONENT/COMPONENT_SET → SYMBOL fix to fig-import spec-- Update desktop-app spec with Safari compatibility (save fallback, banner)-- Add CHANGELOG.md reference to tooling spec-- Update AGENTS.md with new paths and conventions-- Update Figma comparison: Safari save support improved-- Update Penpot comparison LOC stats if stale--## Capabilities--### New Capabilities-(none — changes are incremental updates to existing capabilities)--### Modified Capabilities-- `vitepress-docs`: docs moved to `packages/docs/`, new landing page features, download links, "Open App" nav link-- `tooling`: docs extracted to separate package, npm trusted publishing, CHANGELOG, CI app deploy workflow-- `fig-import`: .fig export fix for COMPONENT/COMPONENT_SET → SYMBOL mapping-- `desktop-app`: Safari save improvements, banner for File System Access API limitation-- `testing`: layers-panel test fixtures updated--## Impact--- **Specs:** 5 existing specs need path and content updates-- **AGENTS.md:** docs paths, commands, repo URL-- **No code changes** — all implementations already mergeddiff --git a/openspec/changes/archive/2026-03-01-sync-master-march-2/specs/desktop-app/spec.md b/openspec/changes/archive/2026-03-01-sync-master-march-2/specs/desktop-app/spec.mddeleted file mode 100644index 2f26228b6..000000000--- a/openspec/changes/archive/2026-03-01-sync-master-march-2/specs/desktop-app/spec.md+++ /dev/null@@ -1,19 +0,0 @@-## ADDED Requirements--### Requirement: Safari save fallback-The editor SHALL support saving in Safari and browsers without File System Access API by creating a download link (`<a>` appended to DOM) with deferred `revokeObjectURL`.--#### Scenario: Save in Safari-- **WHEN** user presses ⌘S in Safari (no showSaveFilePicker)-- **THEN** system creates a blob URL, appends an anchor to DOM, triggers click, and defers revocation--### Requirement: Safari compatibility banner-The editor SHALL display a dismissible banner when running in Safari (or browsers without File System Access API), explaining limitations and suggesting Chrome/Edge.--#### Scenario: Banner shown-- **WHEN** user opens the app in Safari-- **THEN** a banner appears explaining File System Access limitations--#### Scenario: Banner dismissal persisted-- **WHEN** user dismisses the banner-- **THEN** dismissal is saved to localStorage and banner does not reappeardiff --git a/openspec/changes/archive/2026-03-01-sync-master-march-2/specs/fig-import/spec.md b/openspec/changes/archive/2026-03-01-sync-master-march-2/specs/fig-import/spec.mddeleted file mode 100644index b18185980..000000000--- a/openspec/changes/archive/2026-03-01-sync-master-march-2/specs/fig-import/spec.md+++ /dev/null@@ -1,16 +0,0 @@-## ADDED Requirements--### Requirement: Component type mapping in export-The .fig export pipeline SHALL map COMPONENT and COMPONENT_SET node types to SYMBOL in Kiwi encoding (Figma uses SYMBOL enum value for component-like nodes).--#### Scenario: Exporting component-- **WHEN** a COMPONENT node is serialized to Kiwi format-- **THEN** the type field uses the SYMBOL enum value--#### Scenario: Exporting component set-- **WHEN** a COMPONENT_SET node is serialized to Kiwi format-- **THEN** the type field uses the SYMBOL enum value--#### Scenario: Round-trip fidelity-- **WHEN** an exported .fig file is re-imported in Figma-- **THEN** component nodes are recognized as components (not unknown types)diff --git a/openspec/changes/archive/2026-03-01-sync-master-march-2/specs/testing/spec.md b/openspec/changes/archive/2026-03-01-sync-master-march-2/specs/testing/spec.mddeleted file mode 100644index 037d3d7d7..000000000--- a/openspec/changes/archive/2026-03-01-sync-master-march-2/specs/testing/spec.md+++ /dev/null@@ -1,8 +0,0 @@-## MODIFIED Requirements--### Requirement: Layers panel E2E tests-E2E tests SHALL verify the layers panel: node visibility in tree, expand/collapse frames, selection sync between canvas and layers panel. Test fixtures match current demo shapes (Components, App Preview).--#### Scenario: Run layers panel E2E-- **WHEN** the layers panel E2E tests run-- **THEN** all tests pass verifying tree structure, visibility toggles, and selection sync with updated demo shape namesdiff --git a/openspec/changes/archive/2026-03-01-sync-master-march-2/specs/tooling/spec.md b/openspec/changes/archive/2026-03-01-sync-master-march-2/specs/tooling/spec.mddeleted file mode 100644index 1be886926..000000000--- a/openspec/changes/archive/2026-03-01-sync-master-march-2/specs/tooling/spec.md+++ /dev/null@@ -1,46 +0,0 @@-## MODIFIED Requirements--### Requirement: Vite 7 build system-The project SHALL use Vite 7 as the build tool with dev server at port 1420 and HMR support. Documentation lives in `packages/docs/` as `@open-pencil/docs` workspace package with its own dev/build/preview scripts.--#### Scenario: Dev server-- **WHEN** `bun run dev` is executed-- **THEN** Vite dev server starts at http://localhost:1420 with hot module replacement--#### Scenario: Docs dev-- **WHEN** `cd packages/docs && bun run dev` is executed-- **THEN** VitePress dev server starts for the documentation site--#### Scenario: Docs build-- **WHEN** `cd packages/docs && bun run build` is executed-- **THEN** VitePress builds the documentation site to `packages/docs/.vitepress/dist/`--### Requirement: Bun workspace monorepo-The project SHALL use Bun workspaces with packages: root (app), packages/core (@open-pencil/core), packages/cli (@open-pencil/cli), packages/docs (@open-pencil/docs). The workspace is configured in the root package.json. CLI is runnable via `bun open-pencil` in the workspace.--#### Scenario: Workspace packages resolve-- **WHEN** the app imports from @open-pencil/core-- **THEN** Bun resolves it to packages/core/ via workspace linking--## ADDED Requirements--### Requirement: CHANGELOG-The project SHALL maintain a CHANGELOG.md in the root following Keep a Changelog conventions.--#### Scenario: Changelog exists-- **WHEN** user reads CHANGELOG.md-- **THEN** version history with categorized changes (Editor, CLI, File Format, etc.) is listed--### Requirement: npm trusted publishing-Package configs SHALL include `repository` field and `provenance: true` for npm trusted publishing via GitHub Actions.--#### Scenario: Publish with provenance-- **WHEN** GitHub Actions release workflow runs-- **THEN** packages are published to npm with provenance attestation--### Requirement: CI app deployment-The project SHALL have a GitHub Actions workflow (`app.yml`) for deploying the web app to app.openpencil.dev.--#### Scenario: App deploys on push-- **WHEN** code is pushed to main branch-- **THEN** GitHub Actions builds and deploys the appdiff --git a/openspec/changes/archive/2026-03-01-sync-master-march-2/specs/vitepress-docs/spec.md b/openspec/changes/archive/2026-03-01-sync-master-march-2/specs/vitepress-docs/spec.mddeleted file mode 100644index e27bb3bf8..000000000--- a/openspec/changes/archive/2026-03-01-sync-master-march-2/specs/vitepress-docs/spec.md+++ /dev/null@@ -1,30 +0,0 @@-## MODIFIED Requirements--### Requirement: VitePress documentation site-The project SHALL have a VitePress documentation site in the `packages/docs/` directory as `@open-pencil/docs` workspace package, with its own `.vitepress/config.ts` configuration and `package.json`.--#### Scenario: Docs dev server starts-- **WHEN** `cd packages/docs && bun run dev` is executed-- **THEN** VitePress dev server starts and serves the documentation site--#### Scenario: Docs build succeeds-- **WHEN** `cd packages/docs && bun run build` is executed-- **THEN** VitePress produces a static site in `packages/docs/.vitepress/dist/`--### Requirement: Landing page-The docs site SHALL have an index.md landing page with project name, tagline "Open-source Figma alternative. Fully local, AI-native, programmable.", quick navigation to guide and reference sections, download links (GitHub Releases, app.openpencil.dev), and "no subscription, bring your own API key" messaging.--#### Scenario: Landing page loads-- **WHEN** user opens the docs site root URL-- **THEN** a landing page with "OpenPencil" title, tagline, download links, and feature highlights is displayed--#### Scenario: Open App link-- **WHEN** user clicks "Open App" in the top nav-- **THEN** browser navigates to https://app.openpencil.dev--### Requirement: Dark theme-The docs site SHALL use dark appearance to match the editor's dark aesthetic.--#### Scenario: Dark mode-- **WHEN** user opens the documentation site-- **THEN** the site renders with dark theme by defaultdiff --git a/openspec/changes/archive/2026-03-01-sync-master-march-2/tasks.md b/openspec/changes/archive/2026-03-01-sync-master-march-2/tasks.mddeleted file mode 100644index 3d979394e..000000000--- a/openspec/changes/archive/2026-03-01-sync-master-march-2/tasks.md+++ /dev/null@@ -1,27 +0,0 @@-## Context--Sync with master commits 22f8599..7a2694b. Docs moved to `packages/docs/`. Repo renamed to open-pencil/open-pencil. All code already merged.--## 1. Fix stale docs paths in specs--- [x] 1.1 In `openspec/specs/vitepress-docs/spec.md`: replace all `docs/` references with `packages/docs/`, update Purpose line, update VitePress site requirement with new location, add "Open App" nav and download links to landing page requirement-- [x] 1.2 In `openspec/specs/tooling/spec.md`: replace `docs/` → `packages/docs/` in build paths, update Bun workspace monorepo requirement to list 4 packages (add docs), add CHANGELOG, npm trusted publishing, and CI app deploy requirements-- [x] 1.3 In `openspec/specs/fig-import/spec.md`: add COMPONENT/COMPONENT_SET → SYMBOL export mapping requirement-- [x] 1.4 In `openspec/specs/desktop-app/spec.md`: add Safari save fallback and compatibility banner requirements-- [x] 1.5 In `openspec/specs/testing/spec.md`: update layers panel test requirement with current demo shape names--## 2. Update AGENTS.md--- [x] 2.1 Update docs-related commands: `bun run docs:dev` → `cd packages/docs && bun run dev` (or equivalent workspace command)-- [x] 2.2 Add `packages/docs` mention to Monorepo section-- [x] 2.3 Add Safari save note to File format section (download fallback for browsers without File System Access)--## 3. Update docs content--- [x] 3.1 Verify `packages/docs/guide/figma-comparison.md` has correct Safari/save info (check Import & Export section, "Save / Save As" row notes)-- [x] 3.2 Verify `packages/docs/guide/comparison.md` LOC stats — update if stale--## 4. Verification--- [x] 4.1 Run `cd packages/docs && bun run build` — verify no broken links-- [x] 4.2 Verify no remaining `docs/` references in specs (should all be `packages/docs/`)diff --git a/openspec/changes/archive/2026-03-01-sync-specs-docs-with-master/.openspec.yaml b/openspec/changes/archive/2026-03-01-sync-specs-docs-with-master/.openspec.yamldeleted file mode 100644index 0b4defe0e..000000000--- a/openspec/changes/archive/2026-03-01-sync-specs-docs-with-master/.openspec.yaml+++ /dev/null@@ -1,2 +0,0 @@-schema: spec-driven-created: 2026-03-01diff --git a/openspec/changes/archive/2026-03-01-sync-specs-docs-with-master/design.md b/openspec/changes/archive/2026-03-01-sync-specs-docs-with-master/design.mddeleted file mode 100644index 97ab15739..000000000--- a/openspec/changes/archive/2026-03-01-sync-specs-docs-with-master/design.md+++ /dev/null@@ -1,109 +0,0 @@-## Context--OpenSpec and VitePress documentation fell out of sync after a major merge from master (commits 63748ec through 20290f6). The merge introduced:-- Figma Plugin API (`packages/core/src/figma-api.ts`, 1119 LOC) mirroring Figma's plugin surface for headless scripting-- Eval CLI command (`packages/cli/src/commands/eval.ts`) enabling JavaScript execution against .fig files-- Unified tool definitions (`packages/core/src/tools/`) centralizing AI/CLI/MCP tool schemas-- App menu for browser mode (`src/components/AppMenu.vue`, 196 LOC)-- Autosave with 3-second debounce (`src/stores/editor.ts`)-- Extensive test coverage (2571 LOC across 5 new test files)-- Comprehensive eval command documentation (`docs/eval-command.md`, 437 LOC)--These changes are implemented and tested but lack corresponding OpenSpec specs and comprehensive VitePress doc updates (especially comparison matrices). Current state creates documentation debt and risks divergence between code and specs.--**Constraints:**-- Specs live in `openspec/specs/` (main specs) and `openspec/changes/*/specs/` (delta specs during active changes)-- Documentation lives in `docs/` as a VitePress site (not a separate package, just a directory with `.vitepress/config.ts`)-- Changes are already implemented — this is a **documentation sync** task, not a feature build-- Must preserve existing spec structure and documentation style--## Goals / Non-Goals--**Goals:**-- Create OpenSpec specs for 4 new capabilities (figma-plugin-api, eval-command, app-menu, autosave)-- Update 4 existing capability specs (cli, tooling, testing, vitepress-docs) with delta specs-- Update Figma comparison matrix (`docs/guide/figma-comparison.md`) to reflect new features-- Update Penpot comparison (`docs/guide/comparison.md`) to highlight headless scripting-- Ensure specs match implemented behavior (read code/tests as source of truth)-- Link specs to VitePress docs where appropriate--**Non-Goals:**-- Changing code implementation (code is already merged and tested)-- Creating new VitePress articles (eval-command.md already exists)-- Restructuring spec organization or schemas-- Backward-compatibility analysis (all changes are additive)--## Decisions--### **Decision 1: Documentation is sync, not discovery**--**Choice:** Treat code/tests as source of truth; specs document implemented behavior.--**Rationale:**-- Changes already merged, tested (2571 LOC of tests), and documented (eval-command.md)-- Spec creation here is retrospective documentation, not forward-looking requirements-- Reading implementation reveals actual behavior > guessing from commit messages--**Alternatives considered:**-- Write specs from scratch based on desired behavior → Wrong: code is already shipped-- Skip specs entirely → Violates OpenSpec discipline, creates technical debt--### **Decision 2: Separate specs for each new capability**--**Choice:** Create 4 new capability specs (figma-plugin-api, eval-command, app-menu, autosave) in `specs/<name>/spec.md`.--**Rationale:**-- Each is independently testable and documented-- Figma Plugin API is a 1119-line implementation with 924 LOC of tests — deserves standalone spec-- Aligns with OpenSpec principle: one capability = one spec--**Alternatives considered:**-- Merge figma-plugin-api and eval-command into single spec → No: API is usable beyond eval (e.g., AI tools)-- Put app-menu and autosave into existing editor-ui spec → No: loses discoverability--### **Decision 3: Delta specs for modified capabilities**--**Choice:** Create delta specs in `openspec/changes/sync-specs-docs-with-master/specs/<capability>/spec.md` for cli, tooling, testing, vitepress-docs.--**Rationale:**-- Requirements changed (CLI has new eval subcommand, testing has 5 new test suites)-- Delta specs eventually merge into main specs during archive phase-- Preserves change history and review trail--### **Decision 4: Update comparison docs to reflect eval + app menu**--**Choice:**-- Update `docs/guide/figma-comparison.md` → add rows for app menu (Interface section), eval command (Plugin API section), update AI tools row-- Update `docs/guide/comparison.md` → add paragraph in Architecture section highlighting headless scripting advantage over Penpot--**Rationale:**-- App menu brings OpenPencil closer to Figma's UI parity (updates Interface & Navigation section)-- Eval command with Figma Plugin API is unique differentiator (Penpot has no plugin API)-- Comparison matrices are user-facing landing page content → must stay current--**Alternatives considered:**-- Skip comparison updates → No: comparison.md is linked from README and landing page-- Only update Figma comparison → No: headless scripting is architectural advantage over Penpot too--### **Decision 5: Minimal AGENTS.md updates**--**Choice:** Update AGENTS.md only to reflect tool unification (reference `packages/core/src/tools/` instead of `src/ai/tools.ts`).--**Rationale:**-- AGENTS.md already mentions tool architecture-- Eval command, app menu, autosave don't change agent instructions-- Unified tool definitions reduce duplication → agents reference canonical source--## Risks / Trade-offs--**[Risk: Specs may drift from code again]** → Mitigation: Add note to CONTRIBUTING.md or AGENTS.md to update specs alongside code-**[Risk: Verbose specs for retrospective documentation]** → Mitigation: Focus on requirements/scenarios, not rehashing code structure-**[Trade-off: Delta specs add file count]** → Acceptable: OpenSpec workflow requires deltas for modified capabilities; they merge during archive--## Migration Plan--N/A — documentation-only changes. No deployment, rollback, or runtime impact.--## Open Questions--None — all implementation details are observable in merged code and tests.diff --git a/openspec/changes/archive/2026-03-01-sync-specs-docs-with-master/proposal.md b/openspec/changes/archive/2026-03-01-sync-specs-docs-with-master/proposal.mddeleted file mode 100644index 56ce852c3..000000000--- a/openspec/changes/archive/2026-03-01-sync-specs-docs-with-master/proposal.md+++ /dev/null@@ -1,42 +0,0 @@-## Why--After merging changes from master, OpenSpec specs and VitePress documentation are out of sync with the codebase. Major new features (Figma Plugin API, eval command, app menu, autosave) and architectural improvements (unified tool definitions) are implemented but not documented in specs or user-facing docs. This creates a gap between code reality and documentation, reducing project maintainability and developer understanding.--## What Changes--- Add specs for Figma Plugin API (1119-line implementation mirroring Figma's plugin surface)-- Add specs for `eval` CLI command (headless scripting with `--code`, `--stdin`, `--write`)-- Add specs for app menu bar (browser mode: File, Edit, View, Object, Text, Arrange)-- Add specs for autosave (debounced write 3s after scene changes)-- Update CLI spec with eval command integration-- Update tooling spec with unified tool definition system (define once, adapt for AI/CLI/MCP)-- Update testing spec with app menu and autosave integration tests-- Add VitePress documentation for eval command (comprehensive guide with examples)-- Update AGENTS.md references to reflect new tool architecture-- Update Figma comparison matrix (docs/guide/figma-comparison.md) to reflect new capabilities (app menu, CLI eval command, Figma Plugin API compatibility)-- Update Penpot comparison (docs/guide/comparison.md) to highlight headless scripting advantage--## Capabilities--### New Capabilities--- `figma-plugin-api`: Figma-compatible Plugin API for headless scripting. Provides `figma` global object with node creation, manipulation, querying, and serialization matching Figma's surface. Includes SceneNode proxy wrappers, property getters/setters, type guards, and JSON export.-- `eval-command`: CLI command `open-pencil eval <file> --code '<js>'` for executing JavaScript against .fig files. Supports stdin input, writing changes back, and returning JSON results. Enables batch operations, AI tool execution, and headless testing.-- `app-menu`: Browser mode menu bar with File (New, Open, Save, Export), Edit (Undo, Redo, Cut, Copy, Paste), View (Zoom controls, Rulers), Object (Group, Frame, Component), Text (Font size, Bold, Align), and Arrange (Bring to Front, Send to Back) menus. Only visible in browser (`!IS_TAURI`).-- `autosave`: Automatic file saving with 3-second debounce after last scene change. Watches `sceneVersion`, uses `useDebounceFn` from VueUse, writes via Tauri or File System Access API. Disabled for new unsaved files (no fileHandle).--### Modified Capabilities--- `cli`: Add eval command to CLI suite. Integrates FigmaAPI execution environment, supports `--write`/`-o` for persisting changes, `--stdin` for multiline scripts, `--json` for structured output.-- `tooling`: Unified tool definitions in `packages/core/src/tools/`. Define tools once in `schema.ts`, adapt for AI (`ai-adapter.ts`), CLI (citty commands), and MCP (future). Deduplicates 311 lines from `src/ai/tools.ts` by using `FigmaAPI.toJSON()` and shared color parsing.-- `testing`: Add integration tests for app menu (`tests/e2e/app-menu.spec.ts`, 131 lines) and autosave (`tests/e2e/autosave.spec.ts`, 113 lines). Add eval CLI tests (`tests/engine/eval-cli.test.ts`, 202 lines), FigmaAPI tests (`tests/engine/figma-api.test.ts`, 924 lines), and tool adapter tests (409 lines across 3 files).-- `vitepress-docs`: Add `docs/eval-command.md` (437 lines) covering eval architecture, FigmaAPI surface, usage examples, AI integration, testing patterns, and migration from Figma plugins.--## Impact--- **Core:** New `packages/core/src/figma-api.ts` (1119 lines), `packages/core/src/tools/` (3 files, 936 lines)-- **CLI:** New `packages/cli/src/commands/eval.ts` (78 lines)-- **Editor:** New `src/components/AppMenu.vue` (196 lines), modified `src/stores/editor.ts` (autosave logic)-- **Tests:** 5 new test files (2571 lines total)-- **Docs:** New `docs/eval-command.md`, updated AGENTS.md-- **Breaking:** None (additive changes only)diff --git a/openspec/changes/archive/2026-03-01-sync-specs-docs-with-master/specs/app-menu/spec.md b/openspec/changes/archive/2026-03-01-sync-specs-docs-with-master/specs/app-menu/spec.mddeleted file mode 100644index b7d46f698..000000000--- a/openspec/changes/archive/2026-03-01-sync-specs-docs-with-master/specs/app-menu/spec.md+++ /dev/null@@ -1,205 +0,0 @@-## ADDED Requirements--### Requirement: App menu bar for browser mode--The system SHALL display a menu bar in browser mode (`!IS_TAURI`) with File, Edit, View, Object, Text, and Arrange menus.--#### Scenario: Menu visibility in browser-- **WHEN** app runs in browser (not Tauri desktop)-- **THEN** system displays menu bar at top of window--#### Scenario: Menu hidden in Tauri-- **WHEN** app runs in Tauri desktop mode-- **THEN** system hides menu bar (Tauri provides native menus)--### Requirement: File menu--The system SHALL provide File menu with Open, Save, Save As, and Export actions.--#### Scenario: Open file-- **WHEN** user clicks File → Open… or presses ⌘O (Ctrl+O on Windows/Linux)-- **THEN** system opens file picker dialog--#### Scenario: Save file-- **WHEN** user clicks File → Save or presses ⌘S-- **THEN** system saves current document--#### Scenario: Save As-- **WHEN** user clicks File → Save as… or presses ⌘⇧S-- **THEN** system opens save dialog for new filename--#### Scenario: Export selection-- **WHEN** user clicks File → Export selection… or presses ⌘⇧E with selection-- **THEN** system exports selected nodes as PNG--#### Scenario: Export disabled when no selection-- **WHEN** user has no selection-- **THEN** system disables "Export selection…" menu item--### Requirement: Edit menu--The system SHALL provide Edit menu with undo, redo, clipboard, and selection actions.--#### Scenario: Undo-- **WHEN** user clicks Edit → Undo or presses ⌘Z-- **THEN** system reverts last action--#### Scenario: Redo-- **WHEN** user clicks Edit → Redo or presses ⌘⇧Z-- **THEN** system reapplies undone action--#### Scenario: Copy/Paste-- **WHEN** user clicks Edit → Copy (⌘C) or Paste (⌘V)-- **THEN** system performs clipboard operation--#### Scenario: Duplicate-- **WHEN** user clicks Edit → Duplicate or presses ⌘D-- **THEN** system duplicates selected nodes--#### Scenario: Delete-- **WHEN** user clicks Edit → Delete or presses ⌫-- **THEN** system removes selected nodes--#### Scenario: Select all-- **WHEN** user clicks Edit → Select all or presses ⌘A-- **THEN** system selects all nodes on current page--### Requirement: View menu--The system SHALL provide View menu with zoom and ruler controls.--#### Scenario: Zoom to fit-- **WHEN** user clicks View → Zoom to fit or presses ⇧1-- **THEN** system fits all content in viewport--#### Scenario: Zoom in-- **WHEN** user clicks View → Zoom in or presses ⌘=-- **THEN** system zooms in toward center--#### Scenario: Zoom out-- **WHEN** user clicks View → Zoom out or presses ⌘--- **THEN** system zooms out from center--#### Scenario: Toggle rulers-- **WHEN** user clicks View → Rulers or presses ⇧R-- **THEN** system shows/hides canvas rulers--### Requirement: Object menu--The system SHALL provide Object menu with grouping, framing, and component actions.--#### Scenario: Group selection-- **WHEN** user clicks Object → Group or presses ⌘G-- **THEN** system creates GROUP containing selected nodes--#### Scenario: Ungroup-- **WHEN** user clicks Object → Ungroup or presses ⌘⇧G with grouped selection-- **THEN** system dissolves group and reparents children--#### Scenario: Frame selection-- **WHEN** user clicks Object → Frame selection or presses ⌘⌥F-- **THEN** system wraps selected nodes in FRAME--#### Scenario: Create component-- **WHEN** user clicks Object → Create component or presses ⌘⌥K-- **THEN** system converts selection to COMPONENT--#### Scenario: Create component set-- **WHEN** user clicks Object → Create component set with multiple components selected-- **THEN** system creates COMPONENT_SET containing components--### Requirement: Text menu--The system SHALL provide Text menu with font size and style controls.--#### Scenario: Font size adjustment-- **WHEN** user clicks Text → Increase font size (⌘⇧>) or Decrease (⌘⇧<)-- **THEN** system adjusts font size of selected text by 2px--#### Scenario: Bold toggle-- **WHEN** user clicks Text → Bold or presses ⌘B-- **THEN** system toggles bold weight for selected text--#### Scenario: Italic toggle-- **WHEN** user clicks Text → Italic or presses ⌘I-- **THEN** system toggles italic style for selected text--#### Scenario: Underline toggle-- **WHEN** user clicks Text → Underline or presses ⌘U-- **THEN** system toggles underline decoration for selected text--#### Scenario: Strikethrough toggle-- **WHEN** user clicks Text → Strikethrough or presses S button-- **THEN** system toggles strikethrough decoration for selected text--#### Scenario: Text alignment submenu-- **WHEN** user clicks Text → Align → Left/Center/Right-- **THEN** system aligns selected text horizontally--### Requirement: Arrange menu--The system SHALL provide Arrange menu with z-order controls.--#### Scenario: Bring to front-- **WHEN** user clicks Arrange → Bring to front or presses ]-- **THEN** system moves selected node to top of parent's children--#### Scenario: Send to back-- **WHEN** user clicks Arrange → Send to back or presses [-- **THEN** system moves selected node to bottom of parent's children--#### Scenario: Bring forward-- **WHEN** user clicks Arrange → Bring forward-- **THEN** system moves selected node up one position--#### Scenario: Send backward-- **WHEN** user clicks Arrange → Send backward-- **THEN** system moves selected node down one position--### Requirement: Keyboard shortcut display--The system SHALL display keyboard shortcuts next to menu items.--#### Scenario: Platform-specific modifier-- **WHEN** app runs on Mac-- **THEN** system displays ⌘ for Command key--#### Scenario: Windows/Linux modifiers-- **WHEN** app runs on Windows or Linux-- **THEN** system displays Ctrl+ for Control key--### Requirement: reka-ui integration--The system SHALL use reka-ui Menubar components for menu implementation.--#### Scenario: Menu structure-- **WHEN** component renders-- **THEN** system uses MenubarRoot, MenubarMenu, MenubarTrigger, MenubarContent, MenubarItem--#### Scenario: Submenus-- **WHEN** menu has nested items (e.g., Text → Align)-- **THEN** system uses MenubarSub, MenubarSubTrigger, MenubarSubContent--#### Scenario: Separators-- **WHEN** menu defines separator: true-- **THEN** system renders MenubarSeparator divider--### Requirement: Action binding--The system SHALL bind menu actions to editor store methods.--#### Scenario: Calling store actions-- **WHEN** user selects menu item-- **THEN** system invokes corresponding method on useEditorStore (e.g., `store.saveFigFile()`, `store.duplicateSelected()`)--### Requirement: Dynamic disabled state--The system SHALL disable menu items based on current editor state.--#### Scenario: Export requires selection-- **WHEN** no nodes are selected-- **THEN** system disables "Export selection…" item--#### Scenario: Text menu requires text selection-- **WHEN** selected node is not TEXT-- **THEN** system may disable text formatting items (if implemented)diff --git a/openspec/changes/archive/2026-03-01-sync-specs-docs-with-master/specs/autosave/spec.md b/openspec/changes/archive/2026-03-01-sync-specs-docs-with-master/specs/autosave/spec.mddeleted file mode 100644index 5cb52e65c..000000000--- a/openspec/changes/archive/2026-03-01-sync-specs-docs-with-master/specs/autosave/spec.md+++ /dev/null@@ -1,117 +0,0 @@-## ADDED Requirements--### Requirement: Automatic file saving with debounce--The system SHALL automatically save the current document 3 seconds after the last scene change.--#### Scenario: Triggering autosave-- **WHEN** user modifies scene graph (e.g., moves node, changes fill)-- **THEN** system starts 3-second timer--#### Scenario: Debouncing saves-- **WHEN** user makes multiple changes within 3 seconds-- **THEN** system resets timer on each change, saving only after 3 seconds of inactivity--#### Scenario: Writing file-- **WHEN** autosave timer expires-- **THEN** system calls `writeFile(buildFigFile())` to persist document--### Requirement: Watch sceneVersion for changes--The system SHALL monitor `state.sceneVersion` to detect modifications.--#### Scenario: Detecting changes-- **WHEN** `state.sceneVersion` increments (scene graph mutation)-- **THEN** system triggers autosave timer--#### Scenario: No save on unchanged document-- **WHEN** autosave timer expires but `sceneVersion === savedVersion`-- **THEN** system skips write (no changes since last save)--### Requirement: Disable for new unsaved files--The system SHALL not autosave documents without a file handle.--#### Scenario: New untitled document-- **WHEN** document has no associated file path or handle-- **THEN** system skips autosave (user must explicitly Save As)--#### Scenario: After Save As-- **WHEN** user performs Save As and sets file handle-- **THEN** system enables autosave for future changes--### Requirement: Use VueUse debounce--The system SHALL use `useDebounceFn` from VueUse for debouncing logic.--#### Scenario: Debounce implementation-- **WHEN** system sets up autosave watcher-- **THEN** system wraps save logic with `useDebounceFn(fn, 3000)`--### Requirement: Cross-platform file writing--The system SHALL support both Tauri and browser File System Access API.--#### Scenario: Tauri file write-- **WHEN** running in Tauri desktop app-- **THEN** system uses Tauri fs plugin to write file--#### Scenario: Browser file write-- **WHEN** running in browser with File System Access support-- **THEN** system uses FileHandle.createWritable() to write--#### Scenario: Fallback for unsupported browsers-- **WHEN** browser lacks File System Access API-- **THEN** system disables autosave (manual save only)--### Requirement: Silent failure handling--The system SHALL silently handle autosave errors without interrupting user.--#### Scenario: Write failure-- **WHEN** autosave encounters file write error (permissions, disk full)-- **THEN** system logs error silently without showing error dialog--#### Scenario: User can still manual save-- **WHEN** autosave fails-- **THEN** user can still manually trigger Save (⌘S) to retry--### Requirement: Update savedVersion after successful write--The system SHALL track last saved version to avoid redundant writes.--#### Scenario: Recording save-- **WHEN** autosave successfully writes file-- **THEN** system sets `savedVersion = state.sceneVersion`--#### Scenario: No duplicate saves-- **WHEN** autosave timer expires but versions match-- **THEN** system skips write operation--### Requirement: Configurable delay--The system SHALL use a constant `AUTOSAVE_DELAY = 3000` (3 seconds).--#### Scenario: Delay constant-- **WHEN** system sets up autosave-- **THEN** debounce delay is 3000ms (configurable via constant)--### Requirement: Cleanup on unmount--The system SHALL cancel pending autosave timers when editor unmounts.--#### Scenario: Component cleanup-- **WHEN** editor component unmounts or file closes-- **THEN** system clears timeout to prevent orphaned saves--### Requirement: Integration with editor store--The system SHALL integrate autosave into `useEditorStore` reactive state.--#### Scenario: Reactive watcher-- **WHEN** editor store initializes-- **THEN** system sets up `watch(() => state.sceneVersion, ...)` to trigger autosave--#### Scenario: Manual save updates savedVersion-- **WHEN** user manually saves (⌘S or Save As)-- **THEN** system updates `savedVersion` to prevent immediate autosavediff --git a/openspec/changes/archive/2026-03-01-sync-specs-docs-with-master/specs/cli/spec.md b/openspec/changes/archive/2026-03-01-sync-specs-docs-with-master/specs/cli/spec.mddeleted file mode 100644index fdbca3f62..000000000--- a/openspec/changes/archive/2026-03-01-sync-specs-docs-with-master/specs/cli/spec.md+++ /dev/null@@ -1,69 +0,0 @@-## ADDED Requirements--### Requirement: Eval command for headless scripting--The CLI SHALL provide `open-pencil eval <file>` command for executing JavaScript against .fig files with a Figma-compatible `figma` global object.--#### Scenario: Inline code execution-- **WHEN** `bun open-pencil eval design.fig --code 'return figma.currentPage.children.length'` is run-- **THEN** system loads design.fig, executes code, and prints result--#### Scenario: Reading code from stdin-- **WHEN** `cat script.js | bun open-pencil eval design.fig --stdin` is run-- **THEN** system reads script from stdin and executes--#### Scenario: Writing changes back-- **WHEN** `bun open-pencil eval design.fig --code 'frame.name = "Updated"' --write` is run-- **THEN** system modifies design.fig in-place after execution--#### Scenario: Writing to output file-- **WHEN** `bun open-pencil eval design.fig --code '...' -o modified.fig` is run-- **THEN** system writes modified document to modified.fig--#### Scenario: JSON output-- **WHEN** `bun open-pencil eval design.fig --code '...' --json` is run-- **THEN** system formats result as JSON--#### Scenario: Figma API access-- **WHEN** eval code accesses `figma.createFrame()`, `figma.currentPage.findAll()`, etc.-- **THEN** system provides FigmaAPI instance bound to loaded document--#### Scenario: Error handling-- **WHEN** eval code throws error-- **THEN** system prints error message and stack trace to stderr--## MODIFIED Requirements--### Requirement: CLI commands--The CLI SHALL support the following commands:-- `open-pencil info <file>` — document stats, node type counts, font list-- `open-pencil tree <file>` — visual node tree with formatted output-- `open-pencil find <file>` — search nodes by name or type-- `open-pencil export <file>` — render to PNG/JPG/WEBP at any scale-- `open-pencil analyze colors <file>` — color palette usage with clustering-- `open-pencil analyze typography <file>` — font/size/weight distribution-- `open-pencil analyze spacing <file>` — gap/padding values with grid alignment check-- `open-pencil analyze clusters <file>` — repeated patterns (potential components)-- `open-pencil node <file> <id>` — detailed properties of a specific node-- `open-pencil pages <file>` — list pages with node counts-- `open-pencil variables <file>` — list design variables and collections-- **`open-pencil eval <file>` — execute JavaScript with Figma Plugin API (NEW)**--All commands SHALL support `--json` for machine-readable output.--#### Scenario: Info command-- **WHEN** `bun open-pencil info design.fig` is run-- **THEN** document stats, node type counts, and font list are printed--#### Scenario: Export command-- **WHEN** `bun open-pencil export design.fig --format png --scale 2` is run-- **THEN** the document is rendered headlessly and exported as 2× PNG--#### Scenario: JSON output-- **WHEN** `bun open-pencil tree design.fig --json` is run-- **THEN** the node tree is output as JSON--#### Scenario: Eval command-- **WHEN** `bun open-pencil eval design.fig --code 'return figma.currentPage.children.length'` is run-- **THEN** system executes JavaScript with `figma` global and prints resultdiff --git a/openspec/changes/archive/2026-03-01-sync-specs-docs-with-master/specs/eval-command/spec.md b/openspec/changes/archive/2026-03-01-sync-specs-docs-with-master/specs/eval-command/spec.mddeleted file mode 100644index d595ec6b0..000000000--- a/openspec/changes/archive/2026-03-01-sync-specs-docs-with-master/specs/eval-command/spec.md+++ /dev/null@@ -1,141 +0,0 @@-## ADDED Requirements--### Requirement: Execute JavaScript against .fig files--The system SHALL provide `bun open-pencil eval <file> --code '<js>'` command for headless JavaScript execution.--#### Scenario: Running inline code-- **WHEN** user runs `bun open-pencil eval design.fig --code 'return figma.currentPage.children.length'`-- **THEN** system loads design.fig, executes code with `figma` global, prints result to stdout--#### Scenario: Returning JSON-- **WHEN** user runs `bun open-pencil eval design.fig --code 'return { id: figma.currentPage.id }'`-- **THEN** system serializes result as JSON and prints--#### Scenario: Code with no return-- **WHEN** user runs code that doesn't return a value-- **THEN** system prints `undefined`--### Requirement: Read code from stdin--The system SHALL support `--stdin` flag for reading multiline scripts.--#### Scenario: Piping script file-- **WHEN** user runs `cat script.js | bun open-pencil eval design.fig --stdin`-- **THEN** system reads script from stdin and executes--#### Scenario: Heredoc input-- **WHEN** user runs eval with heredoc `<<EOF` and multiline script-- **THEN** system reads until EOF and executes--### Requirement: Write changes back to file--The system SHALL support `--write` and `-o` flags for persisting modifications.--#### Scenario: Writing changes in-place-- **WHEN** user runs `bun open-pencil eval design.fig --code 'frame.name = "Updated"' --write`-- **THEN** system modifies design.fig in-place after execution--#### Scenario: Writing to output file-- **WHEN** user runs `bun open-pencil eval design.fig --code '...' -o modified.fig`-- **THEN** system writes modified scene graph to modified.fig, leaving original unchanged--#### Scenario: Read-only by default-- **WHEN** user runs eval without --write or -o-- **THEN** system does not modify the input file--### Requirement: Figma global object available--The system SHALL provide a `figma` global object matching Figma's Plugin API surface.--#### Scenario: Accessing figma object-- **WHEN** code accesses `figma.currentPage`, `figma.root`, `figma.createFrame()`-- **THEN** system provides FigmaAPI instance bound to loaded document--#### Scenario: Creating nodes-- **WHEN** code calls `figma.createFrame()`, `figma.createRectangle()`, etc.-- **THEN** system creates nodes in scene graph--#### Scenario: Querying nodes-- **WHEN** code calls `figma.currentPage.findAll(n => n.type === "FRAME")`-- **THEN** system traverses scene graph and returns matching nodes--### Requirement: Document loading and unloading--The system SHALL load .fig files before execution and manage cleanup.--#### Scenario: Loading document-- **WHEN** eval command starts-- **THEN** system deserializes .fig file into SceneGraph--#### Scenario: Invalid file-- **WHEN** user provides non-existent or corrupted .fig file-- **THEN** system exits with error message--### Requirement: Error handling--The system SHALL report JavaScript execution errors with stack traces.--#### Scenario: Runtime error-- **WHEN** code throws an exception (e.g., accessing property on undefined)-- **THEN** system prints error message and stack trace to stderr--#### Scenario: Syntax error-- **WHEN** code has invalid JavaScript syntax-- **THEN** system reports syntax error before execution--### Requirement: Structured output option--The system SHALL support `--json` flag for machine-readable output.--#### Scenario: JSON output-- **WHEN** user runs `bun open-pencil eval design.fig --code '...' --json`-- **THEN** system formats result as JSON (even if code doesn't return object)--#### Scenario: JSON with errors-- **WHEN** execution fails with --json flag-- **THEN** system outputs `{ "error": "message", "stack": "..." }` as JSON--### Requirement: Integration with AI tools--The system SHALL enable AI-driven design automation via eval execution.--#### Scenario: AI tool calls eval-- **WHEN** AI tool invokes eval command with generated code-- **THEN** system executes code and returns result for AI to process--#### Scenario: Batch operations-- **WHEN** AI generates loop over nodes (e.g., rename all buttons)-- **THEN** system executes batch modifications efficiently--### Requirement: Console output support--The system SHALL allow `console.log()` for debugging.--#### Scenario: Logging during execution-- **WHEN** code calls `console.log("Debug:", value)`-- **THEN** system prints to stdout before final result--### Requirement: Access to Bun APIs--The system SHALL allow code to use Bun runtime APIs.--#### Scenario: File I/O from eval code-- **WHEN** code uses `Bun.file()`, `Bun.write()`, etc.-- **THEN** system allows file operations (headless scripting context)--#### Scenario: Fetch from eval code-- **WHEN** code uses `fetch()` to call external API-- **THEN** system executes network request--### Requirement: CLI integration--The system SHALL integrate eval command into `@open-pencil/cli` package.--#### Scenario: Command registration-- **WHEN** CLI loads commands-- **THEN** eval command appears in `bun open-pencil --help`--#### Scenario: Command structure-- **WHEN** user runs `bun open-pencil eval --help`-- **THEN** system displays usage, flags (--code, --stdin, --write, -o, --json), and examplesdiff --git a/openspec/changes/archive/2026-03-01-sync-specs-docs-with-master/specs/figma-plugin-api/spec.md b/openspec/changes/archive/2026-03-01-sync-specs-docs-with-master/specs/figma-plugin-api/spec.mddeleted file mode 100644index f08812be4..000000000--- a/openspec/changes/archive/2026-03-01-sync-specs-docs-with-master/specs/figma-plugin-api/spec.md+++ /dev/null@@ -1,325 +0,0 @@-## ADDED Requirements--### Requirement: Figma-compatible global object--The system SHALL provide a `figma` global object that mirrors Figma's Plugin API surface for headless JavaScript execution.--#### Scenario: Creating figma object-- **WHEN** `new FigmaAPI(sceneGraph)` is instantiated-- **THEN** the object provides methods matching Figma's plugin API (createFrame, createRectangle, createText, etc.)--#### Scenario: Accessing current page-- **WHEN** user accesses `figma.currentPage`-- **THEN** system returns a proxy for the active page with methods like `findAll`, `findOne`, `appendChild`--#### Scenario: Accessing document root-- **WHEN** user accesses `figma.root`-- **THEN** system returns a proxy for the document root containing all pages--### Requirement: Node creation methods--The system SHALL provide creation methods for all supported node types.--#### Scenario: Creating a frame-- **WHEN** user calls `figma.createFrame()`-- **THEN** system creates a FRAME node, adds it to current page, and returns a proxy--#### Scenario: Creating a rectangle-- **WHEN** user calls `figma.createRectangle()`-- **THEN** system creates a RECTANGLE node with default fill--#### Scenario: Creating text-- **WHEN** user calls `figma.createText()`-- **THEN** system creates a TEXT node with default font (Inter Regular 14px)--#### Scenario: Creating other shapes-- **WHEN** user calls `figma.createEllipse()`, `figma.createLine()`, `figma.createPolygon()`, `figma.createStar()`, `figma.createVector()`-- **THEN** system creates corresponding node types--#### Scenario: Creating component-- **WHEN** user calls `figma.createComponent()`-- **THEN** system creates a COMPONENT node--#### Scenario: Creating component set-- **WHEN** user calls `figma.createComponentSet()`-- **THEN** system creates a COMPONENT_SET node--### Requirement: Node proxy with property access--The system SHALL wrap SceneNode objects in proxies that provide Figma-compatible property getters and setters.--#### Scenario: Reading node properties-- **WHEN** user accesses `node.id`, `node.type`, `node.name`, `node.x`, `node.y`, `node.width`, `node.height`-- **THEN** system returns current values from the underlying SceneNode--#### Scenario: Setting node properties-- **WHEN** user sets `node.name = "New Name"` or `node.x = 100`-- **THEN** system updates the SceneNode via SceneGraph.updateNode()--#### Scenario: Reading removed nodes-- **WHEN** user accesses a property on a removed node-- **THEN** system throws "Node <id> has been removed"--### Requirement: Geometry and transforms--The system SHALL provide geometry properties matching Figma's API.--#### Scenario: Basic dimensions-- **WHEN** user accesses `node.width`, `node.height`, `node.rotation`-- **THEN** system returns dimensions and rotation from SceneNode--#### Scenario: Absolute position-- **WHEN** user accesses `node.absoluteTransform`-- **THEN** system returns 2x3 matrix `[[a, b, tx], [c, d, ty]]`--#### Scenario: Absolute bounding box-- **WHEN** user accesses `node.absoluteBoundingBox` or `node.absoluteRenderBounds`-- **THEN** system returns `{x, y, width, height}` in absolute coordinates--#### Scenario: Resizing nodes-- **WHEN** user calls `node.resize(200, 100)`-- **THEN** system updates node width and height--### Requirement: Fill, stroke, and effects--The system SHALL provide Figma-compatible paint and effect properties.--#### Scenario: Reading fills-- **WHEN** user accesses `node.fills`-- **THEN** system returns frozen array of Fill objects--#### Scenario: Setting fills-- **WHEN** user sets `node.fills = [{ type: "SOLID", color: { r: 1, g: 0, b: 0 } }]`-- **THEN** system updates node fills--#### Scenario: Reading strokes-- **WHEN** user accesses `node.strokes`, `node.strokeWeight`, `node.strokeAlign`-- **THEN** system returns stroke configuration--#### Scenario: Reading effects-- **WHEN** user accesses `node.effects`-- **THEN** system returns frozen array of Effect objects--### Requirement: Text node properties--The system SHALL provide text-specific properties for TEXT nodes.--#### Scenario: Reading text content-- **WHEN** user accesses `textNode.characters`-- **THEN** system returns text content string--#### Scenario: Setting text content-- **WHEN** user sets `textNode.characters = "Hello"`-- **THEN** system updates text content--#### Scenario: Font properties-- **WHEN** user accesses `textNode.fontName`, `textNode.fontSize`, `textNode.fontWeight`-- **THEN** system returns font configuration--#### Scenario: Setting font-- **WHEN** user sets `textNode.fontName = { family: "Inter", style: "Bold" }`-- **THEN** system converts style to weight (700) and updates font--#### Scenario: Text alignment-- **WHEN** user accesses `textNode.textAlignHorizontal`-- **THEN** system returns "LEFT", "CENTER", or "RIGHT"--### Requirement: Auto-layout properties--The system SHALL provide auto-layout (flexbox) properties for frames.--#### Scenario: Reading layout mode-- **WHEN** user accesses `frame.layoutMode`-- **THEN** system returns "NONE", "HORIZONTAL", or "VERTICAL"--#### Scenario: Setting layout mode-- **WHEN** user sets `frame.layoutMode = "VERTICAL"`-- **THEN** system enables auto-layout with vertical direction--#### Scenario: Spacing and padding-- **WHEN** user accesses `frame.itemSpacing`, `frame.paddingLeft`, `frame.paddingTop`, etc.-- **THEN** system returns spacing values--#### Scenario: Layout sizing-- **WHEN** user accesses `node.layoutSizingHorizontal`, `node.layoutSizingVertical`-- **THEN** system returns "FIXED", "HUG", or "FILL"--### Requirement: Tree operations--The system SHALL provide methods for manipulating the scene graph tree.--#### Scenario: Appending child-- **WHEN** user calls `parent.appendChild(child)`-- **THEN** system reparents child to parent--#### Scenario: Inserting child-- **WHEN** user calls `parent.insertChild(2, child)`-- **THEN** system inserts child at index 2 in parent's children--#### Scenario: Accessing children-- **WHEN** user accesses `parent.children`-- **THEN** system returns frozen array of child proxies--#### Scenario: Accessing parent-- **WHEN** user accesses `node.parent`-- **THEN** system returns parent proxy or null for root--#### Scenario: Removing node-- **WHEN** user calls `node.remove()`-- **THEN** system deletes node from scene graph--### Requirement: Traversal and queries--The system SHALL provide methods for finding nodes in the scene graph.--#### Scenario: Finding all matching nodes-- **WHEN** user calls `figma.currentPage.findAll(n => n.type === "FRAME")`-- **THEN** system returns array of proxies for all frames in the page--#### Scenario: Finding first matching node-- **WHEN** user calls `figma.currentPage.findOne(n => n.name === "Button")`-- **THEN** system returns first matching proxy or null--#### Scenario: Finding by ID-- **WHEN** user calls `figma.getNodeById("node-123")`-- **THEN** system returns proxy for that node or null--#### Scenario: Finding with criteria object-- **WHEN** user calls `figma.currentPage.findAllWithCriteria({ types: ["FRAME", "GROUP"] })`-- **THEN** system returns array of proxies matching type criteria--### Requirement: Selection management--The system SHALL track and expose current selection.--#### Scenario: Reading selection-- **WHEN** user accesses `figma.currentPage.selection`-- **THEN** system returns array of selected node proxies--#### Scenario: Setting selection-- **WHEN** user sets `figma.currentPage.selection = [node1, node2]`-- **THEN** system updates editor selection state--### Requirement: Component operations--The system SHALL provide component and instance methods.--#### Scenario: Creating component from node-- **WHEN** user calls `figma.createComponentFromNode(frame)`-- **THEN** system converts frame to COMPONENT and returns proxy--#### Scenario: Creating instance-- **WHEN** user calls `component.createInstance()`-- **THEN** system creates INSTANCE referencing the component--#### Scenario: Swapping instance-- **WHEN** user calls `instance.swapComponent(otherComponent)`-- **THEN** system updates instance's mainComponent reference--### Requirement: Grouping operations--The system SHALL provide grouping methods.--#### Scenario: Grouping nodes-- **WHEN** user calls `figma.group([node1, node2], parent)`-- **THEN** system creates a GROUP containing the nodes--#### Scenario: Ungrouping-- **WHEN** user calls `figma.ungroup(group)`-- **THEN** system removes group and reparents children to group's parent--### Requirement: Corner radius handling--The system SHALL handle both uniform and independent corner radii matching Figma's API.--#### Scenario: Uniform corner radius-- **WHEN** user accesses `rectangle.cornerRadius` and all corners have same radius-- **THEN** system returns that radius value--#### Scenario: Mixed corner radius-- **WHEN** user accesses `rectangle.cornerRadius` and corners have different radii-- **THEN** system returns the MIXED symbol--#### Scenario: Individual corners-- **WHEN** user accesses `rectangle.topLeftRadius`, `rectangle.topRightRadius`, etc.-- **THEN** system returns individual corner radius values--### Requirement: Cloning nodes--The system SHALL support deep cloning of nodes.--#### Scenario: Cloning a node-- **WHEN** user calls `node.clone()`-- **THEN** system creates a deep copy with new GUID and returns proxy--#### Scenario: Cloning with children-- **WHEN** user calls `frame.clone()` on a frame with children-- **THEN** system recursively clones children--### Requirement: JSON serialization--The system SHALL provide JSON export for AI tools and debugging.--#### Scenario: Exporting node to JSON-- **WHEN** user calls `figma.toJSON(node)`-- **THEN** system returns object with `type`, `name`, `id`, geometry, fills, strokes, and recursive children--#### Scenario: Exporting with depth limit-- **WHEN** user calls `figma.toJSON(node, { maxDepth: 2 })`-- **THEN** system includes children only 2 levels deep--### Requirement: Frozen arrays for safety--The system SHALL return frozen arrays for multi-value properties to prevent accidental mutation.--#### Scenario: Fills array is frozen-- **WHEN** user accesses `node.fills` and tries `fills.push(...)`-- **THEN** system throws error (array is frozen)--#### Scenario: Children array is frozen-- **WHEN** user accesses `parent.children` and tries `children[0] = other`-- **THEN** system throws error (array is frozen)--### Requirement: Internal symbols hidden--The system SHALL hide internal implementation details using Symbol properties.--#### Scenario: Internals not enumerable-- **WHEN** user calls `Object.keys(nodeProxy)` or `for (let k in nodeProxy)`-- **THEN** system does not expose INTERNAL_ID, INTERNAL_GRAPH, INTERNAL_API--### Requirement: Variable support--The system SHALL provide access to design variables.--#### Scenario: Listing variables-- **WHEN** user calls `figma.variables.getLocalVariables()`-- **THEN** system returns array of Variable objects--#### Scenario: Listing variable collections-- **WHEN** user calls `figma.variables.getLocalVariableCollections()`-- **THEN** system returns array of VariableCollection objects--#### Scenario: Getting variable by ID-- **WHEN** user calls `figma.variables.getVariableById("var-123")`-- **THEN** system returns Variable object or undefined--### Requirement: Type guards--The system SHALL provide type-checking methods matching Figma's API.--#### Scenario: Checking node type-- **WHEN** user checks `if (node.type === "FRAME")`-- **THEN** system allows type-based branching--### Requirement: Stub methods for unimplemented features--The system SHALL provide stub methods for Figma API methods not yet implemented, throwing descriptive errors.--#### Scenario: Calling unimplemented method-- **WHEN** user calls `figma.createImage(data)` or `figma.createShapeWithText()`-- **THEN** system throws "Not implemented: <method>"--#### Scenario: Notifying user-- **WHEN** user calls `figma.notify("Hello")`-- **THEN** system logs to console (headless mode has no UI notifications)diff --git a/openspec/changes/archive/2026-03-01-sync-specs-docs-with-master/specs/testing/spec.md b/openspec/changes/archive/2026-03-01-sync-specs-docs-with-master/specs/testing/spec.mddeleted file mode 100644index 3014f3b48..000000000--- a/openspec/changes/archive/2026-03-01-sync-specs-docs-with-master/specs/testing/spec.md+++ /dev/null@@ -1,177 +0,0 @@-## ADDED Requirements--### Requirement: FigmaAPI unit tests--The project SHALL provide comprehensive unit tests for the Figma Plugin API in `tests/engine/figma-api.test.ts`.--#### Scenario: Node creation tests-- **WHEN** `bun test tests/engine/figma-api.test.ts` runs-- **THEN** tests verify `createFrame()`, `createRectangle()`, `createText()`, and other creation methods--#### Scenario: Property access tests-- **WHEN** tests read node properties (x, y, width, height, name, fills, strokes)-- **THEN** all getters return correct values from SceneNode--#### Scenario: Property setting tests-- **WHEN** tests set node properties (`node.name = "Test"`, `node.x = 100`)-- **THEN** SceneGraph is updated correctly--#### Scenario: Text property tests-- **WHEN** tests access `textNode.characters`, `fontSize`, `fontName`-- **THEN** text-specific properties work correctly--#### Scenario: Auto-layout tests-- **WHEN** tests set `layoutMode = "VERTICAL"`, `itemSpacing`, `paddingLeft`-- **THEN** auto-layout properties are applied--#### Scenario: Tree operation tests-- **WHEN** tests call `appendChild()`, `insertChild()`, `remove()`-- **THEN** scene graph tree is modified correctly--#### Scenario: Traversal tests-- **WHEN** tests call `findAll()`, `findOne()`, `findAllWithCriteria()`-- **THEN** correct nodes are returned--#### Scenario: Component tests-- **WHEN** tests create components and instances-- **THEN** component-instance relationships work--#### Scenario: Serialization tests-- **WHEN** tests call `figma.toJSON(node)`-- **THEN** JSON output includes all required properties--#### Scenario: Frozen array tests-- **WHEN** tests access `fills`, `strokes`, `children` and try to mutate-- **THEN** arrays are frozen and throw errors on mutation attempts--#### Scenario: 924 LOC of tests-- **WHEN** FigmaAPI test file is counted-- **THEN** it contains 924 lines covering 60+ test cases--### Requirement: Eval CLI integration tests--The project SHALL provide integration tests for eval command in `tests/engine/eval-cli.test.ts`.--#### Scenario: Inline code execution test-- **WHEN** test runs eval with `--code 'return figma.currentPage.id'`-- **THEN** output matches expected page ID--#### Scenario: Node creation test-- **WHEN** test runs eval creating a frame-- **THEN** document is modified and frame exists--#### Scenario: Write flag test-- **WHEN** test runs eval with `--write`-- **THEN** file is modified in-place--#### Scenario: Output file test-- **WHEN** test runs eval with `-o output.fig`-- **THEN** new file is created with modifications--#### Scenario: JSON output test-- **WHEN** test runs eval with `--json`-- **THEN** result is formatted as JSON--#### Scenario: Error handling test-- **WHEN** eval code throws error-- **THEN** stderr contains error message--#### Scenario: 202 LOC of integration tests-- **WHEN** eval CLI test file is counted-- **THEN** it contains 202 lines covering 17 integration scenarios--### Requirement: Tool schema unit tests--The project SHALL provide unit tests for unified tool definitions in `tests/engine/tools.test.ts`.--#### Scenario: Schema structure tests-- **WHEN** tests validate tool schemas-- **THEN** each tool has name, description, parameters, and handler--#### Scenario: Tool handler tests-- **WHEN** tests invoke tool handlers with valid params-- **THEN** handlers return expected results--#### Scenario: Parameter validation tests-- **WHEN** tests call handlers with invalid params-- **THEN** errors are raised or handled gracefully--#### Scenario: 390 LOC of tool tests-- **WHEN** tools test file is counted-- **THEN** it contains 390 lines--### Requirement: Tool adapter tests--The project SHALL provide adapter tests in `tests/engine/tools-ai-adapter.test.ts` (190 LOC) and `tests/engine/tools-cli.test.ts` (219 LOC).--#### Scenario: AI adapter format test-- **WHEN** AI adapter converts schema to LLM format-- **THEN** output matches expected structure--#### Scenario: CLI adapter test-- **WHEN** CLI commands use tool schema-- **THEN** parameters map correctly--### Requirement: App menu integration tests--The project SHALL provide integration tests for app menu in `tests/e2e/app-menu.spec.ts`.--#### Scenario: File menu test-- **WHEN** test clicks File menu items-- **THEN** actions (Open, Save, Export) are triggered--#### Scenario: Edit menu test-- **WHEN** test uses Edit menu (Undo, Redo, Copy, Paste)-- **THEN** operations execute correctly--#### Scenario: View menu test-- **WHEN** test uses View → Zoom in/out-- **THEN** viewport zoom changes--#### Scenario: Object menu test-- **WHEN** test uses Object → Group/Ungroup-- **THEN** nodes are grouped/ungrouped--#### Scenario: Text menu test-- **WHEN** test uses Text → Bold/Italic-- **THEN** text styles are applied--#### Scenario: Arrange menu test-- **WHEN** test uses Arrange → Bring to front-- **THEN** z-order changes--#### Scenario: 131 LOC of app menu tests-- **WHEN** app menu test file is counted-- **THEN** it contains 131 lines--### Requirement: Autosave integration tests--The project SHALL provide integration tests for autosave in `tests/e2e/autosave.spec.ts`.--#### Scenario: Autosave trigger test-- **WHEN** test modifies scene graph-- **THEN** autosave timer starts--#### Scenario: Debounce test-- **WHEN** test makes rapid changes-- **THEN** only one save occurs after 3 seconds--#### Scenario: Write test-- **WHEN** autosave timer expires-- **THEN** file is written--#### Scenario: Skip unchanged test-- **WHEN** sceneVersion matches savedVersion-- **THEN** write is skipped--#### Scenario: 113 LOC of autosave tests-- **WHEN** autosave test file is counted-- **THEN** it contains 113 lines--### Requirement: Test coverage expansion--The test suite SHALL expand from original coverage to include 2571 LOC of new tests across 7 files (figma-api.test.ts, eval-cli.test.ts, tools.test.ts, tools-ai-adapter.test.ts, tools-cli.test.ts, app-menu.spec.ts, autosave.spec.ts).--#### Scenario: Total new test lines-- **WHEN** new test files are counted-- **THEN** 2571 lines of tests are addeddiff --git a/openspec/changes/archive/2026-03-01-sync-specs-docs-with-master/specs/tooling/spec.md b/openspec/changes/archive/2026-03-01-sync-specs-docs-with-master/specs/tooling/spec.mddeleted file mode 100644index 3d8e76824..000000000--- a/openspec/changes/archive/2026-03-01-sync-specs-docs-with-master/specs/tooling/spec.md+++ /dev/null@@ -1,89 +0,0 @@-## ADDED Requirements--### Requirement: Unified tool definitions--The project SHALL define design tools once in `packages/core/src/tools/` and adapt them for AI, CLI, and MCP contexts.--#### Scenario: Canonical tool schema-- **WHEN** a new tool is added-- **THEN** it is defined in `packages/core/src/tools/schema.ts` as the single source of truth--#### Scenario: AI adapter-- **WHEN** AI assistant needs tool definitions-- **THEN** `packages/core/src/tools/ai-adapter.ts` converts schema to LLM-compatible format--#### Scenario: CLI adapter-- **WHEN** CLI commands use tools-- **THEN** citty commands consume tool schema directly--#### Scenario: MCP adapter (future)-- **WHEN** MCP server integration is added-- **THEN** MCP protocol adapter converts tool schema to MCP format--### Requirement: Tool schema structure--Tool schemas SHALL be defined in `packages/core/src/tools/schema.ts` with name, description, parameters (with types and descriptions), and handler function.--#### Scenario: Tool definition format-- **WHEN** defining a tool in schema.ts-- **THEN** structure includes `{ name, description, parameters: { <param>: { type, description } }, handler: (params) => result }`--#### Scenario: Type-safe parameters-- **WHEN** tool is invoked-- **THEN** parameters are validated against schema types--### Requirement: Deduplication of AI tools--The project SHALL eliminate duplication in `src/ai/tools.ts` by using `FigmaAPI.toJSON()` for node serialization and shared color parsing from `packages/core/src`.--#### Scenario: Node serialization-- **WHEN** AI tool returns node data-- **THEN** it uses `figmaAPI.toJSON(node)` instead of custom JSON builders--#### Scenario: Color parsing-- **WHEN** AI tool parses color input-- **THEN** it uses `parseColor()` from core instead of inline regex--#### Scenario: Code reduction-- **WHEN** AI tools are refactored-- **THEN** 311 lines are removed from `src/ai/tools.ts` via deduplication--### Requirement: Shared tool testing--The project SHALL provide test suites for tools in `tests/engine/tools.test.ts`, `tests/engine/tools-ai-adapter.test.ts`, and `tests/engine/tools-cli.test.ts`.--#### Scenario: Tool schema tests-- **WHEN** `tests/engine/tools.test.ts` runs-- **THEN** each tool schema is validated for structure and handler execution--#### Scenario: AI adapter tests-- **WHEN** `tests/engine/tools-ai-adapter.test.ts` runs-- **THEN** AI tool format conversion is verified--#### Scenario: CLI adapter tests-- **WHEN** `tests/engine/tools-cli.test.ts` runs-- **THEN** CLI command integration with tool schema is verified--### Requirement: Tool handler execution--Tool handlers SHALL receive parameters as plain objects and return structured results (success/error, data).--#### Scenario: Successful tool execution-- **WHEN** tool handler is invoked with valid params-- **THEN** it returns `{ success: true, data: <result> }`--#### Scenario: Tool execution error-- **WHEN** tool handler encounters error-- **THEN** it returns `{ success: false, error: "message" }`--### Requirement: Tool documentation--Each tool in schema.ts SHALL have clear description and parameter documentation for AI/human comprehension.--#### Scenario: Tool description-- **WHEN** AI queries available tools-- **THEN** description explains what the tool does (e.g., "Create a rectangle with specified dimensions and position")--#### Scenario: Parameter descriptions-- **WHEN** AI reads parameter schema-- **THEN** each parameter has type and description (e.g., `width: { type: 'number', description: 'Rectangle width in pixels' }`)diff --git a/openspec/changes/archive/2026-03-01-sync-specs-docs-with-master/specs/vitepress-docs/spec.md b/openspec/changes/archive/2026-03-01-sync-specs-docs-with-master/specs/vitepress-docs/spec.mddeleted file mode 100644index 3c797cfef..000000000--- a/openspec/changes/archive/2026-03-01-sync-specs-docs-with-master/specs/vitepress-docs/spec.md+++ /dev/null@@ -1,93 +0,0 @@-## ADDED Requirements--### Requirement: Eval command documentation--The docs site SHALL include comprehensive documentation for the eval command in `docs/eval-command.md`.--#### Scenario: Eval command page exists-- **WHEN** user navigates to `/eval-command`-- **THEN** full documentation for `open-pencil eval` command is displayed--#### Scenario: Overview section-- **WHEN** user reads eval command docs-- **THEN** overview explains purpose (headless scripting with Figma Plugin API)--#### Scenario: Usage examples-- **WHEN** user reads eval command docs-- **THEN** code examples show `--code`, `--stdin`, `--write`, `-o`, `--json` usage--#### Scenario: Architecture section-- **WHEN** user reads eval command docs-- **THEN** architecture diagram shows CLI → loadDocument → FigmaAPI → execute → serialize flow--#### Scenario: FigmaAPI surface coverage-- **WHEN** user reads eval command docs-- **THEN** documentation lists supported methods (createFrame, createRectangle, findAll, etc.)--#### Scenario: AI integration examples-- **WHEN** user reads eval command docs-- **THEN** examples show how AI tools use eval for batch operations--#### Scenario: Testing patterns-- **WHEN** user reads eval command docs-- **THEN** examples show headless testing with eval--#### Scenario: Migration from Figma plugins-- **WHEN** user reads eval command docs-- **THEN** guide explains how to adapt Figma plugin code to eval scripts--#### Scenario: 437 lines of documentation-- **WHEN** eval-command.md is counted-- **THEN** it contains 437 lines of comprehensive content--### Requirement: Comparison matrix updates--The docs site SHALL update comparison matrices to reflect new features (app menu, eval command, Figma Plugin API).--#### Scenario: Figma comparison update-- **WHEN** user reads `docs/guide/figma-comparison.md`-- **THEN** Interface & Navigation section includes app menu status--#### Scenario: Plugin API row-- **WHEN** user reads Figma comparison-- **THEN** a row documents eval command with Figma Plugin API compatibility--#### Scenario: AI tools update-- **WHEN** user reads Figma comparison-- **THEN** AI tools row is updated to reflect unified tool definitions and eval integration--#### Scenario: Penpot comparison update-- **WHEN** user reads `docs/guide/comparison.md`-- **THEN** Architecture section highlights headless scripting advantage (eval command with Plugin API that Penpot lacks)--### Requirement: App menu documentation--The docs site SHALL document app menu in appropriate guide pages.--#### Scenario: App menu in features-- **WHEN** user reads Features page-- **THEN** app menu is listed with menus (File, Edit, View, Object, Text, Arrange) and key actions--#### Scenario: Browser mode distinction-- **WHEN** user reads app menu docs-- **THEN** clarification that menu bar only appears in browser mode (Tauri uses native menus)--### Requirement: Autosave documentation--The docs site SHALL document autosave behavior in appropriate guide pages.--#### Scenario: Autosave in features-- **WHEN** user reads Features page or Getting Started-- **THEN** autosave is explained (3-second debounce, automatic for files with handle)--#### Scenario: Autosave limitations-- **WHEN** user reads autosave docs-- **THEN** note that new unsaved files don't autosave until user performs Save As--### Requirement: AGENTS.md update reference--The docs site SHALL reference tool unification in development pages when relevant.--#### Scenario: Tool architecture mention-- **WHEN** user reads development/contributing docs-- **THEN** unified tool definitions (`packages/core/src/tools/`) are mentioned as canonical sourcediff --git a/openspec/changes/archive/2026-03-01-sync-specs-docs-with-master/tasks.md b/openspec/changes/archive/2026-03-01-sync-specs-docs-with-master/tasks.mddeleted file mode 100644index eeeb717e8..000000000--- a/openspec/changes/archive/2026-03-01-sync-specs-docs-with-master/tasks.md+++ /dev/null@@ -1,83 +0,0 @@-## Context--This change syncs OpenSpec specs and VitePress documentation with master branch commits 63748ec through 20290f6. All code is already implemented and tested (2571 LOC of new tests). Tasks focus on documentation sync, not code changes.--**References:**-- Proposal: `openspec/changes/sync-specs-docs-with-master/proposal.md` — why and what-- Design: `openspec/changes/sync-specs-docs-with-master/design.md` — how to sync (code as source of truth)-- Delta specs: `openspec/changes/sync-specs-docs-with-master/specs/` — requirements derived from implemented code--**Note:** `docs/eval-command.md` already exists (437 lines, merged from master). Tasks update cross-references and navigation, not content creation.--## 1. Create new capability specs--- [x] 1.1 Create `openspec/specs/figma-plugin-api/spec.md` by resolving delta spec (strip ADDED markers, keep requirement content verbatim)-- [x] 1.2 Create `openspec/specs/eval-command/spec.md` by resolving delta spec-- [x] 1.3 Create `openspec/specs/app-menu/spec.md` by resolving delta spec-- [x] 1.4 Create `openspec/specs/autosave/spec.md` by resolving delta spec--## 2. Update existing capability specs with delta changes--**Merge strategy:**-- **ADDED Requirements** → append to end of requirements section-- **MODIFIED Requirements** → find matching requirement by header text (whitespace-insensitive), replace entire block (from `### Requirement:` through all scenarios). If no exact match, show diff and resolve manually.-- **REMOVED Requirements** → delete requirement block, add deprecation note if needed-- Preserve existing spec structure (Purpose, other requirements)--- [x] 2.1 Merge cli delta: read `changes/.../specs/cli/spec.md`, append ADDED requirements, replace MODIFIED "CLI commands" requirement in `openspec/specs/cli/spec.md`-- [x] 2.2 Merge tooling delta: append ADDED requirements from `changes/.../specs/tooling/spec.md` to `openspec/specs/tooling/spec.md`-- [x] 2.3 Merge testing delta: append ADDED requirements from `changes/.../specs/testing/spec.md` to `openspec/specs/testing/spec.md`-- [x] 2.4 Merge vitepress-docs delta: append ADDED requirements from `changes/.../specs/vitepress-docs/spec.md` to `openspec/specs/vitepress-docs/spec.md`--## 3. Update Figma comparison matrix--**Table format:** Markdown table with columns: Feature | Status | Notes. Status uses emoji: ✅ Supported, 🟡 Partial, 🔲 Not yet.--- [x] 3.1 Add row to Interface & Navigation table: `| App menu (browser mode) | ✅ | File, Edit, View, Object, Text, Arrange menus; Tauri uses native menus |`-- [x] 3.2 Update AI tools row in Interface & Navigation: change status to 🟡, update Notes to mention "10 tools via OpenRouter + unified tool definitions + eval command integration; no AI image generation yet"-- [x] 3.3 Add new "Plugin API & Scripting" section after "Import & Export" with table row: `| Eval command with Figma Plugin API | ✅ | Headless JavaScript execution with figma global object matching Figma's plugin surface |`-- [x] 3.4 Recalculate coverage stats: 85 of 152 addressed (66 ✅, 19 🟡, 67 🔲)--## 4. Update Penpot comparison--- [x] 4.1 Add paragraph to Architecture section in `docs/guide/comparison.md` after "Verdict: Architecture" subsection: "OpenPencil's eval command with Figma Plugin API enables headless scripting and automation that Penpot lacks. Penpot has no plugin system; OpenPencil's `figma` global object mirrors Figma's API for script portability." Link to `/eval-command` for details. (Note: eval-command.md already has 437 lines of examples; link instead of duplicating)--## 5. Update Features documentation--- [x] 5.1 Add app menu entry to `docs/guide/features.md` (File, Edit, View, Object, Text, Arrange menus; browser-only note)-- [x] 5.2 Add autosave entry to `docs/guide/features.md` (3-second debounce, file handle requirement)-- [x] 5.3 Add headless scripting / eval command entry to `docs/guide/features.md` (link to eval-command.md)-- [x] 5.4 Update AI tools entry in `docs/guide/features.md` to mention unified tool definitions-- [x] 5.5 Landing page feature cards already cover eval/CLI via "Programmable" card — no changes needed--## 6. Update VitePress navigation--**Note:** New spec files (figma-plugin-api, eval-command, app-menu, autosave) are OpenSpec internal specs, not user-facing docs. Only eval-command has user docs at `docs/eval-command.md`.--- [x] 6.1 Add "Eval Command" entry to Reference sidebar in `docs/.vitepress/config.ts`: inserted after "File Format" in Reference items array-- [x] 6.2 Verify deferred to section 8--## 7. Update AGENTS.md--**Note:** AGENTS.md already correctly documents tools (`packages/core/src/tools/schema.ts`), FigmaAPI (`packages/core/src/figma-api.ts`), and eval command in "Tools (AI / MCP / CLI)" section per design.md. Only UI section needs update.--- [x] 7.1 Added AppMenu bullet to UI section in AGENTS.md--## 8. Verification--- [x] 8.1 `bun run docs:build` passed — no broken links, built in 35.95s-- [x] 8.2 eval-command.html generated in dist/-- [x] 8.2a Cross-links verified via successful build (VitePress validates internal links)-- [x] 8.3 Figma comparison: app menu row added, AI tools updated, Plugin API section added, stats recalculated (85/152)-- [x] 8.4 Penpot comparison: headless scripting paragraph added with /eval-command link-- [x] 8.5 All 4 new spec files have valid heading hierarchy (### Requirement + #### Scenario)-- [x] 8.6 All 4 merged specs: additions only (0 removed lines), existing requirements preserved-- [x] 8.7 AGENTS.md: AppMenu bullet added in correct format within UI section-- [x] 8.8 Sidebar config updated with Eval Command entry in Reference group--## 9. Archive preparation--- [x] 9.1 All tasks complete-- [x] 9.2 All artifacts present: proposal.md, design.md, specs/ (8 delta specs), tasks.md-- [x] 9.3 Delta specs merged: 4 new specs created, 4 existing specs updated (additions only)-- [ ] 9.4 Ready for `/opsx:archive`diff --git a/openspec/changes/archive/2026-03-01-sync-style-runs-jsx-cli-tests/.openspec.yaml b/openspec/changes/archive/2026-03-01-sync-style-runs-jsx-cli-tests/.openspec.yamldeleted file mode 100644index 0b4defe0e..000000000--- a/openspec/changes/archive/2026-03-01-sync-style-runs-jsx-cli-tests/.openspec.yaml+++ /dev/null@@ -1,2 +0,0 @@-schema: spec-driven-created: 2026-03-01diff --git a/openspec/changes/archive/2026-03-01-sync-style-runs-jsx-cli-tests/design.md b/openspec/changes/archive/2026-03-01-sync-style-runs-jsx-cli-tests/design.mddeleted file mode 100644index 263628489..000000000--- a/openspec/changes/archive/2026-03-01-sync-style-runs-jsx-cli-tests/design.md+++ /dev/null@@ -1,22 +0,0 @@-# Design: Sync style runs, JSX renderer, CLI expansion, tests--## Approach-Documentation-only change. Update delta-specs for affected domains, then propagate to VitePress docs and comparison matrix.--## Affected spec domains--1. **text-editing** — rich text style runs (per-selection bold/italic/underline), double/triple-click, selectLine-2. **canvas-rendering** — mixed-style text rendering with ParagraphBuilder.pushStyle/pop-3. **editor-ui** — B/I/U/S toggle buttons in TypographySection-4. **cli** — new commands: analyze (colors/typography/spacing/clusters), node, pages, variables-5. **tooling** — jscpd, kiwi deduplication, kiwi-serialize.ts, test:coverage-6. **testing** — .fig roundtrip tests, LFS fixtures, import performance fix, 27 JSX renderer tests-7. **scene-graph** — JSX renderer (TreeNode builders, renderTreeNode, renderJsx), StyleRun model--## VitePress docs updates-- features.md: add rich text formatting (⌘B/I/U), JSX renderer, expanded CLI commands, double/triple-click-- figma-comparison.md: update text editing notes (style runs, mixed formatting), mark new CLI capabilities-- roadmap.md: add new items to Phase 4/5 delivered--## Risks-- None — documentation onlydiff --git a/openspec/changes/archive/2026-03-01-sync-style-runs-jsx-cli-tests/proposal.md b/openspec/changes/archive/2026-03-01-sync-style-runs-jsx-cli-tests/proposal.mddeleted file mode 100644index 95373f972..000000000--- a/openspec/changes/archive/2026-03-01-sync-style-runs-jsx-cli-tests/proposal.md+++ /dev/null@@ -1,50 +0,0 @@-# Proposal: Sync style runs, JSX renderer, CLI expansion, tests--## Why-22 commits merged from master (33d3def..6268d8b) introduce rich text formatting, a JSX renderer for programmatic design creation, expanded CLI analysis commands, .fig roundtrip tests, and major deduplication.--## What changed--### Rich text style runs (88bfacd)-- StyleRun model: `{start, length, style}` with CharacterStyleOverride (fontWeight, italic, textDecoration)-- Renderer: ParagraphBuilder.pushStyle/pop for mixed-style text within a single text node-- ⌘B/I/U apply to selection range (toggle per-selection) or whole-node style-- B/I/U/S toggle buttons in TypographySection-- .fig roundtrip: import characterStyleIDs + styleOverrideTable from TextData, export with deduped style table--### Text editing improvements (6268d8b)-- Double-click: select word at position, Triple-click: select all-- selectLine/selectLineAt added to TextEditor--### JSX renderer in @open-pencil/core (13f562a, a32d80f)-- TreeNode builder functions (Frame, Text, Rectangle, Ellipse, etc.)-- renderTreeNode(): tree → scene graph (browser)-- renderJsx(): JSX string → esbuild → tree → scene graph (CLI/headless)-- Tailwind-like shorthand props: w/h, bg, rounded, flex, gap, p/px/py, justify, items, shadow, blur-- 27 tests covering all node types, layout props, effects, nesting--### CLI expansion (36e3f14, 7dcc582)-- analyze colors: color palette usage with clustering-- analyze typography: font/size/weight distribution-- analyze spacing: gap/padding values with grid check-- analyze clusters: repeated patterns (potential components)-- node: detailed properties by ID-- pages: list pages with node counts-- variables: list design variables and collections--### Deduplication (f92a883, e3ae61e, 20827a2, 46bb923)-- kiwi-serialize.ts: shared sceneNodeToKiwi, buildFigKiwi, parseFigKiwiChunks-- Vendored kiwi-schema removed from src/kiwi/ (re-exports from core)-- jscpd added: 15.6% → 0.62% duplication-- Shared font weight mapping, layout merge, style-runs expandRuns helper--### .fig testing (f24f6e0, ca42214, f1806f6)-- Git LFS fixtures: material3.fig (87K nodes), nuxtui.fig (314K nodes)-- O(n²) getChildren() fix: 37s → 535ms on material3-- Roundtrip tests: property invariants, encode/decode cycle-- test:coverage script-- ByteBuffer optimization: inline readVarUint, TextDecoder for strings--### AI chat design (4fb9290, af6a98c, 017b0aa, cc5dda2)-- Planning documents only (PLAN.md), no implementation-- JSX-first rendering, OpenRouter from browser, Stronghold key storagediff --git a/openspec/changes/archive/2026-03-01-sync-style-runs-jsx-cli-tests/specs/canvas-rendering/spec.md b/openspec/changes/archive/2026-03-01-sync-style-runs-jsx-cli-tests/specs/canvas-rendering/spec.mddeleted file mode 100644index 9ca11d5af..000000000--- a/openspec/changes/archive/2026-03-01-sync-style-runs-jsx-cli-tests/specs/canvas-rendering/spec.md+++ /dev/null@@ -1,10 +0,0 @@-# canvas-rendering Specification (delta)--## New Requirements--### Requirement: Mixed-style text rendering-The renderer SHALL render text nodes with per-character formatting using CanvasKit ParagraphBuilder.pushStyle/pop. Each StyleRun segment pushes its own TextStyle (weight, slant, decoration) before adding text, then pops to restore the default style.--#### Scenario: Render mixed bold and regular text-- **WHEN** a text node has "Hello " (regular) + "world" (bold)-- **THEN** the renderer outputs a single Paragraph with two style segments, "world" visually bolddiff --git a/openspec/changes/archive/2026-03-01-sync-style-runs-jsx-cli-tests/specs/cli/spec.md b/openspec/changes/archive/2026-03-01-sync-style-runs-jsx-cli-tests/specs/cli/spec.mddeleted file mode 100644index 8be870fb2..000000000--- a/openspec/changes/archive/2026-03-01-sync-style-runs-jsx-cli-tests/specs/cli/spec.md+++ /dev/null@@ -1,41 +0,0 @@-# cli Specification (delta)--## New Requirements--### Requirement: Analyze commands-The CLI SHALL provide `open-pencil analyze <file>` subcommands for design file analysis:-- `analyze colors` — color palette usage with clustering-- `analyze typography` — font/size/weight distribution-- `analyze spacing` — gap/padding values with grid alignment check-- `analyze clusters` — repeated patterns that could be components--All subcommands SHALL support `--json` for machine-readable output.--#### Scenario: Analyze colors-- **WHEN** `bun open-pencil analyze colors design.fig` is run-- **THEN** a color palette summary with usage counts and clusters is printed--#### Scenario: Analyze clusters-- **WHEN** `bun open-pencil analyze clusters design.fig` is run-- **THEN** repeated node patterns that could be components are listed--### Requirement: Node command-The CLI SHALL provide `open-pencil node <file> <id>` to display detailed properties of a specific node by ID.--#### Scenario: Node details-- **WHEN** `bun open-pencil node design.fig abc123` is run-- **THEN** the node's type, properties, children, and parent are displayed--### Requirement: Pages command-The CLI SHALL provide `open-pencil pages <file>` to list all pages with node counts.--#### Scenario: List pages-- **WHEN** `bun open-pencil pages design.fig` is run-- **THEN** each page name and its node count are listed--### Requirement: Variables command-The CLI SHALL provide `open-pencil variables <file>` to list design variables and collections.--#### Scenario: List variables-- **WHEN** `bun open-pencil variables design.fig` is run-- **THEN** all variable collections, modes, and variable values are listeddiff --git a/openspec/changes/archive/2026-03-01-sync-style-runs-jsx-cli-tests/specs/editor-ui/spec.md b/openspec/changes/archive/2026-03-01-sync-style-runs-jsx-cli-tests/specs/editor-ui/spec.mddeleted file mode 100644index d873464ff..000000000--- a/openspec/changes/archive/2026-03-01-sync-style-runs-jsx-cli-tests/specs/editor-ui/spec.md+++ /dev/null@@ -1,14 +0,0 @@-# editor-ui Specification (delta)--## New Requirements--### Requirement: Rich text formatting buttons-The TypographySection SHALL include B/I/U/S toggle buttons for Bold, Italic, Underline, and Strikethrough. When text is selected during editing, the buttons apply formatting to the selection. When editing with no selection, they toggle the whole-node style. The active state reflects current selection formatting.--#### Scenario: Bold button with selection-- **WHEN** user selects text and clicks the Bold button (or presses ⌘B)-- **THEN** the selection becomes bold and the B button shows active state--#### Scenario: Underline button with no selection-- **WHEN** user clicks the Underline button during editing with no selection-- **THEN** the entire text node's underline style togglesdiff --git a/openspec/changes/archive/2026-03-01-sync-style-runs-jsx-cli-tests/specs/scene-graph/spec.md b/openspec/changes/archive/2026-03-01-sync-style-runs-jsx-cli-tests/specs/scene-graph/spec.mddeleted file mode 100644index a15d45d11..000000000--- a/openspec/changes/archive/2026-03-01-sync-style-runs-jsx-cli-tests/specs/scene-graph/spec.md+++ /dev/null@@ -1,21 +0,0 @@-# scene-graph Specification (delta)--## New Requirements--### Requirement: StyleRun model-SceneNode SHALL support a `styleRuns` array of `{start, length, style}` where style is CharacterStyleOverride (fontWeight, italic, textDecoration). The scene graph SHALL provide helpers to apply/toggle styles on ranges and adjust runs on insert/delete.--#### Scenario: Apply bold to range-- **WHEN** applyStyleToRange is called with fontWeight 700 on characters 6–11-- **THEN** the styleRuns array contains a run for that range with fontWeight 700--### Requirement: JSX renderer-@open-pencil/core SHALL export TreeNode builder functions (Frame, Text, Rectangle, Ellipse, etc.) and two rendering paths: renderTreeNode() (tree → scene graph, no deps) and renderJsx() (JSX string → esbuild → tree → scene graph, for CLI/headless). Builder functions SHALL accept Tailwind-like shorthand props: w, h, bg, rounded, flex, gap, p/px/py, justify, items, shadow, blur.--#### Scenario: Build tree from functions-- **WHEN** Frame({w: 200, h: 100, bg: '#f00'}, [Text({children: 'Hello'})]) is called-- **THEN** a TreeNode with type FRAME, width 200, height 100, and red fill is created with a TEXT child--#### Scenario: Render JSX string-- **WHEN** renderJsx('<Frame w={100}><Text>Hi</Text></Frame>') is called-- **THEN** a scene graph with a FRAME parent and TEXT child is produceddiff --git a/openspec/changes/archive/2026-03-01-sync-style-runs-jsx-cli-tests/specs/testing/spec.md b/openspec/changes/archive/2026-03-01-sync-style-runs-jsx-cli-tests/specs/testing/spec.mddeleted file mode 100644index bb2fec182..000000000--- a/openspec/changes/archive/2026-03-01-sync-style-runs-jsx-cli-tests/specs/testing/spec.md+++ /dev/null@@ -1,28 +0,0 @@-# testing Specification (delta)--## New Requirements--### Requirement: .fig roundtrip tests-The test suite SHALL include roundtrip tests for real .fig files: parsing property invariants, encode/decode cycle fidelity. Test fixtures (material3.fig, nuxtui.fig) SHALL be tracked via Git LFS.--#### Scenario: Roundtrip encode/decode-- **WHEN** a .fig file is parsed and re-encoded-- **THEN** the re-encoded data decodes to the same node properties--#### Scenario: Property invariants-- **WHEN** a real .fig file is parsed-- **THEN** all nodes have valid types, dimensions ≥ 0, and required fields present--### Requirement: .fig import performance-The .fig import pipeline SHALL avoid O(n²) child resolution. A children index SHALL be built upfront for linear-time lookups.--#### Scenario: Large file import speed-- **WHEN** material3.fig (87K nodes) is imported-- **THEN** parsing completes in under 2 seconds (was 37s before fix)--### Requirement: JSX renderer tests-The test suite SHALL include tests for the JSX renderer covering all node types (Frame, Text, Rectangle, Ellipse, etc.), layout props, effects, and nesting.--#### Scenario: Render Frame with children-- **WHEN** a JSX tree with Frame containing Rectangle and Text is rendered-- **THEN** the scene graph contains correct parent-child relationships and propertiesdiff --git a/openspec/changes/archive/2026-03-01-sync-style-runs-jsx-cli-tests/specs/text-editing/spec.md b/openspec/changes/archive/2026-03-01-sync-style-runs-jsx-cli-tests/specs/text-editing/spec.mddeleted file mode 100644index 331428435..000000000--- a/openspec/changes/archive/2026-03-01-sync-style-runs-jsx-cli-tests/specs/text-editing/spec.md+++ /dev/null@@ -1,45 +0,0 @@-# text-editing Specification (delta)--## New Requirements--### Requirement: Rich text style runs-Text nodes SHALL support per-character formatting via StyleRun arrays: `{start, length, style}` where style includes fontWeight, italic (boolean), and textDecoration (UNDERLINE, STRIKETHROUGH). ⌘B toggles bold, ⌘I toggles italic, ⌘U toggles underline on the current selection. With no selection, the shortcut toggles the whole-node style. Style runs adjust on insert/delete to preserve formatting.--#### Scenario: Bold selection-- **WHEN** user selects "world" in "Hello world" and presses ⌘B-- **THEN** the word "world" renders bold while "Hello " stays regular--#### Scenario: Toggle italic on whole node-- **WHEN** user presses ⌘I with no text selected in a text node-- **THEN** the entire text node toggles italic--#### Scenario: Style preservation on insert-- **WHEN** user types "X" between a bold and regular segment-- **THEN** the inserted character inherits the style of the preceding segment and run boundaries adjust--### Requirement: .fig roundtrip for style runs-The .fig import SHALL parse characterStyleIDs and styleOverrideTable from TextData into StyleRun arrays. The .fig export SHALL write back with a deduped style table.--#### Scenario: Import rich text from .fig-- **WHEN** a .fig file with mixed bold/italic text is imported-- **THEN** the style runs are correctly reconstructed--## Modified Requirements--### Requirement: Text selection via mouse drag (MODIFIED)-Double-click SHALL select the word at click position. Triple-click SHALL select the entire text. Single click positions cursor. Drag extends selection. Click outside commits.--#### Scenario: Double-click selects word-- **WHEN** user double-clicks on "world" in "Hello world" during editing-- **THEN** "world" is selected--#### Scenario: Triple-click selects all-- **WHEN** user triple-clicks inside a text node during editing-- **THEN** all text is selected--### Requirement: TextEditor class in core (MODIFIED)-TextEditor SHALL additionally support selectLine(pos) and selectLineAt(x, y) methods for line-level selection.--#### Scenario: Select line-- **WHEN** selectLineAt is called at a position within line 2-- **THEN** the entire second line is selecteddiff --git a/openspec/changes/archive/2026-03-01-sync-style-runs-jsx-cli-tests/specs/tooling/spec.md b/openspec/changes/archive/2026-03-01-sync-style-runs-jsx-cli-tests/specs/tooling/spec.mddeleted file mode 100644index 9ed2ea06b..000000000--- a/openspec/changes/archive/2026-03-01-sync-style-runs-jsx-cli-tests/specs/tooling/spec.md+++ /dev/null@@ -1,24 +0,0 @@-# tooling Specification (delta)--## New Requirements--### Requirement: Copy-paste detection-The project SHALL use jscpd for copy-paste detection. The `bun run jscpd` command SHALL scan for duplicated code blocks.--#### Scenario: Detect duplicates-- **WHEN** `bun run jscpd` is run-- **THEN** duplicated code blocks are reported with locations and percentages--### Requirement: Kiwi serialization consolidation-Shared kiwi serialization logic (sceneNodeToKiwi, buildFigKiwi, parseFigKiwiChunks, decompressFigKiwiDataAsync) SHALL be extracted to packages/core/src/kiwi-serialize.ts. The app's src/kiwi/ SHALL re-export from core, eliminating the vendored kiwi-schema copy.--#### Scenario: Clipboard and fig-export share serialization-- **WHEN** clipboard.ts and fig-export.ts serialize nodes to kiwi-- **THEN** both use the shared kiwi-serialize.ts functions--### Requirement: Test coverage script-The project SHALL include a `test:coverage` script for measuring code coverage.--#### Scenario: Run coverage-- **WHEN** `bun run test:coverage` is run-- **THEN** test coverage metrics are reporteddiff --git a/openspec/changes/archive/2026-03-01-sync-style-runs-jsx-cli-tests/tasks.md b/openspec/changes/archive/2026-03-01-sync-style-runs-jsx-cli-tests/tasks.mddeleted file mode 100644index ffb307c72..000000000--- a/openspec/changes/archive/2026-03-01-sync-style-runs-jsx-cli-tests/tasks.md+++ /dev/null@@ -1,42 +0,0 @@-# Tasks: Sync style runs, JSX renderer, CLI expansion, tests--Reference: 22 commits from master (33d3def..6268d8b).-Delta-specs in `openspec/changes/sync-style-runs-jsx-cli-tests/specs/` (text-editing, canvas-rendering, editor-ui, cli, tooling, testing, scene-graph).-Proposal: `proposal.md`, Design: `design.md` — validated and aligned with delta-specs.--Section 1 (specs) MUST complete before Section 2 (docs) — docs reference merged spec content.--## 1. Merge Delta-Specs into Main Specs--Each task merges ADDED and MODIFIED requirements from the delta-spec into the baseline at `openspec/specs/<domain>/spec.md`. Untouched baseline requirements are preserved. No conflicts between domains — each delta-spec targets a distinct section of its baseline.--- [x] 1.1 Update `openspec/specs/text-editing/spec.md` — ADDED: "Rich text style runs" (⌘B/I/U per-selection, style preservation on insert/delete), ".fig roundtrip for style runs" (import characterStyleIDs, export deduped table). MODIFIED: "Text selection via mouse drag" (add double-click word, triple-click all), "TextEditor class in core" (add selectLine/selectLineAt)-- [x] 1.2 Update `openspec/specs/canvas-rendering/spec.md` — ADDED: "Mixed-style text rendering" (ParagraphBuilder pushStyle/pop per StyleRun segment)-- [x] 1.3 Update `openspec/specs/editor-ui/spec.md` — ADDED: "Rich text formatting buttons" (B/I/U/S toggles in TypographySection, selection-aware)-- [x] 1.4 Update `openspec/specs/cli/spec.md` — ADDED: "Analyze commands" (colors/typography/spacing/clusters with --json), "Node command" (properties by ID), "Pages command" (list with counts), "Variables command" (collections and values)-- [x] 1.5 Update `openspec/specs/tooling/spec.md` — ADDED: "Copy-paste detection" (jscpd, 15.6%→0.62%), "Kiwi serialization consolidation" (kiwi-serialize.ts shared by clipboard + fig-export), "Test coverage script" (test:coverage)-- [x] 1.6 Update `openspec/specs/testing/spec.md` — ADDED: ".fig roundtrip tests" (LFS fixtures material3/nuxtui, property invariants, encode/decode cycle), ".fig import performance" (O(n²)→O(n), 37s→535ms), "JSX renderer tests" (27 tests)-- [x] 1.7 Update `openspec/specs/scene-graph/spec.md` — ADDED: "StyleRun model" (per-character formatting array on SceneNode), "JSX renderer" (TreeNode builders + renderTreeNode + renderJsx, Tailwind-like shorthand props). These are two independent additions to scene-graph — StyleRun extends the text data model, JSX renderer adds a programmatic creation API--## 2. Update VitePress Docs--All three target files already exist — no sidebar/nav changes needed.--- [x] 2.1 Update `docs/guide/features.md` — modify existing sections and add new ones:- - **Modify "Inline Text Editing"**: add double-click (word), triple-click (all) to existing paragraph- - **Add "Rich Text Formatting" section** (after "Inline Text Editing"): ⌘B/I/U toggle per-selection bold/italic/underline, ⌘U for underline, strikethrough via S button in TypographySection, StyleRun model, .fig roundtrip preserves formatting- - **Add "JSX Renderer" section** (after "@open-pencil/core & CLI"): TreeNode builders (Frame, Text, Rectangle, etc.), Tailwind-like shorthand props (w/h/bg/rounded/flex/gap/p), renderTreeNode() for browser, renderJsx() for CLI/headless via esbuild, 27 tests- - **Expand CLI commands** in "@open-pencil/core & CLI" section: add analyze (colors/typography/spacing/clusters), node, pages, variables to the list- - **Add "Code Quality"** section (after "CI/CD Builds"): jscpd copy-paste detection (15.6%→0.62%), kiwi-serialize.ts consolidation, .fig import O(n²) fix (37s→535ms on 87K nodes)-- [x] 2.2 Update `docs/guide/figma-comparison.md` — specific row changes:- - "Text tool & inline editing" ✅: add "rich text style runs (⌘B/I/U), double/triple-click" to notes- - "Text styles" 🔲→🟡: "Per-selection bold/italic/underline/strikethrough via ⌘B/I/U and S button; not yet reusable named text styles"- - "CLI tools" 🟡: add "analyze colors/typography/spacing/clusters, node, pages, variables" to notes- - No other rows change status. After: 64✅, 16🟡, 70🔲 = 150 total. Update coverage line-- [x] 2.3 Update `docs/development/roadmap.md` — specific phase assignments:- - **Phase 4 Delivered** (text/rendering): rich text style runs (⌘B/I/U per-selection, StyleRun model, .fig roundtrip), B/I/U/S buttons in TypographySection, double/triple-click text selection- - **Phase 5 Delivered** (tooling/infra): JSX renderer (TreeNode builders, renderTreeNode/renderJsx, 27 tests), expanded CLI (analyze/node/pages/variables), jscpd (15.6%→0.62%), kiwi-serialize.ts consolidation, .fig roundtrip tests (LFS fixtures), import O(n²) fix, test:coverage script--## 3. Verify--- [x] 3.1 Run `bun run docs:build` — verify build passes. Manually confirm: coverage count in figma-comparison.md matches actual ✅/🟡/🔲 tallies, no broken internal anchor links in outputdiff --git a/openspec/changes/archive/2026-03-01-sync-text-editing-fonts-variables-ui/.openspec.yaml b/openspec/changes/archive/2026-03-01-sync-text-editing-fonts-variables-ui/.openspec.yamldeleted file mode 100644index 0b4defe0e..000000000--- a/openspec/changes/archive/2026-03-01-sync-text-editing-fonts-variables-ui/.openspec.yaml+++ /dev/null@@ -1,2 +0,0 @@-schema: spec-driven-created: 2026-03-01diff --git a/openspec/changes/archive/2026-03-01-sync-text-editing-fonts-variables-ui/design.md b/openspec/changes/archive/2026-03-01-sync-text-editing-fonts-variables-ui/design.mddeleted file mode 100644index 8f9b8d580..000000000--- a/openspec/changes/archive/2026-03-01-sync-text-editing-fonts-variables-ui/design.md+++ /dev/null@@ -1,22 +0,0 @@-# Design: Sync text editing, system fonts, variables UI--## Approach-Documentation-only change. Update delta-specs for affected domains, then propagate to VitePress docs and comparison matrix.--## Affected spec domains--1. **text-editing** — major rewrite: textarea overlay → canvas-native editing with phantom textarea, TextEditor class in core, selection/caret rendering-2. **editor-ui** — VariablesPanel → VariablesDialog (TanStack Table, page properties entry point), FontPicker component, ColorInput extraction-3. **canvas-rendering** — text selection highlights and blinking caret drawn on canvas during editing-4. **desktop-app** — font-kit system font commands (list_system_fonts, load_system_font), app icon/name fixes-5. **undo-redo** — variable operations now undoable (create/delete/rename variable, create collection, rename collection, change color/value)-6. **scene-graph** — demo variable collections (primitives, semantic, spacing) validate multi-mode and alias features--## VitePress docs updates-- features.md: rewrite text editing section (canvas-native), add font picker details, update variables UI description-- figma-comparison.md: update Text tool row (canvas-native), Font loading (font-kit Tauri), Variables → more complete status-- roadmap.md: add text editing and fonts to Phase 4 delivered-- keyboard-shortcuts.md: no new shortcuts (existing ones still apply)--## Risks-- None — documentation only, no source changesdiff --git a/openspec/changes/archive/2026-03-01-sync-text-editing-fonts-variables-ui/proposal.md b/openspec/changes/archive/2026-03-01-sync-text-editing-fonts-variables-ui/proposal.mddeleted file mode 100644index b8404eccb..000000000--- a/openspec/changes/archive/2026-03-01-sync-text-editing-fonts-variables-ui/proposal.md+++ /dev/null@@ -1,38 +0,0 @@-# Proposal: Sync text editing, system fonts, variables UI--## Why-19 commits merged from master (adea7eb..33d3def) introduce three major feature areas that need specs, docs, and comparison matrix updates.--## What changed--### Canvas-native text editing (33d3def)-- TextEditor class in packages/core/src/text-editor.ts — cursor, selection, word boundaries, line navigation via CanvasKit Paragraph API (getGlyphPositionAtCoordinate, getRectsForRange)-- Renderer draws selection highlights (blue translucent rects) and blinking caret directly on canvas-- Phantom textarea (hidden off-screen) captures input, IME composition, clipboard, arrow keys, Home/End, word/line movement (⌥/⌘ modifiers)-- Replaces old visible textarea overlay approach-- use-text-edit.ts composable handles input/composition/clipboard/keyboard-- use-canvas-input.ts adds text selection drag + double-click word select-- editor.ts reworked startTextEditing/commitTextEdit to use TextEditor--### System font enumeration via font-kit (5ccae70, 326f5d1, 621e38e, 4e03d26)-- Rust: list_system_fonts and load_system_font Tauri commands using font-kit crate-- OnceLock cache in Rust for font list, preloaded on app startup-- TS font shim: Tauri path uses invoke() vs browser queryLocalFonts-- FontPicker component: reka-ui Listbox + PopoverRoot with virtual scroll, search filter, CSS font preview via registerFontFaces-- Extracted from TypographySection into standalone FontPicker.vue--### Variables dialog redesign (5c4c6d7 → 2054436, 10 commits)-- VariablesPanel → VariablesDialog (reka-ui Dialog + Tabs + Editable)-- VariablesSection in page properties panel (settings icon opens dialog)-- TanStack Table (@tanstack/vue-table) with resizable columns-- Table layout matches Figma: Name | Mode 1 | Mode 2 | ...-- ColorInput component extracted (swatch + hex, replaces duplication in PageSection, StrokeSection, EffectsSection, VariablesDialog)-- ColorPicker: alpha slider checkerboard fix-- Undo/redo for all variable operations (create/delete variable, create collection, rename, color change)-- Demo: 3 collections (Primitives Light/Dark, Semantic aliases, Spacing Default/Compact)-- Double-click to rename collection tabs--### Desktop app polish (88765bd, faf7ba6, f7d1d59)-- Pencil loader icon as Tauri app icon-- Cargo crate renamed to open_pencil, binary to OpenPencil-- macOS Dock name fix: open-pencil-app → OpenPencildiff --git a/openspec/changes/archive/2026-03-01-sync-text-editing-fonts-variables-ui/specs/canvas-rendering/spec.md b/openspec/changes/archive/2026-03-01-sync-text-editing-fonts-variables-ui/specs/canvas-rendering/spec.mddeleted file mode 100644index 9671ea268..000000000--- a/openspec/changes/archive/2026-03-01-sync-text-editing-fonts-variables-ui/specs/canvas-rendering/spec.md+++ /dev/null@@ -1,18 +0,0 @@-# canvas-rendering Specification (delta)--## New Requirements--### Requirement: Text editing overlay rendering-During text editing, the renderer SHALL draw on the canvas: a blue outline around the text node bounds, translucent blue rectangles for the text selection range, and a blinking black caret at the cursor position. The caret SHALL blink at ~530ms intervals and become solid (non-blinking) immediately after any input. Selection rects and caret position are obtained from TextEditor via getSelectionRects() and getCaretRect().--#### Scenario: Caret rendering-- **WHEN** user is editing text with no selection-- **THEN** a blinking black caret is drawn at the cursor position within the text node--#### Scenario: Selection rendering-- **WHEN** user has selected a range of text during editing-- **THEN** translucent blue rectangles are drawn behind the selected text glyphs--#### Scenario: Blue outline during editing-- **WHEN** user is editing a text node-- **THEN** a blue outline is drawn around the text node bounds (at selection color)diff --git a/openspec/changes/archive/2026-03-01-sync-text-editing-fonts-variables-ui/specs/desktop-app/spec.md b/openspec/changes/archive/2026-03-01-sync-text-editing-fonts-variables-ui/specs/desktop-app/spec.mddeleted file mode 100644index 83f3d9eab..000000000--- a/openspec/changes/archive/2026-03-01-sync-text-editing-fonts-variables-ui/specs/desktop-app/spec.md+++ /dev/null@@ -1,32 +0,0 @@-# desktop-app Specification (delta)--## New Requirements--### Requirement: System font commands via font-kit-The Tauri backend SHALL expose two Rust commands using the font-kit crate: `list_system_fonts` (returns all system font families with style names, cached via OnceLock) and `load_system_font` (loads font data by family + style name, with weight matching and fallback to first font in family). The TS font shim SHALL detect Tauri runtime and use invoke() instead of queryLocalFonts.--#### Scenario: List system fonts-- **WHEN** the frontend calls list_system_fonts via Tauri invoke-- **THEN** a sorted list of font families with styles is returned--#### Scenario: Load specific font style-- **WHEN** the frontend requests "Inter" "Bold" via load_system_font-- **THEN** the font data (ArrayBuffer) is returned and registered with the font provider--#### Scenario: Font list caching-- **WHEN** list_system_fonts is called multiple times-- **THEN** the result is cached (OnceLock) and returned instantly after the first call--### Requirement: CSS font face registration-System font faces SHALL be registered with document.fonts for CSS preview in the font picker. Each system font creates a FontFace pointing to local() source.--#### Scenario: Font preview in picker-- **WHEN** system fonts are loaded in Tauri-- **THEN** font faces are registered so CSS can render preview text in each font--### Requirement: App identity-The Cargo crate SHALL be named `open_pencil` and the binary `OpenPencil`. The macOS Dock SHALL display "OpenPencil". The app icon SHALL use the pencil loader icon.--#### Scenario: macOS Dock name-- **WHEN** the app is running on macOS-- **THEN** the Dock displays "OpenPencil" (not "open-pencil-app")diff --git a/openspec/changes/archive/2026-03-01-sync-text-editing-fonts-variables-ui/specs/editor-ui/spec.md b/openspec/changes/archive/2026-03-01-sync-text-editing-fonts-variables-ui/specs/editor-ui/spec.mddeleted file mode 100644index 50298eafc..000000000--- a/openspec/changes/archive/2026-03-01-sync-text-editing-fonts-variables-ui/specs/editor-ui/spec.md+++ /dev/null@@ -1,49 +0,0 @@-# editor-ui Specification (delta)--## Modified Requirements--### Requirement: Variables panel (MODIFIED → Variables dialog)-The editor SHALL display a VariablesSection in the page-level properties panel showing variable/collection counts and a settings icon. Clicking the icon opens a VariablesDialog (reka-ui Dialog) with: collection tabs (reka-ui Tabs, double-click to rename), a TanStack Table (@tanstack/vue-table) with resizable columns (Name | Mode 1 | Mode 2 | ...), search bar, and a "+ Create variable" button. Color variables display inline ColorInput with picker. Variable names and values are editable inline (reka-ui Editable).--#### Scenario: Open variables dialog-- **WHEN** user clicks the settings icon in the Variables section of page properties-- **THEN** a dialog opens showing collection tabs and a variables table--#### Scenario: Rename collection-- **WHEN** user double-clicks a collection tab name-- **THEN** the tab becomes editable for renaming--#### Scenario: Resize table columns-- **WHEN** user drags a column border in the variables table header-- **THEN** the column width adjusts--#### Scenario: Search variables-- **WHEN** user types in the search bar in the variables dialog-- **THEN** only variables matching the search term are shown--## New Requirements--### Requirement: ColorInput component-A reusable ColorInput component SHALL display a color swatch with ColorPicker and an optional hex input. It SHALL replace duplicated color picker + hex input patterns in PageSection, StrokeSection, EffectsSection, and VariablesDialog.--#### Scenario: Color input with editing-- **WHEN** ColorInput is rendered with editable=true-- **THEN** a swatch with picker and an editable hex input are shown--#### Scenario: Color input read-only-- **WHEN** ColorInput is rendered with editable=false (default)-- **THEN** a swatch with picker and a read-only hex label are shown--### Requirement: ColorPicker alpha slider checkerboard-The ColorPicker alpha slider SHALL display a checkerboard background behind the transparent-to-color gradient, matching FillPicker's implementation.--#### Scenario: Alpha slider visual-- **WHEN** user opens a ColorPicker-- **THEN** the alpha slider shows a checkerboard pattern indicating transparency--### Requirement: Demo variable collections-The demo document SHALL include three variable collections demonstrating multi-mode and alias features: Primitives (Light/Dark modes, 9 color variables), Semantic (aliases to Primitives), and Spacing (Default/Compact modes, 8 number variables). Variables SHALL be bound to demo nodes.--#### Scenario: Demo loads with variables-- **WHEN** the demo document is created-- **THEN** three collections with variables and bindings are present in the scene graphdiff --git a/openspec/changes/archive/2026-03-01-sync-text-editing-fonts-variables-ui/specs/text-editing/spec.md b/openspec/changes/archive/2026-03-01-sync-text-editing-fonts-variables-ui/specs/text-editing/spec.mddeleted file mode 100644index 301c057f1..000000000--- a/openspec/changes/archive/2026-03-01-sync-text-editing-fonts-variables-ui/specs/text-editing/spec.md+++ /dev/null@@ -1,83 +0,0 @@-# text-editing Specification (delta)--## Modified Requirements--### Requirement: Inline text editing (MODIFIED)-Double-clicking a text node SHALL enter canvas-native inline editing mode. A hidden phantom textarea (positioned off-screen, opacity 0) SHALL capture keyboard input, IME composition, and clipboard events. The canvas SHALL render the text directly using CanvasKit Paragraph API — no visible textarea overlay.--#### Scenario: Enter edit mode-- **WHEN** user double-clicks a text node-- **THEN** a phantom textarea is created off-screen and focused, the canvas renders text with a blinking caret--#### Scenario: IME composition-- **WHEN** user enters IME composition during text editing-- **THEN** the phantom textarea handles compositionstart/compositionend events and the composed text is inserted into the TextEditor--### Requirement: Font loading (MODIFIED)-The editor SHALL load Inter as the default font. In Tauri, system fonts SHALL be enumerated and loaded via Rust commands (list_system_fonts, load_system_font) using the font-kit crate. In browser, the Local Font Access API SHALL be used when available. Font list SHALL be preloaded on app startup (cached via OnceLock in Rust) so the picker is ready instantly.--#### Scenario: Default font-- **WHEN** a text node is created without specifying a font-- **THEN** the Inter font is used for rendering--#### Scenario: System fonts via Tauri-- **WHEN** the app runs as a Tauri desktop app-- **THEN** system fonts are enumerated via the font-kit Rust command and loaded via invoke()--#### Scenario: System fonts via browser-- **WHEN** the app runs in a browser with Local Font Access API-- **THEN** system fonts are enumerated via queryLocalFonts--#### Scenario: Font preloading-- **WHEN** the app starts-- **THEN** the font list is preloaded so the font picker opens without delay--## New Requirements--### Requirement: TextEditor class in core-A TextEditor class SHALL live in packages/core/src/text-editor.ts providing cursor positioning, text selection, word boundary detection, and line navigation using CanvasKit Paragraph API (getGlyphPositionAtCoordinate, getRectsForRange, getLineMetrics). It SHALL support: insert, backspace, delete, select all, select word, move left/right/up/down, move to line start/end, move word left/right, and extend selection with Shift.--#### Scenario: Cursor positioning-- **WHEN** user clicks inside a text node during editing-- **THEN** the cursor moves to the glyph position nearest to the click coordinates--#### Scenario: Word selection-- **WHEN** user double-clicks a word during text editing-- **THEN** the word is selected (from word boundary to word boundary)--#### Scenario: Line navigation-- **WHEN** user presses ⌘← during text editing-- **THEN** the cursor moves to the start of the current line--### Requirement: Font picker component-A FontPicker component SHALL provide font family selection with: reka-ui Listbox with virtual scroll (ListboxVirtualizer), search filter (ListboxFilter), CSS font preview (each row rendered in the font itself), and scroll-to-current behavior. Font faces are registered for CSS preview via registerFontFaces.--#### Scenario: Font picker search-- **WHEN** user types "Mono" in the font picker search-- **THEN** only font families containing "Mono" are shown--#### Scenario: Font preview-- **WHEN** user opens the font picker-- **THEN** each font family name is displayed in its own font face--### Requirement: Text editing keyboard navigation-The phantom textarea SHALL handle keyboard navigation with modifier support: ⌥← / ⌥→ (word movement), ⌘← / ⌘→ (line start/end), ⌘⌫ (delete to line start), ⌥⌫ (delete word), Shift extends selection for all movement keys. Cut (⌘X), Copy (⌘C), Paste (⌘V) SHALL use navigator.clipboard API.--#### Scenario: Word-level backspace-- **WHEN** user presses ⌥⌫ during text editing-- **THEN** the word before the cursor is deleted--#### Scenario: Copy selection-- **WHEN** user selects text and presses ⌘C-- **THEN** the selected text is copied to the clipboard--### Requirement: Text selection via mouse drag-Clicking inside a text node during editing SHALL position the cursor. Dragging SHALL extend the selection. Clicking outside the text node bounds SHALL commit the edit and exit editing mode.--#### Scenario: Drag to select-- **WHEN** user clicks and drags inside a text node during editing-- **THEN** the text between click start and current position is selected--#### Scenario: Click outside commits-- **WHEN** user clicks outside the editing text node-- **THEN** the text edit is committed and editing mode exitsdiff --git a/openspec/changes/archive/2026-03-01-sync-text-editing-fonts-variables-ui/specs/undo-redo/spec.md b/openspec/changes/archive/2026-03-01-sync-text-editing-fonts-variables-ui/specs/undo-redo/spec.mddeleted file mode 100644index 8ad0be64b..000000000--- a/openspec/changes/archive/2026-03-01-sync-text-editing-fonts-variables-ui/specs/undo-redo/spec.md+++ /dev/null@@ -1,18 +0,0 @@-# undo-redo Specification (delta)--## Modified Requirements--### Requirement: All operations undoable (MODIFIED)-Undo/redo SHALL cover all editor operations including variable operations: create variable, delete variable, rename variable, create collection, rename collection, and change variable color/value. Each variable mutation pushes an undo entry with forward and inverse callbacks.--#### Scenario: Undo variable creation-- **WHEN** user creates a variable and presses ⌘Z-- **THEN** the variable is removed from the scene graph--#### Scenario: Undo variable rename-- **WHEN** user renames a variable and presses ⌘Z-- **THEN** the variable name reverts to the previous value--#### Scenario: Undo collection rename-- **WHEN** user renames a collection and presses ⌘Z-- **THEN** the collection name reverts to the previous valuediff --git a/openspec/changes/archive/2026-03-01-sync-text-editing-fonts-variables-ui/tasks.md b/openspec/changes/archive/2026-03-01-sync-text-editing-fonts-variables-ui/tasks.mddeleted file mode 100644index 41a8e4094..000000000--- a/openspec/changes/archive/2026-03-01-sync-text-editing-fonts-variables-ui/tasks.md+++ /dev/null@@ -1,25 +0,0 @@-# Tasks: Sync text editing, system fonts, variables UI--Reference: 19 commits from master (adea7eb..33d3def).-Delta-specs in `openspec/changes/sync-text-editing-fonts-variables-ui/specs/` (text-editing, canvas-rendering, editor-ui, desktop-app, undo-redo).-Proposal: `proposal.md`, Design: `design.md` — validated and aligned with delta-specs.--## 1. Merge Delta-Specs into Main Specs--Each task merges ADDED and MODIFIED requirements from the delta-spec into the baseline. Untouched requirements in the baseline are preserved.--- [x] 1.1 Update `openspec/specs/text-editing/spec.md` — MODIFIED: "Inline text editing" (textarea overlay → canvas-native with phantom textarea), "Font loading" (add Tauri font-kit + preloading). ADDED: "TextEditor class in core", "Font picker component", "Text editing keyboard navigation", "Text selection via mouse drag"-- [x] 1.2 Update `openspec/specs/canvas-rendering/spec.md` — ADDED: "Text editing overlay rendering" (selection rects, blinking caret, blue outline)-- [x] 1.3 Update `openspec/specs/editor-ui/spec.md` — MODIFIED: "Variables panel" → "Variables dialog" (TanStack Table, page properties entry, collection tabs). ADDED: "ColorInput component", "ColorPicker alpha slider checkerboard", "Demo variable collections"-- [x] 1.4 Update `openspec/specs/desktop-app/spec.md` — ADDED: "System font commands via font-kit", "CSS font face registration", "App identity"-- [x] 1.5 Update `openspec/specs/undo-redo/spec.md` — MODIFIED: "All operations undoable" (add variable create/delete/rename, collection create/rename, color/value change)--## 2. Update VitePress Docs--- [x] 2.1 Update `docs/guide/features.md` — rewrite "Inline Text Editing" section (canvas-native, phantom textarea, TextEditor in core, cursor/selection/word boundaries, keyboard navigation with ⌥/⌘ modifiers), add font picker details (virtual scroll, search, CSS preview, font-kit in Tauri). Update Variables section (dialog with TanStack Table, mode columns, collection tabs, undo/redo for variable ops, demo collections with Light/Dark + aliases + spacing). Note: keep anchor `#inline-text-editing` unchanged or add redirect-- [x] 2.2 Update `docs/guide/figma-comparison.md` — specific row changes: "Text tool & inline editing" ✅ update notes (canvas-native, phantom textarea), "Font loading" ✅ update notes (font-kit + preloading in Tauri, queryLocalFonts in browser), "Variables" 🟡 update notes (dialog + TanStack Table + undo/redo + demo collections). Recount ✅/🟡/🔲 totals and update coverage line-- [x] 2.3 Update `docs/development/roadmap.md` — add to Phase 4 Delivered (currently ✅): canvas-native text editing with TextEditor, system font enumeration via font-kit, font picker with virtual scroll, variables dialog redesign (TanStack Table), variable undo/redo, ColorInput extraction, app icon and identity--## 3. Verify--- [x] 3.1 Run `bun run docs:build` — verify VitePress build passes, check no broken anchor warnings in outputdiff --git a/openspec/changes/archive/2026-03-01-sync-variables-export-cli/.openspec.yaml b/openspec/changes/archive/2026-03-01-sync-variables-export-cli/.openspec.yamldeleted file mode 100644index b51d4740b..000000000--- a/openspec/changes/archive/2026-03-01-sync-variables-export-cli/.openspec.yaml+++ /dev/null@@ -1 +0,0 @@-type: changediff --git a/openspec/changes/archive/2026-03-01-sync-variables-export-cli/design.md b/openspec/changes/archive/2026-03-01-sync-variables-export-cli/design.mddeleted file mode 100644index 197eda228..000000000--- a/openspec/changes/archive/2026-03-01-sync-variables-export-cli/design.md+++ /dev/null@@ -1,14 +0,0 @@-# Design: Sync Variables, Image Export, CLI, Core Extraction--## Approach--Documentation-only change. Update specs and docs to match implemented features.--## Delta-Specs--### scene-graph — variables system (types, collections, modes, bindings, resolution)-### editor-ui — VariablesPanel, FillSection variable picker, ExportSection, splash loader-### canvas-rendering — variable binding resolution in renderer, image export rendering-### desktop-app — monorepo structure, @open-pencil/core and @open-pencil/cli packages-### tooling — Bun workspace, CLI commands, npm publishing-### testing — 7 variable unit testsdiff --git a/openspec/changes/archive/2026-03-01-sync-variables-export-cli/proposal.md b/openspec/changes/archive/2026-03-01-sync-variables-export-cli/proposal.mddeleted file mode 100644index 5e9512ea3..000000000--- a/openspec/changes/archive/2026-03-01-sync-variables-export-cli/proposal.md+++ /dev/null@@ -1,41 +0,0 @@-# Proposal: Sync Variables, Image Export, CLI, Core Extraction--## Why--21 commits merged from master (7ff16f7..d30ab4c) introduce the variables system, image export, monorepo extraction, CLI tooling, and performance improvements.--## What Changes--### Variables (Phase 4 completion)-- Variable, VariableCollection, VariableCollectionMode types-- VariableType: COLOR, FLOAT, STRING, BOOLEAN-- VariableValue with alias support (chain resolution, cycle detection)-- Collections with modes and activeMode switching-- Bind/unbind variables to node properties (fills/strokes colors)-- Renderer resolves variable bindings before painting-- .fig import of VARIABLE NodeChanges and paint variable bindings-- VariablesPanel UI (reka-ui Tabs for collections, Editable for names/values)-- FillSection variable picker (Popover + Combobox), purple badge, detach button-- 7 new unit tests (variables describe block)--### Image Export-- PNG/JPG/WEBP export with scale selector (0.5×–4×) and format picker-- ExportSection in properties panel with live preview and checkerboard background-- Context menu "Export…" action and ⇧⌘E shortcut-- Tauri save dialog / File System Access API / download fallback-- renderThumbnail and renderNodesToImage in render-image.ts-- JPG renders with white background, PNG/WEBP with transparency-- requestRender/requestRepaint split to avoid export preview updates on pan/zoom--### Monorepo & CLI (Phase 5 start)-- @open-pencil/core package extracted to packages/core/ (zero DOM deps)-- @open-pencil/cli package in packages/cli/ with headless CanvasKit CPU-- CLI commands: info, tree, find, export (all support --json)-- Bun workspace structure-- npm publishing preparation--### UI/Performance-- Splash loader during WASM initialization-- CSS containment on side panels-- sceneVersion/renderVersion split for UI panels-- Export preview flicker fixdiff --git a/openspec/changes/archive/2026-03-01-sync-variables-export-cli/specs/canvas-rendering/spec.md b/openspec/changes/archive/2026-03-01-sync-variables-export-cli/specs/canvas-rendering/spec.mddeleted file mode 100644index 9a8e3a0fe..000000000--- a/openspec/changes/archive/2026-03-01-sync-variables-export-cli/specs/canvas-rendering/spec.md+++ /dev/null@@ -1,24 +0,0 @@-# canvas-rendering Specification (delta)--## New Requirements--### Requirement: Variable binding resolution in renderer-The renderer SHALL resolve variable bindings before painting fills and strokes. When a fill or stroke has a bound variable, the renderer resolves the variable value using the collection's active mode and uses the resolved color.--#### Scenario: Render bound fill-- **WHEN** a rectangle's fill is bound to a COLOR variable with value red in Light mode-- **THEN** the rectangle renders with red fill--### Requirement: Image export rendering-The renderer SHALL support offscreen rendering to PNG, JPG, and WEBP via renderNodesToImage. Export uses an offscreen CanvasKit surface at the specified scale. JPG renders with opaque white background, PNG and WEBP render with transparency. Re-encoding for JPG/WEBP uses OffscreenCanvas.--#### Scenario: Export at 2× scale-- **WHEN** a 100×100 node is exported at 2× scale as PNG-- **THEN** the output image is 200×200 pixels with transparency--### Requirement: Scene version vs render version-The renderer SHALL distinguish between scene changes (increments sceneVersion + renderVersion) and viewport-only changes like pan/zoom (increments renderVersion only). UI panels and export preview observe sceneVersion to avoid unnecessary updates during navigation. This prevents export preview flicker on pan/zoom.--#### Scenario: Pan does not trigger export preview update-- **WHEN** user pans the canvas-- **THEN** sceneVersion does not change, so export preview is not re-rendereddiff --git a/openspec/changes/archive/2026-03-01-sync-variables-export-cli/specs/cli/spec.md b/openspec/changes/archive/2026-03-01-sync-variables-export-cli/specs/cli/spec.mddeleted file mode 100644index b4a0a2dd5..000000000--- a/openspec/changes/archive/2026-03-01-sync-variables-export-cli/specs/cli/spec.md+++ /dev/null@@ -1,37 +0,0 @@-# cli Specification (delta — new spec domain)--## Purpose-Headless CLI for .fig file operations. Runs in Bun/Node without a GUI, using CanvasKit CPU rasterization for rendering.--## New Requirements--### Requirement: CLI package-@open-pencil/cli SHALL be a separate package in packages/cli/ providing headless .fig file operations. It imports @open-pencil/core for engine access and uses CanvasKit CPU rasterization for rendering without WebGL.--### Requirement: CLI commands-The CLI SHALL support the following commands:-- `open-pencil info <file>` — document stats, node type counts, font list-- `open-pencil tree <file>` — visual node tree with formatted output-- `open-pencil find <file>` — search nodes by name or type-- `open-pencil export <file>` — render to PNG/JPG/WEBP at any scale--All commands SHALL support `--json` for machine-readable output.--#### Scenario: Info command-- **WHEN** `bun open-pencil info design.fig` is run-- **THEN** document stats, node type counts, and font list are printed--#### Scenario: Export command-- **WHEN** `bun open-pencil export design.fig --format png --scale 2` is run-- **THEN** the document is rendered headlessly and exported as 2× PNG--#### Scenario: JSON output-- **WHEN** `bun open-pencil tree design.fig --json` is run-- **THEN** the node tree is output as JSON--### Requirement: Workspace integration-The CLI SHALL be runnable via `bun open-pencil` within the Bun workspace, without global installation.--#### Scenario: Run from workspace root-- **WHEN** `bun open-pencil info design.fig` is run from the project root-- **THEN** the CLI executes using the workspace-linked binarydiff --git a/openspec/changes/archive/2026-03-01-sync-variables-export-cli/specs/desktop-app/spec.md b/openspec/changes/archive/2026-03-01-sync-variables-export-cli/specs/desktop-app/spec.mddeleted file mode 100644index 480bd6be1..000000000--- a/openspec/changes/archive/2026-03-01-sync-variables-export-cli/specs/desktop-app/spec.md+++ /dev/null@@ -1,10 +0,0 @@-# desktop-app Specification (delta)--## New Requirements--### Requirement: Monorepo with @open-pencil/core-The project SHALL use a Bun workspace monorepo. The engine (scene-graph, renderer, layout, codec, kiwi, types) SHALL be extracted to `packages/core/` (@open-pencil/core) with zero DOM dependencies. The app's `src/engine/` files become re-export shims. Core is importable by CLI, tests, and the app.--#### Scenario: Core has no DOM dependencies-- **WHEN** @open-pencil/core is imported in a Bun/Node environment without browser APIs-- **THEN** it loads successfullydiff --git a/openspec/changes/archive/2026-03-01-sync-variables-export-cli/specs/editor-ui/spec.md b/openspec/changes/archive/2026-03-01-sync-variables-export-cli/specs/editor-ui/spec.mddeleted file mode 100644index 5bdd3fbed..000000000--- a/openspec/changes/archive/2026-03-01-sync-variables-export-cli/specs/editor-ui/spec.md+++ /dev/null@@ -1,47 +0,0 @@-# editor-ui Specification (delta)--## New Requirements--### Requirement: Variables panel-The editor SHALL include a VariablesPanel toggled from the bottom of the layers sidebar. The panel uses reka-ui Tabs for collections and Editable for variable names/values. Users can create, rename, and delete variables and collections, switch modes, and set variable values per mode.--#### Scenario: Toggle variables panel-- **WHEN** user clicks the variables toggle in the layers sidebar-- **THEN** the VariablesPanel appears showing collections as tabs--#### Scenario: Edit variable value-- **WHEN** user clicks a variable value in the panel-- **THEN** an editable input allows changing the value for the active mode--### Requirement: Fill section variable picker-The fill section SHALL include a variable picker (reka-ui Popover + Combobox) to bind a color variable to a fill. Bound fills display a purple variable name badge with a detach button.--#### Scenario: Bind variable to fill-- **WHEN** user selects a color variable from the fill variable picker-- **THEN** the fill shows a purple badge with the variable name--#### Scenario: Detach variable from fill-- **WHEN** user clicks the detach button on a bound fill-- **THEN** the variable binding is removed and the fill shows the resolved color--### Requirement: Export section in properties panel-The properties panel SHALL include an ExportSection when nodes are selected. The section provides: scale selector (0.5×, 0.75×, 1×, 1.5×, 2×, 3×, 4×), format picker (PNG, JPG, WEBP), multi-export support (add/remove export settings), live preview with checkerboard background, and an Export button. JPG uses white background, PNG/WEBP use transparency.--#### Scenario: Export as PNG-- **WHEN** user sets format to PNG, scale to 2×, and clicks Export-- **THEN** a 2× resolution PNG is saved via native dialog / FSAPI / download--#### Scenario: Export via context menu-- **WHEN** user right-clicks a node and selects "Export…"-- **THEN** the export flow starts for the selected node--#### Scenario: Export via keyboard shortcut-- **WHEN** user presses ⇧⌘E with a node selected-- **THEN** the export flow starts--### Requirement: Splash loader-The editor SHALL display a minimalist loading animation (centered logo + progress bar) during WASM (CanvasKit) initialization. The loader fades out when the canvas is ready.--#### Scenario: Initial load-- **WHEN** user opens the editor-- **THEN** a splash loader is shown until CanvasKit WASM is loaded, then fades outdiff --git a/openspec/changes/archive/2026-03-01-sync-variables-export-cli/specs/scene-graph/spec.md b/openspec/changes/archive/2026-03-01-sync-variables-export-cli/specs/scene-graph/spec.mddeleted file mode 100644index 301c2ee18..000000000--- a/openspec/changes/archive/2026-03-01-sync-variables-export-cli/specs/scene-graph/spec.md+++ /dev/null@@ -1,49 +0,0 @@-# scene-graph Specification (delta)--## New Requirements--### Requirement: Variable types-SceneGraph SHALL support Variable, VariableCollection, VariableCollectionMode types. VariableType is COLOR | FLOAT | STRING | BOOLEAN. VariableValue is Color | number | string | boolean | { aliasId: string }. Variables are stored in a Map keyed by ID. Collections group variables and define modes.--#### Scenario: Create color variable-- **WHEN** a COLOR variable is added with value { r: 1, g: 0, b: 0, a: 1 }-- **THEN** the variable is stored and resolvable by ID--### Requirement: Variable collections and modes-SceneGraph SHALL support variable collections with multiple modes (e.g., Light/Dark). Each collection has an activeMode. Mode switching changes which values are resolved for variables in that collection.--#### Scenario: Switch mode-- **WHEN** a collection has Light and Dark modes, and activeMode is switched to Dark-- **THEN** resolveVariable returns the Dark mode value for variables in that collection--### Requirement: Variable alias resolution-Variables SHALL support alias values ({ aliasId: string }) that reference other variables. Resolution follows the alias chain. Circular aliases SHALL be detected and return undefined (no infinite loop).--#### Scenario: Alias chain-- **WHEN** variable A aliases variable B which has value 42-- **THEN** resolving A returns 42--#### Scenario: Circular alias-- **WHEN** variable A aliases B and B aliases A-- **THEN** resolving A returns undefined--### Requirement: Variable binding to node properties-SceneGraph SHALL support binding variables to node properties via bindVariable(nodeId, field, variableId). Bound fields are stored in the node's variableBindings record. unbindVariable removes a binding.--#### Scenario: Bind color variable to fill-- **WHEN** a COLOR variable is bound to a node's fill-- **THEN** the node's variableBindings record contains the binding--### Requirement: Variable import from .fig files-The .fig import pipeline SHALL parse VARIABLE type NodeChanges and extract paint variable bindings, creating corresponding Variable and VariableCollection objects in the scene graph.--#### Scenario: Import .fig with variables-- **WHEN** a .fig file containing color variables and paint bindings is imported-- **THEN** the variables, collections, and bindings are restored in the scene graph--### Requirement: Remove variable cleans up bindings-Removing a variable SHALL clean up all bindings referencing it across all nodes.--#### Scenario: Remove variable with bindings-- **WHEN** a variable bound to three nodes is removed-- **THEN** all three nodes' variableBindings no longer reference that variablediff --git a/openspec/changes/archive/2026-03-01-sync-variables-export-cli/specs/testing/spec.md b/openspec/changes/archive/2026-03-01-sync-variables-export-cli/specs/testing/spec.mddeleted file mode 100644index fd657ab5f..000000000--- a/openspec/changes/archive/2026-03-01-sync-variables-export-cli/specs/testing/spec.md+++ /dev/null@@ -1,10 +0,0 @@-# testing Specification (delta)--## New Requirements--### Requirement: Variable system unit tests-Unit tests SHALL cover the variables system: add and resolve color/number variables, alias chain resolution, circular alias detection, mode switching, bind/unbind to nodes, and removal cleanup.--#### Scenario: Variable tests pass-- **WHEN** `bun test ./tests/engine` is run-- **THEN** all 7 variable tests pass (total 83+ unit tests)diff --git a/openspec/changes/archive/2026-03-01-sync-variables-export-cli/specs/tooling/spec.md b/openspec/changes/archive/2026-03-01-sync-variables-export-cli/specs/tooling/spec.mddeleted file mode 100644index 865768513..000000000--- a/openspec/changes/archive/2026-03-01-sync-variables-export-cli/specs/tooling/spec.md+++ /dev/null@@ -1,13 +0,0 @@-# tooling Specification (delta)--## Modified Requirements--### Requirement: Bun workspace monorepo (updated)-The project SHALL use Bun workspaces with packages: root (app), packages/core (@open-pencil/core), packages/cli (@open-pencil/cli). The workspace is configured in the root package.json. CLI is runnable via `bun open-pencil` in the workspace.--### Requirement: npm publishing preparation-@open-pencil/core and @open-pencil/cli SHALL have proper package.json fields for npm publishing: name, version, description, exports, main, types, files, license, repository.--#### Scenario: Core package.json is valid-- **WHEN** `npm pack --dry-run` is run in packages/core-- **THEN** the package includes the correct files and metadatadiff --git a/openspec/changes/archive/2026-03-01-sync-variables-export-cli/tasks.md b/openspec/changes/archive/2026-03-01-sync-variables-export-cli/tasks.mddeleted file mode 100644index 8ace660d9..000000000--- a/openspec/changes/archive/2026-03-01-sync-variables-export-cli/tasks.md+++ /dev/null@@ -1,33 +0,0 @@-# Tasks: Sync Variables, Image Export, CLI, Core Extraction--Reference: 21 commits from master (7ff16f7..d30ab4c).-Delta-specs: `openspec/changes/sync-variables-export-cli/specs/` (scene-graph, editor-ui, canvas-rendering, desktop-app, tooling, testing, cli).--Section 1 (specs) must be completed before Section 2 (docs) to ensure docs reference finalized specs.--## 1. Merge Delta-Specs into Main Specs--- [x] 1.1 Update `openspec/specs/scene-graph/spec.md` — add Variable/VariableCollection/VariableCollectionMode types, VariableType (COLOR/FLOAT/STRING/BOOLEAN), VariableValue with alias support, alias chain resolution with cycle detection, collections with modes and activeMode switching, bind/unbind variables to node properties, removal cleans up bindings.-- [x] 1.2 Update `openspec/specs/editor-ui/spec.md` — add VariablesPanel (reka-ui Tabs for collections, Editable for names/values, toggle from layers sidebar), FillSection variable picker (Popover/Combobox, purple badge, detach button), ExportSection (scale 0.5×–4×, format PNG/JPG/WEBP, live preview with checkerboard, multi-export, JPG white bg, PNG/WEBP transparency), ⇧⌘E export shortcut, context menu "Export…", splash loader during WASM init.-- [x] 1.3 Update `openspec/specs/canvas-rendering/spec.md` — add variable binding resolution before painting, image export rendering (offscreen surface, scale, JPG opaque/PNG-WEBP transparent, OffscreenCanvas re-encoding), sceneVersion vs renderVersion split (prevents export preview flicker on pan/zoom).-- [x] 1.4 Update `openspec/specs/desktop-app/spec.md` — add monorepo structure with @open-pencil/core extracted to packages/core/ (zero DOM deps, re-export shims in src/engine/).-- [x] 1.5 Create `openspec/specs/cli/spec.md` — new spec domain for @open-pencil/cli: headless .fig operations (info, tree, find, export), CanvasKit CPU rasterization, --json output.-- [x] 1.6 Update `openspec/specs/tooling/spec.md` — update to Bun workspace monorepo (root + packages/core + packages/cli), add npm publishing preparation.-- [x] 1.7 Update `openspec/specs/testing/spec.md` — add variable system unit tests (7 tests covering color/number resolve, alias chain, circular alias, mode switching, bind/unbind, removal cleanup).--## 2. Update VitePress Docs--- [x] 2.1 Update `docs/guide/features.md` — add "Variables" section (COLOR type with collections, modes, bindings, VariablesPanel, variable picker in FillSection). Add "Image Export" section (PNG/JPG/WEBP, scale selector, ⇧⌘E, context menu). Add "@open-pencil/core & CLI" section (monorepo, headless CLI commands). Update Properties Panel section list to include Export.-- [x] 2.2 Update `docs/guide/figma-comparison.md`:- - Variables (color, number, string, boolean): 🔲→🟡 (COLOR fully implemented with UI; FLOAT/STRING/BOOLEAN types defined but no UI)- - Variable collections & modes: 🔲→🟡 (collections, modes, activeMode work; no variable-driven theming UI yet)- - Image/SVG export: 🔲→🟡 (PNG/JPG/WEBP with scale done; SVG/PDF not yet)- - Add row: CLI tools | 🟡 | info, tree, find, export commands; MCP server not yet- - Update coverage count and date-- [x] 2.3 Update `docs/development/roadmap.md` — add variables (COLOR with UI, bindings, .fig import), image export (PNG/JPG/WEBP + ExportSection), splash loader to Phase 4 Delivered. Add @open-pencil/core extraction and @open-pencil/cli to Phase 5 Delivered. Update Phase 5 Planned to remove items now delivered.-- [x] 2.4 Update `docs/reference/keyboard-shortcuts.md` — add ⇧⌘E (Export…) to File section.-- [x] 2.5 Update `docs/development/contributing.md` — update project structure tree to include packages/core/ and packages/cli/.--## 3. Verify--- [x] 3.1 Run `bun run docs:build` to verify VitePress build passes.diff --git a/openspec/changes/archive/2026-03-01-vitepress-userdoc/.openspec.yaml b/openspec/changes/archive/2026-03-01-vitepress-userdoc/.openspec.yamldeleted file mode 100644index 0b4defe0e..000000000--- a/openspec/changes/archive/2026-03-01-vitepress-userdoc/.openspec.yaml+++ /dev/null@@ -1,2 +0,0 @@-schema: spec-driven-created: 2026-03-01diff --git a/openspec/changes/archive/2026-03-01-vitepress-userdoc/design.md b/openspec/changes/archive/2026-03-01-vitepress-userdoc/design.mddeleted file mode 100644index f4e9a0b8e..000000000--- a/openspec/changes/archive/2026-03-01-vitepress-userdoc/design.md+++ /dev/null@@ -1,49 +0,0 @@-## Context--The project has a VitePress docs site at `docs/` with three sections: Guide (getting started, features, architecture, tech stack, comparison), Reference (shortcuts, node types, MCP tools, scene graph, file format), and Development (contributing, testing, openspec, roadmap). All content is developer/contributor-oriented.--OpenSpec `openspec/specs/` contains 24 feature specs with detailed requirements and scenarios covering every user-facing feature. These specs are the authoritative source of truth for what the editor can do.--## Goals / Non-Goals--**Goals:**-- Add a "User Guide" section to VitePress with task-oriented articles derived from OpenSpec specs-- Cover all user-facing features: canvas navigation, selection, drawing, auto-layout, components, text, pen tool, layers/pages, context menu, export, variables-- Each article explains how to use the feature with keyboard shortcuts, step-by-step instructions, and tips-- Articles follow consistent structure: intro, how-to steps, shortcuts table, tips--**Non-Goals:**-- Automated spec-to-docs pipeline (manual generation this time, automation later)-- Screenshots or video content (text-only for now)-- API/developer documentation (already covered in existing sections)-- Translating docs to other languages--## Decisions--**Article structure**: Each article follows a consistent template: brief intro → feature walkthrough with subsections → keyboard shortcuts table → tips/notes. This mirrors how Figma's help center organizes content and is familiar to design tool users.--**File organization**: All user guide articles live under `docs/user-guide/` with an `index.md` landing page. Naming matches the feature area (e.g., `canvas-navigation.md`, `auto-layout.md`).--**Sidebar placement**: The "User Guide" group goes first in the sidebar, before the existing Guide section. User docs are the primary audience; developer docs are secondary.--**Content derivation**: Each article is written by reading the corresponding OpenSpec spec(s) and translating requirements/scenarios into user-friendly how-to content. The spec's Purpose and Scenarios provide the skeleton; the article adds context, flow, and readability.--**Article list** (12 articles):-1. `index.md` — overview with links to all articles-2. `canvas-navigation.md` — from `canvas-navigation` spec-3. `selection-and-manipulation.md` — from `selection-manipulation` spec-4. `drawing-shapes.md` — from `editor-ui` spec (toolbar, shape tools) + `canvas-rendering` spec-5. `auto-layout.md` — from `auto-layout` spec-6. `components.md` — from `components` spec-7. `text-editing.md` — from `text-editing` spec-8. `pen-tool.md` — from `pen-tool` spec-9. `layers-and-pages.md` — from `editor-ui` spec (layers panel, pages panel)-10. `context-menu.md` — from `context-menu` spec-11. `exporting.md` — from `editor-ui` spec (export section) + `fig-import` spec-12. `variables.md` — from `editor-ui` spec (variables dialog, fill variable picker)--## Risks / Trade-offs--- [Content drift] Specs evolve but docs may lag → Mitigate by documenting the spec-to-doc mapping so future changes can update both-- [No screenshots] Text-only docs are less engaging → Acceptable for v1; screenshots can be added later-- [Mac-centric shortcuts] Shortcuts use ⌘ notation → Add a note about Ctrl equivalents on Linux/Windowsdiff --git a/openspec/changes/archive/2026-03-01-vitepress-userdoc/proposal.md b/openspec/changes/archive/2026-03-01-vitepress-userdoc/proposal.mddeleted file mode 100644index 87c1534ae..000000000--- a/openspec/changes/archive/2026-03-01-vitepress-userdoc/proposal.md+++ /dev/null@@ -1,25 +0,0 @@-## Why--The existing VitePress docs site (`docs/`) is developer-focused — architecture, reference, contributing. There's no user-facing documentation that explains how to actually use the editor. New users have no guide for canvas navigation, drawing shapes, using auto-layout, working with components, editing text, etc. A "User Guide" section derived from the OpenSpec specifications would provide task-oriented documentation covering all implemented features.--## What Changes--- Add a new `User Guide` sidebar group in VitePress with articles covering each user-facing feature area-- Generate articles from OpenSpec specs: canvas navigation, selection & manipulation, drawing & shapes, auto-layout, components & instances, text editing, pen tool, layers & pages, context menu, export, keyboard shortcuts summary-- Add a user guide landing page with feature overview and navigation-- Update VitePress config sidebar/nav to include the new section-- Keep existing Guide/Reference/Development sections unchanged--## Capabilities--### New Capabilities-- `userdoc-articles`: VitePress user documentation pages generated from OpenSpec specs — canvas navigation, selection, shapes, auto-layout, components, text, pen tool, layers, export, and variables--### Modified Capabilities-- `vitepress-docs`: Adding a new "User Guide" sidebar group and nav entry to the existing VitePress config--## Impact--- `docs/` — new `.md` files under `docs/user-guide/`-- `docs/.vitepress/config.ts` — sidebar and nav updates-- No runtime code changes, no dependency changesdiff --git a/openspec/changes/archive/2026-03-01-vitepress-userdoc/specs/userdoc-articles/spec.md b/openspec/changes/archive/2026-03-01-vitepress-userdoc/specs/userdoc-articles/spec.mddeleted file mode 100644index 031496eaa..000000000--- a/openspec/changes/archive/2026-03-01-vitepress-userdoc/specs/userdoc-articles/spec.md+++ /dev/null@@ -1,99 +0,0 @@-## ADDED Requirements--### Requirement: User guide landing page-The docs site SHALL have an `index.md` at `docs/user-guide/` with the title "User Guide", a brief description of OpenPencil's capabilities, and links to all user guide articles organized by category.--#### Scenario: Landing page renders-- **WHEN** user navigates to /user-guide/-- **THEN** a page with "User Guide" title and categorized links to all articles is displayed--### Requirement: Canvas navigation article-The docs site SHALL have a `canvas-navigation.md` article in `docs/user-guide/` documenting panning (space+drag, middle mouse, trackpad, hand tool), zooming (ctrl+scroll, pinch, keyboard shortcuts), and zoom reset.--#### Scenario: Canvas navigation article renders-- **WHEN** user navigates to /user-guide/canvas-navigation-- **THEN** an article explaining panning, zooming, and hand tool usage is displayed with a shortcuts table--### Requirement: Selection and manipulation article-The docs site SHALL have a `selection-and-manipulation.md` article documenting click select, shift multi-select, marquee selection, move by drag, resize handles, rotation with shift snapping, alt+drag duplicate, ⌘D duplicate, nudge with arrows, delete, select all, z-order (]/[), visibility toggle (⇧⌘H), lock toggle (⇧⌘L), and move-to-page.--#### Scenario: Selection article renders-- **WHEN** user navigates to /user-guide/selection-and-manipulation-- **THEN** an article explaining all selection and manipulation operations is displayed--### Requirement: Drawing shapes article-The docs site SHALL have a `drawing-shapes.md` article documenting the bottom toolbar shape tools: Rectangle (R), Ellipse (O), Line (L), Polygon, Star, Frame (F), Section (S). It SHALL cover constrained drawing with Shift, shape properties (fill, stroke, corner radius, effects), and the shapes flyout.--#### Scenario: Drawing shapes article renders-- **WHEN** user navigates to /user-guide/drawing-shapes-- **THEN** an article explaining shape creation with tool shortcuts and property editing is displayed--### Requirement: Auto-layout article-The docs site SHALL have an `auto-layout.md` article documenting Shift+A toggle, layout direction, gap, padding, justify, align, child sizing (fixed/fill/hug), drag reordering, and wrapping selection in auto-layout.--#### Scenario: Auto-layout article renders-- **WHEN** user navigates to /user-guide/auto-layout-- **THEN** an article explaining auto-layout creation and configuration is displayed--### Requirement: Components article-The docs site SHALL have a `components.md` article documenting component creation (⌥⌘K), component sets (⇧⌘K), instance creation (context menu), detach instance (⌥⌘B), go-to-main-component, live sync, overrides, and visual treatment (purple labels, dashed borders).--#### Scenario: Components article renders-- **WHEN** user navigates to /user-guide/components-- **THEN** an article explaining the full component workflow is displayed--### Requirement: Text editing article-The docs site SHALL have a `text-editing.md` article documenting the Text tool (T), inline editing (double-click), cursor navigation (arrow keys, ⌘←/→, ⌥←/→), text selection (click, drag, double-click word, triple-click all), rich text formatting (⌘B/I/U), font picker, and font weight.--#### Scenario: Text editing article renders-- **WHEN** user navigates to /user-guide/text-editing-- **THEN** an article explaining text creation and editing is displayed--### Requirement: Pen tool article-The docs site SHALL have a `pen-tool.md` article documenting the Pen tool (P), placing corner points (click), curve points (click+drag with bezier handles), closing paths (click first point), committing open paths (Escape), and the preview line.--#### Scenario: Pen tool article renders-- **WHEN** user navigates to /user-guide/pen-tool-- **THEN** an article explaining vector path creation is displayed--### Requirement: Layers and pages article-The docs site SHALL have a `layers-and-pages.md` article documenting the layers panel (tree view, expand/collapse, drag reorder, visibility toggle, rename), pages panel (switch, add, delete, rename), and the properties panel tabs (Design, Code, AI).--#### Scenario: Layers and pages article renders-- **WHEN** user navigates to /user-guide/layers-and-pages-- **THEN** an article explaining layer management and page operations is displayed--### Requirement: Context menu article-The docs site SHALL have a `context-menu.md` article documenting right-click actions: clipboard (copy, cut, paste, duplicate, delete), z-order (bring to front, send to back), grouping (group, ungroup, add auto-layout), component actions, visibility/lock, and move-to-page submenu.--#### Scenario: Context menu article renders-- **WHEN** user navigates to /user-guide/context-menu-- **THEN** an article listing all context menu actions with their shortcuts is displayed--### Requirement: Exporting article-The docs site SHALL have an `exporting.md` article documenting the export section in properties panel (scale, format, multi-export), export via context menu, ⇧⌘E shortcut, supported formats (PNG, JPG, WEBP), .fig file save (⌘S, ⇧⌘S), and .fig file import.--#### Scenario: Exporting article renders-- **WHEN** user navigates to /user-guide/exporting-- **THEN** an article explaining image export and file operations is displayed--### Requirement: Variables article-The docs site SHALL have a `variables.md` article documenting the variables dialog (collections, modes, table), creating variables, editing values, color variables, binding variables to fills, and detaching variable bindings.--#### Scenario: Variables article renders-- **WHEN** user navigates to /user-guide/variables-- **THEN** an article explaining design variables and their usage is displayed--### Requirement: Cross-platform shortcut note-Each article that includes keyboard shortcuts SHALL include a note that ⌘ corresponds to Ctrl on Windows/Linux, and ⌥ corresponds to Alt.--#### Scenario: Shortcut platform note present-- **WHEN** user reads any user guide article with a shortcuts table-- **THEN** a note about cross-platform key equivalents is visible--### Requirement: Consistent article structure-Each user guide article SHALL follow a consistent structure: title, brief introduction, feature walkthrough with subsections, keyboard shortcuts table (where applicable), and tips section.--#### Scenario: Article structure consistency-- **WHEN** user reads any user guide article-- **THEN** the article has an intro paragraph, subsections explaining features, and a shortcuts tablediff --git a/openspec/changes/archive/2026-03-01-vitepress-userdoc/specs/vitepress-docs/spec.md b/openspec/changes/archive/2026-03-01-vitepress-userdoc/specs/vitepress-docs/spec.mddeleted file mode 100644index f09837181..000000000--- a/openspec/changes/archive/2026-03-01-vitepress-userdoc/specs/vitepress-docs/spec.md+++ /dev/null@@ -1,16 +0,0 @@-## MODIFIED Requirements--### Requirement: Sidebar navigation-The VitePress config SHALL define a sidebar with logical grouping: User Guide, Guide, Reference, Development. The User Guide group SHALL appear first and include entries for all user guide articles. The Guide group SHALL include a "Figma Feature Matrix" entry after "Comparison" linking to `/guide/figma-comparison`.--#### Scenario: Sidebar groups-- **WHEN** user browses any documentation page-- **THEN** a sidebar shows four collapsible groups: User Guide, Guide, Reference, Development--#### Scenario: User Guide sidebar entries-- **WHEN** user views the User Guide sidebar section-- **THEN** entries for all 12 user guide articles are listed in logical order--#### Scenario: Figma comparison in sidebar-- **WHEN** user views the Guide sidebar section-- **THEN** a "Figma Feature Matrix" entry appears after "Comparison" linking to `/guide/figma-comparison`diff --git a/openspec/changes/archive/2026-03-01-vitepress-userdoc/tasks.md b/openspec/changes/archive/2026-03-01-vitepress-userdoc/tasks.mddeleted file mode 100644index 5f4af6df3..000000000--- a/openspec/changes/archive/2026-03-01-vitepress-userdoc/tasks.md+++ /dev/null@@ -1,30 +0,0 @@-## 1. User Guide Landing Page--- [x] 1.1 Create `docs/user-guide/index.md` with `layout: doc` frontmatter (title, description), intro paragraph, and categorized links to all articles (Getting Around, Creating Content, Organizing & Managing, Advanced Features). Include cross-platform shortcut note (⌘=Ctrl, ⌥=Alt on Win/Linux) that all articles reference.--## 2. Core Articles — Getting Around--- [x] 2.1 Create `docs/user-guide/canvas-navigation.md` — derived from `openspec/specs/canvas-navigation/spec.md`. Frontmatter with title+description. Sections: Panning (space+drag, middle mouse, trackpad, hand tool H), Zooming (ctrl+scroll, pinch, ⌘+/⌘-/⌘0). Shortcuts table with Mac and Win/Linux columns. Cross-link to selection article.-- [x] 2.2 Create `docs/user-guide/selection-and-manipulation.md` — derived from `openspec/specs/selection-manipulation/spec.md`. Frontmatter. Sections: Selecting (click/shift/marquee/⌘A), Moving (drag, arrow nudge 1px/10px), Resizing (8 handles, shift=proportional), Rotating (shift=15° snap), Duplicating (alt+drag, ⌘D), Deleting (⌫), Z-order (]/[), Visibility (⇧⌘H), Lock (⇧⌘L), Move-to-page. Shortcuts table Mac+Win/Linux. Cross-links to context-menu, layers articles.--## 3. Core Articles — Creating Content--- [x] 3.1 Create `docs/user-guide/drawing-shapes.md` — derived from `openspec/specs/editor-ui/spec.md` (toolbar, shape tools) + `openspec/specs/canvas-rendering/spec.md`. Frontmatter. Sections: Toolbar overview, Shape tools (Rectangle R, Ellipse O, Line L, Frame F, Section S), Shapes flyout (Polygon, Star), Constrained drawing (shift), Shape properties (fill, stroke, corner radius, effects). Shortcuts table. Cross-links to auto-layout, exporting.-- [x] 3.2 Create `docs/user-guide/text-editing.md` — derived from `openspec/specs/text-editing/spec.md`. Frontmatter. Sections: Creating text (T tool), Inline editing (double-click), Cursor navigation (arrows, ⌘←/→, ⌥←/→), Text selection (click/drag/double-click=word/triple-click=all), Rich text formatting (⌘B/I/U/S), Font picker, Font weight. Shortcuts table. Cross-link to components.-- [x] 3.3 Create `docs/user-guide/pen-tool.md` — derived from `openspec/specs/pen-tool/spec.md`. Frontmatter. Sections: Activating (P), Corner points (click), Curve points (click+drag, bezier handles), Closing paths (click first point), Open paths (Escape), Preview line. Shortcuts table.--## 4. Core Articles — Organizing & Managing--- [x] 4.1 Create `docs/user-guide/layers-and-pages.md` — derived from `openspec/specs/editor-ui/spec.md` (layers panel, pages panel). Frontmatter. Sections: Layers panel (tree view, expand/collapse, drag reorder, visibility toggle, rename), Pages panel (switch, add, delete, inline rename), Properties panel tabs (Design/Code/AI). Cross-links to selection, components.-- [x] 4.2 Create `docs/user-guide/context-menu.md` — derived from `openspec/specs/context-menu/spec.md`. Frontmatter. Sections: Opening (right-click), Clipboard actions (⌘C/X/V, ⌘D, ⌫), Z-order (]/[), Grouping (⌘G/⇧⌘G, ⇧A), Component actions (purple: ⌥⌘K, ⇧⌘K, create instance, go-to-main, ⌥⌘B), Visibility/Lock (⇧⌘H/⇧⌘L), Move-to-page submenu. Full action table.-- [x] 4.3 Create `docs/user-guide/exporting.md` — derived from `openspec/specs/editor-ui/spec.md` (export section) + `openspec/specs/fig-import/spec.md`. Frontmatter. Sections: Image export (scale 0.5×–4×, format PNG/JPG/WEBP, multi-export, ⇧⌘E, context menu), File operations (.fig save ⌘S/⇧⌘S, .fig import/open). Shortcuts table.--## 5. Core Articles — Advanced Features--- [x] 5.1 Create `docs/user-guide/auto-layout.md` — derived from `openspec/specs/auto-layout/spec.md`. Frontmatter. Sections: Enabling (⇧A toggle), Direction (horizontal/vertical/wrap), Spacing (gap, padding uniform+per-side), Alignment (justify, align), Child sizing (fixed/fill/hug), Drag reordering, Wrapping selection. Shortcuts table. Cross-link to components, drawing-shapes.-- [x] 5.2 Create `docs/user-guide/components.md` — derived from `openspec/specs/components/spec.md`. Frontmatter. Sections: Creating components (⌥⌘K, single vs multi-node), Component sets (⇧⌘K, dashed purple border), Instances (context menu, placed 40px right), Detaching (⌥⌘B), Go-to-main (context menu, cross-page), Live sync (fills, size, effects, layout), Overrides (child property preservation), Visual treatment (purple labels, opaque hit testing, double-click to enter). Shortcuts table.-- [x] 5.3 Create `docs/user-guide/variables.md` — derived from `openspec/specs/editor-ui/spec.md` (variables dialog, fill variable picker). Frontmatter. Sections: Opening variables dialog (settings icon in page properties), Collections and modes, Creating/editing variables, Color variables (inline color input), Binding to fills (purple badge), Detaching bindings. Cross-link to drawing-shapes.--## 6. VitePress Config Update--- [x] 6.1 Update `docs/.vitepress/config.ts` — add "User Guide" as first sidebar group with entries: Overview (/user-guide/), Canvas Navigation, Selection & Manipulation, Drawing Shapes, Text Editing, Pen Tool, Layers & Pages, Context Menu, Exporting, Auto Layout, Components, Variables. Add "User Guide" nav entry before existing "Guide". Verify existing Guide/Reference/Development groups unchanged.diff --git a/openspec/changes/archive/2026-03-03-pwa-support/.openspec.yaml b/openspec/changes/archive/2026-03-03-pwa-support/.openspec.yamldeleted file mode 100644index 85cf50d8b..000000000--- a/openspec/changes/archive/2026-03-03-pwa-support/.openspec.yaml+++ /dev/null@@ -1,2 +0,0 @@-schema: spec-driven-created: 2026-03-03diff --git a/openspec/changes/archive/2026-03-03-pwa-support/design.md b/openspec/changes/archive/2026-03-03-pwa-support/design.mddeleted file mode 100644index 6b2121f2f..000000000--- a/openspec/changes/archive/2026-03-03-pwa-support/design.md+++ /dev/null@@ -1,61 +0,0 @@-## Context--OpenPencil web app is deployed to Cloudflare Pages at `app.openpencil.dev`. The build produces a ~11MB `dist/` with a 7MB CanvasKit WASM, ~2.4MB JS bundle, fonts, and icons. The app uses Vue 3 + Vite, renders entirely on a WebGL canvas (no DOM rendering for design content), and has two routes (`/` and `/share/:roomId`). There is no service worker or manifest — the web app cannot be installed or used offline.--The Tauri desktop app shares the same frontend but wraps it in a native shell with native file dialogs, Zstd compression, and system font access via Rust commands. PWA must not interfere with Tauri runtime.--## Goals / Non-Goals--**Goals:**-- Make the web app installable (A2HS prompt, standalone window)-- Precache critical assets (WASM, fonts, JS/CSS) so the app shell loads offline-- Generate the manifest and SW at build time with zero manual maintenance-- Conditionally skip SW registration inside Tauri webview--**Non-Goals:**-- Full offline editing (requires IndexedDB document persistence — separate change)-- Background sync or push notifications-- Caching user-uploaded images or .fig files in the SW-- Custom update UI (use `vite-plugin-pwa` autoUpdate for now)--## Decisions--### 1. Use `vite-plugin-pwa` with Workbox `generateSW`--**Rationale:** `vite-plugin-pwa` is the standard for Vite projects. `generateSW` (vs `injectManifest`) is simpler — Workbox auto-generates the SW with precache manifest from the build output. No custom SW logic needed at this stage.--**Alternatives considered:**-- Manual `workbox-cli` — more boilerplate, must maintain SW separately-- `injectManifest` — gives full SW control but overkill for asset precaching--### 2. `autoUpdate` registration type--**Rationale:** The app is a single-page editor. Auto-updating the SW on new versions avoids stale caches without needing a "New version available" prompt. Users always get the latest build on next visit.--**Alternatives considered:**-- `prompt` — shows update banner, but adds UI complexity for minimal benefit in an editor app where the session is typically fresh--### 3. Precache strategy: all build output including WASM--**Rationale:** The 7MB CanvasKit WASM is the critical asset. Without it, the app is a blank screen. Precaching it means repeat visits load instantly even on slow connections. Workbox's `maximumFileSizeToCacheInBytes` must be raised to ~8MB.--The `Inter-Regular.ttf` font in `public/` will also be precached as part of the glob.--### 4. Guard SW registration with `IS_TAURI`--**Rationale:** Inside Tauri's webview, a service worker would intercept network requests unnecessarily and could conflict with Tauri's IPC. The `IS_TAURI` constant from `@open-pencil/core` already exists and is the project convention for Tauri detection.--### 5. `standalone` display mode--**Rationale:** Matches the desktop app experience — no browser chrome. The editor uses the full viewport. `minimal-ui` would add a browser nav bar that wastes space and conflicts with the editor's own toolbar.--### 6. Icon generation from existing favicon-128--**Rationale:** The project already has `favicon-128.png` and `apple-touch-icon.png`. PWA requires 192×192 and 512×512. These need to be created once and committed to `public/`. A maskable variant (with padding) is needed for Android adaptive icons.--## Risks / Trade-offs--- [Large precache payload (~10MB)] → Acceptable for a design editor. First visit already downloads all this; SW just caches it for subsequent visits. Cloudflare Pages has no bandwidth cost.-- [SW cache invalidation] → Workbox uses content hashes in the precache manifest. New builds automatically invalidate changed assets.-- [Tauri interference] → Mitigated by `IS_TAURI` guard. SW is never registered in Tauri context.-- [Cloudflare Pages MIME type for `.webmanifest`] → Cloudflare Pages serves `.webmanifest` with correct `application/manifest+json` MIME type by default.diff --git a/openspec/changes/archive/2026-03-03-pwa-support/proposal.md b/openspec/changes/archive/2026-03-03-pwa-support/proposal.mddeleted file mode 100644index 1ac120969..000000000--- a/openspec/changes/archive/2026-03-03-pwa-support/proposal.md+++ /dev/null@@ -1,30 +0,0 @@-## Why--OpenPencil's web version (app.openpencil.dev) is a full-featured design editor deployed to Cloudflare Pages, but it lacks offline capability and native app-like UX. Users lose their work if they navigate away or lose connection. Adding PWA support enables installability, offline access to the shell/cached assets, and positions the web app closer to the Tauri desktop experience.--## What Changes--- Add a web app manifest (`manifest.webmanifest`) with app metadata, icons, and display mode-- Add a service worker for asset precaching (WASM, fonts, JS/CSS bundles) and runtime caching-- Integrate `vite-plugin-pwa` into the Vite build pipeline-- Register the service worker in the app entry point (browser only, skip in Tauri)-- Add PWA meta tags to `index.html` (theme-color, manifest link, apple status bar)-- Generate required icon sizes from existing assets (192×192, 512×512, maskable)--## Capabilities--### New Capabilities-- `pwa`: Progressive Web App support — manifest, service worker, installability, offline shell caching--### Modified Capabilities-- `desktop-app`: Guard service worker registration to avoid conflicts with Tauri runtime--## Impact--- **Vite config**: New plugin (`vite-plugin-pwa`) with workbox configuration-- **Dependencies**: `vite-plugin-pwa` (dev dependency)-- **index.html**: Meta tags for theme-color, manifest link-- **src/main.ts**: Service worker registration (conditional on non-Tauri)-- **public/**: Manifest file, PWA icons (192, 512, maskable)-- **CI**: No changes needed — `bun run build` already deploys to Cloudflare Pages, manifest + SW output automatically included in `dist/`-- **Bundle size impact**: Service worker file (~1KB generated), manifest file (<1KB). No impact on app JS bundle. WASM (~7MB) and fonts will be precached by the SW.diff --git a/openspec/changes/archive/2026-03-03-pwa-support/specs/desktop-app/spec.md b/openspec/changes/archive/2026-03-03-pwa-support/specs/desktop-app/spec.mddeleted file mode 100644index 4d400ded7..000000000--- a/openspec/changes/archive/2026-03-03-pwa-support/specs/desktop-app/spec.md+++ /dev/null@@ -1,12 +0,0 @@-## MODIFIED Requirements--### Requirement: Tauri v2 desktop shell-The editor SHALL run as a native desktop app via Tauri v2 with the web frontend loaded in a webview. The app identifier SHALL be `net.dannote.open-pencil`. When running inside the Tauri webview, the service worker SHALL NOT be registered to avoid intercepting Tauri IPC and native file system requests.--#### Scenario: Desktop app launch-- **WHEN** user runs `bun run tauri dev`-- **THEN** a native desktop window opens with the editor UI and CanvasKit rendering--#### Scenario: No service worker in Tauri-- **WHEN** the app loads inside the Tauri webview-- **THEN** `navigator.serviceWorker.register` is never called and no SW is activediff --git a/openspec/changes/archive/2026-03-03-pwa-support/specs/pwa/spec.md b/openspec/changes/archive/2026-03-03-pwa-support/specs/pwa/spec.mddeleted file mode 100644index b958d790f..000000000--- a/openspec/changes/archive/2026-03-03-pwa-support/specs/pwa/spec.md+++ /dev/null@@ -1,51 +0,0 @@-## ADDED Requirements--### Requirement: Web app manifest-The app SHALL include a `manifest.webmanifest` file linked from `index.html` with `name` "OpenPencil", `short_name` "OpenPencil", `display` "standalone", `start_url` "/", `theme_color` "#1e1e1e", `background_color` "#1e1e1e", and icon entries for 192×192, 512×512, and maskable variants.--#### Scenario: Manifest served correctly-- **WHEN** a browser requests `/manifest.webmanifest`-- **THEN** the response is a valid JSON manifest with `display: "standalone"` and at least three icon entries--#### Scenario: Installability criteria met-- **WHEN** Chrome audits the web app for PWA installability-- **THEN** all criteria pass: manifest present, service worker registered, start_url responds, icons present--### Requirement: Service worker precaching-The build SHALL generate a service worker that precaches all build output assets including JavaScript bundles, CSS, WASM files, fonts, and icons. The Workbox `maximumFileSizeToCacheInBytes` SHALL be set to at least 8MB to accommodate the CanvasKit WASM (~7MB).--#### Scenario: Assets cached on first visit-- **WHEN** a user visits the app for the first time in a browser-- **THEN** the service worker installs and all precache-manifest assets are stored in CacheStorage--#### Scenario: App shell loads offline-- **WHEN** a user has previously visited the app and then loses network connectivity-- **THEN** the app shell (HTML, JS, CSS, WASM, fonts) loads from cache and the canvas initializes--### Requirement: Auto-update strategy-The service worker SHALL use an auto-update strategy: when a new version is detected, the SW activates immediately without requiring user interaction. The `skipWaiting` and `clientsClaim` options SHALL be enabled.--#### Scenario: Transparent update on new deployment-- **WHEN** a new version is deployed and the user revisits the app-- **THEN** the new service worker activates and serves updated assets without a reload prompt--### Requirement: PWA meta tags-`index.html` SHALL include `<meta name="theme-color" content="#1e1e1e">` and `<link rel="manifest" href="/manifest.webmanifest">`. The existing `apple-touch-icon` link SHALL be preserved.--#### Scenario: Theme color matches app background-- **WHEN** the browser reads meta tags-- **THEN** `theme-color` is `#1e1e1e` matching the app's dark background--### Requirement: PWA icons-The `public/` directory SHALL contain PWA icons at 192×192 (`pwa-192.png`), 512×512 (`pwa-512.png`), and a maskable icon at 512×512 (`pwa-maskable-512.png`) with safe-zone padding.--#### Scenario: Icon sizes available-- **WHEN** the manifest is parsed-- **THEN** icons at 192×192 (purpose "any"), 512×512 (purpose "any"), and 512×512 (purpose "maskable") are referenced and the files exist--### Requirement: Vite plugin integration-`vite-plugin-pwa` SHALL be configured in `vite.config.ts` using `generateSW` mode with `autoUpdate` registration type. The plugin SHALL be added to the Vite plugins array.--#### Scenario: Build produces SW-- **WHEN** `bun run build` completes-- **THEN** `dist/sw.js` and `dist/workbox-*.js` files exist alongside the precache manifestdiff --git a/openspec/changes/archive/2026-03-03-pwa-support/tasks.md b/openspec/changes/archive/2026-03-03-pwa-support/tasks.mddeleted file mode 100644index 51b443711..000000000--- a/openspec/changes/archive/2026-03-03-pwa-support/tasks.md+++ /dev/null@@ -1,21 +0,0 @@-## 1. Dependencies & Icons--- [x] 1.1 Install `vite-plugin-pwa` as a dev dependency-- [x] 1.2 Create PWA icons: `public/pwa-192.png`, `public/pwa-512.png`, `public/pwa-maskable-512.png` from existing `public/favicon-128.png`--## 2. Vite Plugin Configuration--- [x] 2.1 Add `vite-plugin-pwa` to `vite.config.ts` with `generateSW` mode, `autoUpdate` registration, `standalone` display, theme/background colors `#1e1e1e`, icon entries, and `maximumFileSizeToCacheInBytes` ≥ 8MB--## 3. HTML Meta Tags--- [x] 3.1 Add `<meta name="theme-color" content="#1e1e1e">` and `<link rel="manifest" href="/manifest.webmanifest">` to `index.html`--## 4. Service Worker Registration--- [x] 4.1 Register the service worker in `src/main.ts` using `virtual:pwa-register`, guarded by `IS_TAURI` to skip registration in the Tauri webview--## 5. Verification--- [x] 5.1 Run `bun run build` and verify `dist/sw.js`, `dist/manifest.webmanifest`, and PWA icon files exist in output-- [x] 5.2 Run `bun run check` to confirm lint and typecheck passdiff --git a/openspec/changes/archive/2026-03-03-sync-and-i18n-docs/.openspec.yaml b/openspec/changes/archive/2026-03-03-sync-and-i18n-docs/.openspec.yamldeleted file mode 100644index 85cf50d8b..000000000--- a/openspec/changes/archive/2026-03-03-sync-and-i18n-docs/.openspec.yaml+++ /dev/null@@ -1,2 +0,0 @@-schema: spec-driven-created: 2026-03-03diff --git a/openspec/changes/archive/2026-03-03-sync-and-i18n-docs/design.md b/openspec/changes/archive/2026-03-03-sync-and-i18n-docs/design.mddeleted file mode 100644index f706167c1..000000000--- a/openspec/changes/archive/2026-03-03-sync-and-i18n-docs/design.md+++ /dev/null@@ -1,15 +0,0 @@-## Context--Retrospective sync + i18n expansion. Code merged, specs stale. VitePress i18n uses directory-per-locale pattern.--## Goals / Non-Goals--**Goals:** Sync specs, add 5 translations to docs site.-**Non-Goals:** Translate reference/development pages (too technical). Translate specs. Code changes.--## Decisions--1. **Translate user-guide + guide pages only** — reference and development pages stay English-only (code examples, API docs don't benefit from translation).-2. **VitePress directory-per-locale** — `de/`, `it/`, `fr/`, `es/`, `pl/` under `packages/docs/`. Root stays English.-3. **Sidebar and nav translations** — each locale gets translated sidebar labels and nav items in config.ts.-4. **Pages to translate per locale** (17 pages): index.md, guide/getting-started.md, guide/features.md, guide/comparison.md, guide/architecture.md, guide/tech-stack.md, guide/figma-comparison.md, user-guide/index.md, user-guide/canvas-navigation.md, user-guide/selection-and-manipulation.md, user-guide/drawing-shapes.md, user-guide/text-editing.md, user-guide/pen-tool.md, user-guide/layers-and-pages.md, user-guide/context-menu.md, user-guide/exporting.md, user-guide/auto-layout.md, user-guide/components.md, user-guide/variables.md.diff --git a/openspec/changes/archive/2026-03-03-sync-and-i18n-docs/proposal.md b/openspec/changes/archive/2026-03-03-sync-and-i18n-docs/proposal.mddeleted file mode 100644index 649a59ba3..000000000--- a/openspec/changes/archive/2026-03-03-sync-and-i18n-docs/proposal.md+++ /dev/null@@ -1,25 +0,0 @@-## Why--Master advanced significantly: P2P collaboration, MCP server package, multi-file tabs, 29 tools, performance optimizations, effects rendering fixes. Specs are out of sync. Additionally, the documentation site has no translations — adding German, Italian, French, Spanish, and Polish expands the audience.--## What Changes--- Update OpenSpec specs to reflect master changes (collab, MCP, multi-tabs, performance, effects)-- Update Figma comparison matrix (multiplayer ✅, MCP ✅, CLI ✅, stats recalculated)-- Add VitePress i18n: translate user-facing docs to de, it, fr, es, pl-- Configure VitePress locales in config.ts--## Capabilities--### New Capabilities-- `docs-i18n`: VitePress internationalization with 5 language directories and locale config--### Modified Capabilities-- `vitepress-docs`: add i18n config, locale switcher-- `tooling`: add MCP package to workspace listing--## Impact--- **Docs:** ~145 new translated md files (29 pages × 5 languages)-- **Config:** packages/docs/.vitepress/config.ts locale setup-- **Specs:** updates to reflect P2P collab, MCP, multi-tabs, effects, performancediff --git a/openspec/changes/archive/2026-03-03-sync-and-i18n-docs/specs/docs-i18n/spec.md b/openspec/changes/archive/2026-03-03-sync-and-i18n-docs/specs/docs-i18n/spec.mddeleted file mode 100644index bf01a2f2c..000000000--- a/openspec/changes/archive/2026-03-03-sync-and-i18n-docs/specs/docs-i18n/spec.md+++ /dev/null@@ -1,37 +0,0 @@-## ADDED Requirements--### Requirement: Documentation available in 5 additional languages--The docs site SHALL provide translations of user-facing pages in German (de), Italian (it), French (fr), Spanish (es), and Polish (pl).--#### Scenario: Navigating to German docs-- **WHEN** user selects "Deutsch" from language switcher-- **THEN** site displays translated pages under `/de/` path--#### Scenario: Translated landing page-- **WHEN** user visits `/fr/`-- **THEN** French landing page with translated hero text and feature cards is shown--#### Scenario: Translated user guide-- **WHEN** user navigates to `/es/user-guide/`-- **THEN** Spanish translations of all user guide articles are available--### Requirement: Directory-per-locale structure--Each locale SHALL have its own directory under `packages/docs/` mirroring the English page structure.--#### Scenario: Locale directories exist-- **WHEN** build runs-- **THEN** `packages/docs/de/`, `it/`, `fr/`, `es/`, `pl/` directories contain translated .md files--### Requirement: VitePress locale configuration--The `.vitepress/config.ts` SHALL define locales with translated labels, nav, and sidebar.--#### Scenario: Language switcher visible-- **WHEN** user opens any docs page-- **THEN** a language dropdown appears in the nav with English, Deutsch, Italiano, Français, Español, Polski--#### Scenario: Sidebar translated-- **WHEN** user browses German docs-- **THEN** sidebar group labels and item names are in Germandiff --git a/openspec/changes/archive/2026-03-03-sync-and-i18n-docs/specs/vitepress-docs/spec.md b/openspec/changes/archive/2026-03-03-sync-and-i18n-docs/specs/vitepress-docs/spec.mddeleted file mode 100644index 0c8d67b76..000000000--- a/openspec/changes/archive/2026-03-03-sync-and-i18n-docs/specs/vitepress-docs/spec.md+++ /dev/null@@ -1,12 +0,0 @@-## MODIFIED Requirements--### Requirement: VitePress documentation site-The project SHALL have a VitePress documentation site in the `packages/docs/` directory as `@open-pencil/docs` workspace package, with its own `.vitepress/config.ts` configuration, `package.json`, and locale configuration for 6 languages (en, de, it, fr, es, pl).--#### Scenario: Docs dev server starts-- **WHEN** `cd packages/docs && bun run dev` is executed-- **THEN** VitePress dev server starts with all locales available--#### Scenario: Docs build succeeds-- **WHEN** `cd packages/docs && bun run build` is executed-- **THEN** VitePress produces a static site with all locale pagesdiff --git a/openspec/changes/archive/2026-03-03-sync-and-i18n-docs/tasks.md b/openspec/changes/archive/2026-03-03-sync-and-i18n-docs/tasks.mddeleted file mode 100644index fbd6b21b4..000000000--- a/openspec/changes/archive/2026-03-03-sync-and-i18n-docs/tasks.md+++ /dev/null@@ -1,32 +0,0 @@-## Context--Sync with master (P2P collab, MCP, multi-tabs, 29 tools, perf) already done via merge. This change adds i18n translations and updates specs.--## 1. Configure VitePress i18n--- [x] 1.1 Add `locales` config to `packages/docs/.vitepress/config.ts` with root (en), de, it, fr, es, pl — each with label, lang, nav, and sidebar translations--## 2. Translate docs — German (de)--- [x] 2.1 Create `packages/docs/de/` with translated: index.md, guide/ (6 pages), user-guide/ (12 pages) — 19 files--## 3. Translate docs — Italian (it)--- [x] 3.1 Create `packages/docs/it/` with same 19 translated files--## 4. Translate docs — French (fr)--- [x] 4.1 Create `packages/docs/fr/` with same 19 translated files--## 5. Translate docs — Spanish (es)--- [x] 5.1 Create `packages/docs/es/` with same 19 translated files--## 6. Translate docs — Polish (pl)--- [x] 6.1 Create `packages/docs/pl/` with same 19 translated files--## 7. Verification--- [x] 7.1 Run `cd packages/docs && bun run build` — verify no dead links across all locales-- [x] 7.2 Verify language switcher works in dev modediff --git a/openspec/changes/archive/2026-03-05-fix-mobile-pr-review/.openspec.yaml b/openspec/changes/archive/2026-03-05-fix-mobile-pr-review/.openspec.yamldeleted file mode 100644index 8f0b86992..000000000--- a/openspec/changes/archive/2026-03-05-fix-mobile-pr-review/.openspec.yaml+++ /dev/null@@ -1,2 +0,0 @@-schema: spec-driven-created: 2026-03-05diff --git a/openspec/changes/archive/2026-03-05-fix-mobile-pr-review/design.md b/openspec/changes/archive/2026-03-05-fix-mobile-pr-review/design.mddeleted file mode 100644index 597d07012..000000000--- a/openspec/changes/archive/2026-03-05-fix-mobile-pr-review/design.md+++ /dev/null@@ -1,36 +0,0 @@-## Context--PR #27 introduced mobile UI components that duplicated utilities and magic numbers already present elsewhere, used hand-rolled dropdowns instead of reka-ui, and used overly-wide types. All changes are purely refactoring/convention fixes — no new features.--## Goals / Non-Goals--**Goals:**-- Eliminate code duplication flagged in review-- Follow project conventions (reka-ui, constants file, store types, useBreakpoints)-- Fix PWA dev-mode caching bug--**Non-Goals:**-- Changing any mobile UX behavior-- Refactoring LayerTree/LayersPanel merge (too large, separate task)--## Decisions--**`colorToCSS` → `packages/core/src/color.ts`**: Composes with existing `colorToRgba255` — single implementation, zero duplication. Both `CollabPanel` and `MobileHud` import from core.--**`initials` → `src/utils/text.ts`**: App-level utility (not core). New `src/utils/` directory follows convention for shared non-component helpers.--**`toolIcons` — export from `Toolbar.vue`**: Toolbar is the authoritative source. Named export `toolIcons` imported by `MobileHud`.--**`mobileDrawerSnap` type: `'closed' | 'half' | 'full'`**: The numeric `0` value was a legacy relic. All code in `MobileDrawer` and `MobileRibbon` already treated `0` as `'closed'`. Migrate to string union, remove the ternary workarounds.--**Clipboard in editor store**: Module-level mutable state in `Toolbar.vue` is not accessible to other components. Store field `clipboardHtml: string` with actions `mobileCopy`, `mobileCut`, `mobilePaste` in editor store.--**reka-ui Popover for peers list, DropdownMenu for app menu**: Project convention. `onClickOutside` workaround replaced by reka-ui's built-in outside-click handling.--**`useBreakpoints` in `EditorView`**: Consistent with `@vueuse/core` usage throughout the codebase.--## Risks / Trade-offs--[`mobileDrawerSnap` type change] → All assignment sites set string values — no runtime risk, verified by TypeScript compiler.--[Moving clipboard to store] → Slightly more verbose, but correct — the store is the right owner of shared mutable state.diff --git a/openspec/changes/archive/2026-03-05-fix-mobile-pr-review/proposal.md b/openspec/changes/archive/2026-03-05-fix-mobile-pr-review/proposal.mddeleted file mode 100644index f5f8de0b3..000000000--- a/openspec/changes/archive/2026-03-05-fix-mobile-pr-review/proposal.md+++ /dev/null@@ -1,45 +0,0 @@-## Why--PR #27 (mobile layout) received review feedback from @dannote flagging 12 issues: code duplication, violation of project conventions (constants, reka-ui components, store types), and a dev-mode PWA bug. These must be fixed before the branch can be merged.--## What Changes--- Extract `toolIcons` map from `MobileHud.vue` — export it from `Toolbar.vue` and import in `MobileHud.vue`-- Extract `colorToCSS` to `packages/core/src/color.ts` (compose with `colorToRgba255`)-- Extract `initials` to a shared util (`src/utils/text.ts`)-- Remove duplicate `colorToCSS` / `initials` from `MobileHud.vue` and `CollabPanel.vue` — import from shared locations-- Replace hand-rolled peers dropdown with `PopoverRoot`/`PopoverContent` from reka-ui-- Replace hand-rolled menu dropdown in `MobileHud.vue` with `DropdownMenuRoot`/`DropdownMenuContent` from reka-ui-- Tighten `mobileDrawerSnap` type in `editor.ts` from `number | string | null` to `'closed' | 'half' | 'full'`; update all usages-- Move magic numbers `RIBBON_H`, `HALF_FRAC`, `HUD_TOP` from `MobileDrawer.vue` to `src/constants.ts`-- Move `SWIPE_THRESHOLD`, `SWIPE_MAX_DURATION` from `MobileRibbon.vue` to `src/constants.ts`-- Move `ACTION_TOAST_DURATION` from `Toolbar.vue` to `src/constants.ts`-- Move `internalClipboard` module-level mutable state from `Toolbar.vue` into the editor store-- Replace `animate-` custom class with `tw-animate-css` in `MobileHud.vue` (line 264)-- Disable PWA service worker in dev: `devOptions: { enabled: false }` in `vite.config.ts`-- Replace `useMediaQuery('(max-width: 767px)')` in `EditorView.vue` with `useBreakpoints`--## Capabilities--### New Capabilities--- `shared-color-utils`: `colorToCSS` utility exported from `@open-pencil/core` color module-- `shared-text-utils`: `initials` string utility in `src/utils/text.ts`--### Modified Capabilities--_(none — no spec-level behavior changes, purely code quality / convention fixes)_--## Impact--- `packages/core/src/color.ts` — new export `colorToCSS`-- `src/utils/text.ts` — new file with `initials`-- `src/constants.ts` — new constants: `RIBBON_H`, `HALF_FRAC`, `HUD_TOP`, `SWIPE_THRESHOLD`, `SWIPE_MAX_DURATION`, `ACTION_TOAST_DURATION`-- `src/stores/editor.ts` — type of `mobileDrawerSnap` narrowed; new `clipboardData` field-- `src/components/Toolbar.vue` — exports `toolIcons`; removes `internalClipboard`; uses constant-- `src/components/MobileHud.vue` — imports shared utils/icons; uses reka-ui Popover + DropdownMenu; uses `tw-animate-css`-- `src/components/CollabPanel.vue` — imports `colorToCSS` from core, `initials` from shared util-- `src/components/MobileDrawer.vue` — imports constants-- `src/components/MobileRibbon.vue` — imports constants-- `src/views/EditorView.vue` — uses `useBreakpoints` instead of raw `useMediaQuery`-- `vite.config.ts` — SW disabled in devdiff --git a/openspec/changes/archive/2026-03-05-fix-mobile-pr-review/specs/shared-color-utils/spec.md b/openspec/changes/archive/2026-03-05-fix-mobile-pr-review/specs/shared-color-utils/spec.mddeleted file mode 100644index ab610fef2..000000000--- a/openspec/changes/archive/2026-03-05-fix-mobile-pr-review/specs/shared-color-utils/spec.md+++ /dev/null@@ -1,12 +0,0 @@-## ADDED Requirements--### Requirement: colorToCSS exported from core-The `colorToCSS` function SHALL be exported from `packages/core/src/color.ts` and compose with the existing `colorToRgba255` helper. It SHALL convert a `Color` value to a CSS `rgb(r, g, b)` string.--#### Scenario: Converts color to CSS string-- **WHEN** `colorToCSS({ r: 0.96, g: 0.26, b: 0.21, a: 1 })` is called-- **THEN** it returns `"rgb(245, 66, 54)"`--#### Scenario: Available as named import from core-- **WHEN** consumer writes `import { colorToCSS } from '@open-pencil/core'`-- **THEN** the import resolves without error and the function works as expecteddiff --git a/openspec/changes/archive/2026-03-05-fix-mobile-pr-review/specs/shared-text-utils/spec.md b/openspec/changes/archive/2026-03-05-fix-mobile-pr-review/specs/shared-text-utils/spec.mddeleted file mode 100644index a98bef08e..000000000--- a/openspec/changes/archive/2026-03-05-fix-mobile-pr-review/specs/shared-text-utils/spec.md+++ /dev/null@@ -1,16 +0,0 @@-## ADDED Requirements--### Requirement: initials utility in src/utils/text.ts-The `initials` function SHALL be exported from `src/utils/text.ts`. It SHALL take a name string and return up to 2 uppercase initials, falling back to `"?"` for empty input.--#### Scenario: Two-word name-- **WHEN** `initials("John Doe")` is called-- **THEN** it returns `"JD"`--#### Scenario: Single word-- **WHEN** `initials("Alice")` is called-- **THEN** it returns `"A"`--#### Scenario: Empty string fallback-- **WHEN** `initials("")` is called-- **THEN** it returns `"?"`diff --git a/openspec/changes/archive/2026-03-05-fix-mobile-pr-review/tasks.md b/openspec/changes/archive/2026-03-05-fix-mobile-pr-review/tasks.mddeleted file mode 100644index f6230b127..000000000--- a/openspec/changes/archive/2026-03-05-fix-mobile-pr-review/tasks.md+++ /dev/null@@ -1,58 +0,0 @@-## 1. Shared utilities--- [x] 1.1 Add `colorToCSS(c: Color): string` to `packages/core/src/color.ts` — compose with existing `colorToRgba255`: `const {r,g,b} = colorToRgba255(c); return \`rgb(${r}, ${g}, ${b})\``; add to named exports in `packages/core/src/index.ts`-- [x] 1.2 Create `src/utils/text.ts` — export `initials(name: string): string` that splits on spaces, takes first letter of each word, uppercases, slices to 2 chars, falls back to `"?"`-- [x] 1.3 Create `src/utils/tools.ts` — move `toolIcons: Record<Tool, Component>` map here (import `Tool` type from `@/stores/editor`, import icon components); export named `toolIcons`--## 2. Constants--- [x] 2.1 Add to `src/constants.ts`: `RIBBON_H = 44`, `HALF_FRAC = 3 / 7`, `HUD_TOP = 12 + 32 + 6 + 32 + 12` (from `MobileDrawer.vue`); `SWIPE_THRESHOLD = 30`, `SWIPE_MAX_DURATION = 500` (from `MobileRibbon.vue`); `ACTION_TOAST_DURATION = 800` (from `Toolbar.vue`)--## 3. Store changes--- [x] 3.1 In `editor.ts` change `mobileDrawerSnap` type to `'closed' | 'half' | 'full'` and default to `'closed'`. Update all assignment sites: `src/views/EditorView.vue:72` (`=== 0` check → remove, only keep `=== 'closed'`; line 73 stays), `src/components/MobileRibbon.vue` (lines 23,25,36,39,61,65,68 — replace `!== 0` → `!== 'closed'`, `= 0` → `= 'closed'`), `src/components/MobileDrawer.vue:23` (setter: `v === 'closed' ? 0 : v` → just `v`), `src/composables/use-keyboard.ts:95` (remove `=== 0 ||`, keep `=== 'closed'` check)-- [x] 3.2 In `editor.ts` add `clipboardHtml: ''` to state; add store actions: `mobileCopy()` — creates `new DataTransfer()`, calls `writeCopyData(transfer)`, sets `state.clipboardHtml = transfer.getData('text/html')`; `mobileCut()` — calls `mobileCopy()` then `deleteSelected()`; `mobilePaste()` — calls `pasteFromHTML(state.clipboardHtml)` when `state.clipboardHtml` is non-empty. (`writeCopyData` and `pasteFromHTML` already exist in the store.)--## 4. Toolbar.vue--- [x] 4.1 Remove `toolIcons` definition from `Toolbar.vue`; import from `@/utils/tools`-- [x] 4.2 Remove `internalClipboard` module-level variable; replace local `mobileCopy`/`mobileCut`/`mobilePaste` functions with `store.mobileCopy()`, `store.mobileCut()`, `store.mobilePaste()` calls-- [x] 4.3 Replace `const ACTION_TOAST_DURATION = 800` (removed from store-level logic); ensure `ACTION_TOAST_DURATION` is imported from `@/constants` wherever the literal `800` was used--## 5. MobileHud.vue--- [x] 5.1 Remove the local `toolIcons` map and all icon component imports used only for it; import `toolIcons` from `@/utils/tools`-- [x] 5.2 Import `colorToCSS` from `@open-pencil/core`; remove local `colorToCSS` function-- [x] 5.3 Import `initials` from `@/utils/text`; remove local `initials` function-- [x] 5.4 Replace hand-rolled peers `<div v-if="peersOpen">` with reka-ui: wrap Online badge button in `<PopoverTrigger as-child>`, add `<PopoverPortal><PopoverContent :modal="false">` with the peers list inside; remove `peersOpen` ref-- [x] 5.5 Replace hand-rolled app menu `<div v-if="menuOpen">` with reka-ui: wrap menu button in `<DropdownMenuTrigger as-child>`, add `<DropdownMenuPortal><DropdownMenuContent>` with `<DropdownMenuItem>` per action; remove `menuRef` ref, `menuOpen` ref, and `onClickOutside` import/call-- [x] 5.6 Replace `<style scoped>` `toast-fade-*` CSS block + `<Transition name="toast-fade">` with `<Transition enter-active-class="animate-fade-in" leave-active-class="animate-fade-out">` (tw-animate-css is already imported in `app.css`)--## 6. CollabPanel.vue--- [x] 6.1 Import `colorToCSS` from `@open-pencil/core`; remove local definition-- [x] 6.2 Import `initials` from `@/utils/text`; remove local definition--## 7. MobileDrawer.vue--- [x] 7.1 Import `RIBBON_H`, `HALF_FRAC`, `HUD_TOP` from `@/constants`; remove local `const` declarations-- [x] 7.2 Update computed `snap` setter: remove `v === 'closed' ? 0 : v` — set `store.state.mobileDrawerSnap` directly to `v` (already a `Snap` value after 3.1)--## 8. MobileRibbon.vue--- [x] 8.1 Import `SWIPE_THRESHOLD`, `SWIPE_MAX_DURATION` from `@/constants`; remove local `const` declarations-- [x] 8.2 All `mobileDrawerSnap` comparison/assignment sites are already covered by task 3.1 — verify no remaining `0` literals remain--## 9. EditorView.vue--- [x] 9.1 Replace `useMediaQuery('(max-width: 767px)')` with `const breakpoints = useBreakpoints({ mobile: 768 })` and `const isMobile = breakpoints.smaller('mobile')` — uses `< 768` matching the original `<= 767px` behavior--## 10. vite.config.ts--- [x] 10.1 Change `devOptions: { enabled: true }` to `devOptions: { enabled: false }` to stop the SW from intercepting dev requests and causing stale cache bugs--## 11. Verification--- [x] 11.1 Run `bun run check` — no type errors or lint warnings-- [x] 11.2 Run `bun run test:unit` — no regressions-- [x] 11.3 Add entry to `CHANGELOG.md` Unreleased section (internal refactor: mobile PR cleanup)diff --git a/openspec/changes/archive/2026-03-07-e2e-coverage-gaps/.openspec.yaml b/openspec/changes/archive/2026-03-07-e2e-coverage-gaps/.openspec.yamldeleted file mode 100644index f1842c5f1..000000000--- a/openspec/changes/archive/2026-03-07-e2e-coverage-gaps/.openspec.yaml+++ /dev/null@@ -1,2 +0,0 @@-schema: spec-driven-created: 2026-03-07diff --git a/openspec/changes/archive/2026-03-07-e2e-coverage-gaps/design.md b/openspec/changes/archive/2026-03-07-e2e-coverage-gaps/design.mddeleted file mode 100644index 2183f4eec..000000000--- a/openspec/changes/archive/2026-03-07-e2e-coverage-gaps/design.md+++ /dev/null@@ -1,45 +0,0 @@-## Context--The project has 17 Playwright E2E spec files covering ~140 test cases, but 12 of 20 manual test plan sections are sparsely covered. All existing tests share a common pattern: `window.__OPEN_PENCIL_STORE__` for state assertions, `CanvasHelper` for canvas interactions, `test.describe.configure({ mode: 'serial' })` with a shared page per file, and page-level event forwarding for error tracking. New tests follow the same conventions.--## Goals / Non-Goals--**Goals:**-- Cover every gap identified in the 20-section manual test plan-- Use `window.__OPEN_PENCIL_STORE__` for deterministic state assertions (no pixel-matching for non-visual tests)-- Keep each spec file self-contained: `beforeAll` creates a fresh page, draws needed fixtures, `afterAll` closes-- Use `canvas.waitForRender()` after every interaction, never arbitrary `waitForTimeout`-- Tests that need visual confirmation (snap guides, hover highlight) use `toHaveScreenshot` with existing snapshot infra--**Non-Goals:**-- Cross-browser testing (Chromium only, matching existing suite)-- Collaboration/P2P tests (require two browser instances and signaling — separate effort)-- Export file content validation (OS dialog interception is too brittle; test UI state only)-- Font picker rendering (system fonts vary across CI environments)--## Decisions--**1. CanvasHelper extension over ad-hoc helpers**-Add `marquee()`, `hover()`, `dragScrubInput()`, and `shiftDrag()` to the existing `CanvasHelper` class. Alternative: inline helpers per test file. Rejected because inline helpers duplicate boilerplate and drift from each other.--**2. Store assertions for invisible/locked nodes**-Nodes that are invisible or locked cannot be hit-tested on canvas. Use `page.evaluate(() => window.__OPEN_PENCIL_STORE__!.graph.getNode(id))` to assert state directly. Consistent with how `context-menu.spec.ts` already handles visibility toggle.--**3. Snap guide tests use screenshot comparison**-Snap guide lines are rendered on the canvas (CanvasKit), not DOM. The only way to assert their presence is `toHaveScreenshot`. Use `--update-snapshots` once on a known-good run; CI then catches regressions. Alternative: expose a `debugSnapLines` store getter — rejected as production API pollution.--**4. ScrubInput drag via `mouse.move` with delta**-ScrubInput responds to `pointerdown` + `pointermove` on the outer container. Simulate with `page.mouse.move(x, y)` → `page.mouse.down()` → `page.mouse.move(x + delta, y)` → `page.mouse.up()`. A `dragScrubInput(locator, delta)` helper encapsulates this.--**5. Variables dialog accessed via store page.evaluate**-The dialog can be opened by clicking the settings icon in `VariablesSection` (only visible without selection). Rather than pixel-hunting for the icon, use `page.locator('[data-test-id="variables-settings-btn"]')`. If that attribute doesn't exist, fall back to `page.evaluate(() => window.__OPEN_PENCIL_STORE__!.openVariablesDialog())` — check during implementation.--**6. Export tests assert UI state, not file content**-`showSaveFilePicker` is a native dialog; Playwright cannot intercept it in Chrome without mocking. Tests verify: export rows are added/removed, preview image appears, format selector value changes. No file download assertion.--## Risks / Trade-offs--- [ScrubInput pointer simulation] → ScrubInput uses `setPointerCapture` which may not behave identically in headless Chromium. Mitigation: test with `--enable-unsafe-swiftshader` (already in playwright.config.ts).-- [Snap guide snapshots] → Guide rendering depends on node positions set up in `beforeAll`. If canvas DPI/viewport changes, snapshots break. Mitigation: pin `deviceScaleFactor: 2` and `viewport: 1280×800` (already in config).-- [Variables dialog test-id] → `data-test-id` may not exist on the settings button. Mitigation: check during implementation; add attribute if missing (1-line change in `VariablesSection.vue`).-- [Font picker test] → Excluded from scope due to CI font availability variance.diff --git a/openspec/changes/archive/2026-03-07-e2e-coverage-gaps/proposal.md b/openspec/changes/archive/2026-03-07-e2e-coverage-gaps/proposal.mddeleted file mode 100644index 42594bf23..000000000--- a/openspec/changes/archive/2026-03-07-e2e-coverage-gaps/proposal.md+++ /dev/null@@ -1,39 +0,0 @@-## Why--The existing E2E suite covers core happy paths but leaves 12 of 20 manual test plan sections with significant uncovered scenarios. Gaps include canvas manipulation (marquee select, resize handles, rotation, Space+drag pan), toolbar flyouts (Polygon/Star/Pen drawing), properties panel interactions (ScrubInput drag, corner radius, gradient, variable binding, alignment), text editing (cursor positioning, formatting shortcuts, font picker), auto-layout controls (direction, gap, padding, alignment grid), snap guides, panel resizing, variables dialog, export, and collaboration UI.--## What Changes--- Add `tests/e2e/canvas-manipulation.spec.ts` — marquee select, resize handles, rotation, Alt+drag duplicate, Shift+Arrow nudge, hover highlight-- Add `tests/e2e/toolbar.spec.ts` — flyout chevrons, Polygon, Star tools, Pen drawing (corner, curve, close, Escape, preview), active tracking-- Add `tests/e2e/properties-panel.spec.ts` — ScrubInput drag-to-change, corner radius (uniform + independent), fill gradient, variable bind/unbind, flip/rotate buttons, alignment buttons, clip content-- Add `tests/e2e/text-formatting.spec.ts` — cursor positioning, drag select, word/line select, word/line navigation shortcuts, bold/italic/underline via keyboard and buttons, font picker search-- Add `tests/e2e/auto-layout.spec.ts` — Shift+A on selection, direction toggle (H/V/wrap), gap ScrubInput, padding (uniform + per-side), alignment grid 3×3, sizing modes-- Add `tests/e2e/snap-guides.spec.ts` — edge snap, center snap (visual: guide lines appear during drag)-- Add `tests/e2e/panels.spec.ts` — layers panel resize, panel size after reload, ⌘\ toggle UI-- Add `tests/e2e/variables-dialog.spec.ts` — open dialog, search filter, edit value, color variable picker-- Add `tests/e2e/export.spec.ts` — PNG/JPG/WEBP/SVG export settings, multi-export rows, preview toggle-- Extend `tests/helpers/canvas.ts` — add `marquee()`, `hover()`, `rightDrag()`, `dragScrubInput()` helpers--## Capabilities--### New Capabilities-- `e2e-canvas-manipulation`: E2E tests for marquee selection, resize, rotation, duplicate, nudge, hover highlight-- `e2e-toolbar`: E2E tests for toolbar flyouts and Pen tool drawing flows-- `e2e-properties-panel`: E2E tests for ScrubInput drag, corner radius, gradient, variable binding, panel interactions-- `e2e-text-formatting`: E2E tests for text cursor, selection, formatting shortcuts and buttons-- `e2e-auto-layout`: E2E tests for auto-layout controls: direction, gap, padding, alignment grid, sizing-- `e2e-snap-guides`: E2E tests for snap guide visibility during drag-- `e2e-panels`: E2E tests for resizable panels and UI toggle-- `e2e-variables-dialog`: E2E tests for variables dialog open, search, edit, color picker-- `e2e-export`: E2E tests for export format settings and preview--### Modified Capabilities-- `testing`: Add new E2E requirements for all 9 new spec files and CanvasHelper extension--## Impact--- `tests/e2e/` — 9 new spec files (~1800 lines)-- `tests/helpers/canvas.ts` — 4 new helper methods-- No production code changes-- All tests target `http://localhost:1420` with `window.__OPEN_PENCIL_STORE__` for state assertionsdiff --git a/openspec/changes/archive/2026-03-07-e2e-coverage-gaps/specs/e2e-auto-layout/spec.md b/openspec/changes/archive/2026-03-07-e2e-coverage-gaps/specs/e2e-auto-layout/spec.mddeleted file mode 100644index dc50cee82..000000000--- a/openspec/changes/archive/2026-03-07-e2e-coverage-gaps/specs/e2e-auto-layout/spec.md+++ /dev/null@@ -1,43 +0,0 @@-## ADDED Requirements--### Requirement: Auto-layout Shift+A on selection E2E-The E2E suite SHALL verify that Shift+A on multiple selected nodes wraps them in an auto-layout frame.--#### Scenario: Shift+A wraps nodes in auto-layout frame-- **WHEN** two rectangles are selected and Shift+A is pressed-- **THEN** a single FRAME node exists on the page with `layoutMode` set to `HORIZONTAL` or `VERTICAL` and the rectangles are its children--### Requirement: Auto-layout direction toggle E2E-The E2E suite SHALL verify that clicking the horizontal/vertical direction buttons changes `layoutMode`.--#### Scenario: Direction button toggles layoutMode-- **WHEN** an auto-layout frame is selected and the vertical direction button is clicked in LayoutSection-- **THEN** `frame.layoutMode` equals `VERTICAL`--### Requirement: Auto-layout gap E2E-The E2E suite SHALL verify that changing the gap ScrubInput updates `itemSpacing`.--#### Scenario: Gap ScrubInput changes itemSpacing-- **WHEN** an auto-layout frame is selected and the gap ScrubInput value is changed to 20-- **THEN** `frame.itemSpacing` equals 20--### Requirement: Auto-layout padding uniform E2E-The E2E suite SHALL verify that changing the uniform padding input updates all four padding properties.--#### Scenario: Uniform padding updates all sides-- **WHEN** an auto-layout frame is selected and padding is set to 16-- **THEN** `frame.paddingTop`, `frame.paddingRight`, `frame.paddingBottom`, and `frame.paddingLeft` all equal 16--### Requirement: Auto-layout alignment grid E2E-The E2E suite SHALL verify that clicking a cell in the 3×3 alignment grid updates `primaryAxisAlign` and `counterAxisAlign`.--#### Scenario: Center-center alignment set-- **WHEN** the center-center cell of the alignment grid is clicked-- **THEN** `frame.primaryAxisAlign` equals `CENTER` and `frame.counterAxisAlign` equals `CENTER`--### Requirement: Auto-layout remove E2E-The E2E suite SHALL verify that clicking the remove (−) button in the auto-layout section sets `layoutMode` to NONE.--#### Scenario: Remove auto-layout resets layoutMode-- **WHEN** an auto-layout frame is selected and the remove auto-layout button is clicked-- **THEN** `frame.layoutMode` equals `NONE`diff --git a/openspec/changes/archive/2026-03-07-e2e-coverage-gaps/specs/e2e-canvas-manipulation/spec.md b/openspec/changes/archive/2026-03-07-e2e-coverage-gaps/specs/e2e-canvas-manipulation/spec.mddeleted file mode 100644index d8f970e0d..000000000--- a/openspec/changes/archive/2026-03-07-e2e-coverage-gaps/specs/e2e-canvas-manipulation/spec.md+++ /dev/null@@ -1,47 +0,0 @@-## ADDED Requirements--### Requirement: Marquee selection E2E-The E2E suite SHALL verify that dragging from an empty canvas area selects all nodes whose bounds intersect the drag rectangle.--#### Scenario: Marquee selects intersected nodes-- **WHEN** two rectangles are drawn and mouse is dragged from a point before both to a point after both-- **THEN** both nodes appear in `store.state.selectedIds`--#### Scenario: Marquee on empty area deselects-- **WHEN** a node is selected and mouse is dragged across empty canvas-- **THEN** `store.state.selectedIds.size` equals 0--### Requirement: Resize handles E2E-The E2E suite SHALL verify that dragging a resize handle changes the node's width and height.--#### Scenario: Corner resize increases dimensions-- **WHEN** a rectangle is selected and its bottom-right corner handle is dragged 50px right and 50px down-- **THEN** node width and height each increase by approximately 50px--### Requirement: Rotation handle E2E-The E2E suite SHALL verify that the rotation handle rotates a node.--#### Scenario: Rotation changes node rotation-- **WHEN** a rectangle is selected and the cursor is positioned just outside a corner, then dragged in an arc-- **THEN** `node.rotation` is non-zero--### Requirement: Alt+drag duplicate E2E-The E2E suite SHALL verify that Alt+drag creates a copy of the node.--#### Scenario: Alt drag creates duplicate-- **WHEN** a rectangle is selected and dragged with Alt held-- **THEN** the page has one more node than before the drag--### Requirement: Shift+Arrow nudge E2E-The E2E suite SHALL verify that Shift+Arrow nudges a node by 10px.--#### Scenario: Shift+ArrowRight nudges 10px-- **WHEN** a node is selected and Shift+ArrowRight is pressed-- **THEN** `node.x` increases by 10--### Requirement: Hover highlight E2E-The E2E suite SHALL verify that hovering over a node (without clicking) triggers a visible highlight outline on the canvas.--#### Scenario: Hover renders highlight-- **WHEN** the mouse moves over a rectangle without clicking-- **THEN** a screenshot taken during hover differs from a screenshot taken with the mouse away (highlight outline visible)diff --git a/openspec/changes/archive/2026-03-07-e2e-coverage-gaps/specs/e2e-export/spec.md b/openspec/changes/archive/2026-03-07-e2e-coverage-gaps/specs/e2e-export/spec.mddeleted file mode 100644index d10cbd266..000000000--- a/openspec/changes/archive/2026-03-07-e2e-coverage-gaps/specs/e2e-export/spec.md+++ /dev/null@@ -1,33 +0,0 @@-## ADDED Requirements--### Requirement: Export format selection E2E-The E2E suite SHALL verify that changing the export format selector updates the format value in the export section.--#### Scenario: Format selector changes to JPG-- **WHEN** a node with an export setting is selected and the format selector is changed to JPG-- **THEN** the export row displays JPG as the selected format--### Requirement: Export multi-row add/remove E2E-The E2E suite SHALL verify that clicking + adds a new export row and − removes it.--#### Scenario: Add export row-- **WHEN** a node is selected and the + button in ExportSection is clicked-- **THEN** one more export setting row is visible than before--#### Scenario: Remove export row-- **WHEN** a node has two export rows and the − button on one row is clicked-- **THEN** only one export row remains--### Requirement: Export preview toggle E2E-The E2E suite SHALL verify that clicking the Preview button shows a preview image element.--#### Scenario: Preview button shows image-- **WHEN** a node with an export setting is selected and the Preview button is clicked-- **THEN** an image element (checkerboard preview) becomes visible in the export section--### Requirement: SVG format hides scale selector E2E-The E2E suite SHALL verify that when SVG format is selected, the scale (multiplier) selector is hidden.--#### Scenario: SVG hides scale input-- **WHEN** an export row format is set to SVG-- **THEN** no scale/multiplier input is visible for that rowdiff --git a/openspec/changes/archive/2026-03-07-e2e-coverage-gaps/specs/e2e-panels/spec.md b/openspec/changes/archive/2026-03-07-e2e-coverage-gaps/specs/e2e-panels/spec.mddeleted file mode 100644index 57c053d4b..000000000--- a/openspec/changes/archive/2026-03-07-e2e-coverage-gaps/specs/e2e-panels/spec.md+++ /dev/null@@ -1,26 +0,0 @@-## ADDED Requirements--### Requirement: Layers panel resize E2E-The E2E suite SHALL verify that dragging the resize handle between the left panel and canvas changes the panel width.--#### Scenario: Panel resize handle changes width-- **WHEN** the splitter handle on the left panel is dragged 80px to the right-- **THEN** the layers panel DOM element has a wider width than before the drag--### Requirement: UI toggle persistence across reload E2E-The E2E suite SHALL verify that panel sizes are preserved after a page reload.--#### Scenario: Panel width persists after reload-- **WHEN** the layers panel is resized and the page is reloaded-- **THEN** the panel width after reload matches the width set before reload (within 2px)--### Requirement: ⌘\\ hides and shows panels E2E-The E2E suite SHALL verify that pressing ⌘\\ toggles the visibility of the left and right panels.--#### Scenario: Cmd+Backslash hides panels-- **WHEN** ⌘\\ is pressed while panels are visible-- **THEN** the layers panel and properties panel elements are not visible in the DOM--#### Scenario: Cmd+Backslash shows panels again-- **WHEN** ⌘\\ is pressed while panels are hidden-- **THEN** the layers panel and properties panel elements are visible againdiff --git a/openspec/changes/archive/2026-03-07-e2e-coverage-gaps/specs/e2e-properties-panel/spec.md b/openspec/changes/archive/2026-03-07-e2e-coverage-gaps/specs/e2e-properties-panel/spec.mddeleted file mode 100644index 8f9bcf527..000000000--- a/openspec/changes/archive/2026-03-07-e2e-coverage-gaps/specs/e2e-properties-panel/spec.md+++ /dev/null@@ -1,57 +0,0 @@-## ADDED Requirements--### Requirement: ScrubInput drag-to-change E2E-The E2E suite SHALL verify that dragging horizontally on a ScrubInput changes the node property value.--#### Scenario: Drag X ScrubInput moves node-- **WHEN** a rectangle is selected and the X ScrubInput is dragged 50px to the right-- **THEN** `node.x` increases by approximately 50--### Requirement: Corner radius uniform E2E-The E2E suite SHALL verify that typing a corner radius value in the appearance section applies it to all corners.--#### Scenario: Uniform corner radius applied-- **WHEN** a rectangle is selected and a corner radius value is typed into the appearance input-- **THEN** `node.cornerRadius` equals the entered value--### Requirement: Corner radius independent E2E-The E2E suite SHALL verify that toggling to independent corners splits the input into four separate fields.--#### Scenario: Independent corners toggle shows four fields-- **WHEN** the independent corners button is clicked-- **THEN** four corner radius inputs are visible in the panel--### Requirement: Fill gradient switch E2E-The E2E suite SHALL verify that switching fill type to Linear Gradient updates the node fill.--#### Scenario: Fill type switches to gradient-- **WHEN** a rectangle with a solid fill is selected and fill type is changed to LINEAR-- **THEN** `node.fills[0].type` equals `GRADIENT_LINEAR`--### Requirement: Variable bind E2E-The E2E suite SHALL verify that binding a color variable to a fill displays a variable badge.--#### Scenario: Variable badge appears after bind-- **WHEN** a color variable exists and is bound to a node's fill-- **THEN** a variable badge element is visible in the fill section--### Requirement: Alignment buttons E2E-The E2E suite SHALL verify that clicking alignment buttons aligns multiple selected nodes.--#### Scenario: Align left aligns nodes-- **WHEN** two rectangles at different X positions are selected and Align Left is clicked-- **THEN** both nodes have the same `x` coordinate (leftmost of the two)--### Requirement: Flip horizontal E2E-The E2E suite SHALL verify that clicking the flip horizontal button sets `flipX` on the node.--#### Scenario: Flip horizontal toggles-- **WHEN** a rectangle is selected and flip horizontal button is clicked-- **THEN** `node.flipX` is true--### Requirement: Clip content toggle E2E-The E2E suite SHALL verify that the clip content checkbox toggles `clipsContent` on a frame.--#### Scenario: Clip content checkbox toggles-- **WHEN** a frame is selected and the clip content checkbox is clicked-- **THEN** `node.clipsContent` changes to the opposite boolean valuediff --git a/openspec/changes/archive/2026-03-07-e2e-coverage-gaps/specs/e2e-snap-guides/spec.md b/openspec/changes/archive/2026-03-07-e2e-coverage-gaps/specs/e2e-snap-guides/spec.mddeleted file mode 100644index 8719fbbd6..000000000--- a/openspec/changes/archive/2026-03-07-e2e-coverage-gaps/specs/e2e-snap-guides/spec.md+++ /dev/null@@ -1,15 +0,0 @@-## ADDED Requirements--### Requirement: Edge snap guide visual E2E-The E2E suite SHALL verify that dragging a node to align its edge with another node causes snap guide lines to appear on the canvas.--#### Scenario: Edge snap guide renders during drag-- **WHEN** two rectangles are positioned such that dragging one aligns its left edge with the other's left edge-- **THEN** a screenshot taken mid-drag (while edges are aligned) contains red guide line pixels not present in the pre-drag screenshot--### Requirement: Center snap guide visual E2E-The E2E suite SHALL verify that dragging a node to align its center with another node causes a center snap guide line to appear.--#### Scenario: Center snap guide renders during drag-- **WHEN** two rectangles are positioned such that dragging one aligns its horizontal center with the other's center-- **THEN** a screenshot taken mid-drag contains guide line pixels indicating center alignmentdiff --git a/openspec/changes/archive/2026-03-07-e2e-coverage-gaps/specs/e2e-text-formatting/spec.md b/openspec/changes/archive/2026-03-07-e2e-coverage-gaps/specs/e2e-text-formatting/spec.mddeleted file mode 100644index cb26fa6e3..000000000--- a/openspec/changes/archive/2026-03-07-e2e-coverage-gaps/specs/e2e-text-formatting/spec.md+++ /dev/null@@ -1,43 +0,0 @@-## ADDED Requirements--### Requirement: Text cursor positioning E2E-The E2E suite SHALL verify that clicking inside a text node in edit mode positions the cursor near the clicked glyph.--#### Scenario: Click positions cursor-- **WHEN** a text node is double-clicked to enter edit mode and then a position inside the text is clicked-- **THEN** the text node remains in edit mode without errors--### Requirement: Text word selection E2E-The E2E suite SHALL verify that double-clicking on a word selects that word.--#### Scenario: Double-click selects word-- **WHEN** a text node is in edit mode and a word is double-clicked-- **THEN** the canvas screenshot shows the word highlighted (differs from no-selection screenshot)--### Requirement: Bold shortcut E2E-The E2E suite SHALL verify that ⌘B toggles bold formatting on selected text.--#### Scenario: Cmd+B toggles bold-- **WHEN** a text node is in edit mode, all text is selected, and ⌘B is pressed-- **THEN** `node.fontWeight` changes to 700 (bold) or back to 400 (normal)--### Requirement: Italic shortcut E2E-The E2E suite SHALL verify that ⌘I toggles italic formatting on selected text.--#### Scenario: Cmd+I toggles italic-- **WHEN** a text node is in edit mode with all text selected and ⌘I is pressed-- **THEN** `node.italic` toggles to the opposite boolean--### Requirement: Word navigation shortcut E2E-The E2E suite SHALL verify that Alt+ArrowRight moves the cursor by one word.--#### Scenario: Alt+ArrowRight moves by word-- **WHEN** a text node is in edit mode with cursor at position 0 and Alt+ArrowRight is pressed-- **THEN** no JavaScript errors are thrown and the editor remains in text mode--### Requirement: Typography section buttons E2E-The E2E suite SHALL verify that the Bold button in the typography section applies formatting.--#### Scenario: Bold button in panel toggles bold-- **WHEN** a text node is selected (not in edit mode) and the Bold button in DesignPanel is clicked-- **THEN** `node.fontWeight` changesdiff --git a/openspec/changes/archive/2026-03-07-e2e-coverage-gaps/specs/e2e-toolbar/spec.md b/openspec/changes/archive/2026-03-07-e2e-coverage-gaps/specs/e2e-toolbar/spec.mddeleted file mode 100644index 903dc59d3..000000000--- a/openspec/changes/archive/2026-03-07-e2e-coverage-gaps/specs/e2e-toolbar/spec.md+++ /dev/null@@ -1,50 +0,0 @@-## ADDED Requirements--### Requirement: Shapes flyout E2E-The E2E suite SHALL verify that the shapes flyout chevron opens a menu with Polygon and Star tools.--#### Scenario: Shapes flyout opens-- **WHEN** the shapes flyout trigger is clicked-- **THEN** the flyout menu is visible with Polygon and Star items--### Requirement: Polygon tool E2E-The E2E suite SHALL verify that selecting Polygon from the flyout and dragging creates a POLYGON node.--#### Scenario: Polygon created-- **WHEN** Polygon is selected from flyout and drag is performed on canvas-- **THEN** a node with type POLYGON exists on the current page--### Requirement: Star tool E2E-The E2E suite SHALL verify that selecting Star from the flyout and dragging creates a STAR node.--#### Scenario: Star created-- **WHEN** Star is selected from flyout and drag is performed on canvas-- **THEN** a node with type STAR exists on the current page--### Requirement: Pen tool corner points E2E-The E2E suite SHALL verify that three clicks with the Pen tool create a VECTOR node with 3 vertices.--#### Scenario: Three clicks create three vertices-- **WHEN** Pen tool is active and three distinct canvas positions are clicked, then Enter pressed (commits open path)-- **THEN** a VECTOR node exists with `vectorNetwork.vertices.length === 3`--### Requirement: Pen tool close path E2E-The E2E suite SHALL verify that clicking the first point of a Pen path closes it.--#### Scenario: Click first point closes path-- **WHEN** Pen tool creates 3 vertices and the user clicks on the first vertex position-- **THEN** the resulting VECTOR node has a closed segment (no open endpoint)--### Requirement: Pen tool Escape cancels path E2E-The E2E suite SHALL verify that pressing Escape during Pen drawing cancels the current path without creating a node.--#### Scenario: Escape cancels open path-- **WHEN** Pen tool creates 2 vertices and Escape is pressed-- **THEN** no new VECTOR node is created on the page (penCancel discards in-progress path)--### Requirement: Frame flyout E2E-The E2E suite SHALL verify that the Frame flyout chevron shows Frame and Section options.--#### Scenario: Frame flyout shows both options-- **WHEN** the frame flyout trigger is clicked-- **THEN** Frame (F) and Section (S) items are visible in the flyoutdiff --git a/openspec/changes/archive/2026-03-07-e2e-coverage-gaps/specs/e2e-variables-dialog/spec.md b/openspec/changes/archive/2026-03-07-e2e-coverage-gaps/specs/e2e-variables-dialog/spec.mddeleted file mode 100644index 47ec0ad67..000000000--- a/openspec/changes/archive/2026-03-07-e2e-coverage-gaps/specs/e2e-variables-dialog/spec.md+++ /dev/null@@ -1,29 +0,0 @@-## ADDED Requirements--### Requirement: Variables dialog open E2E-The E2E suite SHALL verify that the variables dialog can be opened when no node is selected.--#### Scenario: Variables dialog opens-- **WHEN** no node is selected and the variables settings button is activated-- **THEN** a dialog element with variables table is visible--### Requirement: Variables dialog search E2E-The E2E suite SHALL verify that typing in the search field filters the variables table.--#### Scenario: Search filters variable rows-- **WHEN** variables exist with different names and a search term is typed-- **THEN** only rows whose names match the search term are visible--### Requirement: Variables dialog edit value E2E-The E2E suite SHALL verify that clicking a variable value cell makes it editable.--#### Scenario: Click cell to edit-- **WHEN** a variable value cell is clicked in the dialog-- **THEN** an input field is focused in that cell--### Requirement: Color variable picker E2E-The E2E suite SHALL verify that clicking a color variable swatch opens a color picker.--#### Scenario: Color swatch opens picker-- **WHEN** a color variable's swatch is clicked in the dialog-- **THEN** a color picker element becomes visiblediff --git a/openspec/changes/archive/2026-03-07-e2e-coverage-gaps/specs/testing/spec.md b/openspec/changes/archive/2026-03-07-e2e-coverage-gaps/specs/testing/spec.mddeleted file mode 100644index 2a2dcde36..000000000--- a/openspec/changes/archive/2026-03-07-e2e-coverage-gaps/specs/testing/spec.md+++ /dev/null@@ -1,71 +0,0 @@-## ADDED Requirements--### Requirement: Canvas manipulation E2E tests-The E2E suite SHALL include tests for `tests/e2e/canvas-manipulation.spec.ts` covering: marquee selection, resize handle drag, rotation handle drag, Alt+drag duplicate, Shift+Arrow nudge (10px), and hover highlight (visual screenshot comparison).--#### Scenario: Canvas manipulation tests pass-- **WHEN** `bun run test` executes `canvas-manipulation.spec.ts`-- **THEN** all 6+ tests pass verifying selection, resize, rotation, duplicate, nudge, and hover--### Requirement: Toolbar E2E tests-The E2E suite SHALL include tests for `tests/e2e/toolbar.spec.ts` covering: shapes flyout chevron, Polygon tool, Star tool, Pen tool (corner, close path, Escape), and Frame flyout.--#### Scenario: Toolbar tests pass-- **WHEN** `bun run test` executes `toolbar.spec.ts`-- **THEN** all 7+ tests pass verifying flyout menus and shape creation--### Requirement: Properties panel E2E tests-The E2E suite SHALL include tests for `tests/e2e/properties-panel.spec.ts` covering: ScrubInput drag, corner radius (uniform + independent), fill gradient switch, variable bind badge, alignment buttons, flip horizontal, and clip content checkbox.--#### Scenario: Properties panel tests pass-- **WHEN** `bun run test` executes `properties-panel.spec.ts`-- **THEN** all 8+ tests pass verifying property changes via store assertions--### Requirement: Text formatting E2E tests-The E2E suite SHALL include tests for `tests/e2e/text-formatting.spec.ts` covering: cursor positioning, double-click word select, ⌘B bold, ⌘I italic, Alt+ArrowRight word navigation, and Bold button in typography section.--#### Scenario: Text formatting tests pass-- **WHEN** `bun run test` executes `text-formatting.spec.ts`-- **THEN** all 6+ tests pass verifying text edit interactions--### Requirement: Auto-layout E2E tests-The E2E suite SHALL include tests for `tests/e2e/auto-layout.spec.ts` covering: Shift+A on selection, direction toggle, gap ScrubInput, uniform padding, alignment grid, and remove auto-layout.--#### Scenario: Auto-layout tests pass-- **WHEN** `bun run test` executes `auto-layout.spec.ts`-- **THEN** all 6+ tests pass verifying auto-layout frame state via store--### Requirement: Snap guides E2E tests-The E2E suite SHALL include tests for `tests/e2e/snap-guides.spec.ts` covering: edge snap guide and center snap guide, both verified via screenshot comparison.--#### Scenario: Snap guide tests pass-- **WHEN** `bun run test` executes `snap-guides.spec.ts`-- **THEN** 2 screenshot comparison tests pass confirming guide line visibility--### Requirement: Panel resize E2E tests-The E2E suite SHALL include tests for `tests/e2e/panels.spec.ts` covering: left panel drag resize, width persistence after reload, and ⌘\\ UI toggle (hide + show).--#### Scenario: Panel tests pass-- **WHEN** `bun run test` executes `panels.spec.ts`-- **THEN** all 4+ tests pass verifying panel DOM dimensions and visibility--### Requirement: Variables dialog E2E tests-The E2E suite SHALL include tests for `tests/e2e/variables-dialog.spec.ts` covering: dialog open, search filter, cell edit, and color swatch picker.--#### Scenario: Variables dialog tests pass-- **WHEN** `bun run test` executes `variables-dialog.spec.ts`-- **THEN** all 4+ tests pass verifying dialog interactions--### Requirement: Export E2E tests-The E2E suite SHALL include tests for `tests/e2e/export.spec.ts` covering: format selector, add/remove rows, preview toggle, and SVG hiding scale input.--#### Scenario: Export tests pass-- **WHEN** `bun run test` executes `export.spec.ts`-- **THEN** all 5+ tests pass verifying export section UI state--### Requirement: CanvasHelper extended helpers-The `CanvasHelper` class SHALL provide `marquee()`, `hover()`, `dragScrubInput()`, and `shiftDrag()` helper methods usable across all spec files.--#### Scenario: Helpers available in all specs-- **WHEN** a spec file imports `CanvasHelper`-- **THEN** `canvas.marquee()`, `canvas.hover()`, `canvas.dragScrubInput()`, and `canvas.shiftDrag()` are callable without TypeScript errorsdiff --git a/openspec/changes/archive/2026-03-07-e2e-coverage-gaps/tasks.md b/openspec/changes/archive/2026-03-07-e2e-coverage-gaps/tasks.mddeleted file mode 100644index 8c11eb139..000000000--- a/openspec/changes/archive/2026-03-07-e2e-coverage-gaps/tasks.md+++ /dev/null@@ -1,96 +0,0 @@-# Tasks: e2e-coverage-gaps--## 0. Prerequisites — data-test-id audit--- [x] 0.1 Add `data-test-id="corner-radius-input"` to the uniform corner radius ScrubInput in `AppearanceSection.vue`-- [x] 0.2 Add `data-test-id="independent-corners-toggle"` to the independent corners toggle button in `AppearanceSection.vue`-- [x] 0.3 Add `data-test-id="corner-tl-input"`, `corner-tr-input`, `corner-br-input`, `corner-bl-input` to the four independent corner ScrubInputs in `AppearanceSection.vue`-- [x] 0.4 Add `data-test-id="clip-content-checkbox"` to the clip content checkbox in `LayoutSection.vue`-- [x] 0.5 Add `data-test-id="left-splitter-handle"` to the first `SplitterResizeHandle` in `EditorView.vue`-- [x] 0.6 Add `data-test-id="typography-bold-button"` to the Bold button in `TypographySection.vue`-- [x] 0.7 Add `data-test-id="variables-search-input"` to the search input in `VariablesDialog.vue`--## 1. Extend CanvasHelper--- [x] 1.1 Add `marquee(x1, y1, x2, y2, steps = 10)` method to `tests/helpers/canvas.ts` — mouse.move to start → mouse.down → mouse.move to end with steps → mouse.up, then waitForRender-- [x] 1.2 Add `hover(x, y)` method — mouse.move to canvas-relative position, waitForRender (uses existing `waitForRender`)-- [x] 1.3 Add `dragScrubInput(locator, deltaX)` method — scroll element into view, getBoundingBox, mouse.move to center, mouse.down, mouse.move +deltaX, mouse.up-- [x] 1.4 Add `altDrag(fromX, fromY, toX, toY)` method — keyboard.down('Alt') → drag → keyboard.up('Alt'), then waitForRender--## 2. Canvas Manipulation spec--- [x] 2.1 Create `tests/e2e/canvas-manipulation.spec.ts` with serial describe, shared page/CanvasHelper, beforeAll (goto + waitForInit + clearCanvas), afterAll (close)-- [x] 2.2 Test: marquee selects two rectangles — draw rect at (100,100,80,80), draw rect at (250,100,80,80), marquee from (80,80) to (360,220), assert `store.state.selectedIds.size === 2`-- [x] 2.3 Test: marquee on empty area deselects — press Escape to select none, draw rect at (100,300,80,80), click to select it, marquee from (500,500) to (600,600), assert `store.state.selectedIds.size === 0`-- [x] 2.4 Test: Alt+drag duplicate — clearCanvas, draw rect at (100,100,80,80), click to select, altDrag from (140,140) to (280,140), assert page child count increased by 1-- [x] 2.5 Test: Shift+ArrowRight nudge 10px — clearCanvas, draw rect at (200,200,80,80), record `node.x`, press Shift+ArrowRight, assert `node.x === initial + 10`-- [x] 2.6 Test: hover highlight visual — clearCanvas, draw rect at (200,200,100,100), take no-hover screenshot, `canvas.hover(250, 250)`, take hover screenshot, assert they differ using `expect(hoverShot).not.toEqual(noHoverShot)` (Buffer comparison, not toHaveScreenshot — avoids baseline management)--## 3. Toolbar spec--- [x] 3.1 Create `tests/e2e/toolbar.spec.ts` with serial describe, shared page/CanvasHelper, beforeAll (goto + waitForInit)-- [x] 3.2 Test: shapes flyout opens — click `[data-test-id="toolbar-flyout-rectangle"]`, assert `[data-test-id="toolbar-flyout-item-polygon"]` is visible-- [x] 3.3 Test: Polygon created — click `[data-test-id="toolbar-flyout-item-polygon"]`, drag on canvas (300,200) to (400,300), assert POLYGON node in store page children-- [x] 3.4 Test: Star created — click `[data-test-id="toolbar-flyout-rectangle"]`, click `[data-test-id="toolbar-flyout-item-star"]`, drag (150,150) to (250,250), assert STAR node in store page children-- [x] 3.5 Test: Pen creates VECTOR on Enter — press P, click canvas at (100,100), click at (200,100), click at (200,200), press Enter (commits open path), assert VECTOR node with `vectorNetwork.vertices.length === 3`-- [x] 3.6 Test: Frame flyout shows Frame and Section — click `[data-test-id="toolbar-flyout-frame"]`, assert `[data-test-id="toolbar-flyout-item-frame"]` and `[data-test-id="toolbar-flyout-item-section"]` are both visible--## 4. Properties Panel spec--- [x] 4.1 Create `tests/e2e/properties-panel.spec.ts` with serial describe, shared page/CanvasHelper, beforeAll (goto + waitForInit)-- [x] 4.2 Test: ScrubInput drag changes X — clearCanvas, draw rect at (100,100,80,80), record `node.x`, dragScrubInput(`[data-test-id="position-section"] input` first scrub, +50), assert `node.x` changed from initial-- [x] 4.3 Test: corner radius uniform — clearCanvas, draw rect at (200,200,80,80), select, triple-click `[data-test-id="corner-radius-input"]` input, type "12", press Enter, assert `node.cornerRadius === 12`-- [x] 4.4 Test: independent corners shows four fields — click `[data-test-id="independent-corners-toggle"]`, assert `[data-test-id="corner-tl-input"]`, `corner-tr-input`, `corner-br-input`, `corner-bl-input` are all visible-- [x] 4.5 Test: fill gradient switch — clearCanvas, draw rect at (200,200,80,80), click `[data-test-id="fill-item"]` swatch to open picker, click `[data-test-id="fill-picker-tab-gradient"]`, assert `node.fills[0].type === 'GRADIENT_LINEAR'`-- [x] 4.6 Test: alignment buttons align nodes — clearCanvas, draw rect at (50,200,60,60), draw rect at (250,200,60,60), select both (Meta+A), click `[data-test-id="position-align-left"]`, assert both nodes have same `node.x`-- [x] 4.7 Test: flip horizontal — clearCanvas, draw rect at (200,200,80,80), click `[data-test-id="position-flip-horizontal"]`, assert `node.flipX === true`-- [x] 4.8 Test: clip content checkbox — clearCanvas, press F, drag (100,100) to (300,300) to create frame, select it, click `[data-test-id="clip-content-checkbox"]`, assert `node.clipsContent` changed--## 5. Text Formatting spec--- [x] 5.1 Create `tests/e2e/text-formatting.spec.ts` with serial describe, shared page/CanvasHelper, beforeAll (goto + waitForInit)-- [x] 5.2 Test: double-click enters text edit mode — create text node via store at (200,200,150,30), press Escape to deselect, double-click canvas at (275,215), waitForRender, assert `store.state.editingTextId` is not null, assert no canvas errors-- [x] 5.3 Test: Cmd+B toggles bold — (continuing from text edit mode) Ctrl+A, Meta+b, press Escape, assert `node.fontWeight === 700`-- [x] 5.4 Test: Cmd+I toggles italic — double-click text node to re-enter edit, Ctrl+A, Meta+i, press Escape, assert `node.italic === true`-- [x] 5.5 Test: Alt+ArrowRight word navigation — double-click text node to enter edit, press Alt+ArrowRight, assert no canvas errors, assert `store.state.editingTextId` is still set-- [x] 5.6 Test: Bold button in panel — press Escape to exit edit mode and stay selected, click `[data-test-id="typography-bold-button"]`, assert `node.fontWeight` changed--## 6. Auto-Layout spec--- [x] 6.1 Create `tests/e2e/auto-layout.spec.ts` with serial describe, shared page/CanvasHelper, beforeAll (goto + waitForInit + clearCanvas)-- [x] 6.2 Test: Shift+A wraps selection — draw rect at (100,100,60,60), draw rect at (220,100,60,60), Meta+A, Shift+A, assert FRAME node with `layoutMode !== 'NONE'` and 2 children-- [x] 6.3 Test: direction button toggles VERTICAL — select the auto-layout frame, click `[data-test-id="layout-direction-vertical"]`, assert `frame.layoutMode === 'VERTICAL'`-- [x] 6.4 Test: gap ScrubInput sets itemSpacing — select frame, dragScrubInput(`[data-test-id="layout-section"]` gap scrub input, +20), assert `frame.itemSpacing >= 20`-- [x] 6.5 Test: alignment grid center — select frame, click 5th button (index 4) inside `[data-test-id="layout-alignment-grid"]`, assert `frame.primaryAxisAlign === 'CENTER'` and `frame.counterAxisAlign === 'CENTER'`-- [x] 6.6 Test: remove auto-layout — select frame, click `[data-test-id="layout-remove-auto"]`, assert `frame.layoutMode === 'NONE'`--## 7. Snap Guides spec--- [x] 7.1 Create `tests/e2e/snap-guides.spec.ts` with serial describe, shared page/CanvasHelper, beforeAll (goto + waitForInit + clearCanvas). Tag with `test.skip` on Linux CI (snap guides are visual-only and X11 Alt+drag interference makes setup unreliable; these are run manually or on macOS CI).-- [x] 7.2 Test: edge snap guide visual — create rect A at (100,100,80,80) and rect B at (300,100,80,80) via store. Take baseline screenshot. Slow-drag rect B from (340,140) toward (182,140) with steps=30 using mouse.down/move (do NOT release). Take mid-drag screenshot. Assert screenshots differ (guide pixels appeared). Release mouse.-- [x] 7.3 Test: center snap guide visual — reset rects, slow-drag rect B toward center alignment with rect A with steps=30 mid-drag. Assert screenshots differ.--## 8. Panels spec--- [x] 8.1 Create `tests/e2e/panels.spec.ts` with serial describe, shared page/CanvasHelper, beforeAll (goto + waitForInit)-- [x] 8.2 Test: layers panel resize — get bounding box of `[data-test-id="layers-panel"]`, record width, drag `[data-test-id="left-splitter-handle"]` 80px right, assert panel width increased by at least 40px-- [x] 8.3 Test: panel width persists after reload — record panel width after resize, reload page, waitForInit, assert new panel width is within 5px of recorded width (Reka SplitterGroup uses `auto-save-id` localStorage)-- [x] 8.4 Test: Cmd+Backslash hides panels — press Meta+Backslash, assert `[data-test-id="layers-panel"]` not visible-- [x] 8.5 Test: Cmd+Backslash shows panels — press Meta+Backslash again, assert layers-panel visible--## 9. Variables Dialog spec--- [x] 9.1 Create `tests/e2e/variables-dialog.spec.ts` with serial describe, shared page/CanvasHelper, beforeAll (goto + waitForInit)-- [x] 9.2 Test: dialog opens — create a color variable collection via `store.graph` evaluate, click `[data-test-id="variables-section-open"]`, assert `[data-test-id="variables-dialog"]` is visible-- [x] 9.3 Test: search filters rows — create 2 variables with names "alpha-color" and "beta-spacing" via store, type "alpha" into `[data-test-id="variables-search-input"]`, assert only 1 `tr` row visible in the table body-- [x] 9.4 Test: click cell to edit — click the EditablePreview in the first name cell, assert EditableInput is focused (use `page.locator('[data-test-id="variables-dialog"] tbody tr:first-child [contenteditable], input').first()`)-- [x] 9.5 Test: color swatch opens picker — click `[data-test-id="color-picker-swatch"]` in first color variable row, assert `[data-test-id="color-picker-popover"]` is visible--## 10. Export spec--- [x] 10.1 Create `tests/e2e/export.spec.ts` with serial describe, shared page/CanvasHelper, beforeAll (goto + waitForInit + drawRect + select)-- [x] 10.2 Test: add export row — count `[data-test-id="export-item"]`, click `[data-test-id="export-section-add"]`, assert count +1-- [x] 10.3 Test: remove export row — click add again (now 2 rows), click `[data-test-id="export-item"]:first-child button` (the − button), assert count back to 1-- [x] 10.4 Test: format selector changes to JPG — click the format AppSelect in the export row, select "JPG", assert AppSelect displays "JPG"-- [x] 10.5 Test: SVG hides scale input — change format to SVG, assert the scale AppSelect is not visible (ExportSection hides scale for SVG via `v-if="setting.format !== 'SVG'"`)-- [x] 10.6 Test: preview toggle shows image — click `[data-test-id="export-preview-toggle"]`, wait for `[data-test-id="export-section"] img` to be visible, assert `img.src` starts with `blob:` (confirms actual render, not empty src)diff --git a/openspec/changes/archive/2026-03-07-seo-meta-og/design.md b/openspec/changes/archive/2026-03-07-seo-meta-og/design.mddeleted file mode 100644index c36b465c6..000000000--- a/openspec/changes/archive/2026-03-07-seo-meta-og/design.md+++ /dev/null@@ -1,166 +0,0 @@-# Design: seo-meta-og--## Scope--Changes only in `packages/docs/`. No app code touched.--## URL structure--```-https://openpencil.dev/ → EN (root, x-default)-https://openpencil.dev/de/ → DE-https://openpencil.dev/fr/ → FR-https://openpencil.dev/es/ → ES-https://openpencil.dev/it/ → IT-https://openpencil.dev/pl/ → PL-```--Page paths follow the same pattern: `/guide/features` (EN), `/de/guide/features` (DE), etc.--## Locale map--```ts-const LOCALES = {- en: { lang: 'en', hreflang: 'en', ogLocale: 'en_US', prefix: '' },- de: { lang: 'de', hreflang: 'de', ogLocale: 'de_DE', prefix: '/de' },- fr: { lang: 'fr', hreflang: 'fr', ogLocale: 'fr_FR', prefix: '/fr' },- es: { lang: 'es', hreflang: 'es', ogLocale: 'es_ES', prefix: '/es' },- it: { lang: 'it', hreflang: 'it', ogLocale: 'it_IT', prefix: '/it' },- pl: { lang: 'pl', hreflang: 'pl', ogLocale: 'pl_PL', prefix: '/pl' },-}-const BASE = 'https://openpencil.dev'-const LOCALE_PREFIXES = ['de', 'fr', 'es', 'it', 'pl']-```--## 1. Global head tags (`config.ts`)--Add to the root `head: []`:--```ts-['meta', { property: 'og:site_name', content: 'OpenPencil' }],-['meta', { property: 'og:image', content: 'https://openpencil.dev/screenshot.png' }],-['meta', { property: 'og:image:width', content: '2784' }],-['meta', { property: 'og:image:height', content: '1824' }],-['meta', { property: 'og:image:alt', content: 'OpenPencil — AI-Native Design Editor' }],-['meta', { name: 'twitter:card', content: 'summary_large_image' }],-['meta', { name: 'twitter:site', content: '@openpencildev' }],-['meta', { name: 'twitter:image', content: 'https://openpencil.dev/screenshot.png' }],-```--Keep existing: favicon, `og:type`, `og:title`, `og:description`.--## 2. `transformPageData` hook--Fires at build time for every page. Logic:--```ts-transformPageData(pageData) {- const rel = pageData.relativePath // e.g. 'de/guide/features.md'-- // Determine current locale- const localeKey = LOCALE_PREFIXES.find(p => rel.startsWith(p + '/')) ?? 'en'- const locale = LOCALES[localeKey]-- // Slug = path without locale prefix and .md, index → ''- const slug = rel- .replace(/^(de|fr|es|it|pl)\//, '')- .replace(/\.md$/, '')- .replace(/\/index$/, '')- .replace(/^index$/, '')-- const pageUrl = `${BASE}${locale.prefix}/${slug}`.replace(/\/$/, '') || BASE- const enUrl = slug ? `${BASE}/${slug}` : BASE-- pageData.frontmatter.head ??= []- const h = pageData.frontmatter.head-- // Canonical (locale-specific)- h.push(['link', { rel: 'canonical', href: pageUrl }])-- // og:url (locale-specific)- h.push(['meta', { property: 'og:url', content: pageUrl }])-- // og:locale (current locale)- h.push(['meta', { property: 'og:locale', content: locale.ogLocale }])-- // og:locale:alternate for other locales- for (const [key, loc] of Object.entries(LOCALES)) {- if (key !== localeKey) {- h.push(['meta', { property: 'og:locale:alternate', content: loc.ogLocale }])- }- }-- // hreflang for all locales + x-default- for (const [key, loc] of Object.entries(LOCALES)) {- const altUrl = slug ? `${BASE}${loc.prefix}/${slug}` : `${BASE}${loc.prefix || ''}`- h.push(['link', { rel: 'alternate', hreflang: loc.hreflang, href: altUrl.replace(/\/$/, '') || BASE }])- }- // x-default points to EN- h.push(['link', { rel: 'alternate', hreflang: 'x-default', href: enUrl || BASE }])-- // og:title (per page)- if (pageData.title) {- h.push(['meta', { property: 'og:title', content: `${pageData.title} — OpenPencil` }])- h.push(['meta', { name: 'twitter:title', content: `${pageData.title} — OpenPencil` }])- }-- // og:description + meta description (per page)- if (pageData.description) {- h.push(['meta', { property: 'og:description', content: pageData.description }])- h.push(['meta', { name: 'twitter:description', content: pageData.description }])- h.push(['meta', { name: 'description', content: pageData.description }])- }-}-```--## 3. Sitemap with hreflang alternates--```ts-sitemap: {- hostname: BASE,- transformItems(items) {- return items.map(item => {- // Determine slug and locale from url- const localeKey = LOCALE_PREFIXES.find(p => item.url.startsWith('/' + p + '/')) ?? 'en'- const slug = item.url.replace(/^\/(de|fr|es|it|pl)\//, '/').replace(/\/$/, '') || '/'-- return {- ...item,- links: Object.entries(LOCALES).map(([, loc]) => ({- lang: loc.hreflang,- url: `${BASE}${loc.prefix}${slug === '/' ? '' : slug}` || BASE,- })),- }- })- },-}-```--## 4. JSON-LD component (`SchemaOrg.vue`)--Renders a `<script type="application/ld+json">` only on the EN homepage. Uses VitePress `useData()` to detect the page. The `<component :is="'script'">` pattern avoids Vue treating it as a special element.--Placed via `home-features-after` slot in `HomeLayout.vue` (already used for the screenshot). Only renders when `frontmatter.layout === 'home'` AND locale is EN (no prefix in `page.relativePath`).--## 5. Homepage frontmatter (`index.md` and locale index files)--Root `index.md` — add `title` for cleaner `<title>` tag:-```yaml-title: OpenPencil — AI-Native Design Editor-```--Locale index files (`de/index.md`, `fr/index.md`, etc.) — add translated `title`:-- DE: `OpenPencil — KI-nativer Design-Editor`-- FR: `OpenPencil — Éditeur de Design IA-Natif`-- ES: `OpenPencil — Editor de Diseño IA-Nativo`-- IT: `OpenPencil — Editor di Design IA-Nativo`-- PL: `OpenPencil — Edytor Graficzny z Natywnym AI`--## Key decisions--- **`hreflang` on every page**: Required for Google to correctly associate locale variants. VitePress `transformPageData` is the right hook — fires at build time, modifies `frontmatter.head` which VitePress renders into `<head>`.-- **`x-default` → EN**: Standard practice; tells Google the canonical "fallback" language.-- **`og:locale:alternate`**: Facebook/OG crawlers use this to link locale variants.-- **Sitemap alternates**: `xhtml:link` entries in sitemap are redundant with hreflang in HTML but recommended by Google for completeness.-- **JSON-LD only on EN homepage**: Avoid duplicate structured data across locales; Google recommends one authoritative schema page.-- **`twitter:title` / `twitter:description`**: Per-page Twitter card content, separate from global og tags.diff --git a/openspec/changes/archive/2026-03-07-seo-meta-og/proposal.md b/openspec/changes/archive/2026-03-07-seo-meta-og/proposal.mddeleted file mode 100644index 70d905b5d..000000000--- a/openspec/changes/archive/2026-03-07-seo-meta-og/proposal.md+++ /dev/null@@ -1,25 +0,0 @@-# Proposal: seo-meta-og--## Problem--The VitePress docs site at `openpencil.dev` has minimal SEO and social metadata:--- **Open Graph tags** are incomplete — `og:image`, `og:url`, `og:site_name`, `twitter:card`, `twitter:image` are all missing. Social shares on X/Twitter, Slack, Discord show no preview image.-- **Structured data (JSON-LD)** is absent — no `SoftwareApplication` schema, so Google can't render rich results for the app.-- **Canonical URL** is missing — no `og:url` or `<link rel="canonical">` per page.-- **Per-page meta descriptions** — many pages have frontmatter `title` + `description`, but non-frontmatter pages (guides, reference) have no `<meta name="description">`. VitePress does pick up frontmatter but the site-level fallback is fine; the real gap is OG tags.-- **Twitter/X Card** — `twitter:card`, `twitter:site`, `twitter:image` not set. Links pasted to X show no card.-- **Sitemap** — VitePress supports `sitemap` config but it isn't enabled. Google can only discover pages by crawling.-- **`og:image`** — `screenshot.png` (2784×1824) already exists in `public/` and is perfect for OG image (recommended: 1200×630 crop or use as-is since most crawlers handle oversized).--## What changes--1. **`config.ts`** — add complete `head[]` array with OG, Twitter Card, and canonical base URL; enable sitemap; add `og:image` pointing to `/screenshot.png`-2. **`config.ts`** — add `transformPageData` hook to inject per-page `og:title`, `og:description`, `og:url` dynamically-3. **`index.md`** — add frontmatter `title` for cleaner OG title on homepage-4. **JSON-LD component** — `SchemaOrg.vue` injecting `SoftwareApplication` structured data on the homepage-5. **`theme/index.ts`** — register SchemaOrg component for homepage--## Why--Search engines and social platforms rely on these signals. Without OG image, links to `openpencil.dev` shared anywhere show a blank card. Without JSON-LD, Google won't show the app in rich results. Sitemap speeds up discovery of all 50+ doc pages.diff --git a/openspec/changes/archive/2026-03-07-seo-meta-og/specs/vitepress-docs/spec.md b/openspec/changes/archive/2026-03-07-seo-meta-og/specs/vitepress-docs/spec.mddeleted file mode 100644index 271521b56..000000000--- a/openspec/changes/archive/2026-03-07-seo-meta-og/specs/vitepress-docs/spec.md+++ /dev/null@@ -1,93 +0,0 @@-# vitepress-docs — delta spec (seo-meta-og)--## Requirement: Open Graph image metadata--The docs site SHALL include `og:image`, `og:image:width`, `og:image:height`, and `og:image:alt` globally, pointing to `https://openpencil.dev/screenshot.png`.--### Scenario: OG image tag present on any page-- **WHEN** a crawler fetches any page on `openpencil.dev`-- **THEN** `<meta property="og:image" content="https://openpencil.dev/screenshot.png">` is in `<head>`--## Requirement: Twitter/X Card metadata--The docs site SHALL include `twitter:card` (value: `summary_large_image`), `twitter:site`, and `twitter:image` globally. Per-page `twitter:title` and `twitter:description` SHALL be injected from the page title and description.--### Scenario: Twitter card renders with large image-- **WHEN** a `openpencil.dev` URL is shared on X/Twitter-- **THEN** a large-image card is shown with the screenshot preview--## Requirement: og:site_name--The docs site SHALL include `<meta property="og:site_name" content="OpenPencil">` globally.--## Requirement: hreflang alternate links on every page--Every page SHALL include `<link rel="alternate" hreflang="...">` tags for all 6 language variants (en, de, fr, es, it, pl) plus `hreflang="x-default"` pointing to the EN version. The `x-default` href SHALL point to the English URL.--### Scenario: EN content page has all hreflang links-- **WHEN** crawler fetches `/guide/features`-- **THEN** hreflang links for en/de/fr/es/it/pl and x-default are all present in `<head>`--### Scenario: DE content page has correct hreflang-- **WHEN** crawler fetches `/de/guide/features`-- **THEN** hreflang links point to their respective locale URLs (e.g. de → `/de/guide/features`, en → `/guide/features`)--### Scenario: x-default always points to EN-- **WHEN** crawler fetches any locale page-- **THEN** `hreflang="x-default"` href is the English URL (no locale prefix)--## Requirement: og:locale and og:locale:alternate--Every page SHALL include `og:locale` matching the page language (e.g. `de_DE` for DE pages). All other locales SHALL be listed as `og:locale:alternate`.--### Scenario: DE page has correct og:locale-- **WHEN** crawler fetches `/de/guide/features`-- **THEN** `og:locale` is `de_DE` and other locales appear as `og:locale:alternate`--## Requirement: Per-page canonical URL--Every page SHALL have `<link rel="canonical">` with the full `https://openpencil.dev/<locale-prefix>/<slug>` URL. The canonical SHALL be locale-specific (DE pages have DE canonical).--### Scenario: DE page canonical is locale-specific-- **WHEN** crawler fetches `/de/guide/features`-- **THEN** canonical is `https://openpencil.dev/de/guide/features` (not the EN URL)--## Requirement: Per-page og:url--Every page SHALL have `<meta property="og:url">` matching the page's canonical URL.--## Requirement: Per-page og:title and og:description--Pages with a title SHALL have `og:title` set to `{title} — OpenPencil`. Pages with `description` frontmatter SHALL have `og:description`, `twitter:description`, and `meta name="description"` from it.--### Scenario: Content page OG title-- **WHEN** crawler fetches `/user-guide/canvas-navigation`-- **THEN** `og:title` is `Canvas Navigation — OpenPencil`--## Requirement: Sitemap with locale alternates--The docs site SHALL generate `sitemap.xml` with `<xhtml:link rel="alternate">` entries for all locale variants of each page.--### Scenario: Sitemap generated with alternates-- **WHEN** `bun run docs:build` completes-- **THEN** `sitemap.xml` exists and each URL entry contains `<xhtml:link>` alternates for all 6 locales--## Requirement: JSON-LD SoftwareApplication schema on EN homepage--The EN homepage SHALL include a `<script type="application/ld+json">` with `SoftwareApplication` schema: name, applicationCategory, operatingSystem, offers (free), url, description, screenshot, license. It SHALL NOT appear on locale homepages to avoid duplicate schema.--### Scenario: Structured data on EN homepage-- **WHEN** crawler fetches `https://openpencil.dev/`-- **THEN** a valid `SoftwareApplication` JSON-LD block is present--### Scenario: No duplicate schema on locale homepage-- **WHEN** crawler fetches `https://openpencil.dev/de/`-- **THEN** NO `SoftwareApplication` JSON-LD block is present--## Requirement: Translated title on locale homepages--Each locale homepage `index.md` SHALL have a translated `title` frontmatter field so the `<title>` tag is in the correct language.--### Scenario: DE homepage title in German-- **WHEN** browser opens `https://openpencil.dev/de/`-- **THEN** `<title>OpenPencil — KI-nativer Design-Editor | OpenPencil</title>` (or equivalent) is in `<head>`diff --git a/openspec/changes/archive/2026-03-07-seo-meta-og/tasks.md b/openspec/changes/archive/2026-03-07-seo-meta-og/tasks.mddeleted file mode 100644index 3a377c39d..000000000--- a/openspec/changes/archive/2026-03-07-seo-meta-og/tasks.md+++ /dev/null@@ -1,39 +0,0 @@-# Tasks: seo-meta-og--## 1. Global head tags + transformPageData--- [x] 1.1 `packages/docs/.vitepress/config.ts` — add to root `head[]`: `og:site_name`, `og:image` (+ width/height/alt), `twitter:card`, `twitter:site`, `twitter:image`-- [x] 1.2 `packages/docs/.vitepress/config.ts` — add `transformPageData` hook that for every page injects into `frontmatter.head`:- - `<link rel="canonical">` with full locale-specific URL- - `<meta property="og:url">` with full locale-specific URL- - `<meta property="og:locale">` matching current page language (e.g. `de_DE`)- - `<meta property="og:locale:alternate">` for all other 5 locales- - `<link rel="alternate" hreflang="...">` for all 6 locales (en/de/fr/es/it/pl) pointing to their respective URLs- - `<link rel="alternate" hreflang="x-default">` pointing to EN URL- - `<meta property="og:title">` as `{pageData.title} — OpenPencil` (when title exists)- - `<meta name="twitter:title">` same value- - `<meta property="og:description">` from `pageData.description` (when exists)- - `<meta name="twitter:description">` same value- - `<meta name="description">` same value--## 2. Sitemap--- [x] 2.1 `packages/docs/.vitepress/config.ts` — add `sitemap: { hostname: 'https://openpencil.dev', transformItems }` where `transformItems` adds `links` array with all 6 locale alternates per page URL--## 3. JSON-LD structured data--- [x] 3.1 Create `packages/docs/.vitepress/theme/SchemaOrg.vue` — `SoftwareApplication` JSON-LD rendered only when `page.relativePath === 'index.md'` (EN homepage only, not locale homepages)-- [x] 3.2 `packages/docs/.vitepress/theme/HomeLayout.vue` — import `SchemaOrg` and add `<SchemaOrg />` inside the `home-features-after` template slot (alongside existing screenshot)--## 4. Homepage titles--- [x] 4.1 `packages/docs/index.md` — add `title: OpenPencil — AI-Native Design Editor` to frontmatter-- [x] 4.2 `packages/docs/de/index.md` — add `title: OpenPencil — KI-nativer Design-Editor`-- [x] 4.3 `packages/docs/fr/index.md` — add `title: OpenPencil — Éditeur de Design IA-Natif`-- [x] 4.4 `packages/docs/es/index.md` — add `title: OpenPencil — Editor de Diseño IA-Nativo`-- [x] 4.5 `packages/docs/it/index.md` — add `title: OpenPencil — Editor di Design IA-Nativo`-- [x] 4.6 `packages/docs/pl/index.md` — add `title: OpenPencil — Edytor Graficzny z Natywnym AI`--## 5. Verify build--- [x] 5.1 Run `cd packages/docs && bun run build` — confirm: exits 0, `sitemap.xml` exists in dist, `dist/index.html` contains `og:image`, `hreflang`, JSON-LD block, `dist/de/index.html` contains `og:locale` = `de_DE`, hreflang links, NO JSON-LD blockdiff --git a/openspec/changes/archive/2026-03-07-sync-docs-v07-v08/design.md b/openspec/changes/archive/2026-03-07-sync-docs-v07-v08/design.mddeleted file mode 100644index 4b329cc7c..000000000--- a/openspec/changes/archive/2026-03-07-sync-docs-v07-v08/design.md+++ /dev/null@@ -1,88 +0,0 @@-# Design: sync-docs-v07-v08--## Scope--Pure documentation update — no code changes. All edits are in `packages/docs/`.--## File inventory--### English (source of truth)--| File | Changes needed |-|------|----------------|-| `guide/features.md` | Add: SVG export, Copy/Paste as, stroke align + per-side, Mobile/PWA, Tailwind JSX export, Homebrew tap, layer rename, updated tool count (75→78), Google Fonts fallback, auto-save, profiler |-| `guide/architecture.md` | Add "What's Next" section: multi-file tabs, AI providers, code signing, .fig fidelity, full figma-use tool set, CI tools, prototyping, SVG/PDF export, CSS Grid (Yoga upstream) |-| `guide/comparison.md` | Update: scripting section (75→78 tools), Summary paragraph (78 tools), "What Penpot Does Better" remove SVG export as Penpot advantage |-| `guide/figma-comparison.md` | Fix: Rename layers 🟡→✅, Image/SVG export 🟡→✅ (SVG done), Copy/Paste as 🔲→✅, Tailwind JSX export (new row), Stroke align ✅ (new row), Per-side stroke weights ✅ (new row), AI tools count 75→78, MCP tools count 75→78 |-| `user-guide/exporting.md` | Add SVG to format table; add "Copy/Paste as" subsection with all 4 formats |-| `user-guide/drawing-shapes.md` | Add Stroke Align (Inside/Center/Outside); add per-side stroke weights |-| `user-guide/layers-and-pages.md` | Add double-click rename; mobile drawer note; Code tab format toggle |-| `user-guide/context-menu.md` | Add "Copy/Paste as" section with 4 formats + shortcuts |-| `reference/keyboard-shortcuts.md` | Fix: ⌘N/⌘T ✅, ⌘W ✅, ⌘\\ ✅; add ⇧⌘C ✅ |-| `reference/mcp-tools.md` | Expand all tool tables to full 78 tools |-| `guide/getting-started.md` | Add Homebrew section; add `bun run test:unit` to scripts table |--### Locale translations (DE, ES, FR, IT, PL)--| File | Locales | Notes |-|------|---------|-------|-| `guide/features.md` | DE, ES, FR, IT, PL | Full sync — add all new sections |-| `guide/comparison.md` | DE, ES, FR, IT, PL | Sync scripting/summary counts; DE needs major expansion (128→292 lines) |-| `guide/figma-comparison.md` | DE, ES, FR, IT, PL | Sync status changes (Rename ✅, SVG ✅, Copy/Paste as ✅, new rows) |-| `user-guide/exporting.md` | DE, ES, FR, IT, PL | Add SVG + Copy/Paste as |-| `user-guide/drawing-shapes.md` | DE, ES, FR, IT, PL | Add stroke align + per-side |-| `user-guide/layers-and-pages.md` | DE, ES, FR, IT, PL | Add rename, mobile note, Code tab |-| `user-guide/context-menu.md` | DE, ES, FR, IT, PL | Add Copy/Paste as section |--## Approach--1. Update EN files first (source of truth), in this order:- - comparison tables (quick, factual fixes)- - architecture.md "What's Next"- - user-guide articles (exporting, drawing-shapes, layers, context-menu)- - keyboard-shortcuts, mcp-tools, getting-started- - features.md (comprehensive, last)-2. For each locale, apply the same changes translated into that language-3. Update spec delta files--## Key content decisions--### comparison.md updates-- Update scripting section: "75 tools" → "78 tools"; mention new analyze/diff tools-- Update summary paragraph tool count-- "What Penpot Does Better" section: remove "Server-side export" since OpenPencil now has SVG export; keep PDF as Penpot advantage-- Scale table: update rendering engine LOC from 1,646 to ~3,200 (split into 10 files)--### figma-comparison.md updates-- `Rename layers`: 🟡 (no inline rename UI) → ✅ (double-click inline rename added in Unreleased)-- `Image/SVG export`: 🟡 (no SVG) → ✅ (SVG export in v0.7.0)-- `Copy/Paste as`: add new row ✅-- `Tailwind CSS v4 export`: add new row in Code section ✅-- `Stroke align`: add new row ✅ in Effects & Properties-- `Individual stroke weights per side`: add new row ✅--### architecture.md "What's Next"-Content sourced from `plan.md` "What's next" section and CHANGELOG Unreleased:-- Multi-file / tabs (done in v0.5.0 — mark as complete if needed, or remove)-- More AI providers (Anthropic direct, Gemini, Ollama local models)-- Code signing (done for macOS in v0.6.0)-- .fig compatibility fidelity improvements-- Full figma-use tool set (currently 78/118)-- CI tools (design lint, visual regression via headless CLI)-- Prototyping (frame transitions, triggers, preview mode)-- CSS Grid layout (blocked on facebook/yoga#1893)-- SVG/PDF export (SVG done in v0.7.0, PDF planned)--## Spec deltas--### vitepress-docs/spec.md additions-- Comparison tables accuracy requirement-- Roadmap/What's Next section requirement-- figma-comparison.md status accuracy--### userdoc-articles/spec.md additions-- Stroke align and per-side weights-- Layer inline rename-- Copy/Paste as in context menu-- Mobile drawer note-- Locale paritydiff --git a/openspec/changes/archive/2026-03-07-sync-docs-v07-v08/proposal.md b/openspec/changes/archive/2026-03-07-sync-docs-v07-v08/proposal.mddeleted file mode 100644index c0f14861c..000000000--- a/openspec/changes/archive/2026-03-07-sync-docs-v07-v08/proposal.md+++ /dev/null@@ -1,38 +0,0 @@-# Proposal: sync-docs-v07-v08--## Problem--The VitePress documentation site (`packages/docs/`) has diverged significantly from the codebase since the last docs sync (commit `8a486d5`). Over 100 commits landed in master after that point, introducing major features:--- **SVG export** (v0.7.0) — new format in Export panel, CLI, MCP-- **Copy/Paste as submenu** — Copy as text / SVG / PNG / JSX-- **Stroke align + individual strokes** — Inside/Center/Outside, per-side weights-- **Google Fonts fallback** — auto-loads fonts from Google Fonts API-- **Auto-save toggle** — File → Auto-save to local file-- **Renderer profiler** — HUD overlay, GPU timing (View menu)-- **Mobile layout + PWA** — responsive editor, swipeable drawer, installable PWA-- **Tailwind CSS v4 JSX export** — new Code panel format toggle-- **Homebrew tap** — `brew install open-pencil/tap/open-pencil`-- **Double-click to rename layers** — inline rename in layers panel-- **9 new AI/MCP tools** — analyze_colors, analyze_typography, analyze_spacing, analyze_clusters, diff_create, diff_show, get_components, get_current_page, arrange, node_to_component-- **⌘N / ⌘T new tab, ⌘W close tab** — previously marked 🔲 in keyboard shortcuts-- **⌘\\ Toggle UI** — previously marked 🔲--Additionally:--- **Comparison tables outdated** — `comparison.md` (vs Penpot) and `figma-comparison.md` use stale counts (75 tools vs 78 actual, Rename layers 🟡 should be ✅, Image/SVG export 🟡 should be ✅ for SVG). The DE locale comparison is severely truncated (128 lines vs 292 EN).-- **No "What's next" / roadmap section** — `guide/architecture.md` documents current state but has no future plans. `plan.md` has a rich "What's next" section that should be surfaced in docs.-- **All locale translations** (DE, ES, FR, IT, PL) are 40–80 lines shorter than EN and missing every feature added since v0.5.0.-- **MCP tools reference** counts 75 tools but the table only lists ~25 entries; new tools are undocumented.--## What changes--1. **EN docs** — update `features.md`, `exporting.md`, `drawing-shapes.md`, `layers-and-pages.md`, `context-menu.md`, `reference/keyboard-shortcuts.md`, `reference/mcp-tools.md`, `guide/getting-started.md`, `guide/architecture.md`-2. **Comparison tables** — update `guide/comparison.md` (tool counts, scripting section, summary) and `guide/figma-comparison.md` (Rename layers ✅, SVG export ✅, Copy/Paste as ✅, Tailwind export, stroke align/per-side)-3. **Roadmap** — add "What's Next" section to `guide/architecture.md` drawn from `plan.md`-4. **Locale translations** — full sync for DE, ES, FR, IT, PL: `features.md`, `exporting.md`, `drawing-shapes.md`, `layers-and-pages.md`, `context-menu.md`, `comparison.md`, `figma-comparison.md`-5. **Spec deltas** — update `vitepress-docs/spec.md` and `userdoc-articles/spec.md`--## Why now--The branch `add-vitepress-docs` just pulled in master (e828185). This is the ideal moment to sweep through every doc page and make it accurate before the branch is merged or published.diff --git a/openspec/changes/archive/2026-03-07-sync-docs-v07-v08/specs/userdoc-articles/spec.md b/openspec/changes/archive/2026-03-07-sync-docs-v07-v08/specs/userdoc-articles/spec.mddeleted file mode 100644index b2f0e3c8f..000000000--- a/openspec/changes/archive/2026-03-07-sync-docs-v07-v08/specs/userdoc-articles/spec.md+++ /dev/null@@ -1,61 +0,0 @@-# userdoc-articles — delta spec (sync-docs-v07-v08)--## Requirement: Stroke align and per-side weights in drawing-shapes article--The drawing-shapes article SHALL document stroke alignment (Inside, Center, Outside) and individual stroke weights per side (Top, Right, Bottom, Left) in the Stroke subsection under Shape Properties.--### Scenario: Stroke align documented-- **WHEN** user reads the Drawing Shapes article-- **THEN** the Stroke section explains Inside/Center/Outside alignment options with a note about clip-based rendering--### Scenario: Per-side stroke weights documented-- **WHEN** user reads the Drawing Shapes article-- **THEN** the Stroke section mentions per-side weight control (Top/Right/Bottom/Left)--## Requirement: Layer inline rename in layers-and-pages article--The layers-and-pages article SHALL document double-click to rename a layer inline. Blur, Enter, or Escape SHALL be described as commit/cancel actions.--### Scenario: Layer rename documented-- **WHEN** user reads the Layers & Pages article-- **THEN** the Layers Panel section mentions double-click to rename with commit/cancel behavior--## Requirement: Copy/Paste as in context-menu article--The context-menu article SHALL have a "Copy/Paste as" section documenting: Copy as text, Copy as SVG, Copy as PNG (⇧⌘C / Shift+Ctrl+C), Copy as JSX.--### Scenario: Copy/Paste as section present-- **WHEN** user reads the Context Menu article-- **THEN** a "Copy/Paste as" section lists all four formats with shortcuts--## Requirement: Mobile layout note in layers-and-pages article--The layers-and-pages article SHALL note that on mobile/small screens panels are accessible via a swipeable bottom drawer.--### Scenario: Mobile note present-- **WHEN** user reads the Layers & Pages article-- **THEN** a brief note explains the mobile bottom drawer layout--## Requirement: Code panel format toggle documented--The layers-and-pages article's Code Tab description SHALL mention the format toggle: OpenPencil JSX (custom components) vs Tailwind CSS v4 (HTML with utility classes).--### Scenario: Format toggle mentioned-- **WHEN** user reads the Properties Panel → Code Tab description-- **THEN** both output formats are mentioned (OpenPencil and Tailwind)--## Requirement: Locale parity for updated articles--The DE, ES, FR, IT, PL translations of `guide/features.md`, `guide/comparison.md`, `guide/figma-comparison.md`, `user-guide/exporting.md`, `user-guide/drawing-shapes.md`, `user-guide/layers-and-pages.md`, and `user-guide/context-menu.md` SHALL be fully updated to match EN content, including all features from v0.5.0–Unreleased.--### Scenario: DE comparison.md matches EN structure-- **WHEN** comparing DE and EN comparison.md-- **THEN** DE has all 11 sections present in EN (not the truncated 128-line version)--### Scenario: All locales show SVG in exporting article-- **WHEN** user reads the Exporting article in any locale-- **THEN** SVG format is listed in the format table--### Scenario: All locales show Copy/Paste as in context-menu-- **WHEN** user reads the Context Menu article in any locale-- **THEN** a Copy/Paste as section is presentdiff --git a/openspec/changes/archive/2026-03-07-sync-docs-v07-v08/specs/vitepress-docs/spec.md b/openspec/changes/archive/2026-03-07-sync-docs-v07-v08/specs/vitepress-docs/spec.mddeleted file mode 100644index 3c03d833f..000000000--- a/openspec/changes/archive/2026-03-07-sync-docs-v07-v08/specs/vitepress-docs/spec.md+++ /dev/null@@ -1,88 +0,0 @@-# vitepress-docs — delta spec (sync-docs-v07-v08)--## Requirement: SVG export documentation--The features page and exporting article SHALL document SVG as an export format alongside PNG/JPG/WEBP. The Export section in the properties panel, context menu, CLI, and MCP/AI tool SHALL all be mentioned.--### Scenario: SVG export documented in features-- **WHEN** user reads the Features page-- **THEN** SVG export is listed as an export format with mention of CLI and MCP tool support--### Scenario: SVG in exporting article format table-- **WHEN** user reads the Exporting user guide article-- **THEN** SVG appears in the format table with a note that scale selector is hidden for SVG--## Requirement: Copy/Paste as submenu documentation--The context menu article and features page SHALL document the Copy/Paste as submenu with four options: Copy as text, Copy as SVG, Copy as PNG (⇧⌘C), Copy as JSX.--### Scenario: Copy/Paste as documented in context menu article-- **WHEN** user reads the Context Menu article-- **THEN** a "Copy/Paste as" section lists all four copy formats with shortcuts--## Requirement: Homebrew install in Getting Started--The Getting Started guide SHALL include a Homebrew installation section for macOS before "Building from Source".--### Scenario: Homebrew section present-- **WHEN** user reads the Getting Started page-- **THEN** `brew install open-pencil/tap/open-pencil` is shown as a macOS install option--## Requirement: Keyboard shortcuts accuracy--The keyboard shortcuts reference SHALL mark ⌘N/⌘T (new tab), ⌘W (close tab), and ⌘\\ (toggle UI) as ✅. ⇧⌘C (Copy as PNG) SHALL be added with ✅ status.--### Scenario: New tab shortcuts marked implemented-- **WHEN** user reads the Keyboard Shortcuts reference-- **THEN** ⌘N, ⌘T, ⌘W appear as ✅ in the File section--### Scenario: Toggle UI marked implemented-- **WHEN** user reads the Keyboard Shortcuts reference-- **THEN** ⌘\\ Show/Hide UI appears as ✅ in the View section--## Requirement: MCP tools table completeness--The MCP tools reference SHALL list all 78 tools (75 core + 3 file ops) in their respective category tables. All tool groups from v0.5.0 and later SHALL be documented.--### Scenario: All 78 tools listed-- **WHEN** user reads the MCP Tools reference-- **THEN** all tool groups are documented with tool name and description for each of the 78 tools--## Requirement: Comparison tables accuracy--The `guide/comparison.md` (vs Penpot) SHALL reflect the current tool count (78), correct renderer LOC after the renderer split (~3,200 LOC across 10 files), and accurate scripting section. The "What Penpot Does Better" section SHALL NOT list server-side SVG export as a Penpot advantage since OpenPencil now exports SVG.--### Scenario: comparison.md tool counts current-- **WHEN** user reads the comparison with Penpot-- **THEN** OpenPencil tool count is stated as 78 (not 75)--### Scenario: SVG export not listed as Penpot advantage-- **WHEN** user reads the "What Penpot Does Better" section-- **THEN** SVG export is NOT listed as a Penpot-only feature--## Requirement: Figma feature matrix accuracy--The `guide/figma-comparison.md` SHALL have accurate status flags reflecting the current implementation:-- Rename layers: ✅ (double-click inline rename)-- Image/SVG export: ✅ (SVG added in v0.7.0)-- Copy/Paste as: ✅ (new row)-- Tailwind CSS v4 export: ✅ (new row in Code Panel section)-- Stroke align: ✅ (new row in Effects & Properties)-- Individual stroke weights per side: ✅ (new row)-- AI/MCP tool counts: 78--### Scenario: Rename layers shows ✅-- **WHEN** user reads the figma-comparison Layers & Shapes table-- **THEN** Rename layers row shows ✅ with inline rename note--### Scenario: SVG export shows ✅-- **WHEN** user reads the Import & Export table-- **THEN** Image/SVG export row shows ✅--## Requirement: Architecture roadmap section--The `guide/architecture.md` SHALL include a "What's Next" section documenting planned and in-progress work: additional AI providers, full figma-use tool set completion, CI design tooling, prototyping, CSS Grid (Yoga upstream blocker), PDF export, .fig fidelity improvements.--### Scenario: What's Next section present-- **WHEN** user reads the Architecture guide-- **THEN** a "What's Next" section lists upcoming features with context on blockers and statusdiff --git a/openspec/changes/archive/2026-03-07-sync-docs-v07-v08/tasks.md b/openspec/changes/archive/2026-03-07-sync-docs-v07-v08/tasks.mddeleted file mode 100644index 9d1f30120..000000000--- a/openspec/changes/archive/2026-03-07-sync-docs-v07-v08/tasks.md+++ /dev/null@@ -1,82 +0,0 @@-# Tasks: sync-docs-v07-v08--## 1. English — comparison tables--- [x] 1.1 `guide/comparison.md` — update scripting section: "75 tools" → "78 tools", mention analyze_*/diff_* tools; update Summary paragraph tool counts; remove "Server-side export" from "What Penpot Does Better" (OpenPencil now has SVG export); update rendering engine LOC (~3,200 after renderer split)-- [x] 1.2 `guide/figma-comparison.md` — fix statuses: Rename layers 🟡→✅, Image/SVG export 🟡→✅; add new rows: Copy/Paste as ✅, Tailwind CSS v4 export ✅, Stroke align ✅, Individual stroke weights per side ✅; update AI/MCP tool counts 75→78; update Coverage line count--## 2. English — architecture roadmap--- [x] 2.1 `guide/architecture.md` — add "What's Next" section after the last component section, drawn from `plan.md` and CHANGELOG Unreleased: more AI providers (Anthropic direct, Gemini, Ollama), full figma-use tool set (78/118 currently), CI design lint + visual regression, Prototyping (phase 6), CSS Grid (blocked on facebook/yoga#1893), SVG/PDF export (SVG ✅, PDF planned), .fig fidelity improvements--## 3. English — user guide articles--- [x] 3.1 `user-guide/exporting.md` — add SVG to format table (note: no scale selector for SVG); add "Copy/Paste as" subsection with: Copy as text, Copy as SVG, Copy as PNG (⇧⌘C / Shift+Ctrl+C), Copy as JSX-- [x] 3.2 `user-guide/drawing-shapes.md` — add "Stroke Align" subsection under Shape Properties (Inside/Center/Outside, clip-based rendering); add "Per-Side Stroke Weights" note (Top/Right/Bottom/Left dropdown)-- [x] 3.3 `user-guide/layers-and-pages.md` — add double-click inline rename in Layers Panel section (blur/Enter/Escape to commit); add mobile bottom drawer note; update Code tab description: mention format toggle (OpenPencil JSX / Tailwind CSS v4)-- [x] 3.4 `user-guide/context-menu.md` — add "Copy/Paste as" section: Copy as text, Copy as SVG, Copy as PNG (⇧⌘C), Copy as JSX--## 4. English — reference pages--- [x] 4.1 `reference/keyboard-shortcuts.md` — fix File section: ⌘N ✅, ⌘T ✅, ⌘W ✅; fix View section: ⌘\\ ✅; add Edit section row: ⇧⌘C Copy as PNG ✅-- [x] 4.2 `reference/mcp-tools.md` — expand all tool tables to full 78 tools; add missing categories/tools: Granular Set (set_rotation, set_opacity, set_radius, set_minmax, set_text, set_font, set_font_range, set_text_resize, set_visible, set_blend, set_locked, set_stroke_align), Node ops (node_bounds, node_move, node_resize, node_ancestors, node_children, node_tree, node_bindings, node_replace_with), Variables (get_variable, find_variables, create_variable, set_variable, delete_variable, bind_variable, get_collection, create_collection, delete_collection), Boolean (boolean_union, boolean_subtract, boolean_intersect, boolean_exclude), Vector (path_get, path_set, path_scale, path_flip, path_move), Create extras (create_page, create_vector, create_slice), Analyze (analyze_colors, analyze_typography, analyze_spacing, analyze_clusters), Diff (diff_create, diff_show), Arrange (arrange), Component (node_to_component, get_components, get_current_page)-- [x] 4.3 `guide/getting-started.md` — add Homebrew install section before "Building from Source": `brew install open-pencil/tap/open-pencil`; add `bun run test:unit` row to scripts table--## 5. English — features.md--- [x] 5.1 `guide/features.md` — add/update sections: SVG Export (v0.7.0), Copy/Paste as submenu, Stroke Align + Per-Side Weights, Google Fonts Fallback, Auto-Save Toggle, Renderer Profiler, Mobile Layout & PWA, Tailwind CSS v4 JSX Export, Homebrew Tap, Layer Inline Rename; update AI Chat tools count (75→78); update MCP total (78 tools); update Code Panel: mention format toggle--## 6. German translation (de/)--- [x] 6.1 `de/guide/comparison.md` — full expansion to match EN (128→~290 lines): restore all missing sections (Rendering Pipeline detail, Scene Graph, Layout Engine, File Format, State & Undo, Developer Experience, Performance, What Penpot Does Better, Scripting, full Summary table); update tool counts and SVG export status-- [x] 6.2 `de/guide/figma-comparison.md` — sync status changes: Rename layers ✅, SVG export ✅; add new rows: Copy/Paste as, Tailwind, Stroke align, Per-side weights; update coverage line-- [x] 6.3 `de/guide/features.md` — add all new sections from EN (SVG export, Copy/Paste as, stroke align, mobile/PWA, Tailwind, Homebrew, layer rename, Google Fonts, auto-save, profiler); update tool counts-- [x] 6.4 `de/user-guide/exporting.md` — add SVG format + Copy/Paste as subsection-- [x] 6.5 `de/user-guide/drawing-shapes.md` — add stroke align + per-side weights-- [x] 6.6 `de/user-guide/layers-and-pages.md` — add rename, mobile note, Code tab format toggle-- [x] 6.7 `de/user-guide/context-menu.md` — add Copy/Paste as section--## 7. Spanish translation (es/)--- [x] 7.1 `es/guide/comparison.md` — update scripting/summary tool counts; SVG export status fix-- [x] 7.2 `es/guide/figma-comparison.md` — sync status changes + add new rows-- [x] 7.3 `es/guide/features.md` — add all new sections from EN-- [x] 7.4 `es/user-guide/exporting.md` — add SVG format + Copy/Paste as-- [x] 7.5 `es/user-guide/drawing-shapes.md` — add stroke align + per-side weights-- [x] 7.6 `es/user-guide/layers-and-pages.md` — add rename, mobile, Code tab-- [x] 7.7 `es/user-guide/context-menu.md` — add Copy/Paste as section--## 8. French translation (fr/)--- [x] 8.1 `fr/guide/comparison.md` — update scripting/summary tool counts; SVG export status fix-- [x] 8.2 `fr/guide/figma-comparison.md` — sync status changes + add new rows-- [x] 8.3 `fr/guide/features.md` — add all new sections from EN-- [x] 8.4 `fr/user-guide/exporting.md` — add SVG format + Copy/Paste as-- [x] 8.5 `fr/user-guide/drawing-shapes.md` — add stroke align + per-side weights-- [x] 8.6 `fr/user-guide/layers-and-pages.md` — add rename, mobile, Code tab-- [x] 8.7 `fr/user-guide/context-menu.md` — add Copy/Paste as section--## 9. Italian translation (it/)--- [x] 9.1 `it/guide/comparison.md` — update scripting/summary tool counts; SVG export status fix-- [x] 9.2 `it/guide/figma-comparison.md` — sync status changes + add new rows-- [x] 9.3 `it/guide/features.md` — add all new sections from EN-- [x] 9.4 `it/user-guide/exporting.md` — add SVG format + Copy/Paste as-- [x] 9.5 `it/user-guide/drawing-shapes.md` — add stroke align + per-side weights-- [x] 9.6 `it/user-guide/layers-and-pages.md` — add rename, mobile, Code tab-- [x] 9.7 `it/user-guide/context-menu.md` — add Copy/Paste as section--## 10. Polish translation (pl/)--- [x] 10.1 `pl/guide/comparison.md` — update scripting/summary tool counts; SVG export status fix-- [x] 10.2 `pl/guide/figma-comparison.md` — sync status changes + add new rows-- [x] 10.3 `pl/guide/features.md` — add all new sections from EN-- [x] 10.4 `pl/user-guide/exporting.md` — add SVG format + Copy/Paste as-- [x] 10.5 `pl/user-guide/drawing-shapes.md` — add stroke align + per-side weights-- [x] 10.6 `pl/user-guide/layers-and-pages.md` — add rename, mobile, Code tab-- [x] 10.7 `pl/user-guide/context-menu.md` — add Copy/Paste as section--## 11. Spec updates--- [x] 11.1 `openspec/specs/vitepress-docs/spec.md` — merge delta spec requirements (comparison accuracy, roadmap section, figma-comparison accuracy)-- [x] 11.2 `openspec/specs/userdoc-articles/spec.md` — merge delta spec requirements (stroke align, rename, copy/paste as, mobile, locale parity)diff --git a/openspec/changes/mobile-layout/.openspec.yaml b/openspec/changes/mobile-layout/.openspec.yamldeleted file mode 100644index 85cf50d8b..000000000--- a/openspec/changes/mobile-layout/.openspec.yaml+++ /dev/null@@ -1,2 +0,0 @@-schema: spec-driven-created: 2026-03-03diff --git a/openspec/changes/mobile-layout/design.md b/openspec/changes/mobile-layout/design.mddeleted file mode 100644index f7985f03c..000000000--- a/openspec/changes/mobile-layout/design.md+++ /dev/null@@ -1,113 +0,0 @@-## Context--OpenPencil's EditorView uses a horizontal SplitterGroup with three panels: LayersPanel (18%), EditorCanvas (64%), PropertiesPanel (18%). This works on desktop but fails on small screens. The canvas already supports touch pinch-zoom and multi-touch gestures via `use-canvas-input.ts`.--## Goals / Non-Goals--**Goals:**-- Usable editor on viewports ≥320px wide through 768px-- Canvas gets maximum screen real estate on mobile-- All panel content accessible via bottom drawer-- Touch-friendly interactions (≥44px targets, swipe gestures)-- Zero impact on desktop layout--**Non-Goals:**-- Tablet landscape split view-- PWA / offline mobile support-- Native mobile app--## Decisions--### 1. Custom drawer instead of vaul-vue--Initially planned vaul-vue, but replaced with a custom implementation using CSS `translateY` + `transition` + `requestAnimationFrame`. Reasons:-- vaul-vue portals to `<body>`, creating z-index conflicts with CanvasKit WebGL surface-- Custom drawer gives precise control over snap points and drag behavior-- Simpler DOM structure — drawer stays in normal flow, no portal--Implementation: `MobileDrawer.vue` uses `renderSnap` ref with `nextTick()` + `requestAnimationFrame()` pattern for smooth open animation (force browser to render initial position before transitioning).--### 2. Snap points: closed / half / full--- **Closed**: `translateY(100%)` — fully hidden, only ribbon visible-- **Half**: 3/7 of viewport height — shows enough panel content for quick edits-- **Full**: viewport minus ribbon (44px) minus HUD top area (94px) — stops below the active tool indicator--Drag gestures on the entire drawer body (not just handle) — swipe down from full → half → closed, swipe up from closed → half → full. Threshold: 50px displacement.--### 3. MobileHud overlay--New `MobileHud.vue` component rendered as absolute overlay on the canvas area:-- **Top-left**: Undo/redo buttons (rounded circles, shadow), active tool indicator below-- **Top-center**: Online badge (when connected) + action toast (fade animation)-- **Top-right**: Share button + burger menu (New, Open, Save, Export, Zoom to fit)-- Root div has `pointer-events-none`, child groups have `pointer-events-auto`-- `@touchstart.stop` prevents touch events leaking to canvas--### 4. Ribbon outside the drawer--MobileRibbon is `fixed bottom-0 z-40` — always visible regardless of drawer state. Drawer content appears above the ribbon. The ribbon has:-- Layers and Design as separate buttons (icon + label when active)-- Code and AI as icon-only buttons on the right-- Swipe up/down on ribbon triggers drawer snap changes-- Tab tap when drawer closed auto-opens to half snap--### 5. Toolbar 3-category system (mobile only)--Desktop toolbar unchanged. Mobile toolbar splits into 3 categories:-- **Category 0**: Drawing tools (all TOOLS from store, with flyout dropdowns)-- **Category 1**: Edit actions (Copy, Paste, Cut, Duplicate, Delete)-- **Category 2**: Arrange actions (Front, Back, Group, Ungroup, Lock)--Arrow buttons navigate between categories. Container width animates smoothly: all categories stacked in same space, active one `relative` (sets width), others `absolute` with opacity transition. Width animation via inline `transition: width 250ms ease`.--Edit/Arrange actions show toast via `store.state.actionToast` (displayed in MobileHud).--### 6. Touch-to-mouse synthesis--`use-canvas-input.ts` handles touch events on canvas:-- Single finger on HAND tool → direct pan (existing pinch-zoom behavior)-- Single finger on any other tool → `syntheticMouse()` creates MouseEvent from Touch, delegates to `onMouseDown`/`onMouseMove`/`onMouseUp`-- Two-finger pinch → pinch-zoom (existing)-- `@touchstart.stop` on HUD and toolbar prevents leaking to canvas--### 7. Internal clipboard for mobile--Mobile browsers restrict clipboard API access outside user gesture chains. Copy/paste buttons in toolbar use an in-memory `internalClipboard` variable:-- Copy: `store.writeCopyData(new DataTransfer())` → store HTML in variable-- Paste: `store.pasteFromHTML(internalClipboard)`-- Cut: copy + `store.deleteSelected()`--### 8. Rulers hidden on mobile--`use-canvas.ts` skips ruler rendering when `isMobile` is true. Rulers take valuable screen space and are impractical on touch devices.--### 9. Z-index layering--| Element | Z-index | Position |-|---------|---------|----------|-| Canvas | base | Normal flow |-| Toolbar | z-10 | Absolute, above ribbon |-| MobileDrawer | z-30 | Fixed, above canvas |-| MobileRibbon | z-40 | Fixed bottom |-| Popovers/dropdowns | z-50 | Portal |-| HUD | z-10 | Absolute overlay on canvas |--### 10. State in editor store--```-activeRibbonTab: 'panels' | 'code' | 'ai' | null (null = no highlight when drawer closed)-panelMode: 'layers' | 'design'-mobileDrawerSnap: 0 | 'half' | 'full' | 'closed'-actionToast: string | null-```--## Risks / Trade-offs--**[Trade-off] Custom drawer vs library** — More code to maintain, but full control over behavior and no portal issues.--**[Trade-off] Internal clipboard** — Copy/paste only works within the same session, not across apps. Acceptable limitation for mobile.--**[Trade-off] AppMenu hidden on mobile** — File operations accessible via burger menu in HUD. Not all desktop menu items available on mobile.--**[Risk] Virtual keyboard** — May push viewport when editing text in drawer. Start with default behavior, iterate if needed.diff --git a/openspec/changes/mobile-layout/proposal.md b/openspec/changes/mobile-layout/proposal.mddeleted file mode 100644index 9cedf056e..000000000--- a/openspec/changes/mobile-layout/proposal.md+++ /dev/null@@ -1,46 +0,0 @@-## Why--The editor has a fixed three-column desktop layout (layers | canvas | properties) using reka-ui Splitter. On mobile/tablet viewports (<768px), the side panels consume all usable space, making the canvas unusable. There's no responsive behavior, no breakpoint detection, and no mobile-optimized UI. The canvas already handles touch pinch-zoom, so the rendering layer is ready — the chrome needs to adapt.--## What Changes--- Detect mobile viewport via `useMediaQuery('(max-width: 767px)')` from `@vueuse/core` in EditorView-- On mobile: hide desktop side panels, show canvas fullscreen with HUD overlay-- Add a custom bottom drawer (CSS translateY + transition) that slides up to reveal panel content. Snap points: closed, half (~3/7 viewport), full (viewport minus HUD area)-- Fixed ribbon tab bar at viewport bottom — always visible and thumb-reachable-- Ribbon tabs: Layers and Design as separate buttons (with label when active), Code and AI as icon-only buttons on the right-- Extract layer tree into `LayerTree.vue` for reuse in both desktop LayersPanel and mobile drawer-- Render DesignPanel, CodePanel, ChatPanel directly in mobile drawer via `v-show` (preserve ChatPanel state)-- PagesPanel in compact drawer header; AppMenu hidden on mobile-- MobileHud: undo/redo buttons, active tool indicator, online badge with peers dropdown, action toast, Share button, burger menu (New/Open/Save/Export/Zoom to fit)-- Mobile toolbar with 3 categories (Tools/Edit/Arrange), arrow navigation, animated width transitions-- Touch-to-mouse event synthesis for non-HAND tools in canvas input-- Rulers hidden on mobile-- Internal clipboard buffer for copy/paste (mobile browser clipboard API limitations)-- Fix `showUI` initialization to `true` (was gated by matchMedia)-- ⌘J shortcut bridges mobile/desktop: toggles `activeRibbonTab` on mobile-- Mobile state (`activeRibbonTab`, `panelMode`, `mobileDrawerSnap`, `actionToast`) in editor store-- Z-index layering: canvas < toolbar (z-10) < ribbon (z-40) < drawer (z-30) < popovers (z-50)-- Desktop layout completely unchanged--## Capabilities--### New Capabilities-- `mobile-layout`: Responsive mobile/tablet layout with custom bottom drawer, fixed ribbon tabs, MobileHud overlay, touch tool support, and adaptive panel switching--### Modified Capabilities-- `editor-ui`: EditorView gains responsive breakpoint detection and conditional rendering of desktop vs mobile chrome--## Impact--- `src/views/EditorView.vue` — conditional desktop/mobile layout-- `src/components/MobileDrawer.vue` — new: custom drawer with translateY transitions and drag gestures-- `src/components/MobileRibbon.vue` — new: fixed bottom tab bar-- `src/components/MobileHud.vue` — new: overlay with undo/redo, tool indicator, online badge, toast, burger menu-- `src/components/LayerTree.vue` — new: extracted from LayersPanel-- `src/components/LayersPanel.vue` — refactored to use LayerTree-- `src/components/Toolbar.vue` — 3 mobile categories with animated width, select-none, touch-friendly-- `src/stores/editor.ts` — new state: `activeRibbonTab`, `panelMode`, `mobileDrawerSnap`, `actionToast`; fix `showUI` init-- `src/composables/use-keyboard.ts` — ⌘J mobile bridge-- `src/composables/use-canvas-input.ts` — touch→mouse event synthesis for non-HAND tools-- `src/composables/use-canvas.ts` — rulers hidden on mobilediff --git a/openspec/changes/mobile-layout/specs/editor-ui/spec.md b/openspec/changes/mobile-layout/specs/editor-ui/spec.mddeleted file mode 100644index 2784d99c3..000000000--- a/openspec/changes/mobile-layout/specs/editor-ui/spec.md+++ /dev/null@@ -1,7 +0,0 @@-## MODIFIED Requirements--### Requirement: Bottom toolbar-The toolbar SHALL be positioned at the bottom of the screen with tool selection: Select (V), Frame (F), Section (S, in Frame flyout), Rectangle (R), Ellipse (O), Line (L), Polygon (flyout), Star (flyout), Text (T), Hand (H), Pen (P). On mobile viewports (<768px), the toolbar SHALL split into 3 categories navigated by arrow buttons: Category 0 (drawing tools with flyouts), Category 1 (Copy/Paste/Cut/Duplicate/Delete), Category 2 (Front/Back/Group/Ungroup/Lock). Buttons SHALL be `size-8` inside an `h-11` container with `rounded-[8px]` box and `rounded-[6px]` buttons. The toolbar SHALL be positioned above the MobileRibbon bar. Container width SHALL animate (250ms ease) when switching categories. All mobile buttons SHALL have `select-none border-none`. Edit/arrange actions SHALL trigger action toasts via `store.state.actionToast`.--### Requirement: Resizable panels-The left (layers) and right (properties) panels SHALL be resizable via reka-ui Splitter components on desktop viewports (≥768px). On mobile viewports, panels SHALL render inside the bottom drawer instead of the SplitterGroup.diff --git a/openspec/changes/mobile-layout/specs/mobile-layout/spec.md b/openspec/changes/mobile-layout/specs/mobile-layout/spec.mddeleted file mode 100644index e4978480e..000000000--- a/openspec/changes/mobile-layout/specs/mobile-layout/spec.md+++ /dev/null@@ -1,84 +0,0 @@-## ADDED Requirements--### Requirement: Mobile viewport detection-The editor SHALL detect mobile viewports using a `(max-width: 767px)` media query via `useMediaQuery` from `@vueuse/core` in EditorView. The detection SHALL be reactive — rotating a device or resizing a browser window SHALL switch layouts without page reload.--### Requirement: Mobile canvas fullscreen-On mobile viewports, the EditorCanvas SHALL fill the entire viewport. The desktop SplitterGroup with LayersPanel and PropertiesPanel SHALL NOT render. Rulers SHALL be hidden on mobile.--### Requirement: Custom bottom drawer-The editor SHALL display a custom bottom drawer on mobile viewports containing panel content. The drawer SHALL use CSS `translateY` transitions (not a portal-based library). Three snap states: closed (fully hidden), half (~3/7 viewport height), full (viewport minus ribbon and HUD area). The drawer SHALL support drag gestures on the entire drawer body with a 50px threshold. The active snap SHALL be stored in `store.state.mobileDrawerSnap`. Swipe down from full goes to half, then to closed. Swipe up from closed goes to half, then to full.--#### Scenario: Smooth open animation-- **WHEN** the drawer transitions from closed to half-- **THEN** it animates via CSS transition (not instant jump), using requestAnimationFrame to ensure initial position renders before transition--#### Scenario: Drag to dismiss-- **WHEN** user swipes down >50px from half snap-- **THEN** drawer transitions to closed and `activeRibbonTab` resets to null--### Requirement: Fixed bottom ribbon tab bar-The editor SHALL render a MobileRibbon as a fixed bar at the viewport bottom (`fixed bottom-0 z-40`), outside the drawer. Tabs: Layers and Design as separate buttons (icon + label when active), Code and AI as icon-only buttons on the right. Visible at all times. Touch targets ≥44px. Safe area inset padding via `env(safe-area-inset-bottom)`.--#### Scenario: Ribbon swipe gestures-- **WHEN** user swipes up on the ribbon while drawer is closed-- **THEN** drawer opens to half snap--#### Scenario: Tab tap auto-opens drawer-- **WHEN** user taps a tab while drawer is collapsed-- **THEN** drawer animates to half snap--#### Scenario: Tab tap toggles drawer-- **WHEN** user taps the already-active tab while drawer is open-- **THEN** drawer closes and tab highlight resets to null--### Requirement: MobileHud overlay-The editor SHALL render a MobileHud component as an absolute overlay on the canvas area with:-- Top-left: Undo/redo buttons + active tool indicator (animated icon change)-- Top-center: Online badge (when connected, with peers dropdown) + action toast (800ms fade)-- Top-right: Share button + burger menu (New, Open, Save, Export, Zoom to fit)--The root SHALL have `pointer-events-none` with `pointer-events-auto` on interactive groups. `@touchstart.stop` SHALL prevent touch events from leaking to canvas.--#### Scenario: Action toast display-- **WHEN** user taps an edit/arrange action in the toolbar-- **THEN** a toast with the action name appears in the HUD center for 800ms--#### Scenario: Burger menu file operations-- **WHEN** user taps the burger menu button-- **THEN** a dropdown shows New, Open, Save, Export, Zoom to fit options--### Requirement: Mobile toolbar categories-On mobile, the toolbar SHALL split into 3 categories: drawing tools (Category 0), edit actions (Category 1: Copy/Paste/Cut/Duplicate/Delete), arrange actions (Category 2: Front/Back/Group/Ungroup/Lock). Arrow buttons navigate between categories. The container width SHALL animate smoothly (250ms ease) when switching categories. Buttons SHALL be `size-8` inside an `h-11` container. All buttons SHALL have `select-none` and `border-none`.--#### Scenario: Category switch animation-- **WHEN** user taps the right arrow from Category 0-- **THEN** the container width animates to Category 1's width and icons crossfade via opacity transition--#### Scenario: Edit action with toast-- **WHEN** user taps Delete in Category 1-- **THEN** the selected node is deleted and "Delete" toast shows in MobileHud--### Requirement: Touch-to-mouse event synthesis-`use-canvas-input.ts` SHALL synthesize MouseEvents from TouchEvents for non-HAND tools. Single-finger touch on SELECT/FRAME/RECTANGLE/etc. SHALL trigger `onMouseDown`/`onMouseMove`/`onMouseUp` with coordinates from the touch. Two-finger pinch-zoom SHALL continue to work. HAND tool SHALL use direct pan handling (no mouse synthesis).--### Requirement: Internal clipboard for mobile-Copy/paste toolbar buttons SHALL use an in-memory clipboard buffer instead of system clipboard API. Copy stores HTML via `store.writeCopyData(new DataTransfer())`. Paste reads from the buffer via `store.pasteFromHTML()`.--### Requirement: showUI initialization-The `showUI` store flag SHALL be initialized to `true` (not gated by matchMedia). On mobile with `showUI=true`: canvas + HUD + toolbar + ribbon + drawer. On mobile with `showUI=false`: only canvas.--### Requirement: ⌘J shortcut on mobile-On mobile, ⌘J SHALL toggle `activeRibbonTab` between current tab and `'ai'`, opening the drawer if collapsed. On desktop, existing behavior unchanged.--### Requirement: Extracted LayerTree component-The layer tree (tree nodes, drag reorder, expand/collapse, context menu, visibility toggle) SHALL be extracted from LayersPanel into `LayerTree.vue`. LayersPanel uses LayerTree internally. MobileDrawer uses LayerTree directly.--### Requirement: Panel content preservation-All panels in the mobile drawer SHALL use `v-show` instead of `v-if` to preserve component state during tab switches.--### Requirement: Desktop layout unchanged-On desktop viewports (≥768px), the existing SplitterGroup layout SHALL render unchanged. Mobile components SHALL NOT render.--### Requirement: Full drawer height limit-When the drawer is at full snap, its height SHALL stop below the active tool indicator in the MobileHud, with the same spacing as the HUD has from the viewport top. Full height = viewport - ribbon height (44px) - HUD top area (94px).diff --git a/openspec/changes/mobile-layout/tasks.md b/openspec/changes/mobile-layout/tasks.mddeleted file mode 100644index fa3d207ea..000000000--- a/openspec/changes/mobile-layout/tasks.md+++ /dev/null@@ -1,67 +0,0 @@-## 1. Store & State--- [x] 1.1 Add mobile state to editor store (`src/stores/editor.ts`): `activeRibbonTab: 'panels' | 'code' | 'ai' | null` (default `null`), `panelMode: 'layers' | 'design'` (default `'design'`), `mobileDrawerSnap: 0 | 'half' | 'full' | 'closed'` (default `0`), `actionToast: string | null` (default `null`)-- [x] 1.2 Fix `showUI` initialization: change from `matchMedia(...)` to `true`--## 2. Extract LayerTree Component--- [x] 2.1 Create `src/components/LayerTree.vue` — extract tree logic from LayersPanel: reka-ui TreeRoot/TreeItem, drag reorder, expand/collapse, context menu, visibility icon. Import order: reka-ui → vue → @vueuse → icons → @/ → relative-- [x] 2.2 Refactor `src/components/LayersPanel.vue` to use `<LayerTree />`--## 3. MobileRibbon Component--- [x] 3.1 Create `src/components/MobileRibbon.vue` — fixed bar at viewport bottom (`fixed bottom-0 z-40`), outside the drawer. Layers/Design as separate buttons (icon + label when active), Code/AI as icon-only buttons on right. 44px touch targets. `env(safe-area-inset-bottom)` padding. All tabs have `select-none outline-none transition-colors`. No `hover:` states — mobile only uses state-based styles-- [x] 3.2 Swipe gestures on ribbon: swipe up opens drawer (half/full), swipe down closes. `SWIPE_THRESHOLD = 30`, `SWIPE_MAX_DURATION = 500`-- [x] 3.3 Tab tap toggles: tap active tab while drawer open → close drawer + reset `activeRibbonTab` to null--## 4. MobileDrawer Component--- [x] 4.1 Create `src/components/MobileDrawer.vue` — custom drawer using CSS `translateY` + `transition` (NOT vaul-vue). Snap states: closed, half (3/7 viewport), full (viewport - 44px ribbon - 94px HUD). `renderSnap` ref with `nextTick()` + `requestAnimationFrame()` for smooth open animation-- [x] 4.2 Drag gestures on entire drawer body (not just handle). 50px threshold. Swipe down: full→half→closed. Swipe up: closed→half→full. Drag handle with `select-none`-- [x] 4.3 Drawer header: compact PagesPanel (horizontal scrollable) with border-b-- [x] 4.4 Panel content via `v-show`: LayerTree, DesignPanel, CodePanel, ChatPanel. `@touchstart.stop @touchmove.stop` on content area to prevent canvas interaction--## 5. MobileHud Component--- [x] 5.1 Create `src/components/MobileHud.vue` — absolute overlay with `pointer-events-none` root, `pointer-events-auto` on interactive groups. `@touchstart.stop` on root-- [x] 5.2 Top-left: Undo/redo buttons (`size-8 rounded-full border border-border shadow-md select-none`) + active tool indicator (`border-accent/30`, animated icon change via `Transition mode="out-in"`)-- [x] 5.3 Top-center: Online badge with peers dropdown (simple div toggle, not reka-ui Popover) + action toast (`toast-fade` transition, 800ms duration from `ACTION_TOAST_DURATION`)-- [x] 5.4 Top-right: Share button + burger menu (`onClickOutside` for dismiss). Menu items: New, Open, Save, Export, Zoom to fit. Each with Lucide icon. `border-none bg-transparent outline-none select-none`--## 6. EditorView Responsive Layout--- [x] 6.1 Add `isMobile = useMediaQuery('(max-width: 767px)')` in EditorView. Conditional: desktop SplitterGroup vs mobile layout-- [x] 6.2 Mobile layout: EditorCanvas + MobileHud (collab props forwarded) + Toolbar + MobileRibbon + MobileDrawer-- [x] 6.3 Wire `@tab-change` on MobileRibbon: auto-open drawer to half if collapsed--## 7. Keyboard Shortcut: ⌘J on mobile--- [x] 7.1 In `use-keyboard.ts`, detect `isMobile`. On ⌘J: mobile toggles `activeRibbonTab` between current and `'ai'` (opens drawer if collapsed); desktop unchanged--## 8. Toolbar Mobile Adaptation--- [x] 8.1 3 categories: Category 0 (drawing tools), Category 1 (Copy/Paste/Cut/Duplicate/Delete), Category 2 (Front/Back/Group/Ungroup/Lock). Arrow navigation buttons-- [x] 8.2 Animated container width: active category `relative` (sets width), others `absolute left-2 top-1/2 -translate-y-1/2` with opacity transition. Width via `scrollWidth` measurement + `transition: width 250ms ease`-- [x] 8.3 Internal clipboard: `mobileCopy()`, `mobileCut()`, `mobilePaste()` using in-memory buffer-- [x] 8.4 Action toast: `onActionTap()` sets `store.state.actionToast` for `ACTION_TOAST_DURATION` (800ms)-- [x] 8.5 All buttons: `select-none border-none`, `rounded-[8px]` container, `rounded-[6px]` buttons, `h-11` container with `size-8` buttons--## 9. Touch & Canvas--- [x] 9.1 `use-canvas-input.ts`: `syntheticMouse()` helper creates MouseEvent from Touch. Single finger on non-HAND tool → delegate to mouse handlers. Two-finger → pinch-zoom (existing)-- [x] 9.2 `use-canvas.ts`: hide rulers on mobile via `!isMobile` check--## 10. Code Style Alignment--- [x] 10.1 Import ordering: reka-ui → vue → icons → @vueuse → @/ → relative → type imports-- [x] 10.2 No semicolons (codebase convention)-- [x] 10.3 `select-none` on all tappable elements-- [x] 10.4 `outline-none` on focusable elements (MobileRibbon tabs, menu items)-- [x] 10.5 Magic numbers extracted: `ACTION_TOAST_DURATION`, `SWIPE_MAX_DURATION`, `SWIPE_THRESHOLD`, `RIBBON_H`, `HALF_FRAC`, `HUD_TOP`-- [x] 10.6 No `hover:` on mobile-only elements — only `active:` for touch feedback-- [x] 10.7 `border-none bg-transparent` on menu/action buttons--## 11. Verification--- [x] 11.1 Desktop layout unchanged at ≥768px-- [x] 11.2 `bun run check` passes (0 errors)diff --git a/openspec/specs/app-menu/spec.md b/openspec/specs/app-menu/spec.mddeleted file mode 100644index cba3cb2f7..000000000--- a/openspec/specs/app-menu/spec.md+++ /dev/null@@ -1,210 +0,0 @@-# app-menu Specification--## Purpose-Browser-mode menu bar (`src/components/AppMenu.vue`) with File, Edit, View, Object, Text, and Arrange menus. Uses reka-ui Menubar components. Only visible when `!IS_TAURI` (Tauri provides native menus).--## Requirements--### Requirement: App menu bar for browser mode--The system SHALL display a menu bar in browser mode (`!IS_TAURI`) with File, Edit, View, Object, Text, and Arrange menus.--#### Scenario: Menu visibility in browser-- **WHEN** app runs in browser (not Tauri desktop)-- **THEN** system displays menu bar at top of window--#### Scenario: Menu hidden in Tauri-- **WHEN** app runs in Tauri desktop mode-- **THEN** system hides menu bar (Tauri provides native menus)--### Requirement: File menu--The system SHALL provide File menu with Open, Save, Save As, and Export actions.--#### Scenario: Open file-- **WHEN** user clicks File → Open… or presses ⌘O (Ctrl+O on Windows/Linux)-- **THEN** system opens file picker dialog--#### Scenario: Save file-- **WHEN** user clicks File → Save or presses ⌘S-- **THEN** system saves current document--#### Scenario: Save As-- **WHEN** user clicks File → Save as… or presses ⌘⇧S-- **THEN** system opens save dialog for new filename--#### Scenario: Export selection-- **WHEN** user clicks File → Export selection… or presses ⌘⇧E with selection-- **THEN** system exports selected nodes as PNG--#### Scenario: Export disabled when no selection-- **WHEN** user has no selection-- **THEN** system disables "Export selection…" menu item--### Requirement: Edit menu--The system SHALL provide Edit menu with undo, redo, clipboard, and selection actions.--#### Scenario: Undo-- **WHEN** user clicks Edit → Undo or presses ⌘Z-- **THEN** system reverts last action--#### Scenario: Redo-- **WHEN** user clicks Edit → Redo or presses ⌘⇧Z-- **THEN** system reapplies undone action--#### Scenario: Copy/Paste-- **WHEN** user clicks Edit → Copy (⌘C) or Paste (⌘V)-- **THEN** system performs clipboard operation--#### Scenario: Duplicate-- **WHEN** user clicks Edit → Duplicate or presses ⌘D-- **THEN** system duplicates selected nodes--#### Scenario: Delete-- **WHEN** user clicks Edit → Delete or presses ⌫-- **THEN** system removes selected nodes--#### Scenario: Select all-- **WHEN** user clicks Edit → Select all or presses ⌘A-- **THEN** system selects all nodes on current page--### Requirement: View menu--The system SHALL provide View menu with zoom and ruler controls.--#### Scenario: Zoom to fit-- **WHEN** user clicks View → Zoom to fit or presses ⇧1-- **THEN** system fits all content in viewport--#### Scenario: Zoom in-- **WHEN** user clicks View → Zoom in or presses ⌘=-- **THEN** system zooms in toward center--#### Scenario: Zoom out-- **WHEN** user clicks View → Zoom out or presses ⌘--- **THEN** system zooms out from center--#### Scenario: Toggle rulers-- **WHEN** user clicks View → Rulers or presses ⇧R-- **THEN** system shows/hides canvas rulers--### Requirement: Object menu--The system SHALL provide Object menu with grouping, framing, and component actions.--#### Scenario: Group selection-- **WHEN** user clicks Object → Group or presses ⌘G-- **THEN** system creates GROUP containing selected nodes--#### Scenario: Ungroup-- **WHEN** user clicks Object → Ungroup or presses ⌘⇧G with grouped selection-- **THEN** system dissolves group and reparents children--#### Scenario: Frame selection-- **WHEN** user clicks Object → Frame selection or presses ⌘⌥F-- **THEN** system wraps selected nodes in FRAME--#### Scenario: Create component-- **WHEN** user clicks Object → Create component or presses ⌘⌥K-- **THEN** system converts selection to COMPONENT--#### Scenario: Create component set-- **WHEN** user clicks Object → Create component set with multiple components selected-- **THEN** system creates COMPONENT_SET containing components--### Requirement: Text menu--The system SHALL provide Text menu with font size and style controls.--#### Scenario: Font size adjustment-- **WHEN** user clicks Text → Increase font size (⌘⇧>) or Decrease (⌘⇧<)-- **THEN** system adjusts font size of selected text by 2px--#### Scenario: Bold toggle-- **WHEN** user clicks Text → Bold or presses ⌘B-- **THEN** system toggles bold weight for selected text--#### Scenario: Italic toggle-- **WHEN** user clicks Text → Italic or presses ⌘I-- **THEN** system toggles italic style for selected text--#### Scenario: Underline toggle-- **WHEN** user clicks Text → Underline or presses ⌘U-- **THEN** system toggles underline decoration for selected text--#### Scenario: Strikethrough toggle-- **WHEN** user clicks Text → Strikethrough or presses S button-- **THEN** system toggles strikethrough decoration for selected text--#### Scenario: Text alignment submenu-- **WHEN** user clicks Text → Align → Left/Center/Right-- **THEN** system aligns selected text horizontally--### Requirement: Arrange menu--The system SHALL provide Arrange menu with z-order controls.--#### Scenario: Bring to front-- **WHEN** user clicks Arrange → Bring to front or presses ]-- **THEN** system moves selected node to top of parent's children--#### Scenario: Send to back-- **WHEN** user clicks Arrange → Send to back or presses [-- **THEN** system moves selected node to bottom of parent's children--#### Scenario: Bring forward-- **WHEN** user clicks Arrange → Bring forward-- **THEN** system moves selected node up one position--#### Scenario: Send backward-- **WHEN** user clicks Arrange → Send backward-- **THEN** system moves selected node down one position--### Requirement: Keyboard shortcut display--The system SHALL display keyboard shortcuts next to menu items.--#### Scenario: Platform-specific modifier-- **WHEN** app runs on Mac-- **THEN** system displays ⌘ for Command key--#### Scenario: Windows/Linux modifiers-- **WHEN** app runs on Windows or Linux-- **THEN** system displays Ctrl+ for Control key--### Requirement: reka-ui integration--The system SHALL use reka-ui Menubar components for menu implementation.--#### Scenario: Menu structure-- **WHEN** component renders-- **THEN** system uses MenubarRoot, MenubarMenu, MenubarTrigger, MenubarContent, MenubarItem--#### Scenario: Submenus-- **WHEN** menu has nested items (e.g., Text → Align)-- **THEN** system uses MenubarSub, MenubarSubTrigger, MenubarSubContent--#### Scenario: Separators-- **WHEN** menu defines separator: true-- **THEN** system renders MenubarSeparator divider--### Requirement: Action binding--The system SHALL bind menu actions to editor store methods.--#### Scenario: Calling store actions-- **WHEN** user selects menu item-- **THEN** system invokes corresponding method on useEditorStore (e.g., `store.saveFigFile()`, `store.duplicateSelected()`)--### Requirement: Dynamic disabled state--The system SHALL disable menu items based on current editor state.--#### Scenario: Export requires selection-- **WHEN** no nodes are selected-- **THEN** system disables "Export selection…" item--#### Scenario: Text menu requires text selection-- **WHEN** selected node is not TEXT-- **THEN** system may disable text formatting items (if implemented)diff --git a/openspec/specs/auto-layout/spec.md b/openspec/specs/auto-layout/spec.mddeleted file mode 100644index 7b2b70eb3..000000000--- a/openspec/specs/auto-layout/spec.md+++ /dev/null@@ -1,51 +0,0 @@-# auto-layout Specification--## Purpose-Flexbox-based auto-layout using Yoga WASM. Frames with auto-layout have children positioned automatically with configurable direction, gap, padding, justify, align, and child sizing.-## Requirements-### Requirement: Yoga WASM layout engine-Auto-layout SHALL use Yoga WASM for flexbox-based layout computation. Frames with auto-layout SHALL have their children positioned by Yoga.--#### Scenario: Horizontal auto-layout-- **WHEN** a frame has stackMode HORIZONTAL with gap 16 and three children-- **THEN** the children are laid out horizontally with 16px between them--### Requirement: Layout properties-Auto-layout frames SHALL support: direction (horizontal/vertical/wrap), gap, padding (uniform and per-side), justify (start/center/end/space-between), align (start/center/end/stretch), and child sizing (fixed/fill/hug).--#### Scenario: Vertical layout with padding-- **WHEN** a frame has stackMode VERTICAL, padding 20, and two children-- **THEN** the children are stacked vertically with 20px padding on all sides--### Requirement: Shift+A toggle-Shift+A SHALL toggle auto-layout on the selected frame. If nodes are selected without a parent frame, Shift+A SHALL wrap them in a new auto-layout frame.--#### Scenario: Toggle auto-layout on frame-- **WHEN** user selects a frame and presses Shift+A-- **THEN** auto-layout is enabled on the frame with default settings--#### Scenario: Wrap selection in auto-layout-- **WHEN** user selects three standalone rectangles and presses Shift+A-- **THEN** the rectangles are wrapped in a new frame with auto-layout enabled--### Requirement: Drag reordering-Within an auto-layout frame, dragging a child SHALL reorder it among siblings with a visual insertion indicator.--#### Scenario: Reorder by drag-- **WHEN** user drags the second child past the third child in an auto-layout frame-- **THEN** the second child moves to position 3 with an insertion line indicating the drop position--### Requirement: Sort by position on wrap-When wrapping selected nodes in auto-layout, nodes SHALL be sorted by their visual position (left-to-right for horizontal, top-to-bottom for vertical).--#### Scenario: Wrap preserves visual order-- **WHEN** three scattered nodes are wrapped in horizontal auto-layout-- **THEN** they are ordered left-to-right based on their X position--### Requirement: Auto-layout properties panel-The properties panel SHALL show auto-layout controls (direction, gap, padding, justify, align, sizing) when an auto-layout frame is selected.--#### Scenario: Properties panel for auto-layout-- **WHEN** user selects a frame with auto-layout enabled-- **THEN** the properties panel shows the Layout section with editable direction, gap, padding, justify, and align controls-diff --git a/openspec/specs/autosave/spec.md b/openspec/specs/autosave/spec.mddeleted file mode 100644index a28b58f23..000000000--- a/openspec/specs/autosave/spec.md+++ /dev/null@@ -1,122 +0,0 @@-# autosave Specification--## Purpose-Automatic file saving with 3-second debounce after scene changes. Integrated into `useEditorStore`. Uses `useDebounceFn` from VueUse. Supports Tauri and browser File System Access API. Disabled for new unsaved files.--## Requirements--### Requirement: Automatic file saving with debounce--The system SHALL automatically save the current document 3 seconds after the last scene change.--#### Scenario: Triggering autosave-- **WHEN** user modifies scene graph (e.g., moves node, changes fill)-- **THEN** system starts 3-second timer--#### Scenario: Debouncing saves-- **WHEN** user makes multiple changes within 3 seconds-- **THEN** system resets timer on each change, saving only after 3 seconds of inactivity--#### Scenario: Writing file-- **WHEN** autosave timer expires-- **THEN** system calls `writeFile(buildFigFile())` to persist document--### Requirement: Watch sceneVersion for changes--The system SHALL monitor `state.sceneVersion` to detect modifications.--#### Scenario: Detecting changes-- **WHEN** `state.sceneVersion` increments (scene graph mutation)-- **THEN** system triggers autosave timer--#### Scenario: No save on unchanged document-- **WHEN** autosave timer expires but `sceneVersion === savedVersion`-- **THEN** system skips write (no changes since last save)--### Requirement: Disable for new unsaved files--The system SHALL not autosave documents without a file handle.--#### Scenario: New untitled document-- **WHEN** document has no associated file path or handle-- **THEN** system skips autosave (user must explicitly Save As)--#### Scenario: After Save As-- **WHEN** user performs Save As and sets file handle-- **THEN** system enables autosave for future changes--### Requirement: Use VueUse debounce--The system SHALL use `useDebounceFn` from VueUse for debouncing logic.--#### Scenario: Debounce implementation-- **WHEN** system sets up autosave watcher-- **THEN** system wraps save logic with `useDebounceFn(fn, 3000)`--### Requirement: Cross-platform file writing--The system SHALL support both Tauri and browser File System Access API.--#### Scenario: Tauri file write-- **WHEN** running in Tauri desktop app-- **THEN** system uses Tauri fs plugin to write file--#### Scenario: Browser file write-- **WHEN** running in browser with File System Access support-- **THEN** system uses FileHandle.createWritable() to write--#### Scenario: Fallback for unsupported browsers-- **WHEN** browser lacks File System Access API-- **THEN** system disables autosave (manual save only)--### Requirement: Silent failure handling--The system SHALL silently handle autosave errors without interrupting user.--#### Scenario: Write failure-- **WHEN** autosave encounters file write error (permissions, disk full)-- **THEN** system logs error silently without showing error dialog--#### Scenario: User can still manual save-- **WHEN** autosave fails-- **THEN** user can still manually trigger Save (⌘S) to retry--### Requirement: Update savedVersion after successful write--The system SHALL track last saved version to avoid redundant writes.--#### Scenario: Recording save-- **WHEN** autosave successfully writes file-- **THEN** system sets `savedVersion = state.sceneVersion`--#### Scenario: No duplicate saves-- **WHEN** autosave timer expires but versions match-- **THEN** system skips write operation--### Requirement: Fixed delay constant--The system SHALL use a compile-time constant `AUTOSAVE_DELAY = 3000` (3 seconds).--#### Scenario: Delay constant-- **WHEN** system sets up autosave-- **THEN** debounce delay is 3000ms--### Requirement: Cleanup on unmount--The system SHALL cancel pending autosave timers when editor unmounts.--#### Scenario: Component cleanup-- **WHEN** editor component unmounts or file closes-- **THEN** system clears timeout to prevent orphaned saves--### Requirement: Integration with editor store--The system SHALL integrate autosave into `useEditorStore` reactive state.--#### Scenario: Reactive watcher-- **WHEN** editor store initializes-- **THEN** system sets up `watch(() => state.sceneVersion, ...)` to trigger autosave--#### Scenario: Manual save updates savedVersion-- **WHEN** user manually saves (⌘S or Save As)-- **THEN** system updates `savedVersion` to prevent immediate autosavediff --git a/openspec/specs/canvas-navigation/spec.md b/openspec/specs/canvas-navigation/spec.mddeleted file mode 100644index 391549ac4..000000000--- a/openspec/specs/canvas-navigation/spec.md+++ /dev/null@@ -1,37 +0,0 @@-# canvas-navigation Specification--## Purpose-Viewport control — panning, zooming, and the hand tool. Handles space+drag, middle mouse, trackpad gestures, keyboard shortcuts, and pinch-to-zoom isolation on UI panels.-## Requirements-### Requirement: Pan with space+drag-The canvas SHALL support panning via space+drag, middle mouse drag, and two-finger trackpad gestures.--#### Scenario: Space+drag pan-- **WHEN** user holds space and drags on the canvas-- **THEN** the viewport pans by the drag delta--### Requirement: Zoom with scroll-The canvas SHALL support zooming via ctrl+scroll (or pinch) toward the cursor position, and via keyboard shortcuts ⌘= (zoom in), ⌘- (zoom out), ⌘0 (100%).--#### Scenario: Ctrl+scroll zoom-- **WHEN** user ctrl+scrolls up on the canvas-- **THEN** the viewport zooms in centered on the cursor position--#### Scenario: Keyboard zoom-- **WHEN** user presses ⌘0-- **THEN** the viewport resets to 100% zoom level--### Requirement: Pinch-to-zoom isolation-Browser pinch-to-zoom SHALL be prevented on UI panels while allowing canvas pinch-to-zoom.--#### Scenario: Pinch on panel-- **WHEN** user performs a pinch gesture on the properties panel-- **THEN** the browser zoom does not change--### Requirement: Hand tool-Pressing H SHALL activate the hand tool for continuous panning without holding space.--#### Scenario: Hand tool activation-- **WHEN** user presses H-- **THEN** the hand tool is active and any drag pans the canvas-diff --git a/openspec/specs/canvas-rendering/spec.md b/openspec/specs/canvas-rendering/spec.mddeleted file mode 100644index 0b3975d17..000000000--- a/openspec/specs/canvas-rendering/spec.md+++ /dev/null@@ -1,215 +0,0 @@-# canvas-rendering Specification--## Purpose-Skia CanvasKit WASM rendering pipeline. Draws all scene graph nodes (shapes, text, effects) with transforms, selection outlines, and visual feedback onto an HTML canvas element.-## Requirements-### Requirement: CanvasKit WASM rendering-The renderer SHALL use Skia CanvasKit WASM to draw all scene graph nodes onto an HTML canvas element.--#### Scenario: Canvas initialization-- **WHEN** the editor loads-- **THEN** CanvasKit WASM (canvaskit.wasm) is loaded and a GPU-accelerated surface is created--### Requirement: Shape rendering-The renderer SHALL draw RECTANGLE, ELLIPSE, LINE, STAR, POLYGON, and VECTOR nodes with their fill paints, stroke paints, opacity, and transforms.--#### Scenario: Rectangle with fill and stroke-- **WHEN** a rectangle node has a solid fill (#3B82F6) and a 2px stroke (#000)-- **THEN** the rectangle is rendered with the correct fill color, stroke color, and stroke width--### Requirement: Text rendering-The renderer SHALL render TEXT nodes using CanvasKit's Paragraph API with font family, weight, size, line height, and letter spacing.--#### Scenario: Text with Inter font-- **WHEN** a text node with fontName "Inter", fontSize 16, and characters "Hello" exists-- **THEN** the text is rendered at the correct position with the Inter font--### Requirement: Nested coordinate systems-The renderer SHALL apply parent transforms (position + rotation) when rendering child nodes, supporting arbitrary nesting depth.--#### Scenario: Rotated parent with child-- **WHEN** a frame is rotated 45° and contains a child rectangle-- **THEN** the child rectangle is rendered in the frame's rotated coordinate system--### Requirement: Selection outlines-The renderer SHALL draw selection outlines (blue rectangles) around selected nodes with resize handles at corners and edge midpoints.--#### Scenario: Select a node-- **WHEN** a node is selected-- **THEN** a blue outline with 8 resize handles appears around the node's bounds--### Requirement: Surface resize-The renderer SHALL recreate the Skia surface when the window is resized, maintaining correct dimensions.--#### Scenario: Window resize-- **WHEN** the browser window is resized-- **THEN** the canvas and Skia surface update to the new dimensions without artifacts--### Requirement: Silent crash prevention-The renderer SHALL detect and report rendering errors instead of silently failing.--#### Scenario: Rendering error-- **WHEN** a rendering operation encounters an error-- **THEN** the error is detected and reported rather than silently producing a blank canvas--### Requirement: Gradient rendering-The renderer SHALL draw gradient fills: GRADIENT_LINEAR, GRADIENT_RADIAL, GRADIENT_ANGULAR, and GRADIENT_DIAMOND using CanvasKit shaders with gradient stops and transform matrices.--#### Scenario: Linear gradient on rectangle-- **WHEN** a rectangle has a GRADIENT_LINEAR fill with stops at 0% (#FF0000) and 100% (#0000FF)-- **THEN** the rectangle renders with a smooth red-to-blue linear gradient--### Requirement: Image fill rendering-The renderer SHALL draw IMAGE fills using CanvasKit image decoding. Image transforms (scale, position) and scale modes (FILL, FIT, CROP, TILE) SHALL be applied.--#### Scenario: Image fill on frame-- **WHEN** a frame has an IMAGE fill with imageHash referencing a blob-- **THEN** the image is decoded and rendered within the frame bounds--### Requirement: Effect rendering-The renderer SHALL draw effects: DROP_SHADOW, INNER_SHADOW, LAYER_BLUR, BACKGROUND_BLUR, and FOREGROUND_BLUR using CanvasKit filters.--#### Scenario: Drop shadow on rectangle-- **WHEN** a rectangle has a DROP_SHADOW effect with offset (4, 4), radius 8, color rgba(0,0,0,0.25)-- **THEN** a shadow is rendered below the rectangle with the specified offset, blur, and color--### Requirement: Stroke cap, join, and dash rendering-The renderer SHALL apply stroke cap (NONE, ROUND, SQUARE, ARROW_LINES, ARROW_EQUILATERAL), join (MITER, BEVEL, ROUND), and dash pattern to strokes.--#### Scenario: Round cap dashed stroke-- **WHEN** a line has strokeCap ROUND and dashPattern [10, 5]-- **THEN** the line renders with rounded dash ends and 10px-on/5px-off pattern--### Requirement: Arc rendering-The renderer SHALL draw ellipses with arcData (startAngle, endAngle, innerRadius) as partial arcs or donuts.--#### Scenario: Semi-circle arc-- **WHEN** an ellipse has arcData with startAngle 0 and endAngle π-- **THEN** only the top half of the ellipse is rendered--### Requirement: Hover highlight rendering-The renderer SHALL draw a shape-aware hover outline for the node under the cursor. The outline follows the actual shape geometry (ellipses, rounded rects, vectors), not just the bounding box.--#### Scenario: Hover over ellipse-- **WHEN** the cursor hovers over an ellipse-- **THEN** a thin outline matching the ellipse shape is drawn--### Requirement: Section rendering-The renderer SHALL draw SECTION nodes with a title pill showing the section name. Title text color inverts based on pill background luminance. Frame name labels are shown for direct children of sections.--#### Scenario: Section with title-- **WHEN** a section named "Desktop" exists on the canvas-- **THEN** a title pill reading "Desktop" is rendered above the section bounds--#### Scenario: Section title luminance inversion-- **WHEN** a section has a dark fill color-- **THEN** the title text renders in white for readability--### Requirement: Canvas background color-The renderer SHALL fill the canvas background with the current page's `pageColor` property.--#### Scenario: Custom canvas background-- **WHEN** the user sets the page background color to dark gray-- **THEN** the canvas renders with a dark gray background instead of the default---### Requirement: Viewport culling-The renderer SHALL skip drawing nodes whose bounding boxes are entirely outside the visible viewport. Export rendering SHALL disable culling to render all nodes.--#### Scenario: Off-screen node skipped-- **WHEN** a node is completely outside the visible viewport-- **THEN** the renderer does not draw it--#### Scenario: Export renders all nodes-- **WHEN** `renderSceneToCanvas` is called for export-- **THEN** all nodes are rendered regardless of viewport position--### Requirement: Component label rendering-The renderer SHALL draw purple labels for COMPONENT, COMPONENT_SET, and INSTANCE nodes. Labels appear above the node (or inside for COMPONENT_SET children) with a diamond icon and node name.--#### Scenario: Instance label-- **WHEN** an INSTANCE named "Button" is on canvas-- **THEN** a purple label "Button" with diamond icon is rendered above it--### Requirement: Component set border rendering-The renderer SHALL draw COMPONENT_SET nodes with a dashed purple border (6px dash, 4px gap, 1.5px stroke width).--#### Scenario: Dashed border-- **WHEN** a COMPONENT_SET is visible on canvas-- **THEN** its border is rendered as dashed purple lines--### Requirement: Component label hit testing-The renderer SHALL support `hitTestComponentLabel(graph, x, y)` returning the node whose label was clicked, enabling click-to-select via label.--#### Scenario: Click component label-- **WHEN** user clicks on a component's purple label-- **THEN** the component is selected--### Requirement: Paint object reuse-The renderer SHALL reuse Skia Paint objects across frames instead of allocating new ones per render call.--#### Scenario: Multiple renders-- **WHEN** the scene is rendered 60 times per second-- **THEN** Paint objects are reused, not reallocated each frame--### Requirement: RAF render coalescing-The renderer SHALL coalesce multiple render requests within a single frame using `requestAnimationFrame`, rendering at most once per animation frame.--#### Scenario: Rapid state changes-- **WHEN** 10 state changes trigger renders within one frame-- **THEN** only one actual render occurs--### Requirement: Polygon and Star rendering-The renderer SHALL draw POLYGON and STAR nodes as regular polygon paths. For POLYGON, a path with `pointCount` vertices (minimum 3) is generated equidistant around the node's center. For STAR, `pointCount * 2` vertices alternate between outer radius and inner radius (scaled by `starInnerRadius`). Both types support fill, stroke, hover highlight, and selection outline. The starting vertex is at the top (−π/2 rotation offset).--#### Scenario: Render polygon-- **WHEN** a POLYGON node with pointCount=3 exists on canvas-- **THEN** an equilateral triangle is rendered within the node's bounding box--#### Scenario: Render star-- **WHEN** a STAR node with pointCount=5 and starInnerRadius=0.38 exists-- **THEN** a 5-pointed star is rendered with inner points at 38% of the outer radius--### Requirement: Variable binding resolution in renderer-The renderer SHALL resolve variable bindings before painting fills and strokes. When a fill or stroke has a bound variable, the renderer resolves the variable value using the collection's active mode and uses the resolved color.--#### Scenario: Render bound fill-- **WHEN** a rectangle's fill is bound to a COLOR variable with value red in Light mode-- **THEN** the rectangle renders with red fill--### Requirement: Image export rendering-The renderer SHALL support offscreen rendering to PNG, JPG, and WEBP via renderNodesToImage. Export uses an offscreen CanvasKit surface at the specified scale. JPG renders with opaque white background, PNG and WEBP render with transparency. Re-encoding for JPG/WEBP uses OffscreenCanvas.--#### Scenario: Export at 2× scale-- **WHEN** a 100×100 node is exported at 2× scale as PNG-- **THEN** the output image is 200×200 pixels with transparency--### Requirement: Scene version vs render version-The renderer SHALL distinguish between scene changes (increments sceneVersion + renderVersion) and viewport-only changes like pan/zoom (increments renderVersion only). UI panels and export preview observe sceneVersion to avoid unnecessary updates during navigation.--#### Scenario: Pan does not trigger export preview update-- **WHEN** user pans the canvas-- **THEN** sceneVersion does not change, so export preview is not re-rendered---### Requirement: Text editing overlay rendering-During text editing, the renderer SHALL draw on the canvas: a blue outline around the text node bounds, translucent blue rectangles for the text selection range, and a blinking black caret at the cursor position. The caret SHALL blink at ~530ms intervals and become solid (non-blinking) immediately after any input. Selection rects and caret position are obtained from TextEditor via getSelectionRects() and getCaretRect().--#### Scenario: Caret rendering-- **WHEN** user is editing text with no selection-- **THEN** a blinking black caret is drawn at the cursor position within the text node--#### Scenario: Selection rendering-- **WHEN** user has selected a range of text during editing-- **THEN** translucent blue rectangles are drawn behind the selected text glyphs--#### Scenario: Blue outline during editing-- **WHEN** user is editing a text node-- **THEN** a blue outline is drawn around the text node bounds (at selection color)--### Requirement: Mixed-style text rendering-The renderer SHALL render text nodes with per-character formatting using CanvasKit ParagraphBuilder.pushStyle/pop. Each StyleRun segment pushes its own TextStyle (weight, slant, decoration) before adding text, then pops to restore the default style.--#### Scenario: Render mixed bold and regular text-- **WHEN** a text node has "Hello " (regular) + "world" (bold)-- **THEN** the renderer outputs a single Paragraph with two style segments, "world" visually bolddiff --git a/openspec/specs/cli/spec.md b/openspec/specs/cli/spec.mddeleted file mode 100644index 00841a647..000000000--- a/openspec/specs/cli/spec.md+++ /dev/null@@ -1,113 +0,0 @@-# cli Specification--## Purpose-Headless CLI for .fig file operations. Runs in Bun/Node without a GUI, using CanvasKit CPU rasterization for rendering. Lives in packages/cli/ as @open-pencil/cli.--## Requirements--### Requirement: CLI package-@open-pencil/cli SHALL be a separate package in packages/cli/ providing headless .fig file operations. It imports @open-pencil/core for engine access and uses CanvasKit CPU rasterization for rendering without WebGL.--### Requirement: CLI commands-The CLI SHALL support the following commands:-- `open-pencil info <file>` — document stats, node type counts, font list-- `open-pencil tree <file>` — visual node tree with formatted output-- `open-pencil find <file>` — search nodes by name or type-- `open-pencil export <file>` — render to PNG/JPG/WEBP at any scale-- `open-pencil analyze colors <file>` — color palette usage with clustering-- `open-pencil analyze typography <file>` — font/size/weight distribution-- `open-pencil analyze spacing <file>` — gap/padding values with grid alignment check-- `open-pencil analyze clusters <file>` — repeated patterns (potential components)-- `open-pencil node <file> <id>` — detailed properties of a specific node-- `open-pencil pages <file>` — list pages with node counts-- `open-pencil variables <file>` — list design variables and collections-- `open-pencil eval <file>` — execute JavaScript with Figma Plugin API--All commands SHALL support `--json` for machine-readable output.--#### Scenario: Info command-- **WHEN** `bun open-pencil info design.fig` is run-- **THEN** document stats, node type counts, and font list are printed--#### Scenario: Export command-- **WHEN** `bun open-pencil export design.fig --format png --scale 2` is run-- **THEN** the document is rendered headlessly and exported as 2× PNG--#### Scenario: JSON output-- **WHEN** `bun open-pencil tree design.fig --json` is run-- **THEN** the node tree is output as JSON--#### Scenario: Eval command-- **WHEN** `bun open-pencil eval design.fig --code 'return figma.currentPage.children.length'` is run-- **THEN** system executes JavaScript with `figma` global and prints result--### Requirement: Workspace integration-The CLI SHALL be runnable via `bun open-pencil` within the Bun workspace, without global installation.--#### Scenario: Run from workspace root-- **WHEN** `bun open-pencil info design.fig` is run from the project root-- **THEN** the CLI executes using the workspace-linked binary--### Requirement: Analyze commands-The CLI SHALL provide `open-pencil analyze <file>` subcommands for design file analysis: colors (palette usage with clustering), typography (font/size/weight distribution), spacing (gap/padding values with grid check), clusters (repeated patterns that could be components).--#### Scenario: Analyze colors-- **WHEN** `bun open-pencil analyze colors design.fig` is run-- **THEN** a color palette summary with usage counts and clusters is printed--#### Scenario: Analyze clusters-- **WHEN** `bun open-pencil analyze clusters design.fig` is run-- **THEN** repeated node patterns that could be components are listed--### Requirement: Node command-The CLI SHALL provide `open-pencil node <file> <id>` to display detailed properties of a specific node by ID.--#### Scenario: Node details-- **WHEN** `bun open-pencil node design.fig abc123` is run-- **THEN** the node's type, properties, children, and parent are displayed--### Requirement: Pages command-The CLI SHALL provide `open-pencil pages <file>` to list all pages with node counts.--#### Scenario: List pages-- **WHEN** `bun open-pencil pages design.fig` is run-- **THEN** each page name and its node count are listed--### Requirement: Variables command-The CLI SHALL provide `open-pencil variables <file>` to list design variables and collections.--#### Scenario: List variables-- **WHEN** `bun open-pencil variables design.fig` is run-- **THEN** all variable collections, modes, and variable values are listed--### Requirement: Eval command for headless scripting--The CLI SHALL provide `open-pencil eval <file>` command for executing JavaScript against .fig files with a Figma-compatible `figma` global object.--#### Scenario: Inline code execution-- **WHEN** `bun open-pencil eval design.fig --code 'return figma.currentPage.children.length'` is run-- **THEN** system loads design.fig, executes code, and prints result--#### Scenario: Reading code from stdin-- **WHEN** `cat script.js | bun open-pencil eval design.fig --stdin` is run-- **THEN** system reads script from stdin and executes--#### Scenario: Writing changes back-- **WHEN** `bun open-pencil eval design.fig --code 'frame.name = "Updated"' --write` is run-- **THEN** system modifies design.fig in-place after execution--#### Scenario: Writing to output file-- **WHEN** `bun open-pencil eval design.fig --code '...' -o modified.fig` is run-- **THEN** system writes modified document to modified.fig--#### Scenario: JSON output-- **WHEN** `bun open-pencil eval design.fig --code '...' --json` is run-- **THEN** system formats result as JSON--#### Scenario: Figma API access-- **WHEN** eval code accesses `figma.createFrame()`, `figma.currentPage.findAll()`, etc.-- **THEN** system provides FigmaAPI instance bound to loaded document--#### Scenario: Error handling-- **WHEN** eval code throws error-- **THEN** system prints error message and stack trace to stderrdiff --git a/openspec/specs/components/spec.md b/openspec/specs/components/spec.mddeleted file mode 100644index 4cc7501c9..000000000--- a/openspec/specs/components/spec.md+++ /dev/null@@ -1,105 +0,0 @@-# components Specification--## Purpose-Components, component sets, instances — create, instantiate, detach, go-to-main component, component labels, opaque container hit testing.-## Requirements--### Requirement: Create component from selection-The editor SHALL convert selected frames/groups to COMPONENT type, or wrap multiple selected nodes in a new COMPONENT node (⌥⌘K). Single frame/group converts in-place; multiple nodes wraps in a bounding component.--#### Scenario: Convert frame to component-- **WHEN** user selects a single frame and presses ⌥⌘K-- **THEN** the frame's type changes to COMPONENT--#### Scenario: Wrap multiple nodes in component-- **WHEN** user selects three rectangles and presses ⌥⌘K-- **THEN** a COMPONENT node wraps them, positioned at their bounding box--### Requirement: Create component set from components-The editor SHALL combine multiple selected COMPONENT nodes into a COMPONENT_SET container (⇧⌘K). The set gets a dashed purple border and a 40px padding around its children.--#### Scenario: Create component set-- **WHEN** user selects two COMPONENT nodes and presses ⇧⌘K-- **THEN** a COMPONENT_SET wraps them with dashed purple border--### Requirement: Create instance from component-The editor SHALL create an INSTANCE node from a COMPONENT via context menu, copying its visual properties and deep-cloning children with `componentId` mapping. The instance is placed 40px to the right of the source component. Instance creation is available only through the context menu (no button in properties panel).--#### Scenario: Create instance via context menu-- **WHEN** user right-clicks a component and selects "Create instance"-- **THEN** an INSTANCE appears to the right, visually identical to the component--#### Scenario: Instance children have componentId mapping-- **WHEN** an instance is created from a component with children [A, B]-- **THEN** instance children have `componentId` pointing to A and B respectively--### Requirement: Detach instance-The editor SHALL convert an INSTANCE back to a regular FRAME, clearing its componentId and overrides (⌥⌘B).--#### Scenario: Detach instance-- **WHEN** user selects an instance and presses ⌥⌘B-- **THEN** the instance becomes a FRAME with no component link--### Requirement: Go to main component-The editor SHALL navigate to and select the main COMPONENT for a selected INSTANCE, switching pages if needed.--#### Scenario: Navigate to main component-- **WHEN** user right-clicks an instance and selects "Go to main component"-- **THEN** the main component is selected and centered in the viewport--### Requirement: Component labels-The renderer SHALL draw always-visible purple labels above COMPONENT and INSTANCE nodes (or inside COMPONENT_SET children). Labels show the node name with a diamond icon.--#### Scenario: Component label visible-- **WHEN** a COMPONENT node exists on canvas-- **THEN** a purple label with the component name is rendered above it--### Requirement: Component set visual treatment-COMPONENT_SET nodes SHALL render with a dashed purple border (6px dash, 4px gap, 1.5px width) instead of a solid border.--#### Scenario: Component set border-- **WHEN** a COMPONENT_SET is on canvas-- **THEN** it renders with a dashed purple border--### Requirement: Opaque container hit testing-COMPONENT and INSTANCE nodes SHALL behave as opaque containers for hit testing — clicking selects the component/instance itself, not its children. Children are accessible only via double-click (deep hit test).--#### Scenario: Click on component child-- **WHEN** user clicks a rectangle inside a component-- **THEN** the component is selected, not the rectangle--#### Scenario: Double-click into component-- **WHEN** user double-clicks a child inside a component-- **THEN** the child is selected (deep selection)--### Requirement: Live component-instance sync-The scene graph SHALL propagate property changes from a COMPONENT to all its INSTANCE nodes. Synced properties include: width, height, fills, strokes, effects, opacity, corner radii, layout properties, and clipsContent. The store SHALL auto-trigger sync after `updateNode`, `commitMove`, and `commitResize` when the edited node is inside a COMPONENT.--#### Scenario: Edit component updates instances-- **WHEN** user changes the fill color of a main component-- **THEN** all instances of that component update to the new fill color--#### Scenario: Resize component syncs to instances-- **WHEN** user resizes a main component-- **THEN** all instances resize to match--### Requirement: Override preservation during sync-Instances SHALL maintain an `overrides` record. When syncing, properties marked in overrides are skipped. Child-level overrides use `${childId}:${propertyKey}` keys. Overridable child properties include name, text, fontSize, fontWeight, fontFamily, plus all synced visual/layout properties.--#### Scenario: Override preserved during sync-- **WHEN** an instance child has text overridden to "Custom" and the component child text changes to "New Default"-- **THEN** the instance child's text remains "Custom" while non-overridden properties sync--### Requirement: New children propagate to instances-When a new child is added to a COMPONENT, sync SHALL clone the new child into all existing instances.--#### Scenario: Add child to component-- **WHEN** user adds a new rectangle inside a component that has two instances-- **THEN** both instances gain a cloned copy of the new rectangle--### Requirement: Instance child order matches component-After sync, instance children SHALL be reordered to match the component's child order.--#### Scenario: Reorder component children-- **WHEN** component children are reordered from [A, B] to [B, A]-- **THEN** after sync, instance children reflect the new orderdiff --git a/openspec/specs/context-menu/spec.md b/openspec/specs/context-menu/spec.mddeleted file mode 100644index ef66e6a9c..000000000--- a/openspec/specs/context-menu/spec.md+++ /dev/null@@ -1,58 +0,0 @@-# context-menu Specification--## Purpose-Right-click context menu with Figma-style actions: clipboard, z-order, grouping, component, visibility, lock, and move-to-page.-## Requirements--### Requirement: Right-click context menu-Right-clicking on the canvas SHALL show a context menu with Figma-style actions. If clicking on a node, that node is selected first. If clicking empty canvas, selection is cleared.--#### Scenario: Right-click on node-- **WHEN** user right-clicks on a rectangle-- **THEN** the rectangle is selected and a context menu appears with available actions--#### Scenario: Right-click on empty canvas-- **WHEN** user right-clicks on empty canvas-- **THEN** selection is cleared and a context menu appears with paste action available--### Requirement: Context menu clipboard actions-The context menu SHALL include Copy (⌘C), Cut (⌘X), Paste here (⌘V), Duplicate (⌘D), and Delete (⌫). Clipboard actions are disabled when no selection exists.--#### Scenario: Copy from context menu-- **WHEN** user right-clicks a selected node and clicks "Copy"-- **THEN** the node is copied to clipboard--### Requirement: Context menu z-order actions-The context menu SHALL include "Bring to front" (]) and "Send to back" ([), disabled when no selection exists.--#### Scenario: Bring to front via menu-- **WHEN** user right-clicks a node and selects "Bring to front"-- **THEN** the node moves to the top of its parent's child list--### Requirement: Context menu grouping actions-The context menu SHALL include Group (⌘G, requires 2+ selected), Ungroup (⇧⌘G, shown for groups), and Add auto layout (⇧A).--#### Scenario: Group from context menu-- **WHEN** user selects two nodes, right-clicks, and selects "Group"-- **THEN** the nodes are grouped--### Requirement: Context menu component actions-The context menu SHALL include component actions in purple: Create component (⌥⌘K), Create component set (⇧⌘K, when 2+ components selected), Create instance (for components), Go to main component (for instances), Detach instance (⌥⌘B, for instances).--#### Scenario: Create component from menu-- **WHEN** user right-clicks a frame and selects "Create component"-- **THEN** the frame becomes a component--### Requirement: Context menu visibility and lock actions-The context menu SHALL include "Hide/Show" (⇧⌘H) and "Lock/Unlock" (⇧⌘L) for selected nodes. Labels toggle based on current state.--#### Scenario: Hide via context menu-- **WHEN** user right-clicks a visible node and selects "Hide"-- **THEN** the node becomes invisible--### Requirement: Context menu move to page-The context menu SHALL include a "Move to page" submenu listing all pages except the current one. Selected nodes are reparented to the chosen page.--#### Scenario: Move node to another page-- **WHEN** user right-clicks a node, opens "Move to page", and selects "Page 2"-- **THEN** the node is moved to Page 2diff --git a/openspec/specs/desktop-app/spec.md b/openspec/specs/desktop-app/spec.mddeleted file mode 100644index 5418d0da9..000000000--- a/openspec/specs/desktop-app/spec.md+++ /dev/null@@ -1,165 +0,0 @@-# desktop-app Specification--## Purpose-Tauri v2 desktop shell. Cross-platform native menu bar with wired events, Developer Tools access, and `desktop/` directory structure for Tauri configuration and Rust source.-## Requirements-### Requirement: Tauri v2 desktop shell-The editor SHALL run as a native desktop app via Tauri v2 with the web frontend loaded in a webview. The app identifier SHALL be `net.dannote.open-pencil`. When running inside the Tauri webview, the service worker SHALL NOT be registered to avoid intercepting Tauri IPC and native file system requests.--#### Scenario: Desktop app launch-- **WHEN** user runs `bun run tauri dev`-- **THEN** a native desktop window opens with the editor UI and CanvasKit rendering--#### Scenario: No service worker in Tauri-- **WHEN** the app loads inside the Tauri webview-- **THEN** `navigator.serviceWorker.register` is never called and no SW is active--### Requirement: Native macOS menu bar-The desktop app SHALL display a native menu bar. On macOS, an app-level submenu (OpenPencil) with About, Services, Hide, Hide Others, Show All, and Quit items SHALL be shown. On Windows and Linux, this submenu SHALL be omitted. File, Edit, View, Object, Window, and Help menus SHALL be present on all platforms.--#### Scenario: Menu bar on macOS-- **WHEN** the desktop app launches on macOS-- **THEN** a native menu bar with the OpenPencil app submenu and all standard menus is visible--#### Scenario: Menu bar on Windows-- **WHEN** the desktop app launches on Windows-- **THEN** a native menu bar with File, Edit, View, Object, Window, and Help menus is visible and no macOS-specific app submenu is present--#### Scenario: Menu bar on Linux-- **WHEN** the desktop app launches on Linux-- **THEN** a native menu bar with File, Edit, View, Object, Window, and Help menus is visible and no macOS-specific app submenu is present--### Requirement: Menu events wired to frontend-Menu item clicks SHALL fire events that the Vue frontend handles (e.g., Undo, Redo, Zoom In/Out).--#### Scenario: Menu undo-- **WHEN** user clicks Edit → Undo in the menu bar-- **THEN** the frontend receives the undo event and performs undo--### Requirement: Developer tools menu item-The menu SHALL include a Developer Tools item (⌘⌥I) that opens the webview inspector.--#### Scenario: Open dev tools-- **WHEN** user selects View → Developer Tools or presses ⌘⌥I-- **THEN** the webview developer tools panel opens--### Requirement: Desktop directory structure-The Tauri configuration and Rust source SHALL live in `desktop/` (not `src-tauri/`). Tauri CLI SHALL find it by scanning.--#### Scenario: Build from desktop directory-- **WHEN** `bun run tauri build` is run-- **THEN** Tauri finds configuration in `desktop/` and produces a native binary--### Requirement: Cross-platform build-The desktop app SHALL compile and build on macOS, Windows, and Linux without platform-specific errors.--#### Scenario: Windows build-- **WHEN** `bun run tauri build` is run on Windows with MSVC toolchain installed-- **THEN** the build completes successfully and produces a Windows executable--#### Scenario: Linux build-- **WHEN** `bun run tauri build` is run on Linux with required system libraries installed-- **THEN** the build completes successfully and produces a Linux binary--### Requirement: Platform prerequisites documentation-The README SHALL document platform-specific prerequisites for building the desktop app on macOS, Windows, and Linux.--#### Scenario: Windows prerequisites documented-- **WHEN** a developer reads the README on Windows-- **THEN** they find instructions for installing Rust (stable-msvc), Visual Studio Build Tools, and WebView2--#### Scenario: macOS prerequisites documented-- **WHEN** a developer reads the README on macOS-- **THEN** they find instructions for installing Xcode Command Line Tools--#### Scenario: Linux prerequisites documented-- **WHEN** a developer reads the README on Linux-- **THEN** they find instructions for installing required system libraries (webkit2gtk, etc.)--### Requirement: Tauri native Save/Open dialogs-The desktop app SHALL use Tauri plugin-dialog and plugin-fs for native file dialogs and filesystem access. Open dialog filters for .fig files. Save dialog defaults to "Untitled.fig".--#### Scenario: Open file via native dialog-- **WHEN** user presses ⌘O in the desktop app-- **THEN** the native OS file picker opens and the selected .fig file is imported--#### Scenario: Save As via native dialog-- **WHEN** user selects File → Save As-- **THEN** a native OS save dialog opens and the file is written to the chosen path--### Requirement: Zstd compression via Rust command-The Tauri backend SHALL expose a Rust command for Zstd compression/decompression, used by .fig export for better performance than JavaScript alternatives.--#### Scenario: Zstd compress via IPC-- **WHEN** the frontend requests Zstd compression of a buffer-- **THEN** the Rust backend compresses it and returns the result via Tauri IPC--### Requirement: GitHub Actions CI/CD build workflow-The project SHALL include a GitHub Actions workflow (`.github/workflows/build.yml`) that builds Tauri desktop apps for Windows (x64, arm64) and macOS (x64, arm64). The workflow triggers on version tags (`v*`) and `workflow_dispatch`. Build artifacts are uploaded as draft GitHub releases via `tauri-apps/tauri-action`.--#### Scenario: Tag-triggered build-- **WHEN** a tag matching `v*` is pushed-- **THEN** GitHub Actions builds Windows and macOS binaries and creates a draft release--#### Scenario: Manual build trigger-- **WHEN** a maintainer triggers `workflow_dispatch`-- **THEN** the build runs for all platform/architecture combinations--#### Scenario: Build matrix-- **WHEN** the workflow runs-- **THEN** it builds for: windows-x64 (x86_64-pc-windows-msvc), windows-arm64 (aarch64-pc-windows-msvc), macos-arm64 (aarch64-apple-darwin), macos-x64 (x86_64-apple-darwin)--### Requirement: Monorepo with @open-pencil/core-The project SHALL use a Bun workspace monorepo. The engine (scene-graph, renderer, layout, codec, kiwi, types) SHALL be extracted to `packages/core/` (@open-pencil/core) with zero DOM dependencies. The app's `src/engine/` files become re-export shims. Core is importable by CLI, tests, and the app.--#### Scenario: Core has no DOM dependencies-- **WHEN** @open-pencil/core is imported in a Bun/Node environment without browser APIs-- **THEN** it loads successfully---### Requirement: System font commands via font-kit-The Tauri backend SHALL expose two Rust commands using the font-kit crate: `list_system_fonts` (returns all system font families with style names, cached via OnceLock) and `load_system_font` (loads font data by family + style name, with weight matching and fallback to first font in family). The TS font shim SHALL detect Tauri runtime and use invoke() instead of queryLocalFonts.--#### Scenario: List system fonts-- **WHEN** the frontend calls list_system_fonts via Tauri invoke-- **THEN** a sorted list of font families with styles is returned--#### Scenario: Load specific font style-- **WHEN** the frontend requests "Inter" "Bold" via load_system_font-- **THEN** the font data (ArrayBuffer) is returned and registered with the font provider--#### Scenario: Font list caching-- **WHEN** list_system_fonts is called multiple times-- **THEN** the result is cached (OnceLock) and returned instantly after the first call--### Requirement: CSS font face registration-System font faces SHALL be registered with document.fonts for CSS preview in the font picker. Each system font creates a FontFace pointing to local() source.--#### Scenario: Font preview in picker-- **WHEN** system fonts are loaded in Tauri-- **THEN** font faces are registered so CSS can render preview text in each font--### Requirement: App identity-The Cargo crate SHALL be named `open_pencil` and the binary `OpenPencil`. The macOS Dock SHALL display "OpenPencil". The app icon SHALL use the pencil loader icon.--#### Scenario: macOS Dock name-- **WHEN** the app is running on macOS-- **THEN** the Dock displays "OpenPencil" (not "open-pencil-app")--### Requirement: Safari save fallback-The editor SHALL support saving in Safari and browsers without File System Access API by creating a download link (`<a>` appended to DOM) with deferred `revokeObjectURL`.--#### Scenario: Save in Safari-- **WHEN** user presses ⌘S in Safari (no showSaveFilePicker)-- **THEN** system creates a blob URL, appends an anchor to DOM, triggers click, and defers revocation--### Requirement: Safari compatibility banner-The editor SHALL display a dismissible banner when running in Safari (or browsers without File System Access API), explaining limitations and suggesting Chrome/Edge.--#### Scenario: Banner shown-- **WHEN** user opens the app in Safari-- **THEN** a banner appears explaining File System Access limitations--#### Scenario: Banner dismissal persisted-- **WHEN** user dismisses the banner-- **THEN** dismissal is saved to localStorage and banner does not reappeardiff --git a/openspec/specs/e2e-auto-layout/spec.md b/openspec/specs/e2e-auto-layout/spec.mddeleted file mode 100644index e349b72d8..000000000--- a/openspec/specs/e2e-auto-layout/spec.md+++ /dev/null@@ -1,47 +0,0 @@-# e2e-auto-layout Specification--## Purpose-TBD - created by archiving change e2e-coverage-gaps. Update Purpose after archive.-## Requirements-### Requirement: Auto-layout Shift+A on selection E2E-The E2E suite SHALL verify that Shift+A on multiple selected nodes wraps them in an auto-layout frame.--#### Scenario: Shift+A wraps nodes in auto-layout frame-- **WHEN** two rectangles are selected and Shift+A is pressed-- **THEN** a single FRAME node exists on the page with `layoutMode` set to `HORIZONTAL` or `VERTICAL` and the rectangles are its children--### Requirement: Auto-layout direction toggle E2E-The E2E suite SHALL verify that clicking the horizontal/vertical direction buttons changes `layoutMode`.--#### Scenario: Direction button toggles layoutMode-- **WHEN** an auto-layout frame is selected and the vertical direction button is clicked in LayoutSection-- **THEN** `frame.layoutMode` equals `VERTICAL`--### Requirement: Auto-layout gap E2E-The E2E suite SHALL verify that changing the gap ScrubInput updates `itemSpacing`.--#### Scenario: Gap ScrubInput changes itemSpacing-- **WHEN** an auto-layout frame is selected and the gap ScrubInput value is changed to 20-- **THEN** `frame.itemSpacing` equals 20--### Requirement: Auto-layout padding uniform E2E-The E2E suite SHALL verify that changing the uniform padding input updates all four padding properties.--#### Scenario: Uniform padding updates all sides-- **WHEN** an auto-layout frame is selected and padding is set to 16-- **THEN** `frame.paddingTop`, `frame.paddingRight`, `frame.paddingBottom`, and `frame.paddingLeft` all equal 16--### Requirement: Auto-layout alignment grid E2E-The E2E suite SHALL verify that clicking a cell in the 3×3 alignment grid updates `primaryAxisAlign` and `counterAxisAlign`.--#### Scenario: Center-center alignment set-- **WHEN** the center-center cell of the alignment grid is clicked-- **THEN** `frame.primaryAxisAlign` equals `CENTER` and `frame.counterAxisAlign` equals `CENTER`--### Requirement: Auto-layout remove E2E-The E2E suite SHALL verify that clicking the remove (−) button in the auto-layout section sets `layoutMode` to NONE.--#### Scenario: Remove auto-layout resets layoutMode-- **WHEN** an auto-layout frame is selected and the remove auto-layout button is clicked-- **THEN** `frame.layoutMode` equals `NONE`-diff --git a/openspec/specs/e2e-canvas-manipulation/spec.md b/openspec/specs/e2e-canvas-manipulation/spec.mddeleted file mode 100644index 312b1f525..000000000--- a/openspec/specs/e2e-canvas-manipulation/spec.md+++ /dev/null@@ -1,51 +0,0 @@-# e2e-canvas-manipulation Specification--## Purpose-TBD - created by archiving change e2e-coverage-gaps. Update Purpose after archive.-## Requirements-### Requirement: Marquee selection E2E-The E2E suite SHALL verify that dragging from an empty canvas area selects all nodes whose bounds intersect the drag rectangle.--#### Scenario: Marquee selects intersected nodes-- **WHEN** two rectangles are drawn and mouse is dragged from a point before both to a point after both-- **THEN** both nodes appear in `store.state.selectedIds`--#### Scenario: Marquee on empty area deselects-- **WHEN** a node is selected and mouse is dragged across empty canvas-- **THEN** `store.state.selectedIds.size` equals 0--### Requirement: Resize handles E2E-The E2E suite SHALL verify that dragging a resize handle changes the node's width and height.--#### Scenario: Corner resize increases dimensions-- **WHEN** a rectangle is selected and its bottom-right corner handle is dragged 50px right and 50px down-- **THEN** node width and height each increase by approximately 50px--### Requirement: Rotation handle E2E-The E2E suite SHALL verify that the rotation handle rotates a node.--#### Scenario: Rotation changes node rotation-- **WHEN** a rectangle is selected and the cursor is positioned just outside a corner, then dragged in an arc-- **THEN** `node.rotation` is non-zero--### Requirement: Alt+drag duplicate E2E-The E2E suite SHALL verify that Alt+drag creates a copy of the node.--#### Scenario: Alt drag creates duplicate-- **WHEN** a rectangle is selected and dragged with Alt held-- **THEN** the page has one more node than before the drag--### Requirement: Shift+Arrow nudge E2E-The E2E suite SHALL verify that Shift+Arrow nudges a node by 10px.--#### Scenario: Shift+ArrowRight nudges 10px-- **WHEN** a node is selected and Shift+ArrowRight is pressed-- **THEN** `node.x` increases by 10--### Requirement: Hover highlight E2E-The E2E suite SHALL verify that hovering over a node (without clicking) triggers a visible highlight outline on the canvas.--#### Scenario: Hover renders highlight-- **WHEN** the mouse moves over a rectangle without clicking-- **THEN** a screenshot taken during hover differs from a screenshot taken with the mouse away (highlight outline visible)-diff --git a/openspec/specs/e2e-export/spec.md b/openspec/specs/e2e-export/spec.mddeleted file mode 100644index fcebdb592..000000000--- a/openspec/specs/e2e-export/spec.md+++ /dev/null@@ -1,37 +0,0 @@-# e2e-export Specification--## Purpose-TBD - created by archiving change e2e-coverage-gaps. Update Purpose after archive.-## Requirements-### Requirement: Export format selection E2E-The E2E suite SHALL verify that changing the export format selector updates the format value in the export section.--#### Scenario: Format selector changes to JPG-- **WHEN** a node with an export setting is selected and the format selector is changed to JPG-- **THEN** the export row displays JPG as the selected format--### Requirement: Export multi-row add/remove E2E-The E2E suite SHALL verify that clicking + adds a new export row and − removes it.--#### Scenario: Add export row-- **WHEN** a node is selected and the + button in ExportSection is clicked-- **THEN** one more export setting row is visible than before--#### Scenario: Remove export row-- **WHEN** a node has two export rows and the − button on one row is clicked-- **THEN** only one export row remains--### Requirement: Export preview toggle E2E-The E2E suite SHALL verify that clicking the Preview button shows a preview image element.--#### Scenario: Preview button shows image-- **WHEN** a node with an export setting is selected and the Preview button is clicked-- **THEN** an image element (checkerboard preview) becomes visible in the export section--### Requirement: SVG format hides scale selector E2E-The E2E suite SHALL verify that when SVG format is selected, the scale (multiplier) selector is hidden.--#### Scenario: SVG hides scale input-- **WHEN** an export row format is set to SVG-- **THEN** no scale/multiplier input is visible for that row-diff --git a/openspec/specs/e2e-panels/spec.md b/openspec/specs/e2e-panels/spec.mddeleted file mode 100644index ce09a9799..000000000--- a/openspec/specs/e2e-panels/spec.md+++ /dev/null@@ -1,30 +0,0 @@-# e2e-panels Specification--## Purpose-TBD - created by archiving change e2e-coverage-gaps. Update Purpose after archive.-## Requirements-### Requirement: Layers panel resize E2E-The E2E suite SHALL verify that dragging the resize handle between the left panel and canvas changes the panel width.--#### Scenario: Panel resize handle changes width-- **WHEN** the splitter handle on the left panel is dragged 80px to the right-- **THEN** the layers panel DOM element has a wider width than before the drag--### Requirement: UI toggle persistence across reload E2E-The E2E suite SHALL verify that panel sizes are preserved after a page reload.--#### Scenario: Panel width persists after reload-- **WHEN** the layers panel is resized and the page is reloaded-- **THEN** the panel width after reload matches the width set before reload (within 2px)--### Requirement: ⌘\\ hides and shows panels E2E-The E2E suite SHALL verify that pressing ⌘\\ toggles the visibility of the left and right panels.--#### Scenario: Cmd+Backslash hides panels-- **WHEN** ⌘\\ is pressed while panels are visible-- **THEN** the layers panel and properties panel elements are not visible in the DOM--#### Scenario: Cmd+Backslash shows panels again-- **WHEN** ⌘\\ is pressed while panels are hidden-- **THEN** the layers panel and properties panel elements are visible again-diff --git a/openspec/specs/e2e-properties-panel/spec.md b/openspec/specs/e2e-properties-panel/spec.mddeleted file mode 100644index d526817fc..000000000--- a/openspec/specs/e2e-properties-panel/spec.md+++ /dev/null@@ -1,61 +0,0 @@-# e2e-properties-panel Specification--## Purpose-TBD - created by archiving change e2e-coverage-gaps. Update Purpose after archive.-## Requirements-### Requirement: ScrubInput drag-to-change E2E-The E2E suite SHALL verify that dragging horizontally on a ScrubInput changes the node property value.--#### Scenario: Drag X ScrubInput moves node-- **WHEN** a rectangle is selected and the X ScrubInput is dragged 50px to the right-- **THEN** `node.x` increases by approximately 50--### Requirement: Corner radius uniform E2E-The E2E suite SHALL verify that typing a corner radius value in the appearance section applies it to all corners.--#### Scenario: Uniform corner radius applied-- **WHEN** a rectangle is selected and a corner radius value is typed into the appearance input-- **THEN** `node.cornerRadius` equals the entered value--### Requirement: Corner radius independent E2E-The E2E suite SHALL verify that toggling to independent corners splits the input into four separate fields.--#### Scenario: Independent corners toggle shows four fields-- **WHEN** the independent corners button is clicked-- **THEN** four corner radius inputs are visible in the panel--### Requirement: Fill gradient switch E2E-The E2E suite SHALL verify that switching fill type to Linear Gradient updates the node fill.--#### Scenario: Fill type switches to gradient-- **WHEN** a rectangle with a solid fill is selected and fill type is changed to LINEAR-- **THEN** `node.fills[0].type` equals `GRADIENT_LINEAR`--### Requirement: Variable bind E2E-The E2E suite SHALL verify that binding a color variable to a fill displays a variable badge.--#### Scenario: Variable badge appears after bind-- **WHEN** a color variable exists and is bound to a node's fill-- **THEN** a variable badge element is visible in the fill section--### Requirement: Alignment buttons E2E-The E2E suite SHALL verify that clicking alignment buttons aligns multiple selected nodes.--#### Scenario: Align left aligns nodes-- **WHEN** two rectangles at different X positions are selected and Align Left is clicked-- **THEN** both nodes have the same `x` coordinate (leftmost of the two)--### Requirement: Flip horizontal E2E-The E2E suite SHALL verify that clicking the flip horizontal button sets `flipX` on the node.--#### Scenario: Flip horizontal toggles-- **WHEN** a rectangle is selected and flip horizontal button is clicked-- **THEN** `node.flipX` is true--### Requirement: Clip content toggle E2E-The E2E suite SHALL verify that the clip content checkbox toggles `clipsContent` on a frame.--#### Scenario: Clip content checkbox toggles-- **WHEN** a frame is selected and the clip content checkbox is clicked-- **THEN** `node.clipsContent` changes to the opposite boolean value-diff --git a/openspec/specs/e2e-snap-guides/spec.md b/openspec/specs/e2e-snap-guides/spec.mddeleted file mode 100644index bfcc665aa..000000000--- a/openspec/specs/e2e-snap-guides/spec.md+++ /dev/null@@ -1,19 +0,0 @@-# e2e-snap-guides Specification--## Purpose-TBD - created by archiving change e2e-coverage-gaps. Update Purpose after archive.-## Requirements-### Requirement: Edge snap guide visual E2E-The E2E suite SHALL verify that dragging a node to align its edge with another node causes snap guide lines to appear on the canvas.--#### Scenario: Edge snap guide renders during drag-- **WHEN** two rectangles are positioned such that dragging one aligns its left edge with the other's left edge-- **THEN** a screenshot taken mid-drag (while edges are aligned) contains red guide line pixels not present in the pre-drag screenshot--### Requirement: Center snap guide visual E2E-The E2E suite SHALL verify that dragging a node to align its center with another node causes a center snap guide line to appear.--#### Scenario: Center snap guide renders during drag-- **WHEN** two rectangles are positioned such that dragging one aligns its horizontal center with the other's center-- **THEN** a screenshot taken mid-drag contains guide line pixels indicating center alignment-diff --git a/openspec/specs/e2e-text-formatting/spec.md b/openspec/specs/e2e-text-formatting/spec.mddeleted file mode 100644index 54f156804..000000000--- a/openspec/specs/e2e-text-formatting/spec.md+++ /dev/null@@ -1,47 +0,0 @@-# e2e-text-formatting Specification--## Purpose-TBD - created by archiving change e2e-coverage-gaps. Update Purpose after archive.-## Requirements-### Requirement: Text cursor positioning E2E-The E2E suite SHALL verify that clicking inside a text node in edit mode positions the cursor near the clicked glyph.--#### Scenario: Click positions cursor-- **WHEN** a text node is double-clicked to enter edit mode and then a position inside the text is clicked-- **THEN** the text node remains in edit mode without errors--### Requirement: Text word selection E2E-The E2E suite SHALL verify that double-clicking on a word selects that word.--#### Scenario: Double-click selects word-- **WHEN** a text node is in edit mode and a word is double-clicked-- **THEN** the canvas screenshot shows the word highlighted (differs from no-selection screenshot)--### Requirement: Bold shortcut E2E-The E2E suite SHALL verify that ⌘B toggles bold formatting on selected text.--#### Scenario: Cmd+B toggles bold-- **WHEN** a text node is in edit mode, all text is selected, and ⌘B is pressed-- **THEN** `node.fontWeight` changes to 700 (bold) or back to 400 (normal)--### Requirement: Italic shortcut E2E-The E2E suite SHALL verify that ⌘I toggles italic formatting on selected text.--#### Scenario: Cmd+I toggles italic-- **WHEN** a text node is in edit mode with all text selected and ⌘I is pressed-- **THEN** `node.italic` toggles to the opposite boolean--### Requirement: Word navigation shortcut E2E-The E2E suite SHALL verify that Alt+ArrowRight moves the cursor by one word.--#### Scenario: Alt+ArrowRight moves by word-- **WHEN** a text node is in edit mode with cursor at position 0 and Alt+ArrowRight is pressed-- **THEN** no JavaScript errors are thrown and the editor remains in text mode--### Requirement: Typography section buttons E2E-The E2E suite SHALL verify that the Bold button in the typography section applies formatting.--#### Scenario: Bold button in panel toggles bold-- **WHEN** a text node is selected (not in edit mode) and the Bold button in DesignPanel is clicked-- **THEN** `node.fontWeight` changes-diff --git a/openspec/specs/e2e-toolbar/spec.md b/openspec/specs/e2e-toolbar/spec.mddeleted file mode 100644index 9ad476f72..000000000--- a/openspec/specs/e2e-toolbar/spec.md+++ /dev/null@@ -1,54 +0,0 @@-# e2e-toolbar Specification--## Purpose-TBD - created by archiving change e2e-coverage-gaps. Update Purpose after archive.-## Requirements-### Requirement: Shapes flyout E2E-The E2E suite SHALL verify that the shapes flyout chevron opens a menu with Polygon and Star tools.--#### Scenario: Shapes flyout opens-- **WHEN** the shapes flyout trigger is clicked-- **THEN** the flyout menu is visible with Polygon and Star items--### Requirement: Polygon tool E2E-The E2E suite SHALL verify that selecting Polygon from the flyout and dragging creates a POLYGON node.--#### Scenario: Polygon created-- **WHEN** Polygon is selected from flyout and drag is performed on canvas-- **THEN** a node with type POLYGON exists on the current page--### Requirement: Star tool E2E-The E2E suite SHALL verify that selecting Star from the flyout and dragging creates a STAR node.--#### Scenario: Star created-- **WHEN** Star is selected from flyout and drag is performed on canvas-- **THEN** a node with type STAR exists on the current page--### Requirement: Pen tool corner points E2E-The E2E suite SHALL verify that three clicks with the Pen tool create a VECTOR node with 3 vertices.--#### Scenario: Three clicks create three vertices-- **WHEN** Pen tool is active and three distinct canvas positions are clicked, then Enter pressed (commits open path)-- **THEN** a VECTOR node exists with `vectorNetwork.vertices.length === 3`--### Requirement: Pen tool close path E2E-The E2E suite SHALL verify that clicking the first point of a Pen path closes it.--#### Scenario: Click first point closes path-- **WHEN** Pen tool creates 3 vertices and the user clicks on the first vertex position-- **THEN** the resulting VECTOR node has a closed segment (no open endpoint)--### Requirement: Pen tool Escape cancels path E2E-The E2E suite SHALL verify that pressing Escape during Pen drawing cancels the current path without creating a node.--#### Scenario: Escape cancels open path-- **WHEN** Pen tool creates 2 vertices and Escape is pressed-- **THEN** no new VECTOR node is created on the page (penCancel discards in-progress path)--### Requirement: Frame flyout E2E-The E2E suite SHALL verify that the Frame flyout chevron shows Frame and Section options.--#### Scenario: Frame flyout shows both options-- **WHEN** the frame flyout trigger is clicked-- **THEN** Frame (F) and Section (S) items are visible in the flyout-diff --git a/openspec/specs/e2e-variables-dialog/spec.md b/openspec/specs/e2e-variables-dialog/spec.mddeleted file mode 100644index 3bb17b8f6..000000000--- a/openspec/specs/e2e-variables-dialog/spec.md+++ /dev/null@@ -1,33 +0,0 @@-# e2e-variables-dialog Specification--## Purpose-TBD - created by archiving change e2e-coverage-gaps. Update Purpose after archive.-## Requirements-### Requirement: Variables dialog open E2E-The E2E suite SHALL verify that the variables dialog can be opened when no node is selected.--#### Scenario: Variables dialog opens-- **WHEN** no node is selected and the variables settings button is activated-- **THEN** a dialog element with variables table is visible--### Requirement: Variables dialog search E2E-The E2E suite SHALL verify that typing in the search field filters the variables table.--#### Scenario: Search filters variable rows-- **WHEN** variables exist with different names and a search term is typed-- **THEN** only rows whose names match the search term are visible--### Requirement: Variables dialog edit value E2E-The E2E suite SHALL verify that clicking a variable value cell makes it editable.--#### Scenario: Click cell to edit-- **WHEN** a variable value cell is clicked in the dialog-- **THEN** an input field is focused in that cell--### Requirement: Color variable picker E2E-The E2E suite SHALL verify that clicking a color variable swatch opens a color picker.--#### Scenario: Color swatch opens picker-- **WHEN** a color variable's swatch is clicked in the dialog-- **THEN** a color picker element becomes visible-diff --git a/openspec/specs/editor-ui/spec.md b/openspec/specs/editor-ui/spec.mddeleted file mode 100644index 4c677c89a..000000000--- a/openspec/specs/editor-ui/spec.md+++ /dev/null@@ -1,341 +0,0 @@-# editor-ui Specification--## Purpose-Vue 3 + Reka UI editor interface. Bottom toolbar, layers panel with tree view and drag reorder, properties panel with sectioned layout (appearance, fill, stroke, typography, layout, position), color picker, and Lucide icons.-## Requirements-### Requirement: Vue 3 + Reka UI component architecture-The editor UI SHALL be built with Vue 3, VueUse composables, and Reka UI headless components. The UI framework was migrated from React to Vue 3.--#### Scenario: Editor loads-- **WHEN** user opens the editor at localhost:1420-- **THEN** the Vue 3 application renders with canvas, toolbar, layers panel, and properties panel--### Requirement: Bottom toolbar-The toolbar SHALL be positioned at the bottom of the screen (Figma UI3 style) with tool selection: Select (V), Frame (F), Section (S, in Frame flyout), Rectangle (R), Ellipse (O), Line (L), Polygon (flyout), Star (flyout), Text (T), Hand (H), Pen (P). The shapes flyout (Rectangle, Line, Ellipse, Polygon, Star) SHALL display keyboard shortcuts right-aligned for tools that have them.--#### Scenario: Tool selection via keyboard-- **WHEN** user presses R-- **THEN** the rectangle tool is activated and the toolbar shows R as selected--#### Scenario: Frame flyout includes Section-- **WHEN** user opens the Frame tool flyout-- **THEN** both Frame and Section tools are available--#### Scenario: Shapes flyout includes Polygon and Star-- **WHEN** user opens the shapes flyout-- **THEN** Polygon (triangle icon) and Star (star icon) are listed alongside Rectangle, Line, and Ellipse--#### Scenario: Draw polygon on canvas-- **WHEN** user selects Polygon tool and drags on canvas-- **THEN** a POLYGON node is created with default 3 sides--#### Scenario: Draw star on canvas-- **WHEN** user selects Star tool and drags on canvas-- **THEN** a STAR node is created with 5 points and 0.38 inner radius--### Requirement: Layers panel with tree view-The layers panel SHALL display a tree view of the document hierarchy using Reka UI Tree with expand/collapse and drag reordering.--#### Scenario: Expand/collapse frame children-- **WHEN** user clicks the chevron next to a frame in the layers panel-- **THEN** the frame's children are shown or hidden--#### Scenario: Drag reorder layers-- **WHEN** user drags a layer to a new position in the layers panel-- **THEN** the node's z-order in the scene graph changes accordingly--#### Scenario: Visibility toggle-- **WHEN** user clicks the visibility icon next to a layer-- **THEN** the node is hidden/shown on canvas--### Requirement: Properties panel with tabs-The properties panel SHALL be organized as a tabbed interface with Design | Code | AI tabs (reka-ui Tabs). The Design tab (DesignPanel) contains sections: Appearance (opacity, corner radius with independent mode, visibility toggle), Fill, Stroke, Effects, Typography, Layout, Position. The Code tab shows JSX export. The AI tab shows the chat interface.--#### Scenario: Properties panel shows fill section-- **WHEN** user selects a rectangle with a blue fill-- **THEN** the Fill section shows the hex color #3B82F6 with opacity and visibility controls--#### Scenario: Editable hex input-- **WHEN** user types a new hex value in the fill section-- **THEN** the node's fill updates to the entered color--### Requirement: Color picker-The color picker SHALL provide HSV color selection, hue slider, alpha slider, hex input, and opacity control.--#### Scenario: Change color via HSV-- **WHEN** user moves the color picker cursor in the HSV square-- **THEN** the selected node's fill updates in real time--### Requirement: Lucide icons via Iconify-UI icons SHALL use Lucide icons loaded via unplugin-icons with Iconify, replacing inline emoji/SVG.--#### Scenario: Icon rendering-- **WHEN** the toolbar renders tool icons-- **THEN** Lucide icons are displayed via the icon auto-import resolver--### Requirement: Tailwind CSS 4 styling-The editor SHALL use Tailwind CSS 4 for all styling.--#### Scenario: Dark theme-- **WHEN** the editor renders-- **THEN** the UI uses a dark theme styled with Tailwind CSS 4 utility classes--### Requirement: Pages panel-The editor SHALL display a PagesPanel component showing all pages in the document. Users can switch pages, add pages, delete pages, and rename pages inline (blur commits, Enter/Escape just blur).--#### Scenario: Switch page-- **WHEN** user clicks a page tab in the pages panel-- **THEN** the canvas switches to that page and viewport state is restored--#### Scenario: Add page-- **WHEN** user clicks the add page button-- **THEN** a new page is created and becomes active--#### Scenario: Inline page rename-- **WHEN** user double-clicks a page name-- **THEN** an inline text input appears, blur commits the rename--### Requirement: Section tool-The toolbar SHALL include a Section tool (shortcut <kbd>S</kbd>) in the Frame flyout. Drawing on canvas creates a SECTION node.--#### Scenario: Section tool activation-- **WHEN** user presses S-- **THEN** the section tool activates and the toolbar shows Section as selected--### Requirement: Fill type picker with gradient and image support-The fill section in the properties panel SHALL provide a type picker with tabs: Solid, Gradient (Linear, Radial, Angular, Diamond), and Image. Gradient fills show editable gradient stops. Image fills show image selection.--#### Scenario: Switch fill to linear gradient-- **WHEN** user selects "Linear Gradient" from the fill type picker-- **THEN** the selected node's fill changes to GRADIENT_LINEAR with default stops and the gradient stop editor appears--#### Scenario: Edit gradient stop-- **WHEN** user drags a gradient stop to position 50%-- **THEN** the stop position updates and the node re-renders with the adjusted gradient--### Requirement: Page background color-The properties panel SHALL show a page section with canvas background color picker when no nodes are selected.--#### Scenario: Change canvas background-- **WHEN** user selects no nodes and changes the page color-- **THEN** the canvas background updates to the chosen color--### Requirement: Hover highlight in canvas-The editor SHALL highlight nodes on hover with a shape-aware outline (follows actual geometry, not just bounding box).--#### Scenario: Hover feedback-- **WHEN** user moves cursor over a node without clicking-- **THEN** a highlight outline appears around the node shape---### Requirement: Component keyboard shortcuts-The editor SHALL support keyboard shortcuts for component operations: ⌥⌘K (create component), ⌥⌘B (detach instance), ⇧⌘K (create component set).--#### Scenario: Create component shortcut-- **WHEN** user selects a frame and presses ⌥⌘K-- **THEN** the frame becomes a component--### Requirement: Z-order keyboard shortcuts-The editor SHALL support ] (bring to front) and [ (send to back) keyboard shortcuts.--#### Scenario: Bring to front shortcut-- **WHEN** user selects a node and presses ]-- **THEN** the node moves to the top of its z-order--### Requirement: Visibility and lock keyboard shortcuts-The editor SHALL support ⇧⌘H (toggle visibility) and ⇧⌘L (toggle lock) keyboard shortcuts.--#### Scenario: Toggle visibility shortcut-- **WHEN** user selects a node and presses ⇧⌘H-- **THEN** the node's visibility toggles--### Requirement: Effects section in properties panel-The properties panel SHALL include an Effects section showing all effects on the selected node. Each effect displays as a collapsible row with: color swatch (shadows) or blur icon (blurs), type dropdown (DROP_SHADOW, INNER_SHADOW, LAYER_BLUR, BACKGROUND_BLUR, FOREGROUND_BLUR), visibility toggle, and remove button. Clicking a row expands inline controls.--#### Scenario: Add drop shadow effect-- **WHEN** user clicks the + button in the Effects section-- **THEN** a DROP_SHADOW effect is added with default values (offset 0,4; radius 4; spread 0; color rgba(0,0,0,0.25))--#### Scenario: Switch effect type-- **WHEN** user changes the type dropdown from DROP_SHADOW to LAYER_BLUR-- **THEN** the effect type updates and offset/spread fields are hidden (only blur radius shown)--#### Scenario: Inline shadow controls-- **WHEN** user expands a shadow effect row-- **THEN** X/Y offset, blur radius, spread, color picker, hex input, and opacity controls appear inline--#### Scenario: Toggle effect visibility-- **WHEN** user clicks the eye icon on an effect row-- **THEN** the effect's `visible` property toggles and the canvas re-renders--#### Scenario: Remove effect-- **WHEN** user clicks the − button on an effect row-- **THEN** the effect is removed from the node--### Requirement: Independent corner radius toggle in Appearance section-The Appearance section SHALL show a corner radius toggle button for RECTANGLE, ROUNDED_RECTANGLE, FRAME, COMPONENT, and INSTANCE nodes. When toggled to independent mode, a 2×2 grid of per-corner radius inputs (top-left, top-right, bottom-left, bottom-right) replaces the single radius input. Each corner has a distinct icon. Toggling back to uniform sets all corners to the top-left value.--#### Scenario: Toggle to independent corners-- **WHEN** user clicks the independent corners button-- **THEN** four separate corner radius inputs appear in a grid layout--#### Scenario: Toggle back to uniform-- **WHEN** user clicks the independent corners button while in independent mode-- **THEN** a single corner radius input appears, set to the top-left value--### Requirement: Resizable panels-The left (layers) and right (properties) panels SHALL be resizable via reka-ui Splitter components (SplitterGroup, SplitterPanel, SplitterResizeHandle). Default width SHALL be 15%, minimum 10%, maximum 30%. Panel layout SHALL persist across reloads via auto-save-id. The resize handle SHALL be 8px wide with negative margins and a centered 1px visible line that highlights blue on hover/drag.--#### Scenario: Resize layers panel-- **WHEN** user drags the resize handle between layers panel and canvas-- **THEN** the layers panel width changes and the canvas resizes accordingly--#### Scenario: Panel size persists-- **WHEN** user resizes panels and reloads the page-- **THEN** panel widths are restored to the previous sizes--### Requirement: Throttled WebGL surface recreation during resize-The CanvasKit surface SHALL be recreated at most once per animation frame during panel resize, coalesced via requestAnimationFrame in the ResizeObserver callback.--#### Scenario: Panel resize performance-- **WHEN** user drags a panel resize handle continuously-- **THEN** the WebGL surface is recreated at most once per frame--### Requirement: Variables dialog-The editor SHALL display a VariablesSection in the page-level properties panel showing variable/collection counts and a settings icon. Clicking the icon opens a VariablesDialog (reka-ui Dialog) with: collection tabs (reka-ui Tabs, double-click to rename), a TanStack Table (@tanstack/vue-table) with resizable columns (Name | Mode 1 | Mode 2 | ...), search bar, and a "+ Create variable" button. Color variables display inline ColorInput with picker. Variable names and values are editable inline (reka-ui Editable).--#### Scenario: Open variables dialog-- **WHEN** user clicks the settings icon in the Variables section of page properties-- **THEN** a dialog opens showing collection tabs and a variables table--#### Scenario: Rename collection-- **WHEN** user double-clicks a collection tab name-- **THEN** the tab becomes editable for renaming--#### Scenario: Resize table columns-- **WHEN** user drags a column border in the variables table header-- **THEN** the column width adjusts--#### Scenario: Search variables-- **WHEN** user types in the search bar in the variables dialog-- **THEN** only variables matching the search term are shown--#### Scenario: Edit variable value-- **WHEN** user clicks a variable value cell in the table-- **THEN** an editable input allows changing the value for that mode--### Requirement: Fill section variable picker-The fill section SHALL include a variable picker (reka-ui Popover + Combobox) to bind a color variable to a fill. Bound fills display a purple variable name badge with a detach button.--#### Scenario: Bind variable to fill-- **WHEN** user selects a color variable from the fill variable picker-- **THEN** the fill shows a purple badge with the variable name--#### Scenario: Detach variable from fill-- **WHEN** user clicks the detach button on a bound fill-- **THEN** the variable binding is removed and the fill shows the resolved color--### Requirement: Export section in properties panel-The properties panel SHALL include an ExportSection when nodes are selected. The section provides: scale selector (0.5×, 0.75×, 1×, 1.5×, 2×, 3×, 4×), format picker (PNG, JPG, WEBP), multi-export support (add/remove export settings), live preview with checkerboard background, and an Export button. JPG uses white background, PNG/WEBP use transparency.--#### Scenario: Export as PNG-- **WHEN** user sets format to PNG, scale to 2×, and clicks Export-- **THEN** a 2× resolution PNG is saved via native dialog / FSAPI / download--#### Scenario: Export via context menu-- **WHEN** user right-clicks a node and selects "Export…"-- **THEN** the export flow starts for the selected node--#### Scenario: Export via keyboard shortcut-- **WHEN** user presses ⇧⌘E with a node selected-- **THEN** the export flow starts--### Requirement: Splash loader-The editor SHALL display a minimalist loading animation (centered logo + progress bar) during WASM (CanvasKit) initialization. The loader fades out when the canvas is ready.--#### Scenario: Initial load-- **WHEN** user opens the editor-- **THEN** a splash loader is shown until CanvasKit WASM is loaded, then fades out--### Requirement: ColorInput component-A reusable ColorInput component SHALL display a color swatch with ColorPicker and an optional hex input. It SHALL replace duplicated color picker + hex input patterns in PageSection, StrokeSection, EffectsSection, and VariablesDialog.--#### Scenario: Color input with editing-- **WHEN** ColorInput is rendered with editable=true-- **THEN** a swatch with picker and an editable hex input are shown--#### Scenario: Color input read-only-- **WHEN** ColorInput is rendered with editable=false (default)-- **THEN** a swatch with picker and a read-only hex label are shown--### Requirement: ColorPicker alpha slider checkerboard-The ColorPicker alpha slider SHALL display a checkerboard background behind the transparent-to-color gradient, matching FillPicker's implementation.--#### Scenario: Alpha slider visual-- **WHEN** user opens a ColorPicker-- **THEN** the alpha slider shows a checkerboard pattern indicating transparency--### Requirement: Demo variable collections-The demo document SHALL include three variable collections demonstrating multi-mode and alias features: Primitives (Light/Dark modes, 9 color variables), Semantic (aliases to Primitives), and Spacing (Default/Compact modes, 8 number variables). Variables SHALL be bound to demo nodes.--#### Scenario: Demo loads with variables-- **WHEN** the demo document is created-- **THEN** three collections with variables and bindings are present in the scene graph--### Requirement: Rich text formatting buttons-The TypographySection SHALL include B/I/U/S toggle buttons for Bold, Italic, Underline, and Strikethrough. When text is selected during editing, the buttons apply formatting to the selection. When editing with no selection, they toggle the whole-node style. The active state reflects current selection formatting.--#### Scenario: Bold button with selection-- **WHEN** user selects text and clicks the Bold button (or presses ⌘B)-- **THEN** the selection becomes bold and the B button shows active state--#### Scenario: Underline button with no selection-- **WHEN** user clicks the Underline button during editing with no selection-- **THEN** the entire text node's underline style toggles--### Requirement: AI chat panel-The editor SHALL include an AI chat panel accessible via the AI tab in properties panel or ⌘J shortcut. The panel provides: message list with streaming markdown (vue-stream-markdown), tool call timeline with collapsible details (reka-ui Collapsible), typing indicator, API key setup for OpenRouter (stored in Tauri Stronghold). Messages scroll automatically (reka-ui ScrollArea).--#### Scenario: Send message-- **WHEN** user types a message and presses Enter in the chat input-- **THEN** the message is sent to OpenRouter and a streaming response appears--#### Scenario: Toggle chat-- **WHEN** user presses ⌘J-- **THEN** the properties panel switches to the AI tab (or back to Design)--### Requirement: AI model selector-The chat input SHALL include a model selector with curated models: Claude, Gemini, GPT, DeepSeek, Qwen, Kimi, Llama. Models are stored in @open-pencil/core constants with benchmark-ranked tags.--#### Scenario: Change model-- **WHEN** user selects a different model from the selector-- **THEN** subsequent messages use the selected model--### Requirement: AI tools-The chat SHALL support 10 design tools with valibot schemas: create_shape, set_fill, set_stroke, update_node, set_layout, delete_node, select_nodes, get_page_tree, get_selection, rename_node. Tools execute against the editor store. The ToolLoopAgent calls tools automatically in a loop.--#### Scenario: AI creates a shape-- **WHEN** user asks "Create a blue rectangle 200×100"-- **THEN** the AI calls create_shape with type RECTANGLE, width 200, height 100, and set_fill with blue color--#### Scenario: Tool call visible in chat-- **WHEN** the AI executes a tool-- **THEN** a collapsible tool call section shows the tool name, input, and output--### Requirement: DirectChatTransport-The chat SHALL communicate directly with OpenRouter from the browser — no backend server required. The API key is stored securely in Tauri Stronghold (or localStorage fallback in browser). X-OpenRouter-Title header identifies the app.--#### Scenario: No backend required-- **WHEN** user configures an OpenRouter API key and sends a message-- **THEN** the request goes directly to OpenRouter without a proxy server--### Requirement: Code panel with JSX export-The properties panel Code tab SHALL display the selected node(s) as JSX code using sceneNodeToJsx(). The panel provides Prism.js syntax highlighting, line numbers, and a copy-to-clipboard button. Multi-selection shows each node's JSX.--#### Scenario: View JSX for selection-- **WHEN** user selects a frame and clicks the Code tab-- **THEN** the JSX representation of the frame and its children is displayed with syntax highlighting--#### Scenario: Copy JSX-- **WHEN** user clicks the copy button in the Code panel-- **THEN** the JSX code is copied to the clipboarddiff --git a/openspec/specs/eval-command/spec.md b/openspec/specs/eval-command/spec.mddeleted file mode 100644index 757b3d77e..000000000--- a/openspec/specs/eval-command/spec.md+++ /dev/null@@ -1,146 +0,0 @@-# eval-command Specification--## Purpose-CLI command `open-pencil eval <file>` for executing JavaScript against .fig files with a Figma-compatible `figma` global object. Enables headless scripting, batch operations, AI tool execution, and testing without GUI. Supports `--code`, `--stdin`, `--write`, `-o`, and `--json` flags.--## Requirements--### Requirement: Execute JavaScript against .fig files--The system SHALL provide `bun open-pencil eval <file> --code '<js>'` command for headless JavaScript execution.--#### Scenario: Running inline code-- **WHEN** user runs `bun open-pencil eval design.fig --code 'return figma.currentPage.children.length'`-- **THEN** system loads design.fig, executes code with `figma` global, prints result to stdout--#### Scenario: Returning JSON-- **WHEN** user runs `bun open-pencil eval design.fig --code 'return { id: figma.currentPage.id }'`-- **THEN** system serializes result as JSON and prints--#### Scenario: Code with no return-- **WHEN** user runs code that doesn't return a value-- **THEN** system prints `undefined`--### Requirement: Read code from stdin--The system SHALL support `--stdin` flag for reading multiline scripts.--#### Scenario: Piping script file-- **WHEN** user runs `cat script.js | bun open-pencil eval design.fig --stdin`-- **THEN** system reads script from stdin and executes--#### Scenario: Heredoc input-- **WHEN** user runs eval with heredoc `<<EOF` and multiline script-- **THEN** system reads until EOF and executes--### Requirement: Write changes back to file--The system SHALL support `--write` and `-o` flags for persisting modifications.--#### Scenario: Writing changes in-place-- **WHEN** user runs `bun open-pencil eval design.fig --code 'frame.name = "Updated"' --write`-- **THEN** system modifies design.fig in-place after execution--#### Scenario: Writing to output file-- **WHEN** user runs `bun open-pencil eval design.fig --code '...' -o modified.fig`-- **THEN** system writes modified scene graph to modified.fig, leaving original unchanged--#### Scenario: Read-only by default-- **WHEN** user runs eval without --write or -o-- **THEN** system does not modify the input file--### Requirement: Figma global object available--The system SHALL provide a `figma` global object matching Figma's Plugin API surface.--#### Scenario: Accessing figma object-- **WHEN** code accesses `figma.currentPage`, `figma.root`, `figma.createFrame()`-- **THEN** system provides FigmaAPI instance bound to loaded document--#### Scenario: Creating nodes-- **WHEN** code calls `figma.createFrame()`, `figma.createRectangle()`, etc.-- **THEN** system creates nodes in scene graph--#### Scenario: Querying nodes-- **WHEN** code calls `figma.currentPage.findAll(n => n.type === "FRAME")`-- **THEN** system traverses scene graph and returns matching nodes--### Requirement: Document loading and unloading--The system SHALL load .fig files before execution and manage cleanup.--#### Scenario: Loading document-- **WHEN** eval command starts-- **THEN** system deserializes .fig file into SceneGraph--#### Scenario: Invalid file-- **WHEN** user provides non-existent or corrupted .fig file-- **THEN** system exits with error message--### Requirement: Error handling--The system SHALL report JavaScript execution errors with stack traces.--#### Scenario: Runtime error-- **WHEN** code throws an exception (e.g., accessing property on undefined)-- **THEN** system prints error message and stack trace to stderr--#### Scenario: Syntax error-- **WHEN** code has invalid JavaScript syntax-- **THEN** system reports syntax error before execution--### Requirement: Structured output option--The system SHALL support `--json` flag for machine-readable output.--#### Scenario: JSON output-- **WHEN** user runs `bun open-pencil eval design.fig --code '...' --json`-- **THEN** system formats result as JSON (even if code doesn't return object)--#### Scenario: JSON with errors-- **WHEN** execution fails with --json flag-- **THEN** system outputs `{ "error": "message", "stack": "..." }` as JSON--### Requirement: Integration with AI tools--The system SHALL enable AI-driven design automation via eval execution.--#### Scenario: AI tool calls eval-- **WHEN** AI tool invokes eval command with generated code-- **THEN** system executes code and returns result for AI to process--#### Scenario: Batch operations-- **WHEN** AI generates loop over nodes (e.g., rename all buttons)-- **THEN** system executes batch modifications efficiently--### Requirement: Console output support--The system SHALL allow `console.log()` for debugging.--#### Scenario: Logging during execution-- **WHEN** code calls `console.log("Debug:", value)`-- **THEN** system prints to stdout before final result--### Requirement: Access to Bun APIs--The system SHALL allow code to use Bun runtime APIs. Eval runs in a trusted local context (same as the CLI itself) — no sandboxing is applied.--#### Scenario: File I/O from eval code-- **WHEN** code uses `Bun.file()`, `Bun.write()`, etc.-- **THEN** system allows file operations (trusted headless context)--#### Scenario: Fetch from eval code-- **WHEN** code uses `fetch()` to call external API-- **THEN** system executes network request--### Requirement: CLI integration--The system SHALL integrate eval command into `@open-pencil/cli` package.--#### Scenario: Command registration-- **WHEN** CLI loads commands-- **THEN** eval command appears in `bun open-pencil --help`--#### Scenario: Command structure-- **WHEN** user runs `bun open-pencil eval --help`-- **THEN** system displays usage, flags (--code, --stdin, --write, -o, --json), and examplesdiff --git a/openspec/specs/fig-import/spec.md b/openspec/specs/fig-import/spec.mddeleted file mode 100644index b1ce9871e..000000000--- a/openspec/specs/fig-import/spec.md+++ /dev/null@@ -1,95 +0,0 @@-# fig-import Specification--## Purpose-.fig file import pipeline. Parses Figma file header, decompresses Zstd payload, decodes Kiwi schema, extracts NodeChange[], resolves blob references, and populates the scene graph.-## Requirements-### Requirement: .fig file import-The editor SHALL import .fig files via the Kiwi codec pipeline: parse header (magic "fig-kiwi" + version), decompress Zstd, decode Kiwi schema, extract NodeChange[], and build the scene graph.--#### Scenario: Import a .fig file-- **WHEN** user opens a .fig file-- **THEN** all nodes from the file appear on the canvas with correct types, positions, sizes, and visual properties--### Requirement: File open via keyboard-⌘O SHALL open a file dialog for .fig import.--#### Scenario: Open file dialog-- **WHEN** user presses ⌘O-- **THEN** a file picker dialog appears filtered for .fig files--### Requirement: Blob reference resolution-The import pipeline SHALL resolve blob references (images, vector networks, font data) from the .fig file's blob section.--#### Scenario: Import with vector blobs-- **WHEN** a .fig file containing vector nodes with vectorNetworkBlob data is imported-- **THEN** the vector paths are correctly decoded and renderable--### Requirement: .fig file export-The editor SHALL export documents as .fig files. The pipeline: scene graph → Kiwi encode NodeChange[] → compress → write ZIP with Kiwi header, schema, message, and thumbnail.--#### Scenario: Save As .fig-- **WHEN** user selects File → Save As-- **THEN** a save dialog appears and the document is written as a valid .fig file--#### Scenario: Save existing file-- **WHEN** user selects File → Save (⌘S) with a previously opened file-- **THEN** the file is overwritten in place without a dialog--### Requirement: Thumbnail generation for .fig export-Exported .fig files SHALL include a thumbnail.png in the ZIP archive, as required by Figma for file preview.--#### Scenario: Thumbnail in exported file-- **WHEN** a .fig file is exported-- **THEN** the ZIP archive contains a thumbnail.png--### Requirement: Zstd compression via Tauri Rust-On the desktop app, .fig export SHALL use Zstd compression via a Tauri Rust command for performance. In the browser, deflate fallback via fflate SHALL be used.--#### Scenario: Desktop export uses Zstd-- **WHEN** a .fig file is exported in the Tauri desktop app-- **THEN** the payload is compressed with Zstd via the Rust backend--#### Scenario: Browser export uses deflate-- **WHEN** a .fig file is exported in the browser-- **THEN** the payload is compressed with deflate as a fallback--### Requirement: Tauri native file dialogs-File Open and Save dialogs SHALL use Tauri's plugin-dialog for native OS dialogs on the desktop app. Save filters for .fig files.--#### Scenario: Native open dialog-- **WHEN** user presses ⌘O in the desktop app-- **THEN** the native OS file picker opens filtered for .fig files--#### Scenario: Native save dialog-- **WHEN** user selects Save As in the desktop app-- **THEN** the native OS save dialog opens with default filename "Untitled.fig"--### Requirement: Tier 1 rendering parity for import-The .fig import pipeline SHALL correctly import and render gradient fills, image fills, effects (shadows, blurs), stroke properties (cap, join, dash), and arc data.--#### Scenario: Import file with gradients-- **WHEN** a .fig file containing nodes with gradient fills is imported-- **THEN** all gradient types (linear, radial, angular, diamond) render correctly with their stops and transforms--### Requirement: .fig import/export round-trip-A .fig file imported and then exported SHALL produce a file that Figma can open with the same visual result.--#### Scenario: Round-trip fidelity-- **WHEN** a .fig file is imported into OpenPencil and re-exported-- **THEN** the exported file opens in Figma with matching visual output---### Requirement: Component type mapping in export-The .fig export pipeline SHALL map COMPONENT and COMPONENT_SET node types to SYMBOL in Kiwi encoding (Figma uses SYMBOL enum value for component-like nodes).--#### Scenario: Exporting component-- **WHEN** a COMPONENT node is serialized to Kiwi format-- **THEN** the type field uses the SYMBOL enum value--#### Scenario: Exporting component set-- **WHEN** a COMPONENT_SET node is serialized to Kiwi format-- **THEN** the type field uses the SYMBOL enum value--#### Scenario: Round-trip fidelity-- **WHEN** an exported .fig file is re-imported in Figma-- **THEN** component nodes are recognized as components (not unknown types)diff --git a/openspec/specs/figma-clipboard/spec.md b/openspec/specs/figma-clipboard/spec.mddeleted file mode 100644index 469d088a8..000000000--- a/openspec/specs/figma-clipboard/spec.md+++ /dev/null@@ -1,40 +0,0 @@-# figma-clipboard Specification--## Purpose-Bidirectional clipboard compatibility with Figma. Decodes Kiwi binary on paste, encodes Kiwi binary on copy, supports cut, and works across OpenPencil instances.-## Requirements-### Requirement: Paste from Figma-The editor SHALL accept paste events containing Kiwi binary data from Figma's clipboard. Pasted nodes SHALL be decoded and added to the scene graph.--#### Scenario: Paste Figma nodes-- **WHEN** user copies a frame in Figma and pastes in OpenPencil-- **THEN** the frame and its children appear on the canvas with preserved properties--### Requirement: Copy for Figma compatibility-The editor SHALL encode selected nodes as Kiwi binary on copy, allowing paste into Figma or other OpenPencil instances.--#### Scenario: Copy to Figma-- **WHEN** user copies a rectangle in OpenPencil and pastes in Figma-- **THEN** the rectangle appears in Figma with preserved fill, stroke, and dimensions--### Requirement: Native copy/paste events-Clipboard operations SHALL use native copy/paste browser events (not async Clipboard API) and build the Kiwi binary synchronously in the event handler.--#### Scenario: Synchronous clipboard encoding-- **WHEN** user presses ⌘C with a node selected-- **THEN** the Kiwi binary is built synchronously within the copy event handler--### Requirement: Cut operation-Cut SHALL copy nodes to clipboard and delete them from the scene graph.--#### Scenario: Cut and paste-- **WHEN** user cuts a node and pastes-- **THEN** the original is removed and a copy appears at the paste position--### Requirement: Copy between instances-Copy/paste SHALL work between multiple OpenPencil browser tabs/windows.--#### Scenario: Cross-instance paste-- **WHEN** user copies a node in one OpenPencil tab and pastes in another-- **THEN** the node appears in the second tab with all properties preserved-diff --git a/openspec/specs/figma-comparison-docs/spec.md b/openspec/specs/figma-comparison-docs/spec.mddeleted file mode 100644index d41de40c2..000000000--- a/openspec/specs/figma-comparison-docs/spec.md+++ /dev/null@@ -1,50 +0,0 @@-# figma-comparison-docs Specification--## Purpose-VitePress documentation page with feature-by-feature comparison tables mapping Figma Design features to Open Pencil's implementation status. Sourced from Figma help center articles (~90) and cross-referenced against Open Pencil's specs and features.-## Requirements-### Requirement: Feature comparison page exists-The documentation site SHALL include a page at `packages/docs/guide/figma-comparison.md` that provides feature-by-feature comparison tables mapping Figma Design features to Open Pencil status.--#### Scenario: Page is accessible-- **WHEN** user navigates to `/guide/figma-comparison` on the docs site-- **THEN** the page renders with title "Figma Feature Matrix" and contains comparison tables--### Requirement: Tables organized by Figma categories-The comparison page SHALL group features into tables by Figma's documentation categories: Interface & Navigation, Layers & Shapes, Vector Tools, Text & Typography, Color Gradients & Images, Effects & Properties, Auto Layout, Components & Design Systems, Prototyping, Import & Export, Collaboration, Dev Mode.--#### Scenario: All categories present-- **WHEN** user views the comparison page-- **THEN** each Figma documentation category has its own section heading and table--### Requirement: Three-tier status system-Each feature row SHALL use one of three status indicators: ✅ (supported — feature works), 🟡 (partial — core behavior exists but advanced options missing), 🔲 (not yet — feature not implemented).--#### Scenario: Status indicators are consistent-- **WHEN** a feature is listed in the comparison table-- **THEN** its status column contains exactly one of ✅, 🟡, or 🔲--### Requirement: Feature rows include notes-Each table row SHALL contain columns: Feature, Status, Notes. The Notes column provides brief context such as what works, what's missing, or relevant Open Pencil implementation details. Statuses SHALL be updated when features are implemented.--#### Scenario: Notes explain partial status-- **WHEN** a feature has 🟡 partial status-- **THEN** the Notes column explains what is supported and what is missing--#### Scenario: Component status updated-- **WHEN** user views the Components & Design Systems table-- **THEN** component creation, instances, and detach show current implementation status--### Requirement: Last-updated timestamp-The page SHALL display a last-updated date at the top so readers know the freshness of the comparison data.--#### Scenario: Date is visible-- **WHEN** user views the page-- **THEN** a "Last updated" line is visible near the top of the page--### Requirement: Sidebar integration-The VitePress config SHALL include the new page in the Guide sidebar section.--#### Scenario: Sidebar shows link-- **WHEN** user views any docs page-- **THEN** the sidebar Guide section includes a "Figma Feature Matrix" link pointing to `/guide/figma-comparison`diff --git a/openspec/specs/figma-plugin-api/spec.md b/openspec/specs/figma-plugin-api/spec.mddeleted file mode 100644index 89c8bc5c3..000000000--- a/openspec/specs/figma-plugin-api/spec.md+++ /dev/null@@ -1,330 +0,0 @@-# figma-plugin-api Specification--## Purpose-Figma-compatible Plugin API for headless JavaScript execution. Provides `figma` global object (FigmaAPI class) that mirrors Figma's plugin surface for scripting .fig files. Enables eval command, AI tools, and automated batch operations without GUI.--## Requirements--### Requirement: Figma-compatible global object--The system SHALL provide a `figma` global object that mirrors Figma's Plugin API surface for headless JavaScript execution.--#### Scenario: Creating figma object-- **WHEN** `new FigmaAPI(sceneGraph)` is instantiated-- **THEN** the object provides methods matching Figma's plugin API (createFrame, createRectangle, createText, etc.)--#### Scenario: Accessing current page-- **WHEN** user accesses `figma.currentPage`-- **THEN** system returns a proxy for the active page with methods like `findAll`, `findOne`, `appendChild`--#### Scenario: Accessing document root-- **WHEN** user accesses `figma.root`-- **THEN** system returns a proxy for the document root containing all pages--### Requirement: Node creation methods--The system SHALL provide creation methods for all supported node types.--#### Scenario: Creating a frame-- **WHEN** user calls `figma.createFrame()`-- **THEN** system creates a FRAME node, adds it to current page, and returns a proxy--#### Scenario: Creating a rectangle-- **WHEN** user calls `figma.createRectangle()`-- **THEN** system creates a RECTANGLE node with default fill--#### Scenario: Creating text-- **WHEN** user calls `figma.createText()`-- **THEN** system creates a TEXT node with default font (Inter Regular 14px)--#### Scenario: Creating other shapes-- **WHEN** user calls `figma.createEllipse()`, `figma.createLine()`, `figma.createPolygon()`, `figma.createStar()`, `figma.createVector()`-- **THEN** system creates corresponding node types--#### Scenario: Creating component-- **WHEN** user calls `figma.createComponent()`-- **THEN** system creates a COMPONENT node--#### Scenario: Creating component set-- **WHEN** user calls `figma.createComponentSet()`-- **THEN** system creates a COMPONENT_SET node--### Requirement: Node proxy with property access--The system SHALL wrap SceneNode objects in proxies that provide Figma-compatible property getters and setters.--#### Scenario: Reading node properties-- **WHEN** user accesses `node.id`, `node.type`, `node.name`, `node.x`, `node.y`, `node.width`, `node.height`-- **THEN** system returns current values from the underlying SceneNode--#### Scenario: Setting node properties-- **WHEN** user sets `node.name = "New Name"` or `node.x = 100`-- **THEN** system updates the SceneNode via SceneGraph.updateNode()--#### Scenario: Reading removed nodes-- **WHEN** user accesses a property on a removed node-- **THEN** system throws "Node <id> has been removed"--### Requirement: Geometry and transforms--The system SHALL provide geometry properties matching Figma's API.--#### Scenario: Basic dimensions-- **WHEN** user accesses `node.width`, `node.height`, `node.rotation`-- **THEN** system returns dimensions and rotation from SceneNode--#### Scenario: Absolute position-- **WHEN** user accesses `node.absoluteTransform`-- **THEN** system returns 2x3 matrix `[[a, b, tx], [c, d, ty]]`--#### Scenario: Absolute bounding box-- **WHEN** user accesses `node.absoluteBoundingBox` or `node.absoluteRenderBounds`-- **THEN** system returns `{x, y, width, height}` in absolute coordinates--#### Scenario: Resizing nodes-- **WHEN** user calls `node.resize(200, 100)`-- **THEN** system updates node width and height--### Requirement: Fill, stroke, and effects--The system SHALL provide Figma-compatible paint and effect properties.--#### Scenario: Reading fills-- **WHEN** user accesses `node.fills`-- **THEN** system returns frozen array of Fill objects--#### Scenario: Setting fills-- **WHEN** user sets `node.fills = [{ type: "SOLID", color: { r: 1, g: 0, b: 0 } }]`-- **THEN** system updates node fills--#### Scenario: Reading strokes-- **WHEN** user accesses `node.strokes`, `node.strokeWeight`, `node.strokeAlign`-- **THEN** system returns stroke configuration--#### Scenario: Reading effects-- **WHEN** user accesses `node.effects`-- **THEN** system returns frozen array of Effect objects--### Requirement: Text node properties--The system SHALL provide text-specific properties for TEXT nodes.--#### Scenario: Reading text content-- **WHEN** user accesses `textNode.characters`-- **THEN** system returns text content string--#### Scenario: Setting text content-- **WHEN** user sets `textNode.characters = "Hello"`-- **THEN** system updates text content--#### Scenario: Font properties-- **WHEN** user accesses `textNode.fontName`, `textNode.fontSize`, `textNode.fontWeight`-- **THEN** system returns font configuration--#### Scenario: Setting font-- **WHEN** user sets `textNode.fontName = { family: "Inter", style: "Bold" }`-- **THEN** system converts style to weight (700) and updates font--#### Scenario: Text alignment-- **WHEN** user accesses `textNode.textAlignHorizontal`-- **THEN** system returns "LEFT", "CENTER", or "RIGHT"--### Requirement: Auto-layout properties--The system SHALL provide auto-layout (flexbox) properties for frames.--#### Scenario: Reading layout mode-- **WHEN** user accesses `frame.layoutMode`-- **THEN** system returns "NONE", "HORIZONTAL", or "VERTICAL"--#### Scenario: Setting layout mode-- **WHEN** user sets `frame.layoutMode = "VERTICAL"`-- **THEN** system enables auto-layout with vertical direction--#### Scenario: Spacing and padding-- **WHEN** user accesses `frame.itemSpacing`, `frame.paddingLeft`, `frame.paddingTop`, etc.-- **THEN** system returns spacing values--#### Scenario: Layout sizing-- **WHEN** user accesses `node.layoutSizingHorizontal`, `node.layoutSizingVertical`-- **THEN** system returns "FIXED", "HUG", or "FILL"--### Requirement: Tree operations--The system SHALL provide methods for manipulating the scene graph tree.--#### Scenario: Appending child-- **WHEN** user calls `parent.appendChild(child)`-- **THEN** system reparents child to parent--#### Scenario: Inserting child-- **WHEN** user calls `parent.insertChild(2, child)`-- **THEN** system inserts child at index 2 in parent's children--#### Scenario: Accessing children-- **WHEN** user accesses `parent.children`-- **THEN** system returns frozen array of child proxies--#### Scenario: Accessing parent-- **WHEN** user accesses `node.parent`-- **THEN** system returns parent proxy or null for root--#### Scenario: Removing node-- **WHEN** user calls `node.remove()`-- **THEN** system deletes node from scene graph--### Requirement: Traversal and queries--The system SHALL provide methods for finding nodes in the scene graph.--#### Scenario: Finding all matching nodes-- **WHEN** user calls `figma.currentPage.findAll(n => n.type === "FRAME")`-- **THEN** system returns array of proxies for all frames in the page--#### Scenario: Finding first matching node-- **WHEN** user calls `figma.currentPage.findOne(n => n.name === "Button")`-- **THEN** system returns first matching proxy or null--#### Scenario: Finding by ID-- **WHEN** user calls `figma.getNodeById("node-123")`-- **THEN** system returns proxy for that node or null--#### Scenario: Finding with criteria object-- **WHEN** user calls `figma.currentPage.findAllWithCriteria({ types: ["FRAME", "GROUP"] })`-- **THEN** system returns array of proxies matching type criteria--### Requirement: Selection management--The system SHALL track and expose current selection.--#### Scenario: Reading selection-- **WHEN** user accesses `figma.currentPage.selection`-- **THEN** system returns array of selected node proxies--#### Scenario: Setting selection-- **WHEN** user sets `figma.currentPage.selection = [node1, node2]`-- **THEN** system updates editor selection state--### Requirement: Component operations--The system SHALL provide component and instance methods.--#### Scenario: Creating component from node-- **WHEN** user calls `figma.createComponentFromNode(frame)`-- **THEN** system converts frame to COMPONENT and returns proxy--#### Scenario: Creating instance-- **WHEN** user calls `component.createInstance()`-- **THEN** system creates INSTANCE referencing the component--#### Scenario: Swapping instance-- **WHEN** user calls `instance.swapComponent(otherComponent)`-- **THEN** system updates instance's mainComponent reference--### Requirement: Grouping operations--The system SHALL provide grouping methods.--#### Scenario: Grouping nodes-- **WHEN** user calls `figma.group([node1, node2], parent)`-- **THEN** system creates a GROUP containing the nodes--#### Scenario: Ungrouping-- **WHEN** user calls `figma.ungroup(group)`-- **THEN** system removes group and reparents children to group's parent--### Requirement: Corner radius handling--The system SHALL handle both uniform and independent corner radii matching Figma's API.--#### Scenario: Uniform corner radius-- **WHEN** user accesses `rectangle.cornerRadius` and all corners have same radius-- **THEN** system returns that radius value--#### Scenario: Mixed corner radius-- **WHEN** user accesses `rectangle.cornerRadius` and corners have different radii-- **THEN** system returns the MIXED symbol--#### Scenario: Individual corners-- **WHEN** user accesses `rectangle.topLeftRadius`, `rectangle.topRightRadius`, etc.-- **THEN** system returns individual corner radius values--### Requirement: Cloning nodes--The system SHALL support deep cloning of nodes.--#### Scenario: Cloning a node-- **WHEN** user calls `node.clone()`-- **THEN** system creates a deep copy with new GUID and returns proxy--#### Scenario: Cloning with children-- **WHEN** user calls `frame.clone()` on a frame with children-- **THEN** system recursively clones children--### Requirement: JSON serialization--The system SHALL provide JSON export for AI tools and debugging.--#### Scenario: Exporting node to JSON-- **WHEN** user calls `figma.toJSON(node)`-- **THEN** system returns object with `type`, `name`, `id`, geometry, fills, strokes, and recursive children--#### Scenario: Exporting with depth limit-- **WHEN** user calls `figma.toJSON(node, { maxDepth: 2 })`-- **THEN** system includes children only 2 levels deep--### Requirement: Frozen arrays for safety--The system SHALL return frozen arrays for multi-value properties to prevent accidental mutation.--#### Scenario: Fills array is frozen-- **WHEN** user accesses `node.fills` and tries `fills.push(...)`-- **THEN** system throws error (array is frozen)--#### Scenario: Children array is frozen-- **WHEN** user accesses `parent.children` and tries `children[0] = other`-- **THEN** system throws error (array is frozen)--### Requirement: Internal symbols hidden--The system SHALL hide internal implementation details using Symbol properties.--#### Scenario: Internals not enumerable-- **WHEN** user calls `Object.keys(nodeProxy)` or `for (let k in nodeProxy)`-- **THEN** system does not expose INTERNAL_ID, INTERNAL_GRAPH, INTERNAL_API--### Requirement: Variable support--The system SHALL provide access to design variables.--#### Scenario: Listing variables-- **WHEN** user calls `figma.variables.getLocalVariables()`-- **THEN** system returns array of Variable objects--#### Scenario: Listing variable collections-- **WHEN** user calls `figma.variables.getLocalVariableCollections()`-- **THEN** system returns array of VariableCollection objects--#### Scenario: Getting variable by ID-- **WHEN** user calls `figma.variables.getVariableById("var-123")`-- **THEN** system returns Variable object or undefined--### Requirement: Type guards--The system SHALL provide type-checking methods matching Figma's API.--#### Scenario: Checking node type-- **WHEN** user checks `if (node.type === "FRAME")`-- **THEN** system allows type-based branching--### Requirement: Stub methods for unimplemented features--The system SHALL provide stub methods for Figma API methods not yet implemented, throwing descriptive errors.--#### Scenario: Calling unimplemented method-- **WHEN** user calls `figma.createImage(data)` or `figma.createShapeWithText()`-- **THEN** system throws "Not implemented: <method>"--#### Scenario: Notifying user-- **WHEN** user calls `figma.notify("Hello")`-- **THEN** system logs to console (headless mode has no UI notifications)diff --git a/openspec/specs/group-ungroup/spec.md b/openspec/specs/group-ungroup/spec.mddeleted file mode 100644index 045d55eee..000000000--- a/openspec/specs/group-ungroup/spec.md+++ /dev/null@@ -1,33 +0,0 @@-# group-ungroup Specification--## Purpose-Group and ungroup node operations (⌘G/⇧⌘G). Creates GROUP nodes from selection, ungroups by reparenting children, sorts by visual position, and handles null node edge cases.-## Requirements-### Requirement: Group selection-⌘G SHALL group the current selection into a GROUP node. The group inherits the bounding box of its children.--#### Scenario: Group three nodes-- **WHEN** user selects three shapes and presses ⌘G-- **THEN** a GROUP node is created containing the three shapes as children--### Requirement: Ungroup selection-⇧⌘G SHALL ungroup the selected group, moving its children to the group's parent at the group's position.--#### Scenario: Ungroup-- **WHEN** user selects a group and presses ⇧⌘G-- **THEN** the group is removed and its children become siblings of the group's former parent--### Requirement: Position-based sort on wrap-When grouping or wrapping in auto-layout, nodes SHALL be sorted by their visual position to maintain reading order.--#### Scenario: Group preserves visual order-- **WHEN** three nodes at positions X=300, X=100, X=200 are grouped-- **THEN** the children are ordered by position (X=100 first, X=300 last)--### Requirement: Null node crash prevention-Group/ungroup operations SHALL handle null node references gracefully without crashing.--#### Scenario: Null node in selection-- **WHEN** a group operation encounters a null node reference in the selection-- **THEN** the operation completes without crashing, skipping the null reference-diff --git a/openspec/specs/kiwi-codec/spec.md b/openspec/specs/kiwi-codec/spec.mddeleted file mode 100644index bd1175eb5..000000000--- a/openspec/specs/kiwi-codec/spec.md+++ /dev/null@@ -1,51 +0,0 @@-# kiwi-codec Specification--## Purpose-Vendored Kiwi binary codec for Figma's 194-definition schema. Encodes/decodes NodeChange messages, handles sparse field IDs, and integrates Zstd compression for .fig file compatibility.-## Requirements-### Requirement: Vendored kiwi-schema-The project SHALL vendor kiwi-schema (from evanw/kiwi) with patches for ESM module format and sparse field ID handling.--#### Scenario: ESM import-- **WHEN** kiwi-schema is imported as an ES module-- **THEN** all encoder/decoder functions are available without CommonJS compatibility issues--### Requirement: Kiwi binary codec-The codec SHALL encode and decode Figma's 194-definition Kiwi schema including the NodeChange message type with ~390 fields.--#### Scenario: Decode a Kiwi message-- **WHEN** a compressed Kiwi binary is provided-- **THEN** the codec decodes it into a structured NodeChange[] array--#### Scenario: Encode a Kiwi message-- **WHEN** a NodeChange[] array is provided-- **THEN** the codec encodes it into Kiwi binary format--### Requirement: Sparse field ID support-The kiwi-schema parser SHALL handle sparse field IDs (non-contiguous field numbering) used by Figma's schema.--#### Scenario: Parse schema with sparse IDs-- **WHEN** a Kiwi schema definition has field IDs like 1, 2, 5, 10 (with gaps)-- **THEN** the parser correctly handles all fields without errors--### Requirement: Zstd compression-The codec layer SHALL support Zstd decompression for .fig file payloads and compression for clipboard/export.--#### Scenario: Decompress .fig payload-- **WHEN** a Zstd-compressed Kiwi payload is encountered in a .fig file-- **THEN** it is decompressed before Kiwi decoding--### Requirement: Kiwi encoding for .fig export-The Kiwi codec SHALL support encoding NodeChange[] back to Kiwi binary format for .fig export. The encoding path mirrors the decoding path: scene graph → NodeChange[] → Kiwi encode → compress → ZIP with header.--#### Scenario: Encode scene graph to Kiwi binary-- **WHEN** the editor exports a document-- **THEN** all nodes are encoded as NodeChange messages using the Kiwi schema and the binary output is a valid Kiwi payload--### Requirement: .fig ZIP built in Rust-On the desktop app, the .fig ZIP archive SHALL be assembled in Rust instead of JavaScript (fflate) for better performance and correct Zstd framing (content size in header).--#### Scenario: Rust ZIP assembly-- **WHEN** a .fig file is exported on the desktop app-- **THEN** the ZIP is assembled by the Rust backend with correct Zstd frame headers-diff --git a/openspec/specs/pen-tool/spec.md b/openspec/specs/pen-tool/spec.mddeleted file mode 100644index d93de5f9f..000000000--- a/openspec/specs/pen-tool/spec.md+++ /dev/null@@ -1,154 +0,0 @@-# pen-tool Specification--## Purpose-Pen tool for vector path creation and vector geometry editing using the vector network model. Supports open/closed paths, interactive tangent composition modes, and editing existing curves.--## Requirements-### Requirement: Pen tool activation and vector network model-Pressing `P` SHALL activate the Pen tool. Pen-created vectors SHALL use vector-network geometry (vertices, segments, tangents, regions), not flattened SVG path strings.--#### Scenario: Activate pen tool-- **WHEN** user presses `P`-- **THEN** active tool becomes `PEN`--#### Scenario: Create line segments-- **WHEN** user clicks multiple points without drag-- **THEN** segments are created with zero tangents (`tangentStart/tangentEnd = {0,0}`)--#### Scenario: Create curve segment-- **WHEN** user drags while placing a new point-- **THEN** non-zero tangents are recorded for bezier curvature--### Requirement: Vertex manipulation during creation-While drawing with the Pen tool, users SHALL be able to relocate the currently placed vertex without exiting the active curve drag.--#### Scenario: Relocate vertex with Space-- **WHEN** user drags to create a curve segment and holds `Space`-- **THEN** the active vertex moves with the cursor-- **AND** the tangent handle pull distance remains locked relative to the new vertex position-- **AND** cursor visually remains a crosshair, not switching to the hand tool--### Requirement: Open and closed path commit behavior-Path close intent SHALL be detected near the first vertex, but final close commit SHALL happen on `mouseUp`, not `mouseDown`.--#### Scenario: Close commit on mouseUp-- **WHEN** cursor is within close threshold to first vertex and user presses + releases pointer-- **THEN** the close segment is committed on release (`mouseUp`)--#### Scenario: Open path commit-- **WHEN** user presses `Escape` during Pen drawing-- **THEN** current path is committed as open (no fill region loop)--### Requirement: Closing handle drag behavior-When closing a path, dragging SHALL allow editing the closing handle on the closing vertex (vertex `0`) before commit.--#### Scenario: Closing preview while dragging-- **WHEN** close intent is active and user drags-- **THEN** preview renders closing segment (`last -> first`) with current handle values--#### Scenario: Closing commit with drag tangent-- **WHEN** close intent is active and pointer is released-- **THEN** closing segment end tangent uses the active closing drag tangent on vertex `0`--### Requirement: Pen tangent composition modes while drawing-During Pen drag, composition modifiers SHALL work consistently:-- default: Symmetric (`ANGLE_AND_LENGTH`)-- `Cmd/Ctrl`: Continuous (`ANGLE`) direction lock to sister handle axis, length editable-- `Alt/Option`: Corner (`NONE`) independent active handle, sister preserved--#### Scenario: Default symmetric drag-- **WHEN** user drags without modifiers-- **THEN** opposite handle mirrors active handle symmetrically--#### Scenario: Continuous drag with Cmd/Ctrl-- **WHEN** user drags and holds `Cmd/Ctrl`-- **THEN** active handle is constrained to sister axis and only length changes-- **AND** vertex handle composition is set to `ANGLE`--#### Scenario: Corner drag with Alt/Option-- **WHEN** user drags and holds `Alt/Option`-- **THEN** active handle is edited independently-- **AND** sister handle remains fixed as reference-- **AND** vertex handle composition is `NONE`--#### Scenario: Modifier release during same drag-- **WHEN** user changes modifier state mid-drag-- **THEN** behavior switches immediately to target composition mode without restarting drag--### Requirement: Closing-node default composition-At close-intent drag on vertex `0`, default composition SHALL be `Corner` to avoid mutating the sister handle unless explicitly requested by modifier behavior.--#### Scenario: Closing drag default keeps sister-- **WHEN** user drags close handle without modifiers-- **THEN** sister handle on vertex `0` keeps its prior value-- **AND** composition remains `NONE`--#### Scenario: Closing continuous uses frozen sister reference-- **WHEN** user presses `Cmd/Ctrl` during closing drag-- **THEN** sister handle on vertex `0` is preserved and used as continuous reference-- **AND** it is never zeroed by modifier transition--### Requirement: Entering node edit by double click-Double-clicking a vector while in Select mode SHALL enter geometry edit mode for that node.--#### Scenario: Enter node edit on vector-- **WHEN** user double-clicks a vector node-- **THEN** node edit state is initialized with absolute editable vertices/segments--### Requirement: Node-edit visual/interaction isolation-While in node-edit mode, base selection transform UI (selection bbox, resize/rotate cursor hit testing) SHALL be disabled for the edited node.--#### Scenario: No transform cursor in node-edit-- **WHEN** node-edit mode is active-- **THEN** hovering former selection corners does not produce resize/rotate cursors--### Requirement: Pen tool actions in node-edit mode-With Pen active and node-edit mode open:-- click on contour adds a vertex (segment split)-- click on endpoint resumes drawing from endpoint-- `Alt/Option` click on vertex removes vertex--#### Scenario: Add point on contour in node-edit-- **WHEN** Pen is active in node-edit and user clicks contour-- **THEN** nearest segment is split and a new anchor is inserted--#### Scenario: Resume from endpoint-- **WHEN** Pen is active in node-edit and user clicks endpoint-- **THEN** node-edit exits and Pen resumes path creation from that endpoint--### Requirement: Handle drag composition in node-edit mode-Handle drag in node-edit SHALL support composition modifiers:-- `Alt/Option`: break mirroring (`Corner`)-- `Cmd/Ctrl`: `Continuous` edit on same line as sister handle-- `Shift`: lock tangent direction to pre-drag direction for `Continuous`/`Symmetric`, editing length only--#### Scenario: Shift lock in continuous/symmetric-- **WHEN** handle drag is active on vertex with `ANGLE` or `ANGLE_AND_LENGTH` and `Shift` is held-- **THEN** tangent direction remains equal to pre-drag axis-- **AND** only tangent length changes--### Requirement: Bend-handle direction targeting for vector web-For `Cmd/Ctrl` + vertex drag bend mode, target handle SHALL be selected by incoming drag direction against segment-attachment direction at the vertex (tangent direction or neighbor fallback), not by nearest neighbor point distance.--#### Scenario: Multi-branch vertex target selection-- **WHEN** vertex has 3+ connected segments and user starts bend drag-- **THEN** target segment+tangent field is resolved by best directional alignment-- **AND** resolution is locked for that drag session--### Requirement: Pen render styling consistency-Committed vector style SHALL match drawing style conventions and preserve resumed style when editing/continuing existing vector paths.--#### Scenario: New open path style-- **WHEN** user commits a newly drawn open path-- **THEN** node gets stroke style consistent with live Pen rendering--#### Scenario: Resume existing path preserves style-- **WHEN** user resumes Pen from an existing vector endpoint and commits-- **THEN** fills/strokes from resumed node are preserved--### Requirement: vectorNetwork binary compatibility-Vector network data SHALL remain compatible with Figma-like `vectorNetworkBlob` encoding/decoding pipeline.--#### Scenario: Encode/decode compatibility-- **WHEN** vector is created/edited via Pen and saved/imported-- **THEN** geometry round-trips through vector network binary codec without losing structurediff --git a/openspec/specs/pwa/spec.md b/openspec/specs/pwa/spec.mddeleted file mode 100644index 25a898b16..000000000--- a/openspec/specs/pwa/spec.md+++ /dev/null@@ -1,56 +0,0 @@-# pwa Specification--## Purpose-Progressive Web App support — manifest, service worker, installability, offline shell caching, auto-update strategy.--## Requirements--### Requirement: Web app manifest-The app SHALL include a `manifest.webmanifest` file linked from `index.html` with `name` "OpenPencil", `short_name` "OpenPencil", `display` "standalone", `start_url` "/", `theme_color` "#1e1e1e", `background_color` "#1e1e1e", and icon entries for 192×192, 512×512, and maskable variants.--#### Scenario: Manifest served correctly-- **WHEN** a browser requests `/manifest.webmanifest`-- **THEN** the response is a valid JSON manifest with `display: "standalone"` and at least three icon entries--#### Scenario: Installability criteria met-- **WHEN** Chrome audits the web app for PWA installability-- **THEN** all criteria pass: manifest present, service worker registered, start_url responds, icons present--### Requirement: Service worker precaching-The build SHALL generate a service worker that precaches all build output assets including JavaScript bundles, CSS, WASM files, fonts, and icons. The Workbox `maximumFileSizeToCacheInBytes` SHALL be set to at least 8MB to accommodate the CanvasKit WASM (~7MB).--#### Scenario: Assets cached on first visit-- **WHEN** a user visits the app for the first time in a browser-- **THEN** the service worker installs and all precache-manifest assets are stored in CacheStorage--#### Scenario: App shell loads offline-- **WHEN** a user has previously visited the app and then loses network connectivity-- **THEN** the app shell (HTML, JS, CSS, WASM, fonts) loads from cache and the canvas initializes--### Requirement: Auto-update strategy-The service worker SHALL use an auto-update strategy: when a new version is detected, the SW activates immediately without requiring user interaction. The `skipWaiting` and `clientsClaim` options SHALL be enabled.--#### Scenario: Transparent update on new deployment-- **WHEN** a new version is deployed and the user revisits the app-- **THEN** the new service worker activates and serves updated assets without a reload prompt--### Requirement: PWA meta tags-`index.html` SHALL include `<meta name="theme-color" content="#1e1e1e">` and `<link rel="manifest" href="/manifest.webmanifest">`. The existing `apple-touch-icon` link SHALL be preserved.--#### Scenario: Theme color matches app background-- **WHEN** the browser reads meta tags-- **THEN** `theme-color` is `#1e1e1e` matching the app's dark background--### Requirement: PWA icons-The `public/` directory SHALL contain PWA icons at 192×192 (`pwa-192.png`), 512×512 (`pwa-512.png`), and a maskable icon at 512×512 (`pwa-maskable-512.png`) with safe-zone padding.--#### Scenario: Icon sizes available-- **WHEN** the manifest is parsed-- **THEN** icons at 192×192 (purpose "any"), 512×512 (purpose "any"), and 512×512 (purpose "maskable") are referenced and the files exist--### Requirement: Vite plugin integration-`vite-plugin-pwa` SHALL be configured in `vite.config.ts` using `generateSW` mode with `autoUpdate` registration type. The plugin SHALL be added to the Vite plugins array.--#### Scenario: Build produces SW-- **WHEN** `bun run build` completes-- **THEN** `dist/sw.js` and `dist/workbox-*.js` files exist alongside the precache manifestdiff --git a/openspec/specs/rulers/spec.md b/openspec/specs/rulers/spec.mddeleted file mode 100644index 1e213d4e8..000000000--- a/openspec/specs/rulers/spec.md+++ /dev/null@@ -1,47 +0,0 @@-# rulers Specification--## Purpose-Canvas rulers at top and left edges showing coordinate scales. Displays selection highlight bands, coordinate badges at selection bounds, and can be disabled via URL parameter.-## Requirements-### Requirement: Canvas rulers-Horizontal and vertical rulers SHALL be displayed at the top and left edges of the canvas, showing coordinate scales that update with pan/zoom.--#### Scenario: Ruler display-- **WHEN** the editor loads-- **THEN** horizontal and vertical rulers are visible with tick marks and coordinate labels--### Requirement: Selection highlight on rulers-Rulers SHALL display a highlight band at the position/size of the current selection.--#### Scenario: Selection ruler highlight-- **WHEN** a 200px wide node at X=100 is selected-- **THEN** the horizontal ruler shows a translucent highlight band from 100 to 300--### Requirement: Coordinate badges-Rulers SHALL display coordinate badges at the selection's start and end positions.--#### Scenario: Coordinate badges-- **WHEN** a node spanning X 100-300, Y 50-200 is selected-- **THEN** coordinate badges show 100 and 300 on the horizontal ruler, 50 and 200 on the vertical ruler--### Requirement: Consistent text alignment-Ruler tick labels and badge text SHALL align to the same baseline for visual consistency.--#### Scenario: Label alignment-- **WHEN** rulers render tick labels and coordinate badges-- **THEN** text baselines are aligned consistently across ticks and badges--### Requirement: Vertical ruler text clipping-Vertical ruler text SHALL NOT clip or overflow outside the ruler bounds.--#### Scenario: Vertical ruler overflow-- **WHEN** the vertical ruler displays coordinate labels-- **THEN** no text is clipped or extends beyond the ruler's visible area--### Requirement: Rulers can be disabled-The URL parameter `?no-rulers` SHALL disable canvas rulers for testing or presentation.--#### Scenario: Disable rulers via URL-- **WHEN** the editor loads with `?no-rulers` in the URL-- **THEN** rulers are not rendered-diff --git a/openspec/specs/scene-graph/spec.md b/openspec/specs/scene-graph/spec.mddeleted file mode 100644index 9dbae9496..000000000--- a/openspec/specs/scene-graph/spec.md+++ /dev/null@@ -1,276 +0,0 @@-# scene-graph Specification--## Purpose-Hierarchical data structure managing all design nodes. Provides flat Map<GUID, Node> storage with parent-child tree via parentIndex, CRUD operations, hit testing, and spatial queries.-## Requirements-### Requirement: Flat node storage with GUID keys-The scene graph SHALL store all nodes in a flat `Map<string, SceneNode>` keyed by GUID string. Tree structure SHALL be maintained via `parentIndex` references on each node. Each SceneNode SHALL include `componentId` (nullable reference to main component for instances) and `overrides` (record of instance-level property overrides).--#### Scenario: Create and retrieve a node-- **WHEN** a node is created with type RECTANGLE and a parent GUID-- **THEN** the node is stored in the map and retrievable by its GUID--#### Scenario: Parent-child relationship-- **WHEN** a child node references a parent via parentIndex-- **THEN** `getChildren(parentId)` returns the child sorted by position string--#### Scenario: Node has component fields-- **WHEN** a SceneNode is created-- **THEN** it has `componentId: null` and `overrides: {}` by default--### Requirement: Node types-The scene graph SHALL support node types: FRAME, RECTANGLE, ELLIPSE, LINE, TEXT, VECTOR, STAR, POLYGON, GROUP, BOOLEAN_OPERATION, DOCUMENT, CANVAS.--#### Scenario: Create each supported node type-- **WHEN** a node of each supported type is created-- **THEN** the node is stored with the correct type enum value--### Requirement: CRUD operations-The scene graph SHALL support create, read, update, and delete operations on nodes.--#### Scenario: Delete a node-- **WHEN** a node is deleted by GUID-- **THEN** the node is removed from the map and no longer returned by queries--#### Scenario: Update node properties-- **WHEN** a node's properties (size, fill, rotation) are updated-- **THEN** subsequent reads return the updated values--### Requirement: Hit testing-The scene graph SHALL support hit testing — given a point in canvas coordinates, return the topmost visible node at that position.--#### Scenario: Hit test on overlapping nodes-- **WHEN** two rectangles overlap and a point inside the overlap area is tested-- **THEN** the node with higher z-order (later in position string sorting) is returned--### Requirement: Rectangular area query-The scene graph SHALL support querying all nodes that intersect a given rectangle (for marquee selection).--#### Scenario: Marquee selection-- **WHEN** a rectangle area query is performed-- **THEN** all nodes whose bounds intersect the rectangle are returned--### Requirement: Unit test coverage-The scene graph SHALL have bun:test unit tests covering CRUD, parent-child, z-ordering, and hit testing.--#### Scenario: Unit tests pass-- **WHEN** `bun test ./tests/engine` is run-- **THEN** all scene graph unit tests pass in <50ms--### Requirement: Multi-page document support-The scene graph SHALL support multiple CANVAS (page) nodes as children of the DOCUMENT root. Each page has its own child tree. Pages can be added, deleted, and renamed.--#### Scenario: Add a new page-- **WHEN** user adds a page-- **THEN** a new CANVAS node is created as a child of the DOCUMENT root and becomes the active page--#### Scenario: Delete a page-- **WHEN** user deletes a page and at least two pages exist-- **THEN** the page is removed and the adjacent page becomes active--#### Scenario: Rename a page-- **WHEN** user renames a page-- **THEN** the CANVAS node's name property updates--### Requirement: Section node type-The scene graph SHALL support SECTION nodes. Sections are top-level only (direct children of CANVAS), cannot nest inside frames or groups. Sections auto-adopt overlapping siblings on creation.--#### Scenario: Create section-- **WHEN** user draws a section on the canvas-- **THEN** a SECTION node is created as a direct child of the current page--#### Scenario: Section auto-adopt-- **WHEN** a section is created overlapping existing nodes-- **THEN** overlapping sibling nodes are reparented into the section--#### Scenario: Section nesting restriction-- **WHEN** user attempts to move a section inside a frame or group-- **THEN** the section remains at top-level (direct child of CANVAS)--### Requirement: Extended node type union-The NodeType union SHALL include: CANVAS, FRAME, RECTANGLE, ROUNDED_RECTANGLE, ELLIPSE, TEXT, LINE, STAR, POLYGON, VECTOR, GROUP, SECTION, COMPONENT, COMPONENT_SET, INSTANCE, CONNECTOR, SHAPE_WITH_TEXT.--#### Scenario: NodeType covers all Figma types used in import-- **WHEN** a .fig file containing ROUNDED_RECTANGLE, COMPONENT, INSTANCE, CONNECTOR, or SHAPE_WITH_TEXT nodes is imported-- **THEN** each node is created with its correct type in the scene graph--### Requirement: Hover state tracking-The scene graph state SHALL track a `hoveredNodeId` for the node currently under the cursor.--#### Scenario: Hover a node-- **WHEN** user moves the cursor over a node-- **THEN** `hoveredNodeId` updates to that node's ID and a render is requested--### Requirement: Extended fill types-The Fill interface SHALL support types: SOLID, GRADIENT_LINEAR, GRADIENT_RADIAL, GRADIENT_ANGULAR, GRADIENT_DIAMOND, IMAGE. Gradient fills include `gradientStops` and `gradientTransform`. Image fills include `imageHash`, `imageScaleMode`, and `imageTransform`.--#### Scenario: Gradient fill on a node-- **WHEN** a node has a GRADIENT_LINEAR fill with two stops-- **THEN** the fill stores both gradient stops with position and color, plus a 2×3 gradient transform--### Requirement: Extended stroke properties-The Stroke interface SHALL support `cap` (NONE, ROUND, SQUARE, ARROW_LINES, ARROW_EQUILATERAL), `join` (MITER, BEVEL, ROUND), and `dashPattern` (array of dash/gap lengths).--#### Scenario: Dashed stroke-- **WHEN** a node has a stroke with dashPattern [10, 5]-- **THEN** the stroke renders as a dashed line with 10px dashes and 5px gaps--### Requirement: Per-page viewport state-Each page SHALL maintain independent viewport state (panX, panY, zoom, pageColor). Switching pages restores the viewport.--#### Scenario: Switch page restores viewport-- **WHEN** user switches from Page 1 (zoomed to 200%) to Page 2 and back-- **THEN** Page 1's viewport returns to 200% zoom at the previous pan position---### Requirement: Clone tree-The scene graph SHALL support deep-cloning a node subtree to a new parent via `cloneTree(sourceId, parentId)`, copying all properties and recursively cloning children.--#### Scenario: Clone subtree-- **WHEN** `cloneTree` is called on a frame with two children-- **THEN** a new frame with two new children is created under the target parent--### Requirement: Create instance from component-The scene graph SHALL support creating an INSTANCE node from a COMPONENT via `createInstance(componentId, parentId)`, copying visual properties and deep-cloning children.--#### Scenario: Instance copies component children-- **WHEN** `createInstance` is called for a component with three children-- **THEN** the instance has three cloned children matching the component's--### Requirement: Detach instance-The scene graph SHALL support converting an INSTANCE to FRAME via `detachInstance(instanceId)`, clearing `componentId` and `overrides`.--#### Scenario: Detach changes type-- **WHEN** `detachInstance` is called on an instance-- **THEN** its type becomes FRAME and componentId becomes null--### Requirement: Get main component-The scene graph SHALL support `getMainComponent(instanceId)` returning the source COMPONENT for an instance.--#### Scenario: Retrieve main component-- **WHEN** `getMainComponent` is called on an instance-- **THEN** the linked COMPONENT node is returned--### Requirement: Deep hit testing-The scene graph SHALL support `hitTestDeep(px, py)` that traverses into COMPONENT and INSTANCE containers, unlike standard `hitTest` which treats them as opaque.--#### Scenario: Deep hit test enters component-- **WHEN** `hitTestDeep` is called at a position inside a component's child-- **THEN** the child is returned, not the component--### Requirement: Instance sync method-The SceneGraph SHALL expose a method to synchronize all INSTANCE nodes linked to a given COMPONENT, copying synced properties (width, height, fills, strokes, effects, opacity, cornerRadius, topLeftRadius, topRightRadius, bottomRightRadius, bottomLeftRadius, independentCorners, layoutMode, layoutWrap, primaryAxisAlign, counterAxisAlign, primaryAxisSizing, counterAxisSizing, itemSpacing, counterAxisSpacing, paddingTop, paddingRight, paddingBottom, paddingLeft, clipsContent). Array properties are shallow-copied. Override-marked properties are skipped.--#### Scenario: Sync propagates fills-- **WHEN** a component's fill is changed and sync is triggered-- **THEN** all instances of that component receive the new fill (unless overridden)--### Requirement: Clone children with mapping-The SceneGraph SHALL support recursively cloning children from a source parent to a destination parent, setting each clone's `componentId` to the source child's ID. This enables sync matching between component and instance children.--#### Scenario: Clone with mapping-- **WHEN** a component with nested frames is cloned to an instance-- **THEN** each cloned child (recursively) has `componentId` pointing to the original--### Requirement: Child sync-The SceneGraph SHALL support syncing instance children to component children by matching via `componentId`. Synced child properties include the standard synced property list plus name, text, fontSize, fontWeight, fontFamily. New children from the component are cloned into the instance. Instance children are reordered to match component child order.--#### Scenario: Sync matches children by componentId-- **WHEN** a component has children [A, B] and an instance has cloned children with `componentId` pointing to A and B-- **THEN** sync updates each instance child's non-overridden properties from the corresponding component child--### Requirement: Independent corner radius fields-SceneNode SHALL include `independentCorners` (boolean), `topLeftRadius`, `topRightRadius`, `bottomRightRadius`, `bottomLeftRadius` (numbers). When `independentCorners` is true, each corner radius is controlled independently.--#### Scenario: Independent corners-- **WHEN** a rectangle has `independentCorners: true` with topLeftRadius=8 and topRightRadius=0-- **THEN** the rectangle renders with rounded top-left and sharp top-right--### Requirement: Polygon and Star node properties-SceneNode SHALL include `pointCount: number` (field default 5) and `starInnerRadius: number` (default 0.38). POLYGON nodes use `pointCount` as the number of sides (minimum 3); the Polygon tool overrides pointCount to 3 at creation. STAR nodes use `pointCount` as the number of outer points (default 5) and `starInnerRadius` as the ratio of inner to outer radius.--#### Scenario: Create polygon node-- **WHEN** a POLYGON node is created with pointCount=6-- **THEN** the node stores pointCount=6 and renders as a regular hexagon--#### Scenario: Create star node-- **WHEN** a STAR node is created with pointCount=5 and starInnerRadius=0.38-- **THEN** the node stores both properties and renders as a 5-pointed star--### Requirement: Tool type includes Polygon and Star-The Tool type union SHALL include POLYGON and STAR. The TOOLS array SHALL include POLYGON and STAR in the Rectangle shapes flyout. No dedicated keyboard shortcuts are assigned to Polygon or Star.--### Requirement: Variable types-SceneGraph SHALL support Variable, VariableCollection, and VariableCollectionMode types. VariableType SHALL be COLOR | FLOAT | STRING | BOOLEAN. VariableValue SHALL be Color | number | string | boolean | { aliasId: string }. Variables are stored in a Map keyed by ID. Collections group variables and define modes.--#### Scenario: Create color variable-- **WHEN** a COLOR variable is added with value { r: 1, g: 0, b: 0, a: 1 }-- **THEN** the variable is stored and resolvable by ID--### Requirement: Variable collections and modes-SceneGraph SHALL support variable collections with multiple modes (e.g., Light/Dark). Each collection has an activeMode. Mode switching changes which values are resolved for variables in that collection.--#### Scenario: Switch mode-- **WHEN** a collection has Light and Dark modes and activeMode is switched to Dark-- **THEN** resolveVariable returns the Dark mode value for variables in that collection--### Requirement: Variable alias resolution-Variables SHALL support alias values ({ aliasId: string }) that reference other variables. Resolution follows the alias chain. Circular aliases SHALL be detected and return undefined (no infinite loop).--#### Scenario: Alias chain-- **WHEN** variable A aliases variable B which has value 42-- **THEN** resolving A returns 42--#### Scenario: Circular alias-- **WHEN** variable A aliases B and B aliases A-- **THEN** resolving A returns undefined--### Requirement: Variable binding to node properties-SceneGraph SHALL support binding variables to node properties via bindVariable(nodeId, field, variableId). Bound fields are stored in the node's variableBindings record. unbindVariable removes a binding.--#### Scenario: Bind color variable to fill-- **WHEN** a COLOR variable is bound to a node's fill-- **THEN** the node's variableBindings record contains the binding--### Requirement: Variable import from .fig files-The .fig import pipeline SHALL parse VARIABLE type NodeChanges and extract paint variable bindings (fills/strokes), creating corresponding Variable and VariableCollection objects in the scene graph.--#### Scenario: Import .fig with variables-- **WHEN** a .fig file containing color variables and paint bindings is imported-- **THEN** the variables, collections, and bindings are restored in the scene graph--### Requirement: Variable removal cleans up bindings-Removing a variable SHALL clean up all bindings referencing it across all nodes.--#### Scenario: Remove variable with bindings-- **WHEN** a variable bound to three nodes is removed-- **THEN** all three nodes' variableBindings no longer reference that variable--### Requirement: StyleRun model-SceneNode SHALL support a `styleRuns` array of `{start, length, style}` where style is CharacterStyleOverride (fontWeight, italic, textDecoration). The scene graph SHALL provide helpers to apply/toggle styles on ranges and adjust runs on insert/delete.--#### Scenario: Apply bold to range-- **WHEN** applyStyleToRange is called with fontWeight 700 on characters 6–11-- **THEN** the styleRuns array contains a run for that range with fontWeight 700--### Requirement: JSX renderer-@open-pencil/core SHALL export TreeNode builder functions (Frame, Text, Rectangle, Ellipse, etc.) and two rendering paths: renderTreeNode() (tree → scene graph, no deps) and renderJsx() (JSX string → esbuild → tree → scene graph, for CLI/headless). Builder functions SHALL accept Tailwind-like shorthand props: w, h, bg, rounded, flex, gap, p/px/py, justify, items, shadow, blur.--#### Scenario: Build tree from functions-- **WHEN** Frame({w: 200, h: 100, bg: '#f00'}, [Text({children: 'Hello'})]) is called-- **THEN** a TreeNode with type FRAME, width 200, height 100, and red fill is created with a TEXT child--#### Scenario: Render JSX string-- **WHEN** renderJsx('<Frame w={100}><Text>Hi</Text></Frame>') is called-- **THEN** a scene graph with a FRAME parent and TEXT child is produced--### Requirement: Scene node to JSX export-@open-pencil/core SHALL export a sceneNodeToJsx() function that converts a SceneNode subtree into JSX string using builder function syntax (Frame, Text, Rectangle, etc.) with Tailwind-like shorthand props. The output is valid JSX consumable by renderJsx().--#### Scenario: Export frame with children-- **WHEN** sceneNodeToJsx is called on a frame with a rectangle and text child-- **THEN** a JSX string with Frame wrapping Rectangle and Text is returned--#### Scenario: Export with effects-- **WHEN** sceneNodeToJsx is called on a node with drop shadow-- **THEN** the JSX includes shadow props in the outputdiff --git a/openspec/specs/scrub-input/spec.md b/openspec/specs/scrub-input/spec.mddeleted file mode 100644index 7cb89e747..000000000--- a/openspec/specs/scrub-input/spec.md+++ /dev/null@@ -1,40 +0,0 @@-# scrub-input Specification--## Purpose-Drag-to-scrub numeric input component. Replaces plain number inputs across all property panel sections with drag-to-adjust, click-to-edit, and suffix display capabilities.-## Requirements-### Requirement: Drag-to-scrub numeric input-The ScrubInput component SHALL allow users to drag anywhere on the input field to scrub (adjust) the numeric value. The entire field area SHALL be draggable.--#### Scenario: Drag to increase value-- **WHEN** user clicks and drags right on a ScrubInput with value 100-- **THEN** the value increases proportionally to the drag distance--### Requirement: Click-to-edit mode-Clicking (without dragging) a ScrubInput SHALL enter direct text editing mode where the user can type a numeric value.--#### Scenario: Click to type-- **WHEN** user clicks a ScrubInput without dragging-- **THEN** the input becomes editable and accepts keyboard input--### Requirement: Suffix styling-ScrubInput SHALL support a visual suffix (e.g., "°", "px", "%") displayed after the value.--#### Scenario: Display suffix-- **WHEN** a ScrubInput has suffix "°" and value 45-- **THEN** the input displays "45°"--### Requirement: Used across all numeric properties-ScrubInput SHALL replace plain number inputs in all property panel sections (position, size, rotation, opacity, corner radius, gap, padding, font size, stroke weight).--#### Scenario: Position input uses ScrubInput-- **WHEN** the Position section renders X and Y inputs-- **THEN** they are ScrubInput components with drag-to-scrub behavior--### Requirement: Scrub label hit area-The clickable/draggable area of the scrub label SHALL be properly sized to avoid missing clicks.--#### Scenario: Reliable click target-- **WHEN** user clicks on the scrub label text-- **THEN** the click is registered and scrub mode activates-diff --git a/openspec/specs/selection-manipulation/spec.md b/openspec/specs/selection-manipulation/spec.mddeleted file mode 100644index e92a9e436..000000000--- a/openspec/specs/selection-manipulation/spec.md+++ /dev/null@@ -1,128 +0,0 @@-# selection-manipulation Specification--## Purpose-Node selection and direct manipulation. Click/shift/marquee select, move by drag, resize handles, rotation with snapping, duplicate, nudge, delete, and select-all.-## Requirements-### Requirement: Click to select-Clicking on a node SHALL select it (deselecting all others). Clicking empty canvas SHALL deselect all.--#### Scenario: Select a single node-- **WHEN** user clicks on a rectangle-- **THEN** the rectangle is selected and all other nodes are deselected--### Requirement: Multi-select with shift-Shift+clicking a node SHALL toggle it in the current selection.--#### Scenario: Add to selection-- **WHEN** user shift+clicks a second node while one is already selected-- **THEN** both nodes are in the selection--### Requirement: Marquee selection-Dragging on empty canvas SHALL create a selection rectangle. All nodes intersecting the rectangle SHALL be selected on release.--#### Scenario: Marquee drag-- **WHEN** user drags from empty canvas across three nodes-- **THEN** all three nodes are selected when the drag ends--### Requirement: Move by dragging-Dragging a selected node SHALL move it (and all other selected nodes) by the drag delta.--#### Scenario: Drag to move-- **WHEN** user drags a selected node by 50px right-- **THEN** the node's X position increases by 50--### Requirement: Resize handles-Selected nodes SHALL display 8 resize handles (4 corners + 4 edge midpoints). Dragging a handle SHALL resize the node. Shift constrains proportions.--#### Scenario: Resize from corner-- **WHEN** user drags the bottom-right corner handle outward-- **THEN** the node's width and height increase--### Requirement: Rotation-Hovering just outside a corner handle SHALL show a rotation cursor. Dragging SHALL rotate the node. Shift SHALL snap to 15° increments.--#### Scenario: Rotate with snap-- **WHEN** user drags the rotation handle while holding shift-- **THEN** the rotation snaps to the nearest 15° increment--### Requirement: Duplicate-Alt+drag SHALL duplicate the selected node and move the duplicate. ⌘D SHALL duplicate in place.--#### Scenario: Alt+drag duplicate-- **WHEN** user alt+drags a selected rectangle-- **THEN** a copy of the rectangle is created at the drag position--### Requirement: Constrained drawing-Holding shift while drawing a shape SHALL constrain to square/circle.--#### Scenario: Shift+drag rectangle-- **WHEN** user draws a rectangle while holding shift-- **THEN** the rectangle is constrained to a square (equal width and height)--### Requirement: Nudge with arrows-Arrow keys SHALL move selected nodes by 1px. Shift+arrow SHALL move by 10px.--#### Scenario: Arrow nudge-- **WHEN** user presses the right arrow key with a node selected-- **THEN** the node moves 1px to the right--### Requirement: Delete selection-Backspace/Delete SHALL remove all selected nodes.--#### Scenario: Delete node-- **WHEN** user presses backspace with a node selected-- **THEN** the node is removed from the scene graph--### Requirement: Select all-⌘A SHALL select all nodes on the current canvas.--#### Scenario: Select all-- **WHEN** user presses ⌘A-- **THEN** all nodes on the canvas are selected--### Requirement: Section creation with auto-adopt-Creating a section on the canvas SHALL automatically reparent overlapping sibling nodes into the section. Only nodes fully or partially within the section bounds are adopted.--#### Scenario: Draw section over existing nodes-- **WHEN** user draws a section that overlaps two rectangles-- **THEN** the two rectangles become children of the new section---### Requirement: Z-order manipulation-The editor SHALL support bringing selected nodes to front (]) and sending to back ([). Bring to front moves node to end of parent's childIds; send to back moves to start.--#### Scenario: Bring to front-- **WHEN** user selects a node and presses ]-- **THEN** the node moves to the top of its sibling z-order--#### Scenario: Send to back-- **WHEN** user selects a node and presses [-- **THEN** the node moves to the bottom of its sibling z-order--### Requirement: Toggle visibility-The editor SHALL support toggling node visibility (⇧⌘H). Hidden nodes are not rendered but remain in the scene graph and layers panel.--#### Scenario: Hide node-- **WHEN** user selects a visible node and presses ⇧⌘H-- **THEN** the node's `visible` property becomes false--### Requirement: Toggle lock-The editor SHALL support toggling node lock state (⇧⌘L). Locked nodes cannot be selected or moved via canvas interaction.--#### Scenario: Lock node-- **WHEN** user selects a node and presses ⇧⌘L-- **THEN** the node's `locked` property becomes true--### Requirement: Move to page-The editor SHALL support moving selected nodes to a different page, reparenting them under the target page's CANVAS node.--#### Scenario: Move selection to another page-- **WHEN** user moves a node to Page 2 via context menu-- **THEN** the node is reparented under Page 2's CANVAS node and removed from the current page--### Requirement: Rename node-The editor SHALL support renaming nodes programmatically via `renameNode(id, name)`.--#### Scenario: Rename a layer-- **WHEN** `renameNode` is called with a new name-- **THEN** the node's name property is updateddiff --git a/openspec/specs/shared-color-utils/spec.md b/openspec/specs/shared-color-utils/spec.mddeleted file mode 100644index ab610fef2..000000000--- a/openspec/specs/shared-color-utils/spec.md+++ /dev/null@@ -1,12 +0,0 @@-## ADDED Requirements--### Requirement: colorToCSS exported from core-The `colorToCSS` function SHALL be exported from `packages/core/src/color.ts` and compose with the existing `colorToRgba255` helper. It SHALL convert a `Color` value to a CSS `rgb(r, g, b)` string.--#### Scenario: Converts color to CSS string-- **WHEN** `colorToCSS({ r: 0.96, g: 0.26, b: 0.21, a: 1 })` is called-- **THEN** it returns `"rgb(245, 66, 54)"`--#### Scenario: Available as named import from core-- **WHEN** consumer writes `import { colorToCSS } from '@open-pencil/core'`-- **THEN** the import resolves without error and the function works as expecteddiff --git a/openspec/specs/shared-text-utils/spec.md b/openspec/specs/shared-text-utils/spec.mddeleted file mode 100644index a98bef08e..000000000--- a/openspec/specs/shared-text-utils/spec.md+++ /dev/null@@ -1,16 +0,0 @@-## ADDED Requirements--### Requirement: initials utility in src/utils/text.ts-The `initials` function SHALL be exported from `src/utils/text.ts`. It SHALL take a name string and return up to 2 uppercase initials, falling back to `"?"` for empty input.--#### Scenario: Two-word name-- **WHEN** `initials("John Doe")` is called-- **THEN** it returns `"JD"`--#### Scenario: Single word-- **WHEN** `initials("Alice")` is called-- **THEN** it returns `"A"`--#### Scenario: Empty string fallback-- **WHEN** `initials("")` is called-- **THEN** it returns `"?"`diff --git a/openspec/specs/snap-guides/spec.md b/openspec/specs/snap-guides/spec.mddeleted file mode 100644index b311aad96..000000000--- a/openspec/specs/snap-guides/spec.md+++ /dev/null@@ -1,30 +0,0 @@-# snap-guides Specification--## Purpose-Smart alignment guides during node manipulation. Edge and center snapping with rotation-aware bounding boxes, using sibling nodes in absolute canvas coordinates.-## Requirements-### Requirement: Edge and center snapping-When moving or resizing nodes, snap guides SHALL appear when edges or centers align with sibling nodes (±1px threshold).--#### Scenario: Horizontal edge snap-- **WHEN** user drags a node and its left edge aligns with another node's left edge-- **THEN** a red vertical snap guide line appears at the aligned X coordinate--#### Scenario: Center snap-- **WHEN** user drags a node and its horizontal center aligns with another node's center-- **THEN** a red snap guide line appears at the center coordinate--### Requirement: Rotation-aware snap guides-Snap guides SHALL use rotation-aware bounding boxes. Snap calculations SHALL work correctly for rotated nodes.--#### Scenario: Snap rotated node-- **WHEN** a rotated node is moved near an unrotated node-- **THEN** snap guides align to the rotated node's actual visual bounds--### Requirement: Sibling-based absolute coordinates-Snap guide calculations SHALL use sibling nodes in absolute (canvas) coordinates, not parent-relative coordinates.--#### Scenario: Snap across nesting levels-- **WHEN** a node inside a frame is moved near a node outside the frame-- **THEN** snap guides correctly compare positions in absolute canvas coordinates-diff --git a/openspec/specs/testing/spec.md b/openspec/specs/testing/spec.mddeleted file mode 100644index b9426d0ce..000000000--- a/openspec/specs/testing/spec.md+++ /dev/null@@ -1,384 +0,0 @@-# testing Specification--## Purpose-Test infrastructure. Playwright visual regression (E2E with Figma CDP reference), bun:test unit tests, no-chrome test mode, data-ready synchronization, and page reuse optimization.-## Requirements-### Requirement: Playwright visual regression testing-E2E tests SHALL use Playwright to create shapes and compare screenshots against baseline snapshots.--#### Scenario: Visual regression test pass-- **WHEN** `bun run test` is executed-- **THEN** Playwright tests create shapes, take screenshots, and compare against baseline PNGs--### Requirement: Figma CDP reference tests-A separate Playwright project SHALL connect to Figma via Chrome DevTools Protocol (CDP) to capture reference screenshots for pixel-perfect comparison.--#### Scenario: Figma reference capture-- **WHEN** `bun run test:figma` is executed with Figma running in debug mode-- **THEN** Playwright connects to Figma via CDP and captures reference screenshots--### Requirement: No-chrome test mode-The editor SHALL support a test mode (activated via URL param or environment) that hides Chrome/UI elements for clean screenshot capture.--#### Scenario: Test mode rendering-- **WHEN** the editor loads in test mode-- **THEN** only canvas content is rendered, without toolbar, panels, or other UI chrome--### Requirement: Data-ready optimization-The editor SHALL signal readiness via a `data-ready` attribute for E2E test synchronization, replacing unreliable timeouts.--#### Scenario: Wait for ready-- **WHEN** a Playwright test waits for the data-ready attribute-- **THEN** it proceeds only when the canvas is fully rendered--### Requirement: Page reuse for speed-E2E tests SHALL reuse the browser page across test cases to minimize overhead. Target: all E2E tests complete in <3s.--#### Scenario: Fast E2E execution-- **WHEN** the full E2E test suite runs-- **THEN** it completes in under 3 seconds by reusing the page--### Requirement: bun:test unit tests-Engine unit tests SHALL use bun:test and complete in <50ms.--#### Scenario: Unit test speed-- **WHEN** `bun test ./tests/engine` is run-- **THEN** all unit tests pass in under 50ms--### Requirement: Fig-import unit tests-Unit tests SHALL verify the .fig import pipeline: node type mapping, transform extraction, fill/stroke/effect import, gradient stops, image fills, arc data, stroke properties, and nested frame hierarchies.--#### Scenario: Run fig-import tests-- **WHEN** `bun test ./tests/engine/fig-import.test.ts` is executed-- **THEN** all import pipeline tests pass covering tier 1 rendering features--### Requirement: Layout unit tests-Unit tests SHALL verify Yoga auto-layout computation: direction, gap, padding, justify, align, child sizing (fixed/fill/hug), cross-axis sizing, wrap, and nested layouts.--#### Scenario: Run layout tests-- **WHEN** `bun test ./tests/engine/layout.test.ts` is executed-- **THEN** all layout computation tests pass--### Requirement: Layers panel E2E tests-E2E tests SHALL verify the layers panel: node visibility in tree, expand/collapse frames, selection sync between canvas and layers panel. Test fixtures match current demo shapes (Components, App Preview).--#### Scenario: Run layers panel E2E-- **WHEN** the layers panel E2E tests run-- **THEN** all tests pass verifying tree structure, visibility toggles, and selection sync with updated demo shape names--### Requirement: Component-instance sync unit tests-Unit tests SHALL cover the component-instance sync lifecycle: instance creation with `componentId` mapping on children, sync propagation of property changes, override preservation during sync, new child addition to instances, and detach breaking the link.--#### Scenario: Instance child mapping test-- **WHEN** `bun test ./tests/engine/scene-graph.test.ts` runs-- **THEN** the test verifies instance children have `componentId` pointing to component children--#### Scenario: Sync propagation test-- **WHEN** a component's text child changes and sync is triggered-- **THEN** the test verifies instance children receive the updated text and fontSize--#### Scenario: Override preservation test-- **WHEN** an instance child has an overridden text value-- **THEN** the test verifies the override is preserved while non-overridden properties sync--#### Scenario: New child addition test-- **WHEN** a new child is added to a component and sync runs-- **THEN** the test verifies existing instances gain the new child--#### Scenario: Detach test-- **WHEN** an instance is detached-- **THEN** the test verifies type becomes FRAME, componentId is null, and the component's instance list no longer includes it--### Requirement: Variable system unit tests-Unit tests SHALL cover the variables system: add and resolve color/number variables, alias chain resolution, circular alias detection (returns undefined), mode switching, bind/unbind to nodes, and variable removal cleanup. Total: 7 variable tests in a "Variables" describe block.--#### Scenario: Variable tests pass-- **WHEN** `bun test ./tests/engine` is run-- **THEN** all variable tests pass (add/resolve color, resolve number, alias chain, circular alias, mode switching, bind/unbind, removal cleanup)--### Requirement: .fig roundtrip tests-The test suite SHALL include roundtrip tests for real .fig files: parsing property invariants, encode/decode cycle fidelity. Test fixtures (material3.fig, nuxtui.fig) SHALL be tracked via Git LFS.--#### Scenario: Roundtrip encode/decode-- **WHEN** a .fig file is parsed and re-encoded-- **THEN** the re-encoded data decodes to the same node properties--#### Scenario: Property invariants-- **WHEN** a real .fig file is parsed-- **THEN** all nodes have valid types, dimensions ≥ 0, and required fields present--### Requirement: .fig import performance-The .fig import pipeline SHALL avoid O(n²) child resolution. A children index SHALL be built upfront for linear-time lookups.--#### Scenario: Large file import speed-- **WHEN** material3.fig (87K nodes) is imported-- **THEN** parsing completes in under 2 seconds (was 37s before fix)--### Requirement: JSX renderer tests-The test suite SHALL include tests for the JSX renderer covering all node types (Frame, Text, Rectangle, Ellipse, etc.), layout props, effects, and nesting. Currently 27 tests.--#### Scenario: Render Frame with children-- **WHEN** a JSX tree with Frame containing Rectangle and Text is rendered-- **THEN** the scene graph contains correct parent-child relationships and properties--### Requirement: AI chat Playwright tests-The test suite SHALL include Playwright e2e tests for the AI chat panel with mock transport (no real LLM calls). Tests cover: sending a message, receiving a response, tool call display. Real LLM tests available via TEST_REAL_LLM=1 flag.--#### Scenario: Chat with mock transport-- **WHEN** a Playwright test sends a message via the chat input-- **THEN** the mock transport returns a response and the message appears in the chat--### Requirement: JSX export tests-The test suite SHALL include tests for sceneNodeToJsx() covering shapes, text, layout props, effects, and multi-selection. Currently 14 tests.--#### Scenario: Export rectangle to JSX-- **WHEN** sceneNodeToJsx is called on a rectangle with blue fill-- **THEN** the output includes Rectangle component with bg prop---### Requirement: FigmaAPI unit tests--The project SHALL provide comprehensive unit tests for the Figma Plugin API in `tests/engine/figma-api.test.ts`.--#### Scenario: Node creation tests-- **WHEN** `bun test tests/engine/figma-api.test.ts` runs-- **THEN** tests verify `createFrame()`, `createRectangle()`, `createText()`, and other creation methods--#### Scenario: Property access tests-- **WHEN** tests read node properties (x, y, width, height, name, fills, strokes)-- **THEN** all getters return correct values from SceneNode--#### Scenario: Property setting tests-- **WHEN** tests set node properties (`node.name = "Test"`, `node.x = 100`)-- **THEN** SceneGraph is updated correctly--#### Scenario: Text property tests-- **WHEN** tests access `textNode.characters`, `fontSize`, `fontName`-- **THEN** text-specific properties work correctly--#### Scenario: Auto-layout tests-- **WHEN** tests set `layoutMode = "VERTICAL"`, `itemSpacing`, `paddingLeft`-- **THEN** auto-layout properties are applied--#### Scenario: Tree operation tests-- **WHEN** tests call `appendChild()`, `insertChild()`, `remove()`-- **THEN** scene graph tree is modified correctly--#### Scenario: Traversal tests-- **WHEN** tests call `findAll()`, `findOne()`, `findAllWithCriteria()`-- **THEN** correct nodes are returned--#### Scenario: Component tests-- **WHEN** tests create components and instances-- **THEN** component-instance relationships work--#### Scenario: Serialization tests-- **WHEN** tests call `figma.toJSON(node)`-- **THEN** JSON output includes all required properties--#### Scenario: Frozen array tests-- **WHEN** tests access `fills`, `strokes`, `children` and try to mutate-- **THEN** arrays are frozen and throw errors on mutation attempts--#### Scenario: 924 LOC of tests-- **WHEN** FigmaAPI test file is counted-- **THEN** it contains 924 lines covering 60+ test cases--### Requirement: Eval CLI integration tests--The project SHALL provide integration tests for eval command in `tests/engine/eval-cli.test.ts`.--#### Scenario: Inline code execution test-- **WHEN** test runs eval with `--code 'return figma.currentPage.id'`-- **THEN** output matches expected page ID--#### Scenario: Node creation test-- **WHEN** test runs eval creating a frame-- **THEN** document is modified and frame exists--#### Scenario: Write flag test-- **WHEN** test runs eval with `--write`-- **THEN** file is modified in-place--#### Scenario: Output file test-- **WHEN** test runs eval with `-o output.fig`-- **THEN** new file is created with modifications--#### Scenario: JSON output test-- **WHEN** test runs eval with `--json`-- **THEN** result is formatted as JSON--#### Scenario: Error handling test-- **WHEN** eval code throws error-- **THEN** stderr contains error message--#### Scenario: 202 LOC of integration tests-- **WHEN** eval CLI test file is counted-- **THEN** it contains 202 lines covering 17 integration scenarios--### Requirement: Tool schema unit tests--The project SHALL provide unit tests for unified tool definitions in `tests/engine/tools.test.ts`.--#### Scenario: Schema structure tests-- **WHEN** tests validate tool schemas-- **THEN** each tool has name, description, parameters, and handler--#### Scenario: Tool handler tests-- **WHEN** tests invoke tool handlers with valid params-- **THEN** handlers return expected results--#### Scenario: Parameter validation tests-- **WHEN** tests call handlers with invalid params-- **THEN** errors are raised or handled gracefully--#### Scenario: 390 LOC of tool tests-- **WHEN** tools test file is counted-- **THEN** it contains 390 lines--### Requirement: Tool adapter tests--The project SHALL provide adapter tests in `tests/engine/tools-ai-adapter.test.ts` (190 LOC) and `tests/engine/tools-cli.test.ts` (219 LOC).--#### Scenario: AI adapter format test-- **WHEN** AI adapter converts schema to LLM format-- **THEN** output matches expected structure--#### Scenario: CLI adapter test-- **WHEN** CLI commands use tool schema-- **THEN** parameters map correctly--### Requirement: App menu integration tests--The project SHALL provide integration tests for app menu in `tests/e2e/app-menu.spec.ts`.--#### Scenario: File menu test-- **WHEN** test clicks File menu items-- **THEN** actions (Open, Save, Export) are triggered--#### Scenario: Edit menu test-- **WHEN** test uses Edit menu (Undo, Redo, Copy, Paste)-- **THEN** operations execute correctly--#### Scenario: View menu test-- **WHEN** test uses View → Zoom in/out-- **THEN** viewport zoom changes--#### Scenario: Object menu test-- **WHEN** test uses Object → Group/Ungroup-- **THEN** nodes are grouped/ungrouped--#### Scenario: Text menu test-- **WHEN** test uses Text → Bold/Italic-- **THEN** text styles are applied--#### Scenario: Arrange menu test-- **WHEN** test uses Arrange → Bring to front-- **THEN** z-order changes--#### Scenario: 131 LOC of app menu tests-- **WHEN** app menu test file is counted-- **THEN** it contains 131 lines--### Requirement: Autosave integration tests--The project SHALL provide integration tests for autosave in `tests/e2e/autosave.spec.ts`.--#### Scenario: Autosave trigger test-- **WHEN** test modifies scene graph-- **THEN** autosave timer starts--#### Scenario: Debounce test-- **WHEN** test makes rapid changes-- **THEN** only one save occurs after 3 seconds--#### Scenario: Write test-- **WHEN** autosave timer expires-- **THEN** file is written--#### Scenario: Skip unchanged test-- **WHEN** sceneVersion matches savedVersion-- **THEN** write is skipped--#### Scenario: 113 LOC of autosave tests-- **WHEN** autosave test file is counted-- **THEN** it contains 113 lines--### Requirement: Test coverage expansion--The test suite SHALL expand from original coverage to include 2571 LOC of new tests across 7 files (figma-api.test.ts, eval-cli.test.ts, tools.test.ts, tools-ai-adapter.test.ts, tools-cli.test.ts, app-menu.spec.ts, autosave.spec.ts).--#### Scenario: Total new test lines-- **WHEN** new test files are counted-- **THEN** 2571 lines of tests are added--### Requirement: Canvas manipulation E2E tests-The E2E suite SHALL include tests for `tests/e2e/canvas-manipulation.spec.ts` covering: marquee selection, resize handle drag, rotation handle drag, Alt+drag duplicate, Shift+Arrow nudge (10px), and hover highlight (visual screenshot comparison).--#### Scenario: Canvas manipulation tests pass-- **WHEN** `bun run test` executes `canvas-manipulation.spec.ts`-- **THEN** all 6+ tests pass verifying selection, resize, rotation, duplicate, nudge, and hover--### Requirement: Toolbar E2E tests-The E2E suite SHALL include tests for `tests/e2e/toolbar.spec.ts` covering: shapes flyout chevron, Polygon tool, Star tool, Pen tool (corner, close path, Escape), and Frame flyout.--#### Scenario: Toolbar tests pass-- **WHEN** `bun run test` executes `toolbar.spec.ts`-- **THEN** all 7+ tests pass verifying flyout menus and shape creation--### Requirement: Properties panel E2E tests-The E2E suite SHALL include tests for `tests/e2e/properties-panel.spec.ts` covering: ScrubInput drag, corner radius (uniform + independent), fill gradient switch, variable bind badge, alignment buttons, flip horizontal, and clip content checkbox.--#### Scenario: Properties panel tests pass-- **WHEN** `bun run test` executes `properties-panel.spec.ts`-- **THEN** all 8+ tests pass verifying property changes via store assertions--### Requirement: Text formatting E2E tests-The E2E suite SHALL include tests for `tests/e2e/text-formatting.spec.ts` covering: cursor positioning, double-click word select, ⌘B bold, ⌘I italic, Alt+ArrowRight word navigation, and Bold button in typography section.--#### Scenario: Text formatting tests pass-- **WHEN** `bun run test` executes `text-formatting.spec.ts`-- **THEN** all 6+ tests pass verifying text edit interactions--### Requirement: Auto-layout E2E tests-The E2E suite SHALL include tests for `tests/e2e/auto-layout.spec.ts` covering: Shift+A on selection, direction toggle, gap ScrubInput, uniform padding, alignment grid, and remove auto-layout.--#### Scenario: Auto-layout tests pass-- **WHEN** `bun run test` executes `auto-layout.spec.ts`-- **THEN** all 6+ tests pass verifying auto-layout frame state via store--### Requirement: Snap guides E2E tests-The E2E suite SHALL include tests for `tests/e2e/snap-guides.spec.ts` covering: edge snap guide and center snap guide, both verified via screenshot comparison.--#### Scenario: Snap guide tests pass-- **WHEN** `bun run test` executes `snap-guides.spec.ts`-- **THEN** 2 screenshot comparison tests pass confirming guide line visibility--### Requirement: Panel resize E2E tests-The E2E suite SHALL include tests for `tests/e2e/panels.spec.ts` covering: left panel drag resize, width persistence after reload, and ⌘\\ UI toggle (hide + show).--#### Scenario: Panel tests pass-- **WHEN** `bun run test` executes `panels.spec.ts`-- **THEN** all 4+ tests pass verifying panel DOM dimensions and visibility--### Requirement: Variables dialog E2E tests-The E2E suite SHALL include tests for `tests/e2e/variables-dialog.spec.ts` covering: dialog open, search filter, cell edit, and color swatch picker.--#### Scenario: Variables dialog tests pass-- **WHEN** `bun run test` executes `variables-dialog.spec.ts`-- **THEN** all 4+ tests pass verifying dialog interactions--### Requirement: Export E2E tests-The E2E suite SHALL include tests for `tests/e2e/export.spec.ts` covering: format selector, add/remove rows, preview toggle, and SVG hiding scale input.--#### Scenario: Export tests pass-- **WHEN** `bun run test` executes `export.spec.ts`-- **THEN** all 5+ tests pass verifying export section UI state--### Requirement: CanvasHelper extended helpers-The `CanvasHelper` class SHALL provide `marquee()`, `hover()`, `dragScrubInput()`, and `shiftDrag()` helper methods usable across all spec files.--#### Scenario: Helpers available in all specs-- **WHEN** a spec file imports `CanvasHelper`-- **THEN** `canvas.marquee()`, `canvas.hover()`, `canvas.dragScrubInput()`, and `canvas.shiftDrag()` are callable without TypeScript errors-diff --git a/openspec/specs/text-editing/spec.md b/openspec/specs/text-editing/spec.mddeleted file mode 100644index a8033c5bc..000000000--- a/openspec/specs/text-editing/spec.md+++ /dev/null@@ -1,146 +0,0 @@-# text-editing Specification--## Purpose-Text creation and canvas-native inline editing. Text tool (T), TextEditor class in core (cursor, selection, word boundaries, line navigation via CanvasKit Paragraph API), phantom textarea for input capture, font loading (Inter default + system fonts via font-kit in Tauri / Local Font Access API in browser), font picker with virtual scroll and CSS preview.--## Requirements--### Requirement: Text tool creates text nodes-Pressing T SHALL activate the text tool. Clicking on canvas SHALL create a new empty text node with cursor blinking.--#### Scenario: Create text node-- **WHEN** user presses T and clicks on the canvas-- **THEN** an empty text node is created at the click position with a visible cursor--### Requirement: Inline text editing-Double-clicking a text node SHALL enter canvas-native inline editing mode. A hidden phantom textarea (positioned off-screen, opacity 0) SHALL capture keyboard input, IME composition, and clipboard events. The canvas SHALL render the text directly using CanvasKit Paragraph API — no visible textarea overlay.--#### Scenario: Enter edit mode-- **WHEN** user double-clicks a text node-- **THEN** a phantom textarea is created off-screen and focused, the canvas renders text with a blinking caret--#### Scenario: IME composition-- **WHEN** user enters IME composition during text editing-- **THEN** the phantom textarea handles compositionstart/compositionend events and the composed text is inserted into the TextEditor--### Requirement: TextEditor class in core-A TextEditor class SHALL live in packages/core/src/text-editor.ts providing cursor positioning, text selection, word boundary detection, and line navigation using CanvasKit Paragraph API (getGlyphPositionAtCoordinate, getRectsForRange, getLineMetrics). It SHALL support: insert, backspace, delete, select all, select word, selectLine, selectLineAt, move left/right/up/down, move to line start/end, move word left/right, and extend selection with Shift.--#### Scenario: Cursor positioning-- **WHEN** user clicks inside a text node during editing-- **THEN** the cursor moves to the glyph position nearest to the click coordinates--#### Scenario: Word selection-- **WHEN** user double-clicks a word during text editing-- **THEN** the word is selected (from word boundary to word boundary)--#### Scenario: Line selection-- **WHEN** selectLineAt is called at a position within line 2-- **THEN** the entire second line is selected--#### Scenario: Line navigation-- **WHEN** user presses ⌘← during text editing-- **THEN** the cursor moves to the start of the current line--### Requirement: Text editing keyboard navigation-The phantom textarea SHALL handle keyboard navigation with modifier support: ⌥← / ⌥→ (word movement), ⌘← / ⌘→ (line start/end), ⌘⌫ (delete to line start), ⌥⌫ (delete word), Shift extends selection for all movement keys. Cut (⌘X), Copy (⌘C), Paste (⌘V) SHALL use navigator.clipboard API.--#### Scenario: Word-level backspace-- **WHEN** user presses ⌥⌫ during text editing-- **THEN** the word before the cursor is deleted--#### Scenario: Copy selection-- **WHEN** user selects text and presses ⌘C-- **THEN** the selected text is copied to the clipboard--### Requirement: Text selection via mouse drag-Clicking inside a text node during editing SHALL position the cursor. Dragging SHALL extend the selection. Double-click SHALL select the word at click position. Triple-click SHALL select all text. Clicking outside the text node bounds SHALL commit the edit and exit editing mode.--#### Scenario: Drag to select-- **WHEN** user clicks and drags inside a text node during editing-- **THEN** the text between click start and current position is selected--#### Scenario: Double-click selects word-- **WHEN** user double-clicks on "world" in "Hello world" during editing-- **THEN** "world" is selected--#### Scenario: Triple-click selects all-- **WHEN** user triple-clicks inside a text node during editing-- **THEN** all text is selected--#### Scenario: Click outside commits-- **WHEN** user clicks outside the editing text node-- **THEN** the text edit is committed and editing mode exits--### Requirement: CanvasKit Paragraph API rendering-Text nodes SHALL be rendered using CanvasKit's Paragraph API for proper text shaping, line breaking, and font metrics.--#### Scenario: Multi-line text wrapping-- **WHEN** a text node with a fixed width contains text longer than the width-- **THEN** the text wraps to multiple lines using Paragraph API layout--### Requirement: Font loading-The editor SHALL load Inter as the default font. In Tauri, system fonts SHALL be enumerated and loaded via Rust commands (list_system_fonts, load_system_font) using the font-kit crate. In browser, the Local Font Access API SHALL be used when available. Font list SHALL be preloaded on app startup (cached via OnceLock in Rust) so the picker is ready instantly.--#### Scenario: Default font-- **WHEN** a text node is created without specifying a font-- **THEN** the Inter font is used for rendering--#### Scenario: System fonts via Tauri-- **WHEN** the app runs as a Tauri desktop app-- **THEN** system fonts are enumerated via the font-kit Rust command and loaded via invoke()--#### Scenario: System fonts via browser-- **WHEN** the app runs in a browser with Local Font Access API-- **THEN** system fonts are enumerated via queryLocalFonts--#### Scenario: Font preloading-- **WHEN** the app starts-- **THEN** the font list is preloaded so the font picker opens without delay--### Requirement: Font picker component-A FontPicker component SHALL provide font family selection with: reka-ui Listbox with virtual scroll (ListboxVirtualizer), search filter (ListboxFilter), CSS font preview (each row rendered in the font itself), and scroll-to-current behavior. Font faces are registered for CSS preview via registerFontFaces.--#### Scenario: Font picker search-- **WHEN** user types "Mono" in the font picker search-- **THEN** only font families containing "Mono" are shown--#### Scenario: Font preview-- **WHEN** user opens the font picker-- **THEN** each font family name is displayed in its own font face--### Requirement: Font weight support-Font weight SHALL be applied to the CanvasKit text style during rendering.--#### Scenario: Bold text rendering-- **WHEN** a text node has fontWeight 700-- **THEN** the canvas rendering displays bold text--### Requirement: Blue editing outline-A blue outline SHALL appear around a text node during editing to indicate edit mode.--#### Scenario: Edit mode indicator-- **WHEN** user is editing a text node inline-- **THEN** a blue outline is visible around the text node bounds--### Requirement: Rich text style runs-Text nodes SHALL support per-character formatting via StyleRun arrays: `{start, length, style}` where style includes fontWeight, italic (boolean), and textDecoration (UNDERLINE, STRIKETHROUGH). ⌘B toggles bold, ⌘I toggles italic, ⌘U toggles underline on the current selection. With no selection, the shortcut toggles the whole-node style. Style runs adjust on insert/delete to preserve formatting.--#### Scenario: Bold selection-- **WHEN** user selects "world" in "Hello world" and presses ⌘B-- **THEN** the word "world" renders bold while "Hello " stays regular--#### Scenario: Toggle italic on whole node-- **WHEN** user presses ⌘I with no text selected in a text node-- **THEN** the entire text node toggles italic--#### Scenario: Style preservation on insert-- **WHEN** user types "X" between a bold and regular segment-- **THEN** the inserted character inherits the style of the preceding segment and run boundaries adjust--### Requirement: .fig roundtrip for style runs-The .fig import SHALL parse characterStyleIDs and styleOverrideTable from TextData into StyleRun arrays. The .fig export SHALL write back with a deduped style table.--#### Scenario: Import rich text from .fig-- **WHEN** a .fig file with mixed bold/italic text is imported-- **THEN** the style runs are correctly reconstructeddiff --git a/openspec/specs/tooling/spec.md b/openspec/specs/tooling/spec.mddeleted file mode 100644index 3f450d397..000000000--- a/openspec/specs/tooling/spec.md+++ /dev/null@@ -1,221 +0,0 @@-# tooling Specification--## Purpose-Build and development tooling. Vite 7 build system, oxlint linting, oxfmt formatting, typescript-go type checking, and Tailwind CSS 4 integration.-## Requirements-### Requirement: Vite 7 build system-The project SHALL use Vite 7 as the build tool with dev server at port 1420 and HMR support. Documentation lives in `packages/docs/` as `@open-pencil/docs` workspace package with its own dev/build/preview scripts.--#### Scenario: Dev server-- **WHEN** `bun run dev` is executed-- **THEN** Vite dev server starts at http://localhost:1420 with hot module replacement--#### Scenario: Docs dev-- **WHEN** `cd packages/docs && bun run dev` is executed-- **THEN** VitePress dev server starts for the documentation site--#### Scenario: Docs build-- **WHEN** `cd packages/docs && bun run build` is executed-- **THEN** VitePress builds the documentation site to `packages/docs/.vitepress/dist/`--#### Scenario: Docs preview-- **WHEN** `cd packages/docs && bun run preview` is executed-- **THEN** a static server previews the built documentation site--### Requirement: oxlint linting-The project SHALL use oxlint for fast linting with project-specific configuration in oxlint.json.--#### Scenario: Lint check-- **WHEN** `bun run lint` is executed-- **THEN** oxlint checks src/ for issues based on oxlint.json rules--### Requirement: oxfmt formatting-The project SHALL use oxfmt for code formatting with configuration in .oxfmtrc.json.--#### Scenario: Format code-- **WHEN** `bun run format` is executed-- **THEN** oxfmt formats all files in src/ according to project rules--### Requirement: typescript-go type checking-The project SHALL use typescript-go (tsgo) for type checking via `bun run typecheck`.--#### Scenario: Type check-- **WHEN** `bun run typecheck` is executed-- **THEN** tsgo --noEmit checks all TypeScript files for type errors--### Requirement: Combined check command-`bun run check` SHALL run both lint and typecheck sequentially.--#### Scenario: Full check-- **WHEN** `bun run check` is executed-- **THEN** oxlint runs first, then tsgo, and both must pass--### Requirement: Tailwind CSS 4 integration-Tailwind CSS 4 SHALL be integrated via @tailwindcss/vite plugin.--#### Scenario: Tailwind classes work-- **WHEN** a Vue component uses Tailwind utility classes-- **THEN** the corresponding CSS is generated and applied--### Requirement: @/ import alias-The project SHALL configure a `@/` → `src/` path alias in both `vite.config.ts` (resolve.alias) and `tsconfig.json` (paths). All cross-directory imports SHALL use `@/` instead of relative `../` paths. Same-directory `./` imports are kept as-is.--#### Scenario: Import with alias-- **WHEN** a component in `src/components/` imports from `src/engine/`-- **THEN** the import uses `@/engine/` instead of `../../engine/`--### Requirement: Shared types module-Shared primitive types (Vector, Matrix, Rect) SHALL be defined in `src/types.ts` and imported across the codebase. Window API declarations (File System Access, queryLocalFonts) SHALL be in `src/global.d.ts`. Inline type duplicates SHALL be eliminated.--#### Scenario: Shared Vector type-- **WHEN** multiple files need a 2D point type-- **THEN** they import `Vector` from `@/types` instead of defining their own--### Requirement: Zero lint and type errors-The codebase SHALL maintain 0 oxlint warnings and 0 tsgo type errors. `bun run check` SHALL pass cleanly.--#### Scenario: Clean check-- **WHEN** `bun run check` is executed-- **THEN** both lint and typecheck pass with zero issues--### Requirement: Bun workspace monorepo-The project SHALL use Bun workspaces with packages: root (app), packages/core (@open-pencil/core), packages/cli (@open-pencil/cli), packages/docs (@open-pencil/docs). The workspace is configured in the root package.json. CLI is runnable via `bun open-pencil` in the workspace.--#### Scenario: Workspace packages resolve-- **WHEN** the app imports from @open-pencil/core-- **THEN** Bun resolves it to packages/core/ via workspace linking--### Requirement: npm publishing preparation-@open-pencil/core and @open-pencil/cli SHALL have proper package.json fields for npm publishing: name, version, description, exports, main, types, files, license, repository.---### Requirement: Copy-paste detection-The project SHALL use jscpd for copy-paste detection. The `bun run jscpd` command SHALL scan for duplicated code blocks.--#### Scenario: Detect duplicates-- **WHEN** `bun run jscpd` is run-- **THEN** duplicated code blocks are reported with locations and percentages--### Requirement: Kiwi serialization consolidation-Shared kiwi serialization logic (sceneNodeToKiwi, buildFigKiwi, parseFigKiwiChunks, decompressFigKiwiDataAsync) SHALL be extracted to packages/core/src/kiwi-serialize.ts. The app's src/kiwi/ SHALL re-export from core, eliminating the vendored kiwi-schema copy.--#### Scenario: Clipboard and fig-export share serialization-- **WHEN** clipboard.ts and fig-export.ts serialize nodes to kiwi-- **THEN** both use the shared kiwi-serialize.ts functions--### Requirement: Test coverage script-The project SHALL include a `test:coverage` script for measuring code coverage.--#### Scenario: Run coverage-- **WHEN** `bun run test:coverage` is run-- **THEN** test coverage metrics are reported--### Requirement: Unified tool definitions--The project SHALL define design tools once in `packages/core/src/tools/` and adapt them for AI, CLI, and MCP contexts.--#### Scenario: Canonical tool schema-- **WHEN** a new tool is added-- **THEN** it is defined in `packages/core/src/tools/schema.ts` as the single source of truth--#### Scenario: AI adapter-- **WHEN** AI assistant needs tool definitions-- **THEN** `packages/core/src/tools/ai-adapter.ts` converts schema to LLM-compatible format--#### Scenario: CLI adapter-- **WHEN** CLI commands use tools-- **THEN** citty commands consume tool schema directly--#### Scenario: MCP adapter (future)-- **WHEN** MCP server integration is added-- **THEN** MCP protocol adapter converts tool schema to MCP format--### Requirement: Tool schema structure--Tool schemas SHALL be defined in `packages/core/src/tools/schema.ts` with name, description, parameters (with types and descriptions), and handler function.--#### Scenario: Tool definition format-- **WHEN** defining a tool in schema.ts-- **THEN** structure includes `{ name, description, parameters: { <param>: { type, description } }, handler: (params) => result }`--#### Scenario: Type-safe parameters-- **WHEN** tool is invoked-- **THEN** parameters are validated against schema types--### Requirement: Deduplication of AI tools--The project SHALL eliminate duplication in `src/ai/tools.ts` by using `FigmaAPI.toJSON()` for node serialization and shared color parsing from `packages/core/src`.--#### Scenario: Node serialization-- **WHEN** AI tool returns node data-- **THEN** it uses `figmaAPI.toJSON(node)` instead of custom JSON builders--#### Scenario: Color parsing-- **WHEN** AI tool parses color input-- **THEN** it uses `parseColor()` from core instead of inline regex--#### Scenario: Code reduction-- **WHEN** AI tools are refactored-- **THEN** 311 lines are removed from `src/ai/tools.ts` via deduplication--### Requirement: Shared tool testing--The project SHALL provide test suites for tools in `tests/engine/tools.test.ts`, `tests/engine/tools-ai-adapter.test.ts`, and `tests/engine/tools-cli.test.ts`.--#### Scenario: Tool schema tests-- **WHEN** `tests/engine/tools.test.ts` runs-- **THEN** each tool schema is validated for structure and handler execution--#### Scenario: AI adapter tests-- **WHEN** `tests/engine/tools-ai-adapter.test.ts` runs-- **THEN** AI tool format conversion is verified--#### Scenario: CLI adapter tests-- **WHEN** `tests/engine/tools-cli.test.ts` runs-- **THEN** CLI command integration with tool schema is verified--### Requirement: Tool handler execution--Tool handlers SHALL receive parameters as plain objects and return structured results (success/error, data).--#### Scenario: Successful tool execution-- **WHEN** tool handler is invoked with valid params-- **THEN** it returns `{ success: true, data: <result> }`--#### Scenario: Tool execution error-- **WHEN** tool handler encounters error-- **THEN** it returns `{ success: false, error: "message" }`--### Requirement: Tool documentation--Each tool in schema.ts SHALL have clear description and parameter documentation for AI/human comprehension.--#### Scenario: Tool description-- **WHEN** AI queries available tools-- **THEN** description explains what the tool does (e.g., "Create a rectangle with specified dimensions and position")--#### Scenario: Parameter descriptions-- **WHEN** AI reads parameter schema-- **THEN** each parameter has type and description (e.g., `width: { type: 'number', description: 'Rectangle width in pixels' }`)---### Requirement: CHANGELOG-The project SHALL maintain a CHANGELOG.md in the root following Keep a Changelog conventions.--#### Scenario: Changelog exists-- **WHEN** user reads CHANGELOG.md-- **THEN** version history with categorized changes (Editor, CLI, File Format, etc.) is listed--### Requirement: npm trusted publishing-Package configs SHALL include `repository` field and `provenance: true` for npm trusted publishing via GitHub Actions.--#### Scenario: Publish with provenance-- **WHEN** GitHub Actions release workflow runs-- **THEN** packages are published to npm with provenance attestation--### Requirement: CI app deployment-The project SHALL have a GitHub Actions workflow (`app.yml`) for deploying the web app to app.openpencil.dev.--#### Scenario: App deploys on push-- **WHEN** code is pushed to main branch-- **THEN** GitHub Actions builds and deploys the appdiff --git a/openspec/specs/undo-redo/spec.md b/openspec/specs/undo-redo/spec.mddeleted file mode 100644index c9ca0ca78..000000000--- a/openspec/specs/undo-redo/spec.md+++ /dev/null@@ -1,39 +0,0 @@-# undo-redo Specification--## Purpose-Inverse-command undo/redo system. Records the inverse of every operation, enabling ⌘Z/⇧⌘Z across all editor actions (create, delete, move, resize, rotate, property changes).-## Requirements-### Requirement: Inverse-command undo-The undo system SHALL use an inverse-command pattern where every operation records its inverse. ⌘Z SHALL undo and ⇧⌘Z SHALL redo.--#### Scenario: Undo a move-- **WHEN** user moves a node and presses ⌘Z-- **THEN** the node returns to its original position--#### Scenario: Redo after undo-- **WHEN** user undoes a move and presses ⇧⌘Z-- **THEN** the node moves back to the position after the original move--### Requirement: All operations undoable-Undo/redo SHALL be wired into all editor operations: create, delete, move, resize, rotate, property changes, reparent, layout changes, and variable operations (create/delete variable, create collection, rename variable, rename collection, change variable color/value). Each variable mutation pushes an undo entry with forward and inverse callbacks.--#### Scenario: Undo node creation-- **WHEN** user creates a rectangle and presses ⌘Z-- **THEN** the rectangle is removed from the scene graph--#### Scenario: Undo property change-- **WHEN** user changes a node's fill color from blue to red and presses ⌘Z-- **THEN** the fill color reverts to blue--#### Scenario: Undo variable creation-- **WHEN** user creates a variable and presses ⌘Z-- **THEN** the variable is removed from the scene graph--#### Scenario: Undo variable rename-- **WHEN** user renames a variable and presses ⌘Z-- **THEN** the variable name reverts to the previous value--#### Scenario: Undo collection rename-- **WHEN** user renames a collection and presses ⌘Z-- **THEN** the collection name reverts to the previous value-diff --git a/openspec/specs/userdoc-articles/spec.md b/openspec/specs/userdoc-articles/spec.mddeleted file mode 100644index bf6e53d3f..000000000--- a/openspec/specs/userdoc-articles/spec.md+++ /dev/null@@ -1,131 +0,0 @@-# userdoc-articles Specification--## Purpose-TBD - created by archiving change vitepress-userdoc. Update Purpose after archive.-## Requirements-### Requirement: User guide landing page-The docs site SHALL have an `index.md` at `packages/docs/user-guide/` with the title "User Guide", a brief description positioning OpenPencil as an open-source, Figma-compatible design editor, and links to all user guide articles organized by category.--#### Scenario: Landing page renders-- **WHEN** user navigates to /user-guide/-- **THEN** a page with "User Guide" title, open-source/Figma-compatible positioning, and categorized links to all articles is displayed--### Requirement: Canvas navigation article-The docs site SHALL have a `canvas-navigation.md` article in `packages/docs/user-guide/` documenting panning (space+drag, middle mouse, trackpad, hand tool), zooming (ctrl+scroll, pinch, keyboard shortcuts), and zoom reset.--#### Scenario: Canvas navigation article renders-- **WHEN** user navigates to /user-guide/canvas-navigation-- **THEN** an article explaining panning, zooming, and hand tool usage is displayed with a shortcuts table--### Requirement: Selection and manipulation article-The docs site SHALL have a `selection-and-manipulation.md` article documenting click select, shift multi-select, marquee selection, move by drag, resize handles, rotation with shift snapping, alt+drag duplicate, ⌘D duplicate, nudge with arrows, delete, select all, z-order (]/[), visibility toggle (⇧⌘H), lock toggle (⇧⌘L), and move-to-page.--#### Scenario: Selection article renders-- **WHEN** user navigates to /user-guide/selection-and-manipulation-- **THEN** an article explaining all selection and manipulation operations is displayed--### Requirement: Drawing shapes article-The docs site SHALL have a `drawing-shapes.md` article documenting the bottom toolbar shape tools: Rectangle (R), Ellipse (O), Line (L), Polygon, Star, Frame (F), Section (S). It SHALL cover constrained drawing with Shift, shape properties (fill, stroke, corner radius, effects), and the shapes flyout.--#### Scenario: Drawing shapes article renders-- **WHEN** user navigates to /user-guide/drawing-shapes-- **THEN** an article explaining shape creation with tool shortcuts and property editing is displayed--### Requirement: Auto-layout article-The docs site SHALL have an `auto-layout.md` article documenting Shift+A toggle, layout direction, gap, padding, justify, align, child sizing (fixed/fill/hug), drag reordering, and wrapping selection in auto-layout.--#### Scenario: Auto-layout article renders-- **WHEN** user navigates to /user-guide/auto-layout-- **THEN** an article explaining auto-layout creation and configuration is displayed--### Requirement: Components article-The docs site SHALL have a `components.md` article documenting component creation (⌥⌘K), component sets (⇧⌘K), instance creation (context menu), detach instance (⌥⌘B), go-to-main-component, live sync, overrides, and visual treatment (purple labels, dashed borders).--#### Scenario: Components article renders-- **WHEN** user navigates to /user-guide/components-- **THEN** an article explaining the full component workflow is displayed--### Requirement: Text editing article-The docs site SHALL have a `text-editing.md` article documenting the Text tool (T), inline editing (double-click), cursor navigation (arrow keys, ⌘←/→, ⌥←/→), text selection (click, drag, double-click word, triple-click all), rich text formatting (⌘B/I/U), font picker, and font weight.--#### Scenario: Text editing article renders-- **WHEN** user navigates to /user-guide/text-editing-- **THEN** an article explaining text creation and editing is displayed--### Requirement: Pen tool article-The docs site SHALL have a `pen-tool.md` article documenting the Pen tool (P), placing corner points (click), curve points (click+drag with bezier handles), closing paths (click first point), committing open paths (Escape), and the preview line.--#### Scenario: Pen tool article renders-- **WHEN** user navigates to /user-guide/pen-tool-- **THEN** an article explaining vector path creation is displayed--### Requirement: Layers and pages article-The docs site SHALL have a `layers-and-pages.md` article documenting the layers panel (tree view, expand/collapse, drag reorder, visibility toggle, rename), pages panel (switch, add, delete, rename), and the properties panel tabs (Design, Code, AI).--#### Scenario: Layers and pages article renders-- **WHEN** user navigates to /user-guide/layers-and-pages-- **THEN** an article explaining layer management and page operations is displayed--### Requirement: Context menu article-The docs site SHALL have a `context-menu.md` article documenting right-click actions: clipboard (copy, cut, paste, duplicate, delete), z-order (bring to front, send to back), grouping (group, ungroup, add auto-layout), component actions, visibility/lock, and move-to-page submenu.--#### Scenario: Context menu article renders-- **WHEN** user navigates to /user-guide/context-menu-- **THEN** an article listing all context menu actions with their shortcuts is displayed--### Requirement: Exporting article-The docs site SHALL have an `exporting.md` article documenting the export section in properties panel (scale, format, multi-export), export via context menu, ⇧⌘E shortcut, supported formats (PNG, JPG, WEBP), .fig file save (⌘S, ⇧⌘S), and .fig file import.--#### Scenario: Exporting article renders-- **WHEN** user navigates to /user-guide/exporting-- **THEN** an article explaining image export and file operations is displayed--### Requirement: Variables article-The docs site SHALL have a `variables.md` article documenting the variables dialog (collections, modes, table), creating variables, editing values, color variables, binding variables to fills, and detaching variable bindings.--#### Scenario: Variables article renders-- **WHEN** user navigates to /user-guide/variables-- **THEN** an article explaining design variables and their usage is displayed--### Requirement: Cross-platform shortcut note-Each article that includes keyboard shortcuts SHALL include a note that ⌘ corresponds to Ctrl on Windows/Linux, and ⌥ corresponds to Alt.--#### Scenario: Shortcut platform note present-- **WHEN** user reads any user guide article with a shortcuts table-- **THEN** a note about cross-platform key equivalents is visible--### Requirement: Consistent article structure-Each user guide article SHALL follow a consistent structure: title, brief introduction, feature walkthrough with subsections, keyboard shortcuts table (where applicable), and tips section.--#### Scenario: Article structure consistency-- **WHEN** user reads any user guide article-- **THEN** the article has an intro paragraph, subsections explaining features, and a shortcuts table---### Requirement: Stroke align and per-side weights (sync-docs-v07-v08)--The drawing-shapes article SHALL document stroke alignment (Inside/Center/Outside) and per-side weights (Top/Right/Bottom/Left).--#### Scenario: Stroke align documented-- **WHEN** user reads Drawing Shapes-- **THEN** Inside/Center/Outside alignment is described--### Requirement: Layer inline rename (sync-docs-v07-v08)--The layers-and-pages article SHALL document double-click to rename inline with Enter/Escape/blur to commit.--### Requirement: Copy/Paste as in context-menu (sync-docs-v07-v08)--A Copy/Paste as section SHALL be present in context-menu article for all locales.--### Requirement: Mobile drawer note (sync-docs-v07-v08)--The layers-and-pages article SHALL mention the mobile bottom drawer layout.--### Requirement: Code panel format toggle (sync-docs-v07-v08)--The Code Tab description SHALL mention OpenPencil JSX and Tailwind CSS v4 format toggle.--### Requirement: Locale parity (sync-docs-v07-v08)--DE, ES, FR, IT, PL translations SHALL include all sections present in EN for features.md, comparison.md, figma-comparison.md, exporting.md, drawing-shapes.md, layers-and-pages.md, and context-menu.md.diff --git a/openspec/specs/vector-edit/spec.md b/openspec/specs/vector-edit/spec.mddeleted file mode 100644index 730a5cf00..000000000--- a/openspec/specs/vector-edit/spec.md+++ /dev/null@@ -1,177 +0,0 @@-# vector-edit Specification--## Purpose-Geometry edit mode for VECTOR nodes: direct editing of anchors, segments, and tangents without invoking base transform interactions.--## Requirements-### Requirement: Enter curve edit mode-Double-clicking a VECTOR node in Select mode SHALL enter geometry edit mode for that node.--#### Scenario: Enter by double-click-- **WHEN** user double-clicks a vector curve-- **THEN** editor opens geometry edit mode for that vector-- **AND** editable vertices/segments are initialized--### Requirement: Edit mode scope-Only one vector SHALL be actively edited at a time.--#### Scenario: Enter another vector-- **WHEN** user double-clicks a different vector while one vector is in edit mode-- **THEN** previous edit session ends-- **AND** new vector becomes the active edited vector--### Requirement: Exit curve edit mode-User SHALL be able to exit curve edit mode and return to normal selection interactions.--#### Scenario: Exit with Escape-- **WHEN** curve edit mode is active and user presses `Escape`-- **THEN** curve edit mode ends--#### Scenario: Exit by tool/context switch-- **WHEN** curve edit mode is active and user switches to incompatible context (for example selects non-geometry transform workflow)-- **THEN** curve edit mode ends cleanly--### Requirement: Transform interaction isolation in edit mode-While curve edit mode is active, base selection transform bbox interactions SHALL be disabled for the edited vector.--#### Scenario: Hidden/non-interactive bbox corners-- **WHEN** user hovers where resize/rotate corners would normally be-- **THEN** transform cursors are not shown-- **AND** resize/rotate handles are not hit-testable--### Requirement: Vertex selection and direct drag-Anchors in curve edit mode SHALL support direct manipulation by drag.--#### Scenario: Drag an anchor-- **WHEN** user drags an anchor point in curve edit mode-- **THEN** anchor position updates by pointer delta-- **AND** connected segments update in preview and final geometry--### Requirement: Handle drag without modifiers-Dragging a tangent handle without modifiers SHALL use the node's current composition rules.--#### Scenario: Default handle drag-- **WHEN** user drags a tangent with no modifier keys-- **THEN** tangent updates according to current handle composition of the vertex--### Requirement: Continuous override in curve edit mode-Holding `Cmd/Ctrl` while dragging a tangent SHALL force Continuous behavior for the drag.--#### Scenario: Cmd/Ctrl tangent drag-- **WHEN** user drags a tangent while holding `Cmd/Ctrl`-- **THEN** active tangent direction is constrained to the sister-handle axis-- **AND** active tangent length changes with drag--### Requirement: Corner override in curve edit mode-Holding `Alt/Option` while dragging a tangent SHALL force independent handle editing.--#### Scenario: Alt/Option tangent drag-- **WHEN** user drags a tangent while holding `Alt/Option`-- **THEN** active tangent changes independently-- **AND** sister tangent remains unchanged--### Requirement: Shift axis lock for Continuous/Symmetric-Holding `Shift` during tangent drag on `Continuous` (`ANGLE`) or `Symmetric` (`ANGLE_AND_LENGTH`) vertices SHALL lock direction to pre-drag axis and allow length-only edits.--#### Scenario: Shift lock with Continuous-- **WHEN** user starts dragging a tangent on `ANGLE` vertex and then holds `Shift`-- **THEN** tangent direction stays equal to pre-drag direction-- **AND** only tangent length changes--#### Scenario: Shift lock with Symmetric-- **WHEN** user starts dragging a tangent on `ANGLE_AND_LENGTH` vertex and then holds `Shift`-- **THEN** both tangents stay collinear on pre-drag axis-- **AND** only lengths update per composition rules--### Requirement: Modifier transitions during one drag-Modifier changes (`Cmd/Ctrl`, `Alt/Option`, `Shift`) during an active drag SHALL be applied live without canceling drag.--#### Scenario: Toggle modifiers mid-drag-- **WHEN** user changes modifier keys while still dragging a tangent-- **THEN** active composition behavior switches immediately-- **AND** drag session continues from current pointer state--### Requirement: Bend mode handle targeting on anchor drag-For bend override (`Cmd/Ctrl` + anchor drag), edited tangent SHALL be determined by segment attachment direction at the anchor, not by nearest neighbor-point distance.--#### Scenario: Direction-based target on 2-segment vertex-- **WHEN** vertex has two attached segments and user starts bend drag with `Cmd/Ctrl`-- **THEN** edited tangent is chosen by best directional alignment to drag direction--#### Scenario: Direction-based target on multi-branch vertex-- **WHEN** vertex has 3+ attached segments and user starts bend drag with `Cmd/Ctrl`-- **THEN** edited tangent/segment is resolved by segment attachment direction-- **AND** selected target supports vector-web branching topology--### Requirement: Bend mode target lock-Resolved bend target SHALL lock after initial determination for the current drag session.--#### Scenario: Lock target after initial resolution-- **WHEN** bend drag begins and target tangent is resolved-- **THEN** only that tangent is edited for the remainder of the drag-- **AND** non-target tangents keep original coordinates--### Requirement: Pen interactions while already in curve edit mode-With Pen active inside curve edit mode, contour insertion, endpoint resume, and point deletion SHALL be available.--#### Scenario: Insert anchor on contour-- **WHEN** Pen is active and user clicks a segment in curve edit mode-- **THEN** segment is split and new anchor is inserted at hit position--#### Scenario: Resume drawing from endpoint-- **WHEN** Pen is active and user clicks an open-path endpoint in curve edit mode-- **THEN** editor resumes path drawing from that endpoint--#### Scenario: Delete anchor with Alt/Option click-- **WHEN** Pen is active and user `Alt/Option`-clicks an anchor in curve edit mode-- **THEN** anchor is removed and neighboring segments are reconnected if topology allows--### Requirement: Align selected anchors relative to each other-When two or more anchors are selected in curve edit mode, alignment buttons in the position panel SHALL reposition those anchors relative to each other instead of operating on the parent node.--#### Scenario: Align left (min X)-- **WHEN** 2+ anchors are selected and user clicks Align Left-- **THEN** all selected anchors move to the X coordinate of the leftmost anchor-- **AND** unselected anchors and tangents are unaffected--#### Scenario: Align right (max X)-- **WHEN** 2+ anchors are selected and user clicks Align Right-- **THEN** all selected anchors move to the X coordinate of the rightmost anchor-- **AND** unselected anchors and tangents are unaffected--#### Scenario: Align center horizontally-- **WHEN** 2+ anchors are selected and user clicks Align Center Horizontally-- **THEN** all selected anchors move to the midpoint X between leftmost and rightmost selected anchor-- **AND** unselected anchors and tangents are unaffected--#### Scenario: Align top (min Y)-- **WHEN** 2+ anchors are selected and user clicks Align Top-- **THEN** all selected anchors move to the Y coordinate of the topmost anchor-- **AND** unselected anchors and tangents are unaffected--#### Scenario: Align bottom (max Y)-- **WHEN** 2+ anchors are selected and user clicks Align Bottom-- **THEN** all selected anchors move to the Y coordinate of the bottommost anchor-- **AND** unselected anchors and tangents are unaffected--#### Scenario: Align center vertically-- **WHEN** 2+ anchors are selected and user clicks Align Center Vertically-- **THEN** all selected anchors move to the midpoint Y between topmost and bottommost selected anchor-- **AND** unselected anchors and tangents are unaffected--#### Scenario: Single anchor selected — no vertex alignment-- **WHEN** exactly 1 anchor is selected and user clicks any alignment button-- **THEN** alignment operates on the parent node as in normal selection mode-- **AND** no vertex repositioning occurs--#### Scenario: No anchors selected — no vertex alignment-- **WHEN** no anchors are selected and user clicks any alignment button-- **THEN** alignment operates on the parent node as in normal selection mode--### Requirement: Visual preview correctness during curve edit-Interactive preview in curve edit mode SHALL render active tangent feedback from anchor to active tangent endpoint.--#### Scenario: Active tangent preview line-- **WHEN** user drags an active tangent-- **THEN** preview line is rendered from anchor to active tangent endpoint-- **AND** preview does not render a misleading line between non-active handlesdiff --git a/openspec/specs/vitepress-docs/spec.md b/openspec/specs/vitepress-docs/spec.mddeleted file mode 100644index 0eb8ae58d..000000000--- a/openspec/specs/vitepress-docs/spec.md+++ /dev/null@@ -1,284 +0,0 @@-# vitepress-docs Specification--## Purpose-VitePress documentation site at `packages/docs/` as `@open-pencil/docs` workspace package. Content derived from PLAN.md, README, and openspec specs. Includes guide pages (getting started, architecture, tech stack), reference pages (keyboard shortcuts, node types, MCP tools), and development pages (contributing, testing, openspec workflow, roadmap).-## Requirements-### Requirement: VitePress documentation site-The project SHALL have a VitePress documentation site in the `packages/docs/` directory as `@open-pencil/docs` workspace package, with its own `.vitepress/config.ts` configuration and `package.json`.--#### Scenario: Docs dev server starts-- **WHEN** `cd packages/docs && bun run dev` is executed-- **THEN** VitePress dev server starts and serves the documentation site--#### Scenario: Docs build succeeds-- **WHEN** `cd packages/docs && bun run build` is executed-- **THEN** VitePress produces a static site in `packages/docs/.vitepress/dist/`--### Requirement: Landing page-The docs site SHALL have an index.md landing page with project name, tagline "Open-source Figma alternative. Fully local, AI-native, programmable.", quick navigation to guide and reference sections, download links (GitHub Releases, app.openpencil.dev), and "no subscription, bring your own API key" messaging. The feature cards SHALL reflect the five pillars: open source, Figma-compatible, AI-native, fully local, programmable.--#### Scenario: Landing page loads-- **WHEN** user opens the docs site root URL-- **THEN** a landing page with "OpenPencil" title, the updated tagline, and pillar-based feature highlights is displayed--### Requirement: Guide section-The docs site SHALL include a guide section with pages: Getting Started, Features, Architecture, Tech Stack. The Features page SHALL begin with a brief motivation section explaining why OpenPencil exists (open platform vs closed tooling). The Features page SHALL document components (create, instance, detach, component sets), context menu, z-order, visibility/lock toggle, move-to-page, and rendering optimizations (viewport culling, RAF coalescing).--#### Scenario: Getting started page-- **WHEN** user navigates to the Getting Started guide-- **THEN** installation instructions (`bun install`, `bun run dev`) and desktop app setup are displayed--#### Scenario: Architecture page-- **WHEN** user navigates to the Architecture guide-- **THEN** the system architecture diagram and component descriptions from PLAN.md are displayed--#### Scenario: Features page motivation section-- **WHEN** user reads the features page-- **THEN** a brief intro explains why OpenPencil exists before the feature list--#### Scenario: Features page documents components-- **WHEN** user reads the features page-- **THEN** component creation, instances, detach, component sets, and context menu are described--### Requirement: Reference section-The docs site SHALL include a reference section with pages: Keyboard Shortcuts, Node Types, MCP Tools, Scene Graph, File Format.--#### Scenario: Keyboard shortcuts page-- **WHEN** user navigates to Keyboard Shortcuts reference-- **THEN** the full shortcut table from PLAN.md is displayed with implementation status--#### Scenario: MCP tools page-- **WHEN** user navigates to MCP Tools reference-- **THEN** all 117 MCP tools are listed grouped by category--### Requirement: Development section-The docs site SHALL include a development section with pages: Contributing, Testing, OpenSpec Workflow, Roadmap.--#### Scenario: Roadmap page-- **WHEN** user navigates to the Roadmap development page-- **THEN** the 6 phases from PLAN.md are listed with current progress--### Requirement: Sidebar navigation-The VitePress config SHALL define a sidebar with logical grouping: User Guide, Guide, Reference, Development. The User Guide group SHALL appear first and include entries for all user guide articles. The Guide group SHALL include a "Figma Feature Matrix" entry after "Comparison" linking to `/guide/figma-comparison`.--#### Scenario: Sidebar groups-- **WHEN** user browses any documentation page-- **THEN** a sidebar shows four collapsible groups: User Guide, Guide, Reference, Development--#### Scenario: User Guide sidebar entries-- **WHEN** user views the User Guide sidebar section-- **THEN** entries for all 12 user guide articles are listed in logical order--#### Scenario: Figma comparison in sidebar-- **WHEN** user views the Guide sidebar section-- **THEN** a "Figma Feature Matrix" entry appears after "Comparison" linking to `/guide/figma-comparison`--### Requirement: Dark theme-The docs site SHALL use dark appearance to match the editor's dark aesthetic.--#### Scenario: Dark mode-- **WHEN** user opens the documentation site-- **THEN** the site renders with VitePress dark theme--### Requirement: Build artifacts excluded from git-`packages/docs/.vitepress/dist` and `packages/docs/.vitepress/cache` SHALL be listed in `.gitignore`.--#### Scenario: Gitignore entries-- **WHEN** `bun run docs:build` creates output in `packages/docs/.vitepress/dist/`-- **THEN** the output directory is not tracked by git--### Requirement: Docs reflect sections feature-The features page SHALL document sections: SECTION node type, title pills, auto-adopt siblings, top-level-only constraint.--#### Scenario: Sections described in features-- **WHEN** user reads the features page-- **THEN** sections are documented with their behavior--### Requirement: Docs reflect multi-page support-The features page SHALL document multi-page documents: add/delete/rename pages, per-page viewport, pages panel.--#### Scenario: Pages described in features-- **WHEN** user reads the features page-- **THEN** multi-page support is documented--### Requirement: Docs reflect .fig export-The file-format page SHALL document .fig export: Save/Save As, Kiwi encoding, Zstd compression, thumbnail generation. The features page SHALL list .fig export as a capability.--#### Scenario: Export documented in file-format-- **WHEN** user reads the file-format reference-- **THEN** the export pipeline and supported formats table shows .fig export ✅--### Requirement: Docs reflect advanced rendering-The features page SHALL document tier 1 rendering: gradients, image fills, effects (shadows, blurs), stroke properties (cap, join, dash), arcs.--#### Scenario: Rendering features documented-- **WHEN** user reads the features page-- **THEN** gradient fills, image fills, effects, and stroke properties are described--### Requirement: Docs reflect updated keyboard shortcuts-The keyboard shortcuts page SHALL mark Section tool (S), Save (⌘S), Save As (⇧⌘S), Create Component (⌥⌘K), Detach Instance (⌥⌘B), Create Component Set (⇧⌘K), Bring to Front (]), Send to Back ([), Toggle Visibility (⇧⌘H), and Toggle Lock (⇧⌘L) as implemented (✅).--#### Scenario: New shortcuts marked-- **WHEN** user reads the keyboard shortcuts page-- **THEN** ⌥⌘K, ⌥⌘B, ⇧⌘K, ], [, ⇧⌘H, ⇧⌘L show ✅ status--### Requirement: Docs reflect updated node types-The node-types reference SHALL list the current 17 types in the NodeType union used by the scene graph.--#### Scenario: Node types are current-- **WHEN** user reads the node types page-- **THEN** CANVAS, ROUNDED_RECTANGLE, COMPONENT, COMPONENT_SET, INSTANCE, CONNECTOR, SHAPE_WITH_TEXT are all listed--### Requirement: Roadmap reflects current progress-The roadmap page SHALL reflect that .fig export, sections, pages, hover highlight, and advanced rendering are delivered (Phase 3). Phase 4 SHALL show as 🟡 In Progress with component creation, instances, component sets, and detach delivered.--#### Scenario: Roadmap is current-- **WHEN** user reads the roadmap page-- **THEN** Phase 3 shows delivered items and Phase 4 shows partial progress with component features--### Requirement: Comparison page-The docs site SHALL include a comparison page at `/guide/comparison` documenting architecture, rendering, data model, layout, file format, state management, developer experience, and performance differences between OpenPencil and Penpot. The intro SHALL reference the motivation for an open alternative to closed design platforms.--#### Scenario: Comparison page renders-- **WHEN** user navigates to /guide/comparison-- **THEN** a page with all comparison sections, the summary table, and a motivation context intro is displayed--### Requirement: Comparison in sidebar navigation-The VitePress sidebar SHALL include a "Comparison" link in the Guide section after Tech Stack.--#### Scenario: Sidebar shows comparison-- **WHEN** user views the Guide sidebar-- **THEN** a "Comparison" entry appears after "Tech Stack" linking to /guide/comparison---### Requirement: Eval command documentation--The docs site SHALL include comprehensive documentation for the eval command in `packages/docs/eval-command.md`.--#### Scenario: Eval command page exists-- **WHEN** user navigates to `/eval-command`-- **THEN** full documentation for `open-pencil eval` command is displayed--#### Scenario: Overview section-- **WHEN** user reads eval command docs-- **THEN** overview explains purpose (headless scripting with Figma Plugin API)--#### Scenario: Usage examples-- **WHEN** user reads eval command docs-- **THEN** code examples show `--code`, `--stdin`, `--write`, `-o`, `--json` usage--#### Scenario: Architecture section-- **WHEN** user reads eval command docs-- **THEN** architecture diagram shows CLI → loadDocument → FigmaAPI → execute → serialize flow--#### Scenario: FigmaAPI surface coverage-- **WHEN** user reads eval command docs-- **THEN** documentation lists supported methods (createFrame, createRectangle, findAll, etc.)--#### Scenario: AI integration examples-- **WHEN** user reads eval command docs-- **THEN** examples show how AI tools use eval for batch operations--#### Scenario: Testing patterns-- **WHEN** user reads eval command docs-- **THEN** examples show headless testing with eval--#### Scenario: Migration from Figma plugins-- **WHEN** user reads eval command docs-- **THEN** guide explains how to adapt Figma plugin code to eval scripts--#### Scenario: 437 lines of documentation-- **WHEN** eval-command.md is counted-- **THEN** it contains 437 lines of comprehensive content--### Requirement: Comparison matrix updates--The docs site SHALL update comparison matrices to reflect new features (app menu, eval command, Figma Plugin API).--#### Scenario: Figma comparison update-- **WHEN** user reads `packages/docs/guide/figma-comparison.md`-- **THEN** Interface & Navigation section includes app menu status--#### Scenario: Plugin API row-- **WHEN** user reads Figma comparison-- **THEN** a row documents eval command with Figma Plugin API compatibility--#### Scenario: AI tools update-- **WHEN** user reads Figma comparison-- **THEN** AI tools row is updated to reflect unified tool definitions and eval integration--#### Scenario: Penpot comparison update-- **WHEN** user reads `packages/docs/guide/comparison.md`-- **THEN** Architecture section highlights headless scripting advantage (eval command with Plugin API that Penpot lacks)--### Requirement: App menu documentation--The docs site SHALL document app menu in appropriate guide pages.--#### Scenario: App menu in features-- **WHEN** user reads Features page-- **THEN** app menu is listed with menus (File, Edit, View, Object, Text, Arrange) and key actions--#### Scenario: Browser mode distinction-- **WHEN** user reads app menu docs-- **THEN** clarification that menu bar only appears in browser mode (Tauri uses native menus)--### Requirement: Autosave documentation--The docs site SHALL document autosave behavior in appropriate guide pages.--#### Scenario: Autosave in features-- **WHEN** user reads Features page or Getting Started-- **THEN** autosave is explained (3-second debounce, automatic for files with handle)--#### Scenario: Autosave limitations-- **WHEN** user reads autosave docs-- **THEN** note that new unsaved files don't autosave until user performs Save As--### Requirement: AGENTS.md update reference--The docs site SHALL reference tool unification in development pages when relevant.--#### Scenario: Tool architecture mention-- **WHEN** user reads development/contributing docs-- **THEN** unified tool definitions (`packages/core/src/tools/`) are mentioned as canonical source--### Requirement: SVG export documentation (sync-docs-v07-v08)--The features page and exporting article SHALL document SVG as an export format. The format table SHALL include SVG with a note that the scale selector is hidden for SVG. CLI and MCP tool SHALL be mentioned.--#### Scenario: SVG in exporting article-- **WHEN** user reads the Exporting user guide article-- **THEN** SVG appears in the format table--### Requirement: Copy/Paste as submenu documentation (sync-docs-v07-v08)--The context menu article SHALL document the Copy/Paste as submenu: Copy as text, SVG, PNG (⇧⌘C), JSX.--#### Scenario: Copy/Paste as section present-- **WHEN** user reads the Context Menu article-- **THEN** a Copy/Paste as section lists all four formats--### Requirement: Homebrew install (sync-docs-v07-v08)--The Getting Started guide SHALL include Homebrew install before "Building from Source".--#### Scenario: Homebrew section present-- **WHEN** user reads Getting Started-- **THEN** `brew install open-pencil/tap/open-pencil` is shown--### Requirement: Keyboard shortcuts accuracy (sync-docs-v07-v08)--⌘N/⌘T, ⌘W, and ⌘\\ SHALL be marked ✅. ⇧⌘C (Copy as PNG) SHALL be added as ✅.--### Requirement: MCP tools completeness (sync-docs-v07-v08)--All 78 tools SHALL be listed in the MCP tools reference.--### Requirement: Comparison tables accuracy (sync-docs-v07-v08)--comparison.md SHALL show 78 tools (not 75) and NOT list SVG export as a Penpot advantage. figma-comparison.md SHALL show Rename layers ✅, SVG export ✅, Copy/Paste as ✅, Stroke align ✅, per-side weights ✅.--### Requirement: Architecture roadmap section (sync-docs-v07-v08)--architecture.md SHALL include a "What's Next" section covering: more AI providers, full figma-use tools, CI design tooling, prototyping, CSS Grid, PDF export, .fig fidelity.diff --git a/packages/docs/de/development/contributing.md b/packages/docs/de/development/contributing.mdindex 09f45e0c0..3e1918df7 100644--- a/packages/docs/de/development/contributing.md+++ b/packages/docs/de/development/contributing.md@@ -21,7 +21,6 @@ tests/e2e/ Playwright visuelle Regressionengine/ Unit-Tests (bun:test)packages/docs/ VitePress-Dokumentationsseite-openspec/specs/ Fähigkeitsspezifikationen (Wahrheitsquelle)changes/ Aktive und archivierte Änderungen```@@ -64,11 +63,9 @@ Entwickler und KI-Agenten sollten `AGENTS.md` im Repo-Root lesen ([auf GitHub an## Änderungen vornehmen-1. Vorhandene [OpenSpec-Spezifikationen](/de/development/openspec) für die zu ändernde Fähigkeit prüfen-2. Bei neuem Verhalten eine OpenSpec-Änderung erstellen: `openspec new change "meine-aenderung"`-3. Änderung implementieren-4. `bun run check` und `bun run test` ausführen-5. Pull Request einreichen+1. Änderung implementieren+2. `bun run check` und `bun run test` ausführen+3. Pull Request einreichen## Schlüsseldateiendiff --git a/packages/docs/de/development/openspec.md b/packages/docs/de/development/openspec.mddeleted file mode 100644index 4df42a87a..000000000--- a/packages/docs/de/development/openspec.md+++ /dev/null@@ -1,73 +0,0 @@-# OpenSpec-Workflow--OpenPencil verwendet OpenSpec für spezifikationsgetriebene Entwicklung. Spezifikationen sind die Wahrheitsquelle.--## Struktur--```-openspec/-├── specs/ # Source of truth-│ ├── scene-graph/-│ ├── canvas-rendering/-│ ├── auto-layout/-│ └── ... # 19 capability specs-├── changes/-│ └── archive/-└── config.yaml-```--## Aktuelle Spezifikationen--| Capability | Description |-|-----------|-------------|-| scene-graph | Flat Map, CRUD, hit testing |-| canvas-rendering | CanvasKit WASM rendering |-| auto-layout | Yoga WASM flexbox |-| fig-import | .fig file import |-| kiwi-codec | Kiwi binary codec |-| editor-ui | Vue 3 panels, toolbar |-| desktop-app | Tauri v2 |-| testing | Playwright + bun:test |-| tooling | Vite, oxlint, tsgo |--## Workflow--### 1. Änderung vorschlagen--```-/opsx:propose change-name-```--→ proposal.md, design.md, specs/, tasks.md--### 2. Implementieren--```-/opsx:apply-```--### 3. Archivieren--```-/opsx:archive-```--## Spezifikationsformat--```markdown-# capability-name Specification-## Requirements-### Requirement: Name-#### Scenario: Name-- **WHEN** condition-- **THEN** expected outcome-```--## CLI-Befehle--```sh-openspec list-openspec show <name>-openspec status --change <name>-openspec archive <name>-```diff --git a/packages/docs/development/contributing.md b/packages/docs/development/contributing.mdindex 8bbe5bebc..fc94c90e5 100644--- a/packages/docs/development/contributing.md+++ b/packages/docs/development/contributing.md@@ -24,9 +24,6 @@ tests/e2e/ Playwright visual regressionengine/ Unit tests (bun:test)docs/ VitePress documentation site-openspec/- specs/ Capability specifications (source of truth)- changes/ Active and archived changes```## Development Setup@@ -67,11 +64,9 @@ Developers and AI agents working on the codebase should read `AGENTS.md` in the## Making Changes-1. Check existing [openspec specs](/development/openspec) for the capability you're modifying-2. Create an openspec change if adding new behavior: `openspec new change "my-change"`-3. Implement the change-4. Run `bun run check` and `bun run test`-5. Submit a pull request+1. Implement the change+2. Run `bun run check` and `bun run test`+3. Submit a pull request## Key Filesdiff --git a/packages/docs/development/openspec.md b/packages/docs/development/openspec.mddeleted file mode 100644index 4c3f20939..000000000--- a/packages/docs/development/openspec.md+++ /dev/null@@ -1,107 +0,0 @@-# OpenSpec Workflow--OpenPencil uses [OpenSpec](https://github.com/Fission-AI/OpenSpec) for spec-driven development. Specifications are the source of truth for what the system does.--## Structure--```-openspec/-├── specs/ # Source of truth: how the system works now-│ ├── scene-graph/-│ │ └── spec.md-│ ├── canvas-rendering/-│ │ └── spec.md-│ ├── auto-layout/-│ │ └── spec.md-│ └── ... # 19 capability specs total-├── changes/ # Proposed changes (one directory per change)-│ └── archive/ # Completed changes-└── config.yaml # Optional configuration-```--## Current Specs--| Capability | Description |-|-----------|-------------|-| scene-graph | Flat Map storage, CRUD, hit testing |-| canvas-rendering | CanvasKit WASM rendering pipeline |-| canvas-navigation | Pan, zoom, hand tool |-| selection-manipulation | Click/marquee select, move, resize, rotate |-| undo-redo | Inverse-command pattern |-| text-editing | Text tool, Paragraph API, font loading |-| pen-tool | Vector network model, bezier curves |-| auto-layout | Yoga WASM flexbox, Shift+A toggle |-| figma-clipboard | Bidirectional Kiwi binary clipboard |-| fig-import | .fig file import pipeline |-| kiwi-codec | Kiwi binary codec, sparse field IDs |-| editor-ui | Vue 3 panels, toolbar, color picker |-| snap-guides | Edge/center snapping, rotation-aware |-| rulers | Canvas rulers, selection highlight |-| group-ungroup | <kbd>⌘</kbd><kbd>G</kbd> / <kbd>⇧</kbd><kbd>⌘</kbd><kbd>G</kbd>, position-based sort |-| desktop-app | Tauri v2, macOS menu bar |-| testing | Playwright E2E, bun:test unit |-| scrub-input | Drag-to-scrub numeric inputs |-| tooling | Vite 7, oxlint, oxfmt, tsgo, VitePress |--## Workflow--### 1. Propose a Change--```-/opsx:propose add-dark-mode-```--Creates `openspec/changes/add-dark-mode/` with:-- `proposal.md` — why and what changes-- `design.md` — technical approach-- `specs/` — delta specifications (ADDED/MODIFIED/REMOVED requirements)-- `tasks.md` — implementation checklist--### 2. Implement--```-/opsx:apply-```--Execute tasks from tasks.md, checking off items as they're completed.--### 3. Archive--```-/opsx:archive-```--- Merges delta specs into `openspec/specs/` (the baseline)-- Moves the change to `openspec/changes/archive/`--## Spec Format--Each spec file follows a consistent structure:--```markdown-# capability-name Specification--## Purpose-One-line description of what this capability does.--## Requirements--### Requirement: Name-Description using SHALL/MUST for normative requirements.--#### Scenario: Name-- **WHEN** condition-- **THEN** expected outcome-```--Every requirement has at least one scenario. Scenarios are potential test cases.--## CLI Commands--```sh-openspec list # List active changes-openspec show <name> # Show change details-openspec status --change <name> # Artifact status-openspec archive <name> # Archive completed change-openspec update # Regenerate skills/prompts-```diff --git a/packages/docs/es/development/contributing.md b/packages/docs/es/development/contributing.mdindex 25b158cf6..f6f028056 100644--- a/packages/docs/es/development/contributing.md+++ b/packages/docs/es/development/contributing.md@@ -24,7 +24,6 @@ tests/e2e/ Regresión visual Playwrightengine/ Tests unitarios (bun:test)docs/ Sitio de documentación VitePress-openspec/specs/ Especificaciones de capacidades (fuente de verdad)changes/ Cambios activos y archivados```@@ -67,8 +66,6 @@ Desarrolladores y agentes IA deben leer `AGENTS.md` en la raíz del repo ([ver e## Realizar cambios-1. Consultar las [specs de openspec](/development/openspec) existentes para la capacidad que estás modificando-2. Crear un cambio openspec si añades nuevo comportamiento: `openspec new change "mi-cambio"`3. Implementar el cambio4. Ejecutar `bun run check` y `bun run test`5. Enviar un pull requestdiff --git a/packages/docs/es/development/openspec.md b/packages/docs/es/development/openspec.mddeleted file mode 100644index 01a79bed5..000000000--- a/packages/docs/es/development/openspec.md+++ /dev/null@@ -1,73 +0,0 @@-# Flujo OpenSpec--OpenPencil usa OpenSpec para desarrollo dirigido por especificaciones. Las especificaciones son la fuente de verdad.--## Estructura--```-openspec/-├── specs/ # Source of truth-│ ├── scene-graph/-│ ├── canvas-rendering/-│ ├── auto-layout/-│ └── ... # 19 capability specs-├── changes/-│ └── archive/-└── config.yaml-```--## Especificaciones actuales--| Capability | Description |-|-----------|-------------|-| scene-graph | Flat Map, CRUD, hit testing |-| canvas-rendering | CanvasKit WASM rendering |-| auto-layout | Yoga WASM flexbox |-| fig-import | .fig file import |-| kiwi-codec | Kiwi binary codec |-| editor-ui | Vue 3 panels, toolbar |-| desktop-app | Tauri v2 |-| testing | Playwright + bun:test |-| tooling | Vite, oxlint, tsgo |--## Flujo de trabajo--### 1. Proponer un cambio--```-/opsx:propose change-name-```--→ proposal.md, design.md, specs/, tasks.md--### 2. Implementar--```-/opsx:apply-```--### 3. Archivar--```-/opsx:archive-```--## Formato de especificaciones--```markdown-# capability-name Specification-## Requirements-### Requirement: Name-#### Scenario: Name-- **WHEN** condition-- **THEN** expected outcome-```--## Comandos CLI--```sh-openspec list-openspec show <name>-openspec status --change <name>-openspec archive <name>-```diff --git a/packages/docs/fr/development/contributing.md b/packages/docs/fr/development/contributing.mdindex 846feed72..3cda26f70 100644--- a/packages/docs/fr/development/contributing.md+++ b/packages/docs/fr/development/contributing.md@@ -24,7 +24,6 @@ tests/e2e/ Régression visuelle Playwrightengine/ Tests unitaires (bun:test)docs/ Site de documentation VitePress-openspec/specs/ Spécifications de capacités (source de vérité)changes/ Changements actifs et archivés```@@ -67,8 +66,6 @@ Les développeurs et agents IA doivent lire `AGENTS.md` à la racine du repo ([v## Apporter des changements-1. Consulter les [specs openspec](/development/openspec) existantes-2. Créer un changement openspec si vous ajoutez un nouveau comportement : `openspec new change "mon-changement"`3. Implémenter le changement4. Exécuter `bun run check` et `bun run test`5. Soumettre une pull requestdiff --git a/packages/docs/fr/development/openspec.md b/packages/docs/fr/development/openspec.mddeleted file mode 100644index fb17f0c26..000000000--- a/packages/docs/fr/development/openspec.md+++ /dev/null@@ -1,73 +0,0 @@-# Workflow OpenSpec--OpenPencil utilise OpenSpec pour le développement piloté par les spécifications. Les spécifications sont la source de vérité.--## Structure--```-openspec/-├── specs/ # Source of truth-│ ├── scene-graph/-│ ├── canvas-rendering/-│ ├── auto-layout/-│ └── ... # 19 capability specs-├── changes/-│ └── archive/-└── config.yaml-```--## Spécifications actuelles--| Capability | Description |-|-----------|-------------|-| scene-graph | Flat Map, CRUD, hit testing |-| canvas-rendering | CanvasKit WASM rendering |-| auto-layout | Yoga WASM flexbox |-| fig-import | .fig file import |-| kiwi-codec | Kiwi binary codec |-| editor-ui | Vue 3 panels, toolbar |-| desktop-app | Tauri v2 |-| testing | Playwright + bun:test |-| tooling | Vite, oxlint, tsgo |--## Workflow--### 1. Proposer une modification--```-/opsx:propose change-name-```--→ proposal.md, design.md, specs/, tasks.md--### 2. Implémenter--```-/opsx:apply-```--### 3. Archiver--```-/opsx:archive-```--## Format des spécifications--```markdown-# capability-name Specification-## Requirements-### Requirement: Name-#### Scenario: Name-- **WHEN** condition-- **THEN** expected outcome-```--## Commandes CLI--```sh-openspec list-openspec show <name>-openspec status --change <name>-openspec archive <name>-```diff --git a/packages/docs/it/development/contributing.md b/packages/docs/it/development/contributing.mdindex 9c6b8aba6..b56462bc9 100644--- a/packages/docs/it/development/contributing.md+++ b/packages/docs/it/development/contributing.md@@ -24,7 +24,6 @@ tests/e2e/ Regressione visiva Playwrightengine/ Test unitari (bun:test)docs/ Sito documentazione VitePress-openspec/specs/ Specifiche di capacità (fonte di verità)changes/ Cambiamenti attivi e archiviati```@@ -67,8 +66,6 @@ Sviluppatori e agenti IA dovrebbero leggere `AGENTS.md` nella root del repo ([ve## Apportare modifiche-1. Consultare le [spec openspec](/development/openspec) esistenti-2. Creare un cambiamento openspec se si aggiunge un nuovo comportamento: `openspec new change "mio-cambiamento"`3. Implementare il cambiamento4. Eseguire `bun run check` e `bun run test`5. Inviare una pull requestdiff --git a/packages/docs/it/development/openspec.md b/packages/docs/it/development/openspec.mddeleted file mode 100644index 0045660ab..000000000--- a/packages/docs/it/development/openspec.md+++ /dev/null@@ -1,73 +0,0 @@-# Workflow OpenSpec--OpenPencil usa OpenSpec per lo sviluppo guidato da specifiche. Le specifiche sono la fonte di verità.--## Struttura--```-openspec/-├── specs/ # Source of truth-│ ├── scene-graph/-│ ├── canvas-rendering/-│ ├── auto-layout/-│ └── ... # 19 capability specs-├── changes/-│ └── archive/-└── config.yaml-```--## Specifiche attuali--| Capability | Description |-|-----------|-------------|-| scene-graph | Flat Map, CRUD, hit testing |-| canvas-rendering | CanvasKit WASM rendering |-| auto-layout | Yoga WASM flexbox |-| fig-import | .fig file import |-| kiwi-codec | Kiwi binary codec |-| editor-ui | Vue 3 panels, toolbar |-| desktop-app | Tauri v2 |-| testing | Playwright + bun:test |-| tooling | Vite, oxlint, tsgo |--## Workflow--### 1. Proporre una modifica--```-/opsx:propose change-name-```--→ proposal.md, design.md, specs/, tasks.md--### 2. Implementare--```-/opsx:apply-```--### 3. Archiviare--```-/opsx:archive-```--## Formato delle specifiche--```markdown-# capability-name Specification-## Requirements-### Requirement: Name-#### Scenario: Name-- **WHEN** condition-- **THEN** expected outcome-```--## Comandi CLI--```sh-openspec list-openspec show <name>-openspec status --change <name>-openspec archive <name>-```diff --git a/packages/docs/pl/development/contributing.md b/packages/docs/pl/development/contributing.mdindex 1110be30e..90728c41d 100644--- a/packages/docs/pl/development/contributing.md+++ b/packages/docs/pl/development/contributing.md@@ -24,7 +24,6 @@ tests/e2e/ Regresja wizualna Playwrightengine/ Testy jednostkowe (bun:test)docs/ Strona dokumentacji VitePress-openspec/specs/ Specyfikacje możliwości (źródło prawdy)changes/ Aktywne i zarchiwizowane zmiany```@@ -67,8 +66,6 @@ Deweloperzy i agenci AI powinni przeczytać `AGENTS.md` w katalogu głównym rep## Wprowadzanie zmian-1. Sprawdzić istniejące [specyfikacje openspec](/development/openspec)-2. Utworzyć zmianę openspec jeśli dodajesz nowe zachowanie: `openspec new change "moja-zmiana"`3. Zaimplementować zmianę4. Uruchomić `bun run check` i `bun run test`5. Wysłać pull requestdiff --git a/packages/docs/pl/development/openspec.md b/packages/docs/pl/development/openspec.mddeleted file mode 100644index de0472869..000000000--- a/packages/docs/pl/development/openspec.md+++ /dev/null@@ -1,73 +0,0 @@-# Workflow OpenSpec--OpenPencil używa OpenSpec do rozwoju opartego na specyfikacjach. Specyfikacje są źródłem prawdy.--## Struktura--```-openspec/-├── specs/ # Source of truth-│ ├── scene-graph/-│ ├── canvas-rendering/-│ ├── auto-layout/-│ └── ... # 19 capability specs-├── changes/-│ └── archive/-└── config.yaml-```--## Bieżące specyfikacje--| Capability | Description |-|-----------|-------------|-| scene-graph | Flat Map, CRUD, hit testing |-| canvas-rendering | CanvasKit WASM rendering |-| auto-layout | Yoga WASM flexbox |-| fig-import | .fig file import |-| kiwi-codec | Kiwi binary codec |-| editor-ui | Vue 3 panels, toolbar |-| desktop-app | Tauri v2 |-| testing | Playwright + bun:test |-| tooling | Vite, oxlint, tsgo |--## Workflow--### 1. Zaproponuj zmianę--```-/opsx:propose change-name-```--→ proposal.md, design.md, specs/, tasks.md--### 2. Implementuj--```-/opsx:apply-```--### 3. Archiwizuj--```-/opsx:archive-```--## Format specyfikacji--```markdown-# capability-name Specification-## Requirements-### Requirement: Name-#### Scenario: Name-- **WHEN** condition-- **THEN** expected outcome-```--## Polecenia CLI--```sh-openspec list-openspec show <name>-openspec status --change <name>-openspec archive <name>-```diff --git a/packages/docs/ru/development/contributing.md b/packages/docs/ru/development/contributing.mdindex 327d72987..8383b4a77 100644--- a/packages/docs/ru/development/contributing.md+++ b/packages/docs/ru/development/contributing.md@@ -24,7 +24,6 @@ tests/e2e/ Визуальная регрессия Playwrightengine/ Юнит-тесты (bun:test)docs/ Сайт документации VitePress-openspec/specs/ Спецификации возможностей (источник истины)changes/ Активные и архивные изменения```@@ -67,8 +66,6 @@ bun run check## Внесение изменений-1. Проверьте существующие [спецификации openspec](/ru/development/openspec) для изменяемой возможности-2. Создайте openspec-изменение при добавлении нового поведения: `openspec new change "my-change"`3. Реализуйте изменение4. Запустите `bun run check` и `bun run test`5. Создайте pull requestdiff --git a/packages/docs/ru/development/openspec.md b/packages/docs/ru/development/openspec.mddeleted file mode 100644index 2ed87d6af..000000000--- a/packages/docs/ru/development/openspec.md+++ /dev/null@@ -1,107 +0,0 @@-# Рабочий процесс OpenSpec--OpenPencil использует [OpenSpec](https://github.com/Fission-AI/OpenSpec) для разработки на основе спецификаций. Спецификации — это источник истины о том, что делает система.--## Структура--```-openspec/-├── specs/ # Источник истины: как система работает сейчас-│ ├── scene-graph/-│ │ └── spec.md-│ ├── canvas-rendering/-│ │ └── spec.md-│ ├── auto-layout/-│ │ └── spec.md-│ └── ... # Всего 19 спецификаций возможностей-├── changes/ # Предлагаемые изменения (один каталог на изменение)-│ └── archive/ # Завершённые изменения-└── config.yaml # Опциональная конфигурация-```--## Текущие спецификации--| Возможность | Описание |-|-------------|----------|-| scene-graph | Хранение в плоском Map, CRUD, проверка попадания |-| canvas-rendering | Конвейер отрисовки CanvasKit WASM |-| canvas-navigation | Панорамирование, масштабирование, инструмент «Рука» |-| selection-manipulation | Выделение кликом/рамкой, перемещение, масштабирование, поворот |-| undo-redo | Паттерн обратных команд |-| text-editing | Инструмент «Текст», Paragraph API, загрузка шрифтов |-| pen-tool | Модель векторных сетей, кривые Безье |-| auto-layout | Yoga WASM flexbox, переключение через Shift+A |-| figma-clipboard | Двусторонний бинарный Kiwi-буфер обмена |-| fig-import | Конвейер импорта .fig файлов |-| kiwi-codec | Бинарный кодек Kiwi, разреженные ID полей |-| editor-ui | Панели Vue 3, панель инструментов, палитра цветов |-| snap-guides | Привязка к краям/центрам, с учётом поворота |-| rulers | Линейки на холсте, подсветка выделения |-| group-ungroup | <kbd>⌘</kbd><kbd>G</kbd> / <kbd>⇧</kbd><kbd>⌘</kbd><kbd>G</kbd>, сортировка по позиции |-| desktop-app | Tauri v2, строка меню macOS |-| testing | Playwright E2E, юнит-тесты bun:test |-| scrub-input | Ввод чисел перетаскиванием |-| tooling | Vite 7, oxlint, oxfmt, tsgo, VitePress |--## Рабочий процесс--### 1. Предложить изменение--```-/opsx:propose add-dark-mode-```--Создаёт каталог `openspec/changes/add-dark-mode/` с:-- `proposal.md` — зачем и какие изменения-- `design.md` — технический подход-- `specs/` — дельта-спецификации (ADDED/MODIFIED/REMOVED требования)-- `tasks.md` — чеклист реализации--### 2. Реализовать--```-/opsx:apply-```--Выполнение задач из tasks.md с отметкой выполненных пунктов.--### 3. Архивировать--```-/opsx:archive-```--- Объединяет дельта-спецификации с `openspec/specs/` (базовые спецификации)-- Перемещает изменение в `openspec/changes/archive/`--## Формат спецификаций--Каждый файл спецификации следует единообразной структуре:--```markdown-# capability-name Specification--## Purpose-Однострочное описание назначения этой возможности.--## Requirements--### Requirement: Name-Описание с использованием SHALL/MUST для нормативных требований.--#### Scenario: Name-- **WHEN** условие-- **THEN** ожидаемый результат-```--Каждое требование содержит хотя бы один сценарий. Сценарии — это потенциальные тест-кейсы.--## Команды CLI--```sh-openspec list # Список активных изменений-openspec show <name> # Показать детали изменения-openspec status --change <name> # Статус артефактов-openspec archive <name> # Архивировать завершённое изменение-openspec update # Пересоздать навыки/промпты-```diff --git a/vite.config.ts b/vite.config.tsindex d7e26b182..018774ab8 100644--- a/vite.config.ts+++ b/vite.config.ts@@ -103,7 +103,6 @@ export default defineConfig(async () => ({'**/packages/mcp/**','**/packages/docs/**','**/tests/**',- '**/openspec/**','**/.worktrees/**','**/.github/**','**/.pi/**'