Summary
Introduce .lightfast — a dedicated GitHub repo ({org}/.lightfast) that serves as the org-level "operating system configuration" for Lightfast. Users create any files/structure they want (markdown, yaml, directories), and AI agents explore it like a codebase via a sandboxed shell.
Motivation
Today there is zero org-level configuration for how Lightfast agents behave. The org name (from Clerk) is the only dynamic element injected into agent prompts. .lightfast would be the first org-level context mechanism — giving orgs a version-controlled, git-native way to define their identity, rules, terminology, and conventions for all AI agents operating on their behalf.
Design
| Aspect |
Decision |
| Form |
Dedicated GitHub repo: {org}/.lightfast |
| Content |
User-defined — any files/structure (starting with brand.md) |
| Cardinality |
One per org |
| Onboarding |
Lightfast scaffolds it via UI → GitHub App creates the repo |
| Sync |
Push webhooks → re-clone in Vercel Sandbox |
| MCP exposure |
lightfast_shell — sandboxed shell tool against cloned repo |
| Agents |
Both Lightfast platform agents AND user-facing AI tools (Claude Code, Cursor, Codex) |
Architecture
User's AI tool (Claude Code, Cursor, Codex)
→ MCP tool: lightfast_shell({ command: "grep -r 'tone' ." })
→ Lightfast API (POST /v1/shell)
→ Vercel Sandbox (pre-cloned .lightfast repo for this org)
→ Execute read-only command in sandbox
→ Return stdout/stderr to agent
Push webhook (on .lightfast repo changes):
→ Lightfast webhook pipeline
→ Re-clone / git pull in sandbox environment
Why Shell Over Structured Endpoints
LLMs already know grep, cat, find, ls, head, tail — no new tool semantics to learn. Users can put any structure in .lightfast without Lightfast needing schema knowledge. One MCP tool covers all use cases.
Example Agent Interactions
# Discover repo contents
lightfast_shell({ command: "find . -name '*.md' -type f" })
# Read a file
lightfast_shell({ command: "cat brand.md" })
# Search across all files
lightfast_shell({ command: "grep -rn 'tone' ." })
# Explore directories
lightfast_shell({ command: "ls -la engineering/" })
Existing Infrastructure (Ready to Build On)
- GitHub App (
lightfastai-dev) — already has get-file-contents + list-installation-repos in API catalog
- Webhook pipeline — mature
POST /api/ingest/github → Inngest pipeline (needs push event handler)
- MCP server (
@lightfastai/mcp) — registerContractTools auto-creates MCP tools from API contract. Adding shell to apiContract automatically registers lightfast_shell — zero MCP code changes
- Prompt engine — section-based architecture in
packages/prompt-engine/ for Lightfast's own agents
Implementation Areas
- API contract + handler: Add
POST /v1/shell to apiContract with ShellRequestSchema / ShellResponseSchema
- Vercel Sandbox integration: Clone
.lightfast repo, execute read-only shell commands, return output
- Webhook handler: Add
push event support for .lightfast repos → trigger re-clone/sync
- Scaffolding UI: "Create .lightfast" button → GitHub App creates repo with starter template
- GitHub App permissions: May need
administration:write scope for repo creation
- Prompt engine section: New section provider for Lightfast's Answer agent to load
.lightfast context
- Security boundary: Command allowlist, output size limits, org-scoped isolation
Open Questions
Summary
Introduce
.lightfast— a dedicated GitHub repo ({org}/.lightfast) that serves as the org-level "operating system configuration" for Lightfast. Users create any files/structure they want (markdown, yaml, directories), and AI agents explore it like a codebase via a sandboxed shell.Motivation
Today there is zero org-level configuration for how Lightfast agents behave. The org name (from Clerk) is the only dynamic element injected into agent prompts.
.lightfastwould be the first org-level context mechanism — giving orgs a version-controlled, git-native way to define their identity, rules, terminology, and conventions for all AI agents operating on their behalf.Design
{org}/.lightfastbrand.md)lightfast_shell— sandboxed shell tool against cloned repoArchitecture
Why Shell Over Structured Endpoints
LLMs already know
grep,cat,find,ls,head,tail— no new tool semantics to learn. Users can put any structure in.lightfastwithout Lightfast needing schema knowledge. One MCP tool covers all use cases.Example Agent Interactions
Existing Infrastructure (Ready to Build On)
lightfastai-dev) — already hasget-file-contents+list-installation-reposin API catalogPOST /api/ingest/github→ Inngest pipeline (needspushevent handler)@lightfastai/mcp) —registerContractToolsauto-creates MCP tools from API contract. AddingshelltoapiContractautomatically registerslightfast_shell— zero MCP code changespackages/prompt-engine/for Lightfast's own agentsImplementation Areas
POST /v1/shelltoapiContractwithShellRequestSchema/ShellResponseSchema.lightfastrepo, execute read-only shell commands, return outputpushevent support for.lightfastrepos → trigger re-clone/syncadministration:writescope for repo creation.lightfastcontextOpen Questions
.lightfaststarter template?lightfast_shell, or load key files directly into system prompt?