|
| 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 | + [](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