xtrm-tools 2.0.1 → 2.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +0 -2
- package/cli/dist/index.cjs +19 -19
- package/cli/dist/index.cjs.map +1 -1
- package/cli/package.json +1 -1
- package/hooks/README.md +107 -4
- package/hooks/beads-close-memory-prompt.mjs +49 -0
- package/hooks/beads-commit-gate.mjs +64 -0
- package/hooks/beads-edit-gate.mjs +72 -0
- package/hooks/beads-gate-utils.mjs +121 -0
- package/hooks/beads-stop-gate.mjs +61 -0
- package/hooks/main-guard.mjs +139 -0
- package/package.json +4 -3
- package/project-skills/py-quality-gate/.claude/settings.json +1 -1
- package/project-skills/service-skills-set/.claude/skills/creating-service-skills/SKILL.md +12 -12
- package/project-skills/service-skills-set/.claude/skills/creating-service-skills/references/script_quality_standards.md +13 -0
- package/project-skills/service-skills-set/.claude/skills/creating-service-skills/references/service_skill_system_guide.md +14 -0
- package/project-skills/service-skills-set/.claude/skills/creating-service-skills/scripts/__pycache__/bootstrap.cpython-314.pyc +0 -0
- package/project-skills/service-skills-set/.claude/skills/scoping-service-skills/SKILL.md +6 -6
- package/project-skills/service-skills-set/.claude/skills/updating-service-skills/SKILL.md +1 -1
- package/project-skills/service-skills-set/.claude/skills/using-service-skills/SKILL.md +2 -2
- package/project-skills/service-skills-set/.claude/skills/using-service-skills/scripts/__pycache__/skill_activator.cpython-314.pyc +0 -0
- package/project-skills/service-skills-set/.claude/skills/using-service-skills/scripts/__pycache__/test_skill_activator.cpython-314-pytest-9.0.2.pyc +0 -0
- package/project-skills/service-skills-set/.claude/skills/using-service-skills/scripts/skill_activator.py +2 -2
- package/project-skills/service-skills-set/.claude/skills/using-service-skills/scripts/test_skill_activator.py +58 -0
- package/project-skills/ts-quality-gate/.claude/settings.json +1 -1
- package/project-skills/main-guard/.claude/hooks/main-guard.cjs +0 -188
- package/project-skills/main-guard/.claude/settings.json +0 -16
- package/project-skills/main-guard/.claude/skills/using-main-guard/SKILL.md +0 -135
- package/project-skills/main-guard/README.md +0 -163
|
@@ -1,163 +0,0 @@
|
|
|
1
|
-
# Main Guard
|
|
2
|
-
|
|
3
|
-
**Git branch protection** for Claude Code. Blocks direct edits to main/master branches and enforces feature branch workflow.
|
|
4
|
-
|
|
5
|
-
## What It Does
|
|
6
|
-
|
|
7
|
-
Main Guard prevents accidental commits to protected branches:
|
|
8
|
-
|
|
9
|
-
| Feature | Description |
|
|
10
|
-
|---------|-------------|
|
|
11
|
-
| **Branch blocking** | Prevents Write/Edit on protected branches |
|
|
12
|
-
| **Branch suggestions** | Suggests feature branch names |
|
|
13
|
-
| **Custom patterns** | Configure which branches are protected |
|
|
14
|
-
| **Git flow enforcement** | Encourages PR-based workflow |
|
|
15
|
-
|
|
16
|
-
## Installation
|
|
17
|
-
|
|
18
|
-
```bash
|
|
19
|
-
# Install project skill
|
|
20
|
-
xtrm install project main-guard
|
|
21
|
-
```
|
|
22
|
-
|
|
23
|
-
## How It Works
|
|
24
|
-
|
|
25
|
-
The guard runs as a `PreToolUse` hook:
|
|
26
|
-
|
|
27
|
-
1. You attempt to write/edit a file
|
|
28
|
-
2. Before the edit, the hook checks current branch
|
|
29
|
-
3. If on protected branch: **blocks with instructions**
|
|
30
|
-
4. If on feature branch: **allows the edit**
|
|
31
|
-
|
|
32
|
-
## Protected Branches
|
|
33
|
-
|
|
34
|
-
**Default:**
|
|
35
|
-
- `main`
|
|
36
|
-
- `master`
|
|
37
|
-
- `develop`
|
|
38
|
-
|
|
39
|
-
**Customize:**
|
|
40
|
-
```bash
|
|
41
|
-
export MAIN_GUARD_PROTECTED_BRANCHES="main,master,develop,production"
|
|
42
|
-
```
|
|
43
|
-
|
|
44
|
-
**Supports wildcards:**
|
|
45
|
-
```bash
|
|
46
|
-
export MAIN_GUARD_PROTECTED_BRANCHES="main,master,release/*,hotfix/*"
|
|
47
|
-
```
|
|
48
|
-
|
|
49
|
-
## Usage
|
|
50
|
-
|
|
51
|
-
### Blocked Message
|
|
52
|
-
|
|
53
|
-
When you try to edit on a protected branch:
|
|
54
|
-
|
|
55
|
-
```
|
|
56
|
-
🛑 BLOCKED: Direct edits to protected branches
|
|
57
|
-
|
|
58
|
-
Current branch: main
|
|
59
|
-
|
|
60
|
-
📋 To proceed:
|
|
61
|
-
1. Create a feature branch: git checkout -b feat/task
|
|
62
|
-
2. Make your changes on that branch
|
|
63
|
-
3. Push and create a pull request
|
|
64
|
-
```
|
|
65
|
-
|
|
66
|
-
### Allowed
|
|
67
|
-
|
|
68
|
-
When on a feature branch:
|
|
69
|
-
```
|
|
70
|
-
✅ Git workflow check passed
|
|
71
|
-
Branch: feat/my-feature
|
|
72
|
-
```
|
|
73
|
-
|
|
74
|
-
## Configuration
|
|
75
|
-
|
|
76
|
-
### Environment Variables
|
|
77
|
-
|
|
78
|
-
| Variable | Default | Description |
|
|
79
|
-
|----------|---------|-------------|
|
|
80
|
-
| `MAIN_GUARD_PROTECTED_BRANCHES` | `main,master,develop` | Comma-separated list of protected branches |
|
|
81
|
-
|
|
82
|
-
### Setup
|
|
83
|
-
|
|
84
|
-
Add to your shell profile (`~/.bashrc`, `~/.zshrc`):
|
|
85
|
-
```bash
|
|
86
|
-
export MAIN_GUARD_PROTECTED_BRANCHES="main,master"
|
|
87
|
-
```
|
|
88
|
-
|
|
89
|
-
Or create `.env` in your project:
|
|
90
|
-
```bash
|
|
91
|
-
MAIN_GUARD_PROTECTED_BRANCHES=main,master,develop
|
|
92
|
-
```
|
|
93
|
-
|
|
94
|
-
## Exit Codes
|
|
95
|
-
|
|
96
|
-
| Code | Meaning |
|
|
97
|
-
|------|---------|
|
|
98
|
-
| 0 | Allowed (not on protected branch) |
|
|
99
|
-
| 1 | Fatal error |
|
|
100
|
-
| 2 | Blocked (on protected branch) |
|
|
101
|
-
|
|
102
|
-
## Git Flow
|
|
103
|
-
|
|
104
|
-
### Standard Feature Development
|
|
105
|
-
|
|
106
|
-
```bash
|
|
107
|
-
# Start from main
|
|
108
|
-
git checkout main
|
|
109
|
-
git pull origin main
|
|
110
|
-
|
|
111
|
-
# Create feature branch
|
|
112
|
-
git checkout -b feat/user-authentication
|
|
113
|
-
|
|
114
|
-
# Make changes (main-guard allows this)
|
|
115
|
-
# Edit files, commit, push
|
|
116
|
-
git add .
|
|
117
|
-
git commit -m "feat: add user authentication"
|
|
118
|
-
git push -u origin feat/user-authentication
|
|
119
|
-
|
|
120
|
-
# Create PR on GitHub
|
|
121
|
-
```
|
|
122
|
-
|
|
123
|
-
### Hotfix
|
|
124
|
-
|
|
125
|
-
```bash
|
|
126
|
-
# Emergency fix from main
|
|
127
|
-
git checkout main
|
|
128
|
-
git checkout -b hotfix/login-bug
|
|
129
|
-
|
|
130
|
-
# Fix, commit, push, PR
|
|
131
|
-
```
|
|
132
|
-
|
|
133
|
-
### Release Branch
|
|
134
|
-
|
|
135
|
-
```bash
|
|
136
|
-
# Prepare release
|
|
137
|
-
git checkout -b release/v1.2.0
|
|
138
|
-
|
|
139
|
-
# Final testing, version bump
|
|
140
|
-
# Merge to main and develop
|
|
141
|
-
```
|
|
142
|
-
|
|
143
|
-
## Benefits
|
|
144
|
-
|
|
145
|
-
- ✅ Prevents accidental direct commits to main
|
|
146
|
-
- ✅ Enforces code review via PRs
|
|
147
|
-
- ✅ Maintains clean main branch history
|
|
148
|
-
- ✅ Encourages proper Git workflow
|
|
149
|
-
|
|
150
|
-
## Troubleshooting
|
|
151
|
-
|
|
152
|
-
**"Not in a git repository"**
|
|
153
|
-
- Hook skips when not in git project
|
|
154
|
-
- No protection outside git repos
|
|
155
|
-
|
|
156
|
-
**Node.js not found**
|
|
157
|
-
- Install Node.js: `node --version`
|
|
158
|
-
- Hook requires Node.js to run
|
|
159
|
-
|
|
160
|
-
## See Also
|
|
161
|
-
|
|
162
|
-
- Git Flow: https://nvie.com/posts/a-successful-git-branching-model/
|
|
163
|
-
- GitHub Flow: https://docs.github.com/en/get-started/using-github/github-flow
|