@frcloudsolutions/agent-skills 0.1.0 → 0.2.0

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 (30) hide show
  1. package/README.md +1 -1
  2. package/package.json +4 -2
  3. package/plugins/docs-generator/skills/docs-generator/SKILL.md +68 -0
  4. package/plugins/docs-generator/skills/docs-generator/assets/README.md +8 -0
  5. package/plugins/docs-generator/skills/docs-generator/assets/fonts/OFL.txt +93 -0
  6. package/plugins/docs-generator/skills/docs-generator/assets/fonts/PublicSans-Bold.ttf +0 -0
  7. package/plugins/docs-generator/skills/docs-generator/assets/fonts/PublicSans-BoldItalic.ttf +0 -0
  8. package/plugins/docs-generator/skills/docs-generator/assets/fonts/PublicSans-Italic.ttf +0 -0
  9. package/plugins/docs-generator/skills/docs-generator/assets/fonts/PublicSans-Regular.ttf +0 -0
  10. package/plugins/docs-generator/skills/docs-generator/assets/paged.polyfill.min.js +4 -0
  11. package/plugins/docs-generator/skills/docs-generator/locales/en.json +14 -0
  12. package/plugins/docs-generator/skills/docs-generator/locales/es.json +14 -0
  13. package/plugins/docs-generator/skills/docs-generator/locales/pt-BR.json +14 -0
  14. package/plugins/docs-generator/skills/docs-generator/package-lock.json +1697 -0
  15. package/plugins/docs-generator/skills/docs-generator/package.json +28 -0
  16. package/plugins/docs-generator/skills/docs-generator/references/from-design-system.md +48 -0
  17. package/plugins/docs-generator/skills/docs-generator/references/source-format.md +96 -0
  18. package/plugins/docs-generator/skills/docs-generator/references/theme-format.md +77 -0
  19. package/plugins/docs-generator/skills/docs-generator/references/writing-guide.md +39 -0
  20. package/plugins/docs-generator/skills/docs-generator/scripts/docs.mjs +226 -0
  21. package/plugins/docs-generator/skills/docs-generator/scripts/lib/docx.mjs +377 -0
  22. package/plugins/docs-generator/skills/docs-generator/scripts/lib/html.mjs +273 -0
  23. package/plugins/docs-generator/skills/docs-generator/scripts/lib/images.mjs +25 -0
  24. package/plugins/docs-generator/skills/docs-generator/scripts/lib/office.mjs +184 -0
  25. package/plugins/docs-generator/skills/docs-generator/scripts/lib/pdf.mjs +70 -0
  26. package/plugins/docs-generator/skills/docs-generator/scripts/lib/source.mjs +270 -0
  27. package/plugins/docs-generator/skills/docs-generator/scripts/lib/theme.mjs +219 -0
  28. package/plugins/docs-generator/skills/docs-generator/themes/clean-modern.json +36 -0
  29. package/plugins/docs-generator/skills/docs-generator/themes/docs-theme.schema.json +119 -0
  30. package/src/lib/validate.mjs +6 -3
package/README.md CHANGED
@@ -75,7 +75,7 @@ Create the target folder first (`mkdir -p <folder>`) if it does not exist.
75
75
 
76
76
  | Plugin | Skills | Description |
77
77
  |--------|--------|-------------|
78
- | _none yet_ | | The first skills are coming soon. |
78
+ | [`docs-generator`](plugins/docs-generator/skills/docs-generator/SKILL.md) | `docs-generator` | Writes design documents and reports as structured Markdown and renders them to designed PDF and DOCX (cover, contents, executive summary, sources, annexes, change log), plus a matching Excel template and Office theme. Uses your Claude Design System or brand, or a research-based default theme. Needs Node.js 20+; PDF output also needs Chrome, Edge or Chromium. |
79
79
 
80
80
  ## Layout
81
81
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@frcloudsolutions/agent-skills",
3
- "version": "0.1.0",
3
+ "version": "0.2.0",
4
4
  "description": "Install Agent Skills (SKILL.md) into Claude Code, OpenAI Codex, Gemini CLI, Cursor and GitHub Copilot.",
5
5
  "type": "module",
6
6
  "bin": {
@@ -10,11 +10,13 @@
10
10
  "bin/",
11
11
  "src/",
12
12
  "plugins/*/skills/**",
13
+ "!plugins/*/skills/*/node_modules",
14
+ "!plugins/*/skills/*/test",
13
15
  "README.md",
14
16
  "LICENSE"
15
17
  ],
16
18
  "scripts": {
17
- "test": "node --test",
19
+ "test": "node --test test/cli.test.mjs test/pack.test.mjs test/prompt.test.mjs test/validate.test.mjs",
18
20
  "validate": "node scripts/validate-skills.mjs"
19
21
  },
20
22
  "engines": {
@@ -0,0 +1,68 @@
1
+ ---
2
+ name: docs-generator
3
+ description: Writes design documents, reports and proposals as structured Markdown and renders them to consistently designed PDF and DOCX files (cover, table of contents, executive summary, sources, annexes, change log, back cover), plus a matching Excel template and Office theme. Use when the user asks for a document, report, design doc, proposal or white paper as PDF or Word, wants documents to follow their brand or Claude Design System, or wants an Excel or Office theme in the same look.
4
+ ---
5
+
6
+ # Docs generator
7
+
8
+ Turns one Markdown source into a PDF and a DOCX that share the same structure and look, and can produce an Excel template (`.xltx`) and Office theme (`.thmx`) from the same theme. You write Markdown and JSON; the engine in `scripts/` owns every layout decision.
9
+
10
+ Paths below are relative to this skill's folder (the folder that holds this file).
11
+
12
+ ## When to use
13
+
14
+ - The user wants a design document, report, proposal or white paper as a PDF or Word file.
15
+ - The user wants documents in their brand, from their Claude Design System or another design specification.
16
+ - The user wants an Excel template or an Office theme that matches their documents.
17
+
18
+ ## Workflow
19
+
20
+ 1. **Install the engine on first use.** If `node_modules/` does not exist in this skill's folder, run `npm ci --omit=dev` there. Node.js 20 or later is required. PDF output needs Chrome, Edge or Chromium; if none is installed, DOCX and Excel outputs still work (see Troubleshooting).
21
+ 2. **Choose the theme** (next section) and show the user what will be used before the first build.
22
+ 3. **Write the source** following `references/source-format.md`: YAML frontmatter with `title`, `author`, `date`, `version`, `summary`, `changes` (and optionally `subtitle`, `lang`, `sources`, `annexes`), then the body. Apply the writing rules below.
23
+ 4. **Check it:** `node scripts/docs.mjs check <source.md>`. Fix every error and rerun until it passes. Address warnings too (a vague change log entry is a warning).
24
+ 5. **Build:** `node scripts/docs.mjs build <source.md>` writes `<name>.pdf` and `<name>.docx` next to the source. Use `--format pdf` or `--format docx` for one format, `--out <folder>` for another folder, `--theme <file>` for a theme file elsewhere.
25
+ 6. **Report** the output paths to the user. Mention that Word may ask to update fields when the DOCX opens; answering yes refreshes the table of contents after edits.
26
+
27
+ For an **Excel template or Office theme**: `node scripts/docs.mjs office-theme [--theme <file>] [--lang pt-BR|en|es] [--out <folder>]` writes `<theme>.xltx` and `<theme>.thmx`. Tell the user how to use them: open the `.xltx` to start a workbook (new tables use the theme's table style; the named styles are in the Cell Styles gallery); apply the `.thmx` in Excel, Word or PowerPoint under Page Layout or Design → Themes → Browse for Themes. Office does not embed fonts: if the theme font is not installed on the user's machine, point them to the font files (for the default theme, `assets/fonts/`).
28
+
29
+ Every command accepts `--json` for a machine-readable result. Exit codes: 0 success, 1 validation or rendering failure, 2 usage error.
30
+
31
+ ## Choosing the theme
32
+
33
+ Pick the first that applies, and tell the user which one you used:
34
+
35
+ 1. **A theme the user named**, or a `docs-theme.json` next to the source (the engine picks it up automatically).
36
+ 2. **The user's Claude Design System.** If the user has one (or mentions their design system or brand), read its `project/tokens.json` and map it to a `docs-theme.json` as described in `references/from-design-system.md`. Show the user a short table of which tokens you used and which values came from `clean-modern`, and run `node scripts/docs.mjs theme check docs-theme.json` before building.
37
+ 3. **Another design specification** the user points to (a file, a URL, a Style Dictionary or Figma variables export): map it the same way.
38
+ 4. **The bundled `clean-modern` theme**, if the user accepts it: Public Sans, 11 pt body, teal accent, neutral palette, tables with horizontal rules only.
39
+ 5. **Otherwise, a short interview:** ask for the brand's main color, text color if not near-black, fonts (and their files, if they are not common), logo, and page size (A4 or Letter). Create the file with `node scripts/docs.mjs theme init --out docs-theme.json`, edit it with the answers, and run `theme check`.
40
+
41
+ When `theme check` reports a contrast failure, it prints the nearest color that passes. Propose that color to the user rather than changing the brand silently. Theme fields are described in `references/theme-format.md`.
42
+
43
+ ## Writing rules
44
+
45
+ These come from the research behind the default design (sources in `references/writing-guide.md`):
46
+
47
+ - **Lead with the conclusion.** The first sentence of the executive summary is the recommendation or main finding; the first sentence of each section says what the section concludes. Readers scan headings and first sentences.
48
+ - **Descriptive headings.** A reader should know what a section says from its heading alone ("Launch in three phases", not "Approach").
49
+ - **At most three heading levels** (`#`, `##`, `###`); two is better. In annexes, use `#` and `##` only, because the annex title is the first level. `check` rejects deeper headings.
50
+ - **Short paragraphs, lists for parallel items, tables for comparisons.** Bold only a few key phrases; never bold whole paragraphs.
51
+ - **Change log entries say what changed and where**, as full sentences: "Added section 3.2 on data retention", never "Document updated". The newest entry is shown first automatically.
52
+ - **Sources** go in the `sources` list, not as footnotes (footnotes are not supported).
53
+ - Images are local PNG or JPEG files; the alt text becomes the caption.
54
+
55
+ ## Troubleshooting
56
+
57
+ - **`check` reports an unsupported element** (raw HTML, footnotes, reference-style links, horizontal rules, strikethrough): rewrite it with the supported Markdown listed in `references/source-format.md`.
58
+ - **No browser for the PDF:** install Chrome, or run `npx playwright install chromium` in this skill's folder, or set `DOCS_GENERATOR_CHROMIUM` to a Chrome or Chromium executable. `--format docx` works without one.
59
+ - **The dependencies are missing:** the engine prints the `npm ci` command to run.
60
+ - **Review the layout by eye:** `build --preview <folder>` also writes one PNG per PDF page.
61
+
62
+ ## Examples
63
+
64
+ **Input:** "Write a design document for our new scheduling feature as PDF and Word."
65
+ **Output:** a `scheduling-design.md` source in the project, `scheduling-design.pdf` and `scheduling-design.docx` next to it, built with the user's theme or `clean-modern`, and the paths in the reply.
66
+
67
+ **Input:** "Make an Excel template in the same style as our documents."
68
+ **Output:** `<theme>.xltx` and `<theme>.thmx` from the same `docs-theme.json`, with instructions to open or apply them.
@@ -0,0 +1,8 @@
1
+ # Bundled assets
2
+
3
+ | File | Source | License |
4
+ |------|--------|---------|
5
+ | `paged.polyfill.min.js` | [Paged.js](https://pagedjs.org) v0.4.3 (`pagedjs/dist/paged.polyfill.min.js` from npm) | MIT |
6
+ | `fonts/PublicSans-*.ttf` | [Public Sans](https://github.com/uswds/public-sans) v2.001 (`fonts/ttf/`) | SIL Open Font License 1.1, see `fonts/OFL.txt` |
7
+
8
+ To update Paged.js, replace the file with the same path from a newer npm release and run the test suite (`npm test`).
@@ -0,0 +1,93 @@
1
+ Copyright 2015 The Public Sans Project Authors (https://github.com/uswds/public-sans)
2
+
3
+ This Font Software is licensed under the SIL Open Font License, Version 1.1.
4
+ This license is copied below, and is also available with a FAQ at:
5
+ https://scripts.sil.org/OFL
6
+
7
+
8
+ -----------------------------------------------------------
9
+ SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
10
+ -----------------------------------------------------------
11
+
12
+ PREAMBLE
13
+ The goals of the Open Font License (OFL) are to stimulate worldwide
14
+ development of collaborative font projects, to support the font creation
15
+ efforts of academic and linguistic communities, and to provide a free and
16
+ open framework in which fonts may be shared and improved in partnership
17
+ with others.
18
+
19
+ The OFL allows the licensed fonts to be used, studied, modified and
20
+ redistributed freely as long as they are not sold by themselves. The
21
+ fonts, including any derivative works, can be bundled, embedded,
22
+ redistributed and/or sold with any software provided that any reserved
23
+ names are not used by derivative works. The fonts and derivatives,
24
+ however, cannot be released under any other type of license. The
25
+ requirement for fonts to remain under this license does not apply
26
+ to any document created using the fonts or their derivatives.
27
+
28
+ DEFINITIONS
29
+ "Font Software" refers to the set of files released by the Copyright
30
+ Holder(s) under this license and clearly marked as such. This may
31
+ include source files, build scripts and documentation.
32
+
33
+ "Reserved Font Name" refers to any names specified as such after the
34
+ copyright statement(s).
35
+
36
+ "Original Version" refers to the collection of Font Software components as
37
+ distributed by the Copyright Holder(s).
38
+
39
+ "Modified Version" refers to any derivative made by adding to, deleting,
40
+ or substituting -- in part or in whole -- any of the components of the
41
+ Original Version, by changing formats or by porting the Font Software to a
42
+ new environment.
43
+
44
+ "Author" refers to any designer, engineer, programmer, technical
45
+ writer or other person who contributed to the Font Software.
46
+
47
+ PERMISSION & CONDITIONS
48
+ Permission is hereby granted, free of charge, to any person obtaining
49
+ a copy of the Font Software, to use, study, copy, merge, embed, modify,
50
+ redistribute, and sell modified and unmodified copies of the Font
51
+ Software, subject to the following conditions:
52
+
53
+ 1) Neither the Font Software nor any of its individual components,
54
+ in Original or Modified Versions, may be sold by itself.
55
+
56
+ 2) Original or Modified Versions of the Font Software may be bundled,
57
+ redistributed and/or sold with any software, provided that each copy
58
+ contains the above copyright notice and this license. These can be
59
+ included either as stand-alone text files, human-readable headers or
60
+ in the appropriate machine-readable metadata fields within text or
61
+ binary files as long as those fields can be easily viewed by the user.
62
+
63
+ 3) No Modified Version of the Font Software may use the Reserved Font
64
+ Name(s) unless explicit written permission is granted by the corresponding
65
+ Copyright Holder. This restriction only applies to the primary font name as
66
+ presented to the users.
67
+
68
+ 4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
69
+ Software shall not be used to promote, endorse or advertise any
70
+ Modified Version, except to acknowledge the contribution(s) of the
71
+ Copyright Holder(s) and the Author(s) or with their explicit written
72
+ permission.
73
+
74
+ 5) The Font Software, modified or unmodified, in part or in whole,
75
+ must be distributed entirely under this license, and must not be
76
+ distributed under any other license. The requirement for fonts to
77
+ remain under this license does not apply to any document created
78
+ using the Font Software.
79
+
80
+ TERMINATION
81
+ This license becomes null and void if any of the above conditions are
82
+ not met.
83
+
84
+ DISCLAIMER
85
+ THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
86
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
87
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
88
+ OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
89
+ COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
90
+ INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
91
+ DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
92
+ FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
93
+ OTHER DEALINGS IN THE FONT SOFTWARE.