Skip to content
Closed
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
235 changes: 102 additions & 133 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,31 +1,26 @@
# Kit - Unified Workflow Engine for Software Development
# coding-context - Manage Coding Agent Rules

[![CodeQL](https://github.com/kitproj/kit/actions/workflows/codeql-analysis.yml/badge.svg)](https://github.com/kitproj/kit/actions/workflows/codeql-analysis.yml)
[![Go](https://github.com/kitproj/kit/actions/workflows/go.yml/badge.svg)](https://github.com/kitproj/kit/actions/workflows/go.yml)
A unified CLI tool for managing coding rules across different AI coding agents (Claude, Gemini, Cursor, GitHub Copilot, and more).

## What is Kit?
## What is coding-context?

Kit is a powerful workflow engine that simplifies complex software development environments by combining multiple tools into a single binary:
coding-context simplifies the management of coding rules and guidelines across multiple AI coding agents. Instead of maintaining separate rule files for each agent, you can:

- **Task execution** (like Makefile or Taskfile)
- **Service orchestration** (like Foreman)
- **Container management** (like Docker Compose)
- **Kubernetes resource management** (like Tilt, Skaffold)
- **Local development focus** (like Garden)
- **Import** rules from all agents into a normalized format
- **Export** rules to specific agent formats
- **Bootstrap** the necessary directory structure
- **View** aggregated prompts from all your rules

With Kit, you can define and manage complex workflows in a single `tasks.yaml` file, making it ideal for projects that require running multiple components simultaneously.
## Supported Agents

![Kit UI Screenshot](img.png)

## Key Features

- **Single binary** - Easy to install and use
- **Dependency management** - Define task dependencies in a DAG
- **Multiple task types** - Run commands, containers, Kubernetes resources
- **Auto-restart** - Automatically restart services on failure
- **File watching** - Re-run tasks when files change
- **Port forwarding** - Forward ports from services to host
- **Web UI** - Visualize your workflow and monitor task status with real-time metrics
- **Claude** - Hierarchical concatenation with CLAUDE.md files
- **Gemini** - Strategic layer with GEMINI.md files
- **Codex** - Uses AGENTS.md in ancestor directories
- **Cursor** - Declarative context injection with .cursor/rules/
- **Augment** - Structured rules in .augment/rules/
- **GitHub Copilot** - Uses .github/copilot-instructions.md
- **Windsurf** - Rules in .windsurf/rules/
- **Goose** - Standard AGENTS.md compatibility

## Quick Start

Expand All @@ -35,163 +30,137 @@ Download the standalone binary from the [releases page](https://github.com/kitpr

```bash
# For Linux
sudo curl --fail --location --output /usr/local/bin/kit https://github.com/kitproj/kit/releases/download/v0.1.105/kit_v0.1.105_linux_386
sudo chmod +x /usr/local/bin/kit
sudo curl --fail --location --output /usr/local/bin/coding-context https://github.com/kitproj/kit/releases/download/v0.1.105/kit_v0.1.105_linux_386
sudo chmod +x /usr/local/bin/coding-context

# For Go users
go install github.com/kitproj/kit@v0.1.105
```

### Basic Usage

1. Create a `tasks.yaml` file in your project:

```yaml
tasks:
build:
command: go build .
watch: . # Auto-rebuild when files change
run:
dependencies: [build]
command: ./myapp
ports: [8080] # Define as a service that listens on port 8080
1. **Bootstrap** - Create initial directory structure:

```bash
coding-context bootstrap
```

2. Start your workflow:
2. **Import** - Gather rules from all agents:

```bash
kit run # Run the 'run' task and its dependencies
coding-context import
```

## Core Concepts
3. **Export** - Distribute rules to a specific agent:

### Jobs vs Services

- **Jobs**: Run once and exit (default)
- **Services**: Run indefinitely and listen on ports
```bash
coding-context export Gemini
```

```yaml
# Job example
build:
command: go build .
4. **View Prompt** - See aggregated rules:

# Service example
api:
command: ./api-server
ports: [8080]
```bash
coding-context prompt
```

Services automatically restart on failure. Configure restart behavior with `restartPolicy` (Always, Never, OnFailure).

### Task Types
## Commands

#### Host Tasks
### import

Run commands on your local machine:
Import rules from all supported agents into the normalized AGENTS.md format:

```yaml
build:
command: go build .
```bash
coding-context import
```

#### Shell Tasks
This command:
- Scans for rules from all supported agents
- Appends them to AGENTS.md with source annotations
- Converts .mdc files to .md format
- Skips duplicate imports of AGENTS.md

Run shell scripts:
### export

```yaml
setup:
sh: |
set -eux
echo "Setting up environment..."
mkdir -p ./data
```
Export rules from AGENTS.md to a specific agent's format:

#### Container Tasks
```bash
coding-context export <agent>
```

Run Docker containers:
Available agents: Claude, Gemini, Codex, Cursor, Augment, GitHubCopilot, Windsurf, Goose

```yaml
database:
image: postgres:14
ports: [5432:5432]
env:
- POSTGRES_PASSWORD=password
Examples:
```bash
coding-context export Gemini # Creates GEMINI.md
coding-context export Claude # Creates CLAUDE.md
coding-context export Windsurf # Creates .windsurf/rules/AGENTS.md
```

Kit can also build and run containers from a Dockerfile:
### bootstrap

Create the initial directory structure and files:

```yaml
api:
image: ./src/api # Directory with Dockerfile
ports: [8080]
```bash
coding-context bootstrap
```

#### Kubernetes Tasks
This creates:
- `AGENTS.md` - Main rules file
- `.prompts/` - Project-level rules directory
- `~/.prompts/rules/` - User-level rules directory

Deploy and manage Kubernetes resources:
### prompt

```yaml
deploy:
namespace: default
manifests:
- k8s/
- service.yaml
ports: [80:8080] # Forward cluster port 80 to local port 8080
Print the aggregated prompt from all rule files:

```bash
coding-context prompt
```

### Advanced Features
This displays the content of all rule files in the normalized format.

#### Task Dependencies
## Rule Hierarchy

```yaml
test:
dependencies: [build, database]
command: go test ./...
```
Rules are organized by priority level:

#### Environment Variables
1. **Project Rules (Level 0)** - Most important
- `.prompts/` directory
- Project-specific files like `.github/agents/`

```yaml
server:
command: ./server
env:
- PORT=8080
- DEBUG=true
envfile: .env # Load from file
```
2. **Ancestor Rules (Level 1)** - Next priority
- Files in parent directories (e.g., AGENTS.md, CLAUDE.md)

#### File Watching
3. **User Rules (Level 2)** - User-specific
- `~/.prompts/rules/`
- `~/.claude/CLAUDE.md`
- `~/.gemini/GEMINI.md`

```yaml
build:
command: go build .
watch: src/ # Rebuild when files in src/ change
```
4. **System Rules (Level 3)** - System-wide
- `/usr/local/prompts-rules`

#### Task Grouping

Organize tasks visually in the UI:

```yaml
tasks:
api:
command: ./api
ports: [8080]
group: backend
db:
image: postgres
ports: [5432]
group: backend
ui:
command: npm start
ports: [3000]
group: frontend
```
## Agent-Specific Formats

### Claude
- Global: `~/.claude/CLAUDE.md`
- Ancestor: `./CLAUDE.md` (checked into Git)
- Local: `./CLAUDE.local.md` (highest precedence, typically .gitignore'd)

### Gemini
- Global: `~/.gemini/GEMINI.md`
- Ancestor: `./GEMINI.md`
- Project: `./.gemini/styleguide.md`

### Cursor
- Project: `./.cursor/rules/*.md` and `./.cursor/rules/*.mdc`
- Compatibility: `./AGENTS.md`

## Documentation
### GitHub Copilot
- Repository: `./.github/copilot-instructions.md`
- Agent Config: `.github/agents/`
- Compatibility: `./AGENTS.md`

- [Examples](docs/examples) - Practical examples (MySQL, Kafka, etc.)
- [Reference](docs/reference) - Detailed configuration options
### Windsurf
- Project/Ancestor: `./.windsurf/rules/*.md`

## Contributing

Expand Down
Loading
Loading