@windyroad/jtbd 0.5.0 → 0.5.1-preview.103

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.
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "wr-jtbd",
3
- "version": "0.1.0",
3
+ "version": "0.5.1",
4
4
  "description": "Jobs-to-be-done enforcement for Claude Code"
5
- }
5
+ }
package/agents/agent.md CHANGED
@@ -45,6 +45,10 @@ All review criteria come from the JTBD documentation. Read the docs first and ap
45
45
  - If the change involves API interactions, do the actions align with the job's expected flow?
46
46
  - Are new actions documented in the relevant job's action list?
47
47
 
48
+ ## Output Formatting
49
+
50
+ When referencing JTBD IDs, problem IDs (P<NNN>), or ADR IDs in prose output, always include the human-readable title on first mention. Use the format `JTBD-001 (Enforce Governance Without Slowing Down)`, not bare `JTBD-001`.
51
+
48
52
  ## How to Report
49
53
 
50
54
  If the change aligns with documented jobs:
@@ -0,0 +1,26 @@
1
+ #!/usr/bin/env bats
2
+ # Doc-lint guard: jtbd agent.md must include the output formatting rule
3
+ # requiring human-readable titles alongside bare IDs (P032).
4
+ #
5
+ # Structural assertion — Permitted Exception to the source-grep ban (ADR-005 / P011).
6
+ #
7
+ # Cross-reference:
8
+ # P032 (agent output uses opaque IDs without titles)
9
+ # @jtbd JTBD-001 (enforce governance without slowing down)
10
+
11
+ setup() {
12
+ AGENT_DIR="$(cd "$(dirname "$BATS_TEST_FILENAME")/.." && pwd)"
13
+ AGENT_FILE="${AGENT_DIR}/agent.md"
14
+ }
15
+
16
+ @test "agent.md contains output formatting section" {
17
+ run grep -n "## Output Formatting" "$AGENT_FILE"
18
+ [ "$status" -eq 0 ]
19
+ }
20
+
21
+ @test "agent.md output formatting rule requires titles with IDs (P032)" {
22
+ run grep -n "title" "$AGENT_FILE"
23
+ [ "$status" -eq 0 ]
24
+ run grep -n "Output Formatting" "$AGENT_FILE"
25
+ [ "$status" -eq 0 ]
26
+ }
package/bin/install.mjs CHANGED
@@ -37,7 +37,7 @@ utils.checkPrerequisites();
37
37
  if (flags.uninstall) {
38
38
  utils.uninstallPackage(PLUGIN);
39
39
  } else if (flags.update) {
40
- utils.updatePackage(PLUGIN);
40
+ utils.updatePackage(PLUGIN, { scope: flags.scope });
41
41
  } else {
42
42
  utils.installPackage(PLUGIN, { deps: DEPS, scope: flags.scope });
43
43
  }
@@ -22,7 +22,10 @@ REQUIRED ACTIONS:
22
22
  4. Do NOT skip this step even if you think you can handle it yourself
23
23
 
24
24
  SCOPE: All project files.
25
- Does NOT apply to: CSS, images, fonts, lockfiles, changesets, memory files, plan files.
25
+ Does NOT apply to: CSS, images, fonts, lockfiles, changesets, memory files,
26
+ plan files, docs/problems/ (problem tickets), docs/BRIEFING.md,
27
+ RISK-POLICY.md, .risk-reports/, docs/jtbd/, docs/JOBS_TO_BE_DONE.md,
28
+ docs/PRODUCT_DISCOVERY.md, docs/VOICE-AND-TONE.md, docs/STYLE-GUIDE.md.
26
29
  HOOK_OUTPUT
27
30
  elif [ -f "docs/JOBS_TO_BE_DONE.md" ]; then
28
31
  cat <<'HOOK_OUTPUT'
@@ -42,7 +45,10 @@ REQUIRED ACTIONS:
42
45
  4. Do NOT skip this step even if you think you can handle it yourself
43
46
 
44
47
  SCOPE: All project files.
45
- Does NOT apply to: CSS, images, fonts, lockfiles, changesets, memory files, plan files.
48
+ Does NOT apply to: CSS, images, fonts, lockfiles, changesets, memory files,
49
+ plan files, docs/problems/ (problem tickets), docs/BRIEFING.md,
50
+ RISK-POLICY.md, .risk-reports/, docs/jtbd/, docs/JOBS_TO_BE_DONE.md,
51
+ docs/PRODUCT_DISCOVERY.md, docs/VOICE-AND-TONE.md, docs/STYLE-GUIDE.md.
46
52
  HOOK_OUTPUT
47
53
  else
48
54
  cat <<'HOOK_OUTPUT'
@@ -0,0 +1,39 @@
1
+ #!/usr/bin/env bats
2
+
3
+ # Tests for jtbd-eval.sh (UserPromptSubmit) — verifies the injected scope
4
+ # exclusion text lists governance docs that the PreToolUse gate already
5
+ # exempts (P029). Without this, the LLM wastes time delegating to the
6
+ # jtbd-lead for files the edit gate would allow anyway.
7
+
8
+ setup() {
9
+ SCRIPT_DIR="$(cd "$(dirname "$BATS_TEST_FILENAME")/.." && pwd)"
10
+ HOOK="$SCRIPT_DIR/jtbd-eval.sh"
11
+ ORIG_DIR="$PWD"
12
+ TEST_DIR=$(mktemp -d)
13
+ cd "$TEST_DIR"
14
+ mkdir -p docs/jtbd
15
+ echo "# Index" > docs/jtbd/README.md
16
+ }
17
+
18
+ teardown() {
19
+ cd "$ORIG_DIR"
20
+ rm -rf "$TEST_DIR"
21
+ }
22
+
23
+ @test "eval: scope text mentions problem files exemption (P029)" {
24
+ run bash "$HOOK"
25
+ [ "$status" -eq 0 ]
26
+ [[ "$output" == *"docs/problems/"* ]] || [[ "$output" == *"problem tickets"* ]]
27
+ }
28
+
29
+ @test "eval: scope text mentions BRIEFING.md exemption (P029)" {
30
+ run bash "$HOOK"
31
+ [ "$status" -eq 0 ]
32
+ [[ "$output" == *"BRIEFING"* ]]
33
+ }
34
+
35
+ @test "eval: scope text mentions RISK-POLICY exemption (P029)" {
36
+ run bash "$HOOK"
37
+ [ "$status" -eq 0 ]
38
+ [[ "$output" == *"RISK-POLICY"* ]]
39
+ }
@@ -62,8 +62,11 @@ export function installPlugin(pluginName, { scope = "project" } = {}) {
62
62
  );
63
63
  }
64
64
 
65
- export function updatePlugin(pluginName) {
66
- return run(`claude plugin update ${pluginName}`, pluginName);
65
+ export function updatePlugin(pluginName, { scope = "project" } = {}) {
66
+ return run(
67
+ `claude plugin update "${pluginName}@${MARKETPLACE_NAME}" --scope ${scope}`,
68
+ pluginName
69
+ );
67
70
  }
68
71
 
69
72
  export function uninstallPlugin(pluginName) {
@@ -94,14 +97,14 @@ export function installPackage(pluginName, { deps = [], scope = "project" } = {}
94
97
  /**
95
98
  * Update a single package.
96
99
  */
97
- export function updatePackage(pluginName) {
100
+ export function updatePackage(pluginName, { scope = "project" } = {}) {
98
101
  console.log(`\nUpdating @windyroad/${pluginName.replace("wr-", "")}...\n`);
99
102
 
100
103
  run(
101
104
  `claude plugin marketplace update ${MARKETPLACE_NAME}`,
102
105
  "Updating marketplace"
103
106
  );
104
- updatePlugin(pluginName);
107
+ updatePlugin(pluginName, { scope });
105
108
 
106
109
  console.log("\nDone! Restart Claude Code to apply updates.\n");
107
110
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@windyroad/jtbd",
3
- "version": "0.5.0",
3
+ "version": "0.5.1-preview.103",
4
4
  "description": "Jobs-to-be-done enforcement for UI changes",
5
5
  "bin": {
6
6
  "windyroad-jtbd": "./bin/install.mjs"
@@ -17,6 +17,10 @@ This skill is **read-only**. It does not commit, push, or modify files.
17
17
  - After a significant capability change: check whether existing jobs are still served
18
18
  - Any time the hook gate is not convenient: planning mode, spike work, design review
19
19
 
20
+ ## Output Formatting
21
+
22
+ When referencing JTBD IDs, problem IDs (P<NNN>), or ADR IDs in prose output, always include the human-readable title on first mention. Use the format `JTBD-001 (Enforce Governance Without Slowing Down)`, not bare `JTBD-001`.
23
+
20
24
  ## Steps
21
25
 
22
26
  ### 1. Parse arguments