# Commands Reference Shell patterns for each phase. Load only when you need the exact syntax — the SKILL.md tells you WHAT to look for; this tells you HOW. --- ## Phase 1: Shape ```bash # Clone (always full — never --depth 1) cd $CLONE_DIR && git clone # Dimensions du -sh find . -name "*.go" | grep -v vendor | wc -l # Go files git log --oneline | wc -l # commits git log --format="%an" | sort -u | wc -l # contributors ls -d */ # top-level dirs ``` ## Phase 2: Import Hierarchy ```bash # Go: most-imported internal packages grep -rh '"/' --include="*.go" \ | sed 's/.*"\///' | sed 's/".*//' \ | cut -d/ -f1 | sort | uniq -c | sort -rn | head -15 # Elixir: most-aliased modules grep -rh "alias " --include="*.ex" \ | sed 's/.*alias //' | cut -d. -f1-2 \ | sort | uniq -c | sort -rn | head -15 ``` ## Phase 3: Interfaces ```bash # Go interfaces (skip test/mock/generated) grep -rn "type.*interface {" --include="*.go" \ | grep -v test | grep -v mock | grep -v _gen.go # Elixir behaviours/protocols grep -rn "@callback\|@behaviour\|defprotocol" --include="*.ex" ``` ## Phase 4: Quality Markers ```bash # TODOs (non-test, note format) grep -rn "TODO" --include="*.go" | grep -v test | wc -l grep -rh "// TODO" --include="*.go" | head -5 # check format # Other markers grep -rn "FIXME\|HACK" --include="*.go" | grep -v test | wc -l # Test ratio find . -name "*_test.go" | wc -l # test files find . -name "*mock*" | wc -l # mock files ``` ## Phase 6: Git Archaeology ```bash # When was a file/pattern introduced? git log --all --oneline --diff-filter=A -- path/to/file # Who wrote it and why? git log --format="%an%n%ad%n%s%n%b" -1 # When was a string added/removed (pickaxe search)? git log -p -S "pattern_string" -- relevant/path/ # TODOs added with context git log --all -p -S "TODO" -- lib/ \ | grep "^commit\|^+.*TODO\|^-.*TODO" | head -20 # Find if full clone or shallow git rev-parse --is-shallow-repository # Unshallow if needed git fetch --unshallow ``` ## Phase 7: PR Lookup ```bash # Find PR by title/content gh api "search/issues?q=repo:/++type:pr" \ --jq '.items[] | {number: .number, title: .title}' # Read PR metadata gh api repos///pulls/ \ --jq '{title, body: (.body | split("\n") | .[0:30] | join("\n")), comments, review_comments, created_at, merged_at}' # Read review comments (the debate) gh api "repos///pulls//comments?per_page=30" \ --jq '.[] | select(.body | length > 50) | {user: .user.login, body: (.body | split("\n") | .[0:5] | join("\n"))}' # Read issue comments gh api repos///issues//comments \ --jq '.[] | {user: .user.login, body: (.body | split("\n") | .[0:6] | join("\n"))}' ``` ## Output: Repo Creation & Push Adapt to your git remote (Gitea, GitHub, GitLab, etc.): ```bash # Gitea example: GITEA_TOKEN=$(cat $GIT_TOKEN_PATH) curl -s -X POST "https:///api/v1/user/repos" \ -H "Authorization: token $GITEA_TOKEN" \ -H "Content-Type: application/json" \ -d '{"name": "-conventions", "auto_init": true, "default_branch": "master", "license": "MIT"}' # GitHub example: gh repo create $GIT_ORG/-conventions --public --clone # Clone, add content, push cd -conventions git config user.name "" git config user.email "" # ... add files ... git add -A && git commit -m "docs: initial conventions from /" && git push ```