Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
62 changes: 62 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
# Contributing

This page is for people who change the code. To use the program, start with the [README](README.md). Terms are defined in the [glossary](docs/glossary_EN.md).

## Set up

1. Use Python 3.12, the version CI uses (`.github/workflows/ci.yml`).
2. Install the requirements and pytest:
```bash
python -m pip install -r requirements.txt pytest
```
3. Copy the example config. `config.yaml` is local only and is never committed:
```bash
cp config.example.yaml config.yaml
```

## Before you commit

Run the same checks CI runs:

```bash
python -m pytest -q
python -m ruff check --select E9,F auto_dev_crew scripts tests
```

Install ruff with `python -m pip install ruff==0.17.1` (the version pinned in CI). CI runs the test job on Windows, so tests that use paths or processes should pass there too.

If you changed the GUI, also run `python scripts/gui_smoke.py` while the GUI is open (see [tools-and-scripts.md](docs/tools-and-scripts_EN.md)).

## Rules

- Never commit `config.yaml`, `.env`, or any key.
- Never force-push.
- Never push straight to the default branch. Merge only through a pull request.
- Never delete or skip a test. If a test looks wrong, stop and ask the owner.
- Branches that the agent creates start with `ai/`. Name your own branches differently.

## Project layout

- `auto_dev_crew/`: the package. `runner.py` runs the job queue, clone, agent call, tests, PRs, merge, and reports. `gui.py` is the local web GUI.
- `prompts/`: prompts for issue work, test fixes, and the personas.
- `scripts/`: helper scripts, such as `gui_smoke.py` and `gui_e2e.py`.
- `tests/`: the pytest suite.
- `docs/`: documentation. Each page has an English file (`NAME_EN.md`) and a Thai file (`NAME_TH.md`) with the same name.
- `config.example.yaml`: the tracked config template.
- `state/`: local job history (`state/history.json`). It is not committed.

## Where things are

- [docs/architecture_EN.md](docs/architecture_EN.md): how one job flows through the runner, the slots, the quality gates, and the merge decision.
- [docs/configuration_EN.md](docs/configuration_EN.md): every setting and its default.
- [docs/tools-and-scripts_EN.md](docs/tools-and-scripts_EN.md): the test suite, CI jobs, and helper scripts.
- [docs/github-workflow_EN.md](docs/github-workflow_EN.md): labels, the life of an issue, and feature plans.
- `prompts/`: the prompts for issue work, test fixes, and personas. `prompts/_rules.md` holds the rules the agent follows when it edits code.

## Pull requests

Describe what changed and why. Include the output of the checks above. A bug fix should come with a test that fails before the fix and passes after it.

## Documentation

When you change an English page, change its Thai pair with the same name in the same pull request. Keep the headings and links in the same order in both files of a pair. The root `README.md` and `README_TH.md` follow the same rule.
249 changes: 40 additions & 209 deletions README.md

Large diffs are not rendered by default.

109 changes: 0 additions & 109 deletions README.th.md

This file was deleted.

60 changes: 60 additions & 0 deletions README_TH.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
# Auto Dev Crew 🤖

**Auto Dev Crew คือเอเจนต์เขียนโค้ด AI ที่รันในเครื่องของคุณ** รับงานจาก GitHub issue แล้วเปิด pull request ให้ เมื่อไม่มี issue รอ [ตัวละคร](docs/glossary_TH.md) ทั้งสี่ (⚡🛡️🎨🧪) จะสแกนโค้ดเองและหาจุดที่ควรปรับปรุง

**ภาษา:** [English](README.md) · ภาษาไทย (ไฟล์นี้)

> **สถานะ:** โครงการทดลอง เป็น repository แบบส่วนตัว

## ความต้องการของระบบ
- Python 3.12 (เวอร์ชันที่ CI ใช้)
- Git
- GitHub CLI (`gh`) ล็อกอินด้วย `gh auth login`
- Antigravity CLI (`agy`) เป็นเอนจิน AI หลัก
- แพ็กเกจ Python ที่ระบุใน `requirements.txt`

## ติดตั้ง
1. ติดตั้งสิ่งที่ต้องมีด้านบน
2. ในโฟลเดอร์โปรเจกต์ รัน `pip install -r requirements.txt`
3. คัดลอก `config.example.yaml` เป็น `config.yaml` แล้วตั้ง `owner` เป็นชื่อ GitHub ของคุณ ไฟล์ `config.yaml` อยู่ในเครื่องของคุณและไม่ถูก commit

## สั่งงานให้เอเจนต์
- เปิด issue ใน repository เป้าหมายแล้วติดป้าย `ai-task` เฉพาะ issue ที่เปิดโดยบัญชี `owner` เท่านั้นที่นับ
- เพื่อหยุดเอเจนต์ ติดป้าย `ai-pause` บน issue ที่เปิดอยู่ใดก็ได้ ปิด issue นั้นเพื่อให้ทำงานต่อ

## วิธีรัน
เปิด GUI บนเว็บในเครื่อง ระบบรับการเชื่อมต่อเฉพาะ `127.0.0.1`:
```bash
python -m auto_dev_crew.gui
```
ระบบจะเปิด http://127.0.0.1:8765 ในเบราว์เซอร์ ตัวเลือก: `--port`, `--no-browser`, `--auto`

หรือใช้คำสั่ง:
```bash
python -m auto_dev_crew --dry-run # ทดลองในเครื่อง ไม่แตะ GitHub
python -m auto_dev_crew # ทำ 1 งาน แล้วเปิด PR
python -m auto_dev_crew --loop # ทำต่อจนไม่มีงานเหลือ
```

## การตั้งค่าที่ควรแก้ก่อน
| การตั้งค่า | ค่าเริ่มต้น | ความหมาย |
|---|---|---|
| `owner` | `example-owner` (ค่าตัวอย่าง) | ชื่อ GitHub ของคุณ ระบบจะหยิบเฉพาะ issue จากบัญชีนี้ |
| `merge_mode` | `review-all` | `review-all` เปิด PR อย่างเดียว · `small-only` merge เองเฉพาะ PR เล็ก · `merge-all` merge เองเมื่อ CI ผ่าน |
| `parallel.slots` | `3` | จำนวนช่องทำงานที่รันพร้อมกัน |

คีย์ของผู้ให้บริการ AI ใส่ในไฟล์ `.env` คัดลอกชื่อตัวแปรจาก `.env.example` ห้ามวางค่าคีย์ลงใน issue, log หรือเอกสาร

## รันเทสต์
```bash
python -m pip install -r requirements.txt pytest
python -m pytest -q
```

## อ่านเพิ่มเติม
- [คำศัพท์](docs/glossary_TH.md): คำนิยามสั้น ๆ ของศัพท์ในโครงการ
- [ดัชนีเอกสาร](docs/README_TH.md): ทุกหน้า เริ่มจาก [หน้าเกี่ยวกับ](docs/ABOUT_TH.md)
- [การตั้งค่า](docs/configuration_TH.md): ทุกคีย์และค่าเริ่มต้น
- [คู่มือ GUI](docs/gui_TH.md) และ [คำสั่งบรรทัดคำสั่ง](docs/cli_TH.md)
- [การมีส่วนร่วม](CONTRIBUTING.md): กฎ การตรวจก่อน commit และโครงสร้างโปรเจกต์ (ภาษาอังกฤษ)
- [REQUIREMENTS.md](REQUIREMENTS.md): ร่างการออกแบบฉบับแรก เก็บไว้เป็นประวัติ ไม่ใช่สเปกปัจจุบัน
43 changes: 43 additions & 0 deletions STATE-github-docs-skill.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# STATE: github-docs skill (Library Router)

## Goal
Build a deep, reusable skill `github-docs` in the Library Router catalog. When the user asks in this app to "write documentation" for a repo, the agent reads the code, verifies every claim, writes Thai and English docs, runs checks, and opens a PR. It may also cover release notes and repo About text. Chosen approach: option 1 (one broad skill with reference files per doc type).

## Open
- [ ] Write the full design doc (file path TBD, under docs/superpowers/specs or the catalog) — AI · ready
- [ ] User approves the design doc — user · needs-approval
- [ ] Build skill dir + check_links.py / check_claims.py / release-notes length check — AI · needs-approval (after approval)
- [ ] Add to catalog and sync with scripts/sync_local_skills.py, then verify search returns it — AI · needs-approval
- [ ] Decide where the skill lives: a local source folder read by the sync script (e.g. ~/.claude/skills) vs. the catalog checkout — user · ready

## In progress (for the next agent)
Research done, no files written. Comparison:
- github/awesome-copilot documentation-writer: Diataxis, no code checks, no PR flow.
- antinomyhq/forge write-release-notes: GitHub release/PR fetch, length check (under 2000 chars).
- Our edge: claim checks, link checks, bilingual pairs, PR/release flow in one skill.

## Done (verified unless noted)
- DATAelectricWORKs: PR #203 (user guide + README EN/TH) merged, commit 17d8650.
- DATAelectricWORKs: PR #204 (build script + launcher) merged, commit c28bc9c.
- Release v1.0.0 asset rebuilt from c28bc9c; checksum matches 1ee624a7…c409c4; exe health 200.
- Repo description and topics set. Not verified: upload flow in the exe; guide screenshots.

## Files
- C:\Users\Smart\Documents\DATAelectricWORKs (README*, docs\USER_GUIDE_*, packaging\, tests\test_launcher.py)
- Router skill: C:\Users\Smart\.claude\skills\library-router-plugin\skills\router\SKILL.md
- Catalog checkout: C:\Users\Smart\Documents\ChatGPT\test (scripts\sync_local_skills.py)

## How to check
restart: read this file, then write the design doc. Do not build before approval.
- cd C:\Users\Smart\Documents\DATAelectricWORKs; python -m unittest discover -s tests -p "test_*.py" (expect 203 tests, 1 skipped)
- gh release view v1.0.0 -R OkayOkay101/DATAelectricWORKs

## Decisions
- Work starts from this app (not @claude on GitHub). Build the skill in the Library Router.
- Option 1: one broad skill with reference files, not a skill family.
- Release and PR steps: merge only after the user says so; replace release assets only after a build check.

## Summary
- เป้าหมาย: สร้างสกิล github-docs ใน Library Router ให้เขียนเอกสาร GitHub ได้ลึก
- ค้นสกิลคล้ายกันแล้ว ยังไม่มีตัวไหนตรวจกับโค้ดและทำ PR ครบ
- รอคุณอนุมัติ design doc ก่อนสร้างสกิล
11 changes: 7 additions & 4 deletions STATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,15 @@ Auto Dev Crew: local GUI (`auto_dev_crew/gui.py`) + runner. Thai and English UI
- [x] B6 endpoint `/api/github/*` และ `github_login.py` ที่ UI ไม่ใช้: ลบแล้ว 2026-11-18 (อนุมัติโดยผู้ใช้)
- [x] B7 ลบ route `/classic` แล้ว 2026-11-18 (อนุมัติโดยผู้ใช้) — ไฟล์ `static/index.html` ยังอยู่เพราะ test_gui_layout และ test_api_crud ยังอ่านไฟล์นี้ (ไม่ถูกเสิร์ฟ)
- [x] B8 ลบ `deploy/oracle/` และ config.yaml ที่ผูกกับ Oracle ออกจาก git (commit `6d9e186`); เหลือ `config.example.yaml` เป็นไฟล์ tracked
- [x] B9 ทำเอกสารให้ตรงกับโค้ด: README หลักเป็นภาษาอังกฤษ, ภาษาไทยอยู่ทั้งใน README.md (ส่วนท้าย) และ `README.th.md`; GitHub description เป็นภาษาอังกฤษ (2026-11-18)
- [ ] B10 ให้คนที่อ่านภาษาอังกฤษได้ตรวจ `docs/en/` และ README.md ส่วนอังกฤษ (ยังไม่ได้ทำ; ผู้ช่วยทำเองไม่ได้)
- [x] B9 ทำเอกสารให้ตรงกับโค้ด: README หลักเป็นภาษาอังกฤษ, README.md เป็นอังกฤษอย่างเดียว ภาษาไทยอยู่ใน `README_TH.md` (`README.th.md` ถูกลบแล้ว `f32b0e2`); GitHub description เป็นภาษาอังกฤษ (2026-11-18)
- [ ] B10 ให้คนที่อ่านภาษาอังกฤษได้ตรวจ `docs/*_EN.md` และ README.md ส่วนอังกฤษ (ยังไม่ได้ทำ; ผู้ช่วยทำเองไม่ได้)
- [ ] B11 เทียบเอกสารไทย/อังกฤษทีละประโยค (ตรวจแล้วแค่ส่วนที่มีความต่างชัดเจนและ token ในโค้ด)

## In progress
- ไม่มี งานที่ค้างอยู่ระหว่างทำ
- Task: github-docs pass on this repo (user approved outline 2026-11-18: pairs NAME_EN/NAME_TH, whole set in one round, release notes skipped). Done in working tree; not committed.
- Next step: user decides commit branch and PR (not done). Then B10 native-speaker review, B11 sentence-by-sentence sync.
- Files: `C:\Users\Smart\Documents\auto-dev-crew-clean\README.md`, `...\README_TH.md`, `...\docs\ABOUT.md`
- Watch out (2026-11-18, after rename): README pair passes check_bilingual. Pairs are `NAME_EN.md` / `NAME_TH.md` in `docs/`; anchors differ by language, so per-page check_bilingual flags anchor text (checker limitation). Not committed yet.

## Done (verified)
- Commits: `60f941c` (login + ฐาน i18n), `badfc44` (ADC_INIT, /api/i18n, /api/settings/language, แปล 46 ข้อความ error ฝั่ง backend), `890be71` (แก้ flaky test fake_sleep), `6d9e186` (ลบ Oracle/GitHub login), `e054139`, `eedfc7d` (sync เอกสาร และ gate 3/4 wording), `fed6d2b` (README อังกฤษหลัก), `dab0da5` (handoff)
Expand All @@ -32,7 +35,7 @@ Auto Dev Crew: local GUI (`auto_dev_crew/gui.py`) + runner. Thai and English UI
## Files
- Core: `auto_dev_crew/i18n.py`, `i18n_routes.py`, `locales/en.json`, `static/i18n.js`
- gui.py: `_inject_adc_init`, `set_config_path`, route `/api/i18n`, `/api/settings/language`
- README: `README.md` (อังกฤษ + ไทย), `README.th.md` (ไทย)
- README: `README.md` (อังกฤษ), `README_TH.md` (ไทย)
- Handoff: `docs/HANDOFF.md`
- Plan: `docs/superpowers/plans/2026-11-18-bilingual-th-en.md`; spec: `docs/superpowers/specs/2026-11-18-bilingual-th-en-design.md`

Expand Down
12 changes: 6 additions & 6 deletions docs/en/ABOUT.md → docs/ABOUT_EN.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# About Auto Dev Crew

This document explains what the program does, how it works, where AI is used (both to build it and at runtime), and which parts of the GUI are still incomplete. Installation steps and commands are in the [README](../../README.md). Requirements are in [REQUIREMENTS.md](../../REQUIREMENTS.md), which is an early draft (see [the index](README.md)).
This document explains what the program does, how it works, where AI is used (both to build it and at runtime), and which parts of the GUI are still incomplete. Installation steps and commands are in the [README](../README.md). Requirements are in [REQUIREMENTS.md](../REQUIREMENTS.md), which is an early draft (see [the index](README_EN.md)).

> Status: **experimental project, not production-ready.** The repository is private.

Expand Down Expand Up @@ -56,16 +56,16 @@ GitHub issue (ai-task) or deep-scan / persona

- **Slots:** up to three jobs run at the same time. Slot 1 handles issues you request. Slots 2 and 3 handle personas or extra issues.
- **F6 failover:** when one provider's quota is used up, the agent moves to the next engine in the configured order.
- **Quality gates 1–4:** gate 1, the judge confirms a bug is real before a fix (only when the issue names an existing file); gate 2, the judge reviews the whole file after the fix; gate 3, the change must touch a file the issue names (applies to every issue run); gate 4, deep-scan re-checks findings before an automatic issue is created. See [architecture](architecture.md#6-quality-gates) for the code details and [troubleshooting](troubleshooting.md) row 16 for the GUI wording mismatch.
- **Quality gates 1–4:** gate 1, the judge confirms a bug is real before a fix (only when the issue names an existing file); gate 2, the judge reviews the whole file after the fix; gate 3, the change must touch a file the issue names (applies to every issue run); gate 4, deep-scan re-checks findings before an automatic issue is created. See [architecture](architecture_EN.md#6-quality-gates) for the code details and [troubleshooting](troubleshooting_EN.md) row 16 for the GUI wording mismatch.
- **ai-plan:** a proposed feature waiting for approval. When approved, the system creates `ai-task` issues for it.
- **ai-pause:** add this label to any issue to stop new work in that repository.
- **Memory:** `state/history.json` records what was already proposed and how it turned out. It is not committed.

### Boundaries and safety

- The GUI listens only on `127.0.0.1`. Actions that change data (POST) need a token embedded in the page.
- The GUI listens only on `127.0.0.1`. Actions that change data (POST) need a token embedded in the page, and some read endpoints that read repo data also need it.
- API keys live in `.env`, which is git-ignored.
- Autonomous-mode hooks for Claude Code block `git push`, `gh pr merge`, `gh release`, `deploy`, `git reset --hard`, `git clean -f`, recursive deletes (`rm -r…`, `Remove-Item -Recurse`, `del /s`), and deletion of the autonomous flag file. They do **not** single out force-push.
- The rules against force-push and direct pushes to `main` are written in this documentation. The guard script for autonomous mode (`scripts/autonomous_guard_hook.py`) blocks `git push`, `gh pr merge`, `gh release`, `deploy`, `git reset --hard`, `git clean -f`, recursive deletes (`rm -r…`, `Remove-Item -Recurse`, `del /s`), and deletion of the autonomous flag file. They do **not** single out force-push.
- Code written by the agent must pass tests, quality gates, and CI before merging. It has **not** undergone a professional security audit.

---
Expand All @@ -76,7 +76,7 @@ GitHub issue (ai-task) or deep-scan / persona

- Many parts of the project were done together with AI: the GUI translation, removing the password login, and fixing a flaky test. Progress is recorded in `STATE.md` and `docs/superpowers/`.
- The developer set the goals, made architecture decisions, and checked the results.
- The most recent recorded test run (2026-11-18) was `pytest`: **1442 passed, 6 skipped**.
- The most recent recorded test run (2026-11-18) was `pytest`: **1401 passed, 6 skipped**.
- **AI-written code can still contain bugs or security issues nobody has found yet.** Read and test it before relying on it.

The program **also uses AI while it runs**. It sends code from the target repository to the configured AI providers (Antigravity, OpenCode, NVIDIA Build, Pollinations.ai, Mistral, and others). Code from those repositories therefore leaves your machine and is processed by those providers under their terms.
Expand Down Expand Up @@ -104,6 +104,6 @@ If you find a GUI problem that is not in this table, treat it as not yet checked
## 5. Before you use it

- **Never commit or share `.env`.** Do not print key values into logs or chat.
- `config.yaml` holds owner-specific settings and should not be committed to a public repository. It is no longer tracked by git (removed in `6d9e186`).
- `config.yaml` holds owner-specific settings and and the README says it should not be committed. It is no longer tracked by git (removed in `6d9e186`).
- Automatic merging (`merge-all`) can put unreviewed code into the main branch. Start with `review-all`.
- Run `--dry-run` first whenever you change settings or add a new repository.
Loading
Loading