Production-grade multi-agent workflow orchestration for product development. Every agent communicates through structured handoff packages. Zero human-readable prose. Zero ambiguity.
Problem: Multi-agent systems fail when agents communicate ambiguously, skip fields, or make implicit assumptions.
Solution:
- Every agent outputs the same structure:
INPUTS | TASKS | OUTPUTS | HANDOFF | BLOCKERS - Every handoff is validated against a strict JSON schema
- Agents cannot modify upstream packages (immutable)
- If required information is missing, agent returns
BLOCKED(stops workflow) - The GitHub Supply Chain Agent is the critical gatekeeper — nothing reaches production without explicit supply-chain validation
Creative Director
↓ (Opportunity Report)
Research Agent
↓ (Research Package)
Product Agent
↓ (Product Spec)
Design Agent
↓ (Design Package)
↓ + Dependencies declared
GitHub Supply Chain ← CRITICAL GATEKEEPER
↓ (GitHub Approval)
├─ Security audit
├─ License validation
├─ Maintenance scoring
├─ SBOM generation
└─ Version pinning
↓ (GitHub Package: approved or BLOCKED)
Builder Agent
↓ (Build Package)
Integration Agent
↓ (Integration Package)
QA Agent (parallel with Email Agent)
↓ (QA Sign-Off)
Launch Agent
↓ (Live + Monitoring)
The GitHub Supply Chain Agent is the single point of control that prevents:
- Unknown dependencies sneaking into production
- Security vulnerabilities from abandoned packages
- License conflicts
- Bundle bloat from unused packages
- Supply-chain attacks via malicious dependencies
- Dependency hell from unpinned versions
No code, component, or SDK reaches Builder without GitHub Supply Chain approval.
agents/
├── schemas/
│ ├── opportunity-report.json
│ ├── research-package.json
│ ├── product-spec.json
│ ├── design-package.json
│ ├── github-package.json
│ ├── build-package.json
│ └── launch-package.json
│
├── 00-creative-director.md
├── 01-research.md
├── 02-product.md
├── 03-design.md
├── 04-content.md
├── 05-github-supply-chain.md (CRITICAL)
├── 06-builder.md
├── 07-integration.md
├── 08-qa.md
├── 09-email.md
└── 10-launch.md
.github/workflows/
├── 01-research-pipeline.yml
├── 02-product-spec-validation.yml
├── 03-design-package-approval.yml
├── 05-github-supply-chain-gate.yml (CRITICAL)
├── 06-builder-stage.yml
└── 08-qa-sign-off.yml
config/
├── approved-sources.json (registry of all allowed packages)
├── design-system-versions.json
└── cms-schemas.json
.env.example
.gitignore
package.json
README.md (this file)
Every agent, regardless of role, outputs this JSON structure:
{
"agent": "agent-name",
"version": "1.0.0",
"timestamp": "2024-01-15T10:30:00Z",
"inputs": {
"upstream_package": { "...": "..." },
"validated": true
},
"tasks": [
"task 1 completed",
"task 2 completed"
],
"outputs": {
"primary_deliverable": "...",
"metadata": {}
},
"handoff": {
"next_agent": "next-agent-name",
"required_approvals": [],
"sla": "4 hours"
},
"blockers": [
{ "issue": "...", "action": "..." }
]
}If blockers is non-empty, the workflow stops. Next agent cannot proceed until issues are resolved upstream.
git clone https://github.com/Malphite10/Deterministic-Handoff-System.git
cd multi-agent-system
npm install
# Copy environment template
cp .env.example .env
# Edit .env with your API keys, GitHub tokens, etc.npm run validate-schemasThis checks:
- All JSON schemas are valid
- All agent markdown files declare required rules
- All handoff packages conform to schema
# Trigger via GitHub webhook (on PR or manual trigger)
# Or run locally:
npm run test-workflow -- agents/03-design.md < sample-input.json
# The output will be a JSON handoff package# Validate all sources before deploying
npm run validate-sources
# Build
npm run build
# Deploy (CI/CD pipelines defined in .github/workflows/)
npm run deployEvery agent markdown file MUST include this exact text:
You do not communicate with humans.
You communicate only through structured handoff packages.
You may not skip required fields.
You may not modify upstream packages.
You may only consume approved inputs.
If required information is missing, return BLOCKED.
These rules are non-negotiable. They enforce determinism.
Maintain a single source of truth for all approved packages:
{
"npm_packages": [
"react@18.2.0",
"@shadcn/ui@0.8.1",
"framer-motion@10.16.4"
],
"github_repositories": [
"owner/design-system#v1.2.0"
],
"framer_plugins": [
"framer-plugin-uuid-123"
],
"wix_extensions": [
"wix-extension-id-456"
],
"excluded_forever": [
"random-experimental-lib"
]
}Why this matters: Builder Agent validates every dependency against this list. Anything not approved → BLOCKED.
Runs when Design Package is submitted:
- Parse design dependencies
- Run security audit (npm audit, SNYK)
- Check maintenance score (commits, releases)
- Verify version pinning
- Generate SBOM
- Validate license compatibility
- Approve or BLOCK
If BLOCKED: Workflow stops. Returns to Design Agent with specific action items.
If APPROVED: Emits GitHub Package handoff. Builder Agent can proceed.
Runs when GitHub Package is approved:
- Parse GitHub Package
- Validate source policy (only approved sources)
- Install dependencies (pinned versions from lockfile)
- Build
- Run tests
- Generate build artifacts
- Emit Build Package handoff
Source Policy Check (non-negotiable):
const approved = require('./config/approved-sources.json');
const pkg = require('./package.json');
for (const [name, version] of Object.entries(pkg.dependencies)) {
const entry = `${name}@${version}`;
if (!approved.npm_packages.includes(entry)) {
throw new Error(`BLOCKED: ${entry} not in approved list`);
}
}npm run validate-schemasChecks:
- All schemas are valid JSON Schema v7
- No required fields are missing
- All agent markdown files include the critical rules
npm run validate-handoff -- <output-file.json>Checks:
- All required fields present
- All values conform to schema
- No upstream package modification detected
- Agent name is valid
npm run audit-approved-sourcesRuns:
- npm audit on all approved packages
- SNYK scan
- License check
- Maintenance scoring
- Identify the blocker: Check the
blockersarray in the handoff package - Root cause: Each blocker includes
issue,requirement, andaction - Resolution: Take action as specified (usually re-run upstream agent)
- Re-validate: Run validation script again
- Re-submit: Previous agent re-emits handoff package
- Proceed: Next agent resumes workflow
{
"blockers": [
{
"package": "some-experimental-lib",
"reason": "Not in APPROVED_SOURCES registry",
"requirement": "Remove dependency or request approval review",
"action": "Contact security team for review, or remove from design package"
}
]
}What happens: Design Agent must either:
- Remove the dependency from Figma/design package, OR
- Request formal review (creates GitHub issue for security team)
Once resolved, Design Agent re-submits package.
Before deploying to production:
- All workflows completed without BLOCKED status
- Build artifacts validated (bundle size, performance)
- QA sign-off obtained
- Email campaign approved (if applicable)
- Rollback procedure documented
- Monitoring dashboards ready
- Health checks passing
Each handoff package includes:
timestamp: When agent completed its worktasks: What was doneblockers: If any issues arose
Aggregate these across the entire workflow to get:
- Total time from Creative Director → Launch
- Bottleneck identification (which agent takes longest)
- Blocker frequency (which agent most likely to BLOCK)
- Success rate (% of workflows that complete vs. BLOCKED)
- ✓ Zero supply-chain incidents: No unknown dependencies in production
- ✓ Deterministic deployment: Same input → same output every time
- ✓ 100% audit traceability: Every decision logged with reasoning
- ✓ No rework: Workflows complete on first attempt (no re-runs due to mistakes)
Check the blockers array for the specific issue. Common causes:
- GitHub Supply Chain: Unapproved dependency → Request review or remove
- Builder: Source policy violation → Ensure all dependencies are approved
- QA: Test failure → Fix bug and re-run Builder
- Design: Accessibility issue → Fix in Figma and re-export
Check GitHub Actions logs for:
- API rate limiting
- Missing environment variables
- Network connectivity issues
Cause: Package.json has unpinned version (uses ^ or *).
Fix: Pin exact version in lockfile. Regenerate lockfile and commit.
Scenario 1: Design Agent declares dependency on experimental lib. GitHub Supply Chain validates, finds it's abandoned. BLOCKED. Design Agent removes it. Workflow resumes. Zero issues in production.
Scenario 2: Builder Agent attempts to use unreviewed npm package. Source policy validation fails. BLOCKED. Build fails to start. Design must re-request approval through proper channel.
Scenario 3: All agents complete without blockers. Code deploys to production with complete audit trail. Six months later, security audit is trivial — every decision is documented.
When adding a new agent:
- Create
NN-agent-name.mdinagents/directory - Include the critical rules at the top
- Define input schema in
agents/schemas/ - Create corresponding GitHub Actions workflow in
.github/workflows/ - Update
approved-sources.jsonwith any new dependencies - Run validation:
npm run validate-schemas - Test with sample input:
npm run test-workflow -- agents/NN-agent-name.md < sample.json
This repository is the single source of truth for all multi-agent workflows. Questions? Check the agent markdown files — they document everything.
CodeOwner-@Malphite10 https://github.com/Malphite10
The key insight: When agents can only communicate through immutable, validated handoff packages, failures are caught early, workflows are deterministic, and production is secure by construction.