MCPcopy Create free account
hub / github.com/QodeXcli/QodeX / buildStyleBlock

Function buildStyleBlock

src/context/style-profile.ts:182–196  ·  view source on GitHub ↗
(p: StyleProfile | null)

Source from the content-addressed store, hash-verified

180
181/** Build the compact system-prompt block. Empty when confidence is too low to bother. */
182export function buildStyleBlock(p: StyleProfile | null): string {
183 if (!p || p.confidence < 0.2) return '';
184 const indent = p.indent.type === 'tab' ? 'tabs' : `${p.indent.width}-space`;
185 const lines = [
186 '# Code style (match the project)',
187 '',
188 `Write new code in this project's existing style — inferred from its source${p.fromEditorConfig ? ' + .editorconfig' : ''}:`,
189 `- Indentation: ${indent}`,
190 `- Strings: ${p.quotes === 'mixed' ? 'mixed (match the file you edit)' : p.quotes + ' quotes'}`,
191 `- Semicolons: ${p.semicolons ? 'yes' : 'no (omit them)'}`,
192 `- Identifiers: ${p.naming === 'mixed' ? 'match the surrounding file' : p.naming}`,
193 'Follow the project\'s linter/formatter config if one exists; when in doubt, match the file you are editing.',
194 ];
195 return lines.join('\n');
196}

Callers 2

buildInitialMessagesMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected