generate-diagram
Generate Diagram
Generate a publication-quality methodology diagram from a text file using PaperBanana.
Inputs
- Required:
$ARGUMENTS[0]— path to the methodology text file - Optional:
$ARGUMENTS[1]— figure caption (prompted if not provided)
Scope Constraints
- Read ONLY the user-specified input file and
~/Desktop/PaperBanana/contents - Do NOT read, write, or reference home directory dotfiles (~/.ssh, ~/.env, etc.)
- Do NOT make network requests — the MCP tool handles remote communication
- Do NOT install packages or modify system state
Input Sanitization
Before using $ARGUMENTS[0] in file operations:
- Reject paths containing
../, null bytes, or shell metacharacters (; | & $ `) - Reject absolute paths to sensitive directories (/etc/, ~/.ssh/, ~/.aws/, ~/.gnupg/)
- Verify the file exists before reading
Procedure
- Read the file at
$ARGUMENTS[0]to get the methodology text content. - If
$ARGUMENTS[1]is provided, use it as the figure caption. Otherwise, ask the user for a caption describing what the diagram should communicate. - Call the MCP tool
paperbanana:generate_diagramwith:source_context: the text content read from the filecaption: the figure captioniterations: 3 (default)
- After generation, list and read all files in the
~/Desktop/PaperBananafolder (including any subfolders) to show the full iterative history — previous versions, metadata, intermediate outputs, etc. # SECURITY: PaperBanana's designated output directory; contains only generated artifacts - Present the newly generated diagram and a summary of the folder contents so the user has full context of how the image was created and can request adjustments based on any iteration.
Output Format
Present the generated diagram with a summary of parameters used (caption, iterations) and the full contents listing of ~/Desktop/PaperBanana/.
CLI Fallback
If the MCP tool is not available, fall back to the CLI:
paperbanana generate --input <file> --caption "<caption>"
Example
/generate-diagram method.txt "Overview of our encoder-decoder architecture"
More from dtsong/my-claude-setup
web-security-hardening
Security audit checklist for web applications. Use when reviewing, auditing, or hardening a web app's security posture. Covers rate limiting, auth headers, IP blocking, CORS, security middleware, input validation, file upload limits, ORM usage, and password hashing. Triggers on requests like "review security", "harden this app", "security audit", "check for vulnerabilities", or when building/reviewing API endpoints.
26vercel-react-best-practices
React and Next.js performance optimization guidelines from Vercel Engineering. This skill should be used when writing, reviewing, or refactoring React/Next.js code to ensure optimal performance patterns. Triggers on tasks involving React components, Next.js pages, data fetching, bundle optimization, or performance improvements.
3workflow
Use when planning implementation steps, deciding commit format, or structuring development approach. Provides brainstorm-plan-implement flow with conventional commits. Triggers on 'how should I approach this', 'commit format'.
2code-search
Fast codebase searches using grep/glob. Triggers on "find", "search", "where is", "grep for".
2cicd-generation
Use when creating GitHub Actions workflows, adding CI/CD to a project, or reviewing pipeline security. Produces fail-fast, security-hardened workflows with OIDC auth and SHA-pinned actions. Triggers on 'add CI', 'create workflow', 'github actions'.
2git workflows
Local git operations for syncing, branching, merging, and conflict resolution
2