xiaohongshu
xiaohongshu
ggterm-markdown
Generate markdown reports with embedded ggterm visualizations. Use when creating analysis reports, documenting results, exporting findings, or when the user wants plots in markdown format for sharing or documentation.
Full skill instructions
Generate analysis reports with embedded terminal visualizations and reproducible plot specifications.
A well-structured analysis report includes:
import { gg, geom_point, geom_line } from '@ggterm/core'
import { writeFileSync } from 'fs'
// Create plots
const scatterPlot = gg(data)
.aes({ x: 'x', y: 'y', color: 'category' })
.geom(geom_point())
.labs({ title: 'Relationship Analysis' })
const trendPlot = gg(data)
.aes({ x: 'time', y: 'value' })
.geom(geom_line())
.labs({ title: 'Trend Over Time' })
// Render plots to strings
const scatter = scatterPlot.render({ width: 72, height: 18 })
const trend = trendPlot.render({ width: 72, height: 18 })
// Build markdown report
const report = `# Analysis Report: ${datasetName}
## Overview
This report analyzes ${data.length} observations across ${Object.keys(data[0]).length} variables.
## Data Summary
| Metric | Value |
|--------|-------|
| Rows | ${data.length} |
| Columns | ${Object.keys(data[0]).length} |
| Date Range | ${minDate} to ${maxDate} |
## Visualizations
### Scatter Plot
\`\`\`
${scatter}
\`\`\`
**Interpretation**: The scatter plot shows [describe the relationship observed].
### Trend Analysis
\`\`\`
${trend}
\`\`\`
**Interpretation**: The trend indicates [describe the pattern observed].
## Key Findings
1. **Finding 1**: Description of first key insight
2. **Finding 2**: Description of second key insight
3. **Finding 3**: Description of third key insight
## Appendix: Plot Specifications
<details>
<summary>Scatter Plot Spec (JSON)</summary>
\`\`\`json
${JSON.stringify(scatterPlot.spec(), null, 2)}
\`\`\`
</details>
<details>
<summary>Trend Plot Spec (JSON)</summary>
\`\`\`json
${JSON.stringify(trendPlot.spec(), null, 2)}
\`\`\`
</details>
---
*Generated with ggterm*
`
writeFileSync('analysis-report.md', report)
console.log('Report saved to analysis-report.md')
For reports with many visualizations:
interface PlotSection {
title: string
plot: GGPlot
interpretation: string
}
function generateReport(
title: string,
overview: string,
sections: PlotSection[],
findings: string[]
): string {
const plotSections = sections.map(({ title, plot, interpretation }) => `
### ${title}
\`\`\`
${plot.render({ width: 72, height: 16 })}
\`\`\`
**Interpretation**: ${interpretation}
`).join('\n')
const findingsList = findings
.map((f, i) => `${i + 1}. ${f}`)
.join('\n')
const specs = sections.map(({ title, plot }) => `
<details>
<summary>${title} Spec</summary>
\`\`\`json
${JSON.stringify(plot.spec(), null, 2)}
\`\`\`
</details>
`).join('\n')
return `# ${title}
## Overview
${overview}
## Visualizations
${plotSections}
## Key Findings
${findingsList}
## Appendix: Reproducibility
${specs}
---
*Generated with ggterm*
`
}
Choose plot width based on target context:
| Context | Width | Height | Notes |
|---|---|---|---|
| GitHub README | 72-80 | 16-20 | Standard terminal width |
| GitHub Issues | 72 | 14-18 | Compact for discussions |
| Documentation | 80-100 | 20-24 | More detail |
| Presentations | 60-70 | 12-16 | Readable at distance |
function markdownTable(data: Record<string, unknown>[], columns?: string[]): string {
const cols = columns || Object.keys(data[0])
const header = `| ${cols.join(' | ')} |`
const separator = `| ${cols.map(() => '---').join(' | ')} |`
const rows = data.map(row =>
`| ${cols.map(c => String(row[c] ?? '')).join(' | ')} |`
).join('\n')
return `${header}\n${separator}\n${rows}`
}
// Usage
const summaryTable = markdownTable([
{ metric: 'Mean', value: mean.toFixed(2) },
{ metric: 'Median', value: median.toFixed(2) },
{ metric: 'Std Dev', value: std.toFixed(2) },
])
import { gg, geom_histogram, geom_boxplot, geom_point, facet_wrap } from '@ggterm/core'
import { writeFileSync } from 'fs'
// Assume data is loaded
const numericCols = ['age', 'income', 'score']
const categoricalCols = ['region', 'segment']
// Generate distribution plots
const distributions = numericCols.map(col => ({
title: `Distribution of ${col}`,
plot: gg(data).aes({ x: col }).geom(geom_histogram({ bins: 20 })),
interpretation: `Shows the distribution of ${col} values.`
}))
// Generate comparison plots
const comparisons = categoricalCols.map(cat => ({
title: `Score by ${cat}`,
plot: gg(data).aes({ x: cat, y: 'score' }).geom(geom_boxplot()),
interpretation: `Compares score across ${cat} groups.`
}))
// Correlation scatter
const correlation = {
title: 'Age vs Income',
plot: gg(data)
.aes({ x: 'age', y: 'income', color: 'region' })
.geom(geom_point({ alpha: 0.6 })),
interpretation: 'Shows relationship between age and income by region.'
}
const report = generateReport(
'Exploratory Data Analysis',
`Analysis of ${data.length} customer records.`,
[...distributions, ...comparisons, correlation],
[
'Income is right-skewed with median $X',
'Region A shows significantly higher scores',
'Age and income show moderate positive correlation'
]
)
writeFileSync('eda-report.md', report)
<details> tags keep reports cleanFor report templates, see templates/.
xiaohongshu
technical spec
product ux expert
database patterns
Conduct multi-agent task orchestration and workflow coordination.
Initialize project with Conductor artifacts (product definition,
Expert in web animations, transitions, and motion design using Framer Motion and CSS
Creates Mermaid and ASCII diagrams for flowcharts, architecture, ERDs, state machines, mindmaps, and more. Use when user mentions diagram, flowchart, mermaid, ASCII diagram, text diagram, terminal diagram, visualize, C4, mindmap, architecture diagram, sequence diagram, ERD, or needs visual docume...
PostgreSQL bindings for H3 hexagonal grid system. Use when working with H3 cells in Postgres, including spatial indexing, geometry/geography integration, and raster analysis.
Context-Driven Development skill for projects using Conductor. Use this skill when you detect a `conductor/` directory in the project, when working on tasks defined in a `plan.md` file, or when the user asks about tracks, specs, or plans. Automatically applies TDD workflow, tracks task completion...
Display project status, active tracks, and next actions
Official Stakpak application containerization standard operating procedure, a step-by-step guidline to properly dockerize applications. This is a rule book curated by the Stakpak Team.
Generate, edit, and beat-sync AI video with leading models in one workspace.
The world's fastest calendar for remote work
Transform Your Design with AI Designer by ImgCreator.ai
Revolutionizing Video Production with AI-Powered Creativity
Extend an image past the frame and let AI fill the new aspect ratio.
Discover your celebrity doppelgänger with StarByFace!
ChainClarity explains 700+ crypto whitepapers in plain English, with layered summaries, comparisons, research tools, alerts, and a $4.99 Pro plan.
Opus.ai: Revolutionize Your Web Experience