ebade 0.2.1 → 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 +51 -0
- package/demo.gif +0 -0
- package/demo.mp4 +0 -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");
|
package/demo.gif
CHANGED
|
Binary file
|
package/demo.mp4
CHANGED
|
Binary file
|