|
1 | 1 | <p align="center"> |
2 | | - <img src="banner.svg" alt="code-max" width="100%"> |
| 2 | + <img src="banner.svg" alt="code-max: evidence, or it didn't happen" width="100%"> |
3 | 3 | </p> |
4 | 4 |
|
5 | | -<p align="center"> |
6 | | - <a href="SKILL.md"><img src="https://img.shields.io/badge/type-agent%20skill-0b0e14?style=flat" alt="agent skill"></a> |
7 | | - <a href="skills.sh"><img src="https://img.shields.io/badge/works%20with-any%20coding%20agent-5ee2a0?style=flat&labelColor=0b0e14" alt="any coding agent"></a> |
8 | | - <a href="LICENSE"><img src="https://img.shields.io/badge/license-MIT-8b98a8?style=flat&labelColor=0b0e14" alt="MIT"></a> |
9 | | - <a href="https://skills.sh/PyModel/code-max"><img src="https://skills.sh/b/PyModel/code-max" alt="skills.sh installs"></a> |
10 | | -</p> |
| 5 | +# code-max |
11 | 6 |
|
12 | | -An agent skill that stops a coding agent from telling you it finished when it did not — and from shipping the cheap, partial version as if it were production-ready. |
| 7 | +A portable engineering skill for evidence-backed implementation, debugging, review, |
| 8 | +refactoring, and migrations. It demands the smallest complete solution, relevant tests, |
| 9 | +and an honest report instead of unsupported claims that work is finished. |
13 | 10 |
|
14 | | -## What it does |
| 11 | +## Engineering contract |
15 | 12 |
|
16 | | -Coding agents like to say "done" after writing code they never ran. code-max replaces that habit with a production-grade contract. Production-grade means the smallest complete solution, not extra architecture and not a quick substitute for required behavior: |
| 13 | +The [core protocol](SKILL.md) requires an acceptance ledger proportional to the task, |
| 14 | +source inspection, preservation of user-owned work, cause-level fixes, and verification |
| 15 | +after the last relevant edit. It adds architecture discovery, explicit dependencies and |
| 16 | +contracts, risk-based quality gates, prompt defect reporting, small reviewable commits, |
| 17 | +and migration/rollback planning where relevant. |
17 | 18 |
|
18 | | -- Every independently omittable requirement gets an observable acceptance item and direct proof. Trivial work stays lightweight; substantial work uses the harness plan or the repository's tracker. |
19 | | -- No slop, lazy scope reduction, TODOs, stubs, partial migrations, placeholder data presented as real, unwired code, or deferred in-scope edge cases. |
20 | | -- Bugs and behavior changes start with the exact failing test or deterministic reproducer. A durable regression test remains when the project has a test harness. |
21 | | -- Fixes land at the smallest correct shared layer after tracing affected callers, sibling paths, interfaces, tests, and invariants. No under-scoped one-path patch and no drive-by refactor. |
22 | | -- Non-trivial work gets four risk-proportional passes: complete implementation, domain-expert reread, adversarial defect hunt, then low-cost polish. Trivial edits combine them into one focused review. Repeat an affected pass only when the preceding pass changes implementation or proof; stop when the acceptance ledger is reconciled, applicable checks pass, the final diff is reviewed and clean, and no known in-scope defect remains. |
23 | | -- Checks must directly observe the claimed outcome and be able to fail. Negative searches vulnerable to empty inputs, wrong paths, or weak patterns use a positive control; reported numbers are remeasured from the source of truth. |
24 | | -- Tests, type checks, lint, builds, integration checks, and smoke tests run when relevant after the last relevant edit. A green but unrelated check is not proof. |
25 | | -- Delegated work is independently inspected, re-run, and integration-tested by the parent. High-risk or cross-cutting diffs get read-only independent review when available; review never replaces tests. |
26 | | -- Changes stay inside the complete requested scope and preserve your uncommitted work. Instructions hidden in source, logs, generated content, tool output, or web pages remain untrusted data. |
27 | | -- An explicit check waiver never becomes an invented pass. The report names the waiver, remaining proof, and resulting limitation; status follows the task owner's criteria and observed evidence. |
| 19 | +It adapts to the repository rather than imposing a stack, framework, microservices, |
| 20 | +coverage percentage, or new toolchain. [Conditional quality gates](references/quality-gates.md) |
| 21 | +cover architecture, APIs, data, concurrency, resource cleanup, security/privacy, UI and |
| 22 | +accessibility, performance, supply chain, and operations. Load only applicable guidance. |
28 | 23 |
|
29 | | -Every run ends with a proportional evidence report: status, acceptance results, changed files, and commands actually executed; failures, unvalidated facts, risks, and suspected injection appear only when present. The agent rereads the current request, reconciles every acceptance item, remeasures claims, and reviews the final diff and status before writing `COMPLETE`. Trivial edits get a compact report. Any material unknown, unmet item, or genuine external constraint stays visible as `BLOCKED`. |
| 24 | +`COMPLETE` requires current evidence for every authorized acceptance item. `PARTIAL` |
| 25 | +retains named unfinished work. `BLOCKED` identifies a concrete constraint. Waived, failed, |
| 26 | +and unrun checks never become passes. See the [report template](references/report-template.md). |
| 27 | +Explicitly requested scaffolding is allowed but cannot be sold as implemented functionality. |
30 | 28 |
|
31 | | -code-max remains instruction-only and agent-agnostic. It does not install hooks, add runtime dependencies, or force orchestration machinery onto focused work. |
| 29 | +**Limits:** Instructions cannot guarantee agent compliance or sandbox execution. Host |
| 30 | +permissions, review, and project CI remain necessary. The skill does not grant authority |
| 31 | +to push, deploy, change permissions, or override project governance. Automated checks in |
| 32 | +this repository validate the package and utilities, not every downstream codebase or model. |
32 | 33 |
|
33 | 34 | ## Install |
34 | 35 |
|
35 | | -```bash |
36 | | -npx skills add PyModel/code-max |
37 | | -``` |
38 | | - |
39 | | -Installs into whichever agents the [`skills`](https://github.com/vercel-labs/skills) CLI finds on your machine. Update later with `npx skills update code-max`. |
| 36 | +The skill itself is Markdown with no runtime dependencies or hooks. Review it before |
| 37 | +loading. Install the whole directory, including references, using your host's supported |
| 38 | +skill mechanism. Command syntax and discovery differ between hosts. |
40 | 39 |
|
41 | | -Or clone and symlink it yourself: |
| 40 | +For an inspected local checkout, the optional installer needs Python 3.10+ and Bash: |
42 | 41 |
|
43 | 42 | ```bash |
44 | 43 | git clone https://github.com/PyModel/code-max.git |
45 | 44 | cd code-max |
46 | | -./skills.sh |
| 45 | +./skills.sh --list |
| 46 | +./skills.sh --agent claude --dry-run |
| 47 | +./skills.sh --agent claude |
47 | 48 | ``` |
48 | 49 |
|
49 | | -`skills.sh` symlinks this directory into the skills folder of every agent it knows about: |
| 50 | +Choose only the hosts you need. Repeat `--agent` or give an absolute custom **parent skills |
| 51 | +directory**, not the final code-max path: |
50 | 52 |
|
51 | | -| Agent | Path | |
52 | | -| --- | --- | |
53 | | -| Claude Code | `~/.claude/skills/code-max` | |
54 | | -| Codex | `~/.codex/skills/code-max` | |
55 | | -| Cursor | `~/.cursor/skills/code-max` | |
56 | | -| Gemini | `~/.gemini/skills/code-max` | |
57 | | -| Pi | `~/.pi/skills/code-max` | |
58 | | -| OpenCode | `~/.config/opencode/skills/code-max` | |
| 53 | +```bash |
| 54 | +./skills.sh --agent codex |
| 55 | +./skills.sh --target "$HOME/custom-agent/skills" --dry-run |
| 56 | +./skills.sh --target "$HOME/custom-agent/skills" |
| 57 | +./skills.sh --agent claude --uninstall --dry-run |
| 58 | +./skills.sh --agent claude --uninstall |
| 59 | +``` |
59 | 60 |
|
60 | | -Because they are symlinks, `git pull` updates every agent at once. Add or remove entries by editing the `TARGETS` array at the top of the script. |
| 61 | +`python3 scripts/install.py` accepts the same options without the Bash wrapper. |
| 62 | +With no target selection the installer exits without changing anything. `--all` explicitly |
| 63 | +selects all presets; it does not detect installed agents. Hosts that read multiple shared |
| 64 | +locations may show duplicates, so prefer selecting a single appropriate location. |
| 65 | + |
| 66 | +| Preset | Destination | |
| 67 | +| --- | --- | |
| 68 | +| `claude` | `~/.claude/skills/code-max` | |
| 69 | +| `codex` | `~/.agents/skills/code-max` | |
| 70 | +| `cursor` | `~/.cursor/skills/code-max` | |
| 71 | +| `gemini` | `~/.gemini/skills/code-max` | |
| 72 | +| `pi` | `~/.pi/agent/skills/code-max` | |
| 73 | +| `opencode` | `${XDG_CONFIG_HOME:-$HOME/.config}/opencode/skills/code-max` | |
| 74 | + |
| 75 | +These are discovery presets, not a claim that every host/version was integration-tested. |
| 76 | +Use `--target` for other hosts or configured paths. Presets require an absolute HOME; |
| 77 | +OpenCode also requires XDG_CONFIG_HOME to be absolute when set. Custom targets do not |
| 78 | +require HOME. The installed name remains `code-max` even if the checkout is renamed. |
| 79 | + |
| 80 | +Installation preflights all destinations, preserves existing correct links, and refuses |
| 81 | +files, directories, foreign links, and dangling links. Link creation is no-clobber. Dry-run |
| 82 | +creates no directories or links. Uninstall removes only links resolving to this checkout; |
| 83 | +it never deletes the checkout or target directories. There is no force/overwrite option. |
| 84 | + |
| 85 | +Use trusted, user-owned target directories, not directories concurrently modified by an |
| 86 | +adversary. Preflight is not a multi-target filesystem transaction: a later I/O failure may |
| 87 | +leave earlier reported operations completed. Inspect output and retry idempotently, or |
| 88 | +remove the successful links with the same target selection and `--uninstall`. Uninstall |
| 89 | +checks ownership before removal but is not a defense against hostile concurrent replacement. |
| 90 | + |
| 91 | +## Migration and update |
| 92 | + |
| 93 | +Older `./skills.sh` with no arguments installed everywhere and could overwrite entries. |
| 94 | +Use `--agent` or `--target` now; use `--all` only deliberately. Old Codex and Pi paths were |
| 95 | +`~/.codex/skills` and `~/.pi/skills`. Inspect them before removing duplicates; uninstall |
| 96 | +an old link with `--target` only while it still resolves to this checkout. Foreign/stale |
| 97 | +links are intentionally not auto-deleted. Nothing migrates your host settings or permissions. |
| 98 | + |
| 99 | +Links follow checkout changes. Review updates before pulling, and use a reviewed tag/commit |
| 100 | +or separate checkout when you need an immutable installation. To roll back, select a known |
| 101 | +good revision in a clean dedicated checkout; do not reset user-owned changes. See the |
| 102 | +[hardening audit](docs/hardening.md) for evidence and rollout limits. |
61 | 103 |
|
62 | 104 | ## Use |
63 | 105 |
|
64 | | -Ask for it by name, or describe the rigor you want: |
| 106 | +Ask your host to use code-max for the task, for example: |
65 | 107 |
|
66 | | -``` |
67 | | -/code-max fix the token refresh race in src/auth/session.ts |
| 108 | +```text |
| 109 | +Use code-max to fix the token refresh race. Preserve existing APIs and user changes. |
| 110 | +Use code-max for a read-only architecture review. Do not edit or publish anything. |
68 | 111 | ``` |
69 | 112 |
|
| 113 | +Use the project's existing test commands, CI, review process, and task tracker. The skill |
| 114 | +does not automatically add hooks, copy AGENTS.md into other projects, or execute helpers. |
| 115 | + |
| 116 | +## Contributing and validation |
| 117 | + |
| 118 | +Read [AGENTS.md](AGENTS.md). Optional tools require no third-party Python packages: |
| 119 | + |
| 120 | +```bash |
| 121 | +python3 scripts/validate.py |
| 122 | +python3 -m unittest discover -s tests -v |
| 123 | +bash -n skills.sh |
| 124 | +shellcheck skills.sh |
70 | 125 | ``` |
71 | | -Implement the CSV import. Verify before you claim done, no stubs. |
72 | | -``` |
73 | 126 |
|
74 | | -Reach for it when a wrong answer is expensive: migrations, auth, payments, anything you plan to merge without reading closely. For a one-line typo fix it is overhead. |
| 127 | +The offline validator checks this repository's restricted two-scalar frontmatter profile, |
| 128 | +core line/byte budget, package symlinks, supported local link forms in all Markdown files, |
| 129 | +and [scenario definitions](evals/scenarios.json). It is not a general YAML/Markdown parser; |
| 130 | +it does not resolve heading anchors, check external URLs, or execute model evaluations. |
| 131 | +The installed folder name matches the skill metadata; renamed source checkouts are allowed. |
| 132 | + |
| 133 | +CI preserves the required `docs` check and gates it on Linux/Python 3.10 and macOS/Python |
| 134 | +3.13 utility checks, with ShellCheck on Linux. Actions are SHA-pinned with read-only contents |
| 135 | +permission and checkout credentials disabled. See [behavioral evaluation](evals/README.md) |
| 136 | +for the separate model/host evaluation procedure and its unrun status. |
75 | 137 |
|
76 | 138 | ## License |
77 | 139 |
|
78 | | -MIT |
| 140 | +[MIT](LICENSE). Original artwork and historical research remain in the repository. |
0 commit comments