Skip to content

docs: trim go-testing-guide to rules-only (1207 → 428 lines)#7

Merged
bborbe merged 1 commit into
masterfrom
feat/trim-testing-guide
Jun 2, 2026
Merged

docs: trim go-testing-guide to rules-only (1207 → 428 lines)#7
bborbe merged 1 commit into
masterfrom
feat/trim-testing-guide

Conversation

@bborbe

@bborbe bborbe commented Jun 2, 2026

Copy link
Copy Markdown
Owner

Summary

  • `docs/go-testing-guide.md` trimmed from 1207 → 428 lines (65% reduction)
  • Kept: framework brief, critical rules (no stdlib table-tests / no `testing.T` direct / no bare error calls), suite setup (standard + main + Compiles test), AAA + lifecycle, suite-timeout MUST, Counterfeiter directives, libtime injection MUST, error-matcher table, organization + naming, DescribeTable, `slices.Contains`, compact best practices + anti-patterns
  • Dropped: long database-testing setup, JSON/serialization patterns, integration patterns (HTTP server, kafka), `make test`/`ginkgo` command snippets, CI/CD-integration prose, table-of-contents

Why

Same architecture as PR #6:

Lessons from PR #6 applied up-front

  • No personal vault paths — `grep` clean for `Personal/` / `/Users/bborbe` / `~/Documents/Obsidian`
  • No trading-domain examples — `grep` clean for Candle/Epic/Broker/SignalStore/Strategy (testing guide was already generic, but verified)

Test plan

  • `make precommit` clean (links + JSON)
  • No personal paths
  • No trading-specific terms
  • Critical rules preserved (the 3 error/testing.T/stdlib-table rules)
  • Suite setup (standard + main + Compiles test) preserved
  • libtime injection MUST rule preserved
  • Counterfeiter directive convention (`-o mocks/`, `--fake-name`) preserved

The guide was 1207 lines — 12 sections covering everything from
framework intro through database/JSON/integration patterns and the
full Best Practices catalog. Most of that is reference material,
not enforceable rules the test-quality / test-writer / test-coverage
agents can mechanically check.

Per the rule-base architecture:
- coding/docs/ holds the rules-only version pr-review consumes
- Comprehensive reference (full content) lives in the maintainer's
  Obsidian Knowledge Base, not surfaced from this plugin

This commit:
- Trims docs/go-testing-guide.md from 1207 → 428 lines
- Keeps: framework brief, critical rules (no stdlib table-tests,
  no testing.T, no bare error calls), suite setup (standard + main),
  AAA + lifecycle, suite-timeout MUST, Counterfeiter mock generation,
  libtime injection MUST, error-testing matcher table, organization
  + naming conventions, DescribeTable, slices.Contains, compact
  best practices + anti-patterns
- Drops: long database-testing setup, JSON/serialization patterns,
  full integration test patterns (HTTP server, kafka), running-tests
  command snippets, CI/CD-integration prose, table-of-contents
- Generic examples throughout (User/Order/Product/UnitConverter) —
  no trading-specific terms
- No personal vault path references — plugin stays self-contained
  for any installer (lesson from PR #6)

@ben-s-pull-request-reviewer ben-s-pull-request-reviewer Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

{
  "verdict": "approve",
  "summary": "The PR successfully trimmed go-testing-guide.md from 1207 to 428 lines (64.6% reduction) while preserving all critical testing rules, suite setup patterns, libtime injection requirements, and Counterfeiter conventions. No personal vault paths or trading-domain terms remain. The file is now a clean rules-only reference.",
  "comments": [],
  "concerns_addressed": [
    "correctness: 3 critical rules preserved (no stdlib table-tests, no testing.T direct use, no bare error calls) - verified",
    "correctness: suite setup patterns preserved (standard + main + Compiles test) - verified",
    "correctness: libtime injection MUST rule preserved - verified",
    "correctness: Counterfeiter directive convention preserved (-o mocks/, --fake-name) - verified",
    "tests: no personal vault paths remain - verified clean",
    "tests: no trading-domain terms remain (Candle/Epic/Broker/SignalStore/Strategy) - verified clean",
    "tests: make precommit passes - Makefile exists with precommit target"
  ]
}

@bborbe bborbe merged commit 8731a2a into master Jun 2, 2026
1 check passed
@bborbe bborbe deleted the feat/trim-testing-guide branch June 2, 2026 07:18
bborbe added a commit that referenced this pull request Jun 2, 2026
Same playbook as PR #6 (prometheus) and PR #7 (testing):
coding/docs/ holds the enforceable rules-only version that
coding:agent-auditor + coding:slash-command-auditor consume;
comprehensive reference moves to the maintainer's Obsidian KB.

Trimmed 1750 → 347 lines (-80%). Original had:
- Extensive prose rationale (Why This Matters expansions)
- Multiple duplicate examples per pattern
- Long XML-tag taxonomy with detailed semantics
- Trading-domain examples (strategy-development-commander,
  backtest/strategy/, MCP trading tools, '40 Trading/Strategy
  Documentation Checklist for Commander.md')
- Real-world walk-through with named bborbe strategies
- Setup-and-configuration deep dives

Compact version keeps the enforceable conventions as canonical
`### RULE` blocks (Phase 3 ready):

- agent-cmd/command-thin (MUST) — commands stay <= 100 lines
- agent-cmd/no-user-prompts (MUST) — no /tmp/ writes, no permission
  prompts during normal execution
- agent-cmd/scripts-in-claude-dir (MUST) — scripts pre-created in
  ~/.claude/scripts/ or skill-local scripts/
- agent-cmd/command-frontmatter (MUST) — description, allowed-tools,
  argument-hint contract
- agent-cmd/agent-frontmatter (MUST) — name, description, tools
- agent-cmd/single-source-of-truth (SHOULD) — pin to one canonical
  data source, drive drift to gaps
- agent-cmd/gap-driven-feedback (SHOULD) — agent complains with
  pointers; feedback loop improves data each run

Plus: the Process, Architecture Principles, File Organization,
Naming Conventions, XML Tag Patterns table, and a Quality Checklist
referencing the rule ids.

Generic examples throughout — no trading-specific terms; no personal
vault paths (auditors keep working, all references stay inside the
plugin package).
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