s9n-devops-agent 1.2.1 โ 1.3.1
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 +210 -56
- package/docs/INSTALLATION_GUIDE.md +366 -0
- package/docs/houserules.md +51 -0
- package/package.json +5 -1
- package/src/display-utils.cjs +350 -0
- package/src/file-coordinator.cjs +356 -0
- package/src/file-monitor-enhanced.cjs +338 -0
- package/src/house-rules-manager.js +443 -0
- package/src/session-coordinator.js +51 -6
- package/src/setup-cs-devops-agent.js +5 -3
- package/start-devops-session.sh +139 -0
package/README.md
CHANGED
|
@@ -1,10 +1,26 @@
|
|
|
1
|
-
# CS_DevOpsAgent ๐
|
|
1
|
+
# CS_DevOpsAgent ๐ v1.3.1
|
|
2
2
|
|
|
3
3
|
[](https://badge.fury.io/js/s9n-devops-agent)
|
|
4
4
|
[](https://opensource.org/licenses/MIT)
|
|
5
5
|
[](https://github.com/SecondBrainAICo/CS_DevOpsAgent)
|
|
6
6
|
|
|
7
|
-
An intelligent Git automation system with multi-agent support, session management, and seamless integration with AI coding assistants like Claude, GitHub Copilot, and Cursor.
|
|
7
|
+
An intelligent Git automation system with multi-agent support, real-time file coordination, session management, and seamless integration with AI coding assistants like Claude, GitHub Copilot, and Cursor.
|
|
8
|
+
|
|
9
|
+
## ๐ What's New in v1.3.1
|
|
10
|
+
|
|
11
|
+
### Latest Updates (v1.3.1)
|
|
12
|
+
- **๐ Enhanced File Locking**: Improved coordination scripts with proper empty directory handling
|
|
13
|
+
- **๐งช File Locking Demo**: New comprehensive test showing how multi-agent coordination prevents conflicts
|
|
14
|
+
- **๐ Better Organization**: Coordination scripts moved to `scripts/coordination/` for clarity
|
|
15
|
+
- **๐ Bug Fixes**: Fixed glob expansion issues in file coordination scripts
|
|
16
|
+
|
|
17
|
+
### Previous Features (v1.3.0)
|
|
18
|
+
- **๐ Intelligent House Rules System**: Auto-creates and updates project conventions for AI agents
|
|
19
|
+
- **๐ง Real-time Undeclared Edit Detection**: Instantly alerts when files are edited without declaration
|
|
20
|
+
- **๐ด File Conflict Prevention**: Detects and reports when multiple agents try to edit the same files
|
|
21
|
+
- **๐ Smart Version Updates**: House rules sections update independently while preserving user content
|
|
22
|
+
- **๐ Streamlined Setup**: One-command setup with `npm start` - handles everything automatically
|
|
23
|
+
- **๐ง Self-Healing**: Automatically recovers if house rules are deleted
|
|
8
24
|
|
|
9
25
|
## ๐ Quick Links
|
|
10
26
|
|
|
@@ -15,49 +31,51 @@ An intelligent Git automation system with multi-agent support, session managemen
|
|
|
15
31
|
|
|
16
32
|
## Features โจ
|
|
17
33
|
|
|
34
|
+
### Core Features
|
|
18
35
|
- **๐ค Multi-Agent Support**: Work with Claude, GitHub Copilot, Cursor, and other AI coding assistants
|
|
19
36
|
- **๐ Git Worktree Management**: Isolated workspaces for each session to prevent conflicts
|
|
20
37
|
- **๐ Automatic Commits & Push**: Monitors changes and commits with proper messages
|
|
21
38
|
- **๐
Daily Version Rollover**: Automatic version management with customizable increments
|
|
22
39
|
- **๐ฏ Session Management**: Create, manage, and track multiple development sessions
|
|
23
40
|
- **โ๏ธ VS Code Integration**: Seamlessly integrates with VS Code tasks
|
|
24
|
-
- **๐ Safe Concurrent Development**: Multiple agents can work simultaneously without conflicts
|
|
25
41
|
- **๐ท๏ธ Smart Branching**: Automatic branch creation with configurable naming patterns
|
|
42
|
+
|
|
43
|
+
### File Coordination (v1.3.0) ๐
|
|
44
|
+
- **๐ง Undeclared Edit Detection**: Orange alerts when agents edit files without declaring them
|
|
45
|
+
- **๐ด Conflict Detection**: Red alerts when multiple agents try to edit the same files
|
|
46
|
+
- **๐ Declaration Protocol**: Agents must declare files before editing to prevent conflicts
|
|
47
|
+
- **โก Real-time Monitoring**: Detects violations within 2 seconds
|
|
48
|
+
- **๐ Actionable Instructions**: Provides copy-paste commands to correct agent behavior
|
|
49
|
+
- **๐ Advisory Locks**: File-level coordination without blocking legitimate work
|
|
50
|
+
|
|
51
|
+
### Infrastructure
|
|
52
|
+
- **๐ Safe Concurrent Development**: Multiple agents can work simultaneously without conflicts
|
|
26
53
|
- **๐ Docker Auto-Restart**: Automatically restart Docker containers after code push (v1.2.0)
|
|
27
54
|
|
|
28
55
|
## Installation ๐ฆ
|
|
29
56
|
|
|
30
|
-
|
|
57
|
+
> **๐ Detailed Guide**: See [INSTALLATION_GUIDE.md](docs/INSTALLATION_GUIDE.md) for complete setup instructions
|
|
58
|
+
|
|
59
|
+
### Quick Install (NPM Package)
|
|
31
60
|
|
|
32
|
-
#### Global Installation
|
|
33
61
|
```bash
|
|
62
|
+
# Install globally (recommended)
|
|
34
63
|
npm install -g s9n-devops-agent
|
|
35
|
-
```
|
|
36
64
|
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
npm install s9n-devops-agent --save-dev
|
|
65
|
+
# Verify installation
|
|
66
|
+
s9n-devops-agent --help
|
|
40
67
|
```
|
|
41
68
|
|
|
42
|
-
###
|
|
43
|
-
|
|
44
|
-
#### Clone the Repository
|
|
45
|
-
```bash
|
|
46
|
-
# Clone the repository
|
|
47
|
-
git clone https://github.com/SecondBrainAICo/CS_DevOpsAgent.git
|
|
48
|
-
cd CS_DevOpsAgent
|
|
69
|
+
### What Gets Installed
|
|
49
70
|
|
|
50
|
-
|
|
51
|
-
|
|
71
|
+
The NPM package installs:
|
|
72
|
+
- โ
**CLI Binary**: `s9n-devops-agent` command available globally
|
|
73
|
+
- โ
**Core Files**: Worker, session manager, and utilities in npm's global node_modules
|
|
74
|
+
- โ
**Dependencies**: `chokidar` for file watching, `execa` for git operations
|
|
75
|
+
- โ **No Project Modifications**: Your project stays clean until you run setup
|
|
52
76
|
|
|
53
|
-
|
|
54
|
-
npm link
|
|
77
|
+
### From Source (For Contributors)
|
|
55
78
|
|
|
56
|
-
# Now you can use s9n-devops-agent command globally
|
|
57
|
-
s9n-devops-agent --help
|
|
58
|
-
```
|
|
59
|
-
|
|
60
|
-
#### Development Setup
|
|
61
79
|
```bash
|
|
62
80
|
# Clone and setup for development
|
|
63
81
|
git clone https://github.com/SecondBrainAICo/CS_DevOpsAgent.git
|
|
@@ -66,35 +84,42 @@ cd CS_DevOpsAgent
|
|
|
66
84
|
# Install dependencies
|
|
67
85
|
npm install
|
|
68
86
|
|
|
87
|
+
# Link globally for development
|
|
88
|
+
npm link
|
|
89
|
+
|
|
69
90
|
# Run tests
|
|
70
91
|
npm test
|
|
71
|
-
|
|
72
|
-
# Start development session
|
|
73
|
-
npm run dev
|
|
74
92
|
```
|
|
75
93
|
|
|
76
94
|
## Quick Start ๐
|
|
77
95
|
|
|
78
|
-
###
|
|
96
|
+
### One-Command Setup & Start
|
|
79
97
|
|
|
80
98
|
```bash
|
|
81
|
-
#
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
#
|
|
85
|
-
#
|
|
86
|
-
#
|
|
87
|
-
#
|
|
99
|
+
# Just run npm start - it handles everything!
|
|
100
|
+
npm start
|
|
101
|
+
|
|
102
|
+
# On first run, it will:
|
|
103
|
+
# โ
Set up house rules for AI agents
|
|
104
|
+
# โ
Configure file coordination system
|
|
105
|
+
# โ
Set up your developer initials
|
|
106
|
+
# โ
Configure version strategy
|
|
107
|
+
# โ
Start the session manager
|
|
88
108
|
```
|
|
89
109
|
|
|
90
|
-
|
|
110
|
+
That's it! No separate setup commands needed.
|
|
111
|
+
|
|
112
|
+
### Alternative Setup Methods
|
|
91
113
|
|
|
92
114
|
```bash
|
|
93
|
-
#
|
|
94
|
-
|
|
115
|
+
# Navigate to your project
|
|
116
|
+
cd /path/to/your/project
|
|
95
117
|
|
|
96
|
-
#
|
|
97
|
-
s9n-devops-agent
|
|
118
|
+
# Run the interactive setup wizard (for manual setup)
|
|
119
|
+
s9n-devops-agent setup
|
|
120
|
+
|
|
121
|
+
# Or start a session directly
|
|
122
|
+
s9n-devops-agent start
|
|
98
123
|
```
|
|
99
124
|
|
|
100
125
|
### Working with AI Assistants
|
|
@@ -107,13 +132,113 @@ I'm working in a DevOps-managed session with the following setup:
|
|
|
107
132
|
- Working Directory: /path/to/worktree
|
|
108
133
|
- Task: implement-api
|
|
109
134
|
|
|
110
|
-
|
|
111
|
-
|
|
135
|
+
CRITICAL FIRST STEP:
|
|
136
|
+
1. Read and follow the house rules: cat "/path/to/worktree/houserules.md"
|
|
137
|
+
2. Switch to the working directory: cd "/path/to/worktree"
|
|
138
|
+
|
|
139
|
+
FILE COORDINATION PROTOCOL (from house rules):
|
|
140
|
+
Before editing ANY files, you MUST:
|
|
141
|
+
- Declare your intent in .file-coordination/active-edits/<agent>-8a3s-45b1.json
|
|
142
|
+
- Check for conflicts with other agents
|
|
143
|
+
- Only edit files you've declared
|
|
144
|
+
- Release files when done
|
|
112
145
|
|
|
113
146
|
Write commit messages to: .devops-commit-8a3s-45b1.msg
|
|
114
147
|
The DevOps agent will automatically commit and push changes.
|
|
115
148
|
```
|
|
116
149
|
|
|
150
|
+
## House Rules & File Coordination System ๐๐
|
|
151
|
+
|
|
152
|
+
### House Rules System (NEW!)
|
|
153
|
+
|
|
154
|
+
The DevOps Agent automatically manages "house rules" that teach AI agents your project conventions:
|
|
155
|
+
|
|
156
|
+
**Features:**
|
|
157
|
+
- **Auto-Creation**: Created automatically on first run
|
|
158
|
+
- **Smart Updates**: Updates only DevOps sections, preserves your custom rules
|
|
159
|
+
- **Version Tracking**: Each section independently versioned with checksums
|
|
160
|
+
- **Self-Healing**: Automatically recreates if deleted
|
|
161
|
+
- **CI/CD Ready**: Works in automated environments
|
|
162
|
+
|
|
163
|
+
**House Rules Commands:**
|
|
164
|
+
```bash
|
|
165
|
+
# Check status
|
|
166
|
+
npm run house-rules:status
|
|
167
|
+
|
|
168
|
+
# Update or create
|
|
169
|
+
npm run house-rules:update
|
|
170
|
+
|
|
171
|
+
# Health check and repair
|
|
172
|
+
npm run house-rules:repair
|
|
173
|
+
```
|
|
174
|
+
|
|
175
|
+
### File Coordination System
|
|
176
|
+
|
|
177
|
+
Prevents multiple AI agents from editing the same files simultaneously:
|
|
178
|
+
|
|
179
|
+
1. **Declaration Phase**: Agents declare which files they'll modify
|
|
180
|
+
2. **Conflict Check**: System checks if files are already being edited
|
|
181
|
+
3. **Real-time Monitoring**: Detects violations within 2 seconds
|
|
182
|
+
4. **Alert System**:
|
|
183
|
+
- ๐ง **Orange Alert**: Files edited without declaration
|
|
184
|
+
- ๐ด **Red Alert**: Files being edited by another agent
|
|
185
|
+
5. **Copy-Paste Instructions**: Provides exact commands to correct agent behavior
|
|
186
|
+
|
|
187
|
+
**Coordination Commands:**
|
|
188
|
+
```bash
|
|
189
|
+
# Check if files are available
|
|
190
|
+
./scripts/coordination/check-file-availability.sh src/main.js src/utils.js
|
|
191
|
+
|
|
192
|
+
# Declare intent to edit files
|
|
193
|
+
./scripts/coordination/declare-file-edits.sh <agent-name> <session-id> file1.js file2.js
|
|
194
|
+
|
|
195
|
+
# Release files after editing
|
|
196
|
+
./scripts/coordination/release-file-edits.sh <agent-name> <session-id>
|
|
197
|
+
|
|
198
|
+
# Run file locking demo
|
|
199
|
+
./test_scripts/multi-agent/test-file-locking.sh
|
|
200
|
+
```
|
|
201
|
+
|
|
202
|
+
### For AI Agents
|
|
203
|
+
|
|
204
|
+
Agents should follow this protocol:
|
|
205
|
+
|
|
206
|
+
```json
|
|
207
|
+
// Before editing, create: .file-coordination/active-edits/<agent>-<session>.json
|
|
208
|
+
{
|
|
209
|
+
"agent": "claude",
|
|
210
|
+
"session": "8a3s-45b1",
|
|
211
|
+
"files": ["src/main.js", "src/utils.js"],
|
|
212
|
+
"operation": "edit",
|
|
213
|
+
"reason": "Implementing authentication feature",
|
|
214
|
+
"declaredAt": "2025-09-30T12:00:00Z",
|
|
215
|
+
"estimatedDuration": 300
|
|
216
|
+
}
|
|
217
|
+
```
|
|
218
|
+
|
|
219
|
+
### Alert Examples
|
|
220
|
+
|
|
221
|
+
#### Undeclared Edit Alert (๐ง Orange)
|
|
222
|
+
```
|
|
223
|
+
๐ง๐ง๐ง๐ง๐ง๐ง๐ง๐ง๐ง๐ง๐ง๐ง๐ง๐ง๐ง
|
|
224
|
+
๐ง UNDECLARED FILE EDIT DETECTED!
|
|
225
|
+
๐ง๐ง๐ง๐ง๐ง๐ง๐ง๐ง๐ง๐ง๐ง๐ง๐ง๐ง๐ง
|
|
226
|
+
|
|
227
|
+
โ File "src/main.js" was modified WITHOUT declaration!
|
|
228
|
+
๐ COPY THIS INSTRUCTION TO YOUR CODING AGENT:
|
|
229
|
+
[Instructions on how to declare the file]
|
|
230
|
+
```
|
|
231
|
+
|
|
232
|
+
#### Conflict Alert (๐ด Red)
|
|
233
|
+
```
|
|
234
|
+
๐ด๐ด๐ด๐ด๐ด๐ด๐ด๐ด๐ด๐ด๐ด๐ด๐ด๐ด๐ด
|
|
235
|
+
๐ด FILE CONFLICT DETECTED!
|
|
236
|
+
๐ด๐ด๐ด๐ด๐ด๐ด๐ด๐ด๐ด๐ด๐ด๐ด๐ด๐ด๐ด
|
|
237
|
+
|
|
238
|
+
โ File "src/main.js" is being edited by: claude-session-abc123
|
|
239
|
+
[Instructions on how to resolve]
|
|
240
|
+
```
|
|
241
|
+
|
|
117
242
|
## Commands ๐
|
|
118
243
|
|
|
119
244
|
### Session Management
|
|
@@ -151,6 +276,8 @@ s9n-devops-agent setup
|
|
|
151
276
|
|
|
152
277
|
## Configuration ๐ง
|
|
153
278
|
|
|
279
|
+
> **๐ Complete Configuration Guide**: See [INSTALLATION_GUIDE.md](docs/INSTALLATION_GUIDE.md#configuration-files)
|
|
280
|
+
|
|
154
281
|
### Environment Variables
|
|
155
282
|
|
|
156
283
|
```bash
|
|
@@ -174,9 +301,23 @@ export AC_VERSION_INCREMENT="1" # 1 = 0.01, 10 = 0.1
|
|
|
174
301
|
|
|
175
302
|
### Configuration Files
|
|
176
303
|
|
|
177
|
-
Configuration
|
|
178
|
-
-
|
|
179
|
-
-
|
|
304
|
+
**Global Configuration** (`~/.devops-agent/settings.json`):
|
|
305
|
+
- Developer initials and email
|
|
306
|
+
- Default timezone settings
|
|
307
|
+
- Created on first setup
|
|
308
|
+
|
|
309
|
+
**Project Configuration** (`local_deploy/project-settings.json`):
|
|
310
|
+
- Version numbering strategy
|
|
311
|
+
- Auto-merge settings
|
|
312
|
+
- Docker restart configuration
|
|
313
|
+
- Created per project
|
|
314
|
+
|
|
315
|
+
**House Rules** (`docs/houserules.md`):
|
|
316
|
+
- Instructions for AI assistants
|
|
317
|
+
- Testing requirements
|
|
318
|
+
- Commit message format
|
|
319
|
+
- Multi-agent coordination rules
|
|
320
|
+
- **Must be created manually** ([see template](docs/INSTALLATION_GUIDE.md#house-rules-setup))
|
|
180
321
|
|
|
181
322
|
## Workflow Example ๐ก
|
|
182
323
|
|
|
@@ -289,29 +430,42 @@ At midnight (configurable timezone):
|
|
|
289
430
|
|
|
290
431
|
## Troubleshooting ๐
|
|
291
432
|
|
|
433
|
+
> **๐ Detailed Troubleshooting**: See [INSTALLATION_GUIDE.md](docs/INSTALLATION_GUIDE.md#troubleshooting)
|
|
434
|
+
|
|
292
435
|
### Common Issues
|
|
293
436
|
|
|
294
|
-
**
|
|
437
|
+
**After npm install - command not found**:
|
|
295
438
|
```bash
|
|
296
|
-
#
|
|
297
|
-
|
|
298
|
-
|
|
439
|
+
# Check npm global bin directory
|
|
440
|
+
npm bin -g
|
|
441
|
+
# Add to PATH if needed
|
|
442
|
+
export PATH="$PATH:$(npm bin -g)"
|
|
299
443
|
```
|
|
300
444
|
|
|
301
|
-
**
|
|
445
|
+
**Setup wizard issues**:
|
|
302
446
|
```bash
|
|
303
|
-
# Ensure
|
|
304
|
-
|
|
447
|
+
# Ensure you're in a git repository
|
|
448
|
+
git init
|
|
449
|
+
# Run setup in project directory
|
|
450
|
+
cd /your/project && s9n-devops-agent setup
|
|
305
451
|
```
|
|
306
452
|
|
|
307
453
|
**Agent not detecting changes**:
|
|
308
454
|
```bash
|
|
309
|
-
#
|
|
310
|
-
|
|
311
|
-
#
|
|
455
|
+
# Enable debug mode
|
|
456
|
+
AC_DEBUG=true s9n-devops-agent start
|
|
457
|
+
# Check message file exists and has content
|
|
312
458
|
ls -la .devops-commit-*.msg
|
|
313
459
|
```
|
|
314
460
|
|
|
461
|
+
**Multi-agent conflicts**:
|
|
462
|
+
```bash
|
|
463
|
+
# Check coordination files
|
|
464
|
+
ls -la .ac-prep/ .ac/ack/
|
|
465
|
+
# Clear if stuck
|
|
466
|
+
rm -rf .ac-prep .ac
|
|
467
|
+
```
|
|
468
|
+
|
|
315
469
|
## Contributing ๐ค
|
|
316
470
|
|
|
317
471
|
Contributions are welcome! Please feel free to submit a Pull Request.
|