feat(knowledge): Phase 6 — retrieval integration#255
Open
leeovery wants to merge 9 commits intofeat/knowledge-base-phase-5from
Open
feat(knowledge): Phase 6 — retrieval integration#255leeovery wants to merge 9 commits intofeat/knowledge-base-phase-5from
leeovery wants to merge 9 commits intofeat/knowledge-base-phase-5from
Conversation
Documents the knowledge CLI as the API reference loaded by Layer 2 per-phase usage guides. Covers query (single + batch), flags, search modes, output format, confidence tiers, two-step retrieval, and what not to do. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Adds shared references for autonomous knowledge querying: - knowledge-usage.md: trigger heuristics, query construction, failure handling (pause-with-options), phase-specific notes - contextual-query.md: single query at research/discussion/ investigation phase start Wires the refs into all processing skills (except specification — explicitly excluded from automatic retrieval). Adds knowledge.cjs to allowed-tools on planning, implementation, and review. Renumbers downstream steps and internal routing. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…utting query Adds short inline nudges at high-value moments in all processing skills except specification (research, discussion, investigation, scoping, planning, implementation, review) — brief reminders to query the knowledge base at decision points, root cause synthesis, task entry, etc. Not new steps; embedded at step boundaries. Replaces planning-entry's manual cross-cutting spec reader with a targeted semantic query (--work-type cross-cutting --phase specification), keeping the in-progress-cross-cutting warning intact. Query text is built from the topic's spec summary, not the slug. Adds knowledge.cjs to planning-entry allowed-tools. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…wledge Moves knowledge-check, reindex-work-unit, knowledge-usage, and contextual-query from skills/workflow-shared/references/ into skills/workflow-knowledge/references/ so the knowledge skill owns its domain references. workflow-shared/references/ now holds only truly cross-domain protocols (casing, compliance, background-agents, natural-breaks, convergence). Updates all 22 caller Load directives and attribution headers. No behavioural changes — structural reorganisation only. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
SKILL.md is now the single source for query construction examples and two-step retrieval. knowledge-usage.md keeps the context-level principles (short) and points to SKILL.md for examples and the flag table. contextual-query.md defers to knowledge-usage.md B for construction rules (same deferral pattern it already uses for D failure handling). No behavioural change — removes verbatim duplication so future guidance updates land in one place. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
- knowledge-usage.md D: both retry/skip branches now end with explicit → Return to caller - contextual-query.md B: adds explicit routing for both non-zero and exit-0 branches, with post-D skip vs retry-succeeded sub-routing - cross-cutting-context.md B: restructures in-progress sub-branches to use bold nested conditionals with explicit Proceed/Return routing - cross-cutting-context.md C: adds post-D routing (skip vs retry) so every branch is self-contained per CLAUDE.md convention No behavioural change — makes the control flow explicit where it previously relied on implicit fall-through. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Research Step 6 is terminal (Research Session) — there is no backbone step after it. The "returns to the backbone to proceed toward conclusion" phrasing was copy-pasted from discussion's final-review.md where Step 6 IS a backbone step with Step 7+ after. Narrative now describes the actual control flow: return to topic-completion which runs document review, compliance, and the conclude menu. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
… review
Planning-time KB queries create an escape hatch that undermines the
spec's golden-doc status. The pipeline already captures context via
discussion → spec; spec gaps are blockers, not KB-fill opportunities.
- knowledge-usage.md E:
- Planning: do not query. Spec is golden; gaps go back to the user.
Cross-cutting stays at entry only (existing mechanism).
- Implementation: code is source of truth for *what*; KB is only
for *why* context behind existing patterns (rare).
- Review: cross-work-unit consistency checks only.
- planning SKILL.md: remove inline callout (encouraged anti-pattern).
- implementation SKILL.md: narrow inline callout to why-only usage.
- review SKILL.md: narrow inline callout to cross-work-unit checks.
Research, discussion, investigation, scoping callouts unchanged —
autonomous querying is legitimate there (exploring, deciding,
diagnosing).
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
The "previously this loaded every spec..." paragraph documented what the file used to do, not what it does. Rot magnet. Replaced with a description of current behaviour only. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
6 tasks
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.
Summary
Phase 6 wires the knowledge CLI into the skill system as a queryable resource — when and how skills reach into the knowledge base for context during a phase. Three-layer integration per the design doc.
skills/workflow-knowledge/SKILL.md): API docs for the query layer — commands, flags, output format, confidence tiers, two-step retrieval, do-nots.knowledge-usage.md,contextual-query.md) loaded early in all processing skills except specification. Research, discussion, and investigation also run a single contextual query at phase start.work_type: cross-cutting.Query failures pause the workflow with retry/skip options per design doc guidance (silent skips would erase the knowledge base's value).
allowed-toolsentries forknowledge.cjsadded to planning, implementation, review, and planning-entry.Stacked on
feat/knowledge-base-phase-5— PR base is the phase-5 branch, not main.Test plan
bash tests/scripts/test-knowledge-cli.sh— 127/127 passbash tests/scripts/test-workflow-manifest.sh— 176/176 passBash(node .claude/skills/workflow-knowledge/scripts/knowledge.cjs)inallowed-tools🤖 Generated with Claude Code