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,159 @@
1
+ ---
2
+ name: ys-team-doc-build
3
+ description: "Build or rebuild the reality index for a ys-team project. Generates module-level index with relationship graph and business summaries. Called automatically by ys-team-init and ys-team-rebuild, or invoked manually."
4
+ ---
5
+
6
+ # ys-team-doc-build
7
+
8
+ Use this skill to generate or rebuild the project's reality index.
9
+
10
+ ## Purpose
11
+
12
+ The reality index (`docs/project/module-index.md`) gives AI team roles a shared understanding of the project's module structure and dependencies — so that during spec discussion, roles can reason about impact scope without re-exploring the codebase from scratch each time.
13
+
14
+ This is not javadoc. It is not for humans to read. It is a collaboration substrate for AI roles.
15
+
16
+ ## Core Principles
17
+
18
+ - **Relationship-first**: Record cross-file relationships (inter-module dependencies, data access, messaging, external APIs). These are expensive to re-derive dynamically.
19
+ - **Summary-aided**: Each module gets 2–3 sentences on business responsibility. This lets roles assess impact scope during control phase without reading source files.
20
+ - **Scale-adaptive**: Index granularity adjusts to project size.
21
+ - **Language-agnostic**: Detect project type from build files; adapt index structure to match.
22
+
23
+ ## Scale Strategy
24
+
25
+ | Project Scale | Index Strategy |
26
+ |--------------|----------------|
27
+ | Small (<500 files) | Detailed module index + key class descriptions |
28
+ | Medium (500–2000 files) | Module index + entry point lists |
29
+ | Large (>2000 files) | Core modules only + layered entry point lists |
30
+
31
+ ## Execution Steps
32
+
33
+ ### Phase 1: Project Analysis
34
+
35
+ 1. **Detect language and build tool**:
36
+ - `pom.xml` → Java Maven
37
+ - `build.gradle` → Java Gradle
38
+ - `pyproject.toml` or `setup.py` → Python
39
+ - `package.json` → Node.js / TypeScript
40
+ - Other → Generic
41
+
42
+ 2. **Estimate scale**: Count source files (exclude build output dirs: `target/`, `dist/`, `node_modules/`, `venv/`, `.git/`)
43
+
44
+ 3. **Select strategy** based on file count
45
+
46
+ ### Phase 2: Module Discovery
47
+
48
+ Identify module boundaries using language-specific signals:
49
+
50
+ - **Java Maven**: Parse `<modules>` in root `pom.xml`; top-level application classes (`@SpringBootApplication`); DDD layer packages (`application/`, `domain/`, `service/`)
51
+ - **Java Gradle**: Parse `include` in `settings.gradle`
52
+ - **Python**: Top-level packages under `src/` or project root
53
+ - **Node.js/TS**: Directories with `index.ts` or dedicated `package.json`
54
+ - **Generic**: Top-level directories with source files
55
+
56
+ ### Phase 3: Relationship Extraction
57
+
58
+ For each module, use Grep to extract:
59
+
60
+ - Entry points (service classes, application classes, API controllers)
61
+ - Domain/business services
62
+ - Data access layer (mappers, repositories, DAOs)
63
+ - Outbound messaging (MQ producers, event publishers)
64
+ - Inbound messaging (MQ listeners, event consumers)
65
+ - Scheduled jobs
66
+ - External service dependencies (API clients, SDK calls)
67
+ - Which other modules depend on this module (reverse dependency)
68
+ - Configuration key prefixes (Apollo, env vars, application.properties)
69
+
70
+ ### Phase 4: Summary Generation
71
+
72
+ Read the primary entry class for each module. Generate 2–3 sentences describing:
73
+ - What business problem this module solves
74
+ - Its primary responsibilities
75
+ - Any notable design pattern (strategy, adapter, etc.) if central to understanding
76
+
77
+ Keep summaries factual and stable — avoid implementation details that change frequently.
78
+
79
+ ### Phase 5: Index Generation
80
+
81
+ Write `docs/project/module-index.md` using the format below.
82
+
83
+ For medium and large projects, also generate `docs/project/entry-points/generate.sh` — a shell script that, when run, produces fresh lists of key entry points (services, mappers, listeners, jobs).
84
+
85
+ ## Output Format
86
+
87
+ ```markdown
88
+ # Module Index
89
+
90
+ **Project Type**: [detected type]
91
+ **Project Scale**: [Small/Medium/Large] (~N files)
92
+ **Index Strategy**: [strategy description]
93
+ **Last Updated**: [YYYY-MM-DD]
94
+
95
+ ## [Module Name]([Chinese label if applicable])
96
+ **职责**:[2–3 sentence business summary]
97
+
98
+ **关系**:
99
+ - 入口:[entry class(es)]
100
+ - 领域服务:[domain service classes] (if applicable)
101
+ - [Framework] 服务:[service impl classes] (if applicable)
102
+ - 数据访问:[mapper/repository classes]
103
+ - 外部依赖:[external API/SDK names]
104
+ - 被依赖:[modules that depend on this one, with brief reason]
105
+ - 消息:[listener/producer classes and topic] (omit if none)
106
+ - 定时任务:[job class names] (omit if none)
107
+ - 配置前缀:[config key prefix] (omit if unknown)
108
+ ```
109
+
110
+ Omit fields that do not apply. Do not fabricate entries.
111
+
112
+ ## Entry Point Script (Medium/Large projects)
113
+
114
+ Generate `docs/project/entry-points/generate.sh`:
115
+
116
+ ```bash
117
+ #!/bin/bash
118
+ # Regenerate key entry point lists for this project
119
+ # Run from project root
120
+
121
+ OUTDIR="docs/project/entry-points"
122
+ mkdir -p "$OUTDIR"
123
+
124
+ # Example for Java Maven + Dubbo + MyBatis + RocketMQ:
125
+ grep -r "@DubboService" --include="*.java" -l | sort > "$OUTDIR/dubbo-services.txt"
126
+ ls src/main/resources/mapper/*.xml 2>/dev/null | sed 's|.*/||;s|Mapper.xml||' | sort > "$OUTDIR/mappers.txt"
127
+ grep -r "@RocketMQMessageListener\|implements.*Listener" --include="*.java" -l | sort > "$OUTDIR/listeners.txt"
128
+ grep -r "@Scheduled\|@Job\|@ElasticJob" --include="*.java" -l | sort > "$OUTDIR/jobs.txt"
129
+
130
+ echo "Entry points updated in $OUTDIR/"
131
+ ```
132
+
133
+ Adapt the script to the actual project's framework and conventions. Make it executable.
134
+
135
+ ## Validation
136
+
137
+ Before finalizing:
138
+
139
+ - Every module listed has a non-empty **职责** summary
140
+ - Every dependency relationship is bidirectional (if A depends on B, B lists A under 被依赖)
141
+ - No invented entries — only what Grep or Read confirmed
142
+
143
+ ## Token Cost Check
144
+
145
+ If generation would exceed ~80k tokens (e.g., large project with many modules), warn the user and suggest reducing scope to core modules only.
146
+
147
+ ## Trigger Conditions
148
+
149
+ - Automatically called by `ys-team-init` after baseline generation
150
+ - Automatically called by `ys-team-rebuild` after baseline update
151
+ - Manually invoked when project module structure has materially changed
152
+
153
+ ## After Generation
154
+
155
+ Inform the user:
156
+ - Location of the generated index
157
+ - Number of modules indexed
158
+ - Whether an entry point script was generated
159
+ - Suggested next step (e.g., run `ys-team-rebuild` if project has evolved, or begin spec work)
@@ -0,0 +1,161 @@
1
+ ---
2
+ name: ys-team-init
3
+ description: "Initialize a repository-local ys-team baseline once. Generate the smallest useful .ys_team setup from project reality without forcing a heavy process."
4
+ ---
5
+
6
+ # ys-team-init
7
+
8
+ Use this skill when a repository wants to start using `ys-team` and does not yet have a project-local `.ys_team/`.
9
+
10
+ ## Purpose
11
+
12
+ Create the first project-local ys-team baseline with the lightest useful footprint.
13
+
14
+ `ys-team-init` is not a project modeling ceremony.
15
+ It is a one-time repository specialization step.
16
+
17
+ Its default workflow source is `examples/baseline/`.
18
+
19
+ ## 语言检测
20
+
21
+ Init 的第一步是确认用户主语言,所有角色名、角色卡、team.md、selection rules 将使用该语言。
22
+
23
+ 检测逻辑:
24
+ 1. 检查用户 CLAUDE.md 中是否有语言偏好声明
25
+ 2. 检查系统 locale 环境
26
+ 3. 如无法判断,直接询问用户:"团队角色使用什么语言命名?(如:中文/English)"
27
+
28
+ 确认后:
29
+ - baseline 中的角色模板按用户语言生成
30
+ - `team.md` 的选择规则使用用户语言
31
+ - 角色卡文件名使用用户语言
32
+
33
+ ## Core Rules
34
+
35
+ - Read repository reality before generating anything.
36
+ - Start from `examples/baseline/` as the default workflow source.
37
+ - Prefer the smallest useful local baseline.
38
+ - Do not require the user to understand internal ys-team structure first.
39
+ - Do not block init only because some docs are missing; generate a minimal skeleton when needed.
40
+ - Keep the result repository-local.
41
+
42
+ ## Minimum Outputs
43
+
44
+ Generate or adapt:
45
+
46
+ - `.ys_team/README.md`
47
+ - `.ys_team/team.md`
48
+ - `.ys_team/methods.md`
49
+ - `.ys_team/policy.md`
50
+ - `.ys_team/templates/`
51
+ - `docs/specs/`
52
+ - `docs/roadmap/`
53
+
54
+ When the repository lacks a current-state project doc, create a minimal `docs/project/overview.md` skeleton.
55
+
56
+ If the repository does not have an `AGENTS.md`, generate one from `examples/baseline/AGENTS.md`, adapted to the project's name and stack.
57
+
58
+ ## Language Sensitivity
59
+
60
+ The method is language-agnostic, but local wording should match project reality.
61
+
62
+ Examples:
63
+
64
+ - Python services should reflect their actual package manager, test command, and runtime boundaries.
65
+ - Java services should reflect their build tool, multi-module structure, compatibility concerns, release order, migration surface, and async contracts.
66
+
67
+ ## Success Criteria
68
+
69
+ The repository can start using ys-team immediately after init, without first rewriting the whole project.
70
+
71
+ That means:
72
+
73
+ - discussion can converge into spec
74
+ - spec can guide execution
75
+ - execution can be accepted with evidence
76
+
77
+ ## 工具内化(Toolbox Internalization)
78
+
79
+ 基础 init 完成后,自动执行工具内化流程:
80
+
81
+ ### 步骤
82
+
83
+ 1. **创建 toolbox 目录**:从 `examples/baseline/.ys_team/toolbox/` 复制模板(`_sources.md`、`_candidates.md`)
84
+
85
+ 2. **扫描项目类型**:根据仓库中的文件特征判断项目类型:
86
+ - `requirements.txt` / `pyproject.toml` / `setup.py` → python-backend
87
+ - `pom.xml` / `build.gradle` → java-backend
88
+ - `package.json` + React 依赖 → frontend-react
89
+ - 前后端都有 → fullstack
90
+ - 无法判断 → general
91
+
92
+ 3. **匹配 registry 推荐**:读取 `registry/{项目类型}.md` + `registry/general.md`,合并推荐列表
93
+
94
+ 4. **检索与安装**:
95
+ - 对推荐列表中的每个工具,检查是否已安装
96
+ - 已安装的:直接进入内化流程
97
+ - 未安装但有明确来源的:静默安装后内化
98
+ - 如果用户安装了 `find-skills` 等检索工具,额外根据项目特征搜索适合的 skill,和用户确认后安装
99
+
100
+ 5. **选择性内化**:对每个选中的工具:
101
+ - 阅读原 skill 内容
102
+ - 提取对团队有用的部分(不是完整复制)
103
+ - 改写成符合 ys-team 方法论的格式
104
+ - 保留源链接(skill 名、版本、URL)
105
+ - 写入 `.ys_team/toolbox/{能力名}.md`
106
+
107
+ 6. **角色绑定**:根据推荐的绑定角色建议,更新 `team.md` 中对应角色的 `tools` 字段
108
+
109
+ 7. **更新源索引**:将所有内化工具记录到 `.ys_team/toolbox/_sources.md`
110
+
111
+ ### 内化文件格式
112
+
113
+ ```markdown
114
+ # [能力名称]
115
+
116
+ source: [原 skill 全名]
117
+ source_url: [GitHub 或 marketplace 地址]
118
+ version: [内化时的版本]
119
+ internalized: [日期]
120
+
121
+ ## 团队用法
122
+
123
+ [改写后的、融入团队方法论的能力描述]
124
+
125
+ ## 绑定角色
126
+
127
+ - [角色名]([使用场景])
128
+
129
+ ## 重新内化触发条件
130
+
131
+ [什么情况下应该回到原 skill 重新学习]
132
+ ```
133
+
134
+ ### 完成提示
135
+
136
+ ```
137
+ 团队基础配置已完成,已内化 N 个工具。
138
+ 如需调整工具配置,可运行 /ys-team-rebuild。
139
+ ```
140
+
141
+ ## Status 初始化
142
+
143
+ Init 时从 `examples/baseline/.ys_team/status.md` 复制空模板到项目的 `.ys_team/status.md`。
144
+
145
+ 提示用户可选配置 hooks 以增强状态追踪:
146
+
147
+ ```
148
+ 团队状态追踪已初始化(.ys_team/status.md)。
149
+ 各工作流环节会在关键节点自动更新状态。
150
+
151
+ 如需更细粒度的事件采集(文件变更、session 等),可参考 scripts/hooks-template.json 配置 Claude Code hooks。
152
+ ```
153
+
154
+ ## After Init
155
+
156
+ - Use the generated local `.ys_team/` as the project's baseline.
157
+ - Treat `examples/baseline/` as the default workflow source, not as a rigid project copy.
158
+ - Do not rerun init for normal project work.
159
+ - Use `ys-team-rebuild` only when project reality has materially changed.
160
+
161
+ After `.ys_team/` is generated, automatically invoke `ys-team-doc-build` to create the initial reality index (`docs/project/module-index.md`). This is required — the shared reality index is part of the minimum useful baseline.
@@ -0,0 +1,89 @@
1
+ ---
2
+ name: ys-team-rebuild
3
+ description: "Reassess an existing project-local ys-team baseline and minimally update it when the project, stack, or collaboration shape has materially changed."
4
+ ---
5
+
6
+ # ys-team-rebuild
7
+
8
+ Use this skill when a repository already has `.ys_team/`, but the current local method no longer matches repository reality.
9
+
10
+ ## Purpose
11
+
12
+ Refresh the local ys-team baseline without reintroducing heavy process or unnecessary churn.
13
+
14
+ ## Rebuild Triggers
15
+
16
+ - stack changed
17
+ - project gained or lost major modules
18
+ - existing local roles no longer fit delivery reality
19
+ - current templates no longer match acceptance or rollback needs
20
+ - documentation authority is no longer aligned with the codebase
21
+
22
+ ## Rules
23
+
24
+ - Change the smallest surface that fixes the mismatch.
25
+ - Preserve stable local wording and role boundaries when they still fit.
26
+ - Keep the local method weak-guidance, strong-result.
27
+ - Update local templates only when repository reality really changed.
28
+
29
+ ## Version Check
30
+
31
+ Before rebuilding, check version alignment:
32
+
33
+ 1. Read project `.ys_team/VERSION` (if exists)
34
+ 2. Compare with `examples/baseline/.ys_team/VERSION` from the installed ys-team skill
35
+ 3. If versions differ, inform user: "ys-team baseline 有更新(当前 X.Y.Z → 最新 A.B.C)。是否同步?"
36
+ 4. On user confirmation: merge baseline updates into project `.ys_team/`, preserving project-local customizations
37
+ 5. Update project `.ys_team/VERSION` to match baseline
38
+
39
+ ## 工具重新内化
40
+
41
+ Rebuild 时除了更新基础配置,还需评估和更新工具内化:
42
+
43
+ ### 步骤
44
+
45
+ 1. **检查候选列表**:读取 `.ys_team/toolbox/_candidates.md`,这些是用户在工作流中显式使用过的未内化 skill,作为内化评估输入
46
+
47
+ 2. **检查深化标记**:遍历 `.ys_team/toolbox/*.md`(排除 `_sources.md` 和 `_candidates.md`),检查是否有"需要深化"标记
48
+
49
+ 3. **重新匹配推荐**:如果项目类型发生变化,重新匹配 `registry/` 推荐
50
+
51
+ 4. **处理候选**:
52
+ - 对每个候选工具,评估是否值得内化
53
+ - 和用户确认后,执行内化流程(同 init 的内化步骤)
54
+ - 处理完毕后清空 `_candidates.md`
55
+
56
+ 5. **深化已有工具**:
57
+ - 对标记"需要深化"的工具,回到原 skill 源(通过 `_sources.md` 中的链接)
58
+ - 重新阅读原 skill 最新内容
59
+ - 提取更深入的部分,更新内化文件
60
+ - 清除深化标记
61
+
62
+ 6. **更新角色绑定**:如果新增或移除了工具,同步更新 `team.md` 中的 tools 字段
63
+
64
+ 7. **更新源索引**:同步 `_sources.md`
65
+
66
+ ### 自我学习
67
+
68
+ 当团队成员在某个环节发现内化程度不够时,可以在对应的内化文件末尾追加:
69
+
70
+ ```markdown
71
+ ## 需要深化
72
+
73
+ [具体哪方面不够,需要从原 skill 补充什么]
74
+ ```
75
+
76
+ 下次 rebuild 时会自动处理。
77
+
78
+ ## Doc-Build Integration
79
+
80
+ After baseline update is complete, automatically invoke `ys-team-doc-build` to rebuild the reality index. This ensures `docs/project/module-index.md` reflects current project structure after any rebuild.
81
+
82
+ ## Output
83
+
84
+ Summarize:
85
+
86
+ - what changed
87
+ - why it changed
88
+ - whether existing specs need follow-up
89
+ - 工具变化(新增内化、深化、移除)
@@ -0,0 +1,163 @@
1
+ ---
2
+ name: ys-team-spec-talk
3
+ description: Discuss a non-trivial change using the repository's local .ys_team setup, load only the selected local role files, escalate to additional roles when needed, and output specs or roadmaps only when the current objective actually requires them.
4
+ ---
5
+
6
+ # ys-team-spec-talk
7
+
8
+ Use this skill to discuss a non-trivial change using project-local team guidance.
9
+
10
+ ## Read Order
11
+
12
+ 1. `.ys_team/README.md`
13
+ 2. `.ys_team/team.md`
14
+ 3. `.ys_team/methods.md` if present
15
+ 4. `.ys_team/policy.md`
16
+ 5. repository project/docs context
17
+ 6. relevant active or queued specs or roadmaps if the task extends existing work
18
+
19
+ ## Loading Discipline
20
+
21
+ - Start by reading only the short header block of candidate role files.
22
+ - Load full role files only for roles that actually participate.
23
+ - Do not retain or write full discussion transcripts.
24
+
25
+ ## Intent First
26
+
27
+ Do not assume every discussion should immediately draft a spec.
28
+
29
+ Before selecting the exact path, infer from the conversation:
30
+
31
+ - what object is being discussed now
32
+ - what the current objective is
33
+ - whether the current blocker is clarity, execution readiness, missing evidence, missing expertise, or something else
34
+
35
+ If that is materially unclear, ask a concise clarification before continuing.
36
+
37
+ ## Output Routing
38
+
39
+ - initiative-level executable acceptance work -> `docs/specs/`
40
+ - stage or directional planning -> `docs/roadmap/`
41
+ - discussion-only clarification -> no required repo artifact unless the user asked for one
42
+
43
+ ## Standard Flow
44
+
45
+ 1. Select the default discussion team from `.ys_team/team.md` unless the local method says otherwise.
46
+ 2. Run one internal discussion round using the selected roles.
47
+ 3. Identify risks, disagreements, capability gaps, and whether the current objective requires a spec, a roadmap, a revision to an existing artifact, or no file output.
48
+ 4. After each round, check whether the discussion is still converging (see `.ys_team/methods.md` Discussion Cost Awareness). If warning signs appear, prefer to stop and emit a result card rather than silently entering another round.
49
+ 5. If a gap exists and an external role may be needed, stop and produce an external support request instead of introducing that role immediately.
50
+ 6. Ask the user before introducing an external role.
51
+ 7. Only after approval, load the external role and continue the next round.
52
+ 8. Assign one participating role with `discussion.report` responsibility to write the final summary.
53
+ 9. If the current objective requires repository output, write it using `.ys_team/templates/control.md` and `.ys_team/templates/work.md` for specs, or `.ys_team/templates/roadmap-version.md` for roadmaps.
54
+
55
+ ## Required Discussion Result
56
+
57
+ Every substantial discussion round must end with a result card for the user. Light discussion should still return a compact result card and role brief.
58
+
59
+ Required fields:
60
+
61
+ - `Current Mode`
62
+ - `Decision`: `PASS`, `BLOCKED`, or `REJECT`
63
+ - `Current State`
64
+ - `Why`
65
+ - `Needed Changes`
66
+ - `Next Step`
67
+
68
+ Optional fields when needed:
69
+
70
+ - `Need Your Input`
71
+ - `External Support Request`
72
+
73
+ Also include a short `Role Brief` section that summarizes each participating role's current conclusion in one or two lines. User-facing role names should prefer repository-local Chinese titles when available; otherwise use a readable fallback such as `中文标题(role-id)` or `role-id`.
74
+
75
+ Do not end with a vague recap.
76
+
77
+ ## Required Additions For Written Specs Or Roadmaps
78
+
79
+ Every generated or updated spec should include:
80
+
81
+ - `Collaboration Summary`
82
+ - `Discussion Digest`
83
+
84
+ Every generated or updated roadmap should include role participation and final conclusion summary consistent with the roadmap template.
85
+
86
+ These sections should summarize:
87
+
88
+ - which roles participated
89
+ - the user-facing role titles when available
90
+ - how many rounds were used
91
+ - what escalations happened
92
+ - estimated discussion cost
93
+ - whether `ys-team-submit` is recommended for delivery review
94
+ - each role's final contribution, not a transcript
95
+
96
+ ## 进化感知(角色缺口)
97
+
98
+ 讨论过程中,主动检测是否存在角色缺口:
99
+
100
+ **触发条件**(满足任一即触发):
101
+ - 讨论涉及某专业领域(安全、数据库迁移、无障碍等),但 `team.md` 中没有对应角色
102
+ - result card 中出现 `External Support Request`,且原因是缺少专业角色
103
+ - 讨论收敛为 BLOCKED,且阻塞原因涉及"缺少 XX 领域的评审/判断"
104
+
105
+ **触发后动作**:
106
+ 1. 写入 `.ys_team/evolution/requests.md` 的"待处理"区:
107
+ ```
108
+ ### [EVO-YYYY-MM-DD-N] [日期] [类型: 角色]
109
+
110
+ - 来源环节:spec-talk
111
+ - 关联 Spec:[当前讨论的 spec]
112
+ - 缺口描述:[具体缺什么角色/能力]
113
+ - 发现角色:[哪个角色发现的]
114
+ - 建议方案:[建议引入什么角色]
115
+ - 讨论状态:待讨论
116
+ ```
117
+ 2. 在当前响应中提示用户:
118
+ ```
119
+ 发现团队能力缺口:[描述]。已记录进化申请(EVO-YYYY-MM-DD-N)。
120
+ 建议发起一轮进化评估讨论,由团队评估是否引入新角色。
121
+ ```
122
+ 3. 如果用户同意,立即发起进化评估讨论(由现有角色参与,讨论是否引入新角色)
123
+ 4. 讨论收敛后:PASS → 创建角色卡并加入 team.md / REJECT → 记录原因关闭申请
124
+
125
+ ## Status 写入
126
+
127
+ 讨论收敛后(产出 result card 时),必须同步更新 `.ys_team/status.md`:
128
+
129
+ 1. 读取当前 `.ys_team/status.md`
130
+ 2. 更新以下内容:
131
+ - `updated` 时间戳
132
+ - `活跃 Spec` 表:新增或更新当前讨论的 spec 条目(阶段 = spec-talk,状态 = 讨论中/已收敛)
133
+ - `最新判断` 表:追加本轮 result card 的决定(PASS/BLOCKED/REJECT),保留最近 10 条
134
+ - `阻塞项`:如果决定为 BLOCKED,追加阻塞原因;如果之前阻塞已解除,移除
135
+ - `待办`:根据 Next Step 更新
136
+ 3. 写入完成后再输出 Host Summary
137
+
138
+ 此写入是 spec-talk 的固定环节,不可跳过。
139
+
140
+ ## Host Summary
141
+
142
+ After writing or updating the target document (or concluding a discussion-only round), close the response with a **[主持人]** summary block. This block is mandatory — it is the visible signal that ys-team workflow ran.
143
+
144
+ Format:
145
+
146
+ ```
147
+ ---
148
+ **[主持人]** ys-team · spec-talk
149
+
150
+ [1–2 sentences describing what was decided or produced.]
151
+
152
+ - 参与角色:[localized role titles, comma-separated]
153
+ - 决策:PASS / BLOCKED / REJECT
154
+ - 产出:[artifact path, e.g. docs/specs/active/xxx/control.md, or "无文件输出"]
155
+ - 下一步:[one concrete next action]
156
+ ---
157
+ ```
158
+
159
+ Rules:
160
+ - Use repository-local localized role titles when available; otherwise use readable fallback.
161
+ - Keep the block to 5–7 lines. Do not expand into a full recap.
162
+ - If the discussion was BLOCKED or REJECT, the 下一步 line must state what is needed to unblock.
163
+ - Do not omit this block even for discussion-only rounds with no file output.
@@ -0,0 +1,92 @@
1
+ ---
2
+ name: ys-team-spec-work
3
+ description: "Silent internal execution capability for approved ys-team specs. Execute repository work against the local spec baseline and keep docs and evidence aligned."
4
+ ---
5
+
6
+ # ys-team-spec-work
7
+
8
+ This is a silent internal skill.
9
+
10
+ Use it to execute approved work against an existing repository spec.
11
+
12
+ ## Purpose
13
+
14
+ - implement against the approved spec
15
+ - keep write-scope explicit
16
+ - update authoritative docs in the same delivery
17
+ - collect evidence for acceptance
18
+
19
+ ## Rules
20
+
21
+ - do not execute against vague discussion alone
22
+ - use the local spec as the working contract
23
+ - keep implementation, docs, and evidence in sync
24
+ - surface blockers instead of silently changing scope
25
+
26
+ ## 进化感知(工具缺口)
27
+
28
+ 执行过程中,主动检测是否存在工具缺口:
29
+
30
+ **触发条件**(满足任一即触发):
31
+ - 执行需要某种工作方法(如 TDD、前端设计规范、性能基准测试)但 `.ys_team/toolbox/` 中没有对应工具
32
+ - 执行到某个步骤发现"如果有 XX 工具会更高效/更安全"
33
+ - 角色的 tools 字段为空,但执行内容明显需要工具辅助
34
+
35
+ **触发后动作**:
36
+ 1. 写入 `.ys_team/evolution/requests.md` 的"待处理"区:
37
+ ```
38
+ ### [EVO-YYYY-MM-DD-N] [日期] [类型: 工具]
39
+
40
+ - 来源环节:spec-work
41
+ - 关联 Spec:[当前执行的 spec]
42
+ - 缺口描述:[具体缺什么工具/能力]
43
+ - 发现角色:[哪个角色在执行中发现的]
44
+ - 建议方案:[建议内化什么工具]
45
+ - 讨论状态:待讨论
46
+ ```
47
+ 2. 在当前响应中提示用户:
48
+ ```
49
+ 发现工具缺口:[描述]。已记录进化申请(EVO-YYYY-MM-DD-N)。
50
+ 建议在当前 spec-work 完成后发起进化评估,由团队评估是否内化新工具。
51
+ ```
52
+ 3. **不中断当前执行**——工具缺口不阻塞 spec-work,先记录,完成后再评估
53
+
54
+ ## Status 写入
55
+
56
+ 在以下关键节点必须同步更新 `.ys_team/status.md`:
57
+
58
+ **执行开始时**:
59
+ 1. 读取当前 `.ys_team/status.md`
60
+ 2. 更新 `updated` 时间戳
61
+ 3. 更新 `活跃 Spec` 表:当前 spec 阶段改为 spec-work,状态改为"执行中"
62
+ 4. 写入
63
+
64
+ **执行完成时**:
65
+ 1. 读取当前 `.ys_team/status.md`
66
+ 2. 更新 `updated` 时间戳
67
+ 3. 更新 `活跃 Spec` 表:当前 spec 状态改为"待验收"
68
+ 4. `待办` 追加:建议运行 submit 验收
69
+ 5. 写入
70
+
71
+ **遇到阻塞时**:
72
+ 1. 更新 `活跃 Spec` 表状态为"已阻塞"
73
+ 2. `阻塞项` 追加阻塞原因
74
+ 3. 写入
75
+
76
+ 此写入是 spec-work 的固定环节,不可跳过。
77
+
78
+ ## Visible Marker
79
+
80
+ 每次 `spec-work` 对用户输出后,必须以以下块结尾,作为工作流正在执行的可见标志:
81
+
82
+ ```markdown
83
+ ---
84
+ **[执行中]** ys-team · spec-work
85
+
86
+ [1–2 句说明当前执行内容或本轮完成内容。]
87
+
88
+ - 关联 Spec:[spec id 或 work 文件]
89
+ - 状态:[执行中 / 待验收 / 已阻塞]
90
+ - 下一步:[一个明确动作]
91
+ ---
92
+ ```