@bbcsoftwarefactory/cli 0.1.1 โ 1.1.3
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/audit-ledger.d.ts +2 -0
- package/dist/audit-ledger.js +71 -0
- package/dist/bbc-install.d.ts +2 -0
- package/dist/bbc-install.js +1278 -0
- package/dist/bbc.js +87 -3
- package/dist/bundle/commands/daily/SKILL.md +112 -0
- package/dist/bundle/commands/daily/adapters/command.md +17 -0
- package/dist/bundle/commands/daily/adapters/gemini.toml +17 -0
- package/dist/bundle/commands/issue-clean-and-close/SKILL.md +85 -0
- package/dist/bundle/commands/issue-clean-and-close/adapters/command.md +17 -0
- package/dist/bundle/commands/issue-clean-and-close/adapters/gemini.toml +17 -0
- package/dist/bundle/commands/issue-clean-and-close/references/policy.md +87 -0
- package/dist/bundle/commands/recap/SKILL.md +84 -0
- package/dist/bundle/commands/recap/adapters/command.md +17 -0
- package/dist/bundle/commands/recap/adapters/gemini.toml +17 -0
- package/dist/bundle/installer/clients.json +103 -0
- package/dist/bundle/skills/code-quality-gate/SKILL.md +58 -0
- package/dist/bundle/skills/code-quality-gate/references/gate-bigo.md +31 -0
- package/dist/bundle/skills/code-quality-gate/references/gate-earlyreturn.md +73 -0
- package/dist/bundle/skills/code-quality-gate/references/gate-typesafe.md +32 -0
- package/dist/bundle/skills/code-quality-gate/references/output-schema.yml +40 -0
- package/dist/bundle/skills/delivery-coordinator/SKILL.md +80 -0
- package/dist/bundle/skills/delivery-coordinator/references/hud-output.md +55 -0
- package/dist/bundle/skills/delivery-coordinator/references/intake.md +86 -0
- package/dist/bundle/skills/delivery-coordinator/references/issue-claim.md +143 -0
- package/dist/bundle/skills/delivery-coordinator/references/issue-dedup.md +38 -0
- package/dist/bundle/skills/delivery-coordinator/references/sleuth-regression-exercise.md +60 -0
- package/dist/bundle/skills/delivery-coordinator/references/visual-reference.md +45 -0
- package/dist/bundle/skills/delivery-coordinator/references/worktree-isolation.md +19 -0
- package/dist/bundle/skills/documentation-steward/SKILL.md +43 -0
- package/dist/bundle/skills/documentation-steward/references/discovery.md +17 -0
- package/dist/bundle/skills/documentation-steward/references/handoff.md +15 -0
- package/dist/bundle/skills/greptile-review-loop/SKILL.md +56 -0
- package/dist/bundle/skills/greptile-review-loop/references/review-protocol.md +37 -0
- package/dist/bundle/skills/issue-reviewer/SKILL.md +84 -0
- package/dist/bundle/skills/issue-reviewer/references/review-format.md +100 -0
- package/dist/bundle/skills/issue-reviewer/references/triage.md +105 -0
- package/dist/bundle/skills/question-gate/SKILL.md +64 -0
- package/dist/bundle/skills/question-gate/references/client-hooks.md +111 -0
- package/dist/bundle/skills/question-gate/references/diagram-routing.md +58 -0
- package/dist/bundle/skills/question-gate/tests/fixtures/question-corpus.json +481 -0
- package/dist/bundle/skills/regression-testing/SKILL.md +49 -0
- package/dist/bundle/skills/regression-testing/references/evidence-record.md +35 -0
- package/dist/bundle/skills/requirements-spec/SKILL.md +59 -0
- package/dist/bundle/skills/risk-scout/SKILL.md +53 -0
- package/dist/bundle/skills/risk-scout/references/risk-matrix.md +49 -0
- package/dist/bundle/skills/skill-clean-architecture/SKILL.md +53 -0
- package/dist/bundle/skills/skill-clean-architecture/references/layer-rules.md +22 -0
- package/dist/bundle/skills/skill-clean-architecture/references/source-headers.md +30 -0
- package/dist/bundle/skills/skill-clean-architecture/tests/fixtures/bigo/bad-utf8.js +1 -0
- package/dist/bundle/skills/skill-clean-architecture/tests/fixtures/bigo/edge-crlf.ts +6 -0
- package/dist/bundle/skills/skill-clean-architecture/tests/fixtures/bigo/edge-mixed.ts +15 -0
- package/dist/bundle/skills/skill-clean-architecture/tests/fixtures/bigo/empty.js +0 -0
- package/dist/bundle/skills/skill-clean-architecture/tests/fixtures/bigo/no-newline.js +1 -0
- package/dist/bundle/skills/skill-clean-architecture/tests/fixtures/bigo.expected.yml +95 -0
- package/dist/bundle/skills/tool-depot/SKILL.md +47 -0
- package/dist/bundle/skills/tool-depot/references/checkout.md +29 -0
- package/dist/bundle/skills/tool-depot/references/loki-read.md +41 -0
- package/dist/bundle/skills/tool-depot/references/readonly-access.md +84 -0
- package/dist/bundle/skills/tool-depot/references/tool-catalog.json +47 -0
- package/dist/bundle/skills/tool-depot/scripts/loki-runtime-logs.py +305 -0
- package/dist/bundle/skills/tool-depot/tests/loki-runtime-logs.test.sh +101 -0
- package/dist/bundle/skills/watcher-observability/SKILL.md +72 -0
- package/dist/bundle/skills/watcher-observability/references/batch-protocol.md +44 -0
- package/dist/bundle/skills/watcher-observability/references/configuration.md +31 -0
- package/dist/bundle/skills/watcher-observability/references/error-scan.md +102 -0
- package/dist/bundle/skills/watcher-observability/references/live-protocol.md +49 -0
- package/dist/bundle/skills/watcher-observability/references/server-account.md +72 -0
- package/dist/bundle/skills/watcher-observability/server/watcher-gate.sh +51 -0
- package/dist/bundle/skills/watcher-observability/tests/watcher-gate.test.sh +113 -0
- package/dist/bundle/skills/watcher-observability/watcher.json +1 -0
- package/dist/bundle/skills/workflow-auditor/SKILL.md +53 -0
- package/dist/bundle/skills/workflow-auditor/references/audit-protocol.md +49 -0
- package/dist/bundle/skills/workflow-auditor/references/ledger.md +122 -0
- package/dist/change-lane/classification.js +3 -1
- package/dist/check-issue-claim.d.ts +2 -0
- package/dist/check-issue-claim.js +146 -0
- package/dist/check-worktree-guard.d.ts +2 -0
- package/dist/check-worktree-guard.js +114 -0
- package/dist/error-scan.d.ts +3 -0
- package/dist/error-scan.js +216 -0
- package/dist/export-public.d.ts +9 -0
- package/dist/export-public.js +274 -0
- package/dist/fetch-issue-attachments.d.ts +22 -0
- package/dist/fetch-issue-attachments.js +325 -0
- package/dist/issue-claim/evaluation.d.ts +66 -0
- package/dist/issue-claim/evaluation.js +259 -0
- package/dist/issue-claim/loaders.d.ts +5 -0
- package/dist/issue-claim/loaders.js +116 -0
- package/dist/list-zed-commands.d.ts +7 -0
- package/dist/list-zed-commands.js +288 -0
- package/dist/plan-issue-triage.d.ts +3 -0
- package/dist/plan-issue-triage.js +404 -0
- package/dist/question-gate/ledger.d.ts +5 -0
- package/dist/question-gate/ledger.js +115 -0
- package/dist/question-gate/rules.d.ts +40 -0
- package/dist/question-gate/rules.js +483 -0
- package/dist/recap/board.d.ts +5 -0
- package/dist/recap/board.js +384 -0
- package/dist/recap/git-and-github.d.ts +11 -0
- package/dist/recap/git-and-github.js +620 -0
- package/dist/recap/report-and-hud.d.ts +2 -0
- package/dist/recap/report-and-hud.js +294 -0
- package/dist/recap/time-and-refs.d.ts +27 -0
- package/dist/recap/time-and-refs.js +148 -0
- package/dist/recap.d.ts +2 -0
- package/dist/recap.js +217 -0
- package/dist/render-workflow.js +12 -14
- package/dist/resolve-containers.d.ts +2 -0
- package/dist/resolve-containers.js +96 -0
- package/dist/review-loop.d.ts +7 -0
- package/dist/review-loop.js +622 -0
- package/dist/save-counts.d.ts +2 -0
- package/dist/save-counts.js +191 -0
- package/dist/summarize-logs.d.ts +2 -0
- package/dist/summarize-logs.js +41 -0
- package/dist/sweep-github.d.ts +10 -0
- package/dist/sweep-github.js +453 -0
- package/dist/sweep-issues.d.ts +56 -0
- package/dist/sweep-issues.js +650 -0
- package/dist/sweep.d.ts +2 -0
- package/dist/sweep.js +301 -0
- package/dist/triage-question.d.ts +2 -0
- package/dist/triage-question.js +189 -0
- package/dist/validate-skills.d.ts +2 -0
- package/dist/validate-skills.js +48 -0
- package/dist/watch-live.d.ts +7 -0
- package/dist/watch-live.js +83 -0
- package/dist/watcher/config.d.ts +11 -0
- package/dist/watcher/config.js +265 -0
- package/dist/watcher/live-classifier.d.ts +52 -0
- package/dist/watcher/live-classifier.js +510 -0
- package/dist/watcher/safe-fs.d.ts +9 -0
- package/dist/watcher/safe-fs.js +159 -0
- package/dist/watcher/stream.d.ts +27 -0
- package/dist/watcher/stream.js +340 -0
- package/dist/watcher/summarizer.d.ts +19 -0
- package/dist/watcher/summarizer.js +121 -0
- package/dist/wave3/process.d.ts +14 -0
- package/dist/wave3/process.js +84 -0
- package/dist/wave4/process.d.ts +14 -0
- package/dist/wave4/process.js +128 -0
- package/dist/workflow/render.d.ts +1 -1
- package/dist/workflow/render.js +1 -1
- package/dist/workflow-auditor/audit.d.ts +27 -0
- package/dist/workflow-auditor/audit.js +583 -0
- package/dist/workflow-auditor/ledger-io.d.ts +5 -0
- package/dist/workflow-auditor/ledger-io.js +99 -0
- package/dist/workflow-auditor/skills-validator.d.ts +10 -0
- package/dist/workflow-auditor/skills-validator.js +533 -0
- package/dist/worktree-guard/evaluation.d.ts +19 -0
- package/dist/worktree-guard/evaluation.js +84 -0
- package/dist/worktree-guard/git.d.ts +3 -0
- package/dist/worktree-guard/git.js +61 -0
- package/package.json +32 -33
package/dist/bbc.js
CHANGED
|
@@ -7,12 +7,32 @@
|
|
|
7
7
|
* keywords: [CliEntryPoint, CommandArguments]
|
|
8
8
|
* GOAL: Translate command-line arguments into process output and exit status.
|
|
9
9
|
*/
|
|
10
|
+
import { auditLedger, auditLedgerUsage } from "./audit-ledger.js";
|
|
11
|
+
import { bbcInstall, bbcInstallUsage } from "./bbc-install.js";
|
|
12
|
+
import { checkIssueClaim, checkIssueClaimUsage } from "./check-issue-claim.js";
|
|
13
|
+
import { checkWorktreeGuard, checkWorktreeGuardUsage } from "./check-worktree-guard.js";
|
|
10
14
|
import { classifyChangeLane, classifyChangeLaneUsage } from "./classify-change-lane.js";
|
|
15
|
+
import { errorScan, errorScanUsage } from "./error-scan.js";
|
|
16
|
+
import { exportPublic, exportPublicUsage } from "./export-public.js";
|
|
11
17
|
import { extractDiffScope, extractDiffScopeUsage } from "./extract-diff-scope.js";
|
|
18
|
+
import { fetchIssueAttachments, fetchIssueAttachmentsUsage } from "./fetch-issue-attachments.js";
|
|
19
|
+
import { listZedCommands, listZedCommandsUsage } from "./list-zed-commands.js";
|
|
12
20
|
import { measureBigo, measureBigoUsage } from "./measure-bigo.js";
|
|
21
|
+
import { planIssueTriage, planIssueTriageUsage } from "./plan-issue-triage.js";
|
|
22
|
+
import { recap, recapUsage } from "./recap.js";
|
|
13
23
|
import { renderWorkflow, renderWorkflowUsage } from "./render-workflow.js";
|
|
24
|
+
import { resolveContainers, resolveContainersUsage } from "./resolve-containers.js";
|
|
25
|
+
import { reviewLoop, reviewLoopUsage } from "./review-loop.js";
|
|
26
|
+
import { saveCounts, saveCountsUsage } from "./save-counts.js";
|
|
27
|
+
import { summarizeLogs, summarizeLogsUsage } from "./summarize-logs.js";
|
|
28
|
+
import { sweepGithub, sweepGithubUsage } from "./sweep-github.js";
|
|
29
|
+
import { sweepIssues, sweepIssuesUsage } from "./sweep-issues.js";
|
|
30
|
+
import { sweep, sweepUsage } from "./sweep.js";
|
|
31
|
+
import { triageQuestion, triageQuestionUsage } from "./triage-question.js";
|
|
32
|
+
import { validateSkills, validateSkillsUsage } from "./validate-skills.js";
|
|
33
|
+
import { watchLive, watchLiveUsage } from "./watch-live.js";
|
|
14
34
|
const usage = 'Usage: bbc <command> [arguments]\n';
|
|
15
|
-
function main([command, ...args]) {
|
|
35
|
+
async function main([command, ...args]) {
|
|
16
36
|
const [argument] = args;
|
|
17
37
|
if (command === undefined) {
|
|
18
38
|
process.stderr.write(usage);
|
|
@@ -23,7 +43,31 @@ function main([command, ...args]) {
|
|
|
23
43
|
return 1;
|
|
24
44
|
}
|
|
25
45
|
if (command === '--help') {
|
|
26
|
-
process.stdout.write(`${usage}\nCommands:\n
|
|
46
|
+
process.stdout.write(`${usage}\nCommands:\n` +
|
|
47
|
+
` ${measureBigoUsage}\n` +
|
|
48
|
+
` ${classifyChangeLaneUsage}\n` +
|
|
49
|
+
` ${renderWorkflowUsage}\n` +
|
|
50
|
+
` ${extractDiffScopeUsage}\n` +
|
|
51
|
+
` ${checkWorktreeGuardUsage}\n` +
|
|
52
|
+
` ${checkIssueClaimUsage}\n` +
|
|
53
|
+
` ${triageQuestionUsage}\n` +
|
|
54
|
+
` ${auditLedgerUsage}\n` +
|
|
55
|
+
` ${validateSkillsUsage}\n` +
|
|
56
|
+
` ${resolveContainersUsage}\n` +
|
|
57
|
+
` ${summarizeLogsUsage}\n` +
|
|
58
|
+
` ${watchLiveUsage}\n` +
|
|
59
|
+
` ${errorScanUsage}\n` +
|
|
60
|
+
` ${saveCountsUsage}\n` +
|
|
61
|
+
` ${planIssueTriageUsage}\n` +
|
|
62
|
+
` ${fetchIssueAttachmentsUsage}\n` +
|
|
63
|
+
` ${reviewLoopUsage}\n` +
|
|
64
|
+
` ${sweepUsage}\n` +
|
|
65
|
+
` ${sweepIssuesUsage}\n` +
|
|
66
|
+
` ${sweepGithubUsage}\n` +
|
|
67
|
+
` ${recapUsage}\n` +
|
|
68
|
+
` ${bbcInstallUsage}\n` +
|
|
69
|
+
` ${listZedCommandsUsage}\n` +
|
|
70
|
+
` ${exportPublicUsage}\n`);
|
|
27
71
|
return 0;
|
|
28
72
|
}
|
|
29
73
|
if (command === 'measure-bigo')
|
|
@@ -34,7 +78,47 @@ function main([command, ...args]) {
|
|
|
34
78
|
return renderWorkflow(args);
|
|
35
79
|
if (command === 'extract-diff-scope')
|
|
36
80
|
return extractDiffScope(args);
|
|
81
|
+
if (command === 'check-worktree-guard')
|
|
82
|
+
return checkWorktreeGuard(args);
|
|
83
|
+
if (command === 'check-issue-claim')
|
|
84
|
+
return checkIssueClaim(args);
|
|
85
|
+
if (command === 'triage-question')
|
|
86
|
+
return triageQuestion(args);
|
|
87
|
+
if (command === 'audit-ledger')
|
|
88
|
+
return auditLedger(args);
|
|
89
|
+
if (command === 'validate-skills')
|
|
90
|
+
return validateSkills(args);
|
|
91
|
+
if (command === 'resolve-containers')
|
|
92
|
+
return resolveContainers(args);
|
|
93
|
+
if (command === 'summarize-logs')
|
|
94
|
+
return summarizeLogs(args);
|
|
95
|
+
if (command === 'watch-live')
|
|
96
|
+
return watchLive(args);
|
|
97
|
+
if (command === 'error-scan')
|
|
98
|
+
return errorScan(args);
|
|
99
|
+
if (command === 'save-counts')
|
|
100
|
+
return saveCounts(args);
|
|
101
|
+
if (command === 'plan-issue-triage')
|
|
102
|
+
return planIssueTriage(args);
|
|
103
|
+
if (command === 'fetch-issue-attachments')
|
|
104
|
+
return fetchIssueAttachments(args);
|
|
105
|
+
if (command === 'review-loop')
|
|
106
|
+
return reviewLoop(args);
|
|
107
|
+
if (command === 'sweep')
|
|
108
|
+
return sweep(args);
|
|
109
|
+
if (command === 'sweep-issues')
|
|
110
|
+
return sweepIssues(args);
|
|
111
|
+
if (command === 'sweep-github')
|
|
112
|
+
return sweepGithub(args);
|
|
113
|
+
if (command === 'recap')
|
|
114
|
+
return recap(args);
|
|
115
|
+
if (command === 'bbc-install')
|
|
116
|
+
return bbcInstall(args);
|
|
117
|
+
if (command === 'list-zed-commands')
|
|
118
|
+
return listZedCommands(args);
|
|
119
|
+
if (command === 'export-public')
|
|
120
|
+
return exportPublic(args);
|
|
37
121
|
process.stderr.write(`Unknown command: ${JSON.stringify(command)}\n${usage}`);
|
|
38
122
|
return 1;
|
|
39
123
|
}
|
|
40
|
-
process.exitCode = main(process.argv.slice(2));
|
|
124
|
+
process.exitCode = await main(process.argv.slice(2));
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: daily
|
|
3
|
+
description: "Trigger: /daily, daily, refresh, quรฉ tenemos para hoy, dรณnde quedamos, revisar issues y PRs, seguimiento de backlog. Daily refresh: fetch origin, see where we left off, triage open GitHub issues, and audit open PRs for CI checks and merge conflicts."
|
|
4
|
+
disable-model-invocation: true
|
|
5
|
+
license: Apache-2.0
|
|
6
|
+
metadata:
|
|
7
|
+
author: bbc-skill-internals
|
|
8
|
+
version: "1.4"
|
|
9
|
+
pre_hook: "gh auth status && git fetch origin --prune; tool-depot (github-read / github-write)"
|
|
10
|
+
post_hook: "question-gate (bbc triage-question) + Quest-Tree HUD"
|
|
11
|
+
post_install: "npx --full-depth; copy adapters/gemini.toml + /commands reload (Gemini); server restart (Zed ACP)"
|
|
12
|
+
adapters: "adapters/command.md, adapters/gemini.toml"
|
|
13
|
+
---
|
|
14
|
+
|
|
15
|
+
## Activation Contract
|
|
16
|
+
|
|
17
|
+
Run only when a person explicitly invokes `/daily` (or asks to run `daily` as a refresh/standup check). It audits issues and PRs, **drafts** follow-up comments, and posts only the comments the person approves at the closing `๐ก BOSS GATE`.
|
|
18
|
+
|
|
19
|
+
Optional arguments:
|
|
20
|
+
- `--dry-run`: Audit and render the daily HUD report without drafting or posting any GitHub comments.
|
|
21
|
+
- `#<number>` (or `<number>`): Prioritize or filter the issue/PR triage to that specific number.
|
|
22
|
+
|
|
23
|
+
Granted authority upon explicit `/daily` invocation:
|
|
24
|
+
- `A1` (Read-only repo & GitHub): `git remote`, `git fetch`, read-only code search, and GitHub reads through `gh api` (REST) under Tool Depot `github-read` (`read-approved-issue-or-pr`, `read-pr-review-and-checks`). Use REST, not `gh issue` / `gh pr`: those subcommands use GraphQL, which some hosts (for example Claude Code cloud sessions) refuse. Never edit files or switch branches in the main checkout.
|
|
25
|
+
- `A2` (Issue follow-up comments): Draft at most 1 useful comment per open issue, with an anti-duplicate guard when the latest comment is already a recent `daily` check with no new human or PR activity. Invoking `/daily` does **not** authorize posting: the Tool Depot catalog requires authorization for the exact target. List every draft (issue number + text) in the `๐ก BOSS GATE` and post only the approved ones, each as `github-write` / `comment-approved-issue` recorded in the delivery ledger when one exists, and each following the [visual reference rule](../../skills/delivery-coordinator/references/visual-reference.md) (an image, or a `๐ก GAP visual` line).
|
|
26
|
+
|
|
27
|
+
## Hard Rules
|
|
28
|
+
|
|
29
|
+
- Never close or edit issues (`gh issue close`, `gh issue edit`), never push or merge PRs, and never modify files in the main checkout without explicit human approval at the closing `๐ก BOSS GATE`.
|
|
30
|
+
- If `tool-depot`, `issue-reviewer`, `question-gate`, or `delivery-coordinator` are present in the active project or user skills directory, follow their contracts; never assume unverified companions or hardcode user-specific machine paths.
|
|
31
|
+
- Check `gh auth status` first. If `gh` is missing or unauthenticated, stop and report the blocker.
|
|
32
|
+
- Match each issue comment to the issue's language (`es` / `en` / `pt`), and match the final chat HUD to the user's language.
|
|
33
|
+
- Never guess the contents of unreadable attachments or claim an issue is resolved without verified evidence (merged PR + commit on `origin/<default-branch>` + code verification).
|
|
34
|
+
|
|
35
|
+
## Decision Gates
|
|
36
|
+
|
|
37
|
+
| Situation | Action |
|
|
38
|
+
|---|---|
|
|
39
|
+
| `--dry-run` passed | Run all read-only checks and render HUD; draft and post no comments |
|
|
40
|
+
| Issue has image/file attachments and `@bbcsoftwarefactory/cli` (`fetch-issue-attachments`) is available | Download and visually inspect attachments before classifying the issue |
|
|
41
|
+
| Issue is already fixed (merged PR + commit on `origin/<default-branch>` + verified in code) | Draft a comment with PR link, merge commit, and verified code location (unless `--dry-run`); queue it and the close candidate in `๐ก BOSS GATE` |
|
|
42
|
+
| Issue is open and latest comment is already an unchanged `daily` (or legacy `allio`) follow-up | Skip commenting (`โช Sin cambios` / `unchanged`) to avoid duplicate noise |
|
|
43
|
+
| Issue is open and unresolved (pending / in-progress PR / blocked) | Draft 1 concrete follow-up comment (unless `--dry-run`) stating observed state, what was checked, and next recommended step; queue it in `๐ก BOSS GATE` |
|
|
44
|
+
| Claim status `duplicate-work` (`CL11`: several open PRs for one issue) | `๐ด Duplicate work`: list the PRs and their authors; queue in `๐ก BOSS GATE` for the Tech Lead to keep one. Never close a PR. |
|
|
45
|
+
| Claim status `stale-claim` (`CL12`) or `orphan-claim` (`CL6`) | `๐ก Stale claim`: draft 1 comment asking the holder whether the work continues (unless `--dry-run`); queue it and a release proposal in `๐ก BOSS GATE`. Never unassign anyone. |
|
|
46
|
+
| PR `mergeable` is `null` (GitHub still computing) | Wait 2โ3 seconds and re-query `gh api repos/<owner>/<repo>/pulls/<pr>` once |
|
|
47
|
+
| PR has conflicts (`CONFLICTING` / `DIRTY`) | Diagnose exact conflicting files without touching main checkout (`git merge-tree --write-tree` or temporary detached worktree), report files, and offer resolution in `๐ก BOSS GATE` |
|
|
48
|
+
|
|
49
|
+
## Execution Steps
|
|
50
|
+
|
|
51
|
+
1. **Identify repo and fetch origin**
|
|
52
|
+
- Run `git rev-parse --show-toplevel`, `git remote -v`, and `git ls-remote --symref origin HEAD` to detect `<owner>/<repo>` and `<default-branch>`.
|
|
53
|
+
- Verify `gh auth status`, then run `git fetch origin --prune`.
|
|
54
|
+
|
|
55
|
+
2. **Audit open issues**
|
|
56
|
+
- Run `gh api "repos/<owner>/<repo>/issues?state=open&per_page=50" --jq '[.[] | select(.pull_request == null)]'` (the endpoint also returns PRs; the filter drops them). Filter by `#<n>` if provided. If empty, record `๐ข 0 open issues` and continue to step 3.
|
|
57
|
+
- For each open issue:
|
|
58
|
+
- Read body and comments via `gh api -H "Accept: application/vnd.github.full+json" repos/<owner>/<repo>/issues/<n>` and `gh api repos/<owner>/<repo>/issues/<n>/comments`.
|
|
59
|
+
- If attachments exist and `issue-reviewer` is available, run `npx -y @bbcsoftwarefactory/cli fetch-issue-attachments --repo <owner/repo> --issue <n>` and inspect them before judging status.
|
|
60
|
+
- Cross-check related PRs (`gh api -X GET search/issues -f q='repo:<owner>/<repo> is:pr <terms>'`), commits on `origin/<default-branch>` (`git log origin/<default-branch> --oneline -n 50 --grep="..."`), and current code (`rg` / file read).
|
|
61
|
+
- Classify as resolved (Case A) or pending/in-progress/blocked (Case B) and apply the Decision Gates above.
|
|
62
|
+
- Check who holds it with the [claim rules](../../skills/delivery-coordinator/references/issue-claim.md), when `delivery-coordinator` is installed: save the issue (`gh api repos/<owner>/<repo>/issues/<n>`), and once per run the open PRs (`gh api --paginate --slurp "repos/<owner>/<repo>/pulls?state=open&per_page=100"`) and claim branches (`git ls-remote --heads origin "feat/*"`), then run `npx -y @bbcsoftwarefactory/cli check-issue-claim --phase status --issue-json <issue> --pulls-json <pulls> --branches <branches> --repo <owner>/<repo>`. Report `claimed` with the holder, and apply the claim rows above for `duplicate-work`, `stale-claim`, or `orphan-claim`.
|
|
63
|
+
|
|
64
|
+
3. **Audit open PRs (CI checks & conflicts)**
|
|
65
|
+
- Run `gh api "repos/<owner>/<repo>/pulls?state=open&per_page=50"`.
|
|
66
|
+
- For each open PR, run `gh api repos/<owner>/<repo>/pulls/<pr>` (`mergeable`, `mergeable_state`, `draft`, `head.sha`, `base.ref`), `gh api "repos/<owner>/<repo>/commits/<head.sha>/check-runs?per_page=100"` (`name`, `status`, `conclusion`), and `gh api repos/<owner>/<repo>/pulls/<pr>/reviews` for the review state.
|
|
67
|
+
- Classify each PR:
|
|
68
|
+
- `๐ข Green`: `mergeable: true` / `mergeable_state: clean`, every check run `conclusion: success` (or `skipped`/`neutral`), not draft (note if a review is still required or if duplicate/stacked PRs exist).
|
|
69
|
+
- `๐ก Pending / Draft`: a check run with `status` other than `completed`, or `draft: true`.
|
|
70
|
+
- `๐ด Failing CI`: list failed check names and observable causes/links.
|
|
71
|
+
- `๐ด Conflicts` (`mergeable: false` / `mergeable_state: dirty`): fetch `pull/<pr>/head:refs/remotes/origin/pr/<pr>` and run `git merge-tree --write-tree origin/<base.ref> refs/remotes/origin/pr/<pr>` (or use a temporary detached worktree to run `git merge --no-commit --no-ff`, list `git diff --name-only --diff-filter=U`, abort, and remove the temporary worktree).
|
|
72
|
+
|
|
73
|
+
4. **Gate & report**
|
|
74
|
+
- If `question-gate` (`bbc triage-question`) is installed and any human decision remains (comment drafts to post, conflicted PRs, resolved issues ready to close, or green PRs ready to merge), validate the closing prompt before replying.
|
|
75
|
+
- List each comment draft in the `๐ก BOSS GATE` as `#<n>: <first line of the draft>`, so the person approves exact targets (all, some by number, or none).
|
|
76
|
+
|
|
77
|
+
5. **Post approved comments** (only after the person answers the gate)
|
|
78
|
+
- For each approved issue, request `github-write` / `comment-approved-issue` from Tool Depot for that exact issue, then post with `gh api -X POST repos/<owner>/<repo>/issues/<n>/comments -F body=@<draft-file>`. Record the request and the use, with its `visual`, in the delivery ledger when one exists.
|
|
79
|
+
- Never post a draft that was not approved, and never widen an approval to issues that were not listed.
|
|
80
|
+
|
|
81
|
+
## Output Contract
|
|
82
|
+
|
|
83
|
+
Render a compact **Quest-Tree HUD** matching the user's language (`es` / `en` / `pt`):
|
|
84
|
+
|
|
85
|
+
```text
|
|
86
|
+
๐ฎ DAILY โ <owner>/<repo> (base: <default-branch> ยท <short-sha>)
|
|
87
|
+
โ ๐ Fetch: ๐ข origin updated
|
|
88
|
+
โ
|
|
89
|
+
โโโ ๐ Open issues (<total>)
|
|
90
|
+
โ โโโ #<n> <title> ยทยทยทยทยทยทยทยทยทยทยทยท ๐ข Resolved โ PR #<pr> (comment drafted)
|
|
91
|
+
โ โโโ #<m> <title> ยทยทยทยทยทยทยทยทยทยทยทยท ๐ก Pending โ Follow-up drafted
|
|
92
|
+
โ โโโ #<c> <title> ยทยทยทยทยทยทยทยทยทยทยทยท ๐ด Duplicate work โ PR #<a> @<x> ยท PR #<b> @<y>
|
|
93
|
+
โ โโโ #<s> <title> ยทยทยทยทยทยทยทยทยทยทยทยท ๐ก Stale claim โ @<holder>, 9 days idle
|
|
94
|
+
โ โโโ #<k> <title> ยทยทยทยทยทยทยทยทยทยทยทยท โช Unchanged (duplicate skipped)
|
|
95
|
+
โ
|
|
96
|
+
โโโ ๐ Open PRs (<total>)
|
|
97
|
+
โโโ #<p> <title> ยทยทยทยทยทยทยทยทยทยทยทยท ๐ข Green (checks OK ยท ready/review)
|
|
98
|
+
โโโ #<q> <title> ยทยทยทยทยทยทยทยทยทยทยทยท ๐ด Failing checks (<check name>)
|
|
99
|
+
โโโ #<r> <title> ยทยทยทยทยทยทยทยทยทยทยทยท ๐ด Conflict vs <base> (<files>)
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
If any action requires human approval (posting comment drafts, resolving conflicts + pushing, closing verified resolved issues, or merging green PRs), close with a single `๐ก BOSS GATE` offering `[A]` / `[B]`; otherwise close with `๐ STAGE CLEAR`. After approved comments are posted, report them as `commented` in a short follow-up.
|
|
103
|
+
|
|
104
|
+
When several open issues already have a merged PR, or `needs-info` without an answer, point to [`/issue-clean-and-close`](../issue-clean-and-close/SKILL.md) for the bulk cleanup instead of drafting one comment each. Do not draft a comment that repeats an `<!-- issue-sweeper:โฆ -->` comment newer than the issue's last activity.
|
|
105
|
+
|
|
106
|
+
## References
|
|
107
|
+
|
|
108
|
+
- [Issue cleanup (`/issue-clean-and-close`)](../issue-clean-and-close/SKILL.md)
|
|
109
|
+
- [Install guide for Cursor, Zed, Claude Code, Claude, and Gemini](../../INSTALLATION.md)
|
|
110
|
+
- [Question Gate](../../skills/question-gate/SKILL.md)
|
|
111
|
+
- [Issue Reviewer](../../skills/issue-reviewer/SKILL.md)
|
|
112
|
+
- [Tool Depot catalog](../../skills/tool-depot/references/tool-catalog.json)
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Daily refresh: fetch origin, see where we left off, triage open GitHub issues, and audit open PRs for CI checks and conflicts (/daily)
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# /daily
|
|
6
|
+
|
|
7
|
+
Read and execute `SKILL.md` from the first existing path (single source of truth; do not duplicate or summarize its steps here):
|
|
8
|
+
|
|
9
|
+
1. `.cursor/skills/daily/SKILL.md`
|
|
10
|
+
2. `.claude/skills/daily/SKILL.md`
|
|
11
|
+
3. `.agents/skills/daily/SKILL.md`
|
|
12
|
+
4. `~/.cursor/skills/daily/SKILL.md`
|
|
13
|
+
5. `~/.claude/skills/daily/SKILL.md`
|
|
14
|
+
6. `~/.agents/skills/daily/SKILL.md`
|
|
15
|
+
7. `commands/daily/SKILL.md`
|
|
16
|
+
|
|
17
|
+
Optional argument: `--dry-run` (read-only audit without posting GitHub comments) or an issue/PR number (`/daily #51`).
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
description = "Daily refresh: fetch origin, triage open GitHub issues, and audit open PRs for CI checks and conflicts (/daily)."
|
|
2
|
+
|
|
3
|
+
prompt = """
|
|
4
|
+
Execute the `/daily` command workflow from its single source of truth `SKILL.md`.
|
|
5
|
+
|
|
6
|
+
First, locate and read `SKILL.md` from the first existing path:
|
|
7
|
+
1. `.gemini/skills/daily/SKILL.md`
|
|
8
|
+
2. `.agents/skills/daily/SKILL.md`
|
|
9
|
+
3. `~/.gemini/skills/daily/SKILL.md`
|
|
10
|
+
4. `~/.agents/skills/daily/SKILL.md`
|
|
11
|
+
5. `commands/daily/SKILL.md`
|
|
12
|
+
|
|
13
|
+
If none of those files exists, stop and ask the user to install `commands/daily` into `.gemini/skills/daily/` (or `~/.gemini/skills/daily/`) following `INSTALLATION.md`.
|
|
14
|
+
|
|
15
|
+
Otherwise, follow `SKILL.md` exactly without skipping steps.
|
|
16
|
+
Optional arguments passed by the user: {{args}}
|
|
17
|
+
"""
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: issue-clean-and-close
|
|
3
|
+
description: "Trigger: /issue-clean-and-close, limpiar issues, cerrar issues resueltas, issues abiertas con PR fusionado, backlog sin trazabilidad. Review every open issue of the current repository, propose closing only what a merged PR or an unanswered needs-info settles, label and ping the rest, and apply only the plan the person approves."
|
|
4
|
+
disable-model-invocation: true
|
|
5
|
+
license: Apache-2.0
|
|
6
|
+
compatibility: Requires Node.js 22.18+ (`@bbcsoftwarefactory/cli`), git, and an authenticated gh CLI with GraphQL access for `sweep` and `sweep-github`; `sweep-issues` runs offline.
|
|
7
|
+
metadata:
|
|
8
|
+
author: bbc-skill-internals
|
|
9
|
+
version: "1.0"
|
|
10
|
+
pre_hook: "gh auth status; tool-depot (github-read / github-write)"
|
|
11
|
+
post_hook: "question-gate (bbc triage-question) + Quest-Tree HUD"
|
|
12
|
+
post_install: "npx --full-depth; copy adapters/gemini.toml + /commands reload (Gemini); server restart (Zed ACP)"
|
|
13
|
+
adapters: "adapters/command.md, adapters/gemini.toml"
|
|
14
|
+
---
|
|
15
|
+
|
|
16
|
+
## Activation Contract
|
|
17
|
+
|
|
18
|
+
Run only when a person explicitly invokes `/issue-clean-and-close` in a repository checkout. It reviews every open issue of that repository (the `origin` remote on github.com), shows a plan, and writes to GitHub only what the person approves at the closing `๐ก BOSS GATE`.
|
|
19
|
+
|
|
20
|
+
Optional arguments:
|
|
21
|
+
- `--dry-run`: plan and render the HUD; write nothing.
|
|
22
|
+
- `--repo <owner/repo>`: review another repository instead of the current checkout's `origin`.
|
|
23
|
+
|
|
24
|
+
Granted authority upon explicit invocation:
|
|
25
|
+
- `A1` (read): `sweep plan` under Tool Depot `github-read` / `read-issues-for-cleanup`: the authenticated login, the optional `.github/issue-sweeper.json` on the default branch, and the open issues with one paginated GraphQL query.
|
|
26
|
+
- `A2` (write, only after the gate): `sweep apply` of the exact plan file under `github-write` / `clean-approved-issues`. Invoking the command is **not** approval to write.
|
|
27
|
+
|
|
28
|
+
## Hard Rules
|
|
29
|
+
|
|
30
|
+
- Close only what the [policy](references/policy.md) settles: a merged PR that declares closing the issue (`SW1`), or `needs-info` unanswered by its author for 14 days (`SW3`). Everything else is a label or a ping, never a close. Never close because an issue is old.
|
|
31
|
+
- Apply only the plan file shown at the gate, all of it or the issue numbers the person lists (`--only`). A plan older than 60 minutes is refused: plan again and show the new one.
|
|
32
|
+
- Never touch exempt issues (`security`, `frozen`, `pinned`, `P0`, `P1`), never unassign, never create labels, never edit an issue title or body other than the command's own report issue.
|
|
33
|
+
- Never copy issue or PR text into comments; the scripts write fixed text with numbers, links, dates, and logins.
|
|
34
|
+
- Check `gh auth status` first. If `gh` is missing or unauthenticated, stop and report the blocker.
|
|
35
|
+
- Match the HUD to the user's language; the comments use the policy's `language` (`es` by default).
|
|
36
|
+
|
|
37
|
+
## Execution Steps
|
|
38
|
+
|
|
39
|
+
1. **Plan** (read-only)
|
|
40
|
+
- Run `npx -y @bbcsoftwarefactory/cli sweep plan` from the repository root (add `--repo <owner/repo>` if given).
|
|
41
|
+
- On `unusable`, report its `reason` and stop. A missing `.github/issue-sweeper.json` is not an error: the defaults apply (`config: defaults`).
|
|
42
|
+
|
|
43
|
+
2. **Render the plan** as the HUD below, from the `plan` output: every action with its issue link, rule, and steps; the issues deferred by the per-run cap; report-only issues (`SW4` duplicate work, `SW8` exempt); gaps (missing labels, incomplete timelines); and the metrics.
|
|
44
|
+
- If `actions` is empty, close with `๐ STAGE CLEAR` (nothing to apply).
|
|
45
|
+
- With `--dry-run`, stop after the HUD.
|
|
46
|
+
|
|
47
|
+
3. **Gate**: validate the closing prompt with `question-gate` (`bbc triage-question`) when installed, then ask one `๐ก BOSS GATE โ Code Owner / Issue cleanup`:
|
|
48
|
+
- `[A]` apply the whole plan (each issue's comment, close, or label, plus the report issue);
|
|
49
|
+
- `[B]` apply only the issue numbers the person lists;
|
|
50
|
+
- `[C]` apply nothing.
|
|
51
|
+
|
|
52
|
+
4. **Apply** (only after `[A]` or `[B]`)
|
|
53
|
+
- Run `npx -y @bbcsoftwarefactory/cli sweep apply --plan <plan> [--only <n,m>]` with the `plan` path from step 1. Record the request and the use in the delivery ledger when one exists.
|
|
54
|
+
- If it reports a stale plan, go back to step 1 and show the new plan at a new gate; never widen an approval to a plan the person has not seen.
|
|
55
|
+
- Report what was applied and any `errors` (a failed comment means that issue was not closed).
|
|
56
|
+
|
|
57
|
+
## Output Contract
|
|
58
|
+
|
|
59
|
+
```text
|
|
60
|
+
๐งน ISSUE CLEAN โ <owner>/<repo> (open: <n> ยท with PR: <p> ยท merged but open: <m>)
|
|
61
|
+
โ
|
|
62
|
+
โโโ โ
Close (<k>)
|
|
63
|
+
โ โโโ #<n> <url> ยทยทยท SW1 โ comment + close (completed) ยท PR #<pr>
|
|
64
|
+
โ โโโ #<n> <url> ยทยทยท SW3 โ comment + close (not planned) ยท needs-info <d> days
|
|
65
|
+
โโโ ๐ท๏ธ Label / ping (<k>)
|
|
66
|
+
โ โโโ #<n> ยทยทยท SW2 โ needs-close-review + ping @<assignees>
|
|
67
|
+
โ โโโ #<n> ยทยทยท SW5 โ ping @<holder> (stale claim)
|
|
68
|
+
โ โโโ #<n> ยทยทยท SW6 โ stale (+ comment) ยท SW7 โ remove stale
|
|
69
|
+
โโโ โธ๏ธ Deferred by the cap: #<n>, #<m>
|
|
70
|
+
โโโ ๐ Report only: #<n> SW4 duplicate work ยท #<m> SW8 exempt
|
|
71
|
+
โโโ โ ๏ธ Gaps: missing label `stale` ยท incomplete #<n>
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
Then the `๐ก BOSS GATE` with `[A]` / `[B]` / `[C]`, or `๐ STAGE CLEAR`. After applying, report each issue as `closed`, `labeled`, or `commented`, and the report issue link.
|
|
75
|
+
|
|
76
|
+
## Evidence
|
|
77
|
+
|
|
78
|
+
Every `plan` and `apply` keeps its evidence in `~/.issue-clean-and-close/<owner>__<repo>/`: the policy file used, the snapshot, each plan in `plans/` (last 30), `report.md`, and one JSON line per step in `runs.log`. Every comment carries `<!-- issue-sweeper:<rule> -->`, so a later run does not repeat it.
|
|
79
|
+
|
|
80
|
+
## References
|
|
81
|
+
|
|
82
|
+
- [Policy and rules SW1โSW8](references/policy.md)
|
|
83
|
+
- [Daily refresh](../daily/SKILL.md)
|
|
84
|
+
- [Question Gate](../../skills/question-gate/SKILL.md)
|
|
85
|
+
- [Tool Depot catalog](../../skills/tool-depot/references/tool-catalog.json)
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Review every open issue of this repository, close only what a merged PR or an unanswered needs-info settles, label and ping the rest, after your approval (/issue-clean-and-close)
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# /issue-clean-and-close
|
|
6
|
+
|
|
7
|
+
Read and execute `SKILL.md` from the first existing path (single source of truth; do not duplicate or summarize its steps here):
|
|
8
|
+
|
|
9
|
+
1. `.cursor/skills/issue-clean-and-close/SKILL.md`
|
|
10
|
+
2. `.claude/skills/issue-clean-and-close/SKILL.md`
|
|
11
|
+
3. `.agents/skills/issue-clean-and-close/SKILL.md`
|
|
12
|
+
4. `~/.cursor/skills/issue-clean-and-close/SKILL.md`
|
|
13
|
+
5. `~/.claude/skills/issue-clean-and-close/SKILL.md`
|
|
14
|
+
6. `~/.agents/skills/issue-clean-and-close/SKILL.md`
|
|
15
|
+
7. `commands/issue-clean-and-close/SKILL.md`
|
|
16
|
+
|
|
17
|
+
Optional arguments: `--dry-run` (plan only, write nothing) or `--repo <owner/repo>`.
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
description = "Review every open issue of this repository, close only what the evidence settles, label and ping the rest, after your approval (/issue-clean-and-close)."
|
|
2
|
+
|
|
3
|
+
prompt = """
|
|
4
|
+
Execute the `/issue-clean-and-close` command workflow from its single source of truth `SKILL.md`.
|
|
5
|
+
|
|
6
|
+
First, locate and read `SKILL.md` from the first existing path:
|
|
7
|
+
1. `.gemini/skills/issue-clean-and-close/SKILL.md`
|
|
8
|
+
2. `.agents/skills/issue-clean-and-close/SKILL.md`
|
|
9
|
+
3. `~/.gemini/skills/issue-clean-and-close/SKILL.md`
|
|
10
|
+
4. `~/.agents/skills/issue-clean-and-close/SKILL.md`
|
|
11
|
+
5. `commands/issue-clean-and-close/SKILL.md`
|
|
12
|
+
|
|
13
|
+
If none of those files exists, stop and ask the user to install `commands/issue-clean-and-close` into `.gemini/skills/issue-clean-and-close/` (or `~/.gemini/skills/issue-clean-and-close/`) following `INSTALLATION.md`.
|
|
14
|
+
|
|
15
|
+
Otherwise, follow `SKILL.md` exactly without skipping steps.
|
|
16
|
+
Optional arguments passed by the user: {{args}}
|
|
17
|
+
"""
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
# Issue cleanup policy
|
|
2
|
+
|
|
3
|
+
`/issue-clean-and-close` reviews every open issue of the repository it runs in, closes only what the evidence settles, and labels and pings the rest, so nothing is left open without a reason and nothing is closed because it is old. It runs when a person invokes it; nothing is scheduled or installed. The person approves the exact plan at the Boss Gate, and that approval is the authorization for Tool Depot `github-write` / `clean-approved-issues`.
|
|
4
|
+
|
|
5
|
+
## Pipeline
|
|
6
|
+
|
|
7
|
+
```text
|
|
8
|
+
bbc sweep plan -> login, optional .github/issue-sweeper.json from the default branch
|
|
9
|
+
bbc sweep-github fetch -> snapshot.json (one GraphQL query per 30 open issues)
|
|
10
|
+
bbc sweep-issues -> plans/<UTC>.json (offline: rules SW1-SW8, metrics, report)
|
|
11
|
+
๐ก Boss Gate -> the person approves all, some issue numbers, or nothing
|
|
12
|
+
bbc sweep apply --plan -> bbc sweep-github apply: only what the approved plan lists, plus the report issue
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
`sweep-issues` decides everything and never calls GitHub; `sweep-github` only reads and writes what the plan says; `sweep` chains them, finds the repository from the checkout's `origin`, and keeps the evidence. An LLM reading this file applies the same rules and must reach the same plan; when they differ, the CLI stands and the difference is reported.
|
|
16
|
+
|
|
17
|
+
## Configuration (optional `.github/issue-sweeper.json`)
|
|
18
|
+
|
|
19
|
+
Without the file, the defaults apply. With it, its keys override them; it is read from the default branch, so changing it takes a reviewed pull request.
|
|
20
|
+
|
|
21
|
+
| Key | Default | Meaning |
|
|
22
|
+
|---|---|---|
|
|
23
|
+
| `language` | `es` | Language of comments and report (`es`, `en`). |
|
|
24
|
+
| `max_writes_per_run` | `20` | Issues acted on per plan; the rest are listed as `deferred` for the next run. |
|
|
25
|
+
| `needs_info_days` | `14` | Days after `needs-info` without an answer from the author before closing. |
|
|
26
|
+
| `claim_stale_days` | `7` | Days a claimed issue may go without activity or an open PR. |
|
|
27
|
+
| `inactive_days` | `30` | Days without activity before an unclaimed issue with no PR is marked `stale`. |
|
|
28
|
+
| `labels` | `stale`, `needs-info`, `needs-close-review`, `status:in-progress` | Label names. The command never creates labels; a missing one is a gap and the action proceeds without it. |
|
|
29
|
+
| `exempt_labels` | `security`, `frozen`, `lifecycle/frozen`, `pinned` | Issues the command never touches. |
|
|
30
|
+
| `exempt_priorities` | `P0`, `P1` | Priority levels it never touches (`priority:*`, `prioridad:*`, `P0`โ`P3`). |
|
|
31
|
+
| `report_title` | `Estado de issues` | Title of the report issue. |
|
|
32
|
+
|
|
33
|
+
The account that applies the plan is the `gh` login of whoever runs the command (`run_by` in the plan). Its sweep comments (by marker) and the `stale` and `needs-close-review` labels it sets are the command's own writes; anything else that person does is activity.
|
|
34
|
+
|
|
35
|
+
## Rules decided by `sweep-issues`
|
|
36
|
+
|
|
37
|
+
Rules are checked in this order; an issue gets at most one action per plan.
|
|
38
|
+
|
|
39
|
+
| Rule | Condition | Action |
|
|
40
|
+
|---|---|---|
|
|
41
|
+
| `SW8` | The issue has an exempt label or priority. | Report only. |
|
|
42
|
+
| `SW1` | A merged pull request **declares** closing the issue (manual link, GitHub's `willCloseTarget`, or a closing keyword `close/fix/resolve` + `#n` in its title or body), the issue was not reopened after that merge, and no open pull request also declares closing it. | Comment with the PR and merge commit, then close as `completed`. |
|
|
43
|
+
| `SW2` | A merged pull request references the issue without declaring it closed, or `SW1` was blocked by a reopen or another open PR. | Add `needs-close-review` and comment to the assignees (or the author). |
|
|
44
|
+
| `SW3` | `needs-info` is set, was added at least `needs_info_days` ago, and the author has not commented since. | Comment, then close as `not_planned`. |
|
|
45
|
+
| `SW4` | More than one open pull request references the issue. | Report only (`duplicate-work`). |
|
|
46
|
+
| `SW5` | The claim label is set, someone is assigned, no open pull request references it, and no activity for `claim_stale_days`. | Comment to the assignees. Never unassign. |
|
|
47
|
+
| `SW7` | `stale` is set and there was activity after it was added, within the last `inactive_days`. | Remove `stale`. |
|
|
48
|
+
| `SW6` | `stale` is not set, no open or merged pull request references it, it is not claimed, and no activity for `inactive_days`. | Add `stale` and comment. Never close. |
|
|
49
|
+
|
|
50
|
+
An issue with an incomplete pull request timeline gets no action at all, only a gap in the report.
|
|
51
|
+
|
|
52
|
+
**Activity** is the latest of: the issue's creation, a comment without a sweep marker, a label change other than the runner setting `stale` or `needs-close-review`, and a pull request referencing the issue. The command's own writes never reset or extend a timer.
|
|
53
|
+
|
|
54
|
+
**Idempotency:** every comment ends with `<!-- issue-sweeper:<rule> -->`. A rule that comments (`SW2`, `SW5`, `SW6`) does not comment again while its marker is newer than the last activity, whoever ran it.
|
|
55
|
+
|
|
56
|
+
**Safety:**
|
|
57
|
+
|
|
58
|
+
- The person sees every write before it happens, and `apply` performs only the plan file shown (all of it, or `--only` the approved issue numbers; a number outside the plan is refused). A plan older than 60 minutes or for another repository is refused.
|
|
59
|
+
- An issue with more pull request references than one page holds (25) gets no action (`incomplete`). Only the latest 25 comments and label events are read; an older `needs-info` label without its event in that window is never closed by `SW3`.
|
|
60
|
+
- `willCloseTarget` is not reliable once an issue is closed or reopened, so the closing keywords in the pull request's title and body are checked too. The fetcher keeps only the body lines that reference an issue, so a keyword at the end of a long body is not lost.
|
|
61
|
+
- Comments contain only numbers, links, dates, logins, and fixed text, never text copied from issues or pull requests. Each comment carries a `๐ก GAP visual` line: the evidence is the linked pull request or the timeline.
|
|
62
|
+
- Only an issue opened by the runner's login and carrying the report marker is its report issue, so copying the marker into another issue cannot get that issue's body overwritten.
|
|
63
|
+
- A failed write skips the remaining steps for that issue (a comment that fails is never followed by a close).
|
|
64
|
+
|
|
65
|
+
## Report
|
|
66
|
+
|
|
67
|
+
The plan carries a report, shown at the gate and kept as `report.md`. When a plan is applied, the runner's report issue (titled `report_title`, marked `<!-- issue-sweeper:report -->`) is created or rewritten with it:
|
|
68
|
+
|
|
69
|
+
- Open issues, with a pull request, assigned, age (median and 90th percentile, in days).
|
|
70
|
+
- Merged but still open (`SW1` + `SW2`), stale claims (`SW5`), duplicate work (`SW4`), waiting for information, inactive (`SW6`), exempt (`SW8`).
|
|
71
|
+
- The actions, the issues deferred by the cap, and the report-only issues, each with its rule.
|
|
72
|
+
- Gaps: missing labels, incomplete issues.
|
|
73
|
+
|
|
74
|
+
## Operation
|
|
75
|
+
|
|
76
|
+
```bash
|
|
77
|
+
npx -y @bbcsoftwarefactory/cli sweep plan [--repo <owner>/<repo>]
|
|
78
|
+
npx -y @bbcsoftwarefactory/cli sweep apply --plan <plan> [--only 12,15] [--dry-run]
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
Every step keeps its evidence in `~/.issue-clean-and-close/<owner>__<repo>/` (`SWEEP_HOME` overrides it): the policy file used (`config.json`), `snapshot.json`, the last 30 plans in `plans/` (`--keep`), `report.md`, and one JSON line per step in `runs.log` (plan: actions, deferred, gaps; apply: the plan, `only`, writes, errors).
|
|
82
|
+
|
|
83
|
+
| Exit | `sweep` | `sweep-issues` | `sweep-github` |
|
|
84
|
+
|---|---|---|---|
|
|
85
|
+
| 0 | Done | Plan ready | Done |
|
|
86
|
+
| 1 | Some writes failed (listed) | โ | Some writes failed (listed) |
|
|
87
|
+
| 2 | Unusable input, stale or foreign plan, broken policy file | `unusable` input or config | Unusable input |
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: recap
|
|
3
|
+
description: "Trigger: /recap, recap, resumen del dia, progreso del dia, cuanto avance, que efectivo fui, daily progress summary. Daily progress summary across Git, GitHub REST, and Project v2 boards: issues created/closed, PRs opened/merged, contribution, work in progress, effectiveness ratios, and optional board sync."
|
|
4
|
+
disable-model-invocation: true
|
|
5
|
+
license: Apache-2.0
|
|
6
|
+
compatibility: Requires Node.js 22.18+ (`@bbcsoftwarefactory/cli`), Git, and an authenticated gh CLI for GitHub metrics in `bbc recap`.
|
|
7
|
+
metadata:
|
|
8
|
+
author: bbc-skill-internals
|
|
9
|
+
version: "1.1"
|
|
10
|
+
pre_hook: "tool-depot (github-read: read-approved-issue-or-pr, read-pr-review-and-checks)"
|
|
11
|
+
post_hook: "Quest-Tree HUD"
|
|
12
|
+
post_install: "npx --full-depth; copy adapters/gemini.toml + /commands reload (Gemini); server restart (Zed ACP)"
|
|
13
|
+
adapters: "adapters/command.md, adapters/gemini.toml"
|
|
14
|
+
---
|
|
15
|
+
|
|
16
|
+
## Activation Contract
|
|
17
|
+
|
|
18
|
+
Run only when a person explicitly invokes `/recap` (or asks for a daily progress recap). By default it produces a **read-only** summary across local Git, GitHub REST, and an optional GitHub Project v2 board; it never mutates branches, files, issues, PRs, or boards unless the user explicitly asks to organize/sync the board (`--sync-board`).
|
|
19
|
+
|
|
20
|
+
Optional arguments:
|
|
21
|
+
- `--since <YYYY-MM-DD | <N>h | <N>d>`: Start of the summary window (default: local midnight today).
|
|
22
|
+
- `--all-repos`: Aggregate GitHub activity across all repositories for the user instead of only the current `origin` repository.
|
|
23
|
+
- `--repo <owner/repo>`: Override the target GitHub repository.
|
|
24
|
+
- `--user <login>`: Override the GitHub login (default: authenticated `gh` user).
|
|
25
|
+
- `--team`: Collect summary across all members of the target organization.
|
|
26
|
+
- `--users <u1,u2,...>`: Comma-separated GitHub logins for team summary.
|
|
27
|
+
- `--project <url | owner/number>`: Inspect a GitHub Project v2 board (column counts, assignee breakdown, and sync diff).
|
|
28
|
+
- `--sync-board`: With `--project`, add missing items and move closed/merged cards to `Done`.
|
|
29
|
+
- `--fix-colors`: With `--sync-board`, normalize `Status`/single-select colors (preserving option IDs) and show Labels/Priority/PRs on board view cards.
|
|
30
|
+
- `--apply-labels`: With `--sync-board`, apply matching existing repo labels (`bug`, `enhancement`, `documentation`) to unlabeled added items.
|
|
31
|
+
- `--dry-run`: With `--sync-board`, preview planned board changes without writing.
|
|
32
|
+
- `--no-github`: Collect local Git metrics only without calling `gh`.
|
|
33
|
+
- `--json`: Return structured JSON instead of the Quest-Tree HUD.
|
|
34
|
+
|
|
35
|
+
Granted authority upon explicit `/recap` invocation:
|
|
36
|
+
- `A1` (Read-only repo, GitHub & Project v2): local read-only `git log` / `git status` / `git rev-list`, GitHub REST reads (`gh api`) under [Tool Depot](../../skills/tool-depot/SKILL.md) `github-read` (`read-approved-issue-or-pr`, `read-pr-review-and-checks`), and read-only Project v2 GraphQL queries when `--project` is passed. Keep issue/PR/CI reads on REST (`bbc recap`).
|
|
37
|
+
- `A2` (Board sync, only when explicitly requested): `--sync-board` mutates only the named `--project` board (and existing repo labels when `--apply-labels` is passed), never closing issues, merging PRs, or modifying local Git files. Preview with `--dry-run` first when the user has not explicitly approved the write target.
|
|
38
|
+
|
|
39
|
+
## Hard Rules
|
|
40
|
+
|
|
41
|
+
- **Read-only by default.** Never write files, switch branches, push commits, or mutate issues, PRs, or boards unless `--sync-board` is explicitly authorized for that target project.
|
|
42
|
+
- **Preserve option IDs on color updates.** When `--fix-colors` updates a single-select field, always keep every option `id` so existing card assignments are never cleared.
|
|
43
|
+
- **No invented numbers.** Every count and ratio comes from `bbc recap` against real Git/GitHub output. When GitHub or local Git is unavailable, report `๐ก GAP` and `N/A` rather than guessing `0` or `100%`.
|
|
44
|
+
- **Objective effectiveness.** Report ratios (`merged/opened`, `CI passing`, `closed/created`) with traffic lights (`๐ข` / `๐ก` / `๐ด` / `โช N/A`), never a fabricated score.
|
|
45
|
+
- Match the final HUD language to the user (`--lang es` or `--lang en`).
|
|
46
|
+
|
|
47
|
+
## Decision Gates
|
|
48
|
+
|
|
49
|
+
| Situation | Action |
|
|
50
|
+
|---|---|
|
|
51
|
+
| Default invocation (`/recap`) | Run `npx -y @bbcsoftwarefactory/cli recap` for the current repo (`origin`) from local midnight today |
|
|
52
|
+
| `--all-repos` passed | Include all GitHub repositories for the user while keeping local Git metrics from the current working tree if present |
|
|
53
|
+
| `--project <url\|owner/n>` passed | Query Project v2 board columns, assignee breakdown, and sync diff (`missing_from_board`, `status_mismatches`) read-only |
|
|
54
|
+
| `--team` or `--users` passed | Collect per-member metrics across org members (or listed logins) and include them in the board cross-check |
|
|
55
|
+
| User asks to organize/sync the board | Run `--sync-board --dry-run` to preview, then apply `--sync-board` (with `--fix-colors` / `--apply-labels` as requested) once the target project is confirmed |
|
|
56
|
+
| `gh` missing or unauthenticated | Still run with local Git fallback and surface the explicit `๐ก GAP` in the HUD |
|
|
57
|
+
| Zero denominator in a ratio (e.g. `0` PRs opened) | Show `N/A` (or `<N> merged (0 opened)` when merges occurred from earlier days) |
|
|
58
|
+
|
|
59
|
+
## Execution Steps
|
|
60
|
+
|
|
61
|
+
1. Run `bbc recap` (via `npx -y @bbcsoftwarefactory/cli recap` or the linked `bbc` binary) with `--lang` matching the user's language (`es` or `en`) and any user-supplied flags (`--since`, `--all-repos`, `--repo`, `--user`, `--team`, `--users`, `--project`, `--sync-board`, `--fix-colors`, `--apply-labels`, `--dry-run`, `--no-github`, `--json`):
|
|
62
|
+
```bash
|
|
63
|
+
npx -y @bbcsoftwarefactory/cli recap --lang es
|
|
64
|
+
```
|
|
65
|
+
2. Render the command's Quest-Tree HUD directly in chat. If the user asks for item links (`"detalle"`), rerun with `--json` (or include the `items` list from the JSON output) without inventing details.
|
|
66
|
+
|
|
67
|
+
## Output Contract
|
|
68
|
+
|
|
69
|
+
Render the compact **Quest-Tree HUD** (`๐ RECAP โ <repo> (@<user> ยท desde <since>)`) covering all 7 core items (plus `๐ฅ Equipo`, `๐ Tablero`, and `๐ Tablero organizado` when `--team`, `--project`, or `--sync-board` are used):
|
|
70
|
+
1. `Issues creados`
|
|
71
|
+
2. `Issues cerrados`
|
|
72
|
+
3. `PRs enviados`
|
|
73
|
+
4. `Aporte` (commits, files changed, `+ins/-del`, peer PRs reviewed/commented)
|
|
74
|
+
5. `Solucionado` (PRs merged + issues closed)
|
|
75
|
+
6. `Avance en curso` (active open PRs ready/draft, unpushed commits, local working changes)
|
|
76
|
+
7. `Efectividad` (PR merge ratio, CI pass rate, issue close ratio)
|
|
77
|
+
|
|
78
|
+
Close with `๐ STAGE CLEAR` when all sources succeeded, or list explicit `๐ก Gaps` when a source was unavailable or capped.
|
|
79
|
+
|
|
80
|
+
## References
|
|
81
|
+
|
|
82
|
+
- [Install guide for Cursor, Zed, Claude Code, Claude, and Gemini](../../INSTALLATION.md)
|
|
83
|
+
- [Tool Depot catalog](../../skills/tool-depot/references/tool-catalog.json)
|
|
84
|
+
- [Commands reference](../../docs/commands.md)
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Read-only daily progress summary: issues created/closed, PRs opened/merged, commit/review contribution, work in progress, and effectiveness ratios (/recap)
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# /recap
|
|
6
|
+
|
|
7
|
+
Read and execute `SKILL.md` from the first existing path (single source of truth; do not duplicate or summarize its steps here):
|
|
8
|
+
|
|
9
|
+
1. `.cursor/skills/recap/SKILL.md`
|
|
10
|
+
2. `.claude/skills/recap/SKILL.md`
|
|
11
|
+
3. `.agents/skills/recap/SKILL.md`
|
|
12
|
+
4. `~/.cursor/skills/recap/SKILL.md`
|
|
13
|
+
5. `~/.claude/skills/recap/SKILL.md`
|
|
14
|
+
6. `~/.agents/skills/recap/SKILL.md`
|
|
15
|
+
7. `commands/recap/SKILL.md`
|
|
16
|
+
|
|
17
|
+
Optional arguments: `--since <YYYY-MM-DD|Nh|Nd>`, `--all-repos`, `--repo <owner/repo>`, `--user <login>`, `--team`, `--users <u1,u2>`, `--project <url|owner/number>`, `--sync-board`, `--fix-colors`, `--apply-labels`, `--dry-run`, `--no-github`, `--json`.
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
description = "Read-only daily progress summary: issues created/closed, PRs opened/merged, commits/reviews contribution, work in progress, and effectiveness ratios (/recap)."
|
|
2
|
+
|
|
3
|
+
prompt = """
|
|
4
|
+
Execute the `/recap` command workflow from its single source of truth `SKILL.md`.
|
|
5
|
+
|
|
6
|
+
First, locate and read `SKILL.md` from the first existing path:
|
|
7
|
+
1. `.gemini/skills/recap/SKILL.md`
|
|
8
|
+
2. `.agents/skills/recap/SKILL.md`
|
|
9
|
+
3. `~/.gemini/skills/recap/SKILL.md`
|
|
10
|
+
4. `~/.agents/skills/recap/SKILL.md`
|
|
11
|
+
5. `commands/recap/SKILL.md`
|
|
12
|
+
|
|
13
|
+
If none of those files exists, stop and ask the user to install `commands/recap` into `.gemini/skills/recap/` (or `~/.gemini/skills/recap/`) following `INSTALLATION.md`.
|
|
14
|
+
|
|
15
|
+
Otherwise, follow `SKILL.md` exactly without skipping steps.
|
|
16
|
+
Optional arguments passed by the user: {{args}}
|
|
17
|
+
"""
|