Skip to content

Commit 7157662

Browse files
docs: add integration author guide for contributors (#311)
1 parent 3b88941 commit 7157662

File tree

1 file changed

+81
-0
lines changed

1 file changed

+81
-0
lines changed

CONTRIBUTING.md

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,3 +99,84 @@ pytest tests/ -x -q
9999
## Licensing
100100

101101
By contributing to this project, you agree that your contributions will be licensed under the [MIT License](LICENSE).
102+
103+
## Integration Author Guide
104+
105+
This guide walks you through creating a new framework integration for Agent Governance Toolkit — from scaffolding to testing to publishing.
106+
107+
### Integration Package Structure
108+
109+
Each integration is a standalone package under `packages/agentmesh-integrations/`:
110+
111+
```
112+
packages/agentmesh-integrations/your-integration/
113+
├── pyproject.toml # Package metadata and dependencies
114+
├── README.md # Documentation with quick start
115+
├── LICENSE # MIT License
116+
├── your_integration/ # Source code
117+
│ ├── __init__.py
118+
│ └── ...
119+
└── tests/ # Test suite
120+
├── __init__.py
121+
└── test_your_integration.py
122+
```
123+
124+
### Key Interfaces to Implement
125+
126+
1. **VerificationIdentity**: Cryptographic identity for agents
127+
2. **TrustGatedTool**: Wrap tools with trust requirements
128+
3. **TrustedToolExecutor**: Execute tools with verification
129+
4. **TrustCallbackHandler**: Monitor trust events
130+
131+
See `packages/agentmesh-integrations/langchain-agentmesh/` for the best reference implementation.
132+
133+
### Writing Tests
134+
135+
- Mock external API calls and I/O operations
136+
- Use existing fixtures from `conftest.py` if available
137+
- Cover primary use cases and edge cases
138+
- Include integration tests for trust verification flows
139+
140+
Example test pattern:
141+
142+
```python
143+
def test_trust_gated_tool():
144+
identity = VerificationIdentity.generate('test-agent')
145+
tool = TrustGatedTool(mock_tool, required_capabilities=['test'])
146+
executor = TrustedToolExecutor(identity=identity)
147+
result = executor.invoke(tool, 'input')
148+
assert result is not None
149+
```
150+
151+
### Optional Dependency Pattern
152+
153+
Implement graceful fallback when dependencies are not installed:
154+
155+
```python
156+
try:
157+
import langchain_core
158+
except ImportError:
159+
raise ImportError(
160+
"langchain-core is required. Install with: "
161+
"pip install your-integration[langchain]"
162+
)
163+
```
164+
165+
### PR Readiness Checklist
166+
167+
Before submitting your integration PR:
168+
169+
- [ ] Package follows the structure outlined above
170+
- [ ] `pyproject.toml` includes proper metadata (name, version, description, author)
171+
- [ ] README.md includes installation instructions and quick start
172+
- [ ] All public APIs have docstrings
173+
- [ ] Tests pass: `pytest packages/your-integration/tests/`
174+
- [ ] Code follows PEP 8 and uses type hints
175+
- [ ] No *s or credentials committed
176+
- [ ] Dependencies are pinned to specific versions
177+
178+
### Questions?
179+
180+
- Review existing integrations in `packages/agentmesh-integrations/`
181+
- Open a [discussion](https://github.com/microsoft/agent-governance-toolkit/discussions) for design questions
182+
- Tag `@microsoft/agent-governance-team` for integration review

0 commit comments

Comments
 (0)