Skip to content

agents + knoledge base + cognetive self check protocol + changelog updating#2

Open
codefather-labs wants to merge 224 commits into
Koroqe:mainfrom
codefather-labs:main
Open

agents + knoledge base + cognetive self check protocol + changelog updating#2
codefather-labs wants to merge 224 commits into
Koroqe:mainfrom
codefather-labs:main

Conversation

@codefather-labs

Copy link
Copy Markdown

No description provided.

 Aleksandra added 30 commits April 24, 2026 20:59
codefatherdev and others added 30 commits May 10, 2026 20:41
…ech-decisions log

Five-step explanation: ingest-time encoding → query-time encoding + K-NN →
L2/cosine equivalence on unit-norm vectors → asymmetric passage/query
prefix discipline → RRF k=60 fusion. Future Medium-article material;
also serves as onboarding reading for anyone new to the retrieval stack.
Vector + multimodal retrieval backend (iter-2) for claudeknows:

- Hybrid lexical + dense + RRF k=60 retrieval (default mode = hybrid)
- Schema v3 (sqlite-vec chunks_vec + pages table + per-chunk page columns)
- e5-multilingual-small encoder (384-dim, fastembed-rs, L2-normalized)
- Page-level addressing via 'claudeknows page <doc> <N> [--range R]'
- 'claudeknows compare' A/B-test of all 3 search modes side-by-side
- 'claudeknows search --context N' for paragraph-level neighbor expansion
- 'claudeknows reindex-pages' backfill for legacy v2 indexes
- Real PaddleOCR PP-OCRv4 inference for image chunks (ocr-rs / MNN)
- Bench harness + 12-query golden set; +75% Recall@5 over lexical baseline

Reconciled with main's parallel page-tracking implementation (chunks
page_start/page_end + per-page ingest pipeline) on top of the richer
feat-branch UX (range fetch, basename lookup, reindex-pages backfill).
Existing v2 / pre-merge v3 indexes migrate in-place via the column-rename
fast-path in open_or_init_v2.

Version bump 0.3.1 → 0.4.0; CHANGELOG promoted [Unreleased] → [0.4.0].
Three fixes for the v0.4.0 release pipeline:

1. Bump binary-size assertion 10 MB → 35 MB. Iter-1's 10 MB cap was for
   pdfium-only builds. Iter-2 bundles fastembed-rs (e5 ONNX runtime),
   sqlite-vec, ocr-rs (PaddleOCR/MNN), and bundled-sqlite — observed
   release-build sizes are linux-x64 ~29 MB, darwin-arm64 ~24 MB.

2. Add 'shell: bash' to the Cargo build step so the bash-style line
   continuations (\) parse correctly on windows-latest. Without it the
   step defaults to PowerShell which interprets '--' as a unary op.

3. Mark darwin-x64 and linux-arm64 as best-effort alongside windows-x64.
   ort-sys 2.0.0-rc.12 (transitive via fastembed) does not ship prebuilt
   ONNX Runtime binaries for those targets; building ORT from source
   needs a separate CMake step that's deferred to iter-2.1.
The hybrid retrieval CLI (formerly tools/sdlc-knowledge/) and its
documentation moved to a standalone GitHub repository at:

  https://github.com/codefather-labs/claudebase

The binary is renamed from sdlc-knowledge to claudebase; the global CLI
alias is renamed from claudeknows to claudebase; the install path moved
from ~/.claude/tools/sdlc-knowledge/ to ~/.claude/tools/claudebase/.
Version-continues from sdlc-knowledge-v0.4.0 (2026-05-10) as
claudebase-v0.4.0 in the new repo with no version regression.

Changes in this monorepo:
- install.sh, install.ps1: download URL hard-coded to
  github.com/codefather-labs/claudebase/releases (NOT derived from
  REPO_URL); rename of variables (KNOWLEDGE_VERSION ->
  CLAUDEBASE_VERSION, $KnowledgeVersion -> $ClaudebaseVersion) and
  function names (register_claudeknows_alias ->
  register_claudebase_alias, claudeknows.cmd -> claudebase.cmd);
  added migration cleanup that removes the pre-2026-05-10
  ~/.claude/tools/sdlc-knowledge/ directory and the legacy
  claudeknows symlink on next install; deprecated the
  --bootstrap-release flag with a stderr message pointing to
  claudebase/RELEASING.md; replaced the cargo source-build fallback
  with a deprecation stub.
- README.md, CHANGELOG.md: rename references to the new tool name;
  CHANGELOG [Unreleased] documents the migration.
- src/agents/ (12 files), src/rules/knowledge-base*.md: bulk find-replace
  claudeknows -> claudebase, paths updated, in-repo source paths
  rewritten to tag-pinned cross-repo URLs at
  github.com/codefather-labs/claudebase/blob/claudebase-v0.4.0/...
- src/agents/release-engineer.md: removed the dual tag-scheme
  disambiguation (tools/claudebase/ no longer exists in this monorepo);
  the agent now selects bare v<X.Y.Z> exclusively.
- docs/PRD.md: §15 (vector-retrieval-backend, ~256 lines of
  feature spec) replaced with a 9-line stub linking to claudebase repo.

Removed from this monorepo:
- tools/sdlc-knowledge/ (entire Rust crate)
- .github/workflows/sdlc-knowledge-release.yml
- docs/architecture/vector-retrieval-technical-decisions.md
- docs/benchmarks/2026-05-10-vector-retrieval-backend.md
- docs/use-cases/vector-retrieval-backend_use_cases.md
- docs/qa/vector-retrieval-backend_test_cases.md
- docs/design/vector-retrieval-backend.md

End-to-end verified: bash install.sh --yes --local on this machine
removed the old sdlc-knowledge install + claudeknows symlink, downloaded
claudebase-darwin-arm64 from the new repo's release, registered the
claudebase alias, and the live 39-doc / 75895-chunk index.db continues
to serve hybrid + page queries via the new binary.
…v iteration loop

Closes the gap where qa-planner documented test cases but no one strictly
executed them and demanded concrete evidence. The result was visual /
UX defects slipping through merge-ready because the e2e-runner code-authoring
pass didn't examine screenshots or flag visual regressions.

New agent: qa-engineer (18th core agent)
- Executes the documented QA plan against the running implementation
- UI/UX cases: Playwright MCP (navigate / snapshot / click / take_screenshot
  / fill_form / wait_for / console_messages / network_requests / evaluate /
  resize / etc.) AND examines screenshots visually (multimodal vision) for
  layout / overflow / z-index / color / loading-state defects
- API / DB / CLI / FS cases: Bash with concrete artifact capture (status
  code + body + headers / SQL row count + key columns / exit code + stdout
  + file hashes)
- Emits per-test-case PASS / FAIL / BLOCKED verdict
- PASS requires at least ONE concrete evidence artifact citing tool
  invocation that proved it
- FAIL requires expected-vs-actual mismatch + evidence + fix_directive
  pointing at file:line or symptom
- BLOCKED requires fact-grounded exit_argument + human_needs_to directive
- Strict cognitive-self-check protocol: a verdict without evidence is a
  fact-shaped lie and is automatically FAIL or BLOCKED
- Visual-defect flagging: catches defects observed in screenshots even
  when not enumerated in the test plan (toast z-index, text overflow,
  contrast, missing loading states, network 4xx/5xx swallowed silently)

New skill: /qa-cycle
- Pre-flight: hard-fails before iteration 1 if QA plan has UI/UX cases
  and Playwright MCP is not configured (user-chosen Hard FAIL mode)
- Iteration N:
  - Step 1: spawn qa-engineer; parse structured verdict
  - Step 2 (overall=PASS): exit 0 with summary, /merge-ready can proceed
  - Step 3 (overall=FAIL): spawn implementer with fix directives;
    implementer reports back PASS (commit hash) or BLOCKED (its own
    fact-grounded escape hatch); on implementer PASS, increment N and
    re-spawn qa-engineer
  - Step 4 (overall=BLOCKED from either side): halt the loop, surface
    exit_argument + human_needs_to via AskUserQuestion with proposed
    alternatives + Abort option
- No iteration cap — exit only via PASS, BLOCKED, or implementer FAIL
- Evidence artifacts preserved per-iteration under
  .claude/qa-evidence/iter-N/ so the human can spot-check at any time

Enhanced qa-planner
- Each test case row now requires Verification Class (UI/UX | API | DB |
  CLI | FS | Mixed) and Evidence Required columns
- Evidence Required must name CONCRETE artifacts (not "result is correct"
  or "behaves as expected") — qa-engineer's strict-fact-check protocol
  would mark vague entries as FAIL/BLOCKED at execution time
- For features with a visible browser surface, plan must include ≥ 2
  visual-quality cases with explicit screenshot-based assertions

Pipeline integration (NOT just file additions — actually wired in)
- src/claude.md: qa-engineer in Agency Roles table (18th); /qa-cycle in
  Pipeline Commands; new Phase 3.5 (QA Cycle) between Implementation and
  Quality Gates; After Plan Approval steps renumbered with /qa-cycle as
  step 3 and /merge-ready as step 4; new Plan Critic check for QA test
  case format strictness; Deliverables checklist note that QA test cases
  must carry Verification Class + Evidence Required columns
- src/commands/develop-feature.md: new Phase 2.75 (QA Cycle) chained
  automatically between Phase 2 (impl) and Phase 3 (merge-ready)
- src/commands/merge-ready.md: hard pre-requisite — exits before Gate 0
  with NOT MERGE READY if .claude/qa-evidence/iter-N/ is missing
- src/rules/scratchpad.md: new Status value
  qa-cycle iter N (PASS=p FAIL=f BLOCKED=b)
- src/rules/cognitive-self-check.md: qa-engineer added to the 13
  thinking agents in-scope list
- src/rules/knowledge-base.md + knowledge-base-tool.md: same
- src/agents/role-planner.md: qa-engineer added to the 18 core agent
  collision list (slug collision with qa-engineer = MAJOR)

Page subcommand syntax fixes (drift from main-merge)
- 13 files in src/rules + src/agents referenced the old flag-based
  page --by-id <id> --page <N> syntax (main's pre-merge form)
- Replaced everywhere with the positional page <doc> <N> syntax that
  the current claudebase v0.4.0 binary actually accepts
- Same fix in install.ps1 / install.sh help text

Installer updates
- install.sh + install.ps1: 17 → 18 agents, 5/7 → 8 commands; new
  /qa-cycle entry in COMMANDS AVAILABLE block and post-install summary
- The actual file deployment is automatic via glob — qa-engineer.md and
  qa-cycle.md picked up by the existing for-loop over src/agents/*.md
  and src/commands/*.md

CHANGELOG.md
- [Unreleased] Added entry describing the qa-engineer / /qa-cycle
  capability and the qa-planner format upgrade

Counts bumped throughout
- 17 → 18 core agents (CLAUDE.md, README.md, install.sh/.ps1,
  role-planner collision list, merge-ready teardown list)
- 12 → 13 thinking agents (cognitive-self-check, knowledge-base,
  knowledge-base-tool, README, knowledge-ingest)

End-to-end verified: bash install.sh --yes --local deployed
qa-engineer.md and qa-cycle.md to ~/.claude/agents/ and
~/.claude/commands/; /qa-cycle now appears in the available skills
list and can be invoked from any Claude Code session.
Adds 3 new agents and 2 new commands wired into the SDLC control flow:
- red-team — devil's advocate, 6 attack vectors (auto-chained from
  /bootstrap-feature Step 5.25 and /develop-feature Phase 1.5)
- consolidator + /consolidate — hippocampal sleep-replay drift detection,
  6 fixed passes (auto-chained between waves in /develop-feature Phase 2)
- reflection + /reflect — Default Mode Network unfocused observation
  (exclusively user-invoked, never auto-chained)

Wires 7 neuroscience-inspired protocols into actual pipeline flow:
- Post-error slowing (ACC) — deliberate-mode directive injection on
  /qa-cycle iter N+1 after FAIL
- Sunk-cost circuit breaker (OFC) — pause after 3 non-converging
  implementer iterations on same files with similar diff sizes
- Predictive coding (Friston) — slice 'Predicted outcome' field +
  verifier Level 3.5 prediction-error delta check
- Salience tags (anterior insula) — high/medium/low on every Facts /
  Decisions entry for attention-priority sorting
- Memory consolidation, confirmation-bias debiasing, DMN — see above

Gives every agent a persona (22 total) baked into the prompt files,
so install.sh redeploys them globally:
- Mira (orchestrator) in src/claude.md
- 21 specialists: Spec, Else, Vera, Lien, Cast, Vesna, Cleave, Vex,
  Vault, Pip, Reno, Argus, Mnem, Drift, Roan, Brisk, Knit, Scribe,
  Sweep, Tally, Vale

Generalizes user references — hardcoded 'Aleksandra' replaced with
'your operator' so the pipeline is portable to any user who installs
via install.sh. Persona openings use 'Your name is <Name>' pattern.

Bumps counts: 18 → 21 agents, 8 → 10 commands across CLAUDE.md,
README.md, install.sh, install.ps1, role-planner / merge-ready
collision lists.
…ebase-rename

fix(commands): rename claudeknows → claudebase in /knowledge-ingest spec
…corpus

Slices 8 + 9 of the agent-insights-base feature. Wires the
claudebase-side `insight create / search / list / random / get / gc /
delete` surface into the SDLC pipeline:

Agent prompts (Slice 8 — 16 in-scope thinking agents):
- prd-writer, ba-analyst, architect, qa-planner, planner,
  security-auditor, code-reviewer, verifier, refactor-cleaner,
  resource-architect, role-planner, release-engineer, qa-engineer
- reflection, consolidator, red-team
Each receives an `## Insights Corpus (when present)` section with the
retrieval protocol (call insight search at task receipt, cite hits in
`## Facts -> ### Verified facts` as `insights-base: doc#<id> ...`) and
the surfacing protocol (call insight create at task end ONLY for
cognitive insights along the three axes — self-learning, peer-bias,
prediction-reality). Each agent also gets a per-agent guidance line
naming the source_type tag most natural to its role (consolidator ->
consolidator-drift, red-team -> red-team-objection, etc.).

Exempt (NOT touched): test-writer, build-runner, e2e-runner,
doc-updater, changelog-writer — these are deterministic spec-followers
whose inputs are already fact-cited by upstream thinking agents.

Rule updates (Slice 9):
- src/rules/knowledge-base-tool.md: new "## Insights corpus" section
  covering activation (opt-in per project, no separate sentinel),
  three-axis cognitive taxonomy (mandatory scope filter), retrieval +
  surfacing protocols, salience-to-retention table, admin surface
  boundary (agents call create/search, operator calls list/random/
  get/gc/delete), books-vs-insights routing table.
- src/rules/knowledge-base.md: new "## `insight` subcommand" section
  documenting all 7 CLI subcommands, exit-code uniformity (0 success,
  1 runtime, 2 usage), dedup contract (exact-sha + semantic cosine
  >0.92), path-canonicalization parity with the books subcommands.
- src/rules/cognitive-self-check.md: salience-field block extended
  with a retention table tying high/medium/low to ∞/365d/90d TTL and
  warning against over-marking insights as high (defeats gc).

Activation contract preserved: when
`<project>/.claude/knowledge/insights.db` does not exist (default for
projects that have never run `insight create`), the protocol is silent
no-op — agents proceed exactly as they did pre-feature.

claudebase-side companion commits: e7bcc1c (slice 3 + admin surface),
8890670 (slice 4 search filters), 4b49396 (slice 5 semantic dedup),
2360ec1 (slice 6 --corpus all), 7393910 (slice 7 gc + delete).
Wires the claudebase-side agent-insights corpus into the SDLC pipeline.

Agent-prompt integration (16 in-scope thinking agents):
- prd-writer, ba-analyst, architect, qa-planner, planner,
  security-auditor, code-reviewer, verifier, refactor-cleaner,
  resource-architect, role-planner, release-engineer, qa-engineer,
  reflection, consolidator, red-team

Each receives an `## Insights Corpus (when present)` section with the
retrieval protocol (call insight search at task receipt, cite hits in
`## Facts -> ### Verified facts` as `insights-base: ...`) and the
surfacing protocol (call insight create at task end ONLY for cognitive
insights along the three axes: self-learning, peer-bias, prediction-
reality mismatch). Per-agent guidance lines name the source_type tag
most natural to each role.

Exempt (not touched): test-writer, build-runner, e2e-runner,
doc-updater, changelog-writer — deterministic spec-followers whose
inputs are already fact-cited by upstream thinking agents.

Rule updates:
- src/rules/knowledge-base-tool.md: new "## Insights corpus" section
  with activation, three-axis taxonomy, retrieval/surfacing protocols,
  salience-retention table, admin-vs-agent surface boundary, books-vs-
  insights routing.
- src/rules/knowledge-base.md: new "## `insight` subcommand" section
  documenting all 7 CLI subcommands and exit-code uniformity.
- src/rules/cognitive-self-check.md: salience-field block extended
  with retention table tying high/medium/low to inf/365d/90d TTL.

Activation: opt-in per project via existence of
`<project>/.claude/knowledge/insights.db` (auto-created on first
`claudebase insight create`). Absence = silent no-op, byte-identical
to pre-feature behavior.

Companion claudebase-side commits: 8 commits merged into claudebase
main as 99196a8 (PR-free merge), introducing Slices 1-10 of the
agent-insights-base feature.
v0.5.0 ships the agent-insights corpus (parallel insights.db alongside
the books index.db). Schema v4 additive; books corpus unchanged.
GHA release workflow at claudebase repo triggered via the
claudebase-v0.5.0 tag.
…ommands

install.ps1 was missing the new /consolidate and /reflect commands in
its --Help text and post-install summary. Adds both, with the same
descriptions as install.sh.

README's Windows section was a brief paragraph. Expands it to a
self-contained install guide: prerequisites, clone-and-install flow
via cmd.exe or PowerShell directly, flag table, what-gets-installed
inventory, post-install verification, and a troubleshooting block
covering the three most common failure modes (missing tar.exe on
pre-1803 Windows, execution policy blocking install.ps1, missing
PATH refresh after install).
…corporate-code-style-reviewer

Three changes land together because they touch overlapping files in the
install / agents / commands / rules surface.

1. claudebase split (companion to claudebase v0.5.0 standalone installer)

Removes 8 files that previously shipped from this repo and now ship from
the claudebase repo's own installer:

- src/rules/knowledge-base.md          (CLI contract)
- src/rules/knowledge-base-tool.md     (usage mandate + insights protocol)
- src/rules/tool-limitations.md        (Read/grep/bash truncation gotchas)
- src/commands/knowledge-ingest.md     (/knowledge-ingest skill)
- src/commands/reflect.md              (/reflect skill — DMN observation)
- src/commands/consolidate.md          (/consolidate skill — drift detection)
- src/agents/reflection.md             (reflection agent / Drift persona)
- src/agents/consolidator.md           (consolidator agent / Mnem persona)

install.sh / install.ps1 lose ~350 lines (binary download, pdfium install,
e5 encoder warmup, alias registration, allowlist merge for claudebase
entry) and gain a chain_claudebase_installer / Invoke-ClaudebaseInstaller
function. For *nix: curls and pipes to bash. For Windows: Invoke-WebRequest
+ powershell.exe -ExecutionPolicy Bypass. Both honor --local mode: when
SCRIPT_DIR/claudebase/install.sh|ps1 exists adjacent to the SDLC checkout
(dev path), it runs that directly instead of fetching from main.

End-user inventory after install is byte-identical: 22 agents + 10 commands
+ 8 rules deploy to ~/.claude/. The change is just which installer is the
source of truth for each file. claudebase can now also be installed
standalone (without SDLC) for projects that only want the memory +
observation infrastructure.

SDLC bumps to v3.1.0.

2. Corporate code-style reviewer (sentinel-gated pre-Gate-0 in /merge-ready)

New agent (Norm persona) audits recent code changes against rules declared
in <project>/.codestyle. Sentinel-gated: only activates when the file
exists and is non-empty. Projects without .codestyle see byte-identical
behavior — the pre-gate is silently skipped.

When .codestyle is present, /merge-ready runs the agent in an iteration
loop BEFORE Gate 0:
- PASS → proceed to Gate 0
- FAIL → spawn implementer with `.codestyle §N` + `file:line` fix
  directives; re-audit on next iter
- BLOCKED → halt /merge-ready, surface fact-grounded exit_argument via
  AskUserQuestion

No iteration cap. After 3 non-converging iters the agent itself emits
BLOCKED with `exit_argument: implementer is not addressing the violations`.

Mirrors the qa-engineer / /qa-cycle pattern. Designed for corporate
environments where each team owns its own .codestyle document; SDLC ships
the agent ready-to-use, the team owns the rule content.

3. Sub-agent onboarding rule

New rule at src/rules/subagent-onboarding.md mandates that every Agent-tool
spawn prompt include a verbatim onboarding preamble pointing the sub-agent
at the cognitive-self-check protocols (Facts / Decisions / Inbound), the
knowledge-base discipline, and the insights-corpus retrieval. Catches the
named failure mode where the parent's discipline is local-only and doesn't
propagate to spawned children — sub-agents that skip these protocols
produce fact-shaped lies and re-discover prior-session insights.

Mira's CLAUDE.md persona is updated to enforce: "Onboard every sub-agent
you spawn. A task-only spawn prompt is a contract violation."

Bumps SDLC's own agent count 21 → 20 (lost reflection + consolidator to
claudebase, gained corporate-code-style-reviewer). Total deployed
inventory after both installers run: 22 (20 SDLC + 2 claudebase).
Collision lists in role-planner / merge-ready updated to "22 core agents"
with the new slug.
Adds two pipeline pieces:

1) /onboarding slash command (src/commands/onboarding.md) — forces the
   orchestrator to re-read every load-bearing pipeline rule at session
   start, verify the three cognitive-self-check protocols (Facts,
   Decisions, Inbound) are active, and emit a concise verification
   report. Read-only. Flags missing rule files as drift signals without
   auto-recreating them.

   Runs at: fresh-session boot, after context-compaction, before
   high-stakes features (/bootstrap-feature, /develop-feature).
   Includes a 5-line tail of the most recent session-changelog
   bullets so the agent re-anchors context.

2) session-changelog rule (src/rules/session-changelog.md) — defines
   a short-bullet operator-facing log at <project>/.claude/changelog.md
   for the project manager. One bullet per meaningful milestone
   (commit, slice complete, blocker surfaced/resolved, merge-ready
   verdict, release). Hard cap 100 chars per bullet. Dated
   ## YYYY-MM-DD sections, newest on top. NOT the same file as the
   formal user-facing CHANGELOG.md (governed by
   templates/rules/changelog.md) — that one is for end-users; this
   one is for PMs.

   Sentinel-activated: presence of ~/.claude/rules/session-changelog.md
   enables behaviour; absence equals opt-out.

Updates:
- src/claude.md Pipeline Commands list adds /onboarding entry
- install.sh / install.ps1 + README bump counts (8 commands, 6 rules)
- CHANGELOG.md [Unreleased] gets two Added bullets

Install.sh deploys both via the existing src/commands/*.md and
src/rules/*.md globs — no installer code changes needed beyond the
descriptive count strings.
- src/hooks/sdlc-onboarding.{sh,ps1}: SessionStart hook (matcher: startup|resume|compact). Auto-injects orientation context (3 cognitive-self-check protocols, loaded rules + mtimes, scratchpad summary, changelog tail, git state) as additionalContext on every session boot. Replaces the prior /onboarding slash command which required manual invocation.
- src/hooks/sdlc-subagent-onboarding.{sh,ps1}: SubagentStart hook. Auto-injects the 5-point subagent onboarding preamble (Protocols 1/2/3, knowledge-base discipline, insights-corpus query, push-back-is-not-failure) into every Agent-tool spawn. Belt-and-suspenders with the parent-side subagent-onboarding.md rule.
- install.sh / install.ps1: new install_sdlc_hooks function. Copies hooks to ~/.claude/hooks/, chmod +x, merges hooks.SessionStart + hooks.SubagentStart into ~/.claude/settings.json (jq on bash, ConvertFrom-Json on PowerShell). Idempotent — dedup by command-string equality. Removes stale ~/.claude/commands/onboarding.md from prior installs.
- src/commands/onboarding.md: deleted (superseded by hook).
- src/rules/subagent-onboarding.md: kept MANDATORY (transcript auditability, feature-specific context propagation), now documents the hook as the safety net.
…ty with channel callbacks

- src/hooks/sdlc-onboarding.{sh,ps1}: prepend <hook source="sdlc-onboarding"
  event="..." ts="..." cwd="..." session_id="..."> and append </hook>;
  metadata parsed from CC's stdin JSON envelope (hook_event_name, session_id)
  via jq (sh) / ConvertFrom-Json (ps1), with sane defaults on parse failure
- src/hooks/sdlc-subagent-onboarding.{sh,ps1}: same plus agent_type attr from
  subagent_type/agent_type field
- install.sh / install.ps1: docs update — claudebase install now additionally
  ships ffmpeg + whisper-cli (best-effort), telegram-plugin-rs binary patched
  into the official Anthropic plugin's cache, and `claudebase run` subcommand
  for one-shot launch with telegram channel preset
- docs/plans/telegram-tsx-to-rust.md + telegram-rust-port.md: full plan trail
  for the Rust port (lives in claudebase repo now; plan files stay here as
  the planning context)
- .claude/changelog.md: per-session operator-facing bullets per the
  session-changelog rule
…visible CLI bubble

Plain stdout from a SessionStart/SubagentStart hook only reaches the agent
as additionalContext — the operator sees nothing. Switch to the JSON
envelope per https://code.claude.com/docs/en/hooks so both audiences are
served:

- `systemMessage` -> visible to operator in CLI (short summary line)
- `hookSpecificOutput.additionalContext` -> agent-only, wrapped in
  <hook source="..." event="..." ts="..." ...> tag for visual parity with
  <channel source="...">  Telegram callbacks

SessionStart fires once per session boot/resume/compact — surfaces a
one-line "🪝 SDLC SessionStart hook — event=... project=..." bubble.

SubagentStart deliberately omits systemMessage — it fires on EVERY
Agent-tool spawn (potentially dozens per /develop-feature wave), so a
bubble per spawn would spam the operator's CLI. Agent-only context.

Bash path uses jq -n --rawfile to JSON-escape the multi-line buffer
correctly. PowerShell uses StringBuilder + ConvertTo-Json. Both fall back
to plain text if jq/ConvertTo-Json fail.
…inder

New sdlc-exitplanmode-reminder.sh/.ps1 fires AFTER ExitPlanMode and inspects
<project>/.claude/plan.md. Soft enforcement of CLAUDE.md § Plan-Mode Persistence:
- missing/empty/stale (>300s) → systemMessage bubble + agent additionalContext
- ok (fresh, non-empty) → silent {}
- never blocks (exit 0 always)

install.sh + install.ps1 wire the hook idempotently into settings.json under
hooks.PostToolUse[matcher=ExitPlanMode]. Session changelog + product CHANGELOG
[Unreleased] updated.
src/rules/git.md gains a hard prohibition on git rebase (interactive or
otherwise). Rebase rewrites history — drops commits, forces pushes, strands
work when a conflict aborts mid-rebase; the environment also blocks the
interactive -i flag. Rule directs the agent to git merge for integration,
git revert / git reset-on-unpushed for undo, and to escalate to the operator
if history genuinely needs rewriting.

CHANGELOG [Unreleased] + session changelog updated.
The three-protocol rule (Facts / Decisions / Inbound) is no longer sourced
from src/rules/ — it now ships from the claudebase repo's prompts/rules/ as
part of claudebase's cognitive-infrastructure layer (alongside the
knowledge-base / insights rules). The SDLC installer already chains the
claudebase installer, so the file still lands at
~/.claude/rules/cognitive-self-check.md with zero end-user change; all agent
prompts + CLAUDE.md reference it by that path, unchanged.

install.sh banners updated: SDLC now sources 5 process rules; the claudebase
dependency block lists cognitive-self-check + the two new claudebase hooks.
CHANGELOG [Unreleased] + session changelog updated.
Follow-up to 9f65448 (the file deletion landed alone because the prior
git-rm left the path already staged). This commits the companion edits:
install.sh banners (5 process rules; claudebase dep block lists
cognitive-self-check + the two claudebase hooks), CHANGELOG [Unreleased]
Changed entry, and the session changelog bullet.
sdlc-onboarding.ps1, sdlc-subagent-onboarding.ps1, sdlc-exitplanmode-reminder.ps1
carried em-dashes in string literals. Windows PowerShell 5.1 parses no-BOM
scripts in the local code page (not UTF-8), corrupting the multibyte em-dash
bytes and aborting with "Unexpected token". Same class of bug + fix as the
claudebase hooks (reported on Windows there first).

All three SDLC .ps1 hooks are now ASCII-only (em-dash -> hyphen). The .sh
variants are unchanged (Unix is UTF-8). ASCII bytes parse identically under
any code page — root-cause fix. Convention note added at the top of each .ps1.
claudebase added a /update-claudebase command; the SDLC installer banners
that enumerate the claudebase-provided commands now list 4 (knowledge-ingest,
reflect, consolidate, update-claudebase) instead of 3. Enumeration accuracy
only — no behavioral change (the command ships + deploys from claudebase).
claudebase retired its Stop insight-capture hook and folded insight-capture
into the UserPromptSubmit self-check reminder. The SDLC installer banner that
enumerates claudebase-provided hooks now lists the single UserPromptSubmit
hook (self-check protocols + insight-capture) instead of Stop + UserPromptSubmit.
Enumeration accuracy only.
…flags

claudebase v0.7.0 makes insight create require --category (general|project)
and >=1 --tag (exit 2 otherwise). Update the insight-surfacing template and
the mandatory-flags note in all 14 SDLC agent prompts that emit insights,
so no agent caller breaks on upgrade. Read-time --tag filtering documented
as OR/any-intersection.
Update 14 agent insight create caller templates for claudebase v0.7.0
required --category and --tags flags (BREAKING-change accommodation).
Pairs with claudebase v0.7.0 insights-hybrid-corpus feature.
The documented one-liner 'curl ... | bash' silently aborts: curl
consumes stdin, so install.sh's read -r in confirm() returns empty
and the [y/N] default-deny fires before the user can answer. Add
'-s -- --yes' to the documented command + a note explaining the
trap + the inspect-then-run alternative. Operator hit this today
trying to install fresh; the bare-pipe pattern has been wrong
since the prompt was added.

Follow-up worth doing: install.sh confirm() should detect non-TTY
stdin via [ -t 0 ] and fail-loud ('stdin is not a TTY; pass --yes
to confirm') instead of returning the silent default-no. (Not done
here; one-line README fix unblocks users immediately while the
script fix can be a separate PR.)
README curl|bash install one-liner: add -s -- --yes so the documented
command actually works (curl consumes stdin, install.sh's read -r
silently default-deny'd before). Plus a note documenting the trap +
the inspect-then-run alternative.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants