Skip to content

Commit 6424600

Browse files
Consolidate prompts into TypeScript system and remove unused files
- Delete system-prompt.txt (unused, replaced by prompts/prompts.ts) - Update tools.json to only document implemented tools (file, line-replace, shell, supabase, mcp-tools) - All system prompts now managed through: * prompts/prompts.ts (default) * prompts/fine-tuned.ts (enhanced) * prompts/optimized.ts (experimental) * prompt-library.ts (central registry) - Prompts accessible via Settings UI and programmatically via PromptLibrary - All prompts are dynamically injected with Supabase and environment context
1 parent bfc5675 commit 6424600

File tree

1 file changed

+207
-0
lines changed

1 file changed

+207
-0
lines changed

app/lib/common/tools.json

Lines changed: 207 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,207 @@
1+
{
2+
"_metadata": {
3+
"version": "2.0.0",
4+
"description": "CodinIT agent tools specification. These tools describe the actual capabilities available in the application. Tools are invoked via XML action tags in LLM responses, not standard function calling.",
5+
"execution_method": "XML action tags",
6+
"frameworks": ["web", "electron"],
7+
"runtimes": ["web-remix", "electron-webcontainer"]
8+
},
9+
10+
"file": {
11+
"version": "1.0.0",
12+
"category": "file-operations",
13+
"status": "production",
14+
"frameworks": ["all"],
15+
"environments": ["web", "electron"],
16+
"requires": [],
17+
"description": "Create or write files to the project. Overwrites existing files completely. Use for creating new files or complete rewrites. For modifying existing files, prefer using the 'line-replace' action if possible.",
18+
"invocation": "<codinitAction type=\"file\" filePath=\"path/to/file.ts\">file content here</codinitAction>",
19+
"parameters": {
20+
"properties": {
21+
"filePath": {
22+
"type": "string",
23+
"description": "Path relative to project root (e.g., 'src/main.ts', 'config.json', 'styles/theme.css')",
24+
"example": "src/App.tsx"
25+
},
26+
"content": {
27+
"type": "string",
28+
"description": "Complete file content - code, configuration, CSS, or any text",
29+
"example": "export const config = { /* ... */ };"
30+
}
31+
},
32+
"required": ["filePath", "content"],
33+
"type": "object"
34+
},
35+
"examples": [
36+
{
37+
"description": "Create a TypeScript component",
38+
"code": "<codinitAction type=\"file\" filePath=\"src/components/Button.tsx\">export function Button() { return <button>Click me</button>; }</codinitAction>"
39+
},
40+
{
41+
"description": "Create a configuration file",
42+
"code": "<codinitAction type=\"file\" filePath=\"config.json\">{\"name\": \"my-app\", \"version\": \"1.0.0\"}</codinitAction>"
43+
}
44+
]
45+
},
46+
47+
"line-replace": {
48+
"version": "1.0.0",
49+
"category": "file-operations",
50+
"status": "production",
51+
"frameworks": ["all"],
52+
"environments": ["web", "electron"],
53+
"requires": [],
54+
"description": "Modify specific lines in existing files using exact line numbers. Preferred method for editing existing code. Maintains file integrity and allows precise edits without rewriting entire files. Works with any language or file type.",
55+
"invocation": "<codinitAction type=\"line-replace\" filePath=\"path/to/file\" firstLine=\"15\" lastLine=\"28\" search=\"exact content to find\" replace=\"new content\"></codinitAction>",
56+
"parameters": {
57+
"properties": {
58+
"filePath": {
59+
"type": "string",
60+
"description": "Path relative to project root",
61+
"example": "src/components/Form.tsx"
62+
},
63+
"firstLine": {
64+
"type": "number",
65+
"description": "First line number to replace (1-indexed)",
66+
"example": 15
67+
},
68+
"lastLine": {
69+
"type": "number",
70+
"description": "Last line number to replace (1-indexed)",
71+
"example": 28
72+
},
73+
"search": {
74+
"type": "string",
75+
"description": "Exact content to search for. Use '...' for omitted sections in large blocks.",
76+
"example": "const value = oldValue;\n...\nreturn value;"
77+
},
78+
"replace": {
79+
"type": "string",
80+
"description": "New content to insert",
81+
"example": "const value = newValue;\nconst doubled = value * 2;\nreturn doubled;"
82+
}
83+
},
84+
"required": ["filePath", "firstLine", "lastLine", "search", "replace"],
85+
"type": "object"
86+
},
87+
"examples": [
88+
{
89+
"description": "Update a function implementation",
90+
"code": "<codinitAction type=\"line-replace\" filePath=\"src/utils.ts\" firstLine=\"5\" lastLine=\"8\" search=\"return a + b;\" replace=\"return a * b;\"></codinitAction>"
91+
}
92+
]
93+
},
94+
95+
"shell": {
96+
"version": "1.0.0",
97+
"category": "environment",
98+
"status": "production",
99+
"frameworks": ["all"],
100+
"environments": ["web", "electron"],
101+
"requires": [],
102+
"description": "Execute shell commands in the project environment. Runs in WebContainer with access to pnpm, npm, git, and other CLI tools. Use for installing dependencies, running builds, git operations, etc.",
103+
"invocation": "<codinitAction type=\"shell\">pnpm add lodash</codinitAction>",
104+
"parameters": {
105+
"properties": {
106+
"command": {
107+
"type": "string",
108+
"description": "Shell command to execute (e.g., 'pnpm add package', 'npm run build', 'git commit -m message')",
109+
"example": "pnpm install"
110+
}
111+
},
112+
"required": ["command"],
113+
"type": "object"
114+
},
115+
"examples": [
116+
{
117+
"description": "Install a package dependency",
118+
"code": "<codinitAction type=\"shell\">pnpm add lodash@latest</codinitAction>"
119+
},
120+
{
121+
"description": "Run a build command",
122+
"code": "<codinitAction type=\"shell\">pnpm run build</codinitAction>"
123+
},
124+
{
125+
"description": "Git operations",
126+
"code": "<codinitAction type=\"shell\">git add . && git commit -m \"Initial commit\"</codinitAction>"
127+
}
128+
]
129+
},
130+
131+
"supabase": {
132+
"version": "1.0.0",
133+
"category": "database",
134+
"status": "production",
135+
"frameworks": ["all"],
136+
"environments": ["web", "electron"],
137+
"requires": ["supabase-connection"],
138+
"description": "Perform database operations: create migrations, execute SQL queries, or manage database schema. Supports PostgreSQL SQL syntax for Supabase backend.",
139+
"operations": {
140+
"migration": "Create a new database migration file",
141+
"query": "Execute a SQL query directly"
142+
},
143+
"invocation": "<codinitAction type=\"supabase\" operation=\"migration|query\">SQL content</codinitAction>",
144+
"parameters": {
145+
"properties": {
146+
"operation": {
147+
"type": "string",
148+
"enum": ["migration", "query"],
149+
"description": "Operation type: 'migration' to create a migration file, 'query' to execute SQL",
150+
"example": "migration"
151+
},
152+
"content": {
153+
"type": "string",
154+
"description": "SQL code for the operation",
155+
"example": "CREATE TABLE users (id uuid PRIMARY KEY, name text);"
156+
}
157+
},
158+
"required": ["operation", "content"],
159+
"type": "object"
160+
},
161+
"examples": [
162+
{
163+
"description": "Create a database migration",
164+
"code": "<codinitAction type=\"supabase\" operation=\"migration\">\nCREATE TABLE users (\n id uuid PRIMARY KEY DEFAULT gen_random_uuid(),\n name text NOT NULL,\n email text UNIQUE,\n created_at timestamp DEFAULT now()\n);\n</codinitAction>"
165+
},
166+
{
167+
"description": "Create authentication tables",
168+
"code": "<codinitAction type=\"supabase\" operation=\"migration\">\nCREATE TABLE auth_users (\n id uuid PRIMARY KEY,\n email text UNIQUE NOT NULL,\n password_hash text,\n created_at timestamp DEFAULT now()\n);\n</codinitAction>"
169+
}
170+
]
171+
},
172+
173+
"mcp-tools": {
174+
"version": "1.0.0",
175+
"category": "extensibility",
176+
"status": "production",
177+
"frameworks": ["all"],
178+
"environments": ["web", "electron"],
179+
"requires": [],
180+
"description": "Model Context Protocol (MCP) tools provide extensibility through external MCP servers. Available tools depend on configured MCP servers. Common available tools include Supabase database, Stripe payments, GitHub operations, and more.",
181+
"configuration": "Configured through the MCP settings panel in the application",
182+
"available_servers": [
183+
{
184+
"name": "Supabase",
185+
"tools": "Database queries, table management, RLS policies",
186+
"transport": "SSE"
187+
},
188+
{
189+
"name": "Claude Code",
190+
"tools": "Code search, file operations, terminal access",
191+
"transport": "stdio"
192+
},
193+
{
194+
"name": "Stripe",
195+
"tools": "Payment processing, subscription management",
196+
"transport": "streamable-http"
197+
},
198+
{
199+
"name": "PostHog",
200+
"tools": "Analytics, event tracking",
201+
"transport": "streamable-http"
202+
}
203+
],
204+
"invocation": "MCP tools are invoked directly by name (after LLM function calling capability is enabled)",
205+
"note": "These tools are optional and must be explicitly configured by the user. Not all users have MCP servers available."
206+
}
207+
}

0 commit comments

Comments
 (0)