Repository navigation
fix(views): list repeating project templates, hide them from things projects - #170
Merged
Merged
Conversation
…rojects A project repeats the same way a to-do does: a template row carrying the recurrence rule, plus the projects it generates. The repeating view added in #147 pinned t.type = 0, so a project template appeared nowhere, while ListProjects had no template exclusion and listed it in `things projects` as an ordinary project. The repeating view is now the one view not pinned to t.type = 0 — it takes types 0 and 1, matching the app's Repeating list, which shows both kinds — and ListProjects excludes rows carrying a recurrence rule. Headings cannot reach the view: they carry no rule, and type 2 is outside the set. Ordering the view by type before index keeps to-dos and projects in contiguous blocks rather than interleaving them by an index that is only meaningful within a kind. Plain output marks a project row "(project)" and the detail view prints a "Type: project" line, so a project template is not left reading as a to-do. Both are text rather than colour, so they survive --color never and a pipe. This also covers `things search`, which could already return an unmarked project. The docs gain the project-template behaviour, correct the claim that trash and logbook can hold a template of either kind (both are to-do lists), and say plainly that search is a lookup rather than a view: it returns templates like anything else, carrying "repeating": true so a caller can tell. Closes #165
This was referenced Sep 5, 2026
ryanlewis
added a commit
that referenced
this pull request
Sep 5, 2026
## What changed A repeating project is a template row carrying the recurrence rule plus the projects it generates. The template's own child to-dos carry no rule — only their project does — so the template exclusion added in #147 could not see them, and they listed as ordinary tasks against a project `things projects` no longer reports. The guard tests the resolved parent through the existing `p` join. That needs a recurrence reference for an alias other than `t`, so `probeRepeating` now caches the bare column name and a small `recurrenceRef(alias, column)` builds the reference from it — `recurrenceColFor` can serve any alias, and `probeRepeating` can still build its own without re-entering the `sync.Once`. The `repeatSQL` field goes away; there is now one place that knows how the reference is spelled. It runs for the same views that exclude templates, so `trash` and `logbook` keep reporting what the database holds. Because `p` resolves through `COALESCE(t.project, h.project)`, a to-do nested under a heading in a template project is covered too. ## Verification status — please read before merging **This is not verified against a real repeating project.** This machine's Things database has none, so the tests assert the modelled row layout rather than an observed one. What *is* observed, from the checkpointed daily backups of the real database: for repeating **to-dos**, Things keeps the rule-bearing row as a blueprint (2 rows with `rt1_recurrenceRule`, `rt1_repeatingTemplate` NULL, `start = 2`, `instanceCreationPaused = 1`) and generates **separate** instance rows (17 rows with `rt1_repeatingTemplate` set and no rule of their own). The blueprint is the row the app files under Repeating; the instances are what appear in Today. This guard assumes projects follow the same shape, which is the same `rt1_*` column family and the same mechanism. The residual risk is that projects diverge from to-dos — that Things regenerates children in place under the row holding the rule. If that were so, this would hide every live to-do of every repeating project. I judge that unlikely given the above, but it is the thing to weigh, and it is why this says so here rather than in a comment. ## How tested - `make test` (race) and `make lint` — both green. - `TestTemplateProjectChildrenExcludedFromOpenViews` is table-driven across all seven views the guard applies to (`inbox`, `today`, `upcoming`, `anytime`, `someday`, `deadlines`, `project`). Each case seeds a child of a template project *and* a sibling in an ordinary project, so the assertion proves the guard discriminates rather than hiding everything. - `TestTemplateProjectChildrenExcludedThroughHeading` covers the heading-nested path; `TestTrashAndLogbookKeepTemplateProjectChildren` pins the two opt-out views; `TestRecurrenceColForAlias` covers the helper for a non-`t` alias and the no-column fallback. - I confirmed every exclusion case fails without the guard. - Against a read-only copy of the real database, every view count is byte-identical to before the change — there are no repeating projects there, which is what a guard that cannot over-hide should do. ## Also here `internal/skill/SKILL.md` had a sentence duplicated on main (my edit and a review fix collided in #170); removed. Closes #171
ryanlewis
added a commit
that referenced
this pull request
Sep 5, 2026
…st (#176) Tidy of the bundled agent skill before v0.7.0. Six PRs edited `internal/skill/SKILL.md` piecemeal since v0.6.0 (#150, #151/#166, #157/#168, #160, #169, #170/#173, #172) and it had drifted into a pile of overlapping notes. ## Audited against the CLI Built the binary and checked every command and flag the skill mentions against `./things --help` and each subcommand's `--help`, in both directions. Both now come back clean: no flag in the help is missing from the skill, and no flag named in the skill is absent from the CLI. ## What moved Reordered so the first screen is what an agent needs before it acts: | Before | After | | --- | --- | | Safety → Output → Config → Commands → Repeating → Confirming → Tags → `--agent` → Refs → Values → Flows → Completions → Tips | Safety → **Referring to an item** → Output and `--json` → **Writes: what Things refuses or drops** (4 numbered rules) → Config → Command reference → `--agent` → Values → Flows → Completions | "Referring to an item" moved up from near the bottom — how refs and UUIDs work is prerequisite to almost everything else, and the index-cache trap (any `list` or `search` overwrites it, *including one the agent runs itself*) was buried. The four scattered write-refusal topics are now one section of numbered rules that the rest of the document cross-references by number instead of restating. ## What was cut - **Tips** — every bullet restated an earlier section. Kept its one unique line, about when to reach for `open`. - `--yes` and the project confirmation were stated in **four** places, `--json` in **three**, repeating behaviour in **four**. Each is now in one place. - Comments in the command block that only restated `--help`. Net **14% shorter** (19,107 → ~16,500 chars) while covering more surface. ## What was stale or missing - `open` was listed as a write that "modifies the user's real data". It reveals an item in the app and pulls focus; it writes nothing. - **Absent entirely**: the `skill` subcommands (`list`/`show`/`install`/`uninstall`), `version`, `--db`, `--config`, `$THINGS_CLI_CONFIG`, `--no-hints`. - `--when ""` / `--deadline ""` clear a value on `edit`/`project edit` (and only there) — undocumented. - `tag add` prints its result on success, so the blanket "write commands print nothing" was wrong for it; it is also covered by the `--no-verify` read-back, which rule 1 did not mention. - "Things3 must be running" applied only to `--create-tags`, but `tag add` uses the same AppleScript path. ## One code change `internal/output/agent.go` — a self-contradiction in the `--agent` brief for a **repeating project**, from my #172: `closingOut` guarded the to-do branch on `!t.Repeating` but not the project branch, so the brief offered `things complete <uuid> --yes` / `cancel --yes` directly above a note saying there were none — commands `checkRepeating` refuses anyway. Guarded both branches, with a regression test (`TestPrintAgentBriefRepeatingProject`; there was no test for a repeating project brief). This is outside a docs-only brief, and I flagged it rather than slipping it in: it is here because the skill now documents the corrected behaviour, so doc and code had to move together. The alternative was to document the bug as if it were intended. Happy to split it out if preferred. ## How tested `make test` (`go test -race ./...`) and `make lint` (0 issues) pass; `gofmt` clean. `internal/skill/skill_test.go` asserts the frontmatter and a set of command references, all still present. Verified the rendered install output via `things skill show claude`. README's Agent skill section was checked and needs no change — its subcommand table, flag table and the three default install paths all match `internal/skill/{claude,codex,pi}.go`.
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.
What changed
A project repeats the same way a to-do does: a template row carrying the recurrence rule, plus the projects it generates. The
repeatingview added in #147 pinnedt.type = 0, so a project template appeared nowhere at all, whileListProjectshad no template exclusion and listed it inthings projectsas an ordinary project.repeatingis now the one view not pinned tot.type = 0— it takes types 0 and 1, matching the app's Repeating list, which shows both kinds. Headings cannot reach it: they carry no recurrence rule, and type 2 is outside the set (there is a test for this, since dropping the type pin removes the guard that used to be implicit).ListProjectsexcludes rows carrying a recurrence rule, through the same probed column reference the views use, so a schema without that column degrades to a no-op.Marking projects in output
Plain output marks a project row
(project), and the detail view prints aType: projectline, so a project template is not left reading as a to-do. Both are text rather than colour, so they survive--color neverand a pipe. JSON already carried"type": 1. This also coversthings search, which could already return an unmarked project. To-do output is unchanged in both cases.Search
things searchdeliberately stays a raw lookup: it searches the database as it stands and returns templates like anything else, so a title visible in the Things app is always findable. Results carry"repeating": trueandthings showprints aRepeats:line, so a template is identifiable when one comes back. The docs said templates were kept out of every view but search; that wording is now fixed rather than the behaviour.How tested
make test(race) andmake lint— both green.repeatingordered after to-do templates and carryType/Repeating; headings stay out;ListProjectsexcludes templates with and without--completedand leaves ordinary projects untouched;ListProjectsstill works on a schema with no recurrence column; and the two output markers, each asserting to-do output is unchanged.Left out
The to-dos inside a template project have no guard: they carry no recurrence rule themselves, so they still list in
anytime/someday/upcomingwith aprojectTitlepointing at a projectthings projectsno longer reports. Same class as #147 and #155. I have not fixed it here because I cannot confirm the row layout — this machine's database has no repeating projects — and a wrong guard would hide real to-dos. It also needs an alias-parameterised recurrence helper, since the current one only emits thetalias. Worth its own issue, checked against a database that actually has a repeating project.Closes #165