|
| 1 | +# Contributing to Frame Codex |
| 2 | + |
| 3 | +Welcome! This document is a high-level, human-friendly guide for contributing to **Frame Codex**. |
| 4 | +For the full, step-by-step workflow, see [`docs/contributing/how-to-submit.md`](docs/contributing/how-to-submit.md). |
| 5 | + |
| 6 | +--- |
| 7 | + |
| 8 | +## 1. What is Frame Codex? |
| 9 | + |
| 10 | +Frame Codex is a **data-only, markdown-first knowledge fabric** designed for AI systems: |
| 11 | + |
| 12 | +- **Fabric** – The entire repository: a collection of weaves. |
| 13 | +- **Weave** – Top-level knowledge universe (e.g. `weaves/frame/`, `weaves/wiki/`). |
| 14 | +- **Loom** – Any subdirectory inside a weave (topic/module, inferred from folders). |
| 15 | +- **Strand** – Individual markdown file at any depth inside a weave (atomic unit). |
| 16 | + |
| 17 | +There is **no UI** in this repo. The primary viewer lives at: |
| 18 | + |
| 19 | +- **Frame.dev Codex UI**: <https://frame.dev/codex> |
| 20 | +- **Repo**: <https://github.com/framersai/frame.dev> (app that renders this Codex) |
| 21 | + |
| 22 | +--- |
| 23 | + |
| 24 | +## 2. Recommended Contribution Path (Frame.dev UI) |
| 25 | + |
| 26 | +The easiest way to contribute is **inside the Codex UI** at [`frame.dev/codex`](https://frame.dev/codex): |
| 27 | + |
| 28 | +1. Open the Codex viewer and browse to the area you want to extend. |
| 29 | +2. Click **“Contribute”** in the toolbar (or use the contribution hotkey). |
| 30 | +3. Fill out: |
| 31 | + - **Title** (required) |
| 32 | + - **Summary** (20–300 chars, required) |
| 33 | + - **Content** (markdown, required) |
| 34 | + - **Weave + Loom** (optional – UI can suggest based on current path/content) |
| 35 | + - **Tags, Difficulty, Subjects, Topics** (optional but encouraged) |
| 36 | +4. (Optional) Toggle **AI Enhancement** to let the pipeline refine tags and metadata. |
| 37 | +5. (Optional) Provide a **GitHub Personal Access Token (PAT)** to let the browser create a PR via API. |
| 38 | +6. Preview the generated markdown + frontmatter. |
| 39 | +7. Click **“Create Pull Request”**: |
| 40 | + - With PAT → a PR is created via the GitHub API from your fork. |
| 41 | + - Without PAT → GitHub’s web editor opens with the file pre-filled. |
| 42 | + |
| 43 | +### GitHub PAT Privacy |
| 44 | + |
| 45 | +- PAT is entered **only** into the Codex contribution modal in your browser. |
| 46 | +- It is stored **only in memory** in that tab while the modal is open. |
| 47 | +- It is **never** written to: |
| 48 | + - `localStorage` |
| 49 | + - `sessionStorage` |
| 50 | + - IndexedDB / SQL cache |
| 51 | + - Any Frame.dev backend |
| 52 | +- The token is sent **only** to GitHub’s API endpoints for: |
| 53 | + - Forking `framersai/codex` |
| 54 | + - Creating a branch + file |
| 55 | + - Opening a pull request |
| 56 | + |
| 57 | +You can always skip the PAT and use the GitHub web editor flow instead. |
| 58 | + |
| 59 | +--- |
| 60 | + |
| 61 | +## 3. Manual Git Workflow (Advanced) |
| 62 | + |
| 63 | +If you prefer the CLI, follow the traditional flow: |
| 64 | + |
| 65 | +1. **Fork & Clone** |
| 66 | + |
| 67 | + ```bash |
| 68 | + gh repo fork framersai/codex --clone |
| 69 | + cd codex |
| 70 | + ``` |
| 71 | + |
| 72 | +2. **Create a Branch** |
| 73 | + |
| 74 | + ```bash |
| 75 | + git checkout -b add-my-content |
| 76 | + ``` |
| 77 | + |
| 78 | +3. **Add Content** |
| 79 | + |
| 80 | + - Place files under a weave: |
| 81 | + |
| 82 | + ```text |
| 83 | + weaves/ |
| 84 | + [weave]/ # e.g. frame/, wiki/, technology/ |
| 85 | + weave.yaml |
| 86 | + overview.md # Strand at weave root |
| 87 | + guides/ # Loom (folder inferred from path) |
| 88 | + loom.yaml # Optional |
| 89 | + intro.md # Strand |
| 90 | + deep-dive/notes.md # Nested loom/strand |
| 91 | + ``` |
| 92 | +
|
| 93 | + - See [`docs/contributing/submission-schema.md`](docs/contributing/submission-schema.md) for required fields. |
| 94 | +
|
| 95 | +4. **Validate & Index** |
| 96 | +
|
| 97 | + ```bash |
| 98 | + npm install |
| 99 | + npm run validate |
| 100 | + npm run index -- --validate |
| 101 | + ``` |
| 102 | + |
| 103 | +5. **Commit & Push** |
| 104 | + |
| 105 | + ```bash |
| 106 | + git add . |
| 107 | + git commit -m "feat: add [your content title]" |
| 108 | + git push origin add-my-content |
| 109 | + ``` |
| 110 | + |
| 111 | +6. **Open a PR** |
| 112 | + |
| 113 | + ```bash |
| 114 | + gh pr create --title "Add: [Your Content Title]" --body "Description of your contribution" |
| 115 | + ``` |
| 116 | + |
| 117 | +--- |
| 118 | + |
| 119 | +## 4. Using the Frame.dev UI with Your Own Codex Repo |
| 120 | + |
| 121 | +You can reuse the Frame.dev Codex UI to render **any** Codex-style repository: |
| 122 | + |
| 123 | +1. **Fork `framersai/frame.dev`**. |
| 124 | +2. In your fork, create `.env.local` under `apps/frame.dev`: |
| 125 | + |
| 126 | + ```bash |
| 127 | + NEXT_PUBLIC_CODEX_REPO_OWNER=your-github-username-or-org |
| 128 | + NEXT_PUBLIC_CODEX_REPO_NAME=your-codex-repo |
| 129 | + NEXT_PUBLIC_CODEX_REPO_BRANCH=main |
| 130 | + ``` |
| 131 | + |
| 132 | +3. The viewer reads these in `components/codex/constants.ts` via `REPO_CONFIG`. |
| 133 | +4. Run the UI locally: |
| 134 | + |
| 135 | + ```bash |
| 136 | + cd apps/frame.dev |
| 137 | + pnpm install |
| 138 | + pnpm dev |
| 139 | + ``` |
| 140 | + |
| 141 | +5. Visit `http://localhost:3000/codex` to browse your own fabric. |
| 142 | + |
| 143 | +--- |
| 144 | + |
| 145 | +## 5. Quality Guidelines |
| 146 | + |
| 147 | +- **Content**: Clear, self-contained strands with real knowledge (no placeholders). |
| 148 | +- **Metadata**: Fill in `title`, `summary`, `tags`, `difficulty`, `subjects`, `topics`. |
| 149 | +- **Structure**: Use headings, lists, and code blocks for readability. |
| 150 | +- **Licensing**: Contributions must be compatible with **CC-BY-4.0**. |
| 151 | + |
| 152 | +For full details, examples, and schema reference, see: |
| 153 | + |
| 154 | +- [`docs/contributing/how-to-submit.md`](docs/contributing/how-to-submit.md) |
| 155 | +- [`docs/contributing/submission-schema.md`](docs/contributing/submission-schema.md) |
| 156 | +- [`docs/openstrand-architecture.md`](docs/openstrand-architecture.md) |
| 157 | + |
| 158 | + |
0 commit comments