html-gantt
Skill1 starsChanged 6 months agoApache-2.0View on GitHub
Use when creating or modifying an HTML Gantt chart for project scheduling — tasks with start dates, durations, weekend/holiday markers, and department color coding. Triggers on "make a Gantt chart", "add a project timeline in HTML", "create a schedule visualization", or building hand-crafted CSS Gantt.
In this repository7 other files it gives its agents.
- .github/copilot-instructions.mdCopilot instructions
- atlassian-jira-confluenceSkill
- claw-knowledge-baseSkill
- code-reviewSkill
- gerrit-apiSkill
- skill-guideSkill
- T2MCodingRuleSkill
The file
We split this skill into the rules it gives an agent
1 rule. About 0 are common, 1 is distinctive, and 0 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈1
Distinctive · estimate
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 10
Create self-contained, hand-crafted HTML Gantt charts that render correctly without external JS dependencies.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
HTML Gantt Chart
Overview
Create self-contained, hand-crafted HTML Gantt charts that render correctly without external JS dependencies. Calendar-based timeline with weekend grey strips, holiday red strips, and color-coded task bars by category.
Core Principles
- Calendar-based timeline: Task bars span from start date to end date (inclusive of non-workdays in between).
- No gaps between tasks: The next task starts on the next workday after the previous task ends.
- Non-workday strips as overlays: Weekend (grey) and holiday (red) strips overlay the timeline.
- Holiday priority: Holiday strips merge into continuous blocks and render above weekend strips.
- Color coding by category: Each department/team gets distinct fill + text + border colors.
When to Use
- Creating a project schedule Gantt chart embedded in an HTML page
- Replacing a mermaid.js Gantt with native HTML/CSS for offline/Teams compatibility
- Visualizing tasks with start dates, durations, and department/category color coding
- Building a timeline that accurately shows weekend and holiday non-workday strips
Do NOT use for:
- Interactive Gantt charts requiring drag-and-drop or real-time editing
- Simple text-based task lists that don't need a timeline visualization
- Charts that can use mermaid.js in a live-rendering environment (e.g., GitHub markdown)
Holiday Data
Reference holiday calendar at https://holidays-calendar.net/calendar_zh_cn/china_zh_cn.html. Key rules:
- Chinese statutory holidays: 元旦(1/1), 春节(lunar), 清明节(lunar), 劳动节(5/1), 端午节(lunar), 中秋节(lunar), 国庆节(10/1-7)
- 调休补班 (makeup workdays) are workdays, NOT holidays
- Consecutive holidays merge into a single red strip
- Weekends within a holiday period are classified as holiday, not weekend
See references/holiday-handling.md for detailed rules and examples.
Quick Reference
| Concept | Implementation |
| Task definition | (name, category, workday_count) tuple |
| Calendar positioning | position_pct(d) = (d - first_start).days / total_calendar_days * 100 |
| Task bar width | Calendar days from start to end (includes non-workdays between) |
| Weekend strip | background:rgba(148,163,184,0.06) at z-index:0 |
| Holiday strip | background:rgba(229,57,53,0.10) at z-index:1 |
| Task bar | z-index:2, border-radius:5px, category-specific colors |
Core Algorithm
See references/implementation-guide.md for the complete Python generation script.
Workday Calculation
def is_workday(d):
if d in makeup_workdays: return True
if d.weekday() >= 5: return False
return d not in holidays
def add_workdays(start, n):
d, count = start, 0
while count < n:
if is_workday(d): count += 1
if count < n: d += timedelta(days=1)
return dSchedule Calculation
current = start_date
for name, dept, days in tasks:
end = add_workdays(current, days)
task_dates.append((name, dept, days, current, end))
current = end + timedelta(days=1)
while not is_workday(current):
current += timedelta(days=1)HTML Row Template
Each task row uses a flex container with two columns:
[170px label | flex timeline with positioned bars and strips]See references/implementation-guide.md for the complete HTML template.
Category Color Palette
dept_colors = {
'PMO': ('#DBEAFE', '#1E40AF', '#2563EB'), # (bg, text, border) - blue
'VAL': ('#D1FAE5', '#065F46', '#059669'), # green
'HW': ('#FEF3C7', '#92400E', '#D97706'), # amber
'ME': ('#EDE9FE', '#6D28D9', '#7C3AED'), # purple
'Quality': ('#CCFBF1', '#134E4A', '#0D9488'), # teal
'NPI': ('#FEE2E2', '#991B1B', '#DC2626'), # red
'General': ('#DBEAFE', '#1E40AF', '#2563EB'), # blue
}Integration Into HTML Page
with open('page.html', 'r') as f:
html = f.read()
old_start = '<div class="mermaid"'
old_end = '<!-- 关键风险 -->'
s = html.index(old_start)
e = html.index(old_end)
html = html[:s] + gantt_html + '\n</div>\n\n' + html[e:]
assert html.count('<div') == html.count('</div'), "UNBALANCED DIV TAGS"Common Mistakes
| Mistake | Fix |
| Using mermaid.js for Gantt in HTML | Hand-craft HTML/CSS — mermaid fails in offline/Teams scenarios |
| Workday-only timeline positioning | Use calendar-based timeline; task bars span all days from start to end |
| Holiday strips don't overlap weekends | Holiday z-index:1, weekend z-index:0, task bar z-index:2 |
| 国庆节 written as 10/1-2, 10/5-7 | Use full 10/1-7 (all 7 days are statutory) |
| 调休补班 marked as holiday | Makeup workdays are workdays, not holidays |
| Div tags unbalanced after replacement | Verify html.count('<div') == html.count('</div') after replacement |
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

