Skip to content

feat: add SOD constraints to system-prompt and claude-code adapters#13

Merged
shreyas-lyzr merged 3 commits intoopen-gitagent:mainfrom
patel-lyzr:feat/sod-3-adapters
Feb 27, 2026
Merged

feat: add SOD constraints to system-prompt and claude-code adapters#13
shreyas-lyzr merged 3 commits intoopen-gitagent:mainfrom
patel-lyzr:feat/sod-3-adapters

Conversation

@patel-lyzr
Copy link
Contributor

Summary

Adds segregation of duties output to both export adapters:

  • system-prompt.ts: Exports SOD role assignments, conflict rules, handoff requirements, isolation constraints, and enforcement mode as natural language instructions. Also loads DUTIES.md content.
  • claude-code.ts: Includes SOD subsection in the Compliance section of generated CLAUDE.md. Loads DUTIES.md alongside SOUL.md and RULES.md.

Context

Part 3 of 4 for the SOD feature (#10). Depends on #12 (CLI commands).

Test plan

  • npm run build passes cleanly
  • node dist/index.js export --format system-prompt -d examples/full — includes SOD constraints
  • node dist/index.js export --format claude-code -d examples/full — includes SOD section

PR Stack

  1. Spec + Schema + Types (feat: add segregation of duties schema, types, and spec #11)
  2. CLI support (feat: add SOD validation, audit reporting, and init scaffolding #12)
  3. Adapter support (this PR)
  4. Examples + docs

🤖 Generated with Claude Code

Add the `segregation_of_duties` subsection to the compliance schema with
support for roles, conflict matrix, assignments, isolation levels,
handoff workflows, and enforcement modes.

- JSON Schema definition in agent-yaml.schema.json
- TypeScript types in loader.ts ComplianceConfig interface
- Spec documentation including DUTIES.md convention, validation rules,
  and regulatory reference table

Closes open-gitagent#10 (part 1 of 4)
- validate.ts: 16 validation rules for SOD (role uniqueness, conflict
  detection, assignment integrity, handoff validation, risk tier checks)
- audit.ts: new "Segregation of Duties" section in audit report
- init.ts: DUTIES.md scaffolding in full template

Part 2 of 4 — depends on feat/sod-1-spec-schema
- system-prompt.ts: exports SOD role assignments, conflict rules,
  handoff requirements, isolation constraints, and DUTIES.md content
- claude-code.ts: includes SOD subsection in Compliance output and
  loads DUTIES.md into generated CLAUDE.md

Part 3 of 4 — depends on feat/sod-2-cli-commands
Copy link
Contributor

@shreyas-lyzr shreyas-lyzr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Both adapters handle SOD cleanly:

  • system-prompt.ts: Natural language constraints that any LLM can follow — role assignments, conflict rules, handoff chains, isolation rules, enforcement mode. Good that it loads DUTIES.md too.
  • claude-code.ts: SOD subsection under Compliance in CLAUDE.md — consistent with how other compliance fields are already exported.

The for (const [a, b] of sod.conflicts) destructuring is clean. Handoff output using separator is readable.

Approving.

@shreyas-lyzr shreyas-lyzr merged commit 57ad3ce into open-gitagent:main Feb 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants