Skip to content

Commit 67c21db

Browse files
committed
handover to @parlakisik.
Signed-off-by: Jose Alekhinne <jose@ctx.ist>
1 parent ed8158b commit 67c21db

289 files changed

Lines changed: 125266 additions & 285176 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.context/CONSTITUTION.md

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,56 @@ DO NOT UPDATE FOR:
1414

1515
These rules are INVIOLABLE. If a task requires violating these, the task is wrong.
1616

17+
## Completion Over Motion
18+
19+
Work is only complete when it is **fully done**, not when progress has been made.
20+
21+
- The requested outcome must be delivered end-to-end.
22+
- Partial progress is not completion.
23+
- No half measures.
24+
25+
Do not:
26+
- Leave broken or inconsistent states
27+
- Deliver work that requires the user to "finish it later"
28+
29+
If you start something, you own it, you finish it.
30+
31+
---
32+
33+
## No Excuse Generation
34+
35+
**Never default to deferral.**
36+
37+
Your goal is to satisfy the user's intent, not to complete a narrow
38+
interpretation of the task.
39+
40+
Do not justify incomplete work with statements like:
41+
42+
- "Let's continue this later"
43+
- "This is out of scope"
44+
- "I can create a follow-up task"
45+
- "This will take too long"
46+
- "Another system caused this"
47+
- "This part is not mine"
48+
- "We are running out of context window"
49+
50+
Constraints may exist, but they do not excuse incomplete delivery.
51+
52+
- External systems, prior code, or other agents are not valid excuses
53+
- Inconsistencies must be resolved, not explained away
54+
55+
---
56+
57+
## No Broken Windows
58+
59+
Leave the system in a better state than you found it.
60+
61+
- Fix obvious issues when encountered
62+
- Do not introduce temporary hacks without resolving them
63+
- Do not normalize degraded quality
64+
65+
---
66+
1767
## Security Invariants
1868

1969
- [ ] Never commit secrets, tokens, API keys, or credentials

.context/TASKS.md

Lines changed: 417 additions & 21 deletions
Large diffs are not rendered by default.

docs/cli/change.md

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
---
2+
# / ctx: https://ctx.ist
3+
# ,'`./ do you remember?
4+
# `.,'\
5+
# \ Copyright 2026-present Context contributors.
6+
# SPDX-License-Identifier: Apache-2.0
7+
8+
title: Change
9+
icon: lucide/diff
10+
---
11+
12+
## `ctx change`
13+
14+
Show what changed in context files and code since your last
15+
session.
16+
17+
Automatically detects the previous session boundary from state
18+
markers or event log. Useful at session start to quickly see
19+
what moved while you were away.
20+
21+
```bash
22+
ctx change [flags]
23+
```
24+
25+
**Flags**:
26+
27+
| Flag | Description |
28+
|-----------|---------------------------------------------------------|
29+
| `--since` | Time reference: duration (`24h`) or date (`2026-03-01`) |
30+
31+
**Reference time detection** (priority order):
32+
33+
1. `--since` flag (duration, date, or RFC3339 timestamp)
34+
2. `ctx-loaded-*` marker files in `.context/state/` (second most recent)
35+
3. Last `context-load-gate` event from `.context/state/events.jsonl`
36+
4. Fallback: 24 hours ago
37+
38+
**Examples**:
39+
40+
```bash
41+
# Auto-detect last session, show what changed
42+
ctx change
43+
44+
# Changes in the last 48 hours
45+
ctx change --since 48h
46+
47+
# Changes since a specific date
48+
ctx change --since 2026-03-10
49+
```
50+
51+
**Output**:
52+
53+
```
54+
## Changes Since Last Session
55+
56+
**Reference point**: 6 hours ago
57+
58+
### Context File Changes
59+
- `TASKS.md` - modified 2026-03-12 14:30
60+
- `DECISIONS.md` - modified 2026-03-12 09:15
61+
62+
### Code Changes
63+
- **12 commits** since reference point
64+
- **Latest**: Fix journal enrichment ordering
65+
- **Directories touched**: internal, docs, specs
66+
- **Authors**: jose, claude
67+
```
68+
69+
Context file changes are detected by filesystem mtime (works
70+
without git). Code changes use `git log --since` (empty when
71+
not in a git repo).
72+
73+
**See also**: [Reviewing Session Changes](../recipes/session-changes.md).

docs/cli/completion.md

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
---
2+
# / ctx: https://ctx.ist
3+
# ,'`./ do you remember?
4+
# `.,'\
5+
# \ Copyright 2026-present Context contributors.
6+
# SPDX-License-Identifier: Apache-2.0
7+
8+
title: Completion
9+
icon: lucide/keyboard
10+
---
11+
12+
## `ctx completion`
13+
14+
Generate shell autocompletion scripts.
15+
16+
```bash
17+
ctx completion <shell>
18+
```
19+
20+
### Subcommands
21+
22+
| Shell | Command |
23+
|--------------|-----------------------------|
24+
| `bash` | `ctx completion bash` |
25+
| `zsh` | `ctx completion zsh` |
26+
| `fish` | `ctx completion fish` |
27+
| `powershell` | `ctx completion powershell` |
28+
29+
### Installation
30+
31+
=== "Bash"
32+
33+
```bash
34+
# Add to ~/.bashrc
35+
source <(ctx completion bash)
36+
```
37+
38+
=== "Zsh"
39+
40+
```bash
41+
# Add to ~/.zshrc
42+
source <(ctx completion zsh)
43+
```
44+
45+
=== "Fish"
46+
47+
```bash
48+
ctx completion fish | source
49+
# Or save to completions directory
50+
ctx completion fish > ~/.config/fish/completions/ctx.fish
51+
```
52+
53+
=== "PowerShell"
54+
55+
```powershell
56+
# Add to your PowerShell profile
57+
ctx completion powershell | Out-String | Invoke-Expression
58+
```

docs/cli/connect.md

Lines changed: 30 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,34 @@ icon: lucide/link
1111

1212
## `ctx connect`
1313

14-
Connect to a shared context hub for cross-project knowledge sharing.
15-
Projects publish decisions, learnings, and conventions to a centralized
16-
hub; other projects receive them alongside local context.
14+
Connect a project to a `ctx` Hub for cross-project
15+
knowledge sharing. Projects publish decisions, learnings,
16+
conventions, and tasks to a hub; other subscribed projects receive
17+
them alongside local context.
18+
19+
!!! tip "New to the hub?"
20+
Start with the
21+
[`ctx` Hub overview](../recipes/hub-overview.md) for
22+
the mental model (what the hub is, who it's for, what it is
23+
**not**), then walk through
24+
[Getting Started](../recipes/hub-getting-started.md).
25+
This page is a command reference, not an introduction.
26+
27+
**The unit of identity is a project, not a user.** Registering a
28+
directory with `ctx connect register` binds a per-project client
29+
token in `.context/.connect.enc`. Two developers on the same
30+
project either share that file over a trusted channel, or each
31+
register under a different project name.
32+
33+
**Only structured entries flow through the hub**`decision`,
34+
`learning`, `convention`, `task`. Session journals, scratchpad
35+
contents, and other local state stay on the machine that created
36+
them.
1737

1838
### `ctx connect register`
1939

20-
One-time registration with a shared hub. Requires the hub address and
21-
admin token (printed by `ctx serve --shared` on first run).
40+
One-time registration with a hub. Requires the hub address and
41+
admin token (printed by `ctx hub start` on first run).
2242

2343
```bash
2444
ctx connect register localhost:9900 --token ctx_adm_7f3a...
@@ -40,7 +60,7 @@ ctx connect subscribe decision learning convention
4060
### `ctx connect sync`
4161

4262
Pull matching entries from the hub and write them to
43-
`.context/shared/` as markdown files with origin tags and date
63+
`.context/hub/` as markdown files with origin tags and date
4464
headers. Tracks last-seen sequence for incremental sync.
4565

4666
```bash
@@ -58,7 +78,7 @@ ctx connect publish decision "Use UTC timestamps everywhere"
5878
### `ctx connect listen`
5979

6080
Stream new entries from the hub in real-time. Writes to
61-
`.context/shared/` as entries arrive. Press Ctrl-C to stop.
81+
`.context/hub/` as entries arrive. Press Ctrl-C to stop.
6282

6383
```bash
6484
ctx connect listen
@@ -95,10 +115,10 @@ throttled). No manual `ctx connect sync` needed.
95115

96116
## Shared files
97117

98-
Entries from the hub are stored in `.context/shared/`:
118+
Entries from the hub are stored in `.context/hub/`:
99119

100120
```
101-
.context/shared/
121+
.context/hub/
102122
decisions.md # Shared decisions with origin tags
103123
learnings.md # Shared learnings
104124
conventions.md # Shared conventions
@@ -113,7 +133,7 @@ mixed with local context files.
113133
Include shared knowledge in agent context packets:
114134

115135
```bash
116-
ctx agent --include-shared
136+
ctx agent --include-hub
117137
```
118138

119139
Shared entries are included as Tier 8 in the budget-aware

docs/cli/dep.md

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
---
2+
# / ctx: https://ctx.ist
3+
# ,'`./ do you remember?
4+
# `.,'\
5+
# \ Copyright 2026-present Context contributors.
6+
# SPDX-License-Identifier: Apache-2.0
7+
8+
title: Dependency graph
9+
icon: lucide/git-fork
10+
---
11+
12+
## `ctx dep`
13+
14+
Generate a dependency graph from source code.
15+
16+
Auto-detects the project ecosystem from manifest files and
17+
outputs a dependency graph in Mermaid, table, or JSON format.
18+
19+
```bash
20+
ctx dep [flags]
21+
```
22+
23+
**Supported ecosystems**:
24+
25+
| Ecosystem | Manifest | Method |
26+
|-----------|-----------------------------------------|----------------------------------------|
27+
| Go | `go.mod` | `go list -json ./...` |
28+
| Node.js | `package.json` | Parse `package.json` (workspace-aware) |
29+
| Python | `requirements.txt` or `pyproject.toml` | Parse manifest directly |
30+
| Rust | `Cargo.toml` | `cargo metadata` |
31+
32+
Detection order: Go, Node.js, Python, Rust. First match wins.
33+
34+
**Flags**:
35+
36+
| Flag | Description | Default |
37+
|--------------|-------------------------------------------------|---------------|
38+
| `--format` | Output format: `mermaid`, `table`, `json` | `mermaid` |
39+
| `--external` | Include external/third-party dependencies | `false` |
40+
| `--type` | Force ecosystem: `go`, `node`, `python`, `rust` | auto-detect |
41+
42+
**Examples**:
43+
44+
```bash
45+
# Auto-detect and show internal deps as Mermaid
46+
ctx dep
47+
48+
# Include external dependencies
49+
ctx dep --external
50+
51+
# Force Node.js detection (useful when multiple manifests exist)
52+
ctx dep --type node
53+
54+
# Machine-readable output
55+
ctx dep --format json
56+
57+
# Table format
58+
ctx dep --format table
59+
```
60+
61+
**Ecosystem notes**:
62+
63+
- **Go**: Uses `go list -json ./...`. Requires `go` in PATH.
64+
- **Node.js**: Parses `package.json` directly (no npm/yarn
65+
needed). For monorepos with workspaces, shows
66+
workspace-to-workspace deps (internal) or all deps per
67+
workspace (external).
68+
- **Python**: Parses `requirements.txt` or `pyproject.toml`
69+
directly (no pip needed). Shows declared dependencies; does
70+
not trace imports. With `--external`, includes dev
71+
dependencies from `pyproject.toml`.
72+
- **Rust**: Requires `cargo` in PATH. Uses `cargo metadata`
73+
for accurate dependency resolution.

docs/cli/guide.md

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
---
2+
# / ctx: https://ctx.ist
3+
# ,'`./ do you remember?
4+
# `.,'\
5+
# \ Copyright 2026-present Context contributors.
6+
# SPDX-License-Identifier: Apache-2.0
7+
8+
title: Guide
9+
icon: lucide/book-open
10+
---
11+
12+
## `ctx guide`
13+
14+
Quick-reference cheat sheet for common ctx commands and skills.
15+
16+
```bash
17+
ctx guide [flags]
18+
```
19+
20+
**Flags**:
21+
22+
| Flag | Description |
23+
|--------------|------------------------------|
24+
| `--skills` | Show available skills |
25+
| `--commands` | Show available CLI commands |
26+
27+
**Example**:
28+
29+
```bash
30+
# Show the full cheat sheet
31+
ctx guide
32+
33+
# Skills only
34+
ctx guide --skills
35+
36+
# Commands only
37+
ctx guide --commands
38+
```
39+
40+
Works without initialization (no `.context/` required). Useful
41+
for a printable one-pager when onboarding to a project.

0 commit comments

Comments
 (0)