@legioncodeinc/rflectr 0.1.0

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 (69) hide show
  1. package/.markdown-link-check.json +7 -0
  2. package/AGENTS.md +169 -0
  3. package/LICENSE +661 -0
  4. package/README.md +612 -0
  5. package/assets/733630021_1421561133353555_3999689754075308337_n.jpg +0 -0
  6. package/assets/github-home-image.png +0 -0
  7. package/assets/og-image.jpg +0 -0
  8. package/assets/og-image.png +0 -0
  9. package/assets/og-image.psd +0 -0
  10. package/assets/rflectr-no-bg.png +0 -0
  11. package/assets/vertex-models.example.json +14 -0
  12. package/dist/cli.js +15708 -0
  13. package/library/README.md +39 -0
  14. package/library/issues/README.md +46 -0
  15. package/library/issues/backlog/README.md +26 -0
  16. package/library/issues/completed/README.md +13 -0
  17. package/library/issues/in-work/README.md +13 -0
  18. package/library/knowledge/README.md +34 -0
  19. package/library/knowledge/private/README.md +40 -0
  20. package/library/knowledge/private/ai/README.md +8 -0
  21. package/library/knowledge/private/ai/model-discovery-classification.md +81 -0
  22. package/library/knowledge/private/ai/translation-layer.md +88 -0
  23. package/library/knowledge/private/architecture/README.md +10 -0
  24. package/library/knowledge/private/architecture/launch-flow-claude.md +93 -0
  25. package/library/knowledge/private/architecture/system-overview.md +108 -0
  26. package/library/knowledge/private/auth/README.md +9 -0
  27. package/library/knowledge/private/auth/oauth-device-flows.md +95 -0
  28. package/library/knowledge/private/data/README.md +8 -0
  29. package/library/knowledge/private/data/preferences-config.md +87 -0
  30. package/library/knowledge/private/data/provider-registry.md +126 -0
  31. package/library/knowledge/private/infrastructure/README.md +7 -0
  32. package/library/knowledge/private/infrastructure/server-gateway.md +87 -0
  33. package/library/knowledge/private/integrations/README.md +8 -0
  34. package/library/knowledge/private/integrations/harnesses.md +87 -0
  35. package/library/knowledge/private/integrations/local-proxy.md +82 -0
  36. package/library/knowledge/private/security/README.md +9 -0
  37. package/library/knowledge/private/security/credential-storage.md +129 -0
  38. package/library/knowledge/private/standards/documentation-framework.md +154 -0
  39. package/library/knowledge/public/README.md +49 -0
  40. package/library/knowledge/public/faqs/README.md +7 -0
  41. package/library/knowledge/public/faqs/troubleshooting.md +92 -0
  42. package/library/knowledge/public/guides/README.md +13 -0
  43. package/library/knowledge/public/guides/ai-agents.md +273 -0
  44. package/library/knowledge/public/guides/api-server.md +108 -0
  45. package/library/knowledge/public/guides/claude-desktop.md +382 -0
  46. package/library/knowledge/public/guides/codex.md +296 -0
  47. package/library/knowledge/public/guides/gemini-cli.md +105 -0
  48. package/library/knowledge/public/guides/model-compatibility.md +80 -0
  49. package/library/knowledge/public/guides/providers.md +90 -0
  50. package/library/knowledge/public/overview/README.md +7 -0
  51. package/library/knowledge/public/overview/what-is-rflectr.md +71 -0
  52. package/library/notes/README.md +21 -0
  53. package/library/requirements/README.md +51 -0
  54. package/library/requirements/backlog/README.md +30 -0
  55. package/library/requirements/completed/README.md +14 -0
  56. package/library/requirements/completed/prd-001-cli-core-launch-orchestration/prd-001-cli-core-launch-orchestration-index.md +205 -0
  57. package/library/requirements/completed/prd-001-cli-core-launch-orchestration/qa/.gitkeep +0 -0
  58. package/library/requirements/completed/prd-002-provider-registry/qa/.gitkeep +0 -0
  59. package/library/requirements/completed/prd-003-model-discovery-classification/qa/.gitkeep +0 -0
  60. package/library/requirements/completed/prd-004-translation-layer/qa/.gitkeep +0 -0
  61. package/library/requirements/completed/prd-005-local-proxy-catalog-routing/qa/.gitkeep +0 -0
  62. package/library/requirements/completed/prd-007-oauth-device-flows/qa/.gitkeep +0 -0
  63. package/library/requirements/completed/prd-011-claude-desktop-integration/qa/.gitkeep +0 -0
  64. package/library/requirements/in-work/README.md +19 -0
  65. package/library/requirements/reports/README.md +31 -0
  66. package/package.json +84 -0
  67. package/scripts/refresh-models-dev-cache.mjs +34 -0
  68. package/test-proxy.ts +19 -0
  69. package/test-split.js +1 -0
@@ -0,0 +1,105 @@
1
+ # Gemini CLI
2
+
3
+ > Category: Guide | Version: 1.0 | Date: June 2026 | Status: Active ยท Experimental
4
+
5
+ Use the **Google Gemini CLI** with any model from your rflectr registry โ€” Anthropic, xAI, Google Gemini, Nvidia, DeepSeek, OpenAI, and more.
6
+
7
+ > ๐Ÿงช **Experimental.** Gemini CLI integration is newer than the Claude and Codex paths; expect rough edges.
8
+
9
+ | Command | Launches | Config target |
10
+ |---|---|---|
11
+ | `rflectr gemini` | Gemini **terminal** (prompt loop / TUI) | Ephemeral proxy port via environment variables. |
12
+
13
+ It uses the same registry (`~/.rflectr/providers.json`) and provider picker as Claude Code and Codex โ€” Google's native Gemini endpoints when possible, and a local translation proxy for everything else.
14
+
15
+ > ๐Ÿ“– Full flags: `rflectr gemini --help`.
16
+ > ๐Ÿค– Automating it? See [AI Agents & automation](ai-agents.md) or run `rflectr --ai`.
17
+
18
+ ---
19
+
20
+ ## Prerequisites
21
+
22
+ 1. **rflectr** on your PATH (`npm install -g @legioncodeinc/rflectr`, or built locally).
23
+ 2. **At least one provider:** `rflectr providers add` (or `rflectr providers import`).
24
+ 3. **Gemini CLI installed:** `npm install -g @google/gemini-cli`.
25
+
26
+ Registry providers plus OpenCode Zen/Go all route through rflectr's translation layer when they don't natively speak Gemini format.
27
+
28
+ ---
29
+
30
+ ## How it works
31
+
32
+ The Gemini CLI uses the **Gemini API format** (`POST /v1beta/models/<model>:generateContent`). When you pick a non-Google provider, rflectr spins up a local translation proxy:
33
+
34
+ ```mermaid
35
+ flowchart LR
36
+ gemini["Gemini CLI"]
37
+ gemini -->|"Tier 1: Google only"| google["Google directly"]
38
+ gemini -->|"Tier 2: everyone else"| proxy["rflectr proxy<br/>(127.0.0.1)"]
39
+ proxy --> sdk["Vercel AI SDK"]
40
+ sdk --> upstream["Anthropic / xAI / OpenAI / โ€ฆ"]
41
+ ```
42
+
43
+ Your real API keys stay in rflectr (keychain / registry); the proxy holds them in memory for the session.
44
+
45
+ ---
46
+
47
+ ## Quick start
48
+
49
+ ```bash
50
+ rflectr gemini
51
+ ```
52
+
53
+ Pick provider โ†’ pick model โ†’ the Gemini prompt loop opens, pointed at the translation proxy automatically.
54
+
55
+ ### Flags
56
+
57
+ | Flag | Purpose |
58
+ |---|---|
59
+ | *(none)* | Interactive launch. |
60
+ | `--trace` | Write debug logs to `~/.rflectr/logs/gemini-proxy-debug.log`. |
61
+ | `--help` | Help text. |
62
+
63
+ rflectr manages `--provider` and `--model`; pass other Gemini CLI flags directly:
64
+
65
+ ```bash
66
+ rflectr gemini -p "Analyze this"
67
+ rflectr gemini --provider google --model gemini-2.5-flash -p "Review this file" -o stream-json
68
+ ```
69
+
70
+ ### Environment isolation
71
+
72
+ On launch, rflectr builds a clean child environment: it removes conflicting Gemini env vars, points the CLI at the proxy via base-URL discovery, and sets the selected model. When the CLI exits (normal, `Ctrl+C`, or terminal close), your shell is unchanged.
73
+
74
+ ### Favorites catalog mode
75
+
76
+ With favorites saved via `rflectr models`, `rflectr gemini` shows your starting model + favorites in the mid-session picker natively.
77
+
78
+ ---
79
+
80
+ ## Provider routing
81
+
82
+ | Provider | Route | Notes |
83
+ |---|---|---|
84
+ | **Google** | Tier 1 direct | Native Gemini endpoints for best performance. |
85
+ | **Anthropic, xAI, OpenAI, Nvidia, DeepSeek, โ€ฆ** | Tier 2 proxy | Converts Gemini-format requests to each native format via the Vercel AI SDK. |
86
+ | **OpenCode Zen / Go** | Tier 2 proxy | Requires an OpenCode API key. |
87
+
88
+ ---
89
+
90
+ ## Troubleshooting
91
+
92
+ | Symptom | Fix |
93
+ |---|---|
94
+ | Provider missing in picker | `rflectr providers add` |
95
+ | Model errors / disconnected | `rflectr gemini --trace`, then read `~/.rflectr/logs/gemini-proxy-debug.log` |
96
+ | JSON parse error on first stdout lines (agents) | Add `-o stream-json` or `-o json` |
97
+
98
+ **Known limitation:** the model name in the top-right of the Gemini CLI UI does not refresh after a mid-session `.model` switch. This is a Gemini CLI UI limitation, not a routing problem โ€” the new model is active.
99
+
100
+ ---
101
+
102
+ ## Related guides
103
+
104
+ - [AI Agents & automation](ai-agents.md) ยท [Providers](providers.md) ยท [Troubleshooting](../faqs/troubleshooting.md)
105
+ - [Gemini CLI on npm](https://www.npmjs.com/package/@google/gemini-cli)
@@ -0,0 +1,80 @@
1
+ # Model Compatibility
2
+
3
+ > Category: Guide | Version: 1.0 | Date: June 2026 | Status: Active
4
+
5
+ Why some models don't appear in the picker, and how rflectr decides what to show. By default rflectr shows every model a provider's live API returns โ€” models are hidden **only when there's a specific reason** (they can't run a coding agent, or a free promo ended).
6
+
7
+ ---
8
+
9
+ ## The two filters
10
+
11
+ ```mermaid
12
+ flowchart TD
13
+ api["Live provider API model list"] --> bl{"In curated blacklist?"}
14
+ bl -->|yes| hide["Hidden"]
15
+ bl -->|no| cap{"In models.dev catalog<br/>and unfit for coding agents?"}
16
+ cap -->|yes| hide
17
+ cap -->|no| show["Shown in picker"]
18
+ ```
19
+
20
+ 1. **Curated blacklist** โ€” `src/data/model-incompatible.json`. Researched entries, each with a provider, model id, category, reason, and sources.
21
+ 2. **models.dev capabilities** โ€” a bundled full snapshot in `src/data/models-dev-cache.json` (~2 MB, all providers). When a model exists in that catalog, rflectr may auto-hide it if it can't support coding agents (no text output, `tool_call: false`, etc.). **Missing catalog data never hides a model.**
22
+
23
+ **Offline / blocked network:** the bundled snapshot is always used when `~/.rflectr/models-dev-cache.json` is missing or a fetch fails. **On launch:** rflectr refreshes from `https://models.dev/api.json` in the background (non-blocking); the next compatibility check uses the updated file.
24
+
25
+ ---
26
+
27
+ ## Google Gemini (raw API)
28
+
29
+ Google's `GET /v1/models` returns **many non-chat models** (Imagen, Veo, embeddings, TTS, robotics, โ€ฆ), and models.dev only catalogs a subset. So rflectr also keeps explicit `provider: google` entries in the blacklist for non-coding ids verified on the live API list. After `rflectr providers refresh-models`, if new non-coding ids appear, they should be added to the blacklist rather than matched by name patterns.
30
+
31
+ ---
32
+
33
+ ## "Why don't I see model X?"
34
+
35
+ | Likely cause | What to do |
36
+ |---|---|
37
+ | It's a non-coding model (image/video/embedding/TTS). | Expected โ€” those are filtered out. |
38
+ | Its free promotion ended (stale id still returned by the API). | Expected โ€” hidden via a `"*"` blacklist entry. |
39
+ | Your model list is stale. | `rflectr providers refresh-models [provider]`. |
40
+ | You think it's hidden by mistake. | Run with `--trace` where supported โ€” hidden models log via `hideReason()`. |
41
+
42
+ ---
43
+
44
+ ## Maintainers
45
+
46
+ ### Add a blacklist entry
47
+
48
+ Edit `src/data/model-incompatible.json`:
49
+
50
+ ```json
51
+ {
52
+ "provider": "google",
53
+ "modelId": "example-bad-model",
54
+ "category": "managed_agent",
55
+ "reason": "Plain English explanation",
56
+ "sources": ["https://โ€ฆ"],
57
+ "verifiedAt": "2026-06-10"
58
+ }
59
+ ```
60
+
61
+ - Use `"provider": "*"` to hide a model id for **every** provider (stale promos, deprecated ids).
62
+ - Optional `"agents": ["codex", "codex-app"]` limits hiding to specific launch surfaces.
63
+
64
+ Rebuild after changes: `npm run build`.
65
+
66
+ ### Refresh the bundled snapshot
67
+
68
+ Before a release (or when models.dev changes materially):
69
+
70
+ ```bash
71
+ npm run refresh:models-dev
72
+ ```
73
+
74
+ This commits an updated `src/data/models-dev-cache.json` for offline installs. The user cache path is `~/.rflectr/models-dev-cache.json`, written automatically on launch when the network allows.
75
+
76
+ ---
77
+
78
+ ## Related guides
79
+
80
+ - [Providers](providers.md) ยท [Troubleshooting](../faqs/troubleshooting.md)
@@ -0,0 +1,90 @@
1
+ # Providers
2
+
3
+ > Category: Guide | Version: 1.0 | Date: June 2026 | Status: Active
4
+
5
+ Every provider rflectr can launch, the base URL each uses, and the gotchas worth knowing before you add one. New to rflectr? Start with [What is rflectr?](../overview/what-is-rflectr.md)
6
+
7
+ ---
8
+
9
+ ## How the registry works
10
+
11
+ `rflectr` stores your providers and cached model lists in a **native provider registry** at `~/.rflectr/providers.json`. API keys are kept in your **OS keychain**, never in that file. Add a provider with:
12
+
13
+ ```bash
14
+ rflectr providers add # pick a template, paste a key
15
+ rflectr providers import # one-time import from an existing OpenCode setup
16
+ rflectr providers list # see what's configured
17
+ ```
18
+
19
+ When you add a provider, rflectr picks the correct endpoint format (`@ai-sdk/openai-compatible` vs a provider-specific SDK) and fetches the available models automatically.
20
+
21
+ ---
22
+
23
+ ## Built-in cloud backends
24
+
25
+ These are always available with an `OPENCODE_API_KEY` โ€” they don't need to be added to the registry.
26
+
27
+ | id | Description |
28
+ |---|---|
29
+ | `zen` | OpenCode Zen โ€” free and paid models. |
30
+ | `go` | OpenCode Go โ€” paid models. |
31
+
32
+ ---
33
+
34
+ ## Hosted providers
35
+
36
+ | Provider | Base URL | Notes |
37
+ |---|---|---|
38
+ | **Anthropic** | `https://api.anthropic.com` | Official Claude API. Recommended for standard Claude access. |
39
+ | **OpenAI** | `https://api.openai.com/v1` | GPT, o-series reasoning models, and Codex. |
40
+ | **Google Gemini** | `https://generativelanguage.googleapis.com/v1beta/openai` | Official Gemini API. |
41
+ | **Groq** | `https://api.groq.com/openai/v1` | Ultra-fast inference for open-weight models (Llama, Mixtral). |
42
+ | **Mistral** | `https://api.mistral.ai/v1` | โš ๏ธ Free tier has strict rate limits (HTTP 429) โ€” tool-heavy sessions burn quota fast. |
43
+ | **Together AI** | `https://api.together.xyz/v1` | Train, fine-tune, and run open-source models. |
44
+ | **Cerebras** | `https://api.cerebras.ai/v1` | High-speed inference on wafer-scale chips. |
45
+ | **DeepInfra** | `https://api.deepinfra.com/v1/openai` | Serverless inference for open-source models. |
46
+ | **DeepSeek** | `https://api.deepseek.com/v1` | DeepSeek coding and chat models. |
47
+ | **Zhipu AI (GLM)** | `https://open.bigmodel.cn/api/paas/v4` | The GLM model family. |
48
+ | **Alibaba DashScope** | `https://dashscope.aliyuncs.com/compatible-mode/v1` | Qwen and other models. |
49
+ | **xAI** | `https://api.x.ai/v1` | Grok models. Supports OAuth โ€” see [Codex ยง OAuth](codex.md#oauth). |
50
+ | **Perplexity** | `https://api.perplexity.ai` | Perplexity's online Sonar models. |
51
+ | **Cohere** | `https://api.cohere.com/compatibility/v1` | Command models. |
52
+ | **OpenRouter** | `https://openrouter.ai/api/v1` | Unified proxy to dozens of models. |
53
+
54
+ ---
55
+
56
+ ## Local models (Ollama & LM Studio)
57
+
58
+ Connect to a locally running inference engine. When you add one, rflectr prompts for your local URL (e.g. `http://127.0.0.1:11434/v1`). You can leave the API key blank โ€” local engines generally don't require auth.
59
+
60
+ ---
61
+
62
+ ## The Moonshot / Kimi confusion
63
+
64
+ Moonshot AI split its product into **three separate platforms**. They all use the "Kimi" name but have **different billing, different base URLs, and non-interchangeable API keys**. Using the wrong template for your key gives a `401 Invalid Authentication` / `Incorrect API key` error.
65
+
66
+ | Platform | For | Base URL | Key from |
67
+ |---|---|---|---|
68
+ | **Moonshot (Kimi)** | China domestic, pay-as-you-go | `https://api.moonshot.cn/v1` | `platform.moonshot.cn` |
69
+ | **Moonshot Global (kimi.ai)** | International, pay-as-you-go | `https://api.moonshot.ai/v1` | `platform.kimi.ai` |
70
+ | **Kimi Code** | Monthly coding subscription | `https://api.kimi.com/coding/v1` | `kimi.com/code/console` |
71
+
72
+ > ๐Ÿ’ก The **Global** platform also grants `kimi-k2.7-code` directly through the standard API โ€” no separate coding subscription needed. If your key is from `platform.kimi.ai`, pick **Moonshot Global**.
73
+
74
+ ---
75
+
76
+ ## Advanced / not directly addable
77
+
78
+ These need credentials beyond a simple API key, so they aren't in the `add` template list:
79
+
80
+ | Provider | How to use |
81
+ |---|---|
82
+ | **Amazon Bedrock** | Needs AWS credentials. Configure in OpenCode, then `rflectr providers import`. |
83
+ | **Azure OpenAI** | Needs per-model deployment URLs. Configure in OpenCode, then import. |
84
+ | **Google Vertex AI** | Handled via `gcloud` Application Default Credentials through `rflectr server --vertex` โ€” no registry key required. See [API Server ยง Vertex](api-server.md). |
85
+
86
+ ---
87
+
88
+ ## Related guides
89
+
90
+ - [What is rflectr?](../overview/what-is-rflectr.md) ยท [Model compatibility](model-compatibility.md) ยท [Troubleshooting](../faqs/troubleshooting.md)
@@ -0,0 +1,7 @@
1
+ # Overview
2
+
3
+ Start-here material: what rflectr is and the vocabulary for everything else.
4
+
5
+ | Doc | Covers |
6
+ |---|---|
7
+ | [what-is-rflectr.md](what-is-rflectr.md) | Elevator pitch, the surfaces you can launch, how it works in three ideas, and a glossary. |
@@ -0,0 +1,71 @@
1
+ # What is rflectr?
2
+
3
+ > Category: Overview | Version: 1.0 | Date: June 2026 | Status: Active
4
+
5
+ **rflectr** โ€” *point your coding agents at any model.* Launch Claude Code, OpenAI Codex, Google Gemini CLI, and the Claude / Codex desktop apps against whatever model you want โ€” OpenCode Zen & Go, or your own provider keys (Groq, Mistral, OpenAI, Gemini, DeepSeek, xAI, Ollama, and more) โ€” without touching the host tool's own settings.
6
+
7
+ Built by [Legion Code Inc.](https://github.com/legioncodeinc) ยท `npm install -g @legioncodeinc/rflectr`
8
+
9
+ ---
10
+
11
+ ## The one-paragraph version
12
+
13
+ Every major AI coding tool talks only to its vendor's API out of the box. rflectr sits in front of them: you pick a provider and model from an interactive wizard, and rflectr launches the tool with an environment (or a translating local proxy) that makes it believe it's talking to its native API. Run Claude Code on a Groq Llama model, Codex on DeepSeek, or Gemini CLI on a local Ollama endpoint โ€” same tools, any backend.
14
+
15
+ ```mermaid
16
+ flowchart LR
17
+ you["You pick<br/>provider + model"] --> rflectr["rflectr"]
18
+ rflectr --> cc["Claude Code"]
19
+ rflectr --> cx["Codex CLI / app"]
20
+ rflectr --> gm["Gemini CLI"]
21
+ rflectr --> cd["Claude Desktop"]
22
+ cc & cx & gm & cd --> any["Any model backend<br/>(Zen/Go, Groq, OpenAI, Gemini, Ollama, โ€ฆ)"]
23
+ ```
24
+
25
+ ---
26
+
27
+ ## What you can launch
28
+
29
+ | Command | Launches | Guide |
30
+ |---|---|---|
31
+ | `rflectr claude` | Claude Code CLI | (interactive โ€” start here) |
32
+ | `rflectr codex` / `codex-app` | OpenAI Codex CLI / desktop app | [Codex](../guides/codex.md) |
33
+ | `rflectr gemini` | Google Gemini CLI | [Gemini CLI](../guides/gemini-cli.md) |
34
+ | `rflectr claude-app` | Claude Desktop (Cowork + Code) | [Claude Desktop](../guides/claude-desktop.md) |
35
+ | `rflectr server` | Local API gateway (Anthropic + OpenAI compatible) | [API Server](../guides/api-server.md) |
36
+ | `rflectr providers` | Manage your provider registry | [Providers](../guides/providers.md) |
37
+ | `rflectr models` | Pick favorites for mid-session `/model` switching | โ€” |
38
+ | `rflectr --ai` | Machine-readable reference for scripts & agents | [AI Agents](../guides/ai-agents.md) |
39
+
40
+ ---
41
+
42
+ ## How it works, in three ideas
43
+
44
+ 1. **A provider registry.** Your providers and their models live in `~/.rflectr/providers.json`; secrets live in your OS keychain, never in the file. Add providers with `rflectr providers add` or import them from OpenCode once. See [Providers](../guides/providers.md).
45
+
46
+ 2. **A single translation layer.** Anything that isn't natively Anthropic is routed through one path โ€” the Vercel AI SDK โ€” so the host tool's wire format is translated to and from your chosen model. There's no per-provider hand-rolled translator. See [Model compatibility](../guides/model-compatibility.md).
47
+
48
+ 3. **No settings-file surgery.** rflectr launches the host with a purpose-built environment and a throwaway local proxy on `127.0.0.1`. The two desktop apps are the exception โ€” their config is patched, backed up, and restored on exit.
49
+
50
+ ---
51
+
52
+ ## Glossary
53
+
54
+ | Term | Meaning |
55
+ |---|---|
56
+ | **Provider** | A source of models โ€” `groq`, `openai`, `zen`, `go`, a local Ollama, etc. |
57
+ | **Registry** | Your saved providers + cached model lists, at `~/.rflectr/providers.json`. |
58
+ | **Zen / Go** | OpenCode's cloud backends. Always available with an `OPENCODE_API_KEY`. |
59
+ | **Proxy** | The local `127.0.0.1` server rflectr starts to translate wire formats. |
60
+ | **Favorites** | Up to 20 models saved with `rflectr models` for live `/model` switching. |
61
+ | **Boot flags** | `--provider` / `--model` โ€” skip the wizard for scripts and CI. |
62
+ | **Gateway** | The `rflectr server` long-lived endpoint, used by Claude Desktop. |
63
+
64
+ ---
65
+
66
+ ## Where to go next
67
+
68
+ - **Just want to use it?** Run `rflectr providers add`, then `rflectr claude`.
69
+ - **Set up a specific tool:** [Codex](../guides/codex.md) ยท [Gemini CLI](../guides/gemini-cli.md) ยท [Claude Desktop](../guides/claude-desktop.md) ยท [API Server](../guides/api-server.md)
70
+ - **Automating / scripting:** [AI Agents & automation](../guides/ai-agents.md)
71
+ - **Something's wrong:** [Troubleshooting](../faqs/troubleshooting.md)
@@ -0,0 +1,21 @@
1
+ ---
2
+ ai_description: |
3
+ HUMAN-ONLY junk drawer. Agents MUST NOT read from, write to, create
4
+ files in, or reference files in this folder for any purpose.
5
+ If you want to capture something persistent, write to
6
+ library/knowledge/private/<domain>/<slug>.md instead.
7
+ This invariant is absolute and has no exceptions.
8
+ human_description: |
9
+ Unstructured scratch space for humans. Agents do not touch this folder.
10
+ Put anything here: rough notes, links, half-formed ideas, meeting notes.
11
+ Nothing in notes/ is authoritative or maintained.
12
+ For persistent reference, move content to knowledge/private/ when it matures.
13
+ ---
14
+
15
+ # Notes
16
+
17
+ Human-only scratch space. Agents never read or write here.
18
+
19
+ Put rough notes, links, and half-formed ideas here. Nothing here is authoritative.
20
+
21
+ When a note matures into reference material, move it to `knowledge/private/<domain>/`.
@@ -0,0 +1,51 @@
1
+ ---
2
+ ai_description: |
3
+ This folder contains all planned product and feature work (PRDs).
4
+ Sub-folders: backlog/ (queued, not started), in-work/ (actively
5
+ being implemented), completed/ (shipped), reports/ (routine code scans).
6
+ Lifecycle = location: move entire PRD folders between states.
7
+ PRD folder naming: prd-<###>-<kebab-slug>/
8
+ PRD numbers are repo-local sequential. Take max+1 from all prd-* folders
9
+ across backlog/, in-work/, and completed/.
10
+ Never write PRD content outside of a prd-<###>-<slug>/ folder.
11
+ Do NOT put IRDs here โ€” those go in issues/ (peer of requirements/).
12
+ human_description: |
13
+ Product and feature work (PRDs) organized by lifecycle stage.
14
+ - backlog/: planned work not yet started
15
+ - in-work/: currently being implemented
16
+ - completed/: shipped work (move entire folder here when done)
17
+ - reports/: routine code-scan and QA reports not tied to a specific PRD
18
+ To start a new PRD: create prd-<###>-<slug>/ in backlog/ with an index.md.
19
+ To move lifecycle: move the entire prd-<###>-<slug>/ folder.
20
+ ---
21
+
22
+ # Requirements
23
+
24
+ Product and feature work, organized by lifecycle state.
25
+
26
+ ## Sub-folders
27
+
28
+ | Folder | State | Description |
29
+ |---|---|---|
30
+ | `backlog/` | Queued | PRDs planned but not yet started |
31
+ | `in-work/` | Active | PRDs currently being implemented |
32
+ | `completed/` | Shipped | Entire PRD folder moves here when work ships |
33
+ | `reports/` | Evergreen | Routine code-scan and QA reports not tied to a PRD |
34
+
35
+ ## PRD folder structure
36
+
37
+ ```
38
+ prd-007-user-export/
39
+ prd-007-user-export-index.md module overview + feature list
40
+ prd-007a-user-export-backend.md sub-feature a
41
+ prd-007b-user-export-ui.md sub-feature b
42
+ qa/
43
+ prd-007-user-export-qa.md QA audit (written by quality-guardian)
44
+ ```
45
+
46
+ ## Naming
47
+
48
+ - Folder: `prd-<###>-<kebab-slug>/` (3-digit zero-padded)
49
+ - Index: `prd-<###>-<kebab-slug>-index.md`
50
+ - Sub-PRDs: `prd-<###><letter>-<kebab-slug>-<feature>.md`
51
+ - PRD numbers are **repo-local sequential** โ€” not GitHub issue numbers.
@@ -0,0 +1,30 @@
1
+ ---
2
+ ai_description: |
3
+ Contains PRD folders planned but not yet started. This is where
4
+ library-guardian creates new PRD folders on "write a PRD for X".
5
+ PRD folder naming: prd-<###>-<kebab-slug>/ (3-digit zero-padded).
6
+ PRD number: take max+1 from all prd-* folders across backlog/,
7
+ in-work/, and completed/ in this repo.
8
+ Each PRD folder must contain: prd-<###>-<slug>-index.md (always),
9
+ prd-<###><letter>-<slug>-<feature>.md (one per sub-feature, optional),
10
+ qa/ subfolder (empty on creation; quality-guardian writes QA reports here).
11
+ Move entire folder to in-work/ when implementation begins.
12
+ human_description: |
13
+ PRDs planned but not yet started. Create new PRDs here.
14
+ - Naming: prd-007-feature-name/ with prd-007-feature-name-index.md inside
15
+ - Sub-features: prd-007a-feature-name-backend.md, prd-007b-feature-name-ui.md
16
+ - QA folder: qa/prd-007-feature-name-qa.md (created by quality-guardian)
17
+ Move to in-work/ when implementation begins.
18
+ ---
19
+
20
+ # Requirements โ€” Backlog
21
+
22
+ Planned PRDs not yet in implementation. All new PRD folders are created here.
23
+
24
+ ## Creating a new PRD
25
+
26
+ 1. Find `max_n` across `backlog/prd-*/`, `in-work/prd-*/`, `completed/prd-*/`.
27
+ 2. Create `prd-<max_n + 1>-<kebab-slug>/`.
28
+ 3. Create `prd-<###>-<slug>-index.md` (module overview + feature list).
29
+ 4. Create `qa/` subfolder (empty; `quality-guardian` writes reports here).
30
+ 5. Add sub-PRDs `prd-<###>a-<slug>-<feature>.md` etc. as needed.
@@ -0,0 +1,14 @@
1
+ ---
2
+ ai_description: |
3
+ Contains shipped PRD folders. Entire prd-<###>-<slug>/ folders move
4
+ here from in-work/ when the work ships. Read-only after landing here โ€”
5
+ do NOT edit or move files out of completed/.
6
+ The PRD index, sub-PRDs, and qa/ sub-folder all travel together.
7
+ human_description: |
8
+ Shipped PRD folders. Move entire prd-NNN-slug/ here from in-work/ when
9
+ the feature ships. Read-only โ€” do not edit completed PRDs.
10
+ ---
11
+
12
+ # Requirements โ€” Completed
13
+
14
+ Shipped PRD folders. Entire `prd-<###>-<slug>/` folders land here after the work ships and is confirmed in production. Do not edit files here after landing.