refactor: parameterize environment — no hardcoded paths

Configuration (CLONE_DIR, CLONE_HOST, GIT_REMOTE, GIT_ORG, GIT_TOKEN_PATH)
provided by invoker's workspace context. Commands reference shows
Gitea + GitHub examples.
This commit is contained in:
Rodin
2026-04-30 12:00:09 -07:00
parent 946119a3cc
commit 6df0e383bc
2 changed files with 31 additions and 15 deletions
+20 -7
View File
@@ -17,12 +17,25 @@ description: >-
# Codebase Analysis
Extract architectural conventions from open source repositories.
Output: Gitea repos under `rodin/<project>-conventions`.
Output: convention repos (one per project analyzed).
## Configuration
These are provided by the invoker's environment (TOOLS.md, AGENTS.md,
or invocation context):
- **CLONE_DIR** — where to clone repos (e.g., `~/src/analysis/`)
- **CLONE_HOST** — which machine to clone on (needs disk + git)
- **GIT_REMOTE** — where convention repos are pushed (e.g., Gitea, GitHub)
- **GIT_ORG** — organization/user for convention repos
- **GIT_TOKEN_PATH** — path to auth token for pushing
If not explicitly provided, infer from workspace context.
## Naming
- `*-patterns` = language-level (go-patterns, elixir-patterns)
- `*-conventions` = project-specific (temporal-conventions, etc.)
- `*-patterns` = language-level (how the language wants you to write)
- `*-conventions` = project-specific (how a codebase chose to do it)
## Thinking Framework
@@ -61,7 +74,7 @@ Skip patterns that are:
### Phase 1: Shape (5 min)
Clone on forge (`~/src/analysis/<name>`). Full clone — never shallow.
Clone to `CLONE_DIR/<name>` on `CLONE_HOST`. Full clone — never shallow.
Measure: size, files, commits, contributors, top-level dirs.
@@ -226,7 +239,7 @@ See `references/pattern-breaks.md` for real examples with git history.
## Output Repos
Push to Gitea under `rodin/<project>-conventions`. See
Push to `GIT_REMOTE` under `GIT_ORG/<project>-conventions`. See
`references/commands.md` for repo creation and push commands.
## Fallbacks
@@ -244,7 +257,7 @@ Push to Gitea under `rodin/<project>-conventions`. See
## Execution Notes
- Clone on **forge** (`host="node", node="forge"`)
- `gh api` for GitHub PR lookups (authenticated on all nodes)
- Clone on `CLONE_HOST` — needs disk space for full git history
- `gh api` for GitHub PR lookups (requires authenticated `gh` CLI)
- One repo at a time for focused analysis
- Markdownlint all output before pushing
+11 -8
View File
@@ -9,7 +9,7 @@ syntax — the SKILL.md tells you WHAT to look for; this tells you HOW.
```bash
# Clone (always full — never --depth 1)
cd ~/src/analysis && git clone <url>
cd $CLONE_DIR && git clone <url>
# Dimensions
du -sh <repo>
@@ -103,20 +103,23 @@ gh api repos/<org>/<repo>/issues/<num>/comments \
## Output: Repo Creation & Push
```bash
GITEA_TOKEN=$(cat ~/.openclaw/credentials/gitea-rodin)
Adapt to your git remote (Gitea, GitHub, GitLab, etc.):
# Create repo
curl -s -X POST "https://gitea.weiker.me/api/v1/user/repos" \
```bash
# Gitea example:
GITEA_TOKEN=$(cat $GIT_TOKEN_PATH)
curl -s -X POST "https://<git-host>/api/v1/user/repos" \
-H "Authorization: token $GITEA_TOKEN" \
-H "Content-Type: application/json" \
-d '{"name": "<project>-conventions", "auto_init": true, "default_branch": "master", "license": "MIT"}'
# GitHub example:
gh repo create $GIT_ORG/<project>-conventions --public --clone
# Clone, add content, push
git clone "https://rodin:${GITEA_TOKEN}@gitea.weiker.me/rodin/<project>-conventions.git"
cd <project>-conventions
git config user.name "Rodin"
git config user.email "rodin@forgedthought.ai"
git config user.name "<your-name>"
git config user.email "<your-email>"
# ... add files ...
git add -A && git commit -m "docs: initial conventions from <org>/<project>" && git push
```