forge
Forge is the open-source runtime for Anthropic's Agent Skills standard — built for the agent that runs next to a service, in your environment, on infrastructure you already operate. Write a SKILL.md. Compile to a portable, hardened agent. Deploy it anywhere containers run: Kubernetes, on-prem, air-gapped, embedded in CI, or as an A2A endpoint.
Safety scan
A static text scan, not a guarantee. Select the badge to see what was scanned and every finding.
Check it deeper on your machine
It has changed since its scan on 11 Nov 2026.
As a Claude Code plugin, install it and then ask Claude Code:
/plugin marketplace add keithmackay/mackayi/plugin install scanskillsafety@mackayiDo a deep scan of https://github.com/initializ/forge with scanskillsafety
Or from a terminal, clone it and run it:
git clone https://github.com/keithmackay/scanskillsafety-skill ~/.claude/skills/scanskillsafetynode ~/.claude/skills/scanskillsafety/cli.cjs --deep 'https://github.com/initializ/forge'
It checks the exact commit: every file, its packages against OSV (api.osv.dev), how it compares with this page's scan (findsafeskills.com receives the repository's address), and, if you agree, Claude reading every file with your own Claude subscription. It never runs the code.
Badge for your README
Markdown
[](/listings/initializ--forge)HTML
<a href="/listings/initializ--forge"><img src="/api/listings/initializ--forge/badge.svg" alt="findsafeskills safety rating" /></a>Install
Install instructions from the README
As written by the repo's author. findsafeskills has not verified these steps.
Talk to a working agent, and watch it use a tool, in under 60 seconds:
brew install initializ/tap/forge && forge try
`forge try` scaffolds a keyless demo agent, finds whatever model credential you already have, and drops you into a chat whose every tool call and egress check renders inline:
you › what's the weather in Tokyo, should I pack an umbrella? ▸ tool weather_current(location=Tokyo) ▸ egress wttr.in ✓ allowed ◂ 18C, light rain this evening agent › 18C in Tokyo with light rain tonight. Yes, take the umbrella.
Then build your own: `forge try --keep` graduates the demo to `./forge-quickstart`.
See [Quick Start](docs/getting-started/quick-start.md) for the walkthrough, [Ship to Production](docs/getting-started/ship-to-production.md) for the full pipeline, or [Installation](docs/getting-started/installation.md) for all methods.
What was scanned
The files the safety scan read, as written by the repository's author and shown as plain text. Lines with a finding are marked.
README.md · README · 161 lines
View this file on GitHub (read at the repository's current version: the scan did not record which commit it read)
This file has changed since it was scanned, so this is not exactly the text that was scanned, and no line is marked. The findings are listed with the safety scan above.
- <p align="center">
- <img src="assets/banner.png" alt="Forge — open-source AI agent framework" width="100%">
- </p>
- # Forge — An Open, Secure, Portable AI Agent Runtime for the Enterprise
- <p align="center">
- <a href="https://useforge.ai/docs/"><img src="https://img.shields.io/badge/Docs-useforge.ai-FFD700?style=for-the-badge" alt="Documentation"></a>
- <a href="https://discord.gg/PtFa4z97Ag"><img src="https://img.shields.io/badge/Discord-5865F2?style=for-the-badge&logo=discord&logoColor=white" alt="Discord"></a>
- <a href="https://github.com/initializ/forge/blob/main/LICENSE"><img src="https://img.shields.io/badge/License-Apache%202.0-green?style=for-the-badge" alt="License: Apache 2.0"></a>
- <a href="https://initializ.ai"><img src="https://img.shields.io/badge/Built%20by-initializ-blueviolet?style=for-the-badge" alt="Built by initializ"></a>
- </p>
- Forge is the open-source runtime for Anthropic's Agent Skills standard — built for the agent that runs next to a service, in your environment, on infrastructure you already operate. Write a `SKILL.md`. Compile to a portable, hardened agent. Deploy it anywhere containers run: Kubernetes, on-prem, air-gapped, embedded in CI, or as an A2A endpoint.
- ## Why Forge?
- - **60-second setup** — `forge init` wizard configures provider, keys, channels, and skills
- - **Secure by default** — outbound-only connections, egress allowlists, encrypted secrets, no public listeners
- - **Portable** — same agent runs locally, in Docker, Kubernetes, or inside [Initializ Command](https://initializ.ai)
- - **Observable** — structured NDJSON audit logs with correlation IDs for every action
- - **Extensible** — add skills, tools, channels, and LLM providers without changing core code
- ## Quick Start
- Talk to a working agent, and watch it use a tool, in under 60 seconds:
- ```bash
- brew install initializ/tap/forge && forge try
- ```
- `forge try` scaffolds a keyless demo agent, finds whatever model credential you
- already have, and drops you into a chat whose every tool call and egress check
- renders inline:
- ```
- you › what's the weather in Tokyo, should I pack an umbrella?
- ▸ tool weather_current(location=Tokyo)
- ▸ egress wttr.in ✓ allowed
- ◂ 18C, light rain this evening
- agent › 18C in Tokyo with light rain tonight. Yes, take the umbrella.
- ```
- Then build your own: `forge try --keep` graduates the demo to `./forge-quickstart`.
- See [Quick Start](docs/getting-started/quick-start.md) for the walkthrough,
- [Ship to Production](docs/getting-started/ship-to-production.md) for the full
- pipeline, or [Installation](docs/getting-started/installation.md) for all methods.
- ## How It Works
- ```
- SKILL.md --> Parse --> Discover tools/requirements --> Compile AgentSpec
- |
- v
- Apply security policy
- |
- v
- Run LLM agent loop
- (tool calling + memory + cron)
- ```
- You write a `SKILL.md`. Forge compiles it into a secure, runnable agent with egress controls, encrypted secrets, and audit logging.
- ## Key Features
- | Feature | Description |
- |---------|-------------|
- | Atomic Skills | `SKILL.md`-based agent definitions with YAML frontmatter |
- | Egress Security | Runtime + build-time domain allowlists with subprocess proxy |
- | Channel Connectors | Slack (Socket Mode), Telegram (polling) — outbound-only |
- | Cron Scheduling | Recurring tasks with channel delivery |
- | Memory | Session persistence + long-term vector search |
- | LLM Fallbacks | Multi-provider with automatic failover |
- | MCP Client | Connect to any HTTP MCP server (Linear, Notion, Atlassian, ...) — tools surface as `<server>__<tool>` with namespaced audit |
- | Web Dashboard | `forge ui` for browser-based agent management |
- | Build Signing | Ed25519 artifact signing & verification |
- | Air-Gap Ready | Runs with local models, no cloud required |
- ## Documentation
- ### Getting Started
- | Document | Description |
- |----------|-------------|
- | [Quick Start](docs/getting-started/quick-start.md) | Talk to an agent in 60 seconds with `forge try` |
- | [Ship to Production](docs/getting-started/ship-to-production.md) | The full init, build, package, deploy pipeline |
- | [Installation](docs/getting-started/installation.md) | Homebrew, binary, and Windows install |
- | [Architecture](docs/core-concepts/how-forge-works.md) | System design, module layout, and data flows |
- ### Core Concepts
- | Document | Description |
- |----------|-------------|
- | [Skills](docs/skills/writing-custom-skills.md) | Skill definitions, registry, and compilation |
- | [Binary Dependencies](docs/core-concepts/binary-dependencies.md) | How `forge build` resolves, installs, and places skill-declared binaries |
- | [Tools](docs/core-concepts/tools-and-builtins.md) | Built-in tools, adapters, and custom tools |
- | [Runtime](docs/core-concepts/runtime-engine.md) | LLM providers, fallback chains, running modes |
- | [Memory](docs/core-concepts/memory-system.md) | Session persistence and long-term memory |
- | [Context Compression](docs/core-concepts/context-compression.md) | Reversible compression of bulky tool outputs — fewer tokens, nothing lost |
- | [Channels](docs/core-concepts/channels.md) | Slack and Telegram adapter setup |
- | [Scheduling](docs/core-concepts/scheduling.md) | Cron configuration and schedule tools |
- | [Tracing](docs/core-concepts/observability-tracing.md) | OpenTelemetry distributed tracing — spans, propagation, audit cross-link |
- ### Security
- | Document | Description |
- |----------|-------------|
- | [Security Overview](docs/security/overview.md) | Complete security architecture |
- | [Authentication](docs/security/authentication.md) | Pluggable auth providers — OIDC, AWS Sigv4, GCP IAP, Azure AD |
- | [Egress Security](docs/security/egress-control.md) | Egress enforcement deep dive |
- | [Secrets](docs/security/secret-management.md) | Encrypted secret management |
- | [Build Signing](docs/security/build-signing.md) | Ed25519 signing and verification |
- | [Guardrails](docs/security/guardrails.md) | Content filtering and PII detection |
- | [Workflow Correlation](docs/security/workflow-correlation.md) | Orchestrator correlation IDs threaded through audit events |
- | [Platform Policy](docs/security/platform-policy.md) | Workspace-level deploy-time bounds on egress / tools / models |
- ### Operations
- | Document | Description |
- |----------|-------------|
- | [A2A Agent Card](docs/reference/a2a-agent-card.md) | Spec-conformant Agent Card at `/.well-known/agent-card.json` (A2A 0.3.0) |
- | [Commands](docs/reference/cli-reference.md) | Full CLI reference |
- | [The forge surface](docs/reference/forge-surface.md) | Bare `forge` — an interactive builder that shells into Claude Code (forge MCP tools) or forge's own agent, and generates `initializ-deploy.yaml` |
- | [Configuration](docs/reference/forge-yaml-schema.md) | `forge.yaml` schema and environment variables |
- | [Settings](docs/reference/settings.md) | Layered developer settings (user + managed/MDM) — enabled channels, model default + gateway, builtin tools |
- | [Dashboard](docs/reference/web-dashboard.md) | Web UI features and architecture |
- | [Multimodal I/O](docs/reference/multimodal-io.md) | Sending images/PDFs to an agent and receiving media back over A2A |
- | [Deployment](docs/deployment/kubernetes.md) | Container packaging, Kubernetes, air-gap |
- | [Scheduler — Kubernetes](docs/deployment/scheduler-kubernetes.md) | Hybrid file/CronJob scheduler backend, RBAC, token plumbing |
- | [Hooks](docs/core-concepts/hooks.md) | Agent loop hook system |
- | [Library Modules](docs/reference/library-modules.md) | Import `forge-core`, `forge-skills`, `forge-plugins` as Go libraries — tag scheme, release pipeline, embedder API |
- | [Plugins](docs/reference/framework-plugins.md) | Framework plugin system |
- | [Command Integration](docs/reference/command-integration.md) | Initializ Command platform guide |
- ### For Claude / LLM-assisted contributors
- | File | Description |
- |------|-------------|
- | [Forge knowledge skill](.claude/skills/forge.md) | Single comprehensive markdown — drop it into a Claude conversation for full Forge context (architecture, security, APIs, CLI, audit pipeline, how to build agents + skills). |
- | [Forge skill-builder skill](.claude/skills/forge-skill-builder.md) | Same prompt the `forge ui` Skill Builder uses. Author a valid `SKILL.md` (frontmatter + body + optional scripts) in any Claude chat — no `forge ui` needed. |
- `/sync-docs` keeps both skills current — see `.claude/commands/sync-docs.md`.
- ## Philosophy
- Running agents that do real work requires **atomicity** (explicit skills, defined tools, declared dependencies), **security** (restricted egress, encrypted secrets, audit trails), and **portability** (runs locally, in containers, in Kubernetes, in cloud — same agent, anywhere).
- > Real agent systems require atomicity, security, and portability. Forge provides those building blocks.
- ## Contributing
- We welcome contributions! See [CONTRIBUTING.md](CONTRIBUTING.md) for development setup, how to add skills/tools/channels, and the PR process.
- Please read our [Code of Conduct](CODE_OF_CONDUCT.md) before participating.
- ## License
- See [LICENSE](LICENSE) for details.
forge-skills/local/embedded/code-agent/scripts/code-agent-scaffold.sh · Bundled script · 674 lines · 1 finding marked
- #!/usr/bin/env bash
- # code-agent-scaffold.sh — Scaffold a project with a known-good skeleton.
- # Usage: ./code-agent-scaffold.sh '{"project_name": "my-app", "framework": "react"}'
- #
- # Supported frameworks: react, vue, vanilla, node, python, golang, spring-boot
- # Requires: jq
- set -euo pipefail
- # --- Read input ---
- INPUT="${1:-}"
- if [ -z "$INPUT" ]; then
- echo '{"error": "usage: code-agent-scaffold.sh {\"project_name\": \"...\", \"framework\": \"react\"}"}' >&2
- exit 1
- fi
- if ! echo "$INPUT" | jq empty 2>/dev/null; then
- echo '{"error": "invalid JSON input"}' >&2
- exit 1
- fi
- PROJECT_NAME=$(echo "$INPUT" | jq -r '.project_name // empty')
- FRAMEWORK=$(echo "$INPUT" | jq -r '.framework // empty')
- TITLE=$(echo "$INPUT" | jq -r '.title // empty')
- if [ -z "$PROJECT_NAME" ]; then
- echo '{"error": "project_name is required"}' >&2
- exit 1
- fi
- if [ -z "$FRAMEWORK" ]; then
- echo '{"error": "framework is required. Options: react, vue, vanilla, node, python, golang, spring-boot"}' >&2
- exit 1
- fi
- if [ -z "$TITLE" ]; then
- TITLE="$PROJECT_NAME"
- fi
- # --- Resolve output directory within workspace/ ---
- OUTPUT_DIR="$(pwd)/workspace/$PROJECT_NAME"
- if [ -d "$OUTPUT_DIR" ] && [ "$(ls -A "$OUTPUT_DIR" 2>/dev/null)" ]; then
- FORCE=$(echo "$INPUT" | jq -r '.force // false')
- if [ "$FORCE" != "true" ]; then
- echo '{"error": "project directory already exists and is not empty; set force: true to overwrite"}' >&2
- exit 1
- fi
- fi
- mkdir -p "$OUTPUT_DIR"
- # Track created files
- CREATED_FILES=()
- write_file() {
- local relpath="$1"
- local content="$2"
- local fullpath="$OUTPUT_DIR/$relpath"
- mkdir -p "$(dirname "$fullpath")"
- echo "$content" > "$fullpath"
- CREATED_FILES+=("$relpath")
- }
- # --- Framework templates ---
- scaffold_react() {
- write_file "package.json" "{
- \"name\": \"$PROJECT_NAME\",
- \"private\": true,
- \"version\": \"0.1.0\",
- \"type\": \"module\",
- \"scripts\": {
- \"dev\": \"vite --open\",
- \"build\": \"vite build\",
- \"preview\": \"vite preview\"
- },
- \"dependencies\": {
- \"react\": \"^19.0.0\",
- \"react-dom\": \"^19.0.0\"
- },
- \"devDependencies\": {
- \"@vitejs/plugin-react\": \"^4.4.0\",
- \"vite\": \"^6.0.0\"
- }
- }"
- write_file "vite.config.js" "import { defineConfig } from 'vite'
- import react from '@vitejs/plugin-react'
- export default defineConfig({
- plugins: [react()],
- server: {
- port: 3000,
- open: true,
- },
- })"
- write_file "index.html" "<!DOCTYPE html>
- <html lang=\"en\">
- <head>
- <meta charset=\"UTF-8\" />
- <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\" />
- <title>$TITLE</title>
- <script src=\"https://cdn.tailwindcss.com\"></script>
- </head>
- <body class=\"bg-zinc-950 text-zinc-200 antialiased\">
- <div id=\"root\"></div>
- <script type=\"module\" src=\"/src/main.jsx\"></script>
- </body>
- </html>"
- write_file "src/main.jsx" "import { StrictMode } from 'react'
- import { createRoot } from 'react-dom/client'
- import { App } from './App.jsx'
- createRoot(document.getElementById('root')).render(
- <StrictMode>
- <App />
- </StrictMode>
- )"
- write_file "src/App.jsx" "import { useState } from 'react'
- export function App() {
- const [count, setCount] = useState(0)
- return (
- <div className=\"min-h-screen bg-zinc-950 text-zinc-200\">
- <div className=\"max-w-4xl mx-auto px-6 py-12\">
- <h1 className=\"text-3xl font-bold text-white mb-8 text-center\">$TITLE</h1>
- <div className=\"bg-zinc-900 border border-zinc-800 rounded-lg p-8 text-center shadow-lg\">
- <button
- onClick={() => setCount(c => c + 1)}
- className=\"bg-indigo-500 hover:bg-indigo-400 text-white font-semibold px-6 py-3 rounded-lg transition-colors\"
- >
- Count: {count}
- </button>
- <p className=\"text-zinc-400 mt-4\">
- Edit <code className=\"bg-zinc-950 px-1.5 py-0.5 rounded text-sm font-mono\">src/App.jsx</code> and save to see changes.
- </p>
- </div>
- </div>
- </div>
- )
- }"
- write_file ".gitignore" "node_modules
- dist
- .env
- *.log"
- }
- scaffold_vue() {
- write_file "package.json" "{
- \"name\": \"$PROJECT_NAME\",
- \"private\": true,
- \"version\": \"0.1.0\",
- \"type\": \"module\",
- \"scripts\": {
- \"dev\": \"vite --open\",
- \"build\": \"vite build\",
- \"preview\": \"vite preview\"
- },
- \"dependencies\": {
- \"vue\": \"^3.5.0\"
- },
- \"devDependencies\": {
- \"@vitejs/plugin-vue\": \"^5.2.0\",
- \"vite\": \"^6.0.0\"
- }
- }"
- write_file "vite.config.js" "import { defineConfig } from 'vite'
- import vue from '@vitejs/plugin-vue'
- export default defineConfig({
- plugins: [vue()],
- server: {
- port: 3000,
- open: true,
- },
- })"
- write_file "index.html" "<!DOCTYPE html>
- <html lang=\"en\">
- <head>
- <meta charset=\"UTF-8\" />
- <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\" />
- <title>$TITLE</title>
- <script src=\"https://cdn.tailwindcss.com\"></script>
- </head>
- <body class=\"bg-zinc-950 text-zinc-200 antialiased\">
- <div id=\"app\"></div>
- <script type=\"module\" src=\"/src/main.js\"></script>
- </body>
- </html>"
- write_file "src/main.js" "import { createApp } from 'vue'
- import App from './App.vue'
- createApp(App).mount('#app')"
- write_file "src/App.vue" "<script setup>
- import { ref } from 'vue'
- const count = ref(0)
- </script>
- <template>
- <div class=\"min-h-screen bg-zinc-950 text-zinc-200\">
- <div class=\"max-w-4xl mx-auto px-6 py-12\">
- <h1 class=\"text-3xl font-bold text-white mb-8 text-center\">$TITLE</h1>
- <div class=\"bg-zinc-900 border border-zinc-800 rounded-lg p-8 text-center shadow-lg\">
- <button
- @click=\"count++\"
- class=\"bg-indigo-500 hover:bg-indigo-400 text-white font-semibold px-6 py-3 rounded-lg transition-colors\"
- >
- Count: {{ count }}
- </button>
- <p class=\"text-zinc-400 mt-4\">
- Edit <code class=\"bg-zinc-950 px-1.5 py-0.5 rounded text-sm font-mono\">src/App.vue</code> and save to see changes.
- </p>
- </div>
- </div>
- </div>
- </template>"
- write_file ".gitignore" "node_modules
- dist
- .env
- *.log"
- }
- scaffold_vanilla() {
- write_file "package.json" "{
- \"name\": \"$PROJECT_NAME\",
- \"private\": true,
- \"version\": \"0.1.0\",
- \"type\": \"module\",
- \"scripts\": {
- \"dev\": \"vite --open\",
- \"build\": \"vite build\",
- \"preview\": \"vite preview\"
- },
- \"devDependencies\": {
- \"vite\": \"^6.0.0\"
- }
- }"
- write_file "vite.config.js" "import { defineConfig } from 'vite'
- export default defineConfig({
- server: {
- port: 3000,
- open: true,
- },
- })"
- write_file "index.html" "<!DOCTYPE html>
- <html lang=\"en\">
- <head>
- <meta charset=\"UTF-8\" />
- <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\" />
- <title>$TITLE</title>
- <script src=\"https://cdn.tailwindcss.com\"></script>
- </head>
- <body class=\"bg-zinc-950 text-zinc-200 antialiased\">
- <div id=\"app\" class=\"min-h-screen\">
- <div class=\"max-w-4xl mx-auto px-6 py-12\">
- <h1 class=\"text-3xl font-bold text-white mb-8 text-center\">$TITLE</h1>
- <div id=\"content\" class=\"bg-zinc-900 border border-zinc-800 rounded-lg p-8 text-center shadow-lg\">
- <button id=\"counter\" class=\"bg-indigo-500 hover:bg-indigo-400 text-white font-semibold px-6 py-3 rounded-lg transition-colors\">
- Count: 0
- </button>
- <p class=\"text-zinc-400 mt-4\">
- Edit <code class=\"bg-zinc-950 px-1.5 py-0.5 rounded text-sm font-mono\">src/main.js</code> and save to see changes.
- </p>
- </div>
- </div>
- </div>
- <script type=\"module\" src=\"/src/main.js\"></script>
- </body>
- </html>"
- write_file "src/main.js" "let count = 0
- const btn = document.getElementById('counter')
- btn.addEventListener('click', () => {
- count++
- btn.textContent = \`Count: \${count}\`
- })"
- write_file ".gitignore" "node_modules
- dist
- .env
- *.log"
- }
- scaffold_node() {
- write_file "package.json" "{
- \"name\": \"$PROJECT_NAME\",
- \"private\": true,
- \"version\": \"0.1.0\",
- \"type\": \"module\",
- \"scripts\": {
- \"dev\": \"node --watch src/server.js\",
- \"start\": \"node src/server.js\"
- },
- \"dependencies\": {
- \"express\": \"^4.21.0\"
- }
- }"
- write_file "src/server.js" "import express from 'express'
- import { fileURLToPath } from 'url'
- import { dirname, join } from 'path'
- const __dirname = dirname(fileURLToPath(import.meta.url))
- const app = express()
- const PORT = process.env.PORT || 3000
- app.use(express.json())
- // Serve static frontend files from public/ directory
- app.use(express.static(join(__dirname, '..', 'public')))
- // API routes
- app.get('/api/health', (req, res) => {
- res.json({ status: 'healthy', uptime: process.uptime() })
- })
- // Fallback: serve index.html for any non-API route
- app.get('*', (req, res) => {
- res.sendFile(join(__dirname, '..', 'public', 'index.html'))
- })
- app.listen(PORT, () => {
- console.log(\`Server running at http://localhost:\${PORT}\`)
- })"
- write_file "public/index.html" "<!DOCTYPE html>
- <html lang=\"en\">
- <head>
- <meta charset=\"UTF-8\" />
- <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\" />
- <title>$TITLE</title>
- <script src=\"https://cdn.tailwindcss.com\"></script>
- </head>
- <body class=\"bg-zinc-950 text-zinc-200 antialiased\">
- <div class=\"min-h-screen flex items-center justify-center\">
- <div class=\"max-w-md mx-auto text-center\">
- <h1 class=\"text-3xl font-bold text-white mb-4\">$TITLE</h1>
- <p class=\"text-zinc-400\">Express server is running.</p>
- <p class=\"text-zinc-500 mt-2 text-sm\">API: <code class=\"bg-zinc-900 px-1.5 py-0.5 rounded\">/api/health</code></p>
- </div>
- </div>
- <script type=\"module\" src=\"/app.js\"></script>
- </body>
- </html>"
- write_file "public/app.js" "// Frontend JavaScript — fetches from API and updates the UI
- console.log('$TITLE frontend loaded')"
- write_file ".gitignore" "node_modules
- .env
- *.log"
- }
- scaffold_python() {
- write_file "requirements.txt" "fastapi>=0.115.0
- uvicorn[standard]>=0.32.0"
- write_file "main.py" "from pathlib import Path
- from fastapi import FastAPI
- from fastapi.responses import HTMLResponse, FileResponse
- from fastapi.staticfiles import StaticFiles
- app = FastAPI(title=\"$TITLE\")
- # Serve static frontend files from static/ directory
- STATIC_DIR = Path(__file__).parent / \"static\"
- if STATIC_DIR.exists():
- app.mount(\"/static\", StaticFiles(directory=str(STATIC_DIR)), name=\"static\")
- @app.get(\"/\", response_class=HTMLResponse)
- async def root():
- index = STATIC_DIR / \"index.html\"
- if index.exists():
- return index.read_text()
- return '<h1>$TITLE</h1><p>Create static/index.html for the UI</p>'
- # API routes — all under /api/
- @app.get(\"/api/health\")
- async def health():
- return {\"status\": \"healthy\"}
- @app.get(\"/docs\")
- async def docs_redirect():
- \"\"\"Redirect to auto-generated API docs.\"\"\"
- from fastapi.responses import RedirectResponse
- return RedirectResponse(url=\"/docs\")
- if __name__ == \"__main__\":
- import uvicorn
- uvicorn.run(\"main:app\", host=\"0.0.0.0\", port=8000, reload=True)"
- write_file "static/index.html" "<!DOCTYPE html>
- <html lang=\"en\">
- <head>
- <meta charset=\"UTF-8\">
- <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">
- <title>$TITLE</title>
- <script src=\"https://cdn.tailwindcss.com\"></script>
- </head>
- <body class=\"bg-zinc-950 text-zinc-200 antialiased\">
- <div class=\"min-h-screen flex items-center justify-center\">
- <div class=\"max-w-md mx-auto text-center\">
- <h1 class=\"text-3xl font-bold text-white mb-4\">$TITLE</h1>
- <p class=\"text-zinc-400\">FastAPI server is running.</p>
- <a href=\"/docs\" class=\"inline-block mt-4 bg-indigo-500 hover:bg-indigo-400 text-white font-semibold px-6 py-3 rounded-lg transition-colors\">
- Open API Docs
- </a>
- </div>
- </div>
- <script type=\"module\" src=\"/static/app.js\"></script>
- </body>
- </html>"
- write_file "static/app.js" "// Frontend JavaScript — fetches from API and updates the UI
- console.log('$TITLE frontend loaded')"
- write_file ".gitignore" "__pycache__
- *.pyc
- .venv
- venv
- .env
- *.log"
- }
- scaffold_golang() {
- write_file "go.mod" "module $PROJECT_NAME
- go 1.22
- require github.com/gin-gonic/gin v1.10.0
- require (
- github.com/bytedance/sonic v1.12.6 // indirect
- github.com/bytedance/sonic/loader v0.2.1 // indirect
- github.com/cloudwego/base64x v0.1.4 // indirect
- github.com/cloudwego/iasm v0.2.0 // indirect
- github.com/gabriel-vasile/mimetype v1.4.7 // indirect
- github.com/gin-contrib/sse v0.1.0 // indirect
- github.com/go-playground/locales v0.14.1 // indirect
- github.com/go-playground/universal-translator v0.18.1 // indirect
- github.com/go-playground/validator/v10 v10.23.0 // indirect
- github.com/goccy/go-json v0.10.4 // indirect
- github.com/json-iterator/go v1.1.12 // indirect
- github.com/klauspost/cpuid/v2 v2.2.9 // indirect
- github.com/leodido/go-urn v1.4.0 // indirect
- github.com/mattn/go-isatty v0.0.20 // indirect
- github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
- github.com/modern-go/reflect2 v1.0.2 // indirect
- github.com/pelletier/go-toml/v2 v2.2.3 // indirect
- github.com/twitchyliquid64/golang-asm v0.15.1 // indirect
- github.com/ugorji/go/codec v1.2.12 // indirect
- golang.org/x/arch v0.12.0 // indirect
- golang.org/x/crypto v0.31.0 // indirect
- golang.org/x/net v0.33.0 // indirect
- golang.org/x/sys v0.28.0 // indirect
- golang.org/x/text v0.21.0 // indirect
- google.golang.org/protobuf v1.36.1 // indirect
- )"
- write_file "main.go" "package main
- import (
- \"net/http\"
- \"github.com/gin-gonic/gin\"
- )
- func main() {
- r := gin.Default()
- // Serve static frontend files from static/ directory
- r.Static(\"/static\", \"./static\")
- r.StaticFile(\"/\", \"./static/index.html\")
- // API routes — all under /api/
- api := r.Group(\"/api\")
- {
- api.GET(\"/health\", func(c *gin.Context) {
- c.JSON(http.StatusOK, gin.H{\"status\": \"healthy\"})
- })
- }
- r.Run(\":8080\")
- }"
- write_file "static/index.html" "<!DOCTYPE html>
- <html lang=\"en\">
- <head>
- <meta charset=\"UTF-8\" />
- <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\" />
- <title>$TITLE</title>
- <script src=\"https://cdn.tailwindcss.com\"></script>
- </head>
- <body class=\"bg-zinc-950 text-zinc-200 antialiased\">
- <div class=\"min-h-screen flex items-center justify-center\">
- <div class=\"max-w-md mx-auto text-center\">
- <h1 class=\"text-3xl font-bold text-white mb-4\">$TITLE</h1>
- <p class=\"text-zinc-400\">Gin server is running.</p>
- <p class=\"text-zinc-500 mt-2 text-sm\">API: <code class=\"bg-zinc-900 px-1.5 py-0.5 rounded\">/api/health</code></p>
- </div>
- </div>
- <script type=\"module\" src=\"/static/app.js\"></script>
- </body>
- </html>"
- write_file "static/app.js" "// Frontend JavaScript — fetches from API and updates the UI
- console.log('$TITLE frontend loaded')"
- write_file ".gitignore" "bin/
- *.exe
- *.test
- *.out
- .env
- vendor/"
- }
- scaffold_springboot() {
- local GROUP_ID="com.example"
- local ARTIFACT_ID="$PROJECT_NAME"
- local PKG_PATH="com/example/${PROJECT_NAME//-/}"
- local PKG_NAME="com.example.${PROJECT_NAME//-/}"
- write_file "pom.xml" "<?xml version=\"1.0\" encoding=\"UTF-8\"?>
- <project xmlns=\"http://maven.apache.org/POM/4.0.0\"
- xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"
- xsi:schemaLocation=\"http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd\">
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.springframework.boot</groupId>
- <artifactId>spring-boot-starter-parent</artifactId>
- <version>3.4.0</version>
- <relativePath/>
- </parent>
- <groupId>$GROUP_ID</groupId>
- <artifactId>$ARTIFACT_ID</artifactId>
- <version>0.1.0</version>
- <name>$TITLE</name>
- <properties>
- <java.version>21</java.version>
- </properties>
- <dependencies>
- <dependency>
- <groupId>org.springframework.boot</groupId>
- <artifactId>spring-boot-starter-web</artifactId>
- </dependency>
- <dependency>
- <groupId>org.springframework.boot</groupId>
- <artifactId>spring-boot-starter-test</artifactId>
- <scope>test</scope>
- </dependency>
- </dependencies>
- <build>
- <plugins>
- <plugin>
- <groupId>org.springframework.boot</groupId>
- <artifactId>spring-boot-maven-plugin</artifactId>
- </plugin>
- </plugins>
- </build>
- </project>"
- write_file "src/main/resources/application.properties" "spring.application.name=$PROJECT_NAME
- server.port=8080"
- # Spring Boot automatically serves files from src/main/resources/static/
- write_file "src/main/resources/static/index.html" "<!DOCTYPE html>
- <html lang=\"en\">
- <head>
- <meta charset=\"UTF-8\" />
- <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\" />
- <title>$TITLE</title>
- <script src=\"https://cdn.tailwindcss.com\"></script>
- </head>
- <body class=\"bg-zinc-950 text-zinc-200 antialiased\">
- <div class=\"min-h-screen flex items-center justify-center\">
- <div class=\"max-w-md mx-auto text-center\">
- <h1 class=\"text-3xl font-bold text-white mb-4\">$TITLE</h1>
- <p class=\"text-zinc-400\">Spring Boot server is running.</p>
- <p class=\"text-zinc-500 mt-2 text-sm\">API: <code class=\"bg-zinc-900 px-1.5 py-0.5 rounded\">/api/health</code></p>
- </div>
- </div>
- <script type=\"module\" src=\"/app.js\"></script>
- </body>
- </html>"
- write_file "src/main/resources/static/app.js" "// Frontend JavaScript — fetches from API and updates the UI
- console.log('$TITLE frontend loaded')"
- write_file "src/main/java/$PKG_PATH/Application.java" "package $PKG_NAME;
- import org.springframework.boot.SpringApplication;
- import org.springframework.boot.autoconfigure.SpringBootApplication;
- @SpringBootApplication
- public class Application {
- public static void main(String[] args) {
- SpringApplication.run(Application.class, args);
- }
- }"
- write_file "src/main/java/$PKG_PATH/HelloController.java" "package $PKG_NAME;
- import org.springframework.web.bind.annotation.GetMapping;
- import org.springframework.web.bind.annotation.RequestMapping;
- import org.springframework.web.bind.annotation.RestController;
- import java.util.Map;
- @RestController
- @RequestMapping(\"/api\")
- public class HelloController {
- @GetMapping(\"/health\")
- public Map<String, String> health() {
- return Map.of(\"status\", \"healthy\");
- }
- }"
- write_file ".gitignore" "target/
- *.class
- *.jar
- .env
- *.log
- .idea/
- *.iml"
- # Maven wrapper for ./mvnw support
- write_file ".mvn/wrapper/maven-wrapper.properties" "distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.9/apache-maven-3.9.9-bin.zip
- wrapperUrl=https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.3.2/maven-wrapper-3.3.2.jar"
- Dismissed after review: Links to a Windows program from code, which is how droppers fetch their payload
- Line 648 on GitHub
- }
- # --- Dispatch ---
- case "$FRAMEWORK" in
- react) scaffold_react ;;
- vue) scaffold_vue ;;
- vanilla) scaffold_vanilla ;;
- node) scaffold_node ;;
- python) scaffold_python ;;
- golang|go) scaffold_golang ;;
- spring-boot|springboot|spring) scaffold_springboot ;;
- *)
- echo "{\"error\": \"unknown framework: $FRAMEWORK. Options: react, vue, vanilla, node, python, golang, spring-boot\"}" >&2
- exit 1
- ;;
- esac
- # --- Output result ---
- FILES_JSON=$(printf '%s\n' "${CREATED_FILES[@]}" | jq -R -s 'split("\n") | map(select(length > 0))')
- jq -n \
- --arg status "created" \
- --arg project_name "$PROJECT_NAME" \
- --arg framework "$FRAMEWORK" \
- --arg project_dir "$OUTPUT_DIR" \
- --argjson files "$FILES_JSON" \
- '{status: $status, project_name: $project_name, framework: $framework, project_dir: $project_dir, files: $files}'
Ratings and comments
Sign in to rate this skill.
Sign inFree to use. If it’s helped, pass it on.