Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
fec4a8c
fix: require --section flag for ctx add task
parlakisik Apr 6, 2026
5ddedd0
feat: add hub foundation — store, auth, types
parlakisik Apr 6, 2026
77716a8
feat: add hub gRPC server with auth
parlakisik Apr 7, 2026
b85fb92
feat: add ctx serve --shared CLI command
parlakisik Apr 7, 2026
ff42a3e
feat: add hub client and ctx connect register
parlakisik Apr 7, 2026
adeebed
feat: add subscribe, sync commands and shared file renderer
parlakisik Apr 7, 2026
ddfd160
feat: add publish, listen, and status connect commands
parlakisik Apr 8, 2026
b6424ef
feat: add --include-shared flag to ctx agent
parlakisik Apr 8, 2026
842ba7f
feat: add --daemon and --stop flags to ctx serve --shared
parlakisik Apr 8, 2026
3f0331a
feat: add Raft leader election for hub clustering
parlakisik Apr 8, 2026
8bcb620
feat: add master-follower replication and client failover
parlakisik Apr 8, 2026
ef7eede
feat: add ctx hub status, peer, and stepdown commands
parlakisik Apr 8, 2026
0528ca0
test: add end-to-end integration tests for hub
parlakisik Apr 8, 2026
20c8c53
docs: add CLI reference for connect, serve --shared, and hub
parlakisik Apr 8, 2026
882d8e5
feat: add --share flag to ctx add for automatic hub publishing
parlakisik Apr 8, 2026
2aa2844
test: add unit tests for failover, fanout, and renderer
parlakisik Apr 9, 2026
df7dac6
feat: add auto-sync hook for shared hub entries
parlakisik Apr 9, 2026
173e1c3
fix: address code review findings for shared hub
parlakisik Apr 9, 2026
df82d33
docs: update connect and serve docs with review fixes
parlakisik Apr 9, 2026
9efe1a9
fix: reconcile hub code with main's audit tests after rebase
parlakisik Apr 9, 2026
ed8158b
Merge pull request #60 from ActiveMemory/feat/shared-context-hub
josealekhine Apr 11, 2026
67c21db
handover to @parlakisik.
josealekhine Apr 11, 2026
6ba64f0
handover to @parlakisik.
josealekhine Apr 11, 2026
5cd164e
refactor: flagbind batch helpers and convention sweep
josealekhine Apr 12, 2026
970cdd0
fix: replace manual platform allowlist in dead exports test with go/p…
josealekhine Apr 12, 2026
2ff53c5
Merge pull request #64 from ActiveMemory/feature/ctx-hub-next
josealekhine Apr 12, 2026
78fbdf7
refactor: CLI namespace cleanup — bootstrap, stats, resource, dep, hook
josealekhine Apr 13, 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
  •  
  •  
  •  
249 changes: 249 additions & 0 deletions .claude/skills/_ctx-command-audit/SKILL.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,249 @@
---
name: _ctx-command-audit
description: "Audit CLI command surface after renames, moves, or deletions. Use after any namespace change to catch stale references."
---

Verify that a CLI command change (rename, move, deletion, new parent
grouping) is fully propagated across code, assets, docs, and tests.

## Before Running

1. **Build passes**: `go build ./...` must succeed
2. **Know what changed**: list the command changes (old name -> new
name, or deleted, or moved under a parent)

## When to Use

- After renaming a CLI command (e.g. `ctx stats` -> `ctx usage`)
- After moving a command under a parent (e.g. `ctx pause` -> `ctx hook pause`)
- After deleting a command entirely (e.g. `ctx dep`)
- After promoting or demoting a command (top-level <-> system subcommand)

## When NOT to Use

- For flag-only changes (no command surface change)
- For internal refactors that don't change the user-facing command name
- When only adding a brand-new command (use `_ctx-qa` instead)

## Usage Examples

```text
/_ctx-command-audit
/_ctx-command-audit (after renaming ctx stats to ctx usage)
```

## Checks

For each renamed/moved/deleted command, run these checks in order.

### 1. Cobra --help examples

Verify the examples shown in `--help` output use the correct
command path.

```bash
grep -r "ctx <old-name>" internal/assets/commands/examples.yaml
grep -r "ctx <old-name>" internal/assets/commands/commands.yaml
```

Fix: Update YAML values to use the new command path. For
subcommands under a parent, examples must show the full path
(e.g. `ctx hook event`, not `ctx event`).

### 2. Use/DescKey constants

Verify the cobra Use string and DescKey constant match the new
command name.

```bash
grep -r "Use<OldName>\|DescKey<OldName>" internal/config/embed/cmd/
```

Fix: Rename constants, rename the file if needed (e.g.
`stats.go` -> `usage.go`), update all callers.

### 3. Flag DescKey constants

Verify flag description keys use the new command prefix.

```bash
grep -r "<old-name>\." internal/config/embed/flag/
```

Fix: Rename constants and their string values (e.g.
`stats.follow` -> `usage.follow`), rename the file, update
the corresponding `flags.yaml` keys.

### 4. Text DescKey constants

Verify text/write/error description keys use the new prefix.

```bash
grep -r "<old-name>\." internal/config/embed/text/
```

Fix: Rename constants and YAML keys in
`internal/assets/commands/text/*.yaml`.

### 5. group.go registration

Verify the command is registered in the correct group (or
removed if deleted).

```bash
grep "<old-package>" internal/bootstrap/group.go
```

Fix: Update import path and registration entry. Update the
function's doc comment to list the current commands.

### 6. Doc pages

Verify `docs/cli/<name>.md` exists with correct content, or
is removed for deleted commands.

```bash
ls docs/cli/<old-name>.md # should not exist
ls docs/cli/<new-name>.md # should exist
```

Fix: `git mv` for renames, `git rm` for deletions, create new
files for new parent commands.

### 7. CLI index

Verify `docs/cli/index.md` references the correct command names
and links.

```bash
grep "<old-name>" docs/cli/index.md
```

Fix: Update table entries, links, and anchors.

### 8. zensical.toml nav

Verify the site navigation references correct filenames.

```bash
grep "<old-name>" zensical.toml
```

Fix: Update nav entries to match renamed/new doc files.

### 9. Recipes and docs sweep

Broad sweep for any remaining stale references in user-facing
documentation.

```bash
grep -r "ctx <old-name>" docs/ --include="*.md"
grep -r "ctx <old-name>" internal/assets/claude/ --include="*.md"
```

Fix: Update all references. For commands moved under a parent,
every `ctx <name>` becomes `ctx <parent> <name>`.

### 10. Dead export cascade

After deleting a command, its support packages may become
orphaned (config constants, error constructors, write functions,
exec helpers, format constants, regex patterns).

```bash
make test # TestNoDeadExports will catch these
```

Fix: Delete orphaned packages and constants. Do NOT add
allowlist exceptions — trace the dead export to its root cause
and remove it properly.

### 11. YAML orphan check

After deleting constants, their YAML counterparts may remain
as orphans.

```bash
make test # TestDescKeyYAMLLinkage will catch these
```

Fix: Remove the orphaned YAML entries from `commands.yaml`,
`examples.yaml`, `flags.yaml`, and `text/*.yaml`.

### 12. Magic string check

If you inlined data that previously lived in a config package,
the magic strings test will catch it.

```bash
make test # TestNoMagicStrings will catch these
```

Fix: Move the data to an appropriate `internal/config/`
package. Never inline string literals in source files.

### 13. AST test exceptions

Verify no allowlist entries were added to pass tests.

```bash
grep -r "allowlist\|whitelist\|skip\|except" internal/audit/ internal/compliance/ | grep -i "<command-name>"
```

Fix: If you added an exception, remove it and fix the
underlying issue instead.

### 14. Docstring review

Verify doc comments on touched packages are accurate, not
just minimally gate-passing.

Check these files for each renamed/moved command:
- `doc.go` — package description matches new command path
- `cmd.go` — `Cmd()` godoc names the correct command
- `system.go` or parent — subcommand list in comments is current
- `group.go` — function doc comments list current commands

## Output Format

Report as a checklist:

```
## Command Audit: <change description>

- [x] Cobra --help examples updated
- [x] Use/DescKey constants renamed
- [x] Flag DescKeys renamed
- [x] Text DescKeys renamed
- [x] group.go registration updated
- [x] Doc pages renamed/created/deleted
- [x] CLI index updated
- [x] zensical.toml nav updated
- [x] Recipes and docs swept
- [x] No dead exports
- [x] No orphan YAML keys
- [x] No magic strings
- [x] No AST test exceptions added
- [x] Docstrings reviewed

**Result**: PASS / FAIL (N issues)
```

## Relationship to Other Skills

| Skill | Scope |
|------------------------|------------------------------------|
| `_ctx-qa` | General build/lint/test gate |
| `_ctx-audit` | Codebase convention sweep |
| `_ctx-command-audit` | CLI surface change completeness |
| `_ctx-update-docs` | Docs-code consistency after edits |
| `_ctx-alignment-audit` | Agent playbook vs docs alignment |

## Quality Checklist

Before reporting results, verify:
- [ ] Every check was run for every changed command
- [ ] No stale references remain in docs, recipes, or assets
- [ ] Tests pass with zero exceptions added
- [ ] Docstrings read as if written by someone who understands
the domain, not as minimal gate-passers
50 changes: 50 additions & 0 deletions .context/CONSTITUTION.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,56 @@ DO NOT UPDATE FOR:

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

## Completion Over Motion

Work is only complete when it is **fully done**, not when progress has been made.

- The requested outcome must be delivered end-to-end.
- Partial progress is not completion.
- No half measures.

Do not:
- Leave broken or inconsistent states
- Deliver work that requires the user to "finish it later"

If you start something, you own it, you finish it.

---

## No Excuse Generation

**Never default to deferral.**

Your goal is to satisfy the user's intent, not to complete a narrow
interpretation of the task.

Do not justify incomplete work with statements like:

- "Let's continue this later"
- "This is out of scope"
- "I can create a follow-up task"
- "This will take too long"
- "Another system caused this"
- "This part is not mine"
- "We are running out of context window"

Constraints may exist, but they do not excuse incomplete delivery.

- External systems, prior code, or other agents are not valid excuses
- Inconsistencies must be resolved, not explained away

---

## No Broken Windows

Leave the system in a better state than you found it.

- Fix obvious issues when encountered
- Do not introduce temporary hacks without resolving them
- Do not normalize degraded quality

---

## Security Invariants

- [ ] Never commit secrets, tokens, API keys, or credentials
Expand Down
Loading
Loading