createFeature
codebolt.roadmap.createFeature(phaseId: string, data: CreateFeatureData, projectPath: string): Promise<RoadmapFeatureResponse>
Creates a new feature within a specific phase. Features represent specific functionality items or deliverables.
Parameters
phaseId(string): The ID of the phase to add the feature todata(CreateFeatureData): Feature data including title, description, and optional metadataprojectPath(string): Optional project path (uses active project if not provided)
Returns
Promise<[RoadmapFeatureResponse](/docs/reference/type-reference/codeboltjs/interfaces/RoadmapFeatureResponse)>: A promise that resolves to the created feature
Parameter Details
phaseId(string, required): The ID of the phase to add the feature todata(CreateFeatureData, required): Feature datatitle(string, required): Feature titledescription(string, optional): Feature descriptionimpact(ImpactLevel, optional): 'low' | 'medium' | 'high' | 'critical'difficulty(DifficultyLevel, optional): 'easy' | 'medium' | 'hard' | 'very-hard'priority(number, optional): Feature priority (lower number = higher priority)tags(string[], optional): Feature tags for categorizationcategory(string, optional): Feature categorystatus(FeatureStatus, optional): 'pending' | 'in-progress' | 'completed' | 'cancelled' (default: 'pending')createdBy(RoadmapCreator, optional): Creator information
Response Structure
interface RoadmapFeatureResponse {
feature: Feature;
}
interface Feature {
id: string;
title: string;
description?: string;
impact?: ImpactLevel;
difficulty?: DifficultyLevel;
priority?: number;
tags?: string[];
category?: string;
status: FeatureStatus;
phaseId: string;
createdBy?: RoadmapCreator;
createdAt: string;
updatedAt: string;
}
Examples
1. Create Basic Feature
import codebolt from '@codebolt/codeboltjs';
// Create a simple feature
const result = await codebolt.roadmap.createFeature('phase_001', {
title: 'User Login',
description: 'Allow users to login with email and password'
});
console.log('Feature created:', result.feature.id);
console.log('Title:', result.feature.title);
console.log('Status:', result.feature.status); // 'pending'
2. Create Feature with Impact and Difficulty
// Create feature with impact and difficulty ratings
const result = await codebolt.roadmap.createFeature('phase_001', {
title: 'Payment Processing',
description: 'Integrate Stripe for credit card payments',
impact: 'critical',
difficulty: 'hard',
priority: 1,
category: 'payments'
});
console.log('High-priority critical feature created');