Create and manage photon marketplaces for teams, organizations, or public distribution.
- Overview
- Marketplace Types
- Creating a Marketplace
- Publishing Photons
- Quality Guidelines
- Manifest Format
- Versioning
- Discovery
- Private Marketplaces
Photon marketplaces are Git repositories containing .photon.ts files with a manifest that describes available photons. Users can add marketplaces and install photons with a single command:
# Add a marketplace
photon marketplace add my-team https://github.com/my-org/photons
# Install from marketplace
photon add my-team/analyticsThe default marketplace maintained by Portel:
photon add analytics # Installs from official marketplacePrivate or internal marketplaces for teams:
photon marketplace add acme https://github.com/acme-corp/mcp-tools
photon add acme/sales-reportShare your own photons:
photon marketplace add john https://github.com/john/my-photonsmkdir my-photons
cd my-photons
git init
photon maker initThis creates:
.marketplace/photons.json- Manifest file.githooks/pre-commit- Auto-sync manifest on commit
Create your photon files:
// analytics.photon.ts
/**
* Analytics Dashboard
* @description Track metrics and generate reports
* @icon mdi:chart-line
* @version 1.0.0
*/
export default class AnalyticsPhoton {
async getDailyMetrics() { ... }
async generateReport() { ... }
}photon maker syncThis scans all .photon.ts files and updates the manifest.
git config core.hooksPath .githooksNow the manifest auto-updates on every commit.
- Validation - Run
photon maker validate <name> - Documentation - Clear class-level JSDoc with description
- Icon - Add
@icontag for discoverability - Version - Add
@versiontag following semver - Tests - Include test methods or test files
- Security - Review for vulnerabilities (see SECURITY.md)
-
Create or update photon
# Create new photon photon maker new my-feature # Validate photon maker validate my-feature
-
Sync manifest
photon maker sync
-
Commit and push
git add -A git commit -m "feat: add my-feature photon" git push -
Users can now install
photon add my-marketplace/my-feature
Every photon should have:
/**
* Clear, Descriptive Name
*
* Detailed description explaining what this photon does,
* its use cases, and any requirements.
*
* ## Features
* - Feature 1: Description
* - Feature 2: Description
*
* ## Requirements
* - Requirement 1
* - Requirement 2
*
* @icon mdi:appropriate-icon
* @version 1.0.0
*/
export default class MyPhoton {
/**
* Tool description - what it does and when to use it
* @param input Clear parameter description
* @returns What the tool returns
*/
async myTool(params: { input: string }): Promise<Output> { ... }
}| Element | Convention | Example |
|---|---|---|
| File | kebab-case.photon.ts | sales-report.photon.ts |
| Class | PascalCase + Photon suffix | SalesReportPhoton |
| Methods | camelCase | generateReport |
| Parameters | camelCase | dateRange, includeCharts |
// Good: Informative errors
async getReport(params: { id: string }) {
const report = await this.db.get(params.id);
if (!report) {
throw new Error(`Report not found: ${params.id}`);
}
return report;
}
// Bad: Generic errors
async getReport(params: { id: string }) {
const report = await this.db.get(params.id);
if (!report) {
throw new Error('Error'); // Unhelpful!
}
return report;
}- Keep response times under 5 seconds for interactive tools
- Use progress indicators for long operations
- Implement pagination for large result sets
- Cache expensive computations when appropriate
The .marketplace/photons.json manifest:
{
"name": "my-photons",
"description": "My collection of photons",
"version": "1.0.0",
"photons": [
{
"name": "analytics",
"path": "analytics.photon.ts",
"description": "Track metrics and generate reports",
"icon": "mdi:chart-line",
"version": "1.0.0",
"tools": ["getDailyMetrics", "generateReport"],
"tags": ["analytics", "reporting", "metrics"]
},
{
"name": "notifications",
"path": "notifications.photon.ts",
"description": "Send notifications via multiple channels",
"icon": "mdi:bell",
"version": "1.2.0",
"tools": ["sendEmail", "sendSlack", "sendSMS"],
"tags": ["notifications", "messaging"]
}
]
}| Field | Required | Description |
|---|---|---|
| name | Yes | Marketplace identifier |
| description | Yes | What this marketplace provides |
| version | Yes | Marketplace version (semver) |
| photons | Yes | Array of photon entries |
| photons[].name | Yes | Photon identifier |
| photons[].path | Yes | Relative path to .photon.ts file |
| photons[].description | Yes | Short description |
| photons[].icon | No | Material Design Icons identifier |
| photons[].version | No | Photon version |
| photons[].tools | No | List of tool names |
| photons[].tags | No | Discovery tags |
Use semantic versioning in JSDoc:
/**
* My Photon
* @version 2.1.0
*/Version meaning:
- MAJOR (2.x.x): Breaking changes to tool interfaces
- MINOR (x.1.x): New tools, backward-compatible
- PATCH (x.x.1): Bug fixes, no interface changes
When making breaking changes:
- Deprecate first: Add
@deprecatedto old tools - Document migration: Explain how to update
- Support both: Keep old interface for one version
- Remove: After users have migrated
/**
* Old method - use newMethod instead
* @deprecated Use newMethod() which supports additional options
*/
async oldMethod(params: { query: string }) {
return this.newMethod({ query: params.query, limit: 10 });
}
/**
* New method with improved interface
* @version 2.0.0
*/
async newMethod(params: { query: string; limit?: number }) {
// Implementation
}Users find photons via search:
# Search official marketplace
photon search analytics
# Search specific marketplace
photon search my-team/salesAdd tags for discoverability:
/**
* Sales Analytics
* @tags analytics, sales, reporting, dashboard
*/Common categories:
| Category | Description |
|---|---|
| data | Data processing, ETL |
| api | External API integrations |
| productivity | Task management, notes |
| devops | CI/CD, infrastructure |
| communication | Email, Slack, notifications |
| finance | Payments, accounting |
| ai | AI/ML tools and utilities |
For private organization marketplaces:
# Add with SSH URL
photon marketplace add acme git@github.com:acme-corp/photons.git
# Or HTTPS with token
photon marketplace add acme https://token@github.com/acme-corp/photons.gitHost your own marketplace server:
- Serve the repository via HTTPS
- Ensure
.marketplace/photons.jsonis accessible - Configure authentication as needed
For enterprise deployments:
{
"access": {
"type": "private",
"allowedTeams": ["engineering", "data-science"],
"requireApproval": true
}
}photon maker sync --claude-codeThis creates:
.claude-plugin/marketplace.json- Plugin manifest.claude-plugin/tools/- Tool definitions
The hook auto-generates plugin files:
# .githooks/pre-commit
photon maker sync --claude-code
git add .claude-plugin/# Force regenerate
photon maker sync --force
# Check for errors
photon maker validate .# Check marketplace config
photon marketplace list
# Remove and re-add with correct credentials
photon marketplace remove my-marketplace
photon marketplace add my-marketplace <url># Show installed version
photon info my-photon
# Force upgrade
photon upgrade my-photon --force- GUIDE.md - Photon development guide
- SECURITY.md - Security best practices
- DEPLOYMENT.md - Deployment options