kivax 2.1.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- kivax-2.1.0/LICENSE +21 -0
- kivax-2.1.0/PKG-INFO +611 -0
- kivax-2.1.0/README.md +579 -0
- kivax-2.1.0/pyproject.toml +56 -0
- kivax-2.1.0/setup.cfg +4 -0
- kivax-2.1.0/src/kivax/__init__.py +20 -0
- kivax-2.1.0/src/kivax/__main__.py +11 -0
- kivax-2.1.0/src/kivax/cli.py +1303 -0
- kivax-2.1.0/src/kivax/data/VERSION +1 -0
- kivax-2.1.0/src/kivax/data/agent_runtimes.yml +60 -0
- kivax-2.1.0/src/kivax/data/agents/implementer.md +30 -0
- kivax-2.1.0/src/kivax/data/agents/knowledge-curator.md +38 -0
- kivax-2.1.0/src/kivax/data/agents/orchestrator.md +110 -0
- kivax-2.1.0/src/kivax/data/agents/researcher.md +44 -0
- kivax-2.1.0/src/kivax/data/agents/reviewer.md +27 -0
- kivax-2.1.0/src/kivax/data/agents/spec-analyst.md +59 -0
- kivax-2.1.0/src/kivax/data/agents/spec-compiler.md +25 -0
- kivax-2.1.0/src/kivax/data/agents/tech-planner.md +76 -0
- kivax-2.1.0/src/kivax/data/agents/test-writer.md +29 -0
- kivax-2.1.0/src/kivax/data/agents/trace-auditor.md +30 -0
- kivax-2.1.0/src/kivax/data/agents/wiki-curator.md +34 -0
- kivax-2.1.0/src/kivax/data/ci/github-actions-kivax.yml +38 -0
- kivax-2.1.0/src/kivax/data/runtime/skills/kivax-architecture/SKILL.md +46 -0
- kivax-2.1.0/src/kivax/data/runtime/skills/kivax-audit/SKILL.md +92 -0
- kivax-2.1.0/src/kivax/data/runtime/skills/kivax-compile/SKILL.md +35 -0
- kivax-2.1.0/src/kivax/data/runtime/skills/kivax-evolve/SKILL.md +112 -0
- kivax-2.1.0/src/kivax/data/runtime/skills/kivax-git/SKILL.md +58 -0
- kivax-2.1.0/src/kivax/data/runtime/skills/kivax-it/SKILL.md +62 -0
- kivax-2.1.0/src/kivax/data/runtime/skills/kivax-lessons-schema/SKILL.md +75 -0
- kivax-2.1.0/src/kivax/data/runtime/skills/kivax-new/SKILL.md +21 -0
- kivax-2.1.0/src/kivax/data/runtime/skills/kivax-plan/SKILL.md +77 -0
- kivax-2.1.0/src/kivax/data/runtime/skills/kivax-principles/SKILL.md +37 -0
- kivax-2.1.0/src/kivax/data/runtime/skills/kivax-retro/SKILL.md +59 -0
- kivax-2.1.0/src/kivax/data/runtime/skills/kivax-run/SKILL.md +19 -0
- kivax-2.1.0/src/kivax/data/runtime/skills/kivax-setup/SKILL.md +21 -0
- kivax-2.1.0/src/kivax/data/runtime/skills/kivax-spec/SKILL.md +74 -0
- kivax-2.1.0/src/kivax/data/runtime/skills/kivax-spec-writing/SKILL.md +27 -0
- kivax-2.1.0/src/kivax/data/runtime/skills/kivax-status/SKILL.md +14 -0
- kivax-2.1.0/src/kivax/data/runtime/skills/kivax-tasks/SKILL.md +42 -0
- kivax-2.1.0/src/kivax/data/runtime/skills/kivax-tdd/SKILL.md +70 -0
- kivax-2.1.0/src/kivax/data/runtime/skills/kivax-tdd-loop/SKILL.md +28 -0
- kivax-2.1.0/src/kivax/data/runtime/skills/kivax-wiki/SKILL.md +48 -0
- kivax-2.1.0/src/kivax/data/runtime/skills/kivax-wiki-schema/SKILL.md +56 -0
- kivax-2.1.0/src/kivax/data/runtime/skills/kivax-yml-spec/SKILL.md +50 -0
- kivax-2.1.0/src/kivax/data/stack_profiles.yml +47 -0
- kivax-2.1.0/src/kivax/data/templates/architecture.template.md +24 -0
- kivax-2.1.0/src/kivax/data/templates/lesson.template.md +43 -0
- kivax-2.1.0/src/kivax/data/templates/plan.template.md +34 -0
- kivax-2.1.0/src/kivax/data/templates/pr_description.template.md +19 -0
- kivax-2.1.0/src/kivax/data/templates/principles.template.md +20 -0
- kivax-2.1.0/src/kivax/data/templates/research.template.md +48 -0
- kivax-2.1.0/src/kivax/data/templates/spec.template.md +35 -0
- kivax-2.1.0/src/kivax/data/templates/spec.template.yml +52 -0
- kivax-2.1.0/src/kivax/data/templates/state.template.yml +17 -0
- kivax-2.1.0/src/kivax/lib/__init__.py +7 -0
- kivax-2.1.0/src/kivax/lib/kivax_agents.py +128 -0
- kivax-2.1.0/src/kivax/lib/kivax_hash.py +85 -0
- kivax-2.1.0/src/kivax/lib/kivax_lessons.py +508 -0
- kivax-2.1.0/src/kivax/lib/kivax_lib.py +397 -0
- kivax-2.1.0/src/kivax/lib/kivax_specfirst.py +116 -0
- kivax-2.1.0/src/kivax/lib/kivax_state.py +282 -0
- kivax-2.1.0/src/kivax/lib/kivax_task.py +197 -0
- kivax-2.1.0/src/kivax/lib/kivax_trace.py +181 -0
- kivax-2.1.0/src/kivax/lib/kivax_validate.py +186 -0
- kivax-2.1.0/src/kivax/lib/kivax_wiki.py +138 -0
- kivax-2.1.0/src/kivax.egg-info/PKG-INFO +611 -0
- kivax-2.1.0/src/kivax.egg-info/SOURCES.txt +69 -0
- kivax-2.1.0/src/kivax.egg-info/dependency_links.txt +1 -0
- kivax-2.1.0/src/kivax.egg-info/entry_points.txt +2 -0
- kivax-2.1.0/src/kivax.egg-info/requires.txt +7 -0
- kivax-2.1.0/src/kivax.egg-info/top_level.txt +1 -0
kivax-2.1.0/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Sergio Fernández Fernández
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
kivax-2.1.0/PKG-INFO
ADDED
|
@@ -0,0 +1,611 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: kivax
|
|
3
|
+
Version: 2.1.0
|
|
4
|
+
Summary: A runtime for spec-anchored Spec-Driven Development
|
|
5
|
+
Author: null-result
|
|
6
|
+
License-Expression: MIT
|
|
7
|
+
Project-URL: Homepage, https://github.com/null-result/kivax
|
|
8
|
+
Project-URL: Repository, https://github.com/null-result/kivax
|
|
9
|
+
Project-URL: Issues, https://github.com/null-result/kivax/issues
|
|
10
|
+
Project-URL: Changelog, https://github.com/null-result/kivax/releases
|
|
11
|
+
Keywords: spec-driven-development,sdd,ai-agents,claude-code,traceability
|
|
12
|
+
Classifier: Development Status :: 4 - Beta
|
|
13
|
+
Classifier: Environment :: Console
|
|
14
|
+
Classifier: Intended Audience :: Developers
|
|
15
|
+
Classifier: Operating System :: OS Independent
|
|
16
|
+
Classifier: Programming Language :: Python :: 3 :: Only
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
20
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
21
|
+
Classifier: Topic :: Software Development :: Quality Assurance
|
|
22
|
+
Requires-Python: >=3.10
|
|
23
|
+
Description-Content-Type: text/markdown
|
|
24
|
+
License-File: LICENSE
|
|
25
|
+
Requires-Dist: pyyaml>=6.0
|
|
26
|
+
Provides-Extra: dev
|
|
27
|
+
Requires-Dist: pytest>=7.4; extra == "dev"
|
|
28
|
+
Requires-Dist: pytest-cov>=4.1; extra == "dev"
|
|
29
|
+
Requires-Dist: ruff>=0.5; extra == "dev"
|
|
30
|
+
Requires-Dist: build>=1.2; extra == "dev"
|
|
31
|
+
Dynamic: license-file
|
|
32
|
+
|
|
33
|
+
# Kivax
|
|
34
|
+
|
|
35
|
+
<p align="center">
|
|
36
|
+
<img src="assets/logo.png" alt="Kivax logo" width="200">
|
|
37
|
+
</p>
|
|
38
|
+
|
|
39
|
+
<p align="center">
|
|
40
|
+
<a href="https://github.com/null-result/kivax/actions/workflows/ci.yml"><img src="https://github.com/null-result/kivax/actions/workflows/ci.yml/badge.svg" alt="CI"></a>
|
|
41
|
+
<a href="LICENSE"><img src="https://img.shields.io/badge/license-MIT-blue.svg" alt="License: MIT"></a>
|
|
42
|
+
</p>
|
|
43
|
+
|
|
44
|
+
Kivax is a runtime for spec-anchored Spec-Driven Development: the narrative spec compiles into a canonical yml, from which the plan, tests, and code are derived, with hash-verifiable traceability between them at every step.
|
|
45
|
+
|
|
46
|
+
Works with **Claude Code**, **opencode**, **Cursor**, **GitHub Copilot** (in VS Code and via Copilot CLI), and **OpenAI Codex CLI** — one project can use several at once.
|
|
47
|
+
|
|
48
|
+
**Contents** — [Quick start](#quick-start) · [Prerequisites](#prerequisites) · [Install](#install-once-per-machine) · [Set up a project](#set-up-a-project) · [Using it day to day](#using-it-day-to-day) · [Project files](#project-files-and-the-global-store) · [Keeping in sync](#keeping-in-sync) · [CLI](#cli-reference) · [Troubleshooting](#troubleshooting)
|
|
49
|
+
|
|
50
|
+
---
|
|
51
|
+
|
|
52
|
+
## Quick start
|
|
53
|
+
|
|
54
|
+
```bash
|
|
55
|
+
pipx install kivax
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
Then, at the root of the project you want to work on:
|
|
59
|
+
|
|
60
|
+
```bash
|
|
61
|
+
kivax init
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
Answer the wizard, then open your AI assistant in that project and ask it to **set the project up** (writes `PRINCIPLES.md` and `ARCHITECTURE.md` with you, once) and then to **start a new feature**. That's it — the rest of this document explains each step in detail.
|
|
65
|
+
|
|
66
|
+
---
|
|
67
|
+
|
|
68
|
+
## Prerequisites
|
|
69
|
+
|
|
70
|
+
- **Python 3.10 or later.** Kivax is a pip package; its one dependency (PyYAML) is installed with it.
|
|
71
|
+
- **git** — Kivax's traceability model diffs your branch against a base branch, so run `kivax init` inside a git repository, at its root.
|
|
72
|
+
- **A forge CLI: [`gh`](https://cli.github.com) or [`glab`](https://gitlab.com/gitlab-org/cli)**, authenticated (`gh auth login`). The flow ends by opening a pull request, and a pull request is a forge concept, not a git one — no git command creates one. `kivax doctor` checks for it.
|
|
73
|
+
- **At least one supported assistant**: [Claude Code](https://claude.com/product/claude-code), [opencode](https://opencode.ai), [Cursor](https://cursor.com), [GitHub Copilot](https://github.com/features/copilot) in VS Code, [GitHub Copilot CLI](https://docs.github.com/en/copilot/how-tos/copilot-cli), or [OpenAI Codex CLI](https://developers.openai.com/codex). You can mix several in the same project.
|
|
74
|
+
- Linux, macOS, and Windows are all supported and all covered by CI.
|
|
75
|
+
|
|
76
|
+
---
|
|
77
|
+
|
|
78
|
+
## Install (once per machine)
|
|
79
|
+
|
|
80
|
+
```bash
|
|
81
|
+
pipx install kivax
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
Same command on Linux, macOS, and Windows.
|
|
85
|
+
|
|
86
|
+
[pipx](https://pipx.pypa.io) is the recommendation rather than plain `pip` because Kivax is an *application*, not a library you import: pipx puts it in its own virtualenv and links just the `kivax` command onto your PATH, so it can't collide with your projects' dependencies. It also sidesteps the "externally-managed-environment" error that `pip install` hits on Debian, Ubuntu, and Homebrew Python.
|
|
87
|
+
|
|
88
|
+
Plain pip works too, if you'd rather:
|
|
89
|
+
|
|
90
|
+
```bash
|
|
91
|
+
pip install --user kivax
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
**Upgrade** — one command, and it's the whole story. The agents, skills, and templates Kivax installs into projects ship *inside* the package, so the CLI and the material it copies can never be out of step:
|
|
95
|
+
|
|
96
|
+
```bash
|
|
97
|
+
pipx upgrade kivax
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
That updates Kivax itself. It deliberately doesn't touch any project — run `kivax upgrade` inside each repository you want to bring current, and review the diff.
|
|
101
|
+
|
|
102
|
+
**Uninstall** — `pipx uninstall kivax`.
|
|
103
|
+
|
|
104
|
+
### Verify
|
|
105
|
+
|
|
106
|
+
```bash
|
|
107
|
+
kivax version
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
Should print the store path and the version. If you get `command not found`, see [Troubleshooting](#troubleshooting).
|
|
111
|
+
|
|
112
|
+
> **Upgrading from 2.0 or earlier?** Kivax used to be installed by cloning this repository and running `install.py`, which left a store in `~/.kivax` and a `kivax` symlink in `~/.local/bin`. Neither is used any more. Delete both — if that old symlink sits earlier on your PATH it will keep shadowing the version you just installed. `kivax version` warns you when it spots the leftovers.
|
|
113
|
+
>
|
|
114
|
+
> ```bash
|
|
115
|
+
> rm -rf ~/.kivax ~/.local/bin/kivax
|
|
116
|
+
> ```
|
|
117
|
+
>
|
|
118
|
+
> Projects need no migration: everything `kivax init` wrote is committed in the repository already.
|
|
119
|
+
|
|
120
|
+
---
|
|
121
|
+
|
|
122
|
+
## Set up a project
|
|
123
|
+
|
|
124
|
+
Run this at the **root of your repository**, once per project:
|
|
125
|
+
|
|
126
|
+
```bash
|
|
127
|
+
kivax init
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
It's an interactive wizard that:
|
|
131
|
+
|
|
132
|
+
1. **Asks which assistant(s) you use** — Claude Code, opencode, Cursor, GitHub Copilot in VS Code, GitHub Copilot CLI, OpenAI Codex CLI. Any combination (Claude Code defaults to yes, the rest to no).
|
|
133
|
+
2. **Detects greenfield vs. existing code** (counts source files) and asks you to confirm — it never decides on its own. Stored as `greenfield` in the config, because project setup needs it later.
|
|
134
|
+
3. **Chooses the features root.** Kivax keeps one directory per feature under it (`specs/01-booking/`, `specs/02-cancel/`). If the project isn't greenfield it looks for `specs/`, `spec/`, `docs/specs/`… and offers what it finds — but if that folder already holds loose markdown, it says so and suggests a separate folder instead: Kivax never reads, moves, or migrates a pre-existing corpus of specs.
|
|
135
|
+
4. **Asks what language the spec *content* should be written in** (`spec_language`) — see [Language](#language).
|
|
136
|
+
5. **Detects your stack** by looking for `pom.xml`, `package.json`, `pyproject.toml`, `go.mod`… at the root and in first-level subdirectories (monorepo support), and presents it for confirmation.
|
|
137
|
+
6. **Detects git's base branch** for PRs and diffs — `develop` when the repo has one (gitflow's integration branch), otherwise whatever `origin/HEAD` points at.
|
|
138
|
+
7. **Proposes `legacy_globs`** if the project isn't greenfield — pre-existing files exempt from requiring a spec, for your confirmation. If it found a folder of spec documents you already had, that goes in too: those are documents, not untraced code, so editing one later isn't reported as a violation.
|
|
139
|
+
8. **Writes `.kivax/config.yml`**, creates the (empty) features root, and **copies** the agents, skills, and orchestrator instructions into the project as ordinary files. No spec is written yet: the first one arrives with your first feature.
|
|
140
|
+
|
|
141
|
+
### Commit what it creates
|
|
142
|
+
|
|
143
|
+
Everything `kivax init` writes is a normal file meant to live in git:
|
|
144
|
+
|
|
145
|
+
```bash
|
|
146
|
+
git add .kivax/ CLAUDE.md AGENTS.md .claude/ specs/ # plus .cursor/, .github/, .codex/, .opencode/ if you use them
|
|
147
|
+
git commit -m "chore: install kivax"
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
Teammates then need nothing but `git clone` — the agents, skills, and config are already in the repo. Running `kivax init` again on an already-installed project does nothing (no wizard, no re-copy); it tells you to use `kivax upgrade` instead.
|
|
151
|
+
|
|
152
|
+
### Check the setup
|
|
153
|
+
|
|
154
|
+
```bash
|
|
155
|
+
kivax doctor
|
|
156
|
+
```
|
|
157
|
+
|
|
158
|
+
Diagnoses the project's installation: a missing `paths.features`, config keys left over from an older Kivax (it names each one and what replaced it), an `agents:` entry naming an agent that doesn't exist, a phase whose `kivax-<phase>` skill is missing, duplicate feature numbers or ids, a mistyped feature directory, tag regexes that predate the per-feature id form, and empty agent/skill directories. It stays quiet about documentation folders you deliberately keep alongside your features — it only flags a directory that was clearly *meant* to be a feature.
|
|
159
|
+
|
|
160
|
+
---
|
|
161
|
+
|
|
162
|
+
## Using it day to day
|
|
163
|
+
|
|
164
|
+
Once installed, you drive Kivax by **talking to your assistant**, not by typing CLI commands. Each phase of the flow is a *skill* the assistant reads (`kivax-spec`, `kivax-plan`, …); you either name the skill or just describe what you want and let it trigger.
|
|
165
|
+
|
|
166
|
+
### The pipeline
|
|
167
|
+
|
|
168
|
+
The sequence, fixed and the same in every Kivax project:
|
|
169
|
+
|
|
170
|
+
```
|
|
171
|
+
spec → compile → plan → tdd → it → audit → retro → done
|
|
172
|
+
```
|
|
173
|
+
|
|
174
|
+
| Phase | Skill | What happens | Gate |
|
|
175
|
+
|---|---|---|---|
|
|
176
|
+
| `spec` | `kivax-spec` | Drafts/refines the narrative `spec.md` by interviewing you. | human |
|
|
177
|
+
| `compile` | `kivax-compile` | Compiles `spec.md` → canonical `spec.yml`; validates and hashes it. | human |
|
|
178
|
+
| `plan` | `kivax-plan` | Writes `plan.md` (contracts, REQ→module→test mapping), cuts `feature/NN-slug`, pushes, opens a draft PR. | human |
|
|
179
|
+
| `tdd` | `kivax-tdd` | Per REQ: red unit tests, then minimum code until green. | auto |
|
|
180
|
+
| `it` | `kivax-it` | Integration tests from the spec's `integration_scenarios`. | auto |
|
|
181
|
+
| `audit` | `kivax-audit` | Traceability gate (`kivax trace`) + clean-context PR review, then marks the PR ready. | human |
|
|
182
|
+
| `retro` | `kivax-retro` | Records what the cycle *cost* as lessons the next one has to answer for. | human |
|
|
183
|
+
|
|
184
|
+
Every phase runs, for every feature. The sequence is not configurable, and neither are the gates — they're the workflow Kivax exists to impose, not settings.
|
|
185
|
+
|
|
186
|
+
Writing `PRINCIPLES.md` and `ARCHITECTURE.md` is **not** part of this sequence: those describe the project, so they happen once, before your first feature — see [Project setup](#project-setup-principles-and-architecture).
|
|
187
|
+
|
|
188
|
+
A **gate** is what happens at the end of a phase: `human` means the assistant stops and waits for your explicit approval; `auto` means it chains straight into the next phase. The phases where a mistake is expensive and hard to walk back — a wrong spec, a wrong plan, a passed audit — are the ones a person has to see.
|
|
189
|
+
|
|
190
|
+
**Exceptions are not gates and are not configurable.** An `AMBIGUITY`, `DISPUTE`, `GAP`, `CONFLICT`, `PRINCIPLES-VIOLATION`, a `NOT PASSING` audit verdict, or a failed validation **always** stops the flow and comes to you, even when the gate is `auto`. `auto` delegates approval, never quality control.
|
|
191
|
+
|
|
192
|
+
### A first feature, end to end
|
|
193
|
+
|
|
194
|
+
```
|
|
195
|
+
You: Start a new feature: users can cancel a booking up to 24h before check-in.
|
|
196
|
+
```
|
|
197
|
+
|
|
198
|
+
The assistant runs `kivax-new`, which calls `kivax feature new cancel-booking`: that allocates the next feature number, creates `specs/01-cancel-booking/` with its own `spec.md`, and makes it the active feature. Then `kivax-spec`: it asks you clarifying questions, writes the spec, and stops at the `spec` human gate with its open questions and assumptions.
|
|
199
|
+
|
|
200
|
+
```
|
|
201
|
+
You: Approved.
|
|
202
|
+
```
|
|
203
|
+
|
|
204
|
+
It compiles to `spec.yml` (`kivax-compile`), shows you the assigned REQ-IDs and the hash diff, and stops again. Approve, and `kivax-plan` explores your codebase, writes `plan.md` with concrete contracts, creates the branch, opens a draft PR, and stops.
|
|
205
|
+
|
|
206
|
+
```
|
|
207
|
+
You: Looks good — run through to the audit.
|
|
208
|
+
```
|
|
209
|
+
|
|
210
|
+
That's `kivax-run`: it chains `tdd` (red tests → green code, one REQ at a time, one commit per REQ) and `it`, both `auto`, and stops at the `audit` human gate with the traceability verdict and the reviewer's findings. Approve, and `kivax-retro` writes down what the cycle cost — the bug that took three attempts, the assumption that was wrong twice — as lessons the *next* feature is forced to answer for. You merge; Kivax never does.
|
|
211
|
+
|
|
212
|
+
### Everyday commands (things you say)
|
|
213
|
+
|
|
214
|
+
| You want to… | Ask for | Notes |
|
|
215
|
+
|---|---|---|
|
|
216
|
+
| Start a feature | `kivax-new <description>` | Creates `specs/NN-slug/` with its own spec. One active feature per branch. |
|
|
217
|
+
| Write/refine the spec | `kivax-spec <request>` | The only phase that interviews you at length. |
|
|
218
|
+
| Run several phases at once | `kivax-run` | Stops at the first human gate or exception, and tells you which. |
|
|
219
|
+
| Know where things stand | `kivax-status` | Current phase, REQs by status, coverage, stale hashes. |
|
|
220
|
+
| Change a requirement after the fact | `kivax-evolve <change>` | Selectively invalidates only the affected REQs — never everything. Works on any feature, including ones that shipped long ago. |
|
|
221
|
+
| Build/query the knowledge wiki | `kivax-wiki ingest \| query <question> \| lint` | Derived from the specs; the spec always wins. |
|
|
222
|
+
| Record what an iteration taught | `kivax-retro` | Runs after the audit. Writes the lessons store; later phases must answer for it. |
|
|
223
|
+
| Document legacy code before touching it | `kivax-spec` ("document the current behavior of X") | Retroactive spec mode — describes what the code *does*, not what it should do. |
|
|
224
|
+
|
|
225
|
+
Six more skills are reference material the specialists read rather than phases you invoke: `kivax-spec-writing`, `kivax-yml-spec`, `kivax-tdd-loop`, `kivax-wiki-schema`, `kivax-lessons-schema`, `kivax-tasks`.
|
|
226
|
+
|
|
227
|
+
**Vague ideas get researched first.** If you arrive with a problem that has no shape yet — or one whose answer depends on options nobody on the team has checked — the `spec` phase can bring in the **researcher** before the interview starts. It's the one agent that reaches the internet: it reads your principles, architecture, and code first so it only proposes things this project can actually do, then comes back with `specs/NN-slug/research.md` — two or more real options with their costs, concrete prior art, and every claim carrying a dated source URL. It writes no requirements; the spec-analyst uses the brief as the starting point of its interview, and you approve what makes it into the spec. It's optional and skipped by default when you already know what you want — the assistant asks rather than assuming.
|
|
228
|
+
|
|
229
|
+
> `kivax init` (terminal, project setup) is a different thing from `kivax-new` (chat, start a feature). The first is infrastructure and you run it yourself; the second is workflow.
|
|
230
|
+
|
|
231
|
+
### Artifacts you'll see
|
|
232
|
+
|
|
233
|
+
| File | Owner | Lifecycle |
|
|
234
|
+
|---|---|---|
|
|
235
|
+
| `specs/NN-slug/research.md` | researcher | Optional. Options, prior art, and cited sources behind a vague idea — input to the spec, never a requirement. |
|
|
236
|
+
| `specs/NN-slug/spec.md` | spec-analyst | That feature's narrative spec — the human-readable source. |
|
|
237
|
+
| `specs/NN-slug/spec.yml` | spec-compiler | That feature's canonical anchor. IDs are immutable; hashes drive invalidation. |
|
|
238
|
+
| `specs/NN-slug/plan.md` | tech-planner | Contracts, REQ→module→test mapping, implementation order for that feature. |
|
|
239
|
+
| `specs/wiki/` | wiki-curator | Optional compiled knowledge, one page per domain concept. |
|
|
240
|
+
| `specs/lessons/LSN-*.md` | knowledge-curator | What past iterations cost. Written by `retro`, enforced at the audit gate. |
|
|
241
|
+
| `.kivax/state.yml` | the CLI | Current phase and per-REQ status. The single source of truth across sessions. |
|
|
242
|
+
| `.kivax/traceability.lock.json` | trace-auditor | Hashes and REQ→tests from the last PASSING cycle. |
|
|
243
|
+
| `PRINCIPLES.md` / `ARCHITECTURE.md` | spec-analyst / tech-planner | Project-wide, opt-in. |
|
|
244
|
+
|
|
245
|
+
State lives in the repo, not in the assistant's context — you can close the session, come back tomorrow, and it picks up from `.kivax/state.yml`.
|
|
246
|
+
|
|
247
|
+
### Interrupted mid-agent
|
|
248
|
+
|
|
249
|
+
Knowing the phase isn't always enough. If the session dies while the tech-planner is halfway through exploring your modules, "phase: plan" tells the next session to start the plan — not to finish the one already half-written on disk. Re-running from scratch is worse than it sounds: an agent given the same prompt twice can produce a *different* plan, and you end up reconciling two.
|
|
250
|
+
|
|
251
|
+
So the long-running specialists — researcher, spec-analyst, tech-planner, test-writer, implementer, wiki-curator, knowledge-curator — write down their steps before working and mark them off as they go, via `kivax task`. The list lives in `.kivax/state.yml` beside the phase and the per-REQ status, and is archived and restored with its feature.
|
|
252
|
+
|
|
253
|
+
```bash
|
|
254
|
+
kivax task list
|
|
255
|
+
```
|
|
256
|
+
|
|
257
|
+
```
|
|
258
|
+
Phase 'spec' (01-cancel-booking):
|
|
259
|
+
[x] 1. Read PRINCIPLES.md and ARCHITECTURE.md <researcher>
|
|
260
|
+
[~] 2. Search primary sources for option A <researcher> (3 of 6 sources checked)
|
|
261
|
+
[ ] 3. Write research.md <researcher>
|
|
262
|
+
|
|
263
|
+
1/3 closed.
|
|
264
|
+
Resume at: 2. Search primary sources for option A <researcher>
|
|
265
|
+
```
|
|
266
|
+
|
|
267
|
+
You don't run this yourself in normal use: `kivax state show` ends with the same resume point, and the orchestrator reads it at the start of every session — it will tell you what was in flight and offer to continue rather than restart. The single-pass agents (spec-compiler, trace-auditor, reviewer) keep no list, because re-running them from scratch is already the right recovery.
|
|
268
|
+
|
|
269
|
+
These tasks are **not** requirements. A task is one agent's disposable working step; a REQ is the flow's contract, tracked separately and read by traceability. Nothing in the audit ever looks at a task.
|
|
270
|
+
|
|
271
|
+
### One spec per feature
|
|
272
|
+
|
|
273
|
+
Each feature gets its own directory, and it stays in the repo after the feature ships:
|
|
274
|
+
|
|
275
|
+
```
|
|
276
|
+
specs/
|
|
277
|
+
01-booking/ spec.md spec.yml plan.md
|
|
278
|
+
02-cancel-booking/ spec.md spec.yml plan.md
|
|
279
|
+
wiki/ (project-wide, spans features)
|
|
280
|
+
```
|
|
281
|
+
|
|
282
|
+
The directory number prefixes every id in that spec — `REQ-01-001`, `IT-02-003` — so ids are unique project-wide and a test tag resolves to exactly one requirement. Numbering restarts per feature: feature 02 has its own `REQ-02-001`.
|
|
283
|
+
|
|
284
|
+
**Old specs keep being enforced.** `kivax validate`, `kivax hash`, and `kivax trace` all operate on the union of every feature's spec. Edit the spec of something that merged three months ago and its hashes change, its tests are flagged as potentially stale, and the audit blocks until that change goes through `kivax-evolve` — a spec change always has to produce a code change. Only the phase workflow is scoped to one feature: the *active* one, one per git branch.
|
|
285
|
+
|
|
286
|
+
You rarely touch this yourself; `kivax-new` and `kivax-evolve` drive it. The commands behind them are `kivax feature new <slug>`, `kivax feature list`, `kivax feature show --json`, and `kivax feature switch <NN>` (to resume a feature that already shipped).
|
|
287
|
+
|
|
288
|
+
---
|
|
289
|
+
|
|
290
|
+
## Language
|
|
291
|
+
|
|
292
|
+
Two deliberately independent things:
|
|
293
|
+
|
|
294
|
+
- **The CLI (`kivax` and the `lib/` modules behind it) is always in English.** Not configurable — it's infrastructure, not content, which keeps it maintainable and easy to get help with.
|
|
295
|
+
- **The specs' content follows `spec_language`**, a free-form value you set during `kivax init` (or edit later in `.kivax/config.yml`). The spec-analyst writes titles, descriptions, and acceptance criteria in that language regardless of what language you speak to it in — so you can converse in whatever you like and still guarantee specs land in, say, Spanish, if that's your team's documentation language.
|
|
296
|
+
|
|
297
|
+
The agents and skills (the instructions the assistant reads) are written in English and don't change with `spec_language`. That doesn't affect what language the assistant replies to you in, which always follows the conversation.
|
|
298
|
+
|
|
299
|
+
One technical constraint that never changes: the **keys** in `spec.yml` (`given`, `when`, `then`, `requirements`, `priority`…) are fixed. They're the format the scripts read literally; translating them would break validation and traceability. Only the prose gets translated.
|
|
300
|
+
|
|
301
|
+
---
|
|
302
|
+
|
|
303
|
+
## Git: the flow is a gitflow feature branch
|
|
304
|
+
|
|
305
|
+
Every feature runs on its own branch and **ends as a pull request marked ready for review**. That pull request is the deliverable — Kivax never merges it.
|
|
306
|
+
|
|
307
|
+
```
|
|
308
|
+
develop ──┬─────────────────────────────────────────────► (you merge)
|
|
309
|
+
└── feature/01-booking ──[spec+plan]──[REQ commits]──[IT]──[lessons]──► PR ready
|
|
310
|
+
```
|
|
311
|
+
|
|
312
|
+
| Phase | What it does to git |
|
|
313
|
+
|---|---|
|
|
314
|
+
| `plan` | `git checkout -b feature/NN-slug origin/<base>`, commits spec+plan, **pushes**, opens the PR as a **draft** |
|
|
315
|
+
| `tdd` | one commit per green REQ (`feat(REQ-01-002): …`), pushes before the phase ends |
|
|
316
|
+
| `it` | commits the integration tests, pushes |
|
|
317
|
+
| `retro` | commits the lessons store, pushes |
|
|
318
|
+
| `audit` | checks the tree is clean and everything is pushed, then marks the PR **ready** and writes the reviewer's summary into its description |
|
|
319
|
+
|
|
320
|
+
**The base branch is gitflow's integration branch.** `kivax init` picks `develop` when the repo has one, and stores it as `git.base_branch`. It deliberately doesn't trust `origin/HEAD`: that points at the *published* branch, which on a gitflow repo is `main` — a feature PR against it would be targeting production. The branch name (`feature/`) is fixed, like the pipeline.
|
|
321
|
+
|
|
322
|
+
**Every phase pushes.** A commit that isn't pushed isn't in the pull request, and the pull request is the only thing a reviewer actually reads.
|
|
323
|
+
|
|
324
|
+
### Merges, releases, and hotfixes
|
|
325
|
+
|
|
326
|
+
These are **not** part of the flow. They live in the `kivax-git` skill, which runs **only when you ask for it by name** and confirms every irreversible step with you first:
|
|
327
|
+
|
|
328
|
+
| Ask for | What it does |
|
|
329
|
+
|---|---|
|
|
330
|
+
| merge | Checks the PR isn't draft, its checks are green, and it has an approving review — then merges on your confirmation |
|
|
331
|
+
| release | Opens a `develop → main` PR, and after it lands, tags and opens the back-merge |
|
|
332
|
+
| hotfix | Branches from `main`, and reminds you the fix still needs a spec, then opens PRs into **both** `main` and `develop` |
|
|
333
|
+
|
|
334
|
+
The assistant will never merge, tag, or deploy on its own initiative — not even when the audit passes. A passing audit is what makes a PR *reviewable*; it isn't a review.
|
|
335
|
+
|
|
336
|
+
---
|
|
337
|
+
|
|
338
|
+
## Project setup (principles and architecture)
|
|
339
|
+
|
|
340
|
+
After `kivax init`, one thing is left before your first feature. Open your assistant and ask it to set the project up — the **`kivax-setup`** skill. It writes two project-wide documents, once:
|
|
341
|
+
|
|
342
|
+
- **`PRINCIPLES.md`** — the project's non-negotiable engineering principles, ratified by interviewing you (the spec-analyst). It is **not** a living document: once ratified it changes only on an explicit request to amend it, never as a side effect of a feature.
|
|
343
|
+
- **`ARCHITECTURE.md`** — the system's actual technical shape (the tech-planner drafts it from the intended stack for a greenfield project, or reverse-engineers it from the existing codebase — decided by the `greenfield` flag), then kept current **incrementally**: every `kivax-plan` updates only the sections the feature actually affects.
|
|
344
|
+
|
|
345
|
+
These are **not phases**. They describe the project, not the thing you're building this week, so putting them at the head of every feature's pipeline would have meant answering a question about the repository in the wrong place — two steps in every feature's history that did nothing. They happen once, they're tracked by the files existing on disk, and `kivax state` never sees them.
|
|
346
|
+
|
|
347
|
+
`kivax feature new` refuses while either document is missing:
|
|
348
|
+
|
|
349
|
+
```
|
|
350
|
+
ERROR: this project hasn't been set up yet — PRINCIPLES.md, ARCHITECTURE.md are missing.
|
|
351
|
+
```
|
|
352
|
+
|
|
353
|
+
That's the whole enforcement: mandatory, but paid for once. `kivax doctor` reports it as a next step on a fresh project, and as a real problem if features already exist without them.
|
|
354
|
+
|
|
355
|
+
Every `kivax-plan` and `kivax-audit` also cross-checks the feature against `PRINCIPLES.md` when it exists. A conflict is a `PRINCIPLES-VIOLATION:` — always escalated to you, never auto-resolved, regardless of the gate.
|
|
356
|
+
|
|
357
|
+
---
|
|
358
|
+
|
|
359
|
+
## The lessons store (the `retro` phase)
|
|
360
|
+
|
|
361
|
+
`spec.yml` records what was built. The wiki records what it means. Neither records what it **cost** — which bug was rediscovered, which assumption was wrong twice, which fix had to be redone — and that's the knowledge a team actually loses between iterations. The `retro` phase runs last, after the audit passes, and writes it down.
|
|
362
|
+
|
|
363
|
+
The knowledge-curator doesn't reconstruct the cycle from memory. It reads the evidence the repo already holds: `.kivax/state.yml`'s history (a REQ that cycled `red → green → red`, one marked `invalidated`), the branch's fix-on-fix commits, the audit violations, the reviewer's repeated BLOCKING findings. One lesson per file:
|
|
364
|
+
|
|
365
|
+
```markdown
|
|
366
|
+
---
|
|
367
|
+
id: LSN-0007 # allocated by `kivax lessons new`, never by hand
|
|
368
|
+
title: Flyway migrations must run before the Spring test context boots
|
|
369
|
+
phases: [plan, tdd, it] # which phases get shown this lesson
|
|
370
|
+
paths: ["src/main/resources/db/**"] # empty = project-wide
|
|
371
|
+
origin: {feature: 03-cancel-booking, phase: it, evidence: ["commit 8f2a1c3"]}
|
|
372
|
+
seen_in: [03-cancel-booking, 05-refunds]
|
|
373
|
+
---
|
|
374
|
+
## Rule
|
|
375
|
+
Run migrations in the shared fixture's `@BeforeAll`, never per-test.
|
|
376
|
+
```
|
|
377
|
+
|
|
378
|
+
**This is not documentation — it binds.** `kivax-plan`, `kivax-tdd`, and `kivax-it` each run `kivax lessons relevant --phase <p>` *before* producing anything, and the plan has to answer for every applicable lesson under `## Lessons applied`:
|
|
379
|
+
|
|
380
|
+
```markdown
|
|
381
|
+
## Lessons applied
|
|
382
|
+
- LSN-0007 — migrations moved into the shared test fixture's @BeforeAll.
|
|
383
|
+
- LSN-0002 — not applicable: this feature adds no scheduled job.
|
|
384
|
+
```
|
|
385
|
+
|
|
386
|
+
`kivax lessons check` computes which lessons apply (the project-wide ones, plus the path-scoped ones whose globs match the branch diff or a path named in `plan.md`) and **fails when one isn't answered for**. The trace-auditor runs it as part of the audit gate. A lesson can be dismissed; it cannot be dismissed silently.
|
|
387
|
+
|
|
388
|
+
Three rules keep the store from rotting into noise:
|
|
389
|
+
|
|
390
|
+
- **Reinforce, don't duplicate.** The same problem hitting a second feature appends to `seen_in` and sharpens the rule — it never becomes a second lesson.
|
|
391
|
+
- **Retire, don't delete.** A lesson that stopped being true gets `status: retired` with a `superseded_by` or a `retired_reason`. Deleting the file loses the record that it was ever true.
|
|
392
|
+
- **Zero lessons is a valid cycle.** Every applicable lesson is read by every future planner, so each worthless entry buys inattention to the good ones. Padding the store is the one way to destroy it.
|
|
393
|
+
|
|
394
|
+
A lesson is **never** a substitute for a requirement. If what the retro found is unspecified *behavior*, it's a `GAP:` and it goes through `kivax-evolve` into the spec — the lessons store is not a back door around spec-first.
|
|
395
|
+
|
|
396
|
+
---
|
|
397
|
+
|
|
398
|
+
|
|
399
|
+
## Project files and the global store
|
|
400
|
+
|
|
401
|
+
`kivax init` copies agents, skills, and the orchestrator instructions into your project as real, ordinary, git-committed files. **Nothing in a project points back at the global store** — every file is yours to open and edit, including changing an agent's `model:` line. This also means Kivax updates never change a project's behavior on their own: pulling in changes is always an explicit step (`kivax upgrade`), reviewable with `git diff` before you commit.
|
|
402
|
+
|
|
403
|
+
The global store is the "upstream" those copies come from, and it ships inside the installed package — that's why `pipx upgrade kivax` updates the CLI and the store as a single artifact, with no way for the two to disagree about which version they are. `kivax version` prints where it landed.
|
|
404
|
+
|
|
405
|
+
```
|
|
406
|
+
<the installed package>/kivax/data/ (the global store — read-only, part of the install)
|
|
407
|
+
agents/<name>.md (canonical: description + tools + body — one file per
|
|
408
|
+
specialist, PLUS orchestrator.md, shared by every runtime)
|
|
409
|
+
runtime/skills/ (shared by all 6 runtimes — 6 reference skills +
|
|
410
|
+
14 phase-driver skills, e.g. kivax-spec/, kivax-plan/)
|
|
411
|
+
templates/ (spec, plan, research, lesson… seeds)
|
|
412
|
+
agent_runtimes.yml (per-runtime agent frontmatter recipe)
|
|
413
|
+
stack_profiles.yml (the stack catalog the init wizard offers)
|
|
414
|
+
templates/ (spec, plan, research, principles, architecture, state, PR…)
|
|
415
|
+
ci/ (sample CI gate workflow)
|
|
416
|
+
|
|
417
|
+
your-project/ (all committed to git, no exceptions)
|
|
418
|
+
.claude/agents/*.md # generated — commit them, but change them upstream, not here
|
|
419
|
+
.claude/skills/*/SKILL.md
|
|
420
|
+
.opencode/agent/*.md # if you use opencode
|
|
421
|
+
.opencode/skills/*/SKILL.md
|
|
422
|
+
.cursor/agents/*.md # if you use Cursor
|
|
423
|
+
.cursor/skills/*/SKILL.md
|
|
424
|
+
.github/agents/*.agent.md # if you use GitHub Copilot CLI
|
|
425
|
+
.github/skills/*/SKILL.md # if you use GitHub Copilot (VS Code and/or CLI)
|
|
426
|
+
.github/copilot-instructions.md # if you use GitHub Copilot in VS Code
|
|
427
|
+
.codex/skills/*/SKILL.md # if you use OpenAI Codex CLI
|
|
428
|
+
CLAUDE.md / AGENTS.md # same content, two filenames — Claude Code needs the former
|
|
429
|
+
PRINCIPLES.md # ratified once, rarely touched again
|
|
430
|
+
ARCHITECTURE.md # kept current via kivax-plan
|
|
431
|
+
.kivax/
|
|
432
|
+
config.yml # project config, yours, editable
|
|
433
|
+
state.yml # flow state (phase, REQs)
|
|
434
|
+
traceability.lock.json # traceability lock
|
|
435
|
+
templates/ # copy of the global templates
|
|
436
|
+
specs/ # your specs folder (or wherever you placed it)
|
|
437
|
+
01-booking/ # one directory per feature, each with its own spec
|
|
438
|
+
spec.md / spec.yml / plan.md
|
|
439
|
+
02-cancel-booking/
|
|
440
|
+
spec.md / spec.yml / plan.md
|
|
441
|
+
wiki/ # project-wide, spans features
|
|
442
|
+
lessons/ # LSN-NNNN-*.md — what past iterations cost
|
|
443
|
+
```
|
|
444
|
+
|
|
445
|
+
SKILL.md content is identical across every runtime — only the destination directory changes.
|
|
446
|
+
|
|
447
|
+
**Agent files are the one thing not copied verbatim.** Each specialist — and the orchestrator itself — has a single canonical source (the store's `agents/<name>.md`: description, tools, body, no runtime-specific frontmatter), and `kivax init`/`kivax upgrade` render it into every active runtime's own agent-file shape on the fly, per the recipe in the store's `agent_runtimes.yml`. Fixing an instruction once fixes it everywhere instead of needing the same edit repeated per tool.
|
|
448
|
+
|
|
449
|
+
The orchestrator's rendering is special in one way: besides landing as an ordinary agent file (`.claude/agents/orchestrator.md`, invokable explicitly on tools that support picking an agent), its frontmatter-stripped body is **also** what becomes `AGENTS.md` / `CLAUDE.md` / `.github/copilot-instructions.md` — the ambient context every runtime's default conversation reads. That's how the orchestrator is "the agent the human talks to" on tools without an agent picker.
|
|
450
|
+
|
|
451
|
+
### Choosing a model per agent
|
|
452
|
+
|
|
453
|
+
The agent files are generated, so you don't edit them to change a model — you say it once in `.kivax/config.yml` and Kivax bakes it into every runtime's file on the next `kivax init`/`kivax upgrade`:
|
|
454
|
+
|
|
455
|
+
```yaml
|
|
456
|
+
agents:
|
|
457
|
+
default: {model: sonnet} # applies to every agent below
|
|
458
|
+
orchestrator: {model: opus} # ...except the ones you name
|
|
459
|
+
tech-planner: {model: opus}
|
|
460
|
+
implementer: {model: sonnet}
|
|
461
|
+
```
|
|
462
|
+
|
|
463
|
+
The keys are agent names (`kivax doctor` rejects a typo). `default` is optional; omit the whole block and every agent inherits whatever model the assistant is already running. Values are passed through untouched — they're your assistant's vocabulary, not Kivax's, so use whatever spelling it expects (`opus`, `claude-opus-4-8`, `anthropic/claude-sonnet-4-5`…).
|
|
464
|
+
|
|
465
|
+
This lands where the runtime can actually read it: Claude Code and Cursor take a `model:` in the agent frontmatter, opencode takes one when set, and GitHub Copilot CLI has no such field — there, the CLI picks the model and the setting has no effect.
|
|
466
|
+
|
|
467
|
+
---
|
|
468
|
+
|
|
469
|
+
## Keeping in sync
|
|
470
|
+
|
|
471
|
+
### Pulling updates in: `kivax upgrade`
|
|
472
|
+
|
|
473
|
+
Run it inside a project. It re-materializes every file Kivax manages: agents and skills are rewritten from the global store, anything Kivax used to ship and no longer does is deleted, and files it doesn't manage are never touched.
|
|
474
|
+
|
|
475
|
+
There's no merge and no conflict, because there's nothing to reconcile — the agent and skill files are *generated* from the store plus your `config.yml`, so those two together are the whole truth about what they should contain. **A hand-edit to one of them will be overwritten.** Everything a project legitimately varies lives in `config.yml`, which `kivax upgrade` never rewrites.
|
|
476
|
+
|
|
477
|
+
`kivax upgrade --dry-run` prints exactly what it would add, update, and remove, without writing anything. This is the only thing that ever pulls from the global store into a project, and only when you run it.
|
|
478
|
+
|
|
479
|
+
## CLI reference
|
|
480
|
+
|
|
481
|
+
You'll rarely type these — the assistant runs most of them for you. The ones you own are `init`, `upgrade`, `doctor`, and `version`.
|
|
482
|
+
|
|
483
|
+
| Command | What it does |
|
|
484
|
+
|---|---|
|
|
485
|
+
| `kivax init [--force]` | Install/configure the current project (wizard), or report if already installed |
|
|
486
|
+
| `kivax upgrade [--dry-run]` | Re-copy agents, skills, and templates from the global store, pruning what it no longer ships |
|
|
487
|
+
| `kivax doctor` | Diagnose the current project's installation |
|
|
488
|
+
| `kivax version` | Version and location of the global store |
|
|
489
|
+
| `kivax feature <new\|list\|show\|switch>` | Feature lifecycle: create one, list them, resolve its paths (`show --json`), or make an existing one active |
|
|
490
|
+
| `kivax validate` | Validate every feature's `spec.yml`. Exit 1 if invalid |
|
|
491
|
+
| `kivax hash [--diff] [--json] [--feature NN]` | Current hashes across all features, or the diff against the lock. **Exit 2 = there is pending work, not an error** |
|
|
492
|
+
| `kivax trace [--report-only\|--update-lock\|--json]` | Traceability audit across every feature: coverage, freshness, orphans. Exit 1 if NOT PASSING |
|
|
493
|
+
| `kivax state <show\|set-phase\|set-req\|sync-reqs\|gate\|next>` | Phase and per-requirement status of the active feature |
|
|
494
|
+
| `kivax task <add\|list\|set\|next\|clear>` | Per-agent checklists for the active feature. `list` shows where to resume after an interruption |
|
|
495
|
+
| `kivax wiki <lint\|stale> [--strict] [--json]` | Wiki provenance checks |
|
|
496
|
+
| `kivax lessons <list\|show\|new\|relevant\|check\|lint>` | The lessons store. `relevant --phase <p>` is what a phase reads; `check` is what the audit enforces (exit 1 = an applicable lesson isn't answered for in `plan.md`) |
|
|
497
|
+
| `kivax specfirst [--json] [--base <branch>]` | Classify the branch diff into tests / kivax / legacy / production |
|
|
498
|
+
|
|
499
|
+
`--runtime` accepts `claude`, `opencode`, `cursor`, `vscode-copilot`, `copilot-cli`, or `codex`.
|
|
500
|
+
|
|
501
|
+
---
|
|
502
|
+
|
|
503
|
+
## CI
|
|
504
|
+
|
|
505
|
+
The store's `ci/github-actions-kivax.yml` (in this repo: [src/kivax/data/ci/](src/kivax/data/ci/)) is a sample CI gate: it validates the spec and runs `kivax trace`. Installing Kivax on the runner is one line — `pip install kivax` — and the sample is copy-pasteable as-is. Pin the version (`kivax==2.1.0`) if you'd rather a release never changes what your gate accepts without you choosing it.
|
|
506
|
+
|
|
507
|
+
---
|
|
508
|
+
|
|
509
|
+
## Troubleshooting
|
|
510
|
+
|
|
511
|
+
**`kivax: command not found` after installing.**
|
|
512
|
+
The installer only links into a directory *already on your PATH*. Add the store's bin directory to your shell rc and open a new terminal:
|
|
513
|
+
|
|
514
|
+
```bash
|
|
515
|
+
export PATH="$HOME/.kivax/bin:$PATH"
|
|
516
|
+
```
|
|
517
|
+
|
|
518
|
+
**`ERROR: can't find the Kivax global store at ...`**
|
|
519
|
+
The store ships with the package, so this almost always means `KIVAX_HOME` is set (it overrides the packaged store) and points somewhere that isn't one. Unset it. If it isn't set, the install is damaged — `pipx install --force kivax`.
|
|
520
|
+
|
|
521
|
+
**`ERROR: PyYAML is missing`**
|
|
522
|
+
Shouldn't happen: pip installs it as a dependency. It means the environment was modified after install — `pipx install --force kivax` rebuilds it.
|
|
523
|
+
|
|
524
|
+
**`ERROR: .kivax/config.yml does not exist. Run 'kivax init' first.`**
|
|
525
|
+
You're not at the project root, or the project was never initialized. The scripts walk up parent directories looking for `.kivax/config.yml`, so this means it isn't anywhere above you.
|
|
526
|
+
|
|
527
|
+
**`kivax doctor` says my config's `version` is wrong and lists keys to delete.**
|
|
528
|
+
The project was installed by an older Kivax, when the pipeline, the gates, and most paths were configurable. They aren't any more — Kivax owns the flow. Nothing is broken: those keys are simply ignored. Delete the ones doctor names, set `version: 3`, and the message goes away.
|
|
529
|
+
|
|
530
|
+
**An edit I made to an agent or a skill file disappeared.**
|
|
531
|
+
`kivax upgrade` rewrites those files from the global store — they're generated, not yours to edit.
|
|
532
|
+
|
|
533
|
+
- **To change which model an agent runs on**, use the `agents:` block in `.kivax/config.yml`. That's the supported knob, and upgrade never touches it.
|
|
534
|
+
- **To change what an agent *does***, open an issue or a PR. The store lives inside the installed package and is replaced wholesale on every upgrade, so a local edit to it wouldn't survive either — behavior belongs upstream, where everyone gets the fix.
|
|
535
|
+
- **If you genuinely need a divergent store** (a fork, an internal variant), point `KIVAX_HOME` at your own copy of `src/kivax/data`. Kivax will read that instead of the packaged one. You then own keeping it current — which is exactly the maintenance burden the packaged store exists to avoid, so weigh it before choosing this.
|
|
536
|
+
|
|
537
|
+
**`ERROR running git diff against 'main'` from `kivax specfirst` or the audit.**
|
|
538
|
+
The configured base branch doesn't exist locally. Fix `git.base_branch` in `.kivax/config.yml`, or fetch the branch.
|
|
539
|
+
|
|
540
|
+
**Every new requirement shows as uncovered even though the tests exist.**
|
|
541
|
+
The project's `id_tag_regexes` in `.kivax/config.yml` predate the per-feature id form, so tags like `REQ-02-001` don't match. `kivax doctor` detects exactly this and prints the replacement pattern; `kivax upgrade` warns about it too. Kivax never rewrites `config.yml` for you.
|
|
542
|
+
|
|
543
|
+
**`kivax trace` is NOT PASSING because of a feature I'm not even working on.**
|
|
544
|
+
That's the anchor doing its job: someone edited that feature's spec, so its hashes no longer match the lock and its tests may be stale. `kivax feature switch <NN>`, then run the `kivax-evolve` skill for it.
|
|
545
|
+
|
|
546
|
+
**`ERROR: refusing to write the lock`.**
|
|
547
|
+
`kivax trace --update-lock` rewrites the lock for every feature at once and refused because the rebuild didn't account for ids the lock already held — either a feature lost its `spec.yml` (recompile it) or a requirement was deleted outright instead of being marked `status: deprecated`.
|
|
548
|
+
|
|
549
|
+
**The audit says a file is a spec-first violation but it's pre-existing code.**
|
|
550
|
+
Add it to `legacy_globs` in `.kivax/config.yml` — and remove it again once you migrate that zone with a retroactive spec and tests.
|
|
551
|
+
|
|
552
|
+
**Windows: `kivax` isn't recognized.**
|
|
553
|
+
The installer prints the folder to add to your PATH. From PowerShell, add `%USERPROFILE%\.kivax\bin`, then open a new terminal.
|
|
554
|
+
|
|
555
|
+
---
|
|
556
|
+
|
|
557
|
+
## Updating or uninstalling
|
|
558
|
+
|
|
559
|
+
**Update Kivax:** `pipx upgrade kivax`. This does **not** touch any project by itself — run `kivax upgrade` inside each project you want to bring current.
|
|
560
|
+
|
|
561
|
+
**Uninstall from a project:** delete `.claude/`, `.opencode/`, `.cursor/`, `.codex/`, `CLAUDE.md`, `AGENTS.md`, and `.kivax/`. For `.github/`, don't delete the whole directory — it commonly holds unrelated CI workflows and issue templates — remove only Kivax's own paths: `.github/agents/`, `.github/skills/`, and `.github/copilot-instructions.md`. You lose the state and the lock if you hadn't committed them; since everything here is a normal file, `git log` has your history regardless.
|
|
562
|
+
|
|
563
|
+
**Uninstall from the system:** `pipx uninstall kivax`. If you ever installed a pre-2.1 version from a clone, also `rm -rf ~/.kivax ~/.local/bin/kivax`.
|
|
564
|
+
|
|
565
|
+
---
|
|
566
|
+
|
|
567
|
+
## Scope and limitations
|
|
568
|
+
|
|
569
|
+
Kivax's traceability model — spec hash ↔ tests ↔ code, verified against one git diff — **assumes a single git repository per installation**. It works well for a single repo and for monorepos (multiple stacks in one repo, via `stack.profiles[*].root`), but it does not span multiple independent repositories: a feature touching a separate frontend and backend repo needs a spec (and a `kivax init`) in each, with no built-in way to link their REQs together.
|
|
570
|
+
|
|
571
|
+
The flow drives **one active feature at a time per working tree** — `.kivax/state.yml` names a single active feature. That isn't a limit on how many features a project has (they accumulate, each with its own spec), but on how many you advance simultaneously in one checkout: git branches supply the isolation, one active feature per branch. Two branches cut from the same commit can both allocate the same feature number; `kivax validate` and `kivax doctor` treat a duplicated number as a hard error, and the fix is to renumber the branch that hasn't merged yet — its tests aren't on the base branch, so rewriting its ids and tags is still local and safe.
|
|
572
|
+
|
|
573
|
+
## Repository layout (this repo)
|
|
574
|
+
|
|
575
|
+
```
|
|
576
|
+
pyproject.toml Packaging: console script, dependencies, package data
|
|
577
|
+
assets/ Logo and other repo media
|
|
578
|
+
src/kivax/
|
|
579
|
+
cli.py The CLI — every 'kivax <cmd>' entry point
|
|
580
|
+
lib/ kivax_*.py modules the CLI dispatches to (python -m kivax.lib.X),
|
|
581
|
+
plus kivax_agents.py, the agent renderer
|
|
582
|
+
data/ THE GLOBAL STORE — shipped inside the wheel, copied into projects
|
|
583
|
+
agents/ One canonical file per specialist (description + tools + body, no
|
|
584
|
+
runtime-specific frontmatter), PLUS orchestrator.md — the primary
|
|
585
|
+
coordinator, rendered like every other agent and additionally
|
|
586
|
+
stripped of frontmatter to produce AGENTS.md / CLAUDE.md /
|
|
587
|
+
copilot-instructions.md. Nothing here is copied verbatim.
|
|
588
|
+
runtime/skills/ 6 reference skills + 14 phase-driver skills, shared by all 6
|
|
589
|
+
runtimes (just placed in each one's own skills directory)
|
|
590
|
+
templates/ Starting scaffolds (spec, plan, research, principles, architecture,
|
|
591
|
+
lesson, state, PR)
|
|
592
|
+
ci/ Sample CI gate workflow
|
|
593
|
+
stack_profiles.yml The stack catalog the init wizard offers
|
|
594
|
+
agent_runtimes.yml Per-runtime agent frontmatter recipe
|
|
595
|
+
VERSION Single source of truth: the distribution version and what
|
|
596
|
+
'kivax version' reports
|
|
597
|
+
```
|
|
598
|
+
|
|
599
|
+
## Contributing
|
|
600
|
+
|
|
601
|
+
Issues and pull requests are welcome. [CONTRIBUTING.md](CONTRIBUTING.md) covers running the test suite, how the repository is laid out, and the conventions that aren't obvious from the code — chiefly that agents and skills are documentation the assistant *executes*, so they change alongside the CLI.
|
|
602
|
+
|
|
603
|
+
```bash
|
|
604
|
+
pytest tests # unit + integration + e2e
|
|
605
|
+
pytest tests --cov --cov-config=.coveragerc --cov-report=term-missing # coverage gate (>= 90%)
|
|
606
|
+
ruff check . # lint
|
|
607
|
+
```
|
|
608
|
+
|
|
609
|
+
## License
|
|
610
|
+
|
|
611
|
+
[MIT](LICENSE).
|