You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Resolve conflicts in two files:
- internal/flink/command.go: keep main's compute-pool/statement login-mode
branching and generated-region block; move the new artifact group into the
shared section as newArtifactCommand(cfg).
- pkg/flink/cmf_rest_client.go: adopt main's generic listAllPages helper in
place of the removed extractPageOptions; rewrite ListArtifacts and
ListArtifactVersions onto it (pass 0 for the default page size, since the
artifact commands expose no --page-size flag).
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
description: Validates confluentinc/cli's in-code documentation (Short/Long/Example text on Cobra commands, plus root markdown like README.md/CONTRIBUTING.md) against the live command tree to catch stale references to deprecated or hidden commands/flags, wrong/missing/extra flags in examples, typos, and broken links. Use when asked to check for documentation drift, validate CLI examples/help text, or audit docs for staleness. Read-only by default — only edits a file when explicitly asked to fix something.
4
+
---
5
+
6
+
# Docs Drift — confluentinc/cli
7
+
8
+
The CLI has no separate hand-maintained `docs/` tree. Its "docs" are the `Short`/`Long`/`Example` fields embedded directly in each Cobra command (e.g. `internal/kafka/command_topic_create.go`), plus root-level markdown. Ground truth is the live command/flag tree, not any static file.
9
+
10
+
## 1. Reuse the existing linter — don't re-derive it
11
+
12
+
```
13
+
make lint-cli
14
+
```
15
+
16
+
This runs `pkg/linter.RequireValidExamples()` (`pkg/linter/command_rules.go:220`) over the live command tree: every `IsFlagRequired` flag must appear in the example, every `--flag` token in an example must exist on that command's `pflag.FlagSet`, and `--flag=value` syntax is rejected outright. It also runs hunspell-backed `CommandRule`/`FlagRule` checks (naming, capitalization, punctuation) on `Use`/`Short`/`Long`/flag usage strings. Capture and categorize this output as doc-drift findings rather than reimplementing the flag-matching logic by hand.
17
+
18
+
## 2. Find deprecated/hidden surface still referenced in prose
19
+
20
+
Commands and flags are hidden or disabled via:
21
+
-`cmd.Flags().MarkHidden("flag-name")` (scattered across command files, e.g. `internal/kafka/command_topic_produce.go`)
22
+
-`command.Hidden = true` (see `internal/command.go:229`)
LaunchDarkly can also deprecate visible surface area via `featureflags.DeprecateCommandTree` and `featureflags.DeprecateFlags`, which prefix command `Short`/`Long` text or flag `Usage` with `DEPRECATED:`. Grep for all hiding, disabling, and deprecation patterns repo-wide to build a list of affected commands and flags, then cross-reference each name against every `Example:`/`Long:` string that still mentions it by exact name. A hidden/disabled command or flag shown in another example is stale; a deprecated one shown without an appropriate warning is a drift candidate. Report the file:line of both the mechanism and the stale reference.
26
+
27
+
## 3. Cross-check subcommands mentioned in prose
28
+
29
+
Some `Long:` fields reference other subcommands by name (e.g. "run `confluent kafka topic list` first"). Build the live command tree the same way `cmd/docs/main.go` and `cmd/lint/main.go` do (`internal.NewConfluentCommand(cfg)`), then verify every `confluent <subcommand path>` mentioned in prose still resolves to a real, non-hidden command. A renamed or removed subcommand referenced this way is a direct hit — this is the CLI-side analog of a doc pointing at a resource/attribute that no longer exists.
30
+
31
+
## 4. Root markdown: typos and broken links
32
+
33
+
For `README.md`, `CONTRIBUTING.md`, and any other repo-root markdown:
34
+
- Extract `[text](url)` links. For relative links, verify the target file exists. For `http(s)://` links, follow redirects during a quick HEAD check (`curl -sSIL -o /dev/null -w '%{http_code}' <url>`). If the server rejects HEAD with `405` or `501`, retry with a lightweight GET that discards the body (`curl -sSL -o /dev/null -w '%{http_code}' <url>`). Treat other final 4xx/5xx responses as broken, and skip anything pointing at internal/non-public infrastructure.
35
+
- Cross-reference command/flag names mentioned in prose against the real command surface built in step 3 — a misspelled command (`confluent kafak topic`) won't resolve and is a giveaway.
36
+
37
+
## 5. Optional: regenerate the full reference tree for a manual pass
38
+
39
+
`go run cmd/docs/main.go` renders the entire live command tree to `.rst` under `docs/` (gitignored, not committed, and not wired into `make`/CI). Regenerating and skimming it is useful for a broader manual read beyond the automated checks above, but there's no prior committed version to diff against — don't treat it as a source of drift by itself, just as an on-demand snapshot.
40
+
41
+
## Output
42
+
43
+
Report findings grouped by category — `lint-cli` failures, stale deprecated/hidden reference, broken subcommand reference, typo, broken link — each with a file:line and a one-line concrete explanation (not "looks wrong"). Stay read-only: only edit a file if the user explicitly asks you to fix something, and show the diff before/after.
description: Finds and resolves duplicate GitHub issues in confluentinc/cli, with a lightweight check for related issues in the sibling confluentinc/terraform-provider-confluent repo. Scans open issues, clusters likely duplicates with a suggested canonical issue, and — only after explicit confirmation — comments, labels, and closes confirmed duplicates. Use when asked to find, flag, merge, close, or clean up duplicate issues in this repo. Scanning is read-only; resolving mutates GitHub and always confirms first.
4
+
---
5
+
6
+
# Issue Dedup — confluentinc/cli
7
+
8
+
Two phases in one skill: **Scan** (read-only, always safe to run) and **Resolve** (mutates GitHub, requires explicit confirmation). Do not skip straight to Resolve — always scan (or accept a prior scan's output) first.
9
+
10
+
## Phase 1 — Scan (read-only)
11
+
12
+
1.**Scope**: default to all open issues in `confluentinc/cli`. If the user narrows it (a label, a time window, a keyword), use that instead. First obtain the total matching count without truncation:
13
+
14
+
```
15
+
gh api --method GET search/issues -f q='repo:confluentinc/cli is:issue is:open' --jq '.total_count'
16
+
```
17
+
18
+
Include any user-supplied label, time-window, or keyword filters in the search query. If the count is more than ~500, report it and ask whether to narrow the scope or explicitly approve fetching the larger result set. Only then fetch the issues, setting `--limit` to at least the reported count so the scan is not silently capped:
19
+
20
+
```
21
+
gh issue list --repo confluentinc/cli --state open \
2.**Normalize**: strip issue-template boilerplate (fixed headers, checkbox scaffolding) before comparing bodies — it inflates similarity between unrelated issues that just used the same template. Focus on what varies: error messages, exact commands, stack traces, version strings, repro steps.
26
+
27
+
3.**Cluster** (don't do a naive O(n²) full-text pass):
28
+
- Block by shared signals first: same error string/exit code, same subcommand (e.g. `confluent kafka topic create`), overlapping title tokens, same label.
29
+
- Within a block, actually read the normalized bodies and judge whether they're the same bug/request, not just the same topic. "Topic creation fails" with two different root causes is not a duplicate pair.
30
+
31
+
4.**Cross-repo check**: for clusters that look like they might stem from a platform/API behavior rather than a CLI-specific bug, do one targeted search against the sibling repo before concluding:
32
+
33
+
```
34
+
gh issue list --repo confluentinc/terraform-provider-confluent --state open --search "<keyword>"
35
+
```
36
+
37
+
If you find a match, flag it as **cross-repo related** rather than a same-repo duplicate — see classification below.
38
+
39
+
5.**Pick a canonical issue** per group: prefer most complete repro/description, then oldest by `createdAt`, then most comments/reactions. State which rule decided it.
40
+
41
+
6.**Classify**:
42
+
-**Same-repo duplicate** (High/Medium/Low confidence) — candidate for closing in Phase 2.
43
+
-**Cross-repo related** (High/Medium/Low confidence) — same underlying platform behavior surfacing in both repos. Default action is cross-linking, not closing either side.
44
+
45
+
For every group, give one or two sentences of *concrete* reasoning (shared error text, same command, same field) — never just "these look similar."
46
+
47
+
7.**Output**: write a markdown report (default `./issue-dedup-report-<YYYY-MM-DD>.md`) with one entry per group:
Only enter this phase against a scan you (or a prior run) just produced, or a group the user hands you directly. Never invent duplicate judgments from scratch here.
62
+
63
+
1.**Re-verify** each issue in each group before trusting the report — reports go stale:
Drop/flag a group if an issue is already closed, has picked up substantial new discussion diverging from the canonical thread (treat as "needs manual review"), or its body has changed enough to undercut the original judgment.
70
+
71
+
2.**Show the exact plan before acting** — literal comment text and commands, not a summary:
72
+
73
+
```
74
+
Canonical: #123 <title>
75
+
Will close as duplicate: #456 <title>
76
+
Comment: "Closing as a duplicate of #123. If this doesn't fully capture your issue, please reopen or comment on the original with details."
77
+
Label: duplicate
78
+
Close reason: not planned
79
+
```
80
+
81
+
For **cross-repo related** groups, default to cross-linking only (a comment on each issue pointing at the other) — do not close either side unless the user explicitly says to.
82
+
83
+
3.**Wait for explicit confirmation.** Confirm per group unless the user explicitly approves the whole batch — and even then, show every group's plan first.
gh issue close <dup> --repo confluentinc/cli --reason "not planned"
91
+
```
92
+
93
+
For a cross-repo cross-link, the corresponding comment goes on the `confluentinc/terraform-provider-confluent` issue via the same `gh issue comment` pattern with that repo. If `gh` reports a permissions error, stop and tell the user — don't retry or route around it.
94
+
95
+
5.**Log and summarize**: append each executed action (issue, action, timestamp) to `./issue-dedup-actions-<YYYY-MM-DD>.md`, then report groups resolved, groups skipped (why), and groups left for manual review.
96
+
97
+
## Defaults
98
+
99
+
- Treat every run as dry-run (show the plan, don't execute) unless the user's message already contains clear approval to act ("go ahead", "do it", "apply these").
100
+
- Never bulk-close a group with materially divergent discussion — surface it for manual review instead.
0 commit comments