A template repository for creating managed service providers on the Codesphere platform. Clone this repo, describe what service you want to offer, and let the AI agent scaffold the entire provider for you — then register it with a single make command.
A landscape-based service provider transforms a Codesphere landscape into a reusable blueprint that others can instantiate as managed services. Each provider defines:
- Metadata — name, version, display name, category, description, icon
- Backend — Git repository URL and CI profile reference
- Configuration schemas — what users can configure (
configSchema), what secrets they must provide (secretsSchema), and what runtime details are exposed (detailsSchema)
When registered, your provider appears in the Codesphere Marketplace and can be deployed by any team with access.
| Requirement | Why |
|---|---|
| Codesphere account | To register and deploy providers |
CODESPHERE_API_TOKEN |
API Bearer token for authentication (set as env var) |
CODESPHERE_TEAM_ID |
Your team ID — for team-scoped providers (set as env var) |
CODESPHERE_URL |
Codesphere instance URL (default: https://codesphere.com) |
make |
Build automation |
yq (optional) |
YAML validation in scripts |
| Git provider configured | Git permissions in your Codesphere account settings |
git clone https://github.com/codesphere-cloud/ms-landscape-template.git my-provider
cd my-providerOpen the project in VS Code with GitHub Copilot enabled, then prompt:
"I want to create a landscape provider for PostgreSQL 16 with automated backups and a health check endpoint."
The agent will:
- Read the instructions in
.github/copilot-instructions.md - Follow the detailed schema in
.github/instructions/PROVIDER.instructions.mdand.github/instructions/CI.instructions.md - Generate
config/provider.ymlandconfig/ci.ymlfrom the examples - Scaffold any required source code in
src/
make validateThis checks your provider.yml and ci.yml against the expected schema and catches common mistakes before registration.
make registerThis calls the Codesphere API to register your provider with your team.
make testDeploys a test workspace with your provider and runs smoke tests.
ms-landscape-template/
├── README.md # This file
├── Makefile # validate, register, test commands
│
├── .github/
│ ├── copilot-instructions.md # Agent persona & workflow (auto-loaded)
│ └── instructions/
│ ├── PROVIDER.instructions.md # Provider definition schema & rules
│ └── CI.instructions.md # CI pipeline schema & rules
│
├── config/
│ ├── provider.yml.example # Example provider definition
│ └── ci.yml.example # Example CI pipeline config
│
├── scripts/
│ ├── validate.sh # Validate config files locally
│ ├── register.sh # Register provider via API
│ └── test-provider.sh # Smoke-test a deployed provider
│
└── src/ # Provider source code (agent-generated)
└── .gitkeep
| File | Purpose |
|---|---|
config/provider.yml |
Provider definition: metadata, backend, config/secrets/details schemas |
config/ci.yml |
CI pipeline: prepare, test, and run stages for the landscape |
.github/copilot-instructions.md |
Tells the AI agent what this project is and how to work in it |
.github/instructions/PROVIDER.instructions.md |
Detailed schema reference for provider.yml |
.github/instructions/CI.instructions.md |
Detailed schema reference for ci.yml |
The provider definition file. Describes your managed service metadata and configuration schemas:
name: mattermost # Unique name (lowercase, hyphens, underscores)
version: v1 # Version: v1, v2, etc. (NOT semver)
author: Your Team
displayName: Mattermost # Human-readable name for the Marketplace
category: collaboration # e.g., databases, messaging, monitoring
description: | # Markdown description
Open-source team messaging and collaboration platform.
backend:
landscape:
gitUrl: https://github.com/your-org/mattermost-landscape
ciProfile: production # CI profile name from ci.yml
configSchema: # User-configurable options → env vars
type: object
properties:
SITE_NAME:
type: string
description: Display name for your instance
MAX_USERS:
type: integer
description: Maximum number of users
x-update-constraint: increase-only
secretsSchema: # Secrets → stored in vault
type: object
properties:
ADMIN_PASSWORD:
type: string
format: password
detailsSchema: # Runtime details exposed after provisioning
type: object
properties:
hostname:
type: string
port:
type: integerKey concepts:
- Config values are referenced in ci.yml as
${{ workspace.env['NAME'] }} - Secrets are referenced in ci.yml as
${{ vault.SECRET_NAME }} - Use
x-update-constraint: increase-onlyorimmutableto restrict post-creation updates - Use
x-endpointin detailsSchema to fetch live data from the running service
The CI pipeline definition. Defines how to prepare the environment and orchestrate landscape services:
schemaVersion: v0.2
prepare: # Build stage — runs on Workspace compute
steps:
- name: Install Dependencies
command: nix-env -iA nixpkgs.nodejs
run: # Landscape services — run in parallel
webapp: # Codesphere Reactive
plan: 21
steps:
- command: npm start
env:
DB_HOST: ms-postgres-v1-42-primary-db
SECRET: ${{ vault.MY_SECRET }}
network:
ports:
- port: 3000
isPublic: false
paths:
- port: 3000
path: /
primary-db: # Managed Service from marketplace
provider:
name: postgres
version: v1
plan:
id: 0Key concepts:
prepareinstalls deps and builds assets on the shared filesystem (/home/user/app/)rundefines services: Reactives (steps), Managed Containers (baseImage), or Managed Services (provider)- Services communicate via private networking:
http://ws-server-[WorkspaceId]-[serviceName]:[port] - Environment templates:
${{ vault.NAME }},${{ workspace.env['KEY'] }},${{ workspace.id }},${{ team.id }}
Full ci.yml schema documented in
.github/instructions/CI.instructions.md
| Command | Description |
|---|---|
make validate |
Validate provider.yml and ci.yml syntax and schema |
make register |
Register the provider with Codesphere (requires CODESPHERE_API_TOKEN) |
make test |
Deploy a test instance and run smoke tests |
make clean |
Remove generated files |
make help |
Show all available commands |
This template is designed to be agent-first. The recommended workflow:
- Describe your service — Tell the agent what managed service you want to create
- Review generated configs — The agent creates
provider.ymlandci.yml - Add custom logic — If your service needs setup scripts or custom health checks, add them to
src/ - Validate — Run
make validateto catch issues - Register — Run
make registerto publish to Codesphere - Test — Run
make testto verify end-to-end
If you prefer to work without the agent:
- Copy
config/provider.yml.example→config/provider.yml - Copy
config/ci.yml.example→config/ci.yml - Edit both files following the schema in
.github/instructions/PROVIDER.instructions.md - Add any source code to
src/ - Run
make validate && make register
| Problem | Solution |
|---|---|
make validate fails with schema errors |
Check your YAML against the schema in PROVIDER.instructions.md |
make register returns 401 |
Verify CODESPHERE_API_TOKEN is set and valid |
make register returns 409 |
Provider name/version already registered — bump version or use a different name |
| Agent doesn't follow the template | Ensure .github/copilot-instructions.md exists and VS Code is using the workspace |
version validation fails |
Use v1, v2 format — NOT semver like 1.0.0 |
- Fork this repository
- Create a feature branch
- Make your changes
- Submit a pull request
MIT