Skip to main content

Contribution & Governance

Version: 0.1 (Phase 0 — Spec & Design) Status: Draft Last Updated: 2026-03-02 Depends on: All other spec documents

1. Repository Ownership​

Each top-level directory has a designated owner responsible for code review and architectural decisions.

DirectoryOwnerResponsibility
cli/CLI TeamCLI commands, TypeScript build, UX
api_gateway/Platform TeamFastAPI routes, auth, WebSocket handlers
orchestrator/Platform TeamTemporal workflows, agent scheduling
twin_core/Platform TeamNeo4j graph engine, versioning, constraints
skill_registry/Platform TeamRegistry, loader, schema validation
domain_agents/Agent TeamAgent implementations, domain skills
mcp_core/Platform TeamMCP client, wire protocol
tool_registry/Platform TeamTool catalog, execution engine, adapters
ide_assistants/IDE TeamVS Code, KiCad, FreeCAD extensions
tests/All TeamsCross-cutting tests (unit, integration, e2e)
docs/All TeamsSpecifications, guides

2. Branching Strategy​

Branch Naming​

PatternPurposeExample
mainStable, reviewed code only—
feat/<issue-id>/<short-desc>New featuresfeat/met-8/mechanical-agent
fix/<issue-id>/<short-desc>Bug fixesfix/met-42/twin-merge-conflict
met-<id>/<short-desc>Linear issue workmet-40/phase-0-specs
docs/<short-desc>Documentation changesdocs/skill-spec-update
release/v<version>Release preparationrelease/v0.1.0

Rules​

  1. Never commit directly to main. All changes go through pull requests.
  2. Feature branches are created from main and merged back via PR.
  3. Branches are deleted after merge.
  4. Rebase before merge to keep linear history (no merge commits).

Pull Request Requirements​

RequirementDetails
ReviewersAt least 1 approval from directory owner
TestsAll existing tests pass; new code includes tests
Lintruff check . passes (Python) or eslint passes (TypeScript)
Typesmypy . passes (Python, strict mode) or tsc --noEmit (TypeScript)
DocsPublic API changes include docstring updates
LinearPR description references Linear issue (e.g., "Closes MET-42")

3. Contributing a New Skill​

Follow the complete guide in skill_spec.md Section 12. Summary checklist:

Checklist​

  • Linear issue created under the appropriate agent epic
  • Directory created: domain_agents/<domain>/skills/<skill_name>/
  • definition.json follows schema (see skill_spec.md Section 3)
  • schema.py with Pydantic input/output models, all fields have descriptions
  • handler.py subclasses SkillBase, implements execute()
  • tests.py with pytest async tests — happy path, error path, edge cases
  • SKILL.md with human-readable documentation
  • All tool access goes through self.context.mcp.invoke() (never direct calls)
  • Tests pass: pytest domain_agents/<domain>/skills/<skill_name>/tests.py
  • Lint passes: ruff check domain_agents/<domain>/skills/<skill_name>/
  • Types pass: mypy domain_agents/<domain>/skills/<skill_name>/
  • PR created with "Closes MET-XX" in description

4. Contributing a New Tool Adapter​

Follow the Tool Adapter SDK guide in mcp_spec.md Section 9.

Checklist​

  • Linear issue created under MET-7 (MCP Infrastructure)
  • Directory created: tool_registry/tools/<adapter_name>/
  • server.py subclasses McpToolServer, registers tool manifests
  • Dockerfile with tool binary installed, workspace volume, no network
  • requirements.txt with Python dependencies
  • tests/test_server.py with pytest tests (mock tool binary for unit tests)
  • Tool manifests include accurate input_schema and output_schema
  • Resource limits set appropriately for the tool
  • Docker image builds: docker build -t metaforge/adapter-<name>:0.1 .
  • Integration test: tool responds to health/check and tool/list
  • PR created with "Closes MET-XX" in description

5. Contributing a New Agent​

Checklist​

  • Linear epic created for the new agent
  • Discipline verified in 25-discipline framework (roadmap.md Section 6)
  • Phase assignment confirmed (don't implement Phase 2+ agents in Phase 1)
  • Directory created: domain_agents/<domain>/
  • Agent implementation using PydanticAI Agent class
  • System prompt written for the domain
  • At least 3 skills implemented (following skill checklist above)
  • Agent registered with the orchestrator
  • Integration test: agent can execute a skill and update the Twin
  • PR created with "Closes MET-XX" in description

6. Spec Change Process​

Specification documents (docs/*.md) are living documents. Changes follow an RFC process:

Process​

  1. Propose: Create a Linear issue with label RFC describing the change and rationale.
  2. Discuss: Team reviews the issue. Comments and alternatives are discussed.
  3. Decide: Issue author updates the proposal based on feedback. A team member approves.
  4. Implement: Author creates a PR with the spec change. PR references the RFC issue.
  5. Merge: PR is reviewed and merged. RFC issue is closed.

Rules​

  • Spec changes that affect multiple documents must update all affected docs in the same PR.
  • Breaking changes to the Twin schema, Skill spec, or MCP spec require ADR (Architecture Decision Record).
  • ADRs are numbered sequentially (ADR-001, ADR-002, ...) and stored in docs/adr/.

7. Coding Standards​

Python (Platform Core)​

ToolConfigurationEnforcement
Ruffruff.toml in repo rootCI check, pre-commit hook
mypyStrict mode (--strict)CI check
Pydanticv2 with model_config = ConfigDict(strict=True) where appropriateRuntime validation
pytestAsync tests with pytest-asyncioCI required
structlogStructured JSON loggingRequired for all modules

Python Style Rules​

  • Type hints: All function signatures must have type annotations.
  • Docstrings: All public classes and functions must have docstrings (Google style).
  • Imports: Use absolute imports. No wildcard imports.
  • Async: Use async/await for all I/O operations.
  • Models: Use Pydantic BaseModel for all data structures that cross module boundaries.
  • Errors: Use domain-specific exception classes, not bare Exception.
  • Tests: Minimum 80% coverage for new code. Use pytest.mark.asyncio for async tests.

Node.js / TypeScript (CLI Only)​

ToolConfigurationEnforcement
TypeScriptStrict mode (strict: true in tsconfig.json)CI check
ESLinteslint.config.js in cli/CI check, pre-commit hook
Prettier.prettierrc in cli/CI check, pre-commit hook
JestTest runner for CLI commandsCI required

TypeScript Style Rules​

  • Strict mode: No any types. Explicit return types on exported functions.
  • Naming: camelCase for variables/functions, PascalCase for types/classes.
  • Imports: ES module imports. No require().

8. Linear Workflow​

Issue Lifecycle​

Code
Backlog → Todo → In Progress → In Review → Done
StatusMeaning
BacklogIdentified but not prioritized
TodoPrioritized for current phase
In ProgressActively being worked on (branch created)
In ReviewPR created, awaiting review
DonePR merged, issue closed

Issue Labels​

LabelPurpose
EpicParent issue grouping related work
Phase 0 / Phase 1 / Phase 2 / Phase 3Phase assignment
DocumentationDocumentation task
RFCSpecification change proposal
BugBug report
EnhancementFeature improvement
Tech DebtTechnical debt cleanup
BlockedCannot proceed (add comment explaining why)

Epic Structure​

EpicScopePhase
MET-40Phase 0: Specification documentsPhase 0
MET-5Digital Twin CorePhase 1
MET-6Skill SystemPhase 1
MET-7MCP InfrastructurePhase 1-2
MET-8Mechanical Agent (first vertical)Phase 1
MET-9Electronics AgentPhase 2
MET-10Assistant Layer (IDE extensions)Phase 2-3

9. Release Process​

Versioning​

MetaForge follows Semantic Versioning:

  • v0.x.y: Pre-1.0 development. Minor bumps may include breaking changes.
  • v1.0.0: First stable release (end of Phase 3).

Phase Gates​

Each phase version increment requires:

GateRequirement
All epics for the phase are DoneLinear epic status = Done
Test coverage ≥ 80%CI coverage report
All P0/P1 bugs resolvedNo open Critical/High bugs
Spec documents up to datedocs/ matches implementation
CHANGELOG.md updatedSummarizes changes since last release
Release branch createdrelease/v<version> branch
Tag createdv<version> tag on merge to main

Release Steps​

  1. Create release branch: release/v0.1.0 from main.
  2. Update version numbers in pyproject.toml and cli/package.json.
  3. Update CHANGELOG.md.
  4. Create PR to main.
  5. After merge, tag: git tag v0.1.0.
  6. Push tag: git push origin v0.1.0.
  7. Create GitHub Release from tag with changelog contents.
MetaForge documentationGateway schema