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
3 changes: 2 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ jobs:
- name: ShellCheck agent scripts
run: |
shopt -s globstar
shellcheck --severity=warning skills/*/scripts/*.sh tests/run-scenarios.sh tests/**/*.sh install.sh
shellcheck --severity=warning skills/*/scripts/*.sh lib/*.sh install.sh \
$(find tests -name '*.sh' -not -path '*/issues/*')
# ── cargo-agent scenarios ───────────────────────────────────────────
cargo-agent:
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
.DS_Store
*.swp
*.swo
.ralph/
121 changes: 121 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,17 @@ Standard build tools produce walls of text. Agents waste context window parsing

| Agent | Toolchain | Steps |
|-------|-----------|-------|
| `ansible-agent` | Ansible | lint (ansible-lint), syntax (ansible-playbook --syntax-check) |
| `bash-agent` | Bash/Shell | syntax (bash -n), lint (shellcheck) |
| `cargo-agent` | Rust | fmt, check, clippy, test (nextest) |
| `docker-agent` | Docker | lint (hadolint), build-check (BuildKit) |
| `gha-agent` | GitHub Actions | lint (actionlint) |
| `go-agent` | Go | fmt (gofmt), vet, staticcheck, test |
| `helm-agent` | Helm | lint, template |
| `kube-agent` | Kubernetes | validate (kubeconform/kubeval) |
| `npm-agent` | Node.js | format, lint, typecheck, test, build |
| `py-agent` | Python | format (ruff/black), lint (ruff/flake8), typecheck (mypy/pyright), test (pytest) |
| `sql-agent` | SQL | lint (sqlfluff), fix (sqlfluff fix) |
| `terra-agent` | Terraform | fmt (check/fix), safe init, plan-safe, validate, lint (tflint) |

## Quick Start
Expand All @@ -43,6 +51,9 @@ It also prints a short AGENTS.md/CLAUDE.md policy snippet you can copy/paste.
### Use directly (no install)

```sh
# Ansible project
path/to/x-agent/skills/ansible-agent/scripts/ansible-agent.sh

# Rust project
path/to/x-agent/skills/cargo-agent/scripts/cargo-agent.sh

Expand All @@ -52,12 +63,50 @@ path/to/x-agent/skills/npm-agent/scripts/npm-agent.sh
# Python project
path/to/x-agent/skills/py-agent/scripts/py-agent.sh

# Docker project
path/to/x-agent/skills/docker-agent/scripts/docker-agent.sh

# GitHub Actions project
path/to/x-agent/skills/gha-agent/scripts/gha-agent.sh

# Go project
path/to/x-agent/skills/go-agent/scripts/go-agent.sh

# Helm project
path/to/x-agent/skills/helm-agent/scripts/helm-agent.sh

# Kubernetes project
path/to/x-agent/skills/kube-agent/scripts/kube-agent.sh

# SQL project
path/to/x-agent/skills/sql-agent/scripts/sql-agent.sh

# Terraform project
path/to/x-agent/skills/terra-agent/scripts/terra-agent.sh
```

## Usage

### ansible-agent

```sh
ansible-agent.sh # full suite: lint + syntax
ansible-agent.sh lint # ansible-lint check only
ansible-agent.sh syntax # ansible-playbook --syntax-check only
FMT_MODE=fix ansible-agent.sh lint # auto-fix lint issues
```

`ansible-agent` runs `ansible-lint` for linting (auto-fix locally, check-only in CI) and `ansible-playbook --syntax-check` on discovered playbooks. Reports SKIP when no YAML files are found.

### bash-agent

```sh
bash-agent.sh # full suite: syntax + lint
bash-agent.sh syntax # bash -n syntax check only
bash-agent.sh lint # shellcheck lint only
SHELLCHECK_SEVERITY=error bash-agent.sh lint # only errors, ignore warnings
```

### cargo-agent

```sh
Expand All @@ -68,6 +117,58 @@ cargo-agent.sh test # tests only
cargo-agent.sh test -p api # tests in a specific crate
```

### docker-agent

```sh
docker-agent.sh # full suite: lint only (build-check off by default)
docker-agent.sh lint # hadolint check only
RUN_BUILD_CHECK=1 docker-agent.sh all # lint + BuildKit check
```

`docker-agent` discovers `Dockerfile`, `Dockerfile.*`, and `*.dockerfile` files recursively. `build-check` uses `docker build --check` (BuildKit lint mode) and defaults to OFF. Reports SKIP when no Dockerfiles are found.

### gha-agent

```sh
gha-agent.sh # lint all workflow files
gha-agent.sh lint # actionlint check only
```

`gha-agent` runs `actionlint` on `.github/workflows/*.yml` and `*.yaml` files. Reports SKIP when no workflows directory exists.

### go-agent

```sh
go-agent.sh # full suite: fmt + vet + staticcheck + test
go-agent.sh fmt # gofmt check/fix
go-agent.sh vet # go vet analysis
go-agent.sh test # tests only
FMT_MODE=fix go-agent.sh fmt # auto-fix formatting
```

`go-agent` uses `gofmt` for formatting (auto-fix locally, check-only in CI), `go vet` for analysis, optional `staticcheck` for linting, and `go test` for tests.

### helm-agent

```sh
helm-agent.sh # full suite: lint + template
helm-agent.sh lint # helm lint only
helm-agent.sh template # helm template only
CHART_DIR=charts/myapp helm-agent.sh all # explicit chart directory
```

`helm-agent` auto-detects chart directories by searching for `Chart.yaml`. Use `CHART_DIR` to override. Reports SKIP when no charts are found.

### kube-agent

```sh
kube-agent.sh # full suite: validate
kube-agent.sh validate # validate manifests only
KUBE_SCHEMAS_DIR=path kube-agent.sh all # custom schema location
```

`kube-agent` auto-detects kubeconform or kubeval and validates all `.yaml`/`.yml` files containing Kubernetes resource definitions (`apiVersion:` + `kind:`). Use `KUBE_SCHEMAS_DIR` for custom schemas. Reports SKIP when no manifests are found.

### npm-agent

```sh
Expand All @@ -91,6 +192,18 @@ py-agent.sh test -k login # tests matching "login"

py-agent auto-detects your runner (uv, poetry, or plain python) and finds tools (ruff, black, flake8, mypy, pyright, pytest).

### sql-agent

```sh
sql-agent.sh # full suite: lint only (fix off by default)
sql-agent.sh lint # sqlfluff lint only
sql-agent.sh fix # sqlfluff fix (auto-fix)
RUN_FIX=1 sql-agent.sh all # lint + fix (fix runs first)
SQLFLUFF_DIALECT=postgres sql-agent.sh lint # specify dialect
```

`sql-agent` discovers `.sql` files recursively and lints them with `sqlfluff`. Fix defaults to OFF — enable with `RUN_FIX=1` or `FMT_MODE=fix`. In CI, fix is forced to check-only mode.

### terra-agent

```sh
Expand Down Expand Up @@ -152,9 +265,17 @@ On **PASS**, temp logs are cleaned up automatically. On **FAIL** (or `KEEP_DIR=1

The `skills/` directory contains Claude Code skill definitions. After installing, agents like Claude Code can invoke these as skills:

- `/ansible-agent` — run Ansible playbook checks
- `/bash-agent` — run shell script checks
- `/cargo-agent` — run Rust checks
- `/docker-agent` — run Dockerfile linting
- `/gha-agent` — run GitHub Actions workflow linting
- `/go-agent` — run Go checks
- `/helm-agent` — run Helm chart checks
- `/kube-agent` — run Kubernetes manifest validation
- `/npm-agent` — run Node.js checks
- `/py-agent` — run Python checks
- `/sql-agent` — run SQL linting/fixing
- `/terra-agent` — run Terraform checks/fixes

## License
Expand Down
18 changes: 18 additions & 0 deletions TODO.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# x-agent TODO

Build and ship new agents one at a time, with one commit per item.
See `docs/agents/definition-of-done.md` for completion criteria.

## Backlog (Priority Order)

- [x] `terra-agent` core: Terraform checks (`fmt-check`, `fmt-fix`, `validate`, optional `tflint`)
- [x] `terra-agent` follow-up: add safe init step (`terraform init -backend=false -input=false`)
- [x] `py-agent`: Python checks (`format`, `lint`, `typecheck`, `test`)
- [ ] `bash-agent`: Bash/shell script checks (`bash -n` syntax validation, `shellcheck` linting)
- [ ] `go-agent`: Go checks (`fmt`, `vet`, optional `staticcheck`, `test`)
- [ ] `gha-agent`: GitHub Actions workflow linting (`actionlint`)
- [ ] `helm-agent`: Helm checks (`lint`, `template` render validation)
- [ ] `kube-agent`: Kubernetes manifest validation (`kubeconform`/`kubeval`)
- [ ] `docker-agent`: Dockerfile linting and optional image build check
- [ ] `ansible-agent`: Ansible lint and syntax validation
- [ ] `sql-agent`: SQL format/lint checks (`sqlfluff`)
Loading