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
420 changes: 420 additions & 0 deletions .agents/skills/containdb-development/SKILL.md

Large diffs are not rendered by default.

68 changes: 68 additions & 0 deletions .codex/config.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
# OpenAI Codex CLI Configuration for ContainDB

[project]
name = "ContainDB"
description = "Database Container Management CLI Tool"
language = "Go"
runtime = "Go ≥1.18"

[model]
default = "gpt-4-turbo"
temperature = 0.2
max_tokens = 4096

[approval]
mode = "strict"
ask_before_install = true
ask_before_delete = true
ask_before_build = true

[build]
command = "go build -o containdb src/Core/main.go"
required = true
run_after_changes = true

[test]
command = "go test ./..."
required = true

[style]
use_go_fmt = true
use_go_vet = true
error_handling = "descriptive_with_context"

[rules]
cross_platform = true
docker_sdk_only = true
auto_rollback = true
interactive_prompts = true
no_hardcoded_secrets = true

[security]
validate_inputs = true
no_log_passwords = true
warn_root_required = true
use_docker_networks = true

[documentation]
update_readme = true
update_design = true
update_installation = true
update_changelog = true

[antipatterns]
no_platform_specific_without_fallback = true
no_hardcoded_credentials = true
no_docker_commands = true
no_breaking_cli_changes = true
no_incomplete_rollback = true

[completion]
required = [
"go build passes",
"go test ./... passes",
"Works on Linux, macOS, Windows",
"Documentation updated",
"Backward compatible",
"Auto-rollback implemented"
]
140 changes: 140 additions & 0 deletions .cursor/rules/containdb-core.mdc
Original file line number Diff line number Diff line change
@@ -0,0 +1,140 @@
# ContainDB Core Rules for Cursor IDE

## Project Context

**ContainDB** is a CLI tool for managing containerized databases. Written in Go, cross-platform (Linux/macOS/Windows), distributed via npm and native binaries.

## Mandatory Workflows

### After EVERY Code Change
```bash
go build -o containdb src/Core/main.go
go test ./...
go fmt ./...
go vet ./...
```

### For ANY Feature Change
1. Test on Linux, macOS, Windows
2. Update docs (README, DESIGN, INSTALLATION)
3. Verify auto-rollback works
4. Test error scenarios

## Definition of "Done"

- ✅ `go build` passes
- ✅ `go test ./...` passes
- ✅ Works on all platforms
- ✅ Documentation updated
- ✅ Backward compatible
- ✅ Auto-rollback implemented
- ✅ Clear error messages

## Architecture

### Layers
```
CLI (main.go) → Base Operations → Docker SDK → Docker Engine
```

### Structure
```
src/
├── Core/main.go # Entry point
├── base/ # Logic (Create, Remove, Export, Import)
├── Docker/ # SDK wrapper
└── tools/ # Management tools
```

## Go Standards

### Error Handling
```go
// ✅ REQUIRED
if err != nil {
return fmt.Errorf("failed to create container '%s': %w", name, err)
}

// ❌ FORBIDDEN
if err != nil {
return err
}
```

### Type Safety
```go
// ✅ Use structs
type ContainerOptions struct {
Name string
Image string
Port int
}

// ❌ Too many params
func Create(name, image string, port int) error
```

## Key Patterns

### Auto-Rollback (CRITICAL)
```go
created := []string{}
defer func() {
if err != nil {
for _, id := range created {
cleanup(id)
}
}
}()
```

### Docker SDK (NOT Commands)
```go
// ✅ Use SDK
import "github.com/docker/docker/client"

cli, err := client.NewClientWithOpts(client.FromEnv)

// ❌ Don't execute commands
exec.Command("docker", "run", ...)
```

### Interactive Prompts
```go
// ✅ Prompt for passwords
password := promptSecure("Enter password:")

// ❌ No hardcoded defaults
password := "password123"
```

## Security

- Never log passwords
- Validate all inputs (ports, names)
- Warn about root requirements
- Use Docker networks for isolation

## Testing

- Unit tests for core logic
- Integration tests for CLI
- Test on Linux, macOS, Windows
- Test error scenarios

## Anti-Patterns (FORBIDDEN)

❌ Platform-specific code without fallbacks
❌ Hardcoded credentials
❌ Direct docker commands
❌ Breaking CLI interface
❌ Missing error handling
❌ Incomplete rollback

## Success Criteria

- ✅ Builds successfully
- ✅ Tests pass
- ✅ Works cross-platform
- ✅ Docs updated
- ✅ Backward compatible
34 changes: 34 additions & 0 deletions .gemini/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
{
"version": "1.0",
"description": "Gemini CLI settings for ContainDB",

"project": {
"name": "ContainDB",
"type": "CLI Tool",
"language": "Go",
"runtime": "Go ≥1.18"
},

"model": {
"name": "gemini-3-pro",
"temperature": 0.2,
"maxTokens": 8192
},

"context": {
"fileName": ["GEMINI.md"],
"hierarchical": true
},

"tools": {
"enabled": ["codeSearch", "fileOperations", "shellCommands"]
},

"features": {
"codeCompletion": true,
"codeGeneration": true,
"debugging": true,
"refactoring": true,
"testing": true
}
}
120 changes: 120 additions & 0 deletions .github/copilot/instructions.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,120 @@
# GitHub Copilot Instructions for ContainDB

## Project Overview

**ContainDB** - Database Container Management CLI

- **Language**: Go ≥1.18
- **Type**: CLI tool for Docker database management
- **Platform**: Linux, macOS, Windows
- **Distribution**: npm package + native binaries

## Core Rules (NON-NEGOTIABLE)

### 1. Cross-Platform Compatibility
**ALWAYS test on Linux, macOS, Windows**
- Use `filepath` package for paths
- No platform-specific code without fallbacks
- Test on all target platforms

### 2. Docker SDK Only
```go
// ✅ Use official Docker SDK
import "github.com/docker/docker/client"

cli, err := client.NewClientWithOpts(client.FromEnv)

// ❌ NEVER execute docker commands
exec.Command("docker", "run", ...)
```

### 3. Auto-Rollback on Failure
```go
created := []string{}
defer func() {
if err != nil {
for _, id := range created {
cleanup(id)
}
}
}()
```

### 4. Clear Error Messages
```go
// ✅ GOOD - Descriptive with context
if err != nil {
return fmt.Errorf("failed to create container '%s': %w", name, err)
}

// ❌ BAD - Generic
if err != nil {
return err
}
```

### 5. Interactive Prompts
```go
// ✅ ALWAYS prompt for sensitive data
password := promptSecure("Enter database password:")

// ❌ NEVER hardcode
password := "password123"
```

## Architecture

```
CLI Entry Point (main.go)
Base Operations (src/base/)
Docker Abstraction (src/Docker/)
Docker Engine
```

## Commands

```bash
# Build & Test
go build -o containdb src/Core/main.go
go test ./...
go fmt ./...
go vet ./...

# Distribution
./Scripts/BinBuilder.sh # Multi-platform build
./Scripts/PackageBuilder.sh # Debian package
```

## Documentation

Update when features change:
- README.md - Usage, installation
- DESIGN.md - Architecture
- INSTALLATION.md - Platform guides
- CHANGELOG.md - Version changes

## Security

- Never log or display passwords
- Validate all user inputs
- Warn about root requirements
- No hardcoded secrets

## Testing

- Unit tests for logic
- Integration tests for CLI
- Cross-platform testing
- Error scenario testing

## Success Criteria

- ✅ `go build` passes
- ✅ `go test ./...` passes
- ✅ Works on Linux, macOS, Windows
- ✅ Documentation updated
- ✅ Backward compatible
- ✅ Auto-rollback works
Loading
Loading