Loading...
Loading...
PERSONAL APP ARCHITECT - Strategic development orchestrator for personal productivity applications. Analyzes project context, makes architectural decisions for single-developer projects, delegates to specialized skills, and ensures alignment between user experience goals and technical implementation. Optimized for personal apps targeting 10-100 users.
npx skill4agent add ananddtyagi/cc-marketplace chief-architectasync analyzePersonalAppContext(): Promise<PersonalAppContext> {
// 1. Extract current state
const codeAnalysis = await this.delegateToSkill('comprehensive-system-analyzer', {
paths: ['src/', 'tests/'],
metrics: ['user-experience', 'maintainability', 'performance', 'mobile-readiness']
});
const architectureState = await this.analyzePersonalAppArchitecture({
analyzeDependencies: true,
extractPersonalAppPatterns: true,
identifyUserExperienceIssues: true
});
// 2. Identify user experience gaps
const uxGaps = this.identifyUserExperienceGaps(codeAnalysis, architectureState);
// 3. Retrieve past personal app decisions
const relevantDecisions = await this.queryPersonalAppKnowledgeBase({
context: uxGaps,
similarPersonalApps: true
});
// 4. Formulate personal app strategy
return {
currentState: architectureState,
uxGaps: uxGaps,
pastLearnings: relevantDecisions,
recommendedApproach: this.formulatePersonalAppStrategy(uxGaps, relevantDecisions)
};
}async makePersonalAppDecision(
concern: PersonalAppConcern,
context: PersonalAppContext
): Promise<PersonalAppDecision> {
// 1. Analyze options for personal app impact
const options = await this.researchPersonalAppSolutions({
concern,
constraints: context.constraints,
qualityAttributes: ['user-experience', 'development-speed', 'maintainability', 'mobile-compatibility']
});
// 2. Evaluate personal app trade-offs
const evaluation = await this.evaluatePersonalAppTradeoffs({
options,
qualityAttributes: ['user-experience', 'development-speed', 'maintainability', 'mobile-readiness'],
context
});
// 3. Select optimal solution for personal app
const decision = this.selectPersonalAppSolution(evaluation, context.userExperiencePriorities);
// 4. Document decision for personal development
await this.createPersonalAppDecisionRecord({
decision,
alternatives: options,
rationale: evaluation,
userExperienceImpact: decision.uxImpact
});
// 5. Add to personal development knowledge base
await this.updatePersonalAppKnowledgeBase(decision);
return decision;
}async orchestratePersonalImplementation(
decision: PersonalAppDecision,
context: PersonalAppContext
): Promise<PersonalImplementationResult> {
// 1. Decompose into personal development tasks
const tasks = this.decomposePersonalAppDecision(decision);
// 2. Build task dependency graph
const taskGraph = this.buildPersonalTaskGraph(tasks, context);
// 3. Execute with user experience validation
for (const taskBatch of taskGraph.executionBatches) {
const results = await Promise.allSettled(
taskBatch.map(task => this.delegateToPersonalAppSkill(task, context))
);
// 4. Handle failures with practical recovery
const failures = results.filter(r => r.status === 'rejected');
if (failures.length > 0) {
const recovered = await this.recoverFromPersonalAppFailures(failures, context);
if (!recovered) {
await this.createPersonalAppCheckpoint(context);
throw new PersonalAppImplementationFailure(failures);
}
}
// 5. Validate user experience impact
await this.validateUserExperienceImpact(taskBatch, context);
}
return {
success: true,
tasksCompleted: tasks.length,
userExperienceImprovements: this.measureUserExperienceImpact(context),
personalDevelopmentNotes: this.collectDevelopmentNotes(context)
};
}// File watching for automatic ideas processing
interface IdeasFileWatcher {
watcher: fs.FSWatcher | null;
processTimeout: NodeJS.Timeout | null;
isProcessing: boolean;
lastProcessed: Date | null;
}
const ideasFileWatcher: IdeasFileWatcher = {
watcher: null,
processTimeout: null,
isProcessing: false,
lastProcessed: null
};
/**
* Start watching ideas-issues.md for changes
* Automatically processes new ideas and issues
*/
function watchIdeasFile(): void {
if (ideasFileWatcher.watcher) {
console.log('📝 Ideas file watcher already active');
return;
}
const ideasFilePath = 'docs/planning/overview/ideas-issues.md';
try {
ideasFileWatcher.watcher = fs.watch(
ideasFilePath,
{ persistent: false },
(eventType: string) => {
if (eventType === 'change' && !ideasFileWatcher.isProcessing) {
console.log('📝 Ideas file changed, debouncing...');
// Debounce to avoid processing mid-edit
if (ideasFileWatcher.processTimeout) {
clearTimeout(ideasFileWatcher.processTimeout);
}
ideasFileWatcher.processTimeout = setTimeout(() => {
autoProcessIdeas();
}, 2000); // 2 second debounce
}
}
);
console.log('✅ Ideas file watcher started');
} catch (error) {
console.error('❌ Failed to start ideas file watcher:', error);
}
}
/**
* Automatically process new ideas and issues
* Uses existing enhance/promote workflow
*/
async function autoProcessIdeas(): Promise<void> {
if (ideasFileWatcher.isProcessing) {
console.log('📝 Ideas processing already in progress, skipping...');
return;
}
ideasFileWatcher.isProcessing = true;
try {
// 1. Create backup before processing
await createBackupBeforeProcessing();
// 2. Detect new items in "💭 Raw Ideas" section
const newItems = await detectNewIdeas();
if (newItems.length === 0) {
console.log('📝 No new ideas to process');
return;
}
console.log(`📝 Processing ${newItems.length} new ideas...`);
// 3. Process each item using existing workflow
for (const item of newItems) {
console.log(`📝 Processing: ${item.title}`);
// Use existing enhancement logic
const enhanced = await enhanceIdea(item);
// Validate confidence score
const confidence = calculateConfidenceScore(enhanced);
if (confidence < 80) {
console.log(`⚠️ Low confidence (${confidence}%) for "${item.title}" - marking for review`);
enhanced.requiresReview = true;
}
// Use existing promotion logic
await promoteToMasterPlan(enhanced);
// Archive to weekly folder
await archiveToWeeklyFolder(item.id);
console.log(`✅ Processed: ${item.title} (confidence: ${confidence}%)`);
}
ideasFileWatcher.lastProcessed = new Date();
console.log(`✅ Successfully processed ${newItems.length} ideas`);
} catch (error) {
console.error('❌ Auto-processing failed:', error);
// Attempt rollback if processing failed
await rollbackFromBackup();
} finally {
ideasFileWatcher.isProcessing = false;
}
}
/**
* Detect new ideas from ideas-issues.md
* Returns items without "Processed: YYYY-MM-DD" marker
*/
async function detectNewIdeas(): Promise<RawIdea[]> {
const ideasFilePath = 'docs/planning/overview/ideas-issues.md';
try {
const content = await fs.readFile(ideasFilePath, 'utf-8');
// Extract "💭 Raw Ideas" section
const rawIdeasSection = content.match(/## 💭 Raw Ideas.*?## /ms);
if (!rawIdeasSection) {
return [];
}
const items: RawIdea[] = [];
const ideaMatches = rawIdeasSection[0].match(/### (IDEA-\d+|ISSUE-\d+) \| (.+?)\n\*\*Captured\*\*: (.+?)\n\*\*Priority\*\*: (.+?)\n\*\*Tags\*\*: (.+?)\n\n(.+?)(?=\n---|\n##)/gs);
for (const match of ideaMatches) {
const [, id, title, captured, priority, tags, description] = match;
// Skip if already processed
if (content.includes(`${id} - **Processed:`)) {
continue;
}
items.push({
id: id.trim(),
title: title.trim(),
captured: new Date(captured.trim()),
priority: parsePriority(priority.trim()),
tags: tags.trim().split(' ').map(t => t.replace('#', '')),
description: description.trim(),
itemType: id.startsWith('IDEA-') ? 'idea' : 'issue'
});
}
return items;
} catch (error) {
console.error('Error detecting new ideas:', error);
return [];
}
}
/**
* Calculate confidence score for idea classification
*/
function calculateConfidenceScore(enhanced: EnhancedIdea): number {
let score = 50; // Base score
// Add points for clear categorization
if (enhanced.itemType === 'issue' && enhanced.priority === 'high') score += 30;
if (enhanced.itemType === 'idea' && enhanced.tags.includes('feature')) score += 25;
// Add points for technical specificity
if (enhanced.technicalSpecs?.implementationApproach) score += 15;
if (enhanced.effortEstimate?.complexity) score += 10;
// Add points for clear requirements
if (enhanced.description.length > 50) score += 10;
if (enhanced.tags.length >= 2) score += 5;
return Math.min(100, score);
}
/**
* Archive processed item to weekly folder
*/
async function archiveToWeeklyFolder(itemId: string): Promise<void> {
const weekNumber = getWeekNumber(new Date());
const year = new Date().getFullYear();
const archiveFolder = `docs/archives/ideas-issues/week-${weekNumber}-${year}`;
// Ensure archive folder exists
await fs.mkdir(archiveFolder, { recursive: true });
// Move item from active file to archive
await moveItemToArchive(itemId, archiveFolder);
console.log(`📦 Archived ${itemId} to ${archiveFolder}`);
}
/**
* Stop watching ideas file
*/
function stopWatchingIdeasFile(): void {
if (ideasFileWatcher.watcher) {
ideasFileWatcher.watcher.close();
ideasFileWatcher.watcher = null;
console.log('📝 Ideas file watcher stopped');
}
}
/**
* Get week number for archive folder naming
*/
function getWeekNumber(date: Date): number {
const firstDayOfYear = new Date(date.getFullYear(), 0, 1);
const pastDaysOfYear = (date.getTime() - firstDayOfYear.getTime()) / 86400000;
return Math.ceil((pastDaysOfYear + firstDayOfYear.getDay() + 1) / 7);
}
/**
* Create backup before processing
*/
async function createBackupBeforeProcessing(): Promise<void> {
const timestamp = new Date().toISOString().replace(/[:.]/g, '-');
await fs.copyFile(
'docs/planning/overview/ideas-issues.md',
`docs/planning/overview/ideas-issues.md.backup-${timestamp}`
);
await fs.copyFile(
'docs/MASTER_PLAN.md',
`docs/MASTER_PLAN.md.backup-${timestamp}`
);
console.log(`💾 Created backups with timestamp ${timestamp}`);
}
/**
* Rollback from backup if processing fails
*/
async function rollbackFromBackup(): Promise<void> {
// Find latest backup
const backups = await fs.readdir('docs/planning/overview/')
.then(files => files.filter(f => f.includes('ideas-issues.md.backup-')))
.sort()
.reverse();
if (backups.length === 0) {
console.error('❌ No backups found for rollback');
return;
}
const latestBackup = backups[0];
await fs.copyFile(
`docs/planning/overview/${latestBackup}`,
'docs/planning/overview/ideas-issues.md'
);
console.log(`🔄 Rolled back to ${latestBackup}`);
}async routePersonalAppDataTask(task: PersonalAppDataTask, context: PersonalAppContext): Promise<SkillResult> {
if (task.type === 'CROSS_TAB_SYNC') {
return await this.delegateToSkill('dev-fix-task-sync', {
task,
context,
syncStrategy: 'indexeddb-broadcast-channel',
validation: 'data-consistency-check'
});
} else if (task.type === 'LOCAL_BACKUP') {
return await this.delegateToSkill('indexeddb-backup-debugger', {
task,
context,
backupStrategy: 'incremental-local-backup'
});
} else if (task.type === 'DATA_MIGRATION') {
return await this.delegateToSkill('persistence-type-fixer', {
task,
context,
migrationPlan: 'personal-app-data-migration'
});
}
}async routePersonalAppFrontendTask(task: PersonalAppFrontendTask, context: PersonalAppContext): Promise<SkillResult> {
if (task.framework === 'vue') {
if (task.concern === 'PERFORMANCE') {
return await this.delegateToSkill('dev-optimize-performance', {
task,
context,
optimizationTarget: 'personal-app-user-experience'
});
} else if (task.concern === 'REACTIVITY') {
return await this.delegateToSkill('dev-debugging', {
task,
context,
focus: 'vue-reactivity-debugging'
});
} else if (task.concern === 'COMPONENT_DESIGN') {
return await this.delegateToSkill('dev-vue', {
task,
context,
componentType: 'personal-app-component'
});
}
}
}async routePersonalAppTestingTask(task: PersonalAppTestingTask, context: PersonalAppContext): Promise<SkillResult> {
if (task.type === 'USER_EXPERIENCE_VALIDATION') {
return await this.delegateToSkill('qa-testing', {
task,
context,
testingScope: 'personal-app-user-workflow',
validationMethod: 'playwright-visual-testing'
});
} else if (task.type === 'UI_CONSISTENCY') {
return await this.delegateToSkill('qa-audit-ui-ux', {
task,
context,
auditScope: 'personal-app-design-system'
});
} else if (task.type === 'SYSTEM_HEALTH') {
return await this.delegateToSkill('comprehensive-system-analyzer', {
task,
context,
analysisScope: 'personal-app-health-check'
});
}
}chief-architect implement-cross-tab-sync \
--current-stack "indexeddb/localforage" \
--sync-strategy "broadcast-channel" \
--requirements "real-time-sync,offline-first,user-experience-priority" \
--validation "playwright-cross-tab-testing"chief-architect optimize-personal-app-performance \
--analyze "src/components src/stores" \
--focus "user-experience,mobile-readiness,bundle-size" \
--target-lighthouse-score ">90" \
--validation-method "user-workflow-testing"chief-architect prepare-mobile-version \
--current-platform "browser-only" \
--target-platform "browser + mobile (capacitor)" \
--quality-attributes "touch-interactions,battery-efficiency,responsive-design" \
--timeline "4-weeks"chief-architect enhance-user-experience \
--analyze-user-workflow "task-management,pomodoro-timer,cross-view-synchronization" \
--focus "productivity-improvement,interface-consistency,error-handling" \
--validation "user-testing,playwright-visual-validation"chief-architect watch-ideas-file \
--auto-process "true" \
--confidence-threshold "80" \
--archive-strategy "weekly-folders"chief-architect process-ideas \
--source-file "docs/planning/overview/ideas-issues.md" \
--target-file "docs/MASTER_PLAN.md" \
--enhance-existing "true"chief-architect stop-watching-ideas \
--cleanup "backup-folders"// Systematic project analysis
const analyzeProjectRequirements = (userRequest) => {
return {
// Codebase Context
currentArchitecture: analyzeExistingStructure(),
patterns: identifyExistingPatterns(),
conventions: extractProjectGuidelines(),
// Requirements Analysis
explicitRequirements: extractRequirements(userRequest),
implicitRequirements: identifyImplicitNeeds(),
constraints: analyzeTechnicalConstraints(),
// Dependency Mapping
affectedFiles: mapImpactAreas(),
dataFlow: analyzeDataRequirements(),
integrationPoints: identifyConnections()
}
}// Create implementation roadmap
const createImplementationPlan = (analysis) => {
return {
phases: breakIntoPhases(analysis),
tasks: defineSpecificTasks(),
dependencies: mapTaskDependencies(),
timeline: estimateDevelopmentTime(),
risks: identifyPotentialRisks(),
validation: defineSuccessCriteria()
}
}## Implementation Plan: [Feature Name]
### Phase 1: Foundation
- [ ] Setup core data structures
- [ ] Create basic UI components
- [ ] Implement primary functionality
### Phase 2: Integration
- [ ] Connect to existing stores
- [ ] Integrate with routing
- [ ] Add error handling
### Phase 3: Enhancement
- [ ] Add advanced features
- [ ] Implement accessibility
- [ ] Performance optimization
### Dependencies:
- Requires: [existing features]
- Impacts: [other components]
- Timeline: [estimated duration]
### Success Criteria:
- [ ] Feature works as specified
- [ ] No regressions in existing functionality
- [ ] Performance within acceptable limits
- [ ] User testing validates requirementsAskUserQuestion"I've implemented [description of fix]. Before I mark this as complete, please verify:
1. [Specific thing to check #1]
2. [Specific thing to check #2]
3. Does this fix the issue you were experiencing?
Please confirm the fix works as expected, or let me know what's still not working."