teamai-cli 0.25.0 → 0.26.0-beta.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 +6 -0
- package/README.zh-CN.md +6 -0
- package/dist/index.js +5377 -2786
- package/package.json +4 -1
- package/skill-data/core/SKILL.md +114 -0
- package/skill-data/core/references/commands.md +339 -0
- package/{skills/teamai → skill-data/core}/references/contribute-member.md +13 -10
- package/{skills/teamai → skill-data/core}/references/troubleshooting.md +1 -1
- package/skill-data/setup/SKILL.md +76 -0
- package/{skills/teamai → skill-data/setup}/references/join-member.md +17 -14
- package/{skills/teamai → skill-data/setup}/references/manage-admin.md +8 -6
- package/{skills/teamai → skill-data/setup}/references/provider-tgit.md +9 -6
- package/{skills/teamai → skill-data/setup}/references/setup-admin.md +41 -35
- package/skill-data/share/SKILL.md +70 -0
- package/skill-data/share/references/doc-template.md +44 -0
- package/skill-data/wiki/SKILL.md +314 -0
- package/skill-data/wiki/references/agents/graph-rag-agent.md +344 -0
- package/skill-data/wiki/references/agents/kb-doc-generator.md +323 -0
- package/skill-data/wiki/references/methodology/phase0-collection.md +54 -0
- package/skill-data/wiki/references/methodology/phase1-reverse-engineering.md +89 -0
- package/skill-data/wiki/references/methodology/phase2-document-types.md +341 -0
- package/skill-data/wiki/references/methodology/phase3-ai-enhancement.md +164 -0
- package/skill-data/wiki/references/methodology/phase4-quality.md +232 -0
- package/skill-data/wiki/references/overview.md +124 -0
- package/skill-data/wiki/references/phases/k1-reverse-engineering.md +118 -0
- package/skill-data/wiki/references/phases/k2-documents.md +68 -0
- package/skill-data/wiki/references/phases/k3-ai-native.md +121 -0
- package/skill-data/wiki/references/phases/k4-quality.md +190 -0
- package/skill-data/wiki/references/phases/phase0-init.md +112 -0
- package/skill-data/wiki/references/templates/project-overview.md +148 -0
- package/{skills/team-wiki-codebase → skill-data/wiki}/scripts/scan_repo.py +52 -52
- package/{skills/team-wiki-codebase → skill-data/wiki}/scripts/validate_kb.py +68 -62
- package/skills/teamai/SKILL.md +28 -128
- package/skills/team-wiki-codebase/README.md +0 -121
- package/skills/team-wiki-codebase/SKILL.md +0 -905
- package/skills/team-wiki-codebase/references/agents/graph-rag-agent.md +0 -344
- package/skills/team-wiki-codebase/references/agents/kb-doc-generator.md +0 -323
- package/skills/team-wiki-codebase/references/methodology/phase0-collection.md +0 -54
- package/skills/team-wiki-codebase/references/methodology/phase1-reverse-engineering.md +0 -89
- package/skills/team-wiki-codebase/references/methodology/phase2-document-types.md +0 -341
- package/skills/team-wiki-codebase/references/methodology/phase3-ai-enhancement.md +0 -164
- package/skills/team-wiki-codebase/references/methodology/phase4-quality.md +0 -232
- package/skills/team-wiki-codebase/references/templates/project-overview.md +0 -148
- package/skills/teamai-share-learnings/SKILL.md +0 -87
- /package/{skills/teamai → skill-data/setup}/references/uninstall.md +0 -0
|
@@ -0,0 +1,190 @@
|
|
|
1
|
+
## Phase K4: Knowledge Base Quality Assessment and Report
|
|
2
|
+
|
|
3
|
+
**Methodology**: `{SKILL_DIR}/references/methodology/phase4-quality.md`
|
|
4
|
+
|
|
5
|
+
### Step 1: Automated validation
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
python3 "{SKILL_DIR}/scripts/validate_kb.py" <output_dir> --verbose
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
`--verbose` prints the details of every item (missing anchors, the exact location of dead links). This is exactly the full output required below.
|
|
12
|
+
|
|
13
|
+
Output (**must be shown in full, not only the passing items**):
|
|
14
|
+
```
|
|
15
|
+
Link integrity: ✅/❌ N dead links
|
|
16
|
+
search-anchor: ✅/⚠️ coverage N/M (X%)
|
|
17
|
+
AI Quick Reference table: ✅/⚠️ coverage N/M (X%)
|
|
18
|
+
Bidirectional links: ✅/⚠️ coverage N/M (X%)
|
|
19
|
+
README index: ✅/⚠️ inclusion rate N/M (X%)
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
### Step 2: Accuracy audit
|
|
23
|
+
|
|
24
|
+
Aggregate the credibility of the whole knowledge base from `accuracy_stats`, and the interface coverage from `interface_coverage`:
|
|
25
|
+
|
|
26
|
+
```
|
|
27
|
+
[Content accuracy]
|
|
28
|
+
Total claims: N (business rules + interface descriptions + relationships)
|
|
29
|
+
Verified (with code reference): N (X%)
|
|
30
|
+
[UNVERIFIED]: N (X%)
|
|
31
|
+
AMBIGUOUS relationships: N (X%)
|
|
32
|
+
|
|
33
|
+
[Interface coverage] (only HTTP/MQ/RPC type components are counted, NONE type is excluded)
|
|
34
|
+
HTTP interfaces: documented M / scan baseline N = X%
|
|
35
|
+
MQ Topics: documented M / scan baseline N = X%
|
|
36
|
+
RPC Methods: documented M / scan baseline N = X%
|
|
37
|
+
Overall coverage: X% target ≥ 90%
|
|
38
|
+
|
|
39
|
+
⚠️ Interface gap list (components where documented < scan baseline):
|
|
40
|
+
- ComponentA: documented 8, scan baseline 13, gap 5 → recommend adding
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
⚠️ Manual confirmation list: (documents with [UNVERIFIED] > 20% + components with interface gaps + AMBIGUOUS relationships)
|
|
44
|
+
|
|
45
|
+
### Step 3: RAG retrieval spot check
|
|
46
|
+
|
|
47
|
+
Following `phase4-quality.md §RAG Retrieval Test Cases`, test 1 question from each of the 7 question types (see the methodology for details) and record the hit rate.
|
|
48
|
+
|
|
49
|
+
### Step 4: AI end-to-end validation (E2E Validation)
|
|
50
|
+
|
|
51
|
+
**Core idea**: answer a set of standardised questions using the knowledge base, then **trace back to the code to verify the answers**, to detect whether the knowledge base enables the AI to give correct answers.
|
|
52
|
+
|
|
53
|
+
```
|
|
54
|
+
Step 4A: Generate the standard validation question set (automatic, based on existing documents)
|
|
55
|
+
|
|
56
|
+
**Prefer an external validation set provided by the user**:
|
|
57
|
+
IF the user provided a list of validation questions (3~10 real business questions) in Phase 0 or now:
|
|
58
|
+
→ use the user's questions as the validation set first (source: USER)
|
|
59
|
+
→ top up automatically to 10~15 questions (source: AUTO)
|
|
60
|
+
ELSE:
|
|
61
|
+
→ generate all automatically (source: AUTO)
|
|
62
|
+
|
|
63
|
+
> User-provided questions are more valuable, because when the AI writes its own questions it tends to test areas it already knows,
|
|
64
|
+
> and the real blind spots (things the AI did not understand and is unaware of) can only be found by external questions.
|
|
65
|
+
|
|
66
|
+
Automatically generate 10~15 validation questions from k1-architecture-map.md and k2-doc-list.md:
|
|
67
|
+
|
|
68
|
+
Question type distribution (cover at least the following 5 types):
|
|
69
|
+
|
|
70
|
+
┌────────────────────────────────────────────────────────────────────┐
|
|
71
|
+
│ Type 1: component responsibility (3 questions) │
|
|
72
|
+
│ Pattern: "What is the core responsibility of <component>? Where is the code entry point?" │
|
|
73
|
+
│ Verification: the function / file names in the answer must exist in the code │
|
|
74
|
+
│ │
|
|
75
|
+
│ Type 2: call relationships (3 questions) │
|
|
76
|
+
│ Pattern: "What is the relationship between <component A> and <component B>? How do they communicate?" │
|
|
77
|
+
│ Verification: the answer matches the G1 matrix + the actual imports / calls in the code │
|
|
78
|
+
│ │
|
|
79
|
+
│ Type 3: operation constraints (2 questions) │
|
|
80
|
+
│ Pattern: "Can <operation Y> be executed in <state X>?" │
|
|
81
|
+
│ Verification: the answer matches the G9 constraint matrix + the state checks in the code │
|
|
82
|
+
│ │
|
|
83
|
+
│ Type 4: data flow (2 questions) │
|
|
84
|
+
│ Pattern: "Which tables / queues does <operation Z> ultimately write to?" │
|
|
85
|
+
│ Verification: the answer matches the G3 data flow + the actual SQL / MQ operations in the code │
|
|
86
|
+
│ │
|
|
87
|
+
│ Type 5: error troubleshooting (2 questions) │
|
|
88
|
+
│ Pattern: "What does error code <XXX> mean? Which component produces it?" │
|
|
89
|
+
│ Verification: the answer matches the G4 error code map + the error definitions in the code │
|
|
90
|
+
│ │
|
|
91
|
+
│ Type 6 (optional): knowledge boundary test (2 questions) │
|
|
92
|
+
│ Pattern: deliberately ask about content the knowledge base does not cover (e.g. third-party SDK internals, historical architecture changes) │
|
|
93
|
+
│ Verification: the AI should answer "outside the knowledge base coverage" rather than hallucinate │
|
|
94
|
+
└────────────────────────────────────────────────────────────────────┘
|
|
95
|
+
|
|
96
|
+
Step 4B: Answer using the knowledge base (simulating the AI usage scenario)
|
|
97
|
+
|
|
98
|
+
FOR each validation question:
|
|
99
|
+
1. Assume only the knowledge base documents can be read, not the code directly
|
|
100
|
+
2. Find the relevant document following the retrieval routing rules
|
|
101
|
+
3. Extract the answer from the document
|
|
102
|
+
|
|
103
|
+
Step 4C: Code trace-back verification
|
|
104
|
+
|
|
105
|
+
FOR each answer:
|
|
106
|
+
1. Verify the key claims directly in the code with Grep/Read
|
|
107
|
+
2. Judge the result:
|
|
108
|
+
✅ CORRECT : the answer matches the code
|
|
109
|
+
⚠️ PARTIAL : the answer is partially correct, with omissions or imprecision
|
|
110
|
+
❌ INCORRECT : the answer contradicts the code
|
|
111
|
+
🔇 BOUNDARY_OK : knowledge boundary question, correctly declined to answer (type 6 only)
|
|
112
|
+
🔇 BOUNDARY_FAIL : knowledge boundary question, wrongly gave an answer (type 6 only)
|
|
113
|
+
|
|
114
|
+
Step 4D: Write the validation report
|
|
115
|
+
|
|
116
|
+
Append to the ## AI End-to-End Validation section of k4-quality-report.md:
|
|
117
|
+
|
|
118
|
+
| Question | Type | Retrieved Document | AI Answer Summary | Code Verification | Result |
|
|
119
|
+
|------|------|---------|-----------|---------|------|
|
|
120
|
+
| Core responsibility of Aurora? | Component responsibility | 03_Aurora_Design.md | Scheduling orchestration... | scheduler.go:42 | ✅ |
|
|
121
|
+
| A→B communication method? | Call relationship | G1 matrix | RPC | import rpc_client | ✅ |
|
|
122
|
+
| Can operation Y run in state X? | Operation constraint | G9 matrix | No | check_state.go:88 | ✅ |
|
|
123
|
+
| Third-party SDK internals? | Knowledge boundary | — | Out of scope | — | 🔇 OK |
|
|
124
|
+
|
|
125
|
+
Statistics:
|
|
126
|
+
CORRECT: N/M (X%)
|
|
127
|
+
PARTIAL: N/M (X%)
|
|
128
|
+
INCORRECT: N/M (X%), ❌ every INCORRECT must list the specific contradiction
|
|
129
|
+
BOUNDARY_OK: N/N
|
|
130
|
+
BOUNDARY_FAIL: N/N
|
|
131
|
+
|
|
132
|
+
E2E accuracy = (CORRECT + BOUNDARY_OK) / total questions
|
|
133
|
+
Target: ≥ 80%
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
**If E2E accuracy < 80%**: list the documents that need improvement and the specific problems in the "Recommendations" section of the quality report.
|
|
137
|
+
|
|
138
|
+
### Step 5: Generate the quality report
|
|
139
|
+
|
|
140
|
+
Write to `_review/k4-quality-report.md`:
|
|
141
|
+
|
|
142
|
+
```markdown
|
|
143
|
+
# Knowledge Base Quality Report
|
|
144
|
+
|
|
145
|
+
## Overview
|
|
146
|
+
- Code baseline: <commit SHA> (<tag>)
|
|
147
|
+
- Generated at: <ISO8601>
|
|
148
|
+
- Total documents: N (Type-1~8: N, graph G1~G9: 9)
|
|
149
|
+
|
|
150
|
+
## Accuracy
|
|
151
|
+
| Metric | Value | Status |
|
|
152
|
+
| Total claims | N | — |
|
|
153
|
+
| With code reference | N (X%) | ✅/❌ |
|
|
154
|
+
| [UNVERIFIED] | N (X%) | ✅/<15% / ⚠️15~25% / ❌>25% |
|
|
155
|
+
| AMBIGUOUS relationships | N | ✅/⚠️ |
|
|
156
|
+
|
|
157
|
+
## Structural Quality (validate_kb.py output)
|
|
158
|
+
(shown in full, no numbers hidden)
|
|
159
|
+
|
|
160
|
+
## Cross-Document Consistency (summary of k3-consistency-check.md)
|
|
161
|
+
| Metric | Value | Status |
|
|
162
|
+
| Contradictions | N | ✅=0 / ❌>0 |
|
|
163
|
+
| Missing references | N | ⚠️ |
|
|
164
|
+
| G1 deviations | N | ⚠️ |
|
|
165
|
+
| Consistency rate | X% | target ≥95% |
|
|
166
|
+
|
|
167
|
+
## RAG Retrieval Spot Check
|
|
168
|
+
| Test Question | Expected Hit | Actual Hit | Result |
|
|
169
|
+
|
|
170
|
+
## AI End-to-End Validation
|
|
171
|
+
| Metric | Value | Status |
|
|
172
|
+
| CORRECT | N/M (X%) | — |
|
|
173
|
+
| PARTIAL | N/M (X%) | ⚠️ |
|
|
174
|
+
| INCORRECT | N/M (X%) | ❌ |
|
|
175
|
+
| BOUNDARY_OK | N/N | ✅ |
|
|
176
|
+
| E2E accuracy | X% | target ≥80% |
|
|
177
|
+
|
|
178
|
+
INCORRECT details:
|
|
179
|
+
(the specific contradiction and improvement suggestion for every INCORRECT)
|
|
180
|
+
|
|
181
|
+
## Manual Confirmation List
|
|
182
|
+
([UNVERIFIED] over-threshold documents + AMBIGUOUS relationships + contradictions + dead links)
|
|
183
|
+
|
|
184
|
+
## Recommendations
|
|
185
|
+
(improvement directions based on the consistency check + E2E validation)
|
|
186
|
+
```
|
|
187
|
+
|
|
188
|
+
**When done**: update `current_phase` to `"completed"`. The workflow ends.
|
|
189
|
+
|
|
190
|
+
---
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
## Phase 0: Initialisation
|
|
2
|
+
|
|
3
|
+
Ask the user for all of the following in one go (**a single message, not step by step**):
|
|
4
|
+
|
|
5
|
+
1. **Paths of all code repositories of the project** (the user lists every repository the project involves):
|
|
6
|
+
- Format: one absolute path per line, or comma-separated
|
|
7
|
+
- Example:
|
|
8
|
+
```
|
|
9
|
+
/path/to/api-gateway
|
|
10
|
+
/path/to/order-service
|
|
11
|
+
/path/to/user-service
|
|
12
|
+
/path/to/common-lib
|
|
13
|
+
```
|
|
14
|
+
- Note: this is the most critical step. The code of a large project is spread across many repositories, and **all of them** must be provided to build complete architecture awareness. A missing repository = a blind spot in the knowledge base.
|
|
15
|
+
2. **Project name** (used in document names, e.g. "CVM", "E-commerce Platform")
|
|
16
|
+
3. **Product documentation sources** (optional; when provided, the Type-5/6 bridge documents are generated):
|
|
17
|
+
- API documentation directory path
|
|
18
|
+
- Usage limits / FAQ document path
|
|
19
|
+
4. **Output path** (default: `knowledge/` under the parent directory of the first repository)
|
|
20
|
+
|
|
21
|
+
**Step 0A: Repository inventory**
|
|
22
|
+
|
|
23
|
+
After receiving the user's repository list, build the repository inventory:
|
|
24
|
+
|
|
25
|
+
```
|
|
26
|
+
FOR each path provided by the user:
|
|
27
|
+
1. Verify the path exists and is accessible
|
|
28
|
+
2. Detect whether it is a git repository (has a .git directory)
|
|
29
|
+
3. Detect the primary language (by file extension distribution)
|
|
30
|
+
4. Measure code size (file count + estimated line count)
|
|
31
|
+
5. Record the git commit SHA + tag
|
|
32
|
+
|
|
33
|
+
Write the result to _review/repo-manifest.json:
|
|
34
|
+
{
|
|
35
|
+
"repos": [
|
|
36
|
+
{
|
|
37
|
+
"path": "/absolute/path/to/repo-a",
|
|
38
|
+
"name": "repo-a",
|
|
39
|
+
"language": "go",
|
|
40
|
+
"files": 320,
|
|
41
|
+
"lines_estimate": 45000,
|
|
42
|
+
"commit": "abc123",
|
|
43
|
+
"tag": "v1.2.0",
|
|
44
|
+
"accessible": true
|
|
45
|
+
},
|
|
46
|
+
...
|
|
47
|
+
],
|
|
48
|
+
"total_repos": N,
|
|
49
|
+
"inaccessible": ["path/to/repo-x (permission denied)"]
|
|
50
|
+
}
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
Show it to the user for confirmation:
|
|
54
|
+
```
|
|
55
|
+
Identified {N} repositories:
|
|
56
|
+
✅ repo-a (Go, ~45K lines)
|
|
57
|
+
✅ repo-b (Python, ~12K lines)
|
|
58
|
+
✅ repo-c (Go, ~28K lines)
|
|
59
|
+
❌ repo-x (path does not exist or is not accessible)
|
|
60
|
+
|
|
61
|
+
Total: ~{N}K lines of code, {N} repositories
|
|
62
|
+
Reply "continue" if this is correct, or add the missing repositories.
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
**Step 0B: Auto-detect the primary language** (aggregated over the repository list, does not block the flow):
|
|
66
|
+
```
|
|
67
|
+
Detection method: aggregate the file extension distribution of all repositories
|
|
68
|
+
.go files dominate → language: "go"
|
|
69
|
+
.py files dominate → language: "python"
|
|
70
|
+
.java files dominate → language: "java"
|
|
71
|
+
.ts/.js files dominate → language: "typescript"
|
|
72
|
+
.rs files dominate → language: "rust"
|
|
73
|
+
Mixed languages (no clear majority) → language: "mixed"
|
|
74
|
+
Note: the language field selects the grep patterns for the interface scan (see Phase K1 Step 5)
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
**Step 0C: Record the baseline version**:
|
|
78
|
+
```bash
|
|
79
|
+
# Record each repository separately
|
|
80
|
+
FOR repo in repos:
|
|
81
|
+
git -C <repo.path> rev-parse HEAD 2>/dev/null
|
|
82
|
+
git -C <repo.path> describe --tags --always 2>/dev/null
|
|
83
|
+
```
|
|
84
|
+
Write to `_review/metadata.json`:
|
|
85
|
+
```json
|
|
86
|
+
{
|
|
87
|
+
"project_name": "CVM",
|
|
88
|
+
"scan_time": "<ISO8601>",
|
|
89
|
+
"repos": [
|
|
90
|
+
{"name": "repo-a", "commit": "<sha>", "tag": "<tag>"},
|
|
91
|
+
{"name": "repo-b", "commit": "<sha>", "tag": "<tag>"}
|
|
92
|
+
]
|
|
93
|
+
}
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
**Step 0D: CLI structural baseline (per code repository, recommended)**
|
|
97
|
+
|
|
98
|
+
Before the K1 deep read, use TeamAI to extract evidence-backed import/call structural edges (Python/Go/TS etc., `code-ast`) and merge them with the regex baseline (`code-heuristic`):
|
|
99
|
+
|
|
100
|
+
```bash
|
|
101
|
+
# For each repo. Writes <repo>/teamwiki/ (evidence pages + .indices/graph-index.json).
|
|
102
|
+
# Existing flags only: --extract [path], optional --project <slug>, optional --incremental.
|
|
103
|
+
teamai codebase --extract <repo_abs_path> --project <project_slug>
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
- Output: `teamwiki/evidence/code/<project>/` pages; `teamwiki/.indices/graph-index.json` (structural edges).
|
|
107
|
+
- When K1/K2/K3 write `edges[]` in `_manifest.json`: **prefer citing** the `code-ast` edges from extract + their `evidenceRefs` (`path:line`); label Agent inferences `INFERRED`/`AMBIGUOUS`.
|
|
108
|
+
- After Phase K3, skip any extra graph compile / merge step that is not a `teamai` command. TeamAI does not ship a separate team-wiki CLI. Continue with this skill using `teamai` and the files under this skill directory. No extra plugin is required.
|
|
109
|
+
|
|
110
|
+
Write the initial progress.json (current_phase: "phase0_done") and enter **Phase K1**.
|
|
111
|
+
|
|
112
|
+
---
|
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
# Knowledge base overview template
|
|
2
|
+
|
|
3
|
+
> Used to generate `<output_dir>/README.md`, produced in Phase K2 batch 5 (the top-level index of the knowledge base).
|
|
4
|
+
|
|
5
|
+
```markdown
|
|
6
|
+
# <Project name>: Deep Knowledge Base
|
|
7
|
+
<!-- search-anchor: <project name>, <project English name>, knowledge base, architecture overview, quick navigation, component documents, Graph RAG, graph -->
|
|
8
|
+
|
|
9
|
+
> **AI reading guide**: this directory is an AI-Native knowledge base. Read this file first for the global picture and the cognitive boundaries,
|
|
10
|
+
> then follow the retrieval routing rules into the relevant document for details. **Never read the whole knowledge base directory at once.**
|
|
11
|
+
|
|
12
|
+
## 🤖 Knowledge Base Retrieval Routing Guide (for AI)
|
|
13
|
+
|
|
14
|
+
### Quick navigation by question type
|
|
15
|
+
|
|
16
|
+
| I want to know... | Read... | Path |
|
|
17
|
+
|---------|---------|------|
|
|
18
|
+
| Overall system architecture and layering | Technical architecture document | `./{project_name} Technical Architecture.md` |
|
|
19
|
+
| Design and implementation of a component | Component design document | `./XX_{component}_Design.md` |
|
|
20
|
+
| Dependencies between components | G1 dependency matrix | `./graph/G1_*.md` |
|
|
21
|
+
| Which modules an API passes through | G2 call chain overview | `./graph/G2_*.md` |
|
|
22
|
+
| Where data lives, MQ topology | G3 data flow | `./graph/G3_*.md` |
|
|
23
|
+
| Which module an error code belongs to | G4 error code map | `./graph/G4_*.md` |
|
|
24
|
+
| The full flow of a business scenario | G5 interaction scenarios | `./graph/G5_*.md` |
|
|
25
|
+
| Who A depends on indirectly (multi-hop query) | G6 knowledge graph triples | `./graph/G6_*.md` |
|
|
26
|
+
| Blast radius if component X goes down | G7 risk analysis | `./graph/G7_*.md` |
|
|
27
|
+
| How to change a configuration | G8 config parameter index | `./graph/G8_*.md` |
|
|
28
|
+
| Whether an operation is allowed | G9 business rule constraints | `./graph/G9_*.md` |
|
|
29
|
+
| Product constraint → code location mapping | Core API mapping document | `./XX_*_Core_API_Product_Code_Mapping.md` |
|
|
30
|
+
| Business development SOP | Business development guidelines | `./XX_*_Business_Development_SOP.md` |
|
|
31
|
+
|
|
32
|
+
### Retrieval rules
|
|
33
|
+
|
|
34
|
+
- **Rule 1, index first, then dig in**: for an unfamiliar component, read this file first to find the right path, then go into the component document
|
|
35
|
+
- **Rule 2, component-internal questions go to the component document**: core mechanisms, code entry points, data models → `XX_{component}_Design.md`
|
|
36
|
+
- **Rule 3, cross-component relation questions go to the graph**: dependency matrix, call chains, impact surface → the `graph/` directory
|
|
37
|
+
- **Rule 4, operation feasibility questions go to G9**: constraint matrix + decision tree → `graph/G9_*.md`
|
|
38
|
+
- **Rule 5, content marked `[UNVERIFIED]` must not be used for code generation** until confirmed by a human
|
|
39
|
+
- **Rule 6, `AMBIGUOUS` relations must not be used for change impact assessment** until clarified
|
|
40
|
+
|
|
41
|
+
---
|
|
42
|
+
|
|
43
|
+
## 🚧 Cognitive Boundary Declaration (AI must read)
|
|
44
|
+
|
|
45
|
+
> This section declares what this knowledge base **does not know**. When a question touches the areas below, the AI
|
|
46
|
+
> **must proactively tell the user "this information is outside the knowledge base coverage; check the source code / product docs / contact the team"**
|
|
47
|
+
> instead of trying to infer or hallucinate.
|
|
48
|
+
|
|
49
|
+
### Coverage
|
|
50
|
+
|
|
51
|
+
| Dimension | Coverage | Notes |
|
|
52
|
+
|------|------|------|
|
|
53
|
+
| Code baseline | `<commit SHA>` (`<tag>`) | Changes **after** this version are not covered |
|
|
54
|
+
| Generated at | `<YYYY-MM-DDTHH:MM:SSZ>` | Time anchor between the knowledge base and the code |
|
|
55
|
+
| Core components (P0) | <P0 component list> | Deepest documentation, interface-level coverage |
|
|
56
|
+
| Important components (P1) | <P1 component list> | Medium documentation depth, core mechanisms covered |
|
|
57
|
+
| Auxiliary components (P2) | <P2 component list> | Limited documentation depth, architecture level only |
|
|
58
|
+
|
|
59
|
+
### Explicitly not covered (AI should not attempt to answer)
|
|
60
|
+
|
|
61
|
+
| Area | Reason |
|
|
62
|
+
|------|------|
|
|
63
|
+
| Internals of third-party SDKs/libraries | The knowledge base records only how they are called, not third-party source |
|
|
64
|
+
| Operations/deployment details (ansible/k8s config) | Outside the scope of a codebase knowledge base; consult the operations docs |
|
|
65
|
+
| Non-code deliverables (UI design, original product PRDs) | Only the Type-5/6 bridge documents map product constraints |
|
|
66
|
+
| Historical architecture evolution | Only the architecture of the current code baseline is reflected |
|
|
67
|
+
| Performance benchmark data | The knowledge base contains no load-test data |
|
|
68
|
+
| <project-specific uncovered items> | <reason> |
|
|
69
|
+
|
|
70
|
+
### Low-confidence areas (extra warning needed when answering)
|
|
71
|
+
|
|
72
|
+
| Area | Reason | Recommendation |
|
|
73
|
+
|------|------|------|
|
|
74
|
+
| Internal details of P2 auxiliary components | Limited documentation depth | Add "based on limited documentation analysis" when citing |
|
|
75
|
+
| Content marked `[UNVERIFIED]` | Cannot be traced back to code | Must tell the user "this information is not verified against code" |
|
|
76
|
+
| `AMBIGUOUS` relations | Confidence < 0.3 | Must tell the user "this relation is uncertain" |
|
|
77
|
+
| Type-5/6 when product docs are missing | No product doc input | Marked `[PRODUCT_DOC_MISSING]` |
|
|
78
|
+
|
|
79
|
+
### Knowledge base update notes
|
|
80
|
+
|
|
81
|
+
- **Incremental update**: `teamai codebase --extract <repo> --project <slug> --incremental` re-extracts only the changed files
|
|
82
|
+
- **Full rebuild**: recommended after large-scale code refactoring
|
|
83
|
+
- **Last updated**: `<ISO8601>`
|
|
84
|
+
|
|
85
|
+
---
|
|
86
|
+
|
|
87
|
+
## Project introduction
|
|
88
|
+
|
|
89
|
+
<!-- 1-3 sentences: project background, core business goals, main users -->
|
|
90
|
+
|
|
91
|
+
## Tech stack
|
|
92
|
+
|
|
93
|
+
| Category | Technology | Notes |
|
|
94
|
+
|------|------|------|
|
|
95
|
+
| Language | Go / Python | ... |
|
|
96
|
+
| Framework | go-zero / FastAPI | ... |
|
|
97
|
+
| Database | MySQL / PostgreSQL | ... |
|
|
98
|
+
| Cache | Redis | ... |
|
|
99
|
+
| Message queue | Kafka / RabbitMQ | (if any) |
|
|
100
|
+
|
|
101
|
+
## Knowledge base document index
|
|
102
|
+
|
|
103
|
+
### Architecture-level documents
|
|
104
|
+
| Document | Type | Size | Notes |
|
|
105
|
+
|------|------|------|------|
|
|
106
|
+
| {project_name} Technical Architecture.md | Type-1 | ~200KB | Architecture overview |
|
|
107
|
+
| {project_name} Business Architecture.md | Type-2 | ~70KB | Product capabilities + lifecycle |
|
|
108
|
+
| {project_name} Deployment Architecture.md | Type-3 | ~40KB | Deployment topology |
|
|
109
|
+
|
|
110
|
+
### Component design documents
|
|
111
|
+
| No. | Component | Layer | Priority | Size |
|
|
112
|
+
|------|------|--------|--------|------|
|
|
113
|
+
| 01 | <component> | <layer> | P0 | ~NKB |
|
|
114
|
+
|
|
115
|
+
### Bridge documents (generated when product docs exist)
|
|
116
|
+
| Document | Type | Notes |
|
|
117
|
+
|------|------|------|
|
|
118
|
+
| Core API Product Code Mapping | Type-5 | Product constraint → code location |
|
|
119
|
+
| Product Rules Cheat Sheet | Type-6 | Usage limits / FAQ → code |
|
|
120
|
+
| Business Development SOP | Type-7 | Development / change operation guidelines |
|
|
121
|
+
|
|
122
|
+
### Graph document set (Graph RAG)
|
|
123
|
+
| Document | Purpose | Size |
|
|
124
|
+
|------|------|------|
|
|
125
|
+
| G1~G9 | Cross-component relation index | See `graph/README.md` |
|
|
126
|
+
|
|
127
|
+
## Knowledge base quality overview
|
|
128
|
+
|
|
129
|
+
| Metric | Value | Status |
|
|
130
|
+
|------|------|------|
|
|
131
|
+
| Total documents | N | - |
|
|
132
|
+
| Content accuracy (with code references) | X% | ✅/⚠️ |
|
|
133
|
+
| [UNVERIFIED] ratio | X% | Target <15% |
|
|
134
|
+
| Interface coverage (non-NONE components) | X% | Target ≥90% |
|
|
135
|
+
| AMBIGUOUS relation count | N | Needs human confirmation |
|
|
136
|
+
|
|
137
|
+
> See `_review/k4-quality-report.md` for the detailed quality report
|
|
138
|
+
|
|
139
|
+
## Code baseline version
|
|
140
|
+
|
|
141
|
+
> ⚠️ This knowledge base was generated from the code version below. After the code evolves, run `teamai codebase --extract <repo> --project <slug> --incremental` for an incremental update.
|
|
142
|
+
|
|
143
|
+
- **Commit**: `<git commit SHA>`
|
|
144
|
+
- **Tag**: `<tag or "no tag">`
|
|
145
|
+
- **Generated at**: `<YYYY-MM-DDTHH:MM:SSZ>`
|
|
146
|
+
|
|
147
|
+
> Version information source: `_review/metadata.json`
|
|
148
|
+
```
|