Procurement Document Generation
Overview
Generate structured procurement documents using a template engine pattern: templates with placeholders are populated with validated structured data from procurement systems (ERP, supplier database, order management). Supports multi-format export (PDF, DOCX, structured JSON, Excel) with provenance tracking on all populated values.
Announce at start: "I'm using the procurement-document-generation skill to create a procurement document from template with structured data injection."
When to Use This Skill
Trigger Conditions:
- Generating a Purchase Order from approved requisition
- Creating an RFQ for supplier solicitation
- Generating a contract from negotiated terms
- Creating a supplier evaluation report
- Generating a Non-Conformance Report (NCR)
- Tender document generation
- Contract close-out documentation
Prerequisites:
- Template exists for target document type
- Source data extracted and validated (via
procurement-data-extraction)
- Data provenance tags present on all source values
- Document recipient/audience identified
Step-by-Step Procedure
Step 1: Template Selection
Select appropriate template based on document type and complexity:
| Document Type |
Complexity |
Template Selection |
| Purchase Order |
Simple |
Standard PO template with company header, line items, delivery terms, approval block |
| Purchase Order |
Complex |
Extended PO template with technical specifications, appendices, multi-discipline review |
| RFQ |
Standard |
Standard RFQ template with scope, quantities, submission deadline, evaluation criteria |
| RFQ |
Complex |
Extended RFQ with technical specifications, drawings, site conditions, contract terms |
| Contract |
Any |
Contract template with standard clauses, special conditions, pricing schedule |
| NCR |
Any |
NCR template with defect description, specification reference, corrective action request |
| Supplier Evaluation |
Standard |
Evaluation summary template with scoring, tier assignment, recommendation |
| Tender Document |
Any |
Tender package with invitation, instructions, evaluation criteria, draft contract |
Step 2: Data Assembly
Assemble data from validated source systems:
| Data Category |
Source System |
Validation Required |
| Supplier details |
Supplier database |
Supplier active, approved, current qualification tier |
| Order line items |
Approved requisition / BOQ |
Quantities match MTO, prices match quotation |
| Pricing data |
Quotation / approved rates |
Currency, exchange rate date, validity period |
| Delivery terms |
Order configuration |
Incoterms valid, delivery location exists |
| Approval information |
Approval workflow |
Approver roles assigned, authority limits valid |
| Technical specifications |
Engineering documents |
Current revision, approved by discipline lead |
Data injection format:
{
"template_name": "purchase_order_complex",
"data_source": "validated_requisition_R-2026-0142",
"injection_points": {
"po_number": "PO-2026-0089",
"supplier_name": "SteelWorks Ltd",
"supplier_address": "123 Industrial Way, Johannesburg",
"order_date": "2026-03-31",
"delivery_date": "2026-07-15",
"line_items": [
{
"item_code": "ST-W310-001",
"description": "Structural W310 sections, Grade S355JR",
"quantity": 340,
"uom": "tonnes",
"unit_price": 18500,
"currency": "ZAR",
"total_line": 6290000
}
],
"incoterms": "DAP Site C, Gate 3",
"payment_terms": "30% advance, 70% on delivery",
"approved_by": "John Smith, Procurement Manager"
}
}
Step 3: Template Rendering
Render template with injected data:
Template Design Principles:
- Structured Data Injection, Not Raw Generation — All values come from validated sources, not LLM-generated text
- Provenance Tracking — Every injected value carries source reference (e.g.,
{source: "quotation_Q-2026-142", item: "concrete_C30"})
- Conditional Logic — Optional sections added/omitted based on data availability (e.g., "if no warranty period, omit warranty clause")
- Regulatory Accuracy — Current codes, standards, and regulations referenced
- Multi-Language Support — Documents support all languages represented in supply chain
- Human Readable with Data Export — Documents exportable as structured data for analytics
Rendering Pipeline:
TEMPLATE SELECTION (document type, complexity)
↓
DATA INJECTION (structured data sources → placeholder mapping)
↓
CONDITIONAL LOGIC (add/omit sections based on data)
↓
QUALITY VALIDATION (completeness, accuracy, consistency)
↓
DRAFT DOCUMENT (formatted output)
↓
PROVENANCE TAGGING (all values tagged with source)
↓
OUTPUT GENERATION (PDF, DOCX, JSON, Excel)
Step 4: Quality Validation
Validate generated document before output:
| Validation Check |
Description |
Action on Failure |
| Completeness |
All mandatory placeholders filled |
Reject document, flag missing data |
| Data Consistency |
Calculations correct (totals = sum of lines) |
Reject document, flag calculation error |
| Cross-Reference |
All referenced documents exist (PO refs requisition) |
Reject document, flag broken reference |
| Terminology |
Correct terms used (incoterms, UOM, currency) |
Flag for correction |
| Formatting |
Page numbers, headers, footers, page breaks |
Flag for correction |
Step 5: Multi-Format Export
Generate output in requested formats:
| Format |
Use Case |
Characteristics |
| PDF |
Distribution to suppliers, approval, archival |
Print-ready, locked formatting, watermarked if draft |
| DOCX |
Internal review, editing |
Editable, tracked changes enabled |
| Structured JSON |
System integration, analytics |
All values with provenance, machine-readable |
| Excel |
Line item analysis, comparison |
Tabular data, formulas for calculations |
Step 6: Version Control & Distribution
Manage document lifecycle:
- Version Number — Generate version (v1.0 for first, v1.1 for revision)
- Audit Trail — Log document generation: who, when, data sources, template version
- Distribution — Route to stakeholders per approval workflow
- Archival — Store in document management system with metadata tags
Success Criteria
Common Pitfalls
- Generating Text for Data Fields — Never let the LLM generate numbers for quantities, prices, or dates. All values must come from validated source data.
- Missing Provenance — If a value doesn't have a source reference, the document cannot be used for audit, dispute resolution, or quality checks.
- Ignoring Conditional Logic — Not all documents need all sections. Use conditional logic to omit sections that don't apply (e.g., no warranty for off-the-shelf purchases).
- Skipping Quality Validation — Always run completeness and accuracy checks before output. A document with errors distributed to a supplier damages credibility and causes rework.
- Forgetting Version Control — Always version documents. An unversioned revision creates confusion about which version is current.
Cross-References
Related Skills
procurement-data-extraction — Provides validated source data for injection
procurement-order-management — Consumes generated PO documents
sow-generation — Specialized document generation for scope of work
procurement-compliance — Validates document compliance requirements
Related Agents
Contract Administration Specialist (DomainForge) — Contract document generation
Procurement Strategy Specialist (DomainForge) — RFQ and tender document generation
Procurement Analytics Specialist (DomainForge) — Document export for analytics
Example Usage
Scenario: Generate Purchase Order PO-2026-0089 for 340t structural steel
- Template: Select purchase_order_complex template (complexity: standard with technical specs)
- Data Assembly: Load approved requisition R-2026-0142, quotation Q-2026-142
- Data Injection: Populate all template fields from validated sources
- Quality Validation: Verify calculations (340t × R18,500 = R6,290,000), check all references
- Output: Generate PDF for supplier distribution, JSON for system integration
- Version Control: Log as v1.0, route for approval, archive with metadata
Performance Metrics
Target Performance:
- Template rendering accuracy: >99% (all placeholders correctly populated)
- Data accuracy: >99.9% (exact match with source data)
- Document generation time: <10 seconds (simple), <60 seconds (complex with multiple appendices)
- Review rejection rate: <5% of documents require revision after generation
1---2name: procurement-document-generation3description: Generate structured procurement documents (POs, RFQs, contracts, supplier evaluations, NCRs, tenders) using template engine with structured data injection, provenance tracking, and multi-format export4---56# Procurement Document Generation78## Overview910Generate structured procurement documents using a template engine pattern: templates with placeholders are populated with validated structured data from procurement systems (ERP, supplier database, order management). Supports multi-format export (PDF, DOCX, structured JSON, Excel) with provenance tracking on all populated values.1112**Announce at start:** "I'm using the procurement-document-generation skill to create a procurement document from template with structured data injection."1314## When to Use This Skill1516**Trigger Conditions:**17- Generating a Purchase Order from approved requisition18- Creating an RFQ for supplier solicitation19- Generating a contract from negotiated terms20- Creating a supplier evaluation report21- Generating a Non-Conformance Report (NCR)22- Tender document generation23- Contract close-out documentation2425**Prerequisites:**26- Template exists for target document type27- Source data extracted and validated (via `procurement-data-extraction`)28- Data provenance tags present on all source values29- Document recipient/audience identified3031## Step-by-Step Procedure3233### Step 1: Template Selection3435Select appropriate template based on document type and complexity:3637| Document Type | Complexity | Template Selection |38|---------------|-----------|-------------------|39| Purchase Order | Simple | Standard PO template with company header, line items, delivery terms, approval block |40| Purchase Order | Complex | Extended PO template with technical specifications, appendices, multi-discipline review |41| RFQ | Standard | Standard RFQ template with scope, quantities, submission deadline, evaluation criteria |42| RFQ | Complex | Extended RFQ with technical specifications, drawings, site conditions, contract terms |43| Contract | Any | Contract template with standard clauses, special conditions, pricing schedule |44| NCR | Any | NCR template with defect description, specification reference, corrective action request |45| Supplier Evaluation | Standard | Evaluation summary template with scoring, tier assignment, recommendation |46| Tender Document | Any | Tender package with invitation, instructions, evaluation criteria, draft contract |4748### Step 2: Data Assembly4950Assemble data from validated source systems:5152| Data Category | Source System | Validation Required |53|---------------|---------------|-------------------|54| Supplier details | Supplier database | Supplier active, approved, current qualification tier |55| Order line items | Approved requisition / BOQ | Quantities match MTO, prices match quotation |56| Pricing data | Quotation / approved rates | Currency, exchange rate date, validity period |57| Delivery terms | Order configuration | Incoterms valid, delivery location exists |58| Approval information | Approval workflow | Approver roles assigned, authority limits valid |59| Technical specifications | Engineering documents | Current revision, approved by discipline lead |6061**Data injection format:**62```json63{64 "template_name": "purchase_order_complex",65 "data_source": "validated_requisition_R-2026-0142",66 "injection_points": {67 "po_number": "PO-2026-0089",68 "supplier_name": "SteelWorks Ltd",69 "supplier_address": "123 Industrial Way, Johannesburg",70 "order_date": "2026-03-31",71 "delivery_date": "2026-07-15",72 "line_items": [73 {74 "item_code": "ST-W310-001",75 "description": "Structural W310 sections, Grade S355JR",76 "quantity": 340,77 "uom": "tonnes",78 "unit_price": 18500,79 "currency": "ZAR",80 "total_line": 629000081 }82 ],83 "incoterms": "DAP Site C, Gate 3",84 "payment_terms": "30% advance, 70% on delivery",85 "approved_by": "John Smith, Procurement Manager"86 }87}88```8990### Step 3: Template Rendering9192Render template with injected data:9394**Template Design Principles:**951. **Structured Data Injection, Not Raw Generation** — All values come from validated sources, not LLM-generated text962. **Provenance Tracking** — Every injected value carries source reference (e.g., `{source: "quotation_Q-2026-142", item: "concrete_C30"}`)973. **Conditional Logic** — Optional sections added/omitted based on data availability (e.g., "if no warranty period, omit warranty clause")984. **Regulatory Accuracy** — Current codes, standards, and regulations referenced995. **Multi-Language Support** — Documents support all languages represented in supply chain1006. **Human Readable with Data Export** — Documents exportable as structured data for analytics101102**Rendering Pipeline:**103```104TEMPLATE SELECTION (document type, complexity)105 ↓106DATA INJECTION (structured data sources → placeholder mapping)107 ↓108CONDITIONAL LOGIC (add/omit sections based on data)109 ↓110QUALITY VALIDATION (completeness, accuracy, consistency)111 ↓112DRAFT DOCUMENT (formatted output)113 ↓114PROVENANCE TAGGING (all values tagged with source)115 ↓116OUTPUT GENERATION (PDF, DOCX, JSON, Excel)117```118119### Step 4: Quality Validation120121Validate generated document before output:122123| Validation Check | Description | Action on Failure |124|-----------------|-------------|-------------------|125| Completeness | All mandatory placeholders filled | Reject document, flag missing data |126| Data Consistency | Calculations correct (totals = sum of lines) | Reject document, flag calculation error |127| Cross-Reference | All referenced documents exist (PO refs requisition) | Reject document, flag broken reference |128| Terminology | Correct terms used (incoterms, UOM, currency) | Flag for correction |129| Formatting | Page numbers, headers, footers, page breaks | Flag for correction |130131### Step 5: Multi-Format Export132133Generate output in requested formats:134135| Format | Use Case | Characteristics |136|--------|----------|-----------------|137| PDF | Distribution to suppliers, approval, archival | Print-ready, locked formatting, watermarked if draft |138| DOCX | Internal review, editing | Editable, tracked changes enabled |139| Structured JSON | System integration, analytics | All values with provenance, machine-readable |140| Excel | Line item analysis, comparison | Tabular data, formulas for calculations |141142### Step 6: Version Control & Distribution143144Manage document lifecycle:1451461. **Version Number** — Generate version (v1.0 for first, v1.1 for revision)1472. **Audit Trail** — Log document generation: who, when, data sources, template version1483. **Distribution** — Route to stakeholders per approval workflow1494. **Archival** — Store in document management system with metadata tags150151## Success Criteria152153- [ ] Correct template selected for document type and complexity154- [ ] All data injected from validated sources (no fabricated values)155- [ ] All calculations correct (totals, taxes, currency conversions)156- [ ] All cross-references valid and resolvable157- [ ] Document passes all quality validation checks158- [ ] Provenance tags present on all populated values159- [ ] Output generated in requested format(s)160- [ ] Document logged to audit trail with version control161162## Common Pitfalls1631641. **Generating Text for Data Fields** — Never let the LLM generate numbers for quantities, prices, or dates. All values must come from validated source data.1652. **Missing Provenance** — If a value doesn't have a source reference, the document cannot be used for audit, dispute resolution, or quality checks.1663. **Ignoring Conditional Logic** — Not all documents need all sections. Use conditional logic to omit sections that don't apply (e.g., no warranty for off-the-shelf purchases).1674. **Skipping Quality Validation** — Always run completeness and accuracy checks before output. A document with errors distributed to a supplier damages credibility and causes rework.1685. **Forgetting Version Control** — Always version documents. An unversioned revision creates confusion about which version is current.169170## Cross-References171172### Related Skills173- `procurement-data-extraction` — Provides validated source data for injection174- `procurement-order-management` — Consumes generated PO documents175- `sow-generation` — Specialized document generation for scope of work176- `procurement-compliance` — Validates document compliance requirements177178### Related Agents179- `Contract Administration Specialist` (DomainForge) — Contract document generation180- `Procurement Strategy Specialist` (DomainForge) — RFQ and tender document generation181- `Procurement Analytics Specialist` (DomainForge) — Document export for analytics182183## Example Usage184185**Scenario:** Generate Purchase Order PO-2026-0089 for 340t structural steel1861871. **Template:** Select purchase_order_complex template (complexity: standard with technical specs)1882. **Data Assembly:** Load approved requisition R-2026-0142, quotation Q-2026-1421893. **Data Injection:** Populate all template fields from validated sources1904. **Quality Validation:** Verify calculations (340t × R18,500 = R6,290,000), check all references1915. **Output:** Generate PDF for supplier distribution, JSON for system integration1926. **Version Control:** Log as v1.0, route for approval, archive with metadata193194## Performance Metrics195196**Target Performance:**197- Template rendering accuracy: >99% (all placeholders correctly populated)198- Data accuracy: >99.9% (exact match with source data)199- Document generation time: <10 seconds (simple), <60 seconds (complex with multiple appendices)200- Review rejection rate: <5% of documents require revision after generation