@v11g/agents-rock 1.0.1 → 1.0.3

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 (65) hide show
  1. package/README.md +58 -14
  2. package/package.json +7 -3
  3. package/plugins/business-analyst/.claude-plugin/plugin.json +9 -0
  4. package/plugins/business-analyst/skills/business-analyst/README.md +20 -0
  5. package/plugins/business-analyst/skills/business-analyst/SKILL.md +69 -0
  6. package/plugins/business-analyst/skills/business-analyst/references/ai-extension.md +37 -0
  7. package/plugins/business-analyst/skills/business-analyst/references/frameworks.md +53 -0
  8. package/plugins/business-analyst/skills/business-analyst/references/interview.md +89 -0
  9. package/plugins/business-analyst/skills/business-analyst/references/review.md +25 -0
  10. package/plugins/business-analyst/skills/business-analyst/references/writing.md +102 -0
  11. package/plugins/business-analyst/skills/business-analyst/scripts/lib/checks.mjs +166 -0
  12. package/plugins/business-analyst/skills/business-analyst/scripts/lib/schema.mjs +78 -0
  13. package/plugins/business-analyst/skills/business-analyst/scripts/test/checks.test.mjs +188 -0
  14. package/plugins/business-analyst/skills/business-analyst/scripts/test/e2e.test.mjs +17 -0
  15. package/plugins/business-analyst/skills/business-analyst/scripts/test/fixtures/requirements-fail.json +205 -0
  16. package/plugins/business-analyst/skills/business-analyst/scripts/test/fixtures/requirements-pass.json +59 -0
  17. package/plugins/business-analyst/skills/business-analyst/scripts/test/fixtures/requirements-pass.md +63 -0
  18. package/plugins/business-analyst/skills/business-analyst/scripts/test/schema.test.mjs +41 -0
  19. package/plugins/business-analyst/skills/business-analyst/scripts/validate.mjs +20 -0
  20. package/plugins/solution-architect/skills/analyze-requirements/README.md +1 -1
  21. package/plugins/solution-architect/skills/estimate/SKILL.md +13 -5
  22. package/plugins/solution-architect/skills/estimate/assets/estimate-template-agentic.html +917 -0
  23. package/plugins/solution-architect/skills/estimate/assets/estimate-template.html +430 -13
  24. package/plugins/solution-architect/skills/estimate/references/agentic-estimation.md +148 -0
  25. package/plugins/solution-architect/skills/estimate/references/ai-multipliers.md +10 -0
  26. package/plugins/solution-architect/skills/estimate/references/interview.md +20 -1
  27. package/plugins/solution-architect/skills/estimate/references/task-shapes.md +173 -0
  28. package/plugins/solution-architect/skills/estimate/references/writing.md +31 -0
  29. package/plugins/solution-architect/skills/estimate/scripts/compute.mjs +5 -1
  30. package/plugins/solution-architect/skills/estimate/scripts/lib/agentic-checks.mjs +65 -0
  31. package/plugins/solution-architect/skills/estimate/scripts/lib/baselines.mjs +107 -0
  32. package/plugins/solution-architect/skills/estimate/scripts/lib/checks.mjs +16 -7
  33. package/plugins/solution-architect/skills/estimate/scripts/lib/inline.mjs +14 -0
  34. package/plugins/solution-architect/skills/estimate/scripts/lib/measurements.mjs +59 -0
  35. package/plugins/solution-architect/skills/estimate/scripts/lib/redact.mjs +28 -5
  36. package/plugins/solution-architect/skills/estimate/scripts/lib/rollup.mjs +53 -22
  37. package/plugins/solution-architect/skills/estimate/scripts/lib/schema.mjs +52 -7
  38. package/plugins/solution-architect/skills/estimate/scripts/render.mjs +14 -3
  39. package/plugins/solution-architect/skills/estimate/scripts/test/baselines.test.mjs +120 -0
  40. package/plugins/solution-architect/skills/estimate/scripts/test/browser.test.mjs +69 -0
  41. package/plugins/solution-architect/skills/estimate/scripts/test/compute.test.mjs +44 -0
  42. package/plugins/solution-architect/skills/estimate/scripts/test/e2e.test.mjs +28 -1
  43. package/plugins/solution-architect/skills/estimate/scripts/test/fixtures/agentic-estimation-fail.md +55 -0
  44. package/plugins/solution-architect/skills/estimate/scripts/test/fixtures/agentic-estimation-pass.md +54 -0
  45. package/plugins/solution-architect/skills/estimate/scripts/test/fixtures/agentic-inputs.json +45 -0
  46. package/plugins/solution-architect/skills/estimate/scripts/test/fixtures/measurements.jsonl +20 -0
  47. package/plugins/solution-architect/skills/estimate/scripts/test/measurements.test.mjs +54 -0
  48. package/plugins/solution-architect/skills/estimate/scripts/test/references.test.mjs +25 -1
  49. package/plugins/solution-architect/skills/estimate/scripts/test/render.test.mjs +48 -1
  50. package/plugins/solution-architect/skills/estimate/scripts/test/schema.test.mjs +59 -0
  51. package/plugins/solution-architect/skills/estimate/scripts/test/validate.test.mjs +37 -0
  52. package/plugins/solution-architect/skills/estimate/scripts/test/xlsx-export.test.mjs +168 -0
  53. package/plugins/solution-architect/skills/estimate/scripts/test/zip.mjs +41 -0
  54. package/plugins/solution-architect/skills/new-lead/SKILL.md +15 -10
  55. package/src/cli/agents.mjs +10 -10
  56. package/src/cli/args.mjs +22 -3
  57. package/src/cli/flow.mjs +85 -0
  58. package/src/cli/install.mjs +7 -8
  59. package/src/cli/main.mjs +30 -72
  60. package/src/cli/prompts.mjs +84 -0
  61. package/src/cli/report.mjs +26 -0
  62. package/src/cli/scope.mjs +34 -0
  63. package/src/cli/targets.mjs +45 -0
  64. package/src/cli/uninstall.mjs +9 -10
  65. package/src/cli/picker.mjs +0 -78
@@ -0,0 +1,84 @@
1
+ import * as clack from '@clack/prompts';
2
+ import pc from 'picocolors';
3
+ import { AGENT_LABELS } from './agents.mjs';
4
+
5
+ const HINT_WIDTH = 64;
6
+ const clip = (text) => (text.length > HINT_WIDTH ? `${text.slice(0, HINT_WIDTH - 1)}…` : text);
7
+
8
+ /** Interactive shell around @clack/prompts. Holds no decisions — flow.mjs owns those. */
9
+ export function createPrompts() {
10
+ return { pickPlugins, pickAgents, pickScope, confirmRoot, showSummary, confirmInstall };
11
+ }
12
+
13
+ async function pickPlugins(registry) {
14
+ return unwrap(await clack.multiselect({
15
+ message: 'Which plugins do you want?',
16
+ options: registry.map((plugin) => ({
17
+ value: plugin.name, label: plugin.name, hint: clip(plugin.description ?? ''),
18
+ })),
19
+ required: true,
20
+ }));
21
+ }
22
+
23
+ async function pickAgents(agents) {
24
+ return unwrap(await clack.multiselect({
25
+ message: 'Which agents should get them?',
26
+ options: agents.map((agent) => ({ value: agent, label: AGENT_LABELS[agent] ?? agent })),
27
+ initialValues: agents,
28
+ required: true,
29
+ }));
30
+ }
31
+
32
+ async function pickScope() {
33
+ return unwrap(await clack.select({
34
+ message: 'Installation scope',
35
+ options: [
36
+ { value: 'project', label: 'Project', hint: 'this project only, committed with your repo' },
37
+ { value: 'user', label: 'User', hint: 'your home dir, available in every project' },
38
+ ],
39
+ }));
40
+ }
41
+
42
+ async function confirmRoot({ detected, marker, cwd }) {
43
+ if (!detected) {
44
+ const ok = unwrap(await clack.confirm({
45
+ message: `No project root found above ${pc.cyan(cwd)}. Install here anyway?`,
46
+ }));
47
+ return ok ? cwd : null;
48
+ }
49
+ return unwrap(await clack.select({
50
+ message: 'Install into which directory?',
51
+ options: [
52
+ { value: detected, label: detected, hint: `project root — found ${marker}` },
53
+ { value: cwd, label: cwd, hint: 'current directory' },
54
+ ],
55
+ }));
56
+ }
57
+
58
+ function showSummary(plan) {
59
+ clack.note(summaryLines(plan).join('\n'), verb(plan) + ' summary');
60
+ }
61
+
62
+ async function confirmInstall(plan) {
63
+ return unwrap(await clack.confirm({ message: `Proceed with ${verb(plan).toLowerCase()}?` }));
64
+ }
65
+
66
+ function summaryLines(plan) {
67
+ const agents = plan.agents.map((agent) => AGENT_LABELS[agent] ?? agent).join(', ');
68
+ const scope = plan.scope === 'user' ? 'user (home dir)' : `project (${plan.root})`;
69
+ return [
70
+ `${pc.dim('scope: ')}${scope}`,
71
+ `${pc.dim('agents:')} ${agents}`,
72
+ `${pc.dim('skills:')} ${pc.cyan(plan.targets.canonical)}`,
73
+ ...plan.plugins.map((plugin) => ` ${plugin.name}`),
74
+ ...plan.agents.map((agent) => `${pc.dim('link: ')} ${plan.targets.agentDirs[agent]}`),
75
+ ];
76
+ }
77
+
78
+ function verb(plan) {
79
+ return plan.command === 'uninstall' ? 'Uninstall' : 'Install';
80
+ }
81
+
82
+ function unwrap(value) {
83
+ return clack.isCancel(value) ? null : value;
84
+ }
@@ -0,0 +1,26 @@
1
+ export function printResult(pluginName, result) {
2
+ for (const item of result.reused ?? []) {
3
+ console.log(`↻ ${item.skill} (canonical exists, reused)`);
4
+ }
5
+ for (const item of result.installed ?? []) {
6
+ console.log(`✔ ${pluginName}: ${item.skill} → ${item.agent} (${item.mode})`);
7
+ warnIfCopyFallback(item);
8
+ }
9
+ for (const item of result.removed ?? []) {
10
+ console.log(`✔ ${pluginName}: removed ${item.skill} ← ${item.agent}`);
11
+ }
12
+ for (const skill of result.canonicalRemoved ?? []) {
13
+ console.log(`✔ ${pluginName}: removed canonical ${skill}`);
14
+ }
15
+ for (const item of result.skipped ?? []) {
16
+ console.error(`✖ skipped ${item.path} — ${item.reason}`);
17
+ }
18
+ return (result.skipped ?? []).length;
19
+ }
20
+
21
+ function warnIfCopyFallback(item) {
22
+ if (item.mode !== 'copy') return;
23
+ console.error(
24
+ `⚠ ${item.skill} → ${item.agent} installed as plain copy — updates to the canonical skill will not propagate`,
25
+ );
26
+ }
@@ -0,0 +1,34 @@
1
+ import { existsSync } from 'node:fs';
2
+ import path from 'node:path';
3
+
4
+ const REPO_MARKERS = ['.git'];
5
+ const MANIFEST_MARKERS = ['package.json', 'pyproject.toml', 'go.mod', 'Cargo.toml'];
6
+
7
+ /**
8
+ * Walk up from `cwd` looking for a project root. A repo marker anywhere up the
9
+ * tree outranks a nearer manifest, so a monorepo package resolves to the repo.
10
+ * Returns `{ root, marker }`, or null when nothing is found by `stopAt`.
11
+ */
12
+ export function findProjectRoot(cwd, stopAt = path.parse(path.resolve(cwd)).root) {
13
+ return search(cwd, stopAt, REPO_MARKERS) ?? search(cwd, stopAt, MANIFEST_MARKERS);
14
+ }
15
+
16
+ function search(cwd, stopAt, markers) {
17
+ for (const dir of ancestors(cwd, stopAt)) {
18
+ const marker = markers.find((name) => existsSync(path.join(dir, name)));
19
+ if (marker) return { root: dir, marker };
20
+ }
21
+ return null;
22
+ }
23
+
24
+ function* ancestors(cwd, stopAt) {
25
+ const boundary = path.resolve(stopAt);
26
+ let dir = path.resolve(cwd);
27
+ while (dir !== boundary) {
28
+ yield dir;
29
+ const parent = path.dirname(dir);
30
+ if (parent === dir) return;
31
+ dir = parent;
32
+ }
33
+ yield boundary;
34
+ }
@@ -0,0 +1,45 @@
1
+ import { homedir } from 'node:os';
2
+ import path from 'node:path';
3
+ import { UsageError } from './args.mjs';
4
+ import { AGENT_HOMES, ALL_AGENTS } from './agents.mjs';
5
+
6
+ const CANONICAL = ['.agents', 'skills'];
7
+
8
+ /**
9
+ * Resolve every path an install writes to. Both scopes share one shape —
10
+ * a canonical skills dir plus one skills dir per agent — so install and
11
+ * uninstall stay scope-agnostic.
12
+ */
13
+ export function resolveTargets({ scope, root, home = homedir(), env = process.env }) {
14
+ if (scope === 'project') return projectTargets(requireRoot(root));
15
+ if (scope === 'user') return userTargets(home, env);
16
+ throw new UsageError(`Unknown scope: ${scope}`);
17
+ }
18
+
19
+ function requireRoot(root) {
20
+ if (!root) throw new UsageError('Project scope needs a project root.');
21
+ return root;
22
+ }
23
+
24
+ function projectTargets(root) {
25
+ return {
26
+ canonical: path.join(root, ...CANONICAL),
27
+ agentDirs: mapAgents((agent) => path.join(root, AGENT_HOMES[agent].dir, 'skills')),
28
+ };
29
+ }
30
+
31
+ function userTargets(home, env) {
32
+ return {
33
+ canonical: path.join(home, ...CANONICAL),
34
+ agentDirs: mapAgents((agent) => path.join(agentHome(agent, home, env), 'skills')),
35
+ };
36
+ }
37
+
38
+ function agentHome(agent, home, env) {
39
+ const { dir, env: key } = AGENT_HOMES[agent];
40
+ return env[key]?.trim() || path.join(home, dir);
41
+ }
42
+
43
+ function mapAgents(dirFor) {
44
+ return Object.fromEntries(ALL_AGENTS.map((agent) => [agent, dirFor(agent)]));
45
+ }
@@ -1,21 +1,20 @@
1
1
  import { existsSync, lstatSync, rmSync } from 'node:fs';
2
2
  import path from 'node:path';
3
3
  import { listSkills } from './registry.mjs';
4
- import { agentSkillsDir, canonicalSkillsDir, ALL_AGENTS } from './agents.mjs';
5
4
 
6
- export function uninstallPlugin({ pluginDir, cwd, agents, force = false }) {
5
+ export function uninstallPlugin({ pluginDir, targets, agents, force = false }) {
7
6
  const result = { removed: [], canonicalRemoved: [], skipped: [] };
8
7
  for (const skill of listSkills(pluginDir)) {
9
8
  for (const agent of agents) {
10
- removeAgentEntry({ skill: skill.name, agent, cwd, force, result });
9
+ removeAgentEntry({ skill: skill.name, agent, targets, force, result });
11
10
  }
12
- maybeRemoveCanonical(skill.name, cwd, result);
11
+ maybeRemoveCanonical(skill.name, targets, result);
13
12
  }
14
13
  return result;
15
14
  }
16
15
 
17
- function removeAgentEntry({ skill, agent, cwd, force, result }) {
18
- const linkPath = path.join(agentSkillsDir(agent, cwd), skill);
16
+ function removeAgentEntry({ skill, agent, targets, force, result }) {
17
+ const linkPath = path.join(targets.agentDirs[agent], skill);
19
18
  let stat;
20
19
  try { stat = lstatSync(linkPath); } catch { return; }
21
20
  if (!stat.isSymbolicLink() && !force) {
@@ -25,13 +24,13 @@ function removeAgentEntry({ skill, agent, cwd, force, result }) {
25
24
  result.removed.push({ skill, agent });
26
25
  }
27
26
 
28
- function maybeRemoveCanonical(skill, cwd, result) {
29
- const stillReferenced = ALL_AGENTS.some((agent) => {
30
- try { return Boolean(lstatSync(path.join(agentSkillsDir(agent, cwd), skill))); }
27
+ function maybeRemoveCanonical(skill, targets, result) {
28
+ const stillReferenced = Object.values(targets.agentDirs).some((dir) => {
29
+ try { return Boolean(lstatSync(path.join(dir, skill))); }
31
30
  catch { return false; }
32
31
  });
33
32
  if (stillReferenced) return;
34
- const canonical = path.join(canonicalSkillsDir(cwd), skill);
33
+ const canonical = path.join(targets.canonical, skill);
35
34
  if (!existsSync(canonical)) return;
36
35
  rmSync(canonical, { recursive: true, force: true });
37
36
  result.canonicalRemoved.push(skill);
@@ -1,78 +0,0 @@
1
- import readline from 'node:readline';
2
-
3
- export function createPickerState(items) {
4
- return { items, cursor: 0, selected: new Set() };
5
- }
6
-
7
- export function reduceKey(state, key) {
8
- if (key === 'up') return { ...state, cursor: Math.max(0, state.cursor - 1) };
9
- if (key === 'down') {
10
- return { ...state, cursor: Math.min(state.items.length - 1, state.cursor + 1) };
11
- }
12
- if (key === 'space') return toggle(state);
13
- return state;
14
- }
15
-
16
- function toggle(state) {
17
- const selected = new Set(state.selected);
18
- const value = state.items[state.cursor].value;
19
- if (selected.has(value)) selected.delete(value);
20
- else selected.add(value);
21
- return { ...state, selected };
22
- }
23
-
24
- export function renderPicker(state, title) {
25
- const rows = state.items.map((item, i) => {
26
- const cursor = i === state.cursor ? '>' : ' ';
27
- const mark = state.selected.has(item.value) ? '[x]' : '[ ]';
28
- const hint = item.hint ? ` ${item.hint}` : '';
29
- return `${cursor} ${mark} ${item.label}${hint}`;
30
- });
31
- return [title, ...rows, '(space: toggle, enter: confirm, ctrl-c: cancel)'].join('\n');
32
- }
33
-
34
- export function runPicker({ title, items }) {
35
- return new Promise((resolve) => {
36
- const session = { state: createPickerState(items), title, rendered: 0 };
37
- readline.emitKeypressEvents(process.stdin);
38
- process.stdin.setRawMode(true);
39
- process.stdin.resume();
40
- const onKey = makeKeyHandler(session, (value) => {
41
- teardown(onKey);
42
- resolve(value);
43
- });
44
- process.stdin.on('keypress', onKey);
45
- draw(session);
46
- });
47
- }
48
-
49
- function makeKeyHandler(session, finish) {
50
- return (str, key) => {
51
- try {
52
- if (key.ctrl && key.name === 'c') return finish(null);
53
- if (key.name === 'return') return finish([...session.state.selected]);
54
- session.state = reduceKey(session.state, keyName(key));
55
- draw(session);
56
- } catch {
57
- finish(null);
58
- }
59
- };
60
- }
61
-
62
- function keyName(key) {
63
- if (key.name === 'up' || key.name === 'down' || key.name === 'space') return key.name;
64
- return '';
65
- }
66
-
67
- function draw(session) {
68
- if (session.rendered > 0) process.stdout.write(`\x1b[${session.rendered}A\x1b[J`);
69
- const text = renderPicker(session.state, session.title);
70
- session.rendered = text.split('\n').length;
71
- process.stdout.write(text + '\n');
72
- }
73
-
74
- function teardown(onKey) {
75
- process.stdin.setRawMode(false);
76
- process.stdin.pause();
77
- process.stdin.removeListener('keypress', onKey);
78
- }