Skip to content

Commit 1ac6780

Browse files
committed
feat(docs): add documentation site at apps/docs
- Add apps/docs Nuxt project using docs-please layer - Add docs-please as git submodule at ref/docs-please - Add workspace reference to docs-please layer - Create comprehensive documentation content: - Getting Started (introduction, installation, quick-start) - Guides (claude-code-hooks, auto-formatting, lsp-diagnostics, mcp-server) - Configuration (overview, formatter-config, lsp-config) - Reference (cli-commands, supported-languages, api) - Configure Cloudflare Pages deployment with D1 database Closes #53
1 parent 06366c2 commit 1ac6780

30 files changed

Lines changed: 4764 additions & 454 deletions

.gitmodules

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,6 @@
1313
[submodule "ref/oh-my-opencode"]
1414
path = ref/oh-my-opencode
1515
url = https://github.com/code-yeongyu/oh-my-opencode
16+
[submodule "ref/docs-please"]
17+
path = ref/docs-please
18+
url = https://github.com/pleaseai/docs.git

apps/docs/.gitignore

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# Nuxt dev/build outputs
2+
.output
3+
.data
4+
.nuxt
5+
.nitro
6+
.cache
7+
dist
8+
9+
# Node dependencies
10+
node_modules
11+
12+
# Logs
13+
logs
14+
*.log
15+
16+
# Misc
17+
.DS_Store
18+
.fleet
19+
.idea
20+
21+
# Local env files
22+
.env
23+
.env.*
24+
!.env.example
25+
26+
# Wrangler
27+
.wrangler
28+
.dev.vars

apps/docs/app/app.config.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
export default defineAppConfig({
2+
docs: {
3+
title: 'Code Please',
4+
description: 'Auto-format and type-check hooks for AI coding',
5+
github: {
6+
owner: 'chatbot-pf',
7+
name: 'code-please',
8+
url: 'https://github.com/chatbot-pf/code-please',
9+
branch: 'main',
10+
},
11+
},
12+
})
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
title: Documentation
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
title: Getting Started
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
---
2+
title: Introduction
3+
description: Learn about Code Please and its features
4+
---
5+
6+
# Introduction
7+
8+
**Code Please** is a CLI tool and Claude Code plugin for AI-assisted coding. It provides automatic formatting and LSP diagnostics that integrate seamlessly with Claude Code's hook system.
9+
10+
## What is Code Please?
11+
12+
When you use Claude Code to write or edit files, Code Please can:
13+
14+
1. **Auto-format** your code using the appropriate formatter (Biome, Prettier, gofmt, etc.)
15+
2. **Check for errors** using Language Server Protocol diagnostics (TypeScript, Python, Go, etc.)
16+
17+
This feedback happens automatically after each file edit, giving Claude real-time information about code quality.
18+
19+
## Packages
20+
21+
Code Please consists of four packages:
22+
23+
| Package | Description |
24+
|---------|-------------|
25+
| `@pleaseai/code` | Main CLI tool with format and lsp commands |
26+
| `@pleaseai/code-format` | Formatter orchestration for 20+ formatters |
27+
| `@pleaseai/code-lsp` | LSP client for 30+ language servers |
28+
| `@pleaseai/dora` | MCP server for JetBrains IDE integration |
29+
30+
## How It Works
31+
32+
Code Please integrates with Claude Code via [PostToolUse hooks](https://docs.anthropic.com/en/docs/build-with-claude/claude-code/hooks). When Claude uses the `Write` or `Edit` tool:
33+
34+
1. Claude Code sends the file info to Code Please via stdin
35+
2. Code Please formats the file and/or checks for errors
36+
3. Results are shown to Claude as hook output
37+
38+
This creates a feedback loop where Claude can see and fix issues immediately.
39+
40+
## Next Steps
41+
42+
- [Installation](/docs/getting-started/installation) - Install Code Please
43+
- [Quick Start](/docs/getting-started/quick-start) - Set up Claude Code hooks
Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
---
2+
title: Installation
3+
description: Install Code Please globally or locally
4+
---
5+
6+
# Installation
7+
8+
Code Please can be installed globally or as a project dependency.
9+
10+
## Global Installation
11+
12+
Install globally to use across all projects:
13+
14+
::code-group
15+
```bash [npm]
16+
npm install -g @pleaseai/code
17+
```
18+
19+
```bash [bun]
20+
bun add -g @pleaseai/code
21+
```
22+
23+
```bash [pnpm]
24+
pnpm add -g @pleaseai/code
25+
```
26+
::
27+
28+
Verify installation:
29+
30+
```bash
31+
code version
32+
```
33+
34+
## Local Installation
35+
36+
Install as a dev dependency for project-specific use:
37+
38+
::code-group
39+
```bash [npm]
40+
npm install -D @pleaseai/code
41+
```
42+
43+
```bash [bun]
44+
bun add -D @pleaseai/code
45+
```
46+
47+
```bash [pnpm]
48+
pnpm add -D @pleaseai/code
49+
```
50+
::
51+
52+
Then use via `npx`:
53+
54+
```bash
55+
npx @pleaseai/code format src/index.ts
56+
```
57+
58+
## Requirements
59+
60+
- **Node.js** 20+ or **Bun** 1.0+
61+
- Language-specific tools for formatting (e.g., `biome`, `prettier`)
62+
- Language servers for LSP diagnostics (auto-detected or auto-downloaded)
63+
64+
## Next Steps
65+
66+
- [Quick Start](/docs/getting-started/quick-start) - Set up Claude Code hooks
Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
---
2+
title: Quick Start
3+
description: Set up Code Please with Claude Code in minutes
4+
---
5+
6+
# Quick Start
7+
8+
Get Code Please working with Claude Code in just a few steps.
9+
10+
## Step 1: Install Code Please
11+
12+
```bash
13+
npm install -g @pleaseai/code
14+
```
15+
16+
## Step 2: Configure Claude Code Hooks
17+
18+
Add the following to your `.claude/settings.json`:
19+
20+
```json
21+
{
22+
"hooks": {
23+
"PostToolUse": [
24+
{
25+
"matcher": "Write|Edit",
26+
"hooks": [
27+
{
28+
"type": "command",
29+
"command": "npx @pleaseai/code format --stdin"
30+
},
31+
{
32+
"type": "command",
33+
"command": "npx @pleaseai/code lsp --stdin"
34+
}
35+
]
36+
}
37+
]
38+
}
39+
}
40+
```
41+
42+
Or copy the example hooks file:
43+
44+
```bash
45+
cp node_modules/@pleaseai/code/hooks/hooks.json .claude/
46+
```
47+
48+
## Step 3: Start Coding
49+
50+
Now when Claude writes or edits files:
51+
52+
1. Files are automatically formatted using the appropriate formatter
53+
2. Type errors and diagnostics are reported back to Claude
54+
3. Claude can see and fix issues immediately
55+
56+
## Example Output
57+
58+
When Claude edits a TypeScript file with an error:
59+
60+
```
61+
✗ 1 error found
62+
✗ src/index.ts:15:7 [TS2322]: Type 'string' is not assignable to type 'number'
63+
```
64+
65+
Claude sees this feedback and can fix the issue in the same conversation.
66+
67+
## CLI Usage
68+
69+
You can also use Code Please directly from the command line:
70+
71+
```bash
72+
# Format a file
73+
code format src/index.ts
74+
75+
# Get LSP diagnostics
76+
code lsp src/index.ts
77+
```
78+
79+
## Next Steps
80+
81+
- [Claude Code Hooks](/docs/guides/claude-code-hooks) - Learn more about hook configuration
82+
- [Auto-Formatting](/docs/guides/auto-formatting) - Configure formatters
83+
- [LSP Diagnostics](/docs/guides/lsp-diagnostics) - Configure language servers
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
title: Guides

0 commit comments

Comments
 (0)