Skip to content

Commit e6fa558

Browse files
committed
fix: improve instructions and change kilocode to automode
1 parent 17183ef commit e6fa558

File tree

4 files changed

+54
-50
lines changed

4 files changed

+54
-50
lines changed

src/assistant-kickoff/build-initial-prompt.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,14 +39,15 @@ First steps:
3939
7. Use the LangWatch MCP to learn about prompt management and testing
4040
8. Start implementing the core agent functionality
4141
9. Instrument the agent with LangWatch
42-
10. Use Scenario tests to ensure the agent is working as expected, integrate with the agent and consider it done only when all scenarios pass
43-
11. If available from the framework, open a dev server for the user in the background and give them the url so they can play with the agent themselves
42+
10. Use Scenario tests to ensure the agent is working as expected, integrate with the agent and consider it done only when all scenarios pass, check scenario docs on how to implement
43+
11. If available from the framework, tell the user how to open a dev server give them the url they will be able to access so they can play with the agent themselves, don't run it for them
4444
4545
4646
Remember:
47+
- The LLM and LangWatch API keys are already available in the .env file, you don't need to set them up
4748
- ALWAYS use LangWatch Prompt CLI for prompts (ask the MCP how)
4849
- ALWAYS write Scenario tests for new features (ask the MCP how)
49-
- The LLM and LangWatch API keys are already available in the .env file
50+
- DO NOT test it "manually", always use the Scenario tests instead, do not open the dev server for the user, let them do it themselves only at the end of the implementation with everything working
5051
- Test everything before considering it done`;
5152

5253
return `${instructions}\n\nAgent Goal: ${config.projectGoal}`;

src/config-collection/collect-config.ts

Lines changed: 48 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,53 @@ export const collectConfig = async (): Promise<ProjectConfig> => {
5252
})),
5353
});
5454

55+
const selectedProvider = allProviders.find((p) => p.id === llmProvider);
56+
const providerDisplayName = selectedProvider?.displayName || llmProvider;
57+
58+
if (selectedProvider?.apiKeyUrl) {
59+
logger.userInfo(`To get your ${providerDisplayName} API key, visit:`);
60+
logger.userInfo(`${selectedProvider.apiKeyUrl}`);
61+
}
62+
63+
const llmApiKey = await password({
64+
message: `Enter your ${providerDisplayName} API key:`,
65+
mask: "*",
66+
validate:
67+
llmProvider === "openai"
68+
? validateOpenAIKey
69+
: (value) => {
70+
if (!value || value.length < 5) {
71+
return "API key is required and must be at least 5 characters";
72+
}
73+
return true;
74+
},
75+
});
76+
77+
// Collect additional credentials if the provider needs them
78+
let llmAdditionalInputs: Record<string, string> | undefined;
79+
if (
80+
selectedProvider?.additionalCredentials &&
81+
selectedProvider.additionalCredentials.length > 0
82+
) {
83+
llmAdditionalInputs = {};
84+
85+
for (const credential of selectedProvider.additionalCredentials) {
86+
if (credential.type === "password") {
87+
llmAdditionalInputs[credential.key] = await password({
88+
message: `Enter your ${credential.label}:`,
89+
mask: "*",
90+
validate: credential.validate,
91+
});
92+
} else {
93+
llmAdditionalInputs[credential.key] = await input({
94+
message: `Enter your ${credential.label}:`,
95+
default: credential.defaultValue,
96+
validate: credential.validate,
97+
});
98+
}
99+
}
100+
}
101+
55102
const codingAssistant = await select<CodingAssistant>({
56103
message:
57104
"What is your preferred coding assistant for building the agent?",
@@ -123,52 +170,7 @@ export const collectConfig = async (): Promise<ProjectConfig> => {
123170
}
124171
}
125172

126-
const selectedProvider = allProviders.find((p) => p.id === llmProvider);
127-
const providerDisplayName = selectedProvider?.displayName || llmProvider;
128-
129-
if (selectedProvider?.apiKeyUrl) {
130-
logger.userInfo(`To get your ${providerDisplayName} API key, visit:`);
131-
logger.userInfo(`${selectedProvider.apiKeyUrl}`);
132-
}
133-
134-
const llmApiKey = await password({
135-
message: `Enter your ${providerDisplayName} API key:`,
136-
mask: "*",
137-
validate:
138-
llmProvider === "openai"
139-
? validateOpenAIKey
140-
: (value) => {
141-
if (!value || value.length < 5) {
142-
return "API key is required and must be at least 5 characters";
143-
}
144-
return true;
145-
},
146-
});
147-
148-
// Collect additional credentials if the provider needs them
149-
let llmAdditionalInputs: Record<string, string> | undefined;
150-
if (
151-
selectedProvider?.additionalCredentials &&
152-
selectedProvider.additionalCredentials.length > 0
153-
) {
154-
llmAdditionalInputs = {};
155-
156-
for (const credential of selectedProvider.additionalCredentials) {
157-
if (credential.type === "password") {
158-
llmAdditionalInputs[credential.key] = await password({
159-
message: `Enter your ${credential.label}:`,
160-
mask: "*",
161-
validate: credential.validate,
162-
});
163-
} else {
164-
llmAdditionalInputs[credential.key] = await input({
165-
message: `Enter your ${credential.label}:`,
166-
default: credential.defaultValue,
167-
validate: credential.validate,
168-
});
169-
}
170-
}
171-
}
173+
logger.userInfo("✔︎ Your coding assistant will finish setup later if needed\n");
172174

173175
logger.userInfo("To get your LangWatch API key, visit:");
174176
logger.userInfo("https://app.langwatch.ai/authorize");

src/documentation/sections/principles-section.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ Best practices:
2929
- When broken, run on single scenario at a time to debug and iterate faster, not the whole suite
3030
- Write as few scenarios as possible, try to cover more ground with few scenarios, as they are heavy to run
3131
- If user made 1 request, just 1 scenario might be enough, run it at the end of the implementation to check if it works
32+
- ALWAYS consult the Scenario docs on how to write scenarios, do not assume the syntax
3233
3334
### 2. Prompt Management
3435

src/providers/coding-assistants/kilocode/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ export const KilocodeCodingAssistantProvider: CodingAssistantProvider = {
4141
logger.userInfo(`🤖 Launching ${this.displayName}...`);
4242
// Launch kilocode with full terminal control
4343
// This blocks until kilocode exits
44-
ProcessUtils.launchWithTerminalControl("kilocode", [prompt], {
44+
ProcessUtils.launchWithTerminalControl("kilocode", ["-a", prompt], {
4545
cwd: projectPath,
4646
});
4747
logger.userSuccess("Session complete!");

0 commit comments

Comments
 (0)