dev-playbooks 1.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 (142) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +463 -0
  3. package/bin/devbooks.js +986 -0
  4. package/package.json +41 -0
  5. package/skills/Skill-Development-Guide.md +249 -0
  6. package/skills/Skills-Usage-Guide.md +447 -0
  7. package/skills/_shared/context-detection-template.md +315 -0
  8. package/skills/_shared/mcp-enhancement-template.md +144 -0
  9. package/skills/_shared/references/universal-gating-protocol.md +114 -0
  10. package/skills/_template/config-discovery-template.md +126 -0
  11. package/skills/devbooks-brownfield-bootstrap/SKILL.md +168 -0
  12. package/skills/devbooks-brownfield-bootstrap/references/10-glossary-template.md +42 -0
  13. package/skills/devbooks-brownfield-bootstrap/references/brownfield-bootstrap-prompt.md +115 -0
  14. package/skills/devbooks-brownfield-bootstrap/references/brownfield-bootstrap.md +96 -0
  15. package/skills/devbooks-brownfield-bootstrap/references/code-navigation-strategy.md +203 -0
  16. package/skills/devbooks-brownfield-bootstrap/scripts/cod-update.sh +357 -0
  17. package/skills/devbooks-brownfield-bootstrap/templates/project-profile-template.md +172 -0
  18. package/skills/devbooks-c4-map/SKILL.md +151 -0
  19. package/skills/devbooks-c4-map/references/c4-architecture-map-prompt.md +33 -0
  20. package/skills/devbooks-c4-map/references/layered-constraint-checklist.md +185 -0
  21. package/skills/devbooks-code-review/SKILL.md +175 -0
  22. package/skills/devbooks-code-review/references/code-review-prompt.md +100 -0
  23. package/skills/devbooks-code-review/references/code-smell-cheatsheet.md +498 -0
  24. package/skills/devbooks-code-review/references/pr-template-and-guidelines.md +321 -0
  25. package/skills/devbooks-code-review/references/resource-management-review-checklist.md +311 -0
  26. package/skills/devbooks-coder/SKILL.md +219 -0
  27. package/skills/devbooks-coder/references/code-implementation-prompt.md +74 -0
  28. package/skills/devbooks-coder/references/coding-style-guidelines.md +351 -0
  29. package/skills/devbooks-coder/references/error-code-standard.md +463 -0
  30. package/skills/devbooks-coder/references/logging-standard.md +329 -0
  31. package/skills/devbooks-coder/references/low-risk-modification-techniques.md +275 -0
  32. package/skills/devbooks-delivery-workflow/SKILL.md +217 -0
  33. package/skills/devbooks-delivery-workflow/references/9-change-verification-traceability-template.md +133 -0
  34. package/skills/devbooks-delivery-workflow/references/delivery-acceptance-workflow.md +177 -0
  35. package/skills/devbooks-delivery-workflow/references/prototype-production-dual-track.md +169 -0
  36. package/skills/devbooks-delivery-workflow/scripts/ac-trace-check.sh +330 -0
  37. package/skills/devbooks-delivery-workflow/scripts/audit-scope.sh +262 -0
  38. package/skills/devbooks-delivery-workflow/scripts/change-check.sh +1039 -0
  39. package/skills/devbooks-delivery-workflow/scripts/change-codemod-scaffold.sh +135 -0
  40. package/skills/devbooks-delivery-workflow/scripts/change-evidence.sh +152 -0
  41. package/skills/devbooks-delivery-workflow/scripts/change-scaffold.sh +467 -0
  42. package/skills/devbooks-delivery-workflow/scripts/change-spec-delta-scaffold.sh +135 -0
  43. package/skills/devbooks-delivery-workflow/scripts/constitution-check.sh +237 -0
  44. package/skills/devbooks-delivery-workflow/scripts/env-match-check.sh +128 -0
  45. package/skills/devbooks-delivery-workflow/scripts/fitness-check.sh +365 -0
  46. package/skills/devbooks-delivery-workflow/scripts/guardrail-check.sh +516 -0
  47. package/skills/devbooks-delivery-workflow/scripts/handoff-check.sh +141 -0
  48. package/skills/devbooks-delivery-workflow/scripts/hygiene-check.sh +340 -0
  49. package/skills/devbooks-delivery-workflow/scripts/migrate-from-openspec.sh +385 -0
  50. package/skills/devbooks-delivery-workflow/scripts/migrate-to-v2-gates.sh +202 -0
  51. package/skills/devbooks-delivery-workflow/scripts/progress-dashboard.sh +319 -0
  52. package/skills/devbooks-delivery-workflow/scripts/prototype-promote.sh +341 -0
  53. package/skills/devbooks-delivery-workflow/scripts/spec-preview.sh +203 -0
  54. package/skills/devbooks-delivery-workflow/scripts/spec-promote.sh +118 -0
  55. package/skills/devbooks-delivery-workflow/scripts/spec-rollback.sh +124 -0
  56. package/skills/devbooks-delivery-workflow/scripts/spec-stage.sh +117 -0
  57. package/skills/devbooks-delivery-workflow/scripts/verify-all.sh +78 -0
  58. package/skills/devbooks-delivery-workflow/scripts/verify-npm-package.sh +123 -0
  59. package/skills/devbooks-delivery-workflow/scripts/verify-openspec-free.sh +81 -0
  60. package/skills/devbooks-delivery-workflow/scripts/verify-slash-commands.sh +146 -0
  61. package/skills/devbooks-delivery-workflow/templates/handoff.md +50 -0
  62. package/skills/devbooks-design-backport/SKILL.md +73 -0
  63. package/skills/devbooks-design-backport/references/design-backport-prompt.md +132 -0
  64. package/skills/devbooks-design-doc/SKILL.md +121 -0
  65. package/skills/devbooks-design-doc/references/design-doc-prompt.md +188 -0
  66. package/skills/devbooks-design-doc/references/microservice-design-checklist.md +149 -0
  67. package/skills/devbooks-design-doc/references/privacy-compliance-checklist.md +240 -0
  68. package/skills/devbooks-entropy-monitor/SKILL.md +188 -0
  69. package/skills/devbooks-entropy-monitor/references/entropy-metrics-methodology.md +218 -0
  70. package/skills/devbooks-entropy-monitor/scripts/entropy-measure.sh +449 -0
  71. package/skills/devbooks-entropy-monitor/scripts/entropy-report.sh +303 -0
  72. package/skills/devbooks-entropy-monitor/templates/thresholds.json +99 -0
  73. package/skills/devbooks-federation/SKILL.md +264 -0
  74. package/skills/devbooks-federation/scripts/federation-check.sh +144 -0
  75. package/skills/devbooks-federation/templates/federation.yaml +89 -0
  76. package/skills/devbooks-impact-analysis/SKILL.md +135 -0
  77. package/skills/devbooks-impact-analysis/references/impact-analysis-prompt.md +82 -0
  78. package/skills/devbooks-impact-analysis/scripts/graph-cache.sh +214 -0
  79. package/skills/devbooks-implementation-plan/SKILL.md +83 -0
  80. package/skills/devbooks-implementation-plan/references/implementation-plan-prompt.md +95 -0
  81. package/skills/devbooks-index-bootstrap/SKILL.md +240 -0
  82. package/skills/devbooks-proposal-author/SKILL.md +83 -0
  83. package/skills/devbooks-proposal-author/references/proposal-authoring-prompt.md +66 -0
  84. package/skills/devbooks-proposal-challenger/SKILL.md +86 -0
  85. package/skills/devbooks-proposal-challenger/references/ethics-and-compliance-checklist.md +176 -0
  86. package/skills/devbooks-proposal-challenger/references/proposal-challenge-prompt.md +57 -0
  87. package/skills/devbooks-proposal-debate-workflow/SKILL.md +78 -0
  88. package/skills/devbooks-proposal-debate-workflow/references/11-proposal-debate-template.md +35 -0
  89. package/skills/devbooks-proposal-debate-workflow/references/proposal-debate-workflow.md +24 -0
  90. package/skills/devbooks-proposal-debate-workflow/scripts/proposal-debate-check.sh +102 -0
  91. package/skills/devbooks-proposal-judge/SKILL.md +78 -0
  92. package/skills/devbooks-proposal-judge/references/proposal-judge-prompt.md +37 -0
  93. package/skills/devbooks-router/SKILL.md +346 -0
  94. package/skills/devbooks-spec-contract/SKILL.md +191 -0
  95. package/skills/devbooks-spec-contract/references/api-design-guide.md +349 -0
  96. package/skills/devbooks-spec-contract/references/contract-and-data-definition-prompt.md +85 -0
  97. package/skills/devbooks-spec-contract/references/implicit-change-detection-prompt.md +183 -0
  98. package/skills/devbooks-spec-contract/references/spec-change-prompt.md +63 -0
  99. package/skills/devbooks-spec-contract/scripts/implicit-change-detect.sh +378 -0
  100. package/skills/devbooks-spec-gardener/SKILL.md +73 -0
  101. package/skills/devbooks-spec-gardener/references/spec-gardener-prompt.md +41 -0
  102. package/skills/devbooks-test-owner/SKILL.md +173 -0
  103. package/skills/devbooks-test-owner/references/9-change-verification-traceability-template.md +133 -0
  104. package/skills/devbooks-test-owner/references/async-system-test-strategy.md +316 -0
  105. package/skills/devbooks-test-owner/references/decoupling-techniques-cheatsheet.md +269 -0
  106. package/skills/devbooks-test-owner/references/test-code-prompt.md +171 -0
  107. package/skills/devbooks-test-owner/references/test-driven-development.md +351 -0
  108. package/skills/devbooks-test-owner/references/test-layering-strategy.md +281 -0
  109. package/skills/devbooks-test-reviewer/SKILL.md +189 -0
  110. package/templates/.devbooks/config.yaml +88 -0
  111. package/templates/claude-commands/devbooks/apply.md +38 -0
  112. package/templates/claude-commands/devbooks/archive.md +33 -0
  113. package/templates/claude-commands/devbooks/backport.md +19 -0
  114. package/templates/claude-commands/devbooks/bootstrap.md +20 -0
  115. package/templates/claude-commands/devbooks/c4.md +20 -0
  116. package/templates/claude-commands/devbooks/challenger.md +19 -0
  117. package/templates/claude-commands/devbooks/code.md +20 -0
  118. package/templates/claude-commands/devbooks/debate.md +20 -0
  119. package/templates/claude-commands/devbooks/delivery.md +20 -0
  120. package/templates/claude-commands/devbooks/design.md +20 -0
  121. package/templates/claude-commands/devbooks/entropy.md +19 -0
  122. package/templates/claude-commands/devbooks/federation.md +19 -0
  123. package/templates/claude-commands/devbooks/gardener.md +19 -0
  124. package/templates/claude-commands/devbooks/impact.md +19 -0
  125. package/templates/claude-commands/devbooks/index.md +19 -0
  126. package/templates/claude-commands/devbooks/judge.md +19 -0
  127. package/templates/claude-commands/devbooks/plan.md +20 -0
  128. package/templates/claude-commands/devbooks/proposal.md +20 -0
  129. package/templates/claude-commands/devbooks/quick.md +43 -0
  130. package/templates/claude-commands/devbooks/review.md +20 -0
  131. package/templates/claude-commands/devbooks/router.md +19 -0
  132. package/templates/claude-commands/devbooks/spec.md +20 -0
  133. package/templates/claude-commands/devbooks/test-review.md +19 -0
  134. package/templates/claude-commands/devbooks/test.md +20 -0
  135. package/templates/dev-playbooks/changes/.gitkeep +1 -0
  136. package/templates/dev-playbooks/constitution.md +116 -0
  137. package/templates/dev-playbooks/project.md +96 -0
  138. package/templates/dev-playbooks/scripts/.gitkeep +1 -0
  139. package/templates/dev-playbooks/specs/_meta/anti-patterns/.gitkeep +2 -0
  140. package/templates/dev-playbooks/specs/_meta/glossary.md +48 -0
  141. package/templates/dev-playbooks/specs/_meta/project-profile.md +79 -0
  142. package/templates/dev-playbooks/specs/architecture/fitness-rules.md +95 -0
@@ -0,0 +1,123 @@
1
+ #!/bin/bash
2
+ # verify-npm-package.sh - Verify npm package structure
3
+ #
4
+ # Verify AC-011 ~ AC-016
5
+
6
+ set -uo pipefail # Remove -e, handle errors manually
7
+
8
+ GREEN='\033[0;32m'
9
+ RED='\033[0;31m'
10
+ NC='\033[0m'
11
+
12
+ PASSED=0
13
+ FAILED=0
14
+
15
+ check() {
16
+ local name="$1"
17
+ local result="$2"
18
+ if [[ "$result" == "0" ]]; then
19
+ echo -e "${GREEN}✅ $name${NC}"
20
+ PASSED=$((PASSED + 1))
21
+ else
22
+ echo -e "${RED}❌ $name${NC}"
23
+ FAILED=$((FAILED + 1))
24
+ fi
25
+ }
26
+
27
+ echo "=== npm Package Verification ==="
28
+ echo ""
29
+
30
+ # Use an isolated npm cache to avoid permission issues in CI/dev environments.
31
+ NPM_CACHE_DIR="$(mktemp -d 2>/dev/null || mktemp -d -t 'devbooks-npm-cache')"
32
+ cleanup() {
33
+ rm -rf "$NPM_CACHE_DIR"
34
+ }
35
+ trap cleanup EXIT
36
+
37
+ # AC-011: CLI entry exists and is executable
38
+ # Note: Design changed to `devbooks init` instead of `create-devbooks`
39
+ echo "AC-011: Checking CLI entry..."
40
+ if [[ -f "bin/devbooks.js" ]] && [[ -x "bin/devbooks.js" ]]; then
41
+ check "AC-011: CLI entry exists and is executable" "0"
42
+ else
43
+ check "AC-011: CLI entry exists and is executable" "1"
44
+ fi
45
+
46
+ # AC-012: package.json exists and is valid
47
+ echo "AC-012: Checking package.json..."
48
+ if [[ -f "package.json" ]] && node -e '
49
+ const fs = require("fs");
50
+ const pkg = JSON.parse(fs.readFileSync("package.json", "utf8"));
51
+ const hasName = typeof pkg.name === "string" && pkg.name.trim().length > 0;
52
+ const bin = pkg.bin;
53
+ const normalize = (p) => (typeof p === "string" && p.startsWith("./")) ? p.slice(2) : p;
54
+ const hasBin = (() => {
55
+ if (typeof bin === "string") return normalize(bin) === "bin/devbooks.js";
56
+ if (!bin || typeof bin !== "object") return false;
57
+ return Object.values(bin).some(v => typeof v === "string" && normalize(v) === "bin/devbooks.js");
58
+ })();
59
+ process.exit(hasName && hasBin ? 0 : 1);
60
+ ' >/dev/null 2>&1; then
61
+ check "AC-012: package.json exists and is valid" "0"
62
+ else
63
+ check "AC-012: package.json exists and is valid" "1"
64
+ fi
65
+
66
+ # AC-013: templates/ directory exists
67
+ echo "AC-013: Checking templates/ directory..."
68
+ if [[ -d "templates" ]]; then
69
+ check "AC-013: templates/ directory exists" "0"
70
+ else
71
+ check "AC-013: templates/ directory exists" "1"
72
+ fi
73
+
74
+ # AC-014: Skills count is correct (21 devbooks-* Skills)
75
+ echo "AC-014: Checking Skills count..."
76
+ skill_count=$(ls -d skills/devbooks-* 2>/dev/null | wc -l | tr -d ' ')
77
+ if [[ "$skill_count" -ge 20 ]]; then
78
+ check "AC-014: Skills count is correct ($skill_count)" "0"
79
+ else
80
+ check "AC-014: Skills count is correct ($skill_count, expected >= 20)" "1"
81
+ fi
82
+
83
+ # AC-015: Packaging is controlled (files whitelist or .npmignore)
84
+ echo "AC-015: Checking packaging control..."
85
+ has_files_whitelist="1"
86
+ if [[ -f "package.json" ]] && node -e '
87
+ const fs = require("fs");
88
+ const pkg = JSON.parse(fs.readFileSync("package.json", "utf8"));
89
+ const files = pkg.files;
90
+ const ok = Array.isArray(files) && files.length > 0;
91
+ process.exit(ok ? 0 : 1);
92
+ ' >/dev/null 2>&1; then
93
+ has_files_whitelist="0"
94
+ fi
95
+ if [[ "$has_files_whitelist" == "0" || -f ".npmignore" ]]; then
96
+ check "AC-015: packaging is controlled" "0"
97
+ else
98
+ check "AC-015: packaging is controlled" "1"
99
+ fi
100
+
101
+ # AC-016: npm pack does not include project change packages (exclude template directory)
102
+ # Note: templates/dev-playbooks/changes/ is user project template, should be included
103
+ # dev-playbooks/changes/ is project development change package, should be excluded
104
+ echo "AC-016: Checking npm pack output..."
105
+ pack_output="$(npm --cache "$NPM_CACHE_DIR" pack --dry-run --ignore-scripts 2>&1 || true)"
106
+ if echo "$pack_output" | grep "changes/" | grep -v "templates/" | grep -q "changes/"; then
107
+ check "AC-016: npm pack does not include changes/" "1"
108
+ else
109
+ check "AC-016: npm pack does not include changes/" "0"
110
+ fi
111
+
112
+ echo ""
113
+ echo "=== Results ==="
114
+ echo "Passed: $PASSED"
115
+ echo "Failed: $FAILED"
116
+
117
+ if [[ $FAILED -eq 0 ]]; then
118
+ echo -e "${GREEN}All passed!${NC}"
119
+ exit 0
120
+ else
121
+ echo -e "${RED}Some checks failed${NC}"
122
+ exit 1
123
+ fi
@@ -0,0 +1,81 @@
1
+ #!/bin/bash
2
+ # verify-openspec-free.sh - Verify OpenSpec references are removed
3
+ #
4
+ # Verifies AC-001 ~ AC-004
5
+
6
+ set -uo pipefail # omit -e; handle errors manually
7
+
8
+ GREEN='\033[0;32m'
9
+ RED='\033[0;31m'
10
+ NC='\033[0m'
11
+
12
+ PASSED=0
13
+ FAILED=0
14
+
15
+ check() {
16
+ local name="$1"
17
+ local result="$2"
18
+ if [[ "$result" == "0" ]]; then
19
+ echo -e "${GREEN}✅ $name${NC}"
20
+ PASSED=$((PASSED + 1))
21
+ else
22
+ echo -e "${RED}❌ $name${NC}"
23
+ FAILED=$((FAILED + 1))
24
+ fi
25
+ }
26
+
27
+ echo "=== OpenSpec removal verification ==="
28
+ echo ""
29
+
30
+ # AC-001: No OpenSpec references (exclude legitimate references)
31
+ echo "AC-001: Checking OpenSpec references..."
32
+ # Exclude legitimate references:
33
+ # - backup, changes, .git: history / work dirs
34
+ # - migrate-from-openspec.sh: migration script
35
+ # - verify-*.sh: verification scripts
36
+ # - c4.md: architecture doc (records historical changes)
37
+ # - specs/config-protocol/spec.md: rules definition doc
38
+ # - specs/slash-commands/spec.md: historical record doc
39
+ ref_count=$(grep -rn "openspec\|OpenSpec" . --include="*.md" --include="*.sh" --include="*.yaml" --include="*.yml" --include="*.js" 2>/dev/null | grep -v backup | grep -v changes | grep -v "\.git" | grep -v "DEVBOOKS-EVOLUTION-PROPOSAL.md" | grep -v "migrate-from-openspec.sh" | grep -v "tests/" | grep -v "verify-openspec-free.sh" | grep -v "verify-all.sh" | grep -v "c4.md" | grep -v "specs/config-protocol/spec.md" | grep -v "specs/slash-commands/spec.md" | wc -l | tr -d ' ') || ref_count=0
40
+ if [[ "$ref_count" == "0" ]]; then
41
+ check "AC-001: OpenSpec references = 0" "0"
42
+ else
43
+ check "AC-001: OpenSpec references = 0 (remaining: $ref_count)" "1"
44
+ fi
45
+
46
+ # AC-002: setup/openspec removed
47
+ echo "AC-002: Checking setup/openspec directory..."
48
+ if [[ ! -d "setup/openspec" ]]; then
49
+ check "AC-002: setup/openspec removed" "0"
50
+ else
51
+ check "AC-002: setup/openspec removed" "1"
52
+ fi
53
+
54
+ # AC-003: .claude/commands/openspec removed
55
+ echo "AC-003: Checking .claude/commands/openspec directory..."
56
+ if [[ ! -d ".claude/commands/openspec" ]]; then
57
+ check "AC-003: .claude/commands/openspec removed" "0"
58
+ else
59
+ check "AC-003: .claude/commands/openspec removed" "1"
60
+ fi
61
+
62
+ # AC-004: dev-playbooks/specs/openspec-integration removed
63
+ echo "AC-004: Checking dev-playbooks/specs/openspec-integration directory..."
64
+ if [[ ! -d "dev-playbooks/specs/openspec-integration" ]]; then
65
+ check "AC-004: dev-playbooks/specs/openspec-integration removed" "0"
66
+ else
67
+ check "AC-004: dev-playbooks/specs/openspec-integration removed" "1"
68
+ fi
69
+
70
+ echo ""
71
+ echo "=== Summary ==="
72
+ echo "passed: $PASSED"
73
+ echo "failed: $FAILED"
74
+
75
+ if [[ $FAILED -eq 0 ]]; then
76
+ echo -e "${GREEN}All checks passed!${NC}"
77
+ exit 0
78
+ else
79
+ echo -e "${RED}Some checks failed${NC}"
80
+ exit 1
81
+ fi
@@ -0,0 +1,146 @@
1
+ #!/bin/bash
2
+ # verify-slash-commands.sh - Verify slash command definitions
3
+ #
4
+ # Verifies AC-001 (24 commands) and AC-002 (1:1 command ↔ skill mapping)
5
+
6
+ set -uo pipefail
7
+
8
+ GREEN='\033[0;32m'
9
+ RED='\033[0;31m'
10
+ YELLOW='\033[1;33m'
11
+ NC='\033[0m'
12
+
13
+ PASSED=0
14
+ FAILED=0
15
+
16
+ check() {
17
+ local name="$1"
18
+ local result="$2"
19
+ if [[ "$result" == "0" ]]; then
20
+ echo -e "${GREEN}✅ $name${NC}"
21
+ PASSED=$((PASSED + 1))
22
+ else
23
+ echo -e "${RED}❌ $name${NC}"
24
+ FAILED=$((FAILED + 1))
25
+ fi
26
+ }
27
+
28
+ check_skill_mapping() {
29
+ local cmd="$1"
30
+ local expected_skill="$2"
31
+ local file="$COMMANDS_DIR/$cmd.md"
32
+ if [[ -f "$file" ]]; then
33
+ if grep -q "skill: $expected_skill" "$file"; then
34
+ check "AC-002: $cmd.md → $expected_skill" "0"
35
+ else
36
+ check "AC-002: $cmd.md → $expected_skill (skill metadata mismatch)" "1"
37
+ fi
38
+ fi
39
+ }
40
+
41
+ echo "=== Slash command verification (21 core + 3 backward-compatible = 24 total) ==="
42
+ echo ""
43
+
44
+ COMMANDS_DIR="templates/claude-commands/devbooks"
45
+
46
+ # AC-001: Check command count (24 = 21 core + 3 backward-compatible)
47
+ echo "AC-001: Checking command count..."
48
+ cmd_count=$(ls "$COMMANDS_DIR"/*.md 2>/dev/null | wc -l | tr -d ' ')
49
+ if [[ "$cmd_count" -eq 24 ]]; then
50
+ check "AC-001: Command count is 24 (21 core + 3 backward-compatible)" "0"
51
+ else
52
+ check "AC-001: Command count is 24 (actual: $cmd_count)" "1"
53
+ fi
54
+
55
+ echo ""
56
+ echo "=== Checking presence of the 21 core command files ==="
57
+
58
+ # List of 21 core command files
59
+ COMMANDS=(
60
+ "router"
61
+ "proposal"
62
+ "challenger"
63
+ "judge"
64
+ "debate"
65
+ "design"
66
+ "backport"
67
+ "plan"
68
+ "spec"
69
+ "gardener"
70
+ "test"
71
+ "test-review"
72
+ "code"
73
+ "review"
74
+ "delivery"
75
+ "c4"
76
+ "impact"
77
+ "entropy"
78
+ "federation"
79
+ "bootstrap"
80
+ "index"
81
+ )
82
+
83
+ for cmd in "${COMMANDS[@]}"; do
84
+ if [[ -f "$COMMANDS_DIR/$cmd.md" ]]; then
85
+ check "AC-011~AC-031: $cmd.md exists" "0"
86
+ else
87
+ check "AC-011~AC-031: $cmd.md exists" "1"
88
+ fi
89
+ done
90
+
91
+ echo ""
92
+ echo "=== AC-002: Checking command ↔ skill mapping ==="
93
+
94
+ # Command -> Skill mapping checks
95
+ check_skill_mapping "router" "devbooks-router"
96
+ check_skill_mapping "proposal" "devbooks-proposal-author"
97
+ check_skill_mapping "challenger" "devbooks-proposal-challenger"
98
+ check_skill_mapping "judge" "devbooks-proposal-judge"
99
+ check_skill_mapping "debate" "devbooks-proposal-debate-workflow"
100
+ check_skill_mapping "design" "devbooks-design-doc"
101
+ check_skill_mapping "backport" "devbooks-design-backport"
102
+ check_skill_mapping "plan" "devbooks-implementation-plan"
103
+ check_skill_mapping "spec" "devbooks-spec-contract"
104
+ check_skill_mapping "gardener" "devbooks-spec-gardener"
105
+ check_skill_mapping "test" "devbooks-test-owner"
106
+ check_skill_mapping "test-review" "devbooks-test-reviewer"
107
+ check_skill_mapping "code" "devbooks-coder"
108
+ check_skill_mapping "review" "devbooks-code-review"
109
+ check_skill_mapping "delivery" "devbooks-delivery-workflow"
110
+ check_skill_mapping "c4" "devbooks-c4-map"
111
+ check_skill_mapping "impact" "devbooks-impact-analysis"
112
+ check_skill_mapping "entropy" "devbooks-entropy-monitor"
113
+ check_skill_mapping "federation" "devbooks-federation"
114
+ check_skill_mapping "bootstrap" "devbooks-brownfield-bootstrap"
115
+ check_skill_mapping "index" "devbooks-index-bootstrap"
116
+
117
+ echo ""
118
+ echo "=== AC-008: Checking backward-compatible commands ==="
119
+
120
+ # Backward-compatible command list
121
+ COMPAT_COMMANDS=("apply" "archive" "quick")
122
+
123
+ for cmd in "${COMPAT_COMMANDS[@]}"; do
124
+ if [[ -f "$COMMANDS_DIR/$cmd.md" ]]; then
125
+ if grep -q "backward-compat: true" "$COMMANDS_DIR/$cmd.md"; then
126
+ check "AC-008: $cmd.md exists and is marked backward-compatible" "0"
127
+ else
128
+ check "AC-008: $cmd.md exists but missing backward-compat marker" "1"
129
+ fi
130
+ else
131
+ check "AC-008: $cmd.md exists" "1"
132
+ fi
133
+ done
134
+
135
+ echo ""
136
+ echo "=== Summary ==="
137
+ echo "passed: $PASSED"
138
+ echo "failed: $FAILED"
139
+
140
+ if [[ $FAILED -eq 0 ]]; then
141
+ echo -e "${GREEN}All checks passed!${NC}"
142
+ exit 0
143
+ else
144
+ echo -e "${RED}Some checks failed${NC}"
145
+ exit 1
146
+ fi
@@ -0,0 +1,50 @@
1
+ # Role Handoff Record
2
+
3
+ ## Handoff Metadata
4
+
5
+ - **Change ID**: <change-id>
6
+ - **Handoff from role**: <Test Owner / Design Owner / Planner / ...>
7
+ - **Handoff to role**: <Coder / Reviewer / ...>
8
+ - **Handoff time**: <YYYY-MM-DD HH:MM>
9
+ - **Conversation/instance ID**: <session-id>
10
+
11
+ ## Handoff Content
12
+
13
+ ### Completed Deliverables
14
+
15
+ - [ ] `design.md` - Design doc produced and reviewed
16
+ - [ ] `tasks.md` - Implementation plan produced
17
+ - [ ] `verification.md` - Acceptance tests defined
18
+ - [ ] `tests/**` - Test code implemented
19
+ - [ ] Red baseline recorded in `evidence/red-baseline/`
20
+
21
+ ### Context Information
22
+
23
+ > Fill in key information the receiving role needs.
24
+
25
+ - **Current status**: <brief progress summary>
26
+ - **Key decisions**: <important decisions to know>
27
+ - **Known issues**: <risks or issues likely to be encountered>
28
+ - **References**: <other documents to read>
29
+
30
+ ### Remaining Work
31
+
32
+ > List work the receiving role needs to complete.
33
+
34
+ 1. <remaining item 1>
35
+ 2. <remaining item 2>
36
+
37
+ ## Confirmation Signatures
38
+
39
+ > After handoff, both sides confirm here.
40
+
41
+ - [ ] **From-side confirmation**: I confirm the deliverables above are complete and the information is accurate.
42
+ - [ ] **To-side confirmation**: I confirm I have received the handoff content and understand current status and remaining work.
43
+
44
+ ---
45
+
46
+ ## Notes
47
+
48
+ > Optional: additional information to record.
49
+
50
+ <fill in additional notes or leave blank>
@@ -0,0 +1,73 @@
1
+ ---
2
+ name: devbooks-design-backport
3
+ description: devbooks-design-backport: Backport newly discovered constraints, conflicts, or gaps from implementation back to design.md (keeping design as the golden truth), with annotated decisions and impacts. Use when the user says "backport design/update design doc/Design Backport/design-implementation mismatch/need to clarify constraints" etc.
4
+ tools:
5
+ - Glob
6
+ - Grep
7
+ - Read
8
+ - Write
9
+ - Edit
10
+ ---
11
+
12
+ # DevBooks: Design Backport
13
+
14
+ ## Prerequisites: Configuration Discovery (Protocol-Agnostic)
15
+
16
+ - `<truth-root>`: Current truth directory root
17
+ - `<change-root>`: Change package directory root
18
+
19
+ Before execution, you **must** search for configuration in the following order (stop when found):
20
+ 1. `.devbooks/config.yaml` (if exists) → Parse and use its mappings
21
+ 2. `dev-playbooks/project.md` (if exists) → DevBooks 2.0 protocol, use default mappings
22
+ 4. `project.md` (if exists) → Template protocol, use default mappings
23
+ 5. If still undetermined → **Stop and ask the user**
24
+
25
+ **Key Constraints**:
26
+ - If `agents_doc` (rules document) is specified in configuration, **you must read that document first** before executing any operations
27
+ - Do not guess directory roots
28
+ - Do not skip reading the rules document
29
+
30
+ ## Execution Method
31
+
32
+ 1) First read and follow: `_shared/references/universal-gating-protocol.md` (verifiability + structural quality gating).
33
+ 2) Strictly execute according to the complete prompt: `references/design-backport-prompt.md`.
34
+
35
+ ---
36
+
37
+ ## Context Awareness
38
+
39
+ This Skill automatically detects context before execution, identifying content that needs to be backported.
40
+
41
+ Detection rules reference: `skills/_shared/context-detection-template.md`
42
+
43
+ ### Detection Flow
44
+
45
+ 1. Detect whether `design.md` exists
46
+ 2. Detect whether new discoveries (conflicts/constraints/gaps) were found during implementation
47
+ 3. Compare differences between design and implementation
48
+
49
+ ### Modes Supported by This Skill
50
+
51
+ | Mode | Trigger Condition | Behavior |
52
+ |------|-------------------|----------|
53
+ | **Conflict Backport** | Design-implementation conflict detected | Record conflict points and resolutions |
54
+ | **Constraint Backport** | New implementation constraints discovered | Add constraint conditions to design |
55
+ | **Gap Backport** | Scenarios not covered by design detected | Add missing design decisions |
56
+
57
+ ### Detection Output Example
58
+
59
+ ```
60
+ Detection Results:
61
+ - design.md: Exists
62
+ - Discoveries: 2 new constraints, 1 design conflict
63
+ - Running Mode: Constraint Backport + Conflict Backport
64
+ ```
65
+
66
+ ---
67
+
68
+ ## MCP Enhancement
69
+
70
+ This Skill does not depend on MCP services; no runtime detection required.
71
+
72
+ MCP enhancement rules reference: `skills/_shared/mcp-enhancement-template.md`
73
+
@@ -0,0 +1,132 @@
1
+ # Design Backport Prompt
2
+
3
+ > **Role**: You are the strongest mind in design evolution, combining the wisdom of Michael Nygard (architecture decision records), Martin Fowler (evolutionary design), and Kent Beck (incremental improvement). Your design sync must meet expert-level standards.
4
+
5
+ Highest directive (top priority):
6
+ - Before executing this prompt, read `_shared/references/universal-gating-protocol.md` and follow all protocols within it.
7
+
8
+ # Prompt: Backport Design Docs When Implementation Plans Exceed Design Scope
9
+
10
+ > Use case: You discover new constraints/concepts/acceptance criteria in the implementation plan (tasks/plan) that are not covered in the design docs (design/spec), causing drift between "plan-driven implementation" and "design-driven acceptance."
11
+
12
+ Artifact locations (protocol agnostic):
13
+ - Design doc usually at: `<change-root>/<change-id>/design.md`
14
+ - Implementation plan usually at: `<change-root>/<change-id>/tasks.md`
15
+ - Spec delta usually at: `<change-root>/<change-id>/specs/<capability>/spec.md`
16
+ - Current truth at: `<truth-root>/` (do not backport by editing historical archives; update current truth with a new change package)
17
+
18
+ > Goal: Backport content that *should be part of design* into the design doc to reduce divergence in testing, implementation, and acceptance.
19
+
20
+ ---
21
+
22
+ ## What Can Be Backported to the Design Doc
23
+
24
+ Only backport plan items that meet at least one of the following (i.e., **Design-level**):
25
+
26
+ 1. **External semantics or user-visible behavior**
27
+
28
+ - New/changed key user flows (explicit state machines, async sessions, cancellable/timeouts)
29
+ - External contracts (API input/output shapes, error semantics, required fields, compatibility windows)
30
+
31
+ 2. **System-level invariants / red lines**
32
+
33
+ - Cost/resource limits (e.g., prohibit N^2 LLM calls, hard caps like `max_llm_calls`, budget-triggered degradation)
34
+ - Reliability/security red lines (e.g., multi-tenant isolation on by default, external untrusted boundaries, default isolation for injection)
35
+
36
+ 3. **Core data contracts and evolution strategy**
37
+
38
+ - `schema_version`, required event envelope fields, idempotency key principles, compatibility strategy (DLQ/migration/replay)
39
+ - Minimum standards for what must be replayable/auditable/traceable
40
+
41
+ 4. **Cross-cutting concerns**
42
+
43
+ - Observability metrics, SLO/KPI, alerting and operational strategies
44
+ - Lifecycle/retention policies (Valid/Quarantine/Garbage goals and rules)
45
+ - Gradual rollout/rollback paths and feature flags
46
+
47
+ 5. **Key tradeoffs and decisions**
48
+
49
+ - Why choose A over B, alternatives, risks, fallback strategies
50
+ - New/changed Non-goals or Open Questions
51
+
52
+ ---
53
+
54
+ ## What Must NOT Be Backported
55
+
56
+ The following are **Implementation-level** and should not be written into design docs (unless promoted to formal design decisions):
57
+
58
+ - Specific file paths, class/function names, table/field names (unless they are stable architectural boundaries that must align)
59
+ - PR splitting advice, task execution order, temporary scripts/commands
60
+ - Over-detailed algorithm pseudocode (backport inputs/outputs/invariants/complexity limits/fallbacks instead of code)
61
+ - One-off implementation conveniences without long-term value or verification
62
+
63
+ ---
64
+
65
+ ## Conflict Resolution (Plan vs Design)
66
+
67
+ - **Design doc is the golden truth**: if plan conflicts with design, do not overwrite design with the plan.
68
+ - Two acceptable paths:
69
+
70
+ 1) **Proposal-style backport**: write plan content into the design doc as "Proposed Design Change" and mark it as needing decision/confirmation;
71
+
72
+ 2) **Defer**: mark plan items as `DEFERRED/UNSCOPED` until design is clarified.
73
+
74
+ - When backporting, explicitly label it as "new design decision/supplemental constraint" and explain reasons and impact scope.
75
+
76
+ ---
77
+
78
+ ## Output Requirements
79
+
80
+ 1. **Diff checklist**: list "plan exceeds design" candidate items (group by plan ID), with classification: `Design-level / Implementation-level / Out-of-scope`.
81
+
82
+ 2. **Design backport patch**: write all `Design-level` content back into the design doc with minimal edits, placed in the most appropriate sections (e.g., non-goals/design principles/risks & fallback/contracts/milestones/key decisions).
83
+
84
+ 3. **Traceability updates**: for each backported design item, state acceptance method (A/B/C) and acceptance anchors, and require updates to:
85
+ - Traceability matrix (prefer updating `<change-root>/<change-id>/verification.md`; sync to `docs/` only if needed externally)
86
+ - Manual acceptance checklist (prefer updating `MANUAL-*` in `<change-root>/<change-id>/verification.md`; sync to `docs/` only if needed externally)
87
+ - If new/updated automation anchors are needed: list tests/static checks to add (tests/commands/markers)
88
+
89
+ ---
90
+
91
+ ## Ready-to-Copy Prompt
92
+
93
+ ```text
94
+ You are the "Design Doc Editor." Your goal is to backport design-level content from the implementation plan into the design doc, making it traceable and verifiable.
95
+
96
+ Inputs:
97
+
98
+ - Design doc: `<change-root>/<change-id>/design.md` (or an equivalent path you provide)
99
+ - Implementation plan: `<change-root>/<change-id>/tasks.md` (or an equivalent path you provide)
100
+
101
+ Tasks:
102
+
103
+ 1) Read the implementation plan and identify all items that are missing or under-specified in the design doc (group by section).
104
+
105
+ 2) Classify each candidate item:
106
+
107
+ - Design-level (should be backported): impacts external semantics/user flows/system red lines/data contracts/evolution strategy/operations/governance/key decisions
108
+ - Implementation-level (do not backport): implementation details, file paths, PR splitting, execution order, pseudocode details
109
+ - Out-of-scope (do not backport and defer): not in scope or future phase not yet confirmed by design
110
+
111
+ 3) For Design-level items only, backport into the design doc:
112
+
113
+ - Place in the most appropriate existing section; add small sections if needed, but do not restructure the whole doc
114
+ - Write in "design constraints/decisions" tone; avoid implementation detail
115
+ - If it conflicts with existing design: do not overwrite conclusions; add a "Proposed Design Change/Open Question" with reason, impact, and decision points
116
+ - Update the design doc's "last updated" metadata (if present)
117
+
118
+ 4) Output:
119
+
120
+ - A) Candidate list with classifications (by plan ID)
121
+ - B) Minimal patch to the design doc (only added/modified paragraphs)
122
+ - C) Traceability and anchor updates (prioritized):
123
+ - Which tests/static checks to add/update (A-class anchors)
124
+ - Which manual/hybrid acceptance items to add/update (B/C anchors, prefer `<change-root>/<change-id>/verification.md`)
125
+ - How to update the traceability matrix (prefer `<change-root>/<change-id>/verification.md`)
126
+
127
+ Constraints:
128
+
129
+ - Do not write file paths, class/function names, DB table names, or other implementation details into the design doc unless they are stable architectural boundaries.
130
+ - Do not paste large pseudocode blocks; you may state invariants, complexity limits, and fallback strategies.
131
+ - Keep language consistent with the design doc (English by default; include domain terms if needed).
132
+ ```