ebade 0.2.0 → 0.2.2
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.
- package/README.md +5 -0
- package/cli/scaffold.js +97 -15
- package/demo.gif +0 -0
- package/demo.mp4 +0 -0
- package/demo.tape +63 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -16,7 +16,12 @@
|
|
|
16
16
|
>
|
|
17
17
|
> *Capture the essence of code. Less tokens. Less carbon. Same result.* 🌱
|
|
18
18
|
|
|
19
|
+
## 🎬 See it in action
|
|
20
|
+
|
|
21
|
+

|
|
22
|
+
|
|
19
23
|
```typescript
|
|
24
|
+
|
|
20
25
|
// ❌ Before: 100+ lines of boilerplate
|
|
21
26
|
export default function CheckoutPage() {
|
|
22
27
|
const [cart, setCart] = useState([]);
|
package/cli/scaffold.js
CHANGED
|
@@ -472,6 +472,38 @@ body {
|
|
|
472
472
|
`;
|
|
473
473
|
}
|
|
474
474
|
|
|
475
|
+
function generateAgentRules(config) {
|
|
476
|
+
return `
|
|
477
|
+
# ebade Agent-First Framework Rules
|
|
478
|
+
|
|
479
|
+
You are an AI developer working on a project built with the **ebade Agent-First Framework**.
|
|
480
|
+
This project is designed specifically for AI-Human collaboration.
|
|
481
|
+
|
|
482
|
+
## 🧠 Core Philosophy
|
|
483
|
+
- **Intent > Implementation**: Focus on WHAT the code should do.
|
|
484
|
+
- **Source of Truth**: The structure is defined in \`project.ebade.yaml\`. Always refer to it before making structural changes.
|
|
485
|
+
- **Consistency**: All generated code should match the intents defined in \`app/\`, \`components/\`, and \`api/\`.
|
|
486
|
+
|
|
487
|
+
## 🛠 Framework Patterns
|
|
488
|
+
|
|
489
|
+
### 1. Decorators (Comments)
|
|
490
|
+
All files generated by ebade contain semantic decorators in their headers. Keep them intact:
|
|
491
|
+
- @page('/path'): Marks a Next.js Page.
|
|
492
|
+
- @intent('name'): Describes the purpose of the file.
|
|
493
|
+
- @requires(['components']): Lists dependencies.
|
|
494
|
+
|
|
495
|
+
### 2. Design System
|
|
496
|
+
- Use CSS Variables defined in \`app/globals.css\`.
|
|
497
|
+
- Prefer these tokens: var(--color-primary), var(--color-secondary), var(--radius-default).
|
|
498
|
+
|
|
499
|
+
## 🤝 AI Collaboration Guidelines
|
|
500
|
+
1. **When adding a new page**: First, suggest updating \`project.ebade.yaml\` if possible.
|
|
501
|
+
2. **When modifying components**: Ensure they remain decoupled and respect the design system props.
|
|
502
|
+
|
|
503
|
+
Built with ebade - The Agent-First Framework for the next era of development. 🌱
|
|
504
|
+
`;
|
|
505
|
+
}
|
|
506
|
+
|
|
475
507
|
// ============================================
|
|
476
508
|
// Utility Functions
|
|
477
509
|
// ============================================
|
|
@@ -665,6 +697,25 @@ function scaffold(ebadePath, outputDir) {
|
|
|
665
697
|
);
|
|
666
698
|
log.file("next-env.d.ts");
|
|
667
699
|
|
|
700
|
+
// Agent Rules
|
|
701
|
+
const agentRules = generateAgentRules(config).trim();
|
|
702
|
+
|
|
703
|
+
// .cursorrules (Cursor)
|
|
704
|
+
fs.writeFileSync(path.join(projectDir, ".cursorrules"), agentRules);
|
|
705
|
+
log.file(".cursorrules");
|
|
706
|
+
|
|
707
|
+
// .clauderules (Claude/Windsurf)
|
|
708
|
+
fs.writeFileSync(path.join(projectDir, ".clauderules"), agentRules);
|
|
709
|
+
log.file(".clauderules");
|
|
710
|
+
|
|
711
|
+
// GitHub Copilot instructions
|
|
712
|
+
ensureDir(path.join(projectDir, ".github"));
|
|
713
|
+
fs.writeFileSync(
|
|
714
|
+
path.join(projectDir, ".github/copilot-instructions.md"),
|
|
715
|
+
agentRules
|
|
716
|
+
);
|
|
717
|
+
log.file(".github/copilot-instructions.md");
|
|
718
|
+
|
|
668
719
|
// ========== Generate Database Schema ==========
|
|
669
720
|
if (config.data) {
|
|
670
721
|
log.section("Generating database schema");
|
|
@@ -730,32 +781,63 @@ ${colors.yellow}💡 Tip:${colors.reset} AI Agents can read ${
|
|
|
730
781
|
// CLI Entry Point
|
|
731
782
|
// ============================================
|
|
732
783
|
const args = process.argv.slice(2);
|
|
784
|
+
const command = args[0];
|
|
733
785
|
|
|
734
|
-
|
|
786
|
+
function showHelp() {
|
|
735
787
|
console.log(`
|
|
736
|
-
${colors.bright}ebade
|
|
788
|
+
${colors.bright}ebade CLI${colors.reset} - The Agent-First Framework
|
|
737
789
|
|
|
738
|
-
Usage
|
|
739
|
-
npx ebade
|
|
790
|
+
${colors.dim}Usage:${colors.reset}
|
|
791
|
+
npx ebade <command> [options]
|
|
740
792
|
|
|
741
|
-
|
|
793
|
+
${colors.dim}Commands:${colors.reset}
|
|
794
|
+
scaffold <file> [output] Scaffold a project from ebade file
|
|
795
|
+
|
|
796
|
+
${colors.dim}Examples:${colors.reset}
|
|
742
797
|
npx ebade scaffold examples/ecommerce.ebade.yaml ./output
|
|
798
|
+
npx ebade scaffold my-project.ebade.yaml
|
|
743
799
|
|
|
744
|
-
|
|
745
|
-
ebade
|
|
746
|
-
output-dir Output directory (default: ./output)
|
|
800
|
+
${colors.dim}Learn more:${colors.reset}
|
|
801
|
+
https://ebade.dev
|
|
747
802
|
`);
|
|
748
|
-
process.exit(1);
|
|
749
803
|
}
|
|
750
804
|
|
|
751
|
-
|
|
752
|
-
|
|
805
|
+
if (
|
|
806
|
+
args.length === 0 ||
|
|
807
|
+
command === "help" ||
|
|
808
|
+
command === "--help" ||
|
|
809
|
+
command === "-h"
|
|
810
|
+
) {
|
|
811
|
+
showHelp();
|
|
812
|
+
process.exit(0);
|
|
813
|
+
}
|
|
814
|
+
|
|
815
|
+
if (command === "scaffold") {
|
|
816
|
+
const ebadeFile = args[1];
|
|
817
|
+
const outputDir = args[2] || "./output";
|
|
818
|
+
|
|
819
|
+
if (!ebadeFile) {
|
|
820
|
+
console.error(
|
|
821
|
+
`${colors.red}Error:${colors.reset} Please provide an ebade file path.`
|
|
822
|
+
);
|
|
823
|
+
console.log(
|
|
824
|
+
`\n${colors.dim}Usage:${colors.reset} npx ebade scaffold <file.ebade.yaml> [output-dir]\n`
|
|
825
|
+
);
|
|
826
|
+
process.exit(1);
|
|
827
|
+
}
|
|
753
828
|
|
|
754
|
-
if (!fs.existsSync(ebadeFile)) {
|
|
829
|
+
if (!fs.existsSync(ebadeFile)) {
|
|
830
|
+
console.error(
|
|
831
|
+
`${colors.red}Error:${colors.reset} ebade file not found: ${ebadeFile}`
|
|
832
|
+
);
|
|
833
|
+
process.exit(1);
|
|
834
|
+
}
|
|
835
|
+
|
|
836
|
+
scaffold(ebadeFile, outputDir);
|
|
837
|
+
} else {
|
|
755
838
|
console.error(
|
|
756
|
-
`${colors.red}Error:${colors.reset}
|
|
839
|
+
`${colors.red}Error:${colors.reset} Unknown command: ${command}`
|
|
757
840
|
);
|
|
841
|
+
showHelp();
|
|
758
842
|
process.exit(1);
|
|
759
843
|
}
|
|
760
|
-
|
|
761
|
-
scaffold(ebadeFile, outputDir);
|
package/demo.gif
CHANGED
|
Binary file
|
package/demo.mp4
ADDED
|
Binary file
|
package/demo.tape
ADDED
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
# ebade Demo Video Script
|
|
2
|
+
# Run with: vhs demo.tape
|
|
3
|
+
# Outputs: demo.gif + demo.mp4
|
|
4
|
+
|
|
5
|
+
# Outputs - both formats
|
|
6
|
+
Output demo.gif
|
|
7
|
+
Output demo.mp4
|
|
8
|
+
|
|
9
|
+
# Configuration
|
|
10
|
+
Set FontSize 20
|
|
11
|
+
Set Width 1200
|
|
12
|
+
Set Height 700
|
|
13
|
+
Set Theme "Catppuccin Mocha"
|
|
14
|
+
Set Padding 30
|
|
15
|
+
Set TypingSpeed 50ms
|
|
16
|
+
Set PlaybackSpeed 1.0
|
|
17
|
+
|
|
18
|
+
# Clear and prepare
|
|
19
|
+
Hide
|
|
20
|
+
Type "clear"
|
|
21
|
+
Enter
|
|
22
|
+
Sleep 500ms
|
|
23
|
+
Show
|
|
24
|
+
|
|
25
|
+
# Intro
|
|
26
|
+
Type "# 🧠 ebade - The Agent-First Framework"
|
|
27
|
+
Enter
|
|
28
|
+
Sleep 1.2s
|
|
29
|
+
|
|
30
|
+
Type "# Scaffold a full SaaS Dashboard in seconds..."
|
|
31
|
+
Enter
|
|
32
|
+
Sleep 1.5s
|
|
33
|
+
|
|
34
|
+
# The magic command with npx
|
|
35
|
+
Type "npx ebade scaffold examples/saas-dashboard.ebade.yaml ./output/demo"
|
|
36
|
+
Sleep 500ms
|
|
37
|
+
Enter
|
|
38
|
+
|
|
39
|
+
# Wait for CLI output (ASCII logo + spinners + summary)
|
|
40
|
+
Sleep 10s
|
|
41
|
+
|
|
42
|
+
# Show generated file
|
|
43
|
+
Type ""
|
|
44
|
+
Enter
|
|
45
|
+
Sleep 500ms
|
|
46
|
+
|
|
47
|
+
Type "head -12 output/demo/AnalyticsHQ/app/page.tsx"
|
|
48
|
+
Enter
|
|
49
|
+
Sleep 4s
|
|
50
|
+
|
|
51
|
+
# Final tagline
|
|
52
|
+
Type ""
|
|
53
|
+
Enter
|
|
54
|
+
Type "# ✅ 51 files. ~70% fewer tokens. In 0.1s."
|
|
55
|
+
Enter
|
|
56
|
+
Sleep 500ms
|
|
57
|
+
Type "# 🌱 Green AI. Kind to Earth."
|
|
58
|
+
Enter
|
|
59
|
+
Sleep 500ms
|
|
60
|
+
Type "# → ebade.dev"
|
|
61
|
+
Enter
|
|
62
|
+
|
|
63
|
+
Sleep 3s
|