Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
15 commits
Select commit Hold shift + click to select a range
f0f100a
harden notify resolution: drop project-local key tier, surface undeli…
josealekhine Jun 2, 2026
8da165a
docs: strip auto-injected GitNexus blocks from AGENTS.md and CLAUDE.md
josealekhine Jun 2, 2026
03a24cf
docs(tasks): track make-target to auto-strip GitNexus injected blocks
josealekhine Jun 2, 2026
b5206e8
docs(ctx-dream): v1 design spec, debated brief, and v1 task breakdown
josealekhine Jun 7, 2026
31f8cac
docs(context): consolidate LEARNINGS and DECISIONS; archive originals
josealekhine Jun 7, 2026
9a48fe8
fix(journal/schema): recognize CC 2.1.158+ MCP-attribution and prompt…
josealekhine Jun 7, 2026
1f27c0b
docs(spec): steering sync drift respects configured tools (presence-b…
josealekhine Jun 7, 2026
9c13af6
chore(steering): track generated cursor/cline/kiro steering outputs
josealekhine Jun 7, 2026
ef59aee
feat(drift): presence-based steering sync-staleness; make sync/check-…
josealekhine Jun 7, 2026
7e08b31
docs(ctx-dream): settle v1 open questions; split serendipity; executo…
josealekhine Jun 7, 2026
d20cf1b
feat(dream): executor-agnostic v1 foundation — types, guards, state, …
josealekhine Jun 7, 2026
0d21ccc
feat(dream): ctx dream CLI — pass orchestration, review, and disposit…
josealekhine Jun 7, 2026
73196fc
feat(dream): ctx-dream + ctx-serendipity skills, guard hook, docs, gi…
josealekhine Jun 7, 2026
e820fc6
docs(cli): add ctx dream CLI reference, index entry, examples; rebuil…
josealekhine Jun 7, 2026
0961e50
feat(dream): require proposal provenance; crash-resume + corrupted-ar…
josealekhine Jun 7, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
46 changes: 46 additions & 0 deletions .clinerules/product.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# product


# Product Context

`ctx` is **persistent context for AI coding sessions**. It gives
the AI memory across sessions by writing project state to
git-versioned Markdown files in `.context/` and feeding that
state back to the AI on every turn.

## Target users

Developers using AI coding tools (Claude Code, Cursor, OpenCode,
Copilot CLI, Aider, Cline, Kiro, Codex) who want their AI to
remember decisions, conventions, and learnings across sessions
without re-explaining the project every time.

## Load-bearing constraints

These shape every design decision; treat them as invariants when
proposing features:

- **Local-first.** All state lives in the user's filesystem. No
hosted service, no cloud account, no network call required for
normal operation.
- **Single statically-linked binary.** No runtime dependency
tree, no package manager, no install step beyond "drop the
binary on PATH."
- **Git-friendly.** Context is plain Markdown with stable
ordering; diffs are human-readable. Designed so context
history lives in the same repo as the code it describes.
- **Tool-agnostic.** ctx integrates with multiple AI tools as
symmetric peers. No tool is the "primary"; new tools land via
the same `ctx setup <tool>` and `ctx steering sync` paths.
- **No telemetry, no anonymous data collection.** Period.

## Out of scope

- Cloud-hosted state, SaaS sync, or any solution that requires a
network round-trip during normal use. If a proposal needs a
server, it's the wrong proposal for ctx.
- Embedding an LLM into ctx. ctx is the persistence layer; the
LLM lives in the user's chosen AI tool.
- AI-tool lock-in. Features must work across at least two of the
supported tool families (hook-based + native-rules), not be
Claude-Code-only or Cursor-only by design.
62 changes: 62 additions & 0 deletions .clinerules/structure.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
# structure


# Project Structure

## Top-level layout

| Path | What it is |
|------|-----------|
| `cmd/ctx/` | Cobra entry point. One main package; thin. |
| `internal/` | Private Go packages (compiler-enforced no-external-import). |
| `editors/<editor>/` | Separately-published editor integrations (currently `editors/vscode/`). NOT embedded. |
| `tools/<tool>/` | Dev tooling for embedded assets, sitting outside the embed tree (currently `tools/typecheck/opencode/`). |
| `docs/` | Source for the docs site at https://ctx.ist. |
| `site/` | Built output of `docs/` via `make site` (zensical). Committed. |
| `specs/` | Feature specs; every commit gets a `Spec: specs/<name>.md` trailer. |
| `.context/` | This project's own ctx context (CONSTITUTION, TASKS, DECISIONS, LEARNINGS, CONVENTIONS, steering, journal). |
| `hack/` | Project shell scripts (release, lint helpers, detectors). |
| `ideas/` | Drafts and unscoped exploration; not authoritative. |

## Inside `internal/`

- Organized by **domain**, one package per concern. The split is
read/write/config/err/cli/etc., not "by layer."
- `internal/assets/` is the embed payload root. **Everything
under it is `//go:embed`-ed into the binary.** Read
`internal/assets/README.md` before adding files there: the
layout has a contract (embedded vs. separately-published) that
is easy to violate.
- `internal/cli/<domain>/` mirrors the Cobra command tree. New
commands land in their domain package, not as siblings of the
root.

## Where new files go

- **New Go domain logic** → existing `internal/<domain>/` if it
exists. `ls internal/` and read the candidate's `doc.go`
before creating a new package; extending the existing package
is the default.
- **New embedded asset** → under `internal/assets/<domain>/`,
with a matching `//go:embed` directive added in
`internal/assets/embed.go`. Add a presence test in
`embed_test.go` at minimum.
- **Dev tooling for an embedded asset** (linters, type-checkers,
package.json/tsconfig.json) → `tools/typecheck/<asset>/` or
similar sibling. Never inside `internal/assets/` itself; the
embed contract forbids it.
- **New separately-published deliverable** (e.g. a new editor
extension) → `editors/<editor>/`, with its own pipeline. Not
under `internal/`.
- **User-facing documentation** → `docs/`, then `make site`.
Each tool that warrants a guide gets `docs/home/<tool>.md`.

## Where new files do NOT go

- Not in the repo root unless they are project-wide config
(`Makefile`, `go.mod`, `zensical.toml`, etc.).
- Not in `internal/assets/` if they are not actually embedded.
Foreign-language source belongs only when `embed.go` references
it; tooling about embedded assets belongs in `tools/`.
- Not under `internal/` at all if they are deliverables to an
external channel (marketplace, npm registry, etc.).
59 changes: 59 additions & 0 deletions .clinerules/tech.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
# tech


# Technology Stack

## Primary

- **Go 1.26+**, statically linked (`CGO_ENABLED=0`). The `ctx`
binary is the entire deliverable for the core; everything else
ships as embedded bytes inside it.
- **Cobra** for the CLI command surface.
- **`embed.FS`** for shipping foreign-language assets (TypeScript,
Bash, PowerShell, Markdown, JSON, YAML) inside the Go binary.
See `internal/assets/README.md` for the embed contract; the
hard `//go:embed` no-`../` rule shapes the directory layout.

## Separately-published

- **VS Code extension** at `editors/vscode/` ships as a `.vsix`
to the VS Code Marketplace under publisher `activememory`. It
is NOT embedded; it has its own `package.json`, `tsconfig.json`,
and CI guardrails (`vscode-extension` job).
- The embedded **OpenCode plugin** at
`internal/assets/integrations/opencode/plugin/index.ts` has its
type-check tooling outside the embed tree at
`tools/typecheck/opencode/`.

## Hard constraints

- **No runtime dependencies.** No package manager, no network
fetch on install. If a feature needs a daemon or a service,
it's the wrong feature.
- **No CGO.** Build must succeed with `CGO_ENABLED=0` on every
supported platform (Linux/macOS/Windows × amd64/arm64).
- **No network calls during normal operation.** Tests included.
Operations that genuinely need network (e.g. GitHub release
download in the VS Code extension auto-bootstrap) are scoped
and opt-in.
- **Foreign-language assets ship embedded, not at install time.**
TypeScript / Bash / PowerShell that integrates with external
tools is baked into the Go binary at compile time and written
out to the user's filesystem by `ctx setup <tool>`.

## Companion tooling

- **GitNexus** (`mcp__gitnexus__*`) — code intelligence MCP
server for impact analysis, route maps, and shape checks.
- **Gemini Search** — preferred over built-in web search for
faster, more accurate results.

## Build / test / lint

- `make build`, `make test`, `make lint` are the canonical
entrypoints. CI runs the same.
- `make site` rebuilds `site/` from `docs/` via zensical.
- The TS type-check for embedded OpenCode plugin lives at
`tools/typecheck/opencode/`; `npx tsc --noEmit` is the gate.
- The VS Code extension gate runs `npm ci && npm run build &&
npx tsc --noEmit -p tsconfig.ci.json` in CI.
66 changes: 66 additions & 0 deletions .clinerules/workflow.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
# workflow


# Development Workflow

## Branch discipline

- **Branch off `main` BEFORE the first commit.** `main` is
off-limits for direct commits. Even one-line fixes branch.
- When the user signals "stacking is intentional," stay on the
current feature branch — do NOT create a new one.
- Branch names follow the conventional-commit shape:
`feat/<scope>`, `fix/<scope>`, `docs/<scope>`, `chore/<scope>`.

## Never push, never merge

- **Never run `git push`.** Never offer to. Stop at commit. The
human is the final authoritative decision maker before any
push to upstream (CONSTITUTION).
- Same rule for `gh pr create` and `gh pr merge`. Don't.

## DCO sign-off is required

- Every commit needs `Signed-off-by: …` — use `git commit -s`.
- CI's DCO workflow blocks PRs that lack the sign-off line. There
is no exception.

## Every commit has a Spec trailer

- `Spec: specs/<name>.md` at the end of every commit message
(CONSTITUTION). No "non-trivial" qualifier; even one-liner
fixes get a spec for traceability.
- Use `/ctx-commit` rather than raw `git commit` so decisions
and learnings get captured alongside the code.

## Gates before every commit

- `make lint` — must return zero issues.
- `make test` — must pass.
- Working tree must be clean of unrelated changes. Surface
pre-existing modifications before bundling them; never
silently fold them in.

## Conventional commit subjects

- Prefixes: `feat(scope):`, `fix(scope):`, `docs(scope):`,
`refactor(scope):`, `chore(scope):`, `deps:`, `test(scope):`.
- Subject under 70 characters; details go in the body.
- Co-Authored-By for Claude is omitted. The human signoff stays.

## Error handling

- Handle every error at the call site. No `_ =` discards. No
`value, _ :=`. No `panic`. Existing `_ =` and silent skips in
the codebase are tech debt, not authorization to copy.
- Path construction uses stdlib (`filepath.Join`); never string
concatenation (security: prevents path traversal — CONSTITUTION).

## Context capture cadence

- After completing a task, making a non-obvious decision, or
hitting a gotcha: persist before continuing. Don't wait for
session end.
- Use `/ctx-decision-add`, `/ctx-learning-add`,
`/ctx-convention-add`, `/ctx-task-add`. They auto-link to the
current session + branch + commit.
Loading
Loading