Skip to content

Add gpt-vis-ai-refactor Copilot skill for v1.0 component migration#280

Merged
hustcc merged 3 commits intoaifrom
copilot/add-gpt-vis-ai-refactor
Jan 26, 2026
Merged

Add gpt-vis-ai-refactor Copilot skill for v1.0 component migration#280
hustcc merged 3 commits intoaifrom
copilot/add-gpt-vis-ai-refactor

Conversation

Copy link
Contributor

Copilot AI commented Jan 26, 2026

Creates a GitHub Copilot skill to systematize the migration of GPT-Vis components to the v1.0 functional API pattern in src/ai/.

Skill Structure

Location: .github/skills/gpt-vis-ai-refactor/SKILL.md

The skill follows Claude's standard format:

  • Directory structure: .github/skills/gpt-vis-ai-refactor/
  • File: SKILL.md with YAML frontmatter header containing skill name and description

3-Step Workflow:

  • Component implementation in src/ai/vis/<name>/index.ts with functional factory pattern
  • README documentation with configuration aligned to knowledges/ schemas
  • Playground demos showcasing each major configuration option

Key Features

  • Code templates with TypeScript interfaces (Options, Config, Instance, DataItem)
  • Theme support patterns (default, academy, dark) with palette utilities
  • Configuration validation against knowledge base schemas
  • Component migration checklist and best practices
  • References PR feat: implement Pie component with G2 5.0 functional API and TypeScript playground #277 (Pie chart) as implementation standard
  • YAML frontmatter with skill metadata for Claude compatibility

Usage

Guides developers to:

  1. Match knowledge base configurations exactly
  2. Keep all changes in src/ai/ (rest deleted post-refactor)
  3. Follow functional pattern: factory function returning { render, destroy }
  4. Validate working on ai branch

Example component structure:

export const Component = (options: ComponentOptions): ComponentInstance => {
  let chart: Chart | null = null;
  
  const render = (config: ComponentConfig): void => {
    if (chart) chart.destroy();
    // G2 5.0 chart configuration
  };
  
  const destroy = (): void => { /* cleanup */ };
  
  return { render, destroy };
};
Original prompt

This section details on the original issue you should resolve

<issue_title>生成一个 skill,名字叫 gpt-vis-ai-refactor 用于本次 gpt-vis 1.0 的重构和升级。</issue_title>
<issue_description>这个 skill 的主要职责,是按照一个流程,去进行 gpt-vis 内置组件的升级。

步骤

主要有几个步骤:

  1. 在 src/ai/vis/ 中新增组件代码,并保持函数式。以 pie 组件为例:
const pie = Pie({
  container: 'container',
  width: 600,
  height: 400,
});

// 传入配置项
pie.render({
  "type": "pie",
  "data": [
    { "category": "分类一", "value": 27 },
    { "category": "分类二", "value": 25 },
    { "category": "分类三", "value": 18 },
    { "category": "分类四", "value": 15 },
    { "category": "分类五", "value": 10 },
    { "category": "其他", "value": 5 }
  ],
  "innerRadius": 0.6,
  "theme": "academy"
}); 

pie.destroy()

其中的配置项可以参考 https://github.com/antvis/GPT-Vis/tree/main/knowledges 中对应的文件,并保持配置一模一样

  1. 在对应的组件目录增加 readme,介绍这个组件,以及配置和使用,后续会用于 ai 生码。

  2. 在 playground 中增加新增组件的 demo 案例,可以按照配置项各增加一个案例,并按照组件类型放到对应的子页面中

参考

要求

  • 所有代码都尽量在 src/ai 目录中,其他目录不要动,我会等重构结束后统一删除。
  • 代码保证简洁和精炼,如果不是必须的代码和配置,就不要。
  • 目标分支始终都是 ai,如果不是,提醒我一下。

</issue_description>

<agent_instructions>按照 issue 的描述,生成一个 github copilot 能用到的 skill。</agent_instructions>

Comments on the Issue (you are @copilot in this section)


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

@changeset-bot
Copy link

changeset-bot bot commented Jan 26, 2026

⚠️ No Changeset found

Latest commit: d7e9199

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Copilot AI changed the title [WIP] Add gpt-vis-ai-refactor skill for component upgrade Add gpt-vis-ai-refactor Copilot skill for v1.0 component migration Jan 26, 2026
Copilot AI requested a review from hustcc January 26, 2026 12:52
@hustcc
Copy link
Member

hustcc commented Jan 26, 2026

@copilot .github/skills/gpt-vis-ai-refactor.md 不是符合 claude 标准的 skill 。应该有:

  1. gpt-vis-ai-refactor 目录中有 SKILL.md 文件
  2. SKILL.md 头部需要有 skill 的名字的和描述

Copy link
Contributor Author

Copilot AI commented Jan 26, 2026

@copilot .github/skills/gpt-vis-ai-refactor.md 不是符合 claude 标准的 skill 。应该有:

  1. gpt-vis-ai-refactor 目录中有 SKILL.md 文件
    ...

Fixed in commit d7e9199. The skill now follows Claude's standard format with:

  1. Directory structure: .github/skills/gpt-vis-ai-refactor/
  2. File: SKILL.md with YAML frontmatter header containing skill name and description

@hustcc hustcc marked this pull request as ready for review January 26, 2026 12:58
@hustcc hustcc merged commit 16f57c7 into ai Jan 26, 2026
5 checks passed
@hustcc hustcc deleted the copilot/add-gpt-vis-ai-refactor branch January 26, 2026 12:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants