fix(install): make install.sh idempotent + add onboard-project.sh

- install.sh: no longer exits early when ~/.automaton exists.
  Skips the clone but runs all setup (VRAM detection, guards,
  self-improvement loop, virtualenv). Both curl|bash and
  git-clone + ./install.sh now work correctly.
- onboard-project.sh: new script that bootstraps automaton in a
  project — creates .automaton/ skeleton, detects models, writes
  config.md, inits git, installs hooks, adds .gitignore entries.
- README.md: fix install flow docs (curl|bash + clone-then-run),
  add onboard-project.sh as Option A for project setup
This commit is contained in:
Lap Tran
2026-06-26 13:54:28 -04:00
parent f980ccfe27
commit b880f2535a
4 changed files with 266 additions and 49 deletions
+47 -20
View File
@@ -6,22 +6,28 @@ A contract-based operating system for LLM agents, designed to enforce discipline
Before you can use the framework in any project, you must install the core logic into your local environment.
**Run these commands in your terminal:**
Choose one of the following methods:
### Option A: One-liner (curl pipe, recommended)
```bash
# Clone the framework into the global config directory
git clone <your-git-url> ~/.automaton
# Enter the directory
cd ~/.automaton
# Make the installation script executable and run it
# You must provide the git URL as the first argument
chmod +x install.sh
./install.sh <your-git-url>
curl -fsSL https://raw.githubusercontent.com/<your-org>/automaton/main/scripts/install.sh | bash -s -- <your-git-url>
```
The git URL is required because the framework uses it for self-updates and the self-improvement loop. Choose carefully -- it cannot be changed later without reinstalling.
This clones the framework to `~/.automaton/`, runs VRAM detection, installs pre-edit guards, creates the self-improvement loop, and sets up the Python virtualenv.
### Option B: Clone first
```bash
git clone <your-git-url> ~/.automaton
bash ~/.automaton/scripts/install.sh
```
The script detects that `~/.automaton` already exists, skips the clone, and runs all setup steps (VRAM detection, guards, loop, virtualenv).
### Both methods do the same thing
The git URL is required on fresh install because the framework uses it for self-updates and the self-improvement loop. Choose carefully -- it cannot be changed later without reinstalling.
*Note: This creates the "brain" of the framework (prompts, state machines, and rules) in your home directory. A self-improvement loop is created and scheduled by default (see Loop Engineering below).*
@@ -49,7 +55,24 @@ If a project was set up under the old model (with copies of framework files), it
Once the framework is installed globally, you must "onboard" every individual project you work on.
### Option A: The Agent-Driven Way (Recommended)
### Option A: The Onboarding Script (Recommended)
```bash
bash ~/.automaton/scripts/onboard-project.sh /path/to/project
```
This will:
1. Create `.automaton/` skeleton if missing.
2. Run `detect_models.py --write` to probe local models (falls back to a minimal `models.json`).
3. Generate `config.md` with VRAM recommendations.
4. Write `project-name.md` from the directory name.
5. Initialize git if not already a repo.
6. Install git hooks (pre-commit + pre-push).
7. Add automaton entries to `.gitignore`.
8. Run `status.py --audit` to verify the setup.
### Option B: The Agent-Driven Way
If you want the agent to handle the configuration for you, navigate to your project root and run:
> *"Onboard this project into automaton."
@@ -60,17 +83,21 @@ The agent will automatically:
3. Generate your `.agent.md` and `.rules.md` files.
4. Initiate the "Exploration Ritual" to understand your codebase.
### Option B: The Manual Way
If you prefer to set it up manually, create a `.automaton/` directory in your project root and add:
- `.agent.md`: Project-specific configuration (Mode, rules, etc.).
- `.rules.md`: Project-specific constraints and past failure modes.
### Option C: The Manual Way
If you prefer to set it up manually:
Then install the git pre-commit hook:
```bash
ln -sf ~/.automaton/scripts/git-hooks/pre-commit .git/hooks/pre-commit
# Create the automaton directory
mkdir -p .automaton/tasks .automaton/loops .automaton/design
# Install git hooks
bash ~/.automaton/scripts/install-hooks.sh .
# Configure your model(s)
python3 ~/.automaton/scripts/detect_models.py --write --project .
```
This hook blocks commits when no task is in `implement` or `doc_review` phase, preventing accidental code changes without a tracked task.
Then add `.agent.md` and `.rules.md` for the agent.
### The Self-Improvement Loop is framework-scoped