feat: workflow marketplace v0 — catalog, JSON endpoint, CLI search/install#1624
Conversation
PIV Task 1: Create marketplace.ts with MarketplaceEntry interface, tagConfig, VALID_HOSTS, and 4 seed entries pinned to SHA 69b2c89.
PIV Tasks 2-5: Standalone Astro catalog page with client-side filter, dynamic detail pages via getStaticPaths, workflows.json endpoint, and sidebar entry in astro.config.mjs.
PIV Tasks 6-7: Add workflowSearchCommand (fetches workflows.json, filters by query) and workflowInstallCommand (downloads YAML at pinned SHA, writes to .archon/workflows/). Wire in cli.ts with early-exit for search (no git required) and install case in switch.
PIV Tasks 8-10: Bun lint script validates slug uniqueness, host allowlist, and SHA+file existence. GitHub Action runs on PRs touching marketplace.ts. CONTRIBUTING.md documents submission process.
- Validate slug against ^[a-z0-9-]+$ before path construction to prevent path traversal when ARCHON_MARKETPLACE_URL points to an untrusted server - Validate required fields (slug, sourceUrl, tags) on each marketplace entry in fetchMarketplace() to surface clear errors on malformed responses Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Changes: - workflowInstallCommand now handles both blob (single-file) and tree (directory) URLs - Directory installs fetch GitHub Contents API listing and install files by convention (commands/ → .archon/commands/, scripts/ → .archon/scripts/, etc.) - Main workflow identified by slug-matching filename or sole .yaml in directory root - Lint script validates directory entries via GitHub Contents API instead of raw URL - Updated MarketplaceEntry.sourceUrl comment to reflect file-or-directory semantics - CONTRIBUTING.md documents both single-file and directory submission formats Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (10)
📝 WalkthroughWalkthroughThis PR introduces a complete marketplace system for Archon workflows. It adds a data-driven marketplace with CLI search and install commands, a browsable web UI with filtering, automated validation, and comprehensive contributor documentation. All marketplace entries are pinned to specific commit SHAs for security and reproducibility. ChangesMarketplace Feature
🎯 4 (Complex) | ⏱️ ~60 minutes
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
The directory install code used `subdir.name` and `file.name` from the GitHub Contents API directly in path joins. Add an `isSafePathComponent` guard that rejects `.`, `..`, and any name containing path separators or non-portable characters before using it. Same defense-in-depth pattern as the existing slug validation in `workflowInstallCommand`.
…low-marketplace-v0 # Conflicts: # packages/docs-web/astro.config.mjs
…stall (coleam00#1624) * feat(docs-web): add marketplace data registry PIV Task 1: Create marketplace.ts with MarketplaceEntry interface, tagConfig, VALID_HOSTS, and 4 seed entries pinned to SHA 69b2c89. * feat(docs-web): add marketplace catalog, detail pages, and JSON endpoint PIV Tasks 2-5: Standalone Astro catalog page with client-side filter, dynamic detail pages via getStaticPaths, workflows.json endpoint, and sidebar entry in astro.config.mjs. * feat(cli): add workflow search and install marketplace commands PIV Tasks 6-7: Add workflowSearchCommand (fetches workflows.json, filters by query) and workflowInstallCommand (downloads YAML at pinned SHA, writes to .archon/workflows/). Wire in cli.ts with early-exit for search (no git required) and install case in switch. * feat: add marketplace lint script, GitHub Action, and contributing guide PIV Tasks 8-10: Bun lint script validates slug uniqueness, host allowlist, and SHA+file existence. GitHub Action runs on PRs touching marketplace.ts. CONTRIBUTING.md documents submission process. * fix(cli): validate marketplace slug and entry fields before install - Validate slug against ^[a-z0-9-]+$ before path construction to prevent path traversal when ARCHON_MARKETPLACE_URL points to an untrusted server - Validate required fields (slug, sourceUrl, tags) on each marketplace entry in fetchMarketplace() to surface clear errors on malformed responses Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * feat(cli): support directory-based marketplace installs Changes: - workflowInstallCommand now handles both blob (single-file) and tree (directory) URLs - Directory installs fetch GitHub Contents API listing and install files by convention (commands/ → .archon/commands/, scripts/ → .archon/scripts/, etc.) - Main workflow identified by slug-matching filename or sole .yaml in directory root - Lint script validates directory entries via GitHub Contents API instead of raw URL - Updated MarketplaceEntry.sourceUrl comment to reflect file-or-directory semantics - CONTRIBUTING.md documents both single-file and directory submission formats Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix(cli): validate path components from GitHub API in directory install The directory install code used `subdir.name` and `file.name` from the GitHub Contents API directly in path joins. Add an `isSafePathComponent` guard that rejects `.`, `..`, and any name containing path separators or non-portable characters before using it. Same defense-in-depth pattern as the existing slug validation in `workflowInstallCommand`. --------- Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
Summary
workflow search/workflow install), a PR-gated lint Action, and a CONTRIBUTING.md section.UX Journey
Before
After
Architecture Diagram
Before
After
Connection inventory:
Label Snapshot
risk: lowsize: Lcli,docs,cicli:workflow,docs-web:marketplaceChange Metadata
featuremultiLinked Issue
Validation Evidence (required)
Security Impact (required)
workflow installwrites files to.archon/workflows/andworkflow searchfetches from the networkarchon.diy/workflows.json(overridable viaARCHON_MARKETPLACE_URL)workflow installwrites to the repo's.archon/workflows/directoryRisk and mitigation:
github.comsources permitted)--forcerequired to overwrite existing files (default throws)ARCHON_MARKETPLACE_URLenv var enables local testing without DNS dependencyCompatibility / Migration
ARCHON_MARKETPLACE_URLenv var)Human Verification (required)
workflow installwith--forceflag, missing git repo error path, bad slug error messagearchon.diydeployment (docs site not deployed yet); CLI end-to-end against live URLSide Effects / Blast Radius (required)
ARCHON_MARKETPLACE_URLoverride for offline/local testingRollback Plan (required)
ARCHON_MARKETPLACE_URLcan point to an empty[]array endpoint to effectively disableworkflow search/workflow installthrow on network failure with descriptive errorRisks and Mitigations
devevolves (seed entries point to69b2c89)archon.diynot deployed when CLI shipsARCHON_MARKETPLACE_URLenv override; CLI fails fast with descriptive errorfeat/roadmapRoadmap nav link is dead if that branch hasn't mergedSummary by CodeRabbit
New Features
workflow searchto find marketplace workflows andworkflow install <slug>to install themDocumentation
Chores