@zeyue0329/xiaoma-cli 1.8.0 → 1.8.1
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.
- package/.idea/XiaoMa-Cli.iml +9 -0
- package/.idea/inspectionProfiles/Project_Default.xml +6 -0
- package/.idea/misc.xml +6 -0
- package/.idea/modules.xml +8 -0
- package/.idea/prettier.xml +6 -0
- package/.idea/vcs.xml +6 -0
- package/CLAUDE.md +93 -0
- package/TECH-STACK.md +62 -0
- package/package.json +1 -1
- package/pipeline-optimization-report.md +400 -347
- package/run-5-analysis-report.md +436 -0
- package/src/xmc/workflows/1-analysis/auto-requirements-pipeline/steps/step-05-validate-prd.md +54 -1
- package/src/xmc/workflows/4-implementation/auto-story-pipeline/steps/step-01-init-and-validate.md +6 -1
- package/src/xmc/workflows/4-implementation/auto-story-pipeline/steps/step-02-create-story.md +13 -2
- package/src/xmc/workflows/4-implementation/auto-story-pipeline/steps/step-03-validate-story.md +3 -1
- package/src/xmc/workflows/4-implementation/auto-story-pipeline/steps/step-04-develop-story.md +14 -7
- package/src/xmc/workflows/4-implementation/auto-story-pipeline/steps/step-05-code-review.md +2 -2
- package/src/xmc/workflows/4-implementation/auto-story-pipeline/steps/step-06-test-story.md +111 -2
- package/src/xmc/workflows/4-implementation/auto-story-pipeline/steps/step-07-fix-and-retest.md +109 -0
- package/src/xmc/workflows/4-implementation/auto-story-pipeline/steps/step-08-complete-story.md +2 -2
- package/src/xmc/workflows/4-implementation/auto-story-pipeline/steps/step-09-cycle-check.md +3 -0
- package/src/xmc/workflows/4-implementation/auto-story-pipeline/workflow.md +3 -1
- package/tools/cli/installers/lib/ide/templates/combined/gemini-task.toml +2 -2
- package/tools/cli/installers/lib/ide/templates/combined/gemini-tool.toml +2 -2
- package/tools/cli/installers/lib/ide/templates/combined/gemini-workflow-yaml.toml +1 -1
- package/tools/cli/installers/lib/ide/templates/combined/gemini-workflow.toml +1 -1
- package/tools/cli/lib/cli-utils.js +7 -7
- package//344/270/223/345/210/251/344/272/244/345/272/225/344/271/246_1_/351/235/242/345/220/221AI/346/231/272/350/203/275/344/275/223/345/210/266/345/223/201/347/232/204/345/244/232/351/200/232/351/201/223/344/276/235/350/265/226_20260318.docx +0 -0
- package//344/270/223/345/210/251/344/272/244/345/272/225/344/271/246_2_/345/237/272/344/272/216/351/205/215/347/275/256/351/251/261/345/212/250/347/232/204/350/267/250/345/271/263/345/217/260IDE/346/231/272/350/203/275_20260318.docx +0 -0
- package//344/270/223/345/210/251/344/272/244/345/272/225/344/271/246_3_AI/346/231/272/350/203/275/344/275/223/345/243/260/346/230/216/345/274/217/345/256/232/344/271/211/347/232/204/347/274/226/350/257/221/346/265/201/346/260/264_20260318.docx +0 -0
- package//344/270/223/345/210/251/344/272/244/345/272/225/344/271/246_4_/345/237/272/344/272/216/345/223/210/345/270/214/346/214/207/347/272/271/347/232/204/346/231/272/350/203/275/344/275/223/351/231/204/345/261/236/350/265/204/346/272/220/351/200/211_20260318.docx +0 -0
- package//344/270/223/345/210/251/344/272/244/345/272/225/344/271/246_5_AI/346/231/272/350/203/275/344/275/223/350/247/246/345/217/221/346/214/207/344/273/244/347/232/204/345/244/215/345/220/210/346/240/274/345/274/217/346/240/241_20260318.docx +0 -0
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<module type="JAVA_MODULE" version="4">
|
|
3
|
+
<component name="NewModuleRootManager" inherit-compiler-output="true">
|
|
4
|
+
<exclude-output />
|
|
5
|
+
<content url="file://$MODULE_DIR$" />
|
|
6
|
+
<orderEntry type="inheritedJdk" />
|
|
7
|
+
<orderEntry type="sourceFolder" forTests="false" />
|
|
8
|
+
</component>
|
|
9
|
+
</module>
|
package/.idea/misc.xml
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<project version="4">
|
|
3
|
+
<component name="ProjectRootManager" version="2" languageLevel="JDK_24" default="true" project-jdk-name="24" project-jdk-type="JavaSDK">
|
|
4
|
+
<output url="file://$PROJECT_DIR$/out" />
|
|
5
|
+
</component>
|
|
6
|
+
</project>
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<project version="4">
|
|
3
|
+
<component name="ProjectModuleManager">
|
|
4
|
+
<modules>
|
|
5
|
+
<module fileurl="file://$PROJECT_DIR$/.idea/XiaoMa-Cli.iml" filepath="$PROJECT_DIR$/.idea/XiaoMa-Cli.iml" />
|
|
6
|
+
</modules>
|
|
7
|
+
</component>
|
|
8
|
+
</project>
|
package/.idea/vcs.xml
ADDED
package/CLAUDE.md
ADDED
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
# CLAUDE.md
|
|
2
|
+
|
|
3
|
+
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
|
|
4
|
+
|
|
5
|
+
## Project Overview
|
|
6
|
+
|
|
7
|
+
XiaoMa-CLI (`@zeyue0329/xiaoma-cli`) is an AI-driven agile development framework/CLI tool. It installs specialized AI agent personas, workflows, and skills into a user's project directory for use with AI IDEs (Claude Code, Cursor, etc.). Node.js v20+ required.
|
|
8
|
+
|
|
9
|
+
## Common Commands
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
# Quality gate (run before commits)
|
|
13
|
+
npm run quality
|
|
14
|
+
|
|
15
|
+
# Individual checks
|
|
16
|
+
npm run test:schemas # Agent YAML schema validation (Zod-based)
|
|
17
|
+
npm run test:install # Installation component tests
|
|
18
|
+
npm run test:refs # Cross-file reference validation
|
|
19
|
+
npm run validate:schemas # Schema validation (separate from test)
|
|
20
|
+
npm run validate:refs # File reference validation (strict mode)
|
|
21
|
+
npm run lint # ESLint (JS + YAML), zero warnings allowed
|
|
22
|
+
npm run lint:md # Markdown linting
|
|
23
|
+
npm run format:check # Prettier check
|
|
24
|
+
npm run format:fix # Prettier auto-fix
|
|
25
|
+
|
|
26
|
+
# Test coverage
|
|
27
|
+
npm run test:coverage # c8 coverage report for schema tests
|
|
28
|
+
|
|
29
|
+
# Run the CLI locally
|
|
30
|
+
npm run install:xiaoma # Run install command
|
|
31
|
+
npm run xiaoma:uninstall # Run uninstall command
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
The full `npm test` runs: test:schemas → test:refs → test:install → validate:schemas → lint → lint:md → format:check.
|
|
35
|
+
|
|
36
|
+
## Architecture
|
|
37
|
+
|
|
38
|
+
### Two-Layer Structure
|
|
39
|
+
|
|
40
|
+
1. **`src/`** — Content modules (YAML agents, Markdown workflows, skills)
|
|
41
|
+
2. **`tools/`** — CLI implementation (Node.js/CommonJS, installer, validators)
|
|
42
|
+
|
|
43
|
+
### Module System
|
|
44
|
+
|
|
45
|
+
Modules are defined by `module.yaml` files with configuration variables, prompts, and directory declarations:
|
|
46
|
+
- **`src/core/`** — Shared skills and tasks (module code: `core`)
|
|
47
|
+
- **`src/xmc/`** — XiaoMa Method module, the primary agile framework (module code: `xmc`)
|
|
48
|
+
|
|
49
|
+
### Agent System (`src/xmc/agents/`)
|
|
50
|
+
|
|
51
|
+
Agents are YAML files validated against a Zod schema (`tools/schema/`). Each agent defines:
|
|
52
|
+
- `metadata` — id, name, title, icon, module, capabilities
|
|
53
|
+
- `persona` — role, identity, communication_style, principles
|
|
54
|
+
- `menu` — trigger commands pointing to workflow exec targets
|
|
55
|
+
- `prompts` / `critical_actions` — optional
|
|
56
|
+
|
|
57
|
+
### Workflow System (`src/xmc/workflows/`)
|
|
58
|
+
|
|
59
|
+
Organized by development phase:
|
|
60
|
+
- `1-analysis/` — Brainstorming, research, product brief
|
|
61
|
+
- `2-plan-workflows/` — PRD creation/validation, UX design
|
|
62
|
+
- `3-solutioning/` — Architecture, epics/stories, implementation readiness
|
|
63
|
+
- `4-implementation/` — Sprint planning, story execution, code review, retros
|
|
64
|
+
|
|
65
|
+
Each workflow has: `workflow.md` (entry point with metadata), `steps/` or `steps-{variant}/` directories, and optional `templates/` and `data/` directories.
|
|
66
|
+
|
|
67
|
+
### CLI (`tools/cli/`)
|
|
68
|
+
|
|
69
|
+
- **Entry**: `xiaoma-cli.js` (Commander.js) → wrapped by `xiaoma-npx-wrapper.js`
|
|
70
|
+
- **Commands**: `install`, `status`, `uninstall`
|
|
71
|
+
- **Installer** (`tools/cli/installers/`): Core orchestration class (~8K LOC), module manager, IDE config manager, manifest generator
|
|
72
|
+
- **UI**: `@clack/prompts` for interactive terminal prompts
|
|
73
|
+
|
|
74
|
+
### Skills (`src/core/skills/`)
|
|
75
|
+
|
|
76
|
+
Reusable capabilities: `xiaoma-help`, `xiaoma-brainstorming`, `xiaoma-distillator`, `xiaoma-party-mode`, editorial review skills, etc.
|
|
77
|
+
|
|
78
|
+
## Code Conventions
|
|
79
|
+
|
|
80
|
+
- **JS**: CommonJS (`require`/`module.exports`) for all CLI/tool code
|
|
81
|
+
- **YAML**: `.yaml` extension enforced by ESLint (not `.yml`); double quotes preferred
|
|
82
|
+
- **Formatting**: Prettier with 140 char print width, 2-space indent, double quotes in YAML, single quotes in JS
|
|
83
|
+
- **Linting**: ESLint flat config with unicorn, node, yml plugins; `--max-warnings=0`
|
|
84
|
+
- **Schema validation**: Zod for agent YAML validation at `tools/schema/`
|
|
85
|
+
- **Git hooks**: Husky + lint-staged (runs lint:fix and format:fix on staged files)
|
|
86
|
+
|
|
87
|
+
## Testing
|
|
88
|
+
|
|
89
|
+
Tests are plain Node.js scripts (no test framework), located in `test/`:
|
|
90
|
+
- `test-agent-schema.js` — Validates all agent YAML against Zod schema; 50 fixtures (18 valid, 32 invalid); targets 100% coverage
|
|
91
|
+
- `test-installation-components.js` — Installation flow verification
|
|
92
|
+
- `test-file-refs-csv.js` — Validates cross-file references in CSV data files
|
|
93
|
+
- Fixtures in `test/fixtures/agent-schema/{valid,invalid}/`
|
package/TECH-STACK.md
ADDED
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
# XiaoMa-CLI 技术栈清单
|
|
2
|
+
|
|
3
|
+
## 运行环境
|
|
4
|
+
|
|
5
|
+
| 技术 | 版本 | 用途 |
|
|
6
|
+
|---|---|---|
|
|
7
|
+
| Node.js | >= 20.0.0 | 运行环境 |
|
|
8
|
+
| npm | - | 包管理 |
|
|
9
|
+
|
|
10
|
+
## 运行时依赖
|
|
11
|
+
|
|
12
|
+
| 库 | 用途 |
|
|
13
|
+
|---|---|
|
|
14
|
+
| **commander** | CLI 命令行参数解析 |
|
|
15
|
+
| **@clack/prompts** + **@clack/core** | 交互式终端提示 UI |
|
|
16
|
+
| **chalk** | 终端颜色输出 |
|
|
17
|
+
| **picocolors** | 轻量终端颜色(配合 clack) |
|
|
18
|
+
| **ora** | 终端 loading 动画 |
|
|
19
|
+
| **zod** | YAML schema 运行时校验 |
|
|
20
|
+
| **yaml** + **js-yaml** | YAML 解析(两个库并存) |
|
|
21
|
+
| **csv-parse** | CSV 文件解析 |
|
|
22
|
+
| **xml2js** | XML 解析 |
|
|
23
|
+
| **glob** | 文件路径模式匹配 |
|
|
24
|
+
| **fs-extra** | 增强的文件系统操作 |
|
|
25
|
+
| **semver** | 语义化版本号比较 |
|
|
26
|
+
| **ignore** | .gitignore 风格的文件过滤 |
|
|
27
|
+
| **@kayvan/markdown-tree-parser** | Markdown 结构解析 |
|
|
28
|
+
|
|
29
|
+
## 开发依赖
|
|
30
|
+
|
|
31
|
+
| 库 | 用途 |
|
|
32
|
+
|---|---|
|
|
33
|
+
| **eslint** (v9, flat config) | JS/YAML 代码检查 |
|
|
34
|
+
| **eslint-plugin-n** | Node.js 规则 |
|
|
35
|
+
| **eslint-plugin-unicorn** | 现代 JS 最佳实践 |
|
|
36
|
+
| **eslint-plugin-yml** | YAML 文件检查 |
|
|
37
|
+
| **yaml-eslint-parser** | YAML ESLint 解析器 |
|
|
38
|
+
| **prettier** | 代码格式化 |
|
|
39
|
+
| **prettier-plugin-packagejson** | package.json 排序格式化 |
|
|
40
|
+
| **eslint-config-prettier** | ESLint/Prettier 冲突处理 |
|
|
41
|
+
| **markdownlint-cli2** | Markdown 检查 |
|
|
42
|
+
| **yaml-lint** | YAML 语法检查 |
|
|
43
|
+
| **jest** (v30) | 测试框架(已引入,当前测试为纯 Node 脚本) |
|
|
44
|
+
| **c8** | 代码覆盖率(Istanbul 兼容) |
|
|
45
|
+
| **husky** | Git hooks 管理 |
|
|
46
|
+
| **lint-staged** | 暂存文件自动检查 |
|
|
47
|
+
|
|
48
|
+
## 内容/配置格式
|
|
49
|
+
|
|
50
|
+
| 格式 | 用途 |
|
|
51
|
+
|---|---|
|
|
52
|
+
| **YAML** | Agent 定义、模块配置、CI/CD |
|
|
53
|
+
| **Markdown** | 工作流步骤、模板、文档 |
|
|
54
|
+
| **CSV** | 数据文件、交叉引用 |
|
|
55
|
+
| **JSON** | 包配置、IDE 配置输出 |
|
|
56
|
+
|
|
57
|
+
## CI/CD
|
|
58
|
+
|
|
59
|
+
| 技术 | 用途 |
|
|
60
|
+
|---|---|
|
|
61
|
+
| **GitHub Actions** | 质量门禁 + 发布自动化 |
|
|
62
|
+
| **npm publish** | 包发布(public scope) |
|