Agent skill

Large Codebase Knowledge Base Builder

by Tencent in Tencent/teamai-cli

Compresses a large multi-repository codebase into a structured knowledge base through architecture reverse-engineering, a Graph RAG graph and AST analysis.

Custom licenceAuto-check passedKnowledge Management

Install Large Codebase Knowledge Base Builder

skills CLI
$ npx skills add Tencent/teamai-cli --skill wiki -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install Tencent/teamai-cli wiki --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/Tencent/teamai-cli.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skill-data/wiki .claude/skills/wiki && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
wiki
GitHub stars
5.1k
Token cost
~4.4k tokens
SKILL.md length
1,199 words
Files
18 (incl. scripts, references)
Skills in repo
5
Repo updated
First seen
Licence
Custom licence

At a glance

Compresses a large multi-repository codebase into a structured knowledge base through architecture reverse-engineering, a Graph RAG graph and AST analysis.

  • Works in 10 steps: Code is the single source of truth:… → Three-state confidence is mandatory:… → Two-level accuracy verification: Phase… → …
  • Understanding a codebase spread over 10 or more repositories
  • SKILL.md covers Usage, Agent architecture, Entry decision and Continue mode, plus 8 more sections
  • Calls python3

What it does

It targets projects with 10+ repositories or many microservices, where the code is too large for an agent to read directly. The skill runs architecture reverse-engineering, builds a Graph RAG graph and uses multi-language AST parsing to produce a knowledge base in which every conclusion traces back to a code line and every relation carries a confidence label. The agent then reads that knowledge base instead of the source.

Work proceeds in phases with confirmation points and a progress file. The default is a standard single-session path, a deeper mode runs the full K1 to K4 and G1 to G9 stages, and an update mode refreshes an existing knowledge base incrementally. Sub-agents generate the documents in batches and the graph, and a validate_kb.py script and a quality phase check the output. Documents are written in Simplified Chinese by default. It needs Python 3, the teamai CLI and a source directory.

When your agent uses it

  • Understanding a codebase spread over 10 or more repositories
  • Building an architecture wiki for a long-lived microservice system
  • Refreshing an existing knowledge base after the code has changed

Example prompts

  • “Build a codebase knowledge base for the services under ./platform.”
  • “Reverse-engineer the architecture of the repositories in ./legacy-suite and give me a wiki.”
  • “Update the existing knowledge base incrementally after last week's changes.”

Requirements

  • Python 3
  • The teamai CLI
  • A source directory with one or more repositories

Workflow steps

10 steps, taken from the first numbered list in SKILL.md.

  1. Code is the single source of truth: every conclusion must cite a code file:line as evidence; anything unverifiable is marked [UNVERIFIED]
  2. Three-state confidence is mandatory: every relation in the graph is labelled EXTRACTED(1.0) / INFERRED(0.6~0.9) / AMBIGUOUS(0.1~0.3); no…
  3. Two-level accuracy verification: Phase K2 self-checks every document right after generation; Phase K4 verifies the whole knowledge base
  4. Two human-in-the-loop confirmations: architecture understanding (K①) and component document quality (K②) must be confirmed by a human to…
  5. Parallel generation + resume from checkpoint: Type-4 component documents are dispatched in parallel (all Agent calls in the same message)…
  6. Token economy: the Glob → Grep → Read three-step method; full directory scans are forbidden
  7. Honest auditing: [UNVERIFIED] must not be hidden; quality numbers are shown in full; when unsure, mark AMBIGUOUS instead of deleting
  8. Cognitive boundary declaration: the knowledge base README must state explicitly what is covered and what is not, so AI knows when to say…
  9. Cross-document consistency: Phase K3 must cross-check relation descriptions between components; contradictions count as "consistent" only…
  10. End-to-end verifiable: Phase K4 tests the knowledge base's actual answering ability with standardised questions; E2E accuracy target ≥ 80%

What it can do on your machine

Read from SKILL.md and the folder at commit 3f11504. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Ships 1 file in scripts/, which the agent can run.

    Shell commands in SKILL.md call:

    • python3

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Large Codebase Knowledge Base Builder loads about 4.4k tokens when it runs, and up to ~32k if it reads all its reference files. Until then it costs about 173 tokens; SKILL.md has 1,199 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~173
When it runs · the whole SKILL.md, loaded when a task matches
~4.4k
With references · SKILL.md plus every file in references/, read only if the agent opens them
~32k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); the scripts in this folder are not scanned.

SKILL.md

Its licence (Custom licence) doesn't allow us to republish the file, so here is its outline and opening line. It has 1,199 words (~4,355 tokens).

“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…”

— opening of SKILL.md by Tencent, Custom licence
name
wiki

Read the full SKILL.md on GitHub

Files

SKILL.md and 17 other files (scripts, references) in skill-data/wiki of Tencent/teamai-cli.

  • SKILL.md
  • references/agents/graph-rag-agent.md
  • references/agents/kb-doc-generator.md
  • references/methodology/phase0-collection.md
  • references/methodology/phase1-reverse-engineering.md
  • references/methodology/phase2-document-types.md
  • references/methodology/phase3-ai-enhancement.md
  • references/methodology/phase4-quality.md
  • references/overview.md
  • references/phases/k1-reverse-engineering.md
  • references/phases/k2-documents.md
  • references/phases/k3-ai-native.md
  • references/phases/k4-quality.md
  • references/phases/phase0-init.md
  • references/templates/project-overview.md
  • scripts
  • … and 2 more

Open the folder on GitHubat commit 3f11504

Compare with similar skills

Large Codebase Knowledge Base Builder next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Large Codebase Knowledge Base Builder compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Large Codebase Knowledge Base Builder this skillTencent/teamai-cli5.1k—~4.4kAutomated safety check: PassCustom licence
Architecturemanagedcode/dotnet-skills486—~659Automated safety check: PassMIT
Repo Wikipassportxyz/passport1.2k—~1.2kAutomated safety check: PassCustom licence
GSD Graphifyopen-gsd/gsd-core10k3 repos~5.3kAutomated safety check: NotesMIT
Code Review Graph Buildertirth8205/code-review-graph32k—~295Automated safety check: PassMIT
Graphify Dotnetmanagedcode/dotnet-skills486—~1.9kAutomated safety check: PassMIT

Similar skills

  • Architecture

    managedcode/dotnet-skills

    Design or review .NET solution architecture across modular monoliths, clean architecture, vertical slices, microservices, DDD, CQRS, and cloud-native boundaries without over-engineering.

    486 GitHub stars~659 tokensUpdated today
    DevelopmentAuto-check passed
  • Repo Wiki

    passportxyz/passport

    Sets up and maintains a short, agent-written wiki under /wiki in the repo root, loaded through an index so agents read pages on demand instead of crowding context.

    1.2k GitHub stars~1.2k tokensUpdated yesterday
    Knowledge ManagementAuto-check passed
  • GSD Graphify

    open-gsd/gsd-core

    Builds, queries and inspects the project knowledge graph kept in .planning/graphs/ through the /gsd-graphify command, once the feature is switched on in the config.

    10k GitHub starsUsed in 3 repos~5.3k tokens
    Knowledge ManagementAuto-check: notes
  • Code Review Graph Builder

    tirth8205/code-review-graph

    Builds or incrementally updates the code-review knowledge graph for a repository and reports whether the build succeeded, partly or failed.

    32k GitHub stars~295 tokensUpdated yesterday
    DevelopmentAuto-check passed
  • Graphify Dotnet

    managedcode/dotnet-skills

    Use graphify-dotnet to generate codebase knowledge graphs, architecture snapshots, and exportable repository maps from .NET or polyglot source trees, with optional AI-enriched semantic relationships.

    486 GitHub stars~1.9k tokensUpdated today
    Knowledge ManagementAuto-check passed
  • Shows an evidence-linked map of a codebase's architecture and constraints, highlighting the modules an AI plans to change before it edits anything.

    715 GitHub starsUsed in 1 repo~2.6k tokens
    DevelopmentAuto-check passed

More from Tencent/teamai-cli

  • TeamAI Team Sync

    Tencent/teamai-cli

    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…

    5.1k GitHub stars~632 tokensUpdated yesterday
    Auto-check passed
  • TeamAI Daily Workflow

    Tencent/teamai-cli

    Routes /teamai requests to the right workflow for syncing team skills and rules, checking status, diagnosing problems and contributing, for users who may not know Git.

    5.1k GitHub stars~3.6k tokensUpdated yesterday
    Auto-check passed
  • TeamAI Setup and Lifecycle

    Tencent/teamai-cli

    Walks a non-technical user through creating or joining a TeamAI team repo, then managing members, roles, MCP, and environment settings.

    5.1k GitHub stars~1.2k tokensUpdated yesterday
    Auto-check passed
  • Summarizes what an AI coding session solved or discovered and publishes it to the team knowledge base with the teamai contribute command.

    5.1k GitHub stars~727 tokensUpdated yesterday
    Auto-check passed

Questions about Large Codebase Knowledge Base Builder

What does Large Codebase Knowledge Base Builder do?

Compresses a large multi-repository codebase into a structured knowledge base through architecture reverse-engineering, a Graph RAG graph and AST analysis. It targets projects with 10+ repositories or many microservices, where the code is too large for an agent to read directly. The skill runs architecture reverse-engineering, builds a Graph RAG graph and uses multi-language AST parsing to produce a knowledge base in which every conclusion traces back to a code line and every relation carries a confidence label.

When should I use Large Codebase Knowledge Base Builder?

Large Codebase Knowledge Base Builder fits situations like: understanding a codebase spread over 10 or more repositories; building an architecture wiki for a long-lived microservice system; refreshing an existing knowledge base after the code has changed.

How do I install Large Codebase Knowledge Base Builder in Claude Code?

Run `npx skills add Tencent/teamai-cli --skill wiki -a claude-code`. Or copy the skill folder (skill-data/wiki in Tencent/teamai-cli) into .claude/skills/wiki in your project. Claude Code loads it when a task matches its description.

How do I install Large Codebase Knowledge Base Builder in Codex?

Run `npx skills add Tencent/teamai-cli --skill wiki -a codex`. Or copy the skill folder (skill-data/wiki in Tencent/teamai-cli) into .agents/skills/wiki in your project. Codex loads it when a task matches its description.

Can I use Large Codebase Knowledge Base Builder in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add Tencent/teamai-cli --skill wiki -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/wiki, .gemini/skills/wiki, .github/skills/wiki and .opencode/skills/wiki in your project.

What does Large Codebase Knowledge Base Builder need to run?

Going by SKILL.md and its folder, Large Codebase Knowledge Base Builder needs the command-line tools its instructions call (python3). Our summary lists: Python 3; The teamai CLI; A source directory with one or more repositories.

Does Large Codebase Knowledge Base Builder access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Large Codebase Knowledge Base Builder safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. The check reads SKILL.md only: the scripts in the folder are not scanned, so read them before running anything.

What licence does Large Codebase Knowledge Base Builder use?

Large Codebase Knowledge Base Builder has a licence file (the repository's licence) that doesn't match a standard licence. Read it on GitHub before reusing the skill.

How many tokens does Large Codebase Knowledge Base Builder use?

About 4.4k tokens (SKILL.md is roughly 17k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 28k tokens, read only when the agent opens those files.

What are the alternatives to Large Codebase Knowledge Base Builder?

Skills that share tags, products or a category with Large Codebase Knowledge Base Builder: Architecture (managedcode/dotnet-skills, 486 stars), Repo Wiki (passportxyz/passport, 1.2k stars), GSD Graphify (open-gsd/gsd-core, 10k stars) and Code Review Graph Builder (tirth8205/code-review-graph, 32k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Large Codebase Knowledge Base Builder?

Tencent (a GitHub organization) maintains it in Tencent/teamai-cli, which has 5,136 GitHub stars. The repository holds 5 skills in this directory. The repository was last updated on October 6, 2026.

Source: Tencent/teamai-cli on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.