"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.generateDefaultContext = generateDefaultContext;
exports.createDefaultContextFile = createDefaultContextFile;
const fs_1 = __importDefault(require("fs"));
/**
* Generate a default development context template
* @returns Default development context
*/
function generateDefaultContext() {
return {
name: "Solo Developer Framework",
description: "A comprehensive framework for solo fullstack development that maximizes automation and maintains high quality standards.",
version: "1.0",
directives: [
"Follow component hierarchy building approach: Start with smallest atomic components and build up to larger structures.",
"Organize code in feature-based folder structure.",
"Generate code in order: data models → UI components → validation → services → assembly → tests.",
"Use project_memory.json at the root directory to track progress.",
"Follow consistent documentation practices with JSDoc comments.",
"Implement proper error handling for all operations.",
"Create reusable components with high cohesion and low coupling.",
"Follow simplified git branching strategy with feature branches from main."
],
workflows: [
{
id: "solo-dev-workflow",
name: "Solo Developer Workflow",
description: "Streamlined development process optimized for individual developers with maximum automation.",
steps: [
{
order: 1,
description: "Define project requirements and create project_memory.json",
expectedOutput: "Project requirements document and initial project_memory.json file"
},
{
order: 2,
description: "Set up project structure with feature-based organization",
expectedOutput: "Initial project folder structure and configuration files"
},
{
order: 3,
description: "Create data models and interfaces",
expectedOutput: "TypeScript interfaces and data model definitions"
},
{
order: 4,
description: "Build UI components hierarchically (smallest to largest)",
expectedOutput: "UI component hierarchy with tests"
},
{
order: 5,
description: "Implement validation logic and form handling",
expectedOutput: "Form validation functions and error handling"
},
{
order: 6,
description: "Develop service layer and API interactions",
expectedOutput: "Service classes with API integration"
},
{
order: 7,
description: "Assemble full feature components",
expectedOutput: "Complete feature implementation"
},
{
order: 8,
description: "Write comprehensive tests (unit and integration)",
expectedOutput: "Test suite with high coverage"
},
{
order: 9,
description: "Update documentation and project_memory.json",
expectedOutput: "Up-to-date documentation and progress tracking"
}
]
},
{
id: "ai-collaboration-framework",
name: "AI Collaboration Framework",
description: "Structured approach for effectively working with AI systems for development tasks.",
steps: [
{
order: 1,
description: "Goal Definition & Planning Phase",
expectedOutput: "Clear project objectives and plan"
},
{
order: 2,
description: "Effective Communication Phase",
expectedOutput: "Clear requests and iterative refinement"
},
{
order: 3,
description: "Critical Assessment Phase",
expectedOutput: "Evaluation of AI outputs and verification"
},
{
order: 4,
description: "Integration & Implementation Phase",
expectedOutput: "Practical implementation and documentation"
}
]
},
{
id: "short-prompt-development",
name: "Short Prompt Development",
description: "Pattern for generating complete implementations from brief instructions.",
steps: [
{
order: 1,
description: "Receive short feature request",
expectedOutput: "Brief feature description"
},
{
order: 2,
description: "Build components hierarchically",
expectedOutput: "Complete feature implementation"
},
{
order: 3,
description: "Document and test all components",
expectedOutput: "Tested and documented feature"
},
{
order: 4,
description: "Update project_memory.json",
expectedOutput: "Updated progress tracking"
}
]
}
],
templates: [
{
type: "file",
path: "project_memory.json",
content: JSON.stringify({
"version": "1.0",
"lastUpdated": new Date().toISOString(),
"projects": [
{
"id": "new-project",
"name": "New Project",
"description": "Project description",
"created": new Date().toISOString(),
"status": "planning",
"techStack": {
"frontend": [],
"backend": [],
"database": [],
"deployment": []
},
"components": [],
"completedTasks": [],
"decisions": [],
"currentStatus": "planning",
"nextSteps": []
}
],
"activeProject": "new-project",
"preferences": {
"componentHierarchy": true,
"testingStrategy": "component-first",
"documentationStyle": "inline-jsdoc",
"branchingStrategy": "simplified",
"folderStructure": "feature-based"
}
}, null, 2)
},
{
type: "structure",
path: "src",
children: [
{
type: "folder",
path: "features",
children: []
},
{
type: "folder",
path: "shared",
children: [
{
type: "folder",
path: "components",
children: []
},
{
type: "folder",
path: "hooks",
children: []
},
{
type: "folder",
path: "utils",
children: []
},
{
type: "file",
path: "types.ts",
content: "/**\n * Shared type definitions\n */\n\nexport {};\n"
}
]
}
]
}
]
};
}
/**
* Create a default context file at the specified path
* @param outputPath - Path to save the context file
*/
function createDefaultContextFile(outputPath) {
const context = generateDefaultContext();
try {
fs_1.default.writeFileSync(outputPath, JSON.stringify(context, null, 2));
console.log(`Default context file created at ${outputPath}`);
}
catch (error) {
console.error('Error creating default context file:', error instanceof Error ? error.message : String(error));
}
}
//# sourceMappingURL=defaultContext.js.map