| name | company-product-context |
| description | Compiles comprehensive company product context from PDF documents, web research, and industry knowledge |
Company Product Context Compiler
This skill extracts information from company PDF documents, conducts web research, and synthesizes industry knowledge to create a comprehensive company product context report.
Copy this checklist and track your progress:
Company Product Context Progress:
- [ ] Step 1: Gather company materials and identify sources
- [ ] Step 2: Extract information from PDF documents
- [ ] Step 3: Structure extracted data
- [ ] Step 4: Conduct web research and validation
- [ ] Step 5: Synthesize industry knowledge
- [ ] Step 6: Compile comprehensive product context
- [ ] Step 7: Generate final report
- [ ] Step 8: Export deliverables
Step 1: Gather company materials and identify sources
Collect all available company information:
Required Inputs:
- Company PDF documents (annual reports, product sheets, presentations, etc.)
- Company name and website URL
- Industry/sector information
- Specific products or services to focus on (if applicable)
Actions:
- Request all relevant PDF files from user
- Confirm company name, website, and primary industry
- Ask about specific focus areas or products of interest
- Identify any competitive context needed
Expected in INPUT_DIR:
*.pdf - Company documents
company_info.txt - Basic company details (optional)
Step 2: Extract information from PDF documents
Extract structured information from all provided PDF files.
Use the Python script for PDF extraction:
import os
import re
from pathlib import Path
import PyPDF2
import json
def extract_pdf_content(pdf_path):
"""Extract text content from PDF file."""
text_content = []
metadata = {}
try:
with open(pdf_path, 'rb') as file:
pdf_reader = PyPDF2.PdfReader(file)
if pdf_reader.metadata:
metadata = {
'title': pdf_reader.metadata.get('/Title', ''),
'author': pdf_reader.metadata.get('/Author', ''),
'subject': pdf_reader.metadata.get('/Subject', ''),
'pages': len(pdf_reader.pages)
}
else:
metadata = {'pages': len(pdf_reader.pages)}
for page_num, page in enumerate(pdf_reader.pages, 1):
try:
text = page.extract_text()
if text.strip():
text_content.append({
'page': page_num,
'text': text
})
except Exception as e:
()
Exception e:
()
{
: os.path.basename(pdf_path),
: metadata,
: text_content
}
():
sections = {
: [],
: [],
: [],
: [],
: [],
: [],
: [],
: [],
: []
}
keywords = {
: [, , , , ],
: [, , , , ],
: [, , , ],
: [, , , , ],
: [, , , , ],
: [, , , , ],
: [, , , , ],
: [, , , , , ]
}
lines = text.split()
current_section =
line lines:
line_lower = line.lower().strip()
section, section_keywords keywords.items():
(keyword line_lower keyword section_keywords):
(line_lower) < :
current_section = section
line.strip():
sections[current_section].append(line)
sections
():
analysis = {
: ,
: ,
: [],
: [],
: [],
: [],
: []
}
all_text =
doc extracted_data:
page doc[]:
all_text += page[] +
url_pattern =
analysis[] = ((re.findall(url_pattern, all_text)))
email_pattern =
analysis[] = ((re.findall(email_pattern, all_text)))
metrics_pattern =
analysis[] = re.findall(metrics_pattern, all_text, re.IGNORECASE)
analysis
():
input_dir = os.environ.get(, )
output_dir =
os.makedirs(output_dir, exist_ok=)
pdf_files = (Path(input_dir).glob())
pdf_files:
()
()
extracted_data = []
pdf_file pdf_files:
()
data = extract_pdf_content((pdf_file))
data:
extracted_data.append(data)
all_text = .join([page[] page data[]])
sections = extract_key_sections(all_text)
output_file = output_dir +
(output_file, , encoding=) f:
json.dump({
: data[],
: {k: .join(v) k, v sections.items() v},
: all_text
}, f, indent=, ensure_ascii=)
()
()
extracted_data:
analysis = analyze_company_info(extracted_data)
analysis_file = output_dir +
(analysis_file, , encoding=) f:
json.dump(analysis, f, indent=, ensure_ascii=)
()
()
()
()
()
__name__ == :
main()
Execute the extraction:
python3 /tmp/company-product-context/extract_pdfs.py
Outputs:
/tmp/extracted_data/[filename]_extracted.json - Structured data per PDF
/tmp/extracted_data/company_analysis.json - Aggregated analysis
Step 3: Structure extracted data
Organize the extracted information into a structured format.
Review extracted data:
ls -la /tmp/extracted_data/
cat /tmp/extracted_data/company_analysis.json | jq '.'
for file in /tmp/extracted_data/*_extracted.json; do
echo "=== $(basename $file) ==="
cat "$file" | jq '.metadata, .sections | keys'
done
Manually review and note:
- Company name and full legal name
- Core products and services
- Business model and revenue streams
- Target customers and market segments
- Key differentiators
- Technology stack or platform details
- Financial highlights
- Strategic initiatives
Step 4: Conduct web research and validation
Note: This step requires web search capabilities. Based on extracted information:
Research focus areas:
- Company verification: Confirm company details, recent news, press releases
- Product information: Latest product updates, feature sets, pricing
- Market position: Industry reports, analyst coverage, competitive landscape
- Customer base: Case studies, testimonials, major clients
- Technology: Tech stack, integrations, API documentation
- Recent developments: Funding rounds, partnerships, acquisitions
Search queries to execute:
- "[Company Name] official website"
- "[Company Name] products and services"
- "[Company Name] company overview"
- "[Company Name] industry analysis"
- "[Company Name] competitors"
- "[Company Name] case studies"
- "[Company Name] recent news"
- "[Company Name] technology stack"
Document findings in:
cat > /tmp/extracted_data/web_research.md << 'EOF'
- Website: [URL]
- LinkedIn: [URL]
- Documentation: [URL]
[Key findings from official sources]
[Detailed product information]
[Industry context and competitive landscape]
[News, funding, partnerships]
[Technical architecture, integrations]
[Target market, case studies, testimonials]
[Other relevant findings]
EOF
Edit this file with your research findings.
Step 5: Synthesize industry knowledge
Apply industry expertise and context to enrich the company profile.
Industry analysis framework:
Create an industry context document:
cat > /tmp/extracted_data/industry_context.md << 'EOF'
- Industry: [Name]
- Market size: [Data]
- Growth rate: [Data]
- Key trends: [List]
- Major players: [List]
- Market segments: [Description]
- Competitive dynamics: [Analysis]
1. [Challenge 1]
2. [Challenge 2]
3. [Challenge 3]
1. [Trend 1]
2. [Trend 2]
3. [Trend 3]
[Relevant regulations and compliance requirements]
[Industry predictions and trajectory]
- Market segment: [Position]
- Competitive advantages: [List]
- Challenges faced: [List]
- Opportunities: [List]
EOF
Key considerations:
- Industry-specific terminology and concepts
- Regulatory requirements and compliance standards
- Common business models in the industry
- Typical customer pain points
- Standard technology solutions
- Industry best practices
Step 6: Compile comprehensive product context
Synthesize all gathered information into a structured product context document.
Use the compilation script:
import json
import os
from datetime import datetime
from pathlib import Path
def load_json_files(directory):
"""Load all JSON files from directory."""
data = {}
json_files = Path(directory).glob('*.json')
for file in json_files:
with open(file, 'r', encoding='utf-8') as f:
data[file.stem] = json.load(f)
return data
def load_markdown_files(directory):
"""Load all markdown files from directory."""
data = {}
md_files = Path(directory).glob('*.md')
for file in md_files:
with open(file, 'r', encoding='utf-8') as f:
data[file.stem] = f.read()
return data
def compile_product_context(json_data, markdown_data):
"""Compile comprehensive product context."""
context = {
'metadata': {
'generated_date': datetime.now().isoformat(),
'sources': list(json_data.keys()) + list(markdown_data.keys())
},
'company_profile': {},
'products_and_services': {},
'business_model': {},
: {},
: {},
: {},
: {},
: []
}
json_data:
analysis = json_data[]
context[] = {
: analysis.get(, ),
: analysis.get(, ),
: analysis[][] analysis.get() ,
: analysis[][] analysis.get() ,
: analysis.get(, [])
}
products = []
key, data json_data.items():
key data:
sections = data[]
sections:
products.append(sections[])
context[] = {
: .join(products) products ,
: []
}
markdown_data:
context[] = markdown_data[]
markdown_data:
context[] = markdown_data[]
context
():
report =
metrics = context[].get(, [])
metrics:
metric metrics[:]:
report +=
:
report +=
report +=
products_desc = context[].get(, )
products_desc:
report += products_desc
:
report +=
report +=
context:
report += context[]
:
report +=
report +=
context:
report += context[]
:
report +=
report +=
source context[][]:
report +=
report +=
report
():
data_dir =
()
json_data = load_json_files(data_dir)
markdown_data = load_markdown_files(data_dir)
()
()
()
context = compile_product_context(json_data, markdown_data)
context_file =
(context_file, , encoding=) f:
json.dump(context, f, indent=, ensure_ascii=)
()
()
report = generate_narrative_report(context)
report_file =
(report_file, , encoding=) f:
f.write(report)
()
()
__name__ == :
main()
Execute compilation:
python3 /tmp/company-product-context/compile_context.py
Outputs:
/tmp/product_context.json - Structured data format
/tmp/product_context_report.md - Narrative report
Step 7: Generate final report
Review and enhance the generated report with manual insights and analysis.
Review the report:
cat /tmp/product_context_report.md
Enhancement steps:
- Fill in placeholders: Replace bracketed placeholders with actual information
- Add analysis: Include your expert analysis and insights
- Verify accuracy: Cross-reference with source materials
- Add context: Include industry-specific context and implications
- Enhance narrative: Improve flow and readability
- Add visualizations: Consider adding diagrams or charts (describe them textually)
Create enhanced version:
Edit /tmp/product_context_report.md to add:
- Executive summary with key takeaways
- Deeper analysis of competitive positioning
- Strategic recommendations
- Risk assessment
- Opportunity identification
- Implementation considerations
Step 8: Export deliverables
Package and export all deliverables for the user.
Export script:
#!/bin/bash
OUTPUT_DIR=${OUTPUT_DIR:-/tmp/output}
EXPORT_DIR="/tmp/company_context_deliverables"
mkdir -p "$EXPORT_DIR"
echo "Packaging deliverables..."
cp /tmp/product_context_report.md "$EXPORT_DIR/"
cp /tmp/product_context.json "$EXPORT_DIR/"
mkdir -p "$EXPORT_DIR/raw_data"
cp -r /tmp/extracted_data/* "$EXPORT_DIR/raw_data/"
cat > "$EXPORT_DIR/README.md" << 'EOF'
1. **product_context_report.md** - Comprehensive narrative report
2. **product_context.json** - Structured data format
- **raw_data/** - All extracted and intermediate data
- PDF extractions (JSON format)
- Company analysis
- Web research notes
- Industry context analysis
Open `product_context_report.md` in any markdown viewer or text editor.
This is your primary deliverable with comprehensive analysis.
`product_context.json` contains machine-readable structured data
that can be imported into other systems or databases.
The raw_data folder contains all intermediate processing files
for reference and verification purposes.
1. Review the product context report
2. Validate information against your knowledge
3. Share with relevant stakeholders
4. Use as basis strategic planning
5. Update as company evolves
---
Generated by Company Product Context Compiler
EOF
/tmp
tar -czf company_context_deliverables.tar.gz company_context_deliverables/
-r
company_context_deliverables.tar.gz
-lh
Execute export:
bash /tmp/company-product-context/export_deliverables.sh
Final deliverables:
- 📄 Product Context Report (Markdown)
- 📊 Structured Data (JSON)
- 📁 Raw Extracted Data
- 📦 Complete Archive (tar.gz)
- 📖 README with usage instructions
Usage Examples
Example 1: Technology Company
Inputs: Annual report PDF, product documentation PDF
Focus: SaaS products, B2B market positioning
Output: Comprehensive context with tech stack analysis
Example 2: Manufacturing Company
Inputs: Company brochure PDF, investor presentation
Focus: Product lines, supply chain, market segments
Output: Detailed product portfolio and market analysis
Example 3: Consulting Firm
Inputs: Service offerings PDF, case studies PDF
Focus: Service capabilities, client types, differentiators
Output: Service context with competitive positioning
Tips for Best Results
- Provide multiple PDFs: More sources = richer context
- Include diverse documents: Annual reports, product sheets, presentations, case studies
- Specify focus areas: Guide the analysis to your needs
- Review and enhance: Generated report is a starting point for your expert analysis
- Update web research: Manually add recent information not in PDFs
- Validate metrics: Cross-check extracted numbers for accuracy
- Add industry context: Leverage your domain expertise
- Customize sections: Tailor the report structure to your needs
Troubleshooting
PDF extraction issues
- Ensure PDFs are text-based (not scanned images)
- For image-based PDFs, OCR preprocessing may be needed
- Large PDFs may take longer to process
Missing information
- Not all PDFs contain all sections
- Use web research to fill gaps
- Add manual notes to placeholder sections
Data accuracy
- Always verify extracted metrics
- Cross-reference multiple sources
- Use web research for validation
Customization Options
Modify extraction patterns
Edit extract_pdfs.py to customize:
- Section identification keywords
- Metric extraction patterns
- Data structure organization
Customize report template
Edit compile_context.py to modify:
- Report sections and structure
- Analysis framework
- Output formatting
Add industry-specific sections
Extend the report template with:
- Compliance and regulatory analysis
- Technology architecture deep-dive
- Financial modeling
- Risk assessment frameworks
Integration Possibilities
This skill can be integrated with:
- CRM systems (import structured company data)
- Sales enablement platforms
- Competitive intelligence databases
- Market research tools
- Strategic planning frameworks
Export the JSON format for easy integration with other systems.