diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..dc19f64 --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2026 Aiatulla + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/README.md b/README.md index 0a141c1..ed0f965 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,19 @@ +
+ # agent-kit +**One kit that makes your AI coding agents plan first, follow your rules, and prove their work.** + +[![verify](https://github.com/Aiatulla/agent-kit/actions/workflows/verify.yml/badge.svg)](https://github.com/Aiatulla/agent-kit/actions/workflows/verify.yml) +![Claude Code](https://img.shields.io/badge/Claude_Code-supported-d97757) +![Gemini CLI](https://img.shields.io/badge/Gemini_CLI-supported-4285f4) +[![license](https://img.shields.io/badge/license-MIT-green)](LICENSE) +![bash](https://img.shields.io/badge/deps-bash%20%C2%B7%20git%20%C2%B7%20jq-555) + +[How it works](#how-it-works) · [How it differs](#how-it-differs) · [Install](#install) · [Use it in a project](#use-it-in-a-project) · [Extend](#extend-the-kit) + +
+ One repo that gives your AI coding agents the same rules, commands, reviewer, hooks, and skills on every machine. It supports Claude Code and Gemini CLI today, and a new tool is one adapter file. @@ -11,18 +25,57 @@ The kit has three tiers: Dependencies: bash (3.2 or newer), git, jq. macOS and Linux. +## How it works + +AI agents are fast but tend to guess, skip steps, and "fix" failing tests by changing the tests. +agent-kit gives every task the same path, the way a careful engineering team works: + +```mermaid +flowchart LR + A["/spec
agree on what"] --> B["/plan
agree on how"] + B --> C["/implement
one step at a time"] + C --> D["reviewer
checks the diff"] + D -->|pass| E["merge"] + D -->|fail| C + C -.->|something went wrong| F["/lesson
propose a fix"] +``` + +1. **Spec: agree on what to build.** + `/spec ` makes the agent interview you one question at a time until the goal is clear. + It writes `docs/specs/NNN-name.md` with the goal, what is out of scope, and testable acceptance criteria, plus a plain-language summary you can send to a customer. + No code is written yet. +2. **Plan: agree on how to build it.** + `/plan docs/specs/NNN-name.md` makes the agent read the code first, then write a plan: the approach, existing code to reuse, files to change, small checkbox steps, the tests, and the risks. + You read it and approve it before anything changes. +3. **Implement: one small step at a time.** + `/implement docs/plans/NNN-name.md` does one step, runs the checks, ticks the box, and commits. + If the plan turns out to be wrong, the agent stops and asks instead of improvising. +4. **Guardrails: run automatically while the agent works** (Claude Code, in projects set up with `kit sync`). + The agent's file-edit tools cannot change tests, snapshots, or fixtures (unless you set `ALLOW_TEST_EDITS=1`), so it has to fix the code, not the test. + `scripts/verify.sh` runs after every file edit and again before the agent may finish. + After the same check fails 3 times in a session, the hook tells the agent to stop and report instead of trying again. +5. **Review: a second agent checks the work.** + The `reviewer` agent did not write the code and assumes it has bugs. + It checks the diff against the spec and plan: every requirement built and tested, nothing extra added, nothing duplicated, no weakened checks, no security gaps. + It ends with `VERDICT: PASS` or `VERDICT: FAIL`. +6. **Lesson: learn from mistakes.** + When something goes wrong, `/lesson` records what happened and why, and proposes the smallest mechanical fix (a lint rule, a test, a hook) so it cannot happen again. + +Rules, commands, and skills are shared by Claude Code and Gemini CLI on every machine. +The guardrail hooks and the reviewer agent are Claude Code only for now; in Gemini CLI, the pre-commit hook from `kit sync` still runs `scripts/verify.sh fast` on every commit. + ## How it differs -Most agent kits are frameworks for building new agents. -agent-kit is not: it configures the AI coding agents you already use, and keeps them honest. +agent-kit is not a framework for building new agents. +It configures the AI coding agents you already use, and keeps them honest. - **Tool-agnostic**: one source of rules, commands, and skills for Claude Code and Gemini CLI; a new tool is one adapter file. -- **Guardrails that run, not just prompts**: hooks block edits to tests, snapshots, and fixtures, run `scripts/verify.sh` after edits and before the agent stops, and enforce a stop rule after 3 failed checks. +- **Guardrails that run, not just prompts** (Claude Code): hooks block file-tool edits to tests, snapshots, and fixtures, run `scripts/verify.sh` after edits and before the agent stops, and tell the agent to stop after 3 failed checks. - **Stack-aware**: per-directory stacks (`nextjs`, `fastapi`) bring their own rules, lint presets, and checks, so a monorepo gets the right rules in each folder. - **Spec-driven workflow**: `/spec`, `/plan`, `/implement`, and `/lesson` commands plus a reviewer agent that checks each diff against its spec and plan. -- **Safe and reversible install**: symlinks into the clone, backups before anything is replaced, merged `settings.json`, idempotent reruns, and a clean `--uninstall`. -- **Committed output**: `kit sync` writes plain files into the project, so teammates and CI need nothing installed. -- **No runtime**: bash, git, and jq only; no Node, Python, or package manager. +- **Safe and reversible install**: symlinks into the clone (Gemini commands are generated files), backups before anything is replaced, merged `settings.json`, idempotent reruns, and a clean `--uninstall`. +- **Committed output**: `kit sync` writes plain files into the project, so CI needs nothing installed. +- **Minimal dependencies**: the kit itself needs only bash, git, and jq; no Node, Python, or package manager. ## Install @@ -60,7 +113,7 @@ Create `.agent-kit.json` at the project root, mapping each directory to its stac Then run `kit sync` in the project. It copies the stacks into `.agent-kit/stacks/`, writes each stack's rules into that directory's `AGENTS.md` between `agent-kit` markers (your own content outside the markers is kept), writes `docs/inventory/.md`, generates `scripts/verify.sh`, installs a pre-commit hook that runs `scripts/verify.sh fast`, and records the kit version. -Commit the result: teammates and CI need nothing else installed. +Commit the result: CI needs nothing else installed, and teammates run `install.sh` (agent guardrails and the `kit` command), then `kit sync` (pre-commit hook). It prints the one line to add to your ESLint or Ruff config to extend the stack's preset. The file `.agent-kit.json` also turns on the global hooks for that project: @@ -87,3 +140,7 @@ Run `scripts/verify.sh full` before committing; `AGENTS.md` has the rules for wo ``` This removes only links that point into the kit and the kit's hooks from `settings.json`, then restores your backed-up files. + +## License + +MIT, see [LICENSE](LICENSE).