Skip to content

Commit 31305bb

Browse files
committed
readme
1 parent e54c965 commit 31305bb

1 file changed

Lines changed: 54 additions & 72 deletions

File tree

README.md

Lines changed: 54 additions & 72 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,8 @@ Donna executes such loops for the agents, thereby saving time, context, and toke
3838
- **Saves context, tokens and time** — agents do not need to think when thinking is not required.
3939
- **Readable artifacts** — all workflows and specifications are pure Markdown files with some [Jinja2](https://github.com/pallets/jinja) templating.
4040
- **Artifact management** — non-fuzzy navigation and smart agent-focused rendering of artifacts.
41-
- **Artifact distribution** — install your docs/workflows/skills as a Python lib.
4241
- **Agent-centric behavior** — Donna guides agents through workflows, helps them be on the path, and fixes mistakes.
43-
- **Extensible architecture** — implement your own operations, validators, renderers; add support for new artifact formats and storages (worlds).
42+
- **Extensible architecture** — implement your own operations, validators, renderers, and artifact sources.
4443
- **Batteries included** — Donna goes with a set of pre-defined workflows, so you can start using it right away.
4544

4645
## Example
@@ -117,14 +116,14 @@ What you may notice:
117116

118117
Directives, like `{{ goto("operation_id") }}`, render itself depending on the context:
119118

120-
- For the agent, they render an exact CLI command to run, such as `donna -p llm sessions action-request-completed <action-request-id> 'artifact_id:operation_id'`.
119+
- For the agent, they render an exact CLI command to run, such as `donna -p llm sessions action-request-completed <action-request-id> '@/specs/work/polish.donna.md:finish'`.
121120
- For Donna, they render a specific marker that can be extracted and used to analyze an artifact. For example, Donna uses `goto` directives to build an FSM of the workflow and validate it before running: does each operation exist, can the workflow be completed, are there unreachable operations, etc.
122121

123122
Generally speaking, **all you need is `donna.lib.request_action` operation** — it is enough to achieve a great deal of automation by delegating some decisions to the agent. However, there are some more specific operations that simplify things and make workflows more agile or performant.
124123

125124
</details>
126125

127-
You can find a more complex implementation of the same workflow in the [polish.md](./specs/work/polish.md) file. It demonstrates other Donna operations, such as running scripts directly and branching.
126+
You can find a more complex implementation of the same workflow in the [polish.donna.md](./specs/work/polish.donna.md) file. It demonstrates other Donna operations, such as running scripts directly and branching.
128127

129128
## Installation
130129

@@ -146,8 +145,11 @@ donna workspaces init
146145
Donna will:
147146

148147
- Create a `.donna/` folder in your project root with a default configuration in `.donna/config.toml`.
148+
- Sync bundled Donna specs into `.agents/donna/`.
149149
- Install skills into `.agents/skills/` folder.
150150

151+
If you upgrade Donna later, run `donna workspaces update` to refresh `.agents/donna/` and `.agents/skills/`.
152+
151153
3. Ask your agent to do something like `$donna-do Add a button that …`. The agent will discover the appropriate workflow and execute it.
152154

153155
## Skills
@@ -177,9 +179,9 @@ Use `donna --help` for a quick reference.
177179

178180
You find detailed documentation in the agent instructions — they are readable and always accurate:
179181

180-
- [CLI specification](./donna/artifacts/usage/cli.md) — full list of commands and how to use them.
181-
- [Artifacts](./donna/artifacts/usage/artifacts.md) — what are Donna artifact and how to use them.
182-
- [Worlds](./donna/artifacts/usage/worlds.md) — how Donna discovers and manages its artifacts.
182+
- [CLI specification](./.agents/donna/usage/cli.donna.md) — full list of commands and how to use them.
183+
- [Artifacts](./.agents/donna/usage/artifacts.donna.md) — what Donna artifacts are and how to use them.
184+
- [Filesystem layout](./.agents/donna/usage/worlds.donna.md) — how Donna discovers and manages artifacts on the filesystem.
183185

184186
The documentation below covers aspects important to humans and partially duplicates the agent's instructions.
185187

@@ -205,32 +207,21 @@ Note that the default Donna workflows are designed to be reliable and useful for
205207

206208
Points of interest:
207209

208-
- [donna:rfc:specs:request_for_change](./donna/artifacts/rfc/specs/request_for_change.md) — specification of the RFC document.
209-
- [donna:rfc:work:request](./donna/artifacts/rfc/work/request.md) — workflow to create a RFC document.
210-
- [donna:rfc:work:plan](./donna/artifacts/rfc/work/plan.md) — workflow to plan work on an RFC — creates a new workflow.
211-
- [donna:rfc:work:do](./donna/artifacts/rfc/work/do.md) — meta workflow to automate the whole work from a developer request to a changelog update.
212-
213-
## Artifacts and Worlds
214-
215-
- Artifacts are something that Donna owns. Currently, they are Markdown files with workflows and specifications.
216-
- Worlds are storages for artifacts. Currently, Donna supports two types of worlds:
217-
- `donna.lib.worlds.filesystem` — a folder on the filesystem.
218-
- `donna.lib.worlds.python` — a Python package.
219-
220-
**Please, tell if you need other world types.** It looks interesting to have `http`, `s3`, `git`, `sql` worlds. How about an `email` world that allows you to send a workflow to someone agent and get the results back in your mailbox?
221-
222-
A world ID is the first part of an artifact ID. For example, `donna:usage:cli` artifact resides in the `donna` world.
210+
- [@/.agents/donna/rfc/specs/request_for_change.donna.md](./.agents/donna/rfc/specs/request_for_change.donna.md) — specification of the RFC document.
211+
- [@/.agents/donna/rfc/work/request.donna.md](./.agents/donna/rfc/work/request.donna.md) — workflow to create a RFC document.
212+
- [@/.agents/donna/rfc/work/plan.donna.md](./.agents/donna/rfc/work/plan.donna.md) — workflow to plan work on an RFC and create a new workflow.
213+
- [@/.agents/donna/rfc/work/do.donna.md](./.agents/donna/rfc/work/do.donna.md) — meta workflow to automate the whole work from a developer request to a changelog update.
223214

224-
By default, Donna uses the next worlds:
215+
## Artifacts on Filesystem
225216

226-
- `donna` — artifacts provided by Donna itself;
227-
- `home` — user-level artifacts in `<HOME>/.donna/` folder;
228-
- `project` — project-level artifacts in `<project-root>/specs/` folder;
229-
- `session` — session-level artifacts in `<project-root>/.donna/session/` folder.
217+
- Artifacts are text files Donna reads and validates. In practice they are usually Markdown workflows and specifications stored as `.donna.md` files.
218+
- Donna discovers artifacts directly in the project filesystem and limits what is visible via `.donna/config.toml:file_filters`.
230219

231-
A world can be read-only. By default, writable worlds are `session` (current work scope) and `project` (project scope).
220+
By default, Donna uses these artifact areas:
232221

233-
Agents are not allowed to edit artifacts through Donna CLI directly because artifact consistency is important. Instead, they update the underlying files in writable worlds and rely on Donna validation when needed.
222+
- `specs/` — project-owned artifacts.
223+
- `.agents/donna/` — bundled Donna specs and workflows synced by `donna workspaces init` or `donna workspaces update`.
224+
- `.donna/session/` — session artifacts and Donna runtime state.
234225

235226
### Rendering
236227

@@ -240,44 +231,53 @@ More about Jinja2 rendering is described a bit further.
240231

241232
### Artifacts Discovery
242233

243-
Artifact is identified by its id: `<world>:<colon-separated-path>`, for example, `donna:usage:cli`.
234+
Artifact ids are project-relative filepaths prefixed with `@/`. Section ids append `:section_id` to the artifact id.
244235

245-
You and agents can `list` artifacts and `view` them.
236+
Examples:
237+
238+
- `@/specs/work/polish.donna.md`
239+
- `@/.agents/donna/usage/cli.donna.md`
240+
- `@/.donna/session/execute_rfc.donna.md:review_changes`
246241

247-
- `donna -p llm artifacts list <pattern>` — shows a short description from its h1 section.
242+
You and agents can `list`, `view`, and `validate` artifacts.
243+
244+
- `donna -p llm artifacts list [<pattern>]` — shows a short description from its h1 section.
248245
- `donna -p llm artifacts view <pattern>` — shows the full content of the artifact with proper rendering.
246+
- `donna -p llm artifacts validate [<pattern>]` — validates matching artifacts.
247+
248+
Commands accept both precise artifact ids and glob patterns. Patterns may use absolute ids like `@/...` or rooted wildcard forms like `**/intro.donna.md`.
249249

250-
Both commands accept both precise artifact ids and glob patterns. Patterns allow using:
250+
Patterns allow using:
251251

252-
- `*` to replace a single path segment;
253-
- `**` to replace multiple path segments.
252+
- `*` — matches zero or more characters inside one path level.
253+
- `?` — matches exactly one character inside one path level.
254+
- `[]` — matches a single character class inside one path level.
255+
- `**` — matches zero or more path levels.
254256

255257
Examples:
256258

257-
- `*:artifact:name` — matches all artifacts named `artifact:name` in all worlds.
258-
- `world:*:name` — matches all artifacts with id `something:name` in the `world` world.
259-
- `**:name` — matches all artifacts with id ending with `:name` in all worlds.
260-
- `world:**` — matches all artifacts in the `world` world.
261-
- `world:**:name` — matches all artifacts with id ending with `:name` in the `world` world.
259+
- `@/*.donna.md` — matches all artifacts directly under the project root.
260+
- `@/**/intro.donna.md` — matches all artifacts named `intro.donna.md`.
261+
- `@/.donna/session/**` — matches all session artifacts.
262+
- `**/test_*.donna.md` — matches artifact filenames that start with `test_`.
262263

263-
Both commands also accept `--predicate/-p '<python-expression>'` option to filter artifacts by
264-
their primary section properties (available as `section` inside expression).
264+
Commands that accept an artifact pattern also support `--predicate '<python-expression>'` to filter by primary section properties available as `section`.
265265

266266
Currently, Donna supports two artifact tags:
267267

268268
- `workflow` — marks a workflow artifact — is set automatically by Donna.
269269
- `specification` — marks a specification artifact — is set automatically by Donna.
270270

271271
You can find all workflows with the command
272-
`donna -p llm artifacts list '**' --predicate '"workflow" in section.tags'`.
272+
`donna -p llm artifacts list --predicate '"workflow" in section.tags'`.
273273

274274
## Sessions
275275

276-
`session` world contains the current state of work performed by Donna: all documents and workflows that are created during work and should not be stored permanently in the project.
276+
`<project-root>/.donna/session/` contains the current state of work performed by Donna: runtime state plus temporary documents and workflows created during the session.
277277

278278
The developer is responsible for starting/resetting sessions with commands from `donna -p human sessions` group.
279279

280-
- On session start, Donna removes everything from the previous session and creates a fresh `session` world.
280+
- On session start, Donna removes everything from the previous session and creates a fresh session directory.
281281
- On session reset donna resets the state of the current session (tasks, action requests, etc.), but keeps artifacts.
282282

283283
The agent is encouraged not to manage sessions directly, because it doesn't have enough context to decide when session artifacts may be safely removed.
@@ -303,7 +303,7 @@ To execute a workflow, Donna uses a simplified virtual machine (VM) that maintai
303303

304304
### Operations
305305

306-
You can find detailed docs on built-in operations in the [artifacts documentation](./donna/artifacts/usage/artifacts.md).
306+
You can find detailed docs on built-in operations in the [artifacts documentation](./.agents/donna/usage/artifacts.donna.md).
307307

308308
Here is a short list of them:
309309

@@ -320,15 +320,15 @@ Donna can detect errors (in artifacts, in execution, etc). If an error can be fi
320320
<summary><strong>An example of error message from Donna</strong></summary>
321321

322322
```bash
323-
$ donna -p llm sessions run project:work:polish
323+
$ donna -p llm sessions run @/specs/work/polish.donna.md
324324

325325
kind=artifact_validation_error
326326
media_type=text/markdown
327-
artifact_id=project:work:polish
327+
artifact_id=@/specs/work/polish.donna.md
328328
error_code=donna.artifacts.section_not_found
329329
section_id=run_autoflake_scriptx
330330

331-
Error in artifact 'project:work:polish', section 'run_autoflake_scriptx': Section `run_autoflake_scriptx` is not available in artifact `project:work:polish`.
331+
Error in artifact '@/specs/work/polish.donna.md', section 'run_autoflake_scriptx': Section `run_autoflake_scriptx` is not available in artifact `@/specs/work/polish.donna.md`.
332332

333333
Ways to fix:
334334

@@ -352,11 +352,11 @@ The simplest example of such generation is currently used as a primary way for D
352352

353353
### Discovering workflows
354354

355-
If you want to run a child workflow from an operation, you can just instruct an agent like `Run the workflow project:work:my-cool-workflow` and the agent will find it and run.
355+
If you want to run a child workflow from an operation, you can just instruct an agent like `Run the workflow @/specs/work/my-cool-workflow.donna.md` and the agent will find it and run.
356356

357357
However, it is not very agile. Instead, I suggest you describe the desired outcome and let the agent find the most suitable workflow. In that case, you'll be able to define customized workflows for specific types of changes and let the agent choose the best one for the current situation.
358358

359-
For example, you can have two workflows `project:work:write-backend-test` and `project:work:write-frontend-test`, and your operation can say `Run the workflow that will write a test for the current change`, and the agent will choose the most suitable workflow based on the context and the workflow descriptions.
359+
For example, you can have two workflows `@/specs/work/write-backend-test.donna.md` and `@/specs/work/write-frontend-test.donna.md`, and your operation can say `Run the workflow that will write a test for the current change`, and the agent will choose the most suitable workflow based on the context and the workflow descriptions.
360360

361361
## Jinja2 rendering
362362

@@ -378,7 +378,7 @@ Donna defines a set of built-in Jinja2 functions that provide artifacts with the
378378

379379
Directives are used in the next way: `{{ python.import.path(<args>) }}`.
380380

381-
You can find a detailed documentation of all built-in directives in the [artifacts documentation](./donna/artifacts/usage/artifacts.md).
381+
You can find a detailed documentation of all built-in directives in the [artifacts documentation](./.agents/donna/usage/artifacts.donna.md).
382382

383383
Here they are:
384384

@@ -399,35 +399,17 @@ All Donna logic is referenced by Python import paths. That means:
399399

400400
- You can implement your own functionality and use it with Donna.
401401
- You can enrich your Python packages with additional code to work with Donna.
402-
- You can distribute your Donna artifacts as Python packages.
403402

404403
What you can implement:
405404

406405
- Custom sections (including operations) for Donna artifacts. Check [./donna/primitives/artifacts](./donna/primitives/artifacts) and [./donna/primitives/operations](./donna/primitives/operations) subpackages for examples.
407406
- Custom rendering directives. Check [./donna/primitives/directives](./donna/primitives/directives) subpackage for examples.
408-
- Custom worlds. Check [./donna/workspaces/worlds](./donna/workspaces/worlds) subpackage for examples.
409-
- Custom parsers for artifacts. Check [./donna/workspaces/sources](./donna/workspaces/sources) subpackage for examples.
407+
- Custom artifact parsers. Check [./donna/workspaces/sources](./donna/workspaces/sources) subpackage for examples.
410408

411-
Worlds and sources are configured in the `.donna/config.toml` file of your project.
409+
Sources and file filters are configured in the `.donna/config.toml` file of your project.
412410

413411
Sections and directives are used directly in artifacts by their Python import paths.
414412

415-
## Distribute Your Artifacts
416-
417-
Since Donna world can be a Python lib, you can distribute your artifacts as a Python package.
418-
419-
To define a Donna world in you package you must place a variable `donna_artifacts_root` in your package `__init__.py` file with a import path to the root subpackage with your artifacts.
420-
421-
On the example of Donna:
422-
423-
```python
424-
donna_artifacts_root = "donna.artifacts"
425-
```
426-
427-
After that, you can install your package and add the world into the `.donna/config.toml` file of your project.
428-
429-
Since you distribute text files, **you package is not dependent on Donna itself — no additional dependencies are required.**
430-
431413
## Feedback wanted
432414

433415
Donna is still young and has multiple experimental features — I really appreciate any feedback, ideas, and contributions to make it better.

0 commit comments

Comments
 (0)