| name | document-generation |
| description | Generate professional DOCX, XLSX, PDF, PPTX documents with CPS branding โ reports, formal letters, proposals, presentations, data workbooks, contracts. Trigger - /document-generation (formerly /doc-gen), "generate document", "create report/letter/presentation/spreadsheet", "export as DOCX/PDF/XLSX/PPTX", bilingual English/Arabic output. |
Document Generation
Generate professional Word, Excel, PDF, and PowerPoint documents with CPS branding.
Formerly also invoked as /doc-gen โ that skill has been merged into this one.
What This Does
- Creates DOCX (Word) reports and proposals
- Generates PDF final deliverables
- Creates XLSX (Excel) data exports and trackers
- Builds PPTX (PowerPoint) presentations
- Applies unified CPS branding automatically
- Supports multiple output formats from same content
- Supports bilingual output (English/Arabic)
- Includes headers, footers, page numbers, and confidentiality markings
Instructions for Claude
When this skill is invoked:
-
Identify Document Requirements
- Format: DOCX | XLSX | PDF | PPTX
- Type: Report | Letter | Proposal | Presentation | Spreadsheet | Contract
- Language: English | Arabic | Bilingual
- Confidentiality: Public | Internal | Confidential | Strictly Confidential
-
Gather Content Requirements
- Document title
- Sections/content
- Tables or data
- Output location
-
Generate Document Using Unified System
DOCX โ always cps_docgen.py (English AND Arabic). The JS generator
(cps-document-generator.js) has no RTL/bidi support at all โ an Arabic
DOCX built through it would render broken (see CHANGELOG.md, 2026-08-04
entries, for the specific bugs this cost hours to track down: missing
section-level w:bidi, and w:jc="right" being spec-ambiguous on a bidi
paragraph where Word requires the logical w:jc="start" instead). Rather
than maintain that RTL logic in two places, DOCX generation goes through
cps_docgen.py exclusively โ for English documents too, so there's one
generator, one set of house-style rules, and no drift between them.
import sys, os
sys.path.insert(0, os.environ["CLAUDE_PLUGIN_ROOT"] + "/scripts")
from cps_docgen import CPSDoc
doc = CPSDoc(cover=os.environ["CLAUDE_PLUGIN_ROOT"] + "/assets/Cover Page.docx")
doc.set_cover({"MULTI-PURPOSE TERMINAL DEVELOPMENT PROJECT": "Document Title", ...})
doc.start_body_section()
doc.title("Document Title")
doc.heading("1. Section")
doc.para("Body text ...")
doc.table(["Col A", "Col B"], [["1", "2"]], widths=[2.0, 4.5])
doc.header("Document Title - CPS Confidential")
doc.footer("CORE PATH STRATEGIES | CONFIDENTIAL - Page ")
doc.save("05_Deliverables_Final/MyDoc.docx")
See ${CLAUDE_PLUGIN_ROOT}/scripts/README_docgen.md for the full building-
block API (headings, bullets, key_insight callouts, figures, TOC, etc.).
XLSX โ always cps_xlsxgen.py. Same "one generator per format" rule as
DOCX: cps-document-generator.js's createDocument('xlsx', ...) is
deprecated (see CHANGELOG.md, 2026-08-04) in favor of a single Python
generator that also carries the Big-3-style modeling colour convention
(blue input / black formula / green link) and CPS branding chrome in one
place.
import sys, os
sys.path.insert(0, os.environ["CLAUDE_PLUGIN_ROOT"] + "/scripts")
from cps_xlsxgen import CPSWorkbook
wb = CPSWorkbook(branding=os.environ["CLAUDE_PLUGIN_ROOT"] + "/assets/cps-branding.json")
wb.cover_sheet(title="Workbook Title", prepared_for="Client Name", date="4 August 2026",
logo_path=os.environ["CLAUDE_PLUGIN_ROOT"] + "/assets/logos/cps-logo-full.png")
a = wb.add_sheet("Assumptions", tab_color=wb.gold)
wb.header_row(a, 4, ["Metric", "Year 1", "Year 5"], widths=[28, 14, 14])
wb.input_cell(a, "C5", 0.242, number_format="0.0%")
wb.save("05_Deliverables_Final/MyModel.xlsx")
See ${CLAUDE_PLUGIN_ROOT}/scripts/README_xlsxgen.md for the full building-
block API (cover/dashboard/verify-log helpers, KPI tiles, the colour
convention, RTL sheets).
PDF / PPTX โ still the JS generator (unaffected by this change):
const generator = require(process.env.CLAUDE_PLUGIN_ROOT + '/scripts/cps-document-generator');
await generator.createDocument('pdf', {
title: 'Document Title',
sections: [...]
});
-
Auto-Apply CPS Branding
- CPS logo (0.77" x 0.77", top-left)
- Navy blue headers (#1B4F72)
- Professional formatting
- Consistent fonts (Arial/Arial Black)
- Page numbers and document title in footer
Overview
This skill provides comprehensive document handling using the unified CPS branding system.
All documents are generated using:
- Config:
${CLAUDE_PLUGIN_ROOT}/assets/cps-branding.json - Single source of truth for all branding
- DOCX generator (English and Arabic):
${CLAUDE_PLUGIN_ROOT}/scripts/cps_docgen.py - the only
generator with RTL/bidi support; use it for every Word deliverable, not just Arabic ones
- XLSX generator:
${CLAUDE_PLUGIN_ROOT}/scripts/cps_xlsxgen.py - the only generator for Excel
workbooks; carries CPS branding chrome plus the Big-3-style input/formula/link colour convention
- PDF / PPTX generator:
${CLAUDE_PLUGIN_ROOT}/scripts/cps-document-generator.js
Quick Start
from cps_docgen import CPSDoc
doc = CPSDoc(cover='assets/Cover Page.docx')
doc.set_cover({'MULTI-PURPOSE TERMINAL DEVELOPMENT PROJECT': 'My Report', ...})
doc.start_body_section()
doc.title('My Report')
doc.heading('1. Section 1')
doc.para('Content here...')
doc.table(['A', 'B'], [['1', '2']])
doc.save('05_Deliverables_Final/MyReport.docx')
from cps_xlsxgen import CPSWorkbook
wb = CPSWorkbook()
wb.cover_sheet(title='Data Export', prepared_for='Client Name', date='4 August 2026')
sheet1 = wb.add_sheet('Sheet1', tab_color=wb.navy)
wb.header_row(sheet1, 4, ['Col A', 'Col B'])
wb.data_row(sheet1, 5, ['Data 1', 'Data 2'])
wb.save('05_Deliverables_Final/DataExport.xlsx')
const generator = require(process.env.CLAUDE_PLUGIN_ROOT + '/scripts/cps-document-generator');
await generator.createDocument('pdf', { title: 'My Report', sections: [...] });
await generator.createDocument('pptx', {
title: 'Presentation',
slides: [
{ title: 'Title Slide', subtitle: 'Subtitle', isTitleSlide: true },
{ title: 'Content', bullets: ['Point 1', 'Point 2'] }
]
});
CPS Branding (from cps-branding.json)
Colors
| Purpose | Color | Hex | Usage |
|---|
| Primary | Navy Blue | #1B4F72 | Headers, titles, borders |
| Critical | Red | #CC0000 | Critical status, warnings |
| High | Orange | #FF8C00 | High priority, in progress |
| Medium | Yellow | #FFD700 | Medium priority |
| Low/Complete | Green | #228B22 | Low priority, complete |
| Alt Row | Light Gray | #F8FBFD | Table alternating rows |
Typography
| Element | Font | Size |
|---|
| Title | Arial Black | 24pt |
| Heading 1 | Arial Black | 18pt |
| Heading 2 | Arial Black | 14pt |
| Body | Arial | 11pt |
| Footer | Arial | 9pt |
Logo
- Path:
${CLAUDE_PLUGIN_ROOT}/assets/logos/cps-logo-full.png
- Dimensions: 0.77" x 0.77" (55px x 55px)
- Placement: Top-left, floating in front of text
Document Templates
Template 1: Executive Report (DOCX/PDF)
Sections: Title Page, Executive Summary, TOC, Introduction, Methodology, Findings, Recommendations, Next Steps, Appendices
Header: Logo (0.77") | Vertical Line | "CORE PATH STRATEGIES | [CONFIDENTIALITY]"
Footer: Document Title | Page X of Y
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ [LOGO] โ LINE โ CORE PATH STRATEGIES | CONFIDENTIAL โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ [DOCUMENT TITLE] โ
โ [Subtitle/Client Name] / [Date] โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ EXECUTIVE SUMMARY โ key findings in 3-5 bullet points โ
โ 1. INTRODUCTION โ background, objectives, scope โ
โ 2. METHODOLOGY โ approach, data sources, frameworks โ
โ 3. FINDINGS โ detailed analysis and observations โ
โ 4. RECOMMENDATIONS โ prioritized, with rationale โ
โ 5. NEXT STEPS โ action items, owners, timelines โ
โ APPENDICES โ supporting data, tables, references โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ [Document Title] Page X of Y โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
Template 2: Formal Letter (DOCX/PDF)
Structure: CPS logo full-width header โ Date โ Recipient block (name, title, organization, address) โ Subject line โ Salutation โ Opening paragraph (purpose) โ Body paragraphs (details, requests) โ Closing paragraph (next steps, call to action) โ "Sincerely," signature block (name, title, Core Path Strategies) โ Footer: Core Path Strategies | www.core-path.org | info@core-path.org
Template 3: Presentation (PPTX)
- Title slide: CPS logo, presentation title + subtitle, client name, date, CONFIDENTIAL footer band
- Content slides: small logo top-right, slide title with rule, bullets, chart/table/diagram area, footer
Client Name | Date | Page #
- Final slide: large centered logo, "Thank You", contact name/email/phone,
www.core-path.org
Template 4: Data Workbook (XLSX)
Sheet Structure:
Sheet 1: Executive Summary โ title block (merged, branded), key metrics, charts, notes
Sheet 2: Detailed Data โ branded header row, alternating rows, totals row, footer notes
Sheet 3: Analysis โ pivot tables, charts, trend analysis
Sheet 4: Appendix โ reference data, assumptions, data sources
Formatting Standards:
| Element | Format |
|---|
| Header Row | Background: #1B4F72, Font: White, Bold, 12pt |
| Data Rows | Alternating: White / #F8FBFD |
| Totals | Bold, Border Top, Background: #E8F4FD |
| Currency | $#,##0.00 |
| Percentage | 0.00% |
| Dates | YYYY-MM-DD |
| Numbers | #,##0 (with thousands separator) |
Template 5: Contract/Agreement (DOCX/PDF)
Structure: CPS logo + agreement title + client logo header โ preamble ("This [Agreement Type] is entered into as of [Date] by and between CORE PATH STRATEGIES ("CPS") and [CLIENT NAME] ("Client")") โ numbered articles:
- Scope of Services ยท 2. Deliverables ยท 3. Timeline ยท 4. Fees and Payment ยท 5. Confidentiality ยท 6. Intellectual Property ยท 7. Limitation of Liability ยท 8. Termination ยท 9. Governing Law ยท 10. Signatures
โ "AGREED AND ACCEPTED" dual signature blocks (Signature / Name / Title / Date for both parties).
Document Options
DOCX Options
Built via the CPSDoc API (cps_docgen.py), not a JSON options object โ see
Quick Start above and ${CLAUDE_PLUGIN_ROOT}/scripts/README_docgen.md for
the full method reference (title(), heading(), table(), figure(),
key_insight(), toc(), etc.).
PDF Options
{
title: 'Document Title',
outputPath: './output/file.pdf',
sections: [
{ heading: 'Heading Text' },
{ content: 'Paragraph text...' },
{ pageBreak: true }
]
}
XLSX Options
Built via the CPSWorkbook API (cps_xlsxgen.py), not a JSON options object
โ see Quick Start above and ${CLAUDE_PLUGIN_ROOT}/scripts/README_xlsxgen.md
for the full method reference (add_sheet(), cover_sheet(), header_row(),
input_cell() / formula_cell() / link_cell(), check_row(),
kpi_tile(), etc.). Remember: a later header_row(..., widths=[...]) call
overwrites column widths set earlier in the same sheet โ see the
"Column-width discipline" note in the README before stacking tables.
PPTX Options
{
title: 'Presentation Title',
outputPath: './output/file.pptx',
slides: [
{ title: 'Title', subtitle: 'Subtitle', isTitleSlide: true },
{ title: 'Content Slide', content: 'Text content...' },
{ title: 'Bullets', bullets: ['Point 1', 'Point 2'] },
{ title: 'Table', table: { headers: [...], rows: [[...]] } }
]
}
Accessing Branding Config
const generator = require(process.env.CLAUDE_PLUGIN_ROOT + '/scripts/cps-document-generator');
const branding = generator.getBranding();
console.log(branding.colors.primary.hex);
const primaryColor = generator.getColor('primary', 'hex');
const criticalArgb = generator.getColor('critical', 'argb');
CLI Usage
python your_build_script.py
node ${CLAUDE_PLUGIN_ROOT}/scripts/cps-document-generator.js pdf "Client Proposal" ./output/proposal.pdf
node ${CLAUDE_PLUGIN_ROOT}/scripts/cps-document-generator.js pptx "Presentation"
Output Confirmation
After generation, display:
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
DOCUMENT GENERATED SUCCESSFULLY
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
Document: [Title]
Format: [DOCX | XLSX | PDF | PPTX]
Template: [Executive Report | Letter | Presentation | Workbook | Contract]
Pages/Slides: [N]
Size: [X KB/MB]
Language: [English | Arabic | Bilingual]
Branding: CPS Standard Applied
Output Path: 05_Deliverables_Final/[folder]/[filename]
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
Quick Reference: Document Type Matrix
| Document Type | Formats | Template | Use Case |
|---|
| Executive Report | DOCX, PDF | exec-report | Analysis findings, recommendations |
| Formal Letter | DOCX, PDF | letter | Client communications, requests |
| Presentation | PPTX | presentation | Client meetings, workshops |
| Data Workbook | XLSX | workbook | Financial models, data analysis |
| Proposal | DOCX, PDF | proposal | New engagement proposals |
| Contract | DOCX, PDF | contract | Engagement agreements |
| Status Report | DOCX, PDF | status-report | Weekly/monthly updates |
| Risk Register | XLSX | risk-register | Risk tracking |
| Project Plan | XLSX | project-plan | Timeline, milestones |
Supported Languages
| Language | Code | RTL | Font | DOCX (cps_docgen.py) | XLSX (cps_xlsxgen.py) | PDF / PPTX (JS) |
|---|
| English | en | No | Arial | โ
| โ
| โ
|
| Arabic | ar | Yes | Arial (body) / Tahoma (cover) | โ
(rtl=True) | โ
basic (add_sheet(rtl=True) flips sheet direction; no bidi text shaping beyond that) | โ not implemented |
| Bilingual | en-ar | Mixed | โ | Generate two CPSDoc docs, one per language | Generate two workbooks, one per language | โ not implemented |
The JS generator has no RTL/bidi handling at all โ DOCX is always cps_docgen.py
and XLSX is always cps_xlsxgen.py, regardless of language (see step 3
above). Arabic PDF/PPTX aren't supported by the JS pipeline yet; flag this to
the user rather than generating a broken RTL file for those formats.
Integration with Other Skills
| Skill | Integration |
|---|
/cps-consultation-budget | Export budget estimate as formatted report |
/dashboard | Export dashboard as PDF/PPTX |
/proposal | Uses document-generation for proposal creation |
/risk-communication | Export risk register as XLSX; status report DOCX/PDF |
Error Handling
| Error | Resolution |
|---|
| Logo not found | Use text-only header |
| Font not available | Fall back to system fonts |
| Template missing | Use default template |
| Invalid data | Show validation errors |
File Locations
| File | Purpose |
|---|
${CLAUDE_PLUGIN_ROOT}/assets/cps-branding.json | Unified branding configuration |
${CLAUDE_PLUGIN_ROOT}/assets/logos/cps-logo-full.png | Full CPS logo |
${CLAUDE_PLUGIN_ROOT}/assets/logos/cps-logo-alt.png | Alternative logo |
${CLAUDE_PLUGIN_ROOT}/assets/Cover Page.docx | Shared branded cover, built on by CPSDoc(cover=...) |
${CLAUDE_PLUGIN_ROOT}/scripts/cps_docgen.py | DOCX generator (English + Arabic) โ use for every Word deliverable |
${CLAUDE_PLUGIN_ROOT}/scripts/README_docgen.md | Full CPSDoc API reference |
${CLAUDE_PLUGIN_ROOT}/scripts/cps_xlsxgen.py | XLSX generator (English + Arabic) โ use for every Excel workbook |
${CLAUDE_PLUGIN_ROOT}/scripts/README_xlsxgen.md | Full CPSWorkbook API reference |
${CLAUDE_PLUGIN_ROOT}/scripts/cps-document-generator.js | PDF / PPTX generator |
05_Deliverables_Final/ | Default output directory |
Required Libraries
npm install docx pdfkit pptxgenjs
pip install python-docx openpyxl
Migration from Old Scripts
The following scripts are deprecated:
| Old Script | New Method |
|---|
generate_docx_report.js | cps_docgen.py / CPSDoc (Python, not JS โ see DOCX example above) |
generate_pdf_report.js | createDocument('pdf', ...) |
generate_excel_report.js | cps_xlsxgen.py / CPSWorkbook (Python, not JS โ see XLSX example above) |
generate_pptx_report.js | createDocument('pptx', ...) |
generate_example_documents.js | Use unified generator |
Any DOCX or XLSX call still going through cps-document-generator.js's
createDocument('docx'/'xlsx', ...) is on the deprecated path โ those
functions may still exist in the JS file for backward compatibility, but
neither carries the house style forward (no RTL support for DOCX; no CPS
branding chrome or modeling colour convention for XLSX) and shouldn't be used
for new work. Use cps_docgen.py / cps_xlsxgen.py instead.
File Naming Convention
[CLIENT]_[DOCTYPE]_[DESCRIPTION]_[DATE].[ext]
Examples:
- CPS_Report_Digital_Maturity_Assessment_2026-02-02.docx
- CPS_Proposal_AI_Governance_2026-02-02.pdf
- CPS_Analysis_Financial_Model_2026-02-02.xlsx
- CPS_Presentation_Strategy_Review_2026-02-02.pptx
Save to: 05_Deliverables_Final/[DOCTYPE]/[FILENAME]
See references/ for format-specific examples (docx, pdf, excel, pptx), the export pipeline, validators, and integrations.