agent-concepts 0.0.0-stage → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +771 -2
- package/concepts/bc-brainstorming/body/SKILL.md +43 -0
- package/concepts/bc-code-review/body/SKILL.md +120 -0
- package/concepts/bc-codebase-design/body/SKILL.md +54 -0
- package/concepts/bc-codebase-docs/body/SKILL.md +150 -0
- package/concepts/bc-council-audit-security/body/SKILL.md +72 -0
- package/concepts/bc-council-chain/body/SKILL.md +71 -0
- package/concepts/bc-council-challenge-plan/body/SKILL.md +78 -0
- package/concepts/bc-council-find-bugs/body/SKILL.md +70 -0
- package/concepts/bc-council-improve-architecture/body/SKILL.md +52 -0
- package/concepts/bc-council-mode/body/SKILL.md +56 -0
- package/concepts/bc-council-mode/body/examples/agents/README.md +11 -0
- package/concepts/bc-council-mode/body/examples/agents/council-change.md +14 -0
- package/concepts/bc-council-mode/body/examples/agents/council-compat.md +14 -0
- package/concepts/bc-council-mode/body/examples/agents/council-risk.md +14 -0
- package/concepts/bc-council-mode/body/references/pass-contracts.md +133 -0
- package/concepts/bc-delegate-investigation/body/SKILL.md +119 -0
- package/concepts/bc-delegate-investigation/body/examples/pi-settings-snippet.json +8 -0
- package/concepts/bc-delegate-investigation/body/pi.md +168 -0
- package/concepts/bc-design/body/SKILL.md +49 -0
- package/concepts/bc-design/body/design-framework.md +39 -0
- package/concepts/bc-design/body/existing-app.md +9 -0
- package/concepts/bc-design/body/new-work.md +22 -0
- package/concepts/bc-design/body/principles.md +34 -0
- package/concepts/bc-design/body/surfaces.md +13 -0
- package/concepts/bc-diagnosing-bugs/body/SKILL.md +83 -0
- package/concepts/bc-dispatching-parallel-agents/body/SKILL.md +63 -0
- package/concepts/bc-domain-modeling/body/SKILL.md +40 -0
- package/concepts/bc-executing-plans/body/SKILL.md +50 -0
- package/concepts/bc-explain-visually/body/SKILL.md +167 -0
- package/concepts/bc-find-bugs/body/SKILL.md +90 -0
- package/concepts/bc-finishing-development-branch/body/SKILL.md +73 -0
- package/concepts/bc-grilling/body/SKILL.md +22 -0
- package/concepts/bc-handoff/body/SKILL.md +104 -0
- package/concepts/bc-handoff/body/pickup.md +107 -0
- package/concepts/bc-handoff/body/writing.md +217 -0
- package/concepts/bc-improve-codebase-architecture/body/SKILL.md +101 -0
- package/concepts/bc-json-canvas/body/SKILL.md +40 -0
- package/concepts/bc-json-canvas/body/references/EXAMPLES.md +71 -0
- package/concepts/bc-json-canvas/body/references/SPEC.md +55 -0
- package/concepts/bc-json-canvas/body/references/VALIDATION.md +26 -0
- package/concepts/bc-minimal-solution-ladder/body/SKILL.md +120 -0
- package/concepts/bc-obsidian-bases/body/SKILL.md +59 -0
- package/concepts/bc-obsidian-bases/body/references/EXAMPLES.md +80 -0
- package/concepts/bc-obsidian-bases/body/references/FUNCTIONS.md +49 -0
- package/concepts/bc-obsidian-bases/body/references/SYNTAX.md +82 -0
- package/concepts/bc-obsidian-bases/body/references/TROUBLESHOOTING.md +41 -0
- package/concepts/bc-obsidian-markdown/body/SKILL.md +47 -0
- package/concepts/bc-obsidian-markdown/body/references/CALLOUTS.md +40 -0
- package/concepts/bc-obsidian-markdown/body/references/EMBEDS.md +35 -0
- package/concepts/bc-obsidian-markdown/body/references/PROPERTIES.md +37 -0
- package/concepts/bc-optimize-code/body/SKILL.md +41 -0
- package/concepts/bc-performance-guardrails/body/SKILL.md +53 -0
- package/concepts/bc-performance-guardrails/body/measuring.md +29 -0
- package/concepts/bc-performance-guardrails/body/targets.md +20 -0
- package/concepts/bc-pipeline-to-done/body/SKILL.md +205 -0
- package/concepts/bc-pipeline-to-done/body/agents/bc-drain-auditor.md +19 -0
- package/concepts/bc-pipeline-to-done/body/agents/bc-drain-reviewer.md +19 -0
- package/concepts/bc-pipeline-to-done/body/agents/bc-drain-worker.md +19 -0
- package/concepts/bc-pipeline-to-done/body/execute-issue.md +71 -0
- package/concepts/bc-pipeline-to-done/body/recovery-bundle.md +79 -0
- package/concepts/bc-pipeline-to-done/body/review-contract.md +105 -0
- package/concepts/bc-pipeline-to-done/body/roles.md +13 -0
- package/concepts/bc-pipeline-to-done/body/scripts/publish-check.py +172 -0
- package/concepts/bc-pipeline-to-done/body/source-issues.md +86 -0
- package/concepts/bc-pipeline-to-done/body/source-work-items.md +76 -0
- package/concepts/bc-plain-language/body/SKILL.md +134 -0
- package/concepts/bc-plan-slicing/body/SKILL.md +56 -0
- package/concepts/bc-plan-to-pipeline/body/SKILL.md +89 -0
- package/concepts/bc-prd-drafting/body/SKILL.md +43 -0
- package/concepts/bc-prompting-agents/body/SKILL.md +278 -0
- package/concepts/bc-prototype/body/SKILL.md +40 -0
- package/concepts/bc-qmd/body/SKILL.md +64 -0
- package/concepts/bc-research/body/SKILL.md +26 -0
- package/concepts/bc-security-audit/body/AI-AND-LLM.md +25 -0
- package/concepts/bc-security-audit/body/ATTACK-CLASSES.md +35 -0
- package/concepts/bc-security-audit/body/DESKTOP-MOBILE-AND-LOCAL-IPC.md +28 -0
- package/concepts/bc-security-audit/body/RECONNAISSANCE.md +49 -0
- package/concepts/bc-security-audit/body/SKILL.md +117 -0
- package/concepts/bc-security-audit/body/SUPPLY-CHAIN-AND-RELEASE.md +28 -0
- package/concepts/bc-security-audit/body/VALIDATION-AND-REPORTING.md +124 -0
- package/concepts/bc-security-audit/body/WEB-PROTOCOL-AND-AUTH.md +27 -0
- package/concepts/bc-security-audit/body/validate_audit.py +151 -0
- package/concepts/bc-self-improve/body/SKILL.md +104 -0
- package/concepts/bc-seo/body/CITATIONS.md +23 -0
- package/concepts/bc-seo/body/IMAGE-SEO.md +350 -0
- package/concepts/bc-seo/body/SKILL.md +453 -0
- package/concepts/bc-setup-project/body/SKILL.md +252 -0
- package/concepts/bc-setup-project/body/scaffold.py +2751 -0
- package/concepts/bc-setup-project/body/starter-items.md +157 -0
- package/concepts/bc-setup-project/body/work-data.md +114 -0
- package/concepts/bc-setup-project/body/work_index.py +626 -0
- package/concepts/bc-setup-project/body/work_spent.py +220 -0
- package/concepts/bc-subagent-driven-development/body/SKILL.md +61 -0
- package/concepts/bc-tdd/body/SKILL.md +184 -0
- package/concepts/bc-tdd/body/formal.md +77 -0
- package/concepts/bc-tdd/body/mocking.md +49 -0
- package/concepts/bc-tdd/body/properties.md +59 -0
- package/concepts/bc-tdd/body/refactoring.md +12 -0
- package/concepts/bc-tdd/body/scripts/confirm-red.py +136 -0
- package/concepts/bc-tdd/body/tests.md +59 -0
- package/concepts/bc-teach/body/GLOSSARY-FORMAT.md +36 -0
- package/concepts/bc-teach/body/LEARNING-RECORD-FORMAT.md +60 -0
- package/concepts/bc-teach/body/MISSION-FORMAT.md +34 -0
- package/concepts/bc-teach/body/RESOURCES-FORMAT.md +53 -0
- package/concepts/bc-teach/body/REVIEW-FORMAT.md +48 -0
- package/concepts/bc-teach/body/SKILL.md +281 -0
- package/concepts/bc-teach/body/WIKI-FORMAT.md +58 -0
- package/concepts/bc-teach/body/scripts/due.py +65 -0
- package/concepts/bc-to-spec/body/SKILL.md +21 -0
- package/concepts/bc-to-tickets/body/SKILL.md +21 -0
- package/concepts/bc-triage/body/AGENT-BRIEF.md +38 -0
- package/concepts/bc-triage/body/OUT-OF-SCOPE.md +51 -0
- package/concepts/bc-triage/body/SKILL.md +81 -0
- package/concepts/bc-unslop/body/SKILL.md +269 -0
- package/concepts/bc-using-git-worktrees/body/SKILL.md +91 -0
- package/concepts/bc-wiki-maintain/body/SKILL.md +361 -0
- package/concepts/bc-wiki-maintain/body/runner/README.md +552 -0
- package/concepts/bc-wiki-maintain/body/runner/bc-wiki-lint.service +24 -0
- package/concepts/bc-wiki-maintain/body/runner/bc-wiki-lint.timer +15 -0
- package/concepts/bc-wiki-maintain/body/runner/bc-wiki-maintain-all.service +29 -0
- package/concepts/bc-wiki-maintain/body/runner/bc-wiki-maintain-all.timer +16 -0
- package/concepts/bc-wiki-maintain/body/runner/bc-wiki-maintain.service +28 -0
- package/concepts/bc-wiki-maintain/body/runner/bc-wiki-maintain.timer +12 -0
- package/concepts/bc-wiki-maintain/body/runner/bc-wiki-notify@.service +15 -0
- package/concepts/bc-wiki-maintain/body/runner/notify-failure.sh +92 -0
- package/concepts/bc-wiki-maintain/body/runner/run-lint.sh +69 -0
- package/concepts/bc-wiki-maintain/body/runner/run-promotion-all.sh +103 -0
- package/concepts/bc-wiki-maintain/body/runner/run-promotion.sh +270 -0
- package/concepts/bc-wiki-maintain/body/wiki_lint.py +958 -0
- package/concepts/bc-wiki-maintain/body/wiki_search.py +206 -0
- package/concepts/bc-work-sync/body/PLAN.md +46 -0
- package/concepts/bc-work-sync/body/SKILL.md +71 -0
- package/concepts/bc-writing-plans/body/SKILL.md +79 -0
- package/package.json +130 -4
- package/packages/agent-kernel-pi/AGENT-KERNEL.md +109 -0
- package/packages/agent-kernel-pi/index.js +8 -0
- package/packages/agent-kernel-pi/package.json +12 -0
|
@@ -0,0 +1,361 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: bc-wiki-maintain
|
|
3
|
+
description: Maintain a project-local Markdown agent wiki by linting its computed health, promoting durable log evidence, and flagging contradictions without silently rewriting knowledge. Run explicitly with a vault root when a project wiki needs maintenance.
|
|
4
|
+
disable-model-invocation: true
|
|
5
|
+
argument-hint: "<vault-root>"
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# Maintain a project wiki
|
|
9
|
+
|
|
10
|
+
Run this skill explicitly against one project-local Markdown vault. Capture already happens
|
|
11
|
+
in that vault's append-only `log.md`; this pass separates capture from synthesis by promoting
|
|
12
|
+
only durable evidence into the smallest appropriate page. It works with `.bc-agent/`, `.agent/`,
|
|
13
|
+
or `agent/wiki/` roots. Do not assume the directory name: the vault-root argument is required.
|
|
14
|
+
|
|
15
|
+
If `~/.config/agent-concepts/overlays/bc-wiki-maintain.md` exists, read it for this machine's tool names.
|
|
16
|
+
|
|
17
|
+
## Two layouts
|
|
18
|
+
|
|
19
|
+
The detector decides which layout the target uses and prints it as `Layout:`. Follow the
|
|
20
|
+
detector rather than guessing from folder names, because both layouts use `.bc-agent/`.
|
|
21
|
+
|
|
22
|
+
- **vault** — the classic wiki: `index.md` catalog, `tasks/`, `project/overview.md`,
|
|
23
|
+
`findings/`, `decisions/`, `open-questions/` all inside the vault root.
|
|
24
|
+
- **visible** — the vault root's `AGENTS.md` has a parseable "Where things go" table
|
|
25
|
+
(`bc-setup-project` code, ops and hybrid projects). Project knowledge lives in ordinary folders
|
|
26
|
+
at the repository root; the vault root holds agent mechanics only (`AGENTS.md`, `map.md`,
|
|
27
|
+
`log.md`, `conventions/`, `references/`, `templates/`, `scripts/`). There is no vault catalog, so never
|
|
28
|
+
create `index.md`, `tasks/`, `project/overview.md`, `findings/` or `open-questions/` there:
|
|
29
|
+
the project chose to keep that knowledge visible, and a recreated vault page becomes a
|
|
30
|
+
second, unread copy. Wherever this skill names a destination by role (glossary, decisions,
|
|
31
|
+
research, ideas), take the path from that table; one table per project means a project
|
|
32
|
+
with a justified exception changes one place.
|
|
33
|
+
|
|
34
|
+
**Promotion does not apply to the visible layout.** Promotion existed to move log entries into
|
|
35
|
+
vault pages; in the visible layout agents write decisions and research straight to the table's
|
|
36
|
+
role folders, and `log.md` is a plain journal. So for a visible-layout project the detector
|
|
37
|
+
prints `Promotion: not applicable` and no `PROMOTION_` lines, the runner exits 0 with a
|
|
38
|
+
not-applicable message, and this skill is the lint only: run step 2, report its findings and
|
|
39
|
+
stop. Everything below about classifying and promoting log headings applies to a vault.
|
|
40
|
+
|
|
41
|
+
The detector's `qmd registration` line checks the visible layout's two search collections: one
|
|
42
|
+
rooted at the repository whose pattern covers the table's knowledge roles, and one rooted at
|
|
43
|
+
`.bc-agent/` (qmd skips hidden path parts, so the first cannot index it).
|
|
44
|
+
`wiki_lint.py <vault-root> --qmd-entry <slug>` prints both entries for the collections file.
|
|
45
|
+
|
|
46
|
+
The root-cause rule is load-bearing: **triggers must be computed (from Git and the filesystem),
|
|
47
|
+
never recorded in hand-maintained counters or markers.** The architecture-runway tracker is the
|
|
48
|
+
counterexample: since 2026-07-31 its state has remained `TODO / TODO / TODO`, so its nudge never
|
|
49
|
+
fired. Do not create another marker that an agent must remember to update. Use Git history to
|
|
50
|
+
find the last dedicated promotion commit and the filesystem to find the current pages.
|
|
51
|
+
|
|
52
|
+
## Teach adapter boundary
|
|
53
|
+
|
|
54
|
+
When the target vault contains a structurally valid explicit `references/teach-skill.md` marker,
|
|
55
|
+
read its path map before classifying candidates. Valid means the first line is exactly
|
|
56
|
+
`<!-- teach-host-adapter: v1 -->` and the complete `## Hosted teach path map` table matches the
|
|
57
|
+
approved map in that adapter; a prefix-only, missing-row, or altered-map file is not a contract.
|
|
58
|
+
The standalone `bc-teach` skill remains the authority for the mapped learning state: mission
|
|
59
|
+
(`learning/plan.md`), review queue (`learning/review.md`), learning records
|
|
60
|
+
(`learning/records/`), session/lesson artifacts (`sessions/`), notes (`learning/notes.md`),
|
|
61
|
+
raw sources (`sources/`), compiled concepts (`concepts/`), the teach resource catalog
|
|
62
|
+
(`references/teach-resources.md`), and the Glossary section of `project/overview.md`.
|
|
63
|
+
|
|
64
|
+
This maintenance pass may search those pages as context, and may promote ordinary non-teach
|
|
65
|
+
host evidence elsewhere, but it must never fabricate demonstrated learning, create or rewrite
|
|
66
|
+
a learning record, alter a review prompt/date/interval, advance the review queue, turn a
|
|
67
|
+
session-log claim into evidence, or edit the teach-owned Glossary section. It may edit
|
|
68
|
+
non-glossary sections of `project/overview.md` when ordinary host evidence supports that edit.
|
|
69
|
+
If log evidence appears to target a teach-owned path, classify it as `skip` with a reason and
|
|
70
|
+
leave the edit to `bc-teach`; raw source files remain immutable. Do not infer this boundary from
|
|
71
|
+
directory names alone when the explicit marker is absent.
|
|
72
|
+
|
|
73
|
+
In a visible-layout hybrid project the glossary is the shared root glossary (the table's
|
|
74
|
+
`glossary` role, `glossary.md` by default), not a section of `project/overview.md`. `bc-teach`
|
|
75
|
+
adds learner terms to it; follow the shared-glossary rule in `bc-domain-modeling` (ask before
|
|
76
|
+
removing or redefining a term you did not add this session). A hosted teach workspace keeps its own `index.md` in the vault root: it catalogs only
|
|
77
|
+
teach's folders, so leave it to `bc-teach` and never extend it to agent-mechanics pages.
|
|
78
|
+
|
|
79
|
+
<!-- Adapted from bc-prompting-agents: scope discipline. -->
|
|
80
|
+
**Implement EXACTLY and ONLY what the log evidence supports.** No extra pages, cleanup, or
|
|
81
|
+
reorganization. If adjacent work looks useful, report it as optional; do not do it in this pass.
|
|
82
|
+
Skipping a heading still requires classifying it; silence is not a skip.
|
|
83
|
+
|
|
84
|
+
## Find context before reading it
|
|
85
|
+
|
|
86
|
+
When a task needs a fact from the vault, filter the pages before opening one. The default
|
|
87
|
+
single-vault reader is the bundled direct-BM25 script: it reads tracked Markdown at query time,
|
|
88
|
+
prints a bounded list of paths, and creates no index or cache. Distill the task to **2–4
|
|
89
|
+
meaningful content keywords**; do not paste the user's whole question. The benchmark recorded
|
|
90
|
+
17/20 misses for full-sentence qmd searches (Wilson 95% CI `[0.64, 0.95]`) versus 5/20 for the
|
|
91
|
+
same questions phrased as keywords (CI `[0.11, 0.47]`); see
|
|
92
|
+
[`tests/retrieval-results.md`](../tests/retrieval-results.md) and its reproduced finding in
|
|
93
|
+
[`tests/retrieval-results-round2.md`](../tests/retrieval-results-round2.md). Query shape is the
|
|
94
|
+
safe conclusion; the small sample does **not** prove one retriever is more accurate.
|
|
95
|
+
|
|
96
|
+
Run this from the directory containing the vault's `AGENTS.md`. The script is next to this
|
|
97
|
+
`SKILL.md`; use that directory if it differs from the default install below.
|
|
98
|
+
`AGENT_CONCEPTS` is an optional checkout override:
|
|
99
|
+
|
|
100
|
+
```bash
|
|
101
|
+
VAULT_ROOT="$PWD"
|
|
102
|
+
wiki_skill_dir="$HOME/.agents/skills/bc-wiki-maintain"
|
|
103
|
+
if [ -n "${AGENT_CONCEPTS:-}" ]; then
|
|
104
|
+
wiki_skill_dir="$AGENT_CONCEPTS/concepts/bc-wiki-maintain/body"
|
|
105
|
+
fi
|
|
106
|
+
python3 "$wiki_skill_dir/wiki_search.py" \
|
|
107
|
+
--limit 15 "$VAULT_ROOT" "term one" "term two"
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
Treat returned paths as leads, open the relevant page, and verify the answer in its text. Empty
|
|
111
|
+
output is not evidence that the vault lacks the answer: reformulate once with a different 2–4
|
|
112
|
+
keyword set. If the top results are `index.md`, `map.md`, or `log.md`, the query is too generic;
|
|
113
|
+
add a distinguishing term rather than opening a hub as the answer. Do not grep `index.md` rows
|
|
114
|
+
for lookup. Read `index.md` (a vault; visible layout: `.bc-agent/AGENTS.md`) for broad project orientation only — it is a curated human-facing
|
|
115
|
+
surface, not the retrieval mechanism.
|
|
116
|
+
|
|
117
|
+
For a deliberate **cross-vault** lookup, use qmd with every collection named explicitly and the
|
|
118
|
+
same short-keyword discipline:
|
|
119
|
+
|
|
120
|
+
```bash
|
|
121
|
+
qmd search "term one term two" -c vault-a -c vault-b --format files -n 15
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
Never run an unscoped qmd search: it can return rows from unrelated corpora. Resolve
|
|
125
|
+
collection keys from the qmd registry; never derive one from a `.agent` or `.bc-agent` directory
|
|
126
|
+
basename. `qmd search` may exit 0 while returning `[]`, so an exit status is not an answer signal.
|
|
127
|
+
Never use `qmd query`; its model-expansion and reranking path is not suitable for an inline read.
|
|
128
|
+
If the bundled reader cannot run, do not read the whole vault as a fallback; use a bounded lexical
|
|
129
|
+
candidate search and verify the pages it returns.
|
|
130
|
+
|
|
131
|
+
### Pasteable vault instruction block
|
|
132
|
+
|
|
133
|
+
The following block is the canonical replacement for the old `index.md`-first paragraph in a
|
|
134
|
+
vault's `AGENTS.md`. Run it from the directory containing that file. **Music is the exception in
|
|
135
|
+
workflow shape:** keep its plans-first route after this search step (the relevant plan and its
|
|
136
|
+
open questions); adapt the block rather than replacing Music's local workflow with the generic
|
|
137
|
+
one.
|
|
138
|
+
|
|
139
|
+
~~~md
|
|
140
|
+
<!-- BEGIN canonical vault read path -->
|
|
141
|
+
## First move: search the vault, do not read the index
|
|
142
|
+
|
|
143
|
+
For any task that needs a fact from this vault, run from the directory containing this
|
|
144
|
+
`AGENTS.md`. Find `wiki_search.py` next to the installed `bc-wiki-maintain` skill's
|
|
145
|
+
`SKILL.md`. Use that directory if your install differs from the default below;
|
|
146
|
+
`AGENT_CONCEPTS`, when set, overrides it with a contributor checkout.
|
|
147
|
+
|
|
148
|
+
```bash
|
|
149
|
+
VAULT_ROOT="$PWD"
|
|
150
|
+
wiki_skill_dir="$HOME/.agents/skills/bc-wiki-maintain"
|
|
151
|
+
if [ -n "${AGENT_CONCEPTS:-}" ]; then
|
|
152
|
+
wiki_skill_dir="$AGENT_CONCEPTS/concepts/bc-wiki-maintain/body"
|
|
153
|
+
fi
|
|
154
|
+
python3 "$wiki_skill_dir/wiki_search.py" \
|
|
155
|
+
--limit 15 "$VAULT_ROOT" "term one" "term two"
|
|
156
|
+
```
|
|
157
|
+
|
|
158
|
+
Use **2–4 meaningful content keywords**, not the user's full question. Open the relevant
|
|
159
|
+
returned path(s) and verify the answer in the page text. The corpus is tracked Markdown only:
|
|
160
|
+
a newly created page is invisible until `git add` registers it with Git. If the fact may be in
|
|
161
|
+
an untracked page, do not interpret an empty result as absence; add the page and rerun the
|
|
162
|
+
search. Otherwise, if output is empty, reformulate once with a different 2–4 keyword set;
|
|
163
|
+
empty output is not proof that this vault lacks the answer. If the top result is `index.md`,
|
|
164
|
+
`map.md`, or `log.md`, add a distinguishing term and search again — those are hub/orientation
|
|
165
|
+
pages, not answers. Do not grep `index.md` rows for lookup.
|
|
166
|
+
|
|
167
|
+
Use qmd only for a deliberate cross-vault lookup, with every collection named explicitly:
|
|
168
|
+
|
|
169
|
+
```bash
|
|
170
|
+
qmd search "term one term two" -c vault-a -c vault-b --format files -n 15
|
|
171
|
+
```
|
|
172
|
+
|
|
173
|
+
Never run qmd unscoped, guess a collection from a `.agent`/`.bc-agent` basename, treat exit 0
|
|
174
|
+
or `[]` as proof of an answer's absence, or use `qmd query`. If `wiki_search.py` cannot run,
|
|
175
|
+
do not read the whole vault; use a bounded lexical candidate search and verify its pages.
|
|
176
|
+
|
|
177
|
+
Read `index.md` only for broad project orientation ("what is this project?"); never load it
|
|
178
|
+
whole or grep its rows to locate a page.
|
|
179
|
+
<!-- END canonical vault read path -->
|
|
180
|
+
~~~
|
|
181
|
+
|
|
182
|
+
## The maintenance loop
|
|
183
|
+
|
|
184
|
+
### 1. Establish the boundary before writing
|
|
185
|
+
|
|
186
|
+
- Resolve `<vault-root>` and confirm it contains the target vault's `log.md` and `index.md`.
|
|
187
|
+
- Run `git -C "<vault-root>" status --short` before touching anything. If it is not clean,
|
|
188
|
+
**stop**. Do not stash, reset, or fold the promotion into someone else's working changes.
|
|
189
|
+
- Identify the repository root with Git; the dedicated commit belongs to that repository.
|
|
190
|
+
- Find the latest relevant commit whose subject starts `wiki: promote log entries `. That Git
|
|
191
|
+
history boundary, not a file marker, identifies the previous promotion. If none exists, inspect
|
|
192
|
+
the log from its beginning and avoid duplicating facts already present in pages.
|
|
193
|
+
- The detector supplies the exact `YYYY-MM-DD..YYYY-MM-DD` range of standard dated log headings
|
|
194
|
+
awaiting promotion, and lists each unpromoted heading. Preserve that range for the
|
|
195
|
+
wrapper-owned commit subject. The next dedicated commit treats the whole listed set as
|
|
196
|
+
considered, so every heading must be classified before that commit is allowed.
|
|
197
|
+
|
|
198
|
+
### 2. Run detection first
|
|
199
|
+
|
|
200
|
+
Run the bundled detector before reading candidates or editing pages:
|
|
201
|
+
|
|
202
|
+
```bash
|
|
203
|
+
python3 <skill-dir>/wiki_lint.py "<vault-root>"
|
|
204
|
+
```
|
|
205
|
+
|
|
206
|
+
Read the report and act on it. Broken or ambiguous links that affect a candidate must be
|
|
207
|
+
resolved by the smallest additive change or reported as a blocker; never hide them with a
|
|
208
|
+
rewrite. In a vault, missing `findings/` and `decisions/` index entries are fixed by the
|
|
209
|
+
additive index update in Gate 1. In a visible-layout project the detector also reports
|
|
210
|
+
work-folder errors and warnings, each with its path and a one-line fix (including any entry
|
|
211
|
+
directly under `.bc-agent/` that is not agent mechanics: project knowledge lives at the table's
|
|
212
|
+
role paths, and a tool's own records there must be listed in the table's `agent-extras` row); report them as
|
|
213
|
+
pre-existing findings and leave them alone in this pass, because moving or renumbering work
|
|
214
|
+
items is not log promotion. Distinguish pre-existing findings from defects introduced by this pass. The
|
|
215
|
+
detector is read-only; its report is evidence, not a license to skip the safety gates.
|
|
216
|
+
|
|
217
|
+
### 3. Read the evidence and classify every unpromoted heading
|
|
218
|
+
|
|
219
|
+
Read the unpromoted `log.md` headings the detector listed, the pages they mention, and the
|
|
220
|
+
relevant `index.md` section (in a vault). Keep `log.md` intact: it is the evidence trail, not a queue to
|
|
221
|
+
truncate.
|
|
222
|
+
|
|
223
|
+
Classify **every** listed heading. A later dedicated commit closes this list whether you filed
|
|
224
|
+
one item or twenty; a thin write must not be allowed to swallow the rest.
|
|
225
|
+
|
|
226
|
+
- `promote` — durable and not already represented accurately; file it
|
|
227
|
+
- `skip` — transient status, a transcript, a TODO with no durable claim, or a fact already
|
|
228
|
+
represented accurately; one-line reason required
|
|
229
|
+
- `conflict` — mutually exclusive claims (Gate 3); file the question, do not promote either
|
|
230
|
+
side as current truth
|
|
231
|
+
|
|
232
|
+
Write one JSON object per heading, covering the detector list as a multiset of exact `##`
|
|
233
|
+
lines, to `$CLASSIFY_PATH` when that environment variable is set. Otherwise write the same
|
|
234
|
+
JSONL to a temp file you report and do not put it in the vault — a new non-Markdown file left
|
|
235
|
+
in the vault fails the pass:
|
|
236
|
+
|
|
237
|
+
```json
|
|
238
|
+
{"heading":"## [YYYY-MM-DD] …","verdict":"promote","reason":"…","page":"references/gotchas.md"}
|
|
239
|
+
```
|
|
240
|
+
|
|
241
|
+
`page` is required for `promote` and `conflict`. Do not commit this file; it is a same-pass
|
|
242
|
+
gate, not a wiki page. Its verdicts are carried into the promotion commit body, so write each
|
|
243
|
+
`reason` for the next reader auditing why a heading was never filed.
|
|
244
|
+
|
|
245
|
+
For each `promote`, choose the smallest existing page or a new page by meaning:
|
|
246
|
+
|
|
247
|
+
- verified discovery, scan result, or durable observation → `findings/`;
|
|
248
|
+
- a costly or irreversible choice with a real alternative → the next numbered record in
|
|
249
|
+
`decisions/` (inspect existing numbering first);
|
|
250
|
+
- a domain term or its canonical name → the Glossary section of `project/overview.md`,
|
|
251
|
+
subject to the teach boundary above;
|
|
252
|
+
- stable command, path, external reference, or gotcha → `references/` in the vault root;
|
|
253
|
+
- durable workflow rule or operating convention → `conventions/` in the vault root;
|
|
254
|
+
- unresolved uncertainty or mutually exclusive claims → `open-questions/`.
|
|
255
|
+
|
|
256
|
+
Do not invent frontmatter: the directory supplies the page kind and Git supplies dates
|
|
257
|
+
(`git log -1 --format=%cs -- <path>`). Name appended sections after the fact, not after the
|
|
258
|
+
maintenance pass.
|
|
259
|
+
|
|
260
|
+
### 4. Apply the three gates before and during promotion
|
|
261
|
+
|
|
262
|
+
These gates exist because an unattended promotion has write access. The moment one blocks you
|
|
263
|
+
is precisely when a convenient exception is least trustworthy; do not skip one because the
|
|
264
|
+
change is small, obvious, or time-sensitive.
|
|
265
|
+
|
|
266
|
+
#### Gate 1 — Additive-only
|
|
267
|
+
|
|
268
|
+
Create missing pages and append a dated section to an existing page. In a vault, append a new
|
|
269
|
+
link in the appropriate curated section of `index.md` when a page is created, and also append a link for an
|
|
270
|
+
existing `findings/` or `decisions/` page the detector lists as missing from the index, except
|
|
271
|
+
`README.md` and anything under `templates/`. **Never delete, rewrite, or reflow existing
|
|
272
|
+
prose.** Do not improve wording while you are in the file, normalize headings, generate the
|
|
273
|
+
index, or reorder it. Do not backfill `conventions/`, `references/`, stubs, or other
|
|
274
|
+
directories in this pass. This mirrors `scaffold.py`'s additive/idempotent/never-deletes
|
|
275
|
+
precedent: the existing record is not yours to rewrite, and an additive diff is inspectable
|
|
276
|
+
and reversible.
|
|
277
|
+
|
|
278
|
+
#### Gate 2 — One dedicated Git commit, which you are probably not the one making
|
|
279
|
+
|
|
280
|
+
This pass produces exactly one commit, with the subject:
|
|
281
|
+
|
|
282
|
+
```text
|
|
283
|
+
wiki: promote log entries <from>..<to>
|
|
284
|
+
```
|
|
285
|
+
|
|
286
|
+
**Default: do not create it.** Assume the automatic runner invoked you unless a human, in this
|
|
287
|
+
conversation, explicitly told you to commit. Under the runner the wrapper checks classification
|
|
288
|
+
coverage, stages only the vault files this pass changed, and commits — all after your process
|
|
289
|
+
has exited. You will never see that commit. Do not `git add`, do not `git commit`, and do not
|
|
290
|
+
wait for `HEAD` to move.
|
|
291
|
+
|
|
292
|
+
A commit *you* create with that subject permanently closes the entire unpromoted heading list,
|
|
293
|
+
because the detector computes the next boundary from the latest such commit. That is the
|
|
294
|
+
thin-write failure this gate exists to prevent, entered through the front door. Never use
|
|
295
|
+
`git add -A`, amend an unrelated commit, or edit a dirty tree in place.
|
|
296
|
+
|
|
297
|
+
Only in a direct manual invocation, where a human asked for the commit, do you create it
|
|
298
|
+
yourself — after running the same checks the wrapper would, including classification coverage.
|
|
299
|
+
Then stage only this pass's verified vault files, commit once with the exact detector-provided subject and the verdict
|
|
300
|
+
summary as the body, and confirm with `git show --stat --oneline HEAD`
|
|
301
|
+
and a clean `git status --short`.
|
|
302
|
+
|
|
303
|
+
A separate commit is not noise: Git is the audit trail and the undo path (`git show` and
|
|
304
|
+
`git revert`). If every heading is a skip, make no empty commit and report the no-op; the list
|
|
305
|
+
stays unpromoted until a later pass files or classifies it into a commit.
|
|
306
|
+
|
|
307
|
+
#### Gate 3 — Flag mutually exclusive claims; do not halt on staleness
|
|
308
|
+
|
|
309
|
+
Two different disagreements exist. Only the first is a contradiction.
|
|
310
|
+
|
|
311
|
+
- **Mutually exclusive claims** cannot both be true: a research spike says an acceptance bar
|
|
312
|
+
was "formally lowered" while the ADR addendum and `tasks/active.md` say it was not. Write
|
|
313
|
+
both mutually exclusive source pages **and** the exact originating `log.md` heading/date
|
|
314
|
+
into `open-questions/` (one resolvable question per page or heading, not a batch dump).
|
|
315
|
+
The next reader needs that log provenance; a date on the open-question heading is not a
|
|
316
|
+
source citation. Do not promote either claim as current truth, and classify that heading
|
|
317
|
+
`conflict`. Continue the rest of the pass.
|
|
318
|
+
- **Stale page vs newer dated log** is the promotion job: the log has later verified state
|
|
319
|
+
and a project page still describes the earlier snapshot. Append a dated section with the
|
|
320
|
+
newer observation; do not rewrite the old sentence. Optionally note the leftover sentence
|
|
321
|
+
in `open-questions/` if it would mislead a cold reader. Classify `promote`.
|
|
322
|
+
|
|
323
|
+
A conflict stops that item, not the pass. Do not pick a winner, rewrite either source, or
|
|
324
|
+
turn a conflict into an accepted ADR. The scheduled agent must not silently decide that a
|
|
325
|
+
spike is outdated or that the newer-looking statement wins.
|
|
326
|
+
|
|
327
|
+
### 5. Verify the artifact, then hand off
|
|
328
|
+
|
|
329
|
+
Before the wrapper handoff or direct-manual commit:
|
|
330
|
+
|
|
331
|
+
1. Inspect `git diff --check` and the diff itself. Confirm existing prose was not rewritten,
|
|
332
|
+
no file was deleted or renamed, and (in a vault) every new page has an index entry. The wrapper also
|
|
333
|
+
rejects any non-additive change to a tracked page, so a rewrite fails the whole run rather
|
|
334
|
+
than landing quietly — find it here, not in the failure log.
|
|
335
|
+
2. Re-run `python3 <skill-dir>/wiki_lint.py "<vault-root>"`. Separate pre-existing warnings
|
|
336
|
+
from new defects; do not claim a clean report when it is not clean.
|
|
337
|
+
3. Confirm the classification file covers every detector-listed heading
|
|
338
|
+
(`python3 <skill-dir>/wiki_lint.py "<vault-root>" --verify-classify "$CLASSIFY_PATH"`). It
|
|
339
|
+
prints the verdict summary on success and fails when the unpromoted list is unknown; an
|
|
340
|
+
unknown list is a safe stop, not a pass.
|
|
341
|
+
4. Check `git status --short`. Leave the index and `HEAD` unchanged, then stop and report:
|
|
342
|
+
the wrapper stages and commits after you exit. Do not try to verify a commit — while you
|
|
343
|
+
are running there is none to see. Committing yourself is the Gate 2 failure.
|
|
344
|
+
In a direct manual invocation only, follow the commit steps in Gate 2 instead.
|
|
345
|
+
|
|
346
|
+
Report the detector output, the classification verdicts, promoted pages, any open-question
|
|
347
|
+
conflict, commit ID, and checks run. The next reader should be able to audit the result from
|
|
348
|
+
the commit and the preserved log, not from your self-report.
|
|
349
|
+
|
|
350
|
+
## Automatic runner contract
|
|
351
|
+
|
|
352
|
+
A scheduler may invoke this skill headlessly, but it does not relax any gate. A dirty tree,
|
|
353
|
+
missing or partial classification, or a mutually exclusive claim that cannot even be filed as
|
|
354
|
+
an open question is a safe stop, not a reason to guess. Keep the run scoped to the supplied
|
|
355
|
+
vault; do not modify qmd registry policy, other repositories, or the personal wiki from this
|
|
356
|
+
skill.
|
|
357
|
+
|
|
358
|
+
The wrapper commits only paths inside the vault root and fails the run on anything else. For a
|
|
359
|
+
visible-layout project there is nothing to promote: the wrapper prints that promotion is not
|
|
360
|
+
applicable and exits 0, so a scheduled run over many vaults is not marked failed. Do not enrol
|
|
361
|
+
such a project in the promotion timer; the lint-only timer applies to it.
|