dev-playbooks-cn 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.
- package/LICENSE +21 -0
- package/README.md +466 -0
- package/bin/devbooks.js +987 -0
- package/package.json +43 -0
- package/skills/Skills/344/275/277/347/224/250/350/257/264/346/230/216.md +446 -0
- package/skills/Skill/345/274/200/345/217/221/346/214/207/345/215/227.md +248 -0
- package/skills/_shared/context-detection-template.md +315 -0
- package/skills/_shared/mcp-enhancement-template.md +144 -0
- package/skills/_shared/references//351/200/232/347/224/250/345/256/210/351/227/250/345/215/217/350/256/256.md +114 -0
- package/skills/_template/config-discovery-template.md +126 -0
- package/skills/devbooks-brownfield-bootstrap/SKILL.md +167 -0
- package/skills/devbooks-brownfield-bootstrap/references//344/273/243/347/240/201/345/257/274/350/210/252/347/255/226/347/225/245.md +203 -0
- package/skills/devbooks-brownfield-bootstrap/references//345/255/230/351/207/217/351/241/271/347/233/256/345/210/235/345/247/213/345/214/226.md +96 -0
- package/skills/devbooks-brownfield-bootstrap/references//345/255/230/351/207/217/351/241/271/347/233/256/345/210/235/345/247/213/345/214/226/346/217/220/347/244/272/350/257/215.md +115 -0
- package/skills/devbooks-brownfield-bootstrap/references//346/234/257/350/257/255/350/241/250/346/250/241/346/235/277.md +42 -0
- package/skills/devbooks-brownfield-bootstrap/scripts/cod-update.sh +357 -0
- package/skills/devbooks-brownfield-bootstrap/templates/project-profile-template.md +172 -0
- package/skills/devbooks-c4-map/SKILL.md +151 -0
- package/skills/devbooks-c4-map/references/C4/346/236/266/346/236/204/345/234/260/345/233/276/346/217/220/347/244/272/350/257/215.md +33 -0
- package/skills/devbooks-c4-map/references//345/210/206/345/261/202/347/272/246/346/235/237/346/243/200/346/237/245/346/270/205/345/215/225.md +185 -0
- package/skills/devbooks-code-review/SKILL.md +175 -0
- package/skills/devbooks-code-review/references/PR/346/250/241/346/235/277/344/270/216/346/214/207/345/215/227.md +321 -0
- package/skills/devbooks-code-review/references//344/273/243/347/240/201/350/257/204/345/256/241/346/217/220/347/244/272/350/257/215.md +100 -0
- package/skills/devbooks-code-review/references//345/235/217/345/221/263/351/201/223/351/200/237/346/237/245/350/241/250.md +495 -0
- package/skills/devbooks-code-review/references//350/265/204/346/272/220/347/256/241/347/220/206/345/256/241/346/237/245/346/270/205/345/215/225.md +311 -0
- package/skills/devbooks-coder/SKILL.md +219 -0
- package/skills/devbooks-coder/references//344/273/243/347/240/201/345/256/236/347/216/260/346/217/220/347/244/272/350/257/215.md +70 -0
- package/skills/devbooks-coder/references//344/275/216/351/243/216/351/231/251/346/224/271/345/212/250/346/212/200/346/234/257.md +275 -0
- package/skills/devbooks-coder/references//346/227/245/345/277/227/350/247/204/350/214/203.md +329 -0
- package/skills/devbooks-coder/references//347/274/226/347/240/201/351/243/216/346/240/274/347/273/206/345/210/231.md +351 -0
- package/skills/devbooks-coder/references//351/224/231/350/257/257/347/240/201/350/247/204/350/214/203.md +463 -0
- package/skills/devbooks-delivery-workflow/SKILL.md +217 -0
- package/skills/devbooks-delivery-workflow/references//344/272/244/344/273/230/351/252/214/346/224/266/345/267/245/344/275/234/346/265/201.md +256 -0
- package/skills/devbooks-delivery-workflow/references//345/216/237/345/236/213-/347/224/237/344/272/247/345/217/214/350/275/250/346/250/241/345/274/217.md +168 -0
- package/skills/devbooks-delivery-workflow/references//345/217/230/346/233/264/351/252/214/350/257/201/344/270/216/350/277/275/346/272/257/346/250/241/346/235/277.md +133 -0
- package/skills/devbooks-delivery-workflow/scripts/ac-trace-check.sh +330 -0
- package/skills/devbooks-delivery-workflow/scripts/audit-scope.sh +262 -0
- package/skills/devbooks-delivery-workflow/scripts/change-check.sh +1040 -0
- package/skills/devbooks-delivery-workflow/scripts/change-codemod-scaffold.sh +135 -0
- package/skills/devbooks-delivery-workflow/scripts/change-evidence.sh +152 -0
- package/skills/devbooks-delivery-workflow/scripts/change-scaffold.sh +442 -0
- package/skills/devbooks-delivery-workflow/scripts/change-spec-delta-scaffold.sh +136 -0
- package/skills/devbooks-delivery-workflow/scripts/constitution-check.sh +237 -0
- package/skills/devbooks-delivery-workflow/scripts/env-match-check.sh +128 -0
- package/skills/devbooks-delivery-workflow/scripts/fitness-check.sh +387 -0
- package/skills/devbooks-delivery-workflow/scripts/guardrail-check.sh +519 -0
- package/skills/devbooks-delivery-workflow/scripts/handoff-check.sh +141 -0
- package/skills/devbooks-delivery-workflow/scripts/hygiene-check.sh +340 -0
- package/skills/devbooks-delivery-workflow/scripts/migrate-from-openspec.sh +385 -0
- package/skills/devbooks-delivery-workflow/scripts/migrate-to-v2-gates.sh +202 -0
- package/skills/devbooks-delivery-workflow/scripts/progress-dashboard.sh +319 -0
- package/skills/devbooks-delivery-workflow/scripts/prototype-promote.sh +341 -0
- package/skills/devbooks-delivery-workflow/scripts/spec-preview.sh +203 -0
- package/skills/devbooks-delivery-workflow/scripts/spec-promote.sh +118 -0
- package/skills/devbooks-delivery-workflow/scripts/spec-rollback.sh +124 -0
- package/skills/devbooks-delivery-workflow/scripts/spec-stage.sh +117 -0
- package/skills/devbooks-delivery-workflow/scripts/verify-all.sh +78 -0
- package/skills/devbooks-delivery-workflow/scripts/verify-npm-package.sh +123 -0
- package/skills/devbooks-delivery-workflow/scripts/verify-openspec-free.sh +81 -0
- package/skills/devbooks-delivery-workflow/scripts/verify-slash-commands.sh +146 -0
- package/skills/devbooks-delivery-workflow/templates/handoff.md +50 -0
- package/skills/devbooks-design-backport/SKILL.md +73 -0
- package/skills/devbooks-design-backport/references//345/233/236/345/206/231/350/256/276/350/256/241/346/226/207/346/241/243/346/217/220/347/244/272/350/257/215.md +196 -0
- package/skills/devbooks-design-doc/SKILL.md +121 -0
- package/skills/devbooks-design-doc/references//345/276/256/346/234/215/345/212/241/350/256/276/350/256/241/346/270/205/345/215/225.md +149 -0
- package/skills/devbooks-design-doc/references//350/256/276/350/256/241/346/226/207/346/241/243/346/217/220/347/244/272/350/257/215.md +189 -0
- package/skills/devbooks-design-doc/references//351/232/220/347/247/201/345/220/210/350/247/204/346/243/200/346/237/245/346/270/205/345/215/225.md +240 -0
- package/skills/devbooks-entropy-monitor/SKILL.md +188 -0
- package/skills/devbooks-entropy-monitor/references//347/206/265/345/272/246/351/207/217/346/226/271/346/263/225/350/256/272.md +223 -0
- package/skills/devbooks-entropy-monitor/scripts/entropy-measure.sh +449 -0
- package/skills/devbooks-entropy-monitor/scripts/entropy-report.sh +303 -0
- package/skills/devbooks-entropy-monitor/templates/thresholds.json +99 -0
- package/skills/devbooks-federation/SKILL.md +264 -0
- package/skills/devbooks-federation/scripts/federation-check.sh +144 -0
- package/skills/devbooks-federation/templates/federation.yaml +89 -0
- package/skills/devbooks-impact-analysis/SKILL.md +135 -0
- package/skills/devbooks-impact-analysis/references//345/275/261/345/223/215/345/210/206/346/236/220/346/217/220/347/244/272/350/257/215.md +82 -0
- package/skills/devbooks-impact-analysis/scripts/graph-cache.sh +214 -0
- package/skills/devbooks-implementation-plan/SKILL.md +83 -0
- package/skills/devbooks-implementation-plan/references//347/274/226/347/240/201/350/256/241/345/210/222/346/217/220/347/244/272/350/257/215.md +99 -0
- package/skills/devbooks-index-bootstrap/SKILL.md +240 -0
- package/skills/devbooks-proposal-author/SKILL.md +83 -0
- package/skills/devbooks-proposal-author/references//346/217/220/346/241/210/346/222/260/345/206/231/346/217/220/347/244/272/350/257/215.md +66 -0
- package/skills/devbooks-proposal-challenger/SKILL.md +86 -0
- package/skills/devbooks-proposal-challenger/references//344/274/246/347/220/206/344/270/216/345/220/210/350/247/204/346/243/200/346/237/245/346/270/205/345/215/225.md +176 -0
- package/skills/devbooks-proposal-challenger/references//346/217/220/346/241/210/350/264/250/347/226/221/346/217/220/347/244/272/350/257/215.md +57 -0
- package/skills/devbooks-proposal-debate-workflow/SKILL.md +78 -0
- package/skills/devbooks-proposal-debate-workflow/references//346/217/220/346/241/210/345/257/271/350/276/251/345/267/245/344/275/234/346/265/201.md +24 -0
- package/skills/devbooks-proposal-debate-workflow/references//346/217/220/346/241/210/345/257/271/350/276/251/346/250/241/346/235/277.md +35 -0
- package/skills/devbooks-proposal-debate-workflow/scripts/proposal-debate-check.sh +102 -0
- package/skills/devbooks-proposal-judge/SKILL.md +78 -0
- package/skills/devbooks-proposal-judge/references//346/217/220/346/241/210/350/243/201/345/206/263/346/217/220/347/244/272/350/257/215.md +37 -0
- package/skills/devbooks-router/SKILL.md +346 -0
- package/skills/devbooks-spec-contract/SKILL.md +191 -0
- package/skills/devbooks-spec-contract/references/API/350/256/276/350/256/241/346/214/207/345/215/227.md +349 -0
- package/skills/devbooks-spec-contract/references//345/245/221/347/272/246/344/270/216/346/225/260/346/215/256/345/256/232/344/271/211/346/217/220/347/244/272/350/257/215.md +85 -0
- package/skills/devbooks-spec-contract/references//350/247/204/346/240/274/345/217/230/346/233/264/346/217/220/347/244/272/350/257/215.md +63 -0
- package/skills/devbooks-spec-contract/references//351/232/220/345/274/217/345/217/230/346/233/264/346/243/200/346/265/213/346/217/220/347/244/272/350/257/215.md +183 -0
- package/skills/devbooks-spec-contract/scripts/implicit-change-detect.sh +378 -0
- package/skills/devbooks-spec-gardener/SKILL.md +72 -0
- package/skills/devbooks-spec-gardener/references//350/247/204/346/240/274/345/233/255/344/270/201/346/217/220/347/244/272/350/257/215.md +41 -0
- package/skills/devbooks-test-owner/SKILL.md +172 -0
- package/skills/devbooks-test-owner/references//345/217/230/346/233/264/351/252/214/350/257/201/344/270/216/350/277/275/346/272/257/346/250/241/346/235/277.md +228 -0
- package/skills/devbooks-test-owner/references//345/274/202/346/255/245/347/263/273/347/273/237/346/265/213/350/257/225/347/255/226/347/225/245.md +316 -0
- package/skills/devbooks-test-owner/references//346/265/213/350/257/225/344/273/243/347/240/201/346/217/220/347/244/272/350/257/215.md +208 -0
- package/skills/devbooks-test-owner/references//346/265/213/350/257/225/345/210/206/345/261/202/347/255/226/347/225/245.md +281 -0
- package/skills/devbooks-test-owner/references//346/265/213/350/257/225/351/251/261/345/212/250.md +394 -0
- package/skills/devbooks-test-owner/references//350/247/243/344/276/235/350/265/226/346/212/200/346/234/257/351/200/237/346/237/245/350/241/250.md +432 -0
- package/skills/devbooks-test-reviewer/SKILL.md +189 -0
- package/templates/.devbooks/config.yaml +88 -0
- package/templates/claude-commands/devbooks/apply.md +38 -0
- package/templates/claude-commands/devbooks/archive.md +33 -0
- package/templates/claude-commands/devbooks/backport.md +19 -0
- package/templates/claude-commands/devbooks/bootstrap.md +19 -0
- package/templates/claude-commands/devbooks/c4.md +19 -0
- package/templates/claude-commands/devbooks/challenger.md +19 -0
- package/templates/claude-commands/devbooks/code.md +19 -0
- package/templates/claude-commands/devbooks/debate.md +19 -0
- package/templates/claude-commands/devbooks/delivery.md +19 -0
- package/templates/claude-commands/devbooks/design.md +19 -0
- package/templates/claude-commands/devbooks/entropy.md +19 -0
- package/templates/claude-commands/devbooks/federation.md +19 -0
- package/templates/claude-commands/devbooks/gardener.md +19 -0
- package/templates/claude-commands/devbooks/impact.md +19 -0
- package/templates/claude-commands/devbooks/index.md +19 -0
- package/templates/claude-commands/devbooks/judge.md +19 -0
- package/templates/claude-commands/devbooks/plan.md +19 -0
- package/templates/claude-commands/devbooks/proposal.md +19 -0
- package/templates/claude-commands/devbooks/quick.md +42 -0
- package/templates/claude-commands/devbooks/review.md +19 -0
- package/templates/claude-commands/devbooks/router.md +19 -0
- package/templates/claude-commands/devbooks/spec.md +19 -0
- package/templates/claude-commands/devbooks/test-review.md +19 -0
- package/templates/claude-commands/devbooks/test.md +19 -0
- package/templates/dev-playbooks/README.md +458 -0
- package/templates/dev-playbooks/changes/.gitkeep +1 -0
- package/templates/dev-playbooks/constitution.md +116 -0
- package/templates/dev-playbooks/project.md +96 -0
- package/templates/dev-playbooks/scripts/.gitkeep +1 -0
- package/templates/dev-playbooks/specs/_meta/anti-patterns/.gitkeep +2 -0
- package/templates/dev-playbooks/specs/_meta/glossary.md +47 -0
- package/templates/dev-playbooks/specs/_meta/project-profile.md +79 -0
- package/templates/dev-playbooks/specs/architecture/fitness-rules.md +95 -0
|
@@ -0,0 +1,442 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
set -euo pipefail
|
|
3
|
+
|
|
4
|
+
usage() {
|
|
5
|
+
cat <<'EOF' >&2
|
|
6
|
+
usage: change-scaffold.sh <change-id> [--project-root <dir>] [--change-root <dir>] [--truth-root <dir>] [--force] [--prototype]
|
|
7
|
+
|
|
8
|
+
Creates a DevBooks change package skeleton under:
|
|
9
|
+
<change-root>/<change-id>/
|
|
10
|
+
|
|
11
|
+
Defaults (can be overridden by flags or env):
|
|
12
|
+
DEVBOOKS_PROJECT_ROOT: pwd
|
|
13
|
+
DEVBOOKS_CHANGE_ROOT: changes
|
|
14
|
+
DEVBOOKS_TRUTH_ROOT: specs
|
|
15
|
+
|
|
16
|
+
Options:
|
|
17
|
+
--prototype Create prototype track skeleton (prototype/src + prototype/characterization).
|
|
18
|
+
Use this for "Plan to Throw One Away" exploratory work.
|
|
19
|
+
Prototype code is physically isolated from production code.
|
|
20
|
+
|
|
21
|
+
Notes:
|
|
22
|
+
- Use --change-root and --truth-root to customize paths for your project layout.
|
|
23
|
+
- It writes markdown templates for proposal/design/tasks/verification and creates specs/ + evidence/ directories.
|
|
24
|
+
EOF
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
if [[ $# -eq 0 ]]; then
|
|
28
|
+
usage
|
|
29
|
+
exit 2
|
|
30
|
+
fi
|
|
31
|
+
|
|
32
|
+
if [[ "${1:-}" == "-h" || "${1:-}" == "--help" ]]; then
|
|
33
|
+
usage
|
|
34
|
+
exit 0
|
|
35
|
+
fi
|
|
36
|
+
|
|
37
|
+
change_id="$1"
|
|
38
|
+
shift
|
|
39
|
+
|
|
40
|
+
project_root="${DEVBOOKS_PROJECT_ROOT:-$(pwd)}"
|
|
41
|
+
change_root="${DEVBOOKS_CHANGE_ROOT:-changes}"
|
|
42
|
+
truth_root="${DEVBOOKS_TRUTH_ROOT:-specs}"
|
|
43
|
+
force=false
|
|
44
|
+
prototype=false
|
|
45
|
+
|
|
46
|
+
while [[ $# -gt 0 ]]; do
|
|
47
|
+
case "$1" in
|
|
48
|
+
-h|--help)
|
|
49
|
+
usage
|
|
50
|
+
exit 0
|
|
51
|
+
;;
|
|
52
|
+
--project-root)
|
|
53
|
+
project_root="${2:-}"
|
|
54
|
+
shift 2
|
|
55
|
+
;;
|
|
56
|
+
--change-root)
|
|
57
|
+
change_root="${2:-}"
|
|
58
|
+
shift 2
|
|
59
|
+
;;
|
|
60
|
+
--truth-root)
|
|
61
|
+
truth_root="${2:-}"
|
|
62
|
+
shift 2
|
|
63
|
+
;;
|
|
64
|
+
--force)
|
|
65
|
+
force=true
|
|
66
|
+
shift
|
|
67
|
+
;;
|
|
68
|
+
--prototype)
|
|
69
|
+
prototype=true
|
|
70
|
+
shift
|
|
71
|
+
;;
|
|
72
|
+
*)
|
|
73
|
+
usage
|
|
74
|
+
exit 2
|
|
75
|
+
;;
|
|
76
|
+
esac
|
|
77
|
+
done
|
|
78
|
+
|
|
79
|
+
if [[ -z "$change_id" || "$change_id" == "-"* || "$change_id" =~ [[:space:]] ]]; then
|
|
80
|
+
echo "error: invalid change-id: '$change_id'" >&2
|
|
81
|
+
exit 2
|
|
82
|
+
fi
|
|
83
|
+
|
|
84
|
+
if [[ -z "$project_root" || -z "$change_root" || -z "$truth_root" ]]; then
|
|
85
|
+
usage
|
|
86
|
+
exit 2
|
|
87
|
+
fi
|
|
88
|
+
|
|
89
|
+
change_root="${change_root%/}"
|
|
90
|
+
truth_root="${truth_root%/}"
|
|
91
|
+
project_root="${project_root%/}"
|
|
92
|
+
|
|
93
|
+
if [[ "$change_root" = /* ]]; then
|
|
94
|
+
change_dir="${change_root}/${change_id}"
|
|
95
|
+
else
|
|
96
|
+
change_dir="${project_root}/${change_root}/${change_id}"
|
|
97
|
+
fi
|
|
98
|
+
|
|
99
|
+
mkdir -p "${change_dir}/specs" "${change_dir}/evidence"
|
|
100
|
+
|
|
101
|
+
write_file() {
|
|
102
|
+
local path="$1"
|
|
103
|
+
shift || true
|
|
104
|
+
|
|
105
|
+
if [[ -f "$path" && "$force" != true ]]; then
|
|
106
|
+
echo "skip: $path"
|
|
107
|
+
cat >/dev/null
|
|
108
|
+
return 0
|
|
109
|
+
fi
|
|
110
|
+
|
|
111
|
+
mkdir -p "$(dirname "$path")"
|
|
112
|
+
cat >"$path"
|
|
113
|
+
echo "wrote: $path"
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
escape_sed_repl() {
|
|
117
|
+
printf '%s' "$1" | sed -e 's/[\\/&|]/\\&/g'
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
esc_change_id="$(escape_sed_repl "$change_id")"
|
|
121
|
+
esc_change_root="$(escape_sed_repl "$change_root")"
|
|
122
|
+
esc_truth_root="$(escape_sed_repl "$truth_root")"
|
|
123
|
+
|
|
124
|
+
render_template() {
|
|
125
|
+
sed \
|
|
126
|
+
-e "s|__CHANGE_ID__|${esc_change_id}|g" \
|
|
127
|
+
-e "s|__CHANGE_ROOT__|${esc_change_root}|g" \
|
|
128
|
+
-e "s|__TRUTH_ROOT__|${esc_truth_root}|g"
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
cat <<'EOF' | render_template | write_file "${change_dir}/proposal.md"
|
|
132
|
+
# Proposal: __CHANGE_ID__
|
|
133
|
+
|
|
134
|
+
> Output location: `__CHANGE_ROOT__/__CHANGE_ID__/proposal.md`
|
|
135
|
+
>
|
|
136
|
+
> Note: Proposal phase prohibits implementation code; only define Why/What/Impact/Risks/Validation + debate points.
|
|
137
|
+
|
|
138
|
+
## Why
|
|
139
|
+
|
|
140
|
+
- Problem:
|
|
141
|
+
- Goal:
|
|
142
|
+
|
|
143
|
+
## What Changes
|
|
144
|
+
|
|
145
|
+
- In scope:
|
|
146
|
+
- Out of scope (Non-goals):
|
|
147
|
+
- Impact scope (modules/capabilities/external contracts/data invariants):
|
|
148
|
+
|
|
149
|
+
## Impact
|
|
150
|
+
|
|
151
|
+
- External contracts (API/Schema/Event):
|
|
152
|
+
- Data and migration:
|
|
153
|
+
- Affected modules and dependencies:
|
|
154
|
+
- Testing and quality gates:
|
|
155
|
+
- Value Signal and Observation: <fill "none" or specify metrics/dashboard/logs/business events>
|
|
156
|
+
- Value Stream Bottleneck Hypothesis (where will it block: PR review / tests / release / manual acceptance): <fill "none" or specify hypothesis and mitigation strategy>
|
|
157
|
+
|
|
158
|
+
## Risks & Rollback
|
|
159
|
+
|
|
160
|
+
- Risks:
|
|
161
|
+
- Degradation strategy:
|
|
162
|
+
- Rollback strategy:
|
|
163
|
+
|
|
164
|
+
## Validation
|
|
165
|
+
|
|
166
|
+
- Candidate acceptance anchors (tests/static checks/build/manual evidence):
|
|
167
|
+
- Evidence location: `__CHANGE_ROOT__/__CHANGE_ID__/evidence/` (recommend using `change-evidence.sh <change-id> -- <command>` to collect)
|
|
168
|
+
|
|
169
|
+
## Debate Packet
|
|
170
|
+
|
|
171
|
+
- Debate points/questions requiring decision (<=7 items):
|
|
172
|
+
|
|
173
|
+
## Decision Log
|
|
174
|
+
|
|
175
|
+
- Decision Status: Pending
|
|
176
|
+
- Decision summary:
|
|
177
|
+
- Questions requiring decision:
|
|
178
|
+
EOF
|
|
179
|
+
|
|
180
|
+
cat <<'EOF' | render_template | write_file "${change_dir}/design.md"
|
|
181
|
+
# Design: __CHANGE_ID__
|
|
182
|
+
|
|
183
|
+
> Output location: `__CHANGE_ROOT__/__CHANGE_ID__/design.md`
|
|
184
|
+
>
|
|
185
|
+
> Only write What/Constraints + AC-xxx; prohibit implementation steps and function body code.
|
|
186
|
+
|
|
187
|
+
## Background and Current State
|
|
188
|
+
|
|
189
|
+
- Current behavior (observable facts):
|
|
190
|
+
- Main constraints (performance/security/compatibility/dependency direction):
|
|
191
|
+
|
|
192
|
+
## Goals / Non-goals
|
|
193
|
+
|
|
194
|
+
- Goals:
|
|
195
|
+
- Non-goals:
|
|
196
|
+
|
|
197
|
+
## Design Principles and Red Lines
|
|
198
|
+
|
|
199
|
+
- Principles:
|
|
200
|
+
- Red Lines (unbreakable):
|
|
201
|
+
|
|
202
|
+
## Target Architecture (optional)
|
|
203
|
+
|
|
204
|
+
- Boundaries and dependency direction:
|
|
205
|
+
- Extension points:
|
|
206
|
+
|
|
207
|
+
## Data and Contracts (as needed)
|
|
208
|
+
|
|
209
|
+
- Artifacts / Events / Schema:
|
|
210
|
+
- Compatibility strategy (versioning/migration/replay):
|
|
211
|
+
|
|
212
|
+
## Observability and Acceptance (as needed)
|
|
213
|
+
|
|
214
|
+
- Metrics/KPI/SLO:
|
|
215
|
+
|
|
216
|
+
## Acceptance Criteria
|
|
217
|
+
|
|
218
|
+
- AC-001 (A/B/C): <observable Pass/Fail criteria> (candidate anchors: tests/commands/evidence)
|
|
219
|
+
EOF
|
|
220
|
+
|
|
221
|
+
cat <<'EOF' | render_template | write_file "${change_dir}/tasks.md"
|
|
222
|
+
# Tasks: __CHANGE_ID__
|
|
223
|
+
|
|
224
|
+
> Output location: `__CHANGE_ROOT__/__CHANGE_ID__/tasks.md`
|
|
225
|
+
>
|
|
226
|
+
> Only derive tasks from `__CHANGE_ROOT__/__CHANGE_ID__/design.md`; do not reverse-engineer plan from tests/.
|
|
227
|
+
|
|
228
|
+
========================
|
|
229
|
+
Main Plan Area
|
|
230
|
+
========================
|
|
231
|
+
|
|
232
|
+
- [ ] MP1.1 <one-line goal>
|
|
233
|
+
- Why:
|
|
234
|
+
- Acceptance Criteria (reference AC-xxx):
|
|
235
|
+
- Candidate Anchors (tests/commands/evidence):
|
|
236
|
+
- Dependencies:
|
|
237
|
+
- Risks:
|
|
238
|
+
|
|
239
|
+
========================
|
|
240
|
+
Temporary Plan Area
|
|
241
|
+
========================
|
|
242
|
+
|
|
243
|
+
- (leave empty/as needed)
|
|
244
|
+
|
|
245
|
+
========================
|
|
246
|
+
Context Switch Breakpoint Area
|
|
247
|
+
========================
|
|
248
|
+
|
|
249
|
+
- Last progress:
|
|
250
|
+
- Current blocker:
|
|
251
|
+
- Next shortest path:
|
|
252
|
+
EOF
|
|
253
|
+
|
|
254
|
+
cat <<'EOF' | render_template | write_file "${change_dir}/verification.md"
|
|
255
|
+
# verification.md (__CHANGE_ID__)
|
|
256
|
+
|
|
257
|
+
> Recommended path: `__CHANGE_ROOT__/__CHANGE_ID__/verification.md`
|
|
258
|
+
>
|
|
259
|
+
> Goal: Anchor "Definition of Done" to executable anchors and evidence, and provide `AC-xxx -> Requirement/Scenario -> Test IDs -> Evidence` traceability.
|
|
260
|
+
|
|
261
|
+
---
|
|
262
|
+
|
|
263
|
+
## Metadata
|
|
264
|
+
|
|
265
|
+
- Change ID: `__CHANGE_ID__`
|
|
266
|
+
- Status: Draft | Ready | Done | Archived
|
|
267
|
+
- References:
|
|
268
|
+
- Proposal: `__CHANGE_ROOT__/__CHANGE_ID__/proposal.md`
|
|
269
|
+
- Design: `__CHANGE_ROOT__/__CHANGE_ID__/design.md`
|
|
270
|
+
- Tasks: `__CHANGE_ROOT__/__CHANGE_ID__/tasks.md`
|
|
271
|
+
- Spec deltas: `__CHANGE_ROOT__/__CHANGE_ID__/specs/**`
|
|
272
|
+
- Maintainer: <you>
|
|
273
|
+
- Last Updated: YYYY-MM-DD
|
|
274
|
+
- Test Owner (independent session): <session/agent>
|
|
275
|
+
- Coder (independent session): <session/agent>
|
|
276
|
+
- Red baseline evidence: `__CHANGE_ROOT__/__CHANGE_ID__/evidence/`
|
|
277
|
+
|
|
278
|
+
---
|
|
279
|
+
|
|
280
|
+
========================
|
|
281
|
+
A) Test Plan Directive Table
|
|
282
|
+
========================
|
|
283
|
+
|
|
284
|
+
### Main Plan Area
|
|
285
|
+
|
|
286
|
+
- [ ] TP1.1 <one-line goal>
|
|
287
|
+
- Why:
|
|
288
|
+
- Acceptance Criteria (reference AC-xxx / Requirement):
|
|
289
|
+
- Test Type: unit | contract | integration | e2e | fitness | static
|
|
290
|
+
- Non-goals:
|
|
291
|
+
- Candidate Anchors (Test IDs / commands / evidence):
|
|
292
|
+
|
|
293
|
+
### Temporary Plan Area
|
|
294
|
+
|
|
295
|
+
- (leave empty/as needed)
|
|
296
|
+
|
|
297
|
+
### Context Switch Breakpoint Area
|
|
298
|
+
|
|
299
|
+
- Last progress:
|
|
300
|
+
- Current blocker:
|
|
301
|
+
- Next shortest path:
|
|
302
|
+
|
|
303
|
+
---
|
|
304
|
+
|
|
305
|
+
========================
|
|
306
|
+
B) Traceability Matrix
|
|
307
|
+
========================
|
|
308
|
+
|
|
309
|
+
| AC | Requirement/Scenario | Test IDs / Commands | Evidence / MANUAL-* | Status |
|
|
310
|
+
|---|---|---|---|---|
|
|
311
|
+
| AC-001 | <capability>/Requirement... | TEST-... / pnpm test ... | MANUAL-001 / link | TODO |
|
|
312
|
+
|
|
313
|
+
---
|
|
314
|
+
|
|
315
|
+
========================
|
|
316
|
+
C) Execution Anchors (Deterministic Anchors)
|
|
317
|
+
========================
|
|
318
|
+
|
|
319
|
+
### 1) Behavior
|
|
320
|
+
|
|
321
|
+
- unit:
|
|
322
|
+
- integration:
|
|
323
|
+
- e2e:
|
|
324
|
+
|
|
325
|
+
### 2) Contract
|
|
326
|
+
|
|
327
|
+
- OpenAPI/Proto/Schema:
|
|
328
|
+
- contract tests:
|
|
329
|
+
|
|
330
|
+
### 3) Structure (Fitness Functions)
|
|
331
|
+
|
|
332
|
+
- Layering/dependency direction/no cycles:
|
|
333
|
+
|
|
334
|
+
### 4) Static and Security
|
|
335
|
+
|
|
336
|
+
- lint/typecheck/build:
|
|
337
|
+
- SAST/secret scan:
|
|
338
|
+
- Report format: json|xml (prefer machine-readable)
|
|
339
|
+
|
|
340
|
+
---
|
|
341
|
+
|
|
342
|
+
========================
|
|
343
|
+
D) MANUAL-* Checklist (Manual/Hybrid Acceptance)
|
|
344
|
+
========================
|
|
345
|
+
|
|
346
|
+
- [ ] MANUAL-001 <acceptance item>
|
|
347
|
+
- Pass/Fail criteria:
|
|
348
|
+
- Evidence (screenshot/video/link/log):
|
|
349
|
+
- Responsible/Sign-off:
|
|
350
|
+
|
|
351
|
+
---
|
|
352
|
+
|
|
353
|
+
========================
|
|
354
|
+
E) Risks and Degradation (optional)
|
|
355
|
+
========================
|
|
356
|
+
|
|
357
|
+
- Risks:
|
|
358
|
+
- Degradation strategy:
|
|
359
|
+
- Rollback strategy:
|
|
360
|
+
|
|
361
|
+
========================
|
|
362
|
+
F) Structural Quality Gate Record
|
|
363
|
+
========================
|
|
364
|
+
|
|
365
|
+
- Conflict points:
|
|
366
|
+
- Impact assessment (cohesion/coupling/testability):
|
|
367
|
+
- Alternative gates (complexity/coupling/dependency direction/test quality):
|
|
368
|
+
- Decision and authorization: <fill "none" or specify authorizer/conclusion>
|
|
369
|
+
|
|
370
|
+
========================
|
|
371
|
+
G) Value Stream and Metrics (optional, but must explicitly fill "none")
|
|
372
|
+
========================
|
|
373
|
+
|
|
374
|
+
- Target Value Signal: <fill "none" or specify metrics/dashboard/logs/business events>
|
|
375
|
+
- Delivery and stability metrics (optional DORA): <fill "none" or specify Lead Time / Deploy Frequency / Change Failure Rate / MTTR observation approach>
|
|
376
|
+
- Observation window and trigger points: <fill "none" or specify post-launch duration, what alerts/reports to observe>
|
|
377
|
+
- Evidence: <fill "none" or specify link/screenshot/report path (recommend storing in evidence/)>
|
|
378
|
+
EOF
|
|
379
|
+
|
|
380
|
+
specs_readme_path="${change_dir}/specs/README.md"
|
|
381
|
+
if [[ ! -f "$specs_readme_path" || "$force" == true ]]; then
|
|
382
|
+
printf '%s\n' "# specs/" "" "Create a subdirectory for each capability in this directory, and write \`spec.md\` inside:" "" "- \`${change_root}/${change_id}/specs/<capability>/spec.md\`" "" | write_file "$specs_readme_path"
|
|
383
|
+
fi
|
|
384
|
+
|
|
385
|
+
# Prototype mode: create prototype track skeleton
|
|
386
|
+
if [[ "$prototype" == true ]]; then
|
|
387
|
+
mkdir -p "${change_dir}/prototype/src" "${change_dir}/prototype/characterization"
|
|
388
|
+
|
|
389
|
+
cat <<'EOF' | render_template | write_file "${change_dir}/prototype/PROTOTYPE.md"
|
|
390
|
+
# Prototype Declaration: __CHANGE_ID__
|
|
391
|
+
|
|
392
|
+
> This directory contains prototype code, **DO NOT merge directly into production codebase**.
|
|
393
|
+
>
|
|
394
|
+
> Source: "The Mythical Man-Month" Chapter 11 "Plan to Throw One Away" - "The first system built is not usable...plan to throw it away"
|
|
395
|
+
|
|
396
|
+
## Directory Structure
|
|
397
|
+
|
|
398
|
+
```
|
|
399
|
+
prototype/
|
|
400
|
+
├── PROTOTYPE.md # This file: prototype declaration and status
|
|
401
|
+
├── src/ # Prototype implementation code (technical debt allowed)
|
|
402
|
+
└── characterization/ # Characterization tests (record actual behavior, not acceptance tests)
|
|
403
|
+
```
|
|
404
|
+
|
|
405
|
+
## Status
|
|
406
|
+
|
|
407
|
+
- [ ] Prototype complete
|
|
408
|
+
- [ ] Characterization tests ready (behavior snapshot recorded)
|
|
409
|
+
- [ ] Decided: promote / discard / iterate
|
|
410
|
+
|
|
411
|
+
## Constraints (must follow)
|
|
412
|
+
|
|
413
|
+
1. **Physical isolation**: Prototype code can only be in `prototype/src/`, cannot directly land in repo `src/`
|
|
414
|
+
2. **Role isolation unchanged**: Test Owner and Coder must still use independent sessions/instances
|
|
415
|
+
3. **Characterization tests first**: Test Owner produces "characterization tests" (record actual behavior), not acceptance tests
|
|
416
|
+
4. **Promotion requires explicit trigger**: Run `prototype-promote.sh __CHANGE_ID__` and complete checklist
|
|
417
|
+
|
|
418
|
+
## Promotion Checklist (must complete before promotion)
|
|
419
|
+
|
|
420
|
+
- [ ] Create production-level `design.md` (extract What/Constraints/AC-xxx from prototype learnings)
|
|
421
|
+
- [ ] Test Owner produces acceptance tests `verification.md` (replace characterization tests)
|
|
422
|
+
- [ ] Run `prototype-promote.sh __CHANGE_ID__` and pass all gates
|
|
423
|
+
- [ ] Archive prototype code to `tests/archived-characterization/__CHANGE_ID__/`
|
|
424
|
+
|
|
425
|
+
## Discard Checklist (when discarding)
|
|
426
|
+
|
|
427
|
+
- [ ] Record key insights learned to `proposal.md` Decision Log
|
|
428
|
+
- [ ] Delete `prototype/` directory
|
|
429
|
+
|
|
430
|
+
## Learning Record
|
|
431
|
+
|
|
432
|
+
> What was learned during prototyping? These insights will help production-level implementation.
|
|
433
|
+
|
|
434
|
+
- Technical discoveries:
|
|
435
|
+
- Risk clarifications:
|
|
436
|
+
- Design constraint updates:
|
|
437
|
+
EOF
|
|
438
|
+
|
|
439
|
+
echo "ok: created prototype track at ${change_dir}/prototype/"
|
|
440
|
+
fi
|
|
441
|
+
|
|
442
|
+
echo "ok: scaffolded ${change_dir}"
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
set -euo pipefail
|
|
3
|
+
|
|
4
|
+
usage() {
|
|
5
|
+
cat <<'EOF' >&2
|
|
6
|
+
usage: change-spec-delta-scaffold.sh <change-id> <capability> [--project-root <dir>] [--change-root <dir>] [--force]
|
|
7
|
+
|
|
8
|
+
Creates a spec delta markdown file at:
|
|
9
|
+
<change-root>/<change-id>/specs/<capability>/spec.md
|
|
10
|
+
|
|
11
|
+
Defaults (can be overridden by flags or env):
|
|
12
|
+
DEVBOOKS_PROJECT_ROOT: pwd
|
|
13
|
+
DEVBOOKS_CHANGE_ROOT: changes
|
|
14
|
+
EOF
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
if [[ $# -eq 0 ]]; then
|
|
18
|
+
usage
|
|
19
|
+
exit 2
|
|
20
|
+
fi
|
|
21
|
+
|
|
22
|
+
if [[ "${1:-}" == "-h" || "${1:-}" == "--help" ]]; then
|
|
23
|
+
usage
|
|
24
|
+
exit 0
|
|
25
|
+
fi
|
|
26
|
+
|
|
27
|
+
change_id="${1:-}"
|
|
28
|
+
capability="${2:-}"
|
|
29
|
+
shift 2 || true
|
|
30
|
+
|
|
31
|
+
project_root="${DEVBOOKS_PROJECT_ROOT:-$(pwd)}"
|
|
32
|
+
change_root="${DEVBOOKS_CHANGE_ROOT:-changes}"
|
|
33
|
+
force=false
|
|
34
|
+
|
|
35
|
+
while [[ $# -gt 0 ]]; do
|
|
36
|
+
case "$1" in
|
|
37
|
+
-h|--help)
|
|
38
|
+
usage
|
|
39
|
+
exit 0
|
|
40
|
+
;;
|
|
41
|
+
--project-root)
|
|
42
|
+
project_root="${2:-}"
|
|
43
|
+
shift 2
|
|
44
|
+
;;
|
|
45
|
+
--change-root)
|
|
46
|
+
change_root="${2:-}"
|
|
47
|
+
shift 2
|
|
48
|
+
;;
|
|
49
|
+
--force)
|
|
50
|
+
force=true
|
|
51
|
+
shift
|
|
52
|
+
;;
|
|
53
|
+
*)
|
|
54
|
+
usage
|
|
55
|
+
exit 2
|
|
56
|
+
;;
|
|
57
|
+
esac
|
|
58
|
+
done
|
|
59
|
+
|
|
60
|
+
if [[ -z "$change_id" || "$change_id" == "-"* || "$change_id" =~ [[:space:]] ]]; then
|
|
61
|
+
echo "error: invalid change-id: '$change_id'" >&2
|
|
62
|
+
exit 2
|
|
63
|
+
fi
|
|
64
|
+
|
|
65
|
+
if [[ -z "$capability" || "$capability" == "-"* || "$capability" =~ [[:space:]] ]]; then
|
|
66
|
+
echo "error: invalid capability: '$capability'" >&2
|
|
67
|
+
exit 2
|
|
68
|
+
fi
|
|
69
|
+
|
|
70
|
+
if [[ "$capability" = /* || "$capability" == *".."* ]]; then
|
|
71
|
+
echo "error: capability must be a relative path segment (no absolute path / '..'): '$capability'" >&2
|
|
72
|
+
exit 2
|
|
73
|
+
fi
|
|
74
|
+
|
|
75
|
+
project_root="${project_root%/}"
|
|
76
|
+
change_root="${change_root%/}"
|
|
77
|
+
|
|
78
|
+
if [[ "$change_root" = /* ]]; then
|
|
79
|
+
change_dir="${change_root}/${change_id}"
|
|
80
|
+
else
|
|
81
|
+
change_dir="${project_root}/${change_root}/${change_id}"
|
|
82
|
+
fi
|
|
83
|
+
|
|
84
|
+
spec_file="${change_dir}/specs/${capability}/spec.md"
|
|
85
|
+
|
|
86
|
+
if [[ -f "$spec_file" && "$force" != true ]]; then
|
|
87
|
+
echo "skip: ${spec_file}"
|
|
88
|
+
exit 0
|
|
89
|
+
fi
|
|
90
|
+
|
|
91
|
+
mkdir -p "$(dirname "$spec_file")"
|
|
92
|
+
|
|
93
|
+
cat >"$spec_file" <<EOF
|
|
94
|
+
# Spec Delta: ${capability} (${change_id})
|
|
95
|
+
|
|
96
|
+
> Output location: \`${change_root}/${change_id}/specs/${capability}/spec.md\`
|
|
97
|
+
>
|
|
98
|
+
> Note: Spec delta is only required when "external behavior/contracts/data invariants" change.
|
|
99
|
+
|
|
100
|
+
## ADDED Requirements
|
|
101
|
+
|
|
102
|
+
### Requirement: TODO
|
|
103
|
+
- Source: AC-xxx / Proposal / Decision
|
|
104
|
+
- Notes:
|
|
105
|
+
|
|
106
|
+
#### Scenario: TODO
|
|
107
|
+
GIVEN ...
|
|
108
|
+
WHEN ...
|
|
109
|
+
THEN ...
|
|
110
|
+
|
|
111
|
+
## MODIFIED Requirements
|
|
112
|
+
|
|
113
|
+
### Requirement: TODO
|
|
114
|
+
- Source: AC-xxx / Proposal / Decision
|
|
115
|
+
- Notes:
|
|
116
|
+
|
|
117
|
+
#### Scenario: TODO
|
|
118
|
+
GIVEN ...
|
|
119
|
+
WHEN ...
|
|
120
|
+
THEN ...
|
|
121
|
+
|
|
122
|
+
## REMOVED Requirements
|
|
123
|
+
|
|
124
|
+
### Requirement: TODO
|
|
125
|
+
- Source: AC-xxx / Proposal / Decision
|
|
126
|
+
- Notes:
|
|
127
|
+
|
|
128
|
+
#### Scenario: TODO
|
|
129
|
+
GIVEN ...
|
|
130
|
+
WHEN ...
|
|
131
|
+
THEN ...
|
|
132
|
+
EOF
|
|
133
|
+
|
|
134
|
+
echo "wrote: ${spec_file}"
|
|
135
|
+
echo "ok: scaffolded spec delta for ${change_id} (${capability})"
|
|
136
|
+
|