agent-contracts 0.14.0 → 0.15.0

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 CHANGED
@@ -180,6 +180,7 @@ An **Agent** defines who an execution entity is:
180
180
  * permissions
181
181
  * constraints
182
182
  * behavioral rules
183
+ * structured content sections (reference material, procedures, criteria)
183
184
 
184
185
  ### Task
185
186
 
@@ -317,6 +318,7 @@ Design regressions become testable.
317
318
  ## Features
318
319
 
319
320
  * **Declarative YAML DSL** for multi-agent development workflows
321
+ * **Agent `sections`** for embedding structured reference material, procedures, and criteria directly in agent definitions
320
322
  * **Static schema validation**
321
323
  * **Reference integrity checks**
322
324
  * **Semantic linting**
@@ -574,9 +576,11 @@ agents:
574
576
  constraints:
575
577
  - "Never write code directly"
576
578
 
577
- x-identity: |
578
- You act as the Architect. You NEVER implement or test directly.
579
- Instead you delegate to specialist sub-agents.
579
+ sections:
580
+ - title: "Delegation Protocol"
581
+ content: |
582
+ You act as the Architect. You NEVER implement or test directly.
583
+ Instead you delegate to specialist sub-agents.
580
584
  ````
581
585
 
582
586
  ---
@@ -912,6 +916,8 @@ npx agent-contracts
912
916
  The `[path]` argument defaults to `agent-contracts.yaml` in the current directory.
913
917
  If `-c` / `--config` is specified, the DSL path from the config file is used.
914
918
 
919
+ All commands also accept `--team <id>` to limit execution to a single team when using a [multi-team configuration](#multi-team-configuration).
920
+
915
921
  #### `resolve` options
916
922
 
917
923
  | Option | Description |
@@ -919,6 +925,7 @@ If `-c` / `--config` is specified, the DSL path from the config file is used.
919
925
  | `--format <text\|json>` | Output format (default: `text`) |
920
926
  | `--expand-defaults` | Expand all Zod default values in output. Fields like `required_validations: []`, `tags: []`, and `can_read_artifacts: []` are written explicitly instead of being silently applied by schema defaults. |
921
927
  | `-c, --config <path>` | Path to `agent-contracts.config.yaml` |
928
+ | `--team <id>` | Limit to one team (multi-team config only) |
922
929
 
923
930
  #### `score` options
924
931
 
@@ -927,6 +934,7 @@ If `-c` / `--config` is specified, the DSL path from the config file is used.
927
934
  | `--format <text\|json>` | Output format (default: `text`) |
928
935
  | `--threshold <number>` | Minimum score; exit 1 if below (for CI gates) |
929
936
  | `-c, --config <path>` | Path to `agent-contracts.config.yaml` |
937
+ | `--team <id>` | Limit to one team (multi-team config only) |
930
938
 
931
939
  The score command evaluates 7 dimensions:
932
940
 
@@ -990,6 +998,60 @@ This lets you generate static outputs for:
990
998
 
991
999
  all from the same resolved DSL.
992
1000
 
1001
+ ### Multi-team configuration
1002
+
1003
+ When several teams (for example backend, QA, infra) are managed from one workspace, you can list every team in a single config file instead of maintaining separate configs.
1004
+
1005
+ ````yaml
1006
+ teams:
1007
+ _defaults:
1008
+ bindings:
1009
+ - ./bindings/cursor.yaml
1010
+ vars:
1011
+ language: TypeScript
1012
+ paths:
1013
+ cursor_root: .cursor
1014
+ active_guardrail_policy: default-enforcement
1015
+
1016
+ backend:
1017
+ dsl: ./teams/backend/agent-contracts.yaml
1018
+ interface_output: ./teams/backend/team-interface.yaml
1019
+ bindings:
1020
+ - ./teams/backend/bindings/observability.yaml
1021
+ vars:
1022
+ team_name: backend
1023
+
1024
+ qa:
1025
+ dsl: ./teams/qa/agent-contracts.yaml
1026
+ vars:
1027
+ team_name: qa
1028
+ ````
1029
+
1030
+ **`_defaults`:** Reserved meta-entry in the `teams` map. It uses the same schema as team entries except `dsl` is not required. Values are inherited by all teams. The underscore prefix avoids colliding with real team IDs.
1031
+
1032
+ **Merge with `_defaults`:**
1033
+
1034
+ * `bindings` — `_defaults` bindings are prepended before team-specific bindings
1035
+ * `vars` — shallow merge; team values win
1036
+ * `paths` — shallow merge; team values win
1037
+ * `active_guardrail_policy` — team wins when present
1038
+
1039
+ All commands accept `--team <id>` to run against a single team:
1040
+
1041
+ ````bash
1042
+ agent-contracts validate -c config.yaml # all teams
1043
+ agent-contracts validate -c config.yaml --team backend # one team
1044
+ agent-contracts check -c config.yaml --team qa # one team
1045
+ ````
1046
+
1047
+ The `check` command also validates that imported interface files exist on disk (cross-team references).
1048
+
1049
+ **Design constraints:**
1050
+
1051
+ * `dsl` and `teams` are mutually exclusive at the config root
1052
+ * Every team except `_defaults` must specify `dsl`
1053
+ * Existing single-team configs (top-level `dsl` only) remain valid unchanged
1054
+
993
1055
  ### Render target options
994
1056
 
995
1057
  Each entry in `renders` supports these fields: