Skip to content

Commit a8175ca

Browse files
committed
Revamp documentation, creating distinct sections for API tools and chatbot initialization
1 parent 37b5d35 commit a8175ca

17 files changed

Lines changed: 1157 additions & 1431 deletions

README.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -13,29 +13,29 @@
1313
<a href="https://codeweb.chat/" target="_blank"><strong>Documentation</strong></a>
1414
</div>
1515

16-
## <span style="background-color: #fbb100; color: black; padding: 0.2em 0.6em; border-radius: 999px">What is CWC?</span>
17-
18-
CWC is a non-agentic coding tool for AI-assisted programming built by an independent developer.
16+
Meet CWC, a non-agentic coding tool for AI-assisted programming built by an independent developer.
1917

2018
🧩 Works with VS Code and its derivatives (e.g., Cursor, Windsurf)<br />
2119
✌️ 100% free and open source!
2220

23-
<p><img src="https://github.com/robertpiosik/CodeWebChat/raw/HEAD/packages/shared/src/media/flow.png" alt="Flow" /></p>
24-
2521
**Guiding Principles:**
2622

27-
- initialize popular chatbots—but don't game them
23+
- initialize popular chatbots—don't scrape responses
2824
- API tools—battle-tested must-haves
29-
- respect privacy—zero tracking
30-
- lightweight—under 2MB
25+
- respect privacy—don't track users
26+
- lightweight—about ~1MB of code
3127

3228
**CWC is for you if:**
3329

3430
- you're an experienced engineer working on a large codebase
3531
- you're a student or hobbyist who thrives on the intricate aspects of coding
3632
- you love open source software! 🫶
3733

38-
<p><img src="https://github.com/robertpiosik/CodeWebChat/raw/HEAD/packages/shared/src/media/demo.gif" alt="Walkthrough" /></p>
34+
<p>
35+
<img src="https://github.com/robertpiosik/CodeWebChat/raw/HEAD/packages/shared/src/media/demo.gif" alt="Walkthrough" />
36+
</p>
37+
38+
<img src="https://github.com/robertpiosik/CodeWebChat/raw/HEAD/packages/shared/src/media/flow.png" alt="Flow" />
3939

4040
## <span style="background-color: #fbb100; color: black; padding: 0.2em 0.6em; border-radius: 999px">Context selection</span>
4141

docs/api-tools/_category_.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"label": "API tools",
3+
"position": 4
4+
}
Lines changed: 19 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,35 @@
11
---
2-
title: Code Completions
3-
sidebar_position: 2
2+
title: Code completions
3+
sidebar_position: 1
44
---
55

66
import Tabs from '@theme/Tabs'
77
import TabItem from '@theme/TabItem'
88

99
# Code completions
1010

11-
The tool is designed to provide you with the highest quality autocomplete suggestions at the cost of latency. Intented to be used on-demand through the Tools tab, via the command palette or a keybinding. Setup multiple configurations and choose between them based on difficulty of the completion.
11+
The best quality inline suggestions at the cost of latency. Designed to be used on demand.
12+
13+
✓ Includes selected context<br />
14+
✓ Works with any model
15+
16+
Designed to be used:
17+
18+
- on-demand in the Home tab,
19+
- via the command palette,
20+
- keybindings you set up for<br/>
21+
`Code Web Chat: Code Completion` and<br/>
22+
`Code Web Chat: Code Completion using...` commands.
1223

1324
## API message structure
1425

1526
```
27+
Find correct replacement for <missing text> symbol. Respond with replacement text in "replacement" XML tags, without explanations or any other text.
1628
<files>
17-
<text title="...">...</text>
18-
// other websites...
19-
<file path="...">...</file>
20-
// other files excl. current editor...
29+
<text title="...">...</text> // selected websites
30+
...
31+
<file path="...">...</file> // selected workspace files excluding current editor
32+
...
2133
<file path="..."> // current editor
2234
...
2335
<missing text> // cursor position
Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
---
2-
title: Generate Commit Message
3-
sidebar_position: 5
2+
title: Commit messages
3+
sidebar_position: 4
44
---
55

6-
Generate meaningful commit messages precisely adhering to your preffered style.
6+
Generate meaningful commit messages precisely adhering to your preferred style.
7+
8+
✓ Includes affected files in full<br />
9+
✓ Customizable instructions
710

811
## API message structure
912

docs/api-tools/index.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
---
2+
sidebar_position: 3
3+
hide_table_of_contents: true
4+
---
5+
6+
# API tools
7+
8+
CWC includes battle-tested must-have API tools.
9+
10+
### [Code completions](./code-completions)
11+
12+
The best quality inline suggestions at the cost of latency. Designed to be used on demand.
13+
14+
### [Refactoring](./refactoring)
15+
16+
Modify files based on natural language instructions.
17+
18+
### [Intelligent update]('./intelligent-update)
19+
20+
Update files based on code blocks in truncated edit format and fix malformed diffs.
21+
22+
### [Commit messages](./commit-messages)
23+
24+
Generate meaningful commit messages precisely adhering to your preffered style.
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
---
2+
title: Intelligent update
3+
sidebar_position: 3
4+
---
5+
6+
Update files based on code blocks in truncated edit format and fix malformed diffs.
7+
8+
✓ Regenerates whole files in concurrent API calls<br />
9+
✓ Smaller models like Gemini Flash are sufficient

docs/api-tools/refactoring.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
---
2+
title: Refactoring
3+
sidebar_position: 2
4+
---
5+
6+
Modify files based on natural language instructions.
7+
8+
✓ Includes selected context<br />
9+
✓ Multi-file updates in a single API call<br />
10+
✓ Efficient in output tokens—requests diffs
11+
12+
## API message structure
13+
14+
```
15+
[INSTRUCTIONS] // User's natural language instructions (and optional selected text)
16+
Whenever proposing a file use the markdown code block syntax. Each code block should be a diff patch. Do not send explanations.
17+
<files>
18+
<file path="...">...</file> // context, including current editor
19+
...
20+
</files>
21+
[INSTRUCTIONS] // User's natural language instructions (and optional selected text)
22+
Whenever proposing a file use the markdown code block syntax. Each code block should be a diff patch. Do not send explanations.
23+
```
24+
25+
## Available commands
26+
27+
- `Code Web Chat: Refactor` - Modify files based on natural language instructions.

docs/chatbot-initialization.mdx

Lines changed: 130 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,130 @@
1+
---
2+
title: Chatbot initialization
3+
sidebar_position: 3
4+
---
5+
6+
import Tabs from '@theme/Tabs'
7+
import TabItem from '@theme/TabItem'
8+
9+
Code with your favorite chatbot without tedious copy-pasting and apply responses with a single click.
10+
11+
## Prompts in modes of operation
12+
13+
<Tabs groupId="mode">
14+
<TabItem value="general" label="General">
15+
16+
```
17+
[INSTRUCTIONS]
18+
<files>
19+
<text title="...">...</text> // selected websites
20+
...
21+
<file path="...">...</file> // selected workspace files
22+
...
23+
</files>
24+
[INSTRUCTIONS]
25+
```
26+
27+
</TabItem>
28+
<TabItem value="code completions" label="Code completions">
29+
30+
```
31+
Find correct replacement text for the <missing text> symbol. Correctly formatted response begins with a code block containing replacement text end then proceeds with explanation. Always refer to symbol "<missing_text>" as "cursor position" and "replacement" as "completion".
32+
<files>
33+
<text title="...">...</text> // selected websites
34+
...
35+
<file path="...">...</file> // selected workspace files excluding current editor
36+
...
37+
<file path="..."> // current editor
38+
...
39+
<missing text> // cursor position
40+
...
41+
</file>
42+
</files>
43+
Find correct replacement text for the <missing text> symbol. Correctly formatted response begins with a code block containing replacement text end then proceeds with explanation. Always refer to symbol "<missing_text>" as "cursor position" and "replacement" as "completion".
44+
```
45+
46+
</TabItem>
47+
</Tabs>
48+
49+
<hr />
50+
51+
For model's better adherence to instructions, they're palced at both ends of the prompt.<br />
52+
[OpenAI Cookbook/Prompt Organization](https://cookbook.openai.com/examples/gpt4-1_prompting_guide#prompt-organization)
53+
54+
:::tip Practice single-turns
55+
56+
Chat conversations are only a construct of product interfaces, they hurt the quality of responses from the model and once your context is "poisoned" it will not recover. Whenever you're not satisfied with a reponse, **the best practice is to alawys refine your initial instructions and re-initialize a chat**.
57+
58+
:::
59+
60+
## Edit formats
61+
62+
Additional instructions are appended to your prompt in "General" mode, instructing the model to response in an appropriate format. They can be customized in your `settings.json` file.
63+
64+
### Truncated
65+
66+
`codeWebChat.editFormatInstructionsTruncated`
67+
68+
> Whenever proposing a file use the markdown code block syntax and always add file path in the first line comment. Use ellipsis comments, e.g. "// ...", when appropriate.
69+
70+
### Whole
71+
72+
`codeWebChat.editFormatInstructionsWhole`
73+
74+
> Whenever proposing a file use the markdown code block syntax and always add file path in the first line comment. Please show me the full code of the changed files, I have a disability which means I can't type and need to be able to copy and paste the full code.
75+
76+
### Diff
77+
78+
`codeWebChat.editFormatInstructionsDiff`
79+
80+
> Whenever proposing a file use the markdown code block syntax. Each code block should be a diff patch.
81+
82+
## Presets
83+
84+
Preset is a web chat configuration (chatbot, model, system instructions, temperature, etc.). With the use of prefixes and suffixes, they can serve specific purpose in your workflow.
85+
86+
## Applying chat responses
87+
88+
With CWC, you can automatically integrate multi-file changes with the codebase.
89+
90+
Strategy depends on detected edit format:
91+
92+
- **truncated:** Uses Intelligent Update API tool placing the original file before changes which serve as instructions for a full file rewrite.
93+
- **whole:** Simply replaces original files in place.
94+
- **diff:** Uses the `git apply` utility before falling back to a custom diff processor.
95+
96+
## Available commands
97+
98+
##### `Code Web Chat: Web Chat`
99+
100+
Opens a chat session in your browser with the current context and prompt.
101+
102+
##### `Code Web Chat: Web Chat with...`
103+
104+
Lets you select which AI platform to use for your chat session.
105+
106+
##### `Code Web Chat: Chat to Clipboard`
107+
108+
Instead of opening a chat directly, copies the context and prompt to your clipboard for manual pasting.
109+
110+
##### `Code Web Chat: Apply Chat Response`
111+
112+
Applies changes to the current file using the default model.
113+
114+
##### `Code Web Chat: Revert Last Applied Changes`
115+
116+
Reverts files to their state before the last application of changes.
117+
118+
## Settings
119+
120+
##### `Code Web Chat: Edit Format Instructions Truncated`
121+
122+
Style instructions for chat responses when using truncated format.
123+
124+
##### `Code Web Chat: Edit Format Instructions Whole`
125+
126+
Style instructions for chat responses when showing complete files.
127+
128+
##### `Code Web Chat: Edit Format Instructions Diff`
129+
130+
Whenever proposing a file use the markdown code block syntax. Each code block should be a diff patch.

docs/context-selection.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
---
2+
title: Context selection
3+
sidebar_position: 2
4+
---
5+
6+
Context is something you constantly adjust as you code. CWC makes it simple by using the file explorer you already know.
7+
8+
**Selected items are structured using XML formatting:**
9+
10+
```
11+
<files>
12+
<text title="...">...</text> // selected websites
13+
...
14+
<file path="...">...</file> // selected workspace files
15+
...
16+
</files>
17+
```
18+
19+
**Context is attached with:**
20+
21+
- web chats
22+
- refactoring and code completions API tools
23+
24+
## Available commands
25+
26+
##### `Code Web Chat: Copy Context`
27+
28+
Copy XML-structured files to clipboard.

docs/context.md

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

0 commit comments

Comments
 (0)