scrumrun 1.5.2 → 2.0.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 (106) hide show
  1. package/CHANGELOG.md +42 -0
  2. package/CORE.md +224 -311
  3. package/DECISIONS.md +95 -11
  4. package/LICENSE +21 -0
  5. package/MIGRATION-1-to-2.md +109 -0
  6. package/README.md +137 -78
  7. package/SPEC.md +248 -257
  8. package/bin/claude-install.js +18 -132
  9. package/bin/scrumrun.js +1259 -174
  10. package/docs/COMMANDS.md +69 -0
  11. package/docs/ENTITY-MODEL.md +38 -0
  12. package/docs/RELEASE.md +44 -0
  13. package/docs/SCHEMA.md +80 -0
  14. package/docs/SEMANTIC-MEMORY.md +68 -0
  15. package/docs/TROUBLESHOOTING.md +66 -0
  16. package/lib/code-intel/adapter.js +20 -0
  17. package/lib/code-intel/javascript.js +199 -0
  18. package/lib/code-intel/learning.js +66 -0
  19. package/lib/code-intel/scanner.js +126 -0
  20. package/lib/commands/manifest.js +109 -0
  21. package/lib/commands/render.js +75 -0
  22. package/lib/memory/index.js +600 -0
  23. package/lib/memory/markdown.js +51 -0
  24. package/lib/memory/service.js +300 -0
  25. package/lib/runtime/budgets.js +19 -0
  26. package/lib/runtime/context.js +141 -0
  27. package/lib/runtime/orchestrator.js +270 -0
  28. package/lib/runtime/request-engine.js +128 -0
  29. package/lib/security/secrets.js +23 -0
  30. package/lib/v2/artifacts.js +343 -0
  31. package/lib/v2/conformance.js +167 -0
  32. package/lib/v2/migration.js +1161 -0
  33. package/lib/v2/project-store.js +44 -0
  34. package/lib/v2/schema.js +128 -0
  35. package/package.json +16 -6
  36. package/scripts/generate-contract-docs.js +113 -0
  37. package/templates/project/.scrumrun/config.md +4 -7
  38. package/templates/project/.scrumrun/guardrails.md +23 -0
  39. package/templates/project/.scrumrun/map.md +4 -16
  40. package/templates/project/.scrumrun/memory/decisions/.gitkeep +1 -0
  41. package/templates/project/.scrumrun/memory/dossiers/.gitkeep +1 -0
  42. package/templates/project/.scrumrun/memory/insights/.gitkeep +1 -0
  43. package/templates/project/.scrumrun/memory/knowledge/.gitkeep +1 -0
  44. package/templates/project/.scrumrun/method.json +4 -0
  45. package/templates/project/.scrumrun/project.md +6 -12
  46. package/templates/project/.scrumrun/runs/.gitkeep +1 -0
  47. package/templates/project/.scrumrun/sprints/.gitkeep +1 -0
  48. package/templates/project/.scrumrun/state.md +21 -0
  49. package/templates/project/.scrumrun/tasks/.gitkeep +1 -0
  50. package/templates/project/AGENTS.md +16 -49
  51. package/templates/project-lean/AGENTS.md +18 -0
  52. package/templates/shared/skills/scrumrun/SKILL.md +201 -0
  53. package/templates/codex/prompts/sc-agent.md +0 -14
  54. package/templates/codex/prompts/sc-backlog.md +0 -13
  55. package/templates/codex/prompts/sc-challenge.md +0 -57
  56. package/templates/codex/prompts/sc-config.md +0 -18
  57. package/templates/codex/prompts/sc-context.md +0 -24
  58. package/templates/codex/prompts/sc-decisions.md +0 -8
  59. package/templates/codex/prompts/sc-feature.md +0 -16
  60. package/templates/codex/prompts/sc-fix.md +0 -21
  61. package/templates/codex/prompts/sc-goal.md +0 -14
  62. package/templates/codex/prompts/sc-golden.md +0 -14
  63. package/templates/codex/prompts/sc-help.md +0 -12
  64. package/templates/codex/prompts/sc-init.md +0 -14
  65. package/templates/codex/prompts/sc-intake.md +0 -22
  66. package/templates/codex/prompts/sc-know.md +0 -75
  67. package/templates/codex/prompts/sc-map.md +0 -13
  68. package/templates/codex/prompts/sc-review.md +0 -13
  69. package/templates/codex/prompts/sc-sprint.md +0 -28
  70. package/templates/codex/prompts/sc-study.md +0 -23
  71. package/templates/codex/prompts/sc-uninstall.md +0 -14
  72. package/templates/codex/prompts/sc-update.md +0 -8
  73. package/templates/codex/prompts/sc-vault.md +0 -27
  74. package/templates/codex/skills/scrumrun/SKILL.md +0 -412
  75. package/templates/opencode/commands/sc-agent.md +0 -14
  76. package/templates/opencode/commands/sc-backlog.md +0 -13
  77. package/templates/opencode/commands/sc-challenge.md +0 -57
  78. package/templates/opencode/commands/sc-config.md +0 -18
  79. package/templates/opencode/commands/sc-context.md +0 -24
  80. package/templates/opencode/commands/sc-decisions.md +0 -8
  81. package/templates/opencode/commands/sc-feature.md +0 -16
  82. package/templates/opencode/commands/sc-fix.md +0 -21
  83. package/templates/opencode/commands/sc-goal.md +0 -14
  84. package/templates/opencode/commands/sc-golden.md +0 -14
  85. package/templates/opencode/commands/sc-help.md +0 -12
  86. package/templates/opencode/commands/sc-init.md +0 -14
  87. package/templates/opencode/commands/sc-intake.md +0 -22
  88. package/templates/opencode/commands/sc-know.md +0 -75
  89. package/templates/opencode/commands/sc-map.md +0 -13
  90. package/templates/opencode/commands/sc-review.md +0 -13
  91. package/templates/opencode/commands/sc-sprint.md +0 -28
  92. package/templates/opencode/commands/sc-study.md +0 -23
  93. package/templates/opencode/commands/sc-uninstall.md +0 -14
  94. package/templates/opencode/commands/sc-update.md +0 -8
  95. package/templates/opencode/commands/sc-vault.md +0 -27
  96. package/templates/opencode/skills/scrumrun/SKILL.md +0 -412
  97. package/templates/project/.scrumrun/agents.md +0 -36
  98. package/templates/project/.scrumrun/backlog.md +0 -7
  99. package/templates/project/.scrumrun/context.md +0 -61
  100. package/templates/project/.scrumrun/goals/main/decisions.md +0 -9
  101. package/templates/project/.scrumrun/goals/main/history.md +0 -51
  102. package/templates/project/.scrumrun/goals/main/sprint.md +0 -54
  103. package/templates/project/.scrumrun/golden-rules.md +0 -9
  104. package/templates/project/.scrumrun/knowledge.md +0 -15
  105. package/templates/project/.scrumrun/runbook.md +0 -101
  106. package/templates/project/.scrumrun/token-policy.md +0 -43
@@ -1,147 +1,33 @@
1
1
  #!/usr/bin/env node
2
+ "use strict";
2
3
 
3
- const fs = require("fs");
4
- const path = require("path");
5
- const os = require("os");
4
+ const { spawnSync } = require("node:child_process");
5
+ const path = require("node:path");
6
6
 
7
- const root = path.resolve(__dirname, "..");
8
- const templates = path.join(root, "templates");
9
-
10
- const COMMANDS = [
11
- "sc-help",
12
- "sc-study",
13
- "sc-init",
14
- "sc-uninstall",
15
- "sc-update",
16
- "sc-vault",
17
- "sc-know",
18
- "sc-config",
19
- "sc-golden",
20
- "sc-map",
21
- "sc-challenge",
22
- "sc-goal",
23
- "sc-backlog",
24
- "sc-feature",
25
- "sc-sprint",
26
- "sc-fix",
27
- "sc-agent",
28
- "sc-review",
29
- "sc-decisions"
30
- ];
7
+ const scrumrun = path.join(__dirname, "scrumrun.js");
8
+ const args = process.argv.slice(2);
9
+ const command = args[0];
31
10
 
32
- function usage() {
11
+ if (!command || command === "--help" || command === "-h") {
33
12
  console.log(`ScrumRun for Claude Code
34
13
 
35
14
  Usage:
36
15
  sr-claude install [--force]
37
16
  sr-claude update
38
- sr-claude doctor
17
+ sr-claude doctor [--compat]
39
18
 
40
- Examples:
41
- npx --package=scrumrun@latest sr-claude install
42
- npx --package=scrumrun@latest sr-claude update
43
- npx --package=scrumrun@latest sr-claude doctor
19
+ This compatibility binary delegates to the manifest-driven ScrumRun CLI.
44
20
  `);
21
+ process.exit(0);
45
22
  }
46
23
 
47
- function ensureDir(dir) {
48
- fs.mkdirSync(dir, { recursive: true });
49
- }
50
-
51
- function copyFile(src, dest, { force = true, vars = {} } = {}) {
52
- if (fs.existsSync(dest) && !force) {
53
- return { status: "skipped", dest };
54
- }
55
- ensureDir(path.dirname(dest));
56
- let content = fs.readFileSync(src, "utf8");
57
- for (const [key, value] of Object.entries(vars)) {
58
- content = content.split(`{{${key}}}`).join(value);
59
- }
60
- fs.writeFileSync(dest, content);
61
- return { status: "written", dest };
62
- }
63
-
64
- function copyDir(srcDir, destDir, options = {}) {
65
- const results = [];
66
- for (const entry of fs.readdirSync(srcDir, { withFileTypes: true })) {
67
- const src = path.join(srcDir, entry.name);
68
- const dest = path.join(destDir, entry.name);
69
- if (entry.isDirectory()) {
70
- results.push(...copyDir(src, dest, options));
71
- } else {
72
- results.push(copyFile(src, dest, options));
73
- }
74
- }
75
- return results;
76
- }
77
-
78
- function printResults(title, results) {
79
- console.log(`\n${title}`);
80
- for (const result of results) {
81
- const prefix = result.status === "skipped" ? "skip" : "write";
82
- console.log(` ${prefix} ${result.dest}`);
83
- }
84
- }
85
-
86
- function cleanupLegacy(commandsDir, skillsDir) {
87
- if (fs.existsSync(commandsDir)) {
88
- for (const entry of fs.readdirSync(commandsDir, { withFileTypes: true })) {
89
- if (!entry.isFile()) continue;
90
- const name = entry.name;
91
- const legacyPrefix = name.startsWith("srun-") || name.startsWith("asm-") || name.startsWith("sr-") || name.startsWith("scr-") || name.startsWith("src-") || name.startsWith("run-");
92
- const oldConsolidated = /^scr-[a-z]+-[a-z]+\.md$/.test(name);
93
- if (legacyPrefix || oldConsolidated) {
94
- fs.rmSync(path.join(commandsDir, name), { force: true });
95
- console.log(` rm legacy ${path.join(commandsDir, name)}`);
96
- }
97
- }
98
- }
99
- const oldSkill = path.join(skillsDir, "ai-scrum");
100
- if (fs.existsSync(oldSkill)) {
101
- fs.rmSync(oldSkill, { recursive: true, force: true });
102
- console.log(` rm legacy ${oldSkill}`);
103
- }
104
- }
105
-
106
- function install(force) {
107
- const home = os.homedir();
108
- const commandsDir = path.join(home, ".claude", "commands");
109
- cleanupLegacy(commandsDir, path.join(home, ".claude", "skills"));
110
- const results = [
111
- ...copyDir(path.join(templates, "codex", "prompts"), commandsDir, { force }),
112
- ...copyDir(path.join(templates, "codex", "skills"), path.join(home, ".claude", "skills"), { force })
113
- ];
114
- printResults("Claude ScrumRun installed", results);
115
- }
116
-
117
- function doctor() {
118
- const home = os.homedir();
119
- const checks = COMMANDS.map((command) => [
120
- command,
121
- path.join(home, ".claude", "commands", `${command}.md`)
122
- ]);
123
- checks.push(["scrumrun skill", path.join(home, ".claude", "skills", "scrumrun", "SKILL.md")]);
124
-
125
- let ok = true;
126
- for (const [label, file] of checks) {
127
- const exists = fs.existsSync(file);
128
- ok = ok && exists;
129
- console.log(`${exists ? "ok " : "miss"} ${label}`);
130
- }
131
- process.exitCode = ok ? 0 : 1;
132
- }
133
-
134
- const args = process.argv.slice(2);
135
- const command = args[0];
136
-
137
- if (!command || command === "--help" || command === "-h") {
138
- usage();
139
- } else if (command === "install" || command === "update") {
140
- install(true);
141
- } else if (command === "doctor") {
142
- doctor();
143
- } else {
24
+ if (!["install", "update", "doctor"].includes(command)) {
144
25
  console.error(`Unknown command: ${command}`);
145
- usage();
146
- process.exitCode = 1;
26
+ process.exit(1);
147
27
  }
28
+
29
+ const result = spawnSync(process.execPath, [scrumrun, "claude", command, ...args.slice(1)], {
30
+ stdio: "inherit"
31
+ });
32
+ if (result.error) throw result.error;
33
+ process.exitCode = result.status === null ? 1 : result.status;