Skip to content
Back to search

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.

Checked today

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
findsafeskills safety rating

Markdown

[![findsafeskills safety rating](/api/listings/initializ--forge/badge.svg)](/listings/initializ--forge)

HTML

<a href="/listings/initializ--forge"><img src="/api/listings/initializ--forge/badge.svg" alt="findsafeskills safety rating" /></a>

Install

i

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.

  1. <p align="center">
  2. <img src="assets/banner.png" alt="Forge — open-source AI agent framework" width="100%">
  3. </p>
  4. # Forge — An Open, Secure, Portable AI Agent Runtime for the Enterprise
  5. <p align="center">
  6. <a href="https://useforge.ai/docs/"><img src="https://img.shields.io/badge/Docs-useforge.ai-FFD700?style=for-the-badge" alt="Documentation"></a>
  7. <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>
  8. <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>
  9. <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>
  10. </p>
  11. 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.
  12. ## Why Forge?
  13. - **60-second setup** — `forge init` wizard configures provider, keys, channels, and skills
  14. - **Secure by default** — outbound-only connections, egress allowlists, encrypted secrets, no public listeners
  15. - **Portable** — same agent runs locally, in Docker, Kubernetes, or inside [Initializ Command](https://initializ.ai)
  16. - **Observable** — structured NDJSON audit logs with correlation IDs for every action
  17. - **Extensible** — add skills, tools, channels, and LLM providers without changing core code
  18. ## Quick Start
  19. Talk to a working agent, and watch it use a tool, in under 60 seconds:
  20. ```bash
  21. brew install initializ/tap/forge && forge try
  22. ```
  23. `forge try` scaffolds a keyless demo agent, finds whatever model credential you
  24. already have, and drops you into a chat whose every tool call and egress check
  25. renders inline:
  26. ```
  27. you › what's the weather in Tokyo, should I pack an umbrella?
  28. ▸ tool weather_current(location=Tokyo)
  29. ▸ egress wttr.in ✓ allowed
  30. ◂ 18C, light rain this evening
  31. agent › 18C in Tokyo with light rain tonight. Yes, take the umbrella.
  32. ```
  33. Then build your own: `forge try --keep` graduates the demo to `./forge-quickstart`.
  34. See [Quick Start](docs/getting-started/quick-start.md) for the walkthrough,
  35. [Ship to Production](docs/getting-started/ship-to-production.md) for the full
  36. pipeline, or [Installation](docs/getting-started/installation.md) for all methods.
  37. ## How It Works
  38. ```
  39. SKILL.md --> Parse --> Discover tools/requirements --> Compile AgentSpec
  40. |
  41. v
  42. Apply security policy
  43. |
  44. v
  45. Run LLM agent loop
  46. (tool calling + memory + cron)
  47. ```
  48. You write a `SKILL.md`. Forge compiles it into a secure, runnable agent with egress controls, encrypted secrets, and audit logging.
  49. ## Key Features
  50. | Feature | Description |
  51. |---------|-------------|
  52. | Atomic Skills | `SKILL.md`-based agent definitions with YAML frontmatter |
  53. | Egress Security | Runtime + build-time domain allowlists with subprocess proxy |
  54. | Channel Connectors | Slack (Socket Mode), Telegram (polling) — outbound-only |
  55. | Cron Scheduling | Recurring tasks with channel delivery |
  56. | Memory | Session persistence + long-term vector search |
  57. | LLM Fallbacks | Multi-provider with automatic failover |
  58. | MCP Client | Connect to any HTTP MCP server (Linear, Notion, Atlassian, ...) — tools surface as `<server>__<tool>` with namespaced audit |
  59. | Web Dashboard | `forge ui` for browser-based agent management |
  60. | Build Signing | Ed25519 artifact signing & verification |
  61. | Air-Gap Ready | Runs with local models, no cloud required |
  62. ## Documentation
  63. ### Getting Started
  64. | Document | Description |
  65. |----------|-------------|
  66. | [Quick Start](docs/getting-started/quick-start.md) | Talk to an agent in 60 seconds with `forge try` |
  67. | [Ship to Production](docs/getting-started/ship-to-production.md) | The full init, build, package, deploy pipeline |
  68. | [Installation](docs/getting-started/installation.md) | Homebrew, binary, and Windows install |
  69. | [Architecture](docs/core-concepts/how-forge-works.md) | System design, module layout, and data flows |
  70. ### Core Concepts
  71. | Document | Description |
  72. |----------|-------------|
  73. | [Skills](docs/skills/writing-custom-skills.md) | Skill definitions, registry, and compilation |
  74. | [Binary Dependencies](docs/core-concepts/binary-dependencies.md) | How `forge build` resolves, installs, and places skill-declared binaries |
  75. | [Tools](docs/core-concepts/tools-and-builtins.md) | Built-in tools, adapters, and custom tools |
  76. | [Runtime](docs/core-concepts/runtime-engine.md) | LLM providers, fallback chains, running modes |
  77. | [Memory](docs/core-concepts/memory-system.md) | Session persistence and long-term memory |
  78. | [Context Compression](docs/core-concepts/context-compression.md) | Reversible compression of bulky tool outputs — fewer tokens, nothing lost |
  79. | [Channels](docs/core-concepts/channels.md) | Slack and Telegram adapter setup |
  80. | [Scheduling](docs/core-concepts/scheduling.md) | Cron configuration and schedule tools |
  81. | [Tracing](docs/core-concepts/observability-tracing.md) | OpenTelemetry distributed tracing — spans, propagation, audit cross-link |
  82. ### Security
  83. | Document | Description |
  84. |----------|-------------|
  85. | [Security Overview](docs/security/overview.md) | Complete security architecture |
  86. | [Authentication](docs/security/authentication.md) | Pluggable auth providers — OIDC, AWS Sigv4, GCP IAP, Azure AD |
  87. | [Egress Security](docs/security/egress-control.md) | Egress enforcement deep dive |
  88. | [Secrets](docs/security/secret-management.md) | Encrypted secret management |
  89. | [Build Signing](docs/security/build-signing.md) | Ed25519 signing and verification |
  90. | [Guardrails](docs/security/guardrails.md) | Content filtering and PII detection |
  91. | [Workflow Correlation](docs/security/workflow-correlation.md) | Orchestrator correlation IDs threaded through audit events |
  92. | [Platform Policy](docs/security/platform-policy.md) | Workspace-level deploy-time bounds on egress / tools / models |
  93. ### Operations
  94. | Document | Description |
  95. |----------|-------------|
  96. | [A2A Agent Card](docs/reference/a2a-agent-card.md) | Spec-conformant Agent Card at `/.well-known/agent-card.json` (A2A 0.3.0) |
  97. | [Commands](docs/reference/cli-reference.md) | Full CLI reference |
  98. | [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` |
  99. | [Configuration](docs/reference/forge-yaml-schema.md) | `forge.yaml` schema and environment variables |
  100. | [Settings](docs/reference/settings.md) | Layered developer settings (user + managed/MDM) — enabled channels, model default + gateway, builtin tools |
  101. | [Dashboard](docs/reference/web-dashboard.md) | Web UI features and architecture |
  102. | [Multimodal I/O](docs/reference/multimodal-io.md) | Sending images/PDFs to an agent and receiving media back over A2A |
  103. | [Deployment](docs/deployment/kubernetes.md) | Container packaging, Kubernetes, air-gap |
  104. | [Scheduler — Kubernetes](docs/deployment/scheduler-kubernetes.md) | Hybrid file/CronJob scheduler backend, RBAC, token plumbing |
  105. | [Hooks](docs/core-concepts/hooks.md) | Agent loop hook system |
  106. | [Library Modules](docs/reference/library-modules.md) | Import `forge-core`, `forge-skills`, `forge-plugins` as Go libraries — tag scheme, release pipeline, embedder API |
  107. | [Plugins](docs/reference/framework-plugins.md) | Framework plugin system |
  108. | [Command Integration](docs/reference/command-integration.md) | Initializ Command platform guide |
  109. ### For Claude / LLM-assisted contributors
  110. | File | Description |
  111. |------|-------------|
  112. | [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). |
  113. | [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. |
  114. `/sync-docs` keeps both skills current — see `.claude/commands/sync-docs.md`.
  115. ## Philosophy
  116. 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).
  117. > Real agent systems require atomicity, security, and portability. Forge provides those building blocks.
  118. ## Contributing
  119. We welcome contributions! See [CONTRIBUTING.md](CONTRIBUTING.md) for development setup, how to add skills/tools/channels, and the PR process.
  120. Please read our [Code of Conduct](CODE_OF_CONDUCT.md) before participating.
  121. ## License
  122. See [LICENSE](LICENSE) for details.
forge-skills/local/embedded/code-agent/scripts/code-agent-scaffold.sh · Bundled script · 674 lines · 1 finding marked
  1. #!/usr/bin/env bash
  2. # code-agent-scaffold.sh — Scaffold a project with a known-good skeleton.
  3. # Usage: ./code-agent-scaffold.sh '{"project_name": "my-app", "framework": "react"}'
  4. #
  5. # Supported frameworks: react, vue, vanilla, node, python, golang, spring-boot
  6. # Requires: jq
  7. set -euo pipefail
  8. # --- Read input ---
  9. INPUT="${1:-}"
  10. if [ -z "$INPUT" ]; then
  11. echo '{"error": "usage: code-agent-scaffold.sh {\"project_name\": \"...\", \"framework\": \"react\"}"}' >&2
  12. exit 1
  13. fi
  14. if ! echo "$INPUT" | jq empty 2>/dev/null; then
  15. echo '{"error": "invalid JSON input"}' >&2
  16. exit 1
  17. fi
  18. PROJECT_NAME=$(echo "$INPUT" | jq -r '.project_name // empty')
  19. FRAMEWORK=$(echo "$INPUT" | jq -r '.framework // empty')
  20. TITLE=$(echo "$INPUT" | jq -r '.title // empty')
  21. if [ -z "$PROJECT_NAME" ]; then
  22. echo '{"error": "project_name is required"}' >&2
  23. exit 1
  24. fi
  25. if [ -z "$FRAMEWORK" ]; then
  26. echo '{"error": "framework is required. Options: react, vue, vanilla, node, python, golang, spring-boot"}' >&2
  27. exit 1
  28. fi
  29. if [ -z "$TITLE" ]; then
  30. TITLE="$PROJECT_NAME"
  31. fi
  32. # --- Resolve output directory within workspace/ ---
  33. OUTPUT_DIR="$(pwd)/workspace/$PROJECT_NAME"
  34. if [ -d "$OUTPUT_DIR" ] && [ "$(ls -A "$OUTPUT_DIR" 2>/dev/null)" ]; then
  35. FORCE=$(echo "$INPUT" | jq -r '.force // false')
  36. if [ "$FORCE" != "true" ]; then
  37. echo '{"error": "project directory already exists and is not empty; set force: true to overwrite"}' >&2
  38. exit 1
  39. fi
  40. fi
  41. mkdir -p "$OUTPUT_DIR"
  42. # Track created files
  43. CREATED_FILES=()
  44. write_file() {
  45. local relpath="$1"
  46. local content="$2"
  47. local fullpath="$OUTPUT_DIR/$relpath"
  48. mkdir -p "$(dirname "$fullpath")"
  49. echo "$content" > "$fullpath"
  50. CREATED_FILES+=("$relpath")
  51. }
  52. # --- Framework templates ---
  53. scaffold_react() {
  54. write_file "package.json" "{
  55. \"name\": \"$PROJECT_NAME\",
  56. \"private\": true,
  57. \"version\": \"0.1.0\",
  58. \"type\": \"module\",
  59. \"scripts\": {
  60. \"dev\": \"vite --open\",
  61. \"build\": \"vite build\",
  62. \"preview\": \"vite preview\"
  63. },
  64. \"dependencies\": {
  65. \"react\": \"^19.0.0\",
  66. \"react-dom\": \"^19.0.0\"
  67. },
  68. \"devDependencies\": {
  69. \"@vitejs/plugin-react\": \"^4.4.0\",
  70. \"vite\": \"^6.0.0\"
  71. }
  72. }"
  73. write_file "vite.config.js" "import { defineConfig } from 'vite'
  74. import react from '@vitejs/plugin-react'
  75. export default defineConfig({
  76. plugins: [react()],
  77. server: {
  78. port: 3000,
  79. open: true,
  80. },
  81. })"
  82. write_file "index.html" "<!DOCTYPE html>
  83. <html lang=\"en\">
  84. <head>
  85. <meta charset=\"UTF-8\" />
  86. <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\" />
  87. <title>$TITLE</title>
  88. <script src=\"https://cdn.tailwindcss.com\"></script>
  89. </head>
  90. <body class=\"bg-zinc-950 text-zinc-200 antialiased\">
  91. <div id=\"root\"></div>
  92. <script type=\"module\" src=\"/src/main.jsx\"></script>
  93. </body>
  94. </html>"
  95. write_file "src/main.jsx" "import { StrictMode } from 'react'
  96. import { createRoot } from 'react-dom/client'
  97. import { App } from './App.jsx'
  98. createRoot(document.getElementById('root')).render(
  99. <StrictMode>
  100. <App />
  101. </StrictMode>
  102. )"
  103. write_file "src/App.jsx" "import { useState } from 'react'
  104. export function App() {
  105. const [count, setCount] = useState(0)
  106. return (
  107. <div className=\"min-h-screen bg-zinc-950 text-zinc-200\">
  108. <div className=\"max-w-4xl mx-auto px-6 py-12\">
  109. <h1 className=\"text-3xl font-bold text-white mb-8 text-center\">$TITLE</h1>
  110. <div className=\"bg-zinc-900 border border-zinc-800 rounded-lg p-8 text-center shadow-lg\">
  111. <button
  112. onClick={() => setCount(c => c + 1)}
  113. className=\"bg-indigo-500 hover:bg-indigo-400 text-white font-semibold px-6 py-3 rounded-lg transition-colors\"
  114. >
  115. Count: {count}
  116. </button>
  117. <p className=\"text-zinc-400 mt-4\">
  118. 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.
  119. </p>
  120. </div>
  121. </div>
  122. </div>
  123. )
  124. }"
  125. write_file ".gitignore" "node_modules
  126. dist
  127. .env
  128. *.log"
  129. }
  130. scaffold_vue() {
  131. write_file "package.json" "{
  132. \"name\": \"$PROJECT_NAME\",
  133. \"private\": true,
  134. \"version\": \"0.1.0\",
  135. \"type\": \"module\",
  136. \"scripts\": {
  137. \"dev\": \"vite --open\",
  138. \"build\": \"vite build\",
  139. \"preview\": \"vite preview\"
  140. },
  141. \"dependencies\": {
  142. \"vue\": \"^3.5.0\"
  143. },
  144. \"devDependencies\": {
  145. \"@vitejs/plugin-vue\": \"^5.2.0\",
  146. \"vite\": \"^6.0.0\"
  147. }
  148. }"
  149. write_file "vite.config.js" "import { defineConfig } from 'vite'
  150. import vue from '@vitejs/plugin-vue'
  151. export default defineConfig({
  152. plugins: [vue()],
  153. server: {
  154. port: 3000,
  155. open: true,
  156. },
  157. })"
  158. write_file "index.html" "<!DOCTYPE html>
  159. <html lang=\"en\">
  160. <head>
  161. <meta charset=\"UTF-8\" />
  162. <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\" />
  163. <title>$TITLE</title>
  164. <script src=\"https://cdn.tailwindcss.com\"></script>
  165. </head>
  166. <body class=\"bg-zinc-950 text-zinc-200 antialiased\">
  167. <div id=\"app\"></div>
  168. <script type=\"module\" src=\"/src/main.js\"></script>
  169. </body>
  170. </html>"
  171. write_file "src/main.js" "import { createApp } from 'vue'
  172. import App from './App.vue'
  173. createApp(App).mount('#app')"
  174. write_file "src/App.vue" "<script setup>
  175. import { ref } from 'vue'
  176. const count = ref(0)
  177. </script>
  178. <template>
  179. <div class=\"min-h-screen bg-zinc-950 text-zinc-200\">
  180. <div class=\"max-w-4xl mx-auto px-6 py-12\">
  181. <h1 class=\"text-3xl font-bold text-white mb-8 text-center\">$TITLE</h1>
  182. <div class=\"bg-zinc-900 border border-zinc-800 rounded-lg p-8 text-center shadow-lg\">
  183. <button
  184. @click=\"count++\"
  185. class=\"bg-indigo-500 hover:bg-indigo-400 text-white font-semibold px-6 py-3 rounded-lg transition-colors\"
  186. >
  187. Count: {{ count }}
  188. </button>
  189. <p class=\"text-zinc-400 mt-4\">
  190. 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.
  191. </p>
  192. </div>
  193. </div>
  194. </div>
  195. </template>"
  196. write_file ".gitignore" "node_modules
  197. dist
  198. .env
  199. *.log"
  200. }
  201. scaffold_vanilla() {
  202. write_file "package.json" "{
  203. \"name\": \"$PROJECT_NAME\",
  204. \"private\": true,
  205. \"version\": \"0.1.0\",
  206. \"type\": \"module\",
  207. \"scripts\": {
  208. \"dev\": \"vite --open\",
  209. \"build\": \"vite build\",
  210. \"preview\": \"vite preview\"
  211. },
  212. \"devDependencies\": {
  213. \"vite\": \"^6.0.0\"
  214. }
  215. }"
  216. write_file "vite.config.js" "import { defineConfig } from 'vite'
  217. export default defineConfig({
  218. server: {
  219. port: 3000,
  220. open: true,
  221. },
  222. })"
  223. write_file "index.html" "<!DOCTYPE html>
  224. <html lang=\"en\">
  225. <head>
  226. <meta charset=\"UTF-8\" />
  227. <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\" />
  228. <title>$TITLE</title>
  229. <script src=\"https://cdn.tailwindcss.com\"></script>
  230. </head>
  231. <body class=\"bg-zinc-950 text-zinc-200 antialiased\">
  232. <div id=\"app\" class=\"min-h-screen\">
  233. <div class=\"max-w-4xl mx-auto px-6 py-12\">
  234. <h1 class=\"text-3xl font-bold text-white mb-8 text-center\">$TITLE</h1>
  235. <div id=\"content\" class=\"bg-zinc-900 border border-zinc-800 rounded-lg p-8 text-center shadow-lg\">
  236. <button id=\"counter\" class=\"bg-indigo-500 hover:bg-indigo-400 text-white font-semibold px-6 py-3 rounded-lg transition-colors\">
  237. Count: 0
  238. </button>
  239. <p class=\"text-zinc-400 mt-4\">
  240. 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.
  241. </p>
  242. </div>
  243. </div>
  244. </div>
  245. <script type=\"module\" src=\"/src/main.js\"></script>
  246. </body>
  247. </html>"
  248. write_file "src/main.js" "let count = 0
  249. const btn = document.getElementById('counter')
  250. btn.addEventListener('click', () => {
  251. count++
  252. btn.textContent = \`Count: \${count}\`
  253. })"
  254. write_file ".gitignore" "node_modules
  255. dist
  256. .env
  257. *.log"
  258. }
  259. scaffold_node() {
  260. write_file "package.json" "{
  261. \"name\": \"$PROJECT_NAME\",
  262. \"private\": true,
  263. \"version\": \"0.1.0\",
  264. \"type\": \"module\",
  265. \"scripts\": {
  266. \"dev\": \"node --watch src/server.js\",
  267. \"start\": \"node src/server.js\"
  268. },
  269. \"dependencies\": {
  270. \"express\": \"^4.21.0\"
  271. }
  272. }"
  273. write_file "src/server.js" "import express from 'express'
  274. import { fileURLToPath } from 'url'
  275. import { dirname, join } from 'path'
  276. const __dirname = dirname(fileURLToPath(import.meta.url))
  277. const app = express()
  278. const PORT = process.env.PORT || 3000
  279. app.use(express.json())
  280. // Serve static frontend files from public/ directory
  281. app.use(express.static(join(__dirname, '..', 'public')))
  282. // API routes
  283. app.get('/api/health', (req, res) => {
  284. res.json({ status: 'healthy', uptime: process.uptime() })
  285. })
  286. // Fallback: serve index.html for any non-API route
  287. app.get('*', (req, res) => {
  288. res.sendFile(join(__dirname, '..', 'public', 'index.html'))
  289. })
  290. app.listen(PORT, () => {
  291. console.log(\`Server running at http://localhost:\${PORT}\`)
  292. })"
  293. write_file "public/index.html" "<!DOCTYPE html>
  294. <html lang=\"en\">
  295. <head>
  296. <meta charset=\"UTF-8\" />
  297. <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\" />
  298. <title>$TITLE</title>
  299. <script src=\"https://cdn.tailwindcss.com\"></script>
  300. </head>
  301. <body class=\"bg-zinc-950 text-zinc-200 antialiased\">
  302. <div class=\"min-h-screen flex items-center justify-center\">
  303. <div class=\"max-w-md mx-auto text-center\">
  304. <h1 class=\"text-3xl font-bold text-white mb-4\">$TITLE</h1>
  305. <p class=\"text-zinc-400\">Express server is running.</p>
  306. <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>
  307. </div>
  308. </div>
  309. <script type=\"module\" src=\"/app.js\"></script>
  310. </body>
  311. </html>"
  312. write_file "public/app.js" "// Frontend JavaScript — fetches from API and updates the UI
  313. console.log('$TITLE frontend loaded')"
  314. write_file ".gitignore" "node_modules
  315. .env
  316. *.log"
  317. }
  318. scaffold_python() {
  319. write_file "requirements.txt" "fastapi>=0.115.0
  320. uvicorn[standard]>=0.32.0"
  321. write_file "main.py" "from pathlib import Path
  322. from fastapi import FastAPI
  323. from fastapi.responses import HTMLResponse, FileResponse
  324. from fastapi.staticfiles import StaticFiles
  325. app = FastAPI(title=\"$TITLE\")
  326. # Serve static frontend files from static/ directory
  327. STATIC_DIR = Path(__file__).parent / \"static\"
  328. if STATIC_DIR.exists():
  329. app.mount(\"/static\", StaticFiles(directory=str(STATIC_DIR)), name=\"static\")
  330. @app.get(\"/\", response_class=HTMLResponse)
  331. async def root():
  332. index = STATIC_DIR / \"index.html\"
  333. if index.exists():
  334. return index.read_text()
  335. return '<h1>$TITLE</h1><p>Create static/index.html for the UI</p>'
  336. # API routes — all under /api/
  337. @app.get(\"/api/health\")
  338. async def health():
  339. return {\"status\": \"healthy\"}
  340. @app.get(\"/docs\")
  341. async def docs_redirect():
  342. \"\"\"Redirect to auto-generated API docs.\"\"\"
  343. from fastapi.responses import RedirectResponse
  344. return RedirectResponse(url=\"/docs\")
  345. if __name__ == \"__main__\":
  346. import uvicorn
  347. uvicorn.run(\"main:app\", host=\"0.0.0.0\", port=8000, reload=True)"
  348. write_file "static/index.html" "<!DOCTYPE html>
  349. <html lang=\"en\">
  350. <head>
  351. <meta charset=\"UTF-8\">
  352. <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">
  353. <title>$TITLE</title>
  354. <script src=\"https://cdn.tailwindcss.com\"></script>
  355. </head>
  356. <body class=\"bg-zinc-950 text-zinc-200 antialiased\">
  357. <div class=\"min-h-screen flex items-center justify-center\">
  358. <div class=\"max-w-md mx-auto text-center\">
  359. <h1 class=\"text-3xl font-bold text-white mb-4\">$TITLE</h1>
  360. <p class=\"text-zinc-400\">FastAPI server is running.</p>
  361. <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\">
  362. Open API Docs
  363. </a>
  364. </div>
  365. </div>
  366. <script type=\"module\" src=\"/static/app.js\"></script>
  367. </body>
  368. </html>"
  369. write_file "static/app.js" "// Frontend JavaScript — fetches from API and updates the UI
  370. console.log('$TITLE frontend loaded')"
  371. write_file ".gitignore" "__pycache__
  372. *.pyc
  373. .venv
  374. venv
  375. .env
  376. *.log"
  377. }
  378. scaffold_golang() {
  379. write_file "go.mod" "module $PROJECT_NAME
  380. go 1.22
  381. require github.com/gin-gonic/gin v1.10.0
  382. require (
  383. github.com/bytedance/sonic v1.12.6 // indirect
  384. github.com/bytedance/sonic/loader v0.2.1 // indirect
  385. github.com/cloudwego/base64x v0.1.4 // indirect
  386. github.com/cloudwego/iasm v0.2.0 // indirect
  387. github.com/gabriel-vasile/mimetype v1.4.7 // indirect
  388. github.com/gin-contrib/sse v0.1.0 // indirect
  389. github.com/go-playground/locales v0.14.1 // indirect
  390. github.com/go-playground/universal-translator v0.18.1 // indirect
  391. github.com/go-playground/validator/v10 v10.23.0 // indirect
  392. github.com/goccy/go-json v0.10.4 // indirect
  393. github.com/json-iterator/go v1.1.12 // indirect
  394. github.com/klauspost/cpuid/v2 v2.2.9 // indirect
  395. github.com/leodido/go-urn v1.4.0 // indirect
  396. github.com/mattn/go-isatty v0.0.20 // indirect
  397. github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
  398. github.com/modern-go/reflect2 v1.0.2 // indirect
  399. github.com/pelletier/go-toml/v2 v2.2.3 // indirect
  400. github.com/twitchyliquid64/golang-asm v0.15.1 // indirect
  401. github.com/ugorji/go/codec v1.2.12 // indirect
  402. golang.org/x/arch v0.12.0 // indirect
  403. golang.org/x/crypto v0.31.0 // indirect
  404. golang.org/x/net v0.33.0 // indirect
  405. golang.org/x/sys v0.28.0 // indirect
  406. golang.org/x/text v0.21.0 // indirect
  407. google.golang.org/protobuf v1.36.1 // indirect
  408. )"
  409. write_file "main.go" "package main
  410. import (
  411. \"net/http\"
  412. \"github.com/gin-gonic/gin\"
  413. )
  414. func main() {
  415. r := gin.Default()
  416. // Serve static frontend files from static/ directory
  417. r.Static(\"/static\", \"./static\")
  418. r.StaticFile(\"/\", \"./static/index.html\")
  419. // API routes — all under /api/
  420. api := r.Group(\"/api\")
  421. {
  422. api.GET(\"/health\", func(c *gin.Context) {
  423. c.JSON(http.StatusOK, gin.H{\"status\": \"healthy\"})
  424. })
  425. }
  426. r.Run(\":8080\")
  427. }"
  428. write_file "static/index.html" "<!DOCTYPE html>
  429. <html lang=\"en\">
  430. <head>
  431. <meta charset=\"UTF-8\" />
  432. <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\" />
  433. <title>$TITLE</title>
  434. <script src=\"https://cdn.tailwindcss.com\"></script>
  435. </head>
  436. <body class=\"bg-zinc-950 text-zinc-200 antialiased\">
  437. <div class=\"min-h-screen flex items-center justify-center\">
  438. <div class=\"max-w-md mx-auto text-center\">
  439. <h1 class=\"text-3xl font-bold text-white mb-4\">$TITLE</h1>
  440. <p class=\"text-zinc-400\">Gin server is running.</p>
  441. <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>
  442. </div>
  443. </div>
  444. <script type=\"module\" src=\"/static/app.js\"></script>
  445. </body>
  446. </html>"
  447. write_file "static/app.js" "// Frontend JavaScript — fetches from API and updates the UI
  448. console.log('$TITLE frontend loaded')"
  449. write_file ".gitignore" "bin/
  450. *.exe
  451. *.test
  452. *.out
  453. .env
  454. vendor/"
  455. }
  456. scaffold_springboot() {
  457. local GROUP_ID="com.example"
  458. local ARTIFACT_ID="$PROJECT_NAME"
  459. local PKG_PATH="com/example/${PROJECT_NAME//-/}"
  460. local PKG_NAME="com.example.${PROJECT_NAME//-/}"
  461. write_file "pom.xml" "<?xml version=\"1.0\" encoding=\"UTF-8\"?>
  462. <project xmlns=\"http://maven.apache.org/POM/4.0.0\"
  463. xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"
  464. xsi:schemaLocation=\"http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd\">
  465. <modelVersion>4.0.0</modelVersion>
  466. <parent>
  467. <groupId>org.springframework.boot</groupId>
  468. <artifactId>spring-boot-starter-parent</artifactId>
  469. <version>3.4.0</version>
  470. <relativePath/>
  471. </parent>
  472. <groupId>$GROUP_ID</groupId>
  473. <artifactId>$ARTIFACT_ID</artifactId>
  474. <version>0.1.0</version>
  475. <name>$TITLE</name>
  476. <properties>
  477. <java.version>21</java.version>
  478. </properties>
  479. <dependencies>
  480. <dependency>
  481. <groupId>org.springframework.boot</groupId>
  482. <artifactId>spring-boot-starter-web</artifactId>
  483. </dependency>
  484. <dependency>
  485. <groupId>org.springframework.boot</groupId>
  486. <artifactId>spring-boot-starter-test</artifactId>
  487. <scope>test</scope>
  488. </dependency>
  489. </dependencies>
  490. <build>
  491. <plugins>
  492. <plugin>
  493. <groupId>org.springframework.boot</groupId>
  494. <artifactId>spring-boot-maven-plugin</artifactId>
  495. </plugin>
  496. </plugins>
  497. </build>
  498. </project>"
  499. write_file "src/main/resources/application.properties" "spring.application.name=$PROJECT_NAME
  500. server.port=8080"
  501. # Spring Boot automatically serves files from src/main/resources/static/
  502. write_file "src/main/resources/static/index.html" "<!DOCTYPE html>
  503. <html lang=\"en\">
  504. <head>
  505. <meta charset=\"UTF-8\" />
  506. <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\" />
  507. <title>$TITLE</title>
  508. <script src=\"https://cdn.tailwindcss.com\"></script>
  509. </head>
  510. <body class=\"bg-zinc-950 text-zinc-200 antialiased\">
  511. <div class=\"min-h-screen flex items-center justify-center\">
  512. <div class=\"max-w-md mx-auto text-center\">
  513. <h1 class=\"text-3xl font-bold text-white mb-4\">$TITLE</h1>
  514. <p class=\"text-zinc-400\">Spring Boot server is running.</p>
  515. <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>
  516. </div>
  517. </div>
  518. <script type=\"module\" src=\"/app.js\"></script>
  519. </body>
  520. </html>"
  521. write_file "src/main/resources/static/app.js" "// Frontend JavaScript — fetches from API and updates the UI
  522. console.log('$TITLE frontend loaded')"
  523. write_file "src/main/java/$PKG_PATH/Application.java" "package $PKG_NAME;
  524. import org.springframework.boot.SpringApplication;
  525. import org.springframework.boot.autoconfigure.SpringBootApplication;
  526. @SpringBootApplication
  527. public class Application {
  528. public static void main(String[] args) {
  529. SpringApplication.run(Application.class, args);
  530. }
  531. }"
  532. write_file "src/main/java/$PKG_PATH/HelloController.java" "package $PKG_NAME;
  533. import org.springframework.web.bind.annotation.GetMapping;
  534. import org.springframework.web.bind.annotation.RequestMapping;
  535. import org.springframework.web.bind.annotation.RestController;
  536. import java.util.Map;
  537. @RestController
  538. @RequestMapping(\"/api\")
  539. public class HelloController {
  540. @GetMapping(\"/health\")
  541. public Map<String, String> health() {
  542. return Map.of(\"status\", \"healthy\");
  543. }
  544. }"
  545. write_file ".gitignore" "target/
  546. *.class
  547. *.jar
  548. .env
  549. *.log
  550. .idea/
  551. *.iml"
  552. # Maven wrapper for ./mvnw support
  553. 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
  554. 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
  555. }
  556. # --- Dispatch ---
  557. case "$FRAMEWORK" in
  558. react) scaffold_react ;;
  559. vue) scaffold_vue ;;
  560. vanilla) scaffold_vanilla ;;
  561. node) scaffold_node ;;
  562. python) scaffold_python ;;
  563. golang|go) scaffold_golang ;;
  564. spring-boot|springboot|spring) scaffold_springboot ;;
  565. *)
  566. echo "{\"error\": \"unknown framework: $FRAMEWORK. Options: react, vue, vanilla, node, python, golang, spring-boot\"}" >&2
  567. exit 1
  568. ;;
  569. esac
  570. # --- Output result ---
  571. FILES_JSON=$(printf '%s\n' "${CREATED_FILES[@]}" | jq -R -s 'split("\n") | map(select(length > 0))')
  572. jq -n \
  573. --arg status "created" \
  574. --arg project_name "$PROJECT_NAME" \
  575. --arg framework "$FRAMEWORK" \
  576. --arg project_dir "$OUTPUT_DIR" \
  577. --argjson files "$FILES_JSON" \
  578. '{status: $status, project_name: $project_name, framework: $framework, project_dir: $project_dir, files: $files}'

Ratings and comments

Sign in to rate this skill.

Sign in

Free to use. If it’s helped, pass it on.