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,176 @@
1
+ # Ethics and Compliance Checklist
2
+
3
+ > Use this checklist when the project involves personal data, AI decisions, or social impact.
4
+ >
5
+ > This document is **optional guidance**. Use it only when the project involves one or more of:
6
+ > - Personal data collection/processing/storage
7
+ > - Algorithmic decisions (recommendation, moderation, scoring)
8
+ > - User behavior tracking
9
+ > - Automated decisions affecting user rights/benefits
10
+
11
+ ---
12
+
13
+ ## 1) Data privacy (GDPR/CCPA compliance)
14
+
15
+ ### 1.1 Data collection checks
16
+
17
+ - [ ] **Necessity**: collect only data required to deliver the feature
18
+ - [ ] **Informed consent**: users understand and consent before collection
19
+ - [ ] **Purpose limitation**: use data only for the declared purpose; no secondary use
20
+ - [ ] **Minimization**: collect the minimal set of fields necessary
21
+
22
+ ### 1.2 Data storage checks
23
+
24
+ - [ ] **Retention**: define how long data is kept and how it is deleted after expiration
25
+ - [ ] **Encryption**: sensitive data is encrypted at rest
26
+ - [ ] **Access control**: who can access the data; audit logs exist
27
+ - [ ] **Cross-border transfer**: whether data is transferred to other countries/regions
28
+
29
+ ### 1.3 User rights checks
30
+
31
+ - [ ] **Access**: users can view their data
32
+ - [ ] **Rectification**: users can correct incorrect data
33
+ - [ ] **Deletion**: users can request deletion (“right to be forgotten”)
34
+ - [ ] **Portability**: users can export their data
35
+
36
+ ### 1.4 Required design.md declaration
37
+
38
+ ```markdown
39
+ ### Data privacy statement
40
+ - Data collected: <list fields>
41
+ - Purpose: <describe>
42
+ - Retention: <N days/months/years>
43
+ - User rights UX: <how users access/rectify/delete>
44
+ ```
45
+
46
+ ---
47
+
48
+ ## 2) Algorithmic bias (AI/ML systems)
49
+
50
+ ### 2.1 Bias risk checks
51
+
52
+ | Bias type | Symptom | Detection method |
53
+ |----------|---------|------------------|
54
+ | Historical bias | training data reflects historical inequality | data audit |
55
+ | Representation bias | some groups are underrepresented | group distribution stats |
56
+ | Measurement bias | features unfairly impact some groups | fairness metric comparisons |
57
+ | Evaluation bias | evaluation metrics are unfair for some groups | stratified evaluation |
58
+
59
+ ### 2.2 Fairness checklist
60
+
61
+ - [ ] Did we analyze performance differences across user groups?
62
+ - [ ] Is there a mechanism to detect and correct bias?
63
+ - [ ] Are fairness metrics defined (e.g., accuracy delta across groups < 5%)?
64
+ - [ ] Is there a human review path for edge cases?
65
+
66
+ ### 2.3 Explainability checklist
67
+
68
+ - [ ] Can users understand “why did I get this result”?
69
+ - [ ] Is there an appeal/feedback channel?
70
+ - [ ] For important decisions, is there an opportunity for human intervention?
71
+
72
+ ---
73
+
74
+ ## 3) Social impact assessment
75
+
76
+ ### 3.1 Negative impact checks
77
+
78
+ - [ ] Could this feature be abused? How is abuse prevented?
79
+ - [ ] Could it create filter bubbles/polarization?
80
+ - [ ] Could it widen the digital divide?
81
+ - [ ] Could it impact mental health?
82
+
83
+ ### 3.2 Protecting vulnerable groups
84
+
85
+ - [ ] Are there extra protections for minors?
86
+ - [ ] Is the feature accessible for elderly/disabled users?
87
+ - [ ] Are low-income groups excluded from the service?
88
+
89
+ ### 3.3 Required design.md declaration
90
+
91
+ ```markdown
92
+ ### Social impact assessment
93
+ - Potential negative impacts: <describe risks>
94
+ - Mitigations: <how risk is reduced>
95
+ - Vulnerable group protections: <special measures>
96
+ ```
97
+
98
+ ---
99
+
100
+ ## 4) Security and abuse prevention
101
+
102
+ ### 4.1 Abuse scenario checks
103
+
104
+ - [ ] Did we consider malicious-user abuse scenarios?
105
+ - [ ] Is there rate limiting against abuse/attacks?
106
+ - [ ] Is there content moderation where applicable (e.g., UGC)?
107
+ - [ ] Is there anomaly detection?
108
+
109
+ ### 4.2 Data leakage prevention
110
+
111
+ - [ ] Is sensitive data sanitized/redacted?
112
+ - [ ] Are APIs authenticated and authorized?
113
+ - [ ] Do logs avoid leaking sensitive information?
114
+
115
+ ---
116
+
117
+ ## 5) Proposal-phase ethics checks
118
+
119
+ When challenging a proposal in `devbooks-proposal-challenger`, add these checks:
120
+
121
+ ### 5.1 Mandatory (when personal data is involved)
122
+
123
+ - [ ] **Necessity**: is data collection strictly necessary?
124
+ - [ ] **User awareness**: do users understand how data is used?
125
+ - [ ] **Opt-out / deletion**: can users opt out or delete data?
126
+
127
+ ### 5.2 Optional (when algorithmic decisions are involved)
128
+
129
+ - [ ] **Explainability**: can users understand the rationale?
130
+ - [ ] **Appeals**: can users challenge the decision?
131
+ - [ ] **Fairness**: is it fair across groups?
132
+
133
+ ### 5.3 Proposal template addition
134
+
135
+ ```markdown
136
+ ### Ethics and compliance (optional; required if personal data is involved)
137
+
138
+ #### Data privacy
139
+ - Data collected: <none / list fields>
140
+ - Consent mechanism: <none / describe>
141
+ - Delete/export capability: <none / describe UX>
142
+
143
+ #### Algorithmic decisions (if applicable)
144
+ - Decision type: <none / recommendation / moderation / scoring / other>
145
+ - Explainability: <none / describe>
146
+ - Appeals: <none / describe>
147
+
148
+ #### Social impact
149
+ - Potential negative impacts: <none / describe risks>
150
+ - Mitigations: <none / describe>
151
+ ```
152
+
153
+ ---
154
+
155
+ ## 6) Quick legal reference
156
+
157
+ | Regulation | Region | Core requirements |
158
+ |-----------|--------|-------------------|
159
+ | GDPR | EU | informed consent, data minimization, right to be forgotten, portability |
160
+ | CCPA | California | right to know, deletion, non-discrimination, opt-out |
161
+ | PIPL | China | separate consent, local storage, cross-border assessment |
162
+ | COPPA | US | child data protection under 13 |
163
+
164
+ ---
165
+
166
+ ## 7) Decision log template
167
+
168
+ When there is an ethics dispute, record it in the `Decision Log` section of `proposal.md`:
169
+
170
+ ```markdown
171
+ ### Ethics decision record
172
+
173
+ | Date | Disputed point | Positions | Final decision | Rationale |
174
+ |------|----------------|-----------|----------------|-----------|
175
+ | YYYY-MM-DD | whether to collect location | Product: better recs / Security: privacy risk | collect city-level only | balance value and privacy |
176
+ ```
@@ -0,0 +1,57 @@
1
+ # Proposal Challenge Prompt
2
+
3
+ > **Role**: You are the strongest mind in software architecture, combining the wisdom of Martin Fowler (architecture and refactoring), Gregor Hohpe (enterprise integration patterns), and Michael Nygard (system reliability). Your review 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
+ You are the "Proposal Challenger." Your task is to conduct a **strict review + gap discovery** focused on system quality and long-term maintainability, uncovering missing requirements, uncovered scenarios, and missing acceptance criteria, and proposing actionable alternatives.
9
+
10
+ Input materials (provided by me):
11
+ - `<change-root>/<change-id>/proposal.md`
12
+ - Related design docs (if any): `<change-root>/<change-id>/design.md`
13
+ - Current truth: `<truth-root>/`
14
+ - Project profile: `<truth-root>/_meta/project-profile.md`
15
+ - Glossary (if present): `<truth-root>/_meta/glossary.md`
16
+
17
+ Hard constraints (must follow):
18
+ 1) Do not modify the proposal text; output only a "challenge report."
19
+ 2) Provide a clear conclusion: `Approve | Revise | Reject`, no fence-sitting.
20
+ 3) Every challenge must be verifiable; no vague statements.
21
+ 4) **Gap discovery responsibility**: proactively identify missing items, including:
22
+ - Missing acceptance criteria (AC)
23
+ - Uncovered edge cases
24
+ - Undefined rollback strategy
25
+ - Missing dependency analysis
26
+ - Missing evidence anchors
27
+
28
+ Core values (non-negotiable):
29
+ - Structural integrity (cohesion/coupling/dependency direction)
30
+ - Testability and rollbackability
31
+ - Anti-pattern defense (architecture/process/code)
32
+ - Stop proxy-metric backlash
33
+ - Minimize distributed boundaries (remote calls amplify complexity)
34
+
35
+ Required challenge checklist (check each item):
36
+ - [ ] Is distributed architecture truly required? Was a monolith option evaluated?
37
+ - [ ] Does each remote boundary have a clear failure-handling strategy?
38
+ - [ ] Are transaction boundaries aligned with service boundaries? How is cross-service consistency ensured?
39
+
40
+ Gap discovery checklist (check each item):
41
+ - [ ] Are acceptance criteria complete and covering all functional points?
42
+ - [ ] Are edge cases considered? (nulls, concurrency, timeouts, retries)
43
+ - [ ] Is rollback strategy explicit? How does each phase roll back?
44
+ - [ ] Is dependency analysis complete? Are upstream/downstream impacts listed?
45
+ - [ ] Are evidence anchors clear? How is each AC verified?
46
+ - [ ] Is the migration path defined? How do existing users upgrade?
47
+ - [ ] Are risk mitigations concrete and actionable?
48
+
49
+ Output format (strict):
50
+ 1) **Conclusion**: `Approve | Revise | Reject` + one-line reason
51
+ 2) **Blocking**: list required changes
52
+ 3) **Missing**: missing items found, list each
53
+ 4) **Non-blocking**: improvements that do not block
54
+ 5) **Alternatives**: minimal viable alternative paths or scope reduction suggestions
55
+ 6) **Risks and evidence gaps**: evidence/verification to add
56
+
57
+ Start the "challenge report" now; do not output extra explanations.
@@ -0,0 +1,78 @@
1
+ ---
2
+ name: devbooks-proposal-debate-workflow
3
+ description: devbooks-proposal-debate-workflow: Executes the "Author-Challenger-Judge" triangular debate workflow during the proposal phase, enforcing role isolation and writing back to the Decision Log. Use when the user mentions "proposal debate/three-role adversarial/Challenger/Judge/proposal debate/decision log" etc.
4
+ tools:
5
+ - Glob
6
+ - Grep
7
+ - Read
8
+ - Write
9
+ - Edit
10
+ ---
11
+
12
+ # DevBooks: Proposal Debate Workflow
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, **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 the configuration specifies an `agents_doc` (rules document), **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
+ ## Reference Skeleton (Read as Needed)
31
+
32
+ - Workflow: `references/proposal-debate-workflow.md`
33
+ - Template: `references/11-proposal-debate-template.md`
34
+
35
+ ## Optional Check Script
36
+
37
+ - `proposal-debate-check.sh <change-id> --project-root <repo-root> --change-root <change-root>` (script located at `scripts/proposal-debate-check.sh` within this Skill)
38
+
39
+ ---
40
+
41
+ ## Context Awareness
42
+
43
+ This Skill automatically detects context before execution and selects the appropriate debate phase.
44
+
45
+ Detection rules reference: `skills/_shared/context-detection-template.md`
46
+
47
+ ### Detection Process
48
+
49
+ 1. Detect whether `proposal.md` exists
50
+ 2. Detect Decision Log status
51
+ 3. Detect current debate round
52
+
53
+ ### Modes Supported by This Skill
54
+
55
+ | Mode | Trigger Condition | Behavior |
56
+ |------|-------------------|----------|
57
+ | **Proposal Phase** | No Decision Log | Author drafts proposal |
58
+ | **Challenge Phase** | Proposal complete but no challenge | Challenger initiates challenge |
59
+ | **Judgment Phase** | Challenge complete but no judgment | Judge issues ruling |
60
+ | **Completed** | Decision Log has final ruling | View only |
61
+
62
+ ### Detection Output Example
63
+
64
+ ```
65
+ Detection Result:
66
+ - proposal.md: Exists
67
+ - Decision Log: Has 1 round of challenges
68
+ - Current Round: Round 1
69
+ - Running Mode: Judgment Phase
70
+ ```
71
+
72
+ ---
73
+
74
+ ## MCP Enhancement
75
+
76
+ This Skill does not depend on MCP services and requires no runtime detection.
77
+
78
+ MCP enhancement rules reference: `skills/_shared/mcp-enhancement-template.md`
@@ -0,0 +1,35 @@
1
+ # Optional proposal.md debate template
2
+
3
+ > Recommended path: `<change-root>/<change-id>/proposal.md`
4
+
5
+ ## Why
6
+ - Problem:
7
+ - Goal:
8
+
9
+ ## What Changes
10
+ - In:
11
+ - Out:
12
+ - Scope:
13
+
14
+ ## Impact
15
+ - External contracts:
16
+ - Data & migrations:
17
+ - Modules & dependencies:
18
+ - Tests & verification:
19
+
20
+ ## Risks & Rollback
21
+ - Risks:
22
+ - Rollback:
23
+
24
+ ## Validation
25
+ - Candidate acceptance anchors:
26
+
27
+ ## Debate Packet
28
+ - Contested points:
29
+ - Uncertainties:
30
+ - Questions that require debate:
31
+
32
+ ## Decision Log
33
+ - Decision: `Pending | Approved | Revise | Rejected`
34
+ - Summary:
35
+ - Required changes (if any):
@@ -0,0 +1,24 @@
1
+ # Proposal Debate Workflow
2
+
3
+ Goal: in the proposal phase, use a “proposal → challenge → judgment” three-role debate to avoid diluted consensus and proxy-metric-driven decisions.
4
+
5
+ Directory conventions (protocol-agnostic):
6
+ - Change package: `<change-root>/<change-id>/`
7
+ - Proposal: `<change-root>/<change-id>/proposal.md`
8
+
9
+ Hard rules:
10
+ - Proposal Author / Challenger / Judge must run in separate conversations/instances.
11
+ - The Challenger can only challenge based on the persisted `proposal.md` and available design materials; no “private co-authoring”.
12
+ - The Judge must provide a clear decision; no vague compromises.
13
+
14
+ Process:
15
+ 1) **Proposal Author**: use the `devbooks-proposal-author` skill to produce `proposal.md` (including the Debate Packet).
16
+ 2) **Proposal Challenger**: use the `devbooks-proposal-challenger` skill to produce a challenge report.
17
+ 3) **Proposal Judge**: use the `devbooks-proposal-judge` skill to produce a judgment report.
18
+ 4) **Write back to proposal**: write the judgment conclusion into `proposal.md` under the Decision Log.
19
+ 5) **Proceed to downstream artifacts**: Design/Spec/Plan starts only after a decision of Approved or Revise.
20
+
21
+ Acceptance criteria:
22
+ - `proposal.md` must include a `Decision Log` with decision state `Approved | Revise | Rejected`.
23
+ - If `Revise`, it must list “required changes” and be judged again after completion.
24
+ - Optional automated check: `proposal-debate-check.sh <change-id>` (script: `scripts/proposal-debate-check.sh`)
@@ -0,0 +1,102 @@
1
+ #!/usr/bin/env bash
2
+ set -euo pipefail
3
+
4
+ usage() {
5
+ cat <<'EOF' >&2
6
+ usage: proposal-debate-check.sh <change-id> [--project-root <dir>] [--change-root <dir>]
7
+
8
+ Checks that a proposal has completed the debate decision:
9
+ - proposal.md contains '## Debate Packet' and '## Decision Log'
10
+ - 'Decision Log' contains a decision line with Approved | Revise | Rejected
11
+ EOF
12
+ }
13
+
14
+ if [[ $# -eq 0 ]]; then
15
+ usage
16
+ exit 2
17
+ fi
18
+
19
+ if [[ "${1:-}" == "-h" || "${1:-}" == "--help" ]]; then
20
+ usage
21
+ exit 0
22
+ fi
23
+
24
+ change_id="$1"
25
+ shift
26
+
27
+ project_root="${DEVBOOKS_PROJECT_ROOT:-$(pwd)}"
28
+ change_root="${DEVBOOKS_CHANGE_ROOT:-changes}"
29
+
30
+ while [[ $# -gt 0 ]]; do
31
+ case "$1" in
32
+ -h|--help)
33
+ usage
34
+ exit 0
35
+ ;;
36
+ --project-root)
37
+ project_root="${2:-}"
38
+ shift 2
39
+ ;;
40
+ --change-root)
41
+ change_root="${2:-}"
42
+ shift 2
43
+ ;;
44
+ *)
45
+ usage
46
+ exit 2
47
+ ;;
48
+ esac
49
+ done
50
+
51
+ if [[ -z "$project_root" || -z "$change_root" ]]; then
52
+ usage
53
+ exit 2
54
+ fi
55
+
56
+ if [[ -z "$change_id" || "$change_id" == "-"* || "$change_id" =~ [[:space:]] ]]; then
57
+ echo "error: invalid change-id: '$change_id'" >&2
58
+ exit 2
59
+ fi
60
+
61
+ if ! command -v rg >/dev/null 2>&1; then
62
+ echo "error: missing dependency: rg (ripgrep)" >&2
63
+ exit 2
64
+ fi
65
+
66
+ if [[ "$change_root" = /* ]]; then
67
+ file="${change_root}/${change_id}/proposal.md"
68
+ else
69
+ file="${project_root}/${change_root}/${change_id}/proposal.md"
70
+ fi
71
+
72
+
73
+ if [[ ! -f "$file" ]]; then
74
+ echo "error: missing ${file}" >&2
75
+ exit 2
76
+ fi
77
+
78
+ if ! rg -n "^## Debate Packet$" "$file" >/dev/null; then
79
+ echo "error: missing 'Debate Packet' section in ${file}" >&2
80
+ exit 1
81
+ fi
82
+
83
+ if ! rg -n "^## Decision Log" "$file" >/dev/null; then
84
+ echo "error: missing 'Decision Log' section in ${file}" >&2
85
+ exit 1
86
+ fi
87
+
88
+ decision_line=$(rg -n "^- .*[::] *(Pending|Approved|Revise|Rejected) *$" "$file" -m 1 || true)
89
+ if [[ -z "$decision_line" ]]; then
90
+ echo "error: missing decision line in ${file}" >&2
91
+ exit 1
92
+ fi
93
+
94
+ value="$(echo "$decision_line" | sed -E 's/^[0-9]+:- .*[::] *//')"
95
+
96
+ case "$value" in
97
+ Approved|Revise|Rejected) ;;
98
+ Pending) echo "error: decision is still Pending (debate not concluded): ${file}" >&2; exit 1 ;;
99
+ *) echo "error: decision must be Approved | Revise | Rejected (current: ${value})" >&2; exit 1 ;;
100
+ esac
101
+
102
+ echo "ok: proposal decision present for ${change_id}"
@@ -0,0 +1,78 @@
1
+ ---
2
+ name: devbooks-proposal-judge
3
+ description: "devbooks-proposal-judge: Make rulings (Judge) on proposals during the proposal phase, output Approved/Revise/Rejected and write back to the Decision Log in proposal.md. Use when user says 'judge proposal/proposal review/Approved Revise Rejected/decision log' etc."
4
+ tools:
5
+ - Glob
6
+ - Grep
7
+ - Read
8
+ - Write
9
+ - Edit
10
+ ---
11
+
12
+ # DevBooks: Proposal Judge
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 unable to determine → **Stop and ask the user**
24
+
25
+ **Key Constraints**:
26
+ - If `agents_doc` (rules document) is specified in the configuration, **you must read that document first** before performing 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 output rulings according to the complete prompt: `references/proposal-judge-prompt.md`.
34
+
35
+ ---
36
+
37
+ ## Context Awareness
38
+
39
+ This Skill automatically detects context before execution to ensure role isolation.
40
+
41
+ Detection rules reference: `skills/_shared/context-detection-template.md`
42
+
43
+ ### Detection Process
44
+
45
+ 1. Detect whether `proposal.md` exists
46
+ 2. Detect whether there are challenge opinions from the Challenger
47
+ 3. Detect whether the Author/Challenger role has already been executed in the current session
48
+
49
+ ### Modes Supported by This Skill
50
+
51
+ | Mode | Trigger Condition | Behavior |
52
+ |------|-------------------|----------|
53
+ | **First Ruling** | No ruling record | Comprehensively evaluate the proposal and challenges, output ruling |
54
+ | **Reconsideration Ruling** | Author resubmits after modifications | Re-evaluate the modified content |
55
+
56
+ ### Role Isolation Check
57
+
58
+ - [ ] Current session has not executed Author
59
+ - [ ] Current session has not executed Challenger
60
+
61
+ ### Detection Output Example
62
+
63
+ ```
64
+ Detection Result:
65
+ - proposal.md: Exists
66
+ - Challenger opinions: Exist (3 risk points)
67
+ - Role isolation: ✓
68
+ - Running mode: First Ruling
69
+ ```
70
+
71
+ ---
72
+
73
+ ## MCP Enhancement
74
+
75
+ This Skill does not depend on MCP services and requires no runtime detection.
76
+
77
+ MCP enhancement rules reference: `skills/_shared/mcp-enhancement-template.md`
78
+
@@ -0,0 +1,37 @@
1
+ # Proposal Judge Prompt
2
+
3
+ > **Role**: You are the strongest mind in technical decision-making, combining the wisdom of Michael Nygard (architecture decision records), Gregor Hohpe (technical leadership), and Werner Vogels (system design tradeoffs). Your verdict 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
+ You are the "Proposal Judge." Your task is to issue a clear verdict on disagreements between Author and Challenger and update the proposal decision record.
9
+
10
+ Input materials (provided by me):
11
+ - `<change-root>/<change-id>/proposal.md`
12
+ - Challenger report
13
+ - Related design docs (if any)
14
+
15
+ Hard constraints (must follow):
16
+ 1) You must choose: `Approved | Revise | Rejected` with no ambiguity.
17
+ 2) If unresolved blocking issues exist, the verdict cannot be Approved.
18
+ 3) The verdict must include actionable changes and verification requirements.
19
+
20
+ Core values (non-negotiable):
21
+ - Directional correctness over speed
22
+ - Risk transparency and rollbackability
23
+ - Quality gates over proxy metrics
24
+
25
+ Pre-checks (must execute):
26
+ - [ ] Does design.md contain only What/Constraints and avoid How (implementation steps)?
27
+ - [ ] Does tasks.md contain only How (implementation steps) and avoid What (constraints/acceptance)?
28
+ - If responsibilities are mixed, verdict must be Revise with separation required
29
+
30
+ Output format (strict):
31
+ 1) **Verdict**: `Approved | Revise | Rejected`
32
+ 2) **Reason summary** (3–5 bullets)
33
+ 3) **Required changes (if Revise)**: list each item
34
+ 4) **Verification requirements**: evidence/tests/checks to add
35
+ 5) **Write-back instructions**: changes that must be applied to `proposal.md`
36
+
37
+ Start the "verdict report" now; do not output extra explanations.