Skip to content

Commit b940085

Browse files
qdrivenclaude
andcommitted
docs: add spec and features documentation, fix homepage and navigation
- Add docs/spec/ with complete parameter specs for all 6 command groups (git, agent, task, magic, script, docs) - Add docs/features/ with feature introductions for each module - Fix docs/index.md frontmatter (title/description for docmd homepage) - Update docmd.config.js navigation to include spec/features sections and fix stale paths from deleted files (Refs: #11) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 9ff3427 commit b940085

File tree

14 files changed

+1324
-50
lines changed

14 files changed

+1324
-50
lines changed

docmd.config.js

Lines changed: 32 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -56,22 +56,46 @@ export default defineConfig({
5656
collapsible: true,
5757
children: [
5858
{ title: '概览', path: '/usage/usage' },
59-
{ title: 'Git 仓库更新', path: '/usage/update' },
60-
{ title: 'Mono-repo 创建', path: '/usage/create' },
61-
{ title: '子模块同步', path: '/usage/sync' },
62-
{ title: 'Gitcode 远程', path: '/usage/gitcode' },
63-
{ title: '任务管理', path: '/usage/task' },
59+
{ title: 'Git 管理', path: '/usage/git' },
6460
{ title: 'AI Agent 配置', path: '/usage/agent' },
65-
{ title: 'VS Code 配置', path: '/usage/vscode-setup' },
61+
{ title: '任务管理', path: '/usage/task' },
62+
{ title: '系统工具', path: '/usage/magic' },
63+
{ title: '脚本管理', path: '/usage/script' },
64+
{ title: '文档管理', path: '/usage/docs-cmd' },
6665
],
6766
},
6867
{
6968
title: '架构设计',
7069
icon: 'sitemap',
7170
collapsible: true,
7271
children: [
73-
{ title: 'CLI 集成报告', path: '/analysis/cli-integration-report' },
74-
{ title: 'Spark Hub 架构 RFC', path: '/analysis/spark-hub-architecture-rfc' },
72+
{ title: '项目分析报告', path: '/analysis/project-analysis' },
73+
],
74+
},
75+
{
76+
title: '功能介绍',
77+
icon: 'puzzle-piece',
78+
collapsible: true,
79+
children: [
80+
{ title: 'Git 管理', path: '/features/git' },
81+
{ title: 'Agent 配置', path: '/features/agent' },
82+
{ title: '任务管理', path: '/features/task' },
83+
{ title: '系统工具', path: '/features/magic' },
84+
{ title: '脚本管理', path: '/features/script' },
85+
{ title: '文档管理', path: '/features/docs-feature' },
86+
],
87+
},
88+
{
89+
title: '命令规格',
90+
icon: 'terminal',
91+
collapsible: true,
92+
children: [
93+
{ title: 'Git', path: '/spec/git' },
94+
{ title: 'Agent', path: '/spec/agent' },
95+
{ title: 'Task', path: '/spec/task' },
96+
{ title: 'Magic', path: '/spec/magic' },
97+
{ title: 'Script', path: '/spec/script' },
98+
{ title: 'Docs', path: '/spec/docs-cmd' },
7599
],
76100
},
77101
{ title: 'Agents', path: '/Agents', icon: 'robot' },

docs/features/agent.md

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
# AI Agent 配置管理
2+
3+
## 功能概述
4+
5+
`spark agent` 统一管理多种 AI Agent(Claude Code、Codex、Kimi、GLM)的配置文件。通过 Profile 模板机制,可以在不同项目间快速切换 Agent 配置。
6+
7+
## 支持的 Agent
8+
9+
| Agent | 配置文件 |
10+
|-------|---------|
11+
| Claude Code | `CLAUDE.md``.claude/settings.json`|
12+
| Codex | `AGENTS.md`、codex 配置 |
13+
| Kimi | `.kimi/` 目录下的配置 |
14+
| GLM | `.glm/` 目录下的配置 |
15+
16+
## 核心能力
17+
18+
### 配置查看与编辑
19+
20+
查看、编辑、重置各 Agent 的配置文件,无需记忆文件路径。
21+
22+
```bash
23+
spark agent list # 列出所有 Agent
24+
spark agent view claude-code # 查看配置
25+
spark agent edit kimi # 编辑配置
26+
spark agent reset glm # 重置配置
27+
```
28+
29+
### Profile 模板
30+
31+
Profile 是配置模板,保存了特定 Agent 的完整配置。可以为不同项目或工作模式创建不同 Profile。
32+
33+
```bash
34+
# 创建 Profile
35+
spark agent profile add my-claude -t claude-code
36+
spark agent profile add my-glm -t glm
37+
38+
# 查看 Profile
39+
spark agent profile show my-claude
40+
spark agent profile edit my-claude
41+
```
42+
43+
### 跨项目应用
44+
45+
将 Profile 应用到指定项目,自动创建或覆盖对应的配置文件。
46+
47+
```bash
48+
spark agent use my-claude # 应用到当前目录
49+
spark agent use my-claude -p /path/to/proj # 应用到指定项目
50+
spark agent current # 查看当前 Profile
51+
```
52+
53+
## 使用参数
54+
55+
| 参数 | 说明 |
56+
|------|------|
57+
| `--tui` | 交互式选择模式 |
58+
| `-t, --type` | Profile 的 Agent 类型 |
59+
| `-p, --project` | 目标项目路径,默认 `.` |
60+
61+
## 相关文档
62+
63+
- [Agent 命令规格](../spec/agent.md)
64+
- [Agent 使用指南](../usage/agent.md)

docs/features/docs-feature.md

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
# 文档管理
2+
3+
## 功能概述
4+
5+
`spark docs` 管理项目文档结构和 docmd 站点配置。一键创建标准文档目录,自动生成 docmd 配置文件。
6+
7+
## 核心能力
8+
9+
### 文档目录初始化
10+
11+
创建标准文档目录结构:
12+
13+
```
14+
docs/
15+
├── Agents.md
16+
├── analysis/
17+
├── features/
18+
├── index.md
19+
├── quick-start/
20+
├── README.md
21+
├── spec/
22+
├── tips/
23+
└── usage/
24+
```
25+
26+
已存在的文件和目录会被跳过,不会覆盖。
27+
28+
```bash
29+
spark docs init
30+
spark docs init --root /path/to/project
31+
```
32+
33+
### docmd 站点初始化
34+
35+
自动生成 docmd 配置文件 `docmd.config.js`
36+
- 从 git remote 自动检测项目名称和 GitHub Pages URL
37+
- 配置 sky 主题、SPA 布局
38+
- 启用搜索、Mermaid 图表、LLM 全文索引等插件
39+
- 自动安装 `@docmd/core`(如果未安装)
40+
- 自动初始化 `package.json`(如果不存在)
41+
42+
```bash
43+
spark docs site
44+
spark docs site --root /path/to/project
45+
```
46+
47+
初始化后可运行:
48+
```bash
49+
docmd dev # 本地预览
50+
docmd build # 构建静态站点
51+
```
52+
53+
## 使用参数
54+
55+
| 参数 | 类型 | 默认值 | 说明 |
56+
|------|------|--------|------|
57+
| `--root` | string | `.` | 项目根目录 |
58+
59+
## 依赖
60+
61+
- Node.js(docmd 站点功能)
62+
- `@docmd/core`(自动安装)
63+
64+
## 相关文档
65+
66+
- [Docs 命令规格](../spec/docs-cmd.md)
67+
- [Docs 使用指南](../usage/docs-cmd.md)

docs/features/git.md

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
# Git 仓库管理
2+
3+
## 功能概述
4+
5+
`spark git` 提供多仓库 Git 管理能力,涵盖批量更新、Mono-repo 创建与同步、Gitcode 远程配置、组织仓库克隆等功能。
6+
7+
## 核心能力
8+
9+
### 多仓库批量更新
10+
11+
扫描配置目录下所有 Git 仓库,执行批量 `git pull`。适合同时维护多个仓库的日常更新。
12+
13+
```bash
14+
spark git update -p ~/workspace
15+
```
16+
17+
### Mono-repo 管理
18+
19+
将多个独立仓库作为 Submodule 合并为一个 Mono-repo,方便统一管理和版本控制。
20+
21+
```bash
22+
# 创建 Mono-repo
23+
spark git create -n my-mono -o ./output
24+
25+
# 同步所有 Submodule 到最新
26+
spark git sync ./my-mono
27+
```
28+
29+
### Gitcode 远程集成
30+
31+
为仓库自动添加 Gitcode(https://gitcode.com)远程仓库,实现 GitHub ↔ Gitcode 双向同步。
32+
33+
```bash
34+
spark git gitcode -p ~/workspace
35+
```
36+
37+
### 组织仓库管理
38+
39+
克隆 GitHub 组织下所有仓库,或更新组织 README 中的仓库状态列表。
40+
41+
```bash
42+
# 克隆组织仓库
43+
spark git clone-org variableway -o ./repos
44+
45+
# 更新组织状态
46+
spark git update-org-status variableway --update-dot-github
47+
```
48+
49+
## 使用参数
50+
51+
| 参数 | 说明 |
52+
|------|------|
53+
| `-p, --path` | 指定扫描目录(支持多个),默认 `["."]` |
54+
| `-n, --name` | Mono-repo 名称,默认 `mono-repo` |
55+
| `-o, --output` | 输出路径 |
56+
| `--ssh` | 使用 SSH 克隆(clone-org) |
57+
| `--include` / `--exclude` | 包含/排除匹配模式(clone-org) |
58+
59+
## 依赖
60+
61+
- `git` 命令行工具
62+
- `gh` CLI(clone-org、update-org-status 需要 GitHub API 访问)
63+
64+
## 相关文档
65+
66+
- [Git 命令规格](../spec/git.md)
67+
- [Git 使用指南](../usage/git.md)

docs/features/magic.md

Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
# 系统工具
2+
3+
## 功能概述
4+
5+
`spark magic` 提供日常开发中的系统工具,包括 DNS 缓存刷新和包管理器镜像源切换。
6+
7+
## 核心能力
8+
9+
### DNS 刷新
10+
11+
一键刷新系统 DNS 缓存,支持 macOS、Windows、Linux。
12+
13+
```bash
14+
spark magic flush-dns
15+
```
16+
17+
### Python pip 镜像源切换
18+
19+
管理 pip 的镜像源配置,解决国内访问 PyPI 速度慢的问题。
20+
21+
```bash
22+
spark magic pip list # 列出可用源
23+
spark magic pip use tsinghua # 切换到清华源
24+
spark magic pip current # 查看当前源
25+
```
26+
27+
可用镜像源:
28+
29+
| 名称 | 说明 |
30+
|------|------|
31+
| `tsinghua` | 清华大学 |
32+
| `aliyun` | 阿里云 |
33+
| `douban` | 豆瓣 |
34+
| `ustc` | 中国科技大学 |
35+
| `tencent` | 腾讯云 |
36+
37+
### Go Module Proxy 切换
38+
39+
管理 Go module proxy 配置。
40+
41+
```bash
42+
spark magic go list # 列出可用 proxy
43+
spark magic go use goproxy # 切换到 goproxy.cn
44+
spark magic go current # 查看当前 proxy
45+
```
46+
47+
可用 Proxy:
48+
49+
| 名称 | 说明 |
50+
|------|------|
51+
| `aliyun` | 阿里云 |
52+
| `tsinghua` | 清华大学 |
53+
| `goproxy` | goproxy.cn |
54+
| `ustc` | 中国科技大学 |
55+
| `nju` | 南京大学 |
56+
57+
### Node.js npm Registry 切换
58+
59+
管理 npm registry 配置。
60+
61+
```bash
62+
spark magic node list # 列出可用 registry
63+
spark magic node use taobao # 切换到淘宝源
64+
spark magic node current # 查看当前 registry
65+
```
66+
67+
可用 Registry:
68+
69+
| 名称 | 说明 |
70+
|------|------|
71+
| `taobao` | 淘宝 |
72+
| `aliyun` | 阿里云 |
73+
| `tencent` | 腾讯云 |
74+
| `huawei` | 华为云 |
75+
| `ustc` | 中国科技大学 |
76+
77+
## 使用参数
78+
79+
三个镜像切换命令(pip/go/node)共享相同的子命令结构:
80+
81+
| 子命令 | 参数 | 说明 |
82+
|--------|------|------|
83+
| `list` || 列出可用源 |
84+
| `use` | `<name>` | 切换到指定源 |
85+
| `current` || 显示当前配置 |
86+
87+
## 相关文档
88+
89+
- [Magic 命令规格](../spec/magic.md)

docs/features/script.md

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
# 脚本管理
2+
3+
## 功能概述
4+
5+
`spark script` 管理和执行自定义自动化脚本。脚本可以来自配置文件声明,也可以是 `scripts/` 目录下的可执行文件。
6+
7+
## 核心能力
8+
9+
### 脚本发现
10+
11+
自动发现两种来源的脚本:
12+
1. **配置文件脚本**`~/.spark.yaml` 中的 `spark.scripts` 或顶层 `scripts` 配置
13+
2. **目录脚本**:项目 `scripts/` 目录下的可执行文件
14+
15+
配置文件脚本优先级高于目录脚本。
16+
17+
```bash
18+
spark script list
19+
```
20+
21+
### 脚本执行
22+
23+
通过名称执行已注册的脚本,支持传递额外参数。
24+
25+
```bash
26+
spark script run my-script
27+
spark script run deploy -- --env production
28+
```
29+
30+
## 使用参数
31+
32+
| 命令 | 参数 | 说明 |
33+
|------|------|------|
34+
| `list` || 列出所有可用脚本 |
35+
| `run` | `<name> [args...]` | 执行脚本并传递参数 |
36+
37+
## 配置示例
38+
39+
```yaml
40+
# ~/.spark.yaml
41+
spark:
42+
scripts:
43+
- name: hello
44+
description: Say hello
45+
command: echo "Hello, World!"
46+
```
47+
48+
## 相关文档
49+
50+
- [Script 命令规格](../spec/script.md)

0 commit comments

Comments
 (0)