@team-ai/teamai-cli 0.40.8 → 0.50.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.
- package/CHANGELOG.md +169 -11
- package/README.ja.md +32 -29
- package/README.ko.md +32 -29
- package/README.md +32 -29
- package/README.th.md +32 -29
- package/README.zh-CN.md +32 -29
- package/agents/README.md +68 -0
- package/agents/README.zh-CN.md +68 -0
- package/agents/teamai-recall.md +10 -9
- package/dist/cli.js +209814 -135972
- package/dist/index.js +291 -0
- package/dist/runtime-paseo.js +27562 -0
- package/dist/runtime-sandbox.js +94740 -0
- package/dist/runtime-t3.js +41891 -0
- package/drivers/teamai-claude.yaml +6 -0
- package/drivers/teamai-codex.yaml +6 -0
- package/drivers/teamai-local.yaml +5 -0
- package/drivers/teamai-opencode.yaml +6 -0
- package/drivers/teamai-paseo.yaml +6 -0
- package/drivers/teamai-sandbox.yaml +7 -0
- package/drivers/teamai-t3.yaml +8 -0
- package/hooks/teamai-env-hint/HOOK.yaml +1 -0
- package/hooks/teamai-env-hint/README.md +80 -0
- package/hooks/teamai-env-hint/README.zh-CN.md +80 -0
- package/hooks/teamai-env-hint/exec.md +1 -0
- package/hooks/teamai-env-hint/secrets-rule.md +1 -0
- package/hooks/teamai-env-hint/secrets.md +1 -0
- package/hooks/teamai-env-hint/variables.md +1 -0
- package/hooks/teamai-friction-reminder/HOOK.yaml +1 -0
- package/hooks/teamai-friction-reminder/README.md +117 -0
- package/hooks/teamai-friction-reminder/README.zh-CN.md +117 -0
- package/hooks/teamai-friction-reminder/action-gap.md +1 -0
- package/hooks/teamai-friction-reminder/action-gap.zh.md +1 -0
- package/hooks/teamai-friction-reminder/action-share-learnings.md +1 -0
- package/hooks/teamai-friction-reminder/action-share-learnings.zh.md +1 -0
- package/hooks/teamai-friction-reminder/action.md +1 -0
- package/hooks/teamai-friction-reminder/action.zh.md +1 -0
- package/hooks/teamai-friction-reminder/gap-reasons.md +1 -0
- package/hooks/teamai-friction-reminder/gap-reasons.zh.md +1 -0
- package/hooks/teamai-friction-reminder/gap.md +1 -0
- package/hooks/teamai-friction-reminder/gap.zh.md +1 -0
- package/hooks/teamai-friction-reminder/params.yaml +12 -0
- package/hooks/teamai-friction-reminder/problem-reasons.md +1 -0
- package/hooks/teamai-friction-reminder/problem-reasons.zh.md +1 -0
- package/hooks/teamai-friction-reminder/problem.md +1 -0
- package/hooks/teamai-friction-reminder/problem.zh.md +1 -0
- package/hooks/teamai-friction-reminder/reason-correction.md +1 -0
- package/hooks/teamai-friction-reminder/reason-correction.zh.md +1 -0
- package/hooks/teamai-friction-reminder/reason-interrupt.md +1 -0
- package/hooks/teamai-friction-reminder/reason-interrupt.zh.md +1 -0
- package/hooks/teamai-friction-reminder/reason-tool-error.md +1 -0
- package/hooks/teamai-friction-reminder/reason-tool-error.zh.md +1 -0
- package/hooks/teamai-friction-reminder/reason-tool-reject.md +1 -0
- package/hooks/teamai-friction-reminder/reason-tool-reject.zh.md +1 -0
- package/hooks/teamai-friction-reminder/task.md +1 -0
- package/hooks/teamai-friction-reminder/task.zh.md +1 -0
- package/hooks/teamai-mr-hint/HOOK.yaml +1 -0
- package/hooks/teamai-mr-hint/README.md +81 -0
- package/hooks/teamai-mr-hint/README.zh-CN.md +81 -0
- package/hooks/teamai-mr-hint/offer-command.en.md +7 -0
- package/hooks/teamai-mr-hint/offer-command.md +10 -0
- package/hooks/teamai-mr-hint/offer-workflow.en.md +7 -0
- package/hooks/teamai-mr-hint/offer-workflow.md +10 -0
- package/hooks/teamai-mr-hint/params.yaml +2 -0
- package/hooks/teamai-package-hint/HOOK.yaml +1 -0
- package/hooks/teamai-package-hint/README.md +64 -0
- package/hooks/teamai-package-hint/README.zh-CN.md +64 -0
- package/hooks/teamai-package-hint/message.md +3 -0
- package/hooks/teamai-todowrite-hint/HOOK.yaml +1 -0
- package/hooks/teamai-todowrite-hint/README.md +68 -0
- package/hooks/teamai-todowrite-hint/README.zh-CN.md +68 -0
- package/hooks/teamai-todowrite-hint/message.en.md +6 -0
- package/hooks/teamai-todowrite-hint/message.md +9 -0
- package/package.json +41 -14
- package/rules/teamai-recall/README.md +78 -0
- package/rules/teamai-recall/README.zh-CN.md +78 -0
- package/rules/teamai-recall/RULE.en.md +36 -0
- package/rules/teamai-recall/RULE.md +43 -0
- package/rules/teamai-recall/block-direct.md +27 -0
- package/rules/teamai-recall/block.en.md +42 -0
- package/rules/teamai-recall/block.md +44 -0
- package/runtimes/teamai-paseo.yaml +5 -0
- package/runtimes/teamai-sandbox.yaml +3 -0
- package/runtimes/teamai-t3.yaml +5 -0
- package/sandboxes/teamai-bwrap.yaml +2 -0
- package/sandboxes/teamai-default.yaml +4 -0
- package/sandboxes/teamai-docker.yaml +5 -0
- package/sandboxes/teamai-podman.yaml +4 -0
- package/sandboxes/teamai-sbx.yaml +4 -0
- package/sandboxes/teamai-seatbelt.yaml +2 -0
- package/sandboxes/teamai-vercel.yaml +4 -0
- package/scorers/README.md +103 -0
- package/scorers/README.zh-CN.md +103 -0
- package/scorers/teamai-adoption.md +11 -0
- package/scorers/teamai-correctness.md +17 -0
- package/scorers/teamai-routing.md +11 -0
- package/skill-data/core/SKILL.md +4 -3
- package/skill-data/core/references/commands.md +300 -67
- package/skill-data/core/references/contribute-member.md +4 -4
- package/skill-data/core/references/troubleshooting.md +128 -18
- package/skill-data/setup/references/join-member.md +13 -9
- package/skill-data/setup/references/manage-admin.md +41 -17
- package/skill-data/setup/references/setup-admin.md +2 -2
- package/skill-data/setup/references/uninstall.md +30 -9
- package/skill-data/share/SKILL.md +17 -12
- package/skill-data/share/references/doc-template.md +3 -4
- package/skill-data/wiki/SKILL.md +1 -1
- package/skill-data/wiki/references/agents/graph-rag-agent.md +5 -1
- package/skill-data/workflow/SKILL.md +39 -16
- package/skill-data/workflow/references/fleet.md +13 -0
- package/skill-data/workflow/references/judging.md +17 -10
- package/skill-data/workflow/references/places.md +64 -7
- package/skill-data/workflow/references/sandbox.md +3 -3
- package/skill-data/workflow/references/session-hosts.md +27 -0
- package/skill-data/workflow-local/SKILL.md +4 -3
- package/skill-data/workflow-local/references/ci.md +1 -1
- package/skills/teamai/SKILL.md +4 -3
- package/workflows/README.md +103 -0
- package/workflows/README.zh-CN.md +103 -0
- package/workflows/teamai-benchmark.yaml +78 -0
- package/workflows/teamai-ci-extract-mr.yaml +66 -0
- package/workflows/teamai-codebase-deep-enrich/README.md +123 -0
- package/workflows/teamai-codebase-deep-enrich/README.zh-CN.md +123 -0
- package/workflows/teamai-codebase-deep-enrich/WORKFLOW.yaml +119 -0
- package/workflows/teamai-codebase-deep-enrich/architecture.md +30 -0
- package/workflows/teamai-codebase-deep-enrich/component.md +30 -0
- package/workflows/teamai-codebase-deep-enrich/params.yaml +1 -0
- package/workflows/teamai-codebase-deep-enrich/scenarios.md +32 -0
- package/workflows/teamai-codebase-enrich.yaml +98 -0
- package/workflows/teamai-draft-learning-updates/README.md +116 -0
- package/workflows/teamai-draft-learning-updates/README.zh-CN.md +116 -0
- package/workflows/teamai-draft-learning-updates/WORKFLOW.yaml +61 -0
- package/workflows/teamai-draft-learning-updates/params.yaml +4 -0
- package/workflows/teamai-finished-sessions/README.md +101 -0
- package/workflows/teamai-finished-sessions/README.zh-CN.md +101 -0
- package/workflows/teamai-finished-sessions/WORKFLOW.yaml +43 -0
- package/workflows/teamai-finished-sessions/params.yaml +1 -0
- package/workflows/teamai-import-from-iwiki.yaml +90 -0
- package/workflows/teamai-import-from-mr/README.md +104 -0
- package/workflows/teamai-import-from-mr/README.zh-CN.md +104 -0
- package/workflows/teamai-import-from-mr/WORKFLOW.yaml +94 -0
- package/workflows/teamai-import-from-mr/draft.en.md +48 -0
- package/workflows/teamai-import-from-mr/draft.zh.md +48 -0
- package/workflows/teamai-import-from-repo/README.md +106 -0
- package/workflows/teamai-import-from-repo/README.zh-CN.md +106 -0
- package/workflows/teamai-import-from-repo/WORKFLOW.yaml +109 -0
- package/workflows/teamai-import-from-repo/narrative.md +83 -0
- package/workflows/teamai-import-learnings.yaml +83 -0
- package/workflows/teamai-import-rules.yaml +34 -0
- package/workflows/teamai-new-scorer.yaml +54 -0
- package/workflows/teamai-promote-learning/README.md +122 -0
- package/workflows/teamai-promote-learning/README.zh-CN.md +122 -0
- package/workflows/teamai-promote-learning/WORKFLOW.yaml +102 -0
- package/workflows/teamai-promote-learning/params.yaml +4 -0
- package/workflows/teamai-score.yaml +121 -0
- package/workflows/teamai-self-improvement.yaml +37 -0
- package/workflows/teamai-session-to-task.yaml +69 -0
- package/workflows/teamai-sessions-to-tasks.yaml +62 -0
- package/workflows/teamai-share-learnings-from-sessions.yaml +36 -0
- package/workflows/teamai-share-learnings.yaml +25 -0
- package/workflows/teamai-share-session.yaml +21 -0
- package/workflows/teamai-try-scorer.yaml +32 -0
- package/skill-data/workflow/references/hosts.md +0 -27
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
You are the team's knowledge base curator. Distill one valuable team learning from the MR below.
|
|
2
|
+
Write in English. Output a complete Markdown document with YAML frontmatter.
|
|
3
|
+
|
|
4
|
+
When the MR has review threads, they carry the decisions: a decision reached in a resolved thread outweighs a restatement of the diff. Lead with what the review decided and why.
|
|
5
|
+
|
|
6
|
+
Frontmatter fields (exactly this format, no other fields):
|
|
7
|
+
---
|
|
8
|
+
title: "<short title naming the core problem or finding, under 60 characters>"
|
|
9
|
+
author: {{ steps.fetch.outputs.author }}
|
|
10
|
+
date: {{ steps.fetch.outputs.date }}
|
|
11
|
+
tags: [tag1, tag2, tag3]
|
|
12
|
+
confidence: 0.85
|
|
13
|
+
source_mr: "{{ steps.fetch.outputs.url }}"
|
|
14
|
+
---
|
|
15
|
+
|
|
16
|
+
Body structure (every section is required):
|
|
17
|
+
## Background
|
|
18
|
+
What was being done? What problem came up?
|
|
19
|
+
|
|
20
|
+
## Solution
|
|
21
|
+
How was it solved? What were the key steps?
|
|
22
|
+
|
|
23
|
+
## Lessons
|
|
24
|
+
- lesson 1
|
|
25
|
+
- lesson 2
|
|
26
|
+
|
|
27
|
+
## Related Skills
|
|
28
|
+
- skill-name (or "none")
|
|
29
|
+
|
|
30
|
+
Pick 2-5 tags from these groups:
|
|
31
|
+
stack: python, typescript, go, k8s, docker, sglang, cuda
|
|
32
|
+
problem: troubleshooting, performance, deployment, config, api
|
|
33
|
+
pattern: workflow, pattern, tool-usage, best-practice
|
|
34
|
+
scene: debugging, testing, monitoring, security
|
|
35
|
+
|
|
36
|
+
---
|
|
37
|
+
MR title: {{ steps.fetch.outputs.title }}
|
|
38
|
+
MR description:
|
|
39
|
+
{{ steps.fetch.outputs.description }}
|
|
40
|
+
|
|
41
|
+
Commits:
|
|
42
|
+
{{ steps.fetch.outputs.commits }}
|
|
43
|
+
|
|
44
|
+
Key diff (first 3000 characters):
|
|
45
|
+
{{ steps.fetch.outputs.diff }}
|
|
46
|
+
|
|
47
|
+
Review threads ({{ steps.fetch.outputs.thread_count }}):
|
|
48
|
+
{{ steps.fetch.outputs.threads }}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
你是团队知识库管理员。从以下 MR 信息提炼一条有价值的团队 learning。
|
|
2
|
+
【必须】用中文撰写,输出完整 Markdown 文档(含 YAML frontmatter)。
|
|
3
|
+
|
|
4
|
+
如果 MR 有 Review threads,那一节记录了评审达成的决定:已 resolved 的 thread 里的决定比复述 diff 更重要,优先写评审决定了什么、为什么。
|
|
5
|
+
|
|
6
|
+
frontmatter 字段(严格按此格式,不要加其他字段):
|
|
7
|
+
---
|
|
8
|
+
title: "<简短标题,描述核心问题或发现,<60字符>"
|
|
9
|
+
author: {{ steps.fetch.outputs.author }}
|
|
10
|
+
date: {{ steps.fetch.outputs.date }}
|
|
11
|
+
tags: [tag1, tag2, tag3]
|
|
12
|
+
confidence: 0.85
|
|
13
|
+
source_mr: "{{ steps.fetch.outputs.url }}"
|
|
14
|
+
---
|
|
15
|
+
|
|
16
|
+
body 结构(以下各节必须包含):
|
|
17
|
+
## 背景
|
|
18
|
+
在做什么?遇到了什么问题?
|
|
19
|
+
|
|
20
|
+
## 解决方案
|
|
21
|
+
怎么解决的?关键步骤是什么?
|
|
22
|
+
|
|
23
|
+
## 经验总结
|
|
24
|
+
- 经验 1
|
|
25
|
+
- 经验 2
|
|
26
|
+
|
|
27
|
+
## 相关 Skills
|
|
28
|
+
- skill-name(如无则写"暂无")
|
|
29
|
+
|
|
30
|
+
tags 从以下类别选 2-5 个:
|
|
31
|
+
技术栈: python, typescript, go, k8s, docker, sglang, cuda
|
|
32
|
+
问题类型: troubleshooting, performance, deployment, config, api
|
|
33
|
+
模式: workflow, pattern, tool-usage, best-practice
|
|
34
|
+
场景: debugging, testing, monitoring, security
|
|
35
|
+
|
|
36
|
+
---
|
|
37
|
+
MR 标题:{{ steps.fetch.outputs.title }}
|
|
38
|
+
MR 描述:
|
|
39
|
+
{{ steps.fetch.outputs.description }}
|
|
40
|
+
|
|
41
|
+
提交信息:
|
|
42
|
+
{{ steps.fetch.outputs.commits }}
|
|
43
|
+
|
|
44
|
+
关键 diff(前 3000 字):
|
|
45
|
+
{{ steps.fetch.outputs.diff }}
|
|
46
|
+
|
|
47
|
+
Review threads({{ steps.fetch.outputs.thread_count }}):
|
|
48
|
+
{{ steps.fetch.outputs.threads }}
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
# teamai-import-from-repo
|
|
2
|
+
|
|
3
|
+
English | [中文](README.zh-CN.md)
|
|
4
|
+
|
|
5
|
+
Imports repositories or local checkouts into a teamwiki. When every item is done, it refreshes the teamwiki indexes and publishes them once.
|
|
6
|
+
|
|
7
|
+
| Started by | `mode` |
|
|
8
|
+
|---|---|
|
|
9
|
+
| `teamai import --dir <path>` | `dir` |
|
|
10
|
+
| `teamai import --from-repo <url>` | `repo` |
|
|
11
|
+
| `teamai import --from-repo-list <file>` | `list` |
|
|
12
|
+
| `teamai import --from-org <org>` | `org` |
|
|
13
|
+
|
|
14
|
+
## How teamai's version runs
|
|
15
|
+
|
|
16
|
+
```mermaid
|
|
17
|
+
flowchart TD
|
|
18
|
+
subgraph each [For each item, up to concurrency at once. A failed item does not stop the others]
|
|
19
|
+
stage[Extract the item into a staging teamwiki, with no AI call] --> nar["Ask the AI tool: narrative.md, in its own worktree, when the repository needs a narrative"]
|
|
20
|
+
nar --> enrich["Run teamai-codebase-enrich, when the extraction asks for it"]
|
|
21
|
+
enrich --> publish[Publish the item's evidence, when it changed]
|
|
22
|
+
publish --> deep["Run teamai-codebase-deep-enrich, when publishing asks for it"]
|
|
23
|
+
deep --> done[Record the item]
|
|
24
|
+
end
|
|
25
|
+
each --> finish(["Sum up and publish the indexes: text, exit_code, imported"])
|
|
26
|
+
classDef prompt fill:#6a4f8f,stroke:#513b6d,color:#fff;
|
|
27
|
+
classDef wf fill:#3b6ea5,stroke:#2b5079,color:#fff;
|
|
28
|
+
classDef out fill:#2f8f4f,stroke:#1f6b39,color:#fff;
|
|
29
|
+
class nar prompt;
|
|
30
|
+
class enrich,deep wf;
|
|
31
|
+
class finish out;
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
Purple marks a prompt the AI tool answers. Blue marks another default workflow, which a team can replace too. `WORKFLOW.yaml` holds the steps.
|
|
35
|
+
|
|
36
|
+
| When | What happens to the item |
|
|
37
|
+
|---|---|
|
|
38
|
+
| The AI tool cannot run at all | It fails before anything is published |
|
|
39
|
+
| The narrative fails for another reason | teamai publishes the evidence without the narrative |
|
|
40
|
+
| The deep docs fail | teamai publishes the evidence, and records that the deep docs did not finish |
|
|
41
|
+
|
|
42
|
+
## Files
|
|
43
|
+
|
|
44
|
+
| File | What it is |
|
|
45
|
+
|---|---|
|
|
46
|
+
| `WORKFLOW.yaml` | The steps, and the `output:` each step declares |
|
|
47
|
+
| `narrative.md` | The prompt for a repository's `codebase.md` |
|
|
48
|
+
|
|
49
|
+
A prompt reads the outputs of the steps it needs, as `{{ steps.<id>.outputs.<field> }}`.
|
|
50
|
+
|
|
51
|
+
## Inputs
|
|
52
|
+
|
|
53
|
+
| Input | Type | Meaning |
|
|
54
|
+
|---|---|---|
|
|
55
|
+
| `wiki_root` | `string` | The teamwiki every item goes in |
|
|
56
|
+
| `mode` | `dir \| repo \| list \| org \| update \| ci` | The command that started the run. It decides how the batch is published and summed up |
|
|
57
|
+
| `items` | `[{ kind, source, domain, auth, slug, repo_url, mr_urls }]` | Each a remote repository (`kind: repo`, `source` a URL) or a local checkout (`kind: dir`, `source` a directory) |
|
|
58
|
+
| `settings` | `{ depth, ssh, incremental, skip_enrich, max_files, team_repo }` | The command's import options. `team_repo` is the team repo that holds `wiki_root` |
|
|
59
|
+
| `skipped` | `number` | How many items the command left out before the run. The summary counts them |
|
|
60
|
+
| `concurrency` | `number` | How many items the run imports at once |
|
|
61
|
+
|
|
62
|
+
## Outputs
|
|
63
|
+
|
|
64
|
+
| Output | Meaning |
|
|
65
|
+
|---|---|
|
|
66
|
+
| `text` | The summary the command prints |
|
|
67
|
+
| `exit_code` | `1` when an item failed. The other items still finish |
|
|
68
|
+
| `imported` | The `source`, `slug`, `updated` and `failed` of each item |
|
|
69
|
+
|
|
70
|
+
## Replace it
|
|
71
|
+
|
|
72
|
+
Put only the files you change in `workflows/teamai-import-from-repo/` at the root of the team repo. Every other file, `WORKFLOW.yaml` included, stays teamai's and keeps getting teamai's updates. To change the narrative prompt, copy it:
|
|
73
|
+
|
|
74
|
+
```bash
|
|
75
|
+
mkdir -p workflows/teamai-import-from-repo
|
|
76
|
+
cp "$(npm root -g)/teamai-cli/workflows/teamai-import-from-repo/narrative.md" workflows/teamai-import-from-repo/
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
Then edit it, such as adding this to `narrative.md`:
|
|
80
|
+
|
|
81
|
+
```markdown
|
|
82
|
+
Add a "How to run it locally" section with the commands the README gives.
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
Push the folder. After the next `teamai pull`, the commands run it with your files. A `workflows/teamai-import-from-repo.yaml` file replaces the folder whole.
|
|
86
|
+
|
|
87
|
+
| Keep | Why |
|
|
88
|
+
|---|---|
|
|
89
|
+
| The inputs and outputs above | The commands pass those inputs and read those outputs |
|
|
90
|
+
|
|
91
|
+
## Requires
|
|
92
|
+
|
|
93
|
+
| Needs | Without it |
|
|
94
|
+
|---|---|
|
|
95
|
+
| An AI tool | When a tool named in the settings cannot run, the item fails before anything is published |
|
|
96
|
+
| Access to each remote `source`, as its `auth` says | That item fails, and the others go on |
|
|
97
|
+
|
|
98
|
+
## Settings that change it
|
|
99
|
+
|
|
100
|
+
| Setting | Team `teamai.yaml` | Member config | Environment | Effect |
|
|
101
|
+
|---|---|---|---|---|
|
|
102
|
+
| AI tool | | `workflows.tools.default`, then `ai.tool` | `TEAMAI_AI_TOOL`, before both | Picks the tool that writes the narrative and answers the two enrich workflows |
|
|
103
|
+
| Driver | `workflows.driver` | `workflows.driver` | | Picks where the command starts the run. Unset means this machine |
|
|
104
|
+
| Retention | | `workflows.retention` | | Sets how long `teamai doctor --fix` leaves the worktrees and branches of the answers |
|
|
105
|
+
|
|
106
|
+
The member config is `~/.teamai/projects/<slug>/config.yaml` in a workspace, then `~/.teamai/config.yaml`. The environment wins over the member config, and the member config wins over the team. See [member settings](https://github.com/Tencent/teamai-cli/blob/main/docs/guide/reference.md#member-settings) for the defaults.
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
# teamai-import-from-repo
|
|
2
|
+
|
|
3
|
+
[English](README.md) | 中文
|
|
4
|
+
|
|
5
|
+
把仓库或本地检出导入 teamwiki。每一项都完成后,它刷新 teamwiki 的索引,并统一发布一次。
|
|
6
|
+
|
|
7
|
+
| 启动方式 | `mode` |
|
|
8
|
+
|---|---|
|
|
9
|
+
| `teamai import --dir <path>` | `dir` |
|
|
10
|
+
| `teamai import --from-repo <url>` | `repo` |
|
|
11
|
+
| `teamai import --from-repo-list <file>` | `list` |
|
|
12
|
+
| `teamai import --from-org <org>` | `org` |
|
|
13
|
+
|
|
14
|
+
## teamai 的版本如何运行
|
|
15
|
+
|
|
16
|
+
```mermaid
|
|
17
|
+
flowchart TD
|
|
18
|
+
subgraph each ["对每一项,最多同时 concurrency 项。一项失败不会让其他项停下"]
|
|
19
|
+
stage["把这一项提取到暂存 teamwiki,不调用 AI"] --> nar["询问 AI 工具:narrative.md,在自己的 worktree 里,仓库需要叙述时"]
|
|
20
|
+
nar --> enrich["运行 teamai-codebase-enrich,提取结果要求时"]
|
|
21
|
+
enrich --> publish["发布这一项的证据,有变化时"]
|
|
22
|
+
publish --> deep["运行 teamai-codebase-deep-enrich,发布结果要求时"]
|
|
23
|
+
deep --> done["记录这一项"]
|
|
24
|
+
end
|
|
25
|
+
each --> finish(["汇总并发布索引:text、exit_code、imported"])
|
|
26
|
+
classDef prompt fill:#6a4f8f,stroke:#513b6d,color:#fff;
|
|
27
|
+
classDef wf fill:#3b6ea5,stroke:#2b5079,color:#fff;
|
|
28
|
+
classDef out fill:#2f8f4f,stroke:#1f6b39,color:#fff;
|
|
29
|
+
class nar prompt;
|
|
30
|
+
class enrich,deep wf;
|
|
31
|
+
class finish out;
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
紫色表示由 AI 工具回答的提示词。蓝色表示另一个默认工作流,团队也可以替换它。`WORKFLOW.yaml` 保存这些步骤。
|
|
35
|
+
|
|
36
|
+
| 情况 | 这一项会怎样 |
|
|
37
|
+
|---|---|
|
|
38
|
+
| AI 工具完全无法运行 | 在发布任何内容之前失败 |
|
|
39
|
+
| 叙述因其他原因失败 | teamai 发布不带叙述的证据 |
|
|
40
|
+
| 深度文档失败 | teamai 发布证据,并记录深度文档没有完成 |
|
|
41
|
+
|
|
42
|
+
## 文件
|
|
43
|
+
|
|
44
|
+
| 文件 | 是什么 |
|
|
45
|
+
|---|---|
|
|
46
|
+
| `WORKFLOW.yaml` | 步骤,以及每个步骤声明的 `output:` |
|
|
47
|
+
| `narrative.md` | 仓库 `codebase.md` 的提示词 |
|
|
48
|
+
|
|
49
|
+
提示词以 `{{ steps.<id>.outputs.<field> }}` 的形式,读取它依赖的步骤的输出。
|
|
50
|
+
|
|
51
|
+
## 输入
|
|
52
|
+
|
|
53
|
+
| 输入 | 类型 | 含义 |
|
|
54
|
+
|---|---|---|
|
|
55
|
+
| `wiki_root` | `string` | 每一项落入的 teamwiki |
|
|
56
|
+
| `mode` | `dir \| repo \| list \| org \| update \| ci` | 启动这次运行的命令。它决定这一批如何发布和汇总 |
|
|
57
|
+
| `items` | `[{ kind, source, domain, auth, slug, repo_url, mr_urls }]` | 每一项是一个远程仓库(`kind: repo`,`source` 为 URL)或一个本地检出(`kind: dir`,`source` 为目录) |
|
|
58
|
+
| `settings` | `{ depth, ssh, incremental, skip_enrich, max_files, team_repo }` | 命令的导入选项。`team_repo` 是存放 `wiki_root` 的团队仓库 |
|
|
59
|
+
| `skipped` | `number` | 命令在运行前排除了多少项。摘要会计入它们 |
|
|
60
|
+
| `concurrency` | `number` | 运行同时导入多少项 |
|
|
61
|
+
|
|
62
|
+
## 输出
|
|
63
|
+
|
|
64
|
+
| 输出 | 含义 |
|
|
65
|
+
|---|---|
|
|
66
|
+
| `text` | 命令打印的摘要 |
|
|
67
|
+
| `exit_code` | 有项失败时为 `1`。其他项仍会完成 |
|
|
68
|
+
| `imported` | 每一项的 `source`、`slug`、`updated` 和 `failed` |
|
|
69
|
+
|
|
70
|
+
## 替换它
|
|
71
|
+
|
|
72
|
+
在团队仓库根目录的 `workflows/teamai-import-from-repo/` 里只放你要改的文件。其他文件(包括 `WORKFLOW.yaml`)仍用 teamai 的,并继续获得 teamai 的更新。要修改 narrative 提示词,先复制它:
|
|
73
|
+
|
|
74
|
+
```bash
|
|
75
|
+
mkdir -p workflows/teamai-import-from-repo
|
|
76
|
+
cp "$(npm root -g)/teamai-cli/workflows/teamai-import-from-repo/narrative.md" workflows/teamai-import-from-repo/
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
然后编辑它,例如在 `narrative.md` 里加上这一句:
|
|
80
|
+
|
|
81
|
+
```markdown
|
|
82
|
+
Add a "How to run it locally" section with the commands the README gives.
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
推送这个文件夹。下一次 `teamai pull` 之后,命令都用你的文件运行它。`workflows/teamai-import-from-repo.yaml` 单个文件会整体替换这个文件夹。
|
|
86
|
+
|
|
87
|
+
| 保留 | 原因 |
|
|
88
|
+
|---|---|
|
|
89
|
+
| 上面的输入和输出 | 命令会传这些输入、读这些输出 |
|
|
90
|
+
|
|
91
|
+
## 依赖
|
|
92
|
+
|
|
93
|
+
| 需要 | 没有时 |
|
|
94
|
+
|---|---|
|
|
95
|
+
| AI 工具 | 设置里指定的工具无法运行时,该项在发布任何内容之前失败 |
|
|
96
|
+
| 按 `auth` 指定的方式访问每个远程 `source` | 该项失败,其他项继续 |
|
|
97
|
+
|
|
98
|
+
## 影响它的设置
|
|
99
|
+
|
|
100
|
+
| 设置 | 团队 `teamai.yaml` | 成员配置 | 环境变量 | 作用 |
|
|
101
|
+
|---|---|---|---|---|
|
|
102
|
+
| AI 工具 | | `workflows.tools.default`,其次是 `ai.tool` | `TEAMAI_AI_TOOL`,优先于两者 | 选出编写叙述、并回答两个 enrich 工作流的工具 |
|
|
103
|
+
| 驱动 | `workflows.driver` | `workflows.driver` | | 选出命令在哪里启动运行。未设置表示本机 |
|
|
104
|
+
| 保留期 | | `workflows.retention` | | 设置 `teamai doctor --fix` 把回答留下的 worktree 和分支保留多久 |
|
|
105
|
+
|
|
106
|
+
成员配置在工作区里是 `~/.teamai/projects/<slug>/config.yaml`,其次是 `~/.teamai/config.yaml`。环境变量优先于成员配置,成员配置优先于团队。默认值见[成员设置](https://github.com/Tencent/teamai-cli/blob/main/docs/guide/zh-CN/reference.md#成员设置)。
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
schemaVersion: v1alpha1
|
|
2
|
+
name: teamai-import-from-repo
|
|
3
|
+
description: Import repositories or local checkouts into a teamwiki - extract each one, ask the AI tool for its narrative, module analysis and deep docs, publish it, then refresh the teamwiki indexes and publish them once. teamai import --dir, --from-repo, --from-repo-list and --from-org start it.
|
|
4
|
+
invoke: deny
|
|
5
|
+
private: true
|
|
6
|
+
# wiki_root is the teamwiki every item lands in; mode is the command that started the run, which says how the batch is
|
|
7
|
+
# published and summed up (update and ci: the command publishes it). An item is a remote repository (source a URL, auth
|
|
8
|
+
# token | ssh | public, '' for the default) or a local checkout (source a directory); slug and repo_url, '' when not
|
|
9
|
+
# given, and mr_urls name its evidence and record where it came from. settings.team_repo is the team repo that holds
|
|
10
|
+
# wiki_root, '' when none does; settings.max_files 0 keeps the default.
|
|
11
|
+
inputs:
|
|
12
|
+
wiki_root: string
|
|
13
|
+
mode: dir | repo | list | org | update | ci
|
|
14
|
+
items: [{ kind: repo | dir, source: string, domain: string, auth: string, slug: string, repo_url: string, mr_urls: [string] }]
|
|
15
|
+
settings: { depth: number, ssh: boolean, incremental: boolean, skip_enrich: boolean, max_files: number, team_repo: string }
|
|
16
|
+
skipped: number
|
|
17
|
+
concurrency: number
|
|
18
|
+
steps:
|
|
19
|
+
- id: imports
|
|
20
|
+
for_each: { items: inputs.items, max_parallel: "{{ inputs.concurrency }}" }
|
|
21
|
+
# One item that fails leaves the others; the summary names it and the command exits 1.
|
|
22
|
+
continue_on_failure: true
|
|
23
|
+
workflow:
|
|
24
|
+
ends: { unconfigured-tool: failed }
|
|
25
|
+
outputs:
|
|
26
|
+
slug: steps.stage.outputs.slug
|
|
27
|
+
updated: steps.stage.outputs.updated
|
|
28
|
+
deep_complete: steps.done.outputs.deep_complete
|
|
29
|
+
steps:
|
|
30
|
+
- id: stage
|
|
31
|
+
requires: { host: true }
|
|
32
|
+
command: teamai import stage --item "$ITEM" --settings "$SETTINGS" --wiki-root "$WIKI_ROOT"
|
|
33
|
+
env: { ITEM: "{{ item }}", SETTINGS: "{{ inputs.settings }}", WIKI_ROOT: "{{ inputs.wiki_root }}" }
|
|
34
|
+
output: { slug: string, stage: string, updated: boolean, enrich: boolean, narrate: boolean, context: string, head: string, finished: boolean }
|
|
35
|
+
- id: narrative
|
|
36
|
+
needs: [stage]
|
|
37
|
+
if: steps.stage.outputs.narrate
|
|
38
|
+
answer_file: narrative.md
|
|
39
|
+
output: { text: string }
|
|
40
|
+
timeout: 600s
|
|
41
|
+
# A worktree of its own lets the items' narratives run beside each other.
|
|
42
|
+
workspace: new
|
|
43
|
+
# The evidence is published without the narrative when the tool could not write one; publish says why.
|
|
44
|
+
continue_on_failure: true
|
|
45
|
+
- id: narrative-tool
|
|
46
|
+
needs: [narrative]
|
|
47
|
+
# A tool the member names that cannot run fails the item before anything is published.
|
|
48
|
+
if: steps.narrative.failure.code == 'tool_unconfigured'
|
|
49
|
+
end: unconfigured-tool
|
|
50
|
+
- id: enrich
|
|
51
|
+
needs: [stage, narrative]
|
|
52
|
+
if: steps.stage.outputs.enrich && steps.narrative.failure.code != 'tool_unconfigured'
|
|
53
|
+
workflow: teamai-codebase-enrich
|
|
54
|
+
with: { wiki_root: "{{ steps.stage.outputs.stage }}/teamwiki", project: "{{ steps.stage.outputs.slug }}" }
|
|
55
|
+
- id: publish
|
|
56
|
+
needs: [stage, narrative, enrich]
|
|
57
|
+
if: steps.stage.outputs.updated && steps.narrative.failure.code != 'tool_unconfigured' && steps.enrich.outcome != 'failed'
|
|
58
|
+
requires: { host: true }
|
|
59
|
+
command: teamai import publish --item "$ITEM" --settings "$SETTINGS" --wiki-root "$WIKI_ROOT" --stage "$STAGE" --slug "$SLUG" --narrative "$TEXT" --narrative-failure "$WHY"
|
|
60
|
+
env:
|
|
61
|
+
ITEM: "{{ item }}"
|
|
62
|
+
SETTINGS: "{{ inputs.settings }}"
|
|
63
|
+
WIKI_ROOT: "{{ inputs.wiki_root }}"
|
|
64
|
+
STAGE: "{{ steps.stage.outputs.stage }}"
|
|
65
|
+
SLUG: "{{ steps.stage.outputs.slug }}"
|
|
66
|
+
TEXT: "{{ steps.narrative.outputs.text }}"
|
|
67
|
+
WHY: "{{ steps.narrative.failure.message }}"
|
|
68
|
+
writes: ["{{ inputs.wiki_root }}"]
|
|
69
|
+
output: { deep: boolean }
|
|
70
|
+
- id: deep
|
|
71
|
+
needs: [stage, publish]
|
|
72
|
+
if: steps.publish.outputs.deep
|
|
73
|
+
workflow: teamai-codebase-deep-enrich
|
|
74
|
+
with: { wiki_root: "{{ inputs.wiki_root }}", project: "{{ steps.stage.outputs.slug }}", max_modules: 0, concurrency: 5 }
|
|
75
|
+
# The evidence is published either way: a deep enrich that failed is one that did not finish, which done says.
|
|
76
|
+
continue_on_failure: true
|
|
77
|
+
- id: done
|
|
78
|
+
needs: [stage, publish, deep]
|
|
79
|
+
# An unchanged repository was recorded and said done by stage.
|
|
80
|
+
if: "!steps.stage.outputs.finished && steps.publish.outcome != 'failed'"
|
|
81
|
+
requires: { host: true }
|
|
82
|
+
command: teamai import finish-item --item "$ITEM" --settings "$SETTINGS" --wiki-root "$WIKI_ROOT" --mode "$MODE" --slug "$SLUG" --head "$HEAD" --deep "$DEEP" --deep-failure "$DEEP_WHY"
|
|
83
|
+
env:
|
|
84
|
+
ITEM: "{{ item }}"
|
|
85
|
+
SETTINGS: "{{ inputs.settings }}"
|
|
86
|
+
WIKI_ROOT: "{{ inputs.wiki_root }}"
|
|
87
|
+
MODE: "{{ inputs.mode }}"
|
|
88
|
+
SLUG: "{{ steps.stage.outputs.slug }}"
|
|
89
|
+
HEAD: "{{ steps.stage.outputs.head }}"
|
|
90
|
+
DEEP: "{{ steps.deep.outputs.complete }}"
|
|
91
|
+
DEEP_WHY: "{{ steps.deep.failure.message }}"
|
|
92
|
+
output: { deep_complete: boolean }
|
|
93
|
+
- id: finish
|
|
94
|
+
needs: [imports]
|
|
95
|
+
if: steps.imports.outcome == 'success' || steps.imports.outcome == 'failed'
|
|
96
|
+
requires: { host: true }
|
|
97
|
+
command: teamai import finish --mode "$MODE" --wiki-root "$WIKI_ROOT" --settings "$SETTINGS" --skipped "$SKIPPED" --results "$RESULTS"
|
|
98
|
+
env:
|
|
99
|
+
MODE: "{{ inputs.mode }}"
|
|
100
|
+
WIKI_ROOT: "{{ inputs.wiki_root }}"
|
|
101
|
+
SETTINGS: "{{ inputs.settings }}"
|
|
102
|
+
SKIPPED: "{{ inputs.skipped }}"
|
|
103
|
+
RESULTS: "{{ steps.imports.results }}"
|
|
104
|
+
writes: ["{{ inputs.wiki_root }}"]
|
|
105
|
+
output: { text: string, exit_code: number, imported: [{ source: string, slug: string, updated: boolean, failed: boolean }] }
|
|
106
|
+
outputs:
|
|
107
|
+
text: steps.finish.outputs.text
|
|
108
|
+
exit_code: steps.finish.outputs.exit_code
|
|
109
|
+
imported: steps.finish.outputs.imported
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
你是技术文档专家。根据以下 git 仓库信息,生成一份结构完整的 codebase.md 技术全景文档。
|
|
2
|
+
【必须】用中文撰写,输出纯 Markdown(不要加额外说明)。
|
|
3
|
+
|
|
4
|
+
== 格式骨架(严格按此结构生成,每个章节都必须包含)==
|
|
5
|
+
|
|
6
|
+
# Codebase 概览
|
|
7
|
+
|
|
8
|
+
## 项目概述
|
|
9
|
+
(2-4 句描述项目是什么、做什么,然后列出核心能力 bullet list,每条带 emoji)
|
|
10
|
+
核心能力:
|
|
11
|
+
- 🔄 **功能名**:简短说明
|
|
12
|
+
- 📥 **功能名**:简短说明
|
|
13
|
+
|
|
14
|
+
## 技术栈
|
|
15
|
+
(用表格,含版本信息)
|
|
16
|
+
| 维度 | 技术 |
|
|
17
|
+
|------|------|
|
|
18
|
+
| 语言 | **语言** 版本+ |
|
|
19
|
+
| 运行时 | **运行时** 版本 |
|
|
20
|
+
(继续列出构建、测试、关键依赖库等)
|
|
21
|
+
|
|
22
|
+
## 目录结构与模块职责
|
|
23
|
+
(用带分组框的树形结构,相关文件归为一组,格式如下)
|
|
24
|
+
```
|
|
25
|
+
项目根/
|
|
26
|
+
├── src/
|
|
27
|
+
│ ├── index.ts # CLI 入口,注册所有命令
|
|
28
|
+
│ │
|
|
29
|
+
│ ├── ┌─ 功能分组名 ────────────────────────────────┐
|
|
30
|
+
│ ├── │ fileA.ts # 功能说明 │
|
|
31
|
+
│ ├── │ fileB.ts # 功能说明 │
|
|
32
|
+
│ ├── └─────────────────────────────────────────────────────┘
|
|
33
|
+
│ │
|
|
34
|
+
│ ├── ┌─ 另一个功能分组 ─────────────────────────────┐
|
|
35
|
+
│ ├── │ dir/
|
|
36
|
+
│ ├── │ ├── fileC.ts # 功能说明 │
|
|
37
|
+
│ ├── └─────────────────────────────────────────────────────┘
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
## 数据与配置
|
|
41
|
+
(列出关键配置文件和运行时数据目录的路径树,说明每个目录/文件的用途)
|
|
42
|
+
|
|
43
|
+
## 核心数据流
|
|
44
|
+
(列出 2-4 条核心业务流程,每条用带缩进和 → 的流程图格式)
|
|
45
|
+
### 1. 流程名称
|
|
46
|
+
```
|
|
47
|
+
触发点(用户执行 xxx 命令)
|
|
48
|
+
│
|
|
49
|
+
├─ 1. 步骤描述
|
|
50
|
+
│ └─ 子步骤
|
|
51
|
+
├─ 2. 步骤描述 → 结果
|
|
52
|
+
└─ ✅ 完成
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
## 关键接口与抽象
|
|
56
|
+
(列出项目中最重要的 interface/abstract class,用代码块展示签名,并说明实现)
|
|
57
|
+
|
|
58
|
+
## 配置系统
|
|
59
|
+
(说明配置优先级、scope 检测逻辑、关键配置结构示例)
|
|
60
|
+
|
|
61
|
+
## 性能与可靠性
|
|
62
|
+
(表格列出关键性能设计:并发控制、超时、缓存、降级等)
|
|
63
|
+
|
|
64
|
+
## 架构决策与权衡
|
|
65
|
+
(列出 3-5 条主要设计选择的"为什么",格式如"为什么选择 X 而不是 Y:原因说明")
|
|
66
|
+
|
|
67
|
+
## 已知限制与演进方向
|
|
68
|
+
(列出 3-5 条当前实现的局限与下一步可能的优化)
|
|
69
|
+
|
|
70
|
+
## 测试覆盖
|
|
71
|
+
(表格列出测试层级、用例数、覆盖率)
|
|
72
|
+
|
|
73
|
+
## 备注
|
|
74
|
+
- ✅ 有文档佐证的信息
|
|
75
|
+
- ⚠️ 基于代码结构推断的信息
|
|
76
|
+
|
|
77
|
+
== 以上是格式骨架,根据实际仓库内容填充。若某章节确实无法从上下文推断,可简略但不得省略章节标题。==
|
|
78
|
+
|
|
79
|
+
---
|
|
80
|
+
以下是仓库上下文:
|
|
81
|
+
<context>
|
|
82
|
+
{{ steps.stage.outputs.context }}
|
|
83
|
+
</context>
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
schemaVersion: v1alpha1
|
|
2
|
+
name: teamai-import-learnings
|
|
3
|
+
description: Classify files as team rules, docs or learnings with the AI tool, three at once, leave out the personal ones, ask a person to accept, edit or skip each of the others, and write the accepted ones into rules/, docs/ or learnings/ of the team repo by their type, or all into one directory. It neither commits nor pushes - teamai-import-rules and teamai-import-from-iwiki run it and publish what it wrote.
|
|
4
|
+
invoke: deny
|
|
5
|
+
private: true
|
|
6
|
+
# candidates: each file to classify, by the path it is shown as and the file that holds its text. dir: the team repo,
|
|
7
|
+
# whose rules/, docs/ and learnings/ take the items by type; with by_type false, the directory every item is written
|
|
8
|
+
# into. all: accept every item without asking.
|
|
9
|
+
inputs:
|
|
10
|
+
candidates: [{ path: string, file: string }]
|
|
11
|
+
dir: string
|
|
12
|
+
by_type: boolean
|
|
13
|
+
all: boolean
|
|
14
|
+
defaults:
|
|
15
|
+
requires: { host: true }
|
|
16
|
+
steps:
|
|
17
|
+
- id: classify
|
|
18
|
+
for_each: { items: inputs.candidates, max_parallel: 3 }
|
|
19
|
+
workflow:
|
|
20
|
+
outputs:
|
|
21
|
+
type: steps.parse.outputs.type
|
|
22
|
+
title: steps.parse.outputs.title
|
|
23
|
+
summary: steps.parse.outputs.summary
|
|
24
|
+
tags: steps.parse.outputs.tags
|
|
25
|
+
personal: steps.parse.outputs.personal
|
|
26
|
+
steps:
|
|
27
|
+
- id: read
|
|
28
|
+
command: teamai import read-candidate --file "$FILE"
|
|
29
|
+
env: { FILE: "{{ item.file }}" }
|
|
30
|
+
output: { content: string }
|
|
31
|
+
- id: ask
|
|
32
|
+
needs: [read]
|
|
33
|
+
answer: |-
|
|
34
|
+
你是团队知识库管理员。分析以下文件内容,返回严格 JSON(不要加 markdown 代码块):
|
|
35
|
+
{"type":"rule|doc|learning","title":"<简短标题,<60字符>","summary":"<一句话摘要>","tags":["tag1","tag2"],"confidence":0.8,"isPersonal":false}
|
|
36
|
+
|
|
37
|
+
判断规则:
|
|
38
|
+
- type="rule":编码规范、团队约定、最佳实践文档
|
|
39
|
+
- type="doc":技术文档、设计文档、API 说明
|
|
40
|
+
- type="learning":经验总结、踩坑记录、解决方案
|
|
41
|
+
- isPersonal=true:个人偏好/环境配置(如本地路径、个人 token、个人习惯),不应进入团队库
|
|
42
|
+
|
|
43
|
+
文件路径:{{ item.path }}
|
|
44
|
+
文件内容(前3000字):
|
|
45
|
+
{{ steps.read.outputs.content }}
|
|
46
|
+
output: { text: string }
|
|
47
|
+
timeout: 600s
|
|
48
|
+
# A worktree of its own lets the files' answers run beside each other.
|
|
49
|
+
workspace: new
|
|
50
|
+
- id: parse
|
|
51
|
+
needs: [ask]
|
|
52
|
+
# A reply that is not the JSON asked for reads as personal, so the file is left out rather than guessed at.
|
|
53
|
+
command: teamai import classify-reply --path "$SHOWN" --reply "$REPLY"
|
|
54
|
+
env: { SHOWN: "{{ item.path }}", REPLY: "{{ steps.ask.outputs.text }}" }
|
|
55
|
+
output: { type: rule | doc | learning, title: string, summary: string, tags: [string], personal: boolean }
|
|
56
|
+
- id: review
|
|
57
|
+
needs: [classify]
|
|
58
|
+
if: "!inputs.all"
|
|
59
|
+
for_each: "filter(steps.classify.results, .outputs.personal == false)"
|
|
60
|
+
workflow:
|
|
61
|
+
outputs: { choice: steps.ask.choice, note: steps.ask.note }
|
|
62
|
+
steps:
|
|
63
|
+
- id: ask
|
|
64
|
+
choose:
|
|
65
|
+
message: |-
|
|
66
|
+
{{ item.outputs.title }} ({{ item.outputs.type }}) from {{ item.item.path }}
|
|
67
|
+
Summary: {{ item.outputs.summary }}
|
|
68
|
+
Tags: {{ item.outputs.tags }}
|
|
69
|
+
accept writes it; edit writes it with your note as its title; skip leaves it out.
|
|
70
|
+
options: [accept, edit, skip]
|
|
71
|
+
- id: write
|
|
72
|
+
needs: [classify, review]
|
|
73
|
+
command: teamai import write-learnings --classified "$CLASSIFIED" --reviewed "$REVIEWED" --target "$DIR" --by-type "$BY_TYPE"
|
|
74
|
+
env:
|
|
75
|
+
CLASSIFIED: "{{ steps.classify.results }}"
|
|
76
|
+
REVIEWED: "{{ steps.review.results }}"
|
|
77
|
+
DIR: "{{ inputs.dir }}"
|
|
78
|
+
BY_TYPE: "{{ inputs.by_type }}"
|
|
79
|
+
writes: ["{{ inputs.dir }}"]
|
|
80
|
+
output: { kept: number, written: [string] }
|
|
81
|
+
outputs:
|
|
82
|
+
kept: steps.write.outputs.kept
|
|
83
|
+
written: steps.write.outputs.written
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
schemaVersion: v1alpha1
|
|
2
|
+
name: teamai-import-rules
|
|
3
|
+
description: Import the rules in the rules directory of every AI coding tool teamai supports on this machine into the team repo - teamai-import-learnings classifies them and asks about each one - then commit and push what it wrote. teamai import --from-tools starts it.
|
|
4
|
+
invoke: deny
|
|
5
|
+
private: true
|
|
6
|
+
# dir: the team repo, whose rules/, docs/ and learnings/ take the items by type; with by_type false, the directory every
|
|
7
|
+
# item is written into, and nothing is pushed. all: accept every item without asking.
|
|
8
|
+
inputs: { dir: string, by_type: boolean, all: boolean }
|
|
9
|
+
steps:
|
|
10
|
+
- id: scan
|
|
11
|
+
requires: { host: true }
|
|
12
|
+
command: teamai import scan-rules
|
|
13
|
+
output: { candidates: [{ path: string, file: string }] }
|
|
14
|
+
- id: learnings
|
|
15
|
+
needs: [scan]
|
|
16
|
+
if: length(steps.scan.outputs.candidates) > 0
|
|
17
|
+
workflow: teamai-import-learnings
|
|
18
|
+
with:
|
|
19
|
+
candidates: "{{ steps.scan.outputs.candidates }}"
|
|
20
|
+
dir: "{{ inputs.dir }}"
|
|
21
|
+
by_type: "{{ inputs.by_type }}"
|
|
22
|
+
all: "{{ inputs.all }}"
|
|
23
|
+
- id: publish
|
|
24
|
+
needs: [learnings]
|
|
25
|
+
if: steps.learnings.outcome == 'success'
|
|
26
|
+
requires: { host: true }
|
|
27
|
+
command: teamai import publish-rules --kept "$KEPT" --written "$WRITTEN" --target "$DIR" --by-type "$BY_TYPE"
|
|
28
|
+
env:
|
|
29
|
+
KEPT: "{{ steps.learnings.outputs.kept }}"
|
|
30
|
+
WRITTEN: "{{ steps.learnings.outputs.written }}"
|
|
31
|
+
DIR: "{{ inputs.dir }}"
|
|
32
|
+
BY_TYPE: "{{ inputs.by_type }}"
|
|
33
|
+
writes: ["{{ inputs.dir }}"]
|
|
34
|
+
outputs: { written: steps.learnings.outputs.written }
|