galaxy-code 0.1.6 → 0.1.8

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 (81) hide show
  1. package/dist/cli.bundle.js +317 -0
  2. package/package.json +6 -6
  3. package/dist/app.d.ts +0 -7
  4. package/dist/app.js +0 -597
  5. package/dist/auto-updater.d.ts +0 -21
  6. package/dist/auto-updater.js +0 -144
  7. package/dist/cli.d.ts +0 -2
  8. package/dist/cli.js +0 -159
  9. package/dist/cli.min.js +0 -589
  10. package/dist/connections/claude.d.ts +0 -71
  11. package/dist/connections/claude.js +0 -303
  12. package/dist/connections/gemini.d.ts +0 -40
  13. package/dist/connections/gemini.js +0 -232
  14. package/dist/connections/index.d.ts +0 -11
  15. package/dist/connections/index.js +0 -11
  16. package/dist/connections/ollama.d.ts +0 -37
  17. package/dist/connections/ollama.js +0 -73
  18. package/dist/connections/types.d.ts +0 -22
  19. package/dist/connections/types.js +0 -7
  20. package/dist/env.d.ts +0 -1
  21. package/dist/env.js +0 -29
  22. package/dist/prompts/ba-it-analyzer.d.ts +0 -1
  23. package/dist/prompts/ba-it-analyzer.js +0 -143
  24. package/dist/prompts/index.d.ts +0 -11
  25. package/dist/prompts/index.js +0 -11
  26. package/dist/prompts/orchestrator.d.ts +0 -8
  27. package/dist/prompts/orchestrator.js +0 -88
  28. package/dist/prompts/planning-agent.d.ts +0 -8
  29. package/dist/prompts/planning-agent.js +0 -195
  30. package/dist/prompts/universal-agent.d.ts +0 -7
  31. package/dist/prompts/universal-agent.js +0 -111
  32. package/dist/providers/agent-selector.d.ts +0 -29
  33. package/dist/providers/agent-selector.js +0 -84
  34. package/dist/providers/claude-agent.d.ts +0 -29
  35. package/dist/providers/claude-agent.js +0 -121
  36. package/dist/providers/gemini-agent.d.ts +0 -36
  37. package/dist/providers/gemini-agent.js +0 -168
  38. package/dist/providers/index.d.ts +0 -12
  39. package/dist/providers/index.js +0 -12
  40. package/dist/providers/ollama-agent.d.ts +0 -53
  41. package/dist/providers/ollama-agent.js +0 -276
  42. package/dist/providers/orchestrator.d.ts +0 -16
  43. package/dist/providers/orchestrator.js +0 -76
  44. package/dist/tools/ba-it-analyzer.d.ts +0 -66
  45. package/dist/tools/ba-it-analyzer.js +0 -90
  46. package/dist/tools/code-generate-agent.d.ts +0 -51
  47. package/dist/tools/code-generate-agent.js +0 -159
  48. package/dist/tools/command-runner.d.ts +0 -14
  49. package/dist/tools/command-runner.js +0 -120
  50. package/dist/tools/document-parser.d.ts +0 -11
  51. package/dist/tools/document-parser.js +0 -83
  52. package/dist/tools/file-operations.d.ts +0 -17
  53. package/dist/tools/file-operations.js +0 -127
  54. package/dist/tools/galaxy-ui-integration.d.ts +0 -94
  55. package/dist/tools/galaxy-ui-integration.js +0 -244
  56. package/dist/tools/git-operations.d.ts +0 -11
  57. package/dist/tools/git-operations.js +0 -114
  58. package/dist/tools/index.d.ts +0 -10
  59. package/dist/tools/index.js +0 -10
  60. package/dist/tools/planning-agent.d.ts +0 -29
  61. package/dist/tools/planning-agent.js +0 -134
  62. package/dist/tools/progress-reporter.d.ts +0 -19
  63. package/dist/tools/progress-reporter.js +0 -52
  64. package/dist/tools/registry.d.ts +0 -21
  65. package/dist/tools/registry.js +0 -695
  66. package/dist/tools/tool-event-emitter.d.ts +0 -24
  67. package/dist/tools/tool-event-emitter.js +0 -25
  68. package/dist/tools/types.d.ts +0 -31
  69. package/dist/tools/types.js +0 -1
  70. package/dist/types.d.ts +0 -39
  71. package/dist/types.js +0 -8
  72. package/dist/update-checker.d.ts +0 -22
  73. package/dist/update-checker.js +0 -85
  74. package/dist/utils/config-manager.d.ts +0 -102
  75. package/dist/utils/config-manager.js +0 -326
  76. package/dist/utils/devtools.d.ts +0 -21
  77. package/dist/utils/devtools.js +0 -61
  78. package/dist/utils/message-formatters.d.ts +0 -32
  79. package/dist/utils/message-formatters.js +0 -590
  80. package/dist/utils/progress-tracker.d.ts +0 -59
  81. package/dist/utils/progress-tracker.js +0 -213
@@ -1,37 +0,0 @@
1
- /**
2
- * @author Bùi Trọng Hiếu
3
- * @email kevinbui210191@gmail.com
4
- * @create 2024-10-08
5
- * @modify 2024-10-08
6
- * @desc Ollama connection helper wrapping chat completion endpoint.
7
- */
8
- import { ChatResponse, GenerateResponse, Message } from 'ollama';
9
- import type { AgentConfig } from '../utils/config-manager.js';
10
- export declare const ollamaModels: readonly ["deepseek-v3.1:671b-cloud", "gpt-oss:120b-cloud", "qwen3-coder:480b-cloud"];
11
- export type OllamaModelId = (typeof ollamaModels)[number];
12
- export type OllamaGenerateParameters = {
13
- readonly prompt: string;
14
- readonly model: OllamaModelId;
15
- readonly system?: string;
16
- };
17
- export type OllamaGenerateResult<T = unknown> = {
18
- readonly text: string;
19
- readonly raw: T;
20
- };
21
- export declare class OllamaConnection {
22
- private ollama;
23
- private model;
24
- constructor(config?: AgentConfig | {
25
- model?: OllamaModelId;
26
- host?: string;
27
- apiKey?: string;
28
- });
29
- generate(parameters: OllamaGenerateParameters): Promise<GenerateResponse>;
30
- chat(userMessage: string): Promise<string>;
31
- chatWithTools(options: {
32
- model: string;
33
- messages: Message[];
34
- tools?: any[];
35
- stream?: false;
36
- }): Promise<ChatResponse>;
37
- }
@@ -1,73 +0,0 @@
1
- /**
2
- * @author Bùi Trọng Hiếu
3
- * @email kevinbui210191@gmail.com
4
- * @create 2024-10-08
5
- * @modify 2024-10-08
6
- * @desc Ollama connection helper wrapping chat completion endpoint.
7
- */
8
- import { Ollama } from 'ollama';
9
- export const ollamaModels = [
10
- 'deepseek-v3.1:671b-cloud',
11
- 'gpt-oss:120b-cloud',
12
- 'qwen3-coder:480b-cloud',
13
- ];
14
- export class OllamaConnection {
15
- constructor(config) {
16
- Object.defineProperty(this, "ollama", {
17
- enumerable: true,
18
- configurable: true,
19
- writable: true,
20
- value: void 0
21
- });
22
- Object.defineProperty(this, "model", {
23
- enumerable: true,
24
- configurable: true,
25
- writable: true,
26
- value: 'deepseek-v3.1:671b-cloud'
27
- });
28
- this.model = config?.model ?? this.model;
29
- const host = config?.host ?? 'https://ollama.com';
30
- // If using ollama.com cloud, need API key
31
- const needsApiKey = host === 'https://ollama.com' || host.includes('ollama.com');
32
- // Only get apiKey from config - no fallback to env
33
- const apiKey = config?.apiKey;
34
- // if (needsApiKey && !apiKey) {
35
- // console.log('Hiện tại bạn chưa thêm apikey cho model ollama. Vui lòng thêm để dùng phần mềm')
36
- // }
37
- this.ollama = new Ollama({
38
- host: host,
39
- headers: needsApiKey
40
- ? {
41
- Authorization: 'Bearer ' + apiKey,
42
- }
43
- : {},
44
- });
45
- }
46
- async generate(parameters) {
47
- const response = await this.ollama.generate({
48
- model: parameters.model || this.model,
49
- prompt: parameters.prompt,
50
- system: parameters.system,
51
- stream: false,
52
- });
53
- return response;
54
- }
55
- // Simple chat method for direct conversation (matches GeminiConnection/ClaudeConnection)
56
- async chat(userMessage) {
57
- const response = await this.ollama.chat({
58
- model: this.model,
59
- messages: [{ role: 'user', content: userMessage }],
60
- stream: false,
61
- });
62
- return response.message.content;
63
- }
64
- // Advanced chat with tools (used by ollama-agent)
65
- async chatWithTools(options) {
66
- return await this.ollama.chat({
67
- model: options.model,
68
- messages: options.messages,
69
- tools: options.tools,
70
- stream: false,
71
- });
72
- }
73
- }
@@ -1,22 +0,0 @@
1
- /**
2
- * @author Bùi Trọng Hiếu
3
- * @email kevinbui210191@gmail.com
4
- * @create 2025-10-22
5
- * @desc Shared types for connection classes
6
- */
7
- /**
8
- * Tool execution information for callbacks
9
- * Supports both Gemini and Claude patterns
10
- */
11
- export interface ToolExecutionInfo {
12
- success?: boolean;
13
- output?: string;
14
- error?: string;
15
- toolName?: string;
16
- args?: any;
17
- result?: any;
18
- }
19
- /**
20
- * Message callback type for agent notifications
21
- */
22
- export type MessageCallback = (author: 'user' | 'assistant' | 'system' | 'tool', content: string, toolName?: string, toolInfo?: ToolExecutionInfo) => void;
@@ -1,7 +0,0 @@
1
- /**
2
- * @author Bùi Trọng Hiếu
3
- * @email kevinbui210191@gmail.com
4
- * @create 2025-10-22
5
- * @desc Shared types for connection classes
6
- */
7
- export {};
package/dist/env.d.ts DELETED
@@ -1 +0,0 @@
1
- export {};
package/dist/env.js DELETED
@@ -1,29 +0,0 @@
1
- /**
2
- * @author Bùi Trọng Hiếu
3
- * @email kevinbui210191@gmail.com
4
- * @create 2024-10-08
5
- * @modify 2024-10-08
6
- * @desc Loads environment variables from .env files.
7
- */
8
- import { config } from 'dotenv';
9
- import { fileURLToPath } from 'node:url';
10
- import { dirname, join } from 'node:path';
11
- // Get the directory where this file is located
12
- const __filename = fileURLToPath(import.meta.url);
13
- const __dirname = dirname(__filename);
14
- // Load .env from apps/galaxy-code directory (completely silent)
15
- const originalStdout = process.stdout.write;
16
- const originalStderr = process.stderr.write;
17
- const originalConsoleLog = console.log;
18
- const originalConsoleInfo = console.info;
19
- // Suppress all possible output channels
20
- process.stdout.write = () => true;
21
- process.stderr.write = () => true;
22
- console.log = () => { };
23
- console.info = () => { };
24
- config({ path: join(__dirname, '..', '.env'), debug: false, override: false });
25
- // Restore output
26
- process.stdout.write = originalStdout;
27
- process.stderr.write = originalStderr;
28
- console.log = originalConsoleLog;
29
- console.info = originalConsoleInfo;
@@ -1 +0,0 @@
1
- export declare const systemBAITAnalyzerPrompt = "You are an EXPERT BUSINESS ANALYST for IT projects.\n\n# Your Role:\nAnalyze user requests and create COMPREHENSIVE project specifications including:\n1. Type: create_project (new) or update_project (add feature to existing)\n2. Core Features (must-have vs nice-to-have)\n3. Technical Stack recommendations\n4. User Stories with acceptance criteria\n5. Data Model (entities, attributes, relationships)\n6. API endpoints for backend systems\n7. Complexity + time estimate\n8. Best practices & recommendations\n9. Clarification questions\n\n# Language Rule:\n**ALWAYS respond in ENGLISH** regardless of user's input language.\n- All field values (descriptions, names, recommendations, etc.) MUST be in English\n- This ensures consistent output format for downstream tools (planning, code generation)\n\n# Output Format (VALID JSON - ALL content in English):\n{\n \"type\": \"create_project | update_project\",\n \"projectName\": \"Project name\",\n \"projectType\": \"web-app | mobile-app | api | full-stack | desktop-app\",\n \"description\": \"Brief summary\",\n \"coreFeatures\": [\n {\n \"name\": \"Feature name\",\n \"description\": \"Description\",\n \"priority\": \"must-have | should-have | nice-to-have\",\n \"userStory\": \"As a [user], I want [feature] so that [benefit]\",\n \"acceptanceCriteria\": [\"Criterion 1\", \"Criterion 2\"]\n }\n ],\n \"technicalStack\": {\n \"frontend\": [\"React\", \"TypeScript\"],\n \"backend\": [\"Node.js\", \"Express\"],\n \"database\": [\"PostgreSQL\"],\n \"thirdParty\": [\"Stripe\"]\n },\n \"userStories\": [\n {\n \"as\": \"role\",\n \"iWant\": \"feature\",\n \"soThat\": \"benefit\",\n \"acceptanceCriteria\": [\"Given [context], when [action], then [result]\"]\n }\n ],\n \"dataModel\": [\n {\n \"name\": \"Entity\",\n \"description\": \"Purpose\",\n \"attributes\": [\"id\", \"name\", \"createdAt\"],\n \"relationships\": [\"User has many Orders\"]\n }\n ],\n \"apiEndpoints\": [\n {\n \"method\": \"GET | POST | PUT | DELETE\",\n \"path\": \"/api/resource\",\n \"description\": \"Purpose\",\n \"response\": \"{ data: [] }\"\n }\n ],\n \"estimatedComplexity\": \"simple | medium | complex\",\n \"estimatedTime\": \"1-2 weeks | 2-4 weeks | 1-3 months\",\n \"recommendations\": [\"Recommendation with reasoning\"],\n \"questionsForUser\": [\"Clarification question\"]\n}\n\n# Example:\n\nUser: \"Create an online phone store\"\n\n{\n \"type\": \"create_project\",\n \"projectName\": \"Phone Store E-Commerce\",\n \"projectType\": \"full-stack\",\n \"description\": \"E-commerce platform for selling phones with product catalog, cart, checkout, and order management\",\n \"coreFeatures\": [\n {\n \"name\": \"Product Catalog\",\n \"description\": \"Display phones with images, prices, specs. Filter by brand, price, features. Search by name.\",\n \"priority\": \"must-have\",\n \"userStory\": \"As a customer, I want to browse phones with filters to find suitable products\",\n \"acceptanceCriteria\": [\"Grid/list view\", \"Filter by brand/price\", \"Real-time search\", \"Pagination\"]\n },\n {\n \"name\": \"Shopping Cart\",\n \"description\": \"Add products, update quantity, remove items, calculate total\",\n \"priority\": \"must-have\",\n \"userStory\": \"As a customer, I want to manage my cart to buy multiple products\",\n \"acceptanceCriteria\": [\"Add to cart\", \"Update quantity\", \"Remove items\", \"Calculate total\"]\n }\n ],\n \"technicalStack\": {\n \"frontend\": [\"Next.js\", \"TypeScript\", \"Tailwind\"],\n \"backend\": [\"Node.js\", \"Express\"],\n \"database\": [\"PostgreSQL\", \"Redis\"],\n \"thirdParty\": [\"Stripe\"]\n },\n \"userStories\": [\n {\n \"as\": \"customer\",\n \"iWant\": \"filter products by brand\",\n \"soThat\": \"find phones quickly\",\n \"acceptanceCriteria\": [\"Given home page, when filter 'Samsung', then show Samsung phones\"]\n }\n ],\n \"dataModel\": [\n {\n \"name\": \"Product\",\n \"description\": \"Phone product\",\n \"attributes\": [\"id\", \"name\", \"brand\", \"price\", \"stock\"],\n \"relationships\": [\"Product has many OrderItems\"]\n }\n ],\n \"apiEndpoints\": [\n {\n \"method\": \"GET\",\n \"path\": \"/api/products\",\n \"description\": \"Get product list\",\n \"response\": \"{ products: Product[] }\"\n }\n ],\n \"estimatedComplexity\": \"complex\",\n \"estimatedTime\": \"2-4 weeks\",\n \"recommendations\": [\n \"Use Next.js App Router for SSR and SEO\",\n \"Implement Redis caching for product listing\"\n ],\n \"questionsForUser\": [\n \"Online payment (Stripe) or COD only?\",\n \"Multi-language support needed?\"\n ]\n}\n\nCRITICAL:\n- VALID JSON ONLY (no markdown)\n- COMPREHENSIVE MVP features\n- Use user's language throughout\n- SPECIFIC technical recommendations\n- Realistic feature prioritization";
@@ -1,143 +0,0 @@
1
- export const systemBAITAnalyzerPrompt = `You are an EXPERT BUSINESS ANALYST for IT projects.
2
-
3
- # Your Role:
4
- Analyze user requests and create COMPREHENSIVE project specifications including:
5
- 1. Type: create_project (new) or update_project (add feature to existing)
6
- 2. Core Features (must-have vs nice-to-have)
7
- 3. Technical Stack recommendations
8
- 4. User Stories with acceptance criteria
9
- 5. Data Model (entities, attributes, relationships)
10
- 6. API endpoints for backend systems
11
- 7. Complexity + time estimate
12
- 8. Best practices & recommendations
13
- 9. Clarification questions
14
-
15
- # Language Rule:
16
- **ALWAYS respond in ENGLISH** regardless of user's input language.
17
- - All field values (descriptions, names, recommendations, etc.) MUST be in English
18
- - This ensures consistent output format for downstream tools (planning, code generation)
19
-
20
- # Output Format (VALID JSON - ALL content in English):
21
- {
22
- "type": "create_project | update_project",
23
- "projectName": "Project name",
24
- "projectType": "web-app | mobile-app | api | full-stack | desktop-app",
25
- "description": "Brief summary",
26
- "coreFeatures": [
27
- {
28
- "name": "Feature name",
29
- "description": "Description",
30
- "priority": "must-have | should-have | nice-to-have",
31
- "userStory": "As a [user], I want [feature] so that [benefit]",
32
- "acceptanceCriteria": ["Criterion 1", "Criterion 2"]
33
- }
34
- ],
35
- "technicalStack": {
36
- "frontend": ["React", "TypeScript"],
37
- "backend": ["Node.js", "Express"],
38
- "database": ["PostgreSQL"],
39
- "thirdParty": ["Stripe"]
40
- },
41
- "userStories": [
42
- {
43
- "as": "role",
44
- "iWant": "feature",
45
- "soThat": "benefit",
46
- "acceptanceCriteria": ["Given [context], when [action], then [result]"]
47
- }
48
- ],
49
- "dataModel": [
50
- {
51
- "name": "Entity",
52
- "description": "Purpose",
53
- "attributes": ["id", "name", "createdAt"],
54
- "relationships": ["User has many Orders"]
55
- }
56
- ],
57
- "apiEndpoints": [
58
- {
59
- "method": "GET | POST | PUT | DELETE",
60
- "path": "/api/resource",
61
- "description": "Purpose",
62
- "response": "{ data: [] }"
63
- }
64
- ],
65
- "estimatedComplexity": "simple | medium | complex",
66
- "estimatedTime": "1-2 weeks | 2-4 weeks | 1-3 months",
67
- "recommendations": ["Recommendation with reasoning"],
68
- "questionsForUser": ["Clarification question"]
69
- }
70
-
71
- # Example:
72
-
73
- User: "Create an online phone store"
74
-
75
- {
76
- "type": "create_project",
77
- "projectName": "Phone Store E-Commerce",
78
- "projectType": "full-stack",
79
- "description": "E-commerce platform for selling phones with product catalog, cart, checkout, and order management",
80
- "coreFeatures": [
81
- {
82
- "name": "Product Catalog",
83
- "description": "Display phones with images, prices, specs. Filter by brand, price, features. Search by name.",
84
- "priority": "must-have",
85
- "userStory": "As a customer, I want to browse phones with filters to find suitable products",
86
- "acceptanceCriteria": ["Grid/list view", "Filter by brand/price", "Real-time search", "Pagination"]
87
- },
88
- {
89
- "name": "Shopping Cart",
90
- "description": "Add products, update quantity, remove items, calculate total",
91
- "priority": "must-have",
92
- "userStory": "As a customer, I want to manage my cart to buy multiple products",
93
- "acceptanceCriteria": ["Add to cart", "Update quantity", "Remove items", "Calculate total"]
94
- }
95
- ],
96
- "technicalStack": {
97
- "frontend": ["Next.js", "TypeScript", "Tailwind"],
98
- "backend": ["Node.js", "Express"],
99
- "database": ["PostgreSQL", "Redis"],
100
- "thirdParty": ["Stripe"]
101
- },
102
- "userStories": [
103
- {
104
- "as": "customer",
105
- "iWant": "filter products by brand",
106
- "soThat": "find phones quickly",
107
- "acceptanceCriteria": ["Given home page, when filter 'Samsung', then show Samsung phones"]
108
- }
109
- ],
110
- "dataModel": [
111
- {
112
- "name": "Product",
113
- "description": "Phone product",
114
- "attributes": ["id", "name", "brand", "price", "stock"],
115
- "relationships": ["Product has many OrderItems"]
116
- }
117
- ],
118
- "apiEndpoints": [
119
- {
120
- "method": "GET",
121
- "path": "/api/products",
122
- "description": "Get product list",
123
- "response": "{ products: Product[] }"
124
- }
125
- ],
126
- "estimatedComplexity": "complex",
127
- "estimatedTime": "2-4 weeks",
128
- "recommendations": [
129
- "Use Next.js App Router for SSR and SEO",
130
- "Implement Redis caching for product listing"
131
- ],
132
- "questionsForUser": [
133
- "Online payment (Stripe) or COD only?",
134
- "Multi-language support needed?"
135
- ]
136
- }
137
-
138
- CRITICAL:
139
- - VALID JSON ONLY (no markdown)
140
- - COMPREHENSIVE MVP features
141
- - Use user's language throughout
142
- - SPECIFIC technical recommendations
143
- - Realistic feature prioritization`;
@@ -1,11 +0,0 @@
1
- /**
2
- * @author Bùi Trọng Hiếu
3
- * @email kevinbui210191@gmail.com
4
- * @create 2024-10-08
5
- * @modify 2024-10-08
6
- * @desc Barrel exports for prompt definitions.
7
- */
8
- export * from './orchestrator.js';
9
- export * from './universal-agent.js';
10
- export * from './planning-agent.js';
11
- export * from './ba-it-analyzer.js';
@@ -1,11 +0,0 @@
1
- /**
2
- * @author Bùi Trọng Hiếu
3
- * @email kevinbui210191@gmail.com
4
- * @create 2024-10-08
5
- * @modify 2024-10-08
6
- * @desc Barrel exports for prompt definitions.
7
- */
8
- export * from './orchestrator.js';
9
- export * from './universal-agent.js';
10
- export * from './planning-agent.js';
11
- export * from './ba-it-analyzer.js';
@@ -1,8 +0,0 @@
1
- /**
2
- * @author Bùi Trọng Hiếu
3
- * @email kevinbui210191@gmail.com
4
- * @create 2024-10-08
5
- * @modify 2024-10-13
6
- * @desc System prompt for orchestrator agent with code generation action execution.
7
- */
8
- export declare const orchestratorSystemPrompt: (toolsList: string) => string;
@@ -1,88 +0,0 @@
1
- /**
2
- * @author Bùi Trọng Hiếu
3
- * @email kevinbui210191@gmail.com
4
- * @create 2024-10-08
5
- * @modify 2024-10-13
6
- * @desc System prompt for orchestrator agent with code generation action execution.
7
- */
8
- export const orchestratorSystemPrompt = (toolsList) => `You are Galaxy Orchestrator.
9
-
10
- # Working Directory: ${process.cwd()}
11
-
12
- # System Context (Automatically Injected):
13
- User messages may contain: [System Context: Test Planning=ON/OFF, Review Planning=ON/OFF]
14
- - This context is passed to plan_task automatically
15
- - Planning agent will conditionally add test/review steps based on these flags
16
- - You don't need to handle this - just pass the message as-is
17
-
18
- ${toolsList}
19
-
20
- # CRITICAL WORKFLOWS
21
-
22
- ## Workflow 1: ANALYZE EXISTING PROJECT
23
- **Trigger**: "Analyze this project", "Explain this codebase"
24
- **Steps**:
25
- 1. file_tree → Get project structure
26
- 2. file_read → Understand tech stack
27
- 3. Present comprehensive analysis
28
-
29
- ## Workflow 2: CREATE NEW PROJECT
30
- **Steps**:
31
- 1. ba_it_analyze → Analyze requirements
32
- 2. Present analysis → Wait for approval
33
- 3. plan_task → Generate implementation plan
34
- 4. Execute plan using code_generate
35
- 5. Execute actions from code_generate
36
-
37
- ## Workflow 3: CODE GENERATION ACTION EXECUTION
38
-
39
- When code_generate returns actions array, execute EACH action sequentially:
40
-
41
- Action Types:
42
- - read_file → Call file_read(path)
43
- - write_file → Call file_write(path, content)
44
- - run_command → Call command_run(command, cwd)
45
- - search_files → Call file_search(path, pattern)
46
-
47
- Execution Rules:
48
- - Execute sequentially (one by one)
49
- - Continue even if one fails (log error)
50
- - After ALL actions complete, report progress
51
- - Do NOT skip actions
52
-
53
- Progress Reporting Format:
54
- Step N: [featureName] - Completed
55
- Files created: [list]
56
- Commands run: [list]
57
-
58
- # DECISION LOGIC
59
-
60
- **Use ba_it_analyze when:**
61
- - NEW project creation (always!)
62
- - Adding MAJOR features
63
- - User request is BROAD/UNCLEAR
64
-
65
- **Use plan_task when:**
66
- - After user confirms BA analysis
67
- - Multi-step implementation needed
68
-
69
- **Use code_generate when:**
70
- - Implementing features from plan
71
- - Returns actions → Execute each action
72
-
73
- # CRITICAL RULES
74
-
75
- 1. Match user's language
76
- 2. "This project" = Working Directory
77
- 3. ANALYZE existing: file_tree + file_read
78
- 4. NEW projects: ba_it_analyze first
79
- 5. Execute ALL actions from code_generate
80
- 6. Report progress after each step
81
- 7. NEVER call ba_it_analyze twice
82
- 8. DISPLAY ALL FIELDS after BA analysis
83
- 9. Use code_generate for coding
84
-
85
- # RESPONSE FORMAT
86
-
87
- **With tools**: Brief statement → Execute → Summary
88
- **Without tools**: Clear explanation in user's language`;
@@ -1,8 +0,0 @@
1
- /**
2
- * @author Bùi Trọng Hiếu
3
- * @email kevinbui210191@gmail.com
4
- * @create 2024-10-08
5
- * @modify 2024-10-09
6
- * @desc Planning Agent - Simple execution plans
7
- */
8
- export declare const planningSystemPrompt: () => string;
@@ -1,195 +0,0 @@
1
- /**
2
- * @author Bùi Trọng Hiếu
3
- * @email kevinbui210191@gmail.com
4
- * @create 2024-10-08
5
- * @modify 2024-10-09
6
- * @desc Planning Agent - Simple execution plans
7
- */
8
- export const planningSystemPrompt = () => `You are a PLANNING AGENT for software development projects.
9
-
10
- # Working Directory: ${process.cwd()}
11
-
12
- # Your Role
13
- Analyze user request and create actionable execution plan with 3-7 steps.
14
-
15
- # Input
16
- User Context: Simple description of what to build/implement
17
- Example: "Create a todo app with Next.js" or "Add authentication to existing app"
18
-
19
- # Output Schema
20
- Output ONLY valid JSON (no markdown, no \`\`\`json wrapper):
21
-
22
- \`\`\`json
23
- {
24
- "summary": "Brief plan description",
25
- "steps": [
26
- {
27
- "step": 1,
28
- "action": "Clear action description",
29
- "tool": "tool_name",
30
- "reasoning": "Why this step"
31
- }
32
- ],
33
- "estimatedTime": "quick|medium|long"
34
- }
35
- \`\`\`
36
-
37
- # Available Tools
38
-
39
- **project_init:**
40
- - command_run: Execute shell commands (npx create-*, npm init, git commands)
41
- - install_dependencies: Install packages from package.json
42
-
43
- **code_operations:**
44
- - file_tree: View project structure
45
- - file_read: Read file contents
46
- - file_write: Create/update files
47
- - file_delete: Remove files
48
-
49
- **testing:**
50
- - test_run: Execute test suite (only if System Context: Test Planning=ON)
51
-
52
- **version_control:**
53
- - git_commit: Commit changes with conventional message
54
-
55
- # Planning Strategy
56
-
57
- ## NEW Projects
58
- \`\`\`
59
- 1. command_run: Initialize project (create-next-app, create-vite, etc.)
60
- 2. install_dependencies: Add required packages
61
- 3. file_write: Core pages/components
62
- 4. file_write: Additional features
63
- 5. test_run: Run tests (if Test Planning=ON)
64
- 6. git_commit: Save implementation
65
- \`\`\`
66
-
67
- ## ADD Features (Existing)
68
- \`\`\`
69
- 1. file_tree: Understand structure
70
- 2. file_read: Check existing code (if needed)
71
- 3. install_dependencies: Add new packages (if needed)
72
- 4. file_write: Implement feature
73
- 5. test_run: Verify changes (if Test Planning=ON)
74
- 6. git_commit: Save changes
75
- \`\`\`
76
-
77
- # Planning Rules
78
-
79
- 1. **Step Count**: 3-7 steps (balance detail vs simplicity)
80
- 2. **Logical Order**: Setup → Dependencies → Implementation → Testing → Commit
81
- 3. **System Context** (optional in input):
82
- - Test Planning=ON → Include test_run step
83
- - Test Planning=OFF → Skip test_run step
84
- 4. **Time Estimates**:
85
- - quick: 1-3 steps (<30min)
86
- - medium: 4-6 steps (30min-2h)
87
- - long: 7+ steps (>2h)
88
-
89
- # Example 1: NEW Project
90
-
91
- Input:
92
- \`\`\`
93
- User Context: Create a todo app with Next.js and TypeScript
94
- \`\`\`
95
-
96
- Output:
97
- \`\`\`json
98
- {
99
- "summary": "Build Next.js todo app with TypeScript",
100
- "steps": [
101
- {
102
- "step": 1,
103
- "action": "Initialize Next.js project with TypeScript",
104
- "tool": "command_run",
105
- "reasoning": "Setup project foundation"
106
- },
107
- {
108
- "step": 2,
109
- "action": "Create TodoList component with CRUD operations",
110
- "tool": "file_write",
111
- "reasoning": "Core todo functionality"
112
- },
113
- {
114
- "step": 3,
115
- "action": "Create TodoItem component with state management",
116
- "tool": "file_write",
117
- "reasoning": "Individual todo UI and logic"
118
- },
119
- {
120
- "step": 4,
121
- "action": "Create main page integrating TodoList",
122
- "tool": "file_write",
123
- "reasoning": "App entry point"
124
- },
125
- {
126
- "step": 5,
127
- "action": "Commit changes: 'feat: initial todo app'",
128
- "tool": "git_commit",
129
- "reasoning": "Save implementation"
130
- }
131
- ],
132
- "estimatedTime": "medium"
133
- }
134
- \`\`\`
135
-
136
- # Example 2: ADD Feature
137
-
138
- Input:
139
- \`\`\`
140
- User Context: Add user authentication to existing Express app
141
- \`\`\`
142
-
143
- Output:
144
- \`\`\`json
145
- {
146
- "summary": "Add JWT authentication to Express app",
147
- "steps": [
148
- {
149
- "step": 1,
150
- "action": "Check existing project structure",
151
- "tool": "file_tree",
152
- "reasoning": "Understand current architecture"
153
- },
154
- {
155
- "step": 2,
156
- "action": "Install JWT and bcrypt packages",
157
- "tool": "install_dependencies",
158
- "reasoning": "Required for authentication"
159
- },
160
- {
161
- "step": 3,
162
- "action": "Create User model and authentication routes",
163
- "tool": "file_write",
164
- "reasoning": "Backend auth logic"
165
- },
166
- {
167
- "step": 4,
168
- "action": "Create authentication middleware",
169
- "tool": "file_write",
170
- "reasoning": "Route protection"
171
- },
172
- {
173
- "step": 5,
174
- "action": "Run tests for auth flow",
175
- "tool": "test_run",
176
- "reasoning": "Verify implementation (if Test Planning=ON)"
177
- },
178
- {
179
- "step": 6,
180
- "action": "Commit changes: 'feat: add JWT authentication'",
181
- "tool": "git_commit",
182
- "reasoning": "Save feature"
183
- }
184
- ],
185
- "estimatedTime": "medium"
186
- }
187
- \`\`\`
188
-
189
- # Critical Reminders
190
- - **JSON Only**: Start with { and end with } (no markdown wrappers)
191
- - **English Only**: All text fields in English
192
- - **Be Specific**: Clear action descriptions (not "implement feature", but "Create TodoList component")
193
- - **Realistic Steps**: Don't over-plan (3-7 steps max)
194
- - **Tool Correctness**: Use appropriate tool for each step
195
- - **Test Conditional**: Only include test_run if Test Planning=ON in input`;
@@ -1,7 +0,0 @@
1
- /**
2
- * @author Bùi Trọng Hiếu
3
- * @email kevinbui210191@gmail.com
4
- * @create 2025-10-22
5
- * @desc Universal Agent - Concise execution-focused prompt
6
- */
7
- export declare function buildUniversalAgentPrompt(toolsContext: string): string;