← knowledge.oriz.in

Deferred infra plan — folder reshape + submodule audit + repo template + Greasyfork prefill

decision infrafolder-hierarchysubmodulerepo-templategreasyfork

Deferred infra plan — 2026-07-03

4 items grilled + locked this session. Not executed here due to session context budget. Each has enough detail to execute directly next session.

1. Folder hierarchy reshape

Locked axes:

Migration mapping (18 own repos):

Current path New path
repos/own/api/constants-api repos/own/apis/constants-api
repos/own/api/countries-plus-api repos/own/apis/countries-plus-api
repos/own/api/dynasties-api repos/own/apis/dynasties-api
repos/own/api/ragas-api repos/own/apis/ragas-api
repos/own/api/rto-api repos/own/apis/rto-api
repos/own/api/oriz-mmi-tickertape-mmi-api (renamed mmi-api) repos/own/apis/mmi-api
repos/own/apps-bs-ext/bookmark-mind-bs-ext repos/own/apps-browser-ext/bookmark-mind-bs-ext
repos/own/apps-desktop/screenpipe-pwa repos/own/apps-desktop/screenpipe-pwa (unchanged)
repos/own/apps-mobile/* (3 apps) repos/own/apps-mobile/{janaushdhi,lore,ncert}-app (renamed)
repos/own/apps-vsc-ext/sops-lens-vsc-ext repos/own/apps-vscode-ext/sops-lens-vsc-ext
repos/own/books/* (2 books) repos/own/docs/{janaushdhi,me}-book
repos/own/infra/agent-skills repos/own/infra/agent-skills (unchanged)
repos/own/infra/api-fleet-landing repos/own/infra/api-fleet-landing (unchanged)
repos/own/infra/api-fleet-template repos/own/libs/api-fleet-template (npm pkg → libs/)
repos/own/infra/hermes-config repos/own/infra/hermes-config (unchanged)
repos/own/sites/* (4 sites: me, journal, home, blog) repos/own/webs/{me,journal,home,blog}
repos/own/userscripts repos/own/browser-scripts/userscripts

Execution:

cd C:/d/oriz
# Rename dirs — git preserves submodule config
git mv repos/own/api repos/own/apis
git mv repos/own/apps-bs-ext repos/own/apps-browser-ext
git mv repos/own/apps-vsc-ext repos/own/apps-vscode-ext
git mv repos/own/books repos/own/docs
git mv repos/own/sites repos/own/webs
# Move template + userscripts to their new homes
git mv repos/own/infra/api-fleet-template repos/own/libs/api-fleet-template
mkdir repos/own/browser-scripts && git mv repos/own/userscripts repos/own/browser-scripts/userscripts
# Update .gitmodules paths (git mv updates automatically but verify)
git submodule sync --recursive

2. Retroactive submodule audit

Rule: all-chirag127-repos-are-submodules.md — every non-archived, non-empty chirag127-owned repo MUST be a submodule in the umbrella. Runs at repo creation. Retroactive audit catches drift.

Audit script (draft, scripts/audit-submodules.mjs):

// Fetch all chirag127 repos via gh api user/repos --paginate
// Compare against .gitmodules parsed list
// For each missing repo: prompt user to add or skip (archived/empty/experiment)
// Output: sync report listing what's in / not in / archived

Execution: run script, add missing submodules, categorize each into the right shipping-surface folder from Item 1.

Expected finds: ~20-50 chirag127 repos not currently submoduled. Include everything but archive-tagged repos.

3. Repo template

Locked: create chirag127/repo-template (public). Enforce via gh repo create --template chirag127/repo-template.

Template contents:

repo-template/
├── README.md                # Skeleton with sections: What / Install / Usage / Contributing / License
├── LICENSE                  # MIT with (c) chirag127
├── .gitignore               # Node + Python + macOS + Windows + IDE
├── CONTRIBUTING.md          # Points to family CONTRIBUTING rules
├── .github/
│   ├── workflows/
│   │   ├── ci.yml           # Reusable-workflow call: chirag127/workflows/ci-generic.yml
│   │   └── stale.yml        # Close stale issues after 90 days
│   ├── dependabot.yml       # Weekly npm/pnpm + monthly actions
│   └── ISSUE_TEMPLATE/
│       ├── bug.yml
│       └── feature.yml
├── .editorconfig            # 2 spaces, LF, UTF-8
└── package.json             # Only if the repo is a JS/TS package — skip for data/docs

Enforcement: add rule new-repo-must-use-template.md — CI check on umbrella that fails if a new repo doesn't have expected files.

4. Greasyfork prefill client

Locked path: semi-auto prefill URL POST (user clicks Submit).

Cookie ingestion: read ~/.greasyfork-cookies.txt (user-created, gitignored). Format:

_greasyfork_session=<value>
remember_user_token=<value>

Client (draft, scripts/greasyfork-prefill.mjs):

// Read cookies from ~/.greasyfork-cookies.txt
// For each userscript in repos/own/browser-scripts/userscripts/*/[slug].user.js:
//   1. Read file bytes
//   2. multipart/form-data POST to https://greasyfork.org/en/script_versions/prefill
//      with Cookie header + `script_version[code]` field
//   3. Follow redirect to the pre-filled form
//   4. Print the redirect URL — user opens in browser and clicks Submit

Rate-limiting: 1 request per 3 seconds. If Greasyfork rejects (401/403), instruct user to sign in again.

Where used: After making local edits to a userscript, run node scripts/greasyfork-prefill.mjs <slug> to open the pre-filled update form. User reviews + submits.

Execution order (next session)

  1. Folder reshape (biggest one-time change, no external side-effects)
  2. Retroactive submodule audit (adds a lot of pointer entries; do BEFORE template so template applies to survivors)
  3. Repo template (needs the reshape done first so we know where new repos land)
  4. Greasyfork prefill (independent, ship anytime)

Anti-patterns

Cross-refs