docs: docs/solutions/ design-decision library (KLA-445)#63
Open
jklaassenjc wants to merge 1 commit into
Open
Conversation
A grep-able library of non-obvious decisions made in jc-cli. The target
reader is a future contributor (human or agent) who has just landed in
an unfamiliar package and is about to redo a debate that's already
been settled.
Layout (modeled after jamf-cli's docs/solutions/):
docs/solutions/
├── README.md conventions + frontmatter spec
├── design-patterns/ architectural / structural decisions
├── conventions/ coding conventions and style rules
├── postmortems/ what-went-wrong and how-we-recovered
└── lint_test.go frontmatter enforcement
Seeded with 7 entries pulled from the KLA-408..452 arc:
design-patterns/
step-up-auth-chokepoint — reflection on Execute bool
pre-flight-before-step-up — input validation pre-gate
mcp-app-registration-shapes — appSpec vs typed
conventions/
parallel-mcp-and-cli-taxonomies — they're siblings, not parent/child
aggregate-validation-errors — every problem in one pass
empirical-gate-before-coding — hit the live tenant first
worst-case-capability-classification — Bugbot PR #62 lesson
postmortems/
stacked-pr-self-approval-blocked — PR #50-54 → bundle PR #55
Every file carries YAML frontmatter (title/date/category/module/tags/
applies_when). TestEverySolutionFileHasFrontmatter enforces required
fields and refuses files whose declared category disagrees with their
parent directory.
AGENTS.md gets a new top-of-file pointer telling agents to grep
docs/solutions/ before starting non-trivial structural work.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
A grep-able library of non-obvious decisions made in jc-cli, modeled after jamf-cli's
docs/solutions/. Pins decisions next to the systems they constrain via stable filenames + YAML-frontmatter tags, so future contributors (human or agent) don't redo settled debates.Layout
Seed entries (7)
Pulled from the KLA-408..452 arc:
design-patterns/
step-up-auth-chokepoint— reflection onExecute boolfor one-gate-across-30-toolspre-flight-before-step-up— input validation runs before the gate (Bugbot PR feat(mcp): Apple MDM payloads as MCP tools (KLA-452) #60 catch)mcp-app-registration-shapes—appSpec(no-args) vs typed (parameterized) MCP Appsconventions/
parallel-mcp-and-cli-taxonomies— MCP tools and Cobra commands are siblings, not 1:1aggregate-validation-errors— every problem in one pass (multi-payload compose)empirical-gate-before-coding— hit the live tenant before writing the emitter (KLA-450 iOS)worst-case-capability-classification—jc:classworst-case rule (Bugbot PR feat(cmd): jc:class annotation registry + CI lint (KLA-444) #62)postmortems/
stacked-pr-self-approval-blocked— PR feat(apple-mdm): payloads template — offline .mobileconfig emitter (KLA-449 PR2/3) #50-54 → consolidated bundle PR feat(apple-mdm): emitter + create-policy + TUI authoring + edit (KLA-449/453/454/455) #55Frontmatter contract
Every file declares
title / date / category / module / tags / applies_when(and optionalsuperseded_by).TestEverySolutionFileHasFrontmatter(docs/solutions/lint_test.go) enforces required fields and refuses files whose declared category disagrees with their parent directory.AGENTS.md pointer
A new top-of-file section tells agents to grep
docs/solutions/before starting any non-trivial structural work:Test plan
TestEverySolutionFileHasFrontmatterenforces required fields + category/dir consistencygo test ./...green🤖 Generated with Claude Code
Note
Low Risk
Documentation and test-only enforcement only; no production or auth behavior changes.
Overview
Introduces a grep-able
docs/solutions/library for non-obvious design decisions (patterns, conventions, postmortems), with YAML frontmatter (title,date,category,module,tags,applies_when) and a README that defines layout, filenames, and authoring rules.Seven seed entries document settled choices from the MCP/Apple MDM arc (e.g. step-up chokepoint on
Execute, pre-flight before step-up, MCP vs CLI taxonomies, aggregate validation, empirical API probing, worst-casejc:class, stacked-PR review deadlock).Adds
docs/solutions/lint_test.go(TestEverySolutionFileHasFrontmatter) so CI fails on missing frontmatter, invalid categories, or category/directory mismatches.AGENTS.mdgets a top section telling agents to searchdocs/solutions/before non-trivial structural work, with examplegrepcommands.Reviewed by Cursor Bugbot for commit fee4ac3. Bugbot is set up for automated code reviews on this repo. Configure here.