@agent-smith/core 0.0.1 → 0.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,13 +1,12 @@
1
- import path from "path";
2
1
  import { compile, serializeGrammar } from "@intrinsicai/gbnfgen";
3
- import { readSkillsFromList, readTool } from "../db/read.js";
2
+ import path from "path";
4
3
  import { executeAction } from "../actions/cmd.js";
4
+ import { readSkillsFromList, readTool } from "../db/read.js";
5
5
  import { McpClient } from "../mcp.js";
6
+ import { openAgentSpec } from "../utils/io.js";
6
7
  import { executeWorkflow } from "../workflows/cmd.js";
7
8
  import { executeAgent } from "./cmd.js";
8
- import { openAgentSpec } from "../utils/io.js";
9
9
  import { applyFilePlaceholders } from "./files.js";
10
- //import { confirmToolUsage } from "../tools.js";
11
10
  async function readAgent(name, payload, options) {
12
11
  /*console.log("Read Agent", name);
13
12
  console.log("Payload:", payload);
@@ -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
@@ -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
@@ -1,20 +1,19 @@
1
1
  description: An agent to manage Agent Smith's documentation
2
- category: internal
2
+ category: builtin
3
3
  prompt: |-
4
4
  {prompt}
5
5
  template:
6
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 collaborators. Remember: your job is to organise the workflow and delegate taks to specialized collaborators to orchestrate the work.
7
+ You are Agent Smith, the AI agent for the Agent Smith project, a toolkit to run AI agents. You can run in main agent mode or collaborator mode. Your job is to organise the workflow when in main agent mode and delegate taks to specialized collaborators to orchestrate the work.
8
8
 
9
- 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.
10
- Important: you can only run collaborators when you are not already in collaborator mode. Run them one at the time.
9
+ 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. You can only run collaborators when you are in main agent mode. Run them one at the time.
11
10
 
12
11
  {file:../fragments/workspace.txt}
13
12
 
14
13
  {file:../fragments/ctx-helper-files.md}
15
14
  - `agent-smith/.agents/documentation/documentation-map.md`: an entrypoint to navigate in the documentation
16
15
 
17
- Evaluate the user request and organise the work of collaborators to get an answer.
16
+ Evaluate the request. Execute it if you are in collaborator mode, or and organise the work of collaborators if you are in main agent mode.
18
17
  model: qwen35b
19
18
  backend: llamaccp
20
19
  inferParams:
@@ -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
@@ -20,9 +20,9 @@ template:
20
20
  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.
21
21
 
22
22
  {file:../fragments/workspace.txt}
23
-
24
23
  {file:../fragments/ctx-helper-files.md}
25
- - `agent-smith/.agents/documentation/documentation-map.md`: an entrypoint to navigate in the documentation. Always start by reading this before searching.
24
+ - `agent-smith/.agents/documentation/documentation-map.md`: an entrypoint to navigate in the documentation.
25
+ Always start by reading these files before searching, starting with `AGENTS.md`.
26
26
  model: qwen35b
27
27
  backend: llamaccp
28
28
  inferParams:
@@ -31,7 +31,6 @@ inferParams:
31
31
  top_p: 0.85
32
32
  temperature: 0.6
33
33
  repetition_penalty: 1
34
- presence_penalty: 1.5
35
34
  chat_template_kwargs:
36
35
  enable_thinking: true
37
36
  preserve_thinking: true
@@ -47,4 +46,4 @@ skills:
47
46
  - update-doc-map
48
47
  - update-codebase-summary
49
48
  - document-package
50
- - create-package-readme
49
+ - create-readme
@@ -1,5 +1,5 @@
1
1
  description: An agent to manage Agent Smith's documentation
2
- category: doc
2
+ category: builtin
3
3
  prompt: |-
4
4
  {prompt}
5
5
  template:
@@ -14,7 +14,7 @@ template:
14
14
  {file:../fragments/workspace.txt}
15
15
  {file:../fragments/ctx-helper-files.md}
16
16
 
17
- Information about the database: agent-smith/docsite/public/doc/architecture/3.database.md.
17
+ Information about the database: `agent-smith/docsite/public/doc/architecture/3.database.md`.
18
18
  Important: to read any agents, actions and other builtin features always use the "read-feature" tool if you need to read one. For other files use the "shell" tool.
19
19
 
20
20
  Read AGENTS.md, the project nav file and the database info file before all to get a good idea of the context
@@ -24,6 +24,10 @@ inferParams:
24
24
  top_k: 20
25
25
  top_p: 0.85
26
26
  temperature: 0.6
27
+ repetition_penalty: 1
28
+ chat_template_kwargs:
29
+ enable_thinking: true
30
+ preserve_thinking: true
27
31
  variables:
28
32
  required:
29
33
  workspace:
@@ -1,11 +1,11 @@
1
1
  tool:
2
2
  name: agent-smith-search
3
- description: An agent to run web search
3
+ description: run web search or open web pages
4
4
  arguments:
5
5
  prompt:
6
6
  description: the web search to perform or question about a web page
7
7
  required: true
8
- description: An agent to run web search
8
+ description: An agent to run web search or open web pages
9
9
  category: internal
10
10
  prompt: |-
11
11
  {prompt}
@@ -26,7 +26,6 @@ inferParams:
26
26
  top_p: 0.85
27
27
  temperature: 0.6
28
28
  repetition_penalty: 1
29
- presence_penalty: 1.5
30
29
  chat_template_kwargs:
31
30
  enable_thinking: true
32
31
  preserve_thinking: true
@@ -38,4 +37,4 @@ toolsList:
38
37
  - shell
39
38
  - python
40
39
  - ddsearch
41
- - open_page
40
+ - read-webpage
@@ -1,8 +1,8 @@
1
1
  tool:
2
- description: Create a database query for Agent Smith database
2
+ description: retrieve data from the Agent Smith config database that references agents, actions, workflows and other features
3
3
  arguments:
4
4
  prompt:
5
- description: The user question to create a query from
5
+ description: the question about the config or data to retrieve
6
6
  description: Create an sql query
7
7
  category: internal
8
8
  prompt: |-
@@ -1,19 +1,22 @@
1
1
  description: An agent to manage Agent Smith's documentation
2
- category: internal
2
+ category: builtin
3
3
  prompt: |-
4
4
  {prompt}
5
5
  template:
6
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. Available subagents:
7
+ You are Agent Smith, an AI coordinator agent. Your job is to organise the workflow of other agents. As a coordinator you always delegate taks to agents to orchestrate the work. Your job is to coordinate the team of agents. Available agents:
8
8
 
9
- - `agent-smith-doc`: a documentation manager agent. Use it for all documentation related tasks, like verify, create or update documentation. It has specific skills to create codebase summaries and manage documentation.
10
- - `agent-smith-search`: a web search and web page reader agent. Use to search information or ask questions about some web pages.
11
-
12
- 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.
9
+ - `agent-smith-assistant`: a fork of yourself, the default agent. Run it by default to accomplish any task.
10
+ - `agent-smith-search`: a web search and web page reader agent. Use to search information or for questions about some web pages.
13
11
 
14
12
  {file:../fragments/workspace.txt}
15
13
  {file:../fragments/ctx-helper-files.md}
16
- - `agent-smith/.agents/documentation/documentation-map.md`: read this to find documentation
14
+
15
+ Your workflow to answer a user request:
16
+
17
+ - Analyze the user request
18
+ - Decompose the task to subtasks if necessary and plan the work to do
19
+ - Call agent(s) one after the other to accomplish the subtasks, use `agent-smith-assistant` by default if no specialized agent matches. Only call one agent at the time.
17
20
  model: qwen35b
18
21
  backend: llamaccp
19
22
  inferParams:
@@ -33,5 +36,6 @@ variables:
33
36
  toolsList:
34
37
  - shell
35
38
  - python
36
- - run-worker
37
- - run-agent
39
+ - run-agent
40
+ - load-skill
41
+ - notify-user
@@ -1,5 +1,6 @@
1
1
  description: A collaborator agent
2
- type: builtin
2
+ category: internal
3
+ type: worker
3
4
  prompt: |-
4
5
  You are on collaborator mode. Your role is: {role}. Main agent request:
5
6
 
@@ -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.
@@ -1,4 +1,4 @@
1
1
  Project's context helper files:
2
2
 
3
- - `AGENTS.md`: general high level context map of the project
3
+ - `AGENTS.md`: general high level context map of the project. Read this first.
4
4
  - `.agents/documentation/project-nav.md`: a map of the project repositories and overview of the project
@@ -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
@@ -11,10 +11,12 @@ The tasks are located in an `.agents/tasks` directory, or `[project-name].agents
11
11
 
12
12
  Read `.agents/tasks/[task-name]` to list the task files. If a `state.md` file is there read it: it details the task progression.
13
13
 
14
- ## Write to a task
14
+ ## Create or update a task
15
15
 
16
16
  Check if an `.agents/tasks/[task-name]` directory exists, if not create it. You can write markdown files in it.
17
17
 
18
+ When asked to create a task do it and then report to the user before executing the task
19
+
18
20
  ## Execute or continue a task
19
21
 
20
22
  Check what is remaining to do. Avoid verifying previous phases and execute the next phase directly. Always execute the phases one by one. Update the sate after each phase to mark it done.
@@ -1,5 +1,5 @@
1
1
  tool:
2
- description: and sql agent to retrieve data in the Agent Smith database by asking a question in natural language and get the data back
2
+ description: and agent to retrieve data in the Agent Smith config database that references agents, actions, workflows and other features. Ask a question in natural language and get the data back.
3
3
  arguments:
4
4
  prompt:
5
5
  description: the question to ask about the data
package/package.json CHANGED
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "name": "@agent-smith/core",
3
- "version": "0.0.1",
3
+ "version": "0.0.2",
4
4
  "description": "Agent Smith core",
5
5
  "repository": "https://github.com/synw/agent-smith",
6
6
  "scripts": {
7
7
  "build": "rm -rf dist/* && tsc && cp -r src/features/agents dist/features && cp -r src/features/workflows dist/features && cp -r src/features/fragments dist/features && cp -r src/features/skills dist/features"
8
8
  },
9
9
  "dependencies": {
10
- "@agent-smith/agent": "^0.5.0",
10
+ "@agent-smith/agent": "^0.5.1",
11
11
  "@intrinsicai/gbnfgen": "^0.12.0",
12
12
  "@modelcontextprotocol/sdk": "^1.29.0",
13
13
  "@vue/reactivity": "^3.5.35",
@@ -21,7 +21,7 @@
21
21
  "devDependencies": {
22
22
  "@agent-smith/types": "^0.0.5",
23
23
  "@types/better-sqlite3": "^7.6.13",
24
- "@types/node": "^25.9.1",
24
+ "@types/node": "^25.9.2",
25
25
  "@types/node-notifier": "^8.0.5",
26
26
  "tslib": "^2.8.1",
27
27
  "typescript": "^6.0.3"
@@ -1,66 +0,0 @@
1
- ---
2
- name: create-package-readme
3
- description: use this to create comprehensive README file for a given package
4
- ---
5
-
6
- ## Workflow: Package 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 package in the codebase summary (note its position, dependencies, and purpose)
12
-
13
- ### Phase 2: Deep Dive
14
- 3. Navigate to package directory: `/workspace/agent-smith/packages/{package-name}/`
15
- 4. Read `.agents/documentation/codebase-summary.md` for package-specific 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 `/workspace/agent-smith/packages/{package-name}/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**: 2 sections: documentation for AI agents (must include a link to the codebase navigation map at .agents/documentation/codebase-summary.md and the relevant doc from documentation), and documentation for humans, with the relevant doc http links. Correct links formats:
27
- - For humans use the site link: https://lynxai-team.github.io/agent-smith/: replace the `docsite/public/doc` paths by this link. Example:
28
- ```md
29
- - [Complete doc](https://lynxai-team.github.io/agent-smith/libraries/agent/)
30
- ```
31
- - For AI agents provide detailled links map and use the raw file paths links. Example:
32
- ```md
33
- - [Codebase Summary](.agents/documentation/codebase-summary.md) — Architecture, key files, and patterns for the agent package
34
- - [Get Started](https://raw.githubusercontent.com/lynxai-team/agent-smith/refs/heads/main/docsite/public/doc/libraries/agent/1.get_started.md) — Installation and basic usage
35
- - [Tools](https://raw.githubusercontent.com/lynxai-team/agent-smith/refs/heads/main/docsite/public/doc/libraries/agent/2.tools.md) — Defining and configuring tools for agents
36
- - [Templates](https://raw.githubusercontent.com/lynxai-team/agent-smith/refs/heads/main/docsite/public/doc/libraries/agent/3.templates.md) — System prompts, YAML specs, and few-shot examples
37
- - [Supervision](https://raw.githubusercontent.com/lynxai-team/agent-smith/refs/heads/main/docsite/public/doc/libraries/agent/4.supervision.md) — Human-in-the-loop tool authorization
38
- ```
39
- - **Installation**: npm/yarn command in code block
40
- - **Quick Start**: Minimal working example showing creation, init, and basic operations
41
- - **Usage**: Detailed patterns with code examples (creation, initialization, verbose mode, reading/writing, error handling)
42
- - **Complete Example**: Full working async function demonstrating all operations
43
- - **API Reference**: Factory function signature + parameters table + interface + method summary table
44
- - **Important Notes**: Browser-only warnings, limitations, related packages
45
- - **Documentation Links**: References to full docsite
46
- - **License**: MIT/appropriate license
47
-
48
- ### Key Principles
49
- - **Information Density**: Every section must convey unique value; avoid repetition between Quick Start and Usage
50
- - **Code Examples**: All examples must be complete, runnable TypeScript with proper async/await
51
- - **Type Safety**: Show generic type parameters explicitly (e.g., `get<string>()`)
52
- - **Error Handling**: Document error cases explicitly with try/catch examples
53
- - **Browser vs Node**: Clearly state environment constraints early in the README
54
- - **Visual Hierarchy**: Use emojis for feature bullets, clear section headers, and tables for API reference
55
-
56
- ### Output Validation
57
- Before finalizing, verify:
58
- - [ ] All code blocks are syntactically valid TypeScript
59
- - [ ] API signatures match actual implementation (check source files if needed)
60
- - [ ] Installation command uses correct package name (`@agent-smith/{package-name}`)
61
- - [ ] Documentation links follow consistent pattern
62
- - [ ] No internal paths or implementation details leak into public documentation
63
-
64
- Documentation links base url: https://lynxai-team.github.io/agent-smith/
65
-
66
- Notify the user when the task is completed