FrontAgent is an AI Agent system designed specifically for frontend engineering, addressing core challenges faced when deploying agents in real-world engineering scenarios:
Distilled Planner Model: FrontAgent's Planner stage has been distilled into a standalone small model frontagent-planner-7B-lora. Load the LoRA adapter on top of Qwen2.5-Coder-7B to generate frontend execution plans directly, without calling large LLM APIs. The training workflow, prompts, evaluation scripts, and Hugging Face release metadata live in models/frontagent-planner.
✅ Two-Stage Architecture - Separate planning and execution to avoid JSON parsing errors and enable dynamic code generation
✅ Phase-Based Execution - Steps grouped by phases with error recovery within each phase
✅ Planner Skills Layer - Reusable planning skills for task decomposition and phase injection
✅ Distilled Planner Assets - Repository-native training, evaluation, and release assets for the Planner LoRA model
✅ Skill Lab - Benchmark, improve, and promote content skills with local eval suites
✅ Repository Management Phase - Auto git/gh workflow after acceptance (commit, push, PR)
✅ Cross-Session Memory - Four-phase memory system (preload, runtime recall, post-task persistence, structured storage) that persists project facts, error resolutions, and dependency state across runs
Two Ways to Use FrontAgent
FrontAgent now supports both terminal-first and VS Code desktop workflows:
CLI: use fa init, fa run, RAG commands, Skill Lab, and automation-friendly workflows directly from your terminal.
VS Code Extension: use the FrontAgent sidebar task console to run tasks, attach the current file or selection, provide a browser URL, review phase/step progress, approve sensitive actions, initialize/validate SDD, and open run logs from inside VS Code.
Install the VS Code extension from the Marketplace by searching for FrontAgent or the extension id ceilf6.frontagent.
CLI Quick Start
# 1. Install globally via npm
npm install -g frontagent
# or using pnpm
pnpm add -g frontagent
# or using yarn
yarn global add frontagent
# 2. Configure LLM (supports OpenAI and Anthropic)# OpenAI configexport PROVIDER="openai"export BASE_URL="https://api.openai.com/v1"export MODEL="gpt-4"export API_KEY="sk-..."# Or Anthropic configexport PROVIDER="anthropic"export BASE_URL="https://api.anthropic.com"export MODEL="claude-sonnet-4-20250514"export API_KEY="sk-ant-..."# 3. Navigate to your project directory and initialize SDDcd your-project
fa init
# 4. Let AI help you complete tasks
fa run "Create a user login page"
fa run "Optimize homepage loading performance"
fa run "Add dark mode support"# Use LangGraph engine + checkpoint (optional)
fa run "Add route guards and open a PR" --engine langgraph --langgraph-checkpoint
MCP Server
FrontAgent can run as a local stdio MCP Server for MCP hosts such as Claude Desktop, Cursor, Codex, and other clients that can launch a command-based MCP server.
MCP mode exposes FrontAgent's upper-level agent capabilities only. It does not expose raw internal tools such as read_file, apply_patch, run_command, browser tools, or rag_query directly to the external host.
Start the Server
# Use the installed CLI
fa mcp serve
# Or run from a source checkout after pnpm build
node /absolute/path/to/FrontAgent-app/apps/cli/dist/index.js \
mcp serve
By default, FrontAgent resolves the project root from the MCP host's workspace roots when the host exposes exactly one file root. If host roots are unavailable, it falls back to the MCP server process current working directory.
Use --project-root only when you want to pin the server to a specific project, or when the host exposes multiple workspace roots and FrontAgent cannot choose safely:
fa mcp serve --project-root /absolute/path/to/your-project
One MCP server process is bound to one resolved project root.
Useful server options:
fa mcp serve \
--security-mode balanced \
--rag-repo https://github.com/ceilf6/Lab.git \
--rag-branch main
Host Configuration
Most MCP hosts use the same mcpServers shape. Start with the simple config:
Do not put fa mcp serve into the command field as one string.
If the host reports command "fa" not found or env: node: No such file or directory, the GUI host probably does not inherit your terminal shell PATH. Then use absolute paths:
Read-only tools such as frontagent_status, frontagent_list_skills, frontagent_validate_sdd, and frontagent_init_sdd do not require LLM configuration. frontagent_run_task and frontagent_plan_task require either host Sampling support or a valid direct LLM fallback.
Internal file writes, shell commands, browser actions, and other side effects still go through SecurityManager.
The default security mode is balanced.
Because stdio MCP does not provide FrontAgent's interactive approval UI, any action that requires an ask decision fails closed.
frontagent_init_sdd only writes SDD files inside the configured project root.
Remote RAG
FrontAgent now supports a full remote repository knowledge base flow for planning and code generation:
It syncs the remote repository into .frontagent/rag-cache/repo
It indexes the full repository by chunk, and automatically excludes Git submodule paths
It runs BM25 keyword retrieval and embedding-based semantic retrieval in parallel
It applies metadata filters to each candidate list, then fuses the ranked results
Built indexes and embedding vectors are cached under .frontagent/rag-cache
Default knowledge source:
Repository: https://github.com/ceilf6/Lab.git
Source mode: git by default; when FRONTAGENT_OPENVIKING_ENDPOINT is configured FrontAgent defaults to composite (OpenViking first, Git RAG fallback)
CLI options:
fa run "Explain React setState behavior" \
--provider openai \
--base-url https://yunwu.ai/v1 \
--api-key YOUR_TOKEN \
--rag-repo https://github.com/ceilf6/Lab.git \
--rag-branch main \
--rag-keyword-candidates 40 \
--rag-semantic-candidates 40 \
--rag-keyword-weight 0.45 \
--rag-semantic-weight 0.55
# When provider=openai, RAG embeddings inherit the same base-url/api-key by default.# Override them only if your embedding endpoint is different.
fa run "Explain React setState behavior" \
--provider openai \
--base-url https://yunwu.ai/v1 \
--api-key YOUR_TOKEN \
--rag-embedding-model text-embedding-3-small
# Use Weaviate as the semantic vector store (BM25 stays local)
fa run "Explain React setState behavior" \
--provider openai \
--base-url https://yunwu.ai/v1 \
--api-key YOUR_TOKEN \
--rag-embedding-model text-embedding-3-small \
--rag-vector-store-provider weaviate \
--rag-weaviate-url http://127.0.0.1:8080 \
--rag-weaviate-collection-prefix FrontAgentRagChunk
# Use OpenViking Wiki as the primary knowledge provider, with Git RAG fallback
fa run "Where is FrontAgent RAG implemented?" \
--rag-source composite \
--open-viking-endpoint https://openviking.example.com/query \
--open-viking-corpus wiki \
--open-viking-namespace docs/openviking \
--open-viking-l1-entry docs/openviking/frontagent-l1.md
# Require OpenViking only and disable Git fallback
fa run "Where is FrontAgent RAG implemented?" \
--rag-source openviking \
--open-viking-endpoint https://openviking.example.com/query \
--disable-open-viking-fallback
# Disable LLM query rewrite before retrieval
fa run "How to build a custom selector" \
--disable-rag-query-rewrite
# Cross-encoder reranking is enabled by default after BM25 + embedding candidate retrieval
fa run "Explain React setState behavior" \
--provider openai \
--base-url https://yunwu.ai/v1 \
--api-key YOUR_TOKEN \
--rag-embedding-model text-embedding-3-small \
--rag-reranker-model jina-reranker-v2-base-multilingual \
--rag-reranker-base-url https://your-reranker-endpoint/v1
# Disable reranking for a run
fa run "Explain React setState behavior" \
--disable-rag-reranker
# Disable semantic retrieval and use BM25 only
fa run "Explain React setState behavior" \
--disable-rag-semantic
# Disable remote RAG for a run
fa run "Create a page" --disable-rag
# Force a remote git sync before this query; by default FrontAgent reuses the local cache
fa run "Explain React setState behavior" --rag-sync-on-query
Skill Lab
FrontAgent now includes a local Skill Lab workflow for iterating on content skills under skills/.
# List visible content skills
fa skill list
# Scaffold a new content skill
fa skill scaffold pricing-audit
# Generate starter trigger evals for a skill
fa skill init-evals frontend-design
# Generate starter behavior evals (binary checks for output quality)
fa skill init-behavior-evals frontend-design
# Benchmark current trigger behavior
fa skill benchmark frontend-design
# Benchmark trigger + behavior together
fa skill benchmark frontend-design --behavior
# Generate a candidate revision and compare it against baseline
fa skill improve frontend-design
# Improve with both trigger and behavior eval suites
fa skill improve frontend-design --behavior
# Promote a candidate after review
fa skill promote frontend-design 20260331T120000Z
The current Skill Lab flow supports two eval tracks for content skills:
Trigger evals: whether the skill activates correctly.
Behavior evals: whether the final output quality passes binary checks.
You can run trigger-only (default) or trigger + behavior (--behavior) in benchmark/improve.
If provider=openai, and FRONTAGENT_RAG_EMBEDDING_BASE_URL / FRONTAGENT_RAG_EMBEDDING_API_KEY are not set, FrontAgent will reuse the LLM base-url and api-key automatically.
Main LLM sampling controls:
fa run "Explain React createElement" \
--temperature 0.2 \
--top-p 0.9
--temperature is supported.
--top-p is supported through the AI SDK call settings.
--top-k is exposed, but only some providers/models support it. For example, Anthropic models can use it, while OpenAI-compatible chat models may ignore it as unsupported.
repetition_penalty is not exposed yet in FrontAgent because the current AI SDK/provider stack does not provide a stable cross-provider path for it.
Before retrieval, FrontAgent now sends the user's original request through a separate LLM rewrite step to generate a more retrieval-friendly frontend search query. This rewrite uses the same provider/base-url/model/api-key as the main agent, but the rewritten query is only used for RAG and does not replace the user's original task.
After BM25 + embedding recall, FrontAgent will by default send the top candidate chunks to a reranker endpoint (/rerank, Jina/Cohere-compatible) for cross-encoder-style final ordering when reranker model/base-url/api-key are available. Use --disable-rag-reranker to turn it off for a run.
When FRONTAGENT_RAG_VECTOR_STORE_PROVIDER=weaviate, FrontAgent keeps BM25 in the local index.json, but semantic vectors are written to and queried from Weaviate instead of embeddings.json.
Filesense is used as a current-repository navigation provider. FrontAgent prefers filesense_navigate for structure/location/create/refactor preparation because it is budgeted and avoids full-repo persistent sync. filesense_sync_and_summarize remains available for explicit index maintenance, but is not the normal planning path.
Prebuilt cache bundle workflow:
Do not commit .frontagent/rag-cache into Git
Export a prebuilt cache bundle and upload it to GitHub Releases or object storage
Other users can import the bundle locally before their first query
# Export the current cache directory as a distributable tar.gz bundle
fa rag export# Export to a custom path
fa rag export --output ./artifacts/frontagent-rag-cache.tar.gz
# Import from a local file
fa rag import ./artifacts/frontagent-rag-cache.tar.gz --force
# Import from a remote URL
fa rag import https://example.com/frontagent-rag-cache.tar.gz --force
🔗 Module Tracking - Auto-parse import/export relationships for each created file
8. Cross-Session Memory System (NEW!)
FrontAgent now implements a four-phase memory architecture that persists knowledge across task runs, so the agent no longer starts from scratch every time.
Architecture
The memory system treats context as a time-phased pipeline:
Phase 1 -- Startup Preload: Load durable memories and seed ProjectFacts from the last snapshot before planning begins
Phase 2 -- Runtime Recall: Dynamically recall relevant memories during code generation based on file path, tags, and keywords
Phase 3 -- Post-Task Persistence: Extract and persist durable learnings (created files, error resolutions, dependency changes) after each task completes
Phase 4 -- Compaction: Deferred until multi-turn interactive mode is added
Storage Layout
<projectRoot>/.frontagent/memory/
MEMORY.md # Index entrypoint (concise topic list)
topics/
project-structure.md # Filesystem layout, key modules
dependencies.md # Packages, versions, known issues
errors.md # Past error resolutions
snapshots/
facts-latest.json # Last ProjectFacts snapshot
All memory files are human-readable Markdown (inspectable, editable). Facts snapshots use JSON for efficiency.
Prompt Separation
The system prompt is now structured into three independent zones, each with its own token budget:
Rules zone -- SDD constraints, behavioral instructions (immutable per task)
Memory zone -- Durable project knowledge loaded from .frontagent/memory/
Context zone -- Dynamic per-task data (files, RAG results, skills, facts)
Key Design Decisions
Single-writer pattern: All writes go through MemoryStore to prevent conflicts
Dedup tracking: Per-session injectedKeys set prevents re-injecting the same memory
Budget enforcement: Configurable character limits for preload (default 8000) and per-step recall (default 2000)
Non-blocking persistence: Memory writes run off the critical path with full error swallowing
Backward compatible: Fresh projects with no prior memory run identically to previous behavior
Configuration
const agent = createAgent({
// ...other configmemory: {
enabled: true, // default: truepreloadBudgetChars: 8000, // max chars injected at startuprecallBudgetChars: 2000, // max chars per code-gen recallmaxTopicFiles: 10, // max topic files loaded at startup
},
});
Implementation: packages/core/src/memory/
Core Modules
@frontagent/sdd - SDD Control Layer
Specification Driven Development (SDD) as hard constraints for agent behavior:
Cross-session memory system (NEW!) -- Four-phase durable memory with structured Markdown storage, runtime recall, and prompt zone separation
Distilled Planner Model -- SFT fine-tuned from FrontAgent Planner prompts, published as frontagent-planner-7B-lora, with training and release assets in models/frontagent-planner (Qwen2.5-Coder-7B + LoRA, 100% JSON validity, 100% complete plan rate)
FrontAgent CLI and VS Code extension for frontend AI engineering with SDD constraints, MCP-controlled execution, and RAG planning
The npm package frontagent receives a total of 20 weekly downloads. As such, frontagent popularity was classified as not popular.
We found that frontagent demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago.It has 1 open source maintainer collaborating on the project.
Package last updated on 09 Jun 2026
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.