ad-sdl/madsci/madsci-managers
Claude Code and agent skill by ad-sdl/madsci
- community
Checking that the SKILL.md file is still in the repository.
Working with MADSci manager services (Event, Experiment, Resource, Data, Workcell, Location, Lab). Use when creating, modifying, debugging, or configuring manager servers.
Install
npx vskill@latest install ad-sdl/madsci/madsci-managersSKILL.md
MADSci Manager Services
MADSci has 7 manager services, all built on AbstractManagerBase[SettingsT] with FastAPI via classy_fastapi.Routable. Each follows the pattern: Settings class -> Server class -> Client class.
Reference Files
Detailed material is in reference/. Read the relevant file when the task touches that area:
- Per-Manager Notes — domain-specific notes for each of the 7 managers (Event/Experiment/Resource/Data/Workcell/Location/Lab). See reference/managers.md.
- Database Handler Reference — the 4 handler ABCs and their real + in-memory implementations. See reference/db-handlers.md.
Key Files
| File | Purpose | |
|---|---|---|
src/madsci_common/madsci/common/manager_base.py | AbstractManagerBase - common server lifecycle, health, CORS, OTEL | |
src/madsci_common/madsci/common/types/manager_types.py | ManagerSettings, ManagerHealth base types | |
src/madsci_common/madsci/common/types/base_types.py | MadsciBaseSettings, prefixed_alias_generator() | |
src/madsci_common/madsci/common/db_handlers/ | 4 handler ABCs + real + in-memory implementations | |
src/madsci_*/madsci/*/*_server.py | Each manager's server implementation | |
src/madsci_client/madsci/client/ | All client implementations | |
src/madsci_client/madsci/client/client_mixin.py | MadsciClientMixin for lazy client access |
The 7 Managers
| Manager | Port | Database | Handler Params | Key Domain | |
|---|---|---|---|---|---|
| Lab (Squid) | 8000 | None | N/A | Dashboard, service discovery, health aggregation | |
| Event | 8001 | FerretDB | document_handler | Distributed event logging, retention, analytics | |
| Experiment | 8002 | FerretDB | document_handler | Experiment lifecycle (start/pause/cancel/end) | |
| Resource | 8003 | PostgreSQL | postgres_handler | Inventory, containers (Queue/Stack/Slot), templates | |
| Data | 8004 | FerretDB + S3 | document_handler, object_storage_handler | DataPoints (value/file), dual storage | |
| Workcell | 8005 | FerretDB + Valkey | document_handler, cache_handler | Workflow execution, scheduling, node coordination | |
| Location | 8006 | FerretDB + Valkey | document_handler, cache_handler | Location management, transfer planning, representations |
Manager Implementation Pattern
1. Settings Class
Key points:
env_prefix: Environment variable prefix (e.g.,MYMANAGER_SERVER_URL)prefixed_alias_generator: Enables prefixed keys in YAML (e.g.,mymanager_server_url)prefixed_model_validator: Accepts prefixed keys during model initialization- Code uses unprefixed names (
server_url), YAML/export uses prefixed (mymanager_server_url) model_dump(by_alias=True)-> prefixed keys;model_dump()-> unprefixed
2. Server Class
AbstractManagerBase provides:
GET /health-> callsget_health()GET /settings-> exports settings with secret redaction- CORS middleware (configurable)
- Rate limiting middleware
- OpenTelemetry instrumentation (if enabled)
- Ownership context middleware
- Registry identity resolution (stable IDs across restarts)
self.logger(EventClient) for structured loggingself.span(name, attributes)context manager for OTEL tracingcreate_server()andrun_server()for lifecycle management
3. Client Class
All clients have:
- Lazy HTTP session initialization
close()method for cleanup- Optional
EventClientinjection for logging - Configurable retry behavior
Settings and Configuration
Prefixed Alias System
Each manager uses prefixed_alias_generator() for YAML-friendly configuration:
Secret Marking and Redaction
Environment Variable Precedence
CLI args > init kwargs > env vars > .env > file secrets > JSON > TOML > YAML > field defaults
Deprecated: Manager Definition Types
All *ManagerDefinition classes (e.g., ManagerDefinition, LabManagerDefinition, WorkcellManagerDefinition) are deprecated as of v0.7.0 and will be removed. They emit MadsciDeprecationWarning on instantiation.
- Use `ManagerSettings` subclasses for all configuration (e.g.,
EventManagerSettings,WorkcellManagerSettings) - Use `WorkcellInfo` for workcell runtime state (not
WorkcellManagerDefinition) - Definition files (
*.manager.yaml) are replaced bysettings.yaml+ environment variables - Run
madsci migrateto convert legacy definition files
EventClient Dual Nature
EventClient serves as both a logging interface and an HTTP client:
Structured logging best practice:
Health Check Pattern
ManagerHealth uses model_config = ConfigDict(extra="allow") so subclasses can freely add fields.
Testing Managers
Critical test pattern: Always set enable_registry_resolution=False to prevent registry lockfile usage in tests.
OpenTelemetry Integration
Per-manager configuration via environment:
In code:
Common Pitfalls
- ULID not UUID: Use
new_ulid_str()for all IDs - prefixed vs unprefixed: Code uses
self.settings.server_url, YAML usesevent_server_url - `model_dump(by_alias=True)`: Produces prefixed keys for YAML export
- Registry in tests: Always
enable_registry_resolution=False - Handler injection: Pass handlers via constructor for dependency injection (production and test)
- FerretDB, not MongoDB: The system uses FerretDB (MongoDB wire protocol on PostgreSQL). pymongo client works unchanged.
- Valkey, not Redis: Drop-in Redis replacement. redis-py client works unchanged.
- EventClient recursive logging: Event Manager's own EventClient must have
event_server_url=None - AnyUrl trailing slash: All URLs stored via Pydantic AnyUrl get a trailing slash
- Secret fields: Use
json_schema_extra={"secret": True}orSecretStrtype
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewNot runA model review is scheduled for the next rescan.
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingsrc/madsci_common/madsci/common/bundled_templates/_skills/madsci-managers/SKILL.md
Popularity
- Repository stars
- 82
- Repository forks
- 11
- 7-day trend score
- 22
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/ad-sdl/madsci/madsci-managers)