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
126 changes: 126 additions & 0 deletions .agents/skills/xpack-development/SKILL.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,126 @@
---
name: xpack-development
description: Development rules for xpack Linux package builder
version: 1.0.0
tags: [golang, packaging, deb, rpm, linux]
author: xpack Team
---

# xpack Development Skill

## Project Identity

**xpack** - Universal Linux Package Builder
- Go ≥1.18
- CLI tool for converting binaries to .deb, .rpm, .tar.gz
- Reproducible, standards-compliant packages
Comment on lines +13 to +16

## Mandatory Workflows

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

### For ANY Package Format Change
1. Validate with lintian (deb) or rpmlint (rpm)
2. Test installation on target system
3. Verify reproducible builds
4. Update documentation

## Definition of "Done"

- ✅ `go build` passes
- ✅ `go test ./...` passes
- ✅ Packages validate (lintian/rpmlint)
- ✅ Reproducible builds verified
- ✅ Documentation updated
- ✅ Package standards followed

## Architecture

```
src/
├── Core/main.go # CLI entry
├── base/ # Utilities
└── packager/ # Package builders

Scripts/
├── BinBuilder.sh # Multi-platform
└── installer.sh # One-line install

dist/ # Output packages
```

## Go Standards

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

### Type Safety
```go
// ✅ Use structs
type PackageMetadata struct {
Name string
Version string
Architecture string
Maintainer string
Description string
}
```

## Key Patterns

### Reproducible Builds
```go
// ✅ Sort for determinism
sort.Strings(files)
for _, file := range files {
addToPackage(file)
}
```

### Package Validation
```go
// ✅ Validate metadata
if !regexp.MustCompile(`^[a-z0-9][a-z0-9+.-]+$`).MatchString(name) {
return fmt.Errorf("invalid package name")
}
```

## Package Standards

- **Debian**: Control file, maintainer scripts, /usr/bin layout
- **RPM**: Spec file, scriptlets, /usr/bin layout
- **Tarball**: Unix layout, install script, checksums

## Testing

- Unit: Metadata validation, file operations
- Integration: Full package creation
- Validation: lintian (deb), rpmlint (rpm)
- Installation: Test on Debian, RPM-based systems

## Anti-Patterns (FORBIDDEN)

❌ Non-deterministic builds
❌ Invalid metadata
❌ Missing validation
❌ Breaking standards
❌ Generic errors

## Success Criteria

- ✅ Builds successfully
- ✅ Tests pass
- ✅ Packages validate
- ✅ Reproducible
- ✅ Standards compliant
31 changes: 31 additions & 0 deletions .codex/config.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# OpenAI Codex CLI Configuration for xpack

[project]
name = "xpack"
description = "Universal Linux Package Builder"
language = "Go"

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

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

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

[rules]
reproducible_builds = true
package_standards = true
validate_packages = true

[completion]
required = [
"go build passes",
"go test passes",
"Packages validate",
"Reproducible builds"
]
82 changes: 82 additions & 0 deletions .cursor/rules/xpack-core.mdc
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
# xpack Core Rules for Cursor IDE

## Project Context

**xpack** - Universal Linux Package Builder (Go CLI tool)

## Mandatory Workflows

```bash
go build -o xpack src/Core/main.go
go test ./...
go fmt ./...
go vet ./...
```

## Definition of "Done"

- ✅ `go build` passes
- ✅ Tests pass
- ✅ Packages validate (lintian/rpmlint)
- ✅ Reproducible builds
- ✅ Docs updated

## Architecture

```
src/ (Core, base, packager) → Build → Validate → dist/
```

## Go Standards

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

### Types
```go
// ✅ Use structs
type PackageMetadata struct {
Name string
Version string
}
```

## Key Patterns

### Reproducible
```go
// ✅ Sort files
sort.Strings(files)
```

### Validate
```go
// ✅ Check names
if !regexp.MustCompile(`^[a-z0-9][a-z0-9+.-]+$`).MatchString(name) {
return fmt.Errorf("invalid name")
}
```

## Package Standards

- Debian: Control file, /usr/bin
- RPM: Spec file, /usr/bin
- Tarball: Unix layout

## Anti-Patterns

❌ Non-deterministic builds
❌ Invalid metadata
❌ Missing validation

## Success

- ✅ Builds
- ✅ Tests pass
- ✅ Validates
- ✅ Reproducible
15 changes: 15 additions & 0 deletions .gemini/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"version": "1.0",
"project": {
"name": "xpack",
"type": "CLI Tool",
"language": "Go"
},
"model": {
"name": "gemini-3-pro",
"temperature": 0.2
},
"context": {
"fileName": ["GEMINI.md"]
}
}
78 changes: 78 additions & 0 deletions .github/copilot/instructions.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
# GitHub Copilot Instructions for xpack

## Project Overview

**xpack** - Universal Linux Package Builder
- **Language**: Go ≥1.18
- **Type**: CLI for binary-to-package conversion
- **Formats**: .deb, .rpm, .tar.gz

Comment on lines +5 to +9
## Core Rules

### 1. Reproducible Builds
Same input must produce identical output

### 2. Package Standards
- Debian: Follow Debian Policy
- RPM: Follow RPM Guidelines

### 3. Validation
- Use `lintian` for .deb
- Use `rpmlint` for .rpm

## Commands

```bash
go build -o xpack src/Core/main.go
go test ./...
./bin/xpack -i ./bin -arch amd64 -v 1.1.1
Comment on lines +26 to +28
```

## Go Standards

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

### Type Safety
```go
// ✅ Use structs
type PackageMetadata struct {
Name string
Version string
}
```

## Key Patterns

### Deterministic Builds
```go
// ✅ Sort files
sort.Strings(files)
```

### Validation
```go
// ✅ Validate names
if !regexp.MustCompile(`^[a-z0-9][a-z0-9+.-]+$`).MatchString(name) {
return fmt.Errorf("invalid name")
}
```

## Testing

- Unit: Metadata, file ops
- Integration: Package creation
- Validation: lintian, rpmlint

## Success Criteria

- ✅ `go build` passes
- ✅ Tests pass
- ✅ Packages validate
- ✅ Reproducible
- ✅ Docs updated
29 changes: 29 additions & 0 deletions .github/copilot/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{
"version": "1.0",
"project": {
"name": "xpack",
"type": "CLI Tool",
"language": "Go"
},
"build": {
"command": "go build -o xpack src/Core/main.go",
"required": true
},
"test": {
"command": "go test ./...",
"required": true
},
"instructions": [
"Reproducible builds: same input = same output",
"Follow package standards (Debian Policy, RPM Guidelines)",
"Validate with lintian (deb) and rpmlint (rpm)",
"Sort files for deterministic builds",
"Validate package metadata",
"Clear error messages with context"
],
"antiPatterns": [
"Non-deterministic builds",
"Invalid metadata",
"Missing validation"
]
}
Loading
Loading