Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions .github/instructions/index.instructions.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,15 @@ tests/
test_check_agents.py # Verify .github/prompts/ mirrors are in sync, called by tests.check_agents
modules/
common/ # cli.py, properties.py, route_utils.py, utils.py — shared helpers
repo/ # pull.py, push.py, log.py, squash.py, rebase.py, pr_*.py — git/PR workflow modules
repo/ # pull.py, push.py, squash.py, rebase.py, pr_*.py — git/PR workflow modules
setup/ # properties.py — creates/stamps properties.yml, called by setup.sh/setup.ps1
template/ # ignore.py, naming.py, pull.py, push.py, resolve.py, route.py, scope.py — sync shared tooling with the parent template repo for /template
versioning/ # libs.py, python.py, workflows.py, upgrade.py, project.py — check pyproject.toml deps & workflow action refs vs. latest releases, bump the repo's VERSION file
tasks/
__init__.py # Wires the invoke Collection (debug, repo, ruff, setup, template, tests, upgrade, uv, versioning) plus top-level aliases (fix, test, update)
combos.py # Top-level aliases: fix, test, update
debug.py # debug.env — print cwd + sorted env vars
repo.py # repo.pull, repo.push, repo.log, repo.squash, repo.rebase, repo.pr_diff, repo.pr_notes_save, repo.pr_create, repo.pr_cleanup
repo.py # repo.pull, repo.push, repo.squash, repo.rebase, repo.pr_diff, repo.pr_notes_save, repo.pr_create, repo.pr_cleanup
ruff.py # ruff.fix, ruff.format
setup.py # setup.properties — creates/stamps properties.yml
template.py # template.pull, template.pull_copy, template.push_diff, template.push_apply, template.push_create_pr
Expand Down Expand Up @@ -99,7 +99,6 @@ uv run --no-sync invoke test # ruff + pylint + pytest + yamllint + actionlin
uv run --no-sync invoke fix # Ruff autocorrect + format
uv run --no-sync invoke repo.pull # Pull from git remote (stash → pull --rebase → restore)
uv run --no-sync invoke repo.push # Push to git remote (fix → test → commit → push)
uv run --no-sync invoke repo.log # Save a session log to logs/
uv run --no-sync invoke repo.squash # Anchored squash all commits to root + optional force push
uv run --no-sync invoke repo.rebase # Rebase onto remote default branch (optionally squash first)
uv run --no-sync invoke repo.pr_diff # Print current branch's commit log/diff vs. its base branch
Expand Down
2 changes: 1 addition & 1 deletion .github/instructions/modules.instructions.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ def main() -> None:
| `cli.py` | Click-like `echo`, `prompt`, `confirm`, `is_tty`, `command`/`option` decorators |
| `properties.py` | Read `properties.yml` — `get_repo_local()`, `get_repo_remote()`, `get_template_local()`, `get_template_remote()` |
| `route_utils.py` | AI-tool command routers (`modules/*/route.py`) — `find_repo_root()` (`properties.yml`-anchored, falls back to `cwd()`, no exception), `build_env()` |
| `utils.py` | `success()`, `error()`, `warning()`, `info()`, `create_slug()` |
| `utils.py` | `success()`, `error()`, `warning()`, `info()` |

## Guidelines
- Keep functions focused and single-purpose; extract private helpers instead of writing long functions
Expand Down
3 changes: 0 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,6 @@ uv.lock.bak
.pylint.d/
.mypy_cache/

# Logs generated by repo:log task
logs/*.md

# Linux
**/.directory
**/.Trash-*
Expand Down
9 changes: 4 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

Skeleton setup for a repository that uses Python invoke tasks, reusable modules, uv for
environment/dependency management, and AI Copilot prompts and instructions. Drop this into any
project to get a consistent git workflow, linting, and session logging out of the box.
project to get a consistent git workflow and linting out of the box.

## Setup
```bash
Expand All @@ -25,15 +25,15 @@ tests/
test_check_agents.py # Verify .github/prompts/ mirrors are in sync, called by tests.check_agents
modules/
common/ # cli.py, properties.py, route_utils.py, utils.py — shared helpers
repo/ # pull.py, push.py, log.py, squash.py, rebase.py, pr_*.py — git/PR workflow modules
repo/ # pull.py, push.py, squash.py, rebase.py, pr_*.py — git/PR workflow modules
setup/ # properties.py — creates/stamps properties.yml, called by setup.sh/setup.ps1
template/ # ignore.py, naming.py, pull.py, push.py, resolve.py, route.py, scope.py — sync shared tooling with the parent template repo for /template
versioning/ # libs.py, python.py, workflows.py, upgrade.py, project.py — check pyproject.toml deps & workflow action refs vs. latest releases, bump the repo's VERSION file
tasks/
__init__.py # Wires the invoke Collection (debug, repo, ruff, setup, template, tests, upgrade, uv, versioning) plus top-level aliases (fix, test, update)
combos.py # Top-level aliases: fix, test, update
debug.py # debug.env — print cwd + sorted env vars
repo.py # repo.pull, repo.push, repo.log, repo.squash, repo.rebase, repo.pr_diff, repo.pr_notes_save, repo.pr_create, repo.pr_cleanup
repo.py # repo.pull, repo.push, repo.squash, repo.rebase, repo.pr_diff, repo.pr_notes_save, repo.pr_create, repo.pr_cleanup
ruff.py # ruff.fix, ruff.format
setup.py # setup.properties — creates/stamps properties.yml
template.py # template.pull, template.pull_copy, template.push_diff, template.push_apply, template.push_create_pr
Expand Down Expand Up @@ -67,7 +67,6 @@ uv run --no-sync invoke fix # Ruff autocorrect + format
uv run --no-sync invoke update # Run every version check (libs, python, workflows) — top-level alias for ver.update
uv run --no-sync invoke repo.pull # Pull from git remote (stash → pull --rebase → restore)
uv run --no-sync invoke repo.push # Push to git remote (fix → test → commit → push)
uv run --no-sync invoke repo.log # Save a session log to logs/
uv run --no-sync invoke repo.squash # Anchored squash all commits to root + optional force push
uv run --no-sync invoke repo.rebase # Rebase onto remote default branch (optionally squash first)
uv run --no-sync invoke repo.pr_diff # Print current branch's commit log/diff vs. its base branch
Expand Down Expand Up @@ -119,7 +118,7 @@ uv run --no-sync invoke setup.properties # Create/stamp properties.yml
| Module | Purpose |
|--------|---------|
| [`modules/common/`](modules/common/README.md) | CLI helpers, `properties.yml` config reader, output/utility helpers |
| [`modules/repo/`](modules/repo/README.md) | Git workflow and session logging |
| [`modules/repo/`](modules/repo/README.md) | Git workflow (pull, push, squash, rebase, PR) |
| [`modules/setup/`](modules/setup/README.md) | Creates/stamps `properties.yml`, called by `setup.sh`/`setup.ps1` |
| [`modules/template/`](modules/template/README.md) | Sync shared, generic tooling with the parent template repo for `/template` |
| [`modules/versioning/`](modules/versioning/README.md) | Check `pyproject.toml` deps and workflow action refs vs. latest releases, update locks; bump the repo's `VERSION` file for deploys/releases |
Expand Down
2 changes: 1 addition & 1 deletion modules/common/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ This module provides common functionality that is used by other modules througho
## Files

- `utils.py` — console output helpers: `success()`, `error()`, `warning()`, `info()` (✅/❌/⚠️/ℹ️
prefixed), plus `create_slug()`
prefixed)
- `properties.py` — reads `properties.yml`: `get_repo_root()`, `get_repo_local()`,
`get_repo_remote()`, `get_template_local()`, `get_template_remote()`
- `cli.py` — Click-like CLI compatibility helpers backed by `argparse` (`echo`, `secho`, `prompt`,
Expand Down
20 changes: 0 additions & 20 deletions modules/common/utils.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
"""Common utilities for repo automation."""

import re
import sys
from typing import NoReturn

Expand All @@ -24,22 +23,3 @@ def warning(message: str) -> None:
def info(message: str) -> None:
"""Print info message with emoji prefix."""
print(f"📂 {message}")


def create_slug(text: str) -> str:
"""
Convert text to a URL/filename-safe slug.

Lowercases the text, strips characters that are not alphanumeric, hyphens,
or spaces, then collapses whitespace runs into single underscores.

Args:
text: The input string to slugify.

Returns:
A lowercase slug with spaces replaced by underscores.
"""
text = text.lower()
text = re.sub(r"[^\w\s-]", "", text)
text = re.sub(r"\s+", "_", text.strip())
return text
3 changes: 1 addition & 2 deletions modules/repo/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Repo Module

Git workflow and session-logging logic behind the `repo.*` invoke tasks and their `/push`,
Git workflow logic behind the `repo.*` invoke tasks and their `/push`,
`/pull`, `/squash`, `/rebase`, `/pr-notes`, `/pr`, `/pr-cleanup`, and `/repo` slash-command
counterparts. Every file exposes a `main()` entry point, runnable standalone via
`python -m modules.repo.<name>`.
Expand All @@ -13,7 +13,6 @@ counterparts. Every file exposes a `main()` entry point, runnable standalone via
(`repo.push` / `/push`)
- `pr_push.py` — push the current **feature** branch (fix → test → commit → push), for branches
that may not have upstream tracking yet; used by `/ship-it` ahead of opening a PR
- `log.py` — save a session log markdown file to `logs/` (`repo.log`)
- `squash.py` — anchored squash of every commit down to the root commit, with an auto-generated
message and optional force-push (`repo.squash` / `/squash`)
- `rebase.py` — rebase onto the remote default branch, optionally squashing first, with stash and
Expand Down
52 changes: 0 additions & 52 deletions modules/repo/log.py

This file was deleted.

9 changes: 1 addition & 8 deletions tasks/repo.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
"""Git workflow tasks (pull, push, log, squash, rebase, pr)."""
"""Git workflow tasks (pull, push, squash, rebase, pr)."""

from invoke import task

from modules.repo import log as log_module
from modules.repo import pr_cleanup as pr_cleanup_module
from modules.repo import pr_create as pr_create_module
from modules.repo import pr_diff as pr_diff_module
Expand All @@ -25,12 +24,6 @@ def push(_context):
push_module.main(no_confirm=True)


@task
def log(_context, title=None, content=None):
"""Save a session log to logs/"""
log_module.main(title=title, content=content)


@task
def squash(_context):
"""Anchored squash of all commits to root with optional force push"""
Expand Down
Loading