ebade 0.4.0 β†’ 0.4.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,109 @@
1
+ # ebade Architecture πŸ—οΈ
2
+
3
+ > **The System of Intent.**
4
+
5
+ ebade is not just a framework; it's a **compilation pipeline** designed for an era where AI agents are the primary authors of software. This document explains the technical underpinnings of how ebade transforms abstract niyet (intent) into production-ready code.
6
+
7
+ ---
8
+
9
+ ## 🏁 The Core Pipeline
10
+
11
+ The ebade transformation follows a strictly deterministic flow:
12
+
13
+ ```mermaid
14
+ graph LR
15
+ A[Intent File .ebade.yaml] --> B[ebade CLI/MCP]
16
+ B --> C[Intent AST Parser]
17
+ C --> D[Target Adapter Next.js/etc]
18
+ D --> E[AI-Enhanced Scaffolder]
19
+ E --> F[Production Codebase]
20
+ ```
21
+
22
+ ### 1. Intent Definition (`.ebade.yaml`)
23
+
24
+ The source of truth. It defines **WHAT** the application should be, sans implementation details. It uses a high-density decorator syntax that is optimized for LLM token efficiency.
25
+
26
+ ### 2. AST Parsing
27
+
28
+ The ebade CLI parses the YAML/TypeScript intent into a **Standardized Intent Tree (SIT)**. This tree represents the semantic meaning of the application (pages, components, data flows, auth rules).
29
+
30
+ ### 3. Target Adapters
31
+
32
+ ebade is target-agnostic. While it currently ships with a high-end **Next.js + Tailwind + Shadcn** adapter, the architecture allows for:
33
+
34
+ - **Web:** Next.js, Nuxt, SvelteKit.
35
+ - **Mobile:** Flutter, SwiftUI, React Native.
36
+ - **Backend:** Fastify, Go/Gin, NestJS.
37
+
38
+ ### 4. Auto-Verification Protocol (The Guardrail)
39
+
40
+ Immediately after scaffolding, ebade runs a series of integrity checks:
41
+
42
+ - **Structural Integrity:** Ensures all core Next.js and Tailwind files are present.
43
+ - **Intent-Code Mapping:** Verifies that exported component names and routes match the original intent.
44
+ - **Test Coverage:** Confirms that matching unit tests (Vitest) have been generated for every new component.
45
+
46
+ ### 5. AI-Enhanced Scaffolding (The "Online Compiler")
47
+
48
+ This is where the magic happens. ebade uses AI not as a "free-text generator," but as a **Deterministic Compiler Component**.
49
+
50
+ - **Templates:** ebade provides a library of high-quality, pre-tested component templates.
51
+ - **Mapping:** The AI maps the specific fields and logic from the `@intent` into these templates.
52
+ - **Validation:** Every generated file is validated against the intent AST to ensure zero hallucinations.
53
+
54
+ ---
55
+
56
+ ## 🟒 Green AI: Token Density Architecture
57
+
58
+ Traditional AI coding (e.g., "Write me a dashboard") is **High Entropy**:
59
+
60
+ - User sends 50 tokens.
61
+ - AI returns 2,000 tokens of boilerplate.
62
+ - High cost, high noise, high probability of error.
63
+
64
+ ebade is **Low Entropy**:
65
+
66
+ - Intent is defined in ~50-100 tokens.
67
+ - ebade handles the structure, imports, and layout (0 tokens).
68
+ - AI only fills in the specific business logic snippets.
69
+ - **Result:** ~70% fewer tokens, 100% more reliable.
70
+
71
+ ---
72
+
73
+ ## πŸ› οΈ Internal Structure
74
+
75
+ ### Intent Model
76
+
77
+ The `Intent` model is the central class that holds the parsed state.
78
+
79
+ ```typescript
80
+ class IntentProject {
81
+ name: string;
82
+ type: ProjectType;
83
+ pages: PageIntent[];
84
+ components: ComponentIntent[];
85
+ data: DataIntent[];
86
+ auth: AuthConfig;
87
+ }
88
+ ```
89
+
90
+ ### The Scaffold Engine
91
+
92
+ The engine responsible for directory creation and file writing. It uses a "Clean Architecture" approach, ensuring that:
93
+
94
+ 1. Components stay in `@/components`.
95
+ 2. Logic stays in `@/lib`.
96
+ 3. UI stays in `@/app`.
97
+
98
+ ---
99
+
100
+ ## 🧬 Principles of ebade Engineering
101
+
102
+ 1. **Delete the How:** If a machine can infer the implementation, it shouldn't be in the source file.
103
+ 2. **Deterministic Outputs:** Same input must yield the same structure.
104
+ 3. **Agent-First DX:** The developer experience (DX) is optimized for the agent's context window.
105
+ 4. **Production-Ready by Default:** No "TODOs" in the output. Real types, real error handling, real responsive design.
106
+
107
+ ---
108
+
109
+ _ebade: Compiling Intent into Reality._ πŸŒ±πŸš€
package/CHANGELOG.md CHANGED
@@ -5,15 +5,26 @@ All notable changes to **ebade** will be documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
- ## [Unreleased]
8
+ ## [0.4.3] - 2025-01-10
9
+
10
+ ### Fixed
11
+ - Critical bug where templates were not found when running via `npx` (fix using `import.meta.url`).
12
+ - Added missing component templates for SaaS Dashboard and Landing Pages (`testimonials`, `faq-accordion`, `cta-banner`, `activity-chart`, `stats-grid`, `recent-events`).
13
+ - Updated `tsconfig.json` generation to use `jsx: preserve` and added path aliases (`@/*`).
14
+ - Added slugification for `package.json` names to ensure valid naming conventions.
15
+ - Synced framework versions across all packages.
16
+
17
+ ## [0.4.1] - 2025-01-10
9
18
 
10
19
  ### Added
11
20
 
21
+ - **Auto-Verification Layer** - CLI now performs structural, syntax, and semantic integrity checks after scaffolding.
12
22
  - **Playground UI** - Interactive "Battle Mode" simulation comparing Legacy AI vs ebade-powered Agent.
13
23
  - **Shadcn/UI Integration** - All component templates now use Shadcn design patterns.
14
24
  - **20+ Component Templates** - navbar, footer, pricing-table, login-form, signup-form, and more.
15
25
  - **File-based Template System** - Dynamic template loading from `cli/templates/`.
16
26
  - **Real-time Token Savings** - CLI now displays actual token savings during scaffold.
27
+ - **Agent-Native Stack Vision** - Identity (agents.md) + Capability (MCP) + Intent (ebade).
17
28
  - MCP Server branding update to **ebade**.
18
29
  - Green AI Metrics and Carbon Impact calculations.
19
30
  - Turkish identity integration (Badik mascot 🐣 and "The Essence of Code" vision).
@@ -26,7 +37,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
26
37
  ### Added
27
38
 
28
39
  - πŸŽ‰ Initial alpha release of **ebade**
29
- - MCP Server package (`@ebade/mcp-server`) with 4 tools:
40
+ - MCP Server package (`ebade-mcp-server`) with 4 tools:
30
41
  - `ebade_scaffold` - Create full projects from ebade definitions
31
42
  - `ebade_validate` - Validate ebade files against schema
32
43
  - `ebade_compile` - Compile single ebade to code
package/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # ebade
1
+ # ebade: The Agent-First Protocol 🧠🌱
2
2
 
3
3
  ![ebade - The First Agent-First Framework](https://ebade.dev/og-readme.png)
4
4
 
@@ -6,254 +6,116 @@
6
6
  [![Website](https://img.shields.io/badge/Website-ebade.dev-4F46E5)](https://ebade.dev)
7
7
  [![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT)
8
8
  [![MCP Server](https://img.shields.io/badge/MCP-Ready-green.svg)](./packages/mcp-server)
9
- [![Status](https://img.shields.io/badge/Status-Alpha-orange.svg)](./ROADMAP.md)
10
9
  [![Green AI](https://img.shields.io/badge/🌱_Green_AI-70%25_Less_Tokens-brightgreen)](./docs/GREEN-AI.md)
11
- [![Agent-Native](https://img.shields.io/badge/Agent--Native-Universal_AI_Support-black)](./SYNTAX.md)
12
- [![Sponsor](https://img.shields.io/badge/Sponsor-ebade-pink.svg?logo=github-sponsors)](https://github.com/sponsors/hasankemaldemirci)
10
+ [![Architecture](https://img.shields.io/badge/Architecture-First_Principles-black)](./ARCHITECTURE.md)
13
11
 
14
- > **The first framework designed for AI agents, readable by humans.**
15
- >
16
- > `Code = f(ebade)`
17
- >
18
- > _Capture the essence of code. Less tokens. Less carbon. Same result._ 🌱
12
+ > **"Code is a legacy byproduct. Intent is the source of truth."**
19
13
 
20
- ## 🎬 See it in action
14
+ **ebade** is not just another framework. It is a **compilation protocol** designed for an era where AI Agents are the primary developers. It shifts the paradigm from "Human-Centric Coding" to "Agentic Intent Modeling."
15
+
16
+ ---
17
+
18
+ ## 🎬 The Power of Intent
19
+
20
+ Watch how **ebade** transforms 20 lines of YAML into a production-ready, full-stack Next.js application.
21
21
 
22
22
  ![ebade demo](./assets/demo.gif)
23
23
 
24
- ```typescript
24
+ ### βš”οΈ The Battle of Entropy
25
25
 
26
- // ❌ Before: 100+ lines of boilerplate
27
- export default function CheckoutPage() {
28
- const [cart, setCart] = useState([]);
29
- const [loading, setLoading] = useState(false);
30
- const [error, setError] = useState(null);
31
- useEffect(() => { /* fetch data */ }, []);
32
- // ... 100 more lines of HOW
33
- }
26
+ | Legacy Coding (High Entropy) | ebade Protocol (Low Entropy) |
27
+ | :--- | :--- |
28
+ | **"Write me a dashboard..."** | **"@intent('saas-dashboard')"** |
29
+ | AI guesses folders, imports, and state. | ebade enforces architecture. |
30
+ | 1,500+ tokens burned (Noise). | **<250 tokens** used (Pure Signal). |
31
+ | Hallucinations likely. | **Deterministic** output. |
34
32
 
35
- // βœ… After: Pure intent - WHAT you want
36
- @page('/checkout')
37
- @intent('complete-purchase')
38
- @requires({ data: ['cart', 'user'], auth: 'required' })
39
- @outcomes({ success: '/order/[id]', error: 'show-inline' })
40
- export function Checkout({ cart, user }) {
41
- // Just business logic, zero boilerplate
42
- }
43
- ```
33
+ ---
34
+
35
+ ## πŸ› οΈ The Syntax (Cheat Sheet)
36
+
37
+ ebade uses a high-density decorator syntax designed to fit within an Agent's context window.
38
+
39
+ | Decorator | Purpose | Example |
40
+ | :--- | :--- | :--- |
41
+ | `@page` | Defines routes & paths | `@page('/dashboard')` |
42
+ | `@intent` | The "What" of the logic | `@intent('user-auth')` |
43
+ | `@requires` | Data & Auth dependencies | `@requires(['user', 'db'])` |
44
+ | `@compose` | Intent orchestration | `@compose(['header', 'list'])` |
45
+ | `@outcomes` | Result handlers & UI | `@outcomes({ success: '/dashboard' })` |
46
+ | `@expects` | **Tests as Specification** | `@expects([{ scenario: 'happy-path' }])` |
47
+
48
+ πŸ“– [Full Syntax Specification](./SYNTAX.md)
44
49
 
45
50
  ---
46
51
 
47
52
  ## πŸš€ Quick Start
48
53
 
49
- ### For AI Agents (MCP)
54
+ ### 1. For Agents (MCP)
50
55
 
51
- **ebade** is designed to be used BY AI agents. Add to your MCP configuration:
56
+ Add `ebade` to your AI agent (Claude, Cursor, Windsurf) via the Model Context Protocol:
52
57
 
53
58
  ```json
54
59
  {
55
60
  "mcpServers": {
56
61
  "ebade": {
57
- "command": "node",
58
- "args": ["./packages/mcp-server/dist/index.js"]
62
+ "command": "npx",
63
+ "args": ["-y", "ebade-mcp-server"]
59
64
  }
60
65
  }
61
66
  }
62
67
  ```
63
68
 
64
- Then AI agents can use:
65
-
66
- - `ebade_scaffold` - Create full projects from intent
67
- - `ebade_compile` - Compile single intents to code
68
- - `ebade_validate` - Validate intent files
69
- - `ebade_generate` - Generate from natural language
70
-
71
- ### For Humans (CLI)
69
+ ### 2. For Humans (CLI)
72
70
 
73
71
  ```bash
74
- # Scaffold a new project from an ebade file
72
+ # Scaffold a full project from an intent file
75
73
  npx ebade scaffold examples/saas-dashboard.ebade.yaml ./my-app
76
-
77
- # See all commands
78
- npx ebade --help
79
74
  ```
80
75
 
81
76
  ---
82
77
 
83
- ## πŸ€– Integrated AI Synergy
78
+ ## πŸ—οΈ Architecture: First Principles
84
79
 
85
- **ebade** projects automatically configure themselves for AI collaboration. When you scaffold a project, it generates specialized instruction files for major AI agents:
80
+ ebade operates on the principle of **The Online Compiler**. It treats AI as a deterministic component of the toolchain, not a creative oracle.
86
81
 
87
- - **Cursor**: `.cursorrules`
88
- - **Claude / Windsurf**: `.clauderules`
89
- - **GitHub Copilot**: `.github/copilot-instructions.md`
82
+ - **Standardized Intent Tree (SIT):** Parses YAML/TS into a logical graph.
83
+ - **Target Adapters:** Compiles intent into Next.js, Flutter, or Svelte (0-token boilerplate).
84
+ - **AgentRules:** Automatically generates `.cursorrules` and `.clauderules` to keep your agent aligned.
90
85
 
91
- These files teach the AI agents exactly how to work with ebade intents, ensuring they never "hallucinate" boilerplate and always stay token-efficient.
86
+ πŸ—οΈ [Explore the Architecture](./ARCHITECTURE.md)
92
87
 
93
88
  ---
94
89
 
95
- ## πŸ“Š Benchmark: ~70% Fewer Tokens (Tested)
90
+ ## πŸ“Š Benchmark: ~70% Fewer Tokens
96
91
 
97
- We measured token usage across common development tasks:
92
+ | Task | Legacy (Next.js) | ebade (Protocol) | Savings |
93
+ | :--- | :--- | :--- | :--- |
94
+ | **SaaS Dashboard** ⭐ | 1,850 tokens | **245 tokens** | **86.8%** |
95
+ | Checkout Flow | 258 tokens | **66 tokens** | **74.4%** |
96
+ | Product Grid | 133 tokens | **63 tokens** | **52.6%** |
98
97
 
99
- | Task | Next.js | ebade | Savings | Efficiency |
100
- | :---------------- | :----------- | :--------- | :-------- | :--------- |
101
- | Checkout Page | 258 tokens | 66 tokens | **74.4%** | 3.9x |
102
- | Product Listing | 133 tokens | 63 tokens | **52.6%** | 2.1x |
103
- | User Auth | 148 tokens | 56 tokens | **62.2%** | 2.6x |
104
- | SaaS Dashboard ⭐ | 1,850 tokens | 245 tokens | **86.8%** | 7.6x |
105
- | **Average** | | | **68.8%** | **4.1x** |
106
-
107
- > _For full project scaffolding, savings can reach 75-92%._
108
-
109
- ### πŸ’° Cost Impact
110
-
111
- At scale (1M AI coding sessions):
112
-
113
- | Framework | Token Cost | Savings |
114
- | :-------- | :--------- | :--------- |
115
- | Next.js | $5,390 | - |
116
- | **ebade** | **$1,850** | **$3,540** |
117
-
118
- > _The greenest code is the code you don't generate._
119
-
120
- πŸ“„ [Full Benchmark Results](./benchmarks/RESULTS.md) | 🌱 [Green AI Manifesto](./docs/GREEN-AI.md)
98
+ > "The greenest code is the code you don't generate." 🌱
121
99
 
122
100
  ---
123
101
 
124
- ## πŸ’‘ The Problem
125
-
126
- AI agents (Cursor, Copilot, Claude) write code for **human-designed frameworks**:
102
+ ## πŸ“¦ Project Structure
127
103
 
128
- ```text
129
- AI: "Is this a server or client component?"
130
-
131
- AI: "App router or pages router?"
132
- AI: "useState or useReducer?"
133
- AI: "Where does this file go?"
134
- ```
135
-
136
- Every decision is **ambiguous**. AI guesses. Sometimes wrong.
137
-
138
- ## ✨ The Solution
139
-
140
- **ebade** - A framework where AI expresses **intent**, not implementation.
141
-
142
- ```text
143
- Human describes β†’ AI writes intent β†’ ebade compiles β†’ Working code
144
- ↑
145
- No ambiguity here
146
- ```
104
+ - **`www/`**: The [ebade.dev](https://ebade.dev) landing page & playground.
105
+ - **`packages/mcp-server/`**: The bridge for AI agents.
106
+ - **`cli/`**: The core scaffolding engine.
107
+ - **`examples/`**: Real-world intent templates.
147
108
 
148
109
  ---
149
110
 
150
- ## πŸ“¦ Packages
111
+ ## 🀝 Join the Revolution
151
112
 
152
- | Package | Description | Status |
153
- | :----------------------------------------- | :----------------------- | :---------- |
154
- | **`ebade`** | Core Framework & CLI | βœ… Alpha |
155
- | [@ebade/mcp-server](./packages/mcp-server) | MCP Server for AI agents | βœ… Alpha |
156
- | `@ebade/compiler` | Advanced Intent Compiler | 🚧 Planning |
157
- | `@ebade/vscode` | VS Code extension | πŸ“‹ Planned |
113
+ 1. **Star the repo** to show your support ⭐
114
+ 2. **Become a Sponsor** to help us build a Green AI future πŸ’–
158
115
 
159
116
  ---
160
117
 
161
- ## 🎯 Core Concepts
162
-
163
- ### Intent-First
164
-
165
- ```typescript
166
- @intent('user-authentication')
167
- @inputs(['email', 'password'])
168
- @outcomes({ success: '/dashboard', failure: 'show-error' })
169
- ```
170
-
171
- You say **WHAT**, not **HOW**.
172
-
173
- ### Deterministic
174
-
175
- Same intent = Same output. Every time. No guessing.
176
-
177
- ### Composable
178
-
179
- ```typescript
180
- @compose(['header', 'sidebar', 'content', 'footer'])
181
- ```
182
-
183
- Small intents build big applications.
184
-
185
- ### Target-Agnostic
186
-
187
- ```typescript
188
- @compile('nextjs') // β†’ Next.js App Router
189
- @compile('vue') // β†’ Vue + Nuxt (coming)
190
- @compile('svelte') // β†’ SvelteKit (coming)
191
- ```
192
-
193
- One intent, many outputs.
194
-
195
- ---
196
-
197
- ## πŸ“‹ Example
198
-
199
- ```yaml
200
- # project.intent.yaml
201
-
202
- name: my-store
203
- type: e-commerce
204
- features:
205
- - product-catalog
206
- - shopping-cart
207
- - checkout
208
- - user-auth
209
-
210
- pages:
211
- - path: /
212
- intent: landing-page
213
- components:
214
- - hero-section
215
- - featured-products
216
- - testimonials
217
-
218
- - path: /products
219
- intent: product-listing
220
- components:
221
- - search-bar
222
- - product-grid
223
- - pagination
224
-
225
- - path: /checkout
226
-
227
- intent: checkout-flow
228
- auth: required
229
- components:
230
- - cart-summary
231
- - payment-form
232
- ```
233
-
234
- **Output:** Full Next.js project with 20+ files, ready to run.
235
-
236
- ---
237
-
238
- ## 🎭 The Paradigm Shift
239
-
240
- | Era | Paradigm | Core Question |
241
- | :------- | :-------- | :------------------------------- |
242
- | 2000s | jQuery | "How do I manipulate DOM?" |
243
- | 2013 | React | "What if UI = f(state)?" |
244
- | 2024 | AI Coding | "AI writes code, but for humans" |
245
- | **2026** | **ebade** | **"What if Code = f(intent)?"** |
246
-
247
- ---
248
-
249
- ## πŸ“š Documentation
250
-
251
- - πŸ“œ [Manifesto](./MANIFESTO.md) β€” Philosophy & Vision
252
- - πŸ“– [Syntax Spec](./SYNTAX.md) β€” Complete Decorator Reference
253
- - πŸ—ΊοΈ [Roadmap](./ROADMAP.md) β€” Development Plan
254
- - πŸ“ [Examples](./examples/) β€” Real-world Intent Files
255
- - πŸ“Š [Benchmarks](./benchmarks/) β€” Token & Cost Analysis
256
- - 🌱 [Green AI](./docs/GREEN-AI.md) β€” Environmental Impact
118
+ MIT Β© ebade Contributors β€” Made with ❀️ in TΓΌrkiye πŸ‡ΉπŸ‡·
257
119
 
258
120
  ---
259
121