renma 0.15.2 → 0.17.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 (126) hide show
  1. package/CHANGELOG.md +54 -1
  2. package/README.md +216 -655
  3. package/architecture.md +523 -0
  4. package/design.md +458 -0
  5. package/dist/agent-skills.d.ts +77 -0
  6. package/dist/agent-skills.d.ts.map +1 -0
  7. package/dist/agent-skills.js +468 -0
  8. package/dist/agent-skills.js.map +1 -0
  9. package/dist/catalog.d.ts.map +1 -1
  10. package/dist/catalog.js +38 -5
  11. package/dist/catalog.js.map +1 -1
  12. package/dist/cli-help.d.ts +13 -11
  13. package/dist/cli-help.d.ts.map +1 -1
  14. package/dist/cli-help.js +36 -11
  15. package/dist/cli-help.js.map +1 -1
  16. package/dist/cli.d.ts.map +1 -1
  17. package/dist/cli.js +139 -40
  18. package/dist/cli.js.map +1 -1
  19. package/dist/commands/catalog.d.ts.map +1 -1
  20. package/dist/commands/catalog.js +4 -3
  21. package/dist/commands/catalog.js.map +1 -1
  22. package/dist/commands/graph.d.ts.map +1 -1
  23. package/dist/commands/graph.js +7 -12
  24. package/dist/commands/graph.js.map +1 -1
  25. package/dist/commands/readiness.d.ts.map +1 -1
  26. package/dist/commands/readiness.js +7 -6
  27. package/dist/commands/readiness.js.map +1 -1
  28. package/dist/commands/scaffold.d.ts.map +1 -1
  29. package/dist/commands/scaffold.js +59 -16
  30. package/dist/commands/scaffold.js.map +1 -1
  31. package/dist/commands/suggest-metadata.d.ts +3 -1
  32. package/dist/commands/suggest-metadata.d.ts.map +1 -1
  33. package/dist/commands/suggest-metadata.js +226 -7
  34. package/dist/commands/suggest-metadata.js.map +1 -1
  35. package/dist/commands/suggest-semantic-split.js +3 -3
  36. package/dist/commands/suggest-semantic-split.js.map +1 -1
  37. package/dist/dependency-resolution.d.ts +6 -0
  38. package/dist/dependency-resolution.d.ts.map +1 -0
  39. package/dist/dependency-resolution.js +11 -0
  40. package/dist/dependency-resolution.js.map +1 -0
  41. package/dist/diagnostic-ids.d.ts +29 -0
  42. package/dist/diagnostic-ids.d.ts.map +1 -1
  43. package/dist/diagnostic-ids.js +28 -0
  44. package/dist/diagnostic-ids.js.map +1 -1
  45. package/dist/discovery.d.ts +50 -0
  46. package/dist/discovery.d.ts.map +1 -1
  47. package/dist/discovery.js +183 -25
  48. package/dist/discovery.js.map +1 -1
  49. package/dist/metadata.d.ts +3 -1
  50. package/dist/metadata.d.ts.map +1 -1
  51. package/dist/metadata.js +166 -29
  52. package/dist/metadata.js.map +1 -1
  53. package/dist/model.d.ts +1 -0
  54. package/dist/model.d.ts.map +1 -1
  55. package/dist/report.d.ts.map +1 -1
  56. package/dist/report.js +16 -1
  57. package/dist/report.js.map +1 -1
  58. package/dist/repository-paths.d.ts +13 -0
  59. package/dist/repository-paths.d.ts.map +1 -1
  60. package/dist/repository-paths.js +60 -2
  61. package/dist/repository-paths.js.map +1 -1
  62. package/dist/rules.d.ts.map +1 -1
  63. package/dist/rules.js +97 -107
  64. package/dist/rules.js.map +1 -1
  65. package/dist/scanner.d.ts.map +1 -1
  66. package/dist/scanner.js +3 -1
  67. package/dist/scanner.js.map +1 -1
  68. package/dist/security-diagnostics.d.ts.map +1 -1
  69. package/dist/security-diagnostics.js +98 -35
  70. package/dist/security-diagnostics.js.map +1 -1
  71. package/dist/security-policy-inventory.js +11 -4
  72. package/dist/security-policy-inventory.js.map +1 -1
  73. package/dist/security-policy.d.ts +27 -1
  74. package/dist/security-policy.d.ts.map +1 -1
  75. package/dist/security-policy.js +247 -34
  76. package/dist/security-policy.js.map +1 -1
  77. package/dist/skill-migration.d.ts +30 -0
  78. package/dist/skill-migration.d.ts.map +1 -0
  79. package/dist/skill-migration.js +566 -0
  80. package/dist/skill-migration.js.map +1 -0
  81. package/dist/trust-graph.d.ts.map +1 -1
  82. package/dist/trust-graph.js +7 -11
  83. package/dist/trust-graph.js.map +1 -1
  84. package/dist/types.d.ts +3 -1
  85. package/dist/types.d.ts.map +1 -1
  86. package/dist/yaml-frontmatter.d.ts +26 -0
  87. package/dist/yaml-frontmatter.d.ts.map +1 -0
  88. package/dist/yaml-frontmatter.js +114 -0
  89. package/dist/yaml-frontmatter.js.map +1 -0
  90. package/docs/README.md +55 -0
  91. package/docs/advanced-skill-authoring.md +140 -0
  92. package/docs/agent-skills-compatibility.md +500 -0
  93. package/docs/authoring-guide.md +324 -0
  94. package/docs/context-conflict-diagnostics.md +32 -0
  95. package/docs/context-language-diagnostics.md +99 -0
  96. package/docs/context-lens.md +253 -0
  97. package/docs/context-lifecycle-diagnostics.md +55 -0
  98. package/docs/diagnostics.md +373 -0
  99. package/docs/metadata-budget.md +14 -0
  100. package/docs/repository-context-bom.md +113 -0
  101. package/docs/security-policy.md +338 -0
  102. package/docs/user-manual.md +813 -0
  103. package/examples/context-lens/README.md +101 -0
  104. package/examples/context-lens/contexts/testing/boundary-value-analysis.md +23 -0
  105. package/examples/context-lens/lenses/testing/spec-review-boundary-values.md +29 -0
  106. package/examples/context-lens/lenses/testing/test-design-boundary-values.md +29 -0
  107. package/examples/context-lens/skills/testing/spec-review/SKILL.md +49 -0
  108. package/examples/context-repo/README.md +149 -0
  109. package/examples/context-repo/contexts/domain/payment/idempotency.md +20 -0
  110. package/examples/context-repo/contexts/testing/boundary-value-analysis.md +19 -0
  111. package/examples/context-repo/contexts/testing/negative-testing.md +19 -0
  112. package/examples/context-repo/lenses/testing/spec-review-boundary-values.md +35 -0
  113. package/examples/context-repo/renma.config.json +12 -0
  114. package/examples/context-repo/skills/testing/spec-review/SKILL.md +66 -0
  115. package/examples/context-repo/tools/appium/README.md +14 -0
  116. package/examples/github-actions/renma-ci-report.yml +36 -0
  117. package/examples/interactive-placeholder/README.md +104 -0
  118. package/examples/interactive-placeholder/assets/template.txt +1 -0
  119. package/examples/interactive-placeholder/renma.config.json +6 -0
  120. package/examples/interactive-placeholder/skills/replace-placeholder/SKILL.md +54 -0
  121. package/examples/interactive-placeholder/tools/README.md +48 -0
  122. package/examples/interactive-placeholder/tools/placeholder-demo.mjs +99 -0
  123. package/package.json +11 -1
  124. package/plan-discovery.md +740 -0
  125. package/plan.md +150 -0
  126. package/scripts/verify-package.mjs +97 -0
@@ -0,0 +1,104 @@
1
+ # Interactive Placeholder Example
2
+
3
+ This small example demonstrates a clarify-before-act interaction described by
4
+ a governed Skill. A consuming agent prepares and inspects a disposable file,
5
+ asks one focused question when a value is missing, waits, applies the validated
6
+ answer with a local CLI, and verifies the result.
7
+
8
+ A Skill can define a clarify-before-act interaction: inspect the current state,
9
+ ask for missing information, wait, and act only after the user supplies it.
10
+
11
+ ## Responsibility Boundary
12
+
13
+ Renma:
14
+
15
+ - discovers and validates the Skill and repository assets;
16
+ - checks workflow clarity, required inputs, helper-command paths, metadata,
17
+ security policy, and repository structure; and
18
+ - provides deterministic scan and readiness evidence.
19
+
20
+ Renma does not run the interaction, execute the Node.js tool, ask the user,
21
+ store conversational state, or resume the workflow.
22
+
23
+ The consuming agent:
24
+
25
+ - follows [`skills/replace-placeholder/SKILL.md`](skills/replace-placeholder/SKILL.md);
26
+ - runs the fixed local CLI commands;
27
+ - notices the missing replacement, asks one question, and waits;
28
+ - validates the user's answer before applying it; and
29
+ - inspects and reports the result.
30
+
31
+ The user supplies the missing value, can inspect the resulting file, and
32
+ retains final control over it.
33
+
34
+ ## Prerequisites
35
+
36
+ - Node.js 22 or newer for the local demonstration.
37
+ - A built Renma checkout for the `node dist/index.js` inspection commands.
38
+ - Run the Renma commands below from the repository root.
39
+
40
+ ## Inspect With Renma
41
+
42
+ ```bash
43
+ npm run build
44
+ node dist/index.js scan examples/interactive-placeholder --fail-on high
45
+ node dist/index.js catalog examples/interactive-placeholder --format markdown
46
+ node dist/index.js readiness examples/interactive-placeholder --format markdown
47
+ node dist/index.js inspect examples/interactive-placeholder/skills/replace-placeholder/SKILL.md
48
+ ```
49
+
50
+ With an installed CLI, the equivalent commands are:
51
+
52
+ ```bash
53
+ renma scan examples/interactive-placeholder --fail-on high
54
+ renma catalog examples/interactive-placeholder --format markdown
55
+ renma readiness examples/interactive-placeholder --format markdown
56
+ renma inspect examples/interactive-placeholder/skills/replace-placeholder/SKILL.md
57
+ ```
58
+
59
+ ## Try The Interaction
60
+
61
+ Change into the example directory, then prepare and inspect the disposable
62
+ output:
63
+
64
+ ```bash
65
+ cd examples/interactive-placeholder
66
+ node tools/placeholder-demo.mjs prepare
67
+ node tools/placeholder-demo.mjs inspect
68
+ ```
69
+
70
+ Expected state:
71
+
72
+ ```text
73
+ State: waiting for a replacement value (<placeholder> remains).
74
+ ```
75
+
76
+ At this boundary, the consuming agent asks for one value matching
77
+ `[A-Za-z0-9_-]{1,32}` and waits without modifying the file. After the user
78
+ supplies a valid value, for example `Renma_017`, the agent passes it as one
79
+ argument and verifies the result:
80
+
81
+ ```bash
82
+ node tools/placeholder-demo.mjs apply Renma_017
83
+ node tools/placeholder-demo.mjs inspect
84
+ ```
85
+
86
+ Expected verification:
87
+
88
+ ```text
89
+ State: complete. Hello, Renma_017!
90
+ ```
91
+
92
+ Run `node tools/placeholder-demo.mjs prepare` at any time to recreate
93
+ `workspace/output.txt` from the immutable `assets/template.txt`. The generated
94
+ output is ignored by Git, so repeating the example does not modify a tracked
95
+ fixture.
96
+
97
+ ## Intentionally Not Demonstrated
98
+
99
+ This example does not add a Renma runtime feature, Context Asset, Context Lens,
100
+ workflow state machine, platform Plan mode, runtime Skill selection, prompt
101
+ assembly, provider integration, agent execution, automatic question asking,
102
+ automatic resume, network access, uploads, or repository rewriting. It isolates
103
+ one interaction pattern that an external consuming agent can execute from a
104
+ statically governed Skill.
@@ -0,0 +1 @@
1
+ Hello, <placeholder>!
@@ -0,0 +1,6 @@
1
+ {
2
+ "fail_on": "high",
3
+ "format": "text",
4
+ "globs": ["skills/**/SKILL.md", "tools/**/*", "README.md"],
5
+ "exclude": ["node_modules", "dist", ".git", "workspace"]
6
+ }
@@ -0,0 +1,54 @@
1
+ ---
2
+ name: replace-placeholder
3
+ description: Prepare this example's disposable placeholder file, ask for a constrained replacement, then apply and verify it. Use only for interactive-placeholder; do not use for arbitrary text, other files, or unattended edits.
4
+ metadata:
5
+ renma.id: skill.example.replace-placeholder
6
+ renma.owner: maintainers
7
+ renma.allowed-data: '["repo-local-files","disclosed-user-provided-data"]'
8
+ renma.network-allowed: "false"
9
+ renma.external-upload-allowed: "false"
10
+ renma.secrets-allowed: "false"
11
+ renma.requires-human-approval: "false"
12
+ renma.forbidden-inputs: '["secrets","credentials","personal-data"]'
13
+ ---
14
+
15
+ # Replace Placeholder
16
+
17
+ ## Routing
18
+
19
+ Use only in `examples/interactive-placeholder`. The consuming agent follows the
20
+ [local tool guide](../../tools/README.md). Renma validates the repository; the
21
+ agent owns the interaction and tool use.
22
+
23
+ ## Required Inputs And Preflight
24
+
25
+ - The example files and write permission for `workspace/output.txt`.
26
+ - One user value matching `[A-Za-z0-9_-]{1,32}`, initially missing.
27
+
28
+ ## Clarify-Before-Act Workflow
29
+
30
+ 1. Follow the guide's `prepare` and `inspect` operations.
31
+ 2. If inspection shows a missing replacement, ask one focused question for an
32
+ accepted value, then stop and wait.
33
+ 3. Validate the response without changing it.
34
+ 4. For a valid response, follow the guide's `apply` and `inspect` operations.
35
+ 5. Verify the placeholder is absent and the value is present, then report the
36
+ inspected result for human review.
37
+
38
+ ## Hard Constraints
39
+
40
+ - Use only the fixed guide and its anchored paths.
41
+ - If the value is missing, ask one focused question and stop.
42
+ - If the value is invalid, explain the accepted format, ask again, and stop.
43
+ - Never guess, transform, or truncate the value; ask again instead.
44
+ - Do not request or accept secrets, credentials, or personal data; ask for a non-sensitive value instead.
45
+ - Do not apply when `<placeholder>` is absent; stop and report the inspected state.
46
+ - Do not edit the Skill, READMEs, or immutable template; leave them unchanged.
47
+ - Do not access the network, upload data, or write outside the example workspace; stop and report the blocked operation.
48
+ - A human retains final control over the inspected result.
49
+
50
+ ## Completion Criteria
51
+
52
+ Complete only after the documented `apply` succeeds and `inspect` returns
53
+ `State: complete` with the user value and no `<placeholder>`. Report this
54
+ evidence.
@@ -0,0 +1,48 @@
1
+ # Placeholder Tool Guide
2
+
3
+ This local tool is the fixed operational contract for the
4
+ `replace-placeholder` Skill. Run it from `examples/interactive-placeholder`.
5
+ It accepts no file path, performs no network or upload operation, and writes
6
+ only the disposable `workspace/output.txt` file.
7
+
8
+ ## Commands
9
+
10
+ Prepare or reset the output from the immutable template, then inspect it:
11
+
12
+ ```bash
13
+ node tools/placeholder-demo.mjs prepare
14
+ node tools/placeholder-demo.mjs inspect
15
+ ```
16
+
17
+ After a user supplies a value matching `[A-Za-z0-9_-]{1,32}`, pass the
18
+ validated value as exactly one argument and inspect the result:
19
+
20
+ ```bash
21
+ node tools/placeholder-demo.mjs apply EXAMPLE_VALUE
22
+ node tools/placeholder-demo.mjs inspect
23
+ ```
24
+
25
+ Pass the value as an argument, never as interpolated shell source. The tool
26
+ rejects missing, extra, or invalid arguments and never accepts a destination
27
+ path.
28
+
29
+ ## Behavior
30
+
31
+ - `prepare` creates `workspace/output.txt` from `assets/template.txt`. It also
32
+ resets a completed output back to the missing-value state.
33
+ - `apply` accepts one constrained value and replaces `<placeholder>` only while
34
+ that marker is present.
35
+ - `inspect` reports either the waiting state with `<placeholder>` or the
36
+ complete state with the rendered value.
37
+ - `assets/template.txt` remains immutable, while the ignored workspace output
38
+ is disposable and safe to remove.
39
+
40
+ ## Failure And Stop Behavior
41
+
42
+ - If the output is missing, run `prepare` before inspecting or applying.
43
+ - If the value does not match `[A-Za-z0-9_-]{1,32}`, explain the format, ask
44
+ again, and stop without applying.
45
+ - If `<placeholder>` is absent, stop and report the current state; use
46
+ `prepare` only when the user wants to reset the demonstration.
47
+ - If the template lacks `<placeholder>` or a local filesystem operation fails,
48
+ stop and report the error. Leave tracked files unchanged.
@@ -0,0 +1,99 @@
1
+ import { mkdir, readFile, writeFile } from "node:fs/promises";
2
+ import path from "node:path";
3
+ import { fileURLToPath } from "node:url";
4
+
5
+ const PLACEHOLDER = "<placeholder>";
6
+ const VALUE_PATTERN = /^[A-Za-z0-9_-]{1,32}$/;
7
+ const TOOL_DIRECTORY = path.dirname(fileURLToPath(import.meta.url));
8
+ const EXAMPLE_ROOT = path.resolve(TOOL_DIRECTORY, "..");
9
+ const TEMPLATE_PATH = anchoredPath("assets", "template.txt");
10
+ const WORKSPACE_PATH = anchoredPath("workspace");
11
+ const OUTPUT_PATH = anchoredPath("workspace", "output.txt");
12
+
13
+ const [command, ...args] = process.argv.slice(2);
14
+
15
+ try {
16
+ if (command === "prepare") {
17
+ requireArgumentCount(command, args, 0);
18
+ await prepare();
19
+ } else if (command === "apply") {
20
+ requireArgumentCount(command, args, 1);
21
+ await apply(args[0]);
22
+ } else if (command === "inspect") {
23
+ requireArgumentCount(command, args, 0);
24
+ await inspect();
25
+ } else {
26
+ fail(
27
+ "Usage: node tools/placeholder-demo.mjs <prepare|apply VALUE|inspect>",
28
+ );
29
+ }
30
+ } catch (error) {
31
+ if (error instanceof Error) fail(error.message);
32
+ fail("Unexpected local filesystem error.");
33
+ }
34
+
35
+ function anchoredPath(...segments) {
36
+ const candidate = path.resolve(EXAMPLE_ROOT, ...segments);
37
+ const relative = path.relative(EXAMPLE_ROOT, candidate);
38
+ if (relative.startsWith("..") || path.isAbsolute(relative)) {
39
+ throw new Error("Refusing a path outside the example directory.");
40
+ }
41
+ return candidate;
42
+ }
43
+
44
+ function requireArgumentCount(selectedCommand, values, expected) {
45
+ if (values.length !== expected) {
46
+ throw new Error(`Invalid arguments for ${selectedCommand}.`);
47
+ }
48
+ }
49
+
50
+ async function prepare() {
51
+ const template = await readFile(TEMPLATE_PATH, "utf8");
52
+ if (!template.includes(PLACEHOLDER)) {
53
+ throw new Error("Immutable template does not contain <placeholder>.");
54
+ }
55
+ await mkdir(WORKSPACE_PATH, { recursive: true });
56
+ await writeFile(OUTPUT_PATH, template, "utf8");
57
+ process.stdout.write(
58
+ "Prepared workspace/output.txt: replacement value is missing (<placeholder>).\n",
59
+ );
60
+ }
61
+
62
+ async function apply(value) {
63
+ if (!VALUE_PATTERN.test(value ?? "")) {
64
+ throw new Error("Invalid value: expected [A-Za-z0-9_-]{1,32}.");
65
+ }
66
+ const output = await readOutput();
67
+ if (!output.includes(PLACEHOLDER)) {
68
+ throw new Error("Cannot apply: workspace/output.txt has no <placeholder>.");
69
+ }
70
+ await writeFile(OUTPUT_PATH, output.replaceAll(PLACEHOLDER, value), "utf8");
71
+ process.stdout.write(`Applied value ${value} to workspace/output.txt.\n`);
72
+ }
73
+
74
+ async function inspect() {
75
+ const output = await readOutput();
76
+ if (output.includes(PLACEHOLDER)) {
77
+ process.stdout.write(
78
+ "State: waiting for a replacement value (<placeholder> remains).\n",
79
+ );
80
+ return;
81
+ }
82
+ process.stdout.write(`State: complete. ${output.trim()}\n`);
83
+ }
84
+
85
+ async function readOutput() {
86
+ try {
87
+ return await readFile(OUTPUT_PATH, "utf8");
88
+ } catch (error) {
89
+ if (error instanceof Error && "code" in error && error.code === "ENOENT") {
90
+ throw new Error("workspace/output.txt is missing; run prepare first.");
91
+ }
92
+ throw error;
93
+ }
94
+ }
95
+
96
+ function fail(message) {
97
+ process.stderr.write(`${message}\n`);
98
+ process.exit(2);
99
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "renma",
3
- "version": "0.15.2",
3
+ "version": "0.17.0",
4
4
  "description": "Manage human-curated context assets for LLMs and agents in Git.",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -27,6 +27,12 @@
27
27
  "files": [
28
28
  "dist",
29
29
  "scripts",
30
+ "docs",
31
+ "examples",
32
+ "architecture.md",
33
+ "design.md",
34
+ "plan.md",
35
+ "plan-discovery.md",
30
36
  "CHANGELOG.md",
31
37
  "LICENSE",
32
38
  "README.md"
@@ -44,6 +50,7 @@
44
50
  "format:check": "prettier --check \"**/*.{ts,js,mjs,json}\"",
45
51
  "lint": "eslint \"{src,test}/**/*.ts\" \"{scripts,tools}/**/*.mjs\" \"eslint.config.js\"",
46
52
  "lint:fix": "eslint --fix \"{src,test}/**/*.ts\" \"{scripts,tools}/**/*.mjs\" \"eslint.config.js\"",
53
+ "verify:package": "npm run build && node scripts/verify-package.mjs",
47
54
  "split-reference": "node scripts/split-reference.mjs",
48
55
  "suggest-semantic-split": "node dist/index.js suggest-semantic-split"
49
56
  },
@@ -55,5 +62,8 @@
55
62
  "prettier": "^3.5.3",
56
63
  "typescript": "^5.8.3",
57
64
  "typescript-eslint": "^8.61.0"
65
+ },
66
+ "dependencies": {
67
+ "yaml": "^2.9.0"
58
68
  }
59
69
  }