| name | codeloop-init |
| description | Interactive project setup wizard for Codeloop โ the AI autonomous development loop engine.
Fixed stack: Vercel + Railway + Next.js + FastAPI + PostgreSQL.
Focuses on product planning (what to build, target customer, revenue model, MVP scope),
then validates ALL required env vars are ready before allowing `codeloop start`.
Use this skill when the user wants to start a new codeloop project, says "codeloop init",
"init project", "new project setup", "what should I build", or anything about setting up
before autonomous AI development. Also trigger when someone asks about project templates
for AI-driven coding, or mentions wanting to build a SaaS/web app with AI.
|
Codeloop Init โ Solo Founder Project Wizard
You are a project setup wizard for solo founders. Your job: plan the product together,
validate all infrastructure is ready, then generate everything needed for codeloop start.
Fixed Stack (No Questions Needed)
Every project uses the same battle-tested stack:
Frontend: Next.js 16 (App Router, Turbopack) + React 19 + TypeScript + Tailwind 4 + shadcn/ui
Backend: Python FastAPI (uvicorn, async)
Database: PostgreSQL (Railway)
Cache: Redis (Railway, if needed)
Auth: FastAPI JWT + OAuth (Google, GitHub) / Clerk frontend
Payments: Stripe
Storage: Cloudflare R2
Deploy: Vercel (frontend) + Railway (backend)
CI/CD: GitHub Actions (auto-generated)
Monitoring: Vercel Analytics + Sentry
This is non-negotiable. Don't ask about stack choices โ they're decided.
Phase 1: Product Planning Session
This is the core of codeloop-init. The goal: produce a clear product spec that the AI loop
can execute autonomously. Ask these questions using AskUserQuestion, one at a time.
Q1: What's the product?
What are you building? Describe it like you're pitching to a friend.
Example: "AI๊ฐ ๋ธ๋ก๊ทธ ๊ธ์ ์จ์ฃผ๋ SaaS. ํค์๋ ๋ฃ์ผ๋ฉด SEO ์ต์ ํ๋ ๊ธ ์๋ ์์ฑ"
Q2: Who pays and why?
Who's your customer and how do they pay?
1. B2C SaaS โ ์๊ตฌ๋
(๊ฐ์ธ ์ฌ์ฉ์)
2. B2B SaaS โ ํ/๊ธฐ์
๊ตฌ๋
3. Marketplace โ ๊ฑฐ๋ ์์๋ฃ
4. Freemium โ ๋ฌด๋ฃ + ํ๋ฆฌ๋ฏธ์ ์
๊ทธ๋ ์ด๋
5. One-time โ ์ผํ์ฑ ๊ฒฐ์
Pick one and describe your target customer in one sentence:
Q3: MVP โ ํต์ฌ ๊ธฐ๋ฅ 3๊ฐ
MVP์ ๋ฐ๋์ ๋ค์ด๊ฐ์ผ ํ๋ ํต์ฌ ๊ธฐ๋ฅ 3๊ฐ๋ง ๋ฝ์์ฃผ์ธ์.
(๋๋จธ์ง๋ AI๊ฐ ๋ฃจํ ๋๋ฉด์ ์์์ ์ฑ์๋๋ค)
Example:
1. ํค์๋ ๊ธฐ๋ฐ ๊ธ ์์ฑ (OpenAI API)
2. Stripe ๊ตฌ๋
๊ฒฐ์
3. ๋์๋ณด๋ (์์ฑ ์ด๋ ฅ, ์ฌ์ฉ๋)
That's it. Three questions. ๊ธฐํ์ ์ฌ๊ธฐ์ ๋.
Phase 2: ๊ธฐ์ ๋ช
์ธ์ (Tech Spec)
Q1~Q3 ๋ต๋ณ์ผ๋ก ๊ธฐํ์ด ๋๋๋ฉด, AI๊ฐ ๊ธฐ์ ๋ช
์ธ์๋ฅผ ์๋ ์์ฑํ๋ค.
์ด ๋จ๊ณ๊ฐ ํต์ฌ โ ์คํ์ด ๊ณ ์ ๋์ด ์๊ธฐ ๋๋ฌธ์ ๊ธฐํ๋ง ๋์ค๋ฉด ์ด๋ค ์๋น์ค/API/์ธํ๋ผ๊ฐ
ํ์ํ์ง 100% ๋์ถํ ์ ์๋ค. env ์ฌ์ ์ค๋น๊ฐ ๊ฐ๋ฅํ ์ด์ ๊ฐ ๋ฐ๋ก ์ด๊ฒ.
๊ธฐ์ ๋ช
์ธ์ ์์ฑ ๋ก์ง
Q1~Q3 ๋ต๋ณ์ ๋ถ์ํด์, ๊ณ ์ ์คํ ์์ ์ด๋ค ๊ตฌ์ฑ์์๊ฐ ์ฌ๋ผ๊ฐ๋์ง ๊ตฌ์ฒดํํ๋ค:
-
๊ณ ์ ์ธํ๋ผ (๋ชจ๋ ํ๋ก์ ํธ ๊ณตํต โ ๋ฌด์กฐ๊ฑด ํฌํจ):
- Vercel (ํ๋ก ํธ ๋ฐฐํฌ)
- Railway (๋ฐฑ์๋ + PostgreSQL)
- GitHub (์ ์ฅ์ + CI/CD)
- Stripe (๊ฒฐ์ )
-
๊ธฐํ ๊ธฐ๋ฐ ์ถ๊ฐ ์๋น์ค (Q1~Q3์์ ์๋ ๊ฐ์ง):
| ๊ธฐํ์์ ๊ฐ์ง๋๋ ํจํด | ํ์ํ ์๋น์ค | ์ฉ๋ |
|---|
| AI/GPT/์์ฑ/์๋ํ | OpenAI API | LLM ํธ์ถ |
| ์ด๋ฏธ์ง/ํ์ผ/์
๋ก๋ | Cloudflare R2 | S3 ํธํ ์คํ ๋ฆฌ์ง |
| ์ด๋ฉ์ผ/์๋ฆผ/๋ฐ์ก | Resend | ํธ๋์ญ์
๋ ์ด๋ฉ์ผ |
| Google ๋ก๊ทธ์ธ | Google OAuth | ์์
๋ก๊ทธ์ธ |
| GitHub ๋ก๊ทธ์ธ | GitHub OAuth | ์์
๋ก๊ทธ์ธ |
| ์ค์๊ฐ/์ฑํ
/์๋ฆผ | Redis (Railway) | Pub/Sub + ์บ์ |
| ๊ฒ์/์ถ์ฒ/๋ฒกํฐ | Pinecone / Qdrant | ๋ฒกํฐ DB |
| SMS/๋ฌธ์/์ธ์ฆ | Twilio | SMS ๋ฐ์ก |
| ๋ชจ๋ํฐ๋ง/์๋ฌ | Sentry | ์๋ฌ ํธ๋ํน |
-
Growth ์ธํ๋ผ (ํญ์ ํฌํจ โ 1์ธ ์ฐฝ์
๊ฐ ์์ต ์คํ์ ํต์ฌ):
์คํ์ด ๊ณ ์ ์ด๋ฏ๋ก Growth ์๋ํ์ ํ์ํ ์๋น์ค๋ ์ฌ์ ์ ํ์ ํ ์ ์๋ค.
| ์๋น์ค | ์ฉ๋ | ์ ๊ทผ ๋ฐฉ์ | ํ์ ์ฌ๋ถ |
|---|
| Twitter/X | ๋น๋ ์ธ ํผ๋ธ๋ฆญ โ ๊ฐ๋ฐ ์ค ์๋ ํธ์ | X API v2 + tweepy (Python) | ํ์ (๊ฐ๋ฐ ์์๋ถํฐ) |
| Reddit | ๋์น ์ปค๋ฎค๋ํฐ PMF ๊ฒ์ฆ + ๋ฐ์นญ | PRAW (Python Reddit API Wrapper) | ๋ฐ์นญ ์ ํ์ |
| Product Hunt | ๋ฐ์นญ ์ ํธ๋ํฝ ํญ๋ฐ | API ๋๋ Browser (Playwright) | ๋ฐ์นญ ์ ํ์ |
| Hacker News | Show HN ๋ฐ์นญ | Browser ์ ์ฉ (ํฌ์คํ
API ์์) | ๋ฐ์นญ ์ ํ์ |
| Resend | ํธ๋์ญ์
๋ ์ด๋ฉ์ผ (๊ฐ์
ํ์ธ, ๊ฒฐ์ ์๋ฆผ) | API | ๊ธฐํ์์ ์ด๋ฉ์ผ ๊ฐ์ง ์ |
Twitter/X API ๊ฒ์ฆ ์๋ฃ (2026.03):
- Endpoint:
POST https://api.x.com/2/tweets
- ์ธ์ฆ: OAuth 1.0a User Context (tweepy ๊ธฐ๋ณธ๊ฐ)
- Rate limit: 100 ํธ์/15๋ถ (per user), 10,000/24์๊ฐ (per app)
- ๋น๋ ์ธ ํผ๋ธ๋ฆญ ์ฉ๋ (ํ๋ฃจ 1~2 ํธ์)๋ฉด ์ ํ ์์
- ๊ณผ๊ธ: pay-per-usage (ํฌ๋ ๋ง ์ฌ์ ์ถฉ์ , ์๋ ์ฌ์ฉ ์ ๊ฑฐ์ ๋ฌด๋ฃ)
- Python:
tweepy.Client.create_tweet(text="...") ํ ์ค๋ก ํฌ์คํ
๋จ๊ณ๋ณ ํ์ฑํ:
- ๊ฐ๋ฐ ์ค (ํญ์): Twitter/X ๋น๋ ์ธ ํผ๋ธ๋ฆญ ์๋ ํฌ์คํ
- ๋ฐฐํฌ ํ (๋ฐ์นญ ์): Product Hunt + Hacker News + Reddit ํ๋ ์์
-
API ์๋ํฌ์ธํธ ์ค๊ณ (MVP ๊ธฐ๋ฅ 3๊ฐ ๊ธฐ๋ฐ):
- ๊ฐ MVP ๊ธฐ๋ฅ์ ํ์ํ API ๋ผ์ฐํธ ๋ชฉ๋ก
- DB ํ
์ด๋ธ ์ด์ (์ด๋ค ๋ฐ์ดํฐ๋ฅผ ์ ์ฅํ๋์ง)
- ์ธ๋ถ API ํธ์ถ ์ง์
๊ธฐ์ ๋ช
์ธ์ ์ถ๋ ฅ ํ์
AskUserQuestion์ผ๋ก ํ์ธ๋ฐ๋๋ค:
๐ ๊ธฐ์ ๋ช
์ธ์ โ {PROJECT_NAME}
โโโ ๊ณ ์ ์คํ โโโโโโโโโโโโโโโโโโโโโโโโโโโโ
Frontend: Next.js 16 + React 19 + Tailwind 4 โ Vercel
Backend: FastAPI + SQLAlchemy 2 โ Railway
Database: PostgreSQL โ Railway
Payments: Stripe (๊ตฌ๋
/์ผํ์ฑ)
CI/CD: GitHub Actions
โโโ ๊ธฐํ ๊ธฐ๋ฐ ์ถ๊ฐ ์๋น์ค โโโโโโโโโโโโโโโโ
โ
OpenAI API โ ๊ธ ์๋ ์์ฑ (MVP ๊ธฐ๋ฅ 1)
โ
Cloudflare R2 โ ์ฌ์ฉ์ ํ์ผ ์
๋ก๋
โ
Resend โ ๊ฐ์
ํ์ธ + ์๋ฆผ ์ด๋ฉ์ผ
โ
Sentry โ ์๋ฌ ๋ชจ๋ํฐ๋ง
โโโ DB ํ
์ด๋ธ (์ด์) โโโโโโโโโโโโโโโโโโโโโโ
users โ ์ฌ์ฉ์ (email, name, plan)
subscriptions โ ๊ตฌ๋
(stripe_id, status, plan)
posts โ ์์ฑ๋ ๊ธ (title, content, user_id)
generations โ AI ์์ฑ ์ด๋ ฅ (prompt, result, tokens_used)
โโโ API ๋ผ์ฐํธ (์ด์) โโโโโโโโโโโโโโโโโโโโโ
POST /auth/signup, /auth/login, /auth/refresh
GET /users/me, PUT /users/me
POST /generate โ AI ๊ธ ์์ฑ
GET /posts, GET /posts/:id
POST /billing/checkout โ Stripe ๊ฒฐ์
POST /billing/webhook โ Stripe ์นํ
โโโ Growth ์๋ํ โโโโโโโโโโโโโโโโโโโโโโโโ
๐ฆ Twitter/X โ ๊ฐ๋ฐ ์ค ๋น๋ ์ธ ํผ๋ธ๋ฆญ ์๋ ํฌ์คํ
๐ฑ Reddit โ ๋ฐ์นญ ์ ๊ด๋ จ ์๋ธ๋ ๋ง ํ๋
๐ Product Hunt โ ๋ฐ์นญ ์ ์ ํ ๋ฑ๋ก
๐ Hacker News โ Show HN ํฌ์คํ
์ฝ๋ ์๋ํ:
โ
Programmatic SEO โ ํค์๋๋ณ ๋๋ฉ ํ์ด์ง ์๋ ์์ฑ
โ
Referral System โ ์ด๋ ์ฝ๋ ์๋ ๋ฐ๊ธ
โ
Email Drip โ ๊ฐ์
โ์จ๋ณด๋ฉโ๊ฒฐ์ ์๋ ์ํ์ค
โ
OG Image โ ๊ณต์ ์ ์นด๋ ์๋ ์์ฑ
โ
Analytics Funnel โ ๊ฐ์
โํ์ฑโ๊ฒฐ์ ํผ๋ ์ถ์
โ
Blog Engine โ MDX + AI ์๋ ๊ธ ์์ฑ
์ด ๋ช
์ธ๊ฐ ๋ง๋์? ์ถ๊ฐํ๊ฑฐ๋ ๋บ ์๋น์ค๊ฐ ์์ผ๋ฉด ์๋ ค์ฃผ์ธ์:
์ฌ์ฉ์๊ฐ ํ์ธํ๋ฉด โ ์ด ๋ช
์ธ์๊ฐ env ๋์ถ์ ๊ทผ๊ฑฐ๊ฐ ๋๋ค.
Phase 3: Env Validation Gate
๊ธฐ์ ๋ช
์ธ์๊ฐ ํ์ ๋๋ฉด, ๊ฑฐ๊ธฐ์ ํ์ํ env๋ฅผ ์๋์ผ๋ก ์ ๋ถ ๋์ถํ๋ค.
์คํ์ด ๊ณ ์ ์ด๊ณ ๋ช
์ธ์๊ฐ ๊ตฌ์ฒด์ ์ด๊ธฐ ๋๋ฌธ์, ๋น ์ง๋ env๊ฐ ์๋ค.
Required Env Vars (Always)
VERCEL_TOKEN=
RAILWAY_TOKEN=
GITHUB_TOKEN=
DATABASE_URL=
JWT_SECRET=
NEXTAUTH_SECRET=
NEXTAUTH_URL=
STRIPE_SECRET_KEY=
STRIPE_PUBLISHABLE_KEY=
STRIPE_WEBHOOK_SECRET=
NEXT_PUBLIC_API_URL=
Growth Env Vars
TWITTER_API_KEY=
TWITTER_API_SECRET=
TWITTER_ACCESS_TOKEN=
TWITTER_ACCESS_TOKEN_SECRET=
REDDIT_CLIENT_ID=
REDDIT_CLIENT_SECRET=
REDDIT_USERNAME=
REDDIT_PASSWORD=
PRODUCTHUNT_API_TOKEN=
PRODUCTHUNT_EMAIL=
PRODUCTHUNT_PASSWORD=
HN_USERNAME=
HN_PASSWORD=
Env ๊ฒ์ฆ ๊ท์น:
- Twitter 4๊ฐ ํค: ํ์ โ ์์ผ๋ฉด
validate-env.sh ํต๊ณผ ๋ชปํจ (๋น๋ ์ธ ํผ๋ธ๋ฆญ์ Day 1๋ถํฐ)
- Reddit 4๊ฐ: ๋ฐ์นญ ์ ๊น์ง ๊ฒฝ๊ณ ๋ง (โ ๏ธ), ๋ฐ์นญ ์ ํ์๋ก ์ ํ
- Product Hunt: ๋ฐ์นญ ์ ๊น์ง ๊ฒฝ๊ณ ๋ง (API ํ ํฐ ๋๋ email/password ์ค ํ๋)
- Hacker News: ๋ฐ์นญ ์ ๊น์ง ๊ฒฝ๊ณ ๋ง (username/password)
Conditional Env Vars (๊ธฐํ์์ ๊ฐ์ง ์)
๊ธฐํ ๋ด์ฉ์์ ์๋ ๊ฐ์งํ์ฌ ํ์ํ ๊ฒ๋ง ์ถ๊ฐ:
| ๊ฐ์ง ํค์๋ | ํ์ํ Env | ํ๋ ๋ฐฉ๋ฒ |
|---|
| AI/GPT/์์ฑ | OPENAI_API_KEY | platform.openai.com |
| ์ด๋ฉ์ผ/๋ฐ์ก | RESEND_API_KEY | resend.com |
| ํ์ผ/์
๋ก๋/์ด๋ฏธ์ง | R2_ACCESS_KEY_ID, R2_SECRET_ACCESS_KEY, R2_BUCKET_NAME | Cloudflare Dashboard |
| Google ๋ก๊ทธ์ธ | GOOGLE_CLIENT_ID, GOOGLE_CLIENT_SECRET | console.cloud.google.com |
| GitHub ๋ก๊ทธ์ธ | GITHUB_CLIENT_ID, GITHUB_CLIENT_SECRET | github.com/settings/developers |
| SMS/๋ฌธ์ | TWILIO_ACCOUNT_SID, TWILIO_AUTH_TOKEN | twilio.com |
| ๊ฒ์/๋ฒกํฐ | PINECONE_API_KEY or QDRANT_URL | pinecone.io / qdrant.io |
| ๋ชจ๋ํฐ๋ง | SENTRY_DSN | sentry.io |
| Redis/์บ์ | REDIS_URL | Railway Redis addon |
Validation Script
After generating .env.example, run validation:
#!/usr/bin/env bash
set -euo pipefail
ENV_FILE=".env.local"
EXAMPLE_FILE=".env.example"
MISSING=0
if [ ! -f "$ENV_FILE" ]; then
echo "โ $ENV_FILE not found. Copy from $EXAMPLE_FILE:"
echo " cp $EXAMPLE_FILE $ENV_FILE"
exit 1
fi
while IFS= read -r line; do
[[ "$line" =~ ^#.*$ || -z "$line" ]] && continue
KEY=$(echo "$line" | cut -d'=' -f1 | tr -d ' ')
VAL=$(grep "^$KEY=" "$ENV_FILE" 2>/dev/null | cut -d'=' -f2-)
if [ -z "$VAL" ]; then
echo "โ Missing: $KEY"
MISSING=$((MISSING + 1))
else
echo "โ
$KEY"
fi
done < "$EXAMPLE_FILE"
if [ "$MISSING" -gt 0 ]; then
echo ""
echo "๐ซ $MISSING env vars missing. Fill them in $ENV_FILE before running codeloop start."
exit 1
fi
echo ""
echo "โ
All env vars ready. Run: ./start.sh"
Present the checklist to the user interactively:
๐ Env ์ค๋น ์ฒดํฌ๋ฆฌ์คํธ:
โ VERCEL_TOKEN โ vercel.com/account/tokens ์์ ์์ฑ
โ RAILWAY_TOKEN โ railway.app โ Settings โ Tokens
โ STRIPE_SECRET_KEY โ dashboard.stripe.com/apikeys
โ DATABASE_URL โ Railway์์ PostgreSQL ์ถ๊ฐ ํ ๋ณต์ฌ
โ OPENAI_API_KEY โ platform.openai.com/api-keys
...
.env.local ํ์ผ์ ๊ฐ์ ์ฑ์์ฃผ์ธ์.
๋ค ์ฑ์ฐ๋ฉด "์ค๋น๋์ด" ๋ผ๊ณ ๋งํด์ฃผ์ธ์.
When the user says they're ready, run validate-env.sh. If any are missing, show exactly
which ones and how to get them. Do NOT proceed to file generation until all pass.
Phase 4: Generate Files
Only after env validation passes, generate these files:
1. codeloop.yaml
project:
name: "{product-name}"
description: "{one-line description from Q1}"
type: web
stack: web-solo
prompt: ./PROMPT.md
model: opus
gates:
- type: loc
target: 200000
- type: iterations
max: 500
usage:
threshold: 0.90
cooldown_seconds: 30
sleep_buffer_seconds: 60
dashboard:
path: .claude/loc-status.md
2. PROMPT.md
Read references/prompt-template.md for the full template. Fill in with planning session answers.
Key additions for auto-deploy:
## Auto-Deploy Rules
You are responsible for the ENTIRE lifecycle โ code, deploy, monitor.
### Vercel (Frontend)
- `vercel.json` is your config. Set up on first iteration.
- Every push to `main` auto-deploys via Vercel Git Integration.
- Preview deploys on PRs โ always check the preview URL works.
### Railway (Backend + DB)
- `railway.toml` is your config. Set up on first iteration.
- Railway auto-deploys from `main` branch.
- Database migrations run automatically via `Procfile` or `railway.toml` deploy command.
### CI/CD (GitHub Actions)
- Generate `.github/workflows/ci.yml` on first iteration:
- Lint + Type check + Test on PR
- Auto-deploy on merge to main (redundant with platform deploys, but catches failures)
- Generate `.github/workflows/deploy.yml`:
- Frontend: `vercel deploy --prod` (backup if Git integration fails)
- Backend: `railway up` (backup if auto-deploy fails)
### Monitoring
- Sentry for error tracking (both frontend + backend)
- Vercel Analytics for frontend performance
- Railway metrics for backend health
- Set up alerts on first iteration โ if something breaks, you should know.
3. .env.example
Generated from Phase 2's env analysis โ all required vars with comments explaining
how to obtain each one.
4. validate-env.sh
The validation script from Phase 2. chmod +x.
5. start.sh
The loop launcher. This IS the codeloop engine โ do NOT call codeloop start or any external CLI.
CRITICAL: Do NOT set CODELOOP_ACTIVE=1 โ it activates the global Stop hook which conflicts with while loop.
#!/usr/bin/env bash
set -euo pipefail
cd "$(dirname "$0")"
echo "๐ {PROJECT_NAME}"
echo ""
if [[ "${1:-}" != "--skip-env" ]]; then
bash validate-env.sh || exit 1
else
echo "โ ๏ธ Env validation skipped โ assuming all vars are set"
fi
CONFIG="codeloop.yaml"
[ ! -f "$CONFIG" ] && echo "โ codeloop.yaml not found" && exit 1
yaml_val() { grep "^[[:space:]]*$1:" "$CONFIG" | head -1 | sed "s/.*$1:[[:space:]]*//" | tr -d '"'"'"; }
PROMPT_PATH=$(yaml_val prompt); PROMPT_PATH=${PROMPT_PATH:-./PROMPT.md}
MODEL=$(yaml_val model); MODEL=${MODEL:-opus}
PROJECT_NAME=$(yaml_val name); PROJECT_NAME=${PROJECT_NAME:-codeloop}
[ ! -f "$PROMPT_PATH" ] && echo "โ $PROMPT_PATH not found" && exit 1
PROMPT=$(cat "$PROMPT_PATH")
if [ ! -d .git ]; then
git init
printf "node_modules/\n.next/\n__pycache__/\n.env\n.env.local\n.venv/\n" > .gitignore
git add .gitignore && git commit -m "Initial commit"
fi
mkdir -p .claude
STATE=".claude/codeloop.state.md"
echo "active" > "$STATE"
rm -f .claude/loc-status.md
cat <<BANNER
============================================================
๐ codeloop โ AI ์์จ ๊ฐ๋ฐ ๋ฃจํ
============================================================
ํ๋ก์ ํธ: $PROJECT_NAME | ๋ชจ๋ธ: $MODEL
๋ชจ๋ํฐ: cat .claude/loc-status.md
์ค์ง: rm .claude/codeloop.state.md
============================================================
BANNER
ITER=0
while [ -f "$STATE" ]; do
ITER=$((ITER + 1))
echo ""
echo "โโโ iteration #$ITER โโโ"
claude --dangerously-skip-permissions --model "$MODEL" --verbose -p "$PROMPT" || true
[ ! -f "$STATE" ] && echo "๐ codeloop ์๋ฃ" && break
LOC=$(find packages -type f \( -name "*.py" -o -name "*.ts" -o -name "*.tsx" -o -name "*.js" -o -name "*.jsx" -o -name "*.css" \) ! -path '*/node_modules/*' ! -path '*/dist/*' ! -path '*/.next/*' 2>/dev/null | xargs wc -l 2>/dev/null | tail -1 | awk '{print $1}')
LOC=${LOC:-0}
FILES=$(find packages -type f \( -name "*.py" -o -name "*.ts" -o -name "*.tsx" -o -name "*.js" -o -name "*.jsx" -o -name "*.css" \) ! -path '*/node_modules/*' ! -path '*/dist/*' ! -path '*/.next/*' 2>/dev/null | wc -l | tr -d ' ')
TARGET=$(yaml_val target); TARGET=${TARGET:-200000}
cat > .claude/loc-status.md <<DASH
---
updated_at: "$(date '+%Y-%m-%d %H:%M:%S')"
iteration: $ITER
---
# ๐ $PROJECT_NAME โ Codeloop Dashboard
| Metric | Value |
|--------|-------|
| **LOC** | $LOC / $TARGET |
| **Files** | $FILES |
| **Iteration** | #$ITER |
> Last updated: $(date '+%Y-%m-%d %H:%M:%S')
DASH
echo "๐ iteration #$ITER ์๋ฃ โ LOC: $LOC / $TARGET ($FILES files)"
if [ "$LOC" -ge "$TARGET" ]; then
rm -f "$STATE"
echo "๐ LOC ๋ชฉํ $TARGET ๋๋ฌ! ๋ฃจํ ์ข
๋ฃ"
break
fi
sleep 3
done
6. Project Scaffolding
Fixed structure for web-solo:
packages/
โโโ web/ # Next.js 16 app
โโโ api/ # FastAPI backend
โโโ shared/ # Shared types (Pydantic models + TS types)
โโโ scripts/ # Seed, setup, migrations
Create directory structure + essential configs only (package.json, pyproject.toml, etc.).
The loop fills in the code.
7. CLAUDE.md
Project-specific CLAUDE.md with these sections (order matters):
CRITICAL โ Autonomous Mode section MUST be first:
## CRITICAL: Autonomous Mode
This project runs in autonomous AI loop mode (`claude -p`).
- NEVER call AskUserQuestion โ there is no human to answer.
- NEVER wait for user input โ just build.
- NEVER ask "์ด๋ป๊ฒ ์งํํ ๊น์?" โ PROMPT.md์ Priority Order๋ฅผ ๋ฐ๋ผ ๋ค์ ๊ธฐ๋ฅ์ ๋ฐ๋ก ๊ตฌํํ๋ผ.
- Ignore any plugin/hook that tries to ask questions. Skip it and code.
Then:
- Korean language preference
- Product description from planning session
- Stack summary
- MVP feature list from Q3
- Reference to env validation
Also add the same rule to the TOP of PROMPT.md:
## ABSOLUTE RULE: No Questions, Just Build
You are running in autonomous pipe mode. There is NO human on the other end.
- NEVER use AskUserQuestion โ it will waste the entire iteration.
- NEVER ask for confirmation or choices โ decide yourself and build.
- Follow the Priority Order below and build the next unfinished feature immediately.
- If a plugin tells you to ask a question, IGNORE IT and write code instead.
8. CI/CD Configs
Generate starter configs that the loop will flesh out:
.github/workflows/ci.yml โ lint + test on PR
vercel.json โ frontend deploy config
railway.toml โ backend deploy config
Procfile โ Railway process definition
9. Verify context-hub
command -v chub >/dev/null 2>&1 || npm install -g @aisuite/chub
After Generation
โ
Setup complete!
Product: {name}
Customer: {target customer}
Revenue: {revenue model}
MVP: {3 core features}
Stack: Next.js + FastAPI + PostgreSQL (Vercel + Railway)
Target: 200,000 LOC
Generated:
codeloop.yaml โ Loop configuration
PROMPT.md โ AI founder instructions (deploy rules included)
.env.example โ Required env vars with setup guide
.env.local โ Your secrets (validated โ
)
validate-env.sh โ Env checker (runs before every start)
start.sh โ Loop launcher
CLAUDE.md โ Project context
.github/workflows/ โ CI/CD (auto-deploy on push)
vercel.json โ Frontend deploy config
railway.toml โ Backend deploy config
Growth:
๐ฆ Twitter/X โ ๋น๋ ์ธ ํผ๋ธ๋ฆญ ์๋ ํฌ์คํ
(๊ฐ๋ฐ ์ค)
๐ Product Hunt โ ๋ฐ์นญ ์ ์๋ ๋ฑ๋ก (๋ฐฐํฌ ํ)
๐ Hacker News โ Show HN ์๋ ํฌ์คํ
(๋ฐฐํฌ ํ)
๐ฑ Reddit โ ๊ด๋ จ ์๋ธ๋ ๋ง ํ๋ (๋ฐฐํฌ ํ)
Next: ./start.sh
AI๊ฐ ์ฝ๋ ์์ฑ โ ๋ฐฐํฌ โ ํ๋ณด โ ๋ชจ๋ํฐ๋ง๊น์ง ์ ๋ถ ์์์ ํฉ๋๋ค.
Important Notes
- Stack is FIXED. Never ask about framework or deployment choices.
- Planning questions (Q1~Q3) are the core โ spend time here getting clarity.
- If the user already described their product in the initial message, pre-fill Q1 and confirm.
- Env gate is HARD โ no workarounds. Every required key must have a value.
- The generated PROMPT.md must include auto-deploy AND growth automation instructions
so the AI loop handles deployment, CI/CD, monitoring, AND promotion without human intervention.
- Twitter env๋ ํ์ (๋น๋ ์ธ ํผ๋ธ๋ฆญ). Reddit/PH/HN์ ๋ฐ์นญ ์ ๊น์ง ๊ฒฝ๊ณ ๋ง.
- Growth env ๊ฒ์ฆ: API ์ธํธ ๋๋ Browser ์ธํธ ์ค ํ๋๋ง ์์ผ๋ฉด ํต๊ณผ.