Skip to content

openRepoShape command + the worked example (Northwind starts Atlas) + setup.sh clones where you stand - #37

Merged
brettheap merged 2 commits into
mainfrom
docs/worked-example
Sep 5, 2026
Merged

brettheap merged 2 commits into
mainfrom
docs/worked-example

Conversation

@brettheap

@brettheap brettheap commented Sep 5, 2026 •

Copy link
Copy Markdown
Contributor

Lane: codex-intake-shape
Claim: #36 (comment)
Claims (same object set): #38 (comment) · #39 (comment)

What

Closes #36, #38, #39 — one branch, two commits.

The command (#38). openRepoShape at the repository root: openRepoShape Atlas --org Northwind fetches setup.sh (gh api first — authenticated, works where raw downloads are blocked — raw URL as fallback), runs it AS A FILE so it can still prompt, turns the positional <Project> into --project, passes everything else through, never defaults the organisation, and forwards --shape-ref when OPENREPOSHAPE_REF pins one. openRepoShape --install puts it in ~/.local/bin idempotently (installed / updated / unchanged) and prints the PATH line if needed; run from a pipe it fetches itself. It adds no behaviour of its own.

The example (#36). ### A worked example: Northwind starts Atlas, restructured as ruled: #### Prerequisites in two parts — 1. Requirements, 2. Login (whose gh account gh repo create runs under; why git needs its own credentials for the HTTPS pushes; --elected-by authenticates nothing) — then #### Install the command (download-and-install, with the link to the file, or the long line), then #### Run, then what Dana sees, the tree, private legs, daily work with bump-leg, and the variants.

The defect (#39). Self-bootstrap setup.sh derived the clone's parent from .. of its TEMPORARY checkout, so the README one-liner cloned new projects into /tmp/<Project>. The re-exec now passes --into "$INVOCATION_DIR" before the caller's arguments (theirs is parsed later and wins), so the project lands where the person stood; the developer path's .. is unchanged; the fix holds under --shape-ref to an older standard. The example says where the clone lands.

Evidence

  • python3 -m pytest tests -q: 435 passed (18 new for the command, offline via --local-remote-dir; 2 new for the clone location, offline from a scratch cwd; shipped-bash checks parametrised over setup.sh and openRepoShape).
  • bash -n clean on both scripts (shellcheck not installed here).
  • Every README fact checked against the current scripts and templates. Caps: README 573 → 700, AGENTS.md 266 → 269, each by the lines added, with dated notes.

Ruled by Brett Heap, 2026-09-05: "add this example to the openRepoShape README"; "the before starting is to set so we can use gh under Dana's creds?"; "make this more clear… prerequisite… requirements and then the login… a downloadable script that can be installed as a cmd… if the api is more stable, use that… name it openRepoShape so the usage is openRepoShape Atlas".

🤖 Generated with Claude Code

Summary by Sourcery

Provide an installable openRepoShape front door, document its end-to-end use, and correct self-bootstrap clone placement.

New Features:

  • Add the installable openRepoShape command for running project setup with a positional project name, organisation handling, self-installation, and pinned standard references.

Bug Fixes:

  • Ensure self-bootstrap places newly created project clones in the directory where the command was invoked while preserving explicit --into overrides.

Enhancements:

  • Document a complete Northwind/Atlas worked example covering prerequisites, authentication, installation, execution, generated structure, private repositories, daily work, and variants.

Documentation:

  • Expand the README and contributor guidance with the command's usage and the worked project-scaffolding workflow.

Tests:

  • Add offline coverage for command installation, argument forwarding, organisation validation, reference handling, fetch fallback order, and self-bootstrap clone placement.
  • Extend script hygiene and syntax checks to cover both shipped Bash entry points.

The README stated the one-liner and the mechanics and never walked a newcomer
through what they would see and what they would have afterwards. The example
does: whose gh account the act runs under and why git needs credentials of its
own (the repositories are created with `gh repo create`, the first commits
pushed with plain `git push` over HTTPS); the four things setup.sh does before
it asks; the one question and that the human answers it; the tree a scaffold
writes today, agent files included; the private-leg CI credential in one
sentence with a pointer to the section that owns it; the daily loop (work in
the legs, advance the project with `bump-leg`); and the variants (adopt,
family, update-shape). Neutral throughout: an organisation's workflow overlay
attaches afterwards and is its own.

README 573 -> 659. Closes #36.

Lane: codex-intake-shape
Co-Authored-By: Claude Fable 5.1 <[email protected]>
Copilot AI lite review requested due to automatic review settings September 5, 2026 13:28
@brettheap

Copy link
Copy Markdown
Contributor Author

@codex review

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry @brettheap, you've used your own review budget of 250,000 diff characters for the last 7 days.

You can request another review in 1 day and 1 hour by commenting @sourcery-ai review. Upgrade to get a review now.

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, you can upgrade your account or add credits to your account and enable them for code reviews in your settings.

@sourcery-ai

sourcery-ai Bot commented Sep 5, 2026

Copy link
Copy Markdown

Reviewer's Guide

This PR adds a detailed, implementation-grounded README walkthrough for starting and operating a Northwind/Atlas project, clarifying authentication and human-confirmation boundaries, generated layout, CI credentials, pin advancement, and lifecycle variants; it also updates the README length guard with a dated rationale for the expanded documentation.

Sequence diagram for Northwind Atlas project setup

sequenceDiagram
    actor Dana
    participant Setup as setup.sh
    participant GH as gh CLI
    participant Git as git
    participant GitHub as GitHub

    Dana->>GH: gh auth login
    Dana->>GH: gh auth setup-git
    Dana->>Setup: setup.sh --org Northwind --project Atlas --visibility private --elected-by Dana Okafor
    Setup->>GH: gh auth status
    Setup->>Setup: preflight and naming checks
    Setup-->>Dana: scaffold plan and confirmation question
    Dana->>Setup: Type yes
    Setup->>GH: gh repo create
    GH->>GitHub: Create Atlas repositories
    Setup->>Git: git push
    Git->>GitHub: Push initial commits
    Setup->>Setup: make bootstrap
Loading

Flow diagram for the Atlas daily pin-advancement loop

flowchart LR
    A[Work in spec or code repository] --> B[Commit and open pull request]
    B --> C[python3 scripts/bump-leg.py --root ../Atlas --leg code --to commit]
    C --> D[git push -u origin branch]
    D --> E[Open root pull request]
    E --> F[make validate and CI]
Loading

File-Level Changes

Change Details Files
Adds an end-to-end Northwind/Atlas onboarding walkthrough covering authentication, prompts, generated repositories, private-leg CI, daily pin updates, and supported variants.
  • Explains the distinction between the gh account used to create repositories and Git credentials used for HTTPS pushes.
  • Documents preflight checks, naming validation, dry-run planning, human confirmation, repository creation, pinning, cloning, and bootstrap.
  • Shows the scaffolded repository tree, including agent instructions, contracts, validators, workflow, and pinned legs.
  • Summarizes private-leg CI credential options and the warning behavior when credentials are absent.
  • Demonstrates advancing a leg with bump-leg.py and distinguishes ordinary leg work from root pin updates.
  • Introduces adopt, family, and shape-update workflows while keeping organisation-specific workflow overlays separate from the neutral shape.
README.md
Raises the README line-count hygiene cap to account for the new worked example and records the dated rationale.
  • Updates the maximum README length from 573 to 659 lines.
  • Documents why the example adds 86 lines without duplicating existing guidance.
tests/test_repo_hygiene.py

Assessment against linked issues

Issue Objective Addressed Explanation
#36 Add a complete end-to-end worked example showing a new user creating a project in a fictional organisation, including the exact command, prerequisites, preflight behaviour, naming checks, plan, confirmation question, and who must answer it. ✅
#36 Document the resulting scaffold, including agent files, private-leg CI credential requirements, and the normal daily workflow for working in legs and advancing the project with bump-leg. ✅
#36 Document the adopt, family, and update-shape variants while keeping organisation-specific workflow overlays explicitly separate and neutral. ✅

Possibly linked issues


Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

The documentation updates are consistent with the referenced scripts/workflows, and the corresponding hygiene-test cap adjustment is appropriately justified.

Pull request overview

Adds an end-to-end “worked example” walkthrough to the root README to help first-time users run setup.sh in a brand-new GitHub organisation, and updates the repo hygiene test to accommodate the additional documentation.

Changes:

  • Add a “A worked example: Northwind starts Atlas” subsection covering prerequisites (auth + git creds), the exact one-liner, what the user sees, the resulting tree, private-leg CI credential pointers, the daily bump-leg loop, and variants (adopt/family/update-shape).
  • Increase the README line-count cap in tests/test_repo_hygiene.py, with a dated justification comment tied to issue #36.
File summaries
File Description
README.md Adds a comprehensive newcomer-facing worked example for first project setup and ongoing maintenance.
tests/test_repo_hygiene.py Raises the README line cap (with rationale) so the new documentation is allowed by hygiene tests.
Review details
  • Files reviewed: 2/2 changed files
  • Comments generated: 0
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

…hape Atlas`; setup.sh self-bootstrap clones where you stand

The way in was a long `curl … | bash -s -- --org … --project …` line. `openRepoShape`
(bash, at the repository root) is the short form: `openRepoShape <Project>
[--org <org>] [setup.sh options] [-- <scaffold flags>]`. It ADDS NO BEHAVIOUR —
it fetches setup.sh from opensoft/openRepoShape (`gh api` FIRST, authenticated
and so usable where raw downloads are blocked; the raw URL as fallback;
$OPENREPOSHAPE_REPO/$OPENREPOSHAPE_REF overridable, --shape-ref forwarded so
the script that runs and the standard it clones are one commit) and runs it AS
A FILE, not from a pipe, so setup.sh can still ask for the project name and
the one `yes`. The organisation comes from --org, $OPENREPOSHAPE_ORG or a
prompt and is NEVER defaulted. `openRepoShape --install` copies itself (or,
run from stdin, fetches itself) into ~/.local/bin, idempotent by content —
installed / updated / unchanged — and prints the PATH line when needed.

Found on the way (#39): in self-bootstrap mode setup.sh derived the clone's
parent from `..` of its TEMPORARY checkout, so the README one-liner cloned
every new project into /tmp/<Project> and deleted the checkout beside it. The
re-exec now passes `--into "$INVOCATION_DIR"` before the caller's own
arguments — theirs is parsed later and wins — so the project appears where
the person stood, the developer path's `..` is untouched, and the fix holds
even when --shape-ref pins an older standard.

README: the worked example is restructured as Brett asked — Prerequisites in
two parts (Requirements, then Login: whose gh account the act runs under and
why git needs credentials of its own), Install the command (download-and-install
or the long line), Run — and says where the clone lands. AGENTS.md §2 names
the command. Tests: 18 for the command (offline through setup.sh's
--local-remote-dir), 2 for the clone location; the shipped-bash checks now
cover both scripts. README 659 -> 700, AGENTS.md 266 -> 269. 435 passed.

Closes #38. Closes #39.

Lane: codex-intake-shape
Co-Authored-By: Claude Fable 5.1 <[email protected]>
Copilot AI review requested due to automatic review settings September 5, 2026 14:13
@brettheap brettheap changed the title README: a worked example — Northwind starts Atlas openRepoShape command + the worked example (Northwind starts Atlas) + setup.sh clones where you stand Sep 5, 2026
@sonarqubecloud

sonarqubecloud Bot commented Sep 5, 2026

Copy link
Copy Markdown

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The new openRepoShape script has verified argument-handling bugs that can break forwarding (word-splitting) and incorrectly allows extra args in --install mode.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Review details
  • Files reviewed: 7/7 changed files
  • Comments generated: 2
  • Review effort level: Lite

Comment thread openRepoShape
# Fetched at $REF, so setup.sh self-bootstraps its checkout at $REF too:
# otherwise the script that runs and the standard it clones are two commits.
[ -z "${OPENREPOSHAPE_REF:-}" ] || ARGS+=(--shape-ref "$REF")
ARGS+=(${PASSTHROUGH[@]+"${PASSTHROUGH[@]}"})
Comment thread openRepoShape
Comment on lines +152 to +156
if [ "$MODE" = "install" ]; then
[ -z "$PROJECT" ] && [ ${#PASSTHROUGH[@]} -eq 0 ] ||
die "--install takes no other arguments; it only installs this command."
install_self
exit 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

README: a worked example — a new user, a new organisation, one project, end to end

2 participants