agentleFS
linuxfoundationlinuxfoundation/lfx-skills/skills/lfx-setup/SKILL.md

lfx-setup

Skill10 starsChanged 2 months agoMITView on GitHub

Environment setup for any LFX repo, prerequisites, clone, install, env vars, and dev server. Adapts to repo type (Angular or Go). Use for getting started, first-time setup, broken environments, or install failures.

  • Reads credentials
  • Deletes or force-pushes
  • Installs packages

The file

We split this skill into the rules it gives an agent

7 rules. About 0 are common, 5 are distinctive, and 2 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈5

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 2

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Key principle: Verify each step before proceeding to the next.

    line 18
  2. Distinctive:

    Before diving into the technical steps, here's what you should have ready:

    line 22
  3. Distinctive:

    Don't worry if you're not sure about any of these, I'll check each one as we go and help you get access if needed.

    line 29
  4. Distinctive:

    Check that the following are installed and verify versions:

    line 47
  5. Very specific:

    If corepack enable fails with permission errors: sudo corepack enable

    line 64
  6. Very specific:

    If using Homebrew Node: Homebrew doesn't always include corepack, npm install -g corepack first

    line 65
  7. Distinctive:

    If not already cloned:

    line 70

≈ “Common” is an estimate: at least 1 in 5 of the 408,460 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md
<!-- Copyright The Linux Foundation and each contributor to LFX. --><!-- SPDX-License-Identifier: MIT --><!-- Tool names in this file use Claude Code vocabulary. See docs/tool-mapping.md for other platforms. -->

LFX Environment Setup Guide

You are helping a contributor set up an LFX development environment from scratch. Walk through each step interactively, verifying success before moving on.

Key principle: Verify each step before proceeding to the next.

What You'll Need (before we start)

Before diving into the technical steps, here's what you should have ready:

  • Access to the LFX GitHub organization, you need to be able to clone LFX repositories. If you can visit github.com/linuxfoundation and see private repos, you're good.
  • Access to the team 1Password vault, some configuration values (API keys, secrets) are stored in 1Password under the "LFX One Dev Environment" vault. Ask your team lead if you don't have access.
  • About 15 minutes, first-time setup takes a bit for downloads and installs. Subsequent setups are faster.
  • A terminal app, Terminal.app (macOS), iTerm2, or any terminal emulator.

Don't worry if you're not sure about any of these, I'll check each one as we go and help you get access if needed. Don't assume success, check.

Repo Type Detection

if [ -f apps/lfx-one/angular.json ] || [ -f turbo.json ]; then
  echo "REPO_TYPE=angular"      # lfx-self-serve
elif [ -f go.mod ]; then
  echo "REPO_TYPE=go"           # Go microservice
fi

Angular Repo Setup (lfx-self-serve)

Step 1: Prerequisites

Check that the following are installed and verify versions:

echo "=== Prerequisites Check ==="
echo -n "Node.js: " && node --version 2>/dev/null || echo "NOT INSTALLED"
echo -n "Yarn: " && yarn --version 2>/dev/null || echo "NOT INSTALLED"
echo -n "Git: " && git --version 2>/dev/null || echo "NOT INSTALLED"

Required versions:

  1. Node.js v22+, If wrong version: recommend nvm install 22 && nvm use 22
  2. Yarn v4.9.2+, If missing: corepack enable && corepack prepare yarn@4.9.2 --activate
  3. Git, Any recent version

Docker is NOT required for local development. All services point to the shared dev environment.

macOS-specific notes:

  • If corepack enable fails with permission errors: sudo corepack enable
  • If using Homebrew Node: Homebrew doesn't always include corepack, npm install -g corepack first
  • Xcode Command Line Tools must be installed: xcode-select --install

Step 2: Clone the Repository

If not already cloned:

git clone <repository-url>
cd lfx-self-serve

Step 3: Environment Variables

  1. Copy the env template:
    cp apps/lfx-one/.env.example apps/lfx-one/.env
  2. Get credentials from 1Password:
    • Access the LFX One Dev Environment vault
    • Copy all required values into apps/lfx-one/.env
  3. Validate critical env vars:
    echo "=== Env Var Check ==="
    missing=()
    for key in PCC_AUTH0_CLIENT_ID PCC_AUTH0_CLIENT_SECRET PCC_AUTH0_ISSUER_BASE_URL PCC_AUTH0_AUDIENCE PCC_AUTH0_SECRET PCC_BASE_URL LFX_V2_SERVICE; do
      if grep -qE "^${key}=.+" apps/lfx-one/.env 2>/dev/null; then
        echo "✓ $key"
      else
        echo "✗ $key, MISSING"
        missing+=("$key")
      fi
    done
    if [ ${#missing[@]} -gt 0 ]; then
      echo -e "\nMissing vars: ${missing[*]}"
      echo "Get these from 1Password → LFX One Dev Environment vault"
    else
      echo -e "\nAll critical env vars are populated ✓"
    fi

Step 4: Install Dependencies

yarn install

If yarn install fails:

  • EACCES errors → Don't use sudo. Check Node is installed via nvm, not system package
  • Corepack errors → corepack enable && corepack prepare yarn@4.9.2 --activate
  • Network errors → Check VPN/proxy settings, try yarn config set httpProxy ...
  • node-gyp errors → Ensure Xcode Command Line Tools are installed: xcode-select --install

Verify install succeeded:

[ -d node_modules ] && echo "✓ node_modules exists" || echo "✗ node_modules missing"
[ -f yarn.lock ] && echo "✓ yarn.lock exists" || echo "✗ yarn.lock missing"

Step 5: Start Development Server

yarn start

The app should be available at http://localhost:4200.

Step 6: Verify

# Wait a few seconds for the server to start, then check
curl -s -o /dev/null -w "%{http_code}" http://localhost:4200

Expected: HTTP 200 or 302 (redirect to login).

If the server fails to start:

  • Port 4200 in use → lsof -i :4200 to find the process, kill it or use a different port
  • Auth errors → Verify .env values match 1Password
  • Build errors → Run yarn build separately to see detailed errors
  • SSR errors → Check Node version is 22+

Go Microservice Setup

Step 1: Prerequisites

echo "=== Prerequisites Check ==="
echo -n "Go: " && go version 2>/dev/null || echo "NOT INSTALLED"
echo -n "Git: " && git --version 2>/dev/null || echo "NOT INSTALLED"
echo -n "Make: " && make --version 2>/dev/null | head -1 || echo "NOT INSTALLED"

Required:

  1. Go 1.22+, go version
  2. Git, git --version
  3. Make, make --version
  4. Goa v3, installed via Makefile (make apigen handles this)

Optional for full local stack:

  • Helm, helm version
  • OrbStack or Docker, for running the platform locally

Step 2: Clone the Repository

git clone <repository-url>
cd lfx-v2-<service>-service

Step 3: Environment Variables

Standard environment variables for running against the local stack:

export NATS_URL=nats://localhost:4222
export OPENSEARCH_URL=http://localhost:9200
export JWKS_URL=http://localhost:4457/.well-known/jwks
export LFX_ENVIRONMENT=lfx.
export PORT=8080

For running against the shared dev environment, get values from 1Password.

Step 4: Build

go mod download
go build ./...

If build fails:

  • Missing dependencies → go mod tidy && go mod download
  • Wrong Go version → Check go.mod for required version
  • CGO errors on macOS → export CGO_ENABLED=0 if the service doesn't need CGO

Verify:

echo $? # Should be 0

Step 5: Generate API Code (if applicable)

make apigen

If apigen fails:

  • Goa not installed → The Makefile should auto-install it. If not: go install goa.design/goa/v3/cmd/goa@v3.22.6
  • Design errors → Check cmd/*/design/*.go for syntax issues

Step 6: Run

go run cmd/*-api/main.go

Verify:

curl -s http://localhost:8080/livez
# Expected: 200 OK

Step 7: Local Platform Stack (Optional)

To run the full platform locally with all services:

# Clone the helm repo
git clone https://github.com/linuxfoundation/lfx-v2-helm
cd lfx-v2-helm

# Pull chart dependencies
helm dependency update charts/lfx-platform

# Create local values
cp charts/lfx-platform/values.local.example.yaml charts/lfx-platform/values.local.yaml
# Edit values.local.yaml, secrets are in 1Password

# Install
helm install -n lfx lfx-platform ./charts/lfx-platform \
  --values charts/lfx-platform/values.local.yaml

Troubleshooting Quick Reference

SymptomLikely CauseFix
corepack enable permission errorSystem Nodesudo corepack enable or use nvm
yarn install EACCESRoot-owned filesDon't use sudo. Reinstall Node via nvm
Port 4200 in useZombie processlsof -i :4200 then kill <PID>
Auth redirect loopWrong .env valuesRe-copy from 1Password
ERR_MODULE_NOT_FOUNDMissing depsrm -rf node_modules && yarn install
NATS connection refusedLocal stack not runningStart the Helm platform stack
make apigen failsMissing Goago install goa.design/goa/v3/cmd/goa@v3.22.6
Go build fails after Goa changesStale generated codemake apigen && go build ./...

Done

Once the app/service runs successfully:

═══════════════════════════════════════════
SETUP COMPLETE ✓
═══════════════════════════════════════════
Repo: [repo name]
Type: [Angular / Go microservice]
Running at: [URL]
═══════════════════════════════════════════

Suggest next steps:

  • Find the owning repo or peer repos: use /lfx-skills:lfx
  • Understand platform shape: use /lfx-skills:lfx-platform-architecture
  • Understand V2 service shape: use /lfx-skills:lfx-platform-architecture
  • Understand Go conventions: rely on the owning repo's path-scoped <short-repo-name>-dev skill
  • Build or modify a feature: use the owning repo's local skills and CLAUDE.md

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.