/morning-star-harness:mstar-knowledgefrom morning-star-harness
Crystallizes resolved problems into structured knowledge documents and maintains them against code drift. Runs after each development plan's Done or on reusable owner feedback.
Ships in morning-star-harness. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Standalone: this skill + mstar-doc-corpus. Harness running: mstar-harness-core first; paths → mstar-conventions.
One artifact family ({KNOWLEDGE_DIR} 文档 + <repo-root>/CONCEPTS.md), one document shape (mstar-doc-corpus → mstar-doc-corpus/references/knowledge-format.md、mstar-doc-corpus/references/schema.yaml、mstar-doc-corpus/assets/knowledge-skeleton.md;本 skill 不维护第二份字段表或骨架), two workflows: Capture 把已解决的问题沉淀为结构化知识文档,供未来的 plan 研究、debug 与实现检索复用;Maintain 让既有文档对抗代码漂移重新可信。Knowledge that isn't captured evaporates when the session ends; knowledge that is captured but not discoverable is equally lost; documents that are captured also age — code changes, conventions evolve, patterns become obsolete — so capture and maintenance are one skill over one artifact.
In the mstar lifecycle, per-plan Capture runs after every development plan's Done — an iteration row or a standalone development plan — sharing one step sequence (see「Integration with mstar lifecycle」). It is not a mid-plan activity, and report-only plans carry no compound duty; ad-hoc captures and the separate Owner feedback entry remain invocable. Maintain runs only from its own entries (## When to use / Skip), which include the Capture Phase 7 flag and the on-demand project-knowledge bootstrap.
Storage: {KNOWLEDGE_DIR} defaults to .agents/knowledge/ — one default whether or not the harness runs; a .mstarc knowledge_dir is authoritative over it, resolved relative to the .mstarc, and a writing step must resolve the symbol (.mstarc, then mstar path resolve) instead of composing the default path (mstar-doc-corpus § Layout defaults)。知识文档 → {KNOWLEDGE_DIR}/<category>/<slug>.md(<category> 取值见 mstar-doc-corpus mstar-doc-corpus/references/category-mapping.md);CONCEPTS.md → <repo-root>/CONCEPTS.md;Maintain 另可操作 {KNOWLEDGE_DIR}/README.md(散文,见 Maintain Phase 4)。当 harness 运行时,完整的发现链与其余路径符号 → mstar-conventions。
层级分工:本 skill 产出的工程经验与方法论不是当前系统状态;三层语料的边界与更新义务 → mstar-doc-corpus SKILL.md § The three layers(当前状态属 {SPECS_DIR},决策属 {ADR_DIR})。
Capture — use: 每个 development plan Done 后(迭代行与独立 plan 相同,见「Integration with mstar lifecycle」);任何非平凡问题解决后(独立触发,紧急情况同样适用);重大 bug 修复后。
Capture — skip: 自检 ≤2 Yes;Q5 高重叠(更新已有而非新建);纯机械工作(格式化、依赖升级、typo);问题未经验证。每个 development plan 的 disposition 义务不因跳过结晶而消失——结晶跳过时以 reasoned skipped 记录在该 plan 的 ## Review Gate Summary(独立 plan 另记 delivery.compound,见「Integration with mstar lifecycle」)。
When the human owner (operator/user, not the coordinator seat or a review bot) merges, closes, or comments on a submitted PR and states a preference or rule reaching beyond that PR, run an owner-feedback disposition. Examples include a reusable close reason, an "always/never", or a correction to recurring code, description, or evidence shape. An unmerged close also triggers durable tracking of any earlier owner-feedback knowledge edit on the delivery branch that did not reach the target branch; the owner need not restate it.
Use the Capture steps below in Lightweight mode; report created / updated with the knowledge path, or skipped with a reason in the coordination response. Prefer updating the document that already covers the point (Q5 overlap); deduplicate, and rewrite a contradicted rule instead of adding a competing one. Apply the standing-owner-rule exception in references/compound-workflow.md § 决策矩阵; feedback that only fixes that PR is skipped.
Write to the delivery branch while the PR is open. After merge/close, the PM creates or links a durable tracking item in the same round and returns its link, recording the owner rule and intended knowledge path for the next tracked change through ordinary delivery even when no follow-up work exists yet. With an active store, use mstar-project-governance § Issue capture; without one (including a staged store), use a host tracking item only if the selected mstar-host adapter documents an authorized tracking verb. Otherwise report not tracked with cause and recovery below; do not invent a host write or attempt a store write.
If no authorized tracker is available or the write fails, report not tracked with the actual cause and recovery: restore access to a documented host tracking verb and retry; for a fresh workspace, bootstrap via mstar harness scaffold + mstar store init (mstar-artifacts/templates/README.md); for a workspace whose only leftovers are execution-era files (status.json, workflow snapshots), retire them with mstar store init --discard-legacy (mstar-artifacts/references/plan-workflow-lifecycle-contract.md § Migration and history); for a staged store, the authorized cutover ops task activates the reviewed final apply receipt via mstar store activate --manifest <path> --operator <name>, satisfying the verified-backup and consumer-attestation prerequisites in mstar-use-cli/references/status-and-registers.md § Store lifecycle: migration, activation, retirement. Retry store capture only after activation succeeds. Never report an unwritten item as successfully tracked. This event-driven entry reopens no Done row or closed workflow, amends no Review Gate Summary, and does not change per-plan Capture timing.
Maintain — use:
| Trigger | Example |
|---|---|
Capture Phase 7 flag(本 skill,## Workflow — Maintain) | "Two docs cover N+1 queries — consider refresh" |
| Scheduled maintenance | "It's been a quarter, let's audit knowledge" |
| Domain refactored | After a major module rewrite |
| Explicit user request | /pm + "audit the knowledge docs" — Maintain runs as this skill ## Workflow — Maintain |
| Project knowledge bootstrap | No/stale/partial STRATEGY.md, CONCEPTS.md, or {KNOWLEDGE_DIR} — see 「Bootstrap vs refresh」 |
Landing here mid-plan: before a plan's Done, per-plan capture is not due — continue the assigned work; Owner feedback above is a separate event-driven entry. One bounded exception: when current work hits the Capture Phase 2 overlap condition (an existing doc already covers the ground), update that doc (add last_updated) rather than deferring to a Maintain audit; that single-doc update is Capture-phase behaviour, not a licence to start a Maintain library sweep. A full Maintain audit (inventory → five outcomes → document-placement check) runs only from its own entries above.
Inflow workflow: a solved problem or a completed plan exists, and must be judged (Q1–Q8) and possibly written. Full step detail (Gather context / Overlap detection / Write incl. frontmatter schema + path + validate / Discoverability check / CONCEPTS.md synergy / Document placement / Refresh trigger) → references/compound-workflow.md。
Compound 是被生命周期流程调用的知识结晶流程:本 SKILL 只拥有执行步骤(下方 + references/compound-workflow.md);触发时机、cwd、写入面与结果记录面由调用方流程声明。本 SKILL 不复述调用方细节,也不维护调用方清单 —— 调用方各自指向本技能的步骤文件。
每个 development plan Done 后执行一次(迭代行与独立 plan 相同),产出 created / updated / reasoned skipped。知识文档是 Git 通道的 durable 产物,不属于 execution store:execution 行只承载活跃 lifecycle,promotion 完成后终态行经 mstar workflow discard 删除(→ mstar-artifacts/references/plan-workflow-lifecycle-contract.md §4h):
{KNOWLEDGE_DIR} / CONCEPTS.md;有 tracked 变更时立即推进该 plan 的 layer ref(交付线),无变更的 reasoned skipped 只记录、不产生空 commit。disposition 记入该 plan 的 ## Review Gate Summary(引擎 completion payload 不追改)。Child row 无 workflow delivery evidence。delivery.compound。Phase 3 的 specs/ADR 提升不属本技能 → mstar-doc-corpus;plan 级 ADR 判定在 Done 前完成(mstar-artifacts/references/plan-files-and-reports.md 的 ADR: 行),不经过本技能的结晶评分。
调用本 skill 前,PM(或触发方)必须对候选问题逐条自检 Q1–Q8(诊断耗时 / 非显而易见性 / 可复用性 / 项目特异性 / 既有重叠 / 架构影响 / 失败尝试价值 / 跨模块)。完整问题表、决策矩阵(Yes≥4 强烈建议;Yes=3 Lightweight;Yes≤2 跳过;Q5=Yes 高重叠不新建)与示例判定 → references/compound-workflow.md「是否值得结晶」。
快判:Q5 高重叠 → 更新已有文档,不新建;其余按决策矩阵 Yes 数。
| Track | What it captures |
|---|---|
| Bug | Incident-level fix — "X broke, here's why and how we fixed it" |
| Knowledge | Durable guidance — "this is how we do X, and why" |
Track 由 problem_type 决定(完整映射 → mstar-doc-corpus mstar-doc-corpus/references/category-mapping.md)。每轨的正文小节结构在 mstar-doc-corpus mstar-doc-corpus/assets/knowledge-skeleton.md;本 skill 只决定写哪一轨,不复述小节清单。
| Mode | When | Behavior |
|---|---|---|
| Full (default) | Most cases | Dispatches research subagents for context analysis, solution extraction, overlap detection |
| Lightweight | Simple fixes, context-tight sessions | Single-pass documentation, no subagents, faster |
Full mode dispatches research subagents through the host's task tool. PM selects mode.
完整步骤细节(Gather context / Overlap detection / Write document 含 frontmatter schema + path + validate / Discoverability check / CONCEPTS.md synergy / Document placement / Refresh trigger)→ references/compound-workflow.md。每 Phase 一个关键决策:
mstar-doc-corpus mstar-doc-corpus/references/category-mapping.md)last_updated);中度 → 新建并标 consolidation review;低/无 → 正常新建mstar-doc-corpus mstar-doc-corpus/references/schema.yaml)+ body(mstar-doc-corpus mstar-doc-corpus/assets/knowledge-skeleton.md)+ YAML validateAGENTS.md/CLAUDE.md 未提 {KNOWLEDGE_DIR},提议最小补充(需用户同意;拒绝则仅跳过该编辑,doc 仍写)CONCEPTS.md(规则见 references/concepts-vocabulary.md);全仓 bootstrap 归本 skill ## Workflow — Maintain{KNOWLEDGE_DIR}/<category>/<slug>.md 的 tracked 文件即完成:identity / kind / lifecycle 由路径与 frontmatter 提供,listDocuments / getDocument 直接发现,没有登记步骤(有无 store 都一样)。provenance / supersession 写在正文的来源引用里。不再要求 {KNOWLEDGE_DIR}/README.md 索引行(README 是散文,不是登记表)。snapshot plans[].metadata.knowledge_refs 属退役的文件时代,无读写路线也不被导入,不是写入面。## Workflow — Maintain(经 /pm 并指明 scope;不自动跑,仅 flag)Engine check (optional validator): run
mstar compound validate <doc-path> [--knowledge-dir <dir>](enginevalidateSchemaYaml,assertKnowledgeDocumentCompleteness) to validate the frontmatter againstmstar-doc-corpusmstar-doc-corpus/references/schema.yaml(Capture Phase 3 Write); the--knowledge-dirbranch additionally discovers every knowledge document under the configured{KNOWLEDGE_DIR}(listDocuments/getDocument) and holds each to the schema — it needs a resolved harness root, but no store and no registration step (Capture Phase 6 Placement). Onfail, do not proceed — fix and re-run. Contract →mstar-use-cli/references/checks-and-lints.md§ Engine check callouts.
Stock workflow: existing {KNOWLEDGE_DIR} documents show staleness signals, and the document set is audited against the current codebase until it is trustworthy again.
操作面: 本 skill 仅操作 {KNOWLEDGE_DIR}/**/*.md + {KNOWLEDGE_DIR}/README.md(散文,见 Phase 4)+ <repo-root>/CONCEPTS.md;知识关联用正文来源引用与指针,不写 status/snapshot metadata。禁止操作 docs/,以及 harness 运行时才存在的 plan / iteration / spec 树({PLAN_DIR}/、{ITERATION_DIR}/、{SPECS_DIR}/)。完整解析链 → mstar-conventions mstar-conventions/references/artifact-storage-paths.md(仅当 harness 运行时)。
Engine check (optional validator): run
mstar compound validate <doc-path> --knowledge-dir <dir>(enginescopeGuard,compoundRefreshScope) to resolve the allowed scope above ({KNOWLEDGE_DIR}/**,{KNOWLEDGE_DIR}/README.md,<repo-root>/CONCEPTS.md) and guard every write against it; this scope never authorizes ACTIVE status/snapshot writes. The same command's--knowledge-dirbranch validates the discovered corpus against the configured knowledge root; it needs a resolved harness root, but no store. Onfail, do not proceed — fix and re-run. Contract →mstar-use-cli/references/checks-and-lints.md§ Engine check callouts.
| Mode | When | Procedure |
|---|---|---|
| Refresh | {KNOWLEDGE_DIR} exists; audit accuracy, merge overlaps, delete stale docs | This skill ## Workflow — Maintain (Phases 1–6) |
| Bootstrap | No knowledge scaffolding, or artifacts are absent/stale enough to warrant full distillation from codebase | references/project-knowledge-bootstrap.md (7-phase: survey → STRATEGY.md → CONCEPTS.md → baseline knowledge → indexing → opt-in harness init → commit) |
Read the bootstrap reference on demand; do not paste its body into this SKILL.md.
For each candidate document, classify into one of five outcomes:
| Outcome | Meaning | Default action |
|---|---|---|
| Keep | Still accurate and useful | No edit; report reviewed |
| Update | Core solution correct, references drifted | In-place edits (paths, module names, code snippets) |
| Consolidate | Two+ docs overlap heavily, both correct | Merge unique content into canonical doc, delete subsumed |
| Replace | Old doc is misleading; known better replacement exists | Create trustworthy successor, then delete old |
| Delete | No longer useful, applicable, or distinct | Delete — git history preserves it |
Future-decision-value criterion — judge a document by the decision it still constrains, never by length or age: delete when that decision is closed and nothing in the body would guide a future change (git history preserves it, Core rule 6); keep when its rationale, negative guarantee or ownership boundary still constrains work, however long it is; archive only when the historical rationale warrants preservation, and only through the iteration-start §1.6 gate's existing archive tree. Never archive a live proposal; keep a rejected approach only while the losing idea remains a tempting mistake.
Calibration: 9 size-divergent docs (36–78 lines) under {KNOWLEDGE_DIR}/architecture-patterns/ were all kept by future value; length proved not to be a criterion.
Default: user-guided
{KNOWLEDGE_DIR}/<category>/.module:, tags:, problem_type:) and filenames.PM-directed: specific scope
PM provides a scope hint (directory name, filename, module name, or keyword). Match in this order:
{KNOWLEDGE_DIR}/Inventory → assess → classify/act → document-placement check(无登记步骤)→ report → CONCEPTS.md reconciliation. Full Phase 1–6 procedure → references/maintain-workflow.md. CONCEPTS admission rules for Phase 6 → references/concepts-vocabulary.md.
git log --diff-filter=D -- <path> finds deleted docs. The one exception is bulk archiving, which exists only inside an iteration: when an iteration runs, its hygiene pass owns moving superseded/redundant knowledge/specs to {HARNESS_DIR}/archived/knowledge|specs/(mstar-iteration §1.6 corpus hygiene → mstar-iteration/references/iteration-corpus-hygiene.md). Durable decision reason — why an alternative lost, or what a choice cost — has its home in the ADR tree ({ADR_DIR}), not in a kept knowledge doc.
Not adopted: frozen-archive seal machinery,
Archived:triplets, or a verifier — they contradict rule 6 (delete, don't archive; git history is the archive); do not reintroduce.
Capture — 正确结果 = 一篇可发现的结晶文档:{KNOWLEDGE_DIR}/<category>/<slug>.md 通过 mstar-doc-corpus references/schema.yaml frontmatter 校验(Capture Phase 3 Write)+ 达标领域词入 CONCEPTS.md(Capture Phase 5)+ 源文件(若有)标注 Promoted to: <knowledge-path>(Capture Phase 4 Trace)+ 该文件位于解析后的 {KNOWLEDGE_DIR} 下、可经 listDocuments / getDocument 发现(Capture Phase 6 Placement;无登记步骤)。
Maintain — 正确结果 = 每篇候选文档有明确 verdict(Keep / Update / Consolidate / Replace / Delete)并落到产物:文档改动 + 维护报告(Phase 5:reviewed / kept / updated / consolidated / replaced / deleted / flagged)+ CONCEPTS.md 对账(Phase 6)+ 落点核对(Phase 4:文档位于解析后的 {KNOWLEDGE_DIR},frontmatter 的 lifecycle 与正文现状一致;无登记行)。
| 何时 | 打开 |
|---|---|
| Capture 步骤细节(Q1–Q8 完整表、决策矩阵、Phase 1–7、HEAD-resolvability 质量门与 mstar 泄漏分类) | references/compound-workflow.md |
知识文档形状(唯一 SSOT:frontmatter 字段、两轨骨架、problem_type → <category>) | mstar-doc-corpus → mstar-doc-corpus/references/knowledge-format.md(索引)、mstar-doc-corpus/references/schema.yaml(字段)、mstar-doc-corpus/assets/knowledge-skeleton.md(正文骨架)、mstar-doc-corpus/references/category-mapping.md(目录映射) |
| CONCEPTS.md 准入规则(Capture Phase 5、Maintain Phase 6) | references/concepts-vocabulary.md |
| Maintain Phase 1–6 详细步骤 | references/maintain-workflow.md |
项目知识 bootstrap(absent/stale STRATEGY.md / CONCEPTS.md / {KNOWLEDGE_DIR}),on demand | references/project-knowledge-bootstrap.md |
mstar-conventions — 完整路径发现链与其余路径符号(mstar-conventions/references/path-resolution.md / mstar-conventions/references/artifact-storage-paths.md)mstar-artifacts — store.db execution rows(文档不登记;execution 行在 promotion 后经 mstar workflow discard 删除,status.json / snapshot 无读写路线且不导入;project register 仅迁移历史)What SKILL.md sets; muted values are Claude Code's defaults
29 skills in this plugin
/drtDirect work entry: one View completes one bounded unit and ends, with no PM, plan row, Done, QC tri-review or delivery chain. Use when the user wants a bounded request executed directly (audit, review, cleanup, governance pass, docs, harness text) without iteration or multi-plan orchestration./grill-meInterview the user relentlessly about a plan or design until shared understanding, resolving each decision branch. Use when a plan or design needs stress-testing, or the user says 'grill me'./mstar-artifactsPlan artifacts: main plans, durable review summaries, QC/PM Acceptance bundles, workflow state/config/progress/evidence, issue capture, residual severity. Read when authoring or mapping them./mstar-auditAudit or survey a codebase into an evidence-backed, prioritized review report (read-only): bugs, security, perf, test gaps, tech debt, DX, a PR/branch/diff (`pr` variant), test-suite audit, a `skills/` corpus stocktake — is the skill corpus redundant, which skills overlap, what does it cost always-loaded (`skills` variant; read-only, proposes verdicts, never edits a skill)./mstar-branch-worktreeBranch authorization, control/delivery/source checkout isolation, L1/L2 writable-task isolation, QC and PM Acceptance checkout alignment, guarded worktree/branch cleanup after merge./mstar-coding-behaviorUse for non-trivial implementation, debugging, refactoring or code review in any project: requirement drift, speculative complexity, agent-facing interfaces. Not workflow or role selection.Claude Code refuses to install this plugin
.claude-plugin/plugin.json: agents: Invalid string: must end with ".md"
Checked against Claude Code 2.1.332's install rules. The listing below is what the repository ships; Claude Code cannot install it as published.
Other plugins' skills for the same job