Skip to content

sync ideas

Terminal window
holocron sync ideas [--dry-run] [--yes]

An idea starts as a note in a folder of Markdown files (an Obsidian vault). sync ideas is the step that turns an idea into an issue: it reads the ideas through the repo’s ideas provider, creates an issue through its issues provider for each one that is ready, and records the issue on the idea, so it is never filed twice. The command knows nothing about Obsidian: where the ideas are kept is the provider’s, so a second place to keep them is a provider entry and a plugin, not a change here. The design is SPEC-0072.

The provider says where the ideas are, and an ideas block holds the workflow setting:

providers: {
ideas: ["obsidian", { vault: "holocron" }],
},
ideas: { states: { file: "in-progress" } },
Key Default Meaning
providers.ideas none The ideas provider and its options. For Obsidian, vault names a vault in iCloud Drive and dir is a folder of notes; a leading ~ is the home folder.
ideas.states.file in-progress The status: that means “file this idea”. Another repo can use its own word for the state.
ideas.dir none Deprecated: read as providers.ideas: ["obsidian", { dir }] when providers.ideas is absent.

The Obsidian provider’s vault is the folder ~/Library/Mobile Documents/iCloud~md~obsidian/Documents/<vault>. HOLOCRON_IDEAS_DIR overrides its dir, and dir overrides vault, because the path differs per machine (see environment variables). A config with only the older ideas.dir keeps working, and providers.ideas wins when both are set. The ideas capability is optional: a repo with no providers.ideas, no ideas.dir and no variable is unaffected, and the command reports that it has nowhere to read from. A wrong shape is a ConfigError that names the path, such as ideas.states.file.

The Obsidian provider reads every .md file under dir, except in folders whose name starts with _ or . (_templates, .obsidian, .trash, _archive). A note is filed when its status: property equals the filing state and it has no issue: property (or an empty one).

  • Title is the first # heading, else the file name without .md, written as a Conventional Commits title, type(scope): text. The type and scope come from the note’s optional type: and scope: properties; the type defaults to feat and there is no scope by default. A heading that already starts with a conventional prefix (feat:, fix(cli):, …) is left as it is. The types are feat, fix, docs, style, refactor, perf, test, build, ci, chore and revert: a note with another type: (or a scope: that is not letters, digits, ., _, / and -) gets a failing row that names them, and nothing is filed or written for it.
  • Body is the note’s text without its frontmatter, then a footer: a rule, then a line that says the idea came from Obsidian and names the vault, the note’s path relative to dir and the day it was filed (for example the vault, then the note, then the date, in that order), never a folder’s own path. The vault is the vault option, else the name of the nearest folder at or above dir that holds an .obsidian folder; the line leaves it out when neither is known. A blank line and Filed from idea: <title> follow. With no note left to hold issue:, that line is how an issue is traced to its idea. A last line, an HTML comment holding the idea’s key (for Obsidian, the note path relative to dir), is a hidden marker that ties the issue to its note.
  • issue: is then added to the note’s frontmatter in the tracker’s own syntax (#1234 for GitHub, ENG-42 for Linear). Everything else in the file, including line endings, is left as it was.
  • Embedded files (![[photo.png]], ![](assets/a.png)) cannot go into an issue body, so a note that has one is reported and skipped. An image with a web address is plain text and does not count.
  • Quiet output. A row is printed only for a note that is to be filed (ok, fail, or skipped as would file on a dry run) and for a note that needs your attention (embedded files, a note that cannot be read). Notes in another state and notes that already have an issue: get no row; they are counted on a line after the summary (41 note(s) not ready). Rows are printed like every doctor <capability>, then N ok, N fail, N skipped. Exit code 1 if any row fails.
  • No second issue for the same note. Before it creates an issue, it runs one text search (Issues.search with text) for the note’s hidden marker, only for a note that is in the filing state and has no issue:. A text search can match loosely, so an issue counts only when its body contains the exact marker. If one does, nothing is created: that issue’s key is written into the note and the row reads already filed as <key>. When several carry it (a duplicate that was closed may be listed first), the oldest open one is recorded, and when all are closed the oldest of them, because an issue closed on purpose still means the idea was filed. If the search for a note throws, that note gets a failing row and nothing is created for it; the other notes go on. The search is not limited to the newest 100 issues, but it has bounds: on GitHub it pages through up to 2000 recently updated issues, so an issue older than that is still not found and could be filed again, and each search spends rate limit (one per note to file). Linear filters on the server.
  • Overlapping runs converge on one issue. Two runs (two Macs, a terminal and the Council button, a scheduled run) can both search before either creates, and then both create. So after a run creates an issue it searches once more for the marker. If an older open issue carries it, the run’s own issue is a duplicate: the run comments Duplicate of <key>: the same idea was filed by two overlapping runs., closes its own issue, and writes the older key into the note; the row reads filed as <older key> (closed duplicate <own key> from an overlapping run). The older issue is the one with the lower number in its key (#12, ENG-7, owner/repo#12), which both runs work out from the same issues, so both notes end with the same key and the run whose issue is the older changes nothing. The close uses Issues.transition to done (on GitHub, closed as completed), since the capability has no duplicate state. If the comment or the close does not go through (a timeout, or a lost response after the tracker closed it), the note still gets the older key, and the run prints a row that names both keys and says to close the duplicate by hand. If the second search itself does not go through, no older issue is known, so the run keeps its own issue, writes it into the note and prints a row that says to look for another issue with the same marker: a created issue is never left out of the note. The cost is one extra search per note whose issue the run created, and none for a note that is already filed.
  • Limits of the convergence. It works only if the search sees both issues. Each search reads back at most 100 text matches (the marker holds the note’s path, so true hits are few) and has no paging beyond that. GitHub’s search reaches about 2000 recently updated issues and is rate limited, and the tracker’s index can lag a few seconds behind a create, so two runs that overlap closely enough can still each miss the other; the next run does not repeat the problem, but the extra issue stays open until someone closes it. The rule is not a lock, because a lock file in an iCloud vault is not reliable.
  • Asks first unless --dry-run or --yes. Without a terminal it refuses to run without one of them.
  • --dry-run reads the notes and prints would file "<title>". It writes nothing and loads only the ideas provider, never the issues one.
  • Never deletes. A filed note stays in the folder with issue: set; moving it out of the vault belongs to the Council plugin, which runs this command and trashes the note once it has an issue:, since the provider has no retire.
  • A second run changes nothing, because issue: is now set.
  • A note that cannot be filed is a failing row, not the end of the run. If the issue was created but the note could not be written, the row says so and gives the key to add by hand; a rerun also finds the issue by its marker and writes the key itself.

The next step, once an idea is a spec candidate, is new spec, which turns the filed issue into a draft spec.

Option Default Description
--dry-run false Show what would be filed, without creating or writing anything
--yes false File without asking (required without a terminal)

The issues provider reads its token through the usual chain (--token, the environment, .env, the credentials providers, the keyring). The ideas provider needs no token. The command needs the plugin packages (@theholocron/holocron-plugin-obsidian and the issues provider’s) to resolve, as every command that calls a provider does.