Company Knowledge Resolver
company-knowledge-resolver is an AI agent skill that lets Claude Code, MiMoCode, and OpenCode answer questions directly from this Docusaurus knowledge base. Instead of searching manually, you can ask an agent a question like "What is our React naming convention?" and it will fetch the most relevant pages from this documentation, summarize the answer, and cite the source pages.
When to use it
Use the resolver when you need quick, cited answers about internal standards, conventions, or guidelines that are documented in this site.
Examples:
- "What is our company standard for X?"
- "How do we handle Y?"
- "According to our docs, what is the policy on Z?"
- "Code guidelines for React components"
- "Internal documentation says ..."
Do not use it for general programming questions that are not covered by this documentation, or for tasks that are better handled by a dedicated skill (e.g., debugging a specific repo).
How it works
- The agent reads the target Docusaurus URL from the skill configuration.
- It downloads
/sitemap.xmlfrom the published site. - It fetches each page, extracts readable text, and ranks pages by keyword relevance to your question.
- It returns the top relevant excerpts with their source URLs.
- The agent synthesizes a final answer and cites each source.
Configuration
The skill is configured at:
.agents/skills/company-knowledge-resolver/config.json
Current configuration:
{
"docsUrl": "https://src-doc.tsgitdev.com"
}
docsUrl must point to the published Docusaurus site (not a local build). The skill appends /sitemap.xml to this URL, so do not include a trailing slash.
If you deploy this documentation to a different domain, update docsUrl in the skill configuration file before using the resolver.
Enabling the sitemap
This Docusaurus site already has the sitemap plugin enabled via @docusaurus/plugin-content-docs (classic preset). The generated sitemap is available at:
https://<your-domain>/sitemap.xml
If you create a new Docusaurus project, make sure the sitemap plugin is installed and configured:
// docusaurus.config.js / .ts
presets: [
[
'classic',
{
sitemap: {
lastmod: 'date',
changefreq: 'weekly',
priority: 0.5,
ignorePatterns: ['/tags/**'],
filename: 'sitemap.xml',
},
},
],
],
Usage in an agent
Once the skill is loaded in Claude Code, MiMoCode, or OpenCode, ask a company-standard question naturally. The agent will run the resolver automatically.
Example questions:
"How should we structure a new API endpoint?"
"What is our naming convention for React components?"
"What are the best practices for using the calendar component?"
Manual invocation
You can also run the resolver directly from the terminal:
python .agents/skills/company-knowledge-resolver/scripts/resolve.py "What is our naming convention for React components?"
The script prints a JSON object:
{
"docsUrl": "https://src-doc.tsgitdev.com",
"question": "What is our naming convention for React components?",
"results": [
{
"url": "https://src-doc.tsgitdev.com/docs/fe/react/Reusable%20Component/nextjs",
"title": "Reusable Components in Next.js",
"score": 0.87,
"excerpt": "Components should be placed under ..."
}
],
"error": null
}
If error is non-null, the agent should report the error instead of fabricating an answer.
Writing documentation that ranks well
Because the resolver uses keyword matching, well-structured documentation produces better answers.
Use descriptive headings and page titles
Page titles and headings are weighted heavily. A page titled "React Naming Conventions" will rank higher than one titled "Misc" for naming-convention questions.
Include concrete examples and keywords
Write answers that include the actual keywords a developer would use in their question. For example, a page about forms should mention:
React Hook Form, validation, schema, Zod, async select, controlled component
Keep content pages focused
Index and category pages tend to score lower because they contain little text. Put detailed guidance inside focused content pages and link to them from overview pages.
Avoid thin pages
Pages with very little text rarely match questions. If a topic is important, write at least a few paragraphs about it.
Troubleshooting
| Symptom | Cause / Fix |
|---|---|
| "No sitemap found" | Check config.json has the correct docsUrl and that the Docusaurus sitemap plugin is enabled. Verify the published URL is reachable. |
| "No relevant docs found" | The crawler could not match keywords. Rephrase the question or add more descriptive content to the documentation. |
| Low scores for index/category pages | Expected. Add the actual guidance to a focused content page instead of only an overview. |
| Timeout or network error | The machine running the agent must have network access to the configured docsUrl. |
| Wrong domain returned in results | The skill rewrites sitemap URLs to the configured docsUrl. Make sure docsUrl matches the site you want to query. |
Security and governance
- The resolver only reads public Docusaurus pages. It does not execute code or access private repositories.
- Keep sensitive information out of the published documentation. The resolver exposes the same content any visitor can see.
- Update the skill configuration whenever the documentation domain changes, otherwise agents will query the wrong site.
Related resources
Technology Stack: Python 3.10+, Docusaurus, urllib (stdlib only)
Use Case: AI-assisted Q&A over company documentation
Maintainer: TSG IT Dev