vibe-governor 1.3.0 → 1.3.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +137 -80
- package/bin/vibe-governor.cjs +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,115 +1,172 @@
|
|
|
1
|
-
# 🛡️ Vibe Governor
|
|
1
|
+
# 🛡️ Vibe Governor
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
[](https://www.npmjs.com/package/vibe-governor)
|
|
4
|
+
[](https://github.com/SafakSahinn/vibe-governor/blob/main/LICENSE)
|
|
4
5
|
|
|
5
|
-
|
|
6
|
+
**English** · [Türkçe](https://github.com/SafakSahinn/vibe-governor/blob/main/BENIOKU.md)
|
|
6
7
|
|
|
7
|
-
|
|
8
|
+
Guardrails for AI-assisted ("vibe coding") projects, both software and hardware (Verilog/VHDL).
|
|
9
|
+
Vibe Governor installs one shared rule set for all your AI coding assistants, a **Memory Bank** that
|
|
10
|
+
keeps project context between sessions, and a **checker** that blocks commits breaking the rules
|
|
11
|
+
(oversized files, `any`, `unsafe`, `gets()`, latches, …).
|
|
8
12
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
- Çoklu AI Asistan Desteği: AGENTS.md standardı, Claude Code, Gemini CLI, Google Antigravity, Cursor, Windsurf/Devin, Cline, GitHub Copilot
|
|
12
|
-
- Diller: C, C++, C#, Java, JavaScript, TypeScript, Python, Go, Rust, Kotlin, Swift, PHP ve HDL (Verilog, VHDL)
|
|
13
|
+
- **Web wizard:** https://safaksahinn.github.io/vibe-governor/ (pick your settings, preview every file, download a ZIP or copy a one-line command)
|
|
14
|
+
- **CLI:** `npx vibe-governor init` (no install, no dependencies, Node.js 18+)
|
|
13
15
|
|
|
14
|
-
|
|
15
|
-
- Ayarlanabilir Dosya Satır Tavanı (Varsayılan 800 satır)
|
|
16
|
-
- Dokümantasyon Kalite Barajı (Varsayılan 8/10)
|
|
17
|
-
- Dile Özel Güvenlik Anahtarları (23 anahtar): C güvensiz fonksiyonlar ve malloc NULL kontrolü, C++ ham işaretçi, C# dynamic/async void, Java istisna/loglama, JavaScript var/==, TypeScript any, Python tip ipuçları/global, Go hata kontrolü, Rust unsafe/clone, Kotlin !!/GlobalScope, Swift zorla açma, PHP strict_types/eval/hazırlanmış SQL, HDL atama, latch ve VHDL duyarlılık listesi
|
|
16
|
+
## Why
|
|
18
17
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
- `productContext.md`: Çözülen Problem ve Kullanıcı Deneyimi
|
|
22
|
-
- `systemPatterns.md`: Mimari Desenler, Modül Hiyerarşisi, Veri Akışı
|
|
23
|
-
- `techContext.md`: Teknolojiler, Bağımlılıklar, Derleme Komutları
|
|
24
|
-
- `activeContext.md`: Mevcut Odak, Son Yapılanlar, Sıradaki Adımlar
|
|
25
|
-
- `progress.md`: Çalışan Modüller, Tamamlanış Oranı, Teknik Borçlar
|
|
26
|
-
- Tek tıkla hazır örneklerle doldurma (`Pre-fill`)
|
|
18
|
+
AI assistants forget the project between sessions, each tool reads its own rule file, and nothing
|
|
19
|
+
stops a model from growing a 2,000-line file or sprinkling `any` everywhere. Vibe Governor fixes all three:
|
|
27
20
|
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
- `.gitignore`: Memory bank korumalı git konfigürasyonu
|
|
21
|
+
| Problem | What you get |
|
|
22
|
+
|---|---|
|
|
23
|
+
| Every tool has its own rule format | One `AI_GUIDELINES.md`, referenced from each tool's file in its current documented format |
|
|
24
|
+
| Context is lost between sessions | `.memory_bank/` with 6 files the assistant reads first and updates as it works |
|
|
25
|
+
| Rules are only suggestions | `scripts/check_guidelines.py` + a pre-commit hook + optional GitHub Actions CI that fail on violations |
|
|
34
26
|
|
|
35
|
-
|
|
36
|
-
- İnteraktif Dosya Ağacı (Tree View) ve Arama/Filtreleme
|
|
37
|
-
- Satır numaralı, syntax-aware Kod Ön İzleme, Tekil Dosya İndirme ve Kopyalama
|
|
38
|
-
- **Proje Paketini İndir (.ZIP):** Tarayıcı tarafında JSZip ile eksiksiz klasör yapılı `.zip` paketi
|
|
39
|
-
- **Tek Satır CLI Komutu Üretimi**
|
|
27
|
+
## Quick start
|
|
40
28
|
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
## 📖 Uygulama İçi Rehber
|
|
44
|
-
|
|
45
|
-
Sağ üstteki **Rehber / Guide** butonu; uygulamanın ne yaptığını, ne işe yaradığını, 5 adımın nasıl çalıştığını, üretilen dosyaları, kurulumu, günlük akışı, denetçi kurallarını ve SSS’yi iki dilde anlatır.
|
|
46
|
-
|
|
47
|
-
## ⌨️ CLI (Tek Satır Kurulum)
|
|
48
|
-
|
|
49
|
-
Sihirbazın 5. adımındaki komut, tüm seçimleri `--preset` ile taşır ve aynı dosyaları doğrudan proje klasörüne yazar (Node.js 18+):
|
|
29
|
+
Run inside your project folder:
|
|
50
30
|
|
|
51
31
|
```bash
|
|
52
|
-
npx
|
|
53
|
-
# veya preset olmadan:
|
|
54
|
-
npx -y vibe-governor init --name=my-app --languages=Rust,Verilog --lang=en
|
|
32
|
+
npx vibe-governor init
|
|
55
33
|
```
|
|
56
34
|
|
|
57
|
-
|
|
58
|
-
- Mevcut dosyalar korunur (`--force` ile üzerine yazılır), `--dry-run` sadece listeler.
|
|
59
|
-
- Tüm seçimler `vibe-governor.json` dosyasına kaydedilir. Sonradan değiştirmek için:
|
|
60
|
-
`npx -y vibe-governor update --max-lines=600 --enable=tsNoAny --disable=includeGitHubCI`
|
|
61
|
-
Elle düzenlenmiş dosyalar korunur (yeni sürüm `<dosya>.vibe-new` olarak yazılır), Memory Bank'e dokunulmaz, seçimden çıkan araçların değiştirilmemiş dosyaları kaldırılır.
|
|
62
|
-
- Sihirbazdaki **Yapılandırma Yükle** düğmesi bir projenin `vibe-governor.json` dosyasını forma geri yükler.
|
|
35
|
+
Languages are detected from your files (`npx vibe-governor detect` shows them). Or set things explicitly:
|
|
63
36
|
|
|
64
|
-
|
|
37
|
+
```bash
|
|
38
|
+
npx vibe-governor init --name=my-app --languages=Rust,Verilog --lang=en
|
|
39
|
+
```
|
|
65
40
|
|
|
66
|
-
|
|
67
|
-
- Satır içi istisna: `// vibe-ignore: ts_any`, bir alt satır için `vibe-ignore-next-line`, tüm dosya için ilk 10 satırda `vibe-ignore-file: line_limit`. Her bulgunun sonunda kural kimliği yazar.
|
|
68
|
-
- Pre-commit kancası `--staged` ile yalnızca commit'e giren dosyaların hazırlanmış içeriğini denetler; kod değişip `.memory_bank/` güncellenmediyse uyarır.
|
|
41
|
+
The web wizard's last step gives you a command with all of your choices encoded:
|
|
69
42
|
|
|
70
|
-
|
|
43
|
+
```bash
|
|
44
|
+
npx -y vibe-governor init --preset=<value copied from the wizard>
|
|
45
|
+
```
|
|
71
46
|
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
47
|
+
If the folder is a git repository, `.git/hooks/pre-commit` is installed automatically (`--no-hook` to skip).
|
|
48
|
+
Existing files are never overwritten unless you pass `--force`; `--dry-run` only lists what would be written.
|
|
49
|
+
|
|
50
|
+
## What gets generated
|
|
51
|
+
|
|
52
|
+
| File | Purpose |
|
|
53
|
+
|---|---|
|
|
54
|
+
| `AI_GUIDELINES.md` | The rule set, built only from the languages and switches you selected |
|
|
55
|
+
| `AGENTS.md`, `CLAUDE.md`, `GEMINI.md` | AGENTS.md standard, Claude Code, Gemini CLI |
|
|
56
|
+
| `.agents/rules/vibe-governor.md` | Google Antigravity |
|
|
57
|
+
| `.cursor/rules/vibe-governor.mdc` | Cursor (`alwaysApply: true`) |
|
|
58
|
+
| `.windsurf/rules/vibe-governor.md` | Windsurf / Devin (`trigger: always_on`) |
|
|
59
|
+
| `.clinerules/vibe-governor.md` | Cline |
|
|
60
|
+
| `.github/copilot-instructions.md` | GitHub Copilot |
|
|
61
|
+
| `.memory_bank/*.md` | `projectbrief`, `productContext`, `systemPatterns`, `techContext`, `activeContext`, `progress` |
|
|
62
|
+
| `scripts/check_guidelines.py` | Static checker (Python 3.8+, no dependencies) |
|
|
63
|
+
| `scripts/pre-commit-hook.sh` | Runs the checker on staged content only |
|
|
64
|
+
| `.github/workflows/ai-guidelines-ci.yml` | Same checks in CI |
|
|
65
|
+
| `AUDIT_PROMPT.md` | Prompt for a technical-debt review by a frontier model |
|
|
66
|
+
| `vibe-governor.json` | Your settings + hashes of generated files, used by `update` |
|
|
67
|
+
|
|
68
|
+
Only the files for the tools you select are written.
|
|
69
|
+
|
|
70
|
+
## Supported languages and checker rules
|
|
71
|
+
|
|
72
|
+
C, C++, C#, Java, JavaScript, TypeScript, Python, Go, Rust, Kotlin, Swift, PHP, Verilog, VHDL —
|
|
73
|
+
or no language at all (e.g. a pure documentation or hardware-planning repo); then only the
|
|
74
|
+
language-independent rules apply (line limit, Memory Bank, documentation, tests).
|
|
75
|
+
|
|
76
|
+
| Language | Rule ids |
|
|
77
|
+
|---|---|
|
|
78
|
+
| C | `c_unsafe_funcs` (no `gets`/`strcpy`/`strcat`/`sprintf`), `c_malloc_check` (NULL check after allocation) |
|
|
79
|
+
| C++ | `cpp_raw_ptr` (no raw `new`/`delete`, `reinterpret_cast`) |
|
|
80
|
+
| C# | `cs_no_dynamic`, `cs_no_async_void` |
|
|
81
|
+
| Java | `java_exceptions` (no empty/generic catch), `java_no_sysout` |
|
|
82
|
+
| JavaScript | `js_no_var`, `js_strict_eq` |
|
|
83
|
+
| TypeScript | `ts_any` |
|
|
84
|
+
| Python | `py_type_hints`, `py_no_global` (no global state / wildcard imports) |
|
|
85
|
+
| Go | `go_errors` |
|
|
86
|
+
| Rust | `rust_unsafe`, `rust_clone` |
|
|
87
|
+
| Kotlin | `kt_no_bang`, `kt_no_globalscope` |
|
|
88
|
+
| Swift | `swift_no_force` (no `!`, `try!`, `as!`) |
|
|
89
|
+
| PHP | `php_strict_types`, `php_no_eval`, `php_prepared` (no interpolated SQL) |
|
|
90
|
+
| Verilog | `verilog_assign` (`<=` sequential, `=` combinational), `verilog_latch` (`case` needs `default`) |
|
|
91
|
+
| VHDL | `vhdl_numeric_std`, `vhdl_sensitivity` (complete sensitivity lists) |
|
|
92
|
+
| All | `line_limit` (default 800 lines per file) |
|
|
93
|
+
|
|
94
|
+
Each rule can be switched off in the wizard or with `--disable=<switch>`.
|
|
95
|
+
|
|
96
|
+
## Changing settings later
|
|
97
|
+
|
|
98
|
+
All choices are stored in `vibe-governor.json`. To change them:
|
|
75
99
|
|
|
76
|
-
|
|
100
|
+
```bash
|
|
101
|
+
npx vibe-governor update --max-lines=600 --enable=tsNoAny --disable=includeGitHubCI
|
|
102
|
+
```
|
|
77
103
|
|
|
78
|
-
-
|
|
79
|
-
-
|
|
80
|
-
-
|
|
81
|
-
-
|
|
82
|
-
- `cli/index.ts` → `bin/vibe-governor.cjs` (esbuild ile tek dosya, bağımlılıksız)
|
|
83
|
-
- `src/components/ui/` — shadcn/ui bileşenleri (Button, Switch, Dialog; Radix tabanlı, `components.json` ile `npx shadcn add` uyumlu)
|
|
84
|
-
- Yığın: Next.js 16 (statik export), React 19, Tailwind CSS 3, React Hook Form + Zod 4, Monaco Editor, Framer Motion
|
|
104
|
+
- Files you edited by hand are kept; the new version is written next to them as `<file>.vibe-new`.
|
|
105
|
+
- `.memory_bank/` and `.gitignore` are never touched by `update`.
|
|
106
|
+
- Unmodified files of tools you deselected are removed.
|
|
107
|
+
- In the web wizard, **Load Config** reads a project's `vibe-governor.json` back into the form.
|
|
85
108
|
|
|
86
|
-
##
|
|
109
|
+
## Adopting it in an existing project
|
|
87
110
|
|
|
88
111
|
```bash
|
|
89
|
-
|
|
90
|
-
npm run test:ui # yalnızca arayüz testleri
|
|
91
|
-
npm run lint # ESLint (eslint-config-next)
|
|
112
|
+
python3 scripts/check_guidelines.py --update-baseline
|
|
92
113
|
```
|
|
93
114
|
|
|
94
|
-
|
|
115
|
+
Current violations are recorded in `.vibe-baseline.json`; from then on only **new** violations fail.
|
|
116
|
+
Baseline entries survive line shifts, and an oversized file fails again only if it grows.
|
|
95
117
|
|
|
96
|
-
|
|
118
|
+
Inline exemptions (each finding prints its rule id):
|
|
97
119
|
|
|
98
|
-
|
|
120
|
+
```ts
|
|
121
|
+
let raw: any = JSON.parse(s); // vibe-ignore: ts_any
|
|
122
|
+
// vibe-ignore-next-line
|
|
123
|
+
let other: any = 1;
|
|
124
|
+
```
|
|
99
125
|
|
|
100
|
-
|
|
101
|
-
|
|
126
|
+
`vibe-ignore-file: line_limit` within the first 10 lines exempts a whole file.
|
|
127
|
+
|
|
128
|
+
The pre-commit hook runs `check_guidelines.py --staged`: it checks only the staged content and warns
|
|
129
|
+
when code changed but `.memory_bank/` was not updated in the same commit.
|
|
130
|
+
|
|
131
|
+
## CLI reference
|
|
132
|
+
|
|
133
|
+
```text
|
|
134
|
+
vibe-governor init [options] Install the governance pack into a project
|
|
135
|
+
vibe-governor update [options] Re-generate from vibe-governor.json (optionally changing settings)
|
|
136
|
+
vibe-governor detect [--dir=] List the languages detected in a project
|
|
137
|
+
|
|
138
|
+
--dir=<path> Target directory (default: current directory)
|
|
139
|
+
--force Overwrite files even if they exist / were edited by hand
|
|
140
|
+
--dry-run Only show what would change
|
|
141
|
+
--no-hook Do not install .git/hooks/pre-commit
|
|
142
|
+
--preset=<string> (init) Full configuration copied from the web wizard
|
|
143
|
+
--name=<project> Project name
|
|
144
|
+
--platforms=<list> AGENTS_MD,CLAUDE_CLI,GEMINI_CLI,ANTIGRAVITY,CURSOR,WINDSURF,CLINE,GITHUB_COPILOT
|
|
145
|
+
--languages=<list> C,C++,C#,Java,JavaScript,TypeScript,Python,Go,Rust,Kotlin,Swift,PHP,Verilog,VHDL
|
|
146
|
+
--detect (update) Replace the language list with the detected languages
|
|
147
|
+
--max-lines=<n> File line limit (200-1500)
|
|
148
|
+
--doc-score=<n> Documentation score threshold (5-10)
|
|
149
|
+
--lang=<tr|en> Language of the generated files
|
|
150
|
+
--enable=<keys> Turn switches on, e.g. tsNoAny,includeGitHubCI
|
|
151
|
+
--disable=<keys> Turn switches off
|
|
102
152
|
```
|
|
103
153
|
|
|
104
|
-
|
|
154
|
+
The interface and the generated files are available in English and Turkish.
|
|
105
155
|
|
|
106
|
-
|
|
156
|
+
## Development
|
|
107
157
|
|
|
108
158
|
```bash
|
|
109
|
-
npm
|
|
110
|
-
npm run
|
|
159
|
+
npm install
|
|
160
|
+
npm run dev # web wizard on http://localhost:3000
|
|
161
|
+
npm test # builds the CLI, tests the pack + Python checker, then the UI (Vitest)
|
|
162
|
+
npm run lint
|
|
163
|
+
npm run build # static export to out/
|
|
111
164
|
```
|
|
112
165
|
|
|
113
|
-
|
|
166
|
+
- `src/lib/` — schema (Zod), rules, templates and the generator shared by the wizard and the CLI
|
|
167
|
+
- `cli/index.ts` → `bin/vibe-governor.cjs` (single file bundled with esbuild; rebuild with `npm run build:cli` and commit it)
|
|
168
|
+
- Stack: Next.js 16 (static export), React 19, Tailwind CSS 3, shadcn/ui, React Hook Form + Zod 4, Monaco Editor
|
|
169
|
+
|
|
170
|
+
## License
|
|
114
171
|
|
|
115
|
-
[MIT](LICENSE) © 2026 SafakSahinn
|
|
172
|
+
[MIT](https://github.com/SafakSahinn/vibe-governor/blob/main/LICENSE) © 2026 SafakSahinn
|
package/bin/vibe-governor.cjs
CHANGED
|
@@ -991,7 +991,7 @@ ${body(v,s)}`}],PLATFORM_FILES=Object.fromEntries(RULE_FILES.map(d=>[d.platform,
|
|
|
991
991
|
- **Technical Debts & Known Bugs:**
|
|
992
992
|
- [ ] Finalize end-to-end integration test suites.
|
|
993
993
|
`]]}function buildMemoryBankFiles(data,vars,safety){return(data.locale==="tr"?trFiles(data,vars,safety):enFiles(data,vars,safety)).map(([name,content])=>({path:`.memory_bank/${name}`,name,content,language:"markdown",category:"memory_bank"}))}function contentHash(text){let normalized=text.replace(/\r\n/g,`
|
|
994
|
-
`),a=2166136261,b=1523705862;for(let i=0;i<normalized.length;i++){let c=normalized.charCodeAt(i);a=Math.imul(a^c,16777619)>>>0,b=Math.imul(b^c,16777619)>>>0,b=(b^b>>>13)>>>0}return a.toString(16).padStart(8,"0")+b.toString(16).padStart(8,"0")}var VERSION="1.3.
|
|
994
|
+
`),a=2166136261,b=1523705862;for(let i=0;i<normalized.length;i++){let c=normalized.charCodeAt(i);a=Math.imul(a^c,16777619)>>>0,b=Math.imul(b^c,16777619)>>>0,b=(b^b>>>13)>>>0}return a.toString(16).padStart(8,"0")+b.toString(16).padStart(8,"0")}var VERSION="1.3.2";function buildTemplateVars(data){let maxLines=data.constraints.maxLines||800,rules=getEnabledRules(data);return{MAX_LINES:String(maxLines),MAX_LINES_THRESHOLD:String(Math.max(100,maxLines-100)),DOC_SCORE:String(data.constraints.docScoreThreshold||8),LOCALE:data.locale,ENABLED_RULES:JSON.stringify(rules),ENABLED_RULES_DOC:rules.length>0?rules.join(", "):"(none)"}}function applyTemplate(template,vars){return template.replace(/\{\{([A-Z_]+)\}\}/g,(match,key)=>key in vars?vars[key]:match)}function generateProjectFiles(data){let vars=buildTemplateVars(data),fill=t=>applyTemplate(t,vars),safetySummary=getSafetySummary(data),files=[];files.push({path:"AI_GUIDELINES.md",name:"AI_GUIDELINES.md",content:fill(buildGuidelinesTemplate(data)),language:"markdown",category:"guidelines"}),files.push(...buildIdeRuleFiles(data,vars,safetySummary)),files.push(...buildMemoryBankFiles(data,vars,safetySummary));let a=data.automation;return a.includeCheckGuidelines&&files.push({path:"scripts/check_guidelines.py",name:"check_guidelines.py",content:fill(TEMPLATE_CHECK_GUIDELINES_PY),language:"python",category:"scripts"}),a.includePreCommitHook&&files.push({path:"scripts/pre-commit-hook.sh",name:"pre-commit-hook.sh",content:buildPreCommitHook(data.locale),language:"shell",category:"scripts"}),(a.includeCheckGuidelines||a.includePreCommitHook)&&files.push({path:".gitattributes",name:".gitattributes",content:`*.sh text eol=lf
|
|
995
995
|
*.py text eol=lf
|
|
996
996
|
*.yml text eol=lf
|
|
997
997
|
`,language:"plaintext",category:"config"}),a.includeGitHubCI&&files.push({path:".github/workflows/ai-guidelines-ci.yml",name:"ai-guidelines-ci.yml",content:TEMPLATE_GITHUB_CI,language:"yaml",category:"ci"}),a.includeAuditPrompt&&files.push({path:"AUDIT_PROMPT.md",name:"AUDIT_PROMPT.md",content:fill(buildAuditPrompt(data.locale)),language:"markdown",category:"guidelines"}),a.includeGitignore&&files.push({path:".gitignore",name:".gitignore",content:buildGitignore(data.locale),language:"plaintext",category:"config"}),files.push(buildConfigFile(data,files)),files}var CONFIG_FILE="vibe-governor.json";function isUserOwnedPath(path2){return path2.startsWith(".memory_bank/")||path2===".gitignore"||path2===CONFIG_FILE}function buildConfigFile(data,files,hashOverrides={}){let managedFiles={};for(let f of files)isUserOwnedPath(f.path)||(managedFiles[f.path]=contentHash(f.content));Object.assign(managedFiles,hashOverrides);let doc={$comment:"Vibe Governor project config. Change settings with `npx vibe-governor update` or load this file in the web wizard.",formatVersion:1,generator:`vibe-governor@${VERSION}`,config:data,managedFiles};return{path:CONFIG_FILE,name:CONFIG_FILE,content:JSON.stringify(doc,null,2)+`
|
package/package.json
CHANGED