ys-team 0.2.0

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.
Files changed (78) hide show
  1. package/AGENTS.md +64 -0
  2. package/CLAUDE.md +33 -0
  3. package/LICENSE +21 -0
  4. package/README.md +130 -0
  5. package/docs/project/module-index.md +61 -0
  6. package/docs/project/npm-publish.md +57 -0
  7. package/docs/project/overview.md +87 -0
  8. package/docs/project/structure.md +22 -0
  9. package/docs/roadmap/active/.gitkeep +1 -0
  10. package/docs/roadmap/cancelled/.gitkeep +1 -0
  11. package/docs/roadmap/completed/.gitkeep +1 -0
  12. package/docs/roadmap/queued/.gitkeep +1 -0
  13. package/docs/specs/active/.gitkeep +1 -0
  14. package/docs/specs/active/20260407-170500-npm-distribution-modes/control.md +121 -0
  15. package/docs/specs/active/20260407-170500-npm-distribution-modes/evidence/20260407-dual-mode-and-publish-readiness.md +58 -0
  16. package/docs/specs/active/20260407-170500-npm-distribution-modes/work-01-global-and-project-install.md +57 -0
  17. package/docs/specs/active/20260407-170500-npm-distribution-modes/work-02-doc-and-publish-readiness.md +61 -0
  18. package/docs/specs/cancelled/.gitkeep +1 -0
  19. package/docs/specs/completed/.gitkeep +1 -0
  20. package/docs/specs/completed/20260331-110000-ys-team-init-and-productization/control.md +139 -0
  21. package/docs/specs/completed/20260331-110000-ys-team-init-and-productization/evidence/20260407-closeout.md +29 -0
  22. package/docs/specs/completed/20260331-110000-ys-team-init-and-productization/work-01-method-and-skill-surface.md +70 -0
  23. package/docs/specs/completed/20260331-110000-ys-team-init-and-productization/work-02-python-java-onboarding.md +74 -0
  24. package/docs/specs/completed/20260331-110000-ys-team-init-and-productization/work-03-next-skill-surface.md +70 -0
  25. package/docs/specs/completed/20260331-110000-ys-team-init-and-productization/work-04-workflow-visibility-and-distribution.md +88 -0
  26. package/docs/specs/completed/20260407-161500-npm-skill-installer/control.md +117 -0
  27. package/docs/specs/completed/20260407-161500-npm-skill-installer/evidence/20260407-npm-installer-closeout.md +38 -0
  28. package/docs/specs/completed/20260407-161500-npm-skill-installer/work-01-cli-install-skills.md +58 -0
  29. package/docs/specs/completed/20260407-161500-npm-skill-installer/work-02-doc-and-package-surface.md +61 -0
  30. package/examples/baseline/.ys_team/README.md +5 -0
  31. package/examples/baseline/.ys_team/VERSION +1 -0
  32. package/examples/baseline/.ys_team/evolution/requests.md +12 -0
  33. package/examples/baseline/.ys_team/methods.md +54 -0
  34. package/examples/baseline/.ys_team/policy.md +81 -0
  35. package/examples/baseline/.ys_team/roles/external/db-migration-auditor.md +5 -0
  36. package/examples/baseline/.ys_team/roles/external/frontend-accessibility-reviewer.md +5 -0
  37. package/examples/baseline/.ys_team/roles/external/observability-reviewer.md +5 -0
  38. package/examples/baseline/.ys_team/roles/external/security-reviewer.md +5 -0
  39. package/examples/baseline/.ys_team/roles/internal/delivery-guard.md +5 -0
  40. package/examples/baseline/.ys_team/roles/internal/doc-spec-steward.md +5 -0
  41. package/examples/baseline/.ys_team/roles/internal/domain-integrator.md +5 -0
  42. package/examples/baseline/.ys_team/roles/internal/project-architect.md +5 -0
  43. package/examples/baseline/.ys_team/status.md +23 -0
  44. package/examples/baseline/.ys_team/team.md +34 -0
  45. package/examples/baseline/.ys_team/templates/control.md +31 -0
  46. package/examples/baseline/.ys_team/templates/roadmap-version.md +20 -0
  47. package/examples/baseline/.ys_team/templates/work.md +30 -0
  48. package/examples/baseline/.ys_team/toolbox/_candidates.md +7 -0
  49. package/examples/baseline/.ys_team/toolbox/_sources.md +7 -0
  50. package/examples/baseline/AGENTS.md +51 -0
  51. package/examples/baseline/CLAUDE.md +32 -0
  52. package/examples/baseline/README.md +54 -0
  53. package/examples/baseline/docs/project/overview.md +5 -0
  54. package/examples/baseline/docs/roadmap/active/.gitkeep +1 -0
  55. package/examples/baseline/docs/roadmap/cancelled/.gitkeep +1 -0
  56. package/examples/baseline/docs/roadmap/completed/.gitkeep +1 -0
  57. package/examples/baseline/docs/roadmap/queued/.gitkeep +1 -0
  58. package/examples/baseline/docs/specs/active/.gitkeep +1 -0
  59. package/examples/baseline/docs/specs/cancelled/.gitkeep +1 -0
  60. package/examples/baseline/docs/specs/completed/.gitkeep +1 -0
  61. package/examples/baseline/docs/specs/queued/.gitkeep +1 -0
  62. package/package.json +33 -0
  63. package/registry/frontend-react.md +10 -0
  64. package/registry/fullstack.md +10 -0
  65. package/registry/general.md +16 -0
  66. package/registry/java-backend.md +9 -0
  67. package/registry/python-backend.md +9 -0
  68. package/scripts/hooks-template.json +18 -0
  69. package/scripts/ys-team.mjs +284 -0
  70. package/skills/ys-team/SKILL.md +112 -0
  71. package/skills/ys-team-doc-build/SKILL.md +159 -0
  72. package/skills/ys-team-init/SKILL.md +161 -0
  73. package/skills/ys-team-rebuild/SKILL.md +89 -0
  74. package/skills/ys-team-spec-talk/SKILL.md +163 -0
  75. package/skills/ys-team-spec-work/SKILL.md +92 -0
  76. package/skills/ys-team-status/SKILL.md +86 -0
  77. package/skills/ys-team-submit/SKILL.md +54 -0
  78. package/skills/ys-team-talk/SKILL.md +25 -0
@@ -0,0 +1,51 @@
1
+ # AGENTS.md
2
+
3
+ ## 最高优先级工作流
4
+
5
+ 本仓库使用 `ys-team` 排他工作流。
6
+
7
+ **任何请求必须先经过 `ys-team` 路由。**
8
+
9
+ **如果当前回复末尾没有出现 `ys-team` 可见标志,视为不在 ys-team 工作流中,必须立即切回路由。**
10
+
11
+ Trivial 改动定义(可直接执行,无需 spec):
12
+ - 单文件修改
13
+ - 无跨模块影响
14
+ - 无回滚风险
15
+ - 用户明确说明是 trivial(如"修拼写错误"、"改注释")
16
+
17
+ **如果不确定是否 trivial,必须触发 ys-team-spec-talk。**
18
+
19
+ ## Skill 排他规则
20
+
21
+ **禁止自动触发 `.ys_team/toolbox/` 以外的任何 skill。**
22
+
23
+ 已内化的工具清单见 `.ys_team/toolbox/_sources.md`。
24
+ 仅这些工具的能力(以内化后的版本为准)在工作流中可用。
25
+
26
+ 用户如需临时使用未内化的 skill,必须显式指定(如 `/skill-name`)。
27
+ 此时 ys-team 记录该使用行为,作为下次 rebuild 的内化候选。
28
+
29
+ ## 例外
30
+
31
+ 用户在 CLAUDE.md 中显式声明的全局 skill 不受此规则限制。
32
+
33
+ ## 可见标志规则
34
+
35
+ 只要正在执行 `ys-team` 工作流,回复末尾必须出现以下其一:
36
+
37
+ - 路由判断:`` `ys-team` · [判断结果] → [下一步] ``
38
+ - discussion / spec-talk:`**[主持人]** ys-team · spec-talk`
39
+ - spec-work:`**[执行中]** ys-team · spec-work`
40
+ - submit:`**[验收]** ys-team · submit`
41
+ - status:`**[状态]** ys-team · status`
42
+
43
+ 如果缺少这些标志,直接要求:
44
+
45
+ `请先进入 ys-team 工作流,并给出当前阶段标志。`
46
+
47
+ ## 现实索引
48
+
49
+ 项目现实索引位于 `docs/project/module-index.md`。
50
+
51
+ 在讨论影响范围、编写 spec 或评估改动风险时,先读取该索引,而不是直接探索代码库。
@@ -0,0 +1,32 @@
1
+ # CLAUDE.md
2
+
3
+ 本项目启用 `ys-team` 工作流后,默认进入排他模式。
4
+
5
+ ## 首先做什么
6
+
7
+ - 先判断当前请求是否已进入 `ys-team` 路由
8
+ - 如果不是 trivial 改动,先进入 discussion / spec 链路
9
+
10
+ ## 工作流可见标志
11
+
12
+ 正在执行 `ys-team` 时,回复末尾必须出现以下其一:
13
+
14
+ - 路由判断:`` `ys-team` · [判断结果] → [下一步] ``
15
+ - discussion / spec-talk:`**[主持人]** ys-team · spec-talk`
16
+ - spec-work:`**[执行中]** ys-team · spec-work`
17
+ - submit:`**[验收]** ys-team · submit`
18
+ - status:`**[状态]** ys-team · status`
19
+
20
+ 如果没有这些标志,直接要求:
21
+
22
+ `请先进入 ys-team 工作流,并给出当前阶段标志。`
23
+
24
+ ## 排他规则
25
+
26
+ - 禁止自动触发 `.ys_team/toolbox/` 以外的任何 skill
27
+ - 用户在仓库自己的 `CLAUDE.md` 中显式声明的全局 skill 例外
28
+
29
+ ## 现实索引
30
+
31
+ - 先读取 `docs/project/module-index.md`
32
+ - 再判断影响范围和是否需要 spec
@@ -0,0 +1,54 @@
1
+ # baseline
2
+
3
+ `baseline` 是 `ys-team` 当前默认工作流的公开承载。
4
+
5
+ 它不是某个项目的完整复制品,而是从已验证项目工作流中提纯出来的默认骨架。
6
+
7
+ ## 作用
8
+
9
+ - 作为 `ys-team-init` 的默认工作流来源
10
+ - 作为使用者理解“初始化后项目会长成什么样”的样例
11
+ - 作为后续新增 preset 前的默认 baseline
12
+
13
+ ## 设计原则
14
+
15
+ - 保留通用协作机制
16
+ - 保留 spec-first 骨架
17
+ - 保留角色、模板、证据和文档同步机制
18
+ - 不保留具体项目的领域角色、目录结构和技术栈命令
19
+
20
+ ## 包含内容
21
+
22
+ - `.ys_team/`
23
+ - `docs/specs/`
24
+ - `docs/roadmap/`
25
+ - `docs/project/`
26
+
27
+ ## 默认能力目标
28
+
29
+ 基于 `baseline` 初始化后的项目,应直接具备这条默认链路:
30
+
31
+ - discussion
32
+ - spec
33
+ - work
34
+ - acceptance
35
+
36
+ 这些能力可以由多个静默内部 skills 支撑,但不要求用户主动点名调用。
37
+
38
+ ## 可见标志
39
+
40
+ 初始化后的项目在执行 `ys-team` 工作流时,回复末尾必须出现明显标志:
41
+
42
+ - 路由判断:`` `ys-team` · [判断结果] → [下一步] ``
43
+ - discussion / spec-talk:`**[主持人]** ys-team · spec-talk`
44
+ - spec-work:`**[执行中]** ys-team · spec-work`
45
+ - submit:`**[验收]** ys-team · submit`
46
+ - status:`**[状态]** ys-team · status`
47
+
48
+ 如果没有这些标志,说明当前还没有真正进入 ys-team 工作流。
49
+
50
+ ## 不包含内容
51
+
52
+ - 某个单一项目的领域角色
53
+ - 某个语言栈的固定验证命令
54
+ - 某个业务系统的目录映射
@@ -0,0 +1,5 @@
1
+ # baseline 项目概览示例
2
+
3
+ 这里用于展示一个项目在接入 `ys-team` 之后,应该如何维护自己的现实索引。
4
+
5
+ 真实项目应把这里替换成自己的现状说明。
package/package.json ADDED
@@ -0,0 +1,33 @@
1
+ {
2
+ "name": "ys-team",
3
+ "version": "0.2.0",
4
+ "description": "AI 团队治理方法论:以共享现实索引为对齐基础、以 Spec 为执行与验收统一依据的轻量治理框架",
5
+ "keywords": [
6
+ "claude-code",
7
+ "ai-team",
8
+ "governance",
9
+ "spec-first",
10
+ "skills"
11
+ ],
12
+ "license": "MIT",
13
+ "repository": {
14
+ "type": "git",
15
+ "url": "https://github.com/dwp7399/ys-team"
16
+ },
17
+ "publishConfig": {
18
+ "access": "public"
19
+ },
20
+ "bin": {
21
+ "ys-team": "./scripts/ys-team.mjs"
22
+ },
23
+ "files": [
24
+ "skills/",
25
+ "examples/",
26
+ "registry/",
27
+ "scripts/",
28
+ "docs/",
29
+ "README.md",
30
+ "AGENTS.md",
31
+ "CLAUDE.md"
32
+ ]
33
+ }
@@ -0,0 +1,10 @@
1
+ # 前端 (React) 项目工具推荐
2
+
3
+ 在通用推荐基础上,额外推荐以下工具。
4
+
5
+ ## 推荐列表
6
+
7
+ | 工具 | 用途 | 绑定角色建议 | 来源 |
8
+ |------|------|-------------|------|
9
+ | frontend-design | 前端界面设计规范 | project-architect | frontend-design:frontend-design |
10
+ | test-driven-development | TDD 开发流程 | project-architect | superpowers:test-driven-development |
@@ -0,0 +1,10 @@
1
+ # 全栈项目工具推荐
2
+
3
+ 在通用推荐基础上,额外推荐以下工具。
4
+
5
+ ## 推荐列表
6
+
7
+ | 工具 | 用途 | 绑定角色建议 | 来源 |
8
+ |------|------|-------------|------|
9
+ | frontend-design | 前端界面设计规范 | project-architect | frontend-design:frontend-design |
10
+ | test-driven-development | TDD 开发流程 | project-architect | superpowers:test-driven-development |
@@ -0,0 +1,16 @@
1
+ # 通用工具推荐
2
+
3
+ 适用于所有项目类型的基础工具推荐。
4
+
5
+ ## 推荐列表
6
+
7
+ | 工具 | 用途 | 绑定角色建议 | 来源 |
8
+ |------|------|-------------|------|
9
+ | verification-before-completion | 完成前验证检查 | delivery-guard | superpowers:verification-before-completion |
10
+ | systematic-debugging | 系统化调试流程 | project-architect | superpowers:systematic-debugging |
11
+
12
+ ## 说明
13
+
14
+ - 以上为默认推荐,init 时根据项目扫描结果自动匹配
15
+ - 如果推荐的 skill 未安装,提示用户安装或跳过
16
+ - 内化时选择性提取,不要求完整复制
@@ -0,0 +1,9 @@
1
+ # Java 后端项目工具推荐
2
+
3
+ 在通用推荐基础上,额外推荐以下工具。
4
+
5
+ ## 推荐列表
6
+
7
+ | 工具 | 用途 | 绑定角色建议 | 来源 |
8
+ |------|------|-------------|------|
9
+ | test-driven-development | TDD 开发流程 | project-architect | superpowers:test-driven-development |
@@ -0,0 +1,9 @@
1
+ # Python 后端项目工具推荐
2
+
3
+ 在通用推荐基础上,额外推荐以下工具。
4
+
5
+ ## 推荐列表
6
+
7
+ | 工具 | 用途 | 绑定角色建议 | 来源 |
8
+ |------|------|-------------|------|
9
+ | test-driven-development | TDD 开发流程 | project-architect | superpowers:test-driven-development |
@@ -0,0 +1,18 @@
1
+ {
2
+ "$schema": "https://docs.anthropic.com/claude-code/settings-schema.json",
3
+ "_comment": "ys-team hooks 配置模板。将此内容合并到项目的 .claude/settings.json 中。",
4
+ "hooks": {
5
+ "PostToolUse": [
6
+ {
7
+ "matcher": "Write|Edit",
8
+ "command": "echo '[ys-team-hook] file_changed' >> .ys_team/status-events.log"
9
+ }
10
+ ],
11
+ "Stop": [
12
+ {
13
+ "matcher": "",
14
+ "command": "echo '[ys-team-hook] session_end' >> .ys_team/status-events.log"
15
+ }
16
+ ]
17
+ }
18
+ }
@@ -0,0 +1,284 @@
1
+ #!/usr/bin/env node
2
+
3
+ import fs from "node:fs";
4
+ import path from "node:path";
5
+ import os from "node:os";
6
+ import { fileURLToPath } from "node:url";
7
+
8
+ const __filename = fileURLToPath(import.meta.url);
9
+ const __dirname = path.dirname(__filename);
10
+ const packageRoot = path.resolve(__dirname, "..");
11
+ const bundledSkillsDir = path.join(packageRoot, "skills");
12
+ const baselineAgentsPath = path.join(packageRoot, "examples", "baseline", "AGENTS.md");
13
+ const baselineClaudePath = path.join(packageRoot, "examples", "baseline", "CLAUDE.md");
14
+
15
+ function defaultSkillsDir() {
16
+ return path.join(os.homedir(), ".agents", "skills");
17
+ }
18
+
19
+ function helpText() {
20
+ return [
21
+ "ys-team npm surface",
22
+ "",
23
+ "This package currently distributes repository assets and can install bundled ys-team skills.",
24
+ "",
25
+ "Commands:",
26
+ "- ys-team --help",
27
+ "- ys-team install-skills [--dest <dir>] [--force] [--dry-run]",
28
+ "- ys-team init-project [--dir <project-dir>] [--force] [--dry-run]",
29
+ "",
30
+ "Default global install destination:",
31
+ `- ${defaultSkillsDir()}`,
32
+ "",
33
+ "Default project-local install destination:",
34
+ "- <project>/.agents/skills",
35
+ "",
36
+ "Included:",
37
+ "- skills/",
38
+ "- examples/baseline/",
39
+ "- registry/",
40
+ "- docs/",
41
+ "- scripts/",
42
+ "",
43
+ "Visible workflow markers:",
44
+ "- route: `ys-team` · [decision] -> [next step]",
45
+ "- spec-talk: [主持人] ys-team · spec-talk",
46
+ "- spec-work: [执行中] ys-team · spec-work",
47
+ "- submit: [验收] ys-team · submit",
48
+ "- status: [状态] ys-team · status",
49
+ "",
50
+ "Current npm boundaries:",
51
+ "- installs bundled ys-team skills into ~/.agents/skills for global use",
52
+ "- can initialize project-local .agents/skills plus baseline AGENTS.md / CLAUDE.md",
53
+ "- does not automatically execute ys-team-init",
54
+ "- is ready to publish, but actual npm registry publish still needs npm account credentials",
55
+ "",
56
+ "Recommended next step after install:",
57
+ "1. For global mode: run ys-team-init in the target repository.",
58
+ "2. For project mode: open the target repository and continue with ys-team-init there."
59
+ ].join("\n");
60
+ }
61
+
62
+ function parseArgs(argv) {
63
+ const args = {
64
+ command: null,
65
+ dest: defaultSkillsDir(),
66
+ dir: process.cwd(),
67
+ force: false,
68
+ dryRun: false,
69
+ help: false
70
+ };
71
+
72
+ const rest = argv.slice(2);
73
+ if (rest.length === 0) {
74
+ args.help = true;
75
+ return args;
76
+ }
77
+
78
+ for (let i = 0; i < rest.length; i += 1) {
79
+ const value = rest[i];
80
+ if (value === "--help" || value === "-h") {
81
+ args.help = true;
82
+ continue;
83
+ }
84
+ if (!args.command && !value.startsWith("--")) {
85
+ args.command = value;
86
+ continue;
87
+ }
88
+ if (value === "--dest") {
89
+ const next = rest[i + 1];
90
+ if (!next) {
91
+ throw new Error("Missing value for --dest");
92
+ }
93
+ args.dest = path.resolve(next);
94
+ i += 1;
95
+ continue;
96
+ }
97
+ if (value === "--dir") {
98
+ const next = rest[i + 1];
99
+ if (!next) {
100
+ throw new Error("Missing value for --dir");
101
+ }
102
+ args.dir = path.resolve(next);
103
+ i += 1;
104
+ continue;
105
+ }
106
+ if (value === "--force") {
107
+ args.force = true;
108
+ continue;
109
+ }
110
+ if (value === "--dry-run") {
111
+ args.dryRun = true;
112
+ continue;
113
+ }
114
+ throw new Error(`Unsupported argument: ${value}`);
115
+ }
116
+
117
+ return args;
118
+ }
119
+
120
+ function ensureBundledSkills() {
121
+ if (!fs.existsSync(bundledSkillsDir)) {
122
+ throw new Error(`Bundled skills directory not found: ${bundledSkillsDir}`);
123
+ }
124
+ if (!fs.existsSync(baselineAgentsPath) || !fs.existsSync(baselineClaudePath)) {
125
+ throw new Error("Baseline AGENTS.md / CLAUDE.md templates not found");
126
+ }
127
+ }
128
+
129
+ function listBundledSkills() {
130
+ ensureBundledSkills();
131
+ return fs.readdirSync(bundledSkillsDir, { withFileTypes: true })
132
+ .filter((entry) => entry.isDirectory())
133
+ .map((entry) => entry.name)
134
+ .sort();
135
+ }
136
+
137
+ function copyDirectoryRecursive(sourceDir, targetDir) {
138
+ fs.mkdirSync(targetDir, { recursive: true });
139
+ for (const entry of fs.readdirSync(sourceDir, { withFileTypes: true })) {
140
+ const sourcePath = path.join(sourceDir, entry.name);
141
+ const targetPath = path.join(targetDir, entry.name);
142
+ if (entry.isDirectory()) {
143
+ copyDirectoryRecursive(sourcePath, targetPath);
144
+ } else {
145
+ fs.copyFileSync(sourcePath, targetPath);
146
+ }
147
+ }
148
+ }
149
+
150
+ function copyFileWithPolicy(sourcePath, targetPath, { force, dryRun }) {
151
+ const exists = fs.existsSync(targetPath);
152
+ if (exists && !force) {
153
+ return { action: "skipped", targetPath };
154
+ }
155
+
156
+ if (!dryRun) {
157
+ fs.mkdirSync(path.dirname(targetPath), { recursive: true });
158
+ fs.copyFileSync(sourcePath, targetPath);
159
+ }
160
+
161
+ return { action: exists ? "replaced" : "created", targetPath };
162
+ }
163
+
164
+ function installSkills({ dest, force, dryRun }) {
165
+ const skills = listBundledSkills();
166
+ const operations = [];
167
+ const skipped = [];
168
+
169
+ for (const skill of skills) {
170
+ const sourcePath = path.join(bundledSkillsDir, skill);
171
+ const targetPath = path.join(dest, skill);
172
+ const exists = fs.existsSync(targetPath);
173
+
174
+ if (exists && !force) {
175
+ skipped.push(skill);
176
+ continue;
177
+ }
178
+
179
+ operations.push({ skill, sourcePath, targetPath, replace: exists });
180
+ }
181
+
182
+ if (!dryRun) {
183
+ fs.mkdirSync(dest, { recursive: true });
184
+ for (const op of operations) {
185
+ if (op.replace) {
186
+ fs.rmSync(op.targetPath, { recursive: true, force: true });
187
+ }
188
+ copyDirectoryRecursive(op.sourcePath, op.targetPath);
189
+ }
190
+ }
191
+
192
+ const lines = [
193
+ dryRun ? "ys-team install-skills dry-run" : "ys-team install-skills",
194
+ "",
195
+ `destination: ${dest}`,
196
+ `bundled skills: ${skills.length}`,
197
+ `scheduled installs: ${operations.length}`,
198
+ `skipped existing: ${skipped.length}`
199
+ ];
200
+
201
+ if (operations.length > 0) {
202
+ lines.push("", "planned:");
203
+ for (const op of operations) {
204
+ lines.push(`- ${op.skill}${op.replace ? " (replace)" : ""}`);
205
+ }
206
+ }
207
+
208
+ if (skipped.length > 0) {
209
+ lines.push("", "skipped:");
210
+ for (const skill of skipped) {
211
+ lines.push(`- ${skill}`);
212
+ }
213
+ lines.push("", "Use --force to replace existing installed skills.");
214
+ }
215
+
216
+ if (!dryRun && operations.length > 0) {
217
+ lines.push("", "next:");
218
+ lines.push("- run ys-team-init in the target repository");
219
+ lines.push("- update AGENTS.md and CLAUDE.md so ys-team is the highest-priority workflow");
220
+ }
221
+
222
+ return lines.join("\n");
223
+ }
224
+
225
+ function initProject({ dir, force, dryRun }) {
226
+ const skillsDest = path.join(dir, ".agents", "skills");
227
+ const agentsDest = path.join(dir, "AGENTS.md");
228
+ const claudeDest = path.join(dir, "CLAUDE.md");
229
+
230
+ const installSummary = installSkills({
231
+ dest: skillsDest,
232
+ force,
233
+ dryRun
234
+ });
235
+
236
+ const agentsResult = copyFileWithPolicy(baselineAgentsPath, agentsDest, { force, dryRun });
237
+ const claudeResult = copyFileWithPolicy(baselineClaudePath, claudeDest, { force, dryRun });
238
+
239
+ return [
240
+ dryRun ? "ys-team init-project dry-run" : "ys-team init-project",
241
+ "",
242
+ `project: ${dir}`,
243
+ `local skills: ${skillsDest}`,
244
+ `AGENTS.md: ${agentsResult.action}`,
245
+ `CLAUDE.md: ${claudeResult.action}`,
246
+ "",
247
+ installSummary,
248
+ "",
249
+ "next:",
250
+ "- open the target repository",
251
+ "- run ys-team-init in that repository",
252
+ "- verify AGENTS.md and CLAUDE.md match your project-local needs"
253
+ ].join("\n");
254
+ }
255
+
256
+ function main() {
257
+ try {
258
+ const args = parseArgs(process.argv);
259
+
260
+ if (args.help || !args.command) {
261
+ console.log(helpText());
262
+ process.exit(0);
263
+ }
264
+
265
+ if (args.command === "install-skills") {
266
+ console.log(installSkills(args));
267
+ process.exit(0);
268
+ }
269
+
270
+ if (args.command === "init-project") {
271
+ console.log(initProject(args));
272
+ process.exit(0);
273
+ }
274
+
275
+ console.error(`Unsupported command: ${args.command}`);
276
+ console.error("Run `ys-team --help`.");
277
+ process.exit(1);
278
+ } catch (error) {
279
+ console.error(`ys-team error: ${error.message}`);
280
+ process.exit(1);
281
+ }
282
+ }
283
+
284
+ main();
@@ -0,0 +1,112 @@
1
+ ---
2
+ name: ys-team
3
+ description: "Entry skill for the ys-team method. Use it to explain the method, keep decisions anchored in repository reality, and route users toward project init or local rebuild when needed."
4
+ ---
5
+
6
+ # ys-team
7
+
8
+ `ys-team` 是一种以共享现实索引为对齐基础、以多角色讨论为收敛机制、以 Spec 为执行与验收统一依据的 AI 团队治理方法。
9
+
10
+ ## The Zen of ys-team
11
+
12
+ - 现实先于生成。
13
+ - 规格先于执行。
14
+ - 讨论归于收敛。
15
+ - 证据胜于感觉。
16
+
17
+ ## Purpose
18
+
19
+ Use `ys-team` as the public entry skill for this method.
20
+
21
+ Its job is to keep the conversation anchored in:
22
+
23
+ - repository reality
24
+ - role-based convergence
25
+ - spec-first execution
26
+ - evidence-based acceptance
27
+
28
+ ## Public Model
29
+
30
+ 对外只保留很少的用户心智:
31
+
32
+ 1. 先把 ys-team skills 装好
33
+ 2. 在项目里执行一次 `ys-team-init`
34
+ 3. 项目形态明显变化后,再执行 `ys-team-rebuild`
35
+
36
+ 不要把内部实现细节包装成用户必须理解的流程图。
37
+
38
+ 默认工作流由 `examples/baseline/` 承载。
39
+
40
+ ## Core Invariants
41
+
42
+ - 项目必须维护共享现实索引,并随真实变化同步更新。
43
+ - 非 trivial 工作先形成 Spec,再按 Spec 执行和验收。
44
+ - 讨论的目标是收敛,而不是无边界扩展。
45
+ - 交付必须留下可复核证据。
46
+
47
+ ## Routing Guidance
48
+
49
+ - 如果用户想先理解方法论,直接解释 `ys-team`,不要急着让用户执行初始化。
50
+ - 如果仓库还没有 `.ys_team/`,引导到 `ys-team-init`。
51
+ - 如果仓库已有 `.ys_team/`,但团队、模板或约束已经不符合项目现实,引导到 `ys-team-rebuild`。
52
+ - 如果用户想先看默认工作流长什么样,引导到 `examples/baseline/`。
53
+ - 如果当前只是澄清理念、边界或推广方式,不强行写 spec。
54
+
55
+ ## Trigger Default
56
+
57
+ 当仓库存在 `.ys_team/` 时,默认行为是触发 ys-team 工作流。
58
+
59
+ - **默认**:任何代码改动请求都先经过 ys-team 路由判断,确认是否需要 spec
60
+ - **豁免**:仅当满足以下**全部**条件时可直接执行:
61
+ - 单文件改动
62
+ - 无跨模块影响
63
+ - 无回滚风险
64
+ - 用户明确声明是 trivial(如"修拼写错误"、"改注释")
65
+ - **原则**:举证责任在"跳过路由",而不在"触发路由"。不确定时,触发。
66
+
67
+ ## 排他工作流
68
+
69
+ ys-team 启用后,工作流具有排他性:
70
+
71
+ - **禁止自动触发** `.ys_team/toolbox/` 以外的任何 skill
72
+ - 已内化的工具清单见 `.ys_team/toolbox/_sources.md`
73
+ - 仅内化后的版本在工作流中可用
74
+ - 用户显式调用未内化 skill 时(如 `/skill-name`),记录该使用行为到 `.ys_team/toolbox/_candidates.md`,作为下次 rebuild 的内化候选
75
+ - 用户在 CLAUDE.md 中显式声明的全局 skill 不受此规则限制
76
+
77
+ ## Toolbox 感知
78
+
79
+ 路由判断时,如果 `.ys_team/toolbox/` 存在且非空:
80
+
81
+ 1. 读取 `_sources.md` 了解团队已内化的工具
82
+ 2. 在路由决策中考虑已内化工具的能力(如团队有 TDD 能力,执行时建议使用)
83
+ 3. 角色绑定的工具(`team.md` 中的 tools 字段)在对应环节自动建议使用
84
+
85
+ ## Style
86
+
87
+ - 少解释内部结构,多解释稳定原则。
88
+ - 少输出流程感,多输出边界、结果和下一步。
89
+ - 允许项目本地化,不强迫所有仓库长成同一种样子。
90
+
91
+ ## Response Markers
92
+
93
+ 每次经过 ys-team 路由的响应,必须以可见标记结尾,让用户能确认工作流是否运行。
94
+
95
+ **路由判断类响应**(如决定委托给 spec-talk、回答方法论问题、运行 status)使用紧凑 footer:
96
+
97
+ ```
98
+ ---
99
+ `ys-team` · [判断结果] → [下一步]
100
+ ```
101
+
102
+ 示例:`` `ys-team` · 已路由至 spec-talk → 请确认是否开始讨论 ``
103
+
104
+ **spec-talk / 讨论类响应**使用 `[主持人]` 块(由 ys-team-spec-talk 定义)。不在此重复输出。
105
+
106
+ **其他环节**也必须保留可见标志:
107
+
108
+ - `spec-work`:`**[执行中]** ys-team · spec-work`
109
+ - `submit`:`**[验收]** ys-team · submit`
110
+ - `status`:`**[状态]** ys-team · status`
111
+
112
+ 如果当前响应末尾没有任何 `ys-team` 标记,应视为尚未进入 ys-team 工作流,并立刻回到路由判断。