You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+54-72Lines changed: 54 additions & 72 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -38,9 +38,8 @@ Donna executes such loops for the agents, thereby saving time, context, and toke
38
38
-**Saves context, tokens and time** — agents do not need to think when thinking is not required.
39
39
-**Readable artifacts** — all workflows and specifications are pure Markdown files with some [Jinja2](https://github.com/pallets/jinja) templating.
40
40
-**Artifact management** — non-fuzzy navigation and smart agent-focused rendering of artifacts.
41
-
-**Artifact distribution** — install your docs/workflows/skills as a Python lib.
42
41
-**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.
44
43
-**Batteries included** — Donna goes with a set of pre-defined workflows, so you can start using it right away.
45
44
46
45
## Example
@@ -117,14 +116,14 @@ What you may notice:
117
116
118
117
Directives, like `{{ goto("operation_id") }}`, render itself depending on the context:
119
118
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'`.
121
120
- 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.
122
121
123
122
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.
124
123
125
124
</details>
126
125
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.
128
127
129
128
## Installation
130
129
@@ -146,8 +145,11 @@ donna workspaces init
146
145
Donna will:
147
146
148
147
- Create a `.donna/` folder in your project root with a default configuration in `.donna/config.toml`.
148
+
- Sync bundled Donna specs into `.agents/donna/`.
149
149
- Install skills into `.agents/skills/` folder.
150
150
151
+
If you upgrade Donna later, run `donna workspaces update` to refresh `.agents/donna/` and `.agents/skills/`.
152
+
151
153
3. Ask your agent to do something like `$donna-do Add a button that …`. The agent will discover the appropriate workflow and execute it.
152
154
153
155
## Skills
@@ -177,9 +179,9 @@ Use `donna --help` for a quick reference.
177
179
178
180
You find detailed documentation in the agent instructions — they are readable and always accurate:
179
181
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.
183
185
184
186
The documentation below covers aspects important to humans and partially duplicates the agent's instructions.
185
187
@@ -205,32 +207,21 @@ Note that the default Donna workflows are designed to be reliable and useful for
205
207
206
208
Points of interest:
207
209
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.
223
214
224
-
By default, Donna uses the next worlds:
215
+
## Artifacts on Filesystem
225
216
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`.
230
219
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:
232
221
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.
234
225
235
226
### Rendering
236
227
@@ -240,44 +231,53 @@ More about Jinja2 rendering is described a bit further.
240
231
241
232
### Artifacts Discovery
242
233
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.
244
235
245
-
You and agents can `list` artifacts and `view` them.
Commands accept both precise artifact ids and glob patterns. Patterns may use absolute ids like `@/...` or rooted wildcard forms like `**/intro.donna.md`.
249
249
250
-
Both commands accept both precise artifact ids and glob patterns. Patterns allow using:
250
+
Patterns allow using:
251
251
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.
254
256
255
257
Examples:
256
258
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_`.
262
263
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`.
265
265
266
266
Currently, Donna supports two artifact tags:
267
267
268
268
-`workflow` — marks a workflow artifact — is set automatically by Donna.
269
269
-`specification` — marks a specification artifact — is set automatically by Donna.
270
270
271
271
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'`.
273
273
274
274
## Sessions
275
275
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.
277
277
278
278
The developer is responsible for starting/resetting sessions with commands from `donna -p human sessions` group.
279
279
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.
281
281
- On session reset donna resets the state of the current session (tasks, action requests, etc.), but keeps artifacts.
282
282
283
283
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
303
303
304
304
### Operations
305
305
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).
307
307
308
308
Here is a short list of them:
309
309
@@ -320,15 +320,15 @@ Donna can detect errors (in artifacts, in execution, etc). If an error can be fi
320
320
<summary><strong>An example of error message from Donna</strong></summary>
321
321
322
322
```bash
323
-
$ donna -p llm sessions run project:work:polish
323
+
$ donna -p llm sessions run @/specs/work/polish.donna.md
324
324
325
325
kind=artifact_validation_error
326
326
media_type=text/markdown
327
-
artifact_id=project:work:polish
327
+
artifact_id=@/specs/work/polish.donna.md
328
328
error_code=donna.artifacts.section_not_found
329
329
section_id=run_autoflake_scriptx
330
330
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`.
332
332
333
333
Ways to fix:
334
334
@@ -352,11 +352,11 @@ The simplest example of such generation is currently used as a primary way for D
352
352
353
353
### Discovering workflows
354
354
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.
356
356
357
357
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.
358
358
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.
360
360
361
361
## Jinja2 rendering
362
362
@@ -378,7 +378,7 @@ Donna defines a set of built-in Jinja2 functions that provide artifacts with the
378
378
379
379
Directives are used in the next way: `{{ python.import.path(<args>) }}`.
380
380
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).
382
382
383
383
Here they are:
384
384
@@ -399,35 +399,17 @@ All Donna logic is referenced by Python import paths. That means:
399
399
400
400
- You can implement your own functionality and use it with Donna.
401
401
- You can enrich your Python packages with additional code to work with Donna.
402
-
- You can distribute your Donna artifacts as Python packages.
403
402
404
403
What you can implement:
405
404
406
405
- Custom sections (including operations) for Donna artifacts. Check [./donna/primitives/artifacts](./donna/primitives/artifacts) and [./donna/primitives/operations](./donna/primitives/operations) subpackages for examples.
407
406
- 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.
410
408
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.
412
410
413
411
Sections and directives are used directly in artifacts by their Python import paths.
414
412
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
-
431
413
## Feedback wanted
432
414
433
415
Donna is still young and has multiple experimental features — I really appreciate any feedback, ideas, and contributions to make it better.
0 commit comments