npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

sf-doc-generator-cli

v1.0.1

Published

AI-powered Salesforce project documentation generator from requirements

Downloads

7

Readme

🚀 Salesforce Project Documentation Generator

A powerful AI-driven CLI tool that generates complete project documentation from requirement documents (Markdown or PDF). Creates all necessary artifacts including Project Plans, Design Documents, Architecture, Test Plans, and more.

Version License Node

✨ Features

  • 📄 Document Processing: Parse Markdown (.md) or PDF (.pdf) requirement documents
  • 🤖 Multiple AI Providers: Ollama, OpenAI, Anthropic, Groq, Grok (xAI)
  • 📚 Complete Documentation Suite:
    • Project Plan (Timeline, Milestones, Resources)
    • Design Document (UI/UX, Data Model, Integration)
    • Architecture Document (System Design, Components, Diagrams)
    • Technical Specifications (APIs, Security, Performance)
    • Test Plan (Test Cases, Test Scenarios, Coverage)
    • QA Strategy (Quality Gates, Acceptance Criteria)
    • Performance Testing Plan (Load Tests, Benchmarks)
    • Deployment Guide (Steps, Rollback, Checklist)
    • User Documentation (User Guide, Training Materials)
    • Risk Assessment (Risks, Mitigation, Contingency)
  • 🌲 Interactive Tree View: VSCode-like document explorer
  • 🎨 Monaco Editor: Professional markdown/document viewing/editing
  • 💾 Smart Downloads: Individual files or complete ZIP
  • 📊 Documentation Dashboard: Overview of all generated artifacts
  • 🔄 Export Formats: Markdown, HTML, PDF

Demo

  • sf-doc-gen

Sample and tips


📦 Installation

npm install -g sf-doc-generator-cli

🎯 Usage

From Markdown Requirements

Create requirements.md:

# Sales Cloud Enhancement Project

## Project Overview
Implement advanced opportunity management features with AI-driven insights.

## Business Requirements
- Real-time pipeline analytics
- Competitor tracking
- Win/loss analysis
- Forecasting improvements

## Technical Requirements
- Lightning Web Components
- Einstein Analytics integration
- Mobile-responsive design
- API integrations with external systems

## Timeline
- Duration: 12 weeks
- Budget: $150,000
- Team Size: 8 people

## Stakeholders
- VP of Sales
- Sales Operations Manager
- IT Director

Generate Documentation:

sf-doc-gen create \
  -f requirements.md \
  -m ollama \
  --model-name llama3.2

From PDF Requirements

sf-doc-gen create \
  -f "Project Requirements.pdf" \
  -m anthropic \
  --api-key sk-ant-your-key

Using Different AI Providers

Ollama (Local, Free):

sf-doc-gen create -f requirements.md -m ollama

OpenAI:

sf-doc-gen create -f requirements.md -m openai --api-key sk-your-key

Anthropic (Claude):

sf-doc-gen create -f requirements.md -m anthropic --api-key sk-ant-your-key

Groq (Fast):

sf-doc-gen create -f requirements.md -m groq --api-key gsk-your-key

# Example:
# export GROQ_API_KEY="gsk_abc"
sf-doc-gen create -m groq  --model-name llama-3.3-70b-versatile  -n acme-project -f docs/requirements.md

Grok (xAI):

sf-doc-gen create -f requirements.md -m grok --api-key xai-your-key

📋 Generated Documentation Structure

project-name/
├── 01-project-plan/
│   ├── project-charter.md
│   ├── timeline.md
│   ├── resource-plan.md
│   ├── budget.md
│   └── risk-register.md
├── 02-design/
│   ├── design-overview.md
│   ├── ui-ux-mockups.md
│   ├── data-model.md
│   ├── integration-design.md
│   └── security-design.md
├── 03-architecture/
│   ├── architecture-overview.md
│   ├── system-architecture.md
│   ├── component-diagram.md
│   ├── sequence-diagrams.md
│   └── deployment-architecture.md
├── 04-technical-specs/
│   ├── api-specifications.md
│   ├── security-requirements.md
│   ├── performance-requirements.md
│   ├── data-dictionary.md
│   └── integration-specs.md
├── 05-test-plan/
│   ├── test-strategy.md
│   ├── test-cases.md
│   ├── test-scenarios.md
│   ├── acceptance-criteria.md
│   └── test-data-requirements.md
├── 06-qa-strategy/
│   ├── qa-approach.md
│   ├── quality-gates.md
│   ├── defect-management.md
│   └── code-review-guidelines.md
├── 07-performance-testing/
│   ├── performance-test-plan.md
│   ├── load-test-scenarios.md
│   ├── stress-test-plan.md
│   ├── benchmarks.md
│   └── monitoring-strategy.md
├── 08-deployment/
│   ├── deployment-guide.md
│   ├── rollback-plan.md
│   ├── deployment-checklist.md
│   ├── environment-setup.md
│   └── post-deployment-validation.md
├── 09-user-documentation/
│   ├── user-guide.md
│   ├── admin-guide.md
│   ├── training-materials.md
│   ├── faq.md
│   └── troubleshooting.md
└── 10-appendix/
    ├── glossary.md
    ├── references.md
    ├── meeting-notes.md
    └── change-log.md

🖥️ Web Interface Features

Document Explorer (Left Pane)

  • 📁 Hierarchical folder structure
  • 🎯 Click to view/edit documents
  • 🎨 Color-coded by document type
  • 📊 Document size indicators
  • 🔍 Search functionality

Monaco Editor (Right Pane)

  • Markdown syntax highlighting
  • Live preview toggle
  • Search and replace
  • Export to HTML/PDF
  • Dark/Light theme

Action Bar

  • 💾 Save changes
  • 📥 Download individual document
  • 📦 Download complete ZIP
  • 🔄 Regenerate specific document
  • 📊 Generate summary report

📝 Command Reference

Global Options

| Option | Alias | Description | Required | |--------|-------|-------------|----------| | --file <path> | -f | Path to requirements file (.md or .pdf) | ✅ | | --model <provider> | -m | AI provider (ollama, openai, anthropic, groq, grok) | ✅ | | --api-key <key> | | API key (not needed for Ollama) | ⚠️ | | --model-name <name> | | Specific model name | ❌ | | --output-dir <dir> | -o | Output directory (default: ./sf-docs) | ❌ | | --project-name <name> | -n | Project name for organization | ❌ | | --export-format <fmt> | | Export format (md, html, pdf) | ❌ | | --port <port> | | Web UI port (default: 3000) | ❌ |

Commands

create

Generate complete documentation suite from requirements.

sf-doc-gen create -f requirements.md -m ollama

regenerate

Regenerate specific document(s).

sf-doc-gen regenerate \
  --docs "test-plan,deployment-guide" \
  --project my-project

export

Export documentation to different formats.

sf-doc-gen export \
  --project my-project \
  --format html \
  --output ./exports

💡 Example Requirements Document

# Salesforce CPQ Enhancement Project

## Executive Summary
Implement advanced CPQ features to streamline quote generation and approval processes.

## Project Goals
1. Reduce quote generation time by 50%
2. Automate approval workflows
3. Improve pricing accuracy
4. Enable mobile quote access

## Business Requirements

### Quote Management
- Dynamic pricing rules based on volume
- Automated discount calculations
- Multi-currency support
- Quote versioning and comparison

### Approval Workflows
- Multi-level approval chains
- Automated approval for standard discounts
- Escalation for high-value deals
- Mobile approval notifications

### Product Configuration
- Guided selling with product recommendations
- Bundle and package management
- Option constraints and dependencies
- Real-time inventory checking

## Technical Requirements

### Platform
- Salesforce CPQ (Spring '24)
- Lightning Web Components
- Apex for custom pricing logic
- Integration with ERP system

### Integrations
- SAP for inventory data
- DocuSign for e-signatures
- Avalara for tax calculations
- Tableau for analytics

### Performance
- Quote generation < 3 seconds
- Support 10,000 concurrent users
- 99.9% uptime SLA

## Constraints
- Must maintain existing data model
- No changes to core CPQ objects
- Complete in Q2 2024
- Budget: $200,000

## Success Criteria
- 90% user adoption within 3 months
- 50% reduction in quote errors
- 40% faster approval cycles
- Positive ROI within 12 months

🤖 AI Provider Details

Ollama (Local - Free)

  • Best For: Privacy-sensitive projects, cost-free generation
  • Models: llama3.2, codellama, mistral
  • Setup: Install from ollama.ai

OpenAI

  • Best For: Complex projects, high-quality documentation
  • Models: gpt-4, gpt-4-turbo, gpt-3.5-turbo
  • Cost: ~$0.10-0.50 per project

Anthropic (Claude)

  • Best For: Detailed technical documentation, best overall quality
  • Models: claude-sonnet-4.5, claude-opus-4.1
  • Cost: ~$0.15-0.40 per project

Groq

  • Best For: Fast iteration, quick documentation updates
  • Models: mixtral-8x7b-32768, llama-3.1-70b
  • Cost: Very low, often free tier available

Grok (xAI)

  • Best For: Technical documentation, architecture diagrams
  • Models: grok-beta
  • Cost: Competitive pricing

🎨 Customization

Document Templates

Create custom templates in ~/.sf-doc-gen/templates/:

# templates/custom-test-plan.md

# {{project_name}} Test Plan

## Test Objectives
{{test_objectives}}

## Test Scope
{{test_scope}}

## Test Strategy
{{test_strategy}}

## Custom Section
{{custom_content}}

Use custom template:

sf-doc-gen create \
  -f requirements.md \
  -m ollama \
  --template custom-test-plan \
  --template-vars '{"test_objectives": "Ensure 100% coverage"}'

Export Formats

HTML Export:

sf-doc-gen export --project my-project --format html
# Generates: my-project-docs.html (single page)

PDF Export:

sf-doc-gen export --project my-project --format pdf
# Generates: my-project-docs.pdf (professionally formatted)

Confluence Export:

sf-doc-gen export \
  --project my-project \
  --format confluence \
  --confluence-space "SALESFORCE"

📊 Dashboard View

The web UI includes a dashboard showing:

  • 📈 Project Overview: Timeline, budget, resources
  • ✅ Completion Status: Which documents are generated
  • 📄 Document Stats: Page counts, word counts
  • 🔍 Search Across All Docs: Full-text search
  • 📊 Project Health: Risk indicators, issues
  • 🔄 Version History: Track document changes

🔧 Advanced Usage

Batch Generation

Generate docs for multiple projects:

# projects-list.txt
project1:requirements1.md
project2:requirements2.pdf
project3:requirements3.md

sf-doc-gen batch -f projects-list.txt -m anthropic

Incremental Updates

Update specific sections without regenerating everything:

sf-doc-gen update \
  --project my-project \
  --section "test-plan" \
  --append "New test cases for mobile testing"

Collaborative Editing

Start server for team collaboration:

sf-doc-gen serve \
  --project my-project \
  --port 8080 \
  --auth enabled \
  --users team-config.json

🚀 Workflow Example

1. Prepare Requirements

# Create requirements document
cat > requirements.md << 'EOF'
# My Salesforce Project
## Goals: Improve sales efficiency
## Features: Dashboard, Reports, Mobile
EOF

2. Generate Documentation

sf-doc-gen create \
  -f requirements.md \
  -m ollama \
  -n "Sales Efficiency Project" \
  -o ./docs

3. Review in Browser

🌐 Web UI opens automatically at http://localhost:3000
📁 Browse all generated documents
✏️ Edit directly in Monaco Editor

4. Export for Stakeholders

sf-doc-gen export \
  --project "Sales Efficiency Project" \
  --format pdf \
  --output ./stakeholder-review

5. Update as Needed

sf-doc-gen regenerate \
  --docs "architecture,deployment-guide" \
  --project "Sales Efficiency Project"

🔒 Security Best Practices

  • API Keys: Never commit to version control
  • Sensitive Data: Sanitize requirements before processing
  • Access Control: Use authentication for team servers
  • Encryption: Enable for stored documents
  • Audit Trail: Track all document changes

📚 Best Practices

Writing Requirements

Good Requirements:

  • Clear business objectives
  • Specific technical details
  • Defined success criteria
  • Timeline and budget constraints
  • Stakeholder information

Avoid:

  • Vague descriptions
  • Missing context
  • No success metrics
  • Unclear scope

Documentation Quality

The AI generates better docs when you provide:

  • Detailed requirements: More context = better output
  • Clear structure: Organized sections
  • Specific examples: Real-world scenarios
  • Constraints: Technical and business limitations

🐛 Troubleshooting

PDF Not Parsing

# Install poppler for PDF support
# macOS
brew install poppler

# Ubuntu/Debian
sudo apt-get install poppler-utils

# Windows
# Download from: https://github.com/oschwartz10612/poppler-windows

AI Generation Timeout

# Increase timeout
sf-doc-gen create -f requirements.md -m ollama --timeout 300

Memory Issues

# Increase Node.js memory
NODE_OPTIONS="--max-old-space-size=4096" sf-doc-gen create -f large-requirements.pdf

📄 License

MIT License (c) Mohan Chinnappan

🌟 Roadmap

  • [ ] Jira integration for requirements import
  • [ ] Confluence direct publishing
  • [ ] Real-time collaborative editing
  • [ ] AI-powered document review
  • [ ] Diagram generation (Mermaid, PlantUML)
  • [ ] Requirements traceability matrix
  • [ ] Automated gap analysis
  • [ ] Multi-language support

Happy Documenting! 📚

Transform your requirements into comprehensive project documentation in minutes! 🎉