{"_id":"@aprimediet/git-workflow","_rev":"5-a5178dfcddbd673e6a751fffee7587f1","name":"@aprimediet/git-workflow","dist-tags":{"latest":"1.0.1"},"versions":{"1.0.0":{"name":"@aprimediet/git-workflow","version":"1.0.0","keywords":["pi-package","git","workflow","branching-strategy"],"license":"MIT","_id":"@aprimediet/git-workflow@1.0.0","maintainers":[{"name":"aditya.prima","email":"aprimediet@gmail.com"}],"homepage":"https://github.com/aprimediet/pi-git-workflow#readme","bugs":{"url":"https://github.com/aprimediet/pi-git-workflow/issues"},"pi":{"skills":["./skills"],"extensions":["./index.ts"]},"dist":{"shasum":"ed80bf32831b30701c2a9a79bd8a83a0441ecf66","tarball":"https://registry.npmjs.org/@aprimediet/git-workflow/-/git-workflow-1.0.0.tgz","fileCount":21,"integrity":"sha512-CrSTE/Kt8zd301hplnJqjalhfa0VgQncId/EEJ3IynhxgzpAFAzKRZuy7/by/LLmVWmZYj6250eWKLDy8Y5QzA==","signatures":[{"sig":"MEQCIFhfPJteyvYQpSS1CyuL+2bQiy1W/rG18DZqkFbBzUcsAiBrs8PVhkykZMz8y6Bwk3I3rYzFQo0U4FsvePA0OGRBxw==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":78327},"type":"module","gitHead":"f6aa2722f7867776c708355f2c87b9f67802e087","scripts":{"pack:dry":"npm pack --dry-run","prepublishOnly":"node -e \"const pkg=require('./package.json'); if(!pkg.files||pkg.files.length===0){console.error('files field empty \\u2014 abort');process.exit(1)}; console.log('Publishing '+pkg.name+'@'+pkg.version+' with files:', pkg.files)\""},"_npmUser":{"name":"aditya.prima","email":"aprimediet@gmail.com"},"repository":{"url":"git+https://github.com/aprimediet/pi-git-workflow.git","type":"git"},"_npmVersion":"11.17.0","description":"Branching strategy enforcer + safe git commands (/git:init, /git:commit, /git:worktree, /git:push, +11 extras) for the pi coding agent.","directories":{},"_nodeVersion":"24.18.0","publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"peerDependencies":{"typebox":"*","@earendil-works/pi-ai":"*","@earendil-works/pi-tui":"*","@earendil-works/pi-coding-agent":"*"},"_npmOperationalInternal":{"tmp":"tmp/git-workflow_1.0.0_1782412489253_0.4111463776053168","host":"s3://npm-registry-packages-npm-production"}},"1.0.1":{"name":"@aprimediet/git-workflow","version":"1.0.1","type":"module","description":"Branching strategy enforcer + safe git commands (/git:init, /git:commit, /git:worktree, /git:push, +11 extras) for the pi coding agent.","keywords":["pi-package","git","workflow","branching-strategy"],"license":"MIT","repository":{"type":"git","url":"git+https://github.com/aprimediet/pi-git-workflow.git"},"bugs":{"url":"https://github.com/aprimediet/pi-git-workflow/issues"},"homepage":"https://github.com/aprimediet/pi-git-workflow#readme","publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"scripts":{"prepublishOnly":"node -e \"const pkg=require('./package.json'); if(!pkg.files||pkg.files.length===0){console.error('files field empty \\u2014 abort');process.exit(1)}; console.log('Publishing '+pkg.name+'@'+pkg.version+' with files:', pkg.files)\"","pack:dry":"npm pack --dry-run"},"pi":{"extensions":["./index.ts"],"skills":["./skills"]},"peerDependencies":{"@earendil-works/pi-coding-agent":"*","@earendil-works/pi-ai":"*","@earendil-works/pi-tui":"*","typebox":"*"},"gitHead":"5e6d90f925f648784df6ea2a89af0eac1c6c4707","_id":"@aprimediet/git-workflow@1.0.1","_nodeVersion":"24.18.0","_npmVersion":"11.17.0","dist":{"integrity":"sha512-fuq5yZzGjsr+osNfE+PiXe8TzAQXwsijgwm3YPeoWJHxW/MVWtGOJavz+nucJGGJpz7AJg3F7SVcT0xFFMklIQ==","shasum":"bec33f21233b03f06c6259af76327cc7ffb33ab0","tarball":"https://registry.npmjs.org/@aprimediet/git-workflow/-/git-workflow-1.0.1.tgz","fileCount":21,"unpackedSize":78329,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIAba/RAE9VPw4ltpElH2imL1N+KS+3AgHCY6nK+rbFwqAiBxVfmH8Fdv7ny1+08NUqQm4sn+UvpxbAeXtu2m8uk4tQ=="}]},"_npmUser":{"name":"aditya.prima","email":"aprimediet@gmail.com"},"directories":{},"maintainers":[{"name":"aditya.prima","email":"aprimediet@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/git-workflow_1.0.1_1782412999371_0.9856866836625466"},"_hasShrinkwrap":false}},"time":{"created":"2026-06-25T18:34:49.116Z","modified":"2026-06-25T18:43:19.649Z","0.1.0":"2026-06-25T18:03:06.803Z","0.2.0":"2026-06-25T18:16:16.450Z","1.0.0":"2026-06-25T18:34:49.408Z","1.0.1":"2026-06-25T18:43:19.505Z"},"bugs":{"url":"https://github.com/aprimediet/pi-git-workflow/issues"},"license":"MIT","homepage":"https://github.com/aprimediet/pi-git-workflow#readme","keywords":["pi-package","git","workflow","branching-strategy"],"repository":{"type":"git","url":"git+https://github.com/aprimediet/pi-git-workflow.git"},"description":"Branching strategy enforcer + safe git commands (/git:init, /git:commit, /git:worktree, /git:push, +11 extras) for the pi coding agent.","maintainers":[{"name":"aditya.prima","email":"aprimediet@gmail.com"}],"readme":"# `@aprimediet/git-workflow`\n\n> Branching strategy enforcer + safe git commands for the **pi coding agent**.\n\nThis extension enforces a branching strategy (gitflow / github-flow / gitlab-flow / trunk-based)\nat project init time, persists the choice to `~/.pi/projects/<project-id>/git-workflow.json`, and\nprovides 15 slash commands that wrap every common git workflow with explicit user confirmation.\n\nThe agent is **never allowed** to run `git commit`, `git push`, `git tag -m`, `gh pr create/merge`,\nor `glab mr create/merge` without asking first. Suggest `/git:commit`, `/git:push`, etc. instead.\n\n## Install\n\n```bash\npi install @aprimediet/git-workflow\n```\n\n## Setup\n\nOn first `pi` startup inside a git repo, you'll be prompted to pick a branching strategy. The\nchoice persists to `~/.pi/projects/<project-id>/git-workflow.json` (NOT in the repo) so it\nsurvives `git clean` and cross-machine clones.\n\nTo re-pick later:\n\n```\n/git:init\n```\n\n## Commands\n\n### Core\n\n| Command | What it does |\n|---|---|\n| `/git:init` | Pick a branching strategy, create base branches, write config. |\n| `/git:commit` | Detect changes, suggest a conventional-commit message, commit on approval. |\n| `/git:worktree` | Suggest a worktree pattern based on current branch + strategy, create it. |\n| `/git:push` | Push current branch to origin (with `-u` first time). |\n\n### Extras\n\n| Command | What it does |\n|---|---|\n| `/git:pr` | Open a pull request / merge request via `gh` or `glab`. |\n| `/git:merge <src>` | Merge `<src>` into current branch with strategy-aware flags. |\n| `/git:rebase <base>` | Rebase current branch onto `<base>` (refuses if dirty). |\n| `/git:log [filters]` | Pretty git log with `--since`, `--author`, `--` path filters. |\n| `/git:stash [name]` | Stash changes with a strategy-aware name. |\n| `/git:diff [args]` | Show diff with optional ref/path filters. |\n| `/git:tag vX.Y.Z [-m msg]` | Create annotated SemVer tag; ask to push. |\n| `/git:reset <mode> <target>` | Soft/mixed/hard reset with mandatory backup branch. |\n| `/git:branch list\\|create\\|delete` | Branch management with strategy validation. |\n| `/git:status` | Compact 4-line status summary. |\n| `/git:changelog [ref]` | Generate grouped Markdown changelog since `<ref>`. |\n\n## Branching strategies\n\n| Strategy | Branches |\n|---|---|\n| `gitflow` | `master`, `dev`, `features/*`, `release/*`, `hotfix/*`, `bugfix/*` |\n| `github-flow` | `master`, `features/*`, `bugfix/*` |\n| `gitlab-flow` | `master`, `staging`, `production`, `features/*`, `hotfix/*` |\n| `trunk-based` | `main`, `features/*`, `release/*` |\n\nEach strategy ships as an `agentskills.io`-compliant skill that the agent loads when it sees\nmatching work.\n\n## Safety gates\n\nThe extension wires five lifecycle hooks:\n\n1. **G1 — `session_start`**: if the project has git but no config, prompts to initialize.\n2. **G2 — `before_agent_start`**: injects a \"Git Workflow Safety Policy\" + active-strategy\n   reminder into the system prompt so the agent knows to suggest slash commands instead of\n   running git directly.\n3. **G3 — `tool_call`**: blocks `git commit`, `git push`, `git tag -m`, `gh pr create/merge`,\n   `glab mr create/merge` unless explicitly confirmed by the user. Slash-command handlers bypass\n   via a sentinel flag.\n4. **G4 — `agent_end`**: after each turn, if the working tree is dirty, asks \"Commit now?\" and\n   suggests `/git:commit` (never auto-executes).\n5. **G5 — `tool_call`**: detects `git checkout -b` / `git switch -c` for branches outside the\n   configured strategy and asks the user to either cancel, create anyway, or update the strategy.\n\n## Memory integration\n\nThis extension does not depend on `@aprimediet/memory`. If you have it installed and want\ngit-related events persisted to memory (strategy decisions, commits, pushes, tag, PR), configure\nyour memory extension to capture these events via its own means — e.g. a session-end hook that\nparses the current branch + last commit and writes a memory entry.\n\n## File layout\n\n```\n~/.pi/projects/<project-id>/\n└── git-workflow.json          # persisted config (strategy, branches, preferences)\n```\n\n## Publishing\n\nThis package is published under the `@aprimediet` npm scope. To publish a new version:\n\n```bash\ncd extensions/git-workflow\n# bump version in package.json\nnpm run pack:dry\nnpm publish --access public --userconfig /tmp/npmrc\n```\n\nSee [../../prompts/git-workflow.md](../../prompts/git-workflow.md) for the full build prompt and\nspecification.\n\n## License\n\nMIT © aprimediet","readmeFilename":"README.md"}