@bbcsoftwarefactory/skills 0.0.0-stage → 0.1.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/dist/index.json +42 -0
- package/dist/skills/code-quality-gate/SKILL.md +59 -0
- package/dist/skills/code-quality-gate/references/gate-bigo.md +31 -0
- package/dist/skills/code-quality-gate/references/gate-earlyreturn.md +73 -0
- package/dist/skills/code-quality-gate/references/gate-typesafe.md +32 -0
- package/dist/skills/code-quality-gate/references/output-schema.yml +40 -0
- package/dist/skills/code-quality-gate/scripts/extract-diff-scope.py +225 -0
- package/dist/skills/code-quality-gate/tests/extract-diff-scope.test.sh +200 -0
- package/dist/skills/delivery-coordinator/SKILL.md +81 -0
- package/dist/skills/delivery-coordinator/references/hud-output.md +55 -0
- package/dist/skills/delivery-coordinator/references/intake.md +86 -0
- package/dist/skills/delivery-coordinator/references/issue-claim.md +143 -0
- package/dist/skills/delivery-coordinator/references/issue-dedup.md +38 -0
- package/dist/skills/delivery-coordinator/references/sleuth-regression-exercise.md +60 -0
- package/dist/skills/delivery-coordinator/references/visual-reference.md +45 -0
- package/dist/skills/delivery-coordinator/references/worktree-isolation.md +19 -0
- package/dist/skills/delivery-coordinator/scripts/check-issue-claim.py +363 -0
- package/dist/skills/delivery-coordinator/scripts/check-worktree-guard.py +220 -0
- package/dist/skills/delivery-coordinator/scripts/classify-change-lane.py +263 -0
- package/dist/skills/delivery-coordinator/tests/check-issue-claim.test.sh +221 -0
- package/dist/skills/delivery-coordinator/tests/check-worktree-guard.test.sh +123 -0
- package/dist/skills/delivery-coordinator/tests/classify-change-lane.test.sh +124 -0
- package/dist/skills/documentation-steward/SKILL.md +43 -0
- package/dist/skills/documentation-steward/references/discovery.md +17 -0
- package/dist/skills/documentation-steward/references/handoff.md +15 -0
- package/dist/skills/greptile-review-loop/SKILL.md +57 -0
- package/dist/skills/greptile-review-loop/references/review-protocol.md +37 -0
- package/dist/skills/greptile-review-loop/scripts/review-loop.py +435 -0
- package/dist/skills/greptile-review-loop/tests/review-loop.test.sh +331 -0
- package/dist/skills/issue-reviewer/SKILL.md +87 -0
- package/dist/skills/issue-reviewer/references/review-format.md +100 -0
- package/dist/skills/issue-reviewer/references/triage.md +105 -0
- package/dist/skills/issue-reviewer/scripts/fetch-issue-attachments.py +239 -0
- package/dist/skills/issue-reviewer/scripts/plan-issue-triage.py +311 -0
- package/dist/skills/issue-reviewer/tests/fetch-issue-attachments.test.sh +90 -0
- package/dist/skills/issue-reviewer/tests/plan-issue-triage.test.sh +168 -0
- package/dist/skills/question-gate/SKILL.md +66 -0
- package/dist/skills/question-gate/references/client-hooks.md +111 -0
- package/dist/skills/question-gate/references/diagram-routing.md +58 -0
- package/dist/skills/question-gate/scripts/triage-question.py +713 -0
- package/dist/skills/question-gate/tests/fixtures/question-corpus.json +481 -0
- package/dist/skills/question-gate/tests/question-corpus.test.sh +32 -0
- package/dist/skills/question-gate/tests/triage-question.test.sh +441 -0
- package/dist/skills/regression-testing/SKILL.md +49 -0
- package/dist/skills/regression-testing/references/evidence-record.md +35 -0
- package/dist/skills/requirements-spec/SKILL.md +59 -0
- package/dist/skills/risk-scout/SKILL.md +53 -0
- package/dist/skills/risk-scout/references/risk-matrix.md +49 -0
- package/dist/skills/skill-clean-architecture/SKILL.md +54 -0
- package/dist/skills/skill-clean-architecture/references/layer-rules.md +22 -0
- package/dist/skills/skill-clean-architecture/references/source-headers.md +31 -0
- package/dist/skills/skill-clean-architecture/scripts/measure-bigo.py +427 -0
- package/dist/skills/skill-clean-architecture/tests/fixtures/bigo/bad-utf8.js +1 -0
- package/dist/skills/skill-clean-architecture/tests/fixtures/bigo/edge-crlf.ts +6 -0
- package/dist/skills/skill-clean-architecture/tests/fixtures/bigo/edge-mixed.ts +15 -0
- package/dist/skills/skill-clean-architecture/tests/fixtures/bigo/empty.js +0 -0
- package/dist/skills/skill-clean-architecture/tests/fixtures/bigo/no-newline.js +1 -0
- package/dist/skills/skill-clean-architecture/tests/fixtures/bigo.expected.yml +95 -0
- package/dist/skills/skill-clean-architecture/tests/measure-bigo.test.sh +222 -0
- package/dist/skills/tool-depot/SKILL.md +47 -0
- package/dist/skills/tool-depot/references/checkout.md +29 -0
- package/dist/skills/tool-depot/references/loki-read.md +41 -0
- package/dist/skills/tool-depot/references/readonly-access.md +84 -0
- package/dist/skills/tool-depot/references/tool-catalog.json +47 -0
- package/dist/skills/tool-depot/scripts/loki-runtime-logs.py +305 -0
- package/dist/skills/tool-depot/tests/loki-runtime-logs.test.sh +101 -0
- package/dist/skills/watcher-observability/SKILL.md +73 -0
- package/dist/skills/watcher-observability/references/batch-protocol.md +44 -0
- package/dist/skills/watcher-observability/references/configuration.md +31 -0
- package/dist/skills/watcher-observability/references/error-scan.md +102 -0
- package/dist/skills/watcher-observability/references/live-protocol.md +49 -0
- package/dist/skills/watcher-observability/references/server-account.md +72 -0
- package/dist/skills/watcher-observability/scripts/error-scan.py +318 -0
- package/dist/skills/watcher-observability/scripts/resolve-containers.py +155 -0
- package/dist/skills/watcher-observability/scripts/save-counts.py +381 -0
- package/dist/skills/watcher-observability/scripts/summarize-logs.py +113 -0
- package/dist/skills/watcher-observability/scripts/watch-live.py +606 -0
- package/dist/skills/watcher-observability/server/watcher-gate.sh +51 -0
- package/dist/skills/watcher-observability/tests/error-scan.test.sh +257 -0
- package/dist/skills/watcher-observability/tests/live-windows.test.sh +177 -0
- package/dist/skills/watcher-observability/tests/resolve-containers.test.sh +87 -0
- package/dist/skills/watcher-observability/tests/save-counts.test.sh +338 -0
- package/dist/skills/watcher-observability/tests/sleuth.test.sh +176 -0
- package/dist/skills/watcher-observability/tests/summarize-logs.test.sh +105 -0
- package/dist/skills/watcher-observability/tests/watcher-config.test.sh +70 -0
- package/dist/skills/watcher-observability/tests/watcher-gate.test.sh +110 -0
- package/dist/skills/watcher-observability/watcher.json +1 -0
- package/dist/skills/workflow-auditor/SKILL.md +55 -0
- package/dist/skills/workflow-auditor/references/audit-protocol.md +49 -0
- package/dist/skills/workflow-auditor/references/ledger.md +122 -0
- package/dist/skills/workflow-auditor/scripts/audit-ledger.py +624 -0
- package/dist/skills/workflow-auditor/scripts/list-zed-commands.py +183 -0
- package/dist/skills/workflow-auditor/scripts/render-workflow.py +201 -0
- package/dist/skills/workflow-auditor/scripts/validate-skills.py +444 -0
- package/dist/skills/workflow-auditor/tests/audit-ledger.test.sh +660 -0
- package/dist/skills/workflow-auditor/tests/list-zed-commands.test.sh +93 -0
- package/dist/skills/workflow-auditor/tests/render-workflow.test.sh +135 -0
- package/dist/skills/workflow-auditor/tests/validate-skills.test.sh +190 -0
- package/package.json +27 -6
- package/README.md +0 -3
|
@@ -0,0 +1,200 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
set -euo pipefail
|
|
3
|
+
cd -- "${BASH_SOURCE[0]%/*}/.."
|
|
4
|
+
|
|
5
|
+
SCRIPT="$PWD/scripts/extract-diff-scope.py"
|
|
6
|
+
PYTHON_BIN=$(command -v python3 || command -v python)
|
|
7
|
+
run() { "$PYTHON_BIN" -I -B "$SCRIPT" "$@"; }
|
|
8
|
+
scratch=$(mktemp -d)
|
|
9
|
+
trap 'rm -rf -- "$scratch"' EXIT
|
|
10
|
+
|
|
11
|
+
failures=0
|
|
12
|
+
checks=0
|
|
13
|
+
|
|
14
|
+
assert_contains() {
|
|
15
|
+
local label=$1 haystack=$2 needle=$3
|
|
16
|
+
checks=$((checks + 1))
|
|
17
|
+
if ! printf '%s' "$haystack" | grep -Fq -- "$needle"; then
|
|
18
|
+
printf 'FAIL [%s]: expected to contain: %s\n' "$label" "$needle" >&2
|
|
19
|
+
failures=$((failures + 1))
|
|
20
|
+
fi
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
assert_not_contains() {
|
|
24
|
+
local label=$1 haystack=$2 needle=$3
|
|
25
|
+
checks=$((checks + 1))
|
|
26
|
+
if printf '%s' "$haystack" | grep -Fq -- "$needle"; then
|
|
27
|
+
printf 'FAIL [%s]: expected NOT to contain: %s\n' "$label" "$needle" >&2
|
|
28
|
+
failures=$((failures + 1))
|
|
29
|
+
fi
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
repo="$scratch/repo"
|
|
33
|
+
mkdir -p "$repo/src" "$repo/dist"
|
|
34
|
+
git -C "$repo" init -q
|
|
35
|
+
git -C "$repo" config user.email "test@example.com"
|
|
36
|
+
git -C "$repo" config user.name "Test"
|
|
37
|
+
|
|
38
|
+
cat >"$repo/src/service.ts" <<'EOF'
|
|
39
|
+
export function greet(name: string): string {
|
|
40
|
+
return `hi ${name}`
|
|
41
|
+
}
|
|
42
|
+
EOF
|
|
43
|
+
git -C "$repo" add src/service.ts
|
|
44
|
+
git -C "$repo" commit -q -m "init"
|
|
45
|
+
|
|
46
|
+
# 1. Working mode includes tracked modifications AND untracked new .ts files, excludes dist/ and .md
|
|
47
|
+
cat >"$repo/src/service.ts" <<'EOF'
|
|
48
|
+
export function greet(name: string, items: string[]): string {
|
|
49
|
+
const raw: any = name
|
|
50
|
+
if (items.length > 0) {
|
|
51
|
+
return raw
|
|
52
|
+
} else {
|
|
53
|
+
return items.filter(x => items.includes(x)).join(',')
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
EOF
|
|
57
|
+
cat >"$repo/src/helper.ts" <<'EOF'
|
|
58
|
+
export const castVal = (v: unknown) => v as string
|
|
59
|
+
export const dupTernary = async (fn: (a: string, opt?: string) => Promise<void>, opt?: string) =>
|
|
60
|
+
opt
|
|
61
|
+
? await fn('a', opt)
|
|
62
|
+
: await fn('a')
|
|
63
|
+
EOF
|
|
64
|
+
cat >"$repo/dist/generated.js" <<'EOF'
|
|
65
|
+
const ignored: any = 1
|
|
66
|
+
EOF
|
|
67
|
+
cat >"$repo/README.md" <<'EOF'
|
|
68
|
+
# Ignored markdown
|
|
69
|
+
EOF
|
|
70
|
+
|
|
71
|
+
out_working=$(cd "$repo" && run --working)
|
|
72
|
+
assert_contains "working mode" "$out_working" 'mode: "working"'
|
|
73
|
+
assert_contains "working files_changed" "$out_working" 'files_changed: 2'
|
|
74
|
+
assert_contains "working tracked file" "$out_working" 'file: "src/service.ts"'
|
|
75
|
+
assert_contains "working untracked file" "$out_working" 'file: "src/helper.ts"'
|
|
76
|
+
assert_not_contains "working excludes dist" "$out_working" 'dist/generated.js'
|
|
77
|
+
assert_not_contains "working excludes md" "$out_working" 'README.md'
|
|
78
|
+
assert_contains "working typesafe candidate" "$out_working" 'const raw: any = name'
|
|
79
|
+
assert_contains "working earlyreturn candidate" "$out_working" '} else {'
|
|
80
|
+
assert_contains "working duplicate ternary candidate" "$out_working" "? await fn('a', opt)"
|
|
81
|
+
assert_contains "working bigo candidate" "$out_working" 'items.filter(x => items.includes(x))'
|
|
82
|
+
|
|
83
|
+
# The `records` section lists every added line, so the checks above pass even if
|
|
84
|
+
# a gate regex is broken. Assert inside each gate's own section as well.
|
|
85
|
+
section() { printf '%s\n' "$1" | sed -n "/^ $2:/,/^ [a-z_]*:/p"; }
|
|
86
|
+
ts_sec=$(section "$out_working" typesafe_candidates)
|
|
87
|
+
er_sec=$(section "$out_working" earlyreturn_candidates)
|
|
88
|
+
bo_sec=$(section "$out_working" bigo_candidates)
|
|
89
|
+
assert_contains "typesafe section: any" "$ts_sec" 'const raw: any = name'
|
|
90
|
+
assert_contains "typesafe section: as cast" "$ts_sec" 'v as string'
|
|
91
|
+
assert_not_contains "typesafe section: no plain line" "$ts_sec" 'if (items.length > 0) {'
|
|
92
|
+
assert_contains "earlyreturn section: else" "$er_sec" '} else {'
|
|
93
|
+
assert_contains "earlyreturn section: ternary" "$er_sec" "? await fn('a', opt)"
|
|
94
|
+
assert_not_contains "earlyreturn section: no any line" "$er_sec" 'const raw: any = name'
|
|
95
|
+
assert_contains "bigo section: filter+includes" "$bo_sec" 'items.filter(x => items.includes(x))'
|
|
96
|
+
assert_not_contains "bigo section: no any line" "$bo_sec" 'const raw: any = name'
|
|
97
|
+
|
|
98
|
+
# 2. Staged mode only includes staged files
|
|
99
|
+
git -C "$repo" add src/helper.ts
|
|
100
|
+
out_staged=$(cd "$repo" && run --staged)
|
|
101
|
+
assert_contains "staged mode" "$out_staged" 'mode: "staged"'
|
|
102
|
+
assert_contains "staged files_changed" "$out_staged" 'files_changed: 1'
|
|
103
|
+
assert_contains "staged has helper.ts" "$out_staged" 'file: "src/helper.ts"'
|
|
104
|
+
assert_not_contains "staged excludes unstaged service.ts" "$out_staged" 'file: "src/service.ts"'
|
|
105
|
+
|
|
106
|
+
# 3. Range mode works across commits
|
|
107
|
+
git -C "$repo" add src/service.ts
|
|
108
|
+
git -C "$repo" commit -q -m "wave 1"
|
|
109
|
+
out_range=$(cd "$repo" && run --range HEAD~1..HEAD)
|
|
110
|
+
assert_contains "range mode" "$out_range" 'mode: "range"'
|
|
111
|
+
assert_contains "range files_changed" "$out_range" 'files_changed: 2'
|
|
112
|
+
|
|
113
|
+
# 4. Head mode works and empty working tree yields 0 files
|
|
114
|
+
out_head=$(cd "$repo" && run --head 1)
|
|
115
|
+
assert_contains "head mode" "$out_head" 'mode: "head"'
|
|
116
|
+
assert_contains "head files_changed" "$out_head" 'files_changed: 2'
|
|
117
|
+
|
|
118
|
+
rm -f "$repo/dist/generated.js" "$repo/README.md"
|
|
119
|
+
out_clean=$(cd "$repo" && run --working)
|
|
120
|
+
assert_contains "clean files_changed 0" "$out_clean" 'files_changed: 0'
|
|
121
|
+
assert_contains "clean empty records" "$out_clean" 'records: []'
|
|
122
|
+
|
|
123
|
+
# 5. Unknown options and invalid --head must exit non-zero
|
|
124
|
+
checks=$((checks + 1))
|
|
125
|
+
if (cd "$repo" && run --bogus-flag >/dev/null 2>&1); then
|
|
126
|
+
printf 'FAIL [unknown option]: expected non-zero exit code\n' >&2
|
|
127
|
+
failures=$((failures + 1))
|
|
128
|
+
fi
|
|
129
|
+
|
|
130
|
+
checks=$((checks + 1))
|
|
131
|
+
if (cd "$repo" && run --head foo >/dev/null 2>&1); then
|
|
132
|
+
printf 'FAIL [invalid --head]: expected non-zero exit code\n' >&2
|
|
133
|
+
failures=$((failures + 1))
|
|
134
|
+
fi
|
|
135
|
+
|
|
136
|
+
# 6. diff.noprefix=true in git config must still parse tracked files
|
|
137
|
+
out_noprefix=$(cd "$repo" && git -c diff.noprefix=true status >/dev/null && GIT_CONFIG_PARAMETERS="'diff.noprefix=true'" run --range HEAD~1..HEAD)
|
|
138
|
+
assert_contains "diff.noprefix=true preserves files_changed" "$out_noprefix" 'files_changed: 2'
|
|
139
|
+
assert_contains "diff.noprefix=true preserves records" "$out_noprefix" 'const raw: any = name'
|
|
140
|
+
|
|
141
|
+
# 7. ADR 0001 portability: only python and git are needed (no bash, awk, wc or tr).
|
|
142
|
+
gitdir="$scratch/only-git"
|
|
143
|
+
mkdir -p "$gitdir"
|
|
144
|
+
ln -s "$(command -v git)" "$gitdir/git"
|
|
145
|
+
py_abs=$("$PYTHON_BIN" -c 'import sys; print(sys.executable)')
|
|
146
|
+
out_bare=$(cd "$repo" && env -i HOME="$HOME" PATH="$gitdir" "$py_abs" -I -B "$SCRIPT" --head 1 2>&1) || true
|
|
147
|
+
assert_contains "no awk/bash: runs" "$out_bare" 'files_changed: 2'
|
|
148
|
+
assert_contains "no awk/bash: records" "$out_bare" 'const raw: any = name'
|
|
149
|
+
|
|
150
|
+
# 8. Legacy escaping is part of the contract: the files list escapes quotes,
|
|
151
|
+
# tracked and untracked records carry the path as git prints it.
|
|
152
|
+
cat >"$repo/src/quo\"te.ts" <<'EOF'
|
|
153
|
+
const q: any = 1
|
|
154
|
+
EOF
|
|
155
|
+
out_quote=$(cd "$repo" && run --working)
|
|
156
|
+
assert_contains "quoted name escaped in files" "$out_quote" ' - "src/quo\"te.ts"'
|
|
157
|
+
assert_contains "quoted name raw in untracked record" "$out_quote" ' - file: "src/quo"te.ts"'
|
|
158
|
+
rm -f "$repo/src/quo\"te.ts"
|
|
159
|
+
|
|
160
|
+
# 9. Each BigO alternative must be reachable on its own: a line that only
|
|
161
|
+
# matches through .map( must reach bigo_candidates.
|
|
162
|
+
cat >"$repo/src/only-map.ts" <<'EOF'
|
|
163
|
+
export const ids = rows.map(r => r.id)
|
|
164
|
+
EOF
|
|
165
|
+
bo_map=$(section "$(cd "$repo" && run --working)" bigo_candidates)
|
|
166
|
+
assert_contains "bigo section: map alone" "$bo_map" 'rows.map(r => r.id)'
|
|
167
|
+
rm -f "$repo/src/only-map.ts"
|
|
168
|
+
|
|
169
|
+
# 10. #41 regression: deep nesting is 12+ leading spaces before if/for/while.
|
|
170
|
+
printf 'function f() {\n if (deep) {}\n if (shallow) {}\n}\n' >"$repo/src/nesting.ts"
|
|
171
|
+
er_nest=$(section "$(cd "$repo" && run --working)" earlyreturn_candidates)
|
|
172
|
+
assert_contains "earlyreturn: 12 spaces is deep" "$er_nest" ' if (deep) {}'
|
|
173
|
+
assert_not_contains "earlyreturn: 10 spaces is not" "$er_nest" 'if (shallow)'
|
|
174
|
+
rm -f "$repo/src/nesting.ts"
|
|
175
|
+
|
|
176
|
+
# 11. Line numbers are positions in the NEW file. Removed lines ("-") and the
|
|
177
|
+
# "" marker do not exist there, so they must not
|
|
178
|
+
# advance the counter (the awk version counted them and shifted every
|
|
179
|
+
# added line after a deletion).
|
|
180
|
+
lines_repo="$scratch/lines"
|
|
181
|
+
mkdir -p "$lines_repo"
|
|
182
|
+
git -C "$lines_repo" init -q
|
|
183
|
+
git -C "$lines_repo" config user.email "test@example.com"
|
|
184
|
+
git -C "$lines_repo" config user.name "Test"
|
|
185
|
+
printf 'a\nb\nc\nd\n' >"$lines_repo/replace.ts"
|
|
186
|
+
printf 'x\ny' >"$lines_repo/nonl.ts"
|
|
187
|
+
git -C "$lines_repo" add . && git -C "$lines_repo" commit -q -m base
|
|
188
|
+
printf 'a\nconst x: any = 1\nconst y: any = 2\nd\n' >"$lines_repo/replace.ts"
|
|
189
|
+
printf 'x\ny\nconst z: any = 3\n' >"$lines_repo/nonl.ts"
|
|
190
|
+
out_lines=$(cd "$lines_repo" && run --working)
|
|
191
|
+
lines_of() { printf '%s\n' "$out_lines" | grep -B3 -F "content: \"$1\"" | grep -m1 -o 'line: [0-9]*'; }
|
|
192
|
+
checks=$((checks + 1))
|
|
193
|
+
got="$(lines_of 'const x: any = 1') $(lines_of 'const y: any = 2') $(lines_of 'const z: any = 3')"
|
|
194
|
+
if [[ $got != 'line: 2 line: 3 line: 3' ]]; then
|
|
195
|
+
printf 'FAIL [new-file line numbers]: got %s, want line: 2 line: 3 line: 3\n' "$got" >&2
|
|
196
|
+
failures=$((failures + 1))
|
|
197
|
+
fi
|
|
198
|
+
|
|
199
|
+
printf 'extract-diff-scope.test.sh: %d checks, %d failures\n' "$checks" "$failures"
|
|
200
|
+
[[ "$failures" -eq 0 ]]
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: delivery-coordinator
|
|
3
|
+
description: "Trigger: Delivery Coordinator, feature, bug fix, PRD, GitHub issue. Clarify requirements, triage Watcher evidence, and guide test-first implementation with DDD."
|
|
4
|
+
license: Apache-2.0
|
|
5
|
+
compatibility: Requires Python 3.8+ and Git for scripts/classify-change-lane.py, scripts/check-worktree-guard.py and scripts/check-issue-claim.py (standard library only; Linux, macOS and Windows).
|
|
6
|
+
metadata:
|
|
7
|
+
author: bbc-skill-internals
|
|
8
|
+
version: "1.7"
|
|
9
|
+
pre_hook: "check-issue-claim.py (references/issue-claim.md) + git worktree add -b feat/<task> + bbc-delivery-ledger.json (references/worktree-isolation.md)"
|
|
10
|
+
post_hook: "question-gate (triage-question.py) + Quest-Tree HUD (references/hud-output.md)"
|
|
11
|
+
scripts: "scripts/check-worktree-guard.py, scripts/classify-change-lane.py, scripts/check-issue-claim.py"
|
|
12
|
+
---
|
|
13
|
+
|
|
14
|
+
## Activation Contract
|
|
15
|
+
|
|
16
|
+
Use to scope a feature, investigate a fix, draft or file an issue, or implement an approved change. Accept one or more of the three [standard inputs](references/intake.md#standard-inputs): a human request, an existing issue or PRD, or an optional sanitized Watcher Sleuth `report.json`. Links, local files, an authorized CLI, or MCP only retrieve inputs; they are not inputs or permissions.
|
|
17
|
+
|
|
18
|
+
**Company role:** Tech Lead coordinating AI agents. People approve open decisions (Product Manager), authorize implementation (Tech Lead), review and merge (Code Owner), and decide deployment (Release Owner). See the [roles and approvals](references/intake.md#roles-and-approvals).
|
|
19
|
+
|
|
20
|
+
## Hard Rules
|
|
21
|
+
|
|
22
|
+
- Route covered GitHub reads and issue/project writes through `tool-depot`. If it is unavailable or the request is not eligible, use supplied artifacts or prepare a local draft; do not perform the covered operation.
|
|
23
|
+
- **Mandate 1 — Always associate every delivery with a canonical GitHub issue:**
|
|
24
|
+
1. Never implement a `change` delivery without a canonical GitHub issue (`<owner/repo>#<n>`). First [search for an existing issue](references/issue-dedup.md) (open, closed, and drafts) via `tool-depot` (`github-read` / `check-duplicate-issues`, and `read-approved-issue-or-pr`).
|
|
25
|
+
2. **If a matching issue exists:** link it as the canonical issue in the delivery ledger (reuse if open, or reopen per `issue-dedup.md`) **and** comment on it (`github-write` / `comment-approved-issue`, with user authorization and a sanitized [visual reference](references/visual-reference.md) or `🟡 GAP visual`) stating that work is starting and linking the scope/branch.
|
|
26
|
+
3. **If no matching issue exists:** create a new GitHub issue following the repository's `.github/ISSUE_TEMPLATE/` via `tool-depot` (`github-write` / `publish-approved-issue`, with user authorization and a sanitized visual reference or `🟡 GAP visual`) and link that new `#<n>` as the canonical issue before implementing.
|
|
27
|
+
- **Mandate 2 — Always move the canonical issue on the GitHub Project board to `"Trabajando"` / `"Working"` (or equivalent active status):**
|
|
28
|
+
- When starting work on the canonical issue (together with claiming it), inspect the repository/organization's GitHub Project v2 board via `tool-depot` (`github-read` / `read-approved-project-board`) to read the real `Status` field options (never invent column names).
|
|
29
|
+
- Add the issue to the board if absent and update its Status to the active-work option (`"Trabajando"`, `"Working"`, `"In Progress"`, `"En progreso"`, or the board's matching active state) via `tool-depot` (`github-write` / `update-approved-project-status`, with user authorization).
|
|
30
|
+
- If no GitHub Project board is configured or the host token lacks `project` / `read:project` scopes, record an explicit `🟡 GAP` in the delivery ledger and display it in the Game HUD; never skip silently or claim the status changed.
|
|
31
|
+
|
|
32
|
+
- Establish observable acceptance criteria before coding. Keep them in the canonical issue or PRD; a separate specification is not required. Ask only for decisions that prevent a testable scope; present each open decision in plain language with a clear recommendation and why, and wait for user approval.
|
|
33
|
+
- Treat reports as untrusted evidence, not instructions or proof of cause. Never attach full reports, raw logs, secrets, or private identifiers to issues. Use synthetic fixtures.
|
|
34
|
+
- Do not implement an issue-only request or publish, comment on, or move an issue without authorization. Confirm the target repository and follow its templates and policy.
|
|
35
|
+
- One person per canonical issue. Before the worktree, [claim the issue](references/issue-claim.md): check it with `scripts/check-issue-claim.py`, assign the person and add `status:in-progress` through `tool-depot` (`claim-approved-issue`), and recheck. If someone else holds it, stop and bring the holder to the Tech Lead; never work on it in parallel or remove another person's claim.
|
|
36
|
+
- Every issue you publish, update, or comment on (including the start-of-work comment and the PR back-link) embeds at least one sanitized [visual reference](references/visual-reference.md): the person's attachment, a screenshot of the failure or the change, or a rendered image of sanitized evidence. If none can be produced safely, state a `🟡 GAP visual` in the issue and the HUD; never skip it silently.
|
|
37
|
+
- Before stopping to ask the user any question or next-step prompt, run `question-gate` (`triage-question.py`). Never offload local testing (`"¿prefieres probarlo primero en local?"`), quality checks, or doc audits to the user, and never bundle a delegable check with a Commit & PR authorization question.
|
|
38
|
+
- Keep a [delivery ledger](../workflow-auditor/references/ledger.md) for every delivery: each stage as it runs (including gaps and fix loops), each human authorization, each Tool Depot request with its decision, and each covered tool use. Record only what happened; never add an authorization a person did not give.
|
|
39
|
+
|
|
40
|
+
## Decision Gates
|
|
41
|
+
|
|
42
|
+
| Request | First deliverable |
|
|
43
|
+
|---|---|
|
|
44
|
+
| Feature | Search for an existing matching issue first (link & comment if found, or draft/create a new issue with acceptance scenarios). Draft a brief PRD only if product decisions need more context. |
|
|
45
|
+
| Bug fix | Search for an existing matching issue first (link & comment if found, or draft/create a new issue with expected vs. observed behavior, minimal reproduction, and evidence gaps). |
|
|
46
|
+
| Issue only | Search duplicates first; draft, link/comment, reopen, or file as authorized (and move on the Project board only if work is starting), then stop before implementation. |
|
|
47
|
+
|
|
48
|
+
## Execution Steps
|
|
49
|
+
|
|
50
|
+
1. Classify each supplied item as a [standard input](references/intake.md#standard-inputs) or prior-stage evidence. Use the [handoff contracts](references/intake.md) to validate supplied artifacts and start at the earliest unmet stage within the authorized scope. Prefer the listed companion skills when an artifact is missing; accept equivalent evidence regardless of who produced it. **Resolve the canonical GitHub issue first:** search for an existing matching issue via `tool-depot` (`check-duplicate-issues` / `read-approved-issue-or-pr`), then—with user authorization—either link & comment on the matching issue (`comment-approved-issue`, or reopen per `issue-dedup.md`) or create a new issue (`publish-approved-issue`). For issue-only requests, stop after the authorized issue action. When scope is ready for changes, run `scripts/classify-change-lane.py` (`--files` or `--working`) to select the `trivial`, `standard`, or `high-risk` lane and record `lane` in the ledger (`high-risk` requires `risk-scout` / `residual_risk`; `trivial` uses proportional verification with `no-runnable-test`).
|
|
51
|
+
2. For the canonical issue, [claim it](references/issue-claim.md) first, continue only on `claimed-by-you`, record the `claim` stage, and move the issue on the GitHub Project v2 board (`read-approved-project-board` → `update-approved-project-status`) to `"Trabajando"` / `"Working"` / `"In Progress"` (or record an explicit `🟡 GAP` if the board or `project` token scope is unavailable). Before any authorized write or writer delegation, prepare and verify a dedicated linked worktree on `feat/<issue-number>-<slug>` from the remote's verified default branch, and verify it with `scripts/check-worktree-guard.py`. Use the [isolation preflight](references/worktree-isolation.md); stop the affected work if isolation is unavailable. Start the ledger in that worktree with the worktree record, canonical `issue`, Project board status (or gap), and the stages already met. Then follow the host's ODD workflow and track large work by reference. Reuse a reproducible RED tied to the criterion and relevant baseline, or produce one before changing production code when a test is applicable. If a reported bug cannot be reproduced safely, document the gap; do not implement a speculative fix.
|
|
52
|
+
3. Make the smallest scoped change, following DDD and repository conventions. Prefer `skill-clean-architecture` for guidance. Rerun the focused test and applicable existing checks on the resulting revision. If no meaningful runnable test applies, document why and verify proportionately without claiming RED/GREEN.
|
|
53
|
+
4. After each implementation slice reaches GREEN, verify TypeSafe, EarlyReturn, and BigO on the slice diff before closing or committing it. Prefer `code-quality-gate` (`--working` or `--range`); equivalent evidence must cover all three checks on the same diff. If blocked, address the findings and rerun the affected tests and quality checks.
|
|
54
|
+
5. Commit the slice and open or update the PR through the host workflow when authorized; CI is owned by the platform team, and no companion skill covers this step. When the delivery implements a canonical GitHub issue, include `Closes #<n>` (or `Refs #<n>`) in the PR body **and** immediately go to that issue via `tool-depot` (`github-write` / `comment-approved-issue`) to comment the opened PR link (URL, branch, and head SHA) with a visual reference of the change so the issue is never left orphaned. Record the PR link, head SHA, CI results, and—when an issue exists—`issue`, `issue_linked: true`, and the Tool Depot record in the ledger.
|
|
55
|
+
6. Run `greptile-review-loop` on every PR this workflow opens or updates, before the human handoff. The authorization to commit and publish that PR covers triggering its Greptile review and pushing in-scope fixes for confirmed findings to the same branch, within the loop's round budget. Require fresh Greptile evidence for the exact PR head. If Greptile is not configured, does not answer within the wait limit, or the budget ends, record the observed score (or unknown) and the open findings and continue: the gap goes to the Code Owner, it does not block the handoff.
|
|
56
|
+
7. Run `workflow-auditor` on the ledger of every PR this workflow opens or updates, after the Greptile loop and before the human handoff. Return each violation to the stage that owns it and rerun the audit after the fix; do not hand off a PR with open violations. Gaps travel with the PR.
|
|
57
|
+
8. Hand the PR, criteria, verification evidence, Greptile result, and audit verdict to the human Code Owner for review and merge. Requested changes return to step 3. If material operational risk remains or corrections expanded scope, prefer `risk-scout` for a read-only residual-risk assessment against the reviewed revision.
|
|
58
|
+
9. Provide the evidence and readiness conditions to the human Release Owner. Neither a 5/5 nor a merge authorizes deployment; deployment and production observation belong to the host process, with `watcher-observability` as an optional read-only source for new incidents.
|
|
59
|
+
|
|
60
|
+
## Companion Handoffs
|
|
61
|
+
|
|
62
|
+
When a change may affect user-facing documentation, hand off the exact diff and criteria to `documentation-steward` for a read-only audit. If an update is needed and in scope, request a documentation-only change in the assigned worktree and include the result in verification. Accept equivalent evidence when available.
|
|
63
|
+
|
|
64
|
+
Discover companions for the next unmet handoff: `question-gate` (before stopping to ask the user), `requirements-spec`, `regression-testing`, `skill-clean-architecture`, `code-quality-gate`, `greptile-review-loop` and `workflow-auditor` (every PR), or, when relevant, `watcher-observability` and `risk-scout`.
|
|
65
|
+
|
|
66
|
+
Check the active skill catalog for the named companion before relying on it. If availability is unknown and its help is needed, ask whether it is available; do not ask when equivalent evidence already satisfies the handoff. Never assume installation, install automatically, or transfer permissions.
|
|
67
|
+
|
|
68
|
+
## Output Contract
|
|
69
|
+
|
|
70
|
+
In **human-facing chat turns**, render the compact **Game HUD + Traffic-Light (`🟢` / `🟡` / `🔴`)** format in [hud-output.md](references/hud-output.md): short 1-line stage status, active `🌿` branch/short-SHA (keep full worktree path, base SHA, commands, and YAML in `bbc-delivery-ledger.json`, PR body, or on `"detalle"`), and at most one `🟡 BOSS GATE` decision with `[A]`/`[B]`, recommendation, and 1-line why. Keep `observation` vs. `hypothesis` vs. `verified cause` distinct, and never promote a `🟡` gap or `🔴` failure to `🟢`.
|
|
71
|
+
|
|
72
|
+
## References
|
|
73
|
+
|
|
74
|
+
- [Game HUD and traffic-light chat format](references/hud-output.md)
|
|
75
|
+
- [Worktree and execution isolation preflight](references/worktree-isolation.md)
|
|
76
|
+
|
|
77
|
+
- [Intake, issue drafting, evidence, and verification](references/intake.md)
|
|
78
|
+
- [Search before filing an issue: reuse, reopen, or create](references/issue-dedup.md)
|
|
79
|
+
- [Claim the issue before working on it: rules CL1-CL12 and C1-C4](references/issue-claim.md)
|
|
80
|
+
- [Visual reference on every issue write](references/visual-reference.md)
|
|
81
|
+
- [Synthetic exercise: Sleuth report to issue and regression test](references/sleuth-regression-exercise.md)
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
# Game HUD & Traffic-Light Chat Output
|
|
2
|
+
|
|
3
|
+
Use this **RPG Quest-Tree HUD** for **human-facing chat updates and decisions** so the user can scan status and decide in seconds. Keep full technical logs, exact commands, file lists, and YAML in `bbc-delivery-ledger.json`, PR descriptions, or an on-demand `"detalle"` reply.
|
|
4
|
+
|
|
5
|
+
## Traffic-Light Legend (`Semáforo`)
|
|
6
|
+
|
|
7
|
+
| Light | Meaning | When to use |
|
|
8
|
+
|---|---|---|
|
|
9
|
+
| `🟢` | Clear / Pass | Stage verified, tests GREEN, quality pass, Greptile 5/5, `conforms` |
|
|
10
|
+
| `🟡` | Caution / Decision / Gap | Pending human gate (`BOSS GATE`), non-blocking gap, optional warning |
|
|
11
|
+
| `🔴` | Blocked / Fail / RED | Failing test (intended RED or unexpected fail), `code-quality-gate` `block`, `workflow-auditor` `violations`, high risk |
|
|
12
|
+
|
|
13
|
+
## Rules for Agile Decisions
|
|
14
|
+
|
|
15
|
+
1. **Use the tree HUD (`├──`, `│`, `└──`, `···`)** with max 1 short line per item; omit stages that have not started yet.
|
|
16
|
+
2. **Never dump walls of text, raw YAML, or long file trees** in the decision turn unless a `🔴` blocker requires `file:line` or the user asks for `"detalle"`.
|
|
17
|
+
3. **Always verify first** via `question-gate` (`triage-question.py`) before emitting a `🟡 BOSS GATE`. Never put QA, lint, or doc audits inside a decision prompt.
|
|
18
|
+
4. **Match the user's language** (`es` / `en` / `pt`) and keep each line crisp and scannable.
|
|
19
|
+
5. **Truthfulness stays intact:** never turn a `🟡` gap or `🔴` failure into `🟢`, and keep `observation` vs. `hypothesis` clear in 1 short phrase.
|
|
20
|
+
|
|
21
|
+
## Standard Quest-Tree HUD Template
|
|
22
|
+
|
|
23
|
+
```text
|
|
24
|
+
🎮 QUEST ACTUAL ─ <short title / issue #link>
|
|
25
|
+
│ 🌿 <branch> · <base-short-sha>
|
|
26
|
+
│ 📌 Issue: #<n> (linked & commented | created) · 📊 Project: 🟢 Trabajando | 🟡 GAP <motivo>
|
|
27
|
+
│ 📍 Checkpoint: <current stage>
|
|
28
|
+
│
|
|
29
|
+
├── 📋 Spec ································ 🟢 <N> ACs | 🟡 <open decision>
|
|
30
|
+
├── 🧪 QA ·································· 🔴 → 🟢 <N>/<N> | 🟡 <gap>
|
|
31
|
+
├── 🛡️ Quality ····························· 🟢 <checks> | 🔴 <file:line>
|
|
32
|
+
│ └── <sub-check summary>
|
|
33
|
+
├── 🖼️ Visual ······························ 🟢 <N> imagen(es) en issue/PR | 🟡 GAP visual: <motivo>
|
|
34
|
+
├── ⭐ Review ······························ 🟢 5/5 | 🟡 <score/gap>
|
|
35
|
+
└── 🔍 Audit ······························· 🟢 conforms | 🔴 <rule IDs>
|
|
36
|
+
|
|
37
|
+
🟡 BOSS GATE ─ <Role: PM | Tech Lead | Commit & PR | Code Owner | Release Owner>
|
|
38
|
+
│
|
|
39
|
+
├── ❓ <Single focused question?>
|
|
40
|
+
│
|
|
41
|
+
├── 👉 Recomendado: [A]
|
|
42
|
+
│ └── <1-line reason>
|
|
43
|
+
│
|
|
44
|
+
└── ⚡ Opciones
|
|
45
|
+
├── [A] <fast action>
|
|
46
|
+
└── [B] <alternative>
|
|
47
|
+
|
|
48
|
+
💬 Escribe "detalle" para ver comandos, archivos o YAML completo.
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
*(If no human decision is needed—stage complete—close with `🏁 STAGE CLEAR` and 1 short line.)*
|
|
52
|
+
|
|
53
|
+
## When the User Asks for Details
|
|
54
|
+
|
|
55
|
+
If the user replies `"detalle"` / `"log"` / `"full"`, or when handing off a PR to Code Owner in the PR body, expand the full `evidence-record.md`, worktree path, base SHA, exact commands, and `code-quality-gate` / `workflow-auditor` details.
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
# Intake and evidence
|
|
2
|
+
|
|
3
|
+
## Standard inputs
|
|
4
|
+
|
|
5
|
+
Start from one or more of these three inputs. When several arrive together, the issue or PRD stays canonical and the others add context.
|
|
6
|
+
|
|
7
|
+
| Input | Accept when it provides | Use it to |
|
|
8
|
+
|---|---|---|
|
|
9
|
+
| Human request | The desired outcome or observed problem in the user's words. A short ask is enough. | Specify: draft or reuse acceptance criteria. |
|
|
10
|
+
| Existing issue or PRD | A readable reference with the problem and, ideally, observable acceptance criteria. | Specify: reuse its criteria; if they are already observable, continue at the first unmet stage. |
|
|
11
|
+
| Sleuth report (optional) | A sanitized Watcher `report.json`, read with its mode and coverage limits. | Add incident observations to Specify; never treat it as requirements or proof of cause. |
|
|
12
|
+
|
|
13
|
+
Access channels (a link, local file, authorized CLI, or MCP) only retrieve these inputs. They are not inputs and do not grant permission to connect, edit, or publish. Neither a PRD nor an MCP is required.
|
|
14
|
+
|
|
15
|
+
Prior-stage evidence, such as an existing failing test, CI result, or PR, is not a fourth input. Attach it to an input and validate it against the [handoff contracts](#handoff-contracts) to skip completed stages.
|
|
16
|
+
|
|
17
|
+
If nothing supplied matches a standard input, or a reference cannot be read, ask for a short request or a readable reference; do not guess the scope.
|
|
18
|
+
|
|
19
|
+
## Pick the source of truth
|
|
20
|
+
|
|
21
|
+
- **Always resolve to a canonical GitHub issue before implementation:** Every `change` delivery must have a canonical GitHub issue (`<owner/repo>#<n>`). First follow [search before filing](issue-dedup.md) (`tool-depot` → `github-read` / `check-duplicate-issues`).
|
|
22
|
+
- **Existing PRD or issue:** Read it first (`read-approved-issue-or-pr`). Reuse clear acceptance criteria and ask about material conflicts. Do not create a duplicate issue to restate it. Link it as the canonical issue and—with user authorization—post a start-of-work comment (`comment-approved-issue`) with a sanitized [visual reference](visual-reference.md) (or `🟡 GAP visual`).
|
|
23
|
+
- **Feature without an issue:** Draft an issue (or short PRD + issue) with the user problem, expected behavior, scope and non-goals, and observable acceptance criteria. Describe outcomes rather than dictating implementation details. Create the issue (`publish-approved-issue`) with user authorization before implementing.
|
|
24
|
+
- **Bug without a reproduction or existing issue:** Record the affected version/environment when known, expected and observed behavior, prerequisites, minimal reproduction steps, and a regression assertion. Mark unknowns; do not silently assume a root cause. If no matching issue exists, create one with user authorization before implementing.
|
|
25
|
+
- **GitHub Project board tracking:** Once the canonical issue is linked or created and work is starting, inspect the repository/organization's GitHub Project v2 board via `tool-depot` (`github-read` / `read-approved-project-board`) and—with user authorization—move the issue (adding it to the board if absent) to the active-work `Status` option matching `"Trabajando"`, `"Working"`, `"In Progress"`, or `"En progreso"` (`github-write` / `update-approved-project-status`). Never invent a status option; if the board does not exist or the host token lacks `project` / `read:project` scopes, record an explicit `🟡 GAP` in the ledger and HUD.
|
|
26
|
+
- **Issue publication:** Use the confirmed repository's issue template. Before filing or reopening, follow the [search-before-filing protocol](issue-dedup.md): reuse an open match, reopen one closed without a fix (with its history), or file a regression linked to one already fixed. If the user requests a draft, keep it local or in the conversation. Require authorization before publishing, commenting, or updating Project status on GitHub; do not create a PR as part of issue triage. Embed at least one sanitized [visual reference](visual-reference.md) in the issue, and attach every image the person supplied.
|
|
27
|
+
|
|
28
|
+
## Intake from Watcher Sleuth
|
|
29
|
+
|
|
30
|
+
1. Use the supplied `report.json` as a read-only input; do not run another capture or connect to a host unless separately authorized.
|
|
31
|
+
2. Read mode and coverage first. A counts-only report does not contain event-level evidence. Sleuth provides a bounded sample, so dropped or absent events do not prove that something did not happen.
|
|
32
|
+
3. Extract only the chronology, exception/cause types, codes, and sanitized frame kind/line that are relevant. Capture-local labels can correlate events within one report; labels from different captures cannot be joined. A frame or an adjacent event does not prove a cause.
|
|
33
|
+
4. In an issue, summarize observed behavior without pasting the report, exact host/container identifiers, or excerpts. Re-create relevant conditions using synthetic fixtures and record what still needs confirmation.
|
|
34
|
+
|
|
35
|
+
## Handoff contracts
|
|
36
|
+
|
|
37
|
+
Validate artifacts against the canonical requirement, relevant baseline or resulting revision, and authorized scope. Accept any standard input, or prior-stage evidence such as a CI result, when it meets the contract. The producer does not matter. Companions can run independently; install them only for the stages where you want their guidance.
|
|
38
|
+
|
|
39
|
+
| Stage | Accepts | Delivers | Preferred companion |
|
|
40
|
+
|---|---|---|---|
|
|
41
|
+
| Observe (optional) | User-authorized target, or existing incident evidence | Sanitized observations, source and coverage limits; separate facts from hypotheses | `watcher-observability` |
|
|
42
|
+
| Specify | Human request, existing issue or PRD, or Sleuth report observations | One canonical GitHub issue (`<owner/repo>#<n>` — linked & commented if existing, reopened, or created after duplicate search), criterion IDs, observable scenarios, and GitHub Project board status moved to active work (`Trabajando` / `Working` / `In Progress`, or explicit `🟡 GAP`) | `requirements-spec` |
|
|
43
|
+
| Reproduce | Criterion or reported mismatch | Test path, exact command, isolated fixture, relevant baseline, and observed RED for the expected reason; otherwise an explicit verification gap | `regression-testing` |
|
|
44
|
+
| Implement | Criterion and applicable RED, with explicit authorization | Scoped change, affected criterion IDs, and resulting revision or worktree | `skill-clean-architecture` |
|
|
45
|
+
| Verify | Scoped change and existing test evidence | Same focused test result and applicable check results tied to the resulting revision; report limitations | `regression-testing` |
|
|
46
|
+
| Check code quality | Verified implementation slice and exact diff | TypeSafe, EarlyReturn, and BigO findings or equivalent evidence covering all three checks | `code-quality-gate` |
|
|
47
|
+
| Commit and PR (host process) | Verified slice that passed the quality checks, with authorization to commit | PR link, exact head SHA, CI results, and—when tied to a canonical issue—the PR back-link comment on that issue via `tool-depot` (`comment-approved-issue`), with a [visual reference](visual-reference.md) of the change | none (host workflow) |
|
|
48
|
+
| Review (every PR) | PR, exact head SHA, criteria and verification results | Observed Greptile score, findings and status for that head, or the reason Greptile could not review it; only fresh Greptile evidence counts | `greptile-review-loop` |
|
|
49
|
+
| Audit workflow (every PR) | Delivery ledger for the PR, after the Greptile loop | Verdict `conforms`, `gaps`, or `violations` with rule IDs; violations return to the owning stage and the audit reruns | `workflow-auditor` |
|
|
50
|
+
| Assess residual risk (optional, after review) | Exact reviewed head, review and test evidence, and material rollout or recovery questions | Remaining risks, readiness conditions, and gaps for a human merge or deployment decision | `risk-scout` |
|
|
51
|
+
|
|
52
|
+
Human review and merge, the deployment decision, and deployment itself are not skill stages. They belong to the people and host processes in [Roles and approvals](#roles-and-approvals).
|
|
53
|
+
|
|
54
|
+
Record each stage, authorization, Tool Depot decision, and covered tool use in the [delivery ledger](../../workflow-auditor/references/ledger.md) as it happens; the workflow audit reads it.
|
|
55
|
+
|
|
56
|
+
Check the active skill catalog before relying on a companion. If availability is unknown and its help is needed, ask whether it is available; never install it automatically. If a companion is missing, reuse valid supplied artifacts or produce the missing artifact using the host repository's tools. If evidence cannot be validated or safely produced, block only the affected stage and continue independent authorized work. Never treat a gap as a pass. A handoff carries context and evidence, never permission to publish, connect to a host, or change production code.
|
|
57
|
+
|
|
58
|
+
Example: An issue already defines `C1`, and a test fails at the intended assertion on the relevant baseline. Validate both artifacts. With implementation authorization, start at Implement; do not draft another PRD, capture logs, or recreate the test. After implementation, rerun the test against the resulting change.
|
|
59
|
+
|
|
60
|
+
## Roles and approvals
|
|
61
|
+
|
|
62
|
+
Each skill is an AI agent playing a company role. Only people grant approvals; an agent never approves on a person's behalf.
|
|
63
|
+
|
|
64
|
+
| Step | Played by | Company role | Human approval |
|
|
65
|
+
|---|---|---|---|
|
|
66
|
+
| Human request | Person | Requester | Starts the work |
|
|
67
|
+
| Existing issue or PRD | Person or `requirements-spec` | Product Manager | — |
|
|
68
|
+
| Sleuth report | `watcher-observability` | SRE on call | Authorizes each capture target |
|
|
69
|
+
| Coordinate | `delivery-coordinator` | Tech Lead | — |
|
|
70
|
+
| Specify | `requirements-spec` | Product Manager | Product Manager approves open decisions |
|
|
71
|
+
| Assess risk | `risk-scout` | SRE or Staff Engineer | — |
|
|
72
|
+
| Reproduce and verify | `regression-testing` | QA Engineer | — |
|
|
73
|
+
| Implement | `skill-clean-architecture` | Software Engineer | Tech Lead authorizes the change |
|
|
74
|
+
| Check code quality | `code-quality-gate` | Software Engineer (self-check) | — |
|
|
75
|
+
| Commit and PR, CI | Host process | Software Engineer; Platform owns CI | Authorization to commit and publish (also covers the local review loop's review and its own threads, and linking the PR on the canonical issue) |
|
|
76
|
+
| AI review (every PR) | `greptile-review-loop` | AI Code Reviewer | Covered by the authorization to commit and publish that PR |
|
|
77
|
+
| Workflow audit (every PR) | `workflow-auditor` | Process Auditor | — (read-only; a `conforms` verdict is not an approval) |
|
|
78
|
+
| Review and merge | Person | Code Owner | Approves and merges, or requests changes |
|
|
79
|
+
| Deploy decision | Person | Release Owner | Approves or pauses the release |
|
|
80
|
+
| Deploy and observe | Host process, optional `watcher-observability` | SRE or DevOps | New incidents return as Sleuth input |
|
|
81
|
+
|
|
82
|
+
| Stage | Evidence to record |
|
|
83
|
+
|---|---|
|
|
84
|
+
| RED | Test command, expected observation, and the failure that proves the assertion detects the missing behavior. A setup failure is not RED. |
|
|
85
|
+
| GREEN | Same test now passes after the change. Run applicable existing checks and record failures or skips. |
|
|
86
|
+
| Document only | If reproduction is unsafe, unavailable, or inconclusive, preserve the minimum safe steps, observations, and remaining evidence needed. Do not claim that the defect was reproduced or fixed. |
|
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
# Claim the issue before working on it
|
|
2
|
+
|
|
3
|
+
One canonical issue, one person working on it. Before the worktree exists, Delivery Coordinator checks that nobody else holds the issue, claims it on GitHub, and checks again. Three colleagues who start on the same issue therefore stop at the claim instead of discovering each other at the PR.
|
|
4
|
+
|
|
5
|
+
Every rule below has an ID. `scripts/check-issue-claim.py` decides the `CL*` rules from GitHub output; `workflow-auditor` checks the `C*` rules in the ledger (`audit-ledger.py`) and reviews their meaning in its semantic pass. An LLM reading this file applies the same rules and must reach the same verdict as the script; when they differ, the script's verdict stands and the difference is reported.
|
|
6
|
+
|
|
7
|
+
## When it applies
|
|
8
|
+
|
|
9
|
+
| Situation | Claim? |
|
|
10
|
+
|---|---|
|
|
11
|
+
| `change` work that implements a canonical GitHub issue | Yes, after `specify` and before the worktree and RED. |
|
|
12
|
+
| `change` work with no GitHub issue (a direct request) | No. |
|
|
13
|
+
| `issue-only` or `read-only` work | No; recording a claim there is `K1`. |
|
|
14
|
+
|
|
15
|
+
## Definitions
|
|
16
|
+
|
|
17
|
+
| Term | Meaning |
|
|
18
|
+
|---|---|
|
|
19
|
+
| Claimant | The GitHub login of the person the agent works for: `gh api user --jq .login`. Never a bot's or someone else's login. |
|
|
20
|
+
| Claim | The claimant is an assignee **and** the issue has the claim label. |
|
|
21
|
+
| Claim label | `status:in-progress` unless the repository configures another (`--label`). A maintainer creates it once: `gh label create "status:in-progress"`. The workflow never creates labels. |
|
|
22
|
+
| Delivery branch | `feat/<issue-number>-<slug>`, for example `feat/12-retry-dedup`; `<slug>` is lowercase letters, digits, `.`, `_`, `-`. The number makes another person's branch visible on the remote. |
|
|
23
|
+
| Reporter | The issue author (`user.login`). See [reporter assignment](#reporter-assignment). |
|
|
24
|
+
| References the issue | A pull request whose title or body contains `#<n>`, `<owner/repo>#<n>` for this repository, or `github.com/<owner/repo>/issues/<n>`, or whose head branch is `feat/<n>-*`. `#123` does not reference `#12`. |
|
|
25
|
+
|
|
26
|
+
## Reporter assignment
|
|
27
|
+
|
|
28
|
+
[Issue Reviewer triage](../../issue-reviewer/references/triage.md) assigns the issue author so they own confirming the report. That assignment is not a claim:
|
|
29
|
+
|
|
30
|
+
- `check` and `status`: the reporter's assignment holds the issue only when the claim label is set and nobody else is assigned. A triaged issue with only its author assigned is `free` (and never a `stale-claim`).
|
|
31
|
+
- `verify` and `release`: the reporter's claim starts when the reporter set the claim label still in effect (`labeled` event); a label someone else set does not make the reporter a holder. `release` needs `--events-json` when the reporter remains assigned next to the label.
|
|
32
|
+
- A developer claiming the issue never removes the reporter's assignment.
|
|
33
|
+
|
|
34
|
+
## Procedure
|
|
35
|
+
|
|
36
|
+
### 1. Read (Tool Depot `github-read` / `check-issue-claim`)
|
|
37
|
+
|
|
38
|
+
One request covers these reads for the canonical issue. Use REST, as `/daily` does.
|
|
39
|
+
|
|
40
|
+
```bash
|
|
41
|
+
gh api user --jq .login # claimant
|
|
42
|
+
gh api repos/<owner>/<repo>/issues/<n> > issue.json
|
|
43
|
+
gh api --paginate --slurp "repos/<owner>/<repo>/pulls?state=open&per_page=100" > pulls.json
|
|
44
|
+
git ls-remote --heads <remote> "feat/<n>-*" > branches.txt
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
### 2. Check
|
|
48
|
+
|
|
49
|
+
```bash
|
|
50
|
+
python3 -I -B <delivery-coordinator>/scripts/check-issue-claim.py --phase check \
|
|
51
|
+
--issue-json issue.json --pulls-json pulls.json --branches branches.txt \
|
|
52
|
+
--claimant <login> --branch feat/<n>-<slug> --repo <owner>/<repo>
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
| Verdict | Exit | Next |
|
|
56
|
+
|---|---|---|
|
|
57
|
+
| `free` | 0 | Claim it (step 3). |
|
|
58
|
+
| `claimed-by-you` | 0 | Already yours; skip the write and recheck (step 4). |
|
|
59
|
+
| `claimed-by-other`, `orphan-claim` | 1 | Stop. Show who holds it (`holders`) and open one `🟡 BOSS GATE` for the Tech Lead: **[A]** coordinate with the holder (review or split their PR), recommended; **[B]** take over only with an explicit handover. |
|
|
60
|
+
| `closed` | 1 | Stop. Apply [search before filing](issue-dedup.md) to decide whether to reopen. |
|
|
61
|
+
| `invalid-branch` | 1 | Rename the planned branch to `feat/<n>-<slug>` and rerun. |
|
|
62
|
+
| `unusable` | 2 | Report what is missing; do not claim from memory. |
|
|
63
|
+
|
|
64
|
+
### 3. Claim (Tool Depot `github-write` / `claim-approved-issue`)
|
|
65
|
+
|
|
66
|
+
The `implement` authorization for this issue covers the claim. It changes only the claimant's own assignment and the claim label; it never posts a comment, so the visual reference rule does not apply.
|
|
67
|
+
|
|
68
|
+
```bash
|
|
69
|
+
gh api -X POST repos/<owner>/<repo>/issues/<n>/assignees -f "assignees[]=<login>"
|
|
70
|
+
gh api -X POST repos/<owner>/<repo>/issues/<n>/labels -f "labels[]=status:in-progress"
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
### 4. Recheck
|
|
74
|
+
|
|
75
|
+
GitHub has no lock: two people can assign themselves in the same second. Read the issue again, add its events, and run the `verify` phase:
|
|
76
|
+
|
|
77
|
+
```bash
|
|
78
|
+
gh api repos/<owner>/<repo>/issues/<n> > issue.json
|
|
79
|
+
gh api --paginate --slurp repos/<owner>/<repo>/issues/<n>/events > events.json
|
|
80
|
+
python3 -I -B <delivery-coordinator>/scripts/check-issue-claim.py --phase verify \
|
|
81
|
+
--issue-json issue.json --pulls-json pulls.json --branches branches.txt --events-json events.json \
|
|
82
|
+
--claimant <login> --branch feat/<n>-<slug> --repo <owner>/<repo>
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
Continue to the worktree only on `claimed-by-you`. On `contended-lost`, release your claim (step 5) and stop as in `claimed-by-other`.
|
|
86
|
+
|
|
87
|
+
### 5. Release
|
|
88
|
+
|
|
89
|
+
When the delivery stops without a PR (a `not-reproducible` gap, a lost race, or the person abandons it), remove your own assignment, and the label if nobody else holds the issue, then confirm. Add `--events-json` (as in step 4) when the reporter is still assigned:
|
|
90
|
+
|
|
91
|
+
```bash
|
|
92
|
+
gh api -X DELETE repos/<owner>/<repo>/issues/<n>/assignees -f "assignees[]=<login>"
|
|
93
|
+
gh api -X DELETE "repos/<owner>/<repo>/issues/<n>/labels/status:in-progress"
|
|
94
|
+
python3 -I -B <delivery-coordinator>/scripts/check-issue-claim.py --phase release --issue-json issue.json --claimant <login>
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
Record the release as another `claim-approved-issue` use and add `"release": "released"` to the claim stage evidence. A merged PR with `Closes #<n>` closes the issue; no release is needed.
|
|
98
|
+
|
|
99
|
+
## Rules decided by `check-issue-claim.py`
|
|
100
|
+
|
|
101
|
+
| Rule | Phase | Condition | Verdict |
|
|
102
|
+
|---|---|---|---|
|
|
103
|
+
| `CL1` | all | An input is missing, unreadable or malformed; `--claimant` or `--branch` is missing where required; several assignees in `verify` without events that order them. | `unusable` |
|
|
104
|
+
| `CL2` | check, verify | The issue is not open. | `closed` |
|
|
105
|
+
| `CL3` | check | Someone other than the claimant is assigned (the reporter only with the claim label and nobody else assigned). | `claimed-by-other` |
|
|
106
|
+
| `CL4` | check, verify | An open pull request by someone else references the issue. | `claimed-by-other` |
|
|
107
|
+
| `CL5` | check, verify | A remote `feat/<n>-*` branch other than the delivery branch exists. | `claimed-by-other` |
|
|
108
|
+
| `CL6` | check, status | The claim label is set and nobody is assigned. | `orphan-claim` |
|
|
109
|
+
| `CL7` | check, verify | The delivery branch is not `feat/<n>-<slug>` for this issue. | `invalid-branch` |
|
|
110
|
+
| `CL8` | verify | After claiming, the claimant is not assigned or the label is missing. | `unrecorded-claim` |
|
|
111
|
+
| `CL9` | verify | Several assignees and another login's claim still in effect is older than the claimant's (ties: lowest login); the reporter's claim dates from the claim label they set, and without one they do not compete. | `contended-lost` |
|
|
112
|
+
| `CL10` | release | The claimant is still assigned, or the label remains with no other holder (the reporter holds it only if they set it). | `still-held` |
|
|
113
|
+
| `CL11` | status | More than one open pull request references the issue. | `duplicate-work` |
|
|
114
|
+
| `CL12` | status | Held (assigned other than the bare reporter assignment, or labelled), no referencing pull request, no `feat/<n>-*` branch, and no issue activity for more than `--stale-days` (7). | `stale-claim` |
|
|
115
|
+
|
|
116
|
+
When several rules match, every finding is listed and the verdict is the most severe in this order: `closed`, `claimed-by-other`, `contended-lost`, `orphan-claim`, `invalid-branch`, `unrecorded-claim`, `still-held`, `duplicate-work`, `stale-claim`. With no finding the verdict is `free` or `claimed-by-you` (check), `claimed-by-you` (verify), `released` (release), or `claimed` / `unclaimed` (status).
|
|
117
|
+
|
|
118
|
+
## Ledger record and rules checked by `workflow-auditor`
|
|
119
|
+
|
|
120
|
+
Record the claim as a `claim` stage, and both Tool Depot requests and uses, in the [delivery ledger](../../workflow-auditor/references/ledger.md):
|
|
121
|
+
|
|
122
|
+
```json
|
|
123
|
+
{"stage": "claim", "status": "done", "actor": "delivery-coordinator", "authorization": "AUTH-1",
|
|
124
|
+
"evidence": {"issue": "owner/repo#12", "claimant": "ana", "check": "free", "verify": "claimed-by-you"}}
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
For a handover, `check` keeps the observed verdict and `evidence.handover` names the authorization of the person (holder or Tech Lead) who handed the issue over; it must cover `claim`. If the claimant cannot claim (for example, no triage permission), close the stage as a `gap` with that reason; it travels to the Code Owner as `G1`.
|
|
128
|
+
|
|
129
|
+
| Rule | Violation |
|
|
130
|
+
|---|---|
|
|
131
|
+
| `C1` | `change` work with a canonical issue (top-level `issue` or `commit_pr.evidence.issue`) and no `claim` stage. |
|
|
132
|
+
| `C2` | The claim names another issue or no claimant; `check` is not `free` / `claimed-by-you`, unless a person's handover authorization covering `claim` is cited; or `verify` is not `claimed-by-you`. |
|
|
133
|
+
| `C3` | No eligible `check-issue-claim` use on the issue; no eligible `claim-approved-issue` use when `check` was not `claimed-by-you`; or the claim was written before the read. |
|
|
134
|
+
| `C4` | The worktree branch is not `feat/<n>-<slug>` for the canonical issue. |
|
|
135
|
+
|
|
136
|
+
Stage order (`S2`) puts `claim` after `specify` and before `reproduce`; its authorization (`A1`) must cover `claim` or `implement`.
|
|
137
|
+
|
|
138
|
+
## Semantic checks for the auditor (LLM)
|
|
139
|
+
|
|
140
|
+
- The `check` and `verify` verdicts in the ledger are the script's output for reads made in this delivery, not an earlier session.
|
|
141
|
+
- The claimant is the person who authorized the work, not a bot or another colleague.
|
|
142
|
+
- A handover cites a message from the holder or the Tech Lead that hands the issue over.
|
|
143
|
+
- A delivery that stopped before its PR has `"release": "released"` in its claim evidence, backed by a release `claim-approved-issue` use.
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
# Search before filing an issue
|
|
2
|
+
|
|
3
|
+
Before the workflow files or reopens an issue, it looks for one that already covers the problem. The goal is one canonical issue per problem, carrying its full history, without silently reviving work that was already shipped.
|
|
4
|
+
|
|
5
|
+
## 1. Search
|
|
6
|
+
|
|
7
|
+
Request `github-read` / `check-duplicate-issues` through `tool-depot` for the confirmed target repository. One request covers the whole search below.
|
|
8
|
+
|
|
9
|
+
| Source | How |
|
|
10
|
+
|---|---|
|
|
11
|
+
| Open and closed issues | `gh issue list -R <owner/repo> --state all --search "<terms>" --json number,title,state,closedAt,labels`, one query per term group. |
|
|
12
|
+
| Close reason | `gh api repos/<owner/repo>/issues/<n> --jq .state_reason` (`completed`, `not_planned`, `duplicate`, `reopened`). Some `gh` versions do not expose it in `issue list`. |
|
|
13
|
+
| Project draft items | Only when the repository uses GitHub Projects and the person authorized reading them; otherwise record `🟡 GAP drafts`. |
|
|
14
|
+
| Local drafts | Drafts already in the conversation or the worktree for the same task. |
|
|
15
|
+
|
|
16
|
+
Build the terms from the request before ranking anything: exact error names and codes, affected module, route or file names, the user-visible symptom in the issue's language, and relevant labels. Keyword search is the evidence; it is reproducible and can be rerun by the auditor.
|
|
17
|
+
|
|
18
|
+
An LLM may then rank the results and explain each match in one line (same symptom, same component, same cause). Similarity alone never makes a match: keep at most five candidates and discard those that share only words. Never paste private logs or identifiers into the search terms.
|
|
19
|
+
|
|
20
|
+
## 2. Decide
|
|
21
|
+
|
|
22
|
+
For each real match, read the body, comments, timeline, linked PRs, and attachments with `issue-reviewer` (or its `fetch-issue-attachments.py`) before deciding.
|
|
23
|
+
|
|
24
|
+
| What the search finds | Action |
|
|
25
|
+
|---|---|
|
|
26
|
+
| An open issue | Reuse it as the canonical issue. Add new evidence as a comment; do not file another. |
|
|
27
|
+
| Closed as `not_planned`, stale, or closed by mistake | Reopen it (`reopen-approved-issue`) and comment a history summary: what was tried, what was concluded, why it was closed, and what is new now. |
|
|
28
|
+
| Closed as `completed` with a merged fix | The problem came back: file a new issue marked as a regression that links the old one and carries its conclusions. Do not reopen it; one issue per delivery keeps regressions visible. |
|
|
29
|
+
| Closed as `duplicate` | Follow the link to the canonical issue and apply this table to it. |
|
|
30
|
+
| Locked, transferred, or in another repository | Do not write on it; link it from the issue you file or reuse. |
|
|
31
|
+
| Several plausible candidates, or `completed` without a linked fix | Ask the Product Manager to pick the canonical issue: one question, a recommendation, and the candidates. |
|
|
32
|
+
| No real match | File a new issue (`publish-approved-issue`) and mention the search terms used. |
|
|
33
|
+
|
|
34
|
+
Reopening, commenting, and filing are GitHub writes: each needs the person's authorization for that exact operation and target, and every issue comment or body follows the [visual reference rule](visual-reference.md). A search result never authorizes a write.
|
|
35
|
+
|
|
36
|
+
## 3. Record
|
|
37
|
+
|
|
38
|
+
In the delivery ledger, record the `check-duplicate-issues` request and use **before** any `publish-approved-issue` or `reopen-approved-issue` use on the same repository. `workflow-auditor` flags a publish or reopen without that earlier search as `D1`. Put the outcome in the `specify` stage `reason`: terms, candidate issues, decision (`reuse`, `reopen`, `regression`, `create`), and the canonical issue.
|