Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
55 changes: 55 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: 'DevShelf Auto-Sync'
description: 'Validate .devshelf.yml and automatically sync your open-source tool or free API release with RitualDev-Lab/DevShelf'
author: 'RitualDev Lab'
branding:
icon: 'book-open'
color: 'purple'
inputs:
manifest_path:
description: 'Path to .devshelf.yml manifest file in your repository'
required: false
default: '.devshelf.yml'
github_token:
description: 'Optional GitHub PAT with repo write scope to open a direct sync PR on RitualDev-Lab/DevShelf'
required: false
default: ''
submission_endpoint:
description: 'DevShelf submission API endpoint fallback'
required: false
default: 'https://mcp.ritualdev.in/api/v1/devshelf/submit'
dry_run:
description: 'Validate and generate normalized shelf entry without remote network calls'
required: false
default: 'false'
outputs:
tool_name:
description: 'Normalized DevShelf tool name'
value: ${{ steps.sync.outputs.tool_name }}
valid:
description: 'Validation status (true/false)'
value: ${{ steps.sync.outputs.valid }}
sync_mode:
description: 'Sync path used (pr, api, issue_fallback, or dry_run)'
value: ${{ steps.sync.outputs.sync_mode }}
pr_url:
description: 'Created upstream PR URL when sync_mode=pr'
value: ${{ steps.sync.outputs.pr_url }}
issue_url:
description: 'Prefilled DevShelf submission URL'
value: ${{ steps.sync.outputs.issue_url }}
runs:
using: 'composite'
steps:
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '22'
- id: sync
name: Validate & Sync .devshelf.yml
shell: bash
env:
INPUT_MANIFEST_PATH: ${{ inputs.manifest_path }}
INPUT_GITHUB_TOKEN: ${{ inputs.github_token }}
INPUT_SUBMISSION_ENDPOINT: ${{ inputs.submission_endpoint }}
INPUT_DRY_RUN: ${{ inputs.dry_run }}
run: node "${{ github.action_path }}/scripts/action-entry.mjs"
2 changes: 1 addition & 1 deletion data/counts.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,5 @@
"testing-qa.json": 69
},
"reposCount": 407,
"updatedAt": "2026-12-05T02:19:16.502Z"
"updatedAt": "2026-12-05T02:28:31.959Z"
}
56 changes: 56 additions & 0 deletions scripts/action-entry.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
import fs from "node:fs";
import { syncDevShelfManifest } from "./manifest-parser.mjs";

async function main() {
const manifestPath = process.env.INPUT_MANIFEST_PATH || ".devshelf.yml";
const dryRun = String(process.env.INPUT_DRY_RUN || "false").toLowerCase() === "true";
const githubToken = process.env.INPUT_GITHUB_TOKEN || "";
const submissionEndpoint =
process.env.INPUT_SUBMISSION_ENDPOINT || "https://mcp.ritualdev.in/api/v1/devshelf/submit";

const result = await syncDevShelfManifest({
manifestPath,
dryRun,
githubToken,
submissionEndpoint,
});

if (process.env.GITHUB_OUTPUT) {
fs.appendFileSync(
process.env.GITHUB_OUTPUT,
`${[
`tool_name=${result.toolName}`,
`valid=${result.valid}`,
`sync_mode=${result.syncMode}`,
`pr_url=${result.prUrl || ""}`,
`issue_url=${result.issueUrl}`,
].join("\n")}\n`,
"utf8",
);
}

if (process.env.GITHUB_STEP_SUMMARY) {
const badgeMd = `[![Verified Free on DevShelf](https://devshelf.ritualdev.in/api/v1/badges/verified/${result.slug}.svg)](https://devshelf.ritualdev.in/tools/${result.slug}.html)`;
fs.appendFileSync(
process.env.GITHUB_STEP_SUMMARY,
[
`### 📚 DevShelf Auto-Sync (${result.toolName})`,
`- **Status**: Valid (\`${result.syncMode}\`)`,
`- **Target Shelf**: \`${result.targetShelfFile}\``,
result.prUrl
? `- **Upstream PR**: ${result.prUrl}`
: `- **Submission Link**: ${result.issueUrl}`,
`- **README Badge**: \`${badgeMd}\``,
"",
].join("\n"),
"utf8",
);
}

console.log(`✅ [DevShelf Action] Verified ${result.toolName} (mode=${result.syncMode})`);
}

main().catch((err) => {
console.error("❌ [DevShelf Action] Error:", err.message);
process.exit(1);
});
125 changes: 125 additions & 0 deletions scripts/generate-badges.ts
Original file line number Diff line number Diff line change
Expand Up @@ -409,12 +409,137 @@ export function generateSandboxBadgeSvg(
</svg>`;
}

export interface StackCardSpec {
slug: string;
presetKey?: string;
title: string;
subtitle: string;
items: string[];
}

export const CURATED_DEVSHELF_STACK_CARDS: StackCardSpec[] = [
{
slug: "zero-cost-saas-starter",
presetKey: "saas",
title: "Zero-Cost Indie SaaS Stack",
subtitle: "4 zero-paywall essentials • devshelf.ritualdev.in",
items: ["Supabase", "Resend", "Clerk", "Vercel"],
},
{
slug: "local-first-ai-agent-stack",
presetKey: "ai",
title: "Offline Local AI Agent Stack",
subtitle: "4 local-first AI tools • devshelf.ritualdev.in",
items: ["Ollama", "AgentShield", "SQLite MCP Server", "Playwright MCP Server"],
},
{
slug: "full-stack-typescript-foss",
presetKey: "fullstack",
title: "Full-Stack TypeScript FOSS",
subtitle: "4 open-source TS staples • devshelf.ritualdev.in",
items: ["Hono", "Drizzle ORM", "Biome", "Vitest"],
},
{
slug: "rust-systems-dev",
presetKey: "rust",
title: "Rust Systems Dev Stack",
subtitle: "4 blazing-fast CLI tools • devshelf.ritualdev.in",
items: ["uv", "just", "difftastic", "tokei"],
},
];

export function generateStackCardSvg(options: {
title?: string;
items?: string[];
subtitle?: string;
}): string {
const rawTitle = (options.title || "My DevShelf Tech Stack").trim();
const safeTitle = escapeXml(rawTitle.length > 44 ? `${rawTitle.slice(0, 42)}…` : rawTitle);
const cleanedItems = (Array.isArray(options.items) ? options.items : [])
.map((s) => String(s || "").trim())
.filter(Boolean);
const shown = cleanedItems.slice(0, 6);
const extraCount = Math.max(0, cleanedItems.length - shown.length);

const width = 560;
const rows = Math.max(1, Math.ceil((shown.length + (extraCount > 0 ? 1 : 0)) / 2));
const pillsStartY = 82;
const rowH = 38;
const height = 104 + rows * rowH;

const defaultSubtitle =
cleanedItems.length > 0
? `${cleanedItems.length} curated zero-paywall tools • devshelf.ritualdev.in`
: "Zero-Paywall Open-Source Stack • devshelf.ritualdev.in";
const safeSubtitle = escapeXml((options.subtitle || defaultSubtitle).slice(0, 72));

const pillNodes: string[] = [];
const totalSlots = shown.length + (extraCount > 0 ? 1 : 0);
for (let i = 0; i < totalSlots; i++) {
const col = i % 2;
const row = Math.floor(i / 2);
const x = 22 + col * 262;
const y = pillsStartY + row * rowH;
const isOverflow = i >= shown.length;
const labelRaw = isOverflow ? `+${extraCount} more tools` : shown[i];
const truncated = labelRaw.length > 28 ? `${labelRaw.slice(0, 26)}…` : labelRaw;
const stroke = isOverflow ? "#22d3ee" : "rgba(148, 163, 184, 0.28)";
const textFill = isOverflow ? "#22d3ee" : "#e2e8f0";
const dotFill = isOverflow ? "#22d3ee" : "#a855f7";

pillNodes.push(`
<rect x="${x}" y="${y}" width="250" height="29" rx="8" fill="rgba(15, 23, 42, 0.85)" stroke="${stroke}" stroke-width="1"/>
<circle cx="${x + 13}" cy="${y + 14.5}" r="3.5" fill="${dotFill}"/>
<text x="${x + 24}" y="${y + 18.5}" fill="${textFill}" font-size="11.5" font-weight="600" font-family="ui-monospace,SFMono-Regular,Menlo,Consolas,monospace">${escapeXml(truncated)}</text>`);
}

return `<svg xmlns="http://www.w3.org/2000/svg" width="${width}" height="${height}" viewBox="0 0 ${width} ${height}" fill="none" role="img" aria-label="${safeTitle} — ${safeSubtitle}">
<defs>
<linearGradient id="ds-stack-bg" x1="0" y1="0" x2="${width}" y2="${height}" gradientUnits="userSpaceOnUse">
<stop offset="0%" stop-color="#070b14"/>
<stop offset="100%" stop-color="#111827"/>
</linearGradient>
<linearGradient id="ds-stack-border" x1="0" y1="0" x2="${width}" y2="${height}" gradientUnits="userSpaceOnUse">
<stop offset="0%" stop-color="#a855f7" stop-opacity="0.75"/>
<stop offset="100%" stop-color="#22d3ee" stop-opacity="0.5"/>
</linearGradient>
</defs>
<rect width="${width}" height="${height}" rx="16" fill="url(#ds-stack-bg)"/>
<rect x="0.75" y="0.75" width="${width - 1.5}" height="${height - 1.5}" rx="15.25" stroke="url(#ds-stack-border)" stroke-width="1.5"/>
<rect x="22" y="18" width="132" height="22" rx="11" fill="rgba(15, 23, 42, 0.9)" stroke="#a855f7" stroke-opacity="0.45"/>
<text x="88" y="32.5" text-anchor="middle" fill="#c084fc" font-size="10.5" font-weight="700" font-family="-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,sans-serif">📚 DevShelf Stack</text>
<text x="${width - 22}" y="32.5" text-anchor="end" fill="#64748b" font-size="10" font-family="ui-monospace,monospace">devshelf.ritualdev.in/badges</text>
<text x="22" y="59" fill="#f8fafc" font-size="16" font-weight="800" font-family="-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,sans-serif">${safeTitle}</text>
<text x="22" y="74" fill="#94a3b8" font-size="11" font-family="ui-monospace,monospace">${safeSubtitle}</text>
${pillNodes.join("")}
</svg>`;
}

export async function buildStaticBadges() {
await fs.mkdir(BADGES_DIR, { recursive: true });
await fs.mkdir(path.join(BADGES_DIR, "uptime"), { recursive: true });
await fs.mkdir(path.join(BADGES_DIR, "verified"), { recursive: true });
await fs.mkdir(path.join(BADGES_DIR, "tokens"), { recursive: true });
await fs.mkdir(path.join(BADGES_DIR, "sandbox"), { recursive: true });
const stacksDir = path.join(BADGES_DIR, "stacks");
await fs.mkdir(stacksDir, { recursive: true });

for (const preset of CURATED_DEVSHELF_STACK_CARDS) {
const stackSvg = generateStackCardSvg(preset);
await fs.writeFile(path.join(stacksDir, `${preset.slug}.svg`), stackSvg, "utf8");
if (preset.presetKey) {
await fs.writeFile(path.join(stacksDir, `${preset.presetKey}.svg`), stackSvg, "utf8");
}
}
await fs.writeFile(
path.join(stacksDir, "custom.svg"),
generateStackCardSvg({
title: "My DevShelf Zero-Paywall Stack",
items: ["Supabase", "Hono", "Biome", "Ollama"],
subtitle: "4 curated zero-paywall tools • devshelf.ritualdev.in",
}),
"utf8",
);

const tiers: Array<BadgeOptions["tier"]> = [
"enterprise",
Expand Down
Loading