core
無料TeamAI daily workflow: route a /teamai request, sync with pull and push, inspect status, diagnose with doctor, and reach the specialized workflows. Loaded by the teamai discovery stub.
日本語の概要は準備中です。原文の説明を表示しています。
Make AI truly understand large codebases: for multi-repository, multi-microservice projects that have evolved over years, run architecture reverse-engineering + a Graph RAG graph + multi-language AST to compress a huge codebase into a structured knowledge base, where every conclusion traces back to a code line and every relation carries a confidence label. Suited to projects with 10+ repositories or microservices that AI cannot understand globally by reading the code directly. Triggers: architecture analysis, architecture reverse-engineering, codebase knowledge base, code-to-knowledge, architecture wiki, large multi-repo codebase. Loaded on demand by the teamai discovery stub.
インストールする前に、エージェントに与えられる指示の中身を確認できます。
Prerequisites: an accessible source directory (multiple repositories supported), Python 3, and an installed teamai CLI. The methodology, sub-agent prompts, templates and scripts ship with the CLI. Run
teamai skill path wikito get their absolute path;{SKILL_DIR}in this document refers to that path; a reference file you open on its own writes that directory asSKILL_DIRin braces. Write the knowledge-base documents in Simplified Chinese, as earlier releases did. When updating an existing knowledge base, keep its file names and headings;validate_kb.pyaccepts both the current English and the earlier Chinese headings. The Phase 0 structural baseline usesteamai import --dir. TeamAI does not ship a separate team-wiki CLI. No extra plugin is required.
The problem: large projects (10+ repositories, dozens of microservices, years of iteration) defeat global understanding by AI. The context window cannot hold all the code, component relations are scattered everywhere, and business rules hide deep in call chains. Letting AI read the code directly is both slow (huge token counts) and inaccurate (no global view).
The solution: use architecture reverse-engineering to systematically compress a huge codebase into a structured, verifiable, AI-Native deep knowledge base. Every conclusion traces back to a code line, every relation carries a confidence label, and every update is incrementally verified. AI reads the knowledge base instead of the source, and gains global architecture awareness for about 1/50 of the tokens.
For recalled source freshness, current means only that the cited file matches the scan baseline; check current source when available before relying on claims marked stale, missing or unknown.
The user states the mode in natural language, or simply says "build a codebase knowledge base":
default Standard: single-session core path
--deep Full K1~K4 + G1~G9
--update Incremental update of an existing knowledge/
continue Resume from the _review/progress.json checkpoint
| Agent | File | When started |
|---|---|---|
| Knowledge base document generator Agent | {SKILL_DIR}/references/agents/kb-doc-generator.md | Phase K2, every component batch |
| Graph RAG Agent | {SKILL_DIR}/references/agents/graph-rag-agent.md | Phase K3 |
Main agent responsibilities: workflow orchestration, confirmation point management, progress.json maintenance, quality report aggregation.
This decision must run first on every activation.
IF the user input contains "--update" or "incremental update":
→ Update mode
ELSE IF the user input contains "continue" or "resume":
→ Continue mode
ELSE:
→ Check whether _review/progress.json exists under the user-specified directory
IF it exists → report the state, wait for "resume last run" or "start over"
ELSE → Phase 0
Step 1: Locate progress.json
Step 2: Read and parse it, show a resume summary
Step 3: Jump according to current_phase:
"phase0_done" → Phase K1
"phasek1_waiting_confirm" → Show k1-architecture-map.md, wait for confirmation ①
"phasek1_confirmed" → Phase K2
"phasek2_batch_N" → Continue Phase K2 from batch N (skip completed ones)
"phasek2_waiting_confirm" → Wait for confirmation ②
"phasek2_confirmed" → Phase K3
"phasek3_done" → Phase K4
"phasek4_done"/"completed" → Report completion, ask whether to --update or rerun a component
Trigger: the user asks for an "incremental update", or specifies the --update mode in this skill.
Precondition: an existing progress.json in the completed state.
Step 1: Read progress.json, get file_hash_cache
Step 2: Scan project_root, compute the current SHA256 of every file
Step 3: Compare hashes, classify: added / modified / deleted
Step 4: Show the change summary, wait for user confirmation:
┌────────────────────────────────────┐
│ Change summary │
│ Added: N files │
│ Modified: N files (incl. Aurora.py)│
│ Deleted: N files │
│ Affected components: [list] │
│ Affected graph documents: G1/G2/G6/G7 │
└────────────────────────────────────┘
Step 5: Rerun only the affected scope:
- Phase K2: regenerate the Type-4 documents of affected components (overwrite)
- Phase K3 partial: update the graph documents that involve changed components (G1/G2/G6/G7)
- Phase K4: rerun validate_kb.py
Step 6: Update file_hash_cache + the metadata.json commit SHA
Step 7: Component-level diff (handle added/removed repositories or components)
IF the repos list differs from last time:
Added repositories → run a full K1 scan on the new repository, add it to the component inventory, generate Type-4 documents
Removed repositories → prepend `⚠️ [DEPRECATED] The repository for this component has been removed` to the component document
→ Update the component inventory in k1-architecture-map.md
→ Update the G1 matrix (remove rows/columns of removed components, add rows/columns for new ones)
Path: <output_dir>/../_review/progress.json
{
"version": "5",
"repos": [
{"name": "repo-a", "path": "/absolute/path/to/repo-a", "language": "go"},
{"name": "repo-b", "path": "/absolute/path/to/repo-b", "language": "python"}
],
"output_dir": "/absolute/path/to/knowledge",
"primary_language": "go",
"project_name": "ProjectName",
"scan_time": "2026-01-01T10:00:00Z",
"current_phase": "phasek2_batch_2",
"confirmed_phases": ["phase0", "phasek1"],
"service_map": {
"description": "Service name → repository map built in Phase K1 Step 3",
"ServiceA": {"repo": "repo-a", "entry": "cmd/serviceA/main.go"},
"ServiceB": {"repo": "repo-b", "entry": "app/main.py"}
},
"kb_progress": {
"component_total": 12,
"components_done": ["Aurora", "Frame"],
"components_pending": ["CCDB", "Dispatcher"],
"type1_done": false,
"type2_done": false,
"type3_done": false,
"bridge_docs_done": false,
"graph_rag_done": false
},
"accuracy_stats": {
"total_claims": 0,
"verified": 0,
"unverified": 0,
"ambiguous_relations": 0
},
"interface_coverage": {
"description": "Interface count reconciliation, filled by the Phase K2 self-check",
"ComponentA": {"type": "HTTP", "scanned": 13, "documented": 0, "gap": 13},
"ComponentB": {"type": "MQ", "scanned": 5, "documented": 0, "gap": 5}
},
"consistency_check": {
"description": "Cross-document consistency check result from Phase K3 Step 3",
"contradictions": 0,
"missing_refs": 0,
"g1_deviations": 0,
"consistency_rate": 0.0
},
"e2e_validation": {
"description": "AI end-to-end validation result from Phase K4 Step 4",
"total_questions": 0,
"correct": 0,
"partial": 0,
"incorrect": 0,
"boundary_ok": 0,
"boundary_fail": 0,
"accuracy_rate": 0.0
},
"file_hash_cache": {
"relative/path/to/file.go": "sha256_hex"
}
}
accuracy_statsaccumulates after every Phase K2 batch and is the global trust indicator of the knowledge base.
[UNVERIFIED]EXTRACTED(1.0) / INFERRED(0.6~0.9) / AMBIGUOUS(0.1~0.3); no invention out of thin air, no 0.5 defaultGlob → Grep → Read three-step method; full directory scans are forbidden[UNVERIFIED] must not be hidden; quality numbers are shown in full; when unsure, mark AMBIGUOUS instead of deletingThe full steps of each phase live in separate files. Load a file when its phase comes up; do not read them all at once:
| Phase | File | Content |
|---|---|---|
| Phase 0 | {SKILL_DIR}/references/phases/phase0-init.md | Initialisation, teamai import --dir structural baseline, repository inventory |
| Phase K1 | {SKILL_DIR}/references/phases/k1-reverse-engineering.md | Architecture reverse-engineering and source material collection, scan script, architecture analysis report |
| Phase K2 | {SKILL_DIR}/references/phases/k2-documents.md | Document generation (parallel batches + intermediate quality confirmation) |
| Phase K3 | {SKILL_DIR}/references/phases/k3-ai-native.md | AI-Native enhancement + Graph RAG graph document set |
| Phase K4 | {SKILL_DIR}/references/phases/k4-quality.md | Quality assessment, validation script, quality report |
Methodology background (optional, for reference while writing documents): {SKILL_DIR}/references/methodology/;
sub-agent prompts: {SKILL_DIR}/references/agents/;
knowledge base README template: {SKILL_DIR}/references/templates/project-overview.md.
Human-readable overview (not for execution): {SKILL_DIR}/references/overview.md.
teamai skill get wiki --full prints every reference file in one go (about 130 KB). Use it only when you need to read everything.
<output_dir>/
├── README.md ← Knowledge base index + retrieval routing rules + cognitive boundary declaration (for AI)
│ Start from the template: cp "{SKILL_DIR}/references/templates/project-overview.md" <output_dir>/README.md
├── {project_name} Technical Architecture.md ← [Type-1] Architecture overview (target ≤80KB, split automatically when larger)
├── {project_name} Technical Architecture-Core Call Chains.md ← [Type-1b] Split out only when Type-1 exceeds 80KB
├── {project_name} Technical Architecture-AI Metadata.md ← [Type-1c] Split out only when Type-1 exceeds 80KB
├── {project_name} Business Architecture.md ← [Type-2] Product capabilities + lifecycle ~70KB
├── {project_name} Deployment Architecture.md ← [Type-3] Deployment topology ~40KB
├── XX_{component}_Design.md × N ← [Type-4] 20~100KB each
├── XX_{project_name}_Core_API_Product_Code_Mapping.md ← [Type-5] Generated only when product docs exist
├── XX_{project_name}_Product_Rules_Cheat_Sheet.md ← [Type-6]
├── XX_{project_name}_Business_Development_SOP.md ← [Type-7]
├── {knowledge_enhancement_doc} × N ← [Type-8] Anti-patterns / RPC contracts / troubleshooting / knowledge library
└── graph/ ← [Type-9] Graph RAG graph document set
├── README.md ← Graph index + lookup by question type
├── G1_{project_name}_Component_Dependency_Matrix.md
├── G2_{project_name}_Component_Call_Chain_Overview.md
├── G3_{project_name}_Data_Flow_and_Storage_Dependencies.md
├── G4_{project_name}_Error_Code_Component_Map.md
├── G5_{project_name}_Cross_Component_Interaction_Scenarios.md
├── G6_{project_name}_Knowledge_Graph_Triples.md
├── G7_{project_name}_Architecture_Risks_and_Impact_Analysis.md
├── G8_{project_name}_Core_Config_Parameter_Index.md
└── G9_{project_name}_Business_Rule_Constraint_Matrix.md
_review/ ← Process files (not part of the knowledge base)
├── progress.json ← Resume-from-checkpoint + incremental update state
├── metadata.json ← Code baseline version
├── interface-inventory.json ← Interface scan baseline (Phase K1 Step 5)
├── k1-architecture-map.md ← Architecture reverse-engineering result (confirmed by the user)
├── k2-doc-list.md ← Document inventory + accuracy statistics
├── k3-consistency-check.md ← Cross-document consistency check report (Phase K3 Step 3)
└── k4-quality-report.md ← Quality report (incl. E2E validation results)
| User reply | Behaviour |
|---|---|
| "continue" / "go on" / "ok" | Enter the next phase |
| "stop" | Stop; files generated so far stay usable |
| Describes a problem directly | Adjust, reconfirm, then continue |
| Edits files directly and then replies "continue" | Continue based on the edited file contents |
XX_{component}_Design.md (XX is a two-digit number assigned in dependency-chain order, lower layers get lower numbers)[PRODUCT_DOC_MISSING]; never guess| Phase | Command / path |
|---|---|
| Phase 0 structural baseline | teamai import --dir <repo> --skip-enrich (writes teamwiki/evidence/code/<slug>/ in the team repo; <slug> is the project: it prints) |
| Deep knowledge | Use teamai codebase --deep-enrich --project <slug> after the import has written teamwiki/evidence/code/<slug>/. Prefix with teamai --dry-run to preview without writing. TeamAI does not ship a separate team-wiki CLI. No extra plugin is required. |
| Compile into the wiki after K3 | Skip. 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. |
| Product docs into the graph | Skip. Same English note as above. |
| Product ↔ code bridging | Use teamai codebase --reconcile after product pages are under teamwiki/product/ next to the imported code pages. Prefix with teamai --dry-run to preview without updating the graph. |
| One-shot refresh | Use teamai import --dir <repo> --incremental --skip-enrich, reusing the Phase 0 repository path even when running from another directory. Do not look for another CLI. |
| Quality assessment | Use python3 "{SKILL_DIR}/scripts/validate_kb.py" <output_dir> and teamai codebase --lint. Skip any extra evaluate binary. |
| No team repo | When teamai init has not run, add --output <dir> to every teamai import and teamai codebase command above: they all use <dir>/teamwiki/. |
Path convention: {SKILL_DIR} is the directory printed by teamai skill path wiki. The methodology is in {SKILL_DIR}/references/methodology/, sub-agent prompts in {SKILL_DIR}/references/agents/, and scripts in {SKILL_DIR}/scripts/.
The whole workflow runs within the content served by teamai skill get wiki and the teamai CLI. No extra plugin is required.
まだレビューはありません。使ってみた感想をお寄せください。
概要と使いどころ
TeamAI daily workflow: route a /teamai request, sync with pull and push, inspect status, diagnose with doctor, and reach the specialized workflows. Loaded by the teamai discovery stub.
日本語の概要は準備中です。原文の説明を表示しています。
TeamAI day 0 and repo lifecycle: create a team repo as admin, join an existing team as a member, manage members, roles, MCP and env, and uninstall. Loaded on demand by the teamai discovery stub.
日本語の概要は準備中です。原文の説明を表示しています。
Turn a session into a team learning: summarize what was solved, discovered or worked around, and publish it to the team knowledge base with `teamai contribute`. Loaded on demand by the teamai discovery stub, and by the friction reminder that ends a session worth sharing.
日本語の概要は準備中です。原文の説明を表示しています。
Make every team AI native — TeamAI syncs a team's AI skills, rules, docs and env across AI coding tools. Use when the task operates on team-shared AI configuration or team knowledge: setting up a team repo, joining one, managing members, syncing with pull or push, or checking team status. Also use to build or query a codebase knowledge base for a large multi-repo project (architecture analysis, architecture reverse-engineering, code-to-knowledge, team-wiki-codebase, architecture wiki), and to share what a session taught you back to the team (share session learnings, contribute a learning, share what I learned with my team), including after a friction reminder. Triggers include "set up teamai", "join the team repo", "sync team skills", "team wiki", "share what I learned", and running /teamai. Talking about a team needs no skill; operating on what the team shares does.
日本語の概要は準備中です。原文の説明を表示しています。