Skip to content

Commit 5cf529c

Browse files
Justin-dynamsoftShen-wbTom-DynamsoftCopilotTimothy-Dynamsoft
authored
Skill (#307)
* Update package.json * Init skills * Update license string in SDK documentation to reflect new default key * Add AI coding skill section to README for enhanced developer guidance * Enhance scan & search sample; add filter options for barcode formats, text length & Rex * Sync Zip package dx improvements (#303) * Improve ZIP package first impression (P0 items) - Move hello-world/scan-single/read-image into basics/ subdirectory - Inline favicon (base64) and logo SVG into index.html, remove loose files - Fix scan-a-single-barcode.html title (was copy-pasted from hello-world) - Add meta description, keywords, and canonical tags to all basics samples - Update all links in index.html and README.md to reflect new paths EOF ) * Fix remaining P0 issues and add README.html - Fix canonical URL in read-an-image.html (missing basics/ path) - Fix canonical URL in read-and-parse-GS1-AI (wrong sub-path) - Add LICENSE ALERT comment to hello-world.html and scan-a-single-barcode.html for consistency - Fix documentation link in README.md (point to user-guide) - Add styled README.html for local/ZIP readability * Align README.html and README.md content * Add file:// detection tip to camera-based basics samples Show a non-blocking yellow banner when opened via file:// suggesting the user serve the page from a web server for the best experience. * Add .gitattributes to slim down ZIP downloads * Potential fix for pull request finding Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> --------- Co-authored-by: Tom Kent <Tom-Dynamsoft@users.noreply.github.com> Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> * Improve ZIP package developer experience (#301) * Improve ZIP package first impression (P0 items) - Move hello-world/scan-single/read-image into basics/ subdirectory - Inline favicon (base64) and logo SVG into index.html, remove loose files - Fix scan-a-single-barcode.html title (was copy-pasted from hello-world) - Add meta description, keywords, and canonical tags to all basics samples - Update all links in index.html and README.md to reflect new paths EOF ) * Fix remaining P0 issues and add README.html - Fix canonical URL in read-an-image.html (missing basics/ path) - Fix canonical URL in read-and-parse-GS1-AI (wrong sub-path) - Add LICENSE ALERT comment to hello-world.html and scan-a-single-barcode.html for consistency - Fix documentation link in README.md (point to user-guide) - Add styled README.html for local/ZIP readability * Align README.html and README.md content * Add file:// detection tip to camera-based basics samples Show a non-blocking yellow banner when opened via file:// suggesting the user serve the page from a web server for the best experience. * Add .gitattributes to slim down ZIP downloads * Potential fix for pull request finding Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> --------- Co-authored-by: Justin-dynamsoft <117710848+Justin-dynamsoft@users.noreply.github.com> Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> * Fix license key inconsistency; add BarcodeFormatIds reference and dynamic settings API - Replace incorrect license key in SKILL.md (5 occurrences) to match all reference files and actual samples - Add complete EnumBarcodeFormat table (45+ BF_* values) to api-sdk.md - Add common format presets for templates (retail, industrial, 2D) - Add dynamic settings modification pattern (outputSettings → modify → initSettings) - Document custom template usage with capture() for image decoding - Note framework template placement (public/ directory) * Add advanced DCE APIs to api-camera.md - Camera selection (getAllCameras, selectCamera) - Resolution control (setResolution, getResolution) - Enhanced features (auto-zoom, tap-to-focus) - Video fit mode, single frame mode - Coordinate conversion (convertToPageCoordinates, convertToClientCoordinates) - Tip messages (setTipConfig, updateTipMessage, setTipVisible, TipConfig interface) - Audio feedback (Feedback.beep) - Drawing layers and custom overlays (DrawingLayer, DrawingStyleManager) - UI element customization (hide camera/resolution dropdowns) * Expand Next.js section with full App Router guidance - Replace 4-line stub with complete Next.js App Router documentation - Server vs client component architecture diagram - Page wrapper pattern with next/dynamic and ssr: false - Custom template placement in public/ directory - Server component layout example (no SDK imports) - Next.js-specific rules (5 key points) - Fix MD040 lint warnings (add language to fenced code blocks) * Add CodeParser reference, update SKILL.md routing table, expand evals - New api-parsing.md: CodeParser API for GS1, driver's license (AAMVA), VIN parsing with complete patterns (loadSpec, parse, onParsedResultsReceived) - Update SKILL.md routing table to include api-parsing.md - Update .claude/skills/ descriptions to reflect new content in all ref files - Expand evals from 5 to 10 test cases covering: Next.js App Router, tip messages + beep, dynamic format filtering, GS1 parsing, auto-zoom * Add DCE Advanced Features license note to api-camera.md Clarify that EF_AUTO_ZOOM and EF_TAP_TO_FOCUS require a DCE Advanced Features license, while tip messages, Feedback.beep(), and other CameraView/CameraEnhancer APIs work with a standard DBR license. * Update dedicated license string in SKILL.md for data tracking & enhance barcode reading options in api-sdk.md * Refine README.md for Scan and Search sample * Add ImageEditorView API reference to skill Document ImageEditorView for displaying decoded images with barcode highlights using QuadDrawingItem — replaces manual canvas coordinate mapping with SDK-native drawing layers. * Add DCV bundle guidance, singleFrameMode caveats, and DrawingLayer viewer mode Learnings from building the tip-and-beep sample: - ImageEditorView requires dcv.bundle.js (not in dbr.bundle as of v11.4, expected v11.6+) - singleFrameMode is unreliable for advanced UX (cross-filter conflict) - DrawingLayer.setMode("viewer") prevents interaction with overlays * Add Pattern 9: DPM DataMatrix to sample-patterns.md * Revert "Add Pattern 9: DPM DataMatrix to sample-patterns.md" This reverts commit e871359. * Add tip-and-beep sample: camera scanning with tip messages, beep, and… (#306) * Update index.html * Add tip-and-beep scenario with camera scanning and feedback features * Add SKILL.md for dbr-js-sample-creator and update README for local file access --------- Co-authored-by: SHEN <1014628363@qq.com> Co-authored-by: Tom Kent <Tom-Dynamsoft@users.noreply.github.com> Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> Co-authored-by: timothy-dynamsoft <timothy.chan@dynamsoft.com> Co-authored-by: SHEN <shen@dynamsoft.com>
1 parent 08a7174 commit 5cf529c

21 files changed

Lines changed: 3861 additions & 137 deletions

File tree

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
---
2+
name: dbr-js-sample-creator
3+
description: >
4+
Use when creating JavaScript, TypeScript, or HTML sample code using the Dynamsoft Barcode Reader
5+
SDK (dynamsoft-barcode-reader-bundle npm package or CDN). This skill covers all web barcode
6+
scanning use cases including live camera scanning, image file decoding, single-barcode scanning,
7+
QR codes, 1D barcodes, DataMatrix, PDF417, DPM, and framework integrations (React, Vue, Angular,
8+
Next.js, Nuxt, Svelte, Electron, Capacitor, Blazor, PWA, ES6 modules, plain HTML).
9+
Use this skill whenever the user mentions Dynamsoft Barcode Reader JavaScript, DBR JS,
10+
dynamsoft-barcode-reader-bundle, CaptureVisionRouter in the browser, barcode scanning with
11+
Dynamsoft in a web app, or wants to create a JavaScript/TypeScript sample that scans or decodes
12+
barcodes.
13+
---
14+
15+
# DBR JavaScript Sample Creator
16+
17+
The canonical skill definition lives in `.github/skills/dbr-js-sample-creator/`.
18+
19+
**Read `.github/skills/dbr-js-sample-creator/SKILL.md` and its `references/` directory now.**
20+
21+
The `SKILL.md` file contains:
22+
- SDK architecture overview and loading methods (CDN UMD, CDN ES module, npm)
23+
- License initialization patterns and the default public trial key
24+
- Camera scanning and image capture code patterns
25+
- Code style conventions for this repository
26+
27+
The `references/` directory contains:
28+
- `api-sdk.md` — SDK loading, namespaces, CoreModule, preset templates, BarcodeFormatIds, dynamic settings
29+
- `api-camera.md` — CameraView, CameraEnhancer, tip messages, auto-zoom, drawing layers, audio feedback
30+
- `api-image.md` — File capture, CapturedResult, BarcodeResultItem properties
31+
- `api-frameworks.md` — React, Vue, Angular, Next.js (App Router) complete component patterns
32+
- `api-parsing.md` — CodeParser for GS1, driver's license (AAMVA), VIN parsing
33+
- `sample-patterns.md` — Copy-paste ready code for all common scenarios
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
---
2+
name: dbr-js-sample-creator
3+
description: >
4+
Use when creating JavaScript, TypeScript, or HTML sample code using the Dynamsoft Barcode Reader
5+
SDK (dynamsoft-barcode-reader-bundle npm package or CDN). This skill covers all web barcode
6+
scanning use cases including live camera scanning, image file decoding, single-barcode scanning,
7+
QR codes, 1D barcodes, DataMatrix, PDF417, DPM, and framework integrations (React, Vue, Angular,
8+
Next.js, Nuxt, Svelte, Electron, Capacitor, Blazor, PWA, ES6 modules, plain HTML).
9+
Use this skill whenever the user mentions Dynamsoft Barcode Reader JavaScript, DBR JS,
10+
dynamsoft-barcode-reader-bundle, CaptureVisionRouter in the browser, barcode scanning with
11+
Dynamsoft in a web app, or wants to create a JavaScript/TypeScript sample that scans or decodes
12+
barcodes.
13+
---
14+
15+
# DBR JavaScript Sample Creator
16+
17+
The canonical skill definition lives in `.github/skills/dbr-js-sample-creator/`.
18+
19+
**Read `.github/skills/dbr-js-sample-creator/SKILL.md` and its `references/` directory now.**
20+
21+
The `SKILL.md` file contains:
22+
- SDK architecture overview and loading methods (CDN UMD, CDN ES module, npm)
23+
- License initialization patterns and the default public trial key
24+
- Camera scanning and image capture code patterns
25+
- Code style conventions for this repository
26+
27+
The `references/` directory contains:
28+
- `api-sdk.md` — SDK loading, namespaces, CoreModule, preset templates, BarcodeFormatIds, dynamic settings
29+
- `api-camera.md` — CameraView, CameraEnhancer, tip messages, auto-zoom, drawing layers, audio feedback
30+
- `api-image.md` — File capture, CapturedResult, BarcodeResultItem properties
31+
- `api-frameworks.md` — React, Vue, Angular, Next.js (App Router) complete component patterns
32+
- `api-parsing.md` — CodeParser for GS1, driver's license (AAMVA), VIN parsing
33+
- `sample-patterns.md` — Copy-paste ready code for all common scenarios
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
---
2+
name: dbr-js-sample-creator
3+
description: >
4+
Use when creating JavaScript, TypeScript, or HTML sample code using the Dynamsoft Barcode Reader
5+
SDK (dynamsoft-barcode-reader-bundle npm package or CDN). This skill covers all web barcode
6+
scanning use cases including live camera scanning, image file decoding, single-barcode scanning,
7+
QR codes, 1D barcodes, DataMatrix, PDF417, DPM, and framework integrations (React, Vue, Angular,
8+
Next.js, Nuxt, Svelte, Electron, Capacitor, Blazor, PWA, ES6 modules, plain HTML).
9+
Use this skill whenever the user mentions Dynamsoft Barcode Reader JavaScript, DBR JS,
10+
dynamsoft-barcode-reader-bundle, CaptureVisionRouter in the browser, barcode scanning with
11+
Dynamsoft in a web app, or wants to create a JavaScript/TypeScript sample that scans or decodes
12+
barcodes.
13+
---
14+
15+
# DBR JavaScript Sample Creator
16+
17+
The canonical skill definition lives in `.github/skills/dbr-js-sample-creator/`.
18+
19+
**Read `.github/skills/dbr-js-sample-creator/SKILL.md` and its `references/` directory now.**
20+
21+
The `SKILL.md` file contains:
22+
- SDK architecture overview and loading methods (CDN UMD, CDN ES module, npm)
23+
- License initialization patterns and the default public trial key
24+
- Camera scanning and image capture code patterns
25+
- Code style conventions for this repository
26+
27+
The `references/` directory contains:
28+
- `api-sdk.md` — SDK loading, namespaces, CoreModule, preset templates
29+
- `api-camera.md` — CameraView, CameraEnhancer, result receiver, dedup filter
30+
- `api-image.md` — File capture, CapturedResult, BarcodeResultItem properties
31+
- `api-frameworks.md` — React, Vue, Angular complete component patterns
32+
- `sample-patterns.md` — Copy-paste ready code for all common scenarios
Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
# DBR JavaScript Sample Creator — AI Coding Skill
2+
3+
An AI coding skill that helps developers quickly build working web applications with the
4+
[Dynamsoft Barcode Reader JavaScript Edition](https://www.dynamsoft.com/barcode-reader/sdk-javascript/)
5+
SDK. Feed this skill to your AI agent (GitHub Copilot, Claude, Cursor, Windsurf, etc.) and
6+
describe what you need — the agent will generate correct, production-ready code.
7+
8+
## Who Is This For?
9+
10+
Developers evaluating or integrating the `dynamsoft-barcode-reader-bundle` JavaScript SDK who want
11+
to **accelerate POC development** using AI coding assistants. Instead of reading through
12+
documentation and samples manually, let your AI agent do the heavy lifting with full SDK knowledge
13+
built in.
14+
15+
## No Installation Required
16+
17+
This skill is organized into agent-specific directories so it is **auto-discovered** with no
18+
configuration needed:
19+
20+
| Directory | Agent |
21+
|---|---|
22+
| `.github/skills/dbr-js-sample-creator/` | GitHub Copilot (auto-discovered) |
23+
| `.claude/skills/dbr-js-sample-creator/` | Claude Code (auto-discovered) |
24+
| `.codex/skills/dbr-js-sample-creator/` | OpenAI Codex (auto-discovered) |
25+
26+
Just clone the repository and open it in your AI-enabled editor. The skill is active immediately.
27+
28+
## What's Inside
29+
30+
```
31+
.github/skills/dbr-js-sample-creator/
32+
├── SKILL.md # Entry point — SDK architecture, patterns, conventions
33+
├── README.md # This file
34+
├── references/
35+
│ ├── api-sdk.md # SDK loading (CDN/npm/ES6), namespaces, CoreModule, templates
36+
│ ├── api-camera.md # CameraView, CameraEnhancer, result receiver, filter
37+
│ ├── api-image.md # File/image capture, CapturedResult, BarcodeResultItem
38+
│ ├── api-frameworks.md # React, Vue, Angular integration patterns
39+
│ └── sample-patterns.md # Complete working code for every common scenario
40+
└── evals/
41+
└── evals.json # Test prompts & expectations for skill validation
42+
43+
.claude/skills/dbr-js-sample-creator/SKILL.md # Claude Code entry point
44+
.codex/skills/dbr-js-sample-creator/SKILL.md # Codex entry point
45+
```
46+
47+
The AI agent reads `SKILL.md` first, which directs it to the appropriate reference files based on
48+
your task. You do not need to understand these files — they are written for the AI.
49+
50+
## SDK at a Glance
51+
52+
- **Package:** `dynamsoft-barcode-reader-bundle@11.4.2001`
53+
- **CDN:** `https://cdn.jsdelivr.net/npm/dynamsoft-barcode-reader-bundle@11.4.2001/dist/dbr.bundle.js`
54+
- **npm:** `npm install dynamsoft-barcode-reader-bundle`
55+
- **Trial license:** [Get a 30-day free trial](https://www.dynamsoft.com/customer/license/trialLicense?product=dbr&package=js&utm_source=sampleReadme)
56+
57+
## Example Prompts
58+
59+
Once the skill is active, try prompts like:
60+
61+
| Prompt | What the AI generates |
62+
|---|---|
63+
| *"Create a plain HTML barcode scanner with camera"* | Full HTML with CDN UMD, camera pipeline, dedup filter |
64+
| *"Build a React component that scans barcodes from camera"* | TypeScript React component with proper lifecycle + cleanup |
65+
| *"Make a Vue 3 image barcode decoder"* | Vue SFC with `<script setup>`, Composition API, file input |
66+
| *"Scan QR codes only using a custom template"* | Custom JSON template with `BF_QR_CODE` filter + HTML page |
67+
| *"Write an ES6 module barcode scanner"* | `<script type="module">` with named imports from CDN .mjs |
68+
| *"Add barcode scanning to my Angular app"* | Angular component with `ngAfterViewInit` / `ngOnDestroy` |
69+
70+
## Validating the Skill
71+
72+
Test with this prompt:
73+
74+
> *"Write a plain HTML page that uses the Dynamsoft Barcode Reader to scan barcodes via camera
75+
> and display results."*
76+
77+
The AI should produce code that:
78+
- Loads the SDK from CDN
79+
- Calls `Dynamsoft.License.LicenseManager.initLicense()`
80+
- Creates `CameraView`, `CameraEnhancer`, and `CaptureVisionRouter`
81+
- Adds a `CapturedResultReceiver` with `onDecodedBarcodesReceived`
82+
- Adds a `MultiFrameResultCrossFilter` for deduplication
83+
- Appends the camera UI to a container div
84+
- Calls `cameraEnhancer.open()` and `cvRouter.startCapturing("ReadBarcodes_SpeedFirst")`
85+
86+
More test prompts are available in [`evals/evals.json`](evals/evals.json).

0 commit comments

Comments
 (0)