s9n-devops-agent 2.0.18-dev.0 → 2.0.18-dev.2
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 +93 -143
- package/package.json +1 -1
- package/src/setup-cs-devops-agent.js +49 -19
package/README.md
CHANGED
|
@@ -1,201 +1,151 @@
|
|
|
1
1
|
# DevOps Agent - AI-Powered Git Workflow Automation
|
|
2
2
|
|
|
3
|
-
>
|
|
3
|
+
> **Now with Kora 🤖 - Your Smart DevOps Assistant**
|
|
4
|
+
|
|
5
|
+
DevOps Agent acts as a bridge between human developers and AI coding assistants. It manages git operations, prevents multi-agent conflicts, ensures architectural compliance, and now talks to you to streamline your workflow.
|
|
4
6
|
|
|
5
7
|
[](https://www.npmjs.com/package/s9n-devops-agent)
|
|
6
8
|
[](https://opensource.org/licenses/MIT)
|
|
7
9
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
🤖 **Works with Any AI Assistant** - Claude, Cursor, GitHub Copilot, Cline
|
|
11
|
-
🔄 **Automatic Git Operations** - Watches changes, commits with proper messages, pushes automatically
|
|
12
|
-
🛡️ **Multi-Agent Coordination** - Prevents multiple AIs from editing the same files simultaneously
|
|
13
|
-
🌲 **Smart Branch Management** - Hierarchical structure: session → daily → weekly → main
|
|
14
|
-
📋 **House Rules System** - Teaches AI agents your project conventions and testing requirements
|
|
15
|
-
|
|
16
|
-
## Quick Start (2 Minutes)
|
|
17
|
-
|
|
18
|
-
```bash
|
|
19
|
-
# Install
|
|
20
|
-
npm install -g s9n-devops-agent
|
|
21
|
-
|
|
22
|
-
# Learn (recommended for first-time users)
|
|
23
|
-
s9n-devops-agent tutorial
|
|
24
|
-
|
|
25
|
-
# Setup
|
|
26
|
-
s9n-devops-agent setup
|
|
27
|
-
|
|
28
|
-
# Start working
|
|
29
|
-
s9n-devops-agent start
|
|
30
|
-
```
|
|
10
|
+
---
|
|
31
11
|
|
|
32
|
-
##
|
|
12
|
+
## 🚀 New in v2.0: Smart Features
|
|
33
13
|
|
|
34
|
-
|
|
14
|
+
### 🤖 Meet Kora
|
|
15
|
+
Kora is a conversational AI assistant built into the DevOps Agent. She knows your project's **House Rules**, understands your **Architecture Contracts**, and can manage your development sessions.
|
|
35
16
|
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
4. **Session closes** → Merges to daily branch, then to main
|
|
17
|
+
- **Ask Questions:** "What are the rules for API endpoints?"
|
|
18
|
+
- **Start Work:** "Start a new session to fix the login bug."
|
|
19
|
+
- **Check Status:** "Are there any open sessions?"
|
|
40
20
|
|
|
41
|
-
###
|
|
21
|
+
### 📜 Contract Automation
|
|
22
|
+
Ensure your code matches your architecture. The agent now includes tools to:
|
|
23
|
+
- **Validate Compliance:** Checks if your code implements the defined contracts (API, DB, Features).
|
|
24
|
+
- **Auto-Generate Contracts:** Reverse-engineer documentation from existing code.
|
|
25
|
+
- **Test:** Run `npm run test:contracts` to verify compliance in CI/CD.
|
|
42
26
|
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
- **Own branch** auto-named based on task
|
|
46
|
-
- **File locks** prevent conflicts with other agents
|
|
47
|
-
- **Auto-monitoring** commits and pushes automatically
|
|
27
|
+
### 🧠 AI-Powered Commits
|
|
28
|
+
The agent analyzes your staged changes and generates semantic, conventional commit messages that adhere to your specific House Rules.
|
|
48
29
|
|
|
49
|
-
|
|
30
|
+
---
|
|
50
31
|
|
|
51
|
-
|
|
52
|
-
**What:** Watches your workspace and commits changes automatically
|
|
53
|
-
**Why:** AI can't run git commands, so we do it for them
|
|
54
|
-
**How:** AI writes commit message to special file, agent reads and commits
|
|
32
|
+
## 📦 Installation
|
|
55
33
|
|
|
56
|
-
###
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
34
|
+
### Stable Version
|
|
35
|
+
```bash
|
|
36
|
+
npm install -g s9n-devops-agent
|
|
37
|
+
```
|
|
60
38
|
|
|
61
|
-
###
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
39
|
+
### Development Version (Latest Features)
|
|
40
|
+
To access Kora and the latest smart features:
|
|
41
|
+
```bash
|
|
42
|
+
npm install -g s9n-devops-agent@dev
|
|
43
|
+
```
|
|
65
44
|
|
|
66
|
-
|
|
67
|
-
**What:** Instructions for AI assistants in `docs/houserules.md`
|
|
68
|
-
**Why:** Consistent behavior across agents, follows your conventions
|
|
69
|
-
**How:** Markdown file that AI reads first, auto-updated by agent
|
|
45
|
+
---
|
|
70
46
|
|
|
71
|
-
##
|
|
47
|
+
## ⚡ Quick Start
|
|
72
48
|
|
|
49
|
+
### 1. Setup
|
|
50
|
+
Run the setup wizard to configure your environment and API keys.
|
|
73
51
|
```bash
|
|
74
|
-
|
|
75
|
-
s9n-devops-agent tutorial # Interactive learning (start here!)
|
|
76
|
-
s9n-devops-agent setup # First-time configuration
|
|
77
|
-
s9n-devops-agent help-topics # Browse comprehensive help
|
|
78
|
-
|
|
79
|
-
# Session Management
|
|
80
|
-
s9n-devops-agent start # Create/resume session
|
|
81
|
-
s9n-devops-agent list # Show all sessions
|
|
82
|
-
s9n-devops-agent close # Close active session
|
|
83
|
-
|
|
84
|
-
# Advanced
|
|
85
|
-
s9n-devops-agent create --task api --agent claude # Create specific session
|
|
86
|
-
s9n-devops-agent cleanup # Clean up stale sessions
|
|
52
|
+
s9n-devops-agent setup
|
|
87
53
|
```
|
|
54
|
+
> **Note:** You will be prompted for a `GROQ_API_KEY` to enable Kora and AI features.
|
|
88
55
|
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
### Single AI Agent
|
|
56
|
+
### 2. Talk to Kora
|
|
57
|
+
Start the conversational interface to manage your work.
|
|
92
58
|
```bash
|
|
93
|
-
s9n-devops-agent
|
|
94
|
-
# Copy instructions to Claude/Cursor
|
|
95
|
-
# AI works, agent commits automatically
|
|
96
|
-
s9n-devops-agent close # Merge and cleanup
|
|
59
|
+
s9n-devops-agent chat
|
|
97
60
|
```
|
|
98
61
|
|
|
99
|
-
###
|
|
62
|
+
### 3. Start a Session (Classic Mode)
|
|
63
|
+
If you prefer the CLI menu:
|
|
100
64
|
```bash
|
|
101
|
-
|
|
102
|
-
|
|
65
|
+
s9n-devops-agent start
|
|
66
|
+
```
|
|
103
67
|
|
|
104
|
-
|
|
105
|
-
s9n-devops-agent create --task ui --agent cursor
|
|
68
|
+
---
|
|
106
69
|
|
|
107
|
-
|
|
108
|
-
```
|
|
70
|
+
## 🛠️ Core Features
|
|
109
71
|
|
|
110
|
-
|
|
72
|
+
### 🔄 Auto-Commit System
|
|
73
|
+
- **Watches** your workspace in real-time.
|
|
74
|
+
- **Commits** changes automatically when your AI assistant saves files.
|
|
75
|
+
- **Pushes** to the remote repository.
|
|
111
76
|
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
✅ **Framework Agnostic** - Works with any codebase, any language
|
|
116
|
-
✅ **Git Platform Agnostic** - GitHub, GitLab, Bitbucket, self-hosted
|
|
77
|
+
### 🛡️ Multi-Agent Coordination
|
|
78
|
+
- **File Locking:** Prevents multiple agents (or humans) from editing the same files simultaneously.
|
|
79
|
+
- **Worktrees:** Each session gets an isolated git worktree, keeping your main branch clean.
|
|
117
80
|
|
|
118
|
-
|
|
81
|
+
### 🌲 Smart Branch Management
|
|
82
|
+
- **Hierarchy:** `session/task` → `daily/date` → `main`.
|
|
83
|
+
- **Auto-Merge:** Sessions automatically merge into daily branches, which roll over to main.
|
|
119
84
|
|
|
120
|
-
|
|
121
|
-
-
|
|
122
|
-
-
|
|
85
|
+
### 📋 House Rules System
|
|
86
|
+
- **Context Injection:** AI agents read `docs/houserules.md` to understand your coding conventions.
|
|
87
|
+
- **Enforcement:** The agent checks commits against these rules.
|
|
123
88
|
|
|
124
|
-
|
|
89
|
+
---
|
|
125
90
|
|
|
126
|
-
📖
|
|
127
|
-
- [Interactive Tutorial](docs/V2_IMPLEMENTATION_GUIDE.md) - Learn by doing
|
|
128
|
-
- [Installation Guide](docs/INSTALLATION_GUIDE.md) - Detailed setup
|
|
91
|
+
## 📖 Usage Guide
|
|
129
92
|
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
- [Multi-Agent Setup](docs/multi-agent-guide.md) - Working with multiple AIs
|
|
134
|
-
- [House Rules](docs/houserules-guide.md) - Teaching AI your conventions
|
|
93
|
+
### Using Kora (Chat)
|
|
94
|
+
```bash
|
|
95
|
+
$ s9n-devops-agent chat
|
|
135
96
|
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
- [Session Management](docs/SESSION_MANAGEMENT.md) - Advanced workflows
|
|
97
|
+
🤖 Kora - Smart DevOps Assistant
|
|
98
|
+
Powered by Groq (llama-3.3-70b-versatile)
|
|
99
|
+
============================================================
|
|
140
100
|
|
|
141
|
-
|
|
101
|
+
Kora > Hi! I'm Kora. How can I help you today?
|
|
142
102
|
|
|
143
|
-
|
|
144
|
-
```bash
|
|
145
|
-
s9n-devops-agent list --all # Check closed sessions
|
|
146
|
-
```
|
|
103
|
+
You > Start a session for user auth
|
|
147
104
|
|
|
148
|
-
|
|
149
|
-
```bash
|
|
150
|
-
# Check commit message file exists and has content
|
|
151
|
-
ls -la .devops-commit-*.msg
|
|
152
|
-
# Enable debug mode
|
|
153
|
-
AC_DEBUG=true s9n-devops-agent start
|
|
105
|
+
Kora > Starting new session for: user-auth...
|
|
154
106
|
```
|
|
155
107
|
|
|
156
|
-
|
|
108
|
+
### Managing Sessions
|
|
157
109
|
```bash
|
|
158
|
-
|
|
159
|
-
s9n-devops-agent
|
|
160
|
-
```
|
|
110
|
+
# List all active sessions
|
|
111
|
+
s9n-devops-agent list
|
|
161
112
|
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
113
|
+
# Close the current session (merge and cleanup)
|
|
114
|
+
s9n-devops-agent close
|
|
115
|
+
```
|
|
165
116
|
|
|
117
|
+
### Contract Testing
|
|
118
|
+
Run these tests to ensure your code complies with `House_Rules_Contracts/`:
|
|
166
119
|
```bash
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
# Auto-push (default: true)
|
|
171
|
-
export AC_PUSH=true
|
|
120
|
+
npm run test:contracts
|
|
121
|
+
```
|
|
172
122
|
|
|
173
|
-
|
|
174
|
-
export AC_DEBUG=true
|
|
123
|
+
---
|
|
175
124
|
|
|
176
|
-
|
|
177
|
-
export AC_TZ="America/New_York"
|
|
178
|
-
```
|
|
125
|
+
## ⚙️ Configuration
|
|
179
126
|
|
|
180
|
-
|
|
127
|
+
The setup wizard (`s9n-devops-agent setup`) creates a `.env` file in your project root.
|
|
181
128
|
|
|
182
|
-
|
|
129
|
+
| Variable | Description |
|
|
130
|
+
|----------|-------------|
|
|
131
|
+
| `GROQ_API_KEY` | **Required** for Kora and AI commits. Get one at [console.groq.com](https://console.groq.com). |
|
|
132
|
+
| `AC_BRANCH_PREFIX` | Prefix for branch names (e.g., `dev_abc_`). |
|
|
133
|
+
| `AC_PUSH` | `true` to auto-push commits, `false` for local only. |
|
|
134
|
+
| `AC_DEBUG` | `true` for verbose logging. |
|
|
183
135
|
|
|
184
|
-
|
|
136
|
+
---
|
|
185
137
|
|
|
186
|
-
##
|
|
138
|
+
## 📚 Documentation
|
|
139
|
+
- [Installation Guide](docs/INSTALLATION_GUIDE.md)
|
|
140
|
+
- [Testing Guide](TESTING_GUIDE.md)
|
|
141
|
+
- [House Rules Guide](docs/houserules-guide.md)
|
|
142
|
+
- [Contract Automation](scripts/contract-automation/README.md)
|
|
187
143
|
|
|
188
|
-
|
|
144
|
+
---
|
|
189
145
|
|
|
190
146
|
## Support
|
|
191
|
-
|
|
192
147
|
- 🐛 [Report Issues](https://github.com/SecondBrainAICo/CS_DevOpsAgent/issues)
|
|
193
|
-
- 💬 [Discussions](https://github.com/SecondBrainAICo/CS_DevOpsAgent/discussions)
|
|
194
148
|
- 📦 [npm Package](https://www.npmjs.com/package/s9n-devops-agent)
|
|
195
|
-
- 📖 [Documentation](https://github.com/SecondBrainAICo/CS_DevOpsAgent/wiki)
|
|
196
149
|
|
|
197
150
|
---
|
|
198
|
-
|
|
199
151
|
**Built with ❤️ by [SecondBrain Labs](https://secondbrain.ai)**
|
|
200
|
-
|
|
201
|
-
*Making AI-powered development safe, efficient, and conflict-free.*
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "s9n-devops-agent",
|
|
3
|
-
"version": "2.0.18-dev.
|
|
3
|
+
"version": "2.0.18-dev.2",
|
|
4
4
|
"description": "CS_DevOpsAgent - Intelligent Git Automation System with multi-agent support and session management",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "src/cs-devops-agent-worker.js",
|
|
@@ -150,19 +150,51 @@ This structure is compatible with the DevOps Agent's automation tools.
|
|
|
150
150
|
}
|
|
151
151
|
|
|
152
152
|
function checkContractsExist(projectRoot) {
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
'
|
|
160
|
-
'
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
153
|
+
// Search recursively for contract folders
|
|
154
|
+
try {
|
|
155
|
+
// Find all directories named 'House_Rules_Contracts' or 'contracts'
|
|
156
|
+
// Ignoring node_modules and .git
|
|
157
|
+
const findCommand = `find "${projectRoot}" -type d \\( -name "House_Rules_Contracts" -o -name "contracts" \\) -not -path "*/node_modules/*" -not -path "*/.git/*" -not -path "*/local_deploy/*"`;
|
|
158
|
+
|
|
159
|
+
const output = execSync(findCommand, { encoding: 'utf8' }).trim();
|
|
160
|
+
const locations = output.split('\n').filter(Boolean);
|
|
161
|
+
|
|
162
|
+
let contractsDir = null;
|
|
163
|
+
if (locations.length > 0) {
|
|
164
|
+
// Prefer House_Rules_Contracts if available
|
|
165
|
+
contractsDir = locations.find(l => l.endsWith('House_Rules_Contracts')) || locations[0];
|
|
166
|
+
log.info(`Found contracts directory at: ${contractsDir}`);
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
if (!contractsDir) return false;
|
|
170
|
+
|
|
171
|
+
const requiredContracts = [
|
|
172
|
+
'FEATURES_CONTRACT.md',
|
|
173
|
+
'API_CONTRACT.md',
|
|
174
|
+
'DATABASE_SCHEMA_CONTRACT.md',
|
|
175
|
+
'SQL_CONTRACT.json',
|
|
176
|
+
'THIRD_PARTY_INTEGRATIONS.md',
|
|
177
|
+
'INFRA_CONTRACT.md'
|
|
178
|
+
];
|
|
179
|
+
|
|
180
|
+
// Check if we have multiple similar contracts that might need merging
|
|
181
|
+
const files = fs.readdirSync(contractsDir);
|
|
182
|
+
const potentialDuplicates = files.filter(f =>
|
|
183
|
+
(f.includes('FEATURE') && f !== 'FEATURES_CONTRACT.md') ||
|
|
184
|
+
(f.includes('API') && f !== 'API_CONTRACT.md')
|
|
185
|
+
);
|
|
186
|
+
|
|
187
|
+
if (potentialDuplicates.length > 0) {
|
|
188
|
+
log.info(`Found potential split contract files in ${contractsDir}:`);
|
|
189
|
+
potentialDuplicates.forEach(f => console.log(` - ${f}`));
|
|
190
|
+
console.log('You may want to merge these into single contract files per type.');
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
return requiredContracts.every(file => fs.existsSync(path.join(contractsDir, file)));
|
|
194
|
+
} catch (error) {
|
|
195
|
+
log.warn(`Error searching for contracts: ${error.message}`);
|
|
196
|
+
return false;
|
|
197
|
+
}
|
|
166
198
|
}
|
|
167
199
|
|
|
168
200
|
async function generateContracts(projectRoot) {
|
|
@@ -951,12 +983,10 @@ ${colors.dim}This takes about 2 minutes.${colors.reset}
|
|
|
951
983
|
log.info(`Project root: ${projectRoot}`);
|
|
952
984
|
|
|
953
985
|
// Ensure ScriptCS_DevOpsAgent directory exists
|
|
954
|
-
const scriptsDir = path.join(projectRoot, 'ScriptCS_DevOpsAgent');
|
|
955
|
-
if (!fs.existsSync(scriptsDir)) {
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
process.exit(1);
|
|
959
|
-
}
|
|
986
|
+
// const scriptsDir = path.join(projectRoot, 'ScriptCS_DevOpsAgent');
|
|
987
|
+
// if (!fs.existsSync(scriptsDir)) {
|
|
988
|
+
// log.warn('ScriptCS_DevOpsAgent folder not found. Assuming global install or custom setup.');
|
|
989
|
+
// }
|
|
960
990
|
|
|
961
991
|
// Get developer initials
|
|
962
992
|
console.log();
|