issuekit 0.1.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- issuekit-0.1.0/.gitignore +10 -0
- issuekit-0.1.0/LICENSE +21 -0
- issuekit-0.1.0/PKG-INFO +177 -0
- issuekit-0.1.0/README.md +152 -0
- issuekit-0.1.0/pyproject.toml +46 -0
- issuekit-0.1.0/src/issuekit/__init__.py +3 -0
- issuekit-0.1.0/src/issuekit/agent_commands.py +80 -0
- issuekit-0.1.0/src/issuekit/agents/__init__.py +5 -0
- issuekit-0.1.0/src/issuekit/agents/registry.py +68 -0
- issuekit-0.1.0/src/issuekit/bundled_commands/issuekit.change.md +52 -0
- issuekit-0.1.0/src/issuekit/bundled_commands/issuekit.coding.md +131 -0
- issuekit-0.1.0/src/issuekit/bundled_commands/issuekit.design.md +116 -0
- issuekit-0.1.0/src/issuekit/bundled_commands/issuekit.knowledge.md +117 -0
- issuekit-0.1.0/src/issuekit/bundled_commands/issuekit.release.md +90 -0
- issuekit-0.1.0/src/issuekit/bundled_commands/issuekit.require.md +127 -0
- issuekit-0.1.0/src/issuekit/bundled_commands/issuekit.review.md +82 -0
- issuekit-0.1.0/src/issuekit/bundled_commands/issuekit.test.md +75 -0
- issuekit-0.1.0/src/issuekit/bundled_templates/code-review.md +105 -0
- issuekit-0.1.0/src/issuekit/bundled_templates/release-note.md +90 -0
- issuekit-0.1.0/src/issuekit/bundled_templates/requirement.md +107 -0
- issuekit-0.1.0/src/issuekit/bundled_templates/technical-design.md +279 -0
- issuekit-0.1.0/src/issuekit/bundled_templates/test-plan.md +250 -0
- issuekit-0.1.0/src/issuekit/cli.py +97 -0
- issuekit-0.1.0/src/issuekit/commands/__init__.py +0 -0
- issuekit-0.1.0/src/issuekit/commands/init.py +185 -0
- issuekit-0.1.0/src/issuekit/knowledge/__init__.py +32 -0
- issuekit-0.1.0/src/issuekit/templates.py +17 -0
issuekit-0.1.0/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
issuekit-0.1.0/PKG-INFO
ADDED
|
@@ -0,0 +1,177 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: issuekit
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: AI 辅助开发的 Issue 全生命周期工具。从需求分析到代码审核,由你的 AI 编程助手驱动。
|
|
5
|
+
Project-URL: Homepage, https://github.com/xsg22/issue-kit
|
|
6
|
+
Project-URL: Repository, https://github.com/xsg22/issue-kit
|
|
7
|
+
Project-URL: Issues, https://github.com/xsg22/issue-kit/issues
|
|
8
|
+
License-Expression: MIT
|
|
9
|
+
License-File: LICENSE
|
|
10
|
+
Keywords: ai,claude,codex,cursor,development,issue
|
|
11
|
+
Classifier: Development Status :: 3 - Alpha
|
|
12
|
+
Classifier: Intended Audience :: Developers
|
|
13
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
14
|
+
Classifier: Programming Language :: Python :: 3
|
|
15
|
+
Classifier: Topic :: Software Development :: Quality Assurance
|
|
16
|
+
Requires-Python: >=3.10
|
|
17
|
+
Requires-Dist: click>=8.1
|
|
18
|
+
Requires-Dist: pyyaml>=6.0
|
|
19
|
+
Requires-Dist: rich>=13.0
|
|
20
|
+
Requires-Dist: typer>=0.9
|
|
21
|
+
Provides-Extra: test
|
|
22
|
+
Requires-Dist: pytest-cov>=4.0; extra == 'test'
|
|
23
|
+
Requires-Dist: pytest>=7.0; extra == 'test'
|
|
24
|
+
Description-Content-Type: text/markdown
|
|
25
|
+
|
|
26
|
+
# IssueKit
|
|
27
|
+
|
|
28
|
+
AI 辅助开发的 Issue 全生命周期工具。从需求分析到代码审核,由你的 AI 编程助手驱动。
|
|
29
|
+
|
|
30
|
+
## IssueKit 是什么?
|
|
31
|
+
|
|
32
|
+
IssueKit 为 AI 辅助开发提供结构化的工作流。它提供一组命令,引导你的 AI 编程助手(Cursor、Claude Code、Codex 等)完成一个 Issue 的完整生命周期:
|
|
33
|
+
|
|
34
|
+
| 阶段 | 命令 | 说明 |
|
|
35
|
+
|------|------|------|
|
|
36
|
+
| 1. 需求分析 | `/issuekit.require` | 分析需求,生成面向产品经理的需求文档 |
|
|
37
|
+
| 2. 技术方案 | `/issuekit.design` | 架构设计、接口设计、组件设计、开发步骤 |
|
|
38
|
+
| 3. 编码实现 | `/issuekit.coding` | 按技术方案编码,交叉校验代码与文档一致性 |
|
|
39
|
+
| 4. 测试方案 | `/issuekit.test` | 黑盒业务测试 + 白盒单测/接口测试用例 |
|
|
40
|
+
| 5. 发布准备 | `/issuekit.release` | 生成发布文档,创建 Pull Request |
|
|
41
|
+
| 6. 代码审核 | `/issuekit.review` | 多维度交叉验证(需求、方案、质量) |
|
|
42
|
+
|
|
43
|
+
还有一个 `/issuekit.knowledge` 命令,用于生成项目上下文摘要,让 AI 助手快速理解项目,无需每次从零扫描。
|
|
44
|
+
|
|
45
|
+
## 安装
|
|
46
|
+
|
|
47
|
+
```bash
|
|
48
|
+
pip install issuekit
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
## 快速上手
|
|
52
|
+
|
|
53
|
+
### 第 1 步:初始化
|
|
54
|
+
|
|
55
|
+
在你的项目根目录运行:
|
|
56
|
+
|
|
57
|
+
```bash
|
|
58
|
+
cd your-project
|
|
59
|
+
issuekit init --ai cursor
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
这会创建 `.issuekit/` 目录(模板 + 知识库配置),并将命令文件安装到 `.cursor/commands/`。
|
|
63
|
+
|
|
64
|
+
默认 Issue 文档存放在项目根目录的 `issues/` 文件夹下。你也可以自定义目录:
|
|
65
|
+
|
|
66
|
+
```bash
|
|
67
|
+
issuekit init --ai cursor --issues-dir doc/issues
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
### 第 2 步:构建项目知识(可选但推荐)
|
|
71
|
+
|
|
72
|
+
在 Cursor 中运行命令:
|
|
73
|
+
|
|
74
|
+
```
|
|
75
|
+
/issuekit.knowledge
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
AI 助手会分析你的项目,生成结构化的知识摘要到 `.issuekit/knowledge/`。后续的需求分析和技术方案设计会自动读取这些摘要。
|
|
79
|
+
|
|
80
|
+
### 第 3 步:创建第一个 Issue
|
|
81
|
+
|
|
82
|
+
假设产品经理给了一个需求:"用户个人资料页面增加修改头像功能,支持裁剪和压缩"。
|
|
83
|
+
|
|
84
|
+
在 Cursor 中运行:
|
|
85
|
+
|
|
86
|
+
```
|
|
87
|
+
/issuekit.require 用户个人资料页面增加修改头像功能,支持裁剪和压缩
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
AI 助手会:
|
|
91
|
+
1. 深入分析代码,理解现有用户模块的实现
|
|
92
|
+
2. 生成 Issue ID(如 `FEAT-20260228-avatar-upload`)
|
|
93
|
+
3. 创建 `issues/FEAT-20260228-avatar-upload/requirement.md`
|
|
94
|
+
4. 从 master 拉出特性分支 `feature/FEAT-20260228-avatar-upload`
|
|
95
|
+
|
|
96
|
+
需求文档包含:用户故事(Mermaid 流程图)、边界场景、验收标准、AI 需求评审、待确认问题。
|
|
97
|
+
|
|
98
|
+
### 第 4 步:设计技术方案
|
|
99
|
+
|
|
100
|
+
需求确认后,运行:
|
|
101
|
+
|
|
102
|
+
```
|
|
103
|
+
/issuekit.design
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
生成 `technical-design.md`,涵盖技术调研、架构设计、核心流程、组件设计、接口设计、开发步骤。
|
|
107
|
+
|
|
108
|
+
### 第 5 步:编码实现
|
|
109
|
+
|
|
110
|
+
```
|
|
111
|
+
/issuekit.coding
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
AI 助手按技术文档的开发步骤逐步实现,完成后自动交叉校验代码与技术文档、需求文档的一致性。
|
|
115
|
+
|
|
116
|
+
### 第 6 步:后续流程
|
|
117
|
+
|
|
118
|
+
```
|
|
119
|
+
/issuekit.test # 生成测试方案
|
|
120
|
+
/issuekit.release # 生成发布文档 + 创建 PR
|
|
121
|
+
/issuekit.review # 多维度代码审核
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
## `init` 做了什么
|
|
125
|
+
|
|
126
|
+
1. 创建 `.issuekit/` 目录:
|
|
127
|
+
- `config.yaml` — 项目配置(Issue 文档目录等)
|
|
128
|
+
- `templates/` — 各阶段文档模板(需求、技术方案、测试、发布、审核)
|
|
129
|
+
- `knowledge/` — 项目上下文知识摘要(由 `/issuekit.knowledge` 生成)
|
|
130
|
+
|
|
131
|
+
2. 安装 AI 助手命令到对应目录:
|
|
132
|
+
- Cursor → `.cursor/commands/`
|
|
133
|
+
- Claude Code → `.claude/commands/`
|
|
134
|
+
- Codex → `.codex/commands/`
|
|
135
|
+
- GitHub Copilot → `.github/agents/`
|
|
136
|
+
|
|
137
|
+
## 支持的 AI 助手
|
|
138
|
+
|
|
139
|
+
| AI 助手 | 参数 | 状态 |
|
|
140
|
+
|---------|------|------|
|
|
141
|
+
| Cursor | `--ai cursor` | 已支持 |
|
|
142
|
+
| Claude Code | `--ai claude` | 已支持 |
|
|
143
|
+
| Codex | `--ai codex` | 已支持 |
|
|
144
|
+
| GitHub Copilot | `--ai copilot` | 已支持 |
|
|
145
|
+
|
|
146
|
+
## 目录结构
|
|
147
|
+
|
|
148
|
+
```
|
|
149
|
+
.issuekit/
|
|
150
|
+
├── config.yaml # 项目配置(issues_dir 等)
|
|
151
|
+
├── templates/ # 文档模板
|
|
152
|
+
│ ├── requirement.md # 需求文档模板
|
|
153
|
+
│ ├── technical-design.md # 技术方案模板
|
|
154
|
+
│ ├── test-plan.md # 测试方案模板
|
|
155
|
+
│ ├── release-note.md # 发布文档模板
|
|
156
|
+
│ └── code-review.md # 代码审核模板
|
|
157
|
+
└── knowledge/ # 项目上下文知识摘要
|
|
158
|
+
├── config.yaml # 知识库配置
|
|
159
|
+
├── project-overview.md # 项目概览(/issuekit.knowledge 生成)
|
|
160
|
+
├── architecture.md # 架构分析
|
|
161
|
+
├── api-surface.md # API 接口摘要
|
|
162
|
+
├── data-model.md # 数据模型摘要
|
|
163
|
+
├── integrations.md # 外部集成摘要
|
|
164
|
+
└── conventions.md # 编码约定摘要
|
|
165
|
+
|
|
166
|
+
issues/ # Issue 文档(默认目录,可通过 --issues-dir 自定义)
|
|
167
|
+
└── FEAT-20260228-xxx/
|
|
168
|
+
├── requirement.md # 需求文档
|
|
169
|
+
├── technical-design.md # 技术方案
|
|
170
|
+
├── test-plan.md # 测试方案
|
|
171
|
+
├── release-note.md # 发布文档
|
|
172
|
+
└── code-review.md # 代码审核
|
|
173
|
+
```
|
|
174
|
+
|
|
175
|
+
## 许可证
|
|
176
|
+
|
|
177
|
+
MIT
|
issuekit-0.1.0/README.md
ADDED
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
# IssueKit
|
|
2
|
+
|
|
3
|
+
AI 辅助开发的 Issue 全生命周期工具。从需求分析到代码审核,由你的 AI 编程助手驱动。
|
|
4
|
+
|
|
5
|
+
## IssueKit 是什么?
|
|
6
|
+
|
|
7
|
+
IssueKit 为 AI 辅助开发提供结构化的工作流。它提供一组命令,引导你的 AI 编程助手(Cursor、Claude Code、Codex 等)完成一个 Issue 的完整生命周期:
|
|
8
|
+
|
|
9
|
+
| 阶段 | 命令 | 说明 |
|
|
10
|
+
|------|------|------|
|
|
11
|
+
| 1. 需求分析 | `/issuekit.require` | 分析需求,生成面向产品经理的需求文档 |
|
|
12
|
+
| 2. 技术方案 | `/issuekit.design` | 架构设计、接口设计、组件设计、开发步骤 |
|
|
13
|
+
| 3. 编码实现 | `/issuekit.coding` | 按技术方案编码,交叉校验代码与文档一致性 |
|
|
14
|
+
| 4. 测试方案 | `/issuekit.test` | 黑盒业务测试 + 白盒单测/接口测试用例 |
|
|
15
|
+
| 5. 发布准备 | `/issuekit.release` | 生成发布文档,创建 Pull Request |
|
|
16
|
+
| 6. 代码审核 | `/issuekit.review` | 多维度交叉验证(需求、方案、质量) |
|
|
17
|
+
|
|
18
|
+
还有一个 `/issuekit.knowledge` 命令,用于生成项目上下文摘要,让 AI 助手快速理解项目,无需每次从零扫描。
|
|
19
|
+
|
|
20
|
+
## 安装
|
|
21
|
+
|
|
22
|
+
```bash
|
|
23
|
+
pip install issuekit
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
## 快速上手
|
|
27
|
+
|
|
28
|
+
### 第 1 步:初始化
|
|
29
|
+
|
|
30
|
+
在你的项目根目录运行:
|
|
31
|
+
|
|
32
|
+
```bash
|
|
33
|
+
cd your-project
|
|
34
|
+
issuekit init --ai cursor
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
这会创建 `.issuekit/` 目录(模板 + 知识库配置),并将命令文件安装到 `.cursor/commands/`。
|
|
38
|
+
|
|
39
|
+
默认 Issue 文档存放在项目根目录的 `issues/` 文件夹下。你也可以自定义目录:
|
|
40
|
+
|
|
41
|
+
```bash
|
|
42
|
+
issuekit init --ai cursor --issues-dir doc/issues
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
### 第 2 步:构建项目知识(可选但推荐)
|
|
46
|
+
|
|
47
|
+
在 Cursor 中运行命令:
|
|
48
|
+
|
|
49
|
+
```
|
|
50
|
+
/issuekit.knowledge
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
AI 助手会分析你的项目,生成结构化的知识摘要到 `.issuekit/knowledge/`。后续的需求分析和技术方案设计会自动读取这些摘要。
|
|
54
|
+
|
|
55
|
+
### 第 3 步:创建第一个 Issue
|
|
56
|
+
|
|
57
|
+
假设产品经理给了一个需求:"用户个人资料页面增加修改头像功能,支持裁剪和压缩"。
|
|
58
|
+
|
|
59
|
+
在 Cursor 中运行:
|
|
60
|
+
|
|
61
|
+
```
|
|
62
|
+
/issuekit.require 用户个人资料页面增加修改头像功能,支持裁剪和压缩
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
AI 助手会:
|
|
66
|
+
1. 深入分析代码,理解现有用户模块的实现
|
|
67
|
+
2. 生成 Issue ID(如 `FEAT-20260228-avatar-upload`)
|
|
68
|
+
3. 创建 `issues/FEAT-20260228-avatar-upload/requirement.md`
|
|
69
|
+
4. 从 master 拉出特性分支 `feature/FEAT-20260228-avatar-upload`
|
|
70
|
+
|
|
71
|
+
需求文档包含:用户故事(Mermaid 流程图)、边界场景、验收标准、AI 需求评审、待确认问题。
|
|
72
|
+
|
|
73
|
+
### 第 4 步:设计技术方案
|
|
74
|
+
|
|
75
|
+
需求确认后,运行:
|
|
76
|
+
|
|
77
|
+
```
|
|
78
|
+
/issuekit.design
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
生成 `technical-design.md`,涵盖技术调研、架构设计、核心流程、组件设计、接口设计、开发步骤。
|
|
82
|
+
|
|
83
|
+
### 第 5 步:编码实现
|
|
84
|
+
|
|
85
|
+
```
|
|
86
|
+
/issuekit.coding
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
AI 助手按技术文档的开发步骤逐步实现,完成后自动交叉校验代码与技术文档、需求文档的一致性。
|
|
90
|
+
|
|
91
|
+
### 第 6 步:后续流程
|
|
92
|
+
|
|
93
|
+
```
|
|
94
|
+
/issuekit.test # 生成测试方案
|
|
95
|
+
/issuekit.release # 生成发布文档 + 创建 PR
|
|
96
|
+
/issuekit.review # 多维度代码审核
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
## `init` 做了什么
|
|
100
|
+
|
|
101
|
+
1. 创建 `.issuekit/` 目录:
|
|
102
|
+
- `config.yaml` — 项目配置(Issue 文档目录等)
|
|
103
|
+
- `templates/` — 各阶段文档模板(需求、技术方案、测试、发布、审核)
|
|
104
|
+
- `knowledge/` — 项目上下文知识摘要(由 `/issuekit.knowledge` 生成)
|
|
105
|
+
|
|
106
|
+
2. 安装 AI 助手命令到对应目录:
|
|
107
|
+
- Cursor → `.cursor/commands/`
|
|
108
|
+
- Claude Code → `.claude/commands/`
|
|
109
|
+
- Codex → `.codex/commands/`
|
|
110
|
+
- GitHub Copilot → `.github/agents/`
|
|
111
|
+
|
|
112
|
+
## 支持的 AI 助手
|
|
113
|
+
|
|
114
|
+
| AI 助手 | 参数 | 状态 |
|
|
115
|
+
|---------|------|------|
|
|
116
|
+
| Cursor | `--ai cursor` | 已支持 |
|
|
117
|
+
| Claude Code | `--ai claude` | 已支持 |
|
|
118
|
+
| Codex | `--ai codex` | 已支持 |
|
|
119
|
+
| GitHub Copilot | `--ai copilot` | 已支持 |
|
|
120
|
+
|
|
121
|
+
## 目录结构
|
|
122
|
+
|
|
123
|
+
```
|
|
124
|
+
.issuekit/
|
|
125
|
+
├── config.yaml # 项目配置(issues_dir 等)
|
|
126
|
+
├── templates/ # 文档模板
|
|
127
|
+
│ ├── requirement.md # 需求文档模板
|
|
128
|
+
│ ├── technical-design.md # 技术方案模板
|
|
129
|
+
│ ├── test-plan.md # 测试方案模板
|
|
130
|
+
│ ├── release-note.md # 发布文档模板
|
|
131
|
+
│ └── code-review.md # 代码审核模板
|
|
132
|
+
└── knowledge/ # 项目上下文知识摘要
|
|
133
|
+
├── config.yaml # 知识库配置
|
|
134
|
+
├── project-overview.md # 项目概览(/issuekit.knowledge 生成)
|
|
135
|
+
├── architecture.md # 架构分析
|
|
136
|
+
├── api-surface.md # API 接口摘要
|
|
137
|
+
├── data-model.md # 数据模型摘要
|
|
138
|
+
├── integrations.md # 外部集成摘要
|
|
139
|
+
└── conventions.md # 编码约定摘要
|
|
140
|
+
|
|
141
|
+
issues/ # Issue 文档(默认目录,可通过 --issues-dir 自定义)
|
|
142
|
+
└── FEAT-20260228-xxx/
|
|
143
|
+
├── requirement.md # 需求文档
|
|
144
|
+
├── technical-design.md # 技术方案
|
|
145
|
+
├── test-plan.md # 测试方案
|
|
146
|
+
├── release-note.md # 发布文档
|
|
147
|
+
└── code-review.md # 代码审核
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
## 许可证
|
|
151
|
+
|
|
152
|
+
MIT
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
[project]
|
|
2
|
+
name = "issuekit"
|
|
3
|
+
version = "0.1.0"
|
|
4
|
+
description = "AI 辅助开发的 Issue 全生命周期工具。从需求分析到代码审核,由你的 AI 编程助手驱动。"
|
|
5
|
+
requires-python = ">=3.10"
|
|
6
|
+
license = "MIT"
|
|
7
|
+
readme = "README.md"
|
|
8
|
+
keywords = ["ai", "issue", "development", "cursor", "claude", "codex"]
|
|
9
|
+
classifiers = [
|
|
10
|
+
"Development Status :: 3 - Alpha",
|
|
11
|
+
"Intended Audience :: Developers",
|
|
12
|
+
"License :: OSI Approved :: MIT License",
|
|
13
|
+
"Programming Language :: Python :: 3",
|
|
14
|
+
"Topic :: Software Development :: Quality Assurance",
|
|
15
|
+
]
|
|
16
|
+
dependencies = [
|
|
17
|
+
"typer>=0.9",
|
|
18
|
+
"click>=8.1",
|
|
19
|
+
"rich>=13.0",
|
|
20
|
+
"pyyaml>=6.0",
|
|
21
|
+
]
|
|
22
|
+
|
|
23
|
+
[project.scripts]
|
|
24
|
+
issuekit = "issuekit.cli:app"
|
|
25
|
+
|
|
26
|
+
[project.urls]
|
|
27
|
+
Homepage = "https://github.com/xsg22/issue-kit"
|
|
28
|
+
Repository = "https://github.com/xsg22/issue-kit"
|
|
29
|
+
Issues = "https://github.com/xsg22/issue-kit/issues"
|
|
30
|
+
|
|
31
|
+
[build-system]
|
|
32
|
+
requires = ["hatchling"]
|
|
33
|
+
build-backend = "hatchling.build"
|
|
34
|
+
|
|
35
|
+
[tool.hatch.build.targets.wheel]
|
|
36
|
+
packages = ["src/issuekit"]
|
|
37
|
+
|
|
38
|
+
[project.optional-dependencies]
|
|
39
|
+
test = [
|
|
40
|
+
"pytest>=7.0",
|
|
41
|
+
"pytest-cov>=4.0",
|
|
42
|
+
]
|
|
43
|
+
|
|
44
|
+
[tool.pytest.ini_options]
|
|
45
|
+
testpaths = ["tests"]
|
|
46
|
+
addopts = ["-v", "--tb=short"]
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
"""将 issuekit 命令文件安装到目标 AI 助手的命令目录。"""
|
|
2
|
+
|
|
3
|
+
from importlib import resources
|
|
4
|
+
from pathlib import Path
|
|
5
|
+
|
|
6
|
+
from issuekit.agents.registry import AgentConfig
|
|
7
|
+
|
|
8
|
+
COMMAND_FILES = [
|
|
9
|
+
"issuekit.require.md",
|
|
10
|
+
"issuekit.design.md",
|
|
11
|
+
"issuekit.coding.md",
|
|
12
|
+
"issuekit.test.md",
|
|
13
|
+
"issuekit.release.md",
|
|
14
|
+
"issuekit.review.md",
|
|
15
|
+
"issuekit.change.md",
|
|
16
|
+
]
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
def install_agent_commands(commands_dir: Path, agent_config: AgentConfig) -> int:
|
|
20
|
+
"""安装所有 issuekit 命令文件,返回安装的文件数。"""
|
|
21
|
+
bundled = resources.files("issuekit") / "bundled_commands"
|
|
22
|
+
count = 0
|
|
23
|
+
|
|
24
|
+
for filename in COMMAND_FILES:
|
|
25
|
+
source = bundled / filename
|
|
26
|
+
if not source.is_file():
|
|
27
|
+
continue
|
|
28
|
+
|
|
29
|
+
content = source.read_text(encoding="utf-8")
|
|
30
|
+
|
|
31
|
+
if not agent_config.command_frontmatter:
|
|
32
|
+
content = _strip_frontmatter(content)
|
|
33
|
+
|
|
34
|
+
if not agent_config.supports_handoffs:
|
|
35
|
+
content = _strip_handoffs(content)
|
|
36
|
+
|
|
37
|
+
dest = commands_dir / f"{Path(filename).stem}{agent_config.command_ext}"
|
|
38
|
+
dest.write_text(content, encoding="utf-8")
|
|
39
|
+
count += 1
|
|
40
|
+
|
|
41
|
+
return count
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
def _strip_frontmatter(content: str) -> str:
|
|
45
|
+
"""移除 YAML frontmatter(--- ... ---)。"""
|
|
46
|
+
if content.startswith("---"):
|
|
47
|
+
end = content.find("---", 3)
|
|
48
|
+
if end != -1:
|
|
49
|
+
return content[end + 3:].lstrip("\n")
|
|
50
|
+
return content
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
def _strip_handoffs(content: str) -> str:
|
|
54
|
+
"""移除 YAML frontmatter 中的 handoffs 部分(用于不支持 handoffs 的 AI 助手)。"""
|
|
55
|
+
if not content.startswith("---"):
|
|
56
|
+
return content
|
|
57
|
+
|
|
58
|
+
end = content.find("---", 3)
|
|
59
|
+
if end == -1:
|
|
60
|
+
return content
|
|
61
|
+
|
|
62
|
+
frontmatter = content[3:end]
|
|
63
|
+
body = content[end + 3:]
|
|
64
|
+
|
|
65
|
+
lines = frontmatter.split("\n")
|
|
66
|
+
filtered = []
|
|
67
|
+
skip = False
|
|
68
|
+
for line in lines:
|
|
69
|
+
if line.strip().startswith("handoffs:"):
|
|
70
|
+
skip = True
|
|
71
|
+
continue
|
|
72
|
+
if skip and (line.startswith(" ") or line.startswith("\t")):
|
|
73
|
+
continue
|
|
74
|
+
skip = False
|
|
75
|
+
filtered.append(line)
|
|
76
|
+
|
|
77
|
+
new_frontmatter = "\n".join(filtered).strip()
|
|
78
|
+
if new_frontmatter:
|
|
79
|
+
return f"---\n{new_frontmatter}\n---{body}"
|
|
80
|
+
return body.lstrip("\n")
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
"""AI 助手配置注册表。
|
|
2
|
+
|
|
3
|
+
每个助手定义了命令文件的存放位置和格式要求。
|
|
4
|
+
"""
|
|
5
|
+
|
|
6
|
+
from dataclasses import dataclass
|
|
7
|
+
from typing import Optional
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
@dataclass
|
|
11
|
+
class AgentConfig:
|
|
12
|
+
"""AI 助手配置项。"""
|
|
13
|
+
name: str
|
|
14
|
+
commands_dir: str
|
|
15
|
+
rules_dir: Optional[str]
|
|
16
|
+
command_ext: str
|
|
17
|
+
command_frontmatter: bool
|
|
18
|
+
supports_handoffs: bool
|
|
19
|
+
|
|
20
|
+
def format_description(self) -> str:
|
|
21
|
+
return f"{self.name} ({self.commands_dir})"
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
AGENT_REGISTRY: dict[str, AgentConfig] = {
|
|
25
|
+
"cursor": AgentConfig(
|
|
26
|
+
name="Cursor",
|
|
27
|
+
commands_dir=".cursor/commands",
|
|
28
|
+
rules_dir=".cursor/rules",
|
|
29
|
+
command_ext=".md",
|
|
30
|
+
command_frontmatter=True,
|
|
31
|
+
supports_handoffs=True,
|
|
32
|
+
),
|
|
33
|
+
"claude": AgentConfig(
|
|
34
|
+
name="Claude Code",
|
|
35
|
+
commands_dir=".claude/commands",
|
|
36
|
+
rules_dir=None,
|
|
37
|
+
command_ext=".md",
|
|
38
|
+
command_frontmatter=False,
|
|
39
|
+
supports_handoffs=False,
|
|
40
|
+
),
|
|
41
|
+
"codex": AgentConfig(
|
|
42
|
+
name="Codex",
|
|
43
|
+
commands_dir=".codex/commands",
|
|
44
|
+
rules_dir=None,
|
|
45
|
+
command_ext=".md",
|
|
46
|
+
command_frontmatter=False,
|
|
47
|
+
supports_handoffs=False,
|
|
48
|
+
),
|
|
49
|
+
"copilot": AgentConfig(
|
|
50
|
+
name="GitHub Copilot",
|
|
51
|
+
commands_dir=".github/agents",
|
|
52
|
+
rules_dir=None,
|
|
53
|
+
command_ext=".md",
|
|
54
|
+
command_frontmatter=False,
|
|
55
|
+
supports_handoffs=False,
|
|
56
|
+
),
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
AGENT_ALIASES: dict[str, str] = {
|
|
60
|
+
"cursor-agent": "cursor",
|
|
61
|
+
"claude-code": "claude",
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
def get_agent_config(name: str) -> Optional[AgentConfig]:
|
|
66
|
+
"""根据名称获取 AI 助手配置,支持别名解析。"""
|
|
67
|
+
resolved = AGENT_ALIASES.get(name, name)
|
|
68
|
+
return AGENT_REGISTRY.get(resolved)
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: 记录和管理 Issue 的需求或方案变更。追踪变更对所有文档的影响。
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
## 用户输入
|
|
6
|
+
|
|
7
|
+
```text
|
|
8
|
+
$ARGUMENTS
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## 概述
|
|
12
|
+
|
|
13
|
+
本命令处理开发过程中的需求变更、技术方案调整等,确保所有受影响的文档一致更新,变更被正确追踪。
|
|
14
|
+
|
|
15
|
+
## 工作流程
|
|
16
|
+
|
|
17
|
+
### 第 1 步:定位 Issue 并解析变更
|
|
18
|
+
|
|
19
|
+
1. 读取 `.issuekit/config.yaml` 中的 `issues_dir` 配置项,获取 Issue 文档存放目录(默认为 `issues`)
|
|
20
|
+
2. 定位 issue 目录(从 `$ARGUMENTS` 或当前分支,issue 目录位于 `{issues_dir}/{issue-id}/`)
|
|
21
|
+
3. 从 `$ARGUMENTS` 解析变更内容(用户提供的文字/图片)
|
|
22
|
+
4. 分类变更类型:
|
|
23
|
+
- **需求变更**:产品需求发生变化
|
|
24
|
+
- **方案调整**:技术方案调整
|
|
25
|
+
- **配置变更**:配置项变化
|
|
26
|
+
- **范围变更**:需求范围扩大/缩小
|
|
27
|
+
|
|
28
|
+
### 第 2 步:影响分析
|
|
29
|
+
|
|
30
|
+
1. 阅读相关现有文档
|
|
31
|
+
2. 对比变更内容与当前内容,识别差异
|
|
32
|
+
3. 评估对下游文档的影响:
|
|
33
|
+
- 需求变更 → 可能影响:技术方案、测试方案、发布文档
|
|
34
|
+
- 方案调整 → 可能影响:测试方案、发布文档
|
|
35
|
+
- 范围变更 → 可能影响:所有文档
|
|
36
|
+
|
|
37
|
+
### 第 3 步:更新受影响文档
|
|
38
|
+
|
|
39
|
+
对每个受影响的文档:
|
|
40
|
+
|
|
41
|
+
1. **原地更新内容**(保持可读性,不使用删除线)
|
|
42
|
+
2. **追加变更记录条目**到文档的变更记录表:
|
|
43
|
+
```
|
|
44
|
+
| v{N} | {日期} | {变更人} | {变更描述} | {原因} |
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
### 第 4 步:向用户报告
|
|
48
|
+
|
|
49
|
+
1. 总结变更内容
|
|
50
|
+
2. 列出所有更新的文档及版本号
|
|
51
|
+
3. 如果下游文档需要手动更新(如技术方案需要重新设计),提醒用户并建议使用对应的命令
|
|
52
|
+
4. 如果变更显著影响范围,建议重新运行需求文档的质量验证
|