Skip to content

feat(cli): add --markdown flag to swamp report get#1385

Merged
stack72 merged 1 commit into
mainfrom
worktree-346
May 14, 2026
Merged

feat(cli): add --markdown flag to swamp report get#1385
stack72 merged 1 commit into
mainfrom
worktree-346

Conversation

@stack72
Copy link
Copy Markdown
Contributor

@stack72 stack72 commented May 14, 2026

Summary

Closes swamp-club#346.

  • Add --markdown flag to swamp report get that emits clean markdown (pipe tables, ## headings, no ANSI escapes or box-drawing) instead of terminal-formatted output
  • Mutually exclusive with --json via Cliffy's conflicts declaration
  • Uses the existing renderMarkdownPlain() function which was previously unused
  • Update swamp-report skill to document the new flag

Test Plan

  • 4 new unit tests for the markdown renderer (no ANSI escapes, varySuffix handling, workflow source)
  • All 9 renderer tests pass
  • deno check / deno lint / deno fmt pass
  • Compiled binary and verified --markdown produces clean markdown with real report data
  • Verified --markdown --json correctly errors with conflict message

🤖 Generated with Claude Code

Report output currently uses ANSI escape sequences and box-drawing
characters that don't render in markdown editors, GitHub PRs, or wikis.
Add a `--markdown` flag that emits clean markdown (pipe tables, ## headings,
no ANSI) so reports can be pasted or redirected to .md files directly.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Copy link
Copy Markdown

@github-actions github-actions Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CLI UX Review

Blocking

None.

Suggestions

  1. Metadata line formatting (report_get.ts:84): The metadata line in markdown mode — ${source} | Scope: ${r.reportScope} | v${r.version} | ${r.createdAt} — is unstyled prose after a ## heading. On GitHub/Linear it may look a bit unpolished. A > blockquote prefix or _italic_ wrap would give it a distinct metadata treatment. Entirely optional given the stated use-case is piping to a file.

  2. ISO timestamp in markdown output (report_get.ts:84): createdAt emits a raw ISO string (2026-01-15T10:00:00.000Z). Fine for scripts, slightly noisy in human-read docs. No action needed.

Verdict

PASS — --markdown is well-named, properly conflicts with --json, has a clear example (> report.md), produces verified ANSI-free output, and follows the same renderer pattern as log/json modes. Skill documentation is clear and complete.

Copy link
Copy Markdown

@github-actions github-actions Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

Clean, well-structured PR that adds a --markdown output mode to swamp report get.

Blocking Issues

None.

Suggestions

None — the implementation follows existing patterns closely:

  • Import boundary: CLI command imports from libswamp/mod.ts
  • Renderer pattern: MarkdownReportGetRenderer follows the same class + factory switch pattern as LogReportGetRenderer and JsonReportGetRenderer
  • Type safety: ReportOutputMode = OutputMode | "markdown" cleanly extends the existing type, and the switch in createReportGetRenderer remains exhaustive ✓
  • Mutual exclusion: conflicts: ["json"] follows the same Cliffy pattern used elsewhere (e.g., extension_list.ts, issue_ripple.ts) ✓
  • Tests: 4 new tests cover the key behaviors (no ANSI escapes, varySuffix presence/absence, workflow source) ✓
  • Skill docs: Quick reference table and markdown mode paragraph added in the right places ✓
  • Copyright headers: All files have AGPLv3 header ✓
  • No security concerns: Boolean flag, no user input flows into dangerous paths ✓

@stack72 stack72 merged commit d3a6ea8 into main May 14, 2026
11 checks passed
@stack72 stack72 deleted the worktree-346 branch May 14, 2026 16:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant