feat: scaffold redsen-lean-harness v0.1.0

Recovered from crashed session (Node OOM). Repo contains full P0-P6
scaffold: plugin.json/marketplace.json, AGENTS.md, ADRs 0001-0006,
lh CLI (init/index/graph/lane/run/memory/host/report/doctor), 10
.github/agents, 12 CLI skills, instructions, context7 mcp.json, and
unit/e2e test suite.

Fixed: run.mjs read --in-tokens/--out-tokens but tests and CLI docs
use --input-tokens/--output-tokens, so telemetry totals were always 0.
Now accepts both forms.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
2026-09-09 22:44:15 +02:00
co-authored by Copilot
commit 383129f571
79 changed files with 7855 additions and 0 deletions
@@ -0,0 +1,25 @@
---
applyTo: '**'
description: Mandatory Context7 usage for external library, framework, SDK, API, CLI, and cloud-service work.
---
# Context7 Rules
1. Use Context7 before using any external library, framework, SDK, API, CLI, or cloud service.
2. Call `resolve-library-id` first.
3. Call `query-docs` with the resolved id second.
4. Base implementation on the returned docs.
5. Cite the library id or doc source in notes when it affects decisions.
6. Read the API key only from the `CONTEXT7_API_KEY` environment variable.
7. Never write the API key to any file.
8. Never put the API key in `.github/mcp.json`.
9. Never paste the API key into prompts, logs, memory, or telemetry.
10. If `CONTEXT7_API_KEY` is missing, stop library work.
11. Tell the user exactly:
```bash
export CONTEXT7_API_KEY='<your-context7-api-key>'
```
12. Resume library work only after the environment variable exists.
13. Continue non-library work when it does not depend on external docs.
@@ -0,0 +1,51 @@
---
applyTo: '**'
description: Always-on lean harness behavior, token discipline, style, self-documenting rules, and scope guardrails.
---
# Lean Harness Rules
## Token discipline
1. Prefer `lh index --budget <N>` over raw tree reads.
2. Prefer `lh graph --brief` over verbose diagnostics.
3. Load only `.agents/memory/INDEX.md` by default.
4. Pull memory shards only on demand with `lh memory get`.
5. Return summaries, tables, and paths instead of file dumps.
6. Keep skill bodies short. Use agents and `lh` commands for detail.
## Imperative style
1. Write commands as actions.
2. Use short lines.
3. Avoid motivational prose.
4. Avoid generic LLM advice.
5. State inputs, outputs, gates, and stop conditions.
## Self-documenting work
1. Write decisions to `.agents/specs/<slug>/decisions.md`.
2. Write specs to `.agents/specs/<slug>/spec.md`.
3. Write DAGs to `.agents/specs/<slug>/plan.dag.json`.
4. Write run events to `.agents/runs/<id>/events.ndjson` through `lh run event`.
5. Write journals to `.agents/runs/<id>/journal.md`.
6. Keep ADRs inside `.agents/architecture.md`.
7. Keep durable conventions in `.agents/conventions.md`.
## Scope rule
1. Respect lane scope globs exactly.
2. Create write lanes with `lh lane create` before editing.
3. Work inside the assigned worktree for write lanes.
4. Never create files outside the lane scope.
5. Stop and escalate when required scope is missing.
6. Run `lh graph` before claiming done.
## Pipeline rule
1. Design before plan.
2. Require user gate after design.
3. Plan before build unless fast track applies.
4. Run Ralph loop for every write lane.
5. Merge lanes sequentially.
6. Run one full verify after integration.
@@ -0,0 +1,37 @@
---
applyTo: '**'
description: Rules for reading, writing, compacting, and protecting lean harness memory shards.
---
# Memory Rules
## Read memory
1. Load `.agents/memory/INDEX.md` by default.
2. Do not load every shard at startup.
3. Use `lh memory get --shard <name>` only when needed.
4. Prefer compact shards over raw history.
## Write memory
1. Use `lh memory put --shard failures` for recurring failures and fixes.
2. Use `lh memory put --shard corrections` for user corrections and changed assumptions.
3. Use `lh memory put --shard insights` for reusable design or codebase facts.
4. Use `lh memory put --shard conventions` for durable project rules.
5. Use `lh memory put --shard quirks` for environment or tool behavior.
6. Keep entries short, dated, and source-linked.
7. Record what happened, why it matters, and where it applies.
## Protect secrets
1. Never write secrets to memory.
2. Never write tokens, keys, passwords, cookies, private keys, or credentials.
3. Run `lh memory scan` before saving risky content.
4. Redact sensitive values at source.
5. Stop and ask for remediation if a secret is already present.
## Compact memory
1. Use `lh memory compact` when shards grow noisy.
2. Preserve decisions, fixes, conventions, and source paths.
3. Drop duplicate logs and stale speculation.