# v1.14 Distribution Structure Reorganization (2-Repository System)
Release Date: TBD
## Purpose
- **Separate development (private)** and **distribution (public)** repositories
- Eliminate mixing of distribution items and development-only items (tests, samples, etc.)
- Ensure `init-project.sh` **correctly copies distribution templates**
- Guarantee **neither repository tracks runtime artifacts or secrets**
---
## Repository Structure
| Repository | URL | Purpose | Tracked Items |
|------------|-----|---------|---------------|
| **private** | `tech-spoke/llm-helper-private` | Manages all files needed for development | Distribution + tests + samples + drafts + guides |
| **public** | `tech-spoke/llm-helper` | Users obtain via `git clone` | Only files needed for distribution |
Local development environment remote configuration:
```
origin → llm-helper-private (daily push/pull)
public → llm-helper (push via sync script)
```
---
## File Classification
### A. Distribution Targets (Tracked in Both Repositories)
- Server core: `code_intel_server.py`, `tools/**`
- Setup: `setup.sh`, `init-project.sh`, `requirements.txt`
- Distribution templates: `templates/code-intel/**`, `templates/claude/**`, `templates/skills/**`
- Documentation: `README.md`, `README_ja.md`, `docs/DESIGN.md`, `docs/DESIGN_ja.md`, `docs/updates/**`
- `.gitignore`
### B. Development Only (Private Repo Only)
- Tests: `tests/**`, `tests_with_code/**`, `pytest.ini`
- Samples: `sample/**`
- Work-in-progress notes: `docs/draft/**`
- Internal operational rules: `docs/DOCUMENTATION_RULES.md`, `AGENTS.md`
- Distribution procedures: `docs/distribution/**`
- IDE associated: `llm-helper.code-workspace`
- LLM guides: `.claude/CLAUDE.md`, `.claude/PARALLEL_GUIDE.md`
### C. Not Tracked in Either (Runtime Artifacts, Environment-Dependent)
- Runtime artifacts: `.code-intel/**` (sessions, chroma, logs, ctags_cache, etc.)
- LLM command artifacts: `.claude/commands/**` (generated by `init-project.sh`)
- Python environment: `__pycache__/`, `*.pyc`, `venv/`, `.venv/`, `.env`
- LLM local settings: `.claude/settings.local.json` (environment-dependent)
- Codex local: `.codex/**`
- Playwright: `.playwright-mcp/**`
- OS/IDE: `.DS_Store`, `.vscode/`, `.idea/`
- Database: `vectors.db`, `*.db`
- Models: `models/**` (large size, reproducible via download so not Git-managed)
- Logs: `logs/`, `*.log`
---
## Current State Investigation (Public Repo Tracking Status)
### Investigation Procedure (Required)
After implementing policy 4 (remote change), investigate referencing `public` remote:
1) Get list of tracked files in public repo with `git ls-tree -r --name-only public/main`
2) Compare against A/B/C classification, identify files matching B/C
3) Record as deletion targets
※ Before remote change, use `origin/main`. After change, always use `public/main`.
### Identifying Deletion Targets
From file list obtained above, mark items matching B/C classification as deletion targets.
Generate specific file list at runtime (don't embed fixed values in spec).
**Patterns that may match B classification:**
- `.claude/CLAUDE.md`, `.claude/PARALLEL_GUIDE.md`
- `docs/draft/**`, `docs/DOCUMENTATION_RULES.md`
- `tests/**`, `tests_with_code/**`, `pytest.ini`
- `sample/**`
- `llm-helper.code-workspace`
**Patterns that may match C classification:**
- `.claude/commands/**`, `.claude/settings.local.json`
- `.playwright-mcp/**`, `.codex/**`
### Template Consistency Check (Required)
Add if missing from A classification:
- `templates/code-intel/{config.json, context.yml, doc_research/**, review_prompts/**, interventions/**, verifiers/**, task_planning.md, phase_contract.yml, user_escalation.md}`
- `templates/skills/claude/{code.md, exp.md}`
- `templates/skills/codex/*/SKILL.md`
---
## Policies
### 1) Template Dedicated Directory (Implemented)
Distribution items consolidated in `templates/code-intel/` and `templates/skills/`.
### 2) `.code-intel/` for Generated Artifacts (Implemented)
`.code-intel/` is the runtime-created area. Not Git-managed in either repository.
### 3) Change `init-project.sh` Copy Source to Templates (Implemented)
- `templates/code-intel/` → Copy to `.code-intel/`
- `templates/skills/claude/` → Copy to `.claude/commands/`
### 4) Remote Configuration Change
Change local development environment remotes:
```bash
git remote set-url origin https://github.com/tech-spoke/llm-helper-private.git
git remote add public https://github.com/tech-spoke/llm-helper.git
```
### 5) Create Sync Script
Create `sync-to-public.sh` to sync only A-classification files to public repo.
Processing flow:
1. Clone public repo to temporary directory
2. Copy A-classification files from private → public (`rsync --delete`, etc.)
3. Commit & push
### 6) Public Repo Cleanup
Delete B/C classification files currently tracked in public repo via `git rm`.
### 7) Organize `.gitignore`
`.gitignore` is **common to both repositories** (excludes only C classification).
B classification separation is handled by sync script, not `.gitignore`.
---
## Implementation Tasks
- [x] 1) Create `templates/code-intel/` and place template set
- [x] 1.5) Create `templates/skills/` and place Claude/Codex templates
- [x] 2) Modify `init-project.sh` to template-priority copy
- [x] 3) Document distribution structure in documentation (README, etc.)
- [x] 4) Set up private repo (remote change, push all files)
- Changed `origin` → `llm-helper-private`, `public` → `llm-helper`
- Pushed `main` + work branches to private repo
- [x] 5) Create `sync-to-public.sh` (sync only A-classification files to public)
- rsync filter includes only A-classification, excludes C-classification first
- Confirmed B/C exclusion, A-only sync with `--dry-run`
- [x] 6) Delete B/C classification files from public repo
- Confirmed A-classification only sync with `sync-to-public.sh`, B/C deleted
- Verified all files in public/main are A-classification only
- [x] 7) Organize `.gitignore` (unified to C-classification exclusion only)
- Added `.claude/settings.local.json`, restructured comments to match C-classification categories
---
## Not Covered (Not Done in v1.14)
- Compatibility changes for `.code-intel` internal artifacts
- Behavior changes in `tools/`
- Semantic changes to existing template contents
- Automated sync via GitHub Actions (future consideration)
---
## Expected Benefits
- All files needed for development safely managed in private repo
- Public repo contains only distribution items, users can obtain via `git clone`
- `init-project.sh` can always distribute correct templates
- Sync script makes distribution sync reproducible with no omissions