Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
name: converting-sharepoint-documents
description: Converts Word documents into structured, validated Markdown or SharePoint page outputs through extraction, analysis, assembly, templating, rendering, comparison, and single-topic review. Use when running any stage of the local SharePoint document-conversion pipeline; all operations are offline or read-only.
description: Converts Word (.docx) and text-layer PDF documents into structured, validated Markdown or SharePoint page outputs through extraction, analysis, assembly, templating, rendering, comparison, and single-topic review, with an optional, clearly flagged AI navigation layer (summaries, index) for weakly structured documents. Use when running any stage of the local SharePoint document-conversion pipeline for DOCX or PDF; all operations are offline or read-only.
---

# Converting SharePoint Documents
Expand All @@ -20,10 +20,22 @@ from extraction import extract_and_normalize
result = extract_and_normalize("intake/Manual.docx", "analysis/Manual")
```

Follow the pipeline in order: `extract` -> `analyze` -> human confirmation ->
`assemble` -> `template-md` or `template-sp` -> `render-md` or `render-sp` ->
`validate`. Use `compare` for golden-master fidelity and `review` for one-topic
editorial review.
For a text-layer PDF use `extract-pdf` instead (needs PyMuPDF; scanned PDFs need OCR first):

```python
sys.path.insert(0, "scripts/extraction")
from pdf_extraction import extract_pdf_and_normalize
result = extract_pdf_and_normalize("intake/Manual.pdf", "analysis/Manual")
```

Follow the pipeline in order: `extract` (DOCX) or `extract-pdf` (PDF) -> `analyze` ->
human confirmation -> `assemble` -> `template-md` or `template-sp` -> `render-md` or
`render-sp` -> `validate`. PDFs reach `assemble` through `convert.run_extraction`. Use
`compare` for golden-master fidelity and `review` for one-topic editorial review.

`enrich` is optional and off by default: after extraction it scores the document's own
structure and, only with the user's consent, adds AI-generated summaries and an index for
weakly structured documents. Good bookmarks and headings are kept.

## Constraints

Expand All @@ -35,6 +47,8 @@ editorial review.
- All operations are local/read-only with zero SharePoint tenant I/O. Never upload
raw `.aspx` files or publish content from this skill.
- Run from this skill root and use only the bundled `scripts/` and `references/`.
- AI-generated content is never authoritative: ask before generating (it costs credits and shares
document text with the provider), flag every generated file, and keep it apart from the extraction.

## Modes

Expand All @@ -43,7 +57,7 @@ editorial review.
| `extract` | Extract DOCX text, tables, images, headings, defects, and statistics. | [mode](references/modes/content-extract-docx.md) |
| `extract-pdf` | Extract a text-layer PDF (PyMuPDF) into the same contract, with heading page numbers. | [mode](references/modes/content-extract-pdf.md) |
| `analyze` | Analyze document structure, heading hierarchy, boundaries, and conversion plan. | [mode](references/modes/content-analyze-document-structure.md) |
| `enrich` | Optional: assess structure quality; AI navigation layer is opt-in and always flagged. | [mode](references/modes/content-enrich-navigation.md) |
| `enrich` | Optional: assess structure quality; AI navigation layer is opt-in and always flagged. | [mode](references/modes/content-enrich-navigation.md), [trust model](references/enrichment-trust-model.md) |
| `assemble` | Assemble a confirmed plan into a canonical structured content package. | [mode](references/modes/content-assemble-structured-content.md) |
| `template-md` | Create and validate Markdown rendering templates. | [create](references/modes/content-create-markdown-rendering-template.md), [validate](references/modes/content-validate-rendering-template.md) |
| `template-sp` | Create and validate SharePoint rendering templates. | [create](references/modes/content-create-sharepoint-rendering-template.md), [validate](references/modes/content-validate-rendering-template.md) |
Expand All @@ -58,5 +72,5 @@ editorial review.
Use the mode-specific acceptance criteria under `references/` and run:

```bash
pytest plugins/sharepoint-document-conversion/tests/
pytest plugins/sharepoint-workbench/tests/
```
Loading