Skip to content

Commit 2c97dc8

Browse files
Lling0000yallalaraja
authored andcommitted
docs: integrate license and workflow examples
Integrates the useful parts of PR #8, #9, and #10 with cleanup. Adds a dual-license model, practical AGENTS.md examples, and a safer worktree walkthrough. Regenerates the English and Chinese PDF guides so published artifacts stay in sync. Co-authored-by: yallalaraja <121497045+yallalaraja@users.noreply.github.com>
1 parent 4ca28d9 commit 2c97dc8

7 files changed

Lines changed: 373 additions & 5 deletions

LICENSE-CONTENT

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
Creative Commons Attribution 4.0 International
2+
3+
Documentation, guides, PDFs, and written instructional content in this
4+
repository are licensed under the Creative Commons Attribution 4.0
5+
International License (CC BY 4.0).
6+
7+
You are free to share and adapt the material, including translations and
8+
derivative works, as long as appropriate credit is given.
9+
10+
License deed:
11+
https://creativecommons.org/licenses/by/4.0/
12+
13+
Legal code:
14+
https://creativecommons.org/licenses/by/4.0/legalcode
15+
16+
SPDX-License-Identifier: CC-BY-4.0

README.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,4 +182,9 @@ Good contributions make the guide more concrete, verifiable, and useful in real
182182

183183
## License
184184

185-
No license has been specified for this repository yet. Until a license is added by the repository owner, do not assume redistribution or reuse rights beyond normal GitHub viewing and contribution workflows.
185+
This repository uses a dual-license model:
186+
187+
- Documentation, guides, PDFs, and written instructional content are licensed under [CC BY 4.0](./LICENSE-CONTENT).
188+
- Website code, scripts, styles, and other software source files are licensed under the [MIT License](./LICENSE).
189+
190+
If a file does not say otherwise, use the license that matches its primary purpose: written guide content uses CC BY 4.0; executable or reusable code uses MIT.

README_zh.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,4 @@
1010
- [中文完整教程](./vibe-coding-guide-zh.md)
1111
- [网站学习清单](https://lling0000.github.io/Vibe_coding_guide/)
1212
- [English README](./README.md)
13+
- [许可证说明](./README.md#license)

vibe-coding-guide-en.md

Lines changed: 175 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -332,7 +332,106 @@ Avoid:
332332

333333
Keep `AGENTS.md` short enough to be useful. Around 200-400 lines is often enough for a real project.
334334

335-
### 3.8 Which Language Should You Write It In?
335+
### 3.8 Concrete Examples
336+
337+
Here are three small, tool-neutral examples you can adapt. The important part is not the exact wording; it is that every rule prevents a specific failure mode.
338+
339+
**Small library**
340+
341+
```markdown
342+
# AGENTS.md
343+
344+
## Project Overview
345+
346+
This is a small TypeScript library for parsing invoice numbers.
347+
It is published to npm and used by downstream billing systems.
348+
349+
## Commands
350+
351+
- Test: `npm test`
352+
- Typecheck: `npm run typecheck`
353+
- Build: `npm run build`
354+
355+
## Rules
356+
357+
- Do not change exported function names or argument shapes without updating `CHANGELOG.md`.
358+
- Keep runtime dependencies at zero unless the maintainer approves a new dependency.
359+
- Add tests for every new parser rule, including one invalid input case.
360+
- Preserve support for Node.js 18.
361+
```
362+
363+
What these rules prevent:
364+
365+
- accidental breaking changes in public APIs
366+
- unnecessary dependency bloat in a small package
367+
- parser fixes that only cover the happy path
368+
- code that passes locally but breaks for supported users
369+
370+
**Web app**
371+
372+
```markdown
373+
# AGENTS.md
374+
375+
## Project Overview
376+
377+
This is a Next.js web app with a PostgreSQL database.
378+
User-facing routes live in `app/`; shared UI lives in `components/`.
379+
380+
## Commands
381+
382+
- Dev server: `npm run dev`
383+
- Test: `npm test`
384+
- Lint and typecheck: `npm run check`
385+
386+
## Rules
387+
388+
- Do not put database queries directly in route components; use `lib/services/`.
389+
- Do not edit existing migration files. Add a new migration instead.
390+
- Keep form validation in the shared schema file, not duplicated in components.
391+
- Before changing auth, read `docs/auth-flow.md` and mention the affected flow in the PR.
392+
```
393+
394+
What these rules prevent:
395+
396+
- UI code bypassing service-layer rules
397+
- migration history becoming unsafe for deployed environments
398+
- frontend and backend validation drifting apart
399+
- accidental auth regressions from local-looking changes
400+
401+
**Documentation-first repo**
402+
403+
```markdown
404+
# AGENTS.md
405+
406+
## Project Overview
407+
408+
This repository is primarily a written guide with Markdown, PDFs, and a small static site.
409+
Treat prose changes like product changes: preserve clarity, structure, and reader trust.
410+
411+
## Commands
412+
413+
- Check links: use the repository's documented link checker, if one exists.
414+
- Build site: use the repository's documented static-site build command, if one exists.
415+
- If no automated command exists, manually open the edited pages and verify navigation, links, and downloads.
416+
417+
## Rules
418+
419+
- Keep English and translated docs structurally aligned when editing shared sections.
420+
- Do not rewrite the author's voice unless the task asks for tone editing.
421+
- Prefer small, reviewable wording changes over broad rewrites.
422+
- When adding examples, explain the failure mode each example prevents.
423+
- If the repository ships generated PDFs or static pages, update those artifacts or explicitly note why they were left unchanged.
424+
```
425+
426+
What these rules prevent:
427+
428+
- translations drifting away from the source guide
429+
- style-flattening that makes the guide less recognizable
430+
- huge documentation diffs that are hard to review
431+
- examples that sound useful but do not teach a concrete lesson
432+
- Markdown changes that silently leave PDFs or website output stale
433+
434+
### 3.9 Which Language Should You Write It In?
336435

337436
**Short answer: agents don't care.** They read English, Chinese, mixed, and other languages equally well. The choice is a team UX question, not a technical one.
338437

@@ -1230,7 +1329,7 @@ Create a setup script:
12301329
#!/usr/bin/env bash
12311330
set -euo pipefail
12321331

1233-
cp ../../main-repo/.env .
1332+
cp /path/to/main-repo/.env .
12341333
npm ci
12351334
```
12361335

@@ -1274,6 +1373,80 @@ Do not use worktrees when:
12741373

12751374
The bottleneck is still human review bandwidth. More agents are not useful if nobody can review the output.
12761375

1376+
### 9.6 Command-Level Walkthrough
1377+
1378+
Example: you have three independent issues in one repo:
1379+
1380+
- `auth-copy`: improve login error copy
1381+
- `pricing-tests`: add missing tests for pricing rules
1382+
- `docs-api`: update API usage docs
1383+
1384+
Create one branch and one directory per task from your main worktree:
1385+
1386+
```bash
1387+
mkdir -p ../wt
1388+
1389+
git worktree add -b agent/auth-copy ../wt/auth-copy main
1390+
git worktree add -b agent/pricing-tests ../wt/pricing-tests main
1391+
git worktree add -b agent/docs-api ../wt/docs-api main
1392+
1393+
git worktree list
1394+
```
1395+
1396+
Then start one agent in each directory:
1397+
1398+
```bash
1399+
# Terminal A
1400+
cd ../wt/auth-copy
1401+
# Agent A: "Read AGENTS.md and specs/auth-copy.md. Only edit login copy and related tests."
1402+
1403+
# Terminal B
1404+
cd ../wt/pricing-tests
1405+
# Agent B: "Read AGENTS.md and specs/pricing-tests.md. Add tests only; do not change pricing logic."
1406+
1407+
# Terminal C
1408+
cd ../wt/docs-api
1409+
# Agent C: "Read AGENTS.md and specs/docs-api.md. Update docs only; do not edit runtime code."
1410+
```
1411+
1412+
The split matters more than the tool. Codex, Claude Code, Cursor, Aider, or a terminal-based agent can all follow the same pattern: one task, one branch, one worktree, one focused prompt.
1413+
1414+
Before launching the agents, do a quick overlap check:
1415+
1416+
```text
1417+
auth-copy -> app/login/**, tests/login/**
1418+
pricing-tests -> tests/pricing/**
1419+
docs-api -> docs/api/**
1420+
```
1421+
1422+
If two tasks both need `app/login/form.tsx`, do not run them in parallel. Sequence them, or make one task wait for the other branch to merge.
1423+
1424+
Review and clean up one task at a time:
1425+
1426+
```bash
1427+
cd ../wt/pricing-tests
1428+
git status
1429+
git diff
1430+
npm test
1431+
git add .
1432+
git commit -m "test: cover pricing rules"
1433+
1434+
# Return to your main worktree. Replace this path with your actual repo path.
1435+
cd /path/to/main-repo
1436+
git merge agent/pricing-tests
1437+
git worktree remove ../wt/pricing-tests
1438+
git branch -d agent/pricing-tests
1439+
```
1440+
1441+
If your project does not use `npm test`, replace that command with the test or verification command documented in the repo.
1442+
1443+
Common mistakes:
1444+
1445+
- assigning multiple agents tasks that edit the same files
1446+
- letting every agent "clean up" unrelated code
1447+
- forgetting that each worktree needs its own setup, env files, and ports
1448+
- merging all branches before reviewing each diff
1449+
12771450
---
12781451

12791452
## 10. Creating Skills

vibe-coding-guide-en.pdf

609 KB
Binary file not shown.

0 commit comments

Comments
 (0)