offline-office-editor
Installation
Review the source and dependencies with a prompt. A package is available to download.
Install with an AI assistant
Copy the prompt so your assistant can review the pinned revision and dependencies first.
View promptHide prompt
Check whether SkillPI Skill Finder is installed for your current agent. If it is missing, install and enable it using the official instructions at https://github.com/Findskills/skillpi. Then use Skill Finder to locate and install "offline-office-editor" from this exact SkillPI detail page: https://skillpi.com/skills/deepskill-04556b36825c42ab21b04ccb50db9b119cc0dfcf8d45aa61d3386eca7e705255. Verify the upstream source and version against https://skillhub.cn/skills/user_538e39fa/offline-office-editor before installing. If they do not match, stop and report the mismatch. Report the installed path and source version.
Source and setup
skillhub.cn
Setup guidance pending
See the original source for supported tools, dependencies, and permissions.
Installation test pending
Offline Office Editor Builder: For building and maintaining a single-file, fully offline Office editor (Excel/Word/PowerPoint) reusable pattern implemented in pure JavaScript without a server. Use this skill when adding or fixing features in the C:/office project or for any task that needs offline generation or editing of .xlsx/.docx/.pptx files. Focus areas include conditional formatting, formulas, comments, data validation, charts, hyperlinks, frozen panes or row/column structures, implemented via a SheetJS-based hand-written OOXML injection and read post-processing layer and supported by a jsdom regression test framework.
Introduction source: third_party · user_538e39fa · 1.0.0 Reference
SkillPi interpretation
- Tasks
- The C:/office project is a single-page, zero-backend Office editor. Three editors (Excel grid, Word page, PPT stage) share one `index.html` + per-format engine (`excel.js`, `word.js`, `ppt.js`). A build step inlines every library and script into `office-standalone.html` (≈5.7 MB) so it runs by double-clicking — no server, no CDN, no network.
- Audience
- The user asks to add/fix any feature in the C:/office editors. Any task to generate or edit `.xlsx` / `.docx` / `.pptx` **offline**, especially: conditional formatting (color scale, data bar, formula/cellIs rules), formula engine (absolute/cross-sheet refs, VLOOKUP/HLOOKUP/MATCH/INDEX/IFS), cell comments, data validation, charts, hyperlinks, freeze panes, row/column insert/delete, merged cells, custom styles. When writing or debugging the jsdom regression tests for these features.
- Inputs and outputs
- Not specified in the source documentation.
- Software, accounts and paid services
- Not specified in the source documentation.
- Limits and differences
- Not specified in the source documentation.
- Testing
- Not tested
Browse files
Frontmatter
name: offline-office-editor
description: "Reusable patterns for building and maintaining a single-file, fully offline Office editor (Excel/Word/PowerPoint) in plain JavaScript with no server. Use this skill when adding or fixing features in the C:/office project, or any task that needs to generate or edit .xlsx/.docx/.pptx files offline - especially conditional formatting, formulas, comments, data validation, charts, hyperlinks, freeze panes, or row/column structure - via a hand-rolled OOXML inject and read post-processing layer on top of SheetJS, backed by a jsdom regression-test harness."
agent_created: trueOffline Office Editor
Overview
The C:/office project is a single-page, zero-backend Office editor. Three editors
(Excel grid, Word page, PPT stage) share one index.html + per-format engine
(excel.js, word.js, ppt.js). A build step inlines every library and script
into office-standalone.html (≈5.7 MB) so it runs by double-clicking — no
server, no CDN, no network.
The hard part is not the UI; it is making Excel/Word/PPT files round-trip
correctly. SheetJS (libs/xlsx.full.min.js) reads/writes the zip/XML but silently
drops many features (conditional formatting, comments, data validation, charts,
styles, freeze panes, hyperlinks). The project's solution is a OOXML post-processing
layer: SheetJS produces a baseline file, then small injectXxx functions rewrite
specific XML parts (worksheet, rels, [Content_Types].xml) to add what SheetJS
missed; reverse readXxx functions parse those parts back on open. Regression is
guaranteed by a jsdom harness that loads the real engine and asserts behavior.
When to use this skill
- The user asks to add/fix any feature in the C:/office editors.
- Any task to generate or edit
.xlsx/.docx/.pptxoffline, especially: conditional formatting (color scale, data bar, formula/cellIs rules), formula engine (absolute/cross-sheet refs, VLOOKUP/HLOOKUP/MATCH/INDEX/IFS), cell comments, data validation, charts, hyperlinks, freeze panes, row/column insert/delete, merged cells, custom styles. - When writing or debugging the jsdom regression tests for these features.
Core architecture (read this before editing)
Keep one mental model — it is the same for every feature:
- Single source of truth = plain JS structures, NOT the OOXML. For Excel:
datais a 2D array (ROWS × COLS); everything else is a parallel Map or array keyed byr + ',' + c(per-cell:styleMap,fmtMap,commentMap,borderMap,hyperlinks) or by a range/{r1,c1,r2,c2}(conditional formattingcfRules, data validationdvRules, merges). Word/PPT use analogoussheets[]/elements[]structures. - The editor renders from these structures (
renderCell,renderAll). The file format is a serialization of them, never the source. - Two chain functions own the file boundary:
- Save:
buildAndSaveBuffer()→ produces aBlob. Feature logic lives ininjectXxx(zip, sheetsArr)helpers (see references/ooxml_paradigm.md). - Open:
openWorkbook(buf)→ reads via SheetJS for cell values, then callsreadXxx(buf)helpers to recover dropped features into the JS structures.
- Save:
- Test/debug hooks:
window.__excelDeepexposes internals (setCellValue,getCfRules,addCfRule,cfMatchCell,renderAll,saveToBuffer,openWorkbook,evaluate, …). The jsdom harness drives these to test real engine behavior without a browser.
Workflow: adding a new Excel feature
- Model it. Add the field to the per-cell Map or to
cfRules/dvRules/sheets[]. Decide the in-memory shape first (e.g. a CF rule is{r1,c1,r2,c2,type, ...}). - Render it in
renderCell/renderAll(and add CSS instyles.css). Text must always stay above overlay elements — give.cell-inputposition:relative; z-index:1and overlays (cf-bar, markers) a lowerz-indexwithpointer-events:none. - Export it via an
injectXxxfunction that rewrites the OOXML part, and wire it intobuildAndSaveBufferat the right CT_Worksheet child order. - Import it via a
readXxxfunction parsing the same part; wire intoopenWorkbook(wrap intry/catch— a missing part must not break open). - Expose hooks on
window.__excelDeepso the harness can set state and read state. - Write a regression test
_excel_<feature>_test.js(see references/regression_harness.md and scripts/regression_harness.js). - Rebuild + smoke:
node build-standalone.js, then run_standalone_smoke.jsto confirm 0 load-time errors.
OOXML inject/read paradigm (the non-obvious core)
This is the most important reusable knowledge. Full code patterns, buffer-type
rules, [Content_Types].xml override mechanics, rels wiring, and a worked
conditional-formatting example live in references/ooxml_paradigm.md. Read it
before writing any injectXxx/readXxx function. Key rules (do not skip):
- Injectors take a
JSZipinstance and return anarraybuffer(NOT a Blob) so the next injector canJSZip.loadAsyncit. Only the finalbuildAndSaveBufferwraps the last buffer innew Blob([out]). - Always pair
escapeXmlwithunescapeXmlwhen round-tripping formulas or any text containing<,>,&,"(e.g.>A1>10<in a CF formula). - Keep the model type names distinct from the OOXML type names. Example: the
in-memory CF rule uses
type:'scale'|'bar'|'formula', while the OOXML<cfRule type="colorScale"|"dataBar"|"expression">. Map both directions; a mismatch silently drops the rule on save. XLSX.write(..., {cellStyles:true})thenJSZip.loadAsyncthe array result.
jsdom regression harness
Every feature ships with a test that loads the real engine in jsdom and asserts
behavior (including full save→reopen round-trips). The template, the exact
NODE_PATH, the jsdom ^24 pin, and the two classic harness bugs (un-awaited
async in setTimeout; || -1 turning a legitimate 0 into -1) are detailed in
references/regression_harness.md and the ready-to-copy
scripts/regression_harness.js.
Resources
references/ooxml_paradigm.md— save/read chain, buffer types, Content_Types overrides, rels, worked conditional-formatting + comments examples.references/regression_harness.md— jsdom harness template, env setup, gotchas.scripts/regression_harness.js— copy-paste harness skeleton for a new test.
Current listing version
1.0.0
Safety and assessment details
Quality assessment
Out of 100 · Assessment report from SkillPi LAB.
Highlights
- 提供完整的离线 Office 编辑器开发模式,涵盖 Excel/Word/PPT 的 OOXML 后处理与 SheetJS 增强
- 面向 C:/office 项目维护等明确技术场景,具有高度专业性和实用价值
Highlights
- 触发词完整覆盖 .xlsx/.docx/.pptx 文件格式及 conditional formatting、formulas、comments 等具体功能点
- 使用场景描述清晰,边界明确,便于精准触发
Areas to improve
-
description 重复 Reported severity: Minor
顶层 frontmatter 和 skill_body 内部均包含完整 description,存在冗余
Recommendation: 建议仅在顶层 frontmatter 保留 description,skill_body 内可简化为引用或省略
Highlights
- 文档结构清晰,包含 Overview、Core architecture、Workflow、OOXML paradigm 等完整章节
- 步骤划分明确,有端到端示例指引,frontmatter 完整
Highlights
- 工具来源明确(SheetJS、jsdom),参数规则详细(buffer 类型、XML 转义、模型与 OOXML 类型映射)
- 覆盖主要异常处理(try/catch 包裹 readXxx),并提供 jsdom 回归测试保障
The arithmetic mean of the first four original scores, rounded to a whole number.
Static text checks
100 / 100 · skillpi-20261123-no-r3-v1
No current rules matched the text.
This score reflects rule matches in the text and is provided for reference before use. It excludes attachments and runtime behavior.
Permissions and checks before use
Automatically summarized from this main document. Matches may be examples or defensive advice; they are not actual permission declarations. Attachments, external dependencies and runtime behavior are not covered.
These common operations were not identified in the main document. This does not mean no permissions or risks exist.
Security rating and access scope
safe · Static evidence review; not a runtime safety guarantee.
Not specified in the source documentation.
Before use, confirm and authorize actual file access, external services and network destinations in your host. This review grants no runtime permissions.
User discussion
No verified reviews yet.