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
4 changes: 2 additions & 2 deletions .github/ISSUE_TEMPLATE/bug.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: Bug report
description: Report reproducible AI Optimizer behavior
description: Report reproducible AI Environment Optimizer behavior
title: "bug: "
labels:
- bug
Expand All @@ -10,7 +10,7 @@ body:
- type: input
id: version
attributes:
label: AI Optimizer version
label: AI Environment Optimizer version
placeholder: 0.1.0
validations:
required: true
Expand Down
4 changes: 2 additions & 2 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
blank_issues_enabled: false
contact_links:
- name: Setup and usage questions
url: https://github.com/nyldn/ai-optimizer/discussions
url: https://github.com/nyldn/ai-env-optimizer/discussions
about: Ask the community before filing a bug.
- name: Security vulnerability
url: https://github.com/nyldn/ai-optimizer/security/advisories/new
url: https://github.com/nyldn/ai-env-optimizer/security/advisories/new
about: Report security issues privately.
8 changes: 4 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,12 @@ jobs:
run: |
first="$RUNNER_TEMP/release-a"
second="$RUNNER_TEMP/release-b"
AI_OPTIMIZER_DIST_DIR="$first" scripts/build-release.sh
AI_OPTIMIZER_DIST_DIR="$second" scripts/build-release.sh
cmp "$first/ai-optimizer-$(tr -d '[:space:]' < VERSION).tar.gz" "$second/ai-optimizer-$(tr -d '[:space:]' < VERSION).tar.gz"
AI_ENV_OPTIMIZER_DIST_DIR="$first" scripts/build-release.sh
AI_ENV_OPTIMIZER_DIST_DIR="$second" scripts/build-release.sh
cmp "$first/ai-env-optimizer-$(tr -d '[:space:]' < VERSION).tar.gz" "$second/ai-env-optimizer-$(tr -d '[:space:]' < VERSION).tar.gz"
- name: Verify install and uninstall round trip
run: |
AI_OPTIMIZER_DIST_DIR="$RUNNER_TEMP/release-a" test/install_test.sh
AI_ENV_OPTIMIZER_DIST_DIR="$RUNNER_TEMP/release-a" test/install_test.sh
- name: Scan Git history for secrets
run: |
brew install gitleaks
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,19 +31,19 @@ jobs:
- name: Attest release archive
uses: actions/attest-build-provenance@4d101475d8b20a2381f78447822ac1eab6504dd8 # v4.2.2
with:
subject-path: dist/ai-optimizer-*.tar.gz
subject-path: dist/ai-env-optimizer-*.tar.gz
- name: Retain release assets in the workflow
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: ai-optimizer-release
name: ai-env-optimizer-release
path: |
dist/ai-optimizer-*.tar.gz
dist/ai-optimizer-*.tar.gz.sha256
dist/ai-env-optimizer-*.tar.gz
dist/ai-env-optimizer-*.tar.gz.sha256
dist/install.sh
dist/install.sh.sha256
if-no-files-found: error
- name: Publish GitHub release
env:
GH_TOKEN: ${{ github.token }}
run: |
gh release create "$GITHUB_REF_NAME" dist/ai-optimizer-*.tar.gz dist/ai-optimizer-*.tar.gz.sha256 dist/install.sh dist/install.sh.sha256 --verify-tag --generate-notes --title "AI Optimizer $GITHUB_REF_NAME"
gh release create "$GITHUB_REF_NAME" dist/ai-env-optimizer-*.tar.gz dist/ai-env-optimizer-*.tar.gz.sha256 dist/install.sh dist/install.sh.sha256 --verify-tag --generate-notes --title "AI Environment Optimizer $GITHUB_REF_NAME"
50 changes: 36 additions & 14 deletions AGENTS.md
Original file line number Diff line number Diff line change
@@ -1,32 +1,45 @@
# AI Optimizer agent instructions
# AI Environment Optimizer agent instructions

AI Optimizer is a public, macOS-only diagnostic and narrowly owned maintenance
CLI for Claude Code, Codex, MCP, skills, and coding workspaces. Codex reads this
file automatically. Claude Code receives the same contract through `CLAUDE.md`.
AI Environment Optimizer is a public, macOS-only diagnostic and narrowly owned
maintenance CLI for Claude Code, Codex, MCP, skills, and coding workspaces.
Codex reads this file automatically. Claude Code receives the same contract
through `CLAUDE.md`.

## Choose the workflow

- Use the **Operator workflow** when the user asks to inspect, configure,
optimize, maintain, or repair their AI coding environment.
- Use the **Development workflow** when the user asks to change AI Optimizer
itself.
- Use the **Development workflow** when the user asks to change AI Environment
Optimizer itself.
- If both apply, gather operator evidence first, then develop against a failing
test without mixing host-specific data into the repository.

## Operator workflow

1. From this repository root, run the read-only handshake:
1. Choose the first read-only command from the user's request.

For a storage request, make the first command:

```sh
./bin/ai-env-optimizer storage --json
```

Use it only when the user asks about storage or an evening receipt already
reports a storage warning. The inventory is read-only and path-free. For
other environment work, run the general handshake:

```sh
./bin/ai-optimizer agent-context --json
./bin/ai-env-optimizer agent-context --json
```

Add `--workspace-root PATH` only when the user identifies a different
workspace container. Do not run `setup`, scheduling, package-manager, or
repair commands merely to gather context.

2. Read `overall_status`, `prioritized_actions`, and both embedded reports.
Treat priorities as:
2. Read the selected command's evidence. For `agent-context`, read
`overall_status`, `prioritized_actions`, and both embedded reports. For
`storage`, read `summary` and each classified source; do not ask for or infer
hidden paths. Treat diagnostic priorities as:

- `P0`: required product/platform failure or unknown state;
- `P1`: non-required failure or unknown state;
Expand All @@ -40,17 +53,22 @@ file automatically. Claude Code receives the same contract through `CLAUDE.md`.
- Ask before deleting data, creating credentials, authenticating remote MCP
services, enabling schedules, upgrading unrelated software, or changing
another repository's behavior.
- For storage cleanup, first show the aggregate `--dry-run` result.
Never infer permission to apply cleanup from a preview token. Apply only
the exact token and filters the user explicitly approved.
- Sessions, transcripts, memories, worktrees, and active plugin state are
protected and must never be reclassified as cleanup candidates ad hoc.

4. Never print or commit credentials, environment values, MCP endpoints,
command arguments from user sessions, workspace names, or workspace file
contents. AI Optimizer reports are deliberately redacted; do not weaken that
contents. AI Environment Optimizer reports are deliberately redacted; do not weaken that
boundary while investigating.

5. Verify repairs with the affected tool's native doctor or focused test, then
re-run:

```sh
./bin/ai-optimizer agent-context --json
./bin/ai-env-optimizer agent-context --json
```

Report exact evidence, remaining findings, changed paths, and rollback
Expand All @@ -62,10 +80,14 @@ file automatically. Claude Code receives the same contract through `CLAUDE.md`.
1. Read `README.md`, `docs/architecture.md`, and the relevant tests.
2. Preserve these invariants:

- `doctor`, `scan`, and `agent-context` are read-only.
- Mutating commands may write only AI Optimizer-owned configuration,
- `doctor`, `scan`, `agent-context`, `storage`, and cleanup preview are read-only.
- Mutating commands may write only AI Environment Optimizer-owned configuration,
reports, release installation paths, and launchd label
`io.github.nyldn.ai-optimizer.daily`.
This legacy internal label is intentionally stable across the v0.2 rename.
- Cleanup apply may move only catalog entries marked eligible in code, only
after token revalidation, and only to the current user's Trash. Scheduled
maintenance must never invoke cleanup.
- Never silently edit or upgrade Claude Code, Codex, MCP servers, skills,
companion tools, or repositories.
- Keep runtime code compatible with `/usr/bin/ruby` 2.6 and the standard
Expand Down
21 changes: 20 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,27 @@
# Changelog

All notable changes are documented here. AI Optimizer follows semantic
All notable changes are documented here. AI Environment Optimizer follows semantic
versioning.

## 0.2.0 - 2026-08-23

- Rename the public project, repository, formula, release archive, and primary
command to AI Environment Optimizer and `ai-env-optimizer`.
- Preserve `ai-optimizer` as a working command alias and accept existing v0.1
state, install markers, environment variables, and direct-install roots.
- Keep both existing launchd service labels stable to prevent duplicate jobs,
while new installs use the canonical state directory and environment prefix.
- Add a Homebrew same-tap formula migration so installed users upgrade without
uninstalling or losing their opted-in service.
- Add path-free storage inventory for Claude, Codex, Claude-Mem, and product
state with historical sessions, memories, worktrees, and active state
protected by code-level classifications.
- Add token-verified, provider-idle, same-filesystem cleanup of allowlisted old
caches through a recoverable private Trash folder; no scheduled deletion or
arbitrary path mode exists.
- Add report-only storage health to evening maintenance with a configurable
10 GiB warning threshold.

## 0.1.8 - 2026-08-23

- Add a read-only `agent-context` handshake with embedded doctor and workspace
Expand Down
8 changes: 6 additions & 2 deletions CLAUDE.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,18 @@
# AI Optimizer
# AI Environment Optimizer

@AGENTS.md

Follow `AGENTS.md` as the shared Codex/Claude contract. For any environment
assessment, begin with the read-only repository handshake:

```sh
./bin/ai-optimizer agent-context --json
./bin/ai-env-optimizer agent-context --json
```

Do not infer repair authority from a diagnostic finding. If the user asked for
changes, make the smallest reversible fix, verify it with the owning tool, and
re-run the handshake before reporting completion.

For storage requests, follow the protected preview/apply workflow in
`AGENTS.md`. Make `./bin/ai-env-optimizer storage --json` the first command;
never treat a preview token as authorization to apply cleanup.
Loading
Loading