agent-contracts 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.
- package/README.md +55 -11
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -2,6 +2,50 @@
|
|
|
2
2
|
|
|
3
3
|
A toolkit for declaratively defining multi-agent development workflows in **YAML DSL**, with static validation, linting, and prompt rendering.
|
|
4
4
|
|
|
5
|
+
Designed for teams building multi-agent coding or review workflows that need static guarantees on agent roles, handoffs, and artifact ownership.
|
|
6
|
+
|
|
7
|
+
## Quick Start
|
|
8
|
+
|
|
9
|
+
Define your agents, tasks, and artifacts in a single YAML file:
|
|
10
|
+
|
|
11
|
+
```yaml
|
|
12
|
+
# agent-contracts.yaml
|
|
13
|
+
version: 1
|
|
14
|
+
system:
|
|
15
|
+
id: my-project
|
|
16
|
+
name: My Agent Workflow
|
|
17
|
+
|
|
18
|
+
agents:
|
|
19
|
+
- id: architect
|
|
20
|
+
role_name: "Architect"
|
|
21
|
+
purpose: "Drive phases and delegate work"
|
|
22
|
+
can_invoke_agents: [implementer]
|
|
23
|
+
|
|
24
|
+
- id: implementer
|
|
25
|
+
role_name: "Implementer"
|
|
26
|
+
purpose: "Implement features based on specs"
|
|
27
|
+
|
|
28
|
+
tasks:
|
|
29
|
+
- id: implement-feature
|
|
30
|
+
target_agent: implementer
|
|
31
|
+
allowed_from_agents: [architect]
|
|
32
|
+
phase: implement
|
|
33
|
+
input_artifacts: [spec-md]
|
|
34
|
+
|
|
35
|
+
artifacts:
|
|
36
|
+
- id: spec-md
|
|
37
|
+
type: document
|
|
38
|
+
owner: architect
|
|
39
|
+
consumers: [implementer]
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
Then validate and render:
|
|
43
|
+
|
|
44
|
+
```bash
|
|
45
|
+
agent-contracts validate ./my-project
|
|
46
|
+
agent-contracts render ./my-project --template-dir ./templates --output-dir ./rendered
|
|
47
|
+
```
|
|
48
|
+
|
|
5
49
|
## Features
|
|
6
50
|
|
|
7
51
|
- **Define agent responsibilities, permissions, and handoff relationships** in structured YAML
|
|
@@ -20,8 +64,8 @@ Just as OpenAPI represents "API contracts," agent-contracts expresses **the enti
|
|
|
20
64
|
| Layer | Role | Defined in |
|
|
21
65
|
|---|---|---|
|
|
22
66
|
| **Agent** | Capability declaration and general behavioral spec of the execution entity | `agents` |
|
|
23
|
-
| **Task** |
|
|
24
|
-
| **Handoff** | A concrete delegation instance | Generated at runtime |
|
|
67
|
+
| **Task** | A type of work that can be delegated to an agent, with task-specific behavioral spec | `tasks` |
|
|
68
|
+
| **Handoff** | A concrete delegation instance (runtime object, not predefined in YAML) | Generated at runtime |
|
|
25
69
|
|
|
26
70
|
### Definition Inheritance and Override
|
|
27
71
|
|
|
@@ -32,7 +76,7 @@ base definition (shared team definition)
|
|
|
32
76
|
→ resolved YAML (final result)
|
|
33
77
|
```
|
|
34
78
|
|
|
35
|
-
|
|
79
|
+
Inheritance is currently modeled as two layers: base and project. Priority: **project > base**.
|
|
36
80
|
|
|
37
81
|
---
|
|
38
82
|
|
|
@@ -71,7 +115,7 @@ policies: []
|
|
|
71
115
|
**Single-file format** — All sections in one YAML file:
|
|
72
116
|
|
|
73
117
|
```yaml
|
|
74
|
-
#
|
|
118
|
+
# agent-contracts.yaml
|
|
75
119
|
version: 1
|
|
76
120
|
system: { ... }
|
|
77
121
|
agents: [...]
|
|
@@ -82,7 +126,7 @@ artifacts: [...]
|
|
|
82
126
|
**Multi-file format** — Entry point references split files via `$ref`:
|
|
83
127
|
|
|
84
128
|
```yaml
|
|
85
|
-
#
|
|
129
|
+
# agent-contracts.yaml
|
|
86
130
|
version: 1
|
|
87
131
|
extends: "@agent-contracts/base-team"
|
|
88
132
|
system:
|
|
@@ -261,7 +305,7 @@ agents:
|
|
|
261
305
|
globs: ["**/*"]
|
|
262
306
|
```
|
|
263
307
|
|
|
264
|
-
- `x-` properties
|
|
308
|
+
- `x-` properties are ignored by the schema validator for type enforcement
|
|
265
309
|
- Same merge rules and operators as standard properties apply during `extends` inheritance
|
|
266
310
|
- Included in the Prompt Renderer template context
|
|
267
311
|
|
|
@@ -286,14 +330,14 @@ npx agent-contracts # Direct execution
|
|
|
286
330
|
| `agent-contracts lint [dir]` | Run semantic lint. Display diagnostics and control exit code by severity |
|
|
287
331
|
| `agent-contracts render [dir]` | Generate prompt md from resolved YAML + Handlebars templates |
|
|
288
332
|
| `agent-contracts render [dir] --check` | Drift check. Detect diffs without writing files; exit 1 if diffs found |
|
|
333
|
+
| `agent-contracts check [dir]` | Run resolve → validate → lint → render --check in sequence (for CI) |
|
|
289
334
|
|
|
290
|
-
###
|
|
335
|
+
### Options for `render` / `check`
|
|
291
336
|
|
|
292
337
|
| Option | Description |
|
|
293
338
|
|---|---|
|
|
294
339
|
| `--template-dir <path>` | Handlebars template directory (required) |
|
|
295
340
|
| `--output-dir <path>` | Output directory (required) |
|
|
296
|
-
| `agent-contracts check [dir]` | Run resolve → validate → lint → render --check in sequence (for CI) |
|
|
297
341
|
|
|
298
342
|
### Common Options
|
|
299
343
|
|
|
@@ -347,7 +391,7 @@ agent-contracts resolve ./project/ -o ./resolved.yaml
|
|
|
347
391
|
|
|
348
392
|
```text
|
|
349
393
|
1. Define DSL in YAML
|
|
350
|
-
├──
|
|
394
|
+
├── agent-contracts.yaml (entry point; references base via extends)
|
|
351
395
|
└── agents.yaml, tasks.yaml, ... (for multi-file format)
|
|
352
396
|
|
|
353
397
|
2. agent-contracts resolve
|
|
@@ -370,7 +414,7 @@ agent-contracts resolve ./project/ -o ./resolved.yaml
|
|
|
370
414
|
|
|
371
415
|
## Prompt Rendering
|
|
372
416
|
|
|
373
|
-
Generates static
|
|
417
|
+
Generates one static Markdown file per agent from resolved YAML and Handlebars templates. Files are written to the directory specified by `render --output-dir`. The output serves as the system prompt or instruction document for each agent, containing its responsibilities, constraints, available tools, and delegatable tasks — all derived from the YAML definitions.
|
|
374
418
|
|
|
375
419
|
### Template Context
|
|
376
420
|
|
|
@@ -424,7 +468,7 @@ agent-contracts separates validation into 3 layers.
|
|
|
424
468
|
- Handoff payload shape validation
|
|
425
469
|
- Naming conventions
|
|
426
470
|
|
|
427
|
-
### B. Reference
|
|
471
|
+
### B. Reference Integrity Checks
|
|
428
472
|
|
|
429
473
|
- ID reference integrity across agents / tasks / artifacts / tools / validations
|
|
430
474
|
- Existence check for owner, producers, editors, consumers references
|
package/dist/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const VERSION = "0.0.
|
|
1
|
+
export declare const VERSION = "0.0.2";
|
|
2
2
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export const VERSION = "0.0.
|
|
1
|
+
export const VERSION = "0.0.2";
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
package/package.json
CHANGED