sdd-mcp-server 2.2.1 → 3.0.1

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.
Files changed (48) hide show
  1. package/README.md +93 -33
  2. package/dist/agents/AgentManager.d.ts +61 -0
  3. package/dist/agents/AgentManager.js +75 -0
  4. package/dist/agents/AgentManager.js.map +1 -0
  5. package/dist/agents/index.d.ts +1 -0
  6. package/dist/agents/index.js +3 -0
  7. package/dist/agents/index.js.map +1 -0
  8. package/dist/cli/install-skills.d.ts +56 -11
  9. package/dist/cli/install-skills.js +311 -122
  10. package/dist/cli/install-skills.js.map +1 -1
  11. package/dist/cli/sdd-mcp-cli.js +0 -0
  12. package/dist/contexts/ContextManager.d.ts +53 -0
  13. package/dist/contexts/ContextManager.js +64 -0
  14. package/dist/contexts/ContextManager.js.map +1 -0
  15. package/dist/contexts/index.d.ts +1 -0
  16. package/dist/contexts/index.js +3 -0
  17. package/dist/contexts/index.js.map +1 -0
  18. package/dist/hooks/HookLoader.d.ts +67 -0
  19. package/dist/hooks/HookLoader.js +180 -0
  20. package/dist/hooks/HookLoader.js.map +1 -0
  21. package/dist/index.js +5 -3
  22. package/dist/index.js.map +1 -1
  23. package/dist/infrastructure/di/container.js +24 -0
  24. package/dist/infrastructure/di/container.js.map +1 -1
  25. package/dist/infrastructure/di/types.d.ts +4 -0
  26. package/dist/infrastructure/di/types.js +5 -0
  27. package/dist/infrastructure/di/types.js.map +1 -1
  28. package/dist/rules/RulesManager.d.ts +53 -0
  29. package/dist/rules/RulesManager.js +62 -0
  30. package/dist/rules/RulesManager.js.map +1 -0
  31. package/dist/rules/index.d.ts +1 -0
  32. package/dist/rules/index.js +3 -0
  33. package/dist/rules/index.js.map +1 -0
  34. package/dist/shared/BaseManager.d.ts +130 -0
  35. package/dist/shared/BaseManager.js +274 -0
  36. package/dist/shared/BaseManager.js.map +1 -0
  37. package/dist/shared/index.d.ts +1 -0
  38. package/dist/shared/index.js +3 -0
  39. package/dist/shared/index.js.map +1 -0
  40. package/dist/utils/sddPaths.d.ts +69 -0
  41. package/dist/utils/sddPaths.js +138 -0
  42. package/dist/utils/sddPaths.js.map +1 -0
  43. package/documentGenerator.js +1 -1
  44. package/mcp-server.js +39 -39
  45. package/package.json +1 -1
  46. package/skills/sdd-review/SKILL.md +191 -0
  47. package/skills/sdd-security-check/SKILL.md +193 -0
  48. package/skills/sdd-test-gen/SKILL.md +295 -0
@@ -0,0 +1,53 @@
1
+ import { BaseManager, ComponentDescriptor } from '../shared/BaseManager.js';
2
+ /**
3
+ * Descriptor for a rule component
4
+ */
5
+ export interface RuleDescriptor extends ComponentDescriptor {
6
+ /** Rule name */
7
+ name: string;
8
+ /** Brief description of the rule */
9
+ description: string;
10
+ /** Path to the rule file */
11
+ path: string;
12
+ /** Execution priority (higher = first) */
13
+ priority: number;
14
+ /** Whether rule is always applied */
15
+ alwaysActive: boolean;
16
+ }
17
+ /**
18
+ * Manages rule components - discovery, listing, and installation
19
+ *
20
+ * Rules are always-active guidelines that apply across all AI interactions.
21
+ * They define coding standards, security requirements, testing practices, etc.
22
+ *
23
+ * @example
24
+ * ```typescript
25
+ * const manager = new RulesManager('/path/to/rules');
26
+ * const rules = await manager.listComponents();
27
+ * await manager.installComponents('/project/.claude/rules');
28
+ * ```
29
+ */
30
+ export declare class RulesManager extends BaseManager<RuleDescriptor> {
31
+ /**
32
+ * Create a new RulesManager
33
+ * @param rulesPath - Path to the rules directory
34
+ */
35
+ constructor(rulesPath: string);
36
+ /**
37
+ * Parse metadata from rule file content
38
+ * @param content - Raw content of the rule file
39
+ * @param filePath - Path to the rule file
40
+ * @returns Parsed rule descriptor
41
+ */
42
+ protected parseMetadata(content: string, filePath: string): RuleDescriptor;
43
+ /**
44
+ * Get rules sorted by priority (highest first)
45
+ * @returns Array of rule descriptors sorted by priority
46
+ */
47
+ listByPriority(): Promise<RuleDescriptor[]>;
48
+ /**
49
+ * Get only active rules
50
+ * @returns Array of rule descriptors that are always active
51
+ */
52
+ listActiveRules(): Promise<RuleDescriptor[]>;
53
+ }
@@ -0,0 +1,62 @@
1
+ import * as path from 'path';
2
+ import { BaseManager } from '../shared/BaseManager.js';
3
+ /**
4
+ * Manages rule components - discovery, listing, and installation
5
+ *
6
+ * Rules are always-active guidelines that apply across all AI interactions.
7
+ * They define coding standards, security requirements, testing practices, etc.
8
+ *
9
+ * @example
10
+ * ```typescript
11
+ * const manager = new RulesManager('/path/to/rules');
12
+ * const rules = await manager.listComponents();
13
+ * await manager.installComponents('/project/.claude/rules');
14
+ * ```
15
+ */
16
+ export class RulesManager extends BaseManager {
17
+ /**
18
+ * Create a new RulesManager
19
+ * @param rulesPath - Path to the rules directory
20
+ */
21
+ constructor(rulesPath) {
22
+ super({
23
+ componentPath: rulesPath,
24
+ structureType: 'file',
25
+ fileExtension: '.md',
26
+ });
27
+ }
28
+ /**
29
+ * Parse metadata from rule file content
30
+ * @param content - Raw content of the rule file
31
+ * @param filePath - Path to the rule file
32
+ * @returns Parsed rule descriptor
33
+ */
34
+ parseMetadata(content, filePath) {
35
+ const metadata = this.parseYamlFrontmatter(content);
36
+ const fileName = path.basename(filePath, this.config.fileExtension);
37
+ return {
38
+ name: metadata.name || fileName,
39
+ description: metadata.description || '',
40
+ path: filePath,
41
+ priority: typeof metadata.priority === 'number' ? metadata.priority : 0,
42
+ alwaysActive: metadata.alwaysActive !== false, // Default to true
43
+ };
44
+ }
45
+ /**
46
+ * Get rules sorted by priority (highest first)
47
+ * @returns Array of rule descriptors sorted by priority
48
+ */
49
+ async listByPriority() {
50
+ const rules = await this.listComponents();
51
+ return rules.sort((a, b) => b.priority - a.priority);
52
+ }
53
+ /**
54
+ * Get only active rules
55
+ * @returns Array of rule descriptors that are always active
56
+ */
57
+ async listActiveRules() {
58
+ const rules = await this.listComponents();
59
+ return rules.filter(rule => rule.alwaysActive);
60
+ }
61
+ }
62
+ //# sourceMappingURL=RulesManager.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"RulesMan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AM,KAAK,GAAG,MAAM,IAAI,CAAC,cAAc,EAAE,CAAC;QAC1C,OAAO,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;IACjD,CAAC;CACF"}
@@ -0,0 +1 @@
1
+ export { RulesManager, RuleDescriptor } from './RulesManager.js';
@@ -0,0 +1,3 @@
1
+ // Rules module exports
2
+ export { RulesManager } from './RulesManager.js';
3
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/rules/index.ts"],"names":[],"mappings":"AAAA,uBAAuB;AAEvB,OAAO,EAAE,YAAY,EAAkB,MAAM,mBAAmB,CAAC"}
@@ -0,0 +1,130 @@
1
+ /**
2
+ * Base descriptor for all managed components
3
+ */
4
+ export interface ComponentDescriptor {
5
+ /** Component name (e.g., 'coding-style', 'planner') */
6
+ name: string;
7
+ /** Brief description of the component */
8
+ description: string;
9
+ /** Path to the component (file or directory) */
10
+ path: string;
11
+ }
12
+ /**
13
+ * Result of component installation
14
+ */
15
+ export interface InstallResult {
16
+ /** Successfully installed components */
17
+ installed: string[];
18
+ /** Failed installations with error details */
19
+ failed: Array<{
20
+ name: string;
21
+ error: string;
22
+ }>;
23
+ }
24
+ /**
25
+ * Parsed component metadata from YAML frontmatter
26
+ */
27
+ export interface ComponentMetadata {
28
+ name?: string;
29
+ description?: string;
30
+ [key: string]: unknown;
31
+ }
32
+ /**
33
+ * Configuration options for BaseManager
34
+ */
35
+ export interface ManagerConfig {
36
+ /** Path to the component directory */
37
+ componentPath: string;
38
+ /**
39
+ * Component structure type:
40
+ * - 'directory': Components are in subdirectories with a main file (like skills/)
41
+ * - 'file': Components are individual files (like agents/, rules/, contexts/)
42
+ */
43
+ structureType: 'directory' | 'file';
44
+ /**
45
+ * Main filename for directory-based components (e.g., 'SKILL.md', 'AGENT.md')
46
+ * Only used when structureType is 'directory'
47
+ */
48
+ mainFileName?: string;
49
+ /** File extension to filter (default: '.md') */
50
+ fileExtension?: string;
51
+ }
52
+ /**
53
+ * Abstract base class for component managers
54
+ *
55
+ * Provides common functionality for discovering, listing, and installing
56
+ * various component types (skills, agents, rules, contexts, hooks).
57
+ *
58
+ * @typeParam T - The descriptor type for the managed component
59
+ */
60
+ export declare abstract class BaseManager<T extends ComponentDescriptor> {
61
+ protected readonly config: ManagerConfig;
62
+ /**
63
+ * Create a new BaseManager
64
+ * @param config - Manager configuration
65
+ */
66
+ constructor(config: ManagerConfig);
67
+ /**
68
+ * Parse metadata from component content
69
+ * Override this method to customize metadata extraction
70
+ * @param content - Raw content of the component file
71
+ * @param filePath - Path to the component file (for context)
72
+ * @returns Parsed component descriptor
73
+ */
74
+ protected abstract parseMetadata(content: string, filePath: string): T;
75
+ /**
76
+ * Get the component name from a file or directory path
77
+ * @param entryPath - Path to the entry
78
+ * @returns Component name
79
+ */
80
+ protected getComponentName(entryPath: string): string;
81
+ /**
82
+ * List all available components
83
+ * @returns Array of component descriptors
84
+ */
85
+ listComponents(): Promise<T[]>;
86
+ /**
87
+ * Get content of a specific component
88
+ * @param componentName - Name of the component
89
+ * @returns Component content
90
+ * @throws Error if component not found
91
+ */
92
+ getComponentContent(componentName: string): Promise<string>;
93
+ /**
94
+ * Get path to a specific component
95
+ * @param componentName - Name of the component
96
+ * @returns Path to the component
97
+ * @throws Error if component not found
98
+ */
99
+ getComponentPath(componentName: string): Promise<string>;
100
+ /**
101
+ * Install components to a target directory
102
+ * @param targetPath - Target directory for installation
103
+ * @returns Installation result with success and failure details
104
+ */
105
+ installComponents(targetPath: string): Promise<InstallResult>;
106
+ /**
107
+ * Parse YAML frontmatter from content
108
+ * @param content - Content with YAML frontmatter
109
+ * @returns Parsed metadata
110
+ */
111
+ protected parseYamlFrontmatter(content: string): ComponentMetadata;
112
+ /**
113
+ * Get content body (without frontmatter)
114
+ * @param content - Full content with possible frontmatter
115
+ * @returns Content body
116
+ */
117
+ protected getContentBody(content: string): string;
118
+ /**
119
+ * Copy a directory recursively
120
+ * @param source - Source directory
121
+ * @param destination - Destination directory
122
+ */
123
+ protected copyDirectory(source: string, destination: string): Promise<void>;
124
+ /**
125
+ * Check if a path exists
126
+ * @param filePath - Path to check
127
+ * @returns True if path exists
128
+ */
129
+ protected pathExists(filePath: string): Promise<boolean>;
130
+ }
@@ -0,0 +1,274 @@
1
+ import * as fs from 'fs';
2
+ import * as path from 'path';
3
+ /**
4
+ * Abstract base class for component managers
5
+ *
6
+ * Provides common functionality for discovering, listing, and installing
7
+ * various component types (skills, agents, rules, contexts, hooks).
8
+ *
9
+ * @typeParam T - The descriptor type for the managed component
10
+ */
11
+ export class BaseManager {
12
+ config;
13
+ /**
14
+ * Create a new BaseManager
15
+ * @param config - Manager configuration
16
+ */
17
+ constructor(config) {
18
+ this.config = {
19
+ ...config,
20
+ fileExtension: config.fileExtension || '.md',
21
+ };
22
+ }
23
+ /**
24
+ * Get the component name from a file or directory path
25
+ * @param entryPath - Path to the entry
26
+ * @returns Component name
27
+ */
28
+ getComponentName(entryPath) {
29
+ return path.basename(entryPath, this.config.fileExtension);
30
+ }
31
+ /**
32
+ * List all available components
33
+ * @returns Array of component descriptors
34
+ */
35
+ async listComponents() {
36
+ const components = [];
37
+ try {
38
+ const entries = await fs.promises.readdir(this.config.componentPath, { withFileTypes: true });
39
+ if (this.config.structureType === 'directory') {
40
+ // Directory-based structure (like skills/)
41
+ for (const entry of entries) {
42
+ if (entry.isDirectory()) {
43
+ const mainFilePath = path.join(this.config.componentPath, entry.name, this.config.mainFileName || `${entry.name}${this.config.fileExtension}`);
44
+ try {
45
+ const content = await fs.promises.readFile(mainFilePath, 'utf-8');
46
+ const descriptor = this.parseMetadata(content, mainFilePath);
47
+ components.push({
48
+ ...descriptor,
49
+ path: path.join(this.config.componentPath, entry.name),
50
+ });
51
+ }
52
+ catch {
53
+ // Skip directories without main file
54
+ continue;
55
+ }
56
+ }
57
+ }
58
+ }
59
+ else {
60
+ // File-based structure (like agents/, rules/, contexts/)
61
+ for (const entry of entries) {
62
+ if (entry.isFile() && entry.name.endsWith(this.config.fileExtension || '.md')) {
63
+ const filePath = path.join(this.config.componentPath, entry.name);
64
+ try {
65
+ const content = await fs.promises.readFile(filePath, 'utf-8');
66
+ const descriptor = this.parseMetadata(content, filePath);
67
+ components.push({
68
+ ...descriptor,
69
+ path: filePath,
70
+ });
71
+ }
72
+ catch {
73
+ // Skip files that can't be read or parsed
74
+ continue;
75
+ }
76
+ }
77
+ }
78
+ }
79
+ }
80
+ catch {
81
+ // Return empty array if component directory doesn't exist
82
+ return [];
83
+ }
84
+ return components;
85
+ }
86
+ /**
87
+ * Get content of a specific component
88
+ * @param componentName - Name of the component
89
+ * @returns Component content
90
+ * @throws Error if component not found
91
+ */
92
+ async getComponentContent(componentName) {
93
+ let componentPath;
94
+ if (this.config.structureType === 'directory') {
95
+ componentPath = path.join(this.config.componentPath, componentName, this.config.mainFileName || `${componentName}${this.config.fileExtension}`);
96
+ }
97
+ else {
98
+ componentPath = path.join(this.config.componentPath, `${componentName}${this.config.fileExtension}`);
99
+ }
100
+ try {
101
+ return await fs.promises.readFile(componentPath, 'utf-8');
102
+ }
103
+ catch {
104
+ throw new Error(`Component "${componentName}" not found`);
105
+ }
106
+ }
107
+ /**
108
+ * Get path to a specific component
109
+ * @param componentName - Name of the component
110
+ * @returns Path to the component
111
+ * @throws Error if component not found
112
+ */
113
+ async getComponentPath(componentName) {
114
+ let componentPath;
115
+ if (this.config.structureType === 'directory') {
116
+ componentPath = path.join(this.config.componentPath, componentName);
117
+ }
118
+ else {
119
+ componentPath = path.join(this.config.componentPath, `${componentName}${this.config.fileExtension}`);
120
+ }
121
+ const exists = await this.pathExists(componentPath);
122
+ if (!exists) {
123
+ throw new Error(`Component "${componentName}" not found`);
124
+ }
125
+ return componentPath;
126
+ }
127
+ /**
128
+ * Install components to a target directory
129
+ * @param targetPath - Target directory for installation
130
+ * @returns Installation result with success and failure details
131
+ */
132
+ async installComponents(targetPath) {
133
+ const result = {
134
+ installed: [],
135
+ failed: [],
136
+ };
137
+ // Create target directory
138
+ await fs.promises.mkdir(targetPath, { recursive: true });
139
+ try {
140
+ const entries = await fs.promises.readdir(this.config.componentPath, { withFileTypes: true });
141
+ if (this.config.structureType === 'directory') {
142
+ // Install directory-based components
143
+ for (const entry of entries) {
144
+ if (!entry.isDirectory())
145
+ continue;
146
+ const componentName = entry.name;
147
+ const sourceDir = path.join(this.config.componentPath, componentName);
148
+ const destDir = path.join(targetPath, componentName);
149
+ try {
150
+ await this.copyDirectory(sourceDir, destDir);
151
+ result.installed.push(componentName);
152
+ }
153
+ catch (error) {
154
+ result.failed.push({
155
+ name: componentName,
156
+ error: error instanceof Error ? error.message : String(error),
157
+ });
158
+ }
159
+ }
160
+ }
161
+ else {
162
+ // Install file-based components
163
+ for (const entry of entries) {
164
+ if (!entry.isFile() || !entry.name.endsWith(this.config.fileExtension || '.md')) {
165
+ continue;
166
+ }
167
+ const componentName = this.getComponentName(entry.name);
168
+ const sourceFile = path.join(this.config.componentPath, entry.name);
169
+ const destFile = path.join(targetPath, entry.name);
170
+ try {
171
+ await fs.promises.copyFile(sourceFile, destFile);
172
+ result.installed.push(componentName);
173
+ }
174
+ catch (error) {
175
+ result.failed.push({
176
+ name: componentName,
177
+ error: error instanceof Error ? error.message : String(error),
178
+ });
179
+ }
180
+ }
181
+ }
182
+ }
183
+ catch {
184
+ // Return current result if reading component directory fails
185
+ }
186
+ return result;
187
+ }
188
+ /**
189
+ * Parse YAML frontmatter from content
190
+ * @param content - Content with YAML frontmatter
191
+ * @returns Parsed metadata
192
+ */
193
+ parseYamlFrontmatter(content) {
194
+ const metadata = {};
195
+ // Match YAML frontmatter between --- delimiters
196
+ const frontmatterMatch = content.match(/^---\n([\s\S]*?)\n---/);
197
+ if (!frontmatterMatch) {
198
+ return metadata;
199
+ }
200
+ const frontmatter = frontmatterMatch[1];
201
+ // Simple YAML parsing for key: value pairs
202
+ const lines = frontmatter.split('\n');
203
+ for (const line of lines) {
204
+ const colonIndex = line.indexOf(':');
205
+ if (colonIndex > 0) {
206
+ const key = line.slice(0, colonIndex).trim();
207
+ let value = line.slice(colonIndex + 1).trim();
208
+ // Handle quoted values
209
+ if ((value.startsWith('"') && value.endsWith('"')) ||
210
+ (value.startsWith("'") && value.endsWith("'"))) {
211
+ value = value.slice(1, -1);
212
+ }
213
+ // Handle boolean values
214
+ if (value === 'true') {
215
+ metadata[key] = true;
216
+ }
217
+ else if (value === 'false') {
218
+ metadata[key] = false;
219
+ }
220
+ else if (!isNaN(Number(value)) && value !== '') {
221
+ metadata[key] = Number(value);
222
+ }
223
+ else {
224
+ metadata[key] = value;
225
+ }
226
+ }
227
+ }
228
+ return metadata;
229
+ }
230
+ /**
231
+ * Get content body (without frontmatter)
232
+ * @param content - Full content with possible frontmatter
233
+ * @returns Content body
234
+ */
235
+ getContentBody(content) {
236
+ // Remove YAML frontmatter if present
237
+ const bodyMatch = content.match(/^---\n[\s\S]*?\n---\n?([\s\S]*)$/);
238
+ return bodyMatch ? bodyMatch[1].trim() : content.trim();
239
+ }
240
+ /**
241
+ * Copy a directory recursively
242
+ * @param source - Source directory
243
+ * @param destination - Destination directory
244
+ */
245
+ async copyDirectory(source, destination) {
246
+ await fs.promises.mkdir(destination, { recursive: true });
247
+ const entries = await fs.promises.readdir(source, { withFileTypes: true });
248
+ for (const entry of entries) {
249
+ const sourcePath = path.join(source, entry.name);
250
+ const destPath = path.join(destination, entry.name);
251
+ if (entry.isDirectory()) {
252
+ await this.copyDirectory(sourcePath, destPath);
253
+ }
254
+ else {
255
+ await fs.promises.copyFile(sourcePath, destPath);
256
+ }
257
+ }
258
+ }
259
+ /**
260
+ * Check if a path exists
261
+ * @param filePath - Path to check
262
+ * @returns True if path exists
263
+ */
264
+ async pathExists(filePath) {
265
+ try {
266
+ await fs.promises.access(filePath);
267
+ return true;
268
+ }
269
+ catch {
270
+ return false;
271
+ }
272
+ }
273
+ }
274
+ //# sourceMappingURL=BaseManager.js.map
@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I,CAAC,CAAC;YAEpD,IAAI,KAAK,CAAC,WAAW,EAAE,EAAE,CAAC;gBACxB,MAAM,IAAI,CAAC,aAAa,CAAC,UAAU,EAAE,QAAQ,CAAC,CAAC;YACjD,CAAC;iBAAM,CAAC;gBACN,MAAM,EAAE,CAAC,QAAQ,CAAC,QAAQ,CAAC,UAAU,EAAE,QAAQ,CAAC,CAAC;YACnD,CAAC;QACH,CAAC;IACH,CAAC;IAED;;;;OAIG;IACO,KAAK,CAAC,UAAU,CAAC,QAAgB;QACzC,IAAI,CAAC;YACH,MAAM,EAAE,CAAC,QAAQ,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;YACnC,OAAO,IAAI,CAAC;QACd,CAAC;QAAC,MAAM,CAAC;YACP,OAAO,KAAK,CAAC;QACf,CAAC;IACH,CAAC;CACF"}
@@ -0,0 +1 @@
1
+ export { BaseManager, ComponentDescriptor, InstallResult, ComponentMetadata, ManagerConfig, } from './BaseManager.js';
@@ -0,0 +1,3 @@
1
+ // Shared module exports
2
+ export { BaseManager, } from './BaseManager.js';
3
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/shared/index.ts"],"names":[],"mappings":"AAAA,wBAAwB;AAExB,OAAO,EACL,WAAW,GAKZ,MAAM,kBAAkB,CAAC"}
@@ -0,0 +1,69 @@
1
+ /**
2
+ * SDD directory names
3
+ * .spec is the new standard (v2.1.0+)
4
+ * .kiro is legacy (for backwards compatibility)
5
+ */
6
+ export declare const SDD_DIR = ".spec";
7
+ export declare const SDD_DIR_LEGACY = ".kiro";
8
+ /**
9
+ * Get the SDD root directory for a project
10
+ * Prefers .spec, falls back to .kiro for legacy projects
11
+ *
12
+ * @param projectPath - Project root path
13
+ * @returns SDD root directory path (.spec or .kiro)
14
+ */
15
+ export declare function getSddRoot(projectPath: string): string;
16
+ /**
17
+ * Get the SDD directory name for a project
18
+ * Returns the actual directory name used (.spec or .kiro)
19
+ *
20
+ * @param projectPath - Project root path
21
+ * @returns Directory name (.spec or .kiro)
22
+ */
23
+ export declare function getSddDirName(projectPath: string): string;
24
+ /**
25
+ * Get the specs directory path
26
+ * @param projectPath - Project root path
27
+ * @returns Specs directory path
28
+ */
29
+ export declare function getSpecsPath(projectPath: string): string;
30
+ /**
31
+ * Get the steering directory path
32
+ * @param projectPath - Project root path
33
+ * @returns Steering directory path
34
+ */
35
+ export declare function getSteeringPath(projectPath: string): string;
36
+ /**
37
+ * Get a feature's spec directory path
38
+ * @param projectPath - Project root path
39
+ * @param featureName - Feature name
40
+ * @returns Feature spec directory path
41
+ */
42
+ export declare function getFeatureSpecPath(projectPath: string, featureName: string): string;
43
+ /**
44
+ * Get the spec.json file path for a feature
45
+ * @param projectPath - Project root path
46
+ * @param featureName - Feature name
47
+ * @returns spec.json file path
48
+ */
49
+ export declare function getSpecJsonPath(projectPath: string, featureName: string): string;
50
+ /**
51
+ * Check if this is a legacy project (using .kiro instead of .spec)
52
+ * @param projectPath - Project root path
53
+ * @returns true if project uses .kiro
54
+ */
55
+ export declare function isLegacyProject(projectPath: string): boolean;
56
+ /**
57
+ * Get the appropriate SDD directory for new projects
58
+ * Always returns .spec for new projects
59
+ *
60
+ * @param projectPath - Project root path
61
+ * @returns Path to create SDD directory (.spec)
62
+ */
63
+ export declare function getNewSddRoot(projectPath: string): string;
64
+ /**
65
+ * Create all required SDD directories for a new project
66
+ * @param projectPath - Project root path
67
+ * @returns Created paths
68
+ */
69
+ export declare function createSddDirectories(projectPath: string): string[];