refira-cli 0.2.0 → 0.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/README.md +109 -4
  2. package/dist/index.js +7917 -184
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -86,31 +86,40 @@ refira context
86
86
  ### 4. Page Scaffolding
87
87
 
88
88
  #### `refira scaffold`
89
- Generates a standalone HTML5 starter template pre-configured with:
89
+ Generates a clean HTML5 starter template pre-configured with:
90
90
  - Google Fonts specified in project design tokens.
91
91
  - Tailwind CSS CDN and theme extensions.
92
92
  - Lucide Icons script.
93
93
  - Body content slot marking where agent layout markup should be placed.
94
+ - Optional binding to an existing shared layout (`--layout`).
94
95
 
95
96
  ```bash
97
+ # Scaffold standalone page
96
98
  refira scaffold --page checkout
99
+
100
+ # Scaffold page bound to a shared layout template
101
+ refira scaffold --page analytics --layout dashboard
97
102
  ```
98
103
 
99
104
  Options:
100
105
  - `--page <slug>`: Required page slug (e.g., `checkout`, `dashboard`, `landing`).
106
+ - `--layout <slug>`: Optional layout slug to bind page to a shared layout.
101
107
  - `--output <path>`: Custom destination file path (default: `<slug>.html`).
102
108
 
103
109
  ---
104
110
 
105
- ### 5. Live Preview, Push & Harness Validation
111
+ ### 5. Live Preview, Push & Concurrency Guard
106
112
 
107
113
  #### `refira push` (or `refira preview`)
108
- Inspects an HTML markup file using the Refira Agent Harness. If violations are detected, execution halts with Exit Code 1 and actionable remediation instructions. If valid, the markup is streamed directly to the Refira Canvas.
114
+ Inspects an HTML markup file using the Refira Agent Harness. If violations are detected, execution halts with Exit Code 1 and actionable remediation instructions. If valid, the markup is streamed directly to the Refira Canvas. Supports Optimistic Concurrency Control (OCC) to prevent conflicting agent edits.
109
115
 
110
116
  ```bash
111
117
  refira push checkout.html --page checkout
112
118
  # Alternatively:
113
119
  refira preview checkout.html --page checkout
120
+
121
+ # With optimistic concurrency guard:
122
+ refira push dashboard.html --page dashboard --expected-revision a1b2c3...
114
123
  ```
115
124
 
116
125
  Arguments:
@@ -118,10 +127,106 @@ Arguments:
118
127
 
119
128
  Options:
120
129
  - `--page <slug>`: Target page slug.
130
+ - `--expected-revision <hash>`: Expected SHA-256 revision hash for OCC concurrency guard.
131
+
132
+ ---
133
+
134
+ ### 6. Canvas Annotations & Revision Loops
135
+
136
+ #### `refira annotations`
137
+ Fetches unresolved canvas feedback annotations made by reviewers directly on the canvas elements, allowing agents to perform targeted design iterations.
138
+
139
+ ```bash
140
+ refira annotations --page checkout
141
+ refira annotations --page checkout --format json
142
+ ```
143
+
144
+ Options:
145
+ - `--page <slug>`: Required page slug or ID.
146
+ - `--format <format>`: Output format: `table`, `json`, or `md` (default: `table`).
147
+
148
+ ---
149
+
150
+ ### 7. Layout Focus Management
151
+
152
+ #### `refira layout select`
153
+ Sets the active layout focus for the current project.
154
+
155
+ ```bash
156
+ refira layout select dashboard
157
+ ```
158
+
159
+ #### `refira layout status`
160
+ Displays the current active layout focus and lists all available layouts with their archetype definitions.
161
+
162
+ ```bash
163
+ refira layout status
164
+ ```
165
+
166
+ ---
167
+
168
+ ### 8. Reusable HTML Macro Components
169
+
170
+ #### `refira component add`
171
+ Registers a new reusable HTML macro component in the project catalog.
172
+
173
+ ```bash
174
+ # Register from an HTML snippet file
175
+ refira component add navbar ./components/navbar.html --tags header,nav
176
+
177
+ # Register from inline HTML markup
178
+ refira component add cta-button "<button class=\"px-4 py-2 bg-primary text-white rounded-md\">Get Started</button>" --tags button,cta
179
+ ```
180
+
181
+ Options:
182
+ - `--tags <tags>`: Comma-separated tags (e.g. `header,navigation`).
183
+ - `--project-id <id>`: Target project UUID.
184
+
185
+ #### `refira component list`
186
+ Lists all reusable components registered in the project catalog.
187
+
188
+ ```bash
189
+ refira component list
190
+ ```
191
+
192
+ ---
193
+
194
+ ### 9. JIT Interaction Pattern Guides
195
+
196
+ #### `refira guide`
197
+ Displays Just-In-Time (JIT) HTML5 + Tailwind implementation guidance for complex interaction patterns.
198
+
199
+ ```bash
200
+ refira guide aria
201
+ refira guide forms
202
+ refira guide modals
203
+ refira guide tables
204
+ refira guide components
205
+ ```
206
+
207
+ Topics available: `aria`, `forms`, `modals`, `tables`, `components`.
208
+
209
+ ---
210
+
211
+ ### 10. Workspace Maintenance
212
+
213
+ #### `refira clean`
214
+ Cleans up local agent work directories and scratch files (`.refira-work/`, temporary exports).
215
+
216
+ ```bash
217
+ # Clean local scratch files
218
+ refira clean
219
+
220
+ # Dry run (inspect what would be removed)
221
+ refira clean --dry-run
222
+
223
+ # Clean local scratch and purge server expired tokens
224
+ refira clean --all
225
+ ```
121
226
 
122
227
  ---
123
228
 
124
- ### 6. Agent Skill Installation
229
+ ### 11. Agent Skill Installation
125
230
 
126
231
  #### `refira skill install`
127
232
  Installs the Refira design craftsmanship guide (`SKILL.md`) for AI agents.