Skip to content

Commit 12bcb2a

Browse files
committed
feat: add Claude Code plugin support, wiki sync CI, marketplace docs
- Add update-marketplace job to release.yml (auto-updates CLI version in marketplace) - Add wiki-sync.yml workflow (syncs docs/wiki/ to GitHub Wiki on push) - Add Claude Code Integration section to Getting-Started.md - Add Claude Code Plugin section to AGENTS.md with skill update checklist
1 parent 54f0351 commit 12bcb2a

6 files changed

Lines changed: 190 additions & 2 deletions

File tree

.github/workflows/release.yml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -183,3 +183,47 @@ jobs:
183183
with:
184184
generate_release_notes: true
185185
files: ./release-assets/*
186+
187+
update-marketplace:
188+
needs: release
189+
runs-on: ubuntu-latest
190+
steps:
191+
- name: Extract version from tag
192+
id: version
193+
run: echo "VERSION=${GITHUB_REF_NAME#v}" >> $GITHUB_OUTPUT
194+
195+
- name: Checkout marketplace
196+
uses: actions/checkout@v4
197+
with:
198+
repository: RoboNET/FlexRender-Marketplace
199+
token: ${{ secrets.MARKETPLACE_PAT }}
200+
path: marketplace
201+
202+
- name: Update cli-version.json
203+
run: |
204+
cd marketplace
205+
python3 -c "
206+
import json
207+
with open('flexrender/cli-version.json') as f:
208+
data = json.load(f)
209+
data['recommendedVersion'] = '${{ steps.version.outputs.VERSION }}'
210+
with open('flexrender/cli-version.json', 'w') as f:
211+
json.dump(data, f, indent=2)
212+
f.write('\n')
213+
"
214+
215+
- name: Create PR
216+
working-directory: marketplace
217+
env:
218+
GH_TOKEN: ${{ secrets.MARKETPLACE_PAT }}
219+
run: |
220+
git config user.name "github-actions[bot]"
221+
git config user.email "github-actions[bot]@users.noreply.github.com"
222+
git checkout -b update-cli-${{ steps.version.outputs.VERSION }}
223+
git add flexrender/cli-version.json
224+
git commit -m "chore: update recommendedVersion to ${{ steps.version.outputs.VERSION }}"
225+
git push origin update-cli-${{ steps.version.outputs.VERSION }}
226+
gh pr create \
227+
--title "Update CLI to v${{ steps.version.outputs.VERSION }}" \
228+
--body "Automated update from FlexRender release v${{ steps.version.outputs.VERSION }}" \
229+
--base main

.github/workflows/wiki-sync.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: Sync Wiki
2+
3+
on:
4+
push:
5+
branches: [main]
6+
paths:
7+
- 'docs/wiki/**'
8+
9+
permissions:
10+
contents: write
11+
12+
jobs:
13+
sync-wiki:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- name: Checkout repo
17+
uses: actions/checkout@v4
18+
19+
- name: Checkout wiki
20+
uses: actions/checkout@v4
21+
with:
22+
repository: ${{ github.repository }}.wiki
23+
path: wiki
24+
token: ${{ secrets.GITHUB_TOKEN }}
25+
26+
- name: Sync wiki files
27+
run: |
28+
cp docs/wiki/*.md wiki/
29+
cd wiki
30+
git config user.name "github-actions[bot]"
31+
git config user.email "github-actions[bot]@users.noreply.github.com"
32+
git add -A
33+
if git diff --cached --quiet; then
34+
echo "No changes to sync"
35+
else
36+
git commit -m "docs: sync wiki from docs/wiki ($(date -u +%Y-%m-%dT%H:%M:%SZ))"
37+
git push
38+
fi

AGENTS.md

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -403,6 +403,51 @@ var sb = new StringBuilder(estimatedCapacity);
403403
- [ ] `Span<T>` used for string/array slicing instead of `Substring()`/`Array.Copy()`
404404
- [ ] SKPaint/SKFont objects are reused or pooled, not created per-element
405405

406+
## Claude Code Plugin (FlexRender-Marketplace)
407+
408+
The FlexRender plugin for Claude Code lives in a separate repository: [`RoboNET/FlexRender-Marketplace`](https://github.com/RoboNET/FlexRender-Marketplace).
409+
410+
**When to update the plugin skills:**
411+
412+
Any change to the following areas requires updating the corresponding skill in the marketplace repo:
413+
414+
| Changed Area | Skill to Update | Skill Path |
415+
|-------------|-----------------|------------|
416+
| YAML template syntax, element types, properties, expressions | `template` | `flexrender/skills/template/SKILL.md` |
417+
| C# API, FlexRenderBuilder, AST classes, NuGet packages, DI | `template-csharp` | `flexrender/skills/template-csharp/SKILL.md` |
418+
| Content parsers (Markdown, HTML, NDC), IContentParser API | `content-formats` | `flexrender/skills/content-formats/SKILL.md` |
419+
| CLI commands, options, output formats | `template` | `flexrender/skills/template/SKILL.md` (CLI Reference section) |
420+
421+
**Checklist for code changes:**
422+
423+
- [ ] If YAML syntax changed — update `template` skill
424+
- [ ] If new element type added — update `template` skill (Element Types + Common Properties)
425+
- [ ] If template expressions changed — update `template` skill (Template Expressions section)
426+
- [ ] If C# public API changed — update `template-csharp` skill
427+
- [ ] If NuGet package added/renamed — update `template-csharp` skill (NuGet Package Selection)
428+
- [ ] If content parser changed — update `content-formats` skill
429+
- [ ] If CLI command added/changed — update `template` skill (CLI Reference section)
430+
- [ ] If `KnownProperties.cs` updated — check if `template` skill needs property table updates
431+
432+
**Plugin structure:**
433+
434+
```
435+
flexrender-marketplace/flexrender/
436+
├── .claude-plugin/plugin.json # Plugin manifest
437+
├── cli-version.json # CLI version requirements (auto-updated by CI)
438+
├── hooks/hooks.json # SessionStart hook for CLI auto-install
439+
├── scripts/
440+
│ ├── run-hook.cmd # Cross-platform polyglot wrapper
441+
│ └── ensure-cli.sh # CLI check/install script
442+
├── skills/
443+
│ ├── template/SKILL.md # YAML template authoring skill
444+
│ ├── template-csharp/SKILL.md # C# integration skill
445+
│ └── content-formats/SKILL.md # Content parsers skill
446+
└── README.md
447+
```
448+
449+
**CI automation:** The `release.yml` workflow automatically creates a PR in the marketplace repo to update `cli-version.json` when a new FlexRender version is released.
450+
406451
## Common Tasks
407452

408453
### Add new element type

docs/wiki/Getting-Started.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -346,6 +346,25 @@ var render = new FlexRenderBuilder()
346346
.Build();
347347
```
348348

349+
## Claude Code Integration
350+
351+
Install the FlexRender plugin to get AI-assisted template authoring, live preview, and CLI management:
352+
353+
```bash
354+
# Add the marketplace (one-time)
355+
claude plugins add-marketplace https://github.com/RoboNET/FlexRender-Marketplace
356+
357+
# Install the plugin
358+
claude plugins install flexrender@FlexRender-Marketplace
359+
```
360+
361+
The plugin provides three skills:
362+
- **`template`** -- create, edit, debug YAML templates with live watch preview
363+
- **`template-csharp`** -- C# AST integration, NuGet package selection, builder API
364+
- **`content-formats`** -- Markdown, HTML, and NDC content parser reference
365+
366+
The CLI (`flexrender`) is automatically installed on first session start.
367+
349368
## Next Steps
350369

351370
- [[Template-Syntax]] -- learn all element types and properties

llms-full.txt

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -898,6 +898,25 @@ Key features:
898898
- Form feed, line spacing, tab controls
899899

900900
```yaml
901+
# Load NDC data from a local file
902+
- type: content
903+
source: "file:ndc-data/receipt.bin"
904+
format: ndc
905+
options:
906+
columns: 40
907+
font_family: "JetBrains Mono"
908+
charsets:
909+
I:
910+
font: bold
911+
font_style: bold
912+
encoding: qwerty-jcuken
913+
uppercase: true
914+
J:
915+
encoding: qwerty-jcuken
916+
"2":
917+
font: default
918+
919+
# Or load from a template variable (C# API with BytesValue)
901920
- type: content
902921
source: "{{receiptData}}"
903922
format: ndc
@@ -911,6 +930,18 @@ Key features:
911930
font_style: bold
912931
```
913932

933+
NDC options:
934+
- `columns` -- receipt width in characters (default: 40, standard for 80mm thermal printers)
935+
- `input_encoding` -- byte encoding: `latin1` (default), `utf-8`, `ascii`
936+
- `font_family` -- monospaced font for accurate column alignment
937+
- `char_width_ratio` -- character width ratio (default: 0.6)
938+
- `charsets` -- per-charset styling keyed by designator character from `ESC(X` sequences:
939+
- `encoding` -- `qwerty-jcuken` (Latin→Cyrillic), `none`, `ascii`
940+
- `font` / `font_style` -- font name or style (`bold`, `italic`, `bold-italic`, `regular`)
941+
- `font_size` -- explicit size in pixels (auto-calculated if omitted)
942+
- `color` -- text color (hex)
943+
- `uppercase` -- convert to uppercase after encoding
944+
914945
Register via `.WithNdc()` (FlexRender.Content.Ndc package, 0 external dependencies).
915946

916947
## Color Format

llms.txt

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -284,15 +284,26 @@ Binary sources pass `ReadOnlyMemory<byte>` directly to `IBinaryContentParser` im
284284

285285
#### NDC Content
286286
```yaml
287+
# Load NDC data from a local .bin file
287288
- type: content
288-
source: "{{receiptData}}"
289+
source: "file:ndc-data/receipt.bin"
289290
format: ndc
290291
options:
291292
columns: 40
292293
font_family: "JetBrains Mono"
294+
charsets:
295+
I:
296+
font: bold
297+
font_style: bold
298+
encoding: qwerty-jcuken
299+
uppercase: true
300+
J:
301+
encoding: qwerty-jcuken
302+
"2":
303+
font: default
293304
```
294305

295-
Requires NDC parser registration: `.WithNdc()` (FlexRender.Content.Ndc). Parses binary NDC ATM printer data streams. Supports charset switching, QWERTY→JCUKEN encoding, embedded barcodes, auto font sizing.
306+
Requires NDC parser registration: `.WithNdc()` (FlexRender.Content.Ndc). Parses binary NDC ATM printer data streams. Source can be `file:path`, `{{variable}}` (with `BytesValue`), or `data:` URI. Options: `columns` (default 40), `input_encoding` (`latin1`/`utf-8`/`ascii`), `charsets` with per-charset `encoding` (`qwerty-jcuken`), `font_style`, `uppercase`, `color`.
296307

297308
## YAML Validation
298309

0 commit comments

Comments
 (0)