This project is a deliberate experiment in writing a medium-sized software project entirely through AI prompts, without any direct human coding. Every line of code, test, configuration, and documentation has been generated by AI (GitHub Copilot) based on carefully crafted prompts and architectural instructions.
The goal is to explore:
- Feasibility: Can AI write production-quality code from high-level descriptions?
- Quality: Does AI-generated code meet professional standards for security, performance, and maintainability?
- Coverage: Can AI achieve 100% test coverage while maintaining code elegance?
- Iteration: How effectively can AI refactor, debug, and extend existing codebases?
"The best code is code that writes itself β guided by clear intent."
- Project Overview
- Philosophical Principles
- Repository Structure
- DASE β VS Code Extension
- TFX β Tootega Framework X
- Code Quality Standards
- Development Guide
- CI/CD Pipeline
DASE (Design-Aided Software Engineering) is a visual design environment for modeling and generating multi-layer, multi-platform, multi-database, and multi-paradigm web applications.
The project consists of two main components:
| Component | Description | Status |
|---|---|---|
| TFX/ | Core framework library providing the foundation for VS Code extensions | β Complete |
| DASE/ | VS Code extension implementing visual designers | π§ In Development |
- TypeScript 5.3+ with .NET-inspired conventions
- Node.js 20+ runtime
- Vitest for unit testing with coverage
- GitHub Actions for CI/CD automation
These principles are the foundation behind every directive in this document.
They exist to keep decisions consistent when trade-offs appear.
- The best code is code that writes itself β guided by clear intent.
- Any line of code that cannot be exercised by automated tests should not exist.
- Truth over optics: we refuse βmetric theaterβ (coverage inflation, artificial branches, cosmetic tests).
- Coverage is evidence, not a goal: the goal is confidence in behavior under realistic conditions.
- If a branch is truly unreachable, the correct action is removal or an explicit invariant β not a fabricated test.
- Unreachable code is a design smell: either the model is wrong, or the branch is dead, or the contract is unclear.
- Prefer deletion to decoration: removing dead paths is higher quality than βcoveringβ them.
- Tests must represent plausible worlds: a test that cannot occur in production is documentation of fiction.
- Every test must answer a question: βWhat failure would this catch, and why would it matter?β
- Assertions are contracts: validate invariants where they belong, and test through public behavior.
- Strong contracts reduce defensive noise: less βjust in caseβ, more βcannot happen by constructionβ.
- Write code that is easy to prove: clarity beats cleverness; determinism beats surprises.
- Prefer domain truth over framework convenience: the model dictates the code, not the other way around.
- Code is a liability: every added line MUST pay rent (clear value, verified behavior).
- Make state explicit; implicit state becomes hidden bugs.
- Optimize for the next reader: the future maintainer is usually you.
- Complexity must be earned by measurable benefit; simple mechanisms scale best.
- Fail fast, fail loud: reject invalid input early with precise, actionable errors.
- Measure before optimizing; optimize only what profiling proves is hot.
- Security is an invariant, not a feature.
- Integrity is non-negotiable: we do not trade truth for appearance, even when it looks βbetterβ on paper.
- A green pipeline is not a certificate: it is a signal that must remain honest to keep meaning.
- Just as 10 seconds of silence end a life of
$3 \times 10^9$ beats, sequential errors are software's demise: continuity is life, statistics are an illusion.
DASE50/
βββ .github/
β βββ copilot-instructions.md # AI coding standards
β βββ workflows/
β βββ ci.yml # CI/CD pipeline
βββ TFX/ # Core Framework
β βββ src/
β β βββ Core/ # Foundation classes
β β βββ Data/ # Serialization engine
β β βββ Design/ # Visual design elements
β β βββ Designers/ # Domain-specific designers
β βββ tests/ # Unit tests
βββ DASE/ # VS Code Extension
β βββ src/
β β βββ Commands/ # Extension commands
β β βββ Designers/ORM/ # ORM designer
β β βββ Models/ # Data models
β β βββ Services/ # Business services
β β βββ Views/ # Panel views
β βββ media/ # Webview assets
β βββ src/__tests__/ # Unit tests
βββ README.md # This file
DASE (Design-Aided Software Engineering) is a VS Code extension that provides visual designers for software modeling. The initial focus is an ORM Designer for database schema modeling.
DASE aims to be a comprehensive visual design environment supporting:
- π ORM Designer β Database schema modeling (current phase)
- π UI Designer β User interface layouts (planned)
- π Flow Designer β Business process workflows (planned)
- π‘ API Designer β REST/GraphQL endpoint modeling (planned)
| Feature | Description | Status |
|---|---|---|
| Custom Editor | Opens .dsorm files in visual designer |
β Implemented |
| Tables | Visual table representation with columns | β Implemented |
| Relations | Visual relationship lines between tables | β Implemented |
| Properties Panel | Edit selected element properties | β Implemented |
| Issues Panel | Validation errors and warnings | β Implemented |
| Context Menus | All actions via right-click menus | β Implemented |
| TFX Integration | Bridge to TFX framework for model management | β Implemented |
DASE/src/
βββ ExtensionMain.ts # Extension entry point
βββ Commands/
β βββ DeleteSelectedCommand.ts # Delete elements command
β βββ ReloadDataTypesCommand.ts # Reload data types command
β βββ RenameSelectedCommand.ts # Rename element command
βββ Designers/ORM/
β βββ ORMDesignerEditorProvider.ts # Custom editor provider
β βββ ORMDesignerMessages.ts # Message protocol types
β βββ ORMDesignerState.ts # In-memory state management
β βββ Commands/ # ORM-specific commands
βββ Models/
β βββ DesignerSelection.ts # Selection data structures
β βββ IssueItem.ts # Issue representation
β βββ PropertyItem.ts # Property representation
βββ Services/
β βββ IssueService.ts # Issue management
β βββ SelectionService.ts # Selection state
β βββ TFXBridge.ts # TFX framework integration
βββ Views/
βββ IssuesViewProvider.ts # Issues panel
βββ PropertiesViewProvider.ts # Properties panel
The designer uses a typed message protocol for webview communication:
| Message Type | Direction | Purpose |
|---|---|---|
DesignerReady |
Webview β Extension | Webview initialization complete |
LoadModel |
Extension β Webview | Send model data to render |
ModelLoaded |
Webview β Extension | Confirm model loaded |
SaveModel |
Webview β Extension | Request model persistence |
SelectElement |
Webview β Extension | User selected an element |
SelectionChanged |
Extension β Webview | Selection state updated |
UpdateProperty |
Extension β Webview | Property value changed |
PropertiesChanged |
Webview β Extension | Properties need refresh |
ValidateModel |
Either | Trigger validation |
IssuesChanged |
Extension β Webview | Validation results updated |
Designer Canvas:
Dase.AddTableβ Add a new table to the modelDase.AddRelationβ Add a relationship between tablesDase.DeleteSelectedβ Delete selected elementsDase.RenameSelectedβ Rename selected element
Explorer (.dsorm files):
Dase.OpenORMDesignerβ Open file in visual designerDase.ValidateORMModelβ Validate model and populate Issues
The ORM validator (using XValidator<XORMDocument, XORMDesign>) enforces:
- β Error: Table name cannot be empty
- β Error: Duplicate table names not allowed
- β Error: Relation references non-existent table
β οΈ Warning: Table has no columns defined
TFX is the core library that powers the DASE extension. It provides a robust, type-safe foundation for building VS Code extensions with complex visual designers.
TFX is organized into four main modules:
The foundation layer providing essential building blocks:
| Class | Purpose |
|---|---|
XElement |
Base class for all hierarchical elements with parent-child relationships |
XPersistableElement |
Extended element with serialization, selection, and change tracking |
XProperty |
Reactive property system with metadata, validation, and binding support |
XEvent |
Type-safe event dispatching system |
XDispatcher |
Action executor with queuing capabilities |
XChangeTracker |
Undo/redo tracking for element modifications |
XValidation |
Validation framework with error severity levels |
XGuid |
GUID generation and manipulation utilities |
XConvert |
Type conversion utilities |
Geometry Types:
XPoint,XSize,XRect,XThicknessβ Spatial primitivesXColor,XHSLColor,XBorderColorβ Color managementXFont,XFontStyleβ Typography support
Comprehensive XML serialization engine:
| Class | Purpose |
|---|---|
XSerializationEngine |
Central orchestrator for serialize/deserialize operations |
XSerializationContext |
Manages serialization state, references, and errors |
XElementRegistry |
Type registration for polymorphic serialization |
XmlWriter |
XML output generation with formatting options |
XmlReader |
XML parsing with namespace and attribute handling |
XTypeConverter |
Custom type conversion for serialization |
Visual design element primitives:
| Class | Purpose |
|---|---|
XDocument<T> |
Generic document container for designs |
XDesign |
Base class for design surfaces |
XDesignElement |
Base visual element with layout properties |
XRectangle |
Rectangle shape with borders and styling |
XLine |
Line element with cap and join styles |
XField |
Text field element |
Domain-specific designer implementations:
| Class | Purpose |
|---|---|
XORMDocument |
ORM model document container |
XORMDesign |
ORM design surface |
XORMTable |
Database table representation |
XORMField |
Table column/field definition |
XORMPKField |
Primary key field definition |
XORMReference |
Table relationship/foreign key |
XORMController |
ORM operations controller |
XORMValidator |
ORM model validation |
TFX uses a sophisticated property system inspired by WPF/XAML:
// Property registration with metadata
public static readonly NameProp = XProperty.Register<XORMTable, string>(
(p: XORMTable) => p.Name,
"guid-here",
"Name",
"Table Name",
""
);
// Property access via GetValue/SetValue
public get Name(): string {
return this.GetValue(XORMTable.NameProp) as string;
}
public set Name(pValue: string) {
this.SetValue(XORMTable.NameProp, pValue);
}All elements inherit from XElement, providing:
- Parent-child navigation (
ParentNode,ChildNodes) - Type-safe child queries (
GetChild<T>,GetChildDeep<T>) - Tree traversal (
GetTree()) - Identity management (
ID,Name)
Built-in undo/redo support through XChangeTracker:
- Automatic property change recording
- Transaction grouping
- State restoration
Declarative validation with XDataValidateError:
- Severity levels:
Warning,Error - Property-specific error binding
- Aggregated error collection via
XConcurrentBag
import { XORMDocument, XORMTable, XORMField } from "@tootega/tfx/Designers";
import { XSerializationEngine } from "@tootega/tfx/Data";
// Create a new ORM document
const doc = new XORMDocument();
const table = new XORMTable();
table.Name = "Customers";
doc.Design?.AppendChild(table);
// Serialize to XML
const engine = XSerializationEngine.Instance;
const result = engine.Serialize(doc);This project follows strict coding standards defined in .github/copilot-instructions.md.
- π Secure β Protection against common attacks
- β Correct β Bug-free, sound logic
- β‘ Performant β Minimal memory allocation (zero-allocation mindset)
- π Clear β Self-documenting code (no comments needed)
- π― Consistent β Uniform style across the codebase
- β¨ Elegant β Aesthetically pleasing, easy to navigate
- π§ Maintainable β Easy to modify and extend
- π§ͺ Testable β Designed for automated testing
| Element | Convention | Example |
|---|---|---|
| Classes/Types | PascalCase with X prefix |
XUserService, XORMTable |
| Interfaces | XI prefix + PascalCase |
XIRepository, XISerializable |
| Methods/Properties | PascalCase |
GetById, SaveChanges |
| Private Fields | _ prefix + PascalCase |
_Cache, _Repository |
| Parameters | p prefix + PascalCase |
pUserID, pOptions |
| Local Variables | Lowercase mnemonics | lstua, frsrt |
- β One type per file
- β No braces for single-line blocks
- β Early returns (guard clauses)
- β No comments (self-documenting code)
- β Avoid lambdas in hot paths
- β Prefer explicit loops over LINQ
- β
Use
sealedclasses when inheritance not needed
- Node.js 20+
- VS Code (latest)
- TypeScript 5.3+
# Navigate to TFX directory
cd TFX
# Install dependencies
npm install
# Build the framework
npm run build
# Run tests
npm run test
# Run tests with coverage
npm run test:coverage
# Watch mode for development
npm run test:watchTFX Scripts:
| Script | Description |
|---|---|
npm run build |
Compile TypeScript to JavaScript (dist/) |
npm run watch |
Watch mode compilation |
npm run test |
Run all unit tests with Vitest |
npm run test:coverage |
Generate coverage report (100% required) |
npm run test:watch |
Interactive watch mode for tests |
npm run clean |
Remove build artifacts (dist/) |
npm run lint |
Run ESLint checks |
# Navigate to DASE directory
cd DASE
# Install dependencies (includes local TFX)
npm install
# Build the extension
npm run compile
# Run tests
npm run test
# Run tests with coverage
npm run test:coverage
# Launch extension in VS Code
# Press F5 in VS Code, or:
code --extensionDevelopmentPath=./DASEDASE Scripts:
| Script | Description |
|---|---|
npm run compile |
Compile TypeScript to JavaScript (out/) |
npm run watch |
Watch mode compilation |
npm run test |
Run all unit tests with Jest |
npm run test:coverage |
Generate coverage report (100% required) |
npm run lint |
Run ESLint checks |
npm run package |
Create VSIX extension package |
# From repository root, build everything
cd TFX
npm ci
npm run build
cd ../DASE
npm ci
npm run compile
# Run all tests
cd ../TFX && npm run test:coverage
cd ../DASE && npm run test:coverageThe repository uses a single unified CI/CD workflow that builds and tests both components:
Workflow: .github/workflows/ci.yml
Triggers:
- Push to
masterbranch (TFX/** changes) - Pull requests to
masterbranch
Pipeline Stages:
- Checkout β Clone repository
- Setup Node.js 20 β Configure Node.js environment
- Install Dependencies β Run
npm ciin TFX/ - Build β Compile TypeScript (
npm run build) - Test β Execute test suite with Vitest
- Coverage β Generate and validate 100% coverage
- Upload Reports β Publish coverage artifacts
Quality Gates:
- β All automated tests must pass
- β 100% code coverage required
- β No TypeScript compilation errors
- β Zero-allocation patterns enforced
Workflow: .github/workflows/ci.yml
Triggers:
- Push to
masterbranch (DASE/** or TFX/** changes) - Pull requests to
masterbranch
Pipeline Stages:
- Checkout β Clone repository
- Setup Node.js 20 β Configure Node.js environment
- Build TFX β Build framework dependency
- Test TFX β Validate framework integrity
- Install DASE Dependencies β Run
npm ciin DASE/ - Build DASE β Compile extension (
npm run compile) - Lint β Run ESLint checks
- Test β Execute test suite with Jest
- Coverage β Generate and validate 100% coverage
- Upload Reports β Publish coverage artifacts
- Package (master only) β Create VSIX extension package
Quality Gates:
- β All automated tests must pass
- β 100% code coverage required
- β No TypeScript/ESLint violations
- β TFX dependency integrity validated
- β VSIX package builds successfully
Artifacts:
- Coverage reports (both TFX and DASE)
- VSIX extension package (master branch only)
MIT License β See LICENSE for details.
Built entirely through AI-driven development with GitHub Copilot
π€ No human wrote this code directly β only prompts π€