genesis-architect 3.0.0__tar.gz

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.
Files changed (51) hide show
  1. genesis_architect-3.0.0/LICENSE +21 -0
  2. genesis_architect-3.0.0/PKG-INFO +14 -0
  3. genesis_architect-3.0.0/README.md +635 -0
  4. genesis_architect-3.0.0/pyproject.toml +39 -0
  5. genesis_architect-3.0.0/setup.cfg +4 -0
  6. genesis_architect-3.0.0/src/genesis_architect/__init__.py +3 -0
  7. genesis_architect-3.0.0/src/genesis_architect/cli.py +248 -0
  8. genesis_architect-3.0.0/src/genesis_architect/config.py +32 -0
  9. genesis_architect-3.0.0/src/genesis_architect/core/__init__.py +0 -0
  10. genesis_architect-3.0.0/src/genesis_architect/core/audit_inference.py +78 -0
  11. genesis_architect-3.0.0/src/genesis_architect/core/companion.py +46 -0
  12. genesis_architect-3.0.0/src/genesis_architect/core/drift_detector.py +394 -0
  13. genesis_architect-3.0.0/src/genesis_architect/core/env_probe.py +145 -0
  14. genesis_architect-3.0.0/src/genesis_architect/core/evidence_pack.py +592 -0
  15. genesis_architect-3.0.0/src/genesis_architect/core/feedback.py +135 -0
  16. genesis_architect-3.0.0/src/genesis_architect/core/fork_analyzer.py +73 -0
  17. genesis_architect-3.0.0/src/genesis_architect/core/genesis_state.py +488 -0
  18. genesis_architect-3.0.0/src/genesis_architect/core/genesis_subcommands.py +294 -0
  19. genesis_architect-3.0.0/src/genesis_architect/core/github.py +73 -0
  20. genesis_architect-3.0.0/src/genesis_architect/core/issue_miner.py +235 -0
  21. genesis_architect-3.0.0/src/genesis_architect/core/llm.py +30 -0
  22. genesis_architect-3.0.0/src/genesis_architect/core/mitigation_enforcer.py +485 -0
  23. genesis_architect-3.0.0/src/genesis_architect/core/nlu_gate.py +57 -0
  24. genesis_architect-3.0.0/src/genesis_architect/core/pitfall_coverage_check.py +259 -0
  25. genesis_architect-3.0.0/src/genesis_architect/core/publish_agent.py +481 -0
  26. genesis_architect-3.0.0/src/genesis_architect/core/research_validator.py +423 -0
  27. genesis_architect-3.0.0/src/genesis_architect/core/resolve_engine.py +145 -0
  28. genesis_architect-3.0.0/src/genesis_architect/core/scaffold_generator.py +200 -0
  29. genesis_architect-3.0.0/src/genesis_architect/core/scaffold_smoke_test.py +129 -0
  30. genesis_architect-3.0.0/src/genesis_architect/core/scaffolder.py +61 -0
  31. genesis_architect-3.0.0/src/genesis_architect/core/vault.py +75 -0
  32. genesis_architect-3.0.0/src/genesis_architect.egg-info/PKG-INFO +14 -0
  33. genesis_architect-3.0.0/src/genesis_architect.egg-info/SOURCES.txt +49 -0
  34. genesis_architect-3.0.0/src/genesis_architect.egg-info/dependency_links.txt +1 -0
  35. genesis_architect-3.0.0/src/genesis_architect.egg-info/entry_points.txt +2 -0
  36. genesis_architect-3.0.0/src/genesis_architect.egg-info/requires.txt +8 -0
  37. genesis_architect-3.0.0/src/genesis_architect.egg-info/top_level.txt +1 -0
  38. genesis_architect-3.0.0/tests/test_evidence_pack.py +265 -0
  39. genesis_architect-3.0.0/tests/test_genesis_state.py +194 -0
  40. genesis_architect-3.0.0/tests/test_github_rate_limit.py +120 -0
  41. genesis_architect-3.0.0/tests/test_mitigation_enforcer.py +390 -0
  42. genesis_architect-3.0.0/tests/test_new_features.py +148 -0
  43. genesis_architect-3.0.0/tests/test_new_scripts.py +256 -0
  44. genesis_architect-3.0.0/tests/test_pitfall_coverage_check_platform.py +180 -0
  45. genesis_architect-3.0.0/tests/test_pr13_scripts.py +490 -0
  46. genesis_architect-3.0.0/tests/test_publish_agent.py +451 -0
  47. genesis_architect-3.0.0/tests/test_research_validator.py +137 -0
  48. genesis_architect-3.0.0/tests/test_resolve_engine.py +49 -0
  49. genesis_architect-3.0.0/tests/test_scaffold_generator.py +336 -0
  50. genesis_architect-3.0.0/tests/test_scaffold_smoke_test.py +97 -0
  51. genesis_architect-3.0.0/tests/test_vault_and_resolve.py +119 -0
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Maio Eshet
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,14 @@
1
+ Metadata-Version: 2.4
2
+ Name: genesis-architect
3
+ Version: 3.0.0
4
+ Summary: The AI Software Architect that researches before it builds.
5
+ Requires-Python: >=3.11
6
+ License-File: LICENSE
7
+ Requires-Dist: typer>=0.12
8
+ Requires-Dist: anthropic>=0.28
9
+ Requires-Dist: httpx>=0.27
10
+ Provides-Extra: dev
11
+ Requires-Dist: pytest>=8; extra == "dev"
12
+ Requires-Dist: ruff>=0.4; extra == "dev"
13
+ Requires-Dist: pytest-cov>=5; extra == "dev"
14
+ Dynamic: license-file
@@ -0,0 +1,635 @@
1
+ <div align="center">
2
+
3
+ # Genesis Architect
4
+
5
+ **The AI Software Architect that stays with you for the entire project lifecycle.**
6
+ Not a one-time scaffolder. A research-first architect that mines real production failures,
7
+ builds your project to avoid them, and keeps learning alongside you as you ship.
8
+
9
+ [![CI](https://img.shields.io/github/actions/workflow/status/maioio/genesis-architect/ci.yml?branch=main&style=for-the-badge&label=CI)](https://github.com/maioio/genesis-architect/actions)
10
+ [![Version](https://img.shields.io/badge/version-3.0.0-blue?style=for-the-badge)](CHANGELOG.md)
11
+ [![License](https://img.shields.io/badge/license-MIT-green?style=for-the-badge)](LICENSE)
12
+ [![Claude Code](https://img.shields.io/badge/Claude_Code-skill-orange?style=for-the-badge)](https://github.com/anthropics/claude-code)
13
+ [![Known Vulnerabilities](https://snyk.io/test/github/maioio/genesis-architect/badge.svg?style=for-the-badge)](https://snyk.io/test/github/maioio/genesis-architect)
14
+
15
+ [![Quality Gate](https://sonarcloud.io/api/project_badges/measure?project=maioio_genesis-architect&metric=alert_status)](https://sonarcloud.io/summary/new_code?id=maioio_genesis-architect)
16
+ [![Security Rating](https://sonarcloud.io/api/project_badges/measure?project=maioio_genesis-architect&metric=security_rating)](https://sonarcloud.io/summary/new_code?id=maioio_genesis-architect)
17
+ [![Maintainability](https://sonarcloud.io/api/project_badges/measure?project=maioio_genesis-architect&metric=sqale_rating)](https://sonarcloud.io/summary/new_code?id=maioio_genesis-architect)
18
+ [![Coverage](https://sonarcloud.io/api/project_badges/measure?project=maioio_genesis-architect&metric=coverage)](https://sonarcloud.io/summary/new_code?id=maioio_genesis-architect)
19
+
20
+ [![Phases](https://img.shields.io/badge/phases-9-blueviolet?style=flat-square)](SKILL.md)
21
+ [![Languages](https://img.shields.io/badge/languages-4-informational?style=flat-square)](references/architecture-patterns.md)
22
+ [![Archetypes](https://img.shields.io/badge/archetypes-4-success?style=flat-square)](SKILL.md)
23
+ [![Tests](https://img.shields.io/badge/tests-372-brightgreen?style=flat-square)](tests/)
24
+ [![Eval accuracy](https://img.shields.io/badge/eval_accuracy-100%25-brightgreen?style=flat-square)](evals/test_queries.json)
25
+ [![Stars](https://img.shields.io/github/stars/maioio/genesis-architect?style=social)](https://github.com/maioio/genesis-architect/stargazers)
26
+
27
+ [![GitHub Sponsors](https://img.shields.io/badge/Sponsor-%23EA4AAA?style=flat-square&logo=github-sponsors)](https://github.com/sponsors/maioio)
28
+ [![Buy Me a Coffee](https://img.shields.io/badge/Buy_Me_a_Coffee-%23FFDD00?style=flat-square&logo=buy-me-a-coffee&logoColor=black)](https://buymeacoffee.com/maioio)
29
+
30
+ <br/>
31
+
32
+ > Scans 15-20 real GitHub repos, mines their Issues for what broke in production,
33
+ > builds your project to avoid those mistakes - then stays active as your architect
34
+ > **for the entire development lifecycle.**
35
+
36
+ <br/>
37
+
38
+ <img src="docs/assets/demo.gif" alt="Genesis Architect demo" width="700"/>
39
+
40
+ **If this saved you from a bad architecture decision - [star it](https://github.com/maioio/genesis-architect/stargazers). It helps others find it.**
41
+
42
+ </div>
43
+
44
+ ---
45
+
46
+ ## What it actually produces
47
+
48
+ Run: `genesis init a Python CLI for analyzing log files`
49
+
50
+ **Pitfalls found from real GitHub Issues (before a single file is written):**
51
+
52
+ | # | Issue | Found in | Root cause | Built-in mitigation |
53
+ |---|-------|----------|-----------|---------------------|
54
+ | 1 | [pallets/click#2416](https://github.com/pallets/click/issues/2416) | 4/5 repos | Business logic inside Click callback - untestable | `cli.py` only parses args, all logic in `core.py` |
55
+ | 2 | [pallets/click#2558](https://github.com/pallets/click/issues/2558) | 3/5 repos | Type stubs change in Click 8.1.4 breaks mypy silently | Pin `click>=8.1.7`, `# type: ignore` only where needed |
56
+ | 3 | [pallets/click#1846](https://github.com/pallets/click/issues/1846) | 3/5 repos | Raw file path from CLI args allows `../../../etc/passwd` | `get_safe_path(base, user_input)` in `utils/security.py` |
57
+ | 4 | [fastapi/typer#522](https://github.com/fastapi/typer/issues/522) | 5/5 repos | No input validation produces cryptic tracebacks as errors | `click.BadParameter` at entry point before any processing |
58
+
59
+ **Scaffold generated (12 files, 0 empty stubs):**
60
+
61
+ ```
62
+ log-analyzer/
63
+ ├── src/log-analyzer/
64
+ │ ├── __init__.py
65
+ │ ├── main.py # Click CLI - args only, delegates to core
66
+ │ ├── core.py # All logic lives here, testable without subprocess
67
+ │ └── utils/
68
+ │ └── security.py # get_safe_path() - path traversal guard
69
+ ├── tests/
70
+ │ ├── __init__.py
71
+ │ └── test_core.py # Tests core directly, no subprocess needed
72
+ ├── .github/workflows/ci.yml # 4 jobs: tests, secrets, SAST, quality gate
73
+ ├── .env.example
74
+ ├── pyproject.toml # click>=8.1.7 pinned, mypy strict, pytest config
75
+ ├── RESEARCH.md # 5 repos analyzed, all sources verified live
76
+ ├── PITFALLS.md # The 4 pitfalls above with full root cause analysis
77
+ └── ROADMAP.md # 5-phase plan: scaffold -> tests -> CI -> quality -> ship
78
+ ```
79
+
80
+ Every cited issue URL is verified by CI. A 404 fails the build.
81
+
82
+ ---
83
+
84
+ ## What's new in v2.6.0
85
+
86
+ > [!NOTE]
87
+ > v2.6.0 closes the gap between claimed enforcement and actual mechanical enforcement. Every change is verifiable.
88
+
89
+ | Feature | What it does |
90
+ |---------|-------------|
91
+ | **AST-level mitigation enforcement** | `mitigation_enforcer.py` now checks parse validity, non-stub code, optional symbol and import presence - not just file existence |
92
+ | **Import boundary drift detection** | `drift_detector.py` walks every Python file with AST analysis, checks against `forbidden_imports` derived from `.genesis/evidence.json` |
93
+ | **Confidence scoring in evidence packs** | `evidence_pack.py` computes a weighted 0-1 score (repos, pitfalls, mapping, decision, content) and rejects template-only packs |
94
+ | **`evidence_signed` fixed** | Was always `false`. Now `true` only when Phase 5 recorded a real archetype and user choice |
95
+ | **Genesis enforcement pre-commit hooks** | `.pre-commit-config.yaml` now contains real hooks: mitigation enforcer + drift detector run on every `git commit` |
96
+ | **CI genesis-validate job** | Python CI template includes a `genesis-validate` job: checks `ARCHITECTURE_EVIDENCE.md` exists and runs mitigation enforcer |
97
+ | **270 unit tests** | Full coverage: AST enforcement, confidence scoring, drift detection, argparse CLI, pre-commit hook content |
98
+
99
+ ---
100
+
101
+ ## Why Genesis Architect is different
102
+
103
+ Every other tool - `create-t3-app`, `bolt.new`, Copilot Workspace, Cookiecutter - generates code from templates. They have no idea what broke in production for the 50,000 developers who built the same thing before you. And they stop helping the moment the scaffold is created.
104
+
105
+ Genesis Architect treats every project as a **research problem first**, and treats development as a **continuous collaboration** - not a one-time event.
106
+
107
+ ```
108
+ Day 1: You describe a vision
109
+ Genesis researches 15-20 real repos and their Issues
110
+ Builds a scaffold that avoids the mistakes it found
111
+ Three security gates activate on the first commit
112
+
113
+ Day 30: You hit a bug
114
+ genesis resolve "path traversal python"
115
+ Vault hit: instant answer from last project, no API call
116
+
117
+ Day 60: Deps are aging
118
+ genesis check
119
+ CVE scan + CI action version audit, upgrade commands ready
120
+
121
+ Day 90: New feature needs research
122
+ genesis research "rate limiting patterns"
123
+ Searches Phase 2 repos first, then ecosystem - cites sources
124
+ ```
125
+
126
+ ---
127
+
128
+ ## How it works: three stages
129
+
130
+ ### Stage 1: Deep Research
131
+
132
+ Before writing a single file, Genesis Architect runs three parallel research streams:
133
+
134
+ - **Stream A**: Scans 15-20 GitHub repos matching your vision. Filters by stars, recency, and language.
135
+ - **Stream B**: Searches Reddit, Hacker News, and Stack Overflow for architecture regrets and pitfalls in the wild.
136
+ - **Stream C**: For the top 5-8 repos, mines up to 100 GitHub Issues each. Ranks by engagement (comments + reactions). Extracts recurring failures, security patches, and architecture regrets.
137
+
138
+ Active forks of researched repos are also scanned for bug fixes not yet merged upstream. The result is a `RESEARCH.md` with verified citations and a `PITFALLS.md` with real root causes and mitigations built into the scaffold.
139
+
140
+ ### Stage 2: Secure Scaffolding
141
+
142
+ **Mechanically enforced (CI fails if violated):**
143
+ - Issue URL 404 check: `research_validator.py --verify-issues` in CI
144
+ - Mitigation file existence and code quality: `mitigation_enforcer.py` on examples in CI
145
+ - Evidence pack generation: `evidence_pack.py generate` on examples in CI
146
+ - Structural drift detection: `drift_detector.py --level 1` on examples in CI
147
+ - 270 unit tests: pytest fails the build on any regression
148
+ - Secret scanning: Gitleaks on every push
149
+ - SKILL.md constraints: line count and em-dash scan in CI
150
+
151
+ **Skill-enforced (Claude follows SKILL.md instructions):**
152
+ - Phase 2: stops if fewer than 12 repos found, records state via `genesis_state.py`
153
+ - Phase 5: requires explicit A/B/C/D choice before scaffold begins
154
+ - Phase 6: blocks `git commit` until smoke test exits 0
155
+ - Phase 6 end: runs `evidence_pack.py generate` before Step 7
156
+
157
+ Every scaffold includes `utils/security.py` (or language equivalent) with `get_safe_path` for projects handling user-supplied file paths.
158
+
159
+ ### Stage 3: Smart Resolution (the feedback loop)
160
+
161
+ After scaffolding, the Knowledge Vault starts building up:
162
+
163
+ ```
164
+ You hit a problem
165
+ ↓
166
+ genesis resolve "csv streaming large file python"
167
+ ↓
168
+ Check local .genesis/vault/ first
169
+ ↓
170
+ Vault hit? Return instantly. No API call. No tokens.
171
+ ↓
172
+ No hit? Query Stack Overflow API for top 3 accepted answers
173
+ ↓
174
+ Display with source link. You confirm before anything changes.
175
+ ↓
176
+ Solution saved to vault for next time.
177
+ ```
178
+
179
+ The vault grows with every project. A solution found for a path traversal issue in one project is immediately available in the next one.
180
+
181
+ ---
182
+
183
+ ## Visual architecture
184
+
185
+ ```mermaid
186
+ flowchart TD
187
+ A([You describe a vision]) --> B
188
+
189
+ subgraph P0["Phase 0 - Probe"]
190
+ B[Detect OS, package manager\nScan nearby projects for conventions]
191
+ end
192
+
193
+ subgraph P1["Phase 1 - Align"]
194
+ C[Archetype · Scale · Language\n3 focused questions]
195
+ end
196
+
197
+ subgraph P2["Phase 2 - Research x3 parallel"]
198
+ D1[Stream A\nGitHub repos + active forks]
199
+ D2[Stream B\nReddit / HN / SO ecosystem]
200
+ D3[Stream C\nIssue mining top 5-8 repos]
201
+ D1 & D2 & D3 --> E[Merge + quality signal\nFULL / PARTIAL / THIN]
202
+ end
203
+
204
+ subgraph P3456["Phases 3-6 - Build"]
205
+ F[Architecture synthesis] --> G[Pitfall identification]
206
+ G --> H[A/B architecture choice\nhard gate: explicit confirm required]
207
+ H --> I[Scaffold + tests + CI\nProduction defaults + ADR\nSmoke test gate]
208
+ end
209
+
210
+ subgraph P7["Phase 7 - Companion"]
211
+ J[genesis help · genesis research · genesis check · genesis resolve]
212
+ J --> K[(Knowledge Vault\n.genesis/vault/)]
213
+ K -->|vault hit: instant| J
214
+ K -->|no hit: fetch + cache| L[Stack Overflow API]
215
+ L --> K
216
+ end
217
+
218
+ B --> C --> E --> F
219
+ I --> J
220
+
221
+ style P0 fill:#1e3a5f,color:#fff
222
+ style P1 fill:#1e3a5f,color:#fff
223
+ style P2 fill:#1a472a,color:#fff
224
+ style P3456 fill:#4a1942,color:#fff
225
+ style P7 fill:#7a3b00,color:#fff
226
+ style K fill:#b8860b,color:#fff
227
+ style L fill:#555,color:#fff
228
+ style A fill:#333,color:#fff
229
+ ```
230
+
231
+ > [!NOTE]
232
+ > **Skill-enforced gates:** Phase 2 stops if fewer than 12 repos found. Phase 5 requires an explicit A/B/C/D choice. Phase 6 blocks `git commit` until the smoke test passes. See Stage 2 above for what is mechanically enforced in CI.
233
+
234
+ ---
235
+
236
+ ## Install
237
+
238
+ ```bash
239
+ # Claude Code (recommended)
240
+ git clone https://github.com/maioio/genesis-architect ~/.claude/skills/genesis-architect
241
+
242
+ # Cursor
243
+ # Copy SKILL.md to .cursor/rules/genesis-architect.md
244
+
245
+ # Codex CLI
246
+ git clone https://github.com/maioio/genesis-architect ~/.codex/skills/genesis-architect
247
+ ```
248
+
249
+ No build step, no dependencies.
250
+
251
+ ---
252
+
253
+ ## Usage
254
+
255
+ <details>
256
+ <summary><b>Explicit commands</b></summary>
257
+
258
+ ```
259
+ genesis init a REST API in TypeScript
260
+ genesis init a Python CLI for batch image processing
261
+ genesis init a Chrome extension that does X
262
+ genesis init --from-prd PRD.md # read a product spec, skip Phase 1
263
+ genesis init --from-team-config # restore a teammate's research
264
+ genesis audit ./my-existing-project # audit existing code, no scaffold
265
+ genesis harden ./my-existing-project # inject security gates into any project
266
+ genesis resolve path traversal python # Smart Resolution Engine
267
+ ```
268
+
269
+ </details>
270
+
271
+ <details>
272
+ <summary><b>Natural triggers - just describe what you want</b></summary>
273
+
274
+ ```
275
+ I want to build a Telegram bot
276
+ scaffold a new project for web scraping
277
+ start building a VS Code extension
278
+ I need to build a data pipeline from scratch
279
+ create a tool that converts CSV to JSON
280
+ ```
281
+
282
+ </details>
283
+
284
+ ---
285
+
286
+ ## What every project gets
287
+
288
+ | Deliverable | Contents |
289
+ |-------------|----------|
290
+ | `RESEARCH.md` | 15-20 repos scanned, top 5-8 deeply analyzed, sources linked, ecosystem velocity signals |
291
+ | `PITFALLS.md` | 3-7 real pitfalls from GitHub Issues with root causes and mitigations |
292
+ | `ROADMAP.md` | 5-10 phase development plan including "Activate Quality Gates" phase |
293
+ | `src/` | Functional boilerplate - not empty stubs |
294
+ | `tests/` | Passing unit tests for core logic |
295
+ | `.github/workflows/ci.yml` | 4 parallel jobs: tests, secret scanning, SAST, code quality gate |
296
+ | `utils/security.py` or `security.ts` | `get_safe_path` guard for all file I/O (when applicable) |
297
+ | `docs/adr/001-initial-architecture.md` | Every architectural decision explained with evidence |
298
+ | `.gitignore` | Language-appropriate, hardened against secrets and build artifacts |
299
+ | `sonar-project.properties` | Code quality gate config, ready to activate with one secret |
300
+ | `.pre-commit-config.yaml` | Genesis enforcement hooks: mitigation enforcer + drift detector run on every `git commit` |
301
+
302
+ **Production-readiness defaults baked into every scaffold:**
303
+
304
+ | Default | What it does |
305
+ |---------|-------------|
306
+ | Structured logging | `pino`/`winston`/`slog` from line 1 - no `console.log` in production |
307
+ | Non-root Dockerfile | `USER 1001` - never runs as root |
308
+ | Env validation | Fails loudly at startup if required vars are missing |
309
+ | `GET /health` | Returns `{"status":"ok"}` (Web Service archetype) |
310
+ | No wildcard CORS | Explicitly listed origins only |
311
+ | Secret Zero | `.env.example` with generation hint, validated at startup |
312
+ | Secret scanning CI | Every push scanned - build fails on exposed credentials |
313
+ | SAST analysis CI | Static analysis catches injection and path traversal on every push |
314
+ | Code quality gate | Merge blocked on maintainability or security regressions |
315
+
316
+ ---
317
+
318
+ ## Development Companion Mode
319
+
320
+ After scaffolding, Genesis Architect stays active for the rest of your session - and picks up where it left off in future sessions by reading `RESEARCH.md` from your project directory.
321
+
322
+ ```
323
+ genesis help I need to add rate limiting → searches Phase 2 repos for how they solved it
324
+ genesis research authentication patterns → targeted scan with 1-3 ranked approaches
325
+ genesis check → freshness audit: CVEs, outdated deps, CI versions
326
+ genesis harden ./existing-project → inject security gates into any existing project [skill-mediated]
327
+ genesis resolve path traversal python → Smart Resolution Engine with vault-first lookup
328
+ ```
329
+
330
+ ---
331
+
332
+ ## Smart Resolution Engine
333
+
334
+ `genesis resolve [topic]` is a two-layer system designed to get you an answer as fast as possible while building up institutional knowledge over time.
335
+
336
+ **Layer 1 - Knowledge Vault (instant, free):**
337
+ Every problem you resolve is stored in `.genesis/vault/` tagged by topic and language. On the next query, the vault is checked first. If there is a match, the answer comes back instantly - no network call, no tokens consumed.
338
+
339
+ ```bash
340
+ # Search the vault directly
341
+ python scripts/vault.py search "path traversal" python
342
+
343
+ # Save a solution to the vault
344
+ python scripts/vault.py save "path traversal" python "Use get_safe_path..." --source https://...
345
+
346
+ # See vault stats
347
+ python scripts/vault.py stats
348
+ ```
349
+
350
+ **Layer 2 - Stack Overflow API (when vault misses):**
351
+ Fetches the top 3 community-verified solutions. Prioritizes accepted answers and high-score results. Classifies each as "recent" (last 24 months) or "classic". Caches the result in the vault for next time.
352
+
353
+ ```
354
+ $ genesis resolve "csv streaming large file python"
355
+
356
+ Smart Resolution Engine
357
+ Query: 'csv streaming large file python'
358
+ Source: Stack Overflow community answers
359
+
360
+ ============================================================
361
+ Result 1: Streaming CSV from S3 to Python
362
+ Score: 16 | Answers: 5 | Tags: python, boto3
363
+ [TOP ANSWER: score 11] [type: classic]
364
+
365
+ Use chunked reading: read a block, find the last newline, process.
366
+ chunk_size = 1_000_000 ...
367
+
368
+ Source: https://stackoverflow.com/a/51142062
369
+ ============================================================
370
+
371
+ IMPORTANT: Always review community solutions before applying.
372
+ Genesis Architect never patches your code without your confirmation.
373
+ ```
374
+
375
+ No API key required (300 requests/day). Set `STACKOVERFLOW_KEY` env var for 10,000/day.
376
+
377
+ ---
378
+
379
+ ## Languages and archetypes
380
+
381
+ **Languages** auto-detected from research:
382
+
383
+ ```
384
+ TypeScript / JavaScript Python Go Rust
385
+ ```
386
+
387
+ **Archetypes** - each shapes the entire scaffold differently:
388
+
389
+ | Archetype | Entrypoint | Has server | Has Dockerfile | Test runner |
390
+ |-----------|-----------|-----------|----------------|-------------|
391
+ | CLI Tool | `bin` / `[project.scripts]` | No | Optional | pytest / jest |
392
+ | Library/SDK | Public API, no `main()` | No | No | pytest / jest |
393
+ | Web Service/API | Router | Yes | Yes + `/health` | pytest / jest |
394
+ | Frontend App | Component tree | No (SSR optional) | Optional | vitest / jest |
395
+
396
+ ---
397
+
398
+ ## How Genesis Architect compares
399
+
400
+ | Capability | Genesis Architect | create-t3-app | bolt.new | Cursor Rules | madison/scaffolding |
401
+ |-----------|:-----------------:|:-------------:|:--------:|:------------:|:-------------------:|
402
+ | Research from real GitHub Issues | Yes | No | No | No | No |
403
+ | Validates citations (no hallucinated repos) | Yes | n/a | No | n/a | No |
404
+ | Anti-hallucination CVE check (OSV.dev) | Yes | No | No | No | No |
405
+ | Research Quality Signal (FULL/PARTIAL/THIN) | Yes | No | No | No | No |
406
+ | Hard gates before file creation | Yes | No | No | No | Yes |
407
+ | Secret scanning + SAST on every scaffold | Yes | No | No | No | No |
408
+ | Retrofit security into existing projects | Yes | No | No | No | No |
409
+ | Smart Resolution Engine with local vault | Yes | No | No | No | No |
410
+ | Active fork intelligence | Yes | No | No | No | No |
411
+ | Works without any MCP | Yes | n/a | n/a | n/a | n/a |
412
+ | PRD-driven flow (`--from-prd`) | Yes | No | No | No | No |
413
+ | Stays active for entire project lifecycle | Yes | No | No | No | No |
414
+
415
+ > Assessments based on public documentation as of 2026. Some capabilities may vary by version or configuration.
416
+
417
+ ---
418
+
419
+ ## Works at every level of MCP setup
420
+
421
+ | Setup | Research quality | Speed |
422
+ |-------|-----------------|-------|
423
+ | No MCPs | Web search - real repos, shallower issue data | Normal |
424
+ | GitHub MCP | Deep repo scan + real Issue extraction | Normal |
425
+ | GitHub + Exa | Full parallel: repos + Reddit/HN/SO context | ~3x faster |
426
+ | GitHub + Exa + Firecrawl | Full parallel + targeted page scraping | ~3x faster |
427
+
428
+ > [!TIP]
429
+ > The skill never blocks on a missing tool. It reports what it's using and continues.
430
+
431
+ ---
432
+
433
+ ## Real output - not fabricated
434
+
435
+ From actual projects:
436
+
437
+ **TypeScript CLI:**
438
+ - [`examples/typescript-cli/RESEARCH.md`](examples/typescript-cli/RESEARCH.md) - 5 repos analyzed, every source linked and verified
439
+ - [`examples/typescript-cli/PITFALLS.md`](examples/typescript-cli/PITFALLS.md) - 4 real pitfalls from live GitHub Issues
440
+ - [`examples/typescript-cli/ROADMAP.md`](examples/typescript-cli/ROADMAP.md) - 5-phase plan calibrated to research findings
441
+
442
+ **Python CLI:**
443
+ - [`examples/python-cli/RESEARCH.md`](examples/python-cli/RESEARCH.md) - click, typer, python-fire, tqdm, prompt-toolkit analyzed
444
+ - [`examples/python-cli/PITFALLS.md`](examples/python-cli/PITFALLS.md) - 4 pitfalls: click#2416, click#2558, tqdm#1139, typer#522 - all verified
445
+ - [`examples/python-cli/src/`](examples/python-cli/src/) - working Python CLI with Click, get_safe_path, and full test suite
446
+
447
+ ---
448
+
449
+ ## What contributors found
450
+
451
+ > First external contributor [@nitayk](https://github.com/nitayk) opened 7 issues and submitted a 444-line PR with a self-contained code review - finding and fixing 4 bugs - within 48 hours of launch.
452
+
453
+ ---
454
+
455
+ ## Project structure
456
+
457
+ <details>
458
+ <summary><b>Full layout</b></summary>
459
+
460
+ ```
461
+ genesis-architect/
462
+ ├── SKILL.md # Skill definition - the brain
463
+ ├── plugin.json # Marketplace manifest
464
+ ├── scripts/
465
+ │ ├── scaffold_generator.py # Creates project structure (loads from folder-structures.toml)
466
+ │ ├── research_validator.py # Validates RESEARCH.md + live GitHub URL checks
467
+ │ ├── resolve_engine.py # Smart Resolution Engine (Stack Overflow API + vault)
468
+ │ ├── vault.py # Knowledge Vault - local solution cache
469
+ │ ├── genesis_state.py # Phase 5/6 hard gate state files
470
+ │ ├── genesis_subcommands.py # genesis check: CVE scan + CI action audit
471
+ │ ├── pitfall_coverage_check.py # Verifies PITFALLS.md mitigations exist in source
472
+ │ ├── drift_detector.py # Architecture drift detection vs ADR baseline
473
+ │ ├── issue_miner.py # GitHub Issue mining (GraphQL + REST)
474
+ │ ├── feedback.py # Pitfall feedback recorder
475
+ │ ├── env_probe.py # Phase 0 environment detection
476
+ │ └── eval_runner.py # Trigger rate eval + schema validation
477
+ ├── tests/ # 270 unit tests
478
+ │ ├── test_scaffold_generator.py # 53 tests: all combos, path traversal, TOML integrity, pre-commit hooks
479
+ │ ├── test_pr13_scripts.py # 58 tests: pitfall_coverage_check + genesis_subcommands
480
+ │ ├── test_new_scripts.py # 22 tests: feedback, drift_detector CLI, import boundary, issue_miner
481
+ │ ├── test_research_validator.py # 17 tests: validator logic
482
+ │ ├── test_resolve_engine.py # 9 tests: resolution engine
483
+ │ ├── test_genesis_state.py # 30 tests: hard gate state machine
484
+ │ ├── test_mitigation_enforcer.py # 26 tests: AST enforcement, symbol/import, allow-unmapped
485
+ │ ├── test_evidence_pack.py # 26 tests: confidence scoring, generate, verify
486
+ │ ├── test_scaffold_smoke_test.py # 16 tests: all 8 archetypes smoke-tested
487
+ │ └── test_pitfall_coverage_check_platform.py # 13 tests: platform risk validation
488
+ ├── evals/
489
+ │ ├── test_queries.json # 40 trigger/no-trigger test cases (100% accuracy)
490
+ │ └── README.md
491
+ ├── examples/
492
+ │ ├── typescript-cli/ # Real TypeScript CLI output
493
+ │ │ ├── RESEARCH.md
494
+ │ │ ├── PITFALLS.md
495
+ │ │ └── ROADMAP.md
496
+ │ └── python-cli/ # Real Python CLI output
497
+ │ ├── RESEARCH.md
498
+ │ ├── PITFALLS.md
499
+ │ └── ROADMAP.md
500
+ ├── assets/
501
+ │ ├── demo.gif # Demo recording (see DEMO_SCRIPT.md to record)
502
+ │ ├── RESEARCH.template.md
503
+ │ ├── PITFALLS.template.md
504
+ │ └── ROADMAP.template.md
505
+ ├── references/
506
+ │ ├── architecture-patterns.md # Boilerplate per language/tier + production defaults
507
+ │ ├── mcp-strategy.md # MCP tool strategy and fallback logic
508
+ │ └── security-templates.md # CI templates for secret scanning, SAST, quality gate
509
+ ├── .github/
510
+ │ ├── dependabot.yml # Weekly automated dependency updates
511
+ │ └── workflows/
512
+ │ ├── ci.yml # Tests, secret scanning, SAST, quality gate
513
+ │ └── codeql.yml # GitHub Code Scanning
514
+ ├── pyproject.toml # pytest + ruff config
515
+ ├── DEMO_SCRIPT.md # Step-by-step guide to record the demo GIF
516
+ ├── LAUNCH_COPY.md # Ready-to-post text for HN, Reddit, X, Discord
517
+ ├── SECURITY.md
518
+ ├── CHANGELOG.md
519
+ └── CONTRIBUTING.md
520
+ ```
521
+
522
+ </details>
523
+
524
+ ---
525
+
526
+ ## Quality Shield
527
+
528
+ Four CI jobs run on every push and pull request:
529
+
530
+ | Job | What it gates | Secret required |
531
+ |-----|--------------|-----------------|
532
+ | `quality-gates` | 270 unit tests, evidence pack generation, mitigation enforcement, drift detection (Level 2), genesis_state smoke test, scaffold smoke test, SKILL.md constraints | `GITHUB_TOKEN` (built-in) |
533
+ | `secrets-scan` | Exposed credentials, API keys, tokens in every commit | none |
534
+ | `sonarcloud` | Maintainability, Reliability, Security Hotspots; skips if SONAR_TOKEN absent | `SONAR_TOKEN` |
535
+ | `security-scan` | Dependency CVEs (HIGH+) via Snyk; skips if SNYK_TOKEN absent | `SNYK_TOKEN` |
536
+
537
+ **To activate optional jobs:** set repository Variables (not Secrets) in Settings > Secrets and variables > Actions > Variables:
538
+ - `SONAR_ENABLED` = `true` (then add `SONAR_TOKEN` as a Secret)
539
+ - `SNYK_ENABLED` = `true` (then add `SNYK_TOKEN` as a Secret)
540
+
541
+ > [!IMPORTANT]
542
+ > After connecting SonarCloud, disable **Automatic Analysis** in the SonarCloud project settings (`Project Settings > Analysis Method`). Running both simultaneously causes the quality-gate job to fail.
543
+
544
+ | Badge | Meaning |
545
+ |-------|---------|
546
+ | [![Known Vulnerabilities](https://snyk.io/test/github/maioio/genesis-architect/badge.svg)](https://snyk.io/test/github/maioio/genesis-architect) | No high/critical CVEs in Python deps |
547
+ | [![Quality Gate](https://sonarcloud.io/api/project_badges/measure?project=maioio_genesis-architect&metric=alert_status)](https://sonarcloud.io/summary/new_code?id=maioio_genesis-architect) | Code quality gate status |
548
+ | [![Security Rating](https://sonarcloud.io/api/project_badges/measure?project=maioio_genesis-architect&metric=security_rating)](https://sonarcloud.io/summary/new_code?id=maioio_genesis-architect) | Security rating (A = best) |
549
+ | [![Maintainability](https://sonarcloud.io/api/project_badges/measure?project=maioio_genesis-architect&metric=sqale_rating)](https://sonarcloud.io/summary/new_code?id=maioio_genesis-architect) | Maintainability rating |
550
+ | ![CI](https://img.shields.io/github/actions/workflow/status/maioio/genesis-architect/ci.yml?branch=main&label=CI) | All CI jobs passing |
551
+
552
+ <sub>Built on open-source security tooling. See [security-templates.md](references/security-templates.md) for implementation details.</sub>
553
+
554
+ ---
555
+
556
+ ## Roadmap
557
+
558
+ | Priority | Feature | Status |
559
+ |----------|---------|--------|
560
+ | 1 | Demo GIF - record with [DEMO_SCRIPT.md](DEMO_SCRIPT.md) | Pending recording |
561
+ | 2 | Go and Rust real-world example projects | In progress |
562
+ | 3 | Interactive CLI with progress bars and pretty output | Planned |
563
+ | 4 | VS Code extension with MCP deep integration | Planned |
564
+ | 5 | Templates gallery: Next.js + Supabase, FastAPI + React, T3 Stack | Planned |
565
+ | 6 | Benchmark report vs. competing tools (speed, quality, cost) | Planned |
566
+ | 7 | Hosted version with web UI for non-terminal users | Future |
567
+
568
+ Community contributions welcome - see [CONTRIBUTING.md](CONTRIBUTING.md).
569
+
570
+ ---
571
+
572
+ ## Honest Limitations
573
+
574
+ | Limitation | Details |
575
+ |-----------|---------|
576
+ | **Issue mining depth** | Scans 100 most-recent issues across 5-8 repos. Low-traffic projects or issues closed years ago may not surface. |
577
+ | **Web-search-only mode** | Without GitHub MCP, issue extraction is shallow. RESEARCH.md will note this automatically. |
578
+ | **Quick experiment trigger** | Natural-language triggers ask intent first - but `genesis init` always runs the full flow. |
579
+ | **Issue URL authenticity** | Run `python scripts/research_validator.py RESEARCH.md --verify-issues` to HTTP-check every cited issue URL. |
580
+ | **WSL** | On Windows inside WSL, Linux paths and package managers are used - Windows PATH fixes do not apply. |
581
+ | **Fork intelligence** | Scanning active forks for upstream patches requires GitHub MCP. Without it, fork analysis is skipped. |
582
+ | **Stack Overflow API limit** | 300 requests/day unauthenticated. Set `STACKOVERFLOW_KEY` for 10,000/day. Vault hits bypass this entirely. |
583
+
584
+ ---
585
+
586
+ ## Community
587
+
588
+ Genesis Architect improves through real-world use.
589
+
590
+ - **Share your output**: open a PR adding your `RESEARCH.md` and `PITFALLS.md` to `examples/`
591
+ - **Report missed pitfalls**: if something slipped past the research phase, open an issue - it becomes a future mitigation
592
+ - **Good first issues**: check the [`good first issue`](https://github.com/maioio/genesis-architect/issues?q=label%3A%22good+first+issue%22) label to start contributing
593
+ - **Looking for experienced reviewers**: if you have production experience with CLI tools, Python packaging, or AI skill engineering - feedback is welcome at any level
594
+
595
+ [Open an issue](https://github.com/maioio/genesis-architect/issues) | [Submit a PR](https://github.com/maioio/genesis-architect/pulls) | [Discussions](https://github.com/maioio/genesis-architect/discussions)
596
+
597
+ ---
598
+
599
+ ## Support this project
600
+
601
+ Genesis Architect is free and open-source. If it saved you from a bad architecture decision, a production incident, or hours of research - consider supporting continued development:
602
+
603
+ [![GitHub Sponsors](https://img.shields.io/badge/Sponsor_on_GitHub-%23EA4AAA?style=for-the-badge&logo=github-sponsors)](https://github.com/sponsors/maioio)
604
+ [![Buy Me a Coffee](https://img.shields.io/badge/Buy_Me_a_Coffee-%23FFDD00?style=for-the-badge&logo=buy-me-a-coffee&logoColor=black)](https://buymeacoffee.com/maioio)
605
+
606
+ Sponsorship funds: additional language templates, deeper MCP integrations, real-world example projects, and VS Code extension development.
607
+
608
+ ---
609
+
610
+ ## Contributing
611
+
612
+ See [CONTRIBUTING.md](CONTRIBUTING.md).
613
+
614
+ New language templates, improved MCP strategies, and workflow refinements are welcome.
615
+
616
+ > [!IMPORTANT]
617
+ > Keep SKILL.md under 400 lines. No em dashes anywhere. All code, filenames, and comments in English.
618
+
619
+ > [!NOTE]
620
+ > This project is part of a portfolio demonstrating production-grade AI skill engineering: research-driven scaffolding, self-validating output, multi-layer quality gates, and measurable outcome quality. [View all projects](https://github.com/maioio)
621
+
622
+ ## License
623
+
624
+ [MIT](LICENSE) - Maio Eshet
625
+
626
+ ---
627
+
628
+ <div align="center">
629
+
630
+ **[Star this repo](https://github.com/maioio/genesis-architect/stargazers) if Genesis Architect saved you from a bad architecture decision. It helps others find it.**
631
+
632
+ [Issues](https://github.com/maioio/genesis-architect/issues) · [Discussions](https://github.com/maioio/genesis-architect/discussions) · [CHANGELOG](CHANGELOG.md)
633
+
634
+ </div>
635
+