Hand off the whole picture
Give an agent a goal, the rules it must respect, decisions already made, and the questions it should not silently answer.
A small format for a big context
Cogitate gives your AI the background, facts, rules, and questions it needs, without making it guess which is which.
# goal
Rename user_name to username everywhere.
# constraints
- ! Keep the old column readable for one release.
- ~ Keep the change in one pull request.
# open
- ? [q1] Does the CSV consumer use the old name?It is Markdown with a few conventions: typed sections, strength markers, item IDs, and optional source anchors. Write it in any editor, save it as .cog.md, and paste or attach it to a conversation. No special model or tool is required to read it.
The reason behind the format
A long prompt can mix an established fact, a tentative idea, a hard requirement, and an unanswered question in the same paragraph. Readers have to reconstruct the intent. As context grows, that distinction gets harder to keep track of.
Cogitate was built to make those distinctions explicit while staying quick for people to write and consistent for AI to read. It adds structure to familiar Markdown rather than asking you to maintain a complex schema.
Give an agent a goal, the rules it must respect, decisions already made, and the questions it should not silently answer.
Turn a reference or report into identifiable facts, their relationships, and apparent conflicts, without inventing work to do.
Link a choice to its supporting fact. Attach source quotes. Optionally check references, source anchors, and content integrity.
Cogitate makes intent and provenance easier to inspect. It does not guarantee that a claim is correct, a summary is faithful, or an AI will follow every instruction.
Start small
context.cog.md. Start with an outcome and a few constraints. Add other sections only when they carry useful information.! for a requirement, ~ for a preference, and ? for uncertainty.---
cogitate: 0.2
kind: task-oriented
scope: username migration
---
# goal
Rename user_name to username without breaking existing readers.
# facts
- [f1] The CSV export currently reads user_name.
# constraints
- ! [c1] Keep the old column readable for one release.
# tasks
- [ ] [t1] Update the CSV export, respecting [c1].
# open
- ? [q1] Who owns the CSV consumer?Download a complete task-oriented example. You can use the format by hand without installing anything.
On macOS or Linux, the installer downloads the latest platform release into ~/.local/bin and checks its release checksum. Review the installer before running it. Make sure ~/.local/bin is on your PATH.
curl -fsSL https://raw.githubusercontent.com/kshehadeh/cogitate/main/install.sh | sh
cogitate lint context.cog.md
cogitate parse context.cog.md --pretty
cogitate seal context.cog.mdOn Windows, download the windows-x64 ZIP from GitHub Releases. For a source checkout, run bun install and substitute bun src/cli.ts for cogitate.
The shape of a document
A document has optional front matter, an optional preamble, content sections, and an optional # check section. Each section begins with a level-one heading at column zero, such as # facts. Section names are case-insensitive. Use ## through ###### for subheadings within a section.
Use when the primary purpose is to request work, a change, or a resolution. Include # goal, then the sections the source supports.
kind: task-oriented
# goal
# facts
# constraints
# tasks
# openUse when the primary purpose is to explain or report. Begin with these three sections in this exact order. Do not add a goal or tasks.
kind: informational
# summary
# facts
# relationships
# inconsistencies# inconsistencies is optional; other supported sections can follow.
Choose by the source’s intent, not its filename or isolated words like “must.” Mixed material is task-oriented if requesting work is the primary purpose; otherwise it is informational. Handwritten and older documents can omit kind.
Begin the file with an exact --- line. Write single-line key: value entries, then close with another ---. Keys are case-insensitive and stored in lowercase; values are strings. Use cogitate: 0.2 to declare the format version, not the CLI release version.
| Key | What it records |
|---|---|
cogitate | Format version, currently 0.2. |
kind | task-oriented or informational, if specified. |
scope | A useful description of what this document covers. |
source | The original path, URL, or ticket key. |
source-file | A saved source path relative to the .cog.md file. |
source-sha256 | The hash of the input-normalized source text. |
converted-by | The producing tool or agent and its version. |
Sections can contain paragraphs, bullet or numbered items, nested items, subheadings, and fenced code blocks. The following reference examples are excerpts; an ID such as [f1] can refer to an item in another section of the same document.
Small conventions, explicit intent
An item’s optional prefixes must appear in this order: marker → checkbox → ID → text → anchors.
- ! [ ] [t1] Update the export before removing the column. << "Update the export first"| Syntax | Meaning |
|---|---|
! | Must: a hard requirement. Follow the marker with a space. |
~ | Prefer: a soft preference, not an absolute rule. |
? | Uncertain: do not treat it as confirmed. |
| No marker | A plain statement. |
[ ] / [x] | Not done / done. Uppercase [X] also means done. |
[f1] at the start | Names the item so other blocks can reference it. |
[f1] in text | Refers to the named item. |
<< "quote" | Words from a source, placed at the very end of the item. |
<< inferred | The writer’s inference, rather than a claim stated by the source. |
IDs begin with a letter and can then contain letters, digits, underscores, dots, and hyphens. They are case-insensitive, must be unique across the document, and cannot be x, which is reserved for checkboxes. Prefixes like f or c are useful conventions, not required types.
# facts
- [f1] The CSV export reads user_name.
# decisions
- [d1] Migrate the export first. Because: [f1].
# tasks
- [ ] [t1] Update the export as decided in [d1].Words like “Because:” or “Blocks:” have no special parser meaning. The bracketed IDs carry the links. Markdown links such as [docs](https://example.com) and bracketed text inside inline code are not references.
Indent a bullet farther than the previous bullet to make it a child. Tabs count as four spaces. A non-bullet line immediately after an item continues its text. After a blank line, it continues only if indented farther than the item’s bullet; otherwise it starts a paragraph.
Put one or more anchors at the very end, after any continuation lines. Escape a double quote as \" and a backslash as \\ inside a quoted anchor. Typographic double quotes are accepted too. An anchor elsewhere is ordinary text. Anchors are optional unless # check requires grounding for the relevant section.
Header reference
Choose sections for what the information means, not just how it looks. You do not need every header in every document.
# goalWhat the work is trying to achieve.
Describe the desired end state, not just a list of steps. Use it for task-oriented material. Constraints describe the boundaries; tasks describe the work. Keep those distinctions separate.
# goal
Rename user_name to username everywhere without breaking
existing readers during the transition.Use when: you are asking for a change or deliverable. Informational documents should begin with # summary instead; inventing a goal would change their intent.
# summaryA concise overview of informational material.
Orient the reader to the subject and its main takeaways. Keep detailed claims in # facts and their connections in # relationships. A paragraph or a few items is enough.
# summary
The reference describes response caching, with conflicting
claims about the cache lifetime.Format rule: this is the first section in a document marked kind: informational, followed by # facts and # relationships. Under required grounding, summary items need anchors; paragraphs do not.
# contextThe narrative, history, and background that explain the situation.
Explain how things got here and why the subject matters. Use paragraphs when they are clearer than bullets. Move specific current claims to # facts and rules for the solution to # constraints.
# context
The username migration is part of a naming cleanup.
Older clients and a scheduled CSV export still expect
the original column name.Good fit: previous attempts, project history, stakeholder background, or a short explanation that would lose meaning if split into isolated facts.
# factsThings that are true, or believed true, right now.
Write distinct claims and preserve dates, scope, attribution, and qualifications. Give important facts IDs so decisions and relationships can refer to them. Mark unconfirmed claims with ? instead of presenting them as certain.
# facts
- [f1] Responses are cached for 60 seconds. << "cache stores responses for 60 seconds"
- [f2] Requests within 60 seconds reuse the response. << "Requests within 60 seconds reuse the cached response"
- [f3] The overview reports a 120-second lifetime. << "overview says the cache stores responses for 120 seconds"Format rule: every fact item in an informational document needs an ID. It is the second section, immediately after # summary. Quotes help trace a claim, but do not prove that your paraphrase is accurate.
# relationshipsConnections between facts, linked with item references.
Explain how facts relate: one may support, depend on, explain, or qualify another. Reference the connected fact IDs. Do not turn correlation into causation. If the source does not state the connection, mark it << inferred.
# relationships
- [r1] [f1] explains the reuse window in [f2]. << inferredFormat rule: this is the third section in an informational document. Each relationship item in that kind of document must reference at least two distinct facts.
If the source supports no connections, keep the section and use this paragraph rather than inventing a relationship:
# relationships
No relationships supported by the source.# inconsistenciesClaims that appear to conflict, without choosing a winner.
Preserve both claims and explain the apparent conflict. Keep their dates, scope, attribution, and qualifiers intact: statements about different periods or systems may not contradict each other. Use ? for uncertainty and << inferred when the conflict is your interpretation.
# inconsistencies
- ? [i1] [f1] and [f3] report different cache lifetimes;
the source does not resolve this. << inferredFormat rule: optional for informational material, after relationships. Each item in an informational document must reference at least two distinct facts. Omit the section if no supported conflict exists; do not add an empty placeholder or silently resolve a conflict.
# constraintsRules the solution must or should follow.
Separate non-negotiable requirements from preferences. Use ! for a hard rule and ~ for something desirable but flexible. A constraint is a boundary on the solution, not a proposed implementation step.
# constraints
- ! [c1] Keep the old column readable for one release.
- ~ [c2] Keep the change in one pull request if practical.Reading guidance: if a requested action conflicts with a hard constraint, point out the conflict rather than silently choosing one. IDs make it easy to say “this would violate [c1].”
# decisionsChoices already made, ideally citing their reasons.
Record what has been decided so the reader does not reopen it accidentally. Reference supporting facts or constraints, and include the reason in ordinary text. Put undecided alternatives in # open.
# decisions
- [d1] Migrate the CSV export before removing the old column.
Because: [f1]. Respects: [c1].Watch for: a decision depending on an uncertain item. The linter warns when a decision cites an item marked ?; the warning flags an assumption, not proof that the decision is wrong.
# tasksWork to do, usually with checkboxes.
Describe actionable work and tie it to relevant decisions and constraints. Use [ ] for pending work and [x] for completed work. If a task has a strength marker, put it before the checkbox.
# tasks
- ! [ ] [t1] Update the export, respecting [c1].
- [ ] [t2] Add a regression test for the old name.
- [x] [t3] Identify the current CSV reader.Use when: work is requested or tracked. Do not manufacture tasks from an informational source. A document marked kind: informational must not contain this section.
# openQuestions that still need an answer.
Make gaps visible. Use this section for unanswered questions, unresolved alternatives, and unknowns that could affect the outcome. Assign IDs if another item depends on an answer.
# open
- ? [q1] Who owns the CSV consumer?
- ? [q2] Is one release long enough for downstream clients?Reading guidance: do not treat an unknown as an established fact. Flag it if your answer depends on it. Move confirmed information into facts or record a settled choice in decisions.
# notesUseful material that does not belong in another section.
Keep miscellaneous observations, links, and reminders here. Paragraphs, items, subheadings, and code blocks are all available. Avoid hiding a hard requirement or an essential fact in a catch-all section.
# notes
## Review reminder
Include the CSV owner in the migration review.
- Related reference: [migration guide](https://example.com/guide)Tip: if a recurring category deserves a name, give it a custom # x-... section instead.
# checkOptional instructions for deterministic checks, not content for the AI.
Write key: value lines; a bullet prefix is also allowed. Keep a single check section, usually at the end. It is excluded from the canonical document and its hash. Adding or updating it does not change the content hash.
# check
require: goal, facts, constraints
refs: resolve
grounding: optional| Key | Values and behavior |
|---|---|
require | Comma-separated section names. Missing listed sections are errors. |
refs | resolve (default) errors on unresolved references; warn warns; ignore ignores them. |
grounding | optional (default) or required. Required grounding checks that each item in summary, facts, relationships, inconsistencies, constraints, decisions, tasks, and open has a quote or an inferred anchor. |
sha256 | 64 hex characters. A malformed value or a mismatch with the canonical content hash is an error. |
Use cogitate seal context.cog.md to write a real sha256 value, rather than typing a placeholder. Grounding does not require anchors on paragraphs, code blocks, or items in context, goal, notes, or custom sections.
A document without a check section, or one that fails lint, is still usable input for a model. The check section is for tooling; the model should ignore it.
# x-...Custom sections for context that needs its own category.
Start custom names with x-, such as # x-glossary or # x-reviewers. They can use the same content blocks and references as other sections, and they are included in the content hash.
# x-glossary
- [g1] Legacy reader: a client still using user_name.
# x-reviewers
Ask the CSV owner to review changes affecting [g1].Format rule: other unknown header names still parse, but produce a lint warning. The x- prefix identifies an intentional extension; it does not add new semantic checks.
From existing material to structured context
The CLI can drive an agent over the Agent Client Protocol (ACP) to convert a local file, standard input, URL, or ticket key. Cogitate does not call a model itself. The agent supplies its own model, login, and connectors.
cogitate convert ticket.md
cogitate convert PAY-318
cogitate convert https://example.com/spec
cogitate convert ticket.md --update ticket.cog.md
cogitate convert ticket.md --agent "<your ACP agent command>"The default agent is droid exec --output-format acp. Override it with --agent or COGITATE_AGENT. URL and ticket fetching depend on the agent’s available tools and access.
*.source.md.If conversion still fails, the last generated attempt is written to <out>.rejected and the command exits with status 1. A classification failure produces no document. --update reclassifies the current source and preserves IDs that still apply.
Permissions: Cogitate approves agent permission requests for read, search, fetch, and think, and rejects other requests unless you pass --allow-all. The agent’s own settings still control tools it runs without asking. Cogitate offers no file or terminal tools through ACP.
Know what a check actually proves
cogitate lint can catch duplicate IDs, broken references, missing required sections, invalid informational structure, missing required anchors, source mismatches, and content hash mismatches. Warnings flag issues such as unknown sections or decisions based on uncertain items. Lint exits 1 on errors; --strict also fails on warnings.
cogitate lint context.cog.md
cogitate lint context.cog.md --source original.md
cogitate lint context.cog.md --json
cogitate hash context.cog.md
cogitate seal context.cog.mdParsing produces a canonical document containing metadata, the preamble, and content sections. Items retain their markers, checkbox states, IDs, text, references, anchors, inference flags, and children. Paragraphs, code, and subheadings retain their own block shapes. Line numbers and the check section are excluded.
The CLI serializes the canonical value using RFC 8785 (JSON Canonicalization Scheme), then computes its SHA-256. Content edits, including adding metadata or sections, change the hash. Sealing records the current hash; it is not a signature and does not prove authorship.
When source text is available via --source or source-file, quoted anchors must appear as substrings of the match-normalized source. Matching normalizes input and typographic quotes, removes asterisks, underscores, and backticks, collapses whitespace, and lowercases the text. It is not an exact byte match or a semantic check.
source-sha256 separately checks the input-normalized source text. If a saved source changes, anchor or source-hash errors can show that the conversion is out of date.
A matching quote does not prove that a paraphrase, strength marker, inferred connection, or apparent inconsistency is faithful. An agent-fetched copy does not prove what the original system currently holds. Source classification and semantic interpretation are agent judgments, not deterministic guarantees.
The parser is tolerant and produces a document even when it reports errors. For exact canonical JSON shapes and the full diagnostic list, see the format specification.
Keep exploring