get-tbd 0.1.29 → 0.2.0
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/README.md +5 -1
- package/dist/bin.mjs +3241 -2326
- package/dist/bin.mjs.map +1 -1
- package/dist/cli.mjs +1503 -791
- package/dist/cli.mjs.map +1 -1
- package/dist/{config-B38rbI9u.mjs → config-BJz1m9eN.mjs} +183 -39
- package/dist/config-BJz1m9eN.mjs.map +1 -0
- package/dist/{config-C0ITTrtc.mjs → config-DlCUMyCG.mjs} +1 -1
- package/dist/docs/README.md +5 -1
- package/dist/docs/SKILL.md +0 -1
- package/dist/docs/guidelines/backward-compatibility-rules.md +4 -0
- package/dist/docs/guidelines/bun-monorepo-patterns.md +20 -4
- package/dist/docs/guidelines/cli-agent-skill-patterns.md +354 -37
- package/dist/docs/guidelines/commit-conventions.md +4 -0
- package/dist/docs/guidelines/common-doc-guidelines.md +234 -0
- package/dist/docs/guidelines/convex-limits-best-practices.md +4 -0
- package/dist/docs/guidelines/convex-rules.md +4 -0
- package/dist/docs/guidelines/electron-app-development-patterns.md +4 -0
- package/dist/docs/guidelines/error-handling-rules.md +4 -0
- package/dist/docs/guidelines/general-coding-rules.md +4 -0
- package/dist/docs/guidelines/general-comment-rules.md +4 -0
- package/dist/docs/guidelines/general-eng-assistant-rules.md +4 -0
- package/dist/docs/guidelines/general-tdd-guidelines.md +4 -0
- package/dist/docs/guidelines/general-testing-rules.md +4 -0
- package/dist/docs/guidelines/golden-testing-guidelines.md +4 -0
- package/dist/docs/guidelines/pnpm-monorepo-patterns.md +27 -6
- package/dist/docs/guidelines/python-cli-patterns.md +4 -0
- package/dist/docs/guidelines/python-modern-guidelines.md +30 -0
- package/dist/docs/guidelines/python-rules.md +4 -0
- package/dist/docs/guidelines/release-notes-guidelines.md +4 -0
- package/dist/docs/guidelines/supply-chain-hardening.md +11 -7
- package/dist/docs/guidelines/tbd-sync-troubleshooting.md +10 -4
- package/dist/docs/guidelines/typescript-cli-tool-rules.md +27 -24
- package/dist/docs/guidelines/typescript-code-coverage.md +11 -7
- package/dist/docs/guidelines/typescript-rules.md +10 -6
- package/dist/docs/guidelines/typescript-sorting-patterns.md +4 -0
- package/dist/docs/guidelines/typescript-yaml-handling-rules.md +7 -3
- package/dist/docs/install/ensure-gh-cli.sh +59 -24
- package/dist/docs/shortcuts/standard/agent-handoff.md +4 -0
- package/dist/docs/shortcuts/standard/checkout-third-party-repo.md +4 -0
- package/dist/docs/shortcuts/standard/code-cleanup-all.md +4 -0
- package/dist/docs/shortcuts/standard/code-cleanup-docstrings.md +4 -0
- package/dist/docs/shortcuts/standard/code-cleanup-tests.md +4 -0
- package/dist/docs/shortcuts/standard/code-review-and-commit.md +4 -0
- package/dist/docs/shortcuts/standard/coding-spike.md +4 -0
- package/dist/docs/shortcuts/standard/create-or-update-pr-simple.md +4 -0
- package/dist/docs/shortcuts/standard/create-or-update-pr-with-validation-plan.md +4 -0
- package/dist/docs/shortcuts/standard/implement-beads.md +4 -0
- package/dist/docs/shortcuts/standard/merge-upstream.md +4 -0
- package/dist/docs/shortcuts/standard/new-architecture-doc.md +4 -0
- package/dist/docs/shortcuts/standard/new-guideline.md +4 -0
- package/dist/docs/shortcuts/standard/new-plan-spec.md +4 -0
- package/dist/docs/shortcuts/standard/new-qa-playbook.md +4 -0
- package/dist/docs/shortcuts/standard/new-research-brief.md +4 -0
- package/dist/docs/shortcuts/standard/new-shortcut.md +4 -0
- package/dist/docs/shortcuts/standard/new-validation-plan.md +4 -0
- package/dist/docs/shortcuts/standard/plan-implementation-with-beads.md +4 -0
- package/dist/docs/shortcuts/standard/precommit-process.md +4 -0
- package/dist/docs/shortcuts/standard/review-code-python.md +4 -0
- package/dist/docs/shortcuts/standard/review-code-typescript.md +4 -0
- package/dist/docs/shortcuts/standard/review-code.md +4 -0
- package/dist/docs/shortcuts/standard/review-github-pr.md +4 -0
- package/dist/docs/shortcuts/standard/revise-all-architecture-docs.md +4 -0
- package/dist/docs/shortcuts/standard/revise-architecture-doc.md +4 -0
- package/dist/docs/shortcuts/standard/setup-github-cli.md +4 -0
- package/dist/docs/shortcuts/standard/sync-failure-recovery.md +4 -0
- package/dist/docs/shortcuts/standard/update-specs-status.md +4 -0
- package/dist/docs/shortcuts/standard/welcome-user.md +4 -0
- package/dist/docs/tbd-closing.md +4 -0
- package/dist/docs/tbd-design.md +109 -68
- package/dist/docs/tbd-docs.md +20 -13
- package/dist/docs/tbd-prime.md +4 -0
- package/dist/docs/templates/architecture-doc.md +4 -0
- package/dist/docs/templates/plan-spec.md +4 -0
- package/dist/docs/templates/qa-playbook.md +4 -0
- package/dist/docs/templates/research-brief.md +4 -0
- package/dist/{id-mapping-Ctfl_nc1.mjs → id-mapping-CFoPVinz.mjs} +1 -1
- package/dist/{id-mapping-CqrrLgeX.mjs → id-mapping-CtfTfGIh.mjs} +146 -122
- package/dist/id-mapping-CtfTfGIh.mjs.map +1 -0
- package/dist/index.d.mts +53 -1
- package/dist/index.mjs +3 -3
- package/dist/{schemas-C8mOQykE.mjs → schemas-f0EcuAVu.mjs} +40 -3
- package/dist/schemas-f0EcuAVu.mjs.map +1 -0
- package/dist/{src-CJyVkC3V.mjs → src-rIE4xSVs.mjs} +3 -3
- package/dist/src-rIE4xSVs.mjs.map +1 -0
- package/dist/tbd +3241 -2326
- package/package.json +1 -1
- package/dist/config-B38rbI9u.mjs.map +0 -1
- package/dist/docs/guidelines/general-style-rules.md +0 -38
- package/dist/docs/guidelines/writing-style-guidelines.md +0 -42
- package/dist/id-mapping-CqrrLgeX.mjs.map +0 -1
- package/dist/schemas-C8mOQykE.mjs.map +0 -1
- package/dist/src-CJyVkC3V.mjs.map +0 -1
|
@@ -0,0 +1,234 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Common Documentation Guidelines
|
|
3
|
+
description: Common cross-project standards for writing and organizing docs, code comments, and text files — how to organize, structure, write, and format documents, plus the guideline footer convention. Downstream of github.com/jlevy/practical-prose. Use whenever writing or editing any documentation, README, guideline, or design doc.
|
|
4
|
+
author: Joshua Levy (github.com/jlevy) with LLM assistance
|
|
5
|
+
---
|
|
6
|
+
# Common Documentation Guidelines
|
|
7
|
+
|
|
8
|
+
Version: v0.1 (last update 2026-05-11)\
|
|
9
|
+
Joshua Levy (github.com/jlevy)
|
|
10
|
+
|
|
11
|
+
## Purpose
|
|
12
|
+
|
|
13
|
+
Both agents and humans benefit from accurate, maintained documentation.
|
|
14
|
+
These are brief and general guidelines for humans and agents when writing and organizing
|
|
15
|
+
code, text files, and documentation.
|
|
16
|
+
|
|
17
|
+
See the [Practical Prose](https://github.com/jlevy/practical-prose) repository for more
|
|
18
|
+
extensive guidelines and context.
|
|
19
|
+
|
|
20
|
+
## Organizing Documentation
|
|
21
|
+
|
|
22
|
+
1. **Organize documents for rapid orientation**
|
|
23
|
+
|
|
24
|
+
- All context for understanding a project should be efficiently discoverable.
|
|
25
|
+
- Documents should reference other documents whenever relevant.
|
|
26
|
+
- A reader should be able to navigate from an obvious root document to all other
|
|
27
|
+
documents relevant to a given need by following references.
|
|
28
|
+
|
|
29
|
+
2. **Use self-evident filenames and concise references**
|
|
30
|
+
|
|
31
|
+
- For file naming, always follow existing project conventions.
|
|
32
|
+
If conventions are unclear, use the conventions here.
|
|
33
|
+
- Repos and key file folders should have a concise `README.md` as a root document
|
|
34
|
+
that points to other documents.
|
|
35
|
+
- Within the top-level repo or within key folders, a `docs/` folder should be added
|
|
36
|
+
with other key docs and referenced in the `README.md`.
|
|
37
|
+
- Whenever possible give documents brief but unique names.
|
|
38
|
+
- Include a hint of the *topic* as well as *purpose*, such as
|
|
39
|
+
`python-structural-quality-guidelines.md`.
|
|
40
|
+
- Documents that are likely to become less relevant over time should have *dates or
|
|
41
|
+
versions* as well, such as `plan-2026-04-28-browser-realtime-streaming.md`.
|
|
42
|
+
- Unless other rules forbid it, references within documents should be *maximally
|
|
43
|
+
concise* so they are easy to maintain:
|
|
44
|
+
- For URLs, use simple link text with the URL in Markdown format.
|
|
45
|
+
- For other documents, use the simplest unique reference, such as a title or
|
|
46
|
+
filename, that makes the document easy to find.
|
|
47
|
+
- Do not include unnecessary metadata, local paths, or other details readily
|
|
48
|
+
determined from a search.
|
|
49
|
+
|
|
50
|
+
3. **Divide documents by ownership, audience, and cadence**
|
|
51
|
+
|
|
52
|
+
- Documents owned and maintained by different people or teams should usually be
|
|
53
|
+
distinct.
|
|
54
|
+
- Documents meant for different audiences (such as internal versus external, or team
|
|
55
|
+
docs versus sensitive docs) should be kept separate.
|
|
56
|
+
- Documents updated on different cadences (such as ad hoc, every sprint, or yearly)
|
|
57
|
+
should be distinct.
|
|
58
|
+
- Documents with the same ownership, audience, and update cadence should be
|
|
59
|
+
consolidated.
|
|
60
|
+
|
|
61
|
+
4. **Organize documents for maintainability**
|
|
62
|
+
|
|
63
|
+
- Reference or include relevant guidelines for updates.
|
|
64
|
+
- Documents should be organized in a way that is compatible with typical update
|
|
65
|
+
processes.
|
|
66
|
+
|
|
67
|
+
## Structuring Documents
|
|
68
|
+
|
|
69
|
+
1. **Explain motivations and background**
|
|
70
|
+
|
|
71
|
+
- Assume readers have low context.
|
|
72
|
+
- Highest-level documents or introductory sections should explain *why* as well as
|
|
73
|
+
*what*.
|
|
74
|
+
- A key part of the *why* is explaining why some approaches are taken and their
|
|
75
|
+
benefits compared to alternate approaches or alternate tools.
|
|
76
|
+
- Cite external sources for all content that is best covered externally.
|
|
77
|
+
|
|
78
|
+
2. **Give context gradually and efficiently**
|
|
79
|
+
|
|
80
|
+
- Documents should be as brief as possible while still preserving all relevant
|
|
81
|
+
detail.
|
|
82
|
+
- Add detail incrementally: start with summaries, link to deeper docs.
|
|
83
|
+
|
|
84
|
+
3. **Keep details close to where they apply**
|
|
85
|
+
|
|
86
|
+
- For example, docstrings in code or descriptions within YAML are preferred to
|
|
87
|
+
separate documentation when the content directly relates to code or content in
|
|
88
|
+
those files.
|
|
89
|
+
|
|
90
|
+
4. **Avoid duplication**
|
|
91
|
+
|
|
92
|
+
- Do *not* repeat content in higher-level docs if the details are in referenced
|
|
93
|
+
lower-level docs.
|
|
94
|
+
- For example, if `docs/design.md` is an overview of the design, do not repeat the
|
|
95
|
+
design in `README.md`; reference it instead.
|
|
96
|
+
|
|
97
|
+
5. **Describe the present state, not what it replaced**
|
|
98
|
+
|
|
99
|
+
- By default, write as if the current work or referenced system or design always
|
|
100
|
+
existed. Most readers need to understand what *is*, not what *was*; replacement
|
|
101
|
+
history pollutes their context with deprecated concepts they would otherwise never
|
|
102
|
+
have to learn. When version control like Git is used, its history is the
|
|
103
|
+
authoritative record of what was removed.
|
|
104
|
+
- Agents are especially prone to retaining history notations that are no longer
|
|
105
|
+
relevant ( “this design was changed because of X,” “this function was previously
|
|
106
|
+
named X”, “removed Z”). When in doubt, cut it.
|
|
107
|
+
- Exceptions are allowed when the document’s purpose *includes* history: migration
|
|
108
|
+
guides, postmortems, deprecation notices, decision records, changelogs,
|
|
109
|
+
governance/versioning sections in standards and schemas, and one-line pointers when
|
|
110
|
+
a future reader needs to find a predecessor (for example, “see commit `abc123` for
|
|
111
|
+
the prior shape”). The test is whether the history serves the reader’s task or
|
|
112
|
+
simply records the author’s path.
|
|
113
|
+
|
|
114
|
+
## Writing Style
|
|
115
|
+
|
|
116
|
+
Stylistically, emphasize **clarity**, **depth**, **rigor**, and **warmth**.
|
|
117
|
+
|
|
118
|
+
1. **Be clear and concise**
|
|
119
|
+
|
|
120
|
+
- Use direct and simple language.
|
|
121
|
+
- Eliminate unnecessary or extraneous words.
|
|
122
|
+
- Avoid obvious statements.
|
|
123
|
+
- Remove duplication where a document says the same thing in different places.
|
|
124
|
+
- If removing a sentence loses no information about the subject, cut it.
|
|
125
|
+
|
|
126
|
+
2. **Be detailed and specific**
|
|
127
|
+
|
|
128
|
+
- Use data or facts instead of generalizations or adjectives.
|
|
129
|
+
- Avoid vagueness or generalities.
|
|
130
|
+
- Use concrete examples.
|
|
131
|
+
- Cite sources whenever possible.
|
|
132
|
+
|
|
133
|
+
3. **Be rigorous and logical**
|
|
134
|
+
|
|
135
|
+
- Use structure, such as headings, subheadings, and lists, effectively.
|
|
136
|
+
- Keep structure logical and consistent.
|
|
137
|
+
- Make headings specific; cleave to the true contours of the subject matter.
|
|
138
|
+
|
|
139
|
+
4. **Be engaging and warm**
|
|
140
|
+
|
|
141
|
+
- Be friendly in tone, avoiding unnecessary formality unless required by the
|
|
142
|
+
situation (such as in legal documents).
|
|
143
|
+
- Be gracious in acknowledging previous work, even if correcting it.
|
|
144
|
+
- Avoid unnecessary coldness, blame, condescension, or opacity when writing for
|
|
145
|
+
humans. For agent-facing documents, the equivalent is directness, explicit context,
|
|
146
|
+
and absence of performative fluff.
|
|
147
|
+
`practical-prose-rubric.md` cites this as a Tone / Reader Respect contextual
|
|
148
|
+
modifier rather than a scored dimension.
|
|
149
|
+
|
|
150
|
+
## Effective Communication
|
|
151
|
+
|
|
152
|
+
1. **Respect the reader’s intelligence**
|
|
153
|
+
|
|
154
|
+
- Write for a reader that is *100% intelligent and 100% ignorant*. This respects the
|
|
155
|
+
reader yet provides enough context.
|
|
156
|
+
- Either explain concepts fully and from first principles or point them to where they
|
|
157
|
+
can learn the concept.
|
|
158
|
+
- Never dumb things down, be vague, or skip important technicalities or details.
|
|
159
|
+
|
|
160
|
+
2. **Calibrate confidence**
|
|
161
|
+
|
|
162
|
+
- Never make a confident statement without citations or reasoning that justify the
|
|
163
|
+
confidence.
|
|
164
|
+
- Judgments are allowed but must be calibrated, considering evidence for and against.
|
|
165
|
+
- Do *not* aim to be agreeable; aim to be accurate when certain and explicit about
|
|
166
|
+
uncertainties.
|
|
167
|
+
- Do *not* make sweeping claims or use extravagant language.
|
|
168
|
+
Avoid words like “incontrovertibly,” “emphatically,” “definitively,”
|
|
169
|
+
“unequivocally,” “massive,” “monumental,” “profound,” “transformational,”
|
|
170
|
+
“seismic,” “paradigm-shifting,” “will revolutionize,” “structurally outmaneuvered,”
|
|
171
|
+
“successfully executing,” or “crushing it.”
|
|
172
|
+
|
|
173
|
+
3. **Cut pompousness, meta-commentary, and unnecessary formality**
|
|
174
|
+
|
|
175
|
+
- Avoid “talking about talking,” such as narrating what a doc covers or instructing
|
|
176
|
+
readers on how to read a document.
|
|
177
|
+
Exception: standards, rubrics, runbooks, and other process documents may include
|
|
178
|
+
structural commentary (how dimensions map to rules, how to score, when to apply a
|
|
179
|
+
pass) when that commentary is what the document is *for*.
|
|
180
|
+
- Eliminate common but unnecessary phrases, such as “due to the fact” or “at this
|
|
181
|
+
point in time.” Avoid adverbs and general adjectives, such as “quickly respond” or
|
|
182
|
+
“very good.”
|
|
183
|
+
- Avoid pedantry, such as calling documents “canonical,” or giving justifications for
|
|
184
|
+
word choices. Jargon like “load-bearing” is acceptable when the audience uses it and
|
|
185
|
+
the term is genuinely descriptive (for example, a sentence-craft discussion citing
|
|
186
|
+
Gopen and Swan’s notion of *load-bearing constraints on sentence structure*); avoid
|
|
187
|
+
it as a filler intensifier in ordinary prose.
|
|
188
|
+
- Cut acronyms and jargon unless they serve a clear purpose.
|
|
189
|
+
- When technical terms or jargon are used, define them or reference their definition.
|
|
190
|
+
|
|
191
|
+
## Formatting
|
|
192
|
+
|
|
193
|
+
> Block quotes like this should be used for meta-instructions, quotes, and epigraphs.
|
|
194
|
+
|
|
195
|
+
- **Boldface:** Use boldface for defining **key words** or concepts.
|
|
196
|
+
- **Italics:** Use italics for *general emphasis*.
|
|
197
|
+
- **Itemized lists:** Use bulleted lists whenever it aids with clarity.
|
|
198
|
+
Do not include full stops on each item for short lists and sentence fragments.
|
|
199
|
+
For lists with multiple sentences on each bullet (like this one), consistently use
|
|
200
|
+
full stops on all items.
|
|
201
|
+
- **Inline headings:** Inline headings, where the heading is on the same line as a
|
|
202
|
+
paragraph of text, should be formatted like this, using a boldfaced colon.
|
|
203
|
+
Use this format consistently for inline headings within itemized lists.
|
|
204
|
+
- **Em dashes:** Use em dashes *only* when they are the best punctuation for the
|
|
205
|
+
sentence. Prefer full stops, commas, colons, or semicolons as appropriate.
|
|
206
|
+
When you do use em dashes—like this—follow American style, without spaces around the
|
|
207
|
+
em dash.
|
|
208
|
+
- **Conjunctions:** Write “and” rather than `+` or `&` in prose, list separators, and
|
|
209
|
+
cross-references. Reserve `+` and `&` for code, identifiers, and proper names where
|
|
210
|
+
they are part of the canonical form (for example, “Strunk & White”).
|
|
211
|
+
- **Section headings:** Use Title Case (Chicago Manual of Style rules) for H1 `#` and H2
|
|
212
|
+
`##` headings (as in this document).
|
|
213
|
+
For H3 `###` and H4 `####`, title case is optional but should be applied consistently.
|
|
214
|
+
|
|
215
|
+
### Auto-Formatting and Emojis
|
|
216
|
+
|
|
217
|
+
> These two conventions are tbd extensions not yet in upstream practical-prose; see the
|
|
218
|
+
> PR addendum proposing them upstream.
|
|
219
|
+
|
|
220
|
+
- **Auto-formatting:** Always use auto-formatting on every file type that supports it.
|
|
221
|
+
Defer to the language- or format-specific rules for exact style.
|
|
222
|
+
- **Emojis:** Do not use emojis gratuitously — only when they add clarity through a
|
|
223
|
+
consistent semantic vocabulary.
|
|
224
|
+
Use ✅ and ❌ for success and failure (or ✔︎ and ✘ if the codebase already uses them),
|
|
225
|
+
and ⚠️ and ‼️ for user-facing warnings and errors (or ∆ and ‼︎ to match an existing
|
|
226
|
+
codebase). You may use 📈 for reports and quantitative summaries, ⏰ for timings and
|
|
227
|
+
scheduling, and 🧪 for tests and experiments.
|
|
228
|
+
Apply whatever set you choose consistently.
|
|
229
|
+
Do not put emojis in code comments, where they add distraction without systematic
|
|
230
|
+
meaning.
|
|
231
|
+
|
|
232
|
+
<!-- This document follows common-doc-guidelines.md.
|
|
233
|
+
See github.com/jlevy/practical-prose and review guidelines before editing.
|
|
234
|
+
-->
|
|
@@ -2215,3 +2215,7 @@ constraints:
|
|
|
2215
2215
|
| **10-50 KB** | Separate document or file storage | Use detail tables for on-demand fetch |
|
|
2216
2216
|
| **50-900 KB** | **Must** use detail table or file storage | Approaching 1 MiB document limit |
|
|
2217
2217
|
| **>900 KB** | **Must** use file storage with compression | Brotli compression for HTML/text (3:1 ratio) |
|
|
2218
|
+
|
|
2219
|
+
<!-- This document follows common-doc-guidelines.md.
|
|
2220
|
+
See github.com/jlevy/practical-prose and review guidelines before editing.
|
|
2221
|
+
-->
|
|
@@ -941,3 +941,7 @@ const mockAgentId = '12345;agents' as Id<'agents'>; // OK - looks like real Con
|
|
|
941
941
|
entirely
|
|
942
942
|
|
|
943
943
|
3. **Test IDs should follow Convex format** - if test ids `'12345;tableName'` pattern
|
|
944
|
+
|
|
945
|
+
<!-- This document follows common-doc-guidelines.md.
|
|
946
|
+
See github.com/jlevy/practical-prose and review guidelines before editing.
|
|
947
|
+
-->
|
|
@@ -835,3 +835,7 @@ Avoid `unsafe-eval` and `unsafe-inline`.
|
|
|
835
835
|
|
|
836
836
|
- [Launchpad #1944468: Electron applications all crash upon launch](https://bugs.launchpad.net/bugs/1944468)
|
|
837
837
|
— Ubuntu-specific Electron issues
|
|
838
|
+
|
|
839
|
+
<!-- This document follows common-doc-guidelines.md.
|
|
840
|
+
See github.com/jlevy/practical-prose and review guidelines before editing.
|
|
841
|
+
-->
|
|
@@ -561,3 +561,7 @@ grep -rn -A2 "} catch {" --include="*.ts" | grep -B1 "throw new"
|
|
|
561
561
|
**Problematic patterns**:
|
|
562
562
|
- `throw new CLIError('Failed to do X')` - Loses WHY it failed
|
|
563
563
|
- `throw new Error('Operation failed')` - Generic message hides root cause
|
|
564
|
+
|
|
565
|
+
<!-- This document follows common-doc-guidelines.md.
|
|
566
|
+
See github.com/jlevy/practical-prose and review guidelines before editing.
|
|
567
|
+
-->
|
|
@@ -35,3 +35,7 @@ author: Joshua Levy (github.com/jlevy) with LLM assistance
|
|
|
35
35
|
// Usage:
|
|
36
36
|
const tradeCount = Math.min(trades.length, EXECUTION_STATS_LIMITS.maxTradeCount);
|
|
37
37
|
```
|
|
38
|
+
|
|
39
|
+
<!-- This document follows common-doc-guidelines.md.
|
|
40
|
+
See github.com/jlevy/practical-prose and review guidelines before editing.
|
|
41
|
+
-->
|
|
@@ -94,3 +94,7 @@ These are language-agnostic rules on comments:
|
|
|
94
94
|
and at the top of files.
|
|
95
95
|
|
|
96
96
|
- See language-specific comment rules for more details.
|
|
97
|
+
|
|
98
|
+
<!-- This document follows common-doc-guidelines.md.
|
|
99
|
+
See github.com/jlevy/practical-prose and review guidelines before editing.
|
|
100
|
+
-->
|
|
@@ -53,3 +53,7 @@ Therefore:
|
|
|
53
53
|
That is useless generalization.
|
|
54
54
|
Instead, specifically say what you’ve done, e.g., “I’ve added types, including
|
|
55
55
|
generics, to all the methods in `Foo` and fixed all linter errors.”
|
|
56
|
+
|
|
57
|
+
<!-- This document follows common-doc-guidelines.md.
|
|
58
|
+
See github.com/jlevy/practical-prose and review guidelines before editing.
|
|
59
|
+
-->
|
|
@@ -145,3 +145,7 @@ Tests in the project are broken down into three types:
|
|
|
145
145
|
Are not run on every commit as they can have costs or side effects or be slow.
|
|
146
146
|
Requires all API keys.
|
|
147
147
|
File names end with e2e.test.ts
|
|
148
|
+
|
|
149
|
+
<!-- This document follows common-doc-guidelines.md.
|
|
150
|
+
See github.com/jlevy/practical-prose and review guidelines before editing.
|
|
151
|
+
-->
|
|
@@ -25,3 +25,7 @@ author: Joshua Levy (github.com/jlevy) with LLM assistance
|
|
|
25
25
|
|
|
26
26
|
- Test edge cases and boundaries: Include tests for empty inputs, nulls, maximums,
|
|
27
27
|
minimums, and error conditions—not just happy paths.
|
|
28
|
+
|
|
29
|
+
<!-- This document follows common-doc-guidelines.md.
|
|
30
|
+
See github.com/jlevy/practical-prose and review guidelines before editing.
|
|
31
|
+
-->
|
|
@@ -812,3 +812,7 @@ Golden session testing works well alongside other testing strategies:
|
|
|
812
812
|
- ScalaTest Matchers: https://www.scalatest.org/user_guide/using_matchers
|
|
813
813
|
|
|
814
814
|
- Concordion (Java): https://concordion.org/
|
|
815
|
+
|
|
816
|
+
<!-- This document follows common-doc-guidelines.md.
|
|
817
|
+
See github.com/jlevy/practical-prose and review guidelines before editing.
|
|
818
|
+
-->
|
|
@@ -90,9 +90,10 @@ The architecture prioritizes fast iteration during early development while maint
|
|
|
90
90
|
clear path to split packages later without breaking changes.
|
|
91
91
|
|
|
92
92
|
The recommended stack uses **pnpm workspaces** for dependency management, **tsdown** for
|
|
93
|
-
building ESM/CJS dual outputs with TypeScript declarations, **Changesets**
|
|
94
|
-
|
|
95
|
-
and **
|
|
93
|
+
building ESM/CJS dual outputs with TypeScript declarations, **Changesets**
|
|
94
|
+
(multi-package monorepos) or **tag-triggered OIDC publishing** (single-package repos)
|
|
95
|
+
for versioning and release automation, **publint** for validating package
|
|
96
|
+
publishability, and **lefthook** for fast local git hooks.
|
|
96
97
|
This approach supports private development via GitHub Packages or direct GitHub
|
|
97
98
|
installs, with a seamless transition to public npm publishing when ready.
|
|
98
99
|
|
|
@@ -671,7 +672,8 @@ package. Essential for any published package.
|
|
|
671
672
|
|
|
672
673
|
#### Changesets
|
|
673
674
|
|
|
674
|
-
**Status**:
|
|
675
|
+
**Status**: Recommended for multi-package monorepos (for a single published package,
|
|
676
|
+
prefer the tag-triggered approach below)
|
|
675
677
|
|
|
676
678
|
**Details**:
|
|
677
679
|
|
|
@@ -729,8 +731,10 @@ Changesets provides:
|
|
|
729
731
|
|
|
730
732
|
- Publishes to npm when that PR is merged
|
|
731
733
|
|
|
732
|
-
**Assessment**: Changesets is the de facto standard for monorepo
|
|
733
|
-
|
|
734
|
+
**Assessment**: Changesets is the de facto standard for *multi-package* monorepo
|
|
735
|
+
versioning and integrates seamlessly with pnpm and GitHub Actions.
|
|
736
|
+
For a repo that publishes a single package, its per-PR ceremony rarely pays off — prefer
|
|
737
|
+
the tag-triggered approach below (see the LLM-era note).
|
|
734
738
|
|
|
735
739
|
**References**:
|
|
736
740
|
|
|
@@ -759,6 +763,19 @@ No NPM_TOKEN needed, no “Version Packages” PR workflow.
|
|
|
759
763
|
3. Commit, tag (e.g., `v1.2.3`), and push
|
|
760
764
|
4. GitHub Action publishes automatically on tag push
|
|
761
765
|
|
|
766
|
+
> **When to prefer this over Changesets (LLM-era note):** For a **single published
|
|
767
|
+
> package**, Changesets’ main wins (multi-package coordination and per-PR changelog
|
|
768
|
+
> accumulation) mostly evaporate, while its ceremony (a `.changeset/*.md` per PR, a
|
|
769
|
+
> bump-type decision per PR, the `changeset version` step, a “Version Packages” PR)
|
|
770
|
+
> stays. When releases are cut by an agent/maintainer who assembles notes from clean
|
|
771
|
+
> conventional commits at release time (see a release-notes template), tag-triggered
|
|
772
|
+
> publishing is simpler and has fewer moving parts: clean commits → bump + `## X.Y.Z`
|
|
773
|
+
> CHANGELOG section → tag → auto-publish.
|
|
774
|
+
> `tbd` itself uses this approach (project-local `docs/publishing.md` for the per-repo
|
|
775
|
+
> playbook; the workflow itself is the GitHub Action triggered by the `v*` tag).
|
|
776
|
+
> Keep Changesets when you publish several interdependent packages or want contributors
|
|
777
|
+
> to declare intent in each PR.
|
|
778
|
+
|
|
762
779
|
**One-time setup**:
|
|
763
780
|
|
|
764
781
|
1. Publish package manually once: `npm publish --access public`
|
|
@@ -3554,3 +3571,7 @@ ncu --dep dev --format group
|
|
|
3554
3571
|
# Upgrade with peer dependency handling
|
|
3555
3572
|
ncu --target minor -u && pnpm install --force
|
|
3556
3573
|
```
|
|
3574
|
+
|
|
3575
|
+
<!-- This document follows common-doc-guidelines.md.
|
|
3576
|
+
See github.com/jlevy/practical-prose and review guidelines before editing.
|
|
3577
|
+
-->
|
|
@@ -83,3 +83,7 @@ Use `uv-dynamic-versioning` for git-based versions:
|
|
|
83
83
|
4. Separate handlers from command definitions for testability
|
|
84
84
|
5. Use TypedDict or dataclasses for type-safe options
|
|
85
85
|
6. Test with Typer’s CliRunner for isolated, fast tests
|
|
86
|
+
|
|
87
|
+
<!-- This document follows common-doc-guidelines.md.
|
|
88
|
+
See github.com/jlevy/practical-prose and review guidelines before editing.
|
|
89
|
+
-->
|
|
@@ -182,3 +182,33 @@ class MyThing:
|
|
|
182
182
|
str(MyThing(file_path="/tmp/file.txt", title="Something " + "blah " * 50, url="https://www.example.com", body="..."))
|
|
183
183
|
# -> "MyThing(title='Something blah blah blah blah blah blah blah blah blah blah blah…', file_path=/tmp/file.txt, url=https://www.example.com)"
|
|
184
184
|
```
|
|
185
|
+
|
|
186
|
+
## Releasing (tag-triggered, no changesets)
|
|
187
|
+
|
|
188
|
+
For publishing Python packages to PyPI, follow the
|
|
189
|
+
[`simple-modern-uv`](https://github.com/jlevy/simple-modern-uv) template’s model — it is
|
|
190
|
+
the standard for tbd’s Python projects.
|
|
191
|
+
The same clean principles as the TypeScript guidance apply: no changesets, releases cut
|
|
192
|
+
from clean conventional commits.
|
|
193
|
+
|
|
194
|
+
- **Dynamic versioning from the git tag** via
|
|
195
|
+
[`uv-dynamic-versioning`](https://github.com/ninoseki/uv-dynamic-versioning) — the tag
|
|
196
|
+
*is* the version (no manual `version =` bump in `pyproject.toml`, no version commit).
|
|
197
|
+
- **Release/tag-triggered publish**: a `publish.yml` workflow runs on
|
|
198
|
+
`on: release: types: [published]` (or a `v*` tag), builds with `uv build`, and
|
|
199
|
+
publishes with `uv publish --trusted-publishing always` — **PyPI Trusted Publishing
|
|
200
|
+
(OIDC), no API token**.
|
|
201
|
+
- **Supply-chain cool-off in CI**: set `UV_EXCLUDE_NEWER` to a 14-days-ago cutoff so the
|
|
202
|
+
build never resolves a brand-new (potentially yanked/compromised) release.
|
|
203
|
+
- **Release notes** are written per `release-notes-guidelines` from the commits since
|
|
204
|
+
the last tag — there is no per-PR changeset file.
|
|
205
|
+
- Expose the version at runtime with `importlib.metadata.version("<pkg>")`.
|
|
206
|
+
|
|
207
|
+
So a release is just: clean commits → create the GitHub release/tag `vX.Y.Z` → CI builds
|
|
208
|
+
and publishes.
|
|
209
|
+
See `template/docs/publishing.md` in `simple-modern-uv` for the first-time
|
|
210
|
+
Trusted Publisher setup.
|
|
211
|
+
|
|
212
|
+
<!-- This document follows common-doc-guidelines.md.
|
|
213
|
+
See github.com/jlevy/practical-prose and review guidelines before editing.
|
|
214
|
+
-->
|
|
@@ -258,3 +258,7 @@ These are general rules that *must* be followed on this project for Python code.
|
|
|
258
258
|
- Exported/public variables, functions, or methods SHOULD have concise docstrings.
|
|
259
259
|
Internal/local variables, functions, and methods DO NOT need docstrings unless their
|
|
260
260
|
purpose is not obvious.
|
|
261
|
+
|
|
262
|
+
<!-- This document follows common-doc-guidelines.md.
|
|
263
|
+
See github.com/jlevy/practical-prose and review guidelines before editing.
|
|
264
|
+
-->
|
|
@@ -138,3 +138,7 @@ Before finalizing release notes:
|
|
|
138
138
|
|
|
139
139
|
**Full commit history**: https://github.com/org/repo/compare/v0.1.12...v0.1.13
|
|
140
140
|
```
|
|
141
|
+
|
|
142
|
+
<!-- This document follows common-doc-guidelines.md.
|
|
143
|
+
See github.com/jlevy/practical-prose and review guidelines before editing.
|
|
144
|
+
-->
|
|
@@ -52,7 +52,7 @@ planned upgrade.
|
|
|
52
52
|
| pnpm 11+ | `minimumReleaseAge: 20160` in `pnpm-workspace.yaml` (pnpm 11 ignores `NPM_CONFIG_*`; env prefix is `PNPM_CONFIG_*`) |
|
|
53
53
|
| uv | `UV_EXCLUDE_NEWER="14 days"` |
|
|
54
54
|
| pip 26.1+ | `PIP_UPLOADED_PRIOR_TO="P14D"` |
|
|
55
|
-
| Cargo / Go | no native gate: commit the lockfile, pass `--locked` (Cargo) / keep `go.sum`
|
|
55
|
+
| Cargo / Go | no native gate: commit the lockfile, pass `--locked` (Cargo) / keep `go.sum` and `-mod=readonly` (Go), and require human review before re-resolving; gate automated bumps with Renovate/Dependabot release-age policy |
|
|
56
56
|
|
|
57
57
|
At upgrade-decision time, `npm-check-updates --cooldown 14` (pin the `ncu` version)
|
|
58
58
|
gates which upgrades are even offered.
|
|
@@ -75,8 +75,8 @@ To check one version’s age: `npm view <pkg> time.<ver>`.
|
|
|
75
75
|
5. **Don’t update for its own sake.** The safest update is the one you skip — each bump
|
|
76
76
|
is fresh attack surface.
|
|
77
77
|
Bump only for a concrete reason ("show me the commit we need"); prefer fewer,
|
|
78
|
-
vendored/pinned dependencies; let audits
|
|
79
|
-
is warranted.
|
|
78
|
+
vendored/pinned dependencies; let audits and CVE monitoring tell you when a real
|
|
79
|
+
update is warranted.
|
|
80
80
|
6. **No unpinned zero-install runners.** Avoid `npx` / `pnpm dlx` / `bunx` / `uvx` /
|
|
81
81
|
`go run <remote>` without an explicit `@version` pin and a review of the resolved
|
|
82
82
|
`package@version` — they fetch and execute the latest code, bypassing the cool-off.
|
|
@@ -208,10 +208,10 @@ Reviewed <date>.`
|
|
|
208
208
|
|
|
209
209
|
## What This Does and Doesn’t Cover
|
|
210
210
|
|
|
211
|
-
A cool-off
|
|
212
|
-
It does **not** stop: long-lived typosquats that survive past the window; a
|
|
213
|
-
that already captured a bad version; payloads that fire on import/build rather
|
|
214
|
-
install; or **publish-pipeline compromises** (the May 2026 @antv worm shipped from
|
|
211
|
+
A cool-off plus disabled scripts neutralizes the dominant **fast-yanked-incident**
|
|
212
|
+
pattern. It does **not** stop: long-lived typosquats that survive past the window; a
|
|
213
|
+
lockfile that already captured a bad version; payloads that fire on import/build rather
|
|
214
|
+
than install; or **publish-pipeline compromises** (the May 2026 @antv worm shipped from
|
|
215
215
|
legitimate CI with a forged “verified” provenance badge — a green badge is not proof).
|
|
216
216
|
Those need lockfile review, typosquat checks, build-time controls, and — if you publish
|
|
217
217
|
packages — the publish-side controls in the guidebook’s `hardening-ci-cd.md` (OIDC
|
|
@@ -235,3 +235,7 @@ provenance monitoring).
|
|
|
235
235
|
StepSecurity, Socket, Unit 42).
|
|
236
236
|
- Monorepo enforcement: `tbd guidelines pnpm-monorepo-patterns`,
|
|
237
237
|
`tbd guidelines bun-monorepo-patterns`.
|
|
238
|
+
|
|
239
|
+
<!-- This document follows common-doc-guidelines.md.
|
|
240
|
+
See github.com/jlevy/practical-prose and review guidelines before editing.
|
|
241
|
+
-->
|
|
@@ -163,7 +163,8 @@ The `.tbd/.gitignore` file contains a `!workspaces/` negation pattern to prevent
|
|
|
163
163
|
- Conflicting changes at field level
|
|
164
164
|
|
|
165
165
|
**Solutions:**
|
|
166
|
-
1. Check attic for conflict details:
|
|
166
|
+
1. Check attic for conflict details:
|
|
167
|
+
`ls "$(git rev-parse --path-format=absolute --git-common-dir)/tbd/data-sync-worktree/.tbd/data-sync/attic/"`
|
|
167
168
|
2. Review conflict files to understand what was lost
|
|
168
169
|
3. Manually merge if needed
|
|
169
170
|
4. Re-import with fresh workspace if appropriate
|
|
@@ -195,7 +196,7 @@ The `.tbd/.gitignore` file contains a `!workspaces/` negation pattern to prevent
|
|
|
195
196
|
1. Run `tbd doctor --fix` to auto-repair
|
|
196
197
|
2. If that fails, manually repair:
|
|
197
198
|
```bash
|
|
198
|
-
rm -rf
|
|
199
|
+
rm -rf "$(git rev-parse --path-format=absolute --git-common-dir)/tbd/data-sync-worktree"
|
|
199
200
|
git worktree prune
|
|
200
201
|
tbd doctor --fix
|
|
201
202
|
```
|
|
@@ -204,7 +205,8 @@ The `.tbd/.gitignore` file contains a `!workspaces/` negation pattern to prevent
|
|
|
204
205
|
### Worktree shows “detached HEAD”
|
|
205
206
|
|
|
206
207
|
**Symptoms:**
|
|
207
|
-
- `git -C
|
|
208
|
+
- `git -C "$(git rev-parse --path-format=absolute --git-common-dir)/tbd/data-sync-worktree" status`
|
|
209
|
+
shows detached HEAD
|
|
208
210
|
- Commits not going to tbd-sync branch
|
|
209
211
|
|
|
210
212
|
**Solutions:**
|
|
@@ -224,7 +226,7 @@ tbd sync --status
|
|
|
224
226
|
tbd workspace list
|
|
225
227
|
|
|
226
228
|
# View worktree branch
|
|
227
|
-
git -C
|
|
229
|
+
git -C "$(git rev-parse --path-format=absolute --git-common-dir)/tbd/data-sync-worktree" branch
|
|
228
230
|
|
|
229
231
|
# Compare local vs remote
|
|
230
232
|
git log tbd-sync --oneline -5
|
|
@@ -258,3 +260,7 @@ tbd sync
|
|
|
258
260
|
- `--no-outbox`: Skip automatic import from outbox on success
|
|
259
261
|
|
|
260
262
|
See `tbd shortcut sync-failure-recovery` for the full workflow.
|
|
263
|
+
|
|
264
|
+
<!-- This document follows common-doc-guidelines.md.
|
|
265
|
+
See github.com/jlevy/practical-prose and review guidelines before editing.
|
|
266
|
+
-->
|
|
@@ -7,17 +7,17 @@ author: Joshua Levy (github.com/jlevy) with LLM assistance
|
|
|
7
7
|
|
|
8
8
|
**Last Updated**: 2026-05-21
|
|
9
9
|
|
|
10
|
-
**Tracks**: Commander.js `^15.0.0` (ESM-only, requires Node v22.12.0+),
|
|
11
|
-
|
|
10
|
+
**Tracks**: Commander.js `^15.0.0` (ESM-only, requires Node v22.12.0+), picocolors
|
|
11
|
+
`^1.1.1` (stable; no recent changes), Node.js 24 LTS / Node 26 Current.
|
|
12
12
|
Commander 14 moves to security-only maintenance until May 2027.
|
|
13
13
|
|
|
14
14
|
**Related**:
|
|
15
15
|
|
|
16
16
|
- [TypeScript Rules](./typescript-rules.md)
|
|
17
17
|
- [Supply-Chain Mitigation](./pnpm-monorepo-patterns.md#supply-chain-mitigation) —
|
|
18
|
-
follow the 14-day package-age rule for every CLI dependency.
|
|
19
|
-
CLI dependencies that execute at install time (`postinstall` scripts) are
|
|
20
|
-
primary attack surface.
|
|
18
|
+
follow the 14-day package-age rule for every CLI dependency.
|
|
19
|
+
Bundlers and CLI dependencies that execute at install time (`postinstall` scripts) are
|
|
20
|
+
a primary attack surface.
|
|
21
21
|
|
|
22
22
|
These rules apply to all CLI tools, command-line scripts, and terminal utilities.
|
|
23
23
|
Examples may be inspired by modern TypeScript repos, but guidance here is intentionally
|
|
@@ -107,9 +107,9 @@ generic and reusable across projects.
|
|
|
107
107
|
## Commander.js Patterns
|
|
108
108
|
|
|
109
109
|
- **Use Commander.js for all CLI tools:** Import from `commander` and follow established
|
|
110
|
-
patterns for command registration and option handling.
|
|
111
|
-
(ESM-only, requires Node v22.12.0+).** Commander 14 is
|
|
112
|
-
only until May 2027; do not start new projects on it.
|
|
110
|
+
patterns for command registration and option handling.
|
|
111
|
+
**Target Commander 15+ (ESM-only, requires Node v22.12.0+).** Commander 14 is
|
|
112
|
+
security-maintenance only until May 2027; do not start new projects on it.
|
|
113
113
|
|
|
114
114
|
- **Apply colored help globally, not per-command:** Use Commander v14+ `configureHelp()`
|
|
115
115
|
with style functions, applied recursively to all commands at program initialization.
|
|
@@ -565,30 +565,29 @@ When supporting environment variables, especially those used by SDK libraries (l
|
|
|
565
565
|
`OPENAI_API_KEY`, `ANTHROPIC_API_KEY`, etc.), also support `.env` loading so CLIs work
|
|
566
566
|
seamlessly in local dev and in remote environments.
|
|
567
567
|
|
|
568
|
-
- **Prefer Node.js native `--env-file` for Node ≥20.6**: Production-ready on
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
568
|
+
- **Prefer Node.js native `--env-file` for Node ≥20.6**: Production-ready on Node 24
|
|
569
|
+
LTS. Pass `--env-file=.env.local --env-file=.env` on the CLI invocation; later files
|
|
570
|
+
do not override earlier ones, so list higher-priority first.
|
|
571
|
+
No dependency required:
|
|
572
572
|
|
|
573
573
|
```bash
|
|
574
574
|
node --env-file=.env.local --env-file=.env ./dist/bin.js
|
|
575
575
|
```
|
|
576
576
|
|
|
577
|
-
Make this the default for new projects.
|
|
578
|
-
(variable expansion, multiline values, custom
|
|
579
|
-
conditional loading from inside the CLI).
|
|
577
|
+
Make this the default for new projects.
|
|
578
|
+
Reserve `dotenv` for advanced needs (variable expansion, multiline values, custom
|
|
579
|
+
precedence logic, or runtime conditional loading from inside the CLI).
|
|
580
580
|
|
|
581
|
-
- **Use `dotenv` only when needed:** Add `dotenv` only if your CLI must load
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
581
|
+
- **Use `dotenv` only when needed:** Add `dotenv` only if your CLI must load env files
|
|
582
|
+
programmatically — e.g., it reads them after parsing command-line flags, performs
|
|
583
|
+
variable expansion, or supports custom file paths the user cannot pre-bake into the
|
|
584
|
+
`node` invocation.
|
|
585
585
|
|
|
586
|
-
- **Load `.env.local` and `.env` automatically (recommended):** Whichever
|
|
587
|
-
|
|
588
|
-
|
|
586
|
+
- **Load `.env.local` and `.env` automatically (recommended):** Whichever mechanism you
|
|
587
|
+
use, support both `.env.local` (higher priority, gitignored) and `.env` (lower
|
|
588
|
+
priority, committed defaults only).
|
|
589
589
|
|
|
590
|
-
- **Manual `dotenv` loading:** When you do need `dotenv`, load with explicit
|
|
591
|
-
precedence:
|
|
590
|
+
- **Manual `dotenv` loading:** When you do need `dotenv`, load with explicit precedence:
|
|
592
591
|
|
|
593
592
|
```ts
|
|
594
593
|
import dotenv from 'dotenv';
|
|
@@ -739,3 +738,7 @@ runtimes, Cloudflare Workers, etc.).
|
|
|
739
738
|
|
|
740
739
|
- **Make scripts composable:** Design scripts to work well in pipelines and automation.
|
|
741
740
|
Consider how they’ll be used in CI/CD and shell scripts.
|
|
741
|
+
|
|
742
|
+
<!-- This document follows common-doc-guidelines.md.
|
|
743
|
+
See github.com/jlevy/practical-prose and review guidelines before editing.
|
|
744
|
+
-->
|