Skip to content

Commit d5d00f0

Browse files
committed
chore: remove codebuff.json and repurpose /init
1 parent 76cf928 commit d5d00f0

File tree

22 files changed

+59
-873
lines changed

22 files changed

+59
-873
lines changed

.agents/base/ask.ts

Lines changed: 1 addition & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -99,17 +99,7 @@ Messages from the system are surrounded by <system>${closeXml('system')} or <sys
9999
100100
## Verifying Your Changes at the End of Your Response
101101
102-
### User has a \`codebuff.json\`
103-
104-
If the user has a \`codebuff.json\` with the appropriate \`fileChangeHooks\`, there is no need to run any commands.
105-
106-
If the \`fileChangeHooks\` are not configured, inform the user about the \`fileChangeHooks\` parameter.
107-
108-
### User has no \`codebuff.json\`
109-
110-
If this is the case, inform the user know about the \`/init\` command (within Codebuff, not a terminal command).
111-
112-
Check the knowledge files to see if the user has specified a further protocol for what terminal commands should be run to verify edits. For example, a \`knowledge.md\` file could specify that after every change you should run the tests or linting or run the type checker. If there are multiple commands to run, you should run them all using '&&' to concatenate them into one commands, e.g. \`npm run lint && npm run test\`.
102+
Check the knowledge files to see if the user has specified a protocol for what commands should be run to verify edits. If so, follow it. Otherwise, suggest the most relevant checks for the change.
113103
114104
## Example Response (Simplified - Demonstrating Rules)
115105
@@ -152,18 +142,6 @@ What is included in knowledge files:
152142
153143
If the user sends you the url to a page that is helpful now or could be helpful in the future (e.g. documentation for a library or api), you should always save the url in a knowledge file for future reference. Any links included in knowledge files are automatically scraped and the web page content is added to the knowledge file.
154144
155-
# Codebuff Configuration (codebuff.json)
156-
157-
## Schema
158-
159-
The following describes the structure of the \`./codebuff.json\` configuration file that users might have in their project root. You can use this to understand user settings if they mention them.
160-
161-
${PLACEHOLDER.CONFIG_SCHEMA}
162-
163-
## Background Processes
164-
165-
The user does not have access to these outputs. Please display any pertinent information to the user before referring to it.
166-
167145
${PLACEHOLDER.FILE_TREE_PROMPT}
168146
169147
${PLACEHOLDER.SYSTEM_INFO_PROMPT}

.agents/base/base-prompts.ts

Lines changed: 1 addition & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -104,16 +104,6 @@ ${
104104
105105
## Verifying Your Changes at the End of Your Response
106106
107-
### User has a \`codebuff.json\`
108-
109-
If the user has a \`codebuff.json\` with the appropriate \`fileChangeHooks\`, there is no need to run any commands.
110-
111-
If the \`fileChangeHooks\` are not configured, inform the user about the \`fileChangeHooks\` parameter.
112-
113-
### User has no \`codebuff.json\`
114-
115-
If this is the case, inform the user know about the \`/init\` command (within Codebuff, not a terminal command).
116-
117107
Check the knowledge files to see if the user has specified a further protocol for what terminal commands should be run to verify edits. For example, a \`knowledge.md\` file could specify that after every change you should run the tests or linting or run the type checker. If there are multiple commands to run, you should run them all using '&&' to concatenate them into one commands, e.g. \`npm run lint && npm run test\`.
118108
119109
## Example Response (Simplified - Demonstrating Rules)
@@ -202,15 +192,7 @@ Once again: BE CONCISE!
202192
203193
If the user sends you the url to a page that is helpful now or could be helpful in the future (e.g. documentation for a library or api), you should always save the url in a knowledge file for future reference. Any links included in knowledge files are automatically scraped and the web page content is added to the knowledge file.
204194
205-
# Codebuff Configuration (codebuff.json)
206-
207-
## Schema
208-
209-
The following describes the structure of the \`./codebuff.json\` configuration file that users might have in their project root. You can use this to understand user settings if they mention them.
210-
211-
${PLACEHOLDER.CONFIG_SCHEMA}
212-
213-
## Background Processes
195+
# Background Processes
214196
215197
The user does not have access to these outputs. Please display any pertinent information to the user before referring to it.
216198

.agents/types/secret-agent-definition.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ export interface SecretAgentDefinition
2323
const placeholderNames = [
2424
'AGENT_NAME',
2525
'AGENTS_PROMPT',
26-
'CONFIG_SCHEMA',
2726
'FILE_TREE_PROMPT_SMALL',
2827
'FILE_TREE_PROMPT',
2928
'FILE_TREE_PROMPT_LARGE',

cli/src/commands/__tests__/command-args.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ describe('command factory pattern', () => {
161161
})
162162

163163
test('expected commands ignore args', () => {
164-
const expectedNoArgs = ['login', 'logout', 'exit', 'init', 'usage']
164+
const expectedNoArgs = ['login', 'logout', 'exit', 'usage', 'init']
165165
for (const name of expectedNoArgs) {
166166
const cmd = COMMAND_REGISTRY.find((c) => c.name === name)
167167
expect(cmd, `Command ${name} should exist`).toBeDefined()

cli/src/commands/init.ts

Lines changed: 27 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,51 @@
11
import { existsSync, writeFileSync } from 'fs'
22
import path from 'path'
33

4-
import {
5-
codebuffConfigFile,
6-
INITIAL_CODEBUFF_CONFIG,
7-
} from '@codebuff/common/json-config/constants'
8-
94
import { getProjectRoot } from '../project-files'
105
import { getSystemMessage } from '../utils/message-history'
116

127
import type { PostUserMessageFn } from '../types/contracts/send-message'
138

9+
const KNOWLEDGE_FILE_NAME = 'knowledge.md'
10+
11+
const INITIAL_KNOWLEDGE_FILE = `# Project knowledge
12+
13+
This file gives Codebuff context about your project: goals, commands, conventions, and gotchas.
14+
15+
## Quickstart
16+
- Setup:
17+
- Dev:
18+
- Test:
19+
20+
## Architecture
21+
- Key directories:
22+
- Data flow:
23+
24+
## Conventions
25+
- Formatting/linting:
26+
- Patterns to follow:
27+
- Things to avoid:
28+
`
29+
1430
export function handleInitializationFlowLocally(): {
1531
postUserMessage: PostUserMessageFn
1632
} {
1733
const projectRoot = getProjectRoot()
18-
const configPath = path.join(projectRoot, codebuffConfigFile)
34+
const knowledgePath = path.join(projectRoot, KNOWLEDGE_FILE_NAME)
1935

20-
if (existsSync(configPath)) {
36+
if (existsSync(knowledgePath)) {
2137
const postUserMessage: PostUserMessageFn = (prev) => [
2238
...prev,
23-
getSystemMessage(`📋 ${codebuffConfigFile} already exists.`),
39+
getSystemMessage(`📋 \`${KNOWLEDGE_FILE_NAME}\` already exists.`),
2440
]
25-
return {
26-
postUserMessage,
27-
}
41+
return { postUserMessage }
2842
}
2943

30-
// Create the config file
31-
writeFileSync(configPath, JSON.stringify(INITIAL_CODEBUFF_CONFIG, null, 2))
44+
writeFileSync(knowledgePath, INITIAL_KNOWLEDGE_FILE)
3245

3346
const postUserMessage: PostUserMessageFn = (prev) => [
3447
...prev,
35-
getSystemMessage(`✅ Created \`${codebuffConfigFile}\``),
48+
getSystemMessage(`✅ Created \`${KNOWLEDGE_FILE_NAME}\``),
3649
]
3750
return { postUserMessage }
3851
}

cli/src/data/slash-commands.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ export const SLASH_COMMANDS: SlashCommand[] = [
2424
{
2525
id: 'init',
2626
label: 'init',
27-
description: 'Configure project for better results',
27+
description: 'Create a starter knowledge.md file',
2828
},
2929
{
3030
id: 'logout',

codebuff.json

Lines changed: 0 additions & 69 deletions
This file was deleted.

common/src/json-config/__tests__/__snapshots__/stringify-schema.test.ts.snap

Lines changed: 0 additions & 153 deletions
This file was deleted.

0 commit comments

Comments
 (0)