Generate horizontal Gantt charts from schedule data via the bundled scripts/gantt.py toolkit.
The gantt() function accepts a DataFrame or file path plus column names, and saves a PNG (returning the path).
It handles theming, date parsing, bar colour-coding, completion overlays, today-line, legend, and saving.
Instructions
Provide the data source: a pandas DataFrame, or a path to a
.csv/.tsv/.jsonfile.- One row = one task / phase.
- Required columns: a phase/task name column, a start date column, and either an end date column OR a duration-in-days column.
Import and call
gantt():
import sys
sys.path.insert(0, "scripts") # adjust path to where gantt.py is deployed
from gantt import gantt
# Basic — start + end columns
gantt("schedule.csv", phase="Phase", start="Start", end="End",
title="Project Schedule", out="gantt.png")
# Group colour-coding + today line
gantt(df, phase="phase", start="planned_start", end="planned_end",
group="project", today=True, out="schedule.png")
# Duration instead of end date
gantt(df, phase="task", start="start_date", duration="days",
out="schedule.png")
# Completion % hatch overlay
gantt(df, phase="Phase", start="Start", end="End",
completion="PctDone", out="gantt.png")
- See
references/cheatsheet.mdfor full parameter reference and CLI examples.
Bundled files
scripts/gantt.py— the full toolkit (load_data, apply_theme, save_fig, gantt, CLI)references/cheatsheet.md— parameter quick-reference and copy-paste examplesassets/sample_schedule.csv— demo dataset that exercises every feature
Defaults & behaviour
- Colorblind-friendly palette (matches chart-builder skill for visual consistency).
- Date axis auto-scales: weekly ticks ≤90 days, monthly ≤365 days, bi-monthly beyond.
- Bars ordered top-to-bottom matching input row order.
- Rows with missing phase or start values are silently dropped before drawing.
- Output PNG at 150 DPI by default.
- Provide
endORduration— not both;endtakes priority if both are present.
Run this — do not improvise
This capability's deterministic implementation is a RAPP single-file agent, linked beside this file as gantt_chart_generator_agent.py and embedded as the fenced Python below (sha256 301a1e3447da6048…; a byte-exact copy is also vaulted in the capsule comment at the end of this file). On a host with sandbox execution, run the linked file directly — if it is missing, write the fence contents verbatim to gantt_chart_generator_agent.py first:
python3 gantt_chart_generator_agent.py '{"key": "value"}' # arguments as one JSON object
echo '{"key": "value"}' | python3 gantt_chart_generator_agent.py # or on stdin
python3 gantt_chart_generator_agent.py --tool # emit the JSON tool contract
Treat stdout as a tool result. If it reports missing or unresolved inputs, stop and collect them. If it returns steps, execute those steps in order exactly as returned; if it returns instructions, follow them with the supplied inputs. Otherwise use the result verbatim. Do not invent behavior beyond that output. On a host without code execution, treat the Parameters schema and the code below as the exact specification and never paraphrase a step. Never edit inside the generated markers; a converter-equipped host can instead restore the original file checksum-verified with the installed rapp-agent-converter/scripts/toast.py convert SKILL.md --to agent.
"""GanttChartGenerator -- Use this skill whenever the user asks to visualize a project schedule, timeline, Gantt chart, or phase/task breakdown over time. It gives the agent a prebuilt, parameterized gantt() function so Gantt charts are produced instantly and consistently — with colour-coded groups, completion overlays, a today reference line, and auto-scaled date axes — instead of hand-writing matplotlib each time.
Generated by the rapp skill from gantt-chart-generator. The RCI capsule at the bottom of this file carries the full original; `toast.py convert` restores it byte-exact."""
import json
import re
import sys
try:
from agents.basic_agent import BasicAgent
except ImportError: # running OUTSIDE a brainstem -- stay executable anyway.
class BasicAgent: # noqa: D101 - minimal stand-in, same contract
def __init__(self, name=None, metadata=None):
if name:
self.name = name
if metadata:
self.metadata = metadata
def perform(self, **kwargs):
return "Not implemented."
def system_context(self):
return None
def to_tool(self):
return {"type": "function", "function": {
"name": self.name,
"description": self.metadata.get("description", ""),
"parameters": self.metadata.get("parameters", {})}}
# The procedural layer, verbatim from the source capability.
INSTRUCTIONS = 'Generate horizontal Gantt charts from schedule data via the bundled `scripts/gantt.py` toolkit.\nThe `gantt()` function accepts a DataFrame or file path plus column names, and saves a PNG (returning the path).\nIt handles theming, date parsing, bar colour-coding, completion overlays, today-line, legend, and saving.\n\n## Instructions\n\n1. Provide the data source: a pandas DataFrame, or a path to a `.csv` / `.tsv` / `.json` file.\n - One row = one task / phase.\n - Required columns: a **phase/task name** column, a **start date** column, and either an **end date** column OR a **duration-in-days** column.\n\n2. Import and call `gantt()`:\n\n```python\nimport sys\nsys.path.insert(0, "scripts") # adjust path to where gantt.py is deployed\nfrom gantt import gantt\n\n# Basic — start + end columns\ngantt("schedule.csv", phase="Phase", start="Start", end="End",\n title="Project Schedule", out="gantt.png")\n\n# Group colour-coding + today line\ngantt(df, phase="phase", start="planned_start", end="planned_end",\n group="project", today=True, out="schedule.png")\n\n# Duration instead of end date\ngantt(df, phase="task", start="start_date", duration="days",\n out="schedule.png")\n\n# Completion % hatch overlay\ngantt(df, phase="Phase", start="Start", end="End",\n completion="PctDone", out="gantt.png")\n```\n\n3. See `references/cheatsheet.md` for full parameter reference and CLI examples.\n\n## Bundled files\n- `scripts/gantt.py` — the full toolkit (load_data, apply_theme, save_fig, gantt, CLI)\n- `references/cheatsheet.md` — parameter quick-reference and copy-paste examples\n- `assets/sample_schedule.csv` — demo dataset that exercises every feature\n\n## Defaults & behaviour\n- Colorblind-friendly palette (matches chart-builder skill for visual consistency).\n- Date axis auto-scales: weekly ticks ≤90 days, monthly ≤365 days, bi-monthly beyond.\n- Bars ordered top-to-bottom matching input row order.\n- Rows with missing phase or start values are silently dropped before drawing.\n- Output PNG at 150 DPI by default.\n- Provide `end` OR `duration` — not both; `end` takes priority if both are present.'
# Ordered commands lifted verbatim from the capability's own documentation.
STEPS = []
class GanttChartGeneratorAgent(BasicAgent):
def __init__(self):
self.name = 'GanttChartGenerator'
self.metadata = {
"name": "GanttChartGenerator",
"description": "Use this skill whenever the user asks to visualize a project schedule, timeline, Gantt chart, or phase/task breakdown over time. It gives the agent a prebuilt, parameterized gantt() function so Gantt charts are produced instantly and consistently \u2014 with colour-coded groups, completion overlays, a today reference line, and auto-scaled date axes \u2014 instead of hand-writing matplotlib each time.",
"parameters": {
"type": "object",
"properties": {},
"required": []
}
}
super().__init__(name=self.name, metadata=self.metadata)
def perform(self, **kwargs): # toaster:generated-perform
return json.dumps({"status": "ok", "instructions": INSTRUCTIONS,
"inputs": kwargs,
"note": "Prose-only capability: follow INSTRUCTIONS "
"with the given inputs."}, indent=2)
if __name__ == "__main__":
# echo '{"arg": "value"}' | python3 gantt_chart_generator_agent.py
# python3 gantt_chart_generator_agent.py '{"arg": "value"}'
# python3 gantt_chart_generator_agent.py --tool # emit the JSON tool contract
_a = sys.argv[1:]
if _a and _a[0] == "--tool":
print(json.dumps(GanttChartGeneratorAgent().to_tool(), indent=2))
else:
_raw = _a[0] if _a else (sys.stdin.read().strip() or "{}")
print(GanttChartGeneratorAgent().perform(**json.loads(_raw)))
# rci-capsule:v1:H4sIAAAAAAAC/5VYaZOqWJP+K4Qd78TttixZROFO3IlQcMUV3Kcmbh3gICibHBCxo//7mwe1qu5E90SMH0o4Sy5PZj6Z5Z8VlKVulFS+h5nvv1RsTKzEi1MvCivfKyuCmdT1CENOnu8zuYtDfMEJrGEmI/CAyIkwacRcPJIh37thBjFxEh2xlTLEcrGd+fiFSb0A+14IT30UpiljuShJX5goYWIXEVxPQQxjJhid7CgPmahUAXdemWHKHLwLJqVGdMBhWirAZub5ICFGCQpwihPQbDMHKvzb74yThRZ1gCHRV4WEQQmm1tmZBae9kKSw6RcMCm3GikLikRSXC28Zz3INJvdSFzb8KEtqVmRTDUmUxeQFFoPYx6UOaqyPClhEAISNCibBDk5waGHm7jMVDyBHNWIhH4TYKAVfruDUQw+1BCObiRzGhcO1PPFSLzwwAUpjP0p9z2Qwstw7JJWXCr4iqp5Uvv/3/7xUPHh+Ro9KSrLSedit9CFcCdUGAfZuUZgi/1dAnCQKPuJEDUMQSVSCbWahTa19v+cDqZfovsbFO7gZ+ScvfX0Ll3Dw/QH7+yfuyLJwTPFmVBDZozGiwXY8UBIjADX2M0KRzYKQCWGX3FEiiIYaMfNpn/mW4DRLQooDNYde+x00QkJQjPx7SgSw/XIHFFKBlG8mSr4ErVz623CVwardQ+RjSC37wwi4BKrewt9+Y4ZfEKVL3CszT6KLZ+PSrBIyAros/J1mJghA5NPrMsfR3WeoEsS8v1rk8s7U4SF9PhxJFL6X4IBShmFqzCzETBLlzA8mgqeyOur3Unme0PE58xJsP0AkVPkff3ypJorqH388tl/KXUj3JC3B+roBHmPIc1rLIRwCGH49wsz08radQSYBCjUvrAF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