ralphctl 0.26.0 → 0.27.0

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.
Files changed (42) hide show
  1. package/README.md +10 -4
  2. package/THIRD-PARTY-NOTICES.md +65 -2
  3. package/dist/agent-definitions/ralphctl-generator.md +3 -2
  4. package/dist/{cli-P7D6G5NI.mjs → cli-EYDXERW6.mjs} +4962 -4174
  5. package/dist/cli.mjs +1 -1
  6. package/dist/manifest.json +16 -3
  7. package/dist/prompts/_partials/autonomous-operation.md +18 -7
  8. package/dist/prompts/_partials/conventions-agents-md.md +2 -2
  9. package/dist/prompts/_partials/decisions.md +0 -1
  10. package/dist/prompts/_partials/evaluator-failure-modes.md +8 -5
  11. package/dist/prompts/_partials/evaluator-grading-rules.md +6 -5
  12. package/dist/prompts/_partials/one-shot-operation.md +6 -0
  13. package/dist/prompts/apply-feedback/template.md +5 -4
  14. package/dist/prompts/create-pr/template.md +10 -8
  15. package/dist/prompts/detect-scripts/template.md +7 -4
  16. package/dist/prompts/detect-skills/template.md +2 -0
  17. package/dist/prompts/evaluate/template.md +4 -2
  18. package/dist/prompts/evaluate-continuation/template.md +1 -1
  19. package/dist/prompts/ideate/template.md +2 -3
  20. package/dist/prompts/implement/template.md +16 -13
  21. package/dist/prompts/plan/template.md +3 -4
  22. package/dist/prompts/readiness/template.md +6 -4
  23. package/dist/prompts/refine/template.md +3 -6
  24. package/dist/skills/ralphctl-api-and-interface-design/SKILL.md +117 -0
  25. package/dist/skills/ralphctl-code-review-and-quality/SKILL.md +119 -8
  26. package/dist/skills/ralphctl-code-simplification/SKILL.md +100 -0
  27. package/dist/skills/ralphctl-codebase-design/SKILL.md +82 -0
  28. package/dist/skills/ralphctl-debugging-and-error-recovery/SKILL.md +23 -5
  29. package/dist/skills/ralphctl-deprecation-and-migration/SKILL.md +106 -0
  30. package/dist/skills/ralphctl-frontend-ui-engineering/SKILL.md +94 -0
  31. package/dist/skills/ralphctl-humanizer/SKILL.md +137 -0
  32. package/dist/skills/ralphctl-idea-refinement/SKILL.md +2 -0
  33. package/dist/skills/ralphctl-iterative-review/SKILL.md +10 -4
  34. package/dist/skills/ralphctl-observability-and-instrumentation/SKILL.md +104 -0
  35. package/dist/skills/ralphctl-performance-optimization/SKILL.md +123 -0
  36. package/dist/skills/ralphctl-ponytail/SKILL.md +38 -28
  37. package/dist/skills/ralphctl-security-and-hardening/SKILL.md +259 -0
  38. package/dist/skills/ralphctl-source-driven-development/SKILL.md +103 -0
  39. package/dist/skills/ralphctl-spec-driven-development/SKILL.md +148 -0
  40. package/dist/skills/ralphctl-test-driven-development/SKILL.md +29 -2
  41. package/dist/skills/ralphctl-writing-for-agents/SKILL.md +113 -0
  42. package/package.json +10 -10
@@ -0,0 +1,113 @@
1
+ ---
2
+ name: ralphctl-writing-for-agents
3
+ description: How to write documents an AI agent consumes — project context files (AGENTS.md, CLAUDE.md, and similar), skills, task specs, and requirements. Covers trigger-worded pointers, the cost of always-loaded context, steps that end on checkable completion criteria, leading words, positive phrasing over prohibitions, and pruning restatements, no-ops, and stale lines. Use when drafting or editing any of those documents.
4
+ license: MIT
5
+ ---
6
+
7
+ # Writing for Agents
8
+
9
+ > Adapted from [mattpocock/skills — "Writing for Agents"](https://github.com/mattpocock/skills) (MIT).
10
+ > Adapted for ralphctl's harness contract.
11
+
12
+ A reference for writing any document an agent consumes: a project context file, a skill, a task spec, a
13
+ set of requirements. The packaging differs; the writing does not. The same levers make each one
14
+ predictable — the agent takes the same _process_ every run, rather than producing the same output.
15
+
16
+ The session's prompt still owns the output: its length targets, required sections, and what-to-leave-out
17
+ rules win over anything here.
18
+
19
+ ## When this applies
20
+
21
+ - **Readiness** — the context-file proposal. Every line is loaded into every future session, so each one
22
+ must change behaviour versus the default. Point at what the environment already states instead of
23
+ restating it, but keep every exact command the prompt asks for (build and test lines, setup and verify
24
+ skill bodies).
25
+ - **Refine** — the requirements are read by the planner and every implementing session. Give each
26
+ criterion a checkable completion condition, keep each meaning in one place, and phrase the target
27
+ behaviour positively.
28
+
29
+ ## Context pointers
30
+
31
+ A **context pointer** is a line in context that names material outside it and encodes when to reach it —
32
+ a skill's description, or a context-file line naming a doc. The pointer's _wording_, not its target,
33
+ decides when and how reliably the agent reaches the material. A must-have target behind a weakly worded
34
+ pointer is a variance bug: sharpen the wording first; inline the material only if that fails.
35
+
36
+ A pointer states what the material is and lists the **branches** — distinct cases — that should trigger
37
+ it. Every word of an always-loaded pointer costs on every turn, so prune it hardest:
38
+
39
+ - **Front-load the leading word**; the start of the pointer does the triggering.
40
+ - **One trigger per branch.** Synonyms naming one branch are one branch written twice.
41
+ - **Cut identity the body already carries.**
42
+
43
+ ## The two loads
44
+
45
+ - **Context load** — always-loaded material (a context-file line, a skill description) spends tokens and
46
+ attention every turn, whether or not it fires.
47
+ - **Cognitive load** — the human has to know which documents exist and when each matters. Spend it where
48
+ human judgement matters; remove it where it does not.
49
+
50
+ Material behind a pointer escapes context load at the price of the pointer's own line.
51
+
52
+ ## Information hierarchy
53
+
54
+ A document mixes **steps** (ordered actions) and **reference** (definitions, rules, facts consulted on
55
+ demand). Place each piece on a ladder ranked by how immediately the agent needs it:
56
+
57
+ 1. **In-file steps** — what the agent does, in order.
58
+ 2. **In-file reference** — consulted on demand; a flat set of peer rules is fine.
59
+ 3. **Disclosed reference** — material in another file, reached through a pointer only when needed.
60
+
61
+ Inline what every branch needs; disclose what only some branches reach. Keep a concept's definition,
62
+ rules, and caveats together under one heading rather than scattered. The failure mode is **sprawl** — a
63
+ document so long that attention thins across it even when every line is live. In a session that writes
64
+ only its proposal, disclose by pointing at a file that already exists.
65
+
66
+ ## Steps and completion criteria
67
+
68
+ Every step ends on a **completion criterion** — the condition that tells the agent it is done.
69
+
70
+ - **Clarity** — can the agent tell done from not done? A vague bound ("once understanding is reached")
71
+ invites premature completion, with attention slipping to the steps still ahead. Sharpen the bound
72
+ first. Hiding later steps only helps across a real context boundary (a hand-off to a separate session
73
+ or task).
74
+ - **Demand** — how much the criterion requires. "Every modified model accounted for" forces thorough work
75
+ where "produce a change list" does not. Demand binds flat reference too: "every rule applied".
76
+
77
+ The strongest criteria are both checkable and exhaustive.
78
+
79
+ ## Leading words
80
+
81
+ A **leading word** is a compact concept the model already knows — _tight_ (a tight feedback loop),
82
+ _red_ (a test that fails on the bug), _tracer bullet_. Repeated as a token, it anchors a whole region of
83
+ behaviour in few words by recruiting priors the model already holds. Hunt for passages that spell out a
84
+ triad or a sentence where one such word would do.
85
+
86
+ **Prohibitions backfire.** Naming the forbidden behaviour puts it in context and makes it more
87
+ available. State the target behaviour ("write one-line comments"). Keep a prohibition only as a hard
88
+ guardrail you cannot phrase positively, and pair it with the positive target.
89
+
90
+ ## Pruning
91
+
92
+ - **One meaning, one place.** Duplication costs maintenance and tokens and inflates a meaning's
93
+ prominence. (A leading word repeats a token on purpose, never the meaning.)
94
+ - **The environment is a source of truth.** Config files, the directory layout, `--help` output, and
95
+ what a manifest script does already state themselves; a document that restates them is a cache that
96
+ goes stale. Which command to run is different: where the document exists to tell the agent what to run,
97
+ or the output contract asks for commands, give the exact runnable command, checked against the manifest.
98
+ Beyond that, write down what the agent cannot find by looking — the unwritten convention, the reason
99
+ behind a choice, the gotcha no config admits.
100
+ - **Relevance.** A line that never bears on the task, or describes behaviour that has since changed, is
101
+ sediment. Remove it.
102
+ - **No-ops.** An instruction the model already follows by default says nothing. Delete the whole
103
+ sentence. A word too weak to beat the default (_be thorough_) needs a stronger word, not more words.
104
+
105
+ ## Self-check
106
+
107
+ - [ ] Every always-loaded line changes behaviour versus the default.
108
+ - [ ] Each pointer front-loads its trigger and lists one trigger per branch.
109
+ - [ ] Every step ends on a checkable completion criterion.
110
+ - [ ] Nothing restates what the environment already states, and every command the contract asks for is
111
+ exact and runnable.
112
+ - [ ] Target behaviours are phrased positively.
113
+ - [ ] The prompt's own length and section rules are met.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ralphctl",
3
- "version": "0.26.0",
3
+ "version": "0.27.0",
4
4
  "description": "A ralph harness for long-running AI coding tasks — a generator-evaluator loop that drives Claude Code, GitHub Copilot CLI, OpenAI Codex CLI, OpenCode or Grok Build CLI across one or more repositories",
5
5
  "homepage": "https://github.com/lukas-grigis/ralphctl",
6
6
  "type": "module",
@@ -49,19 +49,19 @@
49
49
  "dependencies": {
50
50
  "commander": "^15.0.0",
51
51
  "cross-spawn": "^7.0.6",
52
- "ink": "^7.1.1",
52
+ "ink": "^8.0.0",
53
53
  "proper-lockfile": "^4.1.2",
54
54
  "react": "^19.3.0",
55
55
  "typescript-result": "^3.5.2",
56
- "zod": "^4.6.0"
56
+ "zod": "^4.6.7"
57
57
  },
58
58
  "devDependencies": {
59
59
  "@eslint/js": "^10.0.1",
60
60
  "@types/cross-spawn": "^6.0.6",
61
- "@types/node": "^26.6.2",
61
+ "@types/node": "^26.6.5",
62
62
  "@types/proper-lockfile": "^4.1.4",
63
63
  "@types/react": "^19.3.0",
64
- "@vitest/coverage-v8": "^5.0.0",
64
+ "@vitest/coverage-v8": "^5.0.4",
65
65
  "eslint": "^10.11.0",
66
66
  "eslint-plugin-react-hooks": "^7.1.1",
67
67
  "eslint-plugin-sonarjs": "^4.2.0",
@@ -71,13 +71,13 @@
71
71
  "jiti": "^2.7.0",
72
72
  "knip": "^6.37.0",
73
73
  "lint-staged": "^17.5.0",
74
- "prettier": "^3.9.8",
75
- "tsup": "^8.5.1",
74
+ "prettier": "^3.9.10",
75
+ "tsup": "^9.0.0",
76
76
  "tsx": "^4.23.15",
77
77
  "typescript": "^6.0.3",
78
- "typescript-eslint": "^8.70.1",
78
+ "typescript-eslint": "^8.71.2",
79
79
  "vite": "^8.2.2",
80
- "vitest": "^5.0.0"
80
+ "vitest": "^5.0.4"
81
81
  },
82
82
  "lint-staged": {
83
83
  "*.{ts,tsx}": [
@@ -90,6 +90,7 @@
90
90
  "build": "tsup && tsx scripts/build-assets.ts",
91
91
  "dev": "NODE_ENV=production NODE_OPTIONS=--max-old-space-size=8192 tsx src/index.ts",
92
92
  "mock": "tsx scripts/seed-mock.ts",
93
+ "demo:record": "NODE_ENV=production tsx scripts/record-demo.ts",
93
94
  "dev:heap-snapshot": "mkdir -p .diagnostics && NODE_OPTIONS='--max-old-space-size=8192 --heapsnapshot-near-heap-limit=2 --diagnostic-dir=.diagnostics' tsx src/index.ts",
94
95
  "start": "NODE_ENV=production NODE_OPTIONS=--max-old-space-size=8192 tsx src/index.ts",
95
96
  "typecheck": "tsc",
@@ -100,7 +101,6 @@
100
101
  "test:watch": "vitest",
101
102
  "coverage": "vitest run --coverage",
102
103
  "verify:coverage": "pnpm coverage",
103
- "coverage:unused": "tsx scripts/find-unused.ts",
104
104
  "deadcode": "knip",
105
105
  "skills:update": "tsx scripts/sync-skills.ts",
106
106
  "eval": "tsx scripts/eval/main.ts",