@nanocollective/nanocoder 1.11.3
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.
- package/LICENSE.md +23 -0
- package/README.md +366 -0
- package/dist/app/hooks/useAppInitialization.d.ts +26 -0
- package/dist/app/hooks/useAppInitialization.d.ts.map +1 -0
- package/dist/app/hooks/useAppInitialization.js +151 -0
- package/dist/app/hooks/useAppInitialization.js.map +1 -0
- package/dist/app/hooks/useAppState.d.ts +84 -0
- package/dist/app/hooks/useAppState.d.ts.map +1 -0
- package/dist/app/hooks/useAppState.js +162 -0
- package/dist/app/hooks/useAppState.js.map +1 -0
- package/dist/app/hooks/useChatHandler.d.ts +26 -0
- package/dist/app/hooks/useChatHandler.d.ts.map +1 -0
- package/dist/app/hooks/useChatHandler.js +532 -0
- package/dist/app/hooks/useChatHandler.js.map +1 -0
- package/dist/app/hooks/useDirectoryTrust.d.ts +15 -0
- package/dist/app/hooks/useDirectoryTrust.d.ts.map +1 -0
- package/dist/app/hooks/useDirectoryTrust.js +77 -0
- package/dist/app/hooks/useDirectoryTrust.js.map +1 -0
- package/dist/app/hooks/useModeHandlers.d.ts +31 -0
- package/dist/app/hooks/useModeHandlers.d.ts.map +1 -0
- package/dist/app/hooks/useModeHandlers.js +98 -0
- package/dist/app/hooks/useModeHandlers.js.map +1 -0
- package/dist/app/hooks/useToolHandler.d.ts +32 -0
- package/dist/app/hooks/useToolHandler.d.ts.map +1 -0
- package/dist/app/hooks/useToolHandler.js +154 -0
- package/dist/app/hooks/useToolHandler.js.map +1 -0
- package/dist/app/utils/appUtils.d.ts +4 -0
- package/dist/app/utils/appUtils.d.ts.map +1 -0
- package/dist/app/utils/appUtils.js +147 -0
- package/dist/app/utils/appUtils.js.map +1 -0
- package/dist/app/utils/conversationState.d.ts +68 -0
- package/dist/app/utils/conversationState.d.ts.map +1 -0
- package/dist/app/utils/conversationState.js +199 -0
- package/dist/app/utils/conversationState.js.map +1 -0
- package/dist/app.d.ts +2 -0
- package/dist/app.d.ts.map +1 -0
- package/dist/app.js +193 -0
- package/dist/app.js.map +1 -0
- package/dist/cli.d.ts +3 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +6 -0
- package/dist/cli.js.map +1 -0
- package/dist/client-factory.d.ts +6 -0
- package/dist/client-factory.d.ts.map +1 -0
- package/dist/client-factory.js +111 -0
- package/dist/client-factory.js.map +1 -0
- package/dist/command-parser.d.ts +5 -0
- package/dist/command-parser.d.ts.map +1 -0
- package/dist/command-parser.js +36 -0
- package/dist/command-parser.js.map +1 -0
- package/dist/commands/clear.d.ts +3 -0
- package/dist/commands/clear.d.ts.map +1 -0
- package/dist/commands/clear.js +17 -0
- package/dist/commands/clear.js.map +1 -0
- package/dist/commands/custom-commands.d.ts +3 -0
- package/dist/commands/custom-commands.d.ts.map +1 -0
- package/dist/commands/custom-commands.js +41 -0
- package/dist/commands/custom-commands.js.map +1 -0
- package/dist/commands/debug.d.ts +3 -0
- package/dist/commands/debug.d.ts.map +1 -0
- package/dist/commands/debug.js +86 -0
- package/dist/commands/debug.js.map +1 -0
- package/dist/commands/exit.d.ts +3 -0
- package/dist/commands/exit.d.ts.map +1 -0
- package/dist/commands/exit.js +17 -0
- package/dist/commands/exit.js.map +1 -0
- package/dist/commands/export.d.ts +3 -0
- package/dist/commands/export.d.ts.map +1 -0
- package/dist/commands/export.js +63 -0
- package/dist/commands/export.js.map +1 -0
- package/dist/commands/help.d.ts +3 -0
- package/dist/commands/help.d.ts.map +1 -0
- package/dist/commands/help.js +31 -0
- package/dist/commands/help.js.map +1 -0
- package/dist/commands/index.d.ts +13 -0
- package/dist/commands/index.d.ts.map +1 -0
- package/dist/commands/index.js +13 -0
- package/dist/commands/index.js.map +1 -0
- package/dist/commands/init.d.ts +3 -0
- package/dist/commands/init.d.ts.map +1 -0
- package/dist/commands/init.js +214 -0
- package/dist/commands/init.js.map +1 -0
- package/dist/commands/mcp.d.ts +9 -0
- package/dist/commands/mcp.d.ts.map +1 -0
- package/dist/commands/mcp.js +41 -0
- package/dist/commands/mcp.js.map +1 -0
- package/dist/commands/model.d.ts +3 -0
- package/dist/commands/model.d.ts.map +1 -0
- package/dist/commands/model.js +11 -0
- package/dist/commands/model.js.map +1 -0
- package/dist/commands/provider.d.ts +3 -0
- package/dist/commands/provider.d.ts.map +1 -0
- package/dist/commands/provider.js +11 -0
- package/dist/commands/provider.js.map +1 -0
- package/dist/commands/theme.d.ts +3 -0
- package/dist/commands/theme.d.ts.map +1 -0
- package/dist/commands/theme.js +11 -0
- package/dist/commands/theme.js.map +1 -0
- package/dist/commands/update.d.ts +3 -0
- package/dist/commands/update.d.ts.map +1 -0
- package/dist/commands/update.js +10 -0
- package/dist/commands/update.js.map +1 -0
- package/dist/commands.d.ts +16 -0
- package/dist/commands.d.ts.map +1 -0
- package/dist/commands.js +46 -0
- package/dist/commands.js.map +1 -0
- package/dist/components/assistant-message.d.ts +4 -0
- package/dist/components/assistant-message.d.ts.map +1 -0
- package/dist/components/assistant-message.js +43 -0
- package/dist/components/assistant-message.js.map +1 -0
- package/dist/components/bash-execution-indicator.d.ts +4 -0
- package/dist/components/bash-execution-indicator.d.ts.map +1 -0
- package/dist/components/bash-execution-indicator.js +9 -0
- package/dist/components/bash-execution-indicator.js.map +1 -0
- package/dist/components/cancelling-indicator.d.ts +3 -0
- package/dist/components/cancelling-indicator.d.ts.map +1 -0
- package/dist/components/cancelling-indicator.js +10 -0
- package/dist/components/cancelling-indicator.js.map +1 -0
- package/dist/components/chat-queue.d.ts +4 -0
- package/dist/components/chat-queue.d.ts.map +1 -0
- package/dist/components/chat-queue.js +23 -0
- package/dist/components/chat-queue.js.map +1 -0
- package/dist/components/custom-commands.d.ts +7 -0
- package/dist/components/custom-commands.d.ts.map +1 -0
- package/dist/components/custom-commands.js +27 -0
- package/dist/components/custom-commands.js.map +1 -0
- package/dist/components/error-message.d.ts +7 -0
- package/dist/components/error-message.d.ts.map +1 -0
- package/dist/components/error-message.js +12 -0
- package/dist/components/error-message.js.map +1 -0
- package/dist/components/info-message.d.ts +6 -0
- package/dist/components/info-message.d.ts.map +1 -0
- package/dist/components/info-message.js +11 -0
- package/dist/components/info-message.js.map +1 -0
- package/dist/components/model-selector.d.ts +10 -0
- package/dist/components/model-selector.d.ts.map +1 -0
- package/dist/components/model-selector.js +59 -0
- package/dist/components/model-selector.js.map +1 -0
- package/dist/components/provider-selector.d.ts +9 -0
- package/dist/components/provider-selector.d.ts.map +1 -0
- package/dist/components/provider-selector.js +36 -0
- package/dist/components/provider-selector.js.map +1 -0
- package/dist/components/security-disclaimer.d.ts +7 -0
- package/dist/components/security-disclaimer.d.ts.map +1 -0
- package/dist/components/security-disclaimer.js +36 -0
- package/dist/components/security-disclaimer.js.map +1 -0
- package/dist/components/status.d.ts +6 -0
- package/dist/components/status.d.ts.map +1 -0
- package/dist/components/status.js +35 -0
- package/dist/components/status.js.map +1 -0
- package/dist/components/success-message.d.ts +6 -0
- package/dist/components/success-message.d.ts.map +1 -0
- package/dist/components/success-message.js +11 -0
- package/dist/components/success-message.js.map +1 -0
- package/dist/components/theme-selector.d.ts +8 -0
- package/dist/components/theme-selector.d.ts.map +1 -0
- package/dist/components/theme-selector.js +40 -0
- package/dist/components/theme-selector.js.map +1 -0
- package/dist/components/thinking-indicator.d.ts +4 -0
- package/dist/components/thinking-indicator.d.ts.map +1 -0
- package/dist/components/thinking-indicator.js +32 -0
- package/dist/components/thinking-indicator.js.map +1 -0
- package/dist/components/tool-confirmation.d.ts +9 -0
- package/dist/components/tool-confirmation.d.ts.map +1 -0
- package/dist/components/tool-confirmation.js +72 -0
- package/dist/components/tool-confirmation.js.map +1 -0
- package/dist/components/tool-execution-indicator.d.ts +3 -0
- package/dist/components/tool-execution-indicator.d.ts.map +1 -0
- package/dist/components/tool-execution-indicator.js +9 -0
- package/dist/components/tool-execution-indicator.js.map +1 -0
- package/dist/components/tool-message.d.ts +10 -0
- package/dist/components/tool-message.d.ts.map +1 -0
- package/dist/components/tool-message.js +16 -0
- package/dist/components/tool-message.js.map +1 -0
- package/dist/components/update-message.d.ts +7 -0
- package/dist/components/update-message.d.ts.map +1 -0
- package/dist/components/update-message.js +93 -0
- package/dist/components/update-message.js.map +1 -0
- package/dist/components/user-input.d.ts +10 -0
- package/dist/components/user-input.d.ts.map +1 -0
- package/dist/components/user-input.js +188 -0
- package/dist/components/user-input.js.map +1 -0
- package/dist/components/user-message.d.ts +4 -0
- package/dist/components/user-message.d.ts.map +1 -0
- package/dist/components/user-message.js +15 -0
- package/dist/components/user-message.js.map +1 -0
- package/dist/components/welcome-message.d.ts +3 -0
- package/dist/components/welcome-message.d.ts.map +1 -0
- package/dist/components/welcome-message.js +21 -0
- package/dist/components/welcome-message.js.map +1 -0
- package/dist/config/index.d.ts +10 -0
- package/dist/config/index.d.ts.map +1 -0
- package/dist/config/index.js +44 -0
- package/dist/config/index.js.map +1 -0
- package/dist/config/logging.d.ts +14 -0
- package/dist/config/logging.d.ts.map +1 -0
- package/dist/config/logging.js +58 -0
- package/dist/config/logging.js.map +1 -0
- package/dist/config/preferences.d.ts +7 -0
- package/dist/config/preferences.d.ts.map +1 -0
- package/dist/config/preferences.js +46 -0
- package/dist/config/preferences.js.map +1 -0
- package/dist/config/themes.d.ts +6 -0
- package/dist/config/themes.d.ts.map +1 -0
- package/dist/config/themes.js +295 -0
- package/dist/config/themes.js.map +1 -0
- package/dist/custom-commands/executor.d.ts +12 -0
- package/dist/custom-commands/executor.d.ts.map +1 -0
- package/dist/custom-commands/executor.js +45 -0
- package/dist/custom-commands/executor.js.map +1 -0
- package/dist/custom-commands/index.d.ts +4 -0
- package/dist/custom-commands/index.d.ts.map +1 -0
- package/dist/custom-commands/index.js +4 -0
- package/dist/custom-commands/index.js.map +1 -0
- package/dist/custom-commands/loader.d.ts +41 -0
- package/dist/custom-commands/loader.d.ts.map +1 -0
- package/dist/custom-commands/loader.js +129 -0
- package/dist/custom-commands/loader.js.map +1 -0
- package/dist/custom-commands/parser.d.ts +10 -0
- package/dist/custom-commands/parser.d.ts.map +1 -0
- package/dist/custom-commands/parser.js +181 -0
- package/dist/custom-commands/parser.js.map +1 -0
- package/dist/hooks/useInputState.d.ts +14 -0
- package/dist/hooks/useInputState.d.ts.map +1 -0
- package/dist/hooks/useInputState.js +66 -0
- package/dist/hooks/useInputState.js.map +1 -0
- package/dist/hooks/useTerminalWidth.d.ts +2 -0
- package/dist/hooks/useTerminalWidth.d.ts.map +1 -0
- package/dist/hooks/useTerminalWidth.js +20 -0
- package/dist/hooks/useTerminalWidth.js.map +1 -0
- package/dist/hooks/useTheme.d.ts +9 -0
- package/dist/hooks/useTheme.d.ts.map +1 -0
- package/dist/hooks/useTheme.js +10 -0
- package/dist/hooks/useTheme.js.map +1 -0
- package/dist/hooks/useUIState.d.ts +19 -0
- package/dist/hooks/useUIState.d.ts.map +1 -0
- package/dist/hooks/useUIState.js +46 -0
- package/dist/hooks/useUIState.js.map +1 -0
- package/dist/init/agents-template-generator.d.ts +29 -0
- package/dist/init/agents-template-generator.d.ts.map +1 -0
- package/dist/init/agents-template-generator.js +340 -0
- package/dist/init/agents-template-generator.js.map +1 -0
- package/dist/init/existing-rules-extractor.d.ts +43 -0
- package/dist/init/existing-rules-extractor.d.ts.map +1 -0
- package/dist/init/existing-rules-extractor.js +226 -0
- package/dist/init/existing-rules-extractor.js.map +1 -0
- package/dist/init/file-scanner.d.ts +40 -0
- package/dist/init/file-scanner.d.ts.map +1 -0
- package/dist/init/file-scanner.js +153 -0
- package/dist/init/file-scanner.js.map +1 -0
- package/dist/init/framework-detector.d.ts +57 -0
- package/dist/init/framework-detector.d.ts.map +1 -0
- package/dist/init/framework-detector.js +277 -0
- package/dist/init/framework-detector.js.map +1 -0
- package/dist/init/language-detector.d.ts +31 -0
- package/dist/init/language-detector.d.ts.map +1 -0
- package/dist/init/language-detector.js +205 -0
- package/dist/init/language-detector.js.map +1 -0
- package/dist/init/project-analyzer.d.ts +62 -0
- package/dist/init/project-analyzer.d.ts.map +1 -0
- package/dist/init/project-analyzer.js +294 -0
- package/dist/init/project-analyzer.js.map +1 -0
- package/dist/langgraph-client.d.ts +20 -0
- package/dist/langgraph-client.d.ts.map +1 -0
- package/dist/langgraph-client.js +245 -0
- package/dist/langgraph-client.js.map +1 -0
- package/dist/mcp/mcp-client.d.ts +23 -0
- package/dist/mcp/mcp-client.d.ts.map +1 -0
- package/dist/mcp/mcp-client.js +194 -0
- package/dist/mcp/mcp-client.js.map +1 -0
- package/dist/mcp/mcp-tool-adapter.d.ts +22 -0
- package/dist/mcp/mcp-tool-adapter.d.ts.map +1 -0
- package/dist/mcp/mcp-tool-adapter.js +49 -0
- package/dist/mcp/mcp-tool-adapter.js.map +1 -0
- package/dist/message-handler.d.ts +7 -0
- package/dist/message-handler.d.ts.map +1 -0
- package/dist/message-handler.js +53 -0
- package/dist/message-handler.js.map +1 -0
- package/dist/prompt-history.d.ts +14 -0
- package/dist/prompt-history.d.ts.map +1 -0
- package/dist/prompt-history.js +88 -0
- package/dist/prompt-history.js.map +1 -0
- package/dist/tool-calling/index.d.ts +6 -0
- package/dist/tool-calling/index.d.ts.map +1 -0
- package/dist/tool-calling/index.js +5 -0
- package/dist/tool-calling/index.js.map +1 -0
- package/dist/tool-calling/json-parser.d.ts +7 -0
- package/dist/tool-calling/json-parser.d.ts.map +1 -0
- package/dist/tool-calling/json-parser.js +168 -0
- package/dist/tool-calling/json-parser.js.map +1 -0
- package/dist/tool-calling/xml-parser.d.ts +34 -0
- package/dist/tool-calling/xml-parser.d.ts.map +1 -0
- package/dist/tool-calling/xml-parser.js +113 -0
- package/dist/tool-calling/xml-parser.js.map +1 -0
- package/dist/tools/create-file.d.ts +3 -0
- package/dist/tools/create-file.d.ts.map +1 -0
- package/dist/tools/create-file.js +66 -0
- package/dist/tools/create-file.js.map +1 -0
- package/dist/tools/delete-lines.d.ts +3 -0
- package/dist/tools/delete-lines.d.ts.map +1 -0
- package/dist/tools/delete-lines.js +218 -0
- package/dist/tools/delete-lines.js.map +1 -0
- package/dist/tools/execute-bash.d.ts +3 -0
- package/dist/tools/execute-bash.d.ts.map +1 -0
- package/dist/tools/execute-bash.js +107 -0
- package/dist/tools/execute-bash.js.map +1 -0
- package/dist/tools/index.d.ts +7 -0
- package/dist/tools/index.d.ts.map +1 -0
- package/dist/tools/index.js +23 -0
- package/dist/tools/index.js.map +1 -0
- package/dist/tools/insert-lines.d.ts +3 -0
- package/dist/tools/insert-lines.d.ts.map +1 -0
- package/dist/tools/insert-lines.js +185 -0
- package/dist/tools/insert-lines.js.map +1 -0
- package/dist/tools/read-file.d.ts +3 -0
- package/dist/tools/read-file.d.ts.map +1 -0
- package/dist/tools/read-file.js +81 -0
- package/dist/tools/read-file.js.map +1 -0
- package/dist/tools/read-many-files.d.ts +3 -0
- package/dist/tools/read-many-files.d.ts.map +1 -0
- package/dist/tools/read-many-files.js +109 -0
- package/dist/tools/read-many-files.js.map +1 -0
- package/dist/tools/replace-lines.d.ts +3 -0
- package/dist/tools/replace-lines.d.ts.map +1 -0
- package/dist/tools/replace-lines.js +220 -0
- package/dist/tools/replace-lines.js.map +1 -0
- package/dist/tools/tool-manager.d.ts +54 -0
- package/dist/tools/tool-manager.d.ts.map +1 -0
- package/dist/tools/tool-manager.js +108 -0
- package/dist/tools/tool-manager.js.map +1 -0
- package/dist/types/app.d.ts +46 -0
- package/dist/types/app.d.ts.map +1 -0
- package/dist/types/app.js +2 -0
- package/dist/types/app.js.map +1 -0
- package/dist/types/commands.d.ts +36 -0
- package/dist/types/commands.d.ts.map +1 -0
- package/dist/types/commands.js +2 -0
- package/dist/types/commands.js.map +1 -0
- package/dist/types/components.d.ts +87 -0
- package/dist/types/components.d.ts.map +1 -0
- package/dist/types/components.js +2 -0
- package/dist/types/components.js.map +1 -0
- package/dist/types/config.d.ts +35 -0
- package/dist/types/config.d.ts.map +1 -0
- package/dist/types/config.js +2 -0
- package/dist/types/config.js.map +1 -0
- package/dist/types/core.d.ts +57 -0
- package/dist/types/core.d.ts.map +1 -0
- package/dist/types/core.js +2 -0
- package/dist/types/core.js.map +1 -0
- package/dist/types/hooks.d.ts +26 -0
- package/dist/types/hooks.d.ts.map +1 -0
- package/dist/types/hooks.js +2 -0
- package/dist/types/hooks.js.map +1 -0
- package/dist/types/index.d.ts +11 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/index.js +12 -0
- package/dist/types/index.js.map +1 -0
- package/dist/types/mcp.d.ts +19 -0
- package/dist/types/mcp.d.ts.map +1 -0
- package/dist/types/mcp.js +2 -0
- package/dist/types/mcp.js.map +1 -0
- package/dist/types/tools.d.ts +31 -0
- package/dist/types/tools.d.ts.map +1 -0
- package/dist/types/tools.js +2 -0
- package/dist/types/tools.js.map +1 -0
- package/dist/types/ui.d.ts +22 -0
- package/dist/types/ui.d.ts.map +1 -0
- package/dist/types/ui.js +2 -0
- package/dist/types/ui.js.map +1 -0
- package/dist/types/utils.d.ts +19 -0
- package/dist/types/utils.d.ts.map +1 -0
- package/dist/types/utils.js +2 -0
- package/dist/types/utils.js.map +1 -0
- package/dist/utils/message-queue.d.ts +8 -0
- package/dist/utils/message-queue.d.ts.map +1 -0
- package/dist/utils/message-queue.js +50 -0
- package/dist/utils/message-queue.js.map +1 -0
- package/dist/utils/programming-language-helper.d.ts +2 -0
- package/dist/utils/programming-language-helper.d.ts.map +1 -0
- package/dist/utils/programming-language-helper.js +32 -0
- package/dist/utils/programming-language-helper.js.map +1 -0
- package/dist/utils/prompt-processor.d.ts +6 -0
- package/dist/utils/prompt-processor.d.ts.map +1 -0
- package/dist/utils/prompt-processor.js +103 -0
- package/dist/utils/prompt-processor.js.map +1 -0
- package/dist/utils/update-checker.d.ts +6 -0
- package/dist/utils/update-checker.d.ts.map +1 -0
- package/dist/utils/update-checker.js +120 -0
- package/dist/utils/update-checker.js.map +1 -0
- package/package.json +97 -0
- package/source/app/prompts/main-prompt.md +107 -0
|
@@ -0,0 +1,340 @@
|
|
|
1
|
+
import { ExistingRulesExtractor } from './existing-rules-extractor.js';
|
|
2
|
+
export class AgentsTemplateGenerator {
|
|
3
|
+
/**
|
|
4
|
+
* Generate AGENTS.md content based on project analysis
|
|
5
|
+
*/
|
|
6
|
+
static generateAgentsMd(analysis, existingRules) {
|
|
7
|
+
const sections = [];
|
|
8
|
+
// Header
|
|
9
|
+
sections.push('# AGENTS.md');
|
|
10
|
+
sections.push('');
|
|
11
|
+
sections.push(`AI coding agent instructions for **${analysis.projectName}**`);
|
|
12
|
+
sections.push('');
|
|
13
|
+
// Project Overview
|
|
14
|
+
sections.push('## Project Overview');
|
|
15
|
+
sections.push('');
|
|
16
|
+
if (analysis.description) {
|
|
17
|
+
sections.push(analysis.description);
|
|
18
|
+
sections.push('');
|
|
19
|
+
}
|
|
20
|
+
sections.push(`**Project Type:** ${analysis.projectType}`);
|
|
21
|
+
if (analysis.languages.primary) {
|
|
22
|
+
sections.push(`**Primary Language:** ${analysis.languages.primary.name} (${analysis.languages.primary.percentage}% of codebase)`);
|
|
23
|
+
}
|
|
24
|
+
if (analysis.languages.secondary.length > 0) {
|
|
25
|
+
const secondaryLangs = analysis.languages.secondary
|
|
26
|
+
.map(lang => `${lang.name} (${lang.percentage}%)`)
|
|
27
|
+
.join(', ');
|
|
28
|
+
sections.push(`**Secondary Languages:** ${secondaryLangs}`);
|
|
29
|
+
}
|
|
30
|
+
sections.push('');
|
|
31
|
+
// Architecture Summary
|
|
32
|
+
if (analysis.dependencies.frameworks.length > 0 || analysis.structure.importantDirectories.length > 0) {
|
|
33
|
+
sections.push('## Architecture');
|
|
34
|
+
sections.push('');
|
|
35
|
+
if (analysis.dependencies.frameworks.length > 0) {
|
|
36
|
+
sections.push('**Key Frameworks & Libraries:**');
|
|
37
|
+
for (const framework of analysis.dependencies.frameworks) {
|
|
38
|
+
const version = framework.version ? ` (${framework.version})` : '';
|
|
39
|
+
sections.push(`- ${framework.name}${version} - ${framework.category}`);
|
|
40
|
+
}
|
|
41
|
+
sections.push('');
|
|
42
|
+
}
|
|
43
|
+
if (analysis.structure.importantDirectories.length > 0) {
|
|
44
|
+
sections.push('**Project Structure:**');
|
|
45
|
+
for (const dir of analysis.structure.importantDirectories.slice(0, 20)) {
|
|
46
|
+
sections.push(`- \`${dir}/\` - ${this.getDirectoryDescription(dir)}`);
|
|
47
|
+
}
|
|
48
|
+
sections.push('');
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
// Key Files
|
|
52
|
+
if (Object.values(analysis.keyFiles).some(files => files.length > 0)) {
|
|
53
|
+
sections.push('## Key Files');
|
|
54
|
+
sections.push('');
|
|
55
|
+
if (analysis.keyFiles.config.length > 0) {
|
|
56
|
+
sections.push('**Configuration:**');
|
|
57
|
+
analysis.keyFiles.config.slice(0, 5).forEach(file => {
|
|
58
|
+
sections.push(`- \`${file}\` - ${this.getFileDescription(file)}`);
|
|
59
|
+
});
|
|
60
|
+
sections.push('');
|
|
61
|
+
}
|
|
62
|
+
if (analysis.keyFiles.documentation.length > 0) {
|
|
63
|
+
sections.push('**Documentation:**');
|
|
64
|
+
analysis.keyFiles.documentation.slice(0, 3).forEach(file => {
|
|
65
|
+
sections.push(`- \`${file}\``);
|
|
66
|
+
});
|
|
67
|
+
sections.push('');
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
// Build and Test Commands
|
|
71
|
+
if (Object.keys(analysis.buildCommands).length > 0) {
|
|
72
|
+
sections.push('## Development Commands');
|
|
73
|
+
sections.push('');
|
|
74
|
+
for (const [action, command] of Object.entries(analysis.buildCommands)) {
|
|
75
|
+
sections.push(`**${action}:**`);
|
|
76
|
+
sections.push('```bash');
|
|
77
|
+
sections.push(command);
|
|
78
|
+
sections.push('```');
|
|
79
|
+
sections.push('');
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
// Code Style Guidelines
|
|
83
|
+
const conventions = this.getCodingConventions(analysis);
|
|
84
|
+
if (conventions.length > 0) {
|
|
85
|
+
sections.push('## Code Style Guidelines');
|
|
86
|
+
sections.push('');
|
|
87
|
+
for (const convention of conventions) {
|
|
88
|
+
sections.push(`- ${convention}`);
|
|
89
|
+
}
|
|
90
|
+
sections.push('');
|
|
91
|
+
}
|
|
92
|
+
// Testing Instructions
|
|
93
|
+
if (analysis.dependencies.testingFrameworks.length > 0 || analysis.keyFiles.test.length > 0) {
|
|
94
|
+
sections.push('## Testing');
|
|
95
|
+
sections.push('');
|
|
96
|
+
if (analysis.dependencies.testingFrameworks.length > 0) {
|
|
97
|
+
sections.push(`**Testing Frameworks:** ${analysis.dependencies.testingFrameworks.join(', ')}`);
|
|
98
|
+
sections.push('');
|
|
99
|
+
}
|
|
100
|
+
if (analysis.buildCommands.Test) {
|
|
101
|
+
sections.push('**Run Tests:**');
|
|
102
|
+
sections.push('```bash');
|
|
103
|
+
sections.push(analysis.buildCommands.Test);
|
|
104
|
+
sections.push('```');
|
|
105
|
+
sections.push('');
|
|
106
|
+
}
|
|
107
|
+
if (analysis.keyFiles.test.length > 0) {
|
|
108
|
+
sections.push('**Test Files:**');
|
|
109
|
+
analysis.keyFiles.test.slice(0, 5).forEach(file => {
|
|
110
|
+
sections.push(`- \`${file}\``);
|
|
111
|
+
});
|
|
112
|
+
sections.push('');
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
// Existing AI rules and guidelines
|
|
116
|
+
if (existingRules && existingRules.length > 0) {
|
|
117
|
+
const mergedRules = ExistingRulesExtractor.mergeExistingRules(existingRules);
|
|
118
|
+
if (mergedRules.trim()) {
|
|
119
|
+
sections.push(mergedRules);
|
|
120
|
+
sections.push('');
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
// Special Considerations for AI
|
|
124
|
+
sections.push('## AI Coding Assistance Notes');
|
|
125
|
+
sections.push('');
|
|
126
|
+
sections.push('**Important Considerations:**');
|
|
127
|
+
// Language-specific notes
|
|
128
|
+
if (analysis.languages.primary) {
|
|
129
|
+
const langNotes = this.getLanguageSpecificNotes(analysis.languages.primary.name);
|
|
130
|
+
langNotes.forEach(note => sections.push(`- ${note}`));
|
|
131
|
+
}
|
|
132
|
+
// Framework-specific notes
|
|
133
|
+
for (const framework of analysis.dependencies.frameworks.slice(0, 3)) {
|
|
134
|
+
const frameworkNotes = this.getFrameworkSpecificNotes(framework.name);
|
|
135
|
+
frameworkNotes.forEach(note => sections.push(`- ${note}`));
|
|
136
|
+
}
|
|
137
|
+
// General notes
|
|
138
|
+
sections.push(`- Project has ${analysis.structure.scannedFiles} files across ${analysis.structure.directories.length} directories`);
|
|
139
|
+
if (analysis.structure.scannedFiles >= 500) {
|
|
140
|
+
sections.push('- Large codebase: Focus on specific areas when making changes');
|
|
141
|
+
}
|
|
142
|
+
if (analysis.keyFiles.build.length > 0) {
|
|
143
|
+
sections.push('- Check build configuration files before making structural changes');
|
|
144
|
+
}
|
|
145
|
+
sections.push('');
|
|
146
|
+
// Repository info
|
|
147
|
+
if (analysis.repository) {
|
|
148
|
+
sections.push('## Repository');
|
|
149
|
+
sections.push('');
|
|
150
|
+
sections.push(`**Source:** ${analysis.repository}`);
|
|
151
|
+
sections.push('');
|
|
152
|
+
}
|
|
153
|
+
// Footer
|
|
154
|
+
sections.push('---');
|
|
155
|
+
sections.push('');
|
|
156
|
+
sections.push('*This AGENTS.md file was generated by Nanocoder. Update it as your project evolves.*');
|
|
157
|
+
return sections.join('\n');
|
|
158
|
+
}
|
|
159
|
+
/**
|
|
160
|
+
* Get description for a directory based on its name
|
|
161
|
+
*/
|
|
162
|
+
static getDirectoryDescription(dir) {
|
|
163
|
+
const dirName = dir.split('/').pop()?.toLowerCase() || '';
|
|
164
|
+
const descriptions = {
|
|
165
|
+
'src': 'Source code',
|
|
166
|
+
'source': 'Source code',
|
|
167
|
+
'app': 'Application code',
|
|
168
|
+
'lib': 'Library code',
|
|
169
|
+
'libs': 'Libraries',
|
|
170
|
+
'components': 'React/UI components',
|
|
171
|
+
'pages': 'Page components',
|
|
172
|
+
'views': 'View components',
|
|
173
|
+
'routes': 'Routing logic',
|
|
174
|
+
'api': 'API endpoints',
|
|
175
|
+
'server': 'Server code',
|
|
176
|
+
'backend': 'Backend code',
|
|
177
|
+
'frontend': 'Frontend code',
|
|
178
|
+
'models': 'Data models',
|
|
179
|
+
'controllers': 'Controllers',
|
|
180
|
+
'services': 'Service layer',
|
|
181
|
+
'utils': 'Utility functions',
|
|
182
|
+
'config': 'Configuration files',
|
|
183
|
+
'configs': 'Configuration files',
|
|
184
|
+
'settings': 'Settings',
|
|
185
|
+
'assets': 'Static assets',
|
|
186
|
+
'static': 'Static files',
|
|
187
|
+
'public': 'Public assets',
|
|
188
|
+
'docs': 'Documentation',
|
|
189
|
+
'documentation': 'Documentation',
|
|
190
|
+
'test': 'Test files',
|
|
191
|
+
'tests': 'Test files',
|
|
192
|
+
'__tests__': 'Test files',
|
|
193
|
+
'spec': 'Test specifications'
|
|
194
|
+
};
|
|
195
|
+
return descriptions[dirName] || 'Project files';
|
|
196
|
+
}
|
|
197
|
+
/**
|
|
198
|
+
* Get description for a file based on its name
|
|
199
|
+
*/
|
|
200
|
+
static getFileDescription(file) {
|
|
201
|
+
const fileName = file.toLowerCase();
|
|
202
|
+
if (fileName.includes('package.json'))
|
|
203
|
+
return 'Node.js dependencies and scripts';
|
|
204
|
+
if (fileName.includes('cargo.toml'))
|
|
205
|
+
return 'Rust package configuration';
|
|
206
|
+
if (fileName.includes('go.mod'))
|
|
207
|
+
return 'Go module dependencies';
|
|
208
|
+
if (fileName.includes('requirements.txt'))
|
|
209
|
+
return 'Python dependencies';
|
|
210
|
+
if (fileName.includes('tsconfig.json'))
|
|
211
|
+
return 'TypeScript configuration';
|
|
212
|
+
if (fileName.includes('webpack'))
|
|
213
|
+
return 'Webpack build configuration';
|
|
214
|
+
if (fileName.includes('vite'))
|
|
215
|
+
return 'Vite build configuration';
|
|
216
|
+
if (fileName.includes('rollup'))
|
|
217
|
+
return 'Rollup build configuration';
|
|
218
|
+
if (fileName.includes('docker'))
|
|
219
|
+
return 'Docker configuration';
|
|
220
|
+
if (fileName.includes('makefile'))
|
|
221
|
+
return 'Build automation';
|
|
222
|
+
return 'Configuration file';
|
|
223
|
+
}
|
|
224
|
+
/**
|
|
225
|
+
* Get coding conventions based on project analysis
|
|
226
|
+
*/
|
|
227
|
+
static getCodingConventions(analysis) {
|
|
228
|
+
const conventions = [];
|
|
229
|
+
if (analysis.languages.primary) {
|
|
230
|
+
const lang = analysis.languages.primary.name;
|
|
231
|
+
switch (lang) {
|
|
232
|
+
case 'JavaScript':
|
|
233
|
+
case 'TypeScript':
|
|
234
|
+
conventions.push('Use camelCase for variables and functions');
|
|
235
|
+
conventions.push('Use PascalCase for classes and components');
|
|
236
|
+
conventions.push('Prefer const/let over var');
|
|
237
|
+
conventions.push('Use async/await over callbacks when possible');
|
|
238
|
+
if (analysis.dependencies.frameworks.some(f => f.name.includes('React'))) {
|
|
239
|
+
conventions.push('Use functional components with hooks');
|
|
240
|
+
conventions.push('Follow React naming conventions for components');
|
|
241
|
+
}
|
|
242
|
+
break;
|
|
243
|
+
case 'Python':
|
|
244
|
+
conventions.push('Follow PEP 8 style guide');
|
|
245
|
+
conventions.push('Use snake_case for variables and functions');
|
|
246
|
+
conventions.push('Use PascalCase for classes');
|
|
247
|
+
conventions.push('Include docstrings for functions and classes');
|
|
248
|
+
conventions.push('Use type hints where appropriate');
|
|
249
|
+
break;
|
|
250
|
+
case 'Rust':
|
|
251
|
+
conventions.push('Follow Rust naming conventions (snake_case)');
|
|
252
|
+
conventions.push('Use cargo fmt for code formatting');
|
|
253
|
+
conventions.push('Handle errors explicitly with Result<T, E>');
|
|
254
|
+
conventions.push('Prefer owned types over references when possible');
|
|
255
|
+
break;
|
|
256
|
+
case 'Go':
|
|
257
|
+
conventions.push('Follow Go naming conventions');
|
|
258
|
+
conventions.push('Use gofmt for formatting');
|
|
259
|
+
conventions.push('Handle errors explicitly');
|
|
260
|
+
conventions.push('Use interfaces for abstraction');
|
|
261
|
+
conventions.push('Keep functions and methods concise');
|
|
262
|
+
break;
|
|
263
|
+
case 'Java':
|
|
264
|
+
conventions.push('Follow Java naming conventions');
|
|
265
|
+
conventions.push('Use camelCase for methods and variables');
|
|
266
|
+
conventions.push('Use PascalCase for classes');
|
|
267
|
+
conventions.push('Include JavaDoc for public methods');
|
|
268
|
+
break;
|
|
269
|
+
}
|
|
270
|
+
}
|
|
271
|
+
return conventions;
|
|
272
|
+
}
|
|
273
|
+
/**
|
|
274
|
+
* Get language-specific notes for AI assistance
|
|
275
|
+
*/
|
|
276
|
+
static getLanguageSpecificNotes(language) {
|
|
277
|
+
switch (language) {
|
|
278
|
+
case 'JavaScript':
|
|
279
|
+
case 'TypeScript':
|
|
280
|
+
return [
|
|
281
|
+
'Check package.json for available scripts before running commands',
|
|
282
|
+
'Be aware of Node.js version requirements',
|
|
283
|
+
'Consider impact on bundle size when adding dependencies'
|
|
284
|
+
];
|
|
285
|
+
case 'Python':
|
|
286
|
+
return [
|
|
287
|
+
'Check virtual environment setup before running commands',
|
|
288
|
+
'Be mindful of Python version compatibility',
|
|
289
|
+
'Follow import organization (stdlib, third-party, local)'
|
|
290
|
+
];
|
|
291
|
+
case 'Rust':
|
|
292
|
+
return [
|
|
293
|
+
'Run cargo check before cargo build for faster feedback',
|
|
294
|
+
'Consider memory safety and ownership when suggesting changes',
|
|
295
|
+
'Use cargo clippy for additional linting'
|
|
296
|
+
];
|
|
297
|
+
case 'Go':
|
|
298
|
+
return [
|
|
299
|
+
'Run go mod tidy after adding dependencies',
|
|
300
|
+
'Consider goroutine usage for concurrent operations',
|
|
301
|
+
'Follow Go idioms for error handling'
|
|
302
|
+
];
|
|
303
|
+
default:
|
|
304
|
+
return [
|
|
305
|
+
'Check project documentation for specific conventions',
|
|
306
|
+
'Test changes thoroughly before committing'
|
|
307
|
+
];
|
|
308
|
+
}
|
|
309
|
+
}
|
|
310
|
+
/**
|
|
311
|
+
* Get framework-specific notes for AI assistance
|
|
312
|
+
*/
|
|
313
|
+
static getFrameworkSpecificNotes(framework) {
|
|
314
|
+
switch (framework) {
|
|
315
|
+
case 'React':
|
|
316
|
+
return [
|
|
317
|
+
'Follow React hooks best practices',
|
|
318
|
+
'Consider component reusability when creating new components'
|
|
319
|
+
];
|
|
320
|
+
case 'Next.js':
|
|
321
|
+
return [
|
|
322
|
+
'Be aware of SSR/SSG implications when making changes',
|
|
323
|
+
'Check routing structure before adding new pages'
|
|
324
|
+
];
|
|
325
|
+
case 'Django':
|
|
326
|
+
return [
|
|
327
|
+
'Run migrations after model changes',
|
|
328
|
+
'Follow Django project structure conventions'
|
|
329
|
+
];
|
|
330
|
+
case 'Express.js':
|
|
331
|
+
return [
|
|
332
|
+
'Consider middleware order when adding new routes',
|
|
333
|
+
'Use proper error handling middleware'
|
|
334
|
+
];
|
|
335
|
+
default:
|
|
336
|
+
return [];
|
|
337
|
+
}
|
|
338
|
+
}
|
|
339
|
+
}
|
|
340
|
+
//# sourceMappingURL=agents-template-generator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agents-template-generator.js","sourceRoot":"","sources":["../../source/init/agents-template-generator.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,sBAAsB,EAAsB,MAAM,+BAA+B,CAAC;AAE3F,MAAM,OAAO,uBAAuB;IAClC;;OAEG;IACI,MAAM,CAAC,gBAAgB,CAAC,QAAyB,EAAE,aAA+B;QACvF,MAAM,QAAQ,GAAa,EAAE,CAAC;QAE9B,SAAS;QACT,QAAQ,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;QAC7B,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QAClB,QAAQ,CAAC,IAAI,CAAC,sCAAsC,QAAQ,CAAC,WAAW,IAAI,CAAC,CAAC;QAC9E,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QAElB,mBAAmB;QACnB,QAAQ,CAAC,IAAI,CAAC,qBAAqB,CAAC,CAAC;QACrC,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QAClB,IAAI,QAAQ,CAAC,WAAW,EAAE,CAAC;YACzB,QAA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CAAC;YAEJ,KAAK,YAAY;gBACf,OAAO;oBACL,kDAAkD;oBAClD,sCAAsC;iBACvC,CAAC;YAEJ;gBACE,OAAO,EAAE,CAAC;QACd,CAAC;IACH,CAAC;CACF"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
export interface ExistingRules {
|
|
2
|
+
source: string;
|
|
3
|
+
content: string;
|
|
4
|
+
type: 'agents' | 'rules' | 'instructions';
|
|
5
|
+
}
|
|
6
|
+
export declare class ExistingRulesExtractor {
|
|
7
|
+
private projectPath;
|
|
8
|
+
private static readonly AI_CONFIG_FILES;
|
|
9
|
+
constructor(projectPath: string);
|
|
10
|
+
/**
|
|
11
|
+
* Find and extract content from existing AI configuration files
|
|
12
|
+
*/
|
|
13
|
+
extractExistingRules(): ExistingRules[];
|
|
14
|
+
/**
|
|
15
|
+
* Clean content and extract only AI-relevant information
|
|
16
|
+
*/
|
|
17
|
+
private cleanAndExtractRelevantContent;
|
|
18
|
+
/**
|
|
19
|
+
* Extract AI agent specific sections
|
|
20
|
+
*/
|
|
21
|
+
private extractAIAgentSections;
|
|
22
|
+
/**
|
|
23
|
+
* Extract rules file content
|
|
24
|
+
*/
|
|
25
|
+
private extractRulesSections;
|
|
26
|
+
/**
|
|
27
|
+
* Extract general instructions from any file
|
|
28
|
+
*/
|
|
29
|
+
private extractGeneralInstructions;
|
|
30
|
+
/**
|
|
31
|
+
* Extract key paragraphs based on content analysis
|
|
32
|
+
*/
|
|
33
|
+
private extractKeyParagraphs;
|
|
34
|
+
/**
|
|
35
|
+
* Determine the type of configuration file
|
|
36
|
+
*/
|
|
37
|
+
private determineFileType;
|
|
38
|
+
/**
|
|
39
|
+
* Merge existing rules into a single consolidated section
|
|
40
|
+
*/
|
|
41
|
+
static mergeExistingRules(existingRules: ExistingRules[]): string;
|
|
42
|
+
}
|
|
43
|
+
//# sourceMappingURL=existing-rules-extractor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"existing-rules-extractor.d.ts","sourceRoot":"","sources":["../../source/init/existing-rules-extractor.ts"],"names":[],"mappings":"AAGA,MAAM,WAAW,aAAa;IAC5B,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,QAAQ,GAAG,OAAO,GAAG,cAAc,CAAC;CAC3C;AAED,qBAAa,sBAAsB;IAsBrB,OAAO,CAAC,WAAW;IArB/B,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,eAAe,CAmBrC;gBAEkB,WAAW,EAAE,MAAM;IAEvC;;OAEG;IACI,oBAAoB,IAAI,aAAa,EAAE;IA4B9C;;OAEG;IACH,OAAO,CAAC,8BAA8B;IAuBtC;;OAEG;IACH,OAAO,CAAC,sBAAsB;IA8C9B;;OAEG;IACH,OAAO,CAAC,oBAAoB;IAe5B;;OAEG;IACH,OAAO,CAAC,0BAA0B;IAIlC;;OAEG;IACH,OAAO,CAAC,oBAAoB;IA8B5B;;OAEG;IACH,OAAO,CAAC,iBAAiB;IAczB;;OAEG;WACW,kBAAkB,CAAC,aAAa,EAAE,aAAa,EAAE,GAAG,MAAM;CAgDzE"}
|
|
@@ -0,0 +1,226 @@
|
|
|
1
|
+
import { readFileSync, existsSync } from 'fs';
|
|
2
|
+
import { join } from 'path';
|
|
3
|
+
export class ExistingRulesExtractor {
|
|
4
|
+
projectPath;
|
|
5
|
+
static AI_CONFIG_FILES = [
|
|
6
|
+
// AI agent specific files
|
|
7
|
+
'AGENTS.md',
|
|
8
|
+
'AGENT.md',
|
|
9
|
+
'CLAUDE.md',
|
|
10
|
+
'GEMINI.md',
|
|
11
|
+
'CURSOR.md',
|
|
12
|
+
// Rules files in various directories
|
|
13
|
+
'.cursor/rules',
|
|
14
|
+
'.clinerules/rules',
|
|
15
|
+
'.roorules/rules',
|
|
16
|
+
// Alternative locations
|
|
17
|
+
'.ai/rules',
|
|
18
|
+
'.ai/instructions',
|
|
19
|
+
'ai-instructions.md',
|
|
20
|
+
'coding-guidelines.md',
|
|
21
|
+
'dev-guidelines.md'
|
|
22
|
+
];
|
|
23
|
+
constructor(projectPath) {
|
|
24
|
+
this.projectPath = projectPath;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Find and extract content from existing AI configuration files
|
|
28
|
+
*/
|
|
29
|
+
extractExistingRules() {
|
|
30
|
+
const found = [];
|
|
31
|
+
for (const configFile of ExistingRulesExtractor.AI_CONFIG_FILES) {
|
|
32
|
+
const filePath = join(this.projectPath, configFile);
|
|
33
|
+
if (existsSync(filePath)) {
|
|
34
|
+
try {
|
|
35
|
+
const content = readFileSync(filePath, 'utf-8');
|
|
36
|
+
const cleanContent = this.cleanAndExtractRelevantContent(content, configFile);
|
|
37
|
+
if (cleanContent.trim()) {
|
|
38
|
+
found.push({
|
|
39
|
+
source: configFile,
|
|
40
|
+
content: cleanContent,
|
|
41
|
+
type: this.determineFileType(configFile)
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
catch (error) {
|
|
46
|
+
// Skip files we can't read
|
|
47
|
+
continue;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
return found;
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Clean content and extract only AI-relevant information
|
|
55
|
+
*/
|
|
56
|
+
cleanAndExtractRelevantContent(content, filename) {
|
|
57
|
+
// Remove excessive markdown formatting but keep structure
|
|
58
|
+
let cleaned = content;
|
|
59
|
+
// Remove multiple consecutive empty lines
|
|
60
|
+
cleaned = cleaned.replace(/\n\s*\n\s*\n/g, '\n\n');
|
|
61
|
+
// Remove excessive header decoration
|
|
62
|
+
cleaned = cleaned.replace(/#{4,}/g, '###');
|
|
63
|
+
// For specific file types, extract relevant sections
|
|
64
|
+
if (filename.toLowerCase().includes('claude') || filename.toLowerCase().includes('agents')) {
|
|
65
|
+
return this.extractAIAgentSections(cleaned);
|
|
66
|
+
}
|
|
67
|
+
if (filename.includes('rules')) {
|
|
68
|
+
return this.extractRulesSections(cleaned);
|
|
69
|
+
}
|
|
70
|
+
// For generic files, extract key sections
|
|
71
|
+
return this.extractGeneralInstructions(cleaned);
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* Extract AI agent specific sections
|
|
75
|
+
*/
|
|
76
|
+
extractAIAgentSections(content) {
|
|
77
|
+
const relevantSections = [];
|
|
78
|
+
const lines = content.split('\n');
|
|
79
|
+
let currentSection = '';
|
|
80
|
+
let inRelevantSection = false;
|
|
81
|
+
let sectionHeader = '';
|
|
82
|
+
const relevantHeaders = [
|
|
83
|
+
'coding', 'style', 'convention', 'pattern', 'architecture',
|
|
84
|
+
'testing', 'security', 'performance', 'build', 'deployment',
|
|
85
|
+
'project', 'structure', 'guidelines', 'rules', 'instructions',
|
|
86
|
+
'important', 'note', 'requirement', 'constraint'
|
|
87
|
+
];
|
|
88
|
+
for (const line of lines) {
|
|
89
|
+
const trimmed = line.trim().toLowerCase();
|
|
90
|
+
// Check if this is a header
|
|
91
|
+
if (line.match(/^#+\s/) || line.match(/^[=\-]{3,}$/)) {
|
|
92
|
+
// Save previous section if it was relevant
|
|
93
|
+
if (inRelevantSection && currentSection.trim()) {
|
|
94
|
+
relevantSections.push(sectionHeader + '\n' + currentSection.trim());
|
|
95
|
+
}
|
|
96
|
+
// Check if new section is relevant
|
|
97
|
+
inRelevantSection = relevantHeaders.some(keyword => trimmed.includes(keyword));
|
|
98
|
+
sectionHeader = line;
|
|
99
|
+
currentSection = '';
|
|
100
|
+
}
|
|
101
|
+
else if (inRelevantSection) {
|
|
102
|
+
currentSection += line + '\n';
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
// Don't forget the last section
|
|
106
|
+
if (inRelevantSection && currentSection.trim()) {
|
|
107
|
+
relevantSections.push(sectionHeader + '\n' + currentSection.trim());
|
|
108
|
+
}
|
|
109
|
+
// If no specific sections found, extract key paragraphs
|
|
110
|
+
if (relevantSections.length === 0) {
|
|
111
|
+
return this.extractKeyParagraphs(content);
|
|
112
|
+
}
|
|
113
|
+
return relevantSections.join('\n\n');
|
|
114
|
+
}
|
|
115
|
+
/**
|
|
116
|
+
* Extract rules file content
|
|
117
|
+
*/
|
|
118
|
+
extractRulesSections(content) {
|
|
119
|
+
// Rules files are typically more concise, keep most content
|
|
120
|
+
const lines = content.split('\n');
|
|
121
|
+
const filtered = lines.filter(line => {
|
|
122
|
+
const trimmed = line.trim();
|
|
123
|
+
// Skip very generic lines
|
|
124
|
+
if (trimmed.length < 10)
|
|
125
|
+
return true; // Keep short lines for structure
|
|
126
|
+
if (trimmed.includes('example') && trimmed.includes('only'))
|
|
127
|
+
return false;
|
|
128
|
+
if (trimmed.includes('this is just') && trimmed.includes('example'))
|
|
129
|
+
return false;
|
|
130
|
+
return true;
|
|
131
|
+
});
|
|
132
|
+
return filtered.join('\n');
|
|
133
|
+
}
|
|
134
|
+
/**
|
|
135
|
+
* Extract general instructions from any file
|
|
136
|
+
*/
|
|
137
|
+
extractGeneralInstructions(content) {
|
|
138
|
+
return this.extractKeyParagraphs(content);
|
|
139
|
+
}
|
|
140
|
+
/**
|
|
141
|
+
* Extract key paragraphs based on content analysis
|
|
142
|
+
*/
|
|
143
|
+
extractKeyParagraphs(content) {
|
|
144
|
+
const paragraphs = content.split('\n\n').filter(p => p.trim().length > 50);
|
|
145
|
+
const keyParagraphs = [];
|
|
146
|
+
const importantKeywords = [
|
|
147
|
+
'must', 'should', 'always', 'never', 'important', 'critical',
|
|
148
|
+
'required', 'mandatory', 'essential', 'convention', 'pattern',
|
|
149
|
+
'style', 'format', 'structure', 'architecture', 'test', 'security'
|
|
150
|
+
];
|
|
151
|
+
for (const paragraph of paragraphs) {
|
|
152
|
+
const lowerParagraph = paragraph.toLowerCase();
|
|
153
|
+
const relevanceScore = importantKeywords.reduce((score, keyword) => {
|
|
154
|
+
return score + (lowerParagraph.includes(keyword) ? 1 : 0);
|
|
155
|
+
}, 0);
|
|
156
|
+
// Include paragraphs with at least 2 important keywords
|
|
157
|
+
if (relevanceScore >= 2) {
|
|
158
|
+
keyParagraphs.push(paragraph.trim());
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
// If we didn't find enough relevant content, take first few paragraphs
|
|
162
|
+
if (keyParagraphs.length === 0 && paragraphs.length > 0) {
|
|
163
|
+
return paragraphs.slice(0, 3).join('\n\n');
|
|
164
|
+
}
|
|
165
|
+
return keyParagraphs.slice(0, 5).join('\n\n'); // Limit to 5 paragraphs max
|
|
166
|
+
}
|
|
167
|
+
/**
|
|
168
|
+
* Determine the type of configuration file
|
|
169
|
+
*/
|
|
170
|
+
determineFileType(filename) {
|
|
171
|
+
const lower = filename.toLowerCase();
|
|
172
|
+
if (lower.includes('agent') || lower.includes('claude') || lower.includes('gemini')) {
|
|
173
|
+
return 'agents';
|
|
174
|
+
}
|
|
175
|
+
if (lower.includes('rule') || lower.includes('.cursor/') || lower.includes('.clinerules/')) {
|
|
176
|
+
return 'rules';
|
|
177
|
+
}
|
|
178
|
+
return 'instructions';
|
|
179
|
+
}
|
|
180
|
+
/**
|
|
181
|
+
* Merge existing rules into a single consolidated section
|
|
182
|
+
*/
|
|
183
|
+
static mergeExistingRules(existingRules) {
|
|
184
|
+
if (existingRules.length === 0) {
|
|
185
|
+
return '';
|
|
186
|
+
}
|
|
187
|
+
const sections = [];
|
|
188
|
+
sections.push('## Existing Project Guidelines');
|
|
189
|
+
sections.push('');
|
|
190
|
+
sections.push('*The following guidelines were found in existing AI configuration files:*');
|
|
191
|
+
sections.push('');
|
|
192
|
+
// Group by type
|
|
193
|
+
const agentRules = existingRules.filter(r => r.type === 'agents');
|
|
194
|
+
const ruleFiles = existingRules.filter(r => r.type === 'rules');
|
|
195
|
+
const instructions = existingRules.filter(r => r.type === 'instructions');
|
|
196
|
+
// Add agent-specific rules
|
|
197
|
+
if (agentRules.length > 0) {
|
|
198
|
+
sections.push('### AI Agent Guidelines');
|
|
199
|
+
for (const rule of agentRules) {
|
|
200
|
+
sections.push(`**From ${rule.source}:**`);
|
|
201
|
+
sections.push(rule.content);
|
|
202
|
+
sections.push('');
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
// Add rule files
|
|
206
|
+
if (ruleFiles.length > 0) {
|
|
207
|
+
sections.push('### Project Rules');
|
|
208
|
+
for (const rule of ruleFiles) {
|
|
209
|
+
sections.push(`**From ${rule.source}:**`);
|
|
210
|
+
sections.push(rule.content);
|
|
211
|
+
sections.push('');
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
// Add general instructions
|
|
215
|
+
if (instructions.length > 0) {
|
|
216
|
+
sections.push('### Additional Instructions');
|
|
217
|
+
for (const rule of instructions) {
|
|
218
|
+
sections.push(`**From ${rule.source}:**`);
|
|
219
|
+
sections.push(rule.content);
|
|
220
|
+
sections.push('');
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
return sections.join('\n');
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
//# sourceMappingURL=existing-rules-extractor.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"existing-rules-extractor.js","sourceRoot":"","sources":["../../source/init/existing-rules-extractor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,IAAI,CAAC;AAC9C,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAQ5B,MAAM,OAAO,sBAAsB;IAsBb;IArBZ,MAAM,CAAU,eAAe,GAAG;QACxC,0BAA0B;QAC1B,WAAW;QACX,UAAU;QACV,WAAW;QACX,WAAW;QACX,WAAW;QAEX,qCAAqC;QACrC,eAAe;QACf,mBAAmB;QACnB,iBAAiB;QAEjB,wBAAwB;QACxB,WAAW;QACX,kBAAkB;QAClB,oBAAoB;QACpB,sBAAsB;QACtB,mBAAmB;KACpB,CAAC;IAEF,YAAoB,WAAmB;QAAnB,gBAAW,GAAX,WAAW,CAAQ;IAAG,CAAC;IAE3C;;OAEG;IACI,oBAAoB;QACzB,MAAM,KA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