Aramb Metadata Generator
Analyze project structure and generate aramb.toml configuration with service definitions only. Uses APPLICATION_ID from environment variable.
Inputs
requirements: What metadata to generate or update
project_path: Root directory to analyze (defaults to current directory)
validation_criteria: Self-validation criteria (critical, expected, nice_to_have)
Prerequisites
CRITICAL: APPLICATION_ID environment variable MUST be set:
if [ -z "$APPLICATION_ID" ]; then
echo "ERROR: APPLICATION_ID environment variable not set"
echo "Set it with: export APPLICATION_ID=your-app-id"
exit 1
fi
CRITICAL RULE: Build Service Separation
When backend code needs to be built, you MUST create TWO services:
1. Build Service (type="build") - Backend Only
- Settings:
repoUrl, buildPath, targetBranches, installationId = "123456789" (dummy value)
- Outputs:
outputs.IMAGE_URL (Docker images)
- Excludes:
image, cmd, commandPort, publicNet, vars, secrets
2. Runtime Service (type="backend")
- Settings:
image = ${buildServiceId.outputs.IMAGE_URL}
- Settings:
cmd, commandPort, publicNet
- Includes: vars, secrets as needed
- Excludes:
repoUrl, buildPath, targetBranches, installationId
Exceptions
- Databases (postgres, redis, mongodb) use
image directly without build service
- Pre-built containers use
image directly without build service
- Frontend services are created as single services (type="frontend") with static build configuration, NO separate build service
Task Chat Communication
Send progress updates to the task chat so users can follow along. Use TaskUserResponse MCP tool for key milestones:
When to send updates:
- Starting: What you're analyzing
- Key milestones: Services discovered, configuration generated
- Completion: Summary of services created in aramb.toml
Example:
TaskUserResponse(message="🔍 Analyzing project structure. Found docker-compose.yml, scanning for services...")
TaskUserResponse(message="📋 Discovered 4 services: postgres-db, backend-build, backend-api, frontend-web. Generating aramb.toml...")
TaskUserResponse(message="✅ Generated aramb.toml with 4 services. Backend uses build service (101) → runtime (102). Ready for deployment.")
Keep messages concise. Focus on what was discovered and created.
Workflow
0. Validate APPLICATION_ID (CRITICAL FIRST STEP)
if [ -z "$APPLICATION_ID" ]; then
echo "ERROR: APPLICATION_ID environment variable not set"
echo "Set it with: export APPLICATION_ID=your-app-id"
exit 1
fi
echo "Using APPLICATION_ID: $APPLICATION_ID"
1. Discover Services
Docker Compose Analysis:
- Search for docker-compose.yml, docker-compose.yaml, compose.yml
- Extract services, ports, environment variables, volumes, dependencies
- Identify database images (postgres:15, redis:7, mongo:6)
Codebase Analysis (ALWAYS required):
- Environment files: .env, .env.example, .env.production
- Config files: config.js, settings.py, application.yml, config.toml
- Package files: package.json, go.mod, requirements.txt, Cargo.toml
- Source code: Search for
process.env, os.Getenv(), os.environ
- Framework detection: Express, FastAPI, Gin, Django, React, Vue, Angular, Next.js
- Build files: Dockerfile, Makefile, build scripts
2. Map Service Types
| Detected Pattern |
Services to Create |
Output |
| Backend framework (Express, FastAPI, Gin, Django, etc.) |
Build service (type="build")Backend service (type="backend") |
outputs.IMAGE_URL |
| Frontend framework (React, Vue, Angular, Next.js, etc.) |
Single frontend service (type="frontend") |
N/A |
| Microservice with Dockerfile |
Build service (type="build")Backend/template service |
outputs.IMAGE_URL |
| Aramb agent code |
Build service (type="build")Aramb-agent service (type="aramb-agent") |
outputs.IMAGE_URL |
| Database (postgres, redis, mongodb) |
Single service with image field |
N/A |
| Pre-built container |
Single service with image field |
N/A |
Rules:
- Backend code to build: TWO services (build + runtime)
- Frontend code: Single service (type="frontend") with static build configuration
- Databases: Single service with
image only
- Pre-built containers: Single service with
image only
- Build service ID < Runtime service ID (sequential ordering for backends)
- Build services: Auto-generate
installationId = "123456789" (dummy value)
3. Extract Configuration
Vars (Non-sensitive):
- Database: POSTGRES_DB, POSTGRES_USER, DB_HOST, DB_PORT
- Application: PORT, NODE_ENV, ENVIRONMENT, DEBUG, API_URL
- Configuration: TIMEOUT, MAX_CONNECTIONS, feature flags
Secrets (Sensitive - leave empty):
- Passwords: POSTGRES_PASSWORD, DB_PASSWORD, MYSQL_PASSWORD
- Tokens: API_KEY, AUTH_TOKEN, JWT_SECRET, SECRET_KEY
- Credentials: PRIVATE_KEY, OAUTH_CLIENT_SECRET, SESSION_SECRET
Secret Detection Keywords (case-insensitive):
- Classify as secret: PASSWORD, PASSWD, PWD, SECRET, TOKEN, API_KEY, PRIVATE, CREDENTIAL, JWT, OAUTH
- Classify as var: HOST, PORT, URL, ENDPOINT, DATABASE, DB_NAME, DB_USER, ENVIRONMENT, DEBUG
Service References:
- Vars:
${uniqueIdentifier.vars.KEY}
- Secrets:
${uniqueIdentifier.secrets.KEY}
- Build outputs:
${uniqueIdentifier.outputs.IMAGE_URL} or ${uniqueIdentifier.outputs.PATH}
4. Generate TOML Structure
CRITICAL: Only create services. Do NOT create project, application, or config_status sections.
Build Services: Always set installationId = "123456789" (dummy value for all build services)
Vars and Secrets: Create INDEPENDENT values for database credentials:
- Database names: Use project-specific names (e.g., "notesdb", "myapp_db")
- Usernames: Use default database usernames (e.g., "postgres", "root", "admin")
- Passwords: Leave as EMPTY strings (
value = "")
- Ports: Use standard ports (PostgreSQL: 5432, MySQL: 3306, Redis: 6379, MongoDB: 27017)
- Hosts: Use service names for container networking (e.g., "postgres", "redis", "mongodb")
DO NOT use placeholders or references for basic database configuration - create actual independent values
# Example: Database Service (pre-built image)
[[services]]
uniqueIdentifier = 100
name = "postgres-db"
type = "postgres"
description = "PostgreSQL database service for application data storage"
applicationID = "8ab0de2a-385c-42f8-8671-185b108802f6" # Actual value from $APPLICATION_ID
[services.configuration.settings]
image = "postgres:15"
commandPort = 5432
publicNet = false
[[services.configuration.vars]]
key = "POSTGRES_DB"
value = "myapp"
[[services.configuration.vars]]
key = "POSTGRES_USER"
value = "postgres"
[[services.configuration.secrets]]
key = "POSTGRES_PASSWORD"
value = ""
# Example: Backend Build Service
[[services]]
uniqueIdentifier = 101
name = "backend-build"
type = "build"
description = "Build service for backend API Docker image"
applicationID = "8ab0de2a-385c-42f8-8671-185b108802f6" # Actual value from $APPLICATION_ID
[services.configuration.settings]
repoUrl = "https://github.com/user/repo"
buildPath = "."
targetBranches = ["main"]
installationId = "123456789" # Dummy value - auto-generated
# Outputs: outputs.IMAGE_URL
# Example: Backend Runtime Service
[[services]]
uniqueIdentifier = 102
name = "backend-api"
type = "backend"
description = "Backend API service handling business logic and data processing"
applicationID = "8ab0de2a-385c-42f8-8671-185b108802f6" # Actual value from $APPLICATION_ID
[services.configuration.settings]
image = "${101.outputs.IMAGE_URL}"
cmd = "npm start"
commandPort = 8080
publicNet = true
[[services.configuration.vars]]
key = "PORT"
value = "8080"
[[services.configuration.vars]]
key = "DB_HOST"
value = "${100.outputs.PRIVATE_HOST}"
[[services.configuration.vars]]
key = "DB_PORT"
value = "${100.outputs.PRIVATE_PORT}"
[[services.configuration.secrets]]
key = "DATABASE_URL"
value = "postgres://${100.vars.POSTGRES_USER}:${100.secrets.POSTGRES_PASSWORD}@${100.outputs.PRIVATE_HOST}:${100.outputs.PRIVATE_PORT}/${100.vars.POSTGRES_DB}"
# ↑ SECRET because it references ${100.secrets.POSTGRES_PASSWORD}
[[services.configuration.secrets]]
key = "JWT_SECRET"
value = ""
# Example: Frontend Service (Single Service - No Build Service)
[[services]]
uniqueIdentifier = 103
name = "frontend-web"
type = "frontend"
description = "Frontend web application serving static files to users"
applicationID = "8ab0de2a-385c-42f8-8671-185b108802f6" # Actual value from $APPLICATION_ID
[services.configuration.settings]
staticPath = "./frontend/dist" # Local build output directory
cmd = "npx http-server"
commandPort = 8080
publicNet = true
[[services.configuration.vars]]
key = "API_URL"
value = "http://localhost:8080"
IMPORTANT:
- Do NOT create
[config_status] section
- Use actual APPLICATION_ID value from environment variable
- Create independent database credentials (db names, usernames)
- Leave passwords as empty strings
5. Update Existing TOML
If aramb.toml exists:
- Read existing configuration
- Merge new services (avoid duplicates)
- Preserve existing uniqueIdentifiers
- Do NOT create or update config_status section
Constraints
uniqueIdentifiers
- Services: 100, 101, 102, ... (sequential, no gaps, no duplicates)
- Build service ID < Runtime service ID
APPLICATION_ID
- MUST be set in environment variable
- MUST exit with error if not found
- MUST use actual APPLICATION_ID value in all services (NOT placeholder)
- Example:
applicationID = "8ab0de2a-385c-42f8-8671-185b108802f6" (actual value from $APPLICATION_ID)
Service Description
- MUST include
description field for ALL services
- MUST be clear and concise (1-2 sentences)
- MUST describe the service's purpose and role in the application
- Examples:
- Database: "PostgreSQL database service for application data storage"
- Backend: "Backend API service handling business logic and data processing"
- Frontend: "Frontend web application serving static files to users"
- Build: "Build service for backend API Docker image"
Service Types
- Supported: aramb-agent, backend, build, frontend, mongodb, onboarding, postgres, redis, template
- Build service: Always type="build"
- Runtime service: backend, frontend, aramb-agent, onboarding, template
- Database: postgres, redis, mongodb
Settings Validation
Build Service (type="build") - Backend Only:
- MUST have:
description (clear, concise service purpose)
- MUST have:
repoUrl, buildPath, targetBranches, installationId = "123456789" (auto-generated dummy value)
- MUST NOT have:
image, cmd, commandPort, publicNet, vars, secrets
Backend Runtime Service (type="backend"):
- MUST have:
description (clear, concise service purpose)
- MUST have:
image (reference to build output, e.g., ${101.outputs.IMAGE_URL})
- MUST have:
cmd, commandPort
- MUST NOT have:
repoUrl, buildPath, targetBranches, installationId
- MUST have: Corresponding build service with lower uniqueIdentifier
Frontend Service (type="frontend") - Single Service:
- MUST have:
description (clear, concise service purpose)
- MUST have:
staticPath (local path to build output, e.g., "./frontend/dist")
- MUST have:
cmd, commandPort
- MUST NOT have:
repoUrl, buildPath, targetBranches, installationId, image
- NO build service required - frontend builds happen locally
Database Service (postgres, redis, mongodb):
- MUST have:
description (clear, concise service purpose)
- MUST have:
image (direct, e.g., "postgres:15")
- MUST NOT have:
repoUrl, buildPath, targetBranches, installationId
Pre-built Container Service:
- MUST have:
description (clear, concise service purpose)
- MUST have:
image (direct, e.g., "myorg/app:latest")
- MUST NOT have:
repoUrl, buildPath, targetBranches, installationId
NEVER: Both image (direct) and repoUrl in same service
Vars & Secrets
CRITICAL CONSTRAINT: Secrets can ONLY be referenced in secrets, vars can be referenced anywhere
Rules:
- If a value references another service's SECRET → it MUST be a SECRET
- If a value references only VARS → it CAN be a VAR or SECRET
- If a value has NO references → it CAN be a VAR or SECRET
Example (CORRECT):
# Service 100: Database
[[services.configuration.secrets]]
key = "POSTGRES_PASSWORD"
value = ""
# Service 102: Backend
[[services.configuration.secrets]] # ← SECRET because it references a secret
key = "DATABASE_URL"
value = "postgres://${100.vars.POSTGRES_USER}:${100.secrets.POSTGRES_PASSWORD}@${100.outputs.PRIVATE_HOST}:${100.outputs.PRIVATE_PORT}/${100.vars.POSTGRES_DB}"
Example (INCORRECT):
# Service 102: Backend
[[services.configuration.vars]] # ✗ WRONG! References a secret but defined as var
key = "DATABASE_URL"
value = "postgres://...${100.secrets.POSTGRES_PASSWORD}..." # ✗ Secret reference in var!
Guidelines:
- Extract from codebase analysis (env files, config files, source code)
- Never hardcode sensitive values
- Leave secrets with empty values (
"")
- Use service references to avoid duplication
- If referencing secrets → use secrets section
- If referencing only vars → use vars section
- Services ordered by dependency (higher IDs depend on lower IDs)
Self-Validation
Critical checks (MUST pass):
- APPLICATION_ID environment variable is set
- TOML syntax is valid
- Structure complete: Only services (100+), NO project, application, or config_status sections
- Service types valid: aramb-agent, backend, build, frontend, mongodb, onboarding, postgres, redis, template
- uniqueIdentifiers sequential: 100, 101, 102, ...
- Required fields present (service: name, type, description, applicationID)
- All services MUST have
description field with clear, concise text (1-2 sentences)
- All services use actual APPLICATION_ID value from environment variable (NOT placeholder)
- Database vars have independent values: database names, usernames, ports, hosts
- Passwords and secrets are empty strings (
value = "")
- Build service pattern followed for backends:
- Build services (type="build") have
repoUrl, no cmd
- Backend runtime services reference build outputs, no
repoUrl
- Build service ID < Backend runtime service ID
- Frontend services (type="frontend"):
- Have
staticPath pointing to local build directory
- NO separate build service required
- Have
cmd and commandPort
- Database services have
image, no repoUrl
- Vars and secrets extracted from codebase (not empty)
- Service references valid (
${N.vars.KEY} points to existing service)
- Secrets empty or use references (never hardcoded)
- CRITICAL: Values referencing secrets MUST be in secrets section (NOT vars)
- CRITICAL: If
${N.secrets.KEY} appears in value → must be a secret, not a var
Error Handling
- No services detected → Create minimal template with database and backend services
- Unknown service type → Use "template" as default
- Circular dependencies → Log warning, break cycle
- Docker-compose parsing fails → Fall back to codebase analysis
- APPLICATION_ID not set → EXIT with error immediately
Output
Return JSON summary:
{
"file_created": "aramb.toml",
"application_id": "8ab0de2a-385c-42f8-8671-185b108802f6",
"structure": {
"services": 4
},
"services_detected": [
{"uniqueIdentifier": 100, "name": "postgres-db", "type": "postgres", "description": "PostgreSQL database service for application data storage", "applicationID": "8ab0de2a-385c-42f8-8671-185b108802f6"},
{"uniqueIdentifier": 101, "name": "backend-build", "type": "build", "description": "Build service for backend API Docker image", "applicationID": "8ab0de2a-385c-42f8-8671-185b108802f6"},
{"uniqueIdentifier": 102, "name": "backend-api", "type": "backend", "description": "Backend API service handling business logic and data processing", "applicationID": "8ab0de2a-385c-42f8-8671-185b108802f6"},
{"uniqueIdentifier": 103, "name": "frontend-web", "type": "frontend", "description": "Frontend web application serving static files to users", "applicationID": "8ab0de2a-385c-42f8-8671-185b108802f6"}
],
"build_outputs": {
"101": "outputs.IMAGE_URL → service 102"
},
"frontend_static_builds": {
"103": "staticPath: ./frontend/dist (local build)"
},
"vars_created": {
"100": ["POSTGRES_DB=notesdb", "POSTGRES_USER=postgres"],
"102": ["PORT=8080", "DB_HOST=localhost"],
"103": ["API_URL=http://localhost:8080"]
},
"secrets_created": {
"100": ["POSTGRES_PASSWORD=\"\""],
"102": ["DATABASE_URL=postgresql://...", "JWT_SECRET=\"\""]
},
"reference_constraints_applied": [
"DATABASE_URL placed in secrets (references POSTGRES_PASSWORD secret)",
"All secret references only in secrets section",
"Var references allowed in both vars and secrets"
],
"service_references": [
"102 → 100 (DB vars/secrets)",
"102 → 101 (IMAGE_URL)"
],
"notes": [
"All services use actual APPLICATION_ID from environment",
"Database credentials created with independent values",
"Passwords left empty for security",
"Build service has dummy installationId=123456789"
],
"validation_passed": true
}
1---2name: aramb-metadata3description: Generate or update aramb.toml configuration file by analyzing docker-compose files or codebase. Use this skill when you need to create project metadata, service configurations, or environment setup for aramb-orchestrated projects.4license: MIT5---67# Aramb Metadata Generator89Analyze project structure and generate aramb.toml configuration with service definitions only. Uses APPLICATION_ID from environment variable.1011## Inputs1213- `requirements`: What metadata to generate or update14- `project_path`: Root directory to analyze (defaults to current directory)15- `validation_criteria`: Self-validation criteria (critical, expected, nice_to_have)1617## Prerequisites1819**CRITICAL**: APPLICATION_ID environment variable MUST be set:2021```bash22if [ -z "$APPLICATION_ID" ]; then23 echo "ERROR: APPLICATION_ID environment variable not set"24 echo "Set it with: export APPLICATION_ID=your-app-id"25 exit 126fi27```2829## CRITICAL RULE: Build Service Separation3031**When backend code needs to be built, you MUST create TWO services:**3233### 1. Build Service (type="build") - Backend Only34- **Settings**: `repoUrl`, `buildPath`, `targetBranches`, `installationId = "123456789"` (dummy value)35- **Outputs**: `outputs.IMAGE_URL` (Docker images)36- **Excludes**: `image`, `cmd`, `commandPort`, `publicNet`, vars, secrets3738### 2. Runtime Service (type="backend")39- **Settings**: `image` = `${buildServiceId.outputs.IMAGE_URL}`40- **Settings**: `cmd`, `commandPort`, `publicNet`41- **Includes**: vars, secrets as needed42- **Excludes**: `repoUrl`, `buildPath`, `targetBranches`, `installationId`4344### Exceptions45- **Databases** (postgres, redis, mongodb) use `image` directly without build service46- **Pre-built containers** use `image` directly without build service47- **Frontend services** are created as single services (type="frontend") with static build configuration, NO separate build service4849## Task Chat Communication5051Send progress updates to the task chat so users can follow along. Use `TaskUserResponse` MCP tool for key milestones:5253**When to send updates:**54- **Starting**: What you're analyzing55- **Key milestones**: Services discovered, configuration generated56- **Completion**: Summary of services created in aramb.toml5758**Example:**59```60TaskUserResponse(message="🔍 Analyzing project structure. Found docker-compose.yml, scanning for services...")61```6263```64TaskUserResponse(message="📋 Discovered 4 services: postgres-db, backend-build, backend-api, frontend-web. Generating aramb.toml...")65```6667```68TaskUserResponse(message="✅ Generated aramb.toml with 4 services. Backend uses build service (101) → runtime (102). Ready for deployment.")69```7071Keep messages concise. Focus on what was discovered and created.7273## Workflow7475### 0. Validate APPLICATION_ID (CRITICAL FIRST STEP)7677```bash78if [ -z "$APPLICATION_ID" ]; then79 echo "ERROR: APPLICATION_ID environment variable not set"80 echo "Set it with: export APPLICATION_ID=your-app-id"81 exit 182fi8384echo "Using APPLICATION_ID: $APPLICATION_ID"85```8687### 1. Discover Services8889**Docker Compose Analysis**:90- Search for docker-compose.yml, docker-compose.yaml, compose.yml91- Extract services, ports, environment variables, volumes, dependencies92- Identify database images (postgres:15, redis:7, mongo:6)9394**Codebase Analysis** (ALWAYS required):95- **Environment files**: .env, .env.example, .env.production96- **Config files**: config.js, settings.py, application.yml, config.toml97- **Package files**: package.json, go.mod, requirements.txt, Cargo.toml98- **Source code**: Search for `process.env`, `os.Getenv()`, `os.environ`99- **Framework detection**: Express, FastAPI, Gin, Django, React, Vue, Angular, Next.js100- **Build files**: Dockerfile, Makefile, build scripts101102### 2. Map Service Types103104| Detected Pattern | Services to Create | Output |105|-----------------|-------------------|--------|106| Backend framework (Express, FastAPI, Gin, Django, etc.) | Build service (type="build")<br>Backend service (type="backend") | `outputs.IMAGE_URL` |107| Frontend framework (React, Vue, Angular, Next.js, etc.) | Single frontend service (type="frontend") | N/A |108| Microservice with Dockerfile | Build service (type="build")<br>Backend/template service | `outputs.IMAGE_URL` |109| Aramb agent code | Build service (type="build")<br>Aramb-agent service (type="aramb-agent") | `outputs.IMAGE_URL` |110| Database (postgres, redis, mongodb) | Single service with `image` field | N/A |111| Pre-built container | Single service with `image` field | N/A |112113**Rules**:114- **Backend code to build**: TWO services (build + runtime)115- **Frontend code**: Single service (type="frontend") with static build configuration116- **Databases**: Single service with `image` only117- **Pre-built containers**: Single service with `image` only118- **Build service ID < Runtime service ID** (sequential ordering for backends)119- **Build services**: Auto-generate `installationId = "123456789"` (dummy value)120121### 3. Extract Configuration122123**Vars (Non-sensitive)**:124- Database: POSTGRES_DB, POSTGRES_USER, DB_HOST, DB_PORT125- Application: PORT, NODE_ENV, ENVIRONMENT, DEBUG, API_URL126- Configuration: TIMEOUT, MAX_CONNECTIONS, feature flags127128**Secrets (Sensitive - leave empty)**:129- Passwords: POSTGRES_PASSWORD, DB_PASSWORD, MYSQL_PASSWORD130- Tokens: API_KEY, AUTH_TOKEN, JWT_SECRET, SECRET_KEY131- Credentials: PRIVATE_KEY, OAUTH_CLIENT_SECRET, SESSION_SECRET132133**Secret Detection Keywords** (case-insensitive):134- Classify as **secret**: PASSWORD, PASSWD, PWD, SECRET, TOKEN, API_KEY, PRIVATE, CREDENTIAL, JWT, OAUTH135- Classify as **var**: HOST, PORT, URL, ENDPOINT, DATABASE, DB_NAME, DB_USER, ENVIRONMENT, DEBUG136137**Service References**:138- Vars: `${uniqueIdentifier.vars.KEY}`139- Secrets: `${uniqueIdentifier.secrets.KEY}`140- Build outputs: `${uniqueIdentifier.outputs.IMAGE_URL}` or `${uniqueIdentifier.outputs.PATH}`141142### 4. Generate TOML Structure143144**CRITICAL**: Only create services. Do NOT create project, application, or config_status sections.145146**Build Services**: Always set `installationId = "123456789"` (dummy value for all build services)147148**Vars and Secrets**: Create INDEPENDENT values for database credentials:149- Database names: Use project-specific names (e.g., "notesdb", "myapp_db")150- Usernames: Use default database usernames (e.g., "postgres", "root", "admin")151- Passwords: Leave as EMPTY strings (`value = ""`)152- Ports: Use standard ports (PostgreSQL: 5432, MySQL: 3306, Redis: 6379, MongoDB: 27017)153- Hosts: Use service names for container networking (e.g., "postgres", "redis", "mongodb")154155**DO NOT** use placeholders or references for basic database configuration - create actual independent values156157```toml158# Example: Database Service (pre-built image)159[[services]]160uniqueIdentifier = 100161name = "postgres-db"162type = "postgres"163description = "PostgreSQL database service for application data storage"164applicationID = "8ab0de2a-385c-42f8-8671-185b108802f6" # Actual value from $APPLICATION_ID165166[services.configuration.settings]167image = "postgres:15"168commandPort = 5432169publicNet = false170171[[services.configuration.vars]]172key = "POSTGRES_DB"173value = "myapp"174175[[services.configuration.vars]]176key = "POSTGRES_USER"177value = "postgres"178179[[services.configuration.secrets]]180key = "POSTGRES_PASSWORD"181value = ""182183# Example: Backend Build Service184[[services]]185uniqueIdentifier = 101186name = "backend-build"187type = "build"188description = "Build service for backend API Docker image"189applicationID = "8ab0de2a-385c-42f8-8671-185b108802f6" # Actual value from $APPLICATION_ID190191[services.configuration.settings]192repoUrl = "https://github.com/user/repo"193buildPath = "."194targetBranches = ["main"]195installationId = "123456789" # Dummy value - auto-generated196# Outputs: outputs.IMAGE_URL197198# Example: Backend Runtime Service199[[services]]200uniqueIdentifier = 102201name = "backend-api"202type = "backend"203description = "Backend API service handling business logic and data processing"204applicationID = "8ab0de2a-385c-42f8-8671-185b108802f6" # Actual value from $APPLICATION_ID205206[services.configuration.settings]207image = "${101.outputs.IMAGE_URL}"208cmd = "npm start"209commandPort = 8080210publicNet = true211212[[services.configuration.vars]]213key = "PORT"214value = "8080"215216[[services.configuration.vars]]217key = "DB_HOST"218value = "${100.outputs.PRIVATE_HOST}"219220[[services.configuration.vars]]221key = "DB_PORT"222value = "${100.outputs.PRIVATE_PORT}"223224[[services.configuration.secrets]]225key = "DATABASE_URL"226value = "postgres://${100.vars.POSTGRES_USER}:${100.secrets.POSTGRES_PASSWORD}@${100.outputs.PRIVATE_HOST}:${100.outputs.PRIVATE_PORT}/${100.vars.POSTGRES_DB}"227# ↑ SECRET because it references ${100.secrets.POSTGRES_PASSWORD}228229[[services.configuration.secrets]]230key = "JWT_SECRET"231value = ""232233# Example: Frontend Service (Single Service - No Build Service)234[[services]]235uniqueIdentifier = 103236name = "frontend-web"237type = "frontend"238description = "Frontend web application serving static files to users"239applicationID = "8ab0de2a-385c-42f8-8671-185b108802f6" # Actual value from $APPLICATION_ID240241[services.configuration.settings]242staticPath = "./frontend/dist" # Local build output directory243cmd = "npx http-server"244commandPort = 8080245publicNet = true246247[[services.configuration.vars]]248key = "API_URL"249value = "http://localhost:8080"250```251252**IMPORTANT**:253- Do NOT create `[config_status]` section254- Use actual APPLICATION_ID value from environment variable255- Create independent database credentials (db names, usernames)256- Leave passwords as empty strings257258### 5. Update Existing TOML259260If aramb.toml exists:261- Read existing configuration262- Merge new services (avoid duplicates)263- Preserve existing uniqueIdentifiers264- Do NOT create or update config_status section265266## Constraints267268### uniqueIdentifiers269- **Services**: 100, 101, 102, ... (sequential, no gaps, no duplicates)270- **Build service ID < Runtime service ID**271272### APPLICATION_ID273- **MUST** be set in environment variable274- **MUST** exit with error if not found275- **MUST** use actual APPLICATION_ID value in all services (NOT placeholder)276- **Example**: `applicationID = "8ab0de2a-385c-42f8-8671-185b108802f6"` (actual value from $APPLICATION_ID)277278### Service Description279- **MUST** include `description` field for ALL services280- **MUST** be clear and concise (1-2 sentences)281- **MUST** describe the service's purpose and role in the application282- Examples:283 - Database: "PostgreSQL database service for application data storage"284 - Backend: "Backend API service handling business logic and data processing"285 - Frontend: "Frontend web application serving static files to users"286 - Build: "Build service for backend API Docker image"287288### Service Types289- Supported: aramb-agent, backend, build, frontend, mongodb, onboarding, postgres, redis, template290- **Build service**: Always type="build"291- **Runtime service**: backend, frontend, aramb-agent, onboarding, template292- **Database**: postgres, redis, mongodb293294### Settings Validation295296**Build Service (type="build")** - Backend Only:297- **MUST have**: `description` (clear, concise service purpose)298- **MUST have**: `repoUrl`, `buildPath`, `targetBranches`, `installationId = "123456789"` (auto-generated dummy value)299- **MUST NOT have**: `image`, `cmd`, `commandPort`, `publicNet`, vars, secrets300301**Backend Runtime Service (type="backend")**:302- **MUST have**: `description` (clear, concise service purpose)303- **MUST have**: `image` (reference to build output, e.g., `${101.outputs.IMAGE_URL}`)304- **MUST have**: `cmd`, `commandPort`305- **MUST NOT have**: `repoUrl`, `buildPath`, `targetBranches`, `installationId`306- **MUST have**: Corresponding build service with lower uniqueIdentifier307308**Frontend Service (type="frontend")** - Single Service:309- **MUST have**: `description` (clear, concise service purpose)310- **MUST have**: `staticPath` (local path to build output, e.g., "./frontend/dist")311- **MUST have**: `cmd`, `commandPort`312- **MUST NOT have**: `repoUrl`, `buildPath`, `targetBranches`, `installationId`, `image`313- **NO build service required** - frontend builds happen locally314315**Database Service (postgres, redis, mongodb)**:316- **MUST have**: `description` (clear, concise service purpose)317- **MUST have**: `image` (direct, e.g., "postgres:15")318- **MUST NOT have**: `repoUrl`, `buildPath`, `targetBranches`, `installationId`319320**Pre-built Container Service**:321- **MUST have**: `description` (clear, concise service purpose)322- **MUST have**: `image` (direct, e.g., "myorg/app:latest")323- **MUST NOT have**: `repoUrl`, `buildPath`, `targetBranches`, `installationId`324325**NEVER**: Both `image` (direct) and `repoUrl` in same service326327### Vars & Secrets328329**CRITICAL CONSTRAINT**: Secrets can ONLY be referenced in secrets, vars can be referenced anywhere330331**Rules**:3321. **If a value references another service's SECRET** → it MUST be a SECRET3332. **If a value references only VARS** → it CAN be a VAR or SECRET3343. **If a value has NO references** → it CAN be a VAR or SECRET335336**Example (CORRECT)**:337```toml338# Service 100: Database339[[services.configuration.secrets]]340key = "POSTGRES_PASSWORD"341value = ""342343# Service 102: Backend344[[services.configuration.secrets]] # ← SECRET because it references a secret345key = "DATABASE_URL"346value = "postgres://${100.vars.POSTGRES_USER}:${100.secrets.POSTGRES_PASSWORD}@${100.outputs.PRIVATE_HOST}:${100.outputs.PRIVATE_PORT}/${100.vars.POSTGRES_DB}"347```348349**Example (INCORRECT)**:350```toml351# Service 102: Backend352[[services.configuration.vars]] # ✗ WRONG! References a secret but defined as var353key = "DATABASE_URL"354value = "postgres://...${100.secrets.POSTGRES_PASSWORD}..." # ✗ Secret reference in var!355```356357**Guidelines**:358- Extract from codebase analysis (env files, config files, source code)359- Never hardcode sensitive values360- Leave secrets with empty values (`""`)361- Use service references to avoid duplication362- **If referencing secrets → use secrets section**363- **If referencing only vars → use vars section**364- Services ordered by dependency (higher IDs depend on lower IDs)365366## Self-Validation367368**Critical checks** (MUST pass):3691. APPLICATION_ID environment variable is set3702. TOML syntax is valid3713. Structure complete: Only services (100+), NO project, application, or config_status sections3724. Service types valid: aramb-agent, backend, build, frontend, mongodb, onboarding, postgres, redis, template3735. uniqueIdentifiers sequential: 100, 101, 102, ...3746. Required fields present (service: name, type, description, applicationID)3757. All services MUST have `description` field with clear, concise text (1-2 sentences)3768. All services use actual APPLICATION_ID value from environment variable (NOT placeholder)3779. Database vars have independent values: database names, usernames, ports, hosts37810. Passwords and secrets are empty strings (`value = ""`)3799. Build service pattern followed for backends:380 - Build services (type="build") have `repoUrl`, no `cmd`381 - Backend runtime services reference build outputs, no `repoUrl`382 - Build service ID < Backend runtime service ID38310. Frontend services (type="frontend"):384 - Have `staticPath` pointing to local build directory385 - NO separate build service required386 - Have `cmd` and `commandPort`38711. Database services have `image`, no `repoUrl`38812. Vars and secrets extracted from codebase (not empty)38913. Service references valid (`${N.vars.KEY}` points to existing service)39014. Secrets empty or use references (never hardcoded)39115. **CRITICAL**: Values referencing secrets MUST be in secrets section (NOT vars)39216. **CRITICAL**: If `${N.secrets.KEY}` appears in value → must be a secret, not a var393394## Error Handling395396- No services detected → Create minimal template with database and backend services397- Unknown service type → Use "template" as default398- Circular dependencies → Log warning, break cycle399- Docker-compose parsing fails → Fall back to codebase analysis400- APPLICATION_ID not set → EXIT with error immediately401402## Output403404Return JSON summary:405```json406{407 "file_created": "aramb.toml",408 "application_id": "8ab0de2a-385c-42f8-8671-185b108802f6",409 "structure": {410 "services": 4411 },412 "services_detected": [413 {"uniqueIdentifier": 100, "name": "postgres-db", "type": "postgres", "description": "PostgreSQL database service for application data storage", "applicationID": "8ab0de2a-385c-42f8-8671-185b108802f6"},414 {"uniqueIdentifier": 101, "name": "backend-build", "type": "build", "description": "Build service for backend API Docker image", "applicationID": "8ab0de2a-385c-42f8-8671-185b108802f6"},415 {"uniqueIdentifier": 102, "name": "backend-api", "type": "backend", "description": "Backend API service handling business logic and data processing", "applicationID": "8ab0de2a-385c-42f8-8671-185b108802f6"},416 {"uniqueIdentifier": 103, "name": "frontend-web", "type": "frontend", "description": "Frontend web application serving static files to users", "applicationID": "8ab0de2a-385c-42f8-8671-185b108802f6"}417 ],418 "build_outputs": {419 "101": "outputs.IMAGE_URL → service 102"420 },421 "frontend_static_builds": {422 "103": "staticPath: ./frontend/dist (local build)"423 },424 "vars_created": {425 "100": ["POSTGRES_DB=notesdb", "POSTGRES_USER=postgres"],426 "102": ["PORT=8080", "DB_HOST=localhost"],427 "103": ["API_URL=http://localhost:8080"]428 },429 "secrets_created": {430 "100": ["POSTGRES_PASSWORD=\"\""],431 "102": ["DATABASE_URL=postgresql://...", "JWT_SECRET=\"\""]432 },433 "reference_constraints_applied": [434 "DATABASE_URL placed in secrets (references POSTGRES_PASSWORD secret)",435 "All secret references only in secrets section",436 "Var references allowed in both vars and secrets"437 ],438 "service_references": [439 "102 → 100 (DB vars/secrets)",440 "102 → 101 (IMAGE_URL)"441 ],442 "notes": [443 "All services use actual APPLICATION_ID from environment",444 "Database credentials created with independent values",445 "Passwords left empty for security",446 "Build service has dummy installationId=123456789"447 ],448 "validation_passed": true449}450```