Pioneering AI-First
Built from the ground up for AI code generation. Less tokens, more clarity, better results.
AgentScript is more than just another language—it’s a revolution, a promise, and a playground for both humans and AI. We believe that the future of code is collaborative, where AI can help generate, refactor, and maintain our programs without sacrificing readability or robust best practices. That’s why AgentScript blends functional programming, contract programming, and concurrency primitives into a sleek, AI-friendly syntax.
Modern development is dominated by AI-driven code creation. Tools like Cursor, WindSurf, Cline, and beyond can spin up features rapidly, but often result in scattered code with minimal testing and shaky maintainability.
AgentScript aims to be the ultimate “intermediate pseudo-code language” that bridges human input, AI generation, and TypeScript interoperability—ensuring you get the benefits of automation with the solid foundation of best practices.
Pioneering AI-First
Built from the ground up for AI code generation. Less tokens, more clarity, better results.
Robust Contracts
Out-of-the-box contract programming and state machines to stop bugs in their tracks before runtime.
Zero Overhead
Produces standard TypeScript. Deploy to Node.js, browsers, or serverless with no performance penalty.
Built for Tomorrow
Future-proof your code. Multiple concurrency constructs, inline tests, and clarity for AI-driven maintainability.
AgentScript began as a bold response to a common frustration: AI-generation can save time, but it often leads to fragile or verbose code. TypeScript is powerful, but remains verbose for quick iteration or AI usage. We wanted the absolute best of both worlds: a language that is so succinct and context-rich that AI can handle it with ease, yet so structurally sound that humans trust it in production.
function processPayment(amount: number, currency: string) goal: "Process a secure payment transaction" backstory: "Interacts with the payment gateway" requires: amount > 0: "Amount must be positive" currency in ["USD", "EUR", "BTC"]: "Supported currencies only" return: amount |> validateAmount |> convertCurrency |> processTransaction errors: InvalidAmount: "Amount must be positive" when amount <= 0 InvalidCurrency: "Unsupported currency" when currency not in ["USD", "EUR", "BTC"] tests: success: 100, "USD" -> { status: "completed", id: "tx_123" } performance: expect < 100ms
In under a dozen lines, you see constraints, error handling, performance tests, and even the function’s goal. AI can latch onto these structured blocks, while humans quickly grasp the function’s responsibilities, constraints, and test coverage.
A crisp superset of TypeScript that strips away boilerplate while adding metadata blocks for tests, concurrency, and error handling.
Each function starts with short metadata fields like goal
and backstory
for immediate clarity.
Common or custom errors are explicitly declared in each function, simplifying debugging and clarifying error pathways.
Embedding state machine logic ensures concurrency patterns are crystal clear and testable—straight out of the box.
Pipeline operators and advanced pattern matching reduce complexity and keep your transformations explicit and AI-friendly.
AgentScript enforces best practices at the language level.
amount > 0
), generating runtime checks in TypeScript.function fetchTodosByUser(userId: number) goal: "Load tasks for a given user" backstory: "Used by the main dashboard to show tasks" requires: userId >= 0: "User ID cannot be negative" return: fetchFromDatabase("todos", userId) errors: UserNotFound: "No user found with the given ID" tests: success: 1 -> [{ id: 1, task: "Buy milk" }, ...] performance: execution: expect < 3ms memory: expect < 5mb
By including these constraints and tests, AI (or you) can’t forget them during refactors or bug fixes.
|>
for chaining transformations in a more readable, more AI-parsable style.match (user.role) { case "admin" -> grantAccess(user) case "guest" -> promptSignup(user)}
Feature | TypeScript | Rust | AgentScript | Why AgentScript? |
---|---|---|---|---|
Concurrency | Library-based | Rayon | ✅ Built-in concurrency patterns | Everything is tested and reasoned about up front. |
State Machines | Library-based | Usually external | ✅ Native constructs | Make concurrency & transitions explicit, baked-in. |
Type Safety | Can be strict | Strong | ✅ High (built-in checks) | AI relies on safe defaults, humans trust it in prod. |
Error Management | Manual/Throws | Results | ✅ Contract blocks + tests | No error left behind—declare them from the start. |
AI-Friendliness | Medium | Medium | ✅ High | Minimal syntax, explicit metadata, fewer tokens. |
Testing | Optional, external | Inline (module tests) | ✅ Inline, enforced | Agents can’t skip coverage; tests are in the code. |
Contract Programming | Runtime/manual | Partial | ✅ Automatic requires checks | Instantly catches invalid inputs at runtime. |
Pipeline Operator | ❌ | ❌ | ✅ Pipeline operator ( | >) |
intent
, context
, and requires
.AgentScript is a bold statement on how AI-driven software can be stable, maintainable, and unstoppable. We see a future where:
TypeScript is among the most popular and flexible languages today. By targeting TypeScript, AgentScript code gains all the ecosystem benefits—Node.js, Cloudflare, React Native, serverless, and more—without extra overhead. You get:
AgentScript isn’t a side project; it’s a movement to reshape how humans and AI collaborate on code. Whether you’re a developer hungry for clarity or an AI agent eager for structure, we welcome you to explore, experiment, and build with us. The future of software starts with AgentScript—where unstoppable innovation meets bulletproof best practices.