agent-concepts 0.0.0-stage → 0.4.1

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.
Files changed (139) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +773 -2
  3. package/concepts/bc-brainstorming/body/SKILL.md +43 -0
  4. package/concepts/bc-code-review/body/SKILL.md +120 -0
  5. package/concepts/bc-codebase-design/body/SKILL.md +54 -0
  6. package/concepts/bc-codebase-docs/body/SKILL.md +150 -0
  7. package/concepts/bc-council-audit-security/body/SKILL.md +72 -0
  8. package/concepts/bc-council-chain/body/SKILL.md +71 -0
  9. package/concepts/bc-council-challenge-plan/body/SKILL.md +78 -0
  10. package/concepts/bc-council-find-bugs/body/SKILL.md +70 -0
  11. package/concepts/bc-council-improve-architecture/body/SKILL.md +52 -0
  12. package/concepts/bc-council-mode/body/SKILL.md +56 -0
  13. package/concepts/bc-council-mode/body/examples/agents/README.md +11 -0
  14. package/concepts/bc-council-mode/body/examples/agents/council-change.md +14 -0
  15. package/concepts/bc-council-mode/body/examples/agents/council-compat.md +14 -0
  16. package/concepts/bc-council-mode/body/examples/agents/council-risk.md +14 -0
  17. package/concepts/bc-council-mode/body/references/pass-contracts.md +133 -0
  18. package/concepts/bc-delegate-investigation/body/SKILL.md +119 -0
  19. package/concepts/bc-delegate-investigation/body/examples/pi-settings-snippet.json +8 -0
  20. package/concepts/bc-delegate-investigation/body/pi.md +170 -0
  21. package/concepts/bc-design/body/SKILL.md +49 -0
  22. package/concepts/bc-design/body/design-framework.md +39 -0
  23. package/concepts/bc-design/body/existing-app.md +9 -0
  24. package/concepts/bc-design/body/new-work.md +22 -0
  25. package/concepts/bc-design/body/principles.md +34 -0
  26. package/concepts/bc-design/body/surfaces.md +13 -0
  27. package/concepts/bc-diagnosing-bugs/body/SKILL.md +83 -0
  28. package/concepts/bc-dispatching-parallel-agents/body/SKILL.md +63 -0
  29. package/concepts/bc-domain-modeling/body/SKILL.md +40 -0
  30. package/concepts/bc-executing-plans/body/SKILL.md +50 -0
  31. package/concepts/bc-explain-visually/body/SKILL.md +167 -0
  32. package/concepts/bc-find-bugs/body/SKILL.md +90 -0
  33. package/concepts/bc-finishing-development-branch/body/SKILL.md +73 -0
  34. package/concepts/bc-grilling/body/SKILL.md +22 -0
  35. package/concepts/bc-handoff/body/SKILL.md +104 -0
  36. package/concepts/bc-handoff/body/pickup.md +107 -0
  37. package/concepts/bc-handoff/body/writing.md +217 -0
  38. package/concepts/bc-improve-codebase-architecture/body/SKILL.md +101 -0
  39. package/concepts/bc-json-canvas/body/SKILL.md +40 -0
  40. package/concepts/bc-json-canvas/body/references/EXAMPLES.md +71 -0
  41. package/concepts/bc-json-canvas/body/references/SPEC.md +55 -0
  42. package/concepts/bc-json-canvas/body/references/VALIDATION.md +26 -0
  43. package/concepts/bc-minimal-solution-ladder/body/SKILL.md +120 -0
  44. package/concepts/bc-obsidian-bases/body/SKILL.md +59 -0
  45. package/concepts/bc-obsidian-bases/body/references/EXAMPLES.md +80 -0
  46. package/concepts/bc-obsidian-bases/body/references/FUNCTIONS.md +49 -0
  47. package/concepts/bc-obsidian-bases/body/references/SYNTAX.md +82 -0
  48. package/concepts/bc-obsidian-bases/body/references/TROUBLESHOOTING.md +41 -0
  49. package/concepts/bc-obsidian-markdown/body/SKILL.md +47 -0
  50. package/concepts/bc-obsidian-markdown/body/references/CALLOUTS.md +40 -0
  51. package/concepts/bc-obsidian-markdown/body/references/EMBEDS.md +35 -0
  52. package/concepts/bc-obsidian-markdown/body/references/PROPERTIES.md +37 -0
  53. package/concepts/bc-optimize-code/body/SKILL.md +41 -0
  54. package/concepts/bc-performance-guardrails/body/SKILL.md +53 -0
  55. package/concepts/bc-performance-guardrails/body/measuring.md +29 -0
  56. package/concepts/bc-performance-guardrails/body/targets.md +20 -0
  57. package/concepts/bc-pipeline-to-done/body/SKILL.md +205 -0
  58. package/concepts/bc-pipeline-to-done/body/agents/bc-drain-auditor.md +19 -0
  59. package/concepts/bc-pipeline-to-done/body/agents/bc-drain-reviewer.md +19 -0
  60. package/concepts/bc-pipeline-to-done/body/agents/bc-drain-worker.md +19 -0
  61. package/concepts/bc-pipeline-to-done/body/execute-issue.md +71 -0
  62. package/concepts/bc-pipeline-to-done/body/recovery-bundle.md +79 -0
  63. package/concepts/bc-pipeline-to-done/body/review-contract.md +105 -0
  64. package/concepts/bc-pipeline-to-done/body/roles.md +13 -0
  65. package/concepts/bc-pipeline-to-done/body/scripts/publish-check.py +172 -0
  66. package/concepts/bc-pipeline-to-done/body/source-issues.md +86 -0
  67. package/concepts/bc-pipeline-to-done/body/source-work-items.md +76 -0
  68. package/concepts/bc-plain-language/body/SKILL.md +134 -0
  69. package/concepts/bc-plan-slicing/body/SKILL.md +56 -0
  70. package/concepts/bc-plan-to-pipeline/body/SKILL.md +89 -0
  71. package/concepts/bc-prd-drafting/body/SKILL.md +43 -0
  72. package/concepts/bc-prompting-agents/body/SKILL.md +278 -0
  73. package/concepts/bc-prototype/body/SKILL.md +40 -0
  74. package/concepts/bc-qmd/body/SKILL.md +64 -0
  75. package/concepts/bc-research/body/SKILL.md +26 -0
  76. package/concepts/bc-security-audit/body/AI-AND-LLM.md +25 -0
  77. package/concepts/bc-security-audit/body/ATTACK-CLASSES.md +35 -0
  78. package/concepts/bc-security-audit/body/DESKTOP-MOBILE-AND-LOCAL-IPC.md +28 -0
  79. package/concepts/bc-security-audit/body/RECONNAISSANCE.md +49 -0
  80. package/concepts/bc-security-audit/body/SKILL.md +117 -0
  81. package/concepts/bc-security-audit/body/SUPPLY-CHAIN-AND-RELEASE.md +28 -0
  82. package/concepts/bc-security-audit/body/VALIDATION-AND-REPORTING.md +124 -0
  83. package/concepts/bc-security-audit/body/WEB-PROTOCOL-AND-AUTH.md +27 -0
  84. package/concepts/bc-security-audit/body/validate_audit.py +151 -0
  85. package/concepts/bc-self-improve/body/SKILL.md +104 -0
  86. package/concepts/bc-seo/body/CITATIONS.md +23 -0
  87. package/concepts/bc-seo/body/IMAGE-SEO.md +350 -0
  88. package/concepts/bc-seo/body/SKILL.md +453 -0
  89. package/concepts/bc-setup-project/body/SKILL.md +252 -0
  90. package/concepts/bc-setup-project/body/scaffold.py +2751 -0
  91. package/concepts/bc-setup-project/body/starter-items.md +157 -0
  92. package/concepts/bc-setup-project/body/work-data.md +114 -0
  93. package/concepts/bc-setup-project/body/work_index.py +626 -0
  94. package/concepts/bc-setup-project/body/work_spent.py +220 -0
  95. package/concepts/bc-subagent-driven-development/body/SKILL.md +61 -0
  96. package/concepts/bc-tdd/body/SKILL.md +184 -0
  97. package/concepts/bc-tdd/body/formal.md +77 -0
  98. package/concepts/bc-tdd/body/mocking.md +49 -0
  99. package/concepts/bc-tdd/body/properties.md +59 -0
  100. package/concepts/bc-tdd/body/refactoring.md +12 -0
  101. package/concepts/bc-tdd/body/scripts/confirm-red.py +136 -0
  102. package/concepts/bc-tdd/body/tests.md +59 -0
  103. package/concepts/bc-teach/body/GLOSSARY-FORMAT.md +36 -0
  104. package/concepts/bc-teach/body/LEARNING-RECORD-FORMAT.md +60 -0
  105. package/concepts/bc-teach/body/MISSION-FORMAT.md +34 -0
  106. package/concepts/bc-teach/body/RESOURCES-FORMAT.md +53 -0
  107. package/concepts/bc-teach/body/REVIEW-FORMAT.md +48 -0
  108. package/concepts/bc-teach/body/SKILL.md +281 -0
  109. package/concepts/bc-teach/body/WIKI-FORMAT.md +58 -0
  110. package/concepts/bc-teach/body/scripts/due.py +65 -0
  111. package/concepts/bc-to-spec/body/SKILL.md +21 -0
  112. package/concepts/bc-to-tickets/body/SKILL.md +21 -0
  113. package/concepts/bc-triage/body/AGENT-BRIEF.md +38 -0
  114. package/concepts/bc-triage/body/OUT-OF-SCOPE.md +51 -0
  115. package/concepts/bc-triage/body/SKILL.md +81 -0
  116. package/concepts/bc-unslop/body/SKILL.md +269 -0
  117. package/concepts/bc-using-git-worktrees/body/SKILL.md +91 -0
  118. package/concepts/bc-wiki-maintain/body/SKILL.md +361 -0
  119. package/concepts/bc-wiki-maintain/body/runner/README.md +552 -0
  120. package/concepts/bc-wiki-maintain/body/runner/bc-wiki-lint.service +24 -0
  121. package/concepts/bc-wiki-maintain/body/runner/bc-wiki-lint.timer +15 -0
  122. package/concepts/bc-wiki-maintain/body/runner/bc-wiki-maintain-all.service +29 -0
  123. package/concepts/bc-wiki-maintain/body/runner/bc-wiki-maintain-all.timer +16 -0
  124. package/concepts/bc-wiki-maintain/body/runner/bc-wiki-maintain.service +28 -0
  125. package/concepts/bc-wiki-maintain/body/runner/bc-wiki-maintain.timer +12 -0
  126. package/concepts/bc-wiki-maintain/body/runner/bc-wiki-notify@.service +15 -0
  127. package/concepts/bc-wiki-maintain/body/runner/notify-failure.sh +92 -0
  128. package/concepts/bc-wiki-maintain/body/runner/run-lint.sh +69 -0
  129. package/concepts/bc-wiki-maintain/body/runner/run-promotion-all.sh +103 -0
  130. package/concepts/bc-wiki-maintain/body/runner/run-promotion.sh +270 -0
  131. package/concepts/bc-wiki-maintain/body/wiki_lint.py +958 -0
  132. package/concepts/bc-wiki-maintain/body/wiki_search.py +206 -0
  133. package/concepts/bc-work-sync/body/PLAN.md +46 -0
  134. package/concepts/bc-work-sync/body/SKILL.md +71 -0
  135. package/concepts/bc-writing-plans/body/SKILL.md +79 -0
  136. package/package.json +130 -4
  137. package/packages/agent-kernel-pi/AGENT-KERNEL.md +109 -0
  138. package/packages/agent-kernel-pi/index.js +8 -0
  139. package/packages/agent-kernel-pi/package.json +12 -0
@@ -0,0 +1,59 @@
1
+ # Property-based tests (Level 2)
2
+
3
+ Load this when a change touches logic with a statable rule. The RED/GREEN rules in [SKILL.md](SKILL.md) still apply; this page adds what is specific to properties.
4
+
5
+ ## When a property is required
6
+
7
+ **Required** when the change touches logic whose correct behaviour can be stated as a rule over many inputs:
8
+
9
+ - parsers and formatters (round-trip: `parse(format(x)) == x`);
10
+ - data transforms (invariants preserved: count, set of keys, total);
11
+ - calculations (bounds, monotonicity, agreement with a simple reference implementation);
12
+ - sorting and filtering (output ordered, a permutation or subset of the input, every kept item matches the predicate);
13
+ - state transitions (no sequence of valid operations reaches an invalid state).
14
+
15
+ **Optional** for glue, UI, I/O wiring and configuration. Example-based tests (Level 1) cover those.
16
+
17
+ If you skip a property on rule-bearing logic, name the rule you could not state. "The examples already pass" is not a reason. Why: examples cover the inputs you thought of; a property searches for the ones you did not.
18
+
19
+ ## Libraries
20
+
21
+ | Language | Library | Run by |
22
+ |---|---|---|
23
+ | Python | Hypothesis | the project's pytest command through its guarded runner when configured; otherwise plain `pytest` with `tmp_path` for fixtures, cleanup even on failure, and no custom `--basetemp` |
24
+ | JS/TS | fast-check | the project's test command (for example `pnpm test`) |
25
+ | Rust | proptest | `cargo test` |
26
+
27
+ Properties live in the project's normal suite and run under its existing command; there is no separate gate. Add the library as a dev dependency the first time a project needs it, and add a property-test line to that project's `validation.md` in the same change.
28
+
29
+ **Shell is out of scope.** If shell code carries a statable rule, move that logic into Python and test it there.
30
+
31
+ Use the library's default example count. Do not raise it to look thorough or lower it to save time.
32
+
33
+ ## Writing a good property
34
+
35
+ - State the rule from the spec, not from the implementation. A property that recomputes the expected value with the code under test is tautological, like any other [test that lies](SKILL.md#tests-that-lie).
36
+ - Generate the realistic input domain, including edge cases the spec allows (empty, unicode, duplicates, boundary numbers). Filter (`assume`) sparingly; a property that rejects most inputs tests little.
37
+ - One rule per property, named for the rule (`test_parse_inverts_format`).
38
+
39
+ ## Fail-first for properties
40
+
41
+ A property must be seen failing for the rule it states.
42
+
43
+ - **New logic:** write the property first and watch it fail, as with any RED.
44
+ - **Code that already works:** plant a bug that breaks the stated rule (a mutation, for example dropping the last element or flipping a comparison), watch the property catch it, then revert. Use a disposable copy, as for other tests written after the code.
45
+ - **Record the evidence** where you already report validation: the mutation, the failing property and its shrunk counterexample, and the green run after revert. Under `bc-pipeline-to-done` that is `validation.json`; otherwise your report. Do not create a new evidence file.
46
+
47
+ ## Pin every failure you find
48
+
49
+ When a property finds a real failure, pin its shrunk input as an explicit example so it runs every time, independent of any local cache:
50
+
51
+ - Hypothesis: `@example(...)` on the property;
52
+ - fast-check: the `examples` option of `fc.assert`;
53
+ - proptest: commit the regression file it writes (`proptest-regressions/`).
54
+
55
+ Local failure caches (`.hypothesis/` and similar) are machine-local state: never commit them, and only when the project sits in a folder a sync tool replicates (Syncthing, Dropbox), add them to that tool's ignore list; otherwise create no sync-tool file. Why: a stranger's build worker wrote a `.stignore` into a project no sync tool watched (stranger rerun, 2026-11-27). Hypothesis gitignores `.hypothesis/` itself; add other libraries' caches to `.gitignore`.
56
+
57
+ ## Changing an existing property
58
+
59
+ Never weaken or delete an existing property to make a change pass: narrowing its generator, adding an `assume` that excludes the failing case, loosening the asserted rule, or removing it. A failing property means the code or the spec changed. If the spec really changed, stop and ask the owner; the reviewer treats an unapproved weakening as Critical.
@@ -0,0 +1,12 @@
1
+ # Refactor candidates
2
+
3
+ After a green TDD cycle (all tests passing), look for:
4
+
5
+ - **Duplication** → extract a function/class.
6
+ - **Long methods** → break into private helpers (keep tests on the public interface).
7
+ - **Shallow modules** → combine or deepen (see `/bc-codebase-design`).
8
+ - **Feature envy** → move logic to where the data lives.
9
+ - **Primitive obsession** → introduce value objects.
10
+ - **Existing code** the new code reveals as problematic.
11
+
12
+ Run affected targeted tests after each refactor step; run pytest through the guarded test runner the project's or machine's instructions name (otherwise plain `pytest`, with `tmp_path` for test fixtures and cleanup even on failure; never custom `--basetemp`), and share full-suite evidence rather than re-running the suite. The `agent-kernel` concept's Storage safety section holds the temp-file and scratch-folder rules, when loaded. Why: refactoring needs fast feedback, not repeated full suites. **Never refactor while RED** — get to green first; the passing tests are what make refactoring safe.
@@ -0,0 +1,136 @@
1
+ #!/usr/bin/env python3
2
+ """Run changed tests against old production code, without touching Git state.
3
+
4
+ Untracked environment such as .venv is not copied: pass absolute interpreter paths.
5
+ Submodules are unsupported; LFS content requires a working Git smudge filter.
6
+ Test globs are repo-root-relative; the command runs from the caller's directory.
7
+ For tests-only changes against unchanged code, use a manual behavioural mutation.
8
+ A nonzero command can reflect environment failure, not a meaningful behavioural RED;
9
+ inspect the output. This runs the supplied command, not a security sandbox.
10
+ """
11
+ import argparse
12
+ import fnmatch
13
+ import os
14
+ from pathlib import Path
15
+ import shlex
16
+ import shutil
17
+ import subprocess
18
+ import sys
19
+ import tempfile
20
+
21
+ DEFAULT_TESTS = ['**/tests/**', '**/test/**', '**/__tests__/**', '**/test_*.py',
22
+ '**/*_test.py', '**/*_test.go', '**/*.test.*', '**/*.spec.*',
23
+ '**/conftest.py']
24
+
25
+
26
+ def git(root, *args):
27
+ return subprocess.check_output(['git', '-C', str(root), *args], stderr=subprocess.PIPE)
28
+
29
+
30
+ def matches(name, patterns):
31
+ # Match path components: only ** can cross directory boundaries.
32
+ def match(parts, glob):
33
+ if not glob:
34
+ return not parts
35
+ if glob[0] == '**':
36
+ return match(parts, glob[1:]) or bool(parts) and match(parts[1:], glob)
37
+ return bool(parts) and fnmatch.fnmatchcase(parts[0], glob[0]) and match(parts[1:], glob[1:])
38
+ return any(match(name.split('/'), pattern.split('/')) for pattern in patterns)
39
+
40
+
41
+ def main():
42
+ parser = argparse.ArgumentParser(description=__doc__)
43
+ parser.add_argument('--base', default='HEAD', metavar='REV')
44
+ parser.add_argument('--tests', nargs='+', metavar='GLOB', default=DEFAULT_TESTS)
45
+ raw = sys.argv[1:]
46
+ if '--' not in raw and ('--help' in raw or '-h' in raw):
47
+ parser.print_help()
48
+ return 0
49
+ if '--' not in raw:
50
+ parser.error('separate the test command with --')
51
+ split = raw.index('--')
52
+ args = parser.parse_args(raw[:split])
53
+ command = raw[split + 1:]
54
+ if not command:
55
+ parser.error('a test command is required')
56
+ try:
57
+ root = Path(git(Path.cwd(), 'rev-parse', '--show-toplevel').decode().strip())
58
+ base = git(root, 'rev-parse', '--verify', args.base + '^{commit}').decode().strip()
59
+ changed = git(root, 'diff', '--no-renames', '--name-only', '-z', base, '--').split(b'\0')
60
+ untracked = git(root, 'ls-files', '--others', '--exclude-standard', '-z').split(b'\0')
61
+ names = sorted({os.fsdecode(n) for n in changed + untracked if n
62
+ and matches(os.fsdecode(n), args.tests)})
63
+ if not names:
64
+ print('Infrastructure error: no changed test files')
65
+ return 2
66
+ caller = Path.cwd().resolve().relative_to(root.resolve())
67
+ if any(entry.startswith(b'160000 ') for entry in
68
+ git(root, 'ls-tree', '-r', base).splitlines()):
69
+ raise ValueError('submodules are unsupported')
70
+ with tempfile.TemporaryDirectory(prefix='confirm-red-') as temp:
71
+ target = Path(temp)
72
+ # A private Git directory excludes info/attributes; the empty work tree
73
+ # makes attribute lookup fall back to the base index, not the caller.
74
+ private_git = target / 'git'
75
+ tree = target / 'tree'
76
+ tree.mkdir()
77
+ subprocess.run(['git', 'init', '--bare', '--template=', '-q', str(private_git)], check=True,
78
+ stdout=subprocess.PIPE, stderr=subprocess.PIPE)
79
+ objects = (root / os.fsdecode(git(root, 'rev-parse', '--git-path', 'objects')).strip()).resolve()
80
+ config = (root / os.fsdecode(git(root, 'rev-parse', '--git-path', 'config')).strip()).resolve()
81
+ env = dict(os.environ, GIT_DIR=str(private_git), GIT_WORK_TREE=str(tree),
82
+ GIT_INDEX_FILE=str(target / 'index'), GIT_OBJECT_DIRECTORY=str(objects),
83
+ GIT_ATTR_NOSYSTEM='1')
84
+ env.pop('GIT_COMMON_DIR', None)
85
+ checkout = ['git', '-c', 'include.path=' + str(config),
86
+ '-c', 'core.bare=false', '-c', 'core.attributesFile=' + os.devnull]
87
+ subprocess.run(checkout + ['read-tree', base], env=env, check=True,
88
+ stdout=subprocess.PIPE, stderr=subprocess.PIPE)
89
+ subprocess.run(checkout + ['checkout-index', '-a', '--prefix=' + str(tree) + os.sep],
90
+ env=env, check=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
91
+ target = tree
92
+ for name in names:
93
+ source, dest = root / name, target / name
94
+ # Do not follow old-tree symlinks when overlaying current tests.
95
+ if any(target.joinpath(*Path(name).parts[:i]).is_symlink()
96
+ for i in range(1, len(Path(name).parts) + 1)):
97
+ raise ValueError('test overlay traverses a symlink: ' + name)
98
+ if source.is_symlink():
99
+ raise ValueError('symlink test overlay is unsupported: ' + name)
100
+ if source.exists():
101
+ dest.parent.mkdir(parents=True, exist_ok=True)
102
+ shutil.copy2(source, dest)
103
+ elif dest.exists():
104
+ dest.unlink()
105
+ print('Overlaid tests:\n' + '\n'.join(names))
106
+ print('Command: ' + shlex.join(command))
107
+ result = subprocess.run(command, cwd=target / caller, stdout=subprocess.PIPE,
108
+ stderr=subprocess.STDOUT, text=True, errors='replace')
109
+ output = result.stdout
110
+ print('Command exit code: ' + str(result.returncode))
111
+ print(output, end='' if output.endswith('\n') else '\n')
112
+ pytest = any('pytest' in Path(part).name for part in command)
113
+ if result.returncode < 0 or (pytest and result.returncode in (3, 4, 5)):
114
+ print('Infrastructure error: signal, pytest internal/usage error or no tests collected')
115
+ return 2
116
+ if result.returncode == 0:
117
+ print('NOT red: tests passed against old code; they cannot catch the change')
118
+ return 1
119
+ print('Confirmed red: command failed against old code')
120
+ if (pytest and result.returncode == 2) or any(marker in output for marker in
121
+ ('ImportError', 'ModuleNotFoundError', 'NameError', 'AttributeError',
122
+ 'unexpected keyword argument', 'Cannot find module', 'is not a function', 'undefined:')):
123
+ print('WARNING: collection/missing-symbol red only proves the symbol is new; '
124
+ 'use a behavioural mutation check')
125
+ return 0
126
+ except Exception as error:
127
+ print('Infrastructure error: ' + str(error), file=sys.stderr)
128
+ return 2
129
+
130
+
131
+ if __name__ == '__main__':
132
+ try:
133
+ sys.exit(main())
134
+ except Exception as error:
135
+ print('Infrastructure error: ' + str(error), file=sys.stderr)
136
+ sys.exit(2)
@@ -0,0 +1,59 @@
1
+ # Good and bad tests
2
+
3
+ ## Good tests — integration-style
4
+
5
+ Test through real interfaces, not mocks of internal parts.
6
+
7
+ ```typescript
8
+ // GOOD: tests observable behavior
9
+ test("user can checkout with valid cart", async () => {
10
+ const cart = createCart();
11
+ cart.add(product);
12
+ const result = await checkout(cart, paymentMethod);
13
+ expect(result.status).toBe("confirmed");
14
+ });
15
+ ```
16
+
17
+ Characteristics:
18
+ - Tests behavior users/callers care about.
19
+ - Uses the public API only.
20
+ - Survives internal refactors.
21
+ - Describes WHAT, not HOW.
22
+ - One logical assertion per test.
23
+
24
+ ## Bad tests — implementation-detail tests
25
+
26
+ Coupled to internal structure.
27
+
28
+ ```typescript
29
+ // BAD: tests implementation details
30
+ test("checkout calls paymentService.process", async () => {
31
+ const mockPayment = jest.mock(paymentService);
32
+ await checkout(cart, payment);
33
+ expect(mockPayment.process).toHaveBeenCalledWith(cart.total);
34
+ });
35
+ ```
36
+
37
+ Red flags:
38
+ - Mocking internal collaborators.
39
+ - Testing private methods.
40
+ - Asserting on call counts/order.
41
+ - Test breaks when refactoring without a behavior change.
42
+ - Test name describes HOW, not WHAT.
43
+ - Verifying through external means instead of the interface.
44
+
45
+ ```typescript
46
+ // BAD: bypasses the interface to verify
47
+ test("createUser saves to database", async () => {
48
+ await createUser({ name: "Alice" });
49
+ const row = await db.query("SELECT * FROM users WHERE name = ?", ["Alice"]);
50
+ expect(row).toBeDefined();
51
+ });
52
+
53
+ // GOOD: verifies through the interface
54
+ test("createUser makes user retrievable", async () => {
55
+ const user = await createUser({ name: "Alice" });
56
+ const retrieved = await getUser(user.id);
57
+ expect(retrieved.name).toBe("Alice");
58
+ });
59
+ ```
@@ -0,0 +1,36 @@
1
+ # GLOSSARY.md Format
2
+
3
+ `GLOSSARY.md` is the canonical language for a standalone teaching workspace. With the explicit
4
+ `.bc-agent/references/teach-skill.md` adapter, the canonical glossary is the existing **Glossary**
5
+ section of `project/overview.md` in the host vault — it is not duplicated into `concepts/` or a
6
+ new root file. All lessons, knowledge pages, and learning records should adhere to the resolved
7
+ glossary. Building it is itself part of learning: compressing a concept into a tight definition
8
+ is evidence the user understands it.
9
+
10
+ ## Structure
11
+
12
+ ```md
13
+ # {Topic} Glossary
14
+
15
+ {One or two sentence description of the topic this glossary covers.}
16
+
17
+ ## Terms
18
+
19
+ **Hypertrophy**:
20
+ Muscle growth driven by mechanical tension and metabolic stress over repeated training sessions.
21
+ _Avoid_: Bulking, getting big
22
+
23
+ **Progressive overload**:
24
+ Systematically increasing the demand on a muscle over time — via load, volume, or intensity.
25
+ _Avoid_: Pushing harder, levelling up
26
+ ```
27
+
28
+ ## Rules
29
+
30
+ - **Add a term only when the user understands it.** The glossary is a record of compressed knowledge, not a dictionary the user reads to learn. Wait until they can use a concept correctly before promoting it here.
31
+ - **Be opinionated.** When several words exist for the same concept, pick the best one and list the rest as aliases to avoid.
32
+ - **Keep definitions tight.** One or two sentences. Define what the term IS, not what it does or how to do it.
33
+ - **Use the glossary's own terms inside definitions.** Once a term is in, prefer it everywhere — including inside other definitions.
34
+ - **Group under subheadings** when natural clusters emerge. A flat list is fine when terms cohere.
35
+ - **Flag ambiguities explicitly.** If a term is used loosely in the wider field, note the resolution: "In this workspace, 'set' always means a working set."
36
+ - **Revise as understanding deepens.** Update definitions in place; do not leave stale entries.
@@ -0,0 +1,60 @@
1
+ # Learning Record Format
2
+
3
+ Learning records live in `./learning-records/` in a standalone workspace and use sequential numbering: `0001-slug.md`, `0002-slug.md`, etc. With the explicit `.bc-agent/references/teach-skill.md` adapter, use `learning/records/` in the host vault instead — never create a second records directory. Create the resolved directory lazily, only when the first record is written.
4
+
5
+ They are the teaching equivalent of ADRs: they capture demonstrated understanding, disclosed prior knowledge, and corrected misconceptions. They are the input to the zone of proximal development, so their integrity matters more than their volume.
6
+
7
+ ## Template
8
+
9
+ ```md
10
+ ---
11
+ Status: demonstrated # demonstrated | self-reported | misconception | superseded by LR-NNNN
12
+ ---
13
+
14
+ # {Short title of what was learned or established}
15
+
16
+ {1-3 sentences: what was learned, and why it matters for future sessions.}
17
+
18
+ ## Evidence
19
+ {How the user demonstrated it: the question they answered, the thing they produced, or the exact prior experience they claimed. Required — a record without evidence/status is a guess, and guesses corrupt future difficulty calibration.}
20
+ ```
21
+
22
+ ## Status values
23
+
24
+ - **demonstrated** — the user explained, applied, or produced something that shows understanding. Future sessions may rely on it.
25
+ - **self-reported** — the user claimed prior knowledge, but it was not demonstrated. Future sessions must spot-check before using it as the ZPD floor.
26
+ - **misconception** — the user exposed a wrong model worth remembering. Do not mark it corrected unless the corrected understanding was later demonstrated.
27
+ - **superseded by LR-NNNN** — a later record replaces this one.
28
+
29
+ ## Optional sections
30
+
31
+ - **Implications** — what this unlocks or rules out for future sessions, when non-obvious.
32
+
33
+ ## The evidence bar
34
+
35
+ Write a `demonstrated` record only when the user has *demonstrated* understanding — explained it back correctly, applied it to a new case, or produced something that works. Hold the bar deliberately high:
36
+
37
+ - A half-right answer is not evidence. Probe with a follow-up before crediting.
38
+ - Your own generosity is the failure mode: an over-credited record sets the ZPD floor too high and makes every future lesson land above the user's head.
39
+ - For disclosed prior knowledge ("I already know X"), record the *depth claimed* as `self-reported` unless a spot-check demonstrates it. Self-reported records are memory aids, not evidence.
40
+
41
+ ## When to write a record
42
+
43
+ 1. The user demonstrated genuine understanding of something non-trivial (per the evidence bar above) — `Status: demonstrated`.
44
+ 2. The user disclosed prior knowledge — `Status: self-reported`; include claimed depth and what to spot-check before relying on it.
45
+ 3. A misconception appeared — `Status: misconception`; high-value because it predicts future stumbling blocks. Mark a correction separately only after the corrected understanding is demonstrated.
46
+ 4. The mission shifted in response to learning — update the resolved mission (`MISSION.md` standalone or `learning/plan.md` hosted) and cross-reference it here.
47
+
48
+ ### What does _not_ qualify
49
+
50
+ - Material merely covered. Coverage is not learning; wait for evidence.
51
+ - Term definitions already captured in the resolved glossary (`GLOSSARY.md` standalone or the Glossary section of `project/overview.md` hosted).
52
+ - Session activity logs. Records are decision-grade insights, not a journal.
53
+
54
+ ## Supersession
55
+
56
+ When a later record contradicts an earlier one, mark the old record `Status: superseded by LR-NNNN` rather than deleting it. How understanding evolved is itself useful signal.
57
+
58
+ ## Index
59
+
60
+ Every record gets a one-line entry (`LR-0001 — title — demonstrated`) in the resolved shared/standalone `index.md` under `## Learning records`, updated when the record is written or superseded. Sessions read the index and open only relevant records.
@@ -0,0 +1,34 @@
1
+ # MISSION.md Format
2
+
3
+ `MISSION.md` lives at the standalone workspace root. It captures the _reason_ the user is learning this topic. Every teaching decision — what to teach next, which resources to surface, which exercises to design — should trace back to this document.
4
+
5
+ When the explicit `.bc-agent/references/teach-skill.md` adapter is active, the same mission
6
+ lives at `learning/plan.md` under the host vault. Do not create a hosted `MISSION.md` or copy
7
+ this state; resolve the path from the adapter and keep the standalone format unchanged.
8
+
9
+ ## Template
10
+
11
+ ```md
12
+ # Mission: {Topic}
13
+
14
+ ## Why
15
+ {1-3 sentences. The concrete real-world goal the user is chasing. What changes in their life or work when they have this skill? Avoid abstract framings like "to understand X" — push for the underlying outcome.}
16
+
17
+ ## Success looks like
18
+ - {A specific, observable thing the user will be able to do}
19
+ - {Another specific thing}
20
+
21
+ ## Constraints
22
+ - {Time, budget, prior commitments, learning preferences, anything that bounds the approach}
23
+
24
+ ## Out of scope
25
+ - {Adjacent topics the user explicitly does not want to chase right now — protects the zone of proximal development}
26
+ ```
27
+
28
+ ## Rules
29
+
30
+ - **One mission per workspace.** Two unrelated goals means two workspaces.
31
+ - **Concrete over abstract.** "Run a half marathon by October" beats "get fitter."
32
+ - **Push back on vagueness.** If the user cannot articulate why, interview them before writing anything. A bad mission is worse than no mission.
33
+ - **Revise when reality shifts.** When the goal moves, update this file and write a learning record capturing why — don't leave a stale mission steering future sessions.
34
+ - **Keep it short.** If the resolved mission file runs past a screen, it has stopped being a compass and started being a plan.
@@ -0,0 +1,53 @@
1
+ # RESOURCES.md Format
2
+
3
+ `RESOURCES.md` is the curated catalog of trusted sources for a standalone teaching workspace. With
4
+ the explicit `.bc-agent/references/teach-skill.md` adapter, use the host's
5
+ `references/teach-resources.md` instead — one catalog, no duplicate root file. It is the
6
+ annotation layer over the existing `./sources/` directory of actual ingested material (clipped
7
+ articles, papers, transcripts), which is immutable once saved. Factual claims in the knowledge
8
+ pages cite these sources, not parametric guesses. Wisdom comes from the communities listed here.
9
+
10
+ When a source is ingested, save the material itself to `./sources/` (web pages rot; local copies
11
+ don't) and note its filename in the resolved catalog.
12
+
13
+ ## Structure
14
+
15
+ ```md
16
+ # {Topic} Resources
17
+
18
+ ## Knowledge
19
+
20
+ - [Book: _The Science and Practice of Strength Training_ — Zatsiorsky & Kraemer](https://example.com)
21
+ Vetted: foundational academic text, widely cited. Use for: periodisation, recovery, intensity zones.
22
+ - [Article: "How Much Should I Train?" — Greg Nuckols (Stronger By Science)](https://example.com)
23
+ Vetted: evidence review with primary citations; author is a recognised practitioner. Use for: weekly volume targets. Ingested: `sources/nuckols-volume.md` → [summary](wiki/source-nuckols-volume.md) standalone, or the corresponding page in `concepts/` hosted.
24
+
25
+ ## Wisdom (Communities)
26
+
27
+ - [r/weightroom](https://reddit.com/r/weightroom)
28
+ High-signal subreddit, moderated against bro-science. Use for: programme critique, plateau troubleshooting.
29
+ - Local: Tuesday strength class at {gym name}
30
+ Use for: real-time coaching feedback on lifts.
31
+
32
+ ## Gaps
33
+
34
+ - {Areas the mission needs that no good resource yet covers — drives future search}
35
+ ```
36
+
37
+ ## Vetting protocol
38
+
39
+ A resource does not become "high-trust" by being added to this file — it must earn entry. Before adding one, check:
40
+
41
+ 1. **Authority** — is the author a recognised expert, primary source, or peer-reviewed venue? Who else cites them?
42
+ 2. **Incentive** — is it education or marketing? Content that funnels toward a product sale is suspect.
43
+ 3. **Citations** — does it cite primary sources itself, or assert from nowhere?
44
+ 4. **Cross-check** — does at least one independent trusted source agree on its core claims?
45
+
46
+ Record the vetting outcome in the annotation (`Vetted: ...`). If you cannot vet a source, list it under `## Gaps` as a candidate, not under Knowledge.
47
+
48
+ ## Rules
49
+
50
+ - **Annotate every entry.** A bare link is useless in three months: one line on what it covers and when to reach for it.
51
+ - **Group by Knowledge / Wisdom.** A resource may appear in only one group.
52
+ - **Prune ruthlessly.** A resource that turned out wrong, shallow, or off-mission gets removed, not buried. In hosted mode, edit only the teach-owned `references/teach-resources.md` catalog; do not rewrite host orientation pages. Five sharp sources beat thirty mediocre ones.
53
+ - **Record community preferences.** If the user opts out of communities, note it here so future sessions stop proposing them.
@@ -0,0 +1,48 @@
1
+ # REVIEW.md Format
2
+
3
+ `REVIEW.md` is the standalone spaced-repetition queue. It is what turns "spacing" from a stated principle into a mechanism. It lives at the standalone workspace root and is checked at the start of every session, before new material.
4
+
5
+ With the explicit `.bc-agent/references/teach-skill.md` adapter, the queue lives at
6
+ `learning/review.md` in the host vault. Do not create a hosted `REVIEW.md`; the queue has one
7
+ authoritative home selected by the adapter.
8
+
9
+ ## Template
10
+
11
+ ```md
12
+ # Review Queue
13
+
14
+ | # | Prompt | Source | Last reviewed | Interval | Due |
15
+ |---|--------|--------|---------------|----------|-----|
16
+ | 1 | Explain why RPE 8 means two reps in reserve | LR-0003 | 2026-06-10 | 4d | 2026-06-14 |
17
+ | 2 | From memory: the three drivers of hypertrophy | LR-0001 | 2026-06-08 | 9d | 2026-06-17 |
18
+ ```
19
+
20
+ - **Prompt** — a free-recall cue, phrased so the agent can ask it verbatim. Never a yes/no question.
21
+ - **Source** — the learning record or wiki page it came from.
22
+ - **Interval** — the current gap; **Due** = last reviewed + interval.
23
+
24
+ ## Computing what's due
25
+
26
+ Never do the date arithmetic in your head. Run `python3 <skill dir>/scripts/due.py <resolved review queue>` — `REVIEW.md` standalone or `learning/review.md` hosted. It prints the due items and the exact next due date for each outcome (recalled / hard / failed). Copy those dates into the resolved table.
27
+
28
+ ## Scheduling
29
+
30
+ Use a simple expanding schedule (no algorithm worship needed):
31
+
32
+ - New item: due in **2 days**.
33
+ - Recalled correctly: roughly **double** the interval (2 → 4 → 9 → 20 → 45 days). Cap at 60 days.
34
+ - Recalled with difficulty: keep the interval the same.
35
+ - Failed: reset to **2 days**, and consider making it the focus of today's lesson.
36
+
37
+ Convert all dates to absolute dates (the agent knows today's date; the file must not contain "next week").
38
+
39
+ ## Rules
40
+
41
+ - **Review before teaching.** 2–3 due items per session, every session. If nothing is due, say so and move on.
42
+ - **One concept per item.** If a prompt needs a compound answer, split it.
43
+ - **Retire items** that survive two 45–60 day intervals — move them to a `## Retired` section rather than deleting, so re-entry is cheap if the topic resurfaces.
44
+ - **Keep it under ~30 active items.** If it grows past that, consolidate overlapping prompts; an unworkable queue gets skipped, and a skipped queue is worse than a short one.
45
+
46
+ ## Anki users
47
+
48
+ The resolved review queue only schedules reviews when a session happens; Anki nags daily on its own. If the user uses Anki (ask once, record the answer in the resolved notes file), offer to export review items as cards instead — via AnkiConnect if their Anki is running, otherwise a genanki-generated `.apkg`. Anki then owns scheduling: keep the resolved queue only as the export ledger (which items have been exported), and skip the in-session review ritual for exported items.