Skip to content
Automation
Skill

/wps-gantt

项目甘特图。输入任务名称、开始结束日期,自动在Excel里画出甘特图, 用颜色显示进度,不用买Project也能做漂亮的项目排期表。 用于帮助用户制作项目甘特图。当用户提到甘特图、项目排期、时间线时触发。 Gantt chart generator in Excel - no Project software needed.

From plugin
wps-skills
1142 skills

Claude Code

$ npx -y skills add Bwkyd/wps-skills --skill wps-gantt --agent claude-code

SKILL.md

wps-gantt.SKILL.md
name: wps-gantt
description: |
  项目甘特图。输入任务名称、开始结束日期,自动在Excel里画出甘特图,
  用颜色显示进度,不用买Project也能做漂亮的项目排期表。
  用于帮助用户制作项目甘特图。当用户提到甘特图、项目排期、时间线时触发。
  Gantt chart generator in Excel - no Project software needed.
license: MIT
user-invocable: true
argument-hint: '[项目任务列表/需求]'
allowed-tools: 'Read, Grep, Glob, Bash, Write, Edit'
metadata:
  author: BWKYD
  title: 甘特图生成
  description_zh: 根据任务列表在Excel中生成甘特图,用于项目进度管理
  tags:
    - 甘特图
    - 项目管理
    - 排期
    - Excel
    - WPS
  version: 1.0.1
  license: MIT

甘特图生成器

任务列表 → Excel甘特图。不用Project也能做项目排期。

When to Use

  • 制作项目计划/排期表
  • 需要可视化的时间线
  • 项目进度跟踪
  • 用户说"做个甘特图""项目排期表"

When NOT to Use

  • 复杂项目管理 → 建议使用专业工具
  • 普通表格 → 使用 `wps-docx-writer`

工作流程

Step 1: 确认任务信息

每个任务需要:

  • 任务名称
  • 开始日期
  • 结束日期(或工期天数)
  • 负责人(可选)
  • 进度百分比(可选)

Step 2: 生成甘特图

from openpyxl import Workbook
from openpyxl.styles import (Font, Alignment, PatternFill,
                              Border, Side, numbers)
from openpyxl.utils import get_column_letter
from datetime import datetime, timedelta
import os

def create_gantt(tasks, output_path=None):
    """
    tasks = [
        {'name': '需求分析', 'start': '2026-04-01', 'end': '2026-04-07',
         'owner': '张三', 'progress': 100},
        {'name': '系统设计', 'start': '2026-04-08', 'end': '2026-04-14',
         'owner': '李四', 'progress': 60},
        ...
    ]
    """
    wb = Workbook()
    ws = wb.active
    ws.title = "项目甘特图"

    # 计算日期范围
    all_dates = []
    for t in tasks:
        all_dates.append(datetime.strptime(t['start'], '%Y-%m-%d'))
        all_dates.append(datetime.strptime(t['end'], '%Y-%m-%d'))
    min_date = min(all_dates)
    max_date = max(all_dates)
    total_days = (max_date - min_date).days + 1

    # 样式
    header_fill = PatternFill('solid', fgColor='2C3E50')
    header_font = Font(name='微软雅黑', size=10, bold=True, color='FFFFFF')
    bar_fill = PatternFill('solid', fgColor='3498DB')
    done_fill = PatternFill('solid', fgColor='2ECC71')
    milestone_fill = PatternFill('solid', fgColor='E74C3C')
    today_fill = PatternFill('solid', fgColor='F39C12')
    thin = Side(style='thin', color='D5D8DC')
    border = Border(left=thin, right=thin, top=thin, bottom=thin)

    # 左侧列标题
    left_headers = ['序号', '任务名称', '负责人', '开始', '结束', '进度']
    for col, h in enumerate(left_headers, 1):
        cell = ws.cell(row=1, column=col, value=h)
        cell.font = header_font
        cell.fill = header_fill
        cell.alignment = Alignment(horizontal='center')

    # 列宽
    ws.column_dimensions['A'].width = 5
    ws.column_dimensions['B'].width = 20
    ws.column_dimensions['C'].width = 8
    ws.column_dimensions['D'].width = 11
    ws.column_dimensions['E'].width = 11
    ws.column_dimensions['F'].width = 7

    # 日期列标题(每天一列或按周)
    date_start_col = len(left_headers) + 1
    use_weekly = total_days > 60

    if use_weekly:
        # 按周显示
        week_start = min_date - timedelta(days=min_date.weekday())
        col = date_start_col
        while week_start <= max_date:
            cell = ws.cell(row=1, column=col,
                          value=week_start.strftime('%m/%d'))
            cell.font = Font(name='微软雅黑', size=8, color='FFFFFF')
            cell.fill = header_fill
            cell.alignment = Alignment(horizontal='center')
            ws.column_dimensions[get_column_letter(col)].width = 5
            week_start += timedelta(days=7)
            col += 1
    else:
        for d in range(total_days):
            date = min_date + timedelta(days=d)
            col = date_start_col + d
            cell = ws.cell(row=1, column=col, value=date.strftime('%m/%d'))
            cell.font = Font(name='微软雅黑', size=7, color='FFFFFF')
            cell.fill = header_fill
            cell.alignment = Alignment(horizontal='center', text_rotation=90)
            ws.column_dimensions[get_column_letter(col)].width = 3.5

    # 任务行
    body_font = Font(name='微软雅黑', size=10)
    for row_idx, task in enumerate(tasks, 2):
        ws.cell(row=row_idx, column=1, value=row_idx-1).font = body_font
        ws.cell(row=row_idx, column=2, value=task['name']).font = body_font
        ws.cell(row=row_idx, column=3,
                value=task.get('owner', '')).font = body_font
        ws.cell(row=row_idx, column=4, value=task['start']).font = body_font
        ws.cell(row=row_idx, column=5, value=task['end']).font = body_font
        progress = task.get('progress', 0)
        ws.cell(row=row_idx, column=6,
                value=f'{progress}%').font = body_font

        # 画甘特条
        start = datetime.strptime(task['start'], '%Y-%m-%d')
        end = datetime.strptime(task['end'], '%Y-%m-%d')

        if use_weekly:
            week_start = min_date - timedelta(days=min_date.weekday())
            s_col = date_start_col + (start - week_start).days // 7
            e_col = date_start_col + (end - week_start).days // 7
        else:
            s_col = date_start_col + (start - min_date).days
            e_col = date_start_col + (end - min_date).days

        for c in range(s_col, e_col + 1):
            cell = ws.cell(row=row_idx, column=c)
            if progress == 100:
                cell.fill = done_fill
            else:
                cell.fill = bar_fill
            cell.border = border

    ws.row_dimensions[1].height = 30
    ws.freeze_panes = 'G2'  # 冻结左侧列和标题行

    if not output_path:
        output_path = '项目甘特图.xlsx'
    wb.save(output_path)
    return os.path.abspath(output_path)

Step 3: 交付

1. 生成甘特图Excel文件 2. 冻结窗格方便查看 3. 颜色说明(蓝=进行中,绿=已完成,红=里程碑)

示例

# 生成甘特图
/wps-gantt 帮我做个项目甘特图,需求分析2周→设计1周→开发4周→测试2周→上线

# 从数据生成
/wps-gantt 用tasks.xlsx里的任务列表生成甘特图

# 更新进度
/wps-gantt 更新项目甘特图的进度
Read more
@bwkyd
Ships withwps-skills

42 个 WPS Office 办公自动化 Claude Code Skills 集合 一句话指令,让 Claude 帮你自动生成 Word / Excel / PPT / PDF 文档。

Stars on GitHub

Momentum

stars in total
11
Star history of Bwkyd/wps-skills on GitHub, a chart by star-history.com

Other skills on wps-skills.

wps-attendance

wps-attendance

考勤打卡统计。把考勤机导出的打卡数据丢进来,自动统计每个人的 迟到、早退、缺勤、加班时长,生成月度考勤汇总表,异常考勤自动标红。 用于帮助HR处理考勤数据。当用户提到考勤、打卡、迟到、加班统计时触发。 Attendance tracker -…

@bwkyd@bwkydInstall Skill
wps-batch-convert

wps-batch-convert

文档批量格式转换。把一个文件夹里的Word全转文本、Excel全导出CSV、 Markdown转Word,支持docx/txt/xlsx/csv/md等格式批量互转,一次搞定。 用于帮助用户批量转换文档格式。当用户提到批量转换、格式转换、导出时触发。…

@bwkyd@bwkydInstall Skill
wps-budget

wps-budget

预算表一键生成。部门年度预算、项目预算、活动经费预算,选个模板填数字就行, 小计合计公式自动写好,还有预算vs实际对比和执行率自动计算。 用于帮助财务和行政制作预算表。当用户提到预算、费用表、经费时触发。 Budget spreadsheet…

@bwkyd@bwkydInstall Skill
wps-certificate

wps-certificate

证书奖状批量生成。给一份名单,批量生成荣誉证书、结业证书、聘书、感谢信, 每人一份独立文件,年终评优、培训结业、表彰活动必备工具。 用于帮助用户批量生成证书。当用户提到证书、奖状、聘书时触发。 Batch certificate/award…

@bwkyd@bwkydInstall Skill
wps-chart

wps-chart

数据图表一键生成。不知道数据该用什么图表?告诉我你的数据和目的, 自动推荐最佳图表类型并生成,柱状图折线图饼图散点图都支持,还帮你调配色。 用于帮助用户制作数据可视化图表。当用户提到图表、柱状图、折线图、饼图时触发。 Chart generator -…

@bwkyd@bwkydInstall Skill
wps-cn-calendar

wps-cn-calendar

日历排班值班表。生成带法定节假日和调休标注的月度/年度日历表, 还能做三班倒/两班倒排班表和节假日值班安排,颜色区分不同班次一目了然。 用于帮助用户生成日历和排班表。当用户提到日历、排班、值班、节假日时触发。 Chinese calendar with…

@bwkyd@bwkydInstall Skill

More skills from other plugins.

agent-builder

agent-builder

Load immediately after an Agent intent, before the first agent_builder_* call. Governs how you create, configure, test, and…

n8n13d209k
@n8n-io@n8n-ioInstall Skill
browser-use

browser-use

Direct browser control via CDP for web interaction: automation, scraping, testing, screenshots, and site/app work. Also covers…

@browser-use@browser-useInstall Skill
agent-browser

agent-browser

Browser automation CLI for AI agents. Use when the user needs to interact with websites, including navigating pages, filling…

@vercel-labs-2@vercel-labs-2Install Skill
add-anydoc

add-anydoc

Add local office-document-to-Markdown conversion to NanoClaw agent containers with the pinned Firecrawl AnyDoc CLI. Use when…

@nanocoai@nanocoaiInstall Skill

Questions about wps-gantt.

Which coding agents can use wps-gantt?
wps-gantt installs in Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, OpenCode and Windsurf with the skills CLI, using each agent's flag shown on this page. Flowy's auto-invocation, which fires a skill when your prompt matches, runs in Claude Code only.