Skip to content

Commit 07421ba

Browse files
committed
feat(skills): rename codebase-reader to source-of-truth, add Wiki API
Upgrade the skill from a code-only reader to the single gateway for all authoritative EvoMap knowledge. Adds the official Wiki API (evomap.ai/api/docs/wiki-full) as the third source of truth alongside the two GitHub repos, with slug index, response schema, and cross-reference rules. Made-with: Cursor
1 parent 38b02d6 commit 07421ba

2 files changed

Lines changed: 241 additions & 123 deletions

File tree

.cursor/skills/codebase-reader/SKILL.md

Lines changed: 0 additions & 123 deletions
This file was deleted.
Lines changed: 241 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,241 @@
1+
---
2+
name: source-of-truth
3+
description: >
4+
The single gateway to all authoritative EvoMap knowledge: two source code
5+
repos and the official Wiki API. Use when the user says "获取前端", "前端代码",
6+
"查前端", "看前端", "website代码" to clone EvoMap/evomap-website, or "获取后端",
7+
"后端代码", "查后端", "看后端", "hub代码" to clone EvoMap/evomap-hub. Also
8+
activate when the user asks about EvoMap platform implementation details
9+
like "这个接口怎么实现的", "这个页面怎么写的", or references any EvoMap repo
10+
by name — even if they just say "帮我查一下代码" in the context of EvoMap
11+
development (in any language). Also activate when the user asks about EvoMap
12+
concepts, architecture, protocols, or any domain knowledge — e.g. "什么是
13+
Evolution Capsule", "wiki", "文档", "Gene 是什么", "A2A 协议".
14+
version: 2.1.0
15+
---
16+
17+
# EvoMap Source of Truth
18+
19+
The single gateway to all authoritative EvoMap knowledge. Fetches source code
20+
from GitHub repos and queries the official Wiki API — so every answer is
21+
grounded in real code and authoritative documentation, never guesses.
22+
23+
## When to activate
24+
25+
- User says "获取前端", "前端代码", "前端源码", "查前端", "看前端", "website 代码"
26+
- User says "获取后端", "后端代码", "后端源码", "查后端", "看后端", "hub 代码"
27+
- User asks about EvoMap platform code, routes, components, APIs, services
28+
- User mentions "evomap-website", "evomap-hub", or any EvoMap repo by name
29+
- User asks "这个接口怎么实现的", "这个页面怎么写的" and the context is EvoMap
30+
- User asks about EvoMap concepts, architecture, protocols, or domain knowledge
31+
(e.g. "什么是 Gene", "Capsule 怎么用", "wiki", "文档", "A2A 协议",
32+
"Evolution Sandbox", "GEP", "Swarm", "Credit Marketplace")
33+
34+
---
35+
36+
## Single source of truth
37+
38+
EvoMap has exactly **three** authoritative sources. All answers MUST come from
39+
one (or more) of these — never from training data or assumptions:
40+
41+
| Source | Type | How to access |
42+
|--------|------|---------------|
43+
| `EvoMap/evomap-website` | Frontend code | `git clone``E:/temp/evomap-website` |
44+
| `EvoMap/evomap-hub` | Backend code | `git clone``E:/temp/evomap-hub` |
45+
| **Official Wiki API** | Concepts & docs | `GET https://evomap.ai/api/docs/wiki-full?lang={lang}&format=json` |
46+
47+
If information cannot be found in any of these three sources, say so explicitly.
48+
Do NOT fill gaps with speculation.
49+
50+
---
51+
52+
## Repository map
53+
54+
| Shorthand | Repository | Local clone path | Stack |
55+
|-----------|-----------|-----------------|-------|
56+
| **前端** / frontend / website | `EvoMap/evomap-website` | `E:/temp/evomap-website` | Next.js (App Router), Tailwind, RTK Query, next-intl |
57+
| **后端** / backend / hub | `EvoMap/evomap-hub` | `E:/temp/evomap-hub` | Express, Prisma, PostgreSQL, Redis, BullMQ |
58+
59+
Both repos are public on GitHub and accessible via `git clone`.
60+
61+
---
62+
63+
## Wiki API
64+
65+
The official EvoMap Wiki is served as a JSON API.
66+
67+
### Endpoint
68+
69+
```
70+
GET https://evomap.ai/api/docs/wiki-full?lang={lang}&format=json
71+
```
72+
73+
- `lang``en` (English) or `zh` (Chinese). Match the user's language.
74+
- `format` — always `json`.
75+
76+
### Response schema
77+
78+
```json
79+
{
80+
"lang": "en",
81+
"count": 27,
82+
"docs": [
83+
{ "slug": "00-introduction", "content": "# Introduction to EvoMap\n..." },
84+
{ "slug": "01-quick-start", "content": "..." }
85+
]
86+
}
87+
```
88+
89+
Each element in `docs` has:
90+
- `slug` — unique identifier (e.g. `05-a2a-protocol`)
91+
- `content` — full Markdown text of that wiki page
92+
93+
### Available wiki pages (slug index)
94+
95+
| Slug | Topic |
96+
|------|-------|
97+
| `00-introduction` | Vision, core modules overview |
98+
| `01-quick-start` | Getting started guide |
99+
| `02-for-human-users` | Human user guide |
100+
| `03-for-ai-agents` | AI agent integration guide |
101+
| `05-a2a-protocol` | Agent-to-Agent protocol |
102+
| `06-billing-reputation` | Billing & reputation system |
103+
| `07-playbooks` | Playbooks |
104+
| `08-faq` | Frequently asked questions |
105+
| `09-research-context` | Research context |
106+
| `10-swarm` | Swarm intelligence |
107+
| `11-evolution-sandbox` | Evolution Sandbox |
108+
| `12-ecosystem` | Ecosystem overview |
109+
| `13-verifiable-trust` | Verifiable trust |
110+
| `14-manifesto` | Manifesto |
111+
| `15-reading-engine` | Reading Engine |
112+
| `16-gep-protocol` | GEP Protocol |
113+
| `17-credit-marketplace` | Credit Marketplace |
114+
| `18-life-ai-parallel` | Life–AI parallel |
115+
| `19-recipe-organism` | Recipe Organism |
116+
| `20-knowledge-graph` | Knowledge Graph |
117+
| `21-anti-hallucination` | Anti-hallucination |
118+
| `22-validator-staking` | Validator & Staking |
119+
| `23-constitution` | Constitution |
120+
| `24-ethics-committee` | Ethics Committee |
121+
| `25-round-table` | Round Table |
122+
| `26-ai-council` | AI Council |
123+
| `27-ai-navigation` | AI Navigation |
124+
125+
---
126+
127+
## Workflow
128+
129+
### Phase 1 — Identify target source(s)
130+
131+
Parse the user's message to determine which sources are needed:
132+
133+
```
134+
Question is about concepts, architecture, protocol design, or domain knowledge?
135+
├─ Yes → need Wiki
136+
└─ Also about implementation?
137+
└─ Yes → also need code repo(s)
138+
139+
User says "前端" or related keywords?
140+
├─ Yes → target repo = EvoMap/evomap-website
141+
└─ No → User says "后端" or related keywords?
142+
├─ Yes → target repo = EvoMap/evomap-hub
143+
└─ No → Only Wiki needed? → proceed with Wiki only
144+
└─ No → Ask the user which repo they mean
145+
```
146+
147+
If the user mentions both (e.g., "前端调后端的接口"), fetch both repos.
148+
When in doubt, fetch the Wiki too — it's cheap and fast.
149+
150+
### Phase 2a — Fetch Wiki (when needed)
151+
152+
Use `WebFetch` to call the Wiki API:
153+
154+
```
155+
https://evomap.ai/api/docs/wiki-full?lang={lang}&format=json
156+
```
157+
158+
- Pick `lang=zh` if the user writes in Chinese, `lang=en` otherwise.
159+
- The response is a single JSON with all 27 docs. Parse it to find the
160+
relevant `slug`(s) based on the user's question, then read their `content`.
161+
- If the full response is too large to process at once, use the slug index
162+
(above) to identify relevant pages, then extract only those entries.
163+
164+
### Phase 2b — Clone or verify local copy (when code is needed)
165+
166+
Check if the repo already exists at the local clone path:
167+
168+
```
169+
Does E:/temp/{repo-name} exist and contain a .git directory?
170+
├─ Yes → Run `git -C <path> pull` to get latest changes
171+
└─ No → Run `git clone --depth 1 https://github.com/EvoMap/{repo}.git E:/temp/{repo-name}`
172+
```
173+
174+
`--depth 1` keeps the clone fast. If the user explicitly asks for git history
175+
or blame, re-clone without `--depth 1`.
176+
177+
**Fallback**: If `git clone` fails (network issue, auth), inform the user and
178+
suggest they clone manually or check their network connection.
179+
180+
### Phase 3 — Navigate and answer
181+
182+
Once the sources are available, use standard tools (Grep, Glob, Read) to find
183+
and read the relevant code, and cite Wiki content for conceptual context.
184+
Common navigation patterns:
185+
186+
| User wants | Where to look (frontend) | Where to look (backend) |
187+
|-----------|-------------------------|------------------------|
188+
| Page / route | `src/app/(main)/**/page.js` ||
189+
| Component | `src/components/**/*.jsx` ||
190+
| API route (BFF) | `src/app/api/**/route.js` ||
191+
| Backend endpoint || `src/routes/**/*.js` |
192+
| Service logic || `src/services/*Service.js` |
193+
| Data model || `prisma/schema.prisma` |
194+
| Navigation | `src/components/layout/NavLinks.jsx` ||
195+
| Config | `next.config.mjs`, `tailwind.config.js` | `src/app.js`, `config/` |
196+
| i18n text | `src/locales/{lang}/*.json` ||
197+
| Store / state | `src/store/**/*.js` ||
198+
| Middleware | `src/proxy.js` (Edge middleware) | `src/middleware/**/*.js` |
199+
200+
When answering, always cite the actual file path and line numbers so the user
201+
can verify.
202+
203+
---
204+
205+
## Rules
206+
207+
1. **Three sources of truth only.** All answers MUST come from the two repos
208+
and/or the Wiki API. Do not guess or fabricate from training data. If
209+
information isn't in any of the three sources, say "I could not find this
210+
in the EvoMap sources."
211+
212+
2. **Always fetch before answering.** Clone/pull repos for code questions;
213+
call the Wiki API for concept/architecture questions. Stale knowledge is
214+
worse than admitting "let me fetch that first."
215+
216+
3. **Use `--depth 1` by default.** Full history is rarely needed and wastes
217+
time and disk. Only fetch full history when the user explicitly needs
218+
git log, blame, or diff across commits.
219+
220+
4. **Pull before answering if the clone already exists.** A stale local copy
221+
can mislead. A quick `git pull` takes seconds and ensures accuracy.
222+
223+
5. **Cite sources explicitly.** For code: cite file paths and line numbers.
224+
For Wiki: cite the slug (e.g. `wiki:05-a2a-protocol`). Every claim should
225+
be traceable.
226+
227+
6. **Don't load entire large files into context.** Files like `a2aService.js`
228+
can exceed 100K characters. Use Grep to locate the relevant function first,
229+
then Read with offset/limit to fetch only what's needed. For the Wiki,
230+
use the slug index to target specific pages.
231+
232+
7. **Respond in the user's language.** Follow the user's language preference
233+
for explanations. Code and Wiki quotes stay as-is.
234+
235+
8. **Cross-reference when possible.** If a concept from the Wiki maps to a
236+
specific implementation in the codebase, link both so the user gets the
237+
full picture (design intent + actual code).
238+
239+
---
240+
241+
*EvoMap Source of Truth v2.1.0*

0 commit comments

Comments
 (0)