Continuity
Learn, record, audit, and apply codebase patterns consistently using CK's existing tools. No external registry files, no new infrastructure — everything lives in CK typed memory and findings.
This skill fills the gap between CK's policy-level validation (ck_validate) and unstructured convention hints in AGENTS.md. It lets you encode local coding conventions — "our screens follow this shape, hooks use this pattern, imports go here" — as searchable, auditable, CI-gatable rules.
Do NOT use when
- The work is a one-off code change (governance is handled by
controlkeel-governance)
- The question is about security policy (use
security-review)
- You need to trace code paths without enforcing conventions (use
investigate)
- The repo has no patterns worth recording yet
How it works
CK typed memory IS the pattern registry. ck_finding IS the violation tracker. ck_fs_* tools ARE the scanner. This skill just wires them together:
| Need |
CK tool |
| Store a pattern |
ck_memory_record(record_type: "decision", tags: ["continuity", "pattern", "active"]) |
| Find known patterns |
ck_memory_search(query: "...", record_type: "decision") + filter tags |
| Find canonical files |
ck_fs_find, ck_fs_grep to locate implementations |
| Read source-of-truth |
ck_fs_read |
| Audit files for drift |
ck_fs_grep for violation signals, ck_fs_read to verify |
| Record violations |
ck_finding(category: "continuity", severity: "...", rule_id: "continuity.<pattern-name>") |
| Scope to changed files |
ck_git_diff to list changed paths first |
| CI gate |
ck_validate against finding-based policy |
Pattern Registry
Patterns live in CK typed memory. To learn a pattern, record it with a consistent shape:
# Pattern recording convention
record_type: "decision"
tags: ["continuity", "pattern", "<status>"]
# status: active | draft | deprecated
# Body shape (markdown):
# ## Pattern: <kebab-case-name>
# - **Source of truth:** <file paths>
# - **Applies to:** <glob patterns>
# - **Does not apply to:** <glob exceptions>
# - **Rule summary:** <one paragraph>
# - **Required shape:** <observable rules>
# - **Violation signals:** <searchable patterns>
# - **Severity:** high | medium | low
# - **Fix strategy:** <mechanical fix steps>
Tag conventions
["continuity", "pattern", "active"] — actively enforced
["continuity", "pattern", "draft"] — being refined
["continuity", "pattern", "deprecated"] — no longer enforced
Invocation modes
learn — Record a new pattern
When the user says "learn this pattern" or shows you canonical example files:
- Read the provided files with
ck_fs_read.
- Search for similar implementations with
ck_fs_find + ck_fs_grep.
- Compare examples. Identify the canonical shape.
- Ask focused questions if ambiguous. Don't guess. Point to specific files and ask which should be canonical.
- Once confirmed, record with
ck_memory_record using the shape above.
- Tell the user what was recorded.
check — Audit for drift (read-only)
When the user says "check this pattern" or "audit for drift":
- Search
ck_memory_search(tags: ["continuity", "pattern"]) for matching patterns.
- If a specific name given, filter by body content matching that name.
- If scope wasn't specified, check
ck_git_diff for changed files first (changed-files scope).
- Or audit the full path scope if user explicitly requests full-repo.
- For each pattern, search for violation signals using
ck_fs_grep.
- Read candidate files with
ck_fs_read to verify.
- Report violations concisely. Do NOT edit files.
- For each violation, offer to record it with
ck_finding if the user wants it tracked.
fix — Audit and apply safe fixes
When the user says "fix this pattern" or "apply the pattern":
- Run the
check workflow first.
- Apply high-confidence mechanical fixes directly.
- Ask before fixes that rename public symbols, move files across packages, or require choosing between canonical examples.
- Re-run the pattern search to confirm drift is closed.
- Run repo-native validation (tests, lint, typecheck) if available.
- Summarize what changed.
ci — Deterministic audit for automation
When run in CI or pre-commit context:
- Run
ck_git_diff to get changed files.
- Search
ck_memory_search(tags: ["continuity", "pattern", "active"]).
- For patterns with
changed-files scope, audit only changed files against violation signals.
- For patterns with
full-repo scope, audit the full scope.
- Report violations as
ck_finding(category: "continuity", severity: rule_severity).
- End with a stable summary line matching the pattern:
CONTINUITY_RESULT: pass|fail
PATTERNS_CHECKED: <n>
VIOLATIONS: <n>
Operating principles
- Code wins over docs. Start from actual implementations, not documentation.
- CK memory wins over inference. Read recorded patterns before making claims. If memory contradicts current code, report the conflict.
- Do not invent canonical patterns. If unsure which file is canonical, ask the user. Point to files, not abstract preferences.
- Record decisions. After the user identifies canonical examples, save in CK memory so future sessions inherit it.
- Prefer narrow scope first. Audit changed files or provided paths before scanning the whole repo.
- Separate detection from fixing. First report violations. Then fix only what's clearly implied by pattern rules.
- Avoid shallow text matching. Use
ck_fs_grep to find candidates, but verify structure by reading relevant files.
- Respect baselines. If a pattern has known legacy drift, don't report it as a new violation.
Useful search tactics
# Find pattern candidates
ck_fs_find --query "ComponentName" --path lib/
# Search for violation signals
ck_fs_grep --query "import { useState }" --path lib/app/
# List changed files for CI scope
ck_git_diff --base-ref origin/main...HEAD
# Find related implementations
ck_fs_find --query "*.tsx" --path lib/app/screens
Output style
Be direct and actionable. Never dump raw search results. Always distinguish:
- Confirmed canonical: file paths with evidence
- Inferred but unconfirmed: labeled as such
- Violations that should be fixed: specific files + issue + expected shape
- Intentional exceptions: known drift, not actionable
- Open questions: what needs human input
If no violations found, say:
Continuity check passed for <pattern>/<scope>.
1---2name: continuity3description: Learn, record, audit, and apply codebase patterns consistently across a repo by comparing current code to canonical local examples stored in CK memory. Use when asked to preserve continuity, learn a pattern, check drift, fix inconsistent implementations, or enforce local conventions.4license: Apache-2.05---67# Continuity89Learn, record, audit, and apply codebase patterns consistently using CK's existing tools. No external registry files, no new infrastructure — everything lives in CK typed memory and findings.1011This skill fills the gap between CK's policy-level validation (`ck_validate`) and unstructured convention hints in `AGENTS.md`. It lets you encode *local coding conventions* — "our screens follow this shape, hooks use this pattern, imports go here" — as searchable, auditable, CI-gatable rules.1213## Do NOT use when14- The work is a one-off code change (governance is handled by `controlkeel-governance`)15- The question is about security policy (use `security-review`)16- You need to trace code paths without enforcing conventions (use `investigate`)17- The repo has no patterns worth recording yet1819## How it works2021CK typed memory IS the pattern registry. `ck_finding` IS the violation tracker. `ck_fs_*` tools ARE the scanner. This skill just wires them together:2223| Need | CK tool |24|------|---------|25| Store a pattern | `ck_memory_record(record_type: "decision", tags: ["continuity", "pattern", "active"])` |26| Find known patterns | `ck_memory_search(query: "...", record_type: "decision")` + filter tags |27| Find canonical files | `ck_fs_find`, `ck_fs_grep` to locate implementations |28| Read source-of-truth | `ck_fs_read` |29| Audit files for drift | `ck_fs_grep` for violation signals, `ck_fs_read` to verify |30| Record violations | `ck_finding(category: "continuity", severity: "...", rule_id: "continuity.<pattern-name>")` |31| Scope to changed files | `ck_git_diff` to list changed paths first |32| CI gate | `ck_validate` against finding-based policy |3334## Pattern Registry3536Patterns live in CK typed memory. To learn a pattern, record it with a consistent shape:3738```elixir39# Pattern recording convention40record_type: "decision"41tags: ["continuity", "pattern", "<status>"]42# status: active | draft | deprecated4344# Body shape (markdown):45# ## Pattern: <kebab-case-name>46# - **Source of truth:** <file paths>47# - **Applies to:** <glob patterns>48# - **Does not apply to:** <glob exceptions>49# - **Rule summary:** <one paragraph>50# - **Required shape:** <observable rules>51# - **Violation signals:** <searchable patterns>52# - **Severity:** high | medium | low53# - **Fix strategy:** <mechanical fix steps>54```5556### Tag conventions5758- `["continuity", "pattern", "active"]` — actively enforced59- `["continuity", "pattern", "draft"]` — being refined60- `["continuity", "pattern", "deprecated"]` — no longer enforced6162## Invocation modes6364### learn — Record a new pattern6566When the user says "learn this pattern" or shows you canonical example files:67681. Read the provided files with `ck_fs_read`.692. Search for similar implementations with `ck_fs_find` + `ck_fs_grep`.703. Compare examples. Identify the canonical shape.714. **Ask focused questions if ambiguous.** Don't guess. Point to specific files and ask which should be canonical.725. Once confirmed, record with `ck_memory_record` using the shape above.736. Tell the user what was recorded.7475### check — Audit for drift (read-only)7677When the user says "check this pattern" or "audit for drift":78791. Search `ck_memory_search(tags: ["continuity", "pattern"])` for matching patterns.802. If a specific name given, filter by body content matching that name.813. If scope wasn't specified, check `ck_git_diff` for changed files first (changed-files scope).824. Or audit the full path scope if user explicitly requests full-repo.835. For each pattern, search for violation signals using `ck_fs_grep`.846. Read candidate files with `ck_fs_read` to verify.857. Report violations concisely. Do NOT edit files.868. For each violation, offer to record it with `ck_finding` if the user wants it tracked.8788### fix — Audit and apply safe fixes8990When the user says "fix this pattern" or "apply the pattern":91921. Run the `check` workflow first.932. Apply high-confidence mechanical fixes directly.943. **Ask before** fixes that rename public symbols, move files across packages, or require choosing between canonical examples.954. Re-run the pattern search to confirm drift is closed.965. Run repo-native validation (tests, lint, typecheck) if available.976. Summarize what changed.9899### ci — Deterministic audit for automation100101When run in CI or pre-commit context:1021031. Run `ck_git_diff` to get changed files.1042. Search `ck_memory_search(tags: ["continuity", "pattern", "active"])`.1053. For patterns with `changed-files` scope, audit only changed files against violation signals.1064. For patterns with `full-repo` scope, audit the full scope.1075. Report violations as `ck_finding(category: "continuity", severity: rule_severity)`.1086. End with a stable summary line matching the pattern:109110```111CONTINUITY_RESULT: pass|fail112PATTERNS_CHECKED: <n>113VIOLATIONS: <n>114```115116## Operating principles1171181. **Code wins over docs.** Start from actual implementations, not documentation.1192. **CK memory wins over inference.** Read recorded patterns before making claims. If memory contradicts current code, report the conflict.1203. **Do not invent canonical patterns.** If unsure which file is canonical, ask the user. Point to files, not abstract preferences.1214. **Record decisions.** After the user identifies canonical examples, save in CK memory so future sessions inherit it.1225. **Prefer narrow scope first.** Audit changed files or provided paths before scanning the whole repo.1236. **Separate detection from fixing.** First report violations. Then fix only what's clearly implied by pattern rules.1247. **Avoid shallow text matching.** Use `ck_fs_grep` to find candidates, but verify structure by reading relevant files.1258. **Respect baselines.** If a pattern has known legacy drift, don't report it as a new violation.126127## Useful search tactics128129```bash130# Find pattern candidates131ck_fs_find --query "ComponentName" --path lib/132133# Search for violation signals134ck_fs_grep --query "import { useState }" --path lib/app/135136# List changed files for CI scope137ck_git_diff --base-ref origin/main...HEAD138139# Find related implementations140ck_fs_find --query "*.tsx" --path lib/app/screens141```142143## Output style144145Be direct and actionable. Never dump raw search results. Always distinguish:146147- **Confirmed canonical:** file paths with evidence148- **Inferred but unconfirmed:** labeled as such149- **Violations that should be fixed:** specific files + issue + expected shape150- **Intentional exceptions:** known drift, not actionable151- **Open questions:** what needs human input152153If no violations found, say:154155> Continuity check passed for `<pattern>/<scope>`.