Generic rules for all AI coding agents working in this repository.
Agent-specific files (CLAUDE.md, .cursorrules, etc.) extend these rules — they do not override them.
git-extract is a web tool for extracting a git subdirectory (with its full history) into a
separate repository. Users authenticate with GitHub or GitLab, pick a source folder via a tree
view, choose a target repo, and the tool runs git filter-repo inside a GitHub Actions workflow
to rewrite and push the history.
| Layer | Technology |
|---|---|
| Frontend | Quasar CLI + Vite, Vue 3 Composition API, Pinia |
| Frontend hosting | Cloudflare Pages |
| Backend | Cloudflare Worker (itty-router) |
| Auth — GitHub | OAuth App, token exchange in Worker |
| Auth — GitLab | PKCE in browser, no Worker involved |
| Git operations | GitHub Actions workflow in this repo (extract.yml) |
| Secret encryption | tweetnacl (libsodium box) inside the Worker |
git-extract/
├── AGENTS.md ← you are here
├── CLAUDE.md ← Claude Code specific extensions
├── .github/workflows/
│ ├── lint-build.yml ← lint + build on PR
│ └── extract.yml ← the git extraction runner (permanent, never touched at runtime)
├── src/ ← Quasar SPA source
│ ├── boot/ ← fetch wrapper (api.js)
│ ├── components/ ← ProviderLogin, RepoList, FolderTree, StatusPoller
│ ├── layouts/ ← MainLayout
│ ├── pages/ ← LoginPage, ReposPage, ExtractPage
│ ├── router/
│ ├── services/ ← github.js, gitlab.js
│ └── stores/ ← auth.js, repos.js (Pinia)
├── quasar.config.js
├── index.html
└── package.json
npm install # install dependencies
npm run dev # Quasar dev server → http://localhost:9000
npm run build # build the SPA- Match the style of the file you are editing. Do not reformat unrelated code.
- Do not add comments that describe what the code does — only add them when the why is non-obvious (hidden constraint, workaround, subtle invariant).
- Do not introduce abstractions beyond what the current task requires.
- Do not add error handling for scenarios that cannot happen in the current call context.
- Prefer editing existing files over creating new ones.
- Vue 3 Composition API only — no Options API.
- Use Quasar components (
QBtn,QTree,QCard, etc.) instead of plain HTML where a Quasar equivalent exists. - State lives in Pinia stores. Components do not hold cross-page state.
- API calls go through
src/services/github.jsorsrc/services/gitlab.js— not directly in components or stores.
- All routes are pure functions:
(request, env) => Response. - Secrets (
env.GH_SERVICE_PAT,env.GITHUB_CLIENT_SECRET) must never appear in responses or logs. - CORS origin must be validated against
env.SPA_URL— never useAccess-Control-Allow-Origin: *.
- The workflow file is static — the Worker dispatches it but never modifies it at runtime.
- Do not add steps that write to the
git-extractrepository itself during a run.
- Write commit messages in the imperative mood:
add X,fix Y,refactor Z. - Scope to the workspace when relevant:
frontend: add FolderTree component. - Do not append
Co-Authored-Bylines attributing any AI tool or agent. Commits are authored by the human developer. Agent contributions are invisible by design. - Do not reference issue numbers in commit message bodies unless the user explicitly asks.
Always pause and confirm before:
- Any
git push --forceor history-rewriting operation. - Deleting files or directories.
- Changing
wrangler.tomlproduction vars or deploying to Cloudflare. - Adding new npm dependencies (confirm the package name and reason first).