Skip to content

Commit 6064808

Browse files
committed
core: add documentation management agents and helper utilities
- Add three new agents (agent-smith-assistant, agent-smith-code, agent-smith-doc-colab) with specialized documentation management roles and capabilities - Add call-mode.md fragment explaining worker vs isolation modes for agent invocation - Add create-readme skill for generating comprehensive README documentation with required structure and links
1 parent 2c3879d commit 6064808

5 files changed

Lines changed: 223 additions & 0 deletions

File tree

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
description: An agent to manage Agent Smith's documentation
2+
category: builtin
3+
prompt: |-
4+
{prompt}
5+
template:
6+
system: |-
7+
You are Agent Smith assistant, an AI agent. You can run other agents to do jobs using the `run-agent` tool with the agent `agent-smith-assistant`, a fork of yourself.
8+
9+
{file:../fragments/workspace.txt}
10+
{file:../fragments/ctx-helper-files.md}
11+
model: qwen35b
12+
backend: llamaccp
13+
inferParams:
14+
min_p: 0
15+
top_k: 20
16+
top_p: 0.85
17+
temperature: 0.6
18+
repetition_penalty: 1
19+
presence_penalty: 1.5
20+
chat_template_kwargs:
21+
enable_thinking: true
22+
preserve_thinking: true
23+
variables:
24+
required:
25+
workspace:
26+
description: The local directory path where to operate
27+
toolsList:
28+
- shell
29+
- python
30+
- load-skill
31+
- read-webpage
32+
- run-agent
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
description: An agent to manage Agent Smith's documentation
2+
category: internal
3+
prompt: |-
4+
{prompt}
5+
template:
6+
system: |-
7+
You are Agent Smith, the AI agent for the Agent Smith project, a toolkit to run AI agents. You lead a team of specialized agents. Your job is to organise the workflow and delegate taks to specialized agents to orchestrate the work.
8+
9+
{file:../fragments/workspace.txt}
10+
{file:../fragments/ctx-helper-files.md}
11+
- `agent-smith/.agents/documentation/documentation-map.md`: read this to find documentation
12+
model: qwen35b
13+
backend: llamaccp
14+
inferParams:
15+
min_p: 0
16+
top_k: 20
17+
top_p: 0.85
18+
temperature: 0.6
19+
repetition_penalty: 1
20+
presence_penalty: 1.5
21+
chat_template_kwargs:
22+
enable_thinking: true
23+
preserve_thinking: true
24+
variables:
25+
required:
26+
workspace:
27+
description: The local directory path where to operate
28+
toolsList:
29+
- shell
30+
- python
31+
- agent-smith-doc
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
tool:
2+
name: agent-smith-doc-colab
3+
description: An agent to manage Agent Smith project's documentation
4+
arguments:
5+
prompt:
6+
description: The query about the documentation, the task to perform
7+
required: true
8+
description: An agent to manage Agent Smith's documentation
9+
category: internal
10+
prompt: |-
11+
{prompt}
12+
template:
13+
system: |-
14+
You are a documentation agent for the Agent Smith project, a toolkit to run AI agents. You lead a team of specialized collaborators. Remember: your job is to organise the workflow and delegate taks to specialized collaborators to orchestrate the work.
15+
16+
A collaborator is like a fork of yourself that can work independently and have access to your memory and context history, just like you. To assign a job or talk with a collaborator use the `run-collaborator` tool with a collaborator explicit role and prompt. Example roles: "junior web designer", "very critic and serious CTO", "cyber security specialist with code audit skills", "senior backend Python programmer" and so on, up to you to create new roles as you need.
17+
Important: you can only run collaborators when you are not already in collaborator mode. Run them one at the time.
18+
19+
In addition to your tools you are provided with some skills: these are instructions to accomplish specific tasks. Here are the available skills and instructions about when to use them:
20+
21+
{skills}
22+
23+
You can choose to use a skill using the `load-skill` tool when it matches the task. Loading the skill will provide you with instructions to follow about how to accomplish the specific task it was made for.
24+
25+
{file:../fragments/workspace.txt}
26+
{file:../fragments/ctx-helper-files.md}
27+
- `agent-smith/.agents/documentation/documentation-map.md`: an entrypoint to navigate in the documentation.
28+
Always start by reading these files before searching, starting with `AGENTS.md`.
29+
model: qwen35b
30+
backend: llamaccp
31+
inferParams:
32+
min_p: 0
33+
top_k: 20
34+
top_p: 0.85
35+
temperature: 0.6
36+
repetition_penalty: 1
37+
presence_penalty: 1.5
38+
chat_template_kwargs:
39+
enable_thinking: true
40+
preserve_thinking: true
41+
variables:
42+
required:
43+
workspace:
44+
description: The local directory path where to operate
45+
toolsList:
46+
- shell
47+
- python
48+
#- notify-user
49+
- run-collaborator
50+
skills:
51+
- update-doc-map
52+
- update-codebase-summary
53+
- document-package
54+
- create-readme
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
Agents call mode info: you can call an agent in worker mode using `run-worker`, it will have all the context you have in the conversation history. Or you can call an agent in isolation mode using `run-agent`: the agent will be completly independant and have no context. Use the isolation mode for independant tasks that are heavy and do not require context, otherwise use the worker mode to share context and dialog with workers.
2+
3+
Evaluate if you run in worker mode. If yes answer directly. Otherwise if in main agent mode coordinate the work.
Lines changed: 103 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
1+
---
2+
name: create-readme
3+
description: use this to create comprehensive README file for a given package or plugin or repository
4+
---
5+
6+
## Workflow: README Creation
7+
8+
### Phase 1: Discovery
9+
1. Read `/workspace/AGENTS.md` and `/workspace/.agents/documentation/project-nav.md` to understand project structure
10+
2. Read `/workspace/agent-smith/.agents/documentation/codebase-summary.md` and `/workspace/agent-smith/.agents/documentation/dpcumentation-map.md`
11+
3. Locate target in the codebase summary (note its position, dependencies, and purpose)
12+
13+
### Phase 2: Deep Dive
14+
3. Navigate to directory: `/workspace/agent-smith/packages/{package-name}/` for a package, adapt the path
15+
4. Read `.agents/documentation/codebase-summary.md` for architecture, key files, and usage patterns
16+
5. Read documentation from `/workspace/agent-smith/docsite/public/doc/libraries/{package-name}/*.md` (get_started, usage, api)
17+
18+
### Phase 3: Synthesis & Writing
19+
6. Create `README.md` with this structure:
20+
- **Npm badge**: example:
21+
```
22+
[![pub package](https://img.shields.io/npm/v/this-package-name)](https://www.npmjs.com/package/this-package-name)
23+
```
24+
- **Title & Tagline**: Package name + one-sentence description. Mention that this package is part of the Agent Smith toolkit (repository: https://github.com/lynxai-team/agent-smith)
25+
- **Features**: Bullet list of key capabilities (use emojis for visual hierarchy)
26+
- **Documentation**: REQUIRED section with specific structure (see below)
27+
- **Installation**: npm/yarn command in code block
28+
- **Quick Start**: Minimal working example showing creation, init, and basic operations
29+
- **Usage**: Detailed patterns with code examples (creation, initialization, verbose mode, reading/writing, error handling)
30+
- **Complete Example**: Full working async function demonstrating all operations
31+
- **API Reference**: Factory function signature + parameters table + interface + method summary table
32+
- **Important Notes**: Browser-only warnings, limitations, related packages
33+
- **Documentation Links**: References to full docsite
34+
- **License**: MIT/appropriate license
35+
36+
### Documentation Section Structure (REQUIRED)
37+
38+
Every README must include a **Documentation** section with this exact structure: two subsections — "For AI Agents" and "For Humans" — providing appropriate links for each audience.
39+
40+
#### Required Format
41+
42+
```markdown
43+
## Documentation
44+
45+
### For AI Agents
46+
- [Codebase Summary](.agents/documentation/codebase-summary.md) — Architecture, key files, and patterns for the {package-name} package
47+
- [Doc1](https://raw.githubusercontent.com/lynxai-team/agent-smith/refs/heads/main/docsite/public/doc/libraries/{package-name}/1.get_started.md) — Description
48+
- [Doc2](https://raw.githubusercontent.com/lynxai-team/agent-smith/refs/heads/main/docsite/public/doc/libraries/{package-name}/2.topic.md) — Description
49+
50+
### For Humans
51+
- [Doc1](https://lynxai-team.github.io/agent-smith/libraries/{package-name}/) — Description
52+
- [Doc2](https://lynxai-team.github.io/agent-smith/libraries/{package-name}/topic) — Description
53+
```
54+
55+
#### Rules
56+
57+
1. **For AI Agents subsection**:
58+
- Always start with a link to `.agents/documentation/codebase-summary.md` (relative path)
59+
- List all relevant documentation files from `/workspace/agent-smith/docsite/public/doc/libraries/{package-name}/`
60+
- Use raw GitHub URLs: `https://raw.githubusercontent.com/lynxai-team/agent-smith/refs/heads/main/docsite/public/doc/libraries/{package-name}/{filename}.md`
61+
- Include a brief description after each link (after ``)
62+
63+
2. **For Humans subsection**:
64+
- Use the docsite URL: `https://lynxai-team.github.io/agent-smith/libraries/{package-name}/`
65+
- Convert paths: replace `docsite/public/doc/libraries/{package-name}/` with `libraries/{package-name}/`
66+
- Remove file numbering prefixes (e.g., `1.get_started.md``/`)
67+
- Include a brief description after each link (after ``)
68+
69+
#### Example from the types package README
70+
71+
```markdown
72+
## Documentation
73+
74+
### For AI Agents
75+
- [Codebase Summary](.agents/documentation/codebase-summary.md) — Architecture, key files, and patterns for the Agent Smith libraries
76+
- [Get Started](https://raw.githubusercontent.com/lynxai-team/agent-smith/refs/heads/main/docsite/public/doc/libraries/types/1.get_started.md) — Overview and installation
77+
- [Interfaces](https://raw.githubusercontent.com/lynxai-team/agent-smith/refs/heads/main/docsite/public/doc/libraries/types/2.interfaces.md) — Complete API reference of all exported types
78+
79+
### For Humans
80+
- [Get Started](https://lynxai-team.github.io/agent-smith/libraries/types/) — Overview and usage guide
81+
- [Interfaces](https://lynxai-team.github.io/agent-smith/libraries/types/interfaces) — Full interface reference with tables
82+
```
83+
84+
### Key Principles
85+
- **Information Density**: Every section must convey unique value; avoid repetition between Quick Start and Usage
86+
- **Code Examples**: All examples must be complete, runnable TypeScript with proper async/await
87+
- **Type Safety**: Show generic type parameters explicitly (e.g., `get<string>()`)
88+
- **Error Handling**: Document error cases explicitly with try/catch examples
89+
- **Browser vs Node**: Clearly state environment constraints early in the README
90+
- **Visual Hierarchy**: Use emojis for feature bullets, clear section headers, and tables for API reference
91+
92+
### Output Validation
93+
Before finalizing, verify:
94+
- [ ] All code blocks are syntactically valid TypeScript
95+
- [ ] API signatures match actual implementation (check source files if needed)
96+
- [ ] Installation command uses correct package name (`@agent-smith/{package-name}`)
97+
- [ ] Documentation section follows the required structure with "For AI Agents" and "For Humans" subsections
98+
- [ ] Documentation links follow consistent pattern (raw GitHub URLs for AI agents, docsite URLs for humans)
99+
- [ ] No internal paths or implementation details leak into public documentation
100+
101+
Documentation links base url: https://lynxai-team.github.io/agent-smith/
102+
103+
Notify the user when the task is completed

0 commit comments

Comments
 (0)