tsaol/awesome-claude/docgen
Claude Code and agent skill by tsaol/awesome-claude
- community
Checking that the SKILL.md file is still in the repository.
Generate documents (PPTX, DOCX, PDF, XLSX, HTML) via AWS Bedrock AgentCore Runtime. Use this skill when the user asks to: - Generate a PPT/presentation / 生成PPT - Generate a Word document / 生成Word文档 - Generate a PDF / 生成PDF - Generate an Excel spreadsheet / 生成Excel表格 - Generate a frontend HTML page / 生成前端页面 - Convert an article to a presentation / 把文章转成PPT - Create a document from a topic / 根据话题生成文档 This skill uses AWS Bedrock AgentCore Runtime (cloud-based, Claude + Code Interpreter).
Install
npx vskill@latest install tsaol/awesome-claude/docgenSKILL.md
Document Generation via AgentCore Runtime
Overview
This skill generates professional documents by calling an AWS Bedrock AgentCore Runtime agent. The remote agent uses Claude + Code Interpreter to produce high-quality files — no local office software required.
Supported Document Types
| Type | Flag | Output | Use Case | |
|---|---|---|---|---|
| pptx | --type pptx | PowerPoint | Presentations, tech talks | |
| docx | --type docx | Word | Reports, design docs | |
--type pdf | Invoices, formal documents | |||
| xlsx | --type xlsx | Excel | Data tables, KPI tracking | |
| frontend-design | --type frontend-design | HTML | Dashboards, landing pages |
Prerequisites
- AWS credentials configured (
~/.aws/credentials, env vars, or IAM role) - AgentCore Runtime deployed with document generation agent
- Python 3.10+ with
boto3installed
Required IAM Permissions
Environment Variables
| Variable | Required | Description | |
|---|---|---|---|
RUNTIME_ARN | Yes | AgentCore Runtime ARN | |
AWS_REGION | No | AWS region (default: ap-northeast-1) |
The script also auto-loads .env from ~/codes/document-generation-mcp/.env if present.
Quick Start
Python API
How Claude Code Should Use This Skill
When a user asks to generate a document, follow this workflow:
Step 1: Determine the Mode
- Mode A (Article -> Document): User has an existing article/markdown and wants it converted
- Mode B (Topic -> Document): User provides a topic and wants a document from scratch
Step 2: Construct the Prompt
The prompt quality determines the output quality. Follow these guidelines:
PPTX Prompt Template
PPTX Rules:
- Each slide description should be under 50 words (keywords and data, not paragraphs)
- Total slides should be <= 22 (more affects generation quality)
- Use "table with N rows" for data tables
- Always include speaker notes instructions
- Specify color scheme explicitly
DOCX Prompt Template
XLSX Prompt Template
Step 3: Save the Prompt (Optional)
For debugging and reuse, save the prompt to a file:
Step 4: Generate the Document
Expected generation times:
- HTML: 30s - 1min
- PPTX (<=10 slides): 2-5 min
- PPTX (10-22 slides): 3-15 min
- DOCX/PDF: 2-5 min
- XLSX: 2-4 min
Complex presentations (15+ slides with detailed content) can take 10-25 minutes. The default timeout is 1200s (20 min). Use --timeout 1800 for very complex documents.
Step 5: Verify Output
Check that the file was generated and report the result:
Command Line Options
| Option | Short | Description | |
|---|---|---|---|
--type | Document type: docx, pdf, pptx, xlsx, frontend-design (required) | ||
--prompt | Document description (inline) | ||
--prompt-file | Read prompt from file | ||
--output | -o | Output file path (required) | |
--region | AWS region (default: ap-northeast-1) | ||
--runtime-arn | AgentCore Runtime ARN | ||
--timeout | Read timeout in seconds (auto-estimated if omitted) | ||
--no-split | Disable auto-split for large PPTX | ||
--max-slides-per-batch | Max slides per batch when splitting (default: 11) |
Tips for Better Results
- Be specific about colors: Always provide hex codes, not just color names
- Keep slide content concise: Keywords and data points, not full sentences
- Speaker notes matter: Include the speaker notes instruction for PPTX — it dramatically improves presentation quality
- Chinese content: Specify "All slide titles and content MUST be in Chinese" if needed
- Data tables: Describe as "table: col1, col2, col3" with row data
- Complex prompts: Save to a file with
--prompt-fileinstead of inline--prompt - Respect the 20-call budget: The server agent has a hard limit of 20 tool calls (code executions). Keep each slide description under 50 words so the agent can generate everything in 1-2 code runs
- Auto-split threshold: For 15+ slides, the script auto-splits into ≤11-slide batches. This is more reliable than generating 22 slides in one shot
Troubleshooting
Timeout Errors
The script now auto-estimates timeout based on complexity. If you still hit timeouts:
The script retries up to 3 times on transient errors (timeout, connection reset) with exponential backoff.
RUNTIME_ARN Not Configured
Set the environment variable or pass via CLI:
Or create a .env file at ~/codes/document-generation-mcp/.env:
Empty or Failed Response
The AgentCore agent has a 20 tool call budget (enforced by MaxToolCallsHook on the server). If the prompt is too complex, the agent runs out of calls before producing the file. Symptoms:
- Response with no
file_base64 - Error: "Code Interpreter did not produce an output file"
Solutions:
- Reduce slide count (keep ≤ 11 per batch, the auto-split handles this)
- Simplify per-slide content (use keywords, not paragraphs)
- The agent must: install deps (1 call) + generate file (1 call) + output base64 (1 call) = 3 minimum calls, leaving 17 for error recovery
Understanding Server Constraints
The remote agent operates under these constraints:
- Model: Claude Opus 4.6 (cross-region inference profile)
- Tool call limit: 20 code executions maximum (warning at 19, hard-stop at 21)
- Conversation window: SlidingWindowConversationManager (window=20, per_turn=True) — old messages get trimmed
- Base64 capture: A hook captures file output before conversation trimming
- Retry on server: The agent retries transient Bedrock errors up to 3 times internally
Architecture
Current Mode (Synchronous)
Auto-Split Mode (for 15+ slide PPTX)
Production Mode (Async — for team/service deployments)
For production use with Amazon Quick Suite, see the full async architecture in sample-amazon-quick-suite-knowledge-hub/docs/use-cases/document-generation-mcp-agentcore-runtime/.
This uses: submit_job Lambda → fire-and-forget → Step Function polling → direct-persist to S3 → CloudFront download URL. No client-side timeout concerns.
Security
- Security scanPassed, 90 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/docgen/SKILL.md
Popularity
- Repository stars
- 62
- Repository forks
- 4
- 7-day trend score
- 21
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/tsaol/awesome-claude/docgen)