Knowledgebse Generation skills and tooling.#88
Merged
Conversation
Phase RG promotes git from an assumed prerequisite to an
enforced one. Phase KB lays down the editorial knowledge-base
pipeline that the spec calls out as depending on it. They ship
paired because the closeout / handover provenance contract
(sha, branch, in-repo evidence SHA pins) is dishonest without
the git mandate.
## Phase RG: git is required
- `internal/gitmeta/` (new): split into require.go (public
RequireGitTree), head.go (ResolveHead with CTX_TASK_COMMIT
/ GITHUB_SHA overrides), branch.go (private resolver),
sha.go (short-form truncation), types.go (HeadRef).
- `internal/err/gitmeta/` (new): ErrMissingGitTree sentinel
+ MissingGitTreeForCmd wrapping constructor.
- `internal/config/gitmeta/` (new): sentinel + format-string
+ env-var name constants.
- `internal/bootstrap/cmd.go`: PersistentPreRunE now calls
RequireGitTree after the existing CTX_DIR + initialized
checks; wraps the sentinel with the subcommand name.
- `internal/config/git/git.go`: adds DotDir = ".git" so the
literal lives in config.
- `.context/CONSTITUTION.md` + mirrored asset: Process
Invariants gain a "Git is required" rule.
## Phase KB: editorial pipeline + handover
Per the spec's pass-mode contract (topic-page / triage /
evidence-only), a completion circuit breaker (page exists +
cites EV-### + site build clean + cold-reader rubric passes),
a source-coverage state-machine ledger, topic-adjacency
pre-flight, life-stage check (bootstrap vs maintenance), and
folder-shaped topic pages from day one.
### Writers (`internal/write/`)
- `closeout/`: Write, Read, List, PostdatedBy, Archive split
across read.go / write.go / frontmatter.go / markdown.go /
filename.go / archive.go / types.go.
- `handover/`: Write with closeout fold + Latest (the
cursor-style timestamp lookup), split across write.go /
provenance.go / markdown.go / filename.go / latest.go /
parse.go / types.go. The package doc.go reframes handover
as session-to-session glue; the closeout fold is the
optional Phase KB integration, not the purpose of the
handover itself.
- `kb/{evidence,sourcecoverage,glossary,contradiction,
question,decision,timeline,sourcemap,relationship}/`: nine
per-artifact writers; evidence enforces no-renumber + ID
allocation, sourcecoverage enforces the state-machine
transition rules.
- `kb/row/`: shared append-with-monotonic-ID helper
(contradiction / decision / question collapsed their
triplicated I/O orchestration into entity.KBRowHooks +
one call into row.Append).
### CLI (`internal/cli/`)
- `kb/` parent + `topic new` (sole scaffold writer), `note`,
`reindex`, plus skill-driven `ingest` / `ask` /
`site-review` / `ground` that refuse on empty input and
surface the canonical /ctx-kb-* skill invocation. Each
subcommand follows the project cmd.go + run.go split:
cmd.go owns cobra plumbing, run.go owns the procedure.
- `handover/` parent + `write` subcommand. MarkFlagRequired
on --summary and --next; rejects placeholder values
(TBD, see chat, n/a, none) via validate.RejectPlaceholder.
Path resolver lives at `handover/core/path/Dir()`, not
under `kb/core/path/`, because the handover is independent
of the editorial pipeline.
- `initialize/core/kb/`: Scaffold lays down kb/, kb/topics/,
ingest/, ingest/closeouts/, ingest/schemas/, handovers/
and copies the embedded templates. HandoversSubdir lives
in cfgHandover, not cfgKB.
- `kb/cmd/topic/cmd/newcmd/`: the new-topic leaf nests
properly under its `topic` parent (no flat `topicnew/`).
- All flag binding via internal/flagbind; all user-stream
writes via io.SafeFprintf; all file IO via io.Safe*
wrappers.
### Skills (canonical + parallel trees)
Six new SKILL.md files (`ctx-kb-ingest`, `ctx-kb-ask`,
`ctx-kb-site-review`, `ctx-kb-ground`, `ctx-kb-note`,
`ctx-handover`) for the canonical Claude tree, plus ported
copies for `integrations/copilot-cli/skills/` (tools: [bash]
frontmatter; capture-skill renames /ctx-task-add →
/ctx-add-task etc.) and condensed versions for
`integrations/opencode/skills/`.
`ctx-wrap-up` is the user-facing trigger for session-end; it
always delegates to `/ctx-handover` as its final step, with
explicit `--summary` / `--next` draft + user-confirmation
phase. `/ctx-handover` is documented as wrap-up's sub-step,
not a user-facing trigger. `/ctx-remember` reads the latest
handover unconditionally; closeout-fold is the
KB-conditional augmentation.
### Embedded templates (`internal/assets/kb/templates/`)
- ingest/: KB-RULES.md (the editorial constitution), four
mode prompts (00-GROUND, 30-INGEST, 40-ASK,
50-SITE_REVIEW), OPERATOR.md, PROMPT.md (hand-fallback
router).
- ingest/schemas/: ten schema templates with fields list +
one worked example each.
- kb/index.md and kb/topics/_template/index.md.
### Shared `internal/slug/`
Lifted `internal/cli/journal/core/slug/` to `internal/slug/`
(FromTitle, CleanTitle, ForTitle) and added `Path()` for
slash-preserving slugs. The kb topic scaffolder consumes
`slug.Path`; the duplicate Slugify in `cli/kb/core/topic/`
was removed.
### Configuration + error packages
Every magic string moved to internal/config/<area>/, every
error constructor moved to internal/err/<area>/ (audit
naked_errors + magic_strings both clean). Cross-package
types (closeout.Frontmatter, closeout.File, KBRowHooks)
moved to internal/entity/. The kb-prefixed flat directories
(`internal/config/kbcli`, `internal/err/kbcli`, etc.) were
restructured into nested subpackages
(`internal/config/kb/cli/`, `internal/err/kb/cli/`, etc.)
matching the embed/{cmd,flag,text} shape. Plural directory
names (contradictions / decisions / questions) were
singularised to match the project's single-noun convention.
### Documentation
- specs/kb-editorial-pipeline.md: full rewrite to current
upstream editorial-pipeline shape.
- specs/require-git.md: pre-existing; cited as Spec trailer.
Rewritten in plain English (no "de facto / de jure"
Latin).
- docs/recipes/build-a-knowledge-base.md (new): six steps
including "Browse the KB Locally" via `ctx serve` on a
`zensical.toml`-equipped `.context/kb/`.
- docs/recipes/typical-kb-session.md (new)
- docs/recipes/recover-aborted-session.md (new)
- docs/cli/kb.md (new) and docs/cli/handover.md (new):
separate pages for distinct commands; the older combined
page was a category error.
- docs/reference/skills.md: six new entries under new
"Knowledge Base (Phase KB)" section.
- docs/cli/init-status.md: git-required admonition + new
KB scaffolding callout.
- docs/cli/index.md and docs/recipes/index.md: nav.
- README.md: git-required note + KB workflow snippet.
- CLAUDE.md (project root + internal/assets/claude/): two
sibling h2 sections, `## Session Handovers` and `## KB
Editorial Workflow`. Trigger map points
"leave a handover" / "before I go" / "stepping away" at
`/ctx-wrap-up`, not `/ctx-handover`.
- dist/RELEASE_NOTES.md: Phase RG + Phase KB section
prepended.
- internal/assets/commands/commands.yaml: every kb /
handover entry now carries a usage Examples block (parity
with the rest of the YAML).
### Refinement passes folded into this commit
- Title-Case heading sweep across recipes, skills, and
templates.
- en-US / American-English sweep (honoured → honored,
catalogue → catalog, etc.).
- "markdown" → "Markdown" (proper-noun) sweep outside code
spans, frontmatter, and language tags.
- Em-dash semantic sweep: each `—` evaluated in context and
replaced with `:` (appositive), `;` (clause break), `,`
(loose pause), or `.` (sentence split).
- Bare `ctx` → `` `ctx` `` brand sweep outside code blocks
and slash-command identifiers.
- NDA scrub: every reference to the upstream sibling
project's name (`things-wtf*`, `disaster-recovery*`,
`~/.../WORKSPACE/things-wtf`) replaced with generic
placeholders (`your-project`, `your-domain`).
- Rot-prone `github.com/.../blob/main/specs/*.md` links
stripped from docs (specs migrate into
`specs/released/v*/` at release-time and the links break).
- "Optional"-labelled steps reframed so the agent always
performs them and the user decides on the result (agents
skip what's labeled optional).
- Defensive over-framings ("regardless of whether
`.context/kb/` exists", "orthogonal to KB", "not a
user-facing trigger") trimmed where the wrong reading was
not naturally tempting; kept only where the prose's
position made the wrong reading the default.
### Audit gate
`make lint` clean, `make test` clean (audit + compliance +
drift checks all green).
## Verification
End-to-end smoke (fresh git tempdir, isolated CTX_DIR):
`ctx init → ctx kb topic new "<topic>" → ctx handover write
… → ctx kb note … → ctx kb reindex` all return zero and
produce the expected on-disk artifacts (topics/<slug>/index.md,
handovers/<TS>-<slug>.md with sha and branch resolved from
git, findings.md append, refreshed CTX:KB:TOPICS managed
block).
Spec: specs/kb-editorial-pipeline.md
Spec: specs/require-git.md
Signed-off-by: Jose Alekhinne <jose@ctx.ist>
The prior Phase KB session introduced an `ErrMsg* = "<english>"`
const layer in `internal/config/<pkg>/<pkg>.go` backing
`var ErrX = errors.New(cfgPkg.ErrMsgX)` sentinels in
`internal/err/<pkg>/<pkg>.go`. Two problems: the English text
materialized at package-init time bypassed the
`commands/text/errors.yaml` lookup that the rest of the codebase
respects, and the doc comments justifying the layer ("package-init
timing prevents desc.Text") were wrong — `desc.Text` can be called
lazily from a method.
The pre-existing convention (`internal/err/context/NotFoundError`,
commit `e524dd98`) already had the answer: typed errors with lazy
`Error()` that calls `desc.Text(...)`. This change generalises that
pattern.
## Shape
- New `entity.Sentinel` (typed string) carries a `desc.Text` lookup
key and implements `error`. Two values are equal under `==` when
they hold the same key, so `errors.Is(err, ErrX)` works against
`fmt.Errorf("%w", …)` wrappers. The text resolves at call time,
never at package init.
- Every `internal/err/<area>/` sentinel is now an untyped
`entity.Sentinel` const, e.g.
`const ErrMissingFrontmatter = entity.Sentinel(text.DescKey...)`.
- Sentinel texts moved into `commands/text/errors.yaml` under
`err.<pkg>.<name>` (or `<name>-msg` where the bare key was
already taken by an existing `%w`-format wrapper).
- All `ErrMsg*` const blocks in
`internal/config/{handover,closeout,git_meta,kb/cli,kb/evidence,
kb/sourcecoverage,rc,initialize,schema}/` deleted, along with the
doc comments that justified the old layer.
## Audit Posture
- `entity.Sentinel` lives in `internal/entity/` because the
cross-package-types audit (TestCrossPackageTypes) treats `entity/`
as the canonical home for types shared across packages.
- No other audit, lint, or test required relaxation. `make lint`
reports 0 issues; full `make test` is green; the cross-package
types audit shows `entity/` exempt-package count unchanged at
0 violations.
## Sentinel Inventory Touched
`handover` (6), `closeout` (3), `git_meta` (2), `kb/cli` (5),
`kb/evidence` (2), `kb/sourcecoverage` (2), `rc`/`context` (7),
`initialize` (2), `schema` (1) — 30 sentinels across 9 packages.
`LEARNINGS.md` codifies the convention so future sessions don't
re-introduce the const layer.
Spec: specs/kb-editorial-pipeline.md
Signed-off-by: Jose Alekhinne <jose@ctx.ist>
The cross-package-types audit forced the placement choice — every type used across packages must live in `internal/entity/`, full stop, with zero grandfathered exceptions. `entity.Sentinel` is a behavioral helper rather than a data shape, which is a mild semantic stretch for `entity/`, but per-package duplication and audit-exemption growth were both rejected: the convention is load-bearing and the next session needs one obvious shape to copy. Spec: specs/kb-editorial-pipeline.md Signed-off-by: Jose Alekhinne <jose@ctx.ist>
`err.kb.cli.*` and `write.kb-cli.*` keys mirrored the Go package
path `internal/{err,cli}/kb/cli/` into the YAML namespace, but
every other CLI command's keys (`err.add.*`, `err.fmt.*`,
`err.backup.*`, …) sit one level shallower because
`commands/text/{errors,write}.yaml` is implicitly the CLI-surface
text. The extra `cli` segment was leaky Go-side detail showing
up where users see it.
Renames (purely textual; no behavioral change):
err.kb.cli.<name> → err.kb.<name> (17 keys)
write.kb-cli.<name> → write.kb.<name> (14 keys)
DescKeyErrKbCli<X> → DescKeyErrKb<X> (17 consts)
DescKeyWriteKbCli<X> → DescKeyWriteKb<X> (14 consts)
embed/text/err_kb_cli.go → embed/text/err_kb.go
embed/text/write_kb_cli.go → embed/text/write_kb.go
The Go package paths under `internal/err/kb/cli/` and
`internal/cli/kb/` are unchanged — those mirror the directory
tree where `kb` legitimately has sibling subdomains
(`evidence/`, `sourcecoverage/`, `glossary/`, etc.). The leak
was YAML-side only.
No collisions with the flat `err.kb.*` / `write.kb.*` namespace:
existing subdomain keys all sit at depth 3+
(`err.kb.evidence.*`, `err.kb.sourcecoverage.*`, etc.).
Spec: specs/kb-editorial-pipeline.md
Signed-off-by: Jose Alekhinne <jose@ctx.ist>
Two surface-level docs described the old contract:
- `.context/CONVENTIONS.md` Error Handling: only said "error
constructors in internal/err"; nothing about sentinels.
- `docs/home/contributing.md` Errors section: "(never custom
error types)" — wrong both before and after this branch.
`internal/err/context.NotFoundError` predates the sweep;
`entity.Sentinel` postdates it.
Both updated to spell out the rule: identity sentinels are
`entity.Sentinel` typed-string consts, parameterised errors use
typed structs (`NotFoundError` shape), and `var ErrX =
errors.New("english")` is forbidden because the English leaks
into `.Error()` output and bypasses localization.
Spec: specs/kb-editorial-pipeline.md
Signed-off-by: Jose Alekhinne <jose@ctx.ist>
The ground skill's input contract accepts URLs, in-tree paths,
AND MCP resources, but every user-facing description called these
"external sources" — leading a reader (the project creator
included) to assume "external" meant "off-repo / network only."
The misnomer obscured ground's actual contract.
Renames (purely documentary; no contract change):
- Skill ledes (`internal/assets/claude/skills/ctx-kb-ground/`,
`integrations/copilot-cli/`, `integrations/opencode/`):
drop "external" from titles, descriptions, and prose. The
skill is now framed as a read-only freshness audit over
*tracked sources* declared in `grounding-sources.md`,
where tracked sources can live anywhere the kb cites them.
- `docs/cli/kb.md`: the `ctx kb ground` table row drops
"External grounding" in favor of "Read-only freshness
audit over tracked sources …".
- `docs/recipes/build-a-knowledge-base.md`: §Step 4 prose
corrected from "the equivalent of a fresh fetch + re-extract
pass" (which is wrong — ground does NOT re-extract) to
"read-only on the kb's prose and evidence; annotates the
ledger and flags drift for ingest." Table row updated.
- `pass-mode: external-refresh` in the ground closeout
frontmatter renamed to `pass-mode: refresh` (no consumers
outside the two SKILL.md drafts; grep-confirmed safe).
The phrase "external citations" survives in
`docs/recipes/build-a-knowledge-base.md` §The Problem because
that usage is idiomatic — citations to materials outside the
kb's own authored prose — and distinct from the "external
sources" overload that was misleading.
Spec: specs/kb-editorial-pipeline.md
Signed-off-by: Jose Alekhinne <jose@ctx.ist>
…eline Two related additions: 1. `docs/recipes/build-a-knowledge-base.md`: new H2 section "Bootstrap vs Steady State: Ingest First, Ground Later". The recipe walked Steps 1-6 linearly but never explained when to invoke ingest vs ground. The new section frames the distinction as *authority* (ingest writes, ground audits) and lays out the canonical lifecycle: bootstrap with ingest, curate `grounding-sources.md` by hand, run ground for steady-state hygiene. Closes with a rule-of-thumb table. 2. `.context/LEARNINGS.md`: new entry "Creator confusion is the strongest doc-quality signal". When the project author trips over the project's own framing — as happened this session with "external sources" — that's a louder signal than any user-facing confusion. The action is "rewrite to match the contract," not "defend or explain." Concrete handler this session: the external-framing rewrite landed in 46cc95b. Spec: specs/kb-editorial-pipeline.md Signed-off-by: Jose Alekhinne <jose@ctx.ist>
Go package names are lowercase with no underscores per
Effective Go: *"They are lower case, with no under_scores or
mixedCaps. They are often simple nouns, such as time, list,
http."* The stdlib has only no-underscore examples (`strconv`,
`httptest`, `bufio`). The package declaration was already
`package flagbind` (correctly); only the directory and the
import-path basename carried the underscore.
Changes are mechanical:
- `internal/flag_bind/` → `internal/flagbind/` (3 files).
- 54 import-path rewrites across cli/, audit/, doc/,
embed/flag/. The Go package name `flagbind` was already
correct, so call sites (`flagbind.Bool(...)` etc.) did
not change.
- `.context/CONVENTIONS.md`: new bullet under §Naming
codifying the rule — lowercase, no underscores, no
mixedCaps for Go package names; filename underscores are
fine (`foo_test.go`), package-name underscores are not.
`make lint` reports 0 issues; full `make test` is green.
Spec: specs/require-git.md
Signed-off-by: Jose Alekhinne <jose@ctx.ist>
`make test` runs the copilot-skills freshness check, which
invokes `hack/sync-copilot-skills.sh` against the actual skills
directory. Earlier commits on this branch updated canonical
claude SKILLs without re-running the sync; this commit captures
the pending drift.
The sync strips `allowed-tools:` (claude-only), adds
`tools: [bash]` (copilot-cli surface), unquotes the
`description:` string, and mirrors prose changes from the
canonical tree.
Eight skills updated:
- ctx-handover: lede now references KB-RULES.md §Four
inviolable rules; adds the authoritative-background-reading
pointer.
- ctx-kb-ask, ctx-kb-ingest, ctx-kb-note,
ctx-kb-site-review, ctx-remember, ctx-wrap-up: minor
canonical drift (prose alignment, frontmatter formatting).
- ctx-kb-ground: matches the "drop external" rewrite from
46cc95b (frontmatter requoting + tools-key strip from the
sync side; lede prose was already aligned).
No content authored here — this is mechanical sync output.
Spec: specs/kb-editorial-pipeline.md
Signed-off-by: Jose Alekhinne <jose@ctx.ist>
Project-wide sweep applying the Effective Go package-naming convention codified in 1835e02. The flagbind rename in that commit was the worked example; this commit applies the same rule to every remaining underscored Go-package directory under `internal/` and `cmd/`. ## Renames (31 packages) Single-segment (directory only; package declaration was already correct): internal/git_meta/ → internal/gitmeta/ internal/config/git_meta/ → internal/config/gitmeta/ internal/err/git_meta/ → internal/err/gitmeta/ internal/cli/setup/core/copilot_cli/ → internal/cli/setup/core/copilotcli/ internal/cli/system/cmd/session_event/ → internal/cli/system/cmd/sessionevent/ Two-step (both directory and `package <name>` declaration): internal/cli/initialize/core/claude_check/ → claudecheck/ internal/cli/system/cmd/block_non_path_ctx/ → blocknonpathctx/ internal/cli/system/cmd/check_anchor_drift/ → checkanchordrift/ internal/cli/system/cmd/check_ceremony/ → checkceremony/ internal/cli/system/cmd/check_context_size/ → checkcontextsize/ internal/cli/system/cmd/check_freshness/ → checkfreshness/ internal/cli/system/cmd/check_hub_sync/ → checkhubsync/ internal/cli/system/cmd/check_journal/ → checkjournal/ internal/cli/system/cmd/check_knowledge/ → checkknowledge/ internal/cli/system/cmd/check_map_staleness/ → checkmapstaleness/ internal/cli/system/cmd/check_memory_drift/ → checkmemorydrift/ internal/cli/system/cmd/check_persistence/ → checkpersistence/ internal/cli/system/cmd/check_reminder/ → checkreminder/ internal/cli/system/cmd/check_resource/ → checkresource/ internal/cli/system/cmd/check_skill_discovery/ → checkskilldiscovery/ internal/cli/system/cmd/check_task_completion/ → checktaskcompletion/ internal/cli/system/cmd/check_version/ → checkversion/ internal/cli/system/cmd/context_load_gate/ → contextloadgate/ internal/cli/system/cmd/mark_journal/ → markjournal/ internal/cli/system/cmd/mark_wrapped_up/ → markwrappedup/ internal/cli/system/cmd/post_commit/ → postcommit/ internal/cli/system/cmd/qa_reminder/ → qareminder/ internal/cli/system/cmd/specs_nudge/ → specsnudge/ internal/cli/system/core/post_commit/ → postcommit/ internal/config/load_gate/ → loadgate/ internal/write/mark_journal/ → markjournal/ ## File renames (4 basename-matching files) Single-file packages whose filename mirrored the directory basename — each file renamed to match the new package name: copilot_cli/copilot_cli.go → copilotcli/copilotcli.go config/git_meta/git_meta.go → config/gitmeta/gitmeta.go config/load_gate/load_gate.go → config/loadgate/loadgate.go write/mark_journal/mark_journal.go → write/markjournal/markjournal.go ## CLI-name mapping CLI subcommand names keep their hyphens (`ctx system check-anchor-drift` is unchanged); only the Go package directory loses the separator. The TestDocGoSubcommandDrift compliance check is updated: hyphen-to-underscore mapping (`strings.ReplaceAll(name, "-", "_")`) becomes hyphen-strip (`strings.ReplaceAll(name, "-", "")`) to reflect the new convention. ## Verification - `go build ./...` clean. - `golangci-lint run`: 0 issues. - `make test`: full suite green, including TestDocGoSubcommandDrift after the normalize-rule update. - `find internal cmd -type d -name '*_*'` returns nothing (excluding non-Go `_template/` and `_ctx-*` directories). ## Documentation Doc/recipe/spec markdowns that referenced the old paths were swept along with the code. Archive markdowns under `.context/archive/` were updated too — they're internal project history, and a working path reference is more useful than a frozen broken one. Spec: specs/require-git.md Signed-off-by: Jose Alekhinne <jose@ctx.ist>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
refactor(packages): drop underscores from all Go package directories
Project-wide sweep applying the Effective Go package-naming
convention codified in 1835e02. The flagbind rename in that
commit was the worked example; this commit applies the same
rule to every remaining underscored Go-package directory under
internal/andcmd/.Renames (31 packages)
Single-segment (directory only; package declaration was
already correct):
internal/git_meta/ → internal/gitmeta/
internal/config/git_meta/ → internal/config/gitmeta/
internal/err/git_meta/ → internal/err/gitmeta/
internal/cli/setup/core/copilot_cli/ → internal/cli/setup/core/copilotcli/
internal/cli/system/cmd/session_event/ → internal/cli/system/cmd/sessionevent/
Two-step (both directory and
package <name>declaration):internal/cli/initialize/core/claude_check/ → claudecheck/
internal/cli/system/cmd/block_non_path_ctx/ → blocknonpathctx/
internal/cli/system/cmd/check_anchor_drift/ → checkanchordrift/
internal/cli/system/cmd/check_ceremony/ → checkceremony/
internal/cli/system/cmd/check_context_size/ → checkcontextsize/
internal/cli/system/cmd/check_freshness/ → checkfreshness/
internal/cli/system/cmd/check_hub_sync/ → checkhubsync/
internal/cli/system/cmd/check_journal/ → checkjournal/
internal/cli/system/cmd/check_knowledge/ → checkknowledge/
internal/cli/system/cmd/check_map_staleness/ → checkmapstaleness/
internal/cli/system/cmd/check_memory_drift/ → checkmemorydrift/
internal/cli/system/cmd/check_persistence/ → checkpersistence/
internal/cli/system/cmd/check_reminder/ → checkreminder/
internal/cli/system/cmd/check_resource/ → checkresource/
internal/cli/system/cmd/check_skill_discovery/ → checkskilldiscovery/
internal/cli/system/cmd/check_task_completion/ → checktaskcompletion/
internal/cli/system/cmd/check_version/ → checkversion/
internal/cli/system/cmd/context_load_gate/ → contextloadgate/
internal/cli/system/cmd/mark_journal/ → markjournal/
internal/cli/system/cmd/mark_wrapped_up/ → markwrappedup/
internal/cli/system/cmd/post_commit/ → postcommit/
internal/cli/system/cmd/qa_reminder/ → qareminder/
internal/cli/system/cmd/specs_nudge/ → specsnudge/
internal/cli/system/core/post_commit/ → postcommit/
internal/config/load_gate/ → loadgate/
internal/write/mark_journal/ → markjournal/
File renames (4 basename-matching files)
Single-file packages whose filename mirrored the directory
basename — each file renamed to match the new package name:
copilot_cli/copilot_cli.go → copilotcli/copilotcli.go
config/git_meta/git_meta.go → config/gitmeta/gitmeta.go
config/load_gate/load_gate.go → config/loadgate/loadgate.go
write/mark_journal/mark_journal.go → write/markjournal/markjournal.go
CLI-name mapping
CLI subcommand names keep their hyphens
(
ctx system check-anchor-driftis unchanged); only the Gopackage directory loses the separator. The
TestDocGoSubcommandDrift compliance check is updated:
hyphen-to-underscore mapping (
strings.ReplaceAll(name, "-", "_")) becomes hyphen-strip (strings.ReplaceAll(name, "-", "")) to reflect the new convention.Verification
go build ./...clean.golangci-lint run: 0 issues.make test: full suite green, includingTestDocGoSubcommandDrift after the normalize-rule update.
find internal cmd -type d -name '*_*'returns nothing(excluding non-Go
_template/and_ctx-*directories).Documentation
Doc/recipe/spec markdowns that referenced the old paths were
swept along with the code. Archive markdowns under
.context/archive/were updated too — they're internalproject history, and a working path reference is more useful
than a frozen broken one.
Spec: specs/require-git.md