You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix: close round-2 plan-vs-implementation gaps (A, B, C)
Gap A — SessionStart Tier 1 missing PROJECT-TOC.md content
hooks/session-start now extracts the ## Files section of PROJECT-TOC.md and
injects it as a <project-toc> block between the <harness-anchor-state>
block and the meta-skill body. Per plan §1, this restores the original
Progressive Disclosure design: agents see a project index at session start
without needing an explicit Read.
Token budget rebalanced: banner kept full, then TOC truncated first if
needed, then skill body. 200-char buffer reserved for truncation markers.
Final safety cap re-applied. Verified: cmake fixture session yields a
4018-char banner with TOC entries visible, well under 8000-char cap.
Gap B — Context7/WebSearch callouts missing from 9/11 skills
Added a "Looking up …" subsection to each skill (cpp-build-systems,
cpp-static-analysis, cpp-sanitizers, cpp-formatting, init-verification,
anti-hallucination-gates, project-indexing, feature-state-keeper,
context-budget-discipline) directing agents to Context7 first, WebSearch
as fallback, for unfamiliar tool errors / check names / API references.
using-harness-anchor adds a meta rule: "When stuck, search docs first."
Gap C — Skill descriptions exceeded plan §7 attention-table ≤150-char ideal
Rewrote all 11 frontmatter descriptions, front-loading trigger keywords
per learn-harness gotchas #12 (skill listing budget). Lengths now 129-150
chars (was 181-281). validate-anchor.sh ≤500 check still passes.
Verification:
validate-anchor.sh: 51/51 pass
post-edit-warn contract test: 5/5 pass
description length ≤150: all 11 OK
Context7 coverage: 11/11 HAS
SessionStart on CMake fixture: <project-toc> block present, entries visible
Skipped Gap D (.harness-anchor/last-error.log for index-builder crashes) —
rare failure path; stderr already captures errors; old TOC naturally preserved
when index-builder exits before write.
Copy file name to clipboardExpand all lines: skills/anti-hallucination-gates/SKILL.md
+10-1Lines changed: 10 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
---
2
2
name: anti-hallucination-gates
3
-
description: Use before claiming a feature/fix/task is "done", "fixed", "complete", "working", "passing". Enforces Default-FAIL contract — every done criterion needs concrete evidence path. Express calibrated uncertainty when evidence is missing.
3
+
description: Use before claiming "done", "fixed", "complete", "passing". Default-FAIL contract — every criterion needs evidence; express uncertainty if missing.
4
4
---
5
5
6
6
# Anti-Hallucination Gates
@@ -104,6 +104,15 @@ If any box is unchecked: state uncertainty explicitly, do NOT flip status to `pa
104
104
- You're about to say "the fix should work"
105
105
- The PostToolUse hook injected warnings — do NOT silently ignore them; surface and address per `self-correction-loop`
106
106
107
+
## Looking up evidence commands for unfamiliar frameworks
108
+
109
+
When the project uses a test/lint framework you don't have committed to memory (Catch2, doctest, ruff, deno test, etc.):
110
+
111
+
-**Context7** — fetch the framework's canonical CLI reference
112
+
-**WebSearch** — "framework + test runner output format" usually surfaces what counts as evidence
113
+
114
+
Bluffing the command and not actually running it is the anti-pattern this skill exists to prevent.
115
+
107
116
## Related
108
117
109
118
-`feature-state-keeper` — actual writes to feature_list.json
Copy file name to clipboardExpand all lines: skills/context-budget-discipline/SKILL.md
+10-1Lines changed: 10 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
---
2
2
name: context-budget-discipline
3
-
description: Use when sessions run long, when adding subagents, when the agent fetches large files, or when planning context-heavy work. Applies SELECT / WRITE / COMPRESS / ISOLATE operations from 2026 context engineering practice. Prevents lost-in-the-middle and reduces token cost.
3
+
description: Use when sessions run long, adding subagents, fetching large files, or planning context-heavy work. SELECT/WRITE/COMPRESS/ISOLATE discipline.
4
4
---
5
5
6
6
# Context Budget Discipline
@@ -88,6 +88,15 @@ You can roughly estimate context use by:
88
88
89
89
When the user asks "how much room do we have?", be honest about the estimate.
90
90
91
+
## Looking up context engineering research
92
+
93
+
For specific patterns (e.g., compaction algorithms, attention windowing, RAG indexing strategies):
94
+
95
+
-**Context7** — Anthropic / OpenAI engineering blog references on harnesses
Copy file name to clipboardExpand all lines: skills/cpp-build-systems/SKILL.md
+10-1Lines changed: 10 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
---
2
2
name: cpp-build-systems
3
-
description: Use in C/C++ projects when configuring builds, fixing build/configure errors, generating compile_commands.json, or selecting CMake/Meson/Make/Bazel commands. Always export compile_commands.json — it's required for static analysis and language tooling.
3
+
description: Use in C/C++ projects for build configure/errors, compile_commands.json generation, or selecting CMake/Meson/Make/Bazel commands.
4
4
---
5
5
6
6
# C/C++ Build Systems
@@ -111,3 +111,12 @@ Run `bash ${CLAUDE_PLUGIN_ROOT}/scripts/cpp-detect.sh --target .` to get a JSON
111
111
If you propose a build fix you haven't verified by running the build:
112
112
113
113
> "I believe the fix is `<change>`. Please run `cmake -S . -B .build && cmake --build .build` and share the output before we mark this resolved."
114
+
115
+
## Looking up tool errors
116
+
117
+
Unfamiliar CMake/Meson/Bazel error or missing-package message? Don't guess:
Copy file name to clipboardExpand all lines: skills/cpp-formatting/SKILL.md
+10-1Lines changed: 10 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
---
2
2
name: cpp-formatting
3
-
description: Use in C/C++ projects to apply clang-format consistently. Run on changed linesonly, never reformat unchanged code mid-feature. Use .clang-format from project root or LLVM baseline.
3
+
description: Use in C/C++ projects for clang-format. Changed-lines-only; never reformat unchanged code mid-feature. .clang-format from root or LLVM baseline.
4
4
---
5
5
6
6
# C/C++ Formatting (clang-format)
@@ -74,3 +74,12 @@ git diff --stat # should show only changed lines' format
74
74
```
75
75
76
76
If clang-format touched files you didn't change, your `.clang-format` may have drifted between machines (different versions produce different output). Pin clang-format major version in CI.
77
+
78
+
## Looking up clang-format options
79
+
80
+
For an unfamiliar `.clang-format` key (e.g. `PenaltyExcessCharacter`, `BreakInheritanceList`):
81
+
82
+
- **Context7** — fetch the official clang-format options reference
83
+
- **WebSearch** — search "clang-format <option-name>" for usage examples
Copy file name to clipboardExpand all lines: skills/cpp-sanitizers/SKILL.md
+10-1Lines changed: 10 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
---
2
2
name: cpp-sanitizers
3
-
description: Use in C/C++ projects when debugging crashes, hangs, undefined behavior, data races, or memory errors. ASan/UBSan/TSan are runtime checkers — they catch what static analysis misses. Build sanitizer config separately; don't mix with release config.
3
+
description: Use in C/C++ projects for crashes, hangs, UB, data races, memory errors. ASan/UBSan/TSan runtime checks. Build sanitizer config separately.
Copy file name to clipboardExpand all lines: skills/cpp-static-analysis/SKILL.md
+10-1Lines changed: 10 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
---
2
2
name: cpp-static-analysis
3
-
description: Use in C/C++ projects when reviewing changed code, before claiming a feature done, or when investigating bugs. Runs clang-tidy / cppcheck / include-what-you-use (IWYU). Requires compile_commands.json. Surface warnings on changed lines only — don't dump the world.
3
+
description: Use in C/C++ projects when reviewing changes or hunting bugs. Runs clang-tidy/cppcheck/IWYU. Needs compile_commands.json. Changed lines only.
4
4
---
5
5
6
6
# C/C++ Static Analysis
@@ -100,6 +100,15 @@ If a warning is wrong (false positive), file a one-line `// NOLINT(check-name)
100
100
101
101
If a warning is in code you didn't change (legacy area) and not a regression risk, defer it: note in `progress.md`, don't fix in this session. Scope discipline.
102
102
103
+
## Looking up unfamiliar checks
104
+
105
+
When you encounter a clang-tidy check name you don't recognize (e.g. `bugprone-suspicious-enum-usage`, `cert-err58-cpp`):
Copy file name to clipboardExpand all lines: skills/feature-state-keeper/SKILL.md
+10-1Lines changed: 10 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
---
2
2
name: feature-state-keeper
3
-
description: Use when starting, advancing, finishing, or blocking a feature. Manages feature_list.json scope record and progress.md/session-handoff.md state files. Enforces Default-FAIL: status='pass' requires non-null evidence.
3
+
description: Use when starting, advancing, finishing, or blocking a feature. Manages feature_list.json + progress.md + session-handoff.md. Default-FAIL enforced.
4
4
---
5
5
6
6
# Feature State Keeper
@@ -112,6 +112,15 @@ Aim for ≤ 300 words. The next session should be able to resume from this alone
112
112
113
113
If the schema file is present, an external validator (e.g. `ajv-cli`) can verify. The agent need not run it — write valid JSON the first time by following the shape above.
114
114
115
+
## Looking up JSON Schema constraints
116
+
117
+
For non-trivial schema constructs (`allOf`, `oneOf`, `if/then`, regex patterns):
118
+
119
+
-**Context7** — `json schema` for the canonical draft-07 / draft-2020-12 spec
120
+
-**WebSearch** — specific keyword + "json schema" for examples
121
+
122
+
Don't guess schema syntax — `feature_list.schema.json` validation must stay correct.
123
+
115
124
## Related
116
125
117
126
- For evidence-gathering procedure → `anti-hallucination-gates` skill
Copy file name to clipboardExpand all lines: skills/init-verification/SKILL.md
+10-1Lines changed: 10 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
---
2
2
name: init-verification
3
-
description: Use at the start of work in a project, after any environment change (deps, branch switch, OS update), or when something "used to work" stops working. Runs init.sh health check; treats failures as blocking. Implements Anthropic's "verify environment before agent does work" pattern.
3
+
description: Use at start of work, after env changes (deps/branch/OS), or when something stops working. Runs init.sh health check; treats failures as blocking.
4
4
---
5
5
6
6
# Init Verification
@@ -77,6 +77,15 @@ When it fails, list the specific failed step, not "init failed" alone.
77
77
- Inside a subagent that was already given verified-healthy context
78
78
- For trivial single-file edits where build/test aren't needed (rare; usually init still cheap enough to run)
79
79
80
+
## Looking up toolchain errors
81
+
82
+
When `init.sh` fails with a cryptic toolchain message (e.g., CMake "could not find compiler", npm `ENOENT`, cargo "linker not found"):
Copy file name to clipboardExpand all lines: skills/project-indexing/SKILL.md
+10-1Lines changed: 10 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
---
2
2
name: project-indexing
3
-
description: Use when locating files, understanding project structure, or before reaching for Glob/find. Consults PROJECT-TOC.md (one-line index of every git-tracked file). Detects staleness via git commit anchor.
3
+
description: Use when locating filesor understanding structure. Consults PROJECT-TOC.md (one-line index per file). Staleness via git commit anchor.
4
4
---
5
5
6
6
# Project Indexing
@@ -73,6 +73,15 @@ The `## Decisions` section is human-edited (long-lived architectural notes). The
73
73
74
74
`PROJECT-TOC.md` typically fits within a few thousand tokens even for medium projects. The SessionStart hook injects **only the first N lines** that fit the Tier 1 budget; the rest is read on demand. Don't ask the user to load the full TOC unless the budget allows.
75
75
76
+
## Looking up indexing techniques
77
+
78
+
For deeper context-engineering / progressive-disclosure indexing approaches not covered here:
79
+
80
+
-**Context7** — search "progressive disclosure llm agent" for harness research
81
+
-**WebSearch** — recent agent harness blog posts and patterns
82
+
83
+
The current TOC algorithm is intentionally minimal; refinements (semantic chunks, embeddings) belong in a separate skill.
84
+
76
85
## Related
77
86
78
87
-`using-harness-anchor` — overall navigation, points here when files are sought
0 commit comments