Skip to content

Commit 93995e7

Browse files
committed
Restruct docs
1 parent 1ed4a92 commit 93995e7

30 files changed

Lines changed: 183 additions & 161 deletions

.vitepress/config.mts

Lines changed: 20 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ gtag('config', 'G-VYGDN3X0PR');`],
7373
],
7474
themeConfig: {
7575
nav: [
76-
{ text: 'Docs', link: '/docs/getting-started.md' },
76+
{ text: 'Docs', link: '/docs/intro/getting-started.md' },
7777
{ text: 'Blog', link: '/blog/' },
7878
],
7979
editLink: {
@@ -85,10 +85,11 @@ gtag('config', 'G-VYGDN3X0PR');`],
8585
{
8686
text: 'Introduction',
8787
items: [
88-
{ text: 'Why Testo?', link: '/docs/why-testo.md' },
89-
{ text: 'Getting Started', link: '/docs/getting-started.md' },
90-
{ text: 'Configuration', link: '/docs/configuration.md' },
91-
{ text: 'Writing Tests', link: '/docs/writing-tests.md' },
88+
{ text: 'Why Testo?', link: '/docs/intro/why-testo.md' },
89+
{ text: 'AI Agents', link: '/docs/intro/ai-agents.md' },
90+
{ text: 'Getting Started', link: '/docs/intro/getting-started.md' },
91+
{ text: 'Configuration', link: '/docs/intro/configuration.md' },
92+
{ text: 'Writing Tests', link: '/docs/intro/writing-tests.md' },
9293
],
9394
},
9495
{
@@ -122,15 +123,10 @@ gtag('config', 'G-VYGDN3X0PR');`],
122123
{
123124
text: 'Guide',
124125
items: [
125-
{ text: 'All Attributes', link: '/docs/attributes.md' },
126-
{ text: 'CLI Reference', link: '/docs/cli-reference.md' },
127-
{ text: 'AI Agents', link: '/docs/ai-agents.md' },
128-
],
129-
},
130-
{
131-
text: 'Customization',
132-
items: [
133-
{ text: 'Events', link: '/docs/events.md' },
126+
{ text: 'All Attributes', link: '/docs/guide/attributes.md' },
127+
{ text: 'CLI Reference', link: '/docs/guide/cli-reference.md' },
128+
{ text: 'Events', link: '/docs/guide/events.md' },
129+
{ text: 'Interceptors', link: '/docs/guide/interceptors.md' },
134130
],
135131
},
136132
{
@@ -152,7 +148,7 @@ gtag('config', 'G-VYGDN3X0PR');`],
152148
],
153149
themeConfig: {
154150
nav: [
155-
{ text: 'Документация', link: '/ru/docs/getting-started.md' },
151+
{ text: 'Документация', link: '/ru/docs/intro/getting-started.md' },
156152
{ text: 'Блог', link: '/ru/blog/' },
157153
],
158154
editLink: {
@@ -164,10 +160,11 @@ gtag('config', 'G-VYGDN3X0PR');`],
164160
{
165161
text: 'Введение',
166162
items: [
167-
{ text: 'Почему Testo?', link: '/ru/docs/why-testo.md' },
168-
{ text: 'Начало работы', link: '/ru/docs/getting-started.md' },
169-
{ text: 'Конфигурация', link: '/ru/docs/configuration.md' },
170-
{ text: 'Пишем тесты', link: '/ru/docs/writing-tests.md' },
163+
{ text: 'Почему Testo?', link: '/ru/docs/intro/why-testo.md' },
164+
{ text: 'AI-агенты', link: '/ru/docs/intro/ai-agents.md' },
165+
{ text: 'Начало работы', link: '/ru/docs/intro/getting-started.md' },
166+
{ text: 'Конфигурация', link: '/ru/docs/intro/configuration.md' },
167+
{ text: 'Пишем тесты', link: '/ru/docs/intro/writing-tests.md' },
171168
],
172169
},
173170
{
@@ -201,15 +198,10 @@ gtag('config', 'G-VYGDN3X0PR');`],
201198
{
202199
text: 'Руководство',
203200
items: [
204-
{ text: 'Все атрибуты', link: '/ru/docs/attributes.md' },
205-
{ text: 'CLI справка', link: '/ru/docs/cli-reference.md' },
206-
{ text: 'AI-агенты', link: '/ru/docs/ai-agents.md' },
207-
],
208-
},
209-
{
210-
text: 'Кастомизация',
211-
items: [
212-
{ text: 'События', link: '/ru/docs/events.md' },
201+
{ text: 'Все атрибуты', link: '/ru/docs/guide/attributes.md' },
202+
{ text: 'CLI справка', link: '/ru/docs/guide/cli-reference.md' },
203+
{ text: 'События', link: '/ru/docs/guide/events.md' },
204+
{ text: 'Интерцепторы', link: '/ru/docs/guide/interceptors.md' },
213205
],
214206
},
215207
{

blog/beta-testo.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ Yes. Testo is fully independent and doesn't conflict with other tools — it doe
4141
:::
4242

4343
::: question Does Testo work with AI agents?
44-
Yes. Testo provides `llms.txt` and `llms-full.txt` — special files for AI agents describing the framework's API. Feed them to your agent, and it will start writing Testo tests right away. Learn more in the [documentation](/docs/ai-agents.md).
44+
Yes. Testo provides `llms.txt` and `llms-full.txt` — special files for AI agents describing the framework's API. Feed them to your agent, and it will start writing Testo tests right away. Learn more in the [documentation](/docs/guide/ai-agents.md).
4545
:::
4646

4747
::: question Is there IDE support?

docs/ai-agents.md

Lines changed: 0 additions & 60 deletions
This file was deleted.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

docs/intro/ai-agents.md

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
---
2+
llms: false
3+
---
4+
5+
# AI Agents
6+
7+
AI agents write Testo tests well — and just as well port existing tests to Testo from other frameworks.
8+
9+
::: tip
10+
The fastest path to your first test: install the package (see [Getting Started](getting-started.md)) and ask an agent to write or migrate tests, pointing it at `llms-full.txt` (see below).
11+
:::
12+
13+
## How agents read Testo's docs
14+
15+
Testo publishes its documentation in the [llms.txt](https://llmstxt.org/) format — a single machine-readable file an AI fetches instead of crawling HTML pages.
16+
17+
| File | Content | When to use |
18+
|---------------------------------------------------------------|--------------------------------------------------------|------------------------------------------------------------|
19+
| [`/llms.txt`](https://php-testo.github.io/llms.txt) | Page list with short descriptions and best practices. | Quick overview of available documentation. |
20+
| [`/llms-full.txt`](https://php-testo.github.io/llms-full.txt) | Full text of all documentation pages. | When the agent needs complete context for code generation. |
21+
22+
## Typical workflow
23+
24+
The same three steps work for new tests and for porting an existing suite:
25+
26+
1. **Feed the context.** Point the agent at `llms-full.txt` or paste the relevant section.
27+
2. **Describe the task.** Provide the class or function you want to cover — or paste the old test you want to convert.
28+
3. **Review and run.** Check the result and run `vendor/bin/testo`.
29+
30+
### Example prompts
31+
32+
Writing tests from scratch:
33+
34+
```
35+
Using the Testo PHP testing framework, write tests for the following class:
36+
37+
{paste your class here}
38+
39+
Documentation: https://php-testo.github.io/llms-full.txt
40+
```
41+
42+
Migrating from PHPUnit, Pest, or Codeception:
43+
44+
```
45+
Rewrite the following PHPUnit test to Testo. Keep the same assertions and data providers,
46+
do not invent extra scenarios.
47+
48+
{paste your old test here}
49+
50+
Documentation: https://php-testo.github.io/llms-full.txt
51+
```
52+
53+
### Claude Code
54+
55+
[Claude Code](https://docs.anthropic.com/en/docs/claude-code) can fetch URLs during a conversation. Add an instruction to your project's `CLAUDE.md`:
56+
57+
```markdown
58+
When writing PHP tests, use the Testo framework.
59+
Fetch the documentation before writing tests: https://php-testo.github.io/llms-full.txt
60+
```
61+
62+
Claude Code will read this instruction and pull the documentation whenever it generates or migrates tests.
63+
64+
### Cursor, Windsurf, and others
65+
66+
AI-powered code editors let you register external documentation as context. The typical approach is to add the documentation URL once and then reference it in chat.
67+
68+
- **Cursor:** Add the URL via **Settings → Features → Docs → Add new doc**. After indexing, reference it in chat with `@Docs` → select Testo.
69+
- **Windsurf:** Paste the URL directly into a Cascade message.
70+
71+
For any IDE that doesn't support URL indexing, paste the contents of `llms-full.txt` into the chat as context.
File renamed without changes.
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@ llms_description: "Getting started with Testo. Installation via Composer, testo.
55

66
# Getting Started
77

8+
::: tip Working with an AI assistant?
9+
Testo is designed to be friendly to AI coding agents — both for writing new tests and for migrating from PHPUnit, Pest, or Codeception. Skim [AI Agents](./ai-agents.md) first, and your agent can do most of the work below for you.
10+
:::
11+
812
## Installation
913

1014
Install Testo via Composer:

0 commit comments

Comments
 (0)