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,43 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: bc-brainstorming
|
|
3
|
+
description: Use when a feature, behavior change, UI, architecture, or product idea is not yet designed and needs collaborative exploration before implementation planning.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Brainstorming
|
|
7
|
+
|
|
8
|
+
Turn a rough idea into an approved design. Do not implement while core purpose, scope, constraints, or success criteria are still being discovered.
|
|
9
|
+
|
|
10
|
+
## When to use
|
|
11
|
+
|
|
12
|
+
Use for new product ideas, features with unresolved behavior, UI/architecture choices, or broad changes where implementation could go in multiple valid directions.
|
|
13
|
+
|
|
14
|
+
Do not use to block clearly specified small edits, bug fixes with a tight repro, or tasks where the user explicitly gave the design and asked for implementation.
|
|
15
|
+
|
|
16
|
+
## Process
|
|
17
|
+
|
|
18
|
+
1. Explore current project context: docs, relevant files, recent decisions.
|
|
19
|
+
2. If the request contains multiple independent subsystems, stop and decompose before detailed questioning.
|
|
20
|
+
3. Ask clarifying questions one at a time. Prefer multiple choice when useful.
|
|
21
|
+
4. Propose 2–3 approaches with tradeoffs and a recommendation.
|
|
22
|
+
5. Present the design in appropriately sized sections: architecture, components, data flow/state, edge cases/errors, testing.
|
|
23
|
+
Apply `naming-things` when choosing domain or public code names in the design.
|
|
24
|
+
6. Get user approval or revisions.
|
|
25
|
+
7. Save the approved design/spec if the project expects durable planning docs.
|
|
26
|
+
8. Self-review the spec/design for placeholders, contradictions, ambiguity, and over-broad scope.
|
|
27
|
+
9. Hand off to implementation planning (`bc-writing-plans`, `bc-prd-drafting`, `bc-plan-slicing`, or project-specific pipeline). Do not start coding unless the user approved both design and execution.
|
|
28
|
+
|
|
29
|
+
## Design quality checks
|
|
30
|
+
|
|
31
|
+
- Every component has one clear responsibility and interface.
|
|
32
|
+
- The design follows existing project patterns unless deliberately changing them.
|
|
33
|
+
- Refactoring is targeted to the current goal, not drive-by cleanup.
|
|
34
|
+
- YAGNI: remove speculative features and “professional” extras not needed for success.
|
|
35
|
+
- Tests/verification are considered before planning implementation. <!-- trigger-allow: design self-check before any planning handoff, not a task triggered by the planning pipeline -->
|
|
36
|
+
|
|
37
|
+
## Red flags
|
|
38
|
+
|
|
39
|
+
- “This is simple, I can just build it.” Simple unchecked assumptions still waste time.
|
|
40
|
+
- Asking five questions at once. Use one-at-a-time to keep decisions crisp.
|
|
41
|
+
- Presenting only one approach when the design space is still open.
|
|
42
|
+
- Writing code, scaffolding, or editing files before design approval.
|
|
43
|
+
- Producing a spec with `TBD`, contradictory sections, or ambiguous requirements.
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: bc-code-review
|
|
3
|
+
description: Review a diff or completed change for independent Spec fidelity and Standards quality; also use when receiving review feedback or deciding whether comments should be implemented.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Code Review
|
|
7
|
+
|
|
8
|
+
Code review is technical evaluation, not emotional performance. Verify feedback against the codebase; request reviews with enough context for an independent reviewer to judge the diff.
|
|
9
|
+
|
|
10
|
+
Before a parallel review, run the machine's storage health check if one exists, and stop and report on critical or unknown health or if the configured check cannot run. If no storage health check is configured, skip it and note that in one line in the report. Reuse recorded checks for the exact tree; repro findings only with targeted tests, run 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`), with scratch folders from `mktemp -d`, never under `/tmp`. The `agent-kernel` concept's Storage safety section holds the temp-file and scratch-folder rules, when loaded. Why: reviewers should assess evidence, not duplicate full suites.
|
|
11
|
+
|
|
12
|
+
## Two-axis diff review
|
|
13
|
+
|
|
14
|
+
For a branch, work-in-progress diff, PR, or completed task, review two independent axes:
|
|
15
|
+
|
|
16
|
+
- **Spec** — does the change faithfully implement the issue, PRD, ticket, or acceptance criteria without omissions or scope creep?
|
|
17
|
+
- **Standards** — does it follow repository conventions and avoid material code-quality, integration, test, portability, security, or documentation problems?
|
|
18
|
+
|
|
19
|
+
### 1. Pin the review packet
|
|
20
|
+
|
|
21
|
+
Use the caller’s explicit base SHA/ref. If none is supplied, ask for one; an AFK driver must pass the recorded base SHA. Capture:
|
|
22
|
+
|
|
23
|
+
- `git diff <base>...HEAD` for committed work, or `git diff <base>` for an uncommitted worktree;
|
|
24
|
+
- commit list or changed-file list;
|
|
25
|
+
- issue/spec/acceptance criteria and domain context;
|
|
26
|
+
- repository standards sources and validation commands/results.
|
|
27
|
+
|
|
28
|
+
Stop if the base does not resolve or the diff is empty. Never review a vague “latest changes” blob.
|
|
29
|
+
|
|
30
|
+
### 2. Review independently
|
|
31
|
+
|
|
32
|
+
Run read-only Spec and Standards reviewers in parallel. They must not edit files, commit, push, close issues, mutate labels, reset a worktree, or manage its lifecycle.
|
|
33
|
+
|
|
34
|
+
Reviewers receive the diff, the spec/acceptance criteria, and the standards sources — **never the implementer's reasoning, chat history, or self-justification**. An author's narrative biases a reviewer toward acceptance; and if a diff can't be judged without the author's explanation, that is itself a finding — the code and its comments must carry that context.
|
|
35
|
+
|
|
36
|
+
**Spec reviewer:** report missing/partial requirements, behavior not requested, and apparently implemented behavior that is wrong. Cite the requirement and diff hunk for each finding. Check each new or changed property-based test (Level 2 in the `bc-tdd` skill, section Test levels) against the spec: the rule it states must be one the spec requires, and its generator must cover the input domain the spec allows. Rule-bearing logic changed without a property, and with no named reason, is a finding. Weakening or deleting an existing property (a narrowed generator, an `assume` that excludes failing cases, a loosened assertion, a removal) is **Critical** unless the packet records the owner's approval.
|
|
37
|
+
|
|
38
|
+
Load the `bc-tdd` skill and audit the report's Test levels block (its section Test levels) against the diff. Each of these is a finding: a missing block — a packet with code changes but neither a Test levels block nor `Test-levels:` commit trailers is itself a finding you must report, never a reason to skip the audit; an L2 line on rule-bearing logic that says `covered by examples`, `not added`, or defers the choice to the owner or reviewer (only a quoted owner approval waives a level); `L2: not required` on rule-bearing logic (a parser, transform or calculation is not glue); an `L2: skipped` reason that names no specific rule; a diff touching a risk-class component with no L3 `on`, `candidate suggested` or `declined` line. For a Level 3 component (the `bc-tdd` skill's `formal.md`), check that each formal rule states what its plain-English line says, and list every escape hatch in the proof: `assume`, axioms/`{:axiom}`, Verus `external_body`/`assume`/`admit`, `{:verify false}`, TLA+ constraints that exclude states, vacuous preconditions. An escape hatch not in the spec's approved assumptions is **Critical**, even when the proof passes. A Level 3 proof that did not run is `untested` and blocks landing.
|
|
39
|
+
|
|
40
|
+
**Standards reviewer:** apply repository standards first. When no project rule settles it, flag material smells as labelled judgment calls—not hard violations: mysterious names, duplicated logic, feature envy, data clumps, primitive obsession, repeated conditionals, shotgun surgery, divergent change, speculative generality, message chains, and needless middle-men. Review new or changed tests against the tests-that-lie definitions in the `bc-tdd` skill (section Tests that lie); flag tautologies, structure-sensitive coverage claims, erased failure modes, and internal-mock assertions rather than trusting green CI. Check new test files against the `bc-tdd` skill's Test layout section: a browser test for behaviour a fake could show, state shared across files, or a file past about 25 tests or 60 s is a finding. Check observable tests, error handling, integration, portability/security, migrations, compatibility, and docs when relevant. Where changed code moves or accumulates data across a boundary (prompt, message, snapshot, payload, file), ask how large it can get — maximum input, duplication or amplification by serialisation (a 31.8 MiB file became a 63.5 MiB message), growth over time — and what happens at the limit: fail loudly, truncate, or block; an unbounded or unhandled limit is a finding. Why: these limits pass every small-fixture test and surface only in real use, after work is blocked. When the diff touches a README, an existing `docs/` page, an architecture page, or JSDoc that states a contract, load `bc-codebase-docs` and flag a stale owner, a change-narration paragraph, or a newly invented `docs/` tree. Do not turn the review into a docs rewrite. When the diff changes a status line or log entry that summarizes test results, check every count and claim in it (runs or checks, blind, PASS) against the results file it cites; one the file does not show is an Important finding. Why: such summaries overclaimed their tables in 4 of 10 items of one drain. Tooling-enforced style is not a review finding.
|
|
41
|
+
|
|
42
|
+
Classify findings as **Critical**, **Important**, or **Minor** and include a precise file/hunk, why it matters, and evidence. If either axis lacks the evidence needed to assess the change, that is blocking—not an excuse to guess.
|
|
43
|
+
|
|
44
|
+
### 3. Keep reports separate
|
|
45
|
+
|
|
46
|
+
Present findings under `## Spec` and `## Standards`. Do not merge or rerank them: code may meet the spec while violating standards, or vice versa. Critical and Important findings block landing; Minors are recorded but may be consciously deferred.
|
|
47
|
+
|
|
48
|
+
Include a report line: `Merge danger: door = one-way|two-way; blast radius = localized|cross-cutting; reason = ...`. One-way means irreversible effects: data loss/migrations, external sends (emails, payments, publishing), deletes, or secret exposure; two-way means revertable effects. Blast radius is the reach of the effect if it is wrong — which users, data, systems or external parties it touches — not the size of the diff: a three-line loop that emails every user is cross-cutting. Classify the actual effects, not just whether the code can be reverted. Always flag one-way doors for human review regardless of diff size; automated approval does not discharge that requirement. Keep this line within any role-defined report format.
|
|
49
|
+
|
|
50
|
+
### Role output contract
|
|
51
|
+
|
|
52
|
+
When the reviewer's role or harness prompt defines its own output format and priority labels (for example P0/P1/P2 with a merge verdict), use that format as the report contract and keep the two axes inside it: put findings under `### Spec` and `### Standards` subsections and never merge or rerank them. Map this skill's labels onto the role's: Critical → P0, Important → P1, Minor → P2. P1 still blocks landing unless the parent explicitly defers it and records why, so the merge verdict stays `BLOCK` while any P0 or undeferred P1 stands, even if the role prompt says only P0 blocks merge. Why: the role prompt and this skill load into the same reviewer, and two competing formats made reports come back in either; a bare relabel would also silently stop Important findings from blocking.
|
|
53
|
+
|
|
54
|
+
### Untested is a result
|
|
55
|
+
|
|
56
|
+
A check you could not run — missing runner, expired auth, unbuildable environment — is recorded `untested` with the reason, never omitted. Why: in a findings table a skipped check and an inapplicable one look identical to the reader, so silent omission reads as coverage. This is a result state, not a severity: Critical/Important/Minor still classify defects you observed. In a human-facing review, report an unconfirmed hypothesis as a question to check, naming what would settle it and assigning no severity—not as a weak finding. Machine-gated contracts without a question channel (`bc-pipeline-to-done` review-contract) retain their existing rule: settle the hypothesis within the reproduction budget, or report it as a finding whose evidence says `untested`. Missing evidence needed to assess the change remains blocking.
|
|
57
|
+
|
|
58
|
+
A finding’s severity cannot exceed the impact demonstrated by an executed check, bounded reproduction, or complete source trace—not a worst-case imagined outcome. This ceiling also applies to machine-gated reports.
|
|
59
|
+
|
|
60
|
+
### Findings are not obligations
|
|
61
|
+
|
|
62
|
+
A reviewer prompted to find gaps will report some even when the work is sound — producing findings is what it was asked to do. Chasing every finding causes over-engineering: extra abstraction layers, defensive code for impossible states, tests for cases that can't happen. So reviewers flag only gaps that affect correctness or the stated requirements (everything else is a labelled judgment call, per the Standards rules above), and fixers treat anything below Critical/Important as optional — pushing back with evidence beats padding the code. This matters most in AFK runs, where nobody is watching a remediation spiral.
|
|
63
|
+
|
|
64
|
+
**Named overclaiming anti-patterns:** checklist deviations presented as defects; strengthening a crash into code execution, ordinary load into shared availability loss, or a same-principal action into privilege gain; defense-in-depth gaps presented as vulnerabilities. These labels need demonstrated consequences, not merely a missing precaution.
|
|
65
|
+
|
|
66
|
+
### Complexity scores are not a quality bar
|
|
67
|
+
|
|
68
|
+
Do not raise a complexity score as a finding on its own, and do not propose or approve a CI threshold on one — `ruff C901`, ESLint `complexity`, Sonar gates, CRAP. A score is a reason to *read* a function, never the finding itself; the finding is the concrete comprehension problem you found there, which the Standards smells above already name.
|
|
69
|
+
|
|
70
|
+
Why: this has been measured. Across four testing disciplines, forcing every function under a complexity cap raised coverage on every run, raised design quality on **none**, and lowered readability on **every** one. It does not simplify, it multiplies names — one prompt loop became three mutually-recursive single-branch functions. The published thresholds do not agree with each other either, which is what an arbitrary constant looks like. Evidence: [unclebob/negative-test-experiment](https://github.com/unclebob/negative-test-experiment) (n=1 product, single author, subjective design scores — enough to refuse a threshold, not enough to claim general harm).
|
|
71
|
+
|
|
72
|
+
If the user wants the gate anyway, that is their call: implement it, and record what it buys and costs somewhere durable rather than dropping the caveat.
|
|
73
|
+
|
|
74
|
+
### Verify a guard can actually fire
|
|
75
|
+
|
|
76
|
+
A rejection clause, validation check, or guard proves nothing until you know its inputs can differ at runtime. Trace each side of the comparison to where the real caller obtains the value. If every production path resolves both sides to the same thing, the check is **inert**: only a test double can supply a differing pair, so it reads as protection, passes review by inspection, and stays permanently green.
|
|
77
|
+
|
|
78
|
+
Name this class explicitly because it defeats the signals reviewers rely on — nothing fails, coverage looks complete, and the code looks careful. Treat "the only inputs reaching this branch come from an injected seam the real caller cannot produce" as a material finding, and say which remedy applies: wire the check to a genuinely independent fact, delete it, or label it a precondition rather than a protection. Watch for two near-misses in fixes: deleting one inert clause while a sibling stays tautological, and substituting a cosmetically independent expression whose runtime value is identical.
|
|
79
|
+
|
|
80
|
+
This does not license adding defensive code for impossible states — see *Findings are not obligations* above. The defect is a guard **described** as protection that cannot deliver it, and the usual fix is accurate labelling or deletion, not more code.
|
|
81
|
+
|
|
82
|
+
## AFK slice gate
|
|
83
|
+
|
|
84
|
+
Inside `/bc-pipeline-to-done`, the reviewed artifact is a worker’s uncommitted, GREEN worktree, and nothing lands until every axis stands approved on the exact diff being landed. A rebase that changes that diff invalidates the approval it carried, so the driver obtains fresh approval before retrying push or close.
|
|
85
|
+
|
|
86
|
+
**The drain owns its own parameters and this section does not restate them.** Which tier applies, how many reviewers a round dispatches, which axes a rework round re-runs, and how many rework cycles are permitted all live in `bc-pipeline-to-done`' review contract, and reading them from there is not optional politeness — an earlier version of this section carried its own copy of the cycle budget and dispatch rule, both of which silently went stale when that loop changed. One home per fact applies to canon describing canon.
|
|
87
|
+
|
|
88
|
+
What this skill contributes inside that loop is the part that is genuinely its own: the two scopes stay distinct, reviewers work from the fixed packet and never from implementation reasoning, and evidence a reviewer lacks is blocking rather than an invitation to guess.
|
|
89
|
+
|
|
90
|
+
## Requesting review
|
|
91
|
+
|
|
92
|
+
Use before merging, after a major task, after a complex bug fix, or when stuck and a fresh perspective could catch mistakes. Prepare the fixed review packet above; do not make reviewers infer requirements or verification from chat history.
|
|
93
|
+
|
|
94
|
+
## Receiving review
|
|
95
|
+
|
|
96
|
+
Before implementing feedback:
|
|
97
|
+
|
|
98
|
+
1. Read all feedback.
|
|
99
|
+
2. Restate unclear requirements or ask before changing code.
|
|
100
|
+
3. Verify against codebase reality.
|
|
101
|
+
4. Evaluate whether it is sound for this codebase.
|
|
102
|
+
5. Implement one item at a time and test each fix.
|
|
103
|
+
6. Push back with technical evidence when feedback is wrong or over-scoped.
|
|
104
|
+
|
|
105
|
+
Never respond with performative agreement (`You're absolutely right`, `Great point`, `Thanks`). Either act, ask a precise question, or give technical reasoning.
|
|
106
|
+
|
|
107
|
+
## External reviewer skepticism
|
|
108
|
+
|
|
109
|
+
External feedback is a suggestion to evaluate, not an order. Check whether it:
|
|
110
|
+
|
|
111
|
+
- Breaks existing behavior or compatibility.
|
|
112
|
+
- Conflicts with user/project decisions.
|
|
113
|
+
- Adds unused “proper” infrastructure. Grep for actual usage; if unused, ask whether to remove/defer instead.
|
|
114
|
+
- Assumes context the reviewer did not have.
|
|
115
|
+
|
|
116
|
+
If you cannot verify a suggestion, say what evidence is missing and ask whether to investigate, ask the reviewer, or proceed.
|
|
117
|
+
|
|
118
|
+
## GitHub review comments
|
|
119
|
+
|
|
120
|
+
When replying to inline GitHub review comments, reply in the thread (`gh api repos/{owner}/{repo}/pulls/{pr}/comments/{id}/replies`) rather than as a top-level PR comment.
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: bc-codebase-design
|
|
3
|
+
description: Shared vocabulary for designing deep modules. Use when designing or improving a module's interface, finding deepening opportunities, deciding where a seam goes, making code more testable or AI-navigable, or when another skill needs the deep-module vocabulary.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Codebase Design
|
|
7
|
+
|
|
8
|
+
## Glossary
|
|
9
|
+
|
|
10
|
+
Use these terms exactly — don't substitute "component," "service," "API," or "boundary." Consistent language is the whole point.
|
|
11
|
+
|
|
12
|
+
- **Module** — anything with an interface and an implementation. Deliberately scale-agnostic: a function, class, package, or tier-spanning slice. *Avoid:* unit, component, service.
|
|
13
|
+
- **Interface** — everything a caller must know to use the module correctly: the type signature, but also invariants, ordering constraints, error modes, required configuration, and performance characteristics. *Avoid:* API, signature (too narrow — they refer only to the type-level surface).
|
|
14
|
+
- **Implementation** — what's inside a module, its body of code. Distinct from **Adapter**.
|
|
15
|
+
- **Depth** — leverage at the interface: how much behaviour a caller (or test) can exercise per unit of interface they have to learn. **Deep** = a lot of behaviour behind a small interface; **shallow** = the interface is nearly as complex as the implementation.
|
|
16
|
+
- **Seam** *(Michael Feathers)* — a place where you can alter behaviour without editing in that place; the *location* at which a module's interface lives. Where to put the seam is its own design decision, distinct from what goes behind it. *Avoid:* boundary (overloaded with DDD's bounded context).
|
|
17
|
+
- **Adapter** — a concrete thing that satisfies an interface at a seam. Describes *role* (what slot it fills), not substance (what's inside).
|
|
18
|
+
- **Leverage** — what callers get from depth: more capability per unit of interface learned. **Locality** — what maintainers get from depth: change, bugs, and verification concentrate in one place.
|
|
19
|
+
|
|
20
|
+
## Deep vs shallow
|
|
21
|
+
|
|
22
|
+
A **deep module** = small interface + lots of implementation. A **shallow module** = large interface + thin implementation (avoid — it's nearly a pass-through). When designing an interface, ask: Can I reduce the number of methods? Simplify the parameters? Hide more complexity inside?
|
|
23
|
+
|
|
24
|
+
## Principles
|
|
25
|
+
|
|
26
|
+
- **Depth is a property of the interface, not the implementation.** A deep module can be internally composed of small, mockable, swappable parts — they just aren't part of the interface. A module can have **internal seams** (private, used by its own tests) as well as the **external seam** at its interface.
|
|
27
|
+
- **The deletion test.** Imagine deleting the module. If complexity vanishes, it was a pass-through. If complexity reappears across N callers, it was earning its keep.
|
|
28
|
+
- **The interface is the test surface.** Callers and tests cross the same seam. If you want to test *past* the interface, the module is probably the wrong shape.
|
|
29
|
+
- **One adapter means a hypothetical seam. Two adapters means a real one.** Don't introduce a seam unless something actually varies across it.
|
|
30
|
+
|
|
31
|
+
## Friction signals
|
|
32
|
+
|
|
33
|
+
Signs a module is too shallow or its seam is in the wrong place. Use them when building as well as when reviewing: if a change you are making produces one, reconsider the shape before adding to it.
|
|
34
|
+
|
|
35
|
+
- Understanding one concept requires bouncing across many files.
|
|
36
|
+
- A module's interface is almost as complex as its implementation.
|
|
37
|
+
- Helpers were extracted for testability, but real bugs hide in how they are called (low locality).
|
|
38
|
+
- Tight coupling leaks across seams.
|
|
39
|
+
- Behaviour is hard to test through a public interface.
|
|
40
|
+
|
|
41
|
+
Confirm a signal with the deletion test before acting on it: complexity that would concentrate if the module were deleted is a deepening signal; complexity that would merely move is not.
|
|
42
|
+
|
|
43
|
+
## Designing for testability
|
|
44
|
+
|
|
45
|
+
Good interfaces make testing natural:
|
|
46
|
+
1. **Accept dependencies, don't create them** — `processOrder(order, paymentGateway)`, not a function that `new`s a `StripeGateway()` inside.
|
|
47
|
+
2. **Return results, don't produce side effects** — `calculateDiscount(cart): Discount`, not `applyDiscount(cart): void` that mutates `cart.total`.
|
|
48
|
+
3. **Small surface area** — fewer methods = fewer tests; fewer params = simpler setup.
|
|
49
|
+
|
|
50
|
+
## Rejected framings
|
|
51
|
+
|
|
52
|
+
- **Depth as ratio of implementation-lines to interface-lines** (Ousterhout): rewards padding the implementation. Use depth-as-leverage instead.
|
|
53
|
+
- **"Interface" as the TypeScript `interface` keyword or a class's public methods**: too narrow — interface here includes every fact a caller must know.
|
|
54
|
+
- **"Boundary"**: overloaded with DDD's bounded context. Say **seam** or **interface**.
|
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: bc-codebase-docs
|
|
3
|
+
description: >
|
|
4
|
+
Keep source-tree documentation truthful: one home per fact, current state
|
|
5
|
+
not change history, tutorial vs reference, and update the owning README or
|
|
6
|
+
existing docs page in the same change as the behavior it describes. Use when
|
|
7
|
+
writing, moving, reviewing, or auditing README, docs/, architecture pages, or
|
|
8
|
+
JSDoc, or when a review says the docs do not match the code. Not for
|
|
9
|
+
.bc-agent/ wikis, agent-facing skills/gates, or human-facing prose quality.
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
# Codebase Docs
|
|
13
|
+
|
|
14
|
+
Source-tree docs are a map of **current** behavior for the next maintainer
|
|
15
|
+
or agent. They fail when the same fact lives in two places, when a page
|
|
16
|
+
narrates the PR that wrote it, or when the code moves and the owning page
|
|
17
|
+
does not.
|
|
18
|
+
|
|
19
|
+
This skill owns **placement** and **truthful maintainer writing**. It does
|
|
20
|
+
not own reader-outcome prose (`bc-plain-language`), agent-instruction authoring
|
|
21
|
+
(`bc-prompting-agents`), or whether a decision earns an ADR (`bc-domain-modeling`).
|
|
22
|
+
|
|
23
|
+
For how-it-works pages, load `bc-explain-visually` for the smallest current-state visual on
|
|
24
|
+
the owning page; placement and one-home rules here still win.
|
|
25
|
+
|
|
26
|
+
## When this applies
|
|
27
|
+
|
|
28
|
+
Use it on **source-tree** maintainer docs: README, an existing `docs/` tree,
|
|
29
|
+
architecture pages, package READMEs, and JSDoc that states a contract.
|
|
30
|
+
|
|
31
|
+
**Do not apply it to `.bc-agent/`.** Do not edit, move, or delete vault
|
|
32
|
+
files to satisfy one-home. The vault has its own placement; a second
|
|
33
|
+
copy there is not this skill's problem to erase.
|
|
34
|
+
**Do not apply it to skill bodies, kernels, gates, or this workspace's
|
|
35
|
+
concept files** unless the user asked to edit those — that is
|
|
36
|
+
`bc-prompting-agents`.
|
|
37
|
+
**Do not use it to restyle a help page or announcement.** Placement still
|
|
38
|
+
applies if the file is source-tree docs; wording for human readers is
|
|
39
|
+
`bc-plain-language`.
|
|
40
|
+
|
|
41
|
+
On a mixed change, apply this skill only to the source-tree doc surface.
|
|
42
|
+
`bc-code-review` loads this skill when a Standards pass sees source-tree docs
|
|
43
|
+
in the diff. `bc-setup-project` points new code wikis at it and keeps it off
|
|
44
|
+
the vault.
|
|
45
|
+
|
|
46
|
+
## One home per fact
|
|
47
|
+
|
|
48
|
+
Each fact has one home: the page or measuring system whose job it is.
|
|
49
|
+
Elsewhere, link there. For live status, the link names the source and how
|
|
50
|
+
to read it: a path, or a command and host when it lives outside git.
|
|
51
|
+
|
|
52
|
+
| Job | Home | Does not belong there |
|
|
53
|
+
|---|---|---|
|
|
54
|
+
| Standing orders an agent needs every session | Root `AGENTS.md` — one to three lines, then a link to the home | Stories, procedures, restated contracts |
|
|
55
|
+
| Current behavior a caller or maintainer looks up | README, or the existing owning `docs/` / architecture page | Why we chose it, PR history, a second copy of the same contract |
|
|
56
|
+
| Cross-module map (only if the page already exists) | `docs/architecture.md` or equivalent | Type catalogs, per-package detail, rationale |
|
|
57
|
+
| Costly, puzzling, trade-off decision | An ADR, and only when `bc-domain-modeling`'s three-part bar holds | Everyday implementation notes |
|
|
58
|
+
| How-to with verify steps | An existing cookbook / contributor page | Design rationale |
|
|
59
|
+
| Live status a system measures: rank, counts, published/held, when a state changed | The system that measures it (its state file, metrics log, or API) | A copy in source-tree docs: the value, or a claim like "visible" / "hidden", even dated "as of" |
|
|
60
|
+
|
|
61
|
+
A document's subject and tree position fix its detail: describe this
|
|
62
|
+
subject; name children by purpose; link to the owner for lower-level
|
|
63
|
+
detail. Why: a README that also retells architecture and the last three
|
|
64
|
+
PRs becomes a second, worse source of truth.
|
|
65
|
+
|
|
66
|
+
Why live status never gets a copy: the measuring system keeps updating and
|
|
67
|
+
nothing updates the prose. A docs page that said "not yet visible" kept
|
|
68
|
+
saying it for days after the metrics showed a rank, and agents that read
|
|
69
|
+
the docs first repeated it as fact. Only an append-only log that the
|
|
70
|
+
project already keeps for dated history may hold such a value; correct a
|
|
71
|
+
bad entry there by appending a superseding note. A dated sentence in a
|
|
72
|
+
README or docs page is still a copy. Do not invent a ledger to hold one.
|
|
73
|
+
|
|
74
|
+
**Do not create a `docs/` tree** because this skill fired, because the
|
|
75
|
+
README feels crowded, or because the user said "just make `docs/foo.md`"
|
|
76
|
+
or "I'm short on time." That is a request to document a fact, not a
|
|
77
|
+
request for a docs tree. Update the existing owner (usually README).
|
|
78
|
+
Create `docs/` only when it already exists, or when the user asks for a
|
|
79
|
+
*tree* — architecture, contributor guides, more than one page — not a
|
|
80
|
+
single file that duplicates the README. Why: "just make docs/cli.md"
|
|
81
|
+
is the shortcut that grows a second wiki.
|
|
82
|
+
|
|
83
|
+
If no page owns the fact, say so. Do not invent a folder to house it.
|
|
84
|
+
|
|
85
|
+
## Tutorial vs reference
|
|
86
|
+
|
|
87
|
+
Classify every in-scope page as a **tutorial** (ordered path to an
|
|
88
|
+
observable outcome) or a **reference** (lookup of current behavior, no
|
|
89
|
+
teaching sequence). Split them when both forms are substantial. Why:
|
|
90
|
+
a reference that also onboards, or a tutorial that also catalogs, hides
|
|
91
|
+
the fact the next reader came for.
|
|
92
|
+
|
|
93
|
+
## Write the current state
|
|
94
|
+
|
|
95
|
+
"Current state" means current behavior, not current status — see the
|
|
96
|
+
live-status row above. Name the live mechanism. Do not write
|
|
97
|
+
"previously," "now," "no longer," "this PR," "this commit," or
|
|
98
|
+
"rejected in review" in durable source-tree docs. Put the change story in the commit, the PR, or an ADR.
|
|
99
|
+
|
|
100
|
+
A reader at HEAD, with no session or PR, must be able to resolve every
|
|
101
|
+
reference and verify every claim. If they cannot, restate the surviving
|
|
102
|
+
fact from the repository's vantage and delete the transcript.
|
|
103
|
+
|
|
104
|
+
Do not hand-edit a file that says it is generated. Edit the owner, then
|
|
105
|
+
regenerate if you know the command; otherwise leave it and say so.
|
|
106
|
+
|
|
107
|
+
## Same-change sync
|
|
108
|
+
|
|
109
|
+
When you change behavior that a README or existing docs page **already
|
|
110
|
+
describes**, update that page in the same change. Why: "the code is the
|
|
111
|
+
docs" is how the next session ships against a lie.
|
|
112
|
+
|
|
113
|
+
This is a human placement rule, not a verifier. Do not add type-paste
|
|
114
|
+
gates, word-count budgets, or i18n pairing. Do not create a page just
|
|
115
|
+
so the rule has a target.
|
|
116
|
+
|
|
117
|
+
If the owning page is unclear, pick the existing page that already
|
|
118
|
+
claims that surface (usually the nearest README) or report that none
|
|
119
|
+
does.
|
|
120
|
+
|
|
121
|
+
## Never
|
|
122
|
+
|
|
123
|
+
These fail by rationalization — the moment they are inconvenient is
|
|
124
|
+
when they matter.
|
|
125
|
+
|
|
126
|
+
- **Never create `docs/`** because someone asked for a single file or
|
|
127
|
+
was short on time. Why: that is how a second wiki starts. A real
|
|
128
|
+
docs-tree request names more than one page or a new home README
|
|
129
|
+
cannot own.
|
|
130
|
+
- **Never edit, move, or delete `.bc-agent/`** under this skill. Why:
|
|
131
|
+
one-home is not a license to empty the vault.
|
|
132
|
+
- **Never skip the owning-page update** because the diff is "obvious"
|
|
133
|
+
or you are short on time. Why: that is how docs and code diverge.
|
|
134
|
+
- **Never dump rationale into a README** to avoid the ADR bar. Why:
|
|
135
|
+
`bc-domain-modeling` keeps ADRs rare so the load-bearing ones stay
|
|
136
|
+
visible; a README is not the overflow tank.
|
|
137
|
+
- **Never copy a live measured value or status claim** into source-tree
|
|
138
|
+
docs, even dated "as of" or because you are short on time. Why: the
|
|
139
|
+
measuring system keeps updating and nothing updates the prose. Name
|
|
140
|
+
the source instead.
|
|
141
|
+
- **Never treat this skill as a note-every-change gate.** Why: that
|
|
142
|
+
default was considered from DeepSeek's Agent Notes and rejected.
|
|
143
|
+
|
|
144
|
+
## Output
|
|
145
|
+
|
|
146
|
+
- Writing/moving: the page that owns the fact, updated to current
|
|
147
|
+
state, with links instead of copies. If you did not update a page,
|
|
148
|
+
say which existing owner was checked and why it needed no change.
|
|
149
|
+
- Review: short findings tagged `home` / `current` / `form` /
|
|
150
|
+
`same-change`. Do not rewrite a tree you were asked only to review.
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: bc-council-audit-security
|
|
3
|
+
description: "Run a bc-security-audit full audit through the advisor council: this session does recon and the threat model, every council advisor hunts the trust boundaries dealt to it, they attack each other's candidates, then every candidate still goes to its own fresh refuting reviewer before the normal records, validator and report, and confirmed findings can be filed. Use when the user says bc-council-audit-security or asks the council to audit a repository's security. Pi only: runs on bc-council-mode, which needs the pi-subagents `subagent` tool."
|
|
4
|
+
disable-model-invocation: true
|
|
5
|
+
argument-hint: "[scope] [--max-verify N]"
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# Council security audit
|
|
9
|
+
|
|
10
|
+
This skill joins three skills and copies none. Load all three before starting:
|
|
11
|
+
|
|
12
|
+
- `bc-council-chain`: the council steps every chain shares (roster, shared map, pass 1, merge, pass 2, fallbacks, cleanup) and the parts a chain must define.
|
|
13
|
+
- `bc-security-audit`: the full-audit workflow, its Output gate, execution boundary, recon note and coverage ledger, fresh verification, JSON records, validator and report.
|
|
14
|
+
- `bc-council-mode`: how to brief, launch, relay to and resume advisors, and the pass cap.
|
|
15
|
+
|
|
16
|
+
Invoking this skill is the explicit full-audit request `bc-security-audit` requires. Run its full audit with one change: the council replaces its step 2 (the single hunting pass). Steps 1, 3 and 4, the Output gate and the execution boundary stay as that skill states them. Run every step through the report and filing without stopping between them; ask the owner only the questions the loaded skills require (for example the Output gate, the roster question or the filing question). Where this file is silent, those three skills decide.
|
|
17
|
+
|
|
18
|
+
Advisor agreement never verifies a finding. Only a fresh `reviewer` decides a verdict; the council only orders the verification queue. Why: agreement between hunters is not independent evidence, and `bc-security-audit`'s independence rule stays whole.
|
|
19
|
+
|
|
20
|
+
## Pre-reading and map
|
|
21
|
+
|
|
22
|
+
The shared map is `bc-security-audit` step 1, done by this session, not by a scout: pass the Output gate, create `.security-audit/run-N/`, write `architecture.md` and seed `coverage-ledger.json` as its `RECONNAISSANCE.md` says, and choose the companions. This replaces `bc-council-chain`'s map scout. Why: the recon note and ledger are already the audit's map, and a second map would drift from the ledger the records cite.
|
|
23
|
+
|
|
24
|
+
Settle the scope (default: the whole repository) and `--max-verify N` (default: no cap). Number the trust boundaries in `architecture.md` (`B1`, `B2`, ...), each with its entry surfaces and `file:line`.
|
|
25
|
+
|
|
26
|
+
Brief extras: the run folder path, the scope and source revision, the selected companion files, `bc-security-audit`'s Evidence before labels section and its named overclaiming anti-patterns, the execution boundary (source only; advisors run nothing and stay read-only), and that advisors propose candidates, never verdicts or severity.
|
|
27
|
+
|
|
28
|
+
## Focuses
|
|
29
|
+
|
|
30
|
+
Deal the numbered trust boundaries round-robin, one at a time, across the advisors until all are dealt; with more advisors than boundaries, dealing wraps. Each advisor hunts every attack class from `ATTACK-CLASSES.md` and the selected companions across its dealt boundaries, and still reports candidates elsewhere. State each advisor's boundaries in chat and in the report's roster section. Why: recon already names the boundaries, and a missed check at a boundary is where a hole appears.
|
|
31
|
+
|
|
32
|
+
## Candidate format
|
|
33
|
+
|
|
34
|
+
Each advisor returns at most 8 candidates (the owner can raise this per run), each as:
|
|
35
|
+
|
|
36
|
+
```
|
|
37
|
+
### <id> <one-line title>
|
|
38
|
+
Claim: <the boundary violation and its concrete outcome>
|
|
39
|
+
Principal: <lower-trust actor, its starting capability, and the affected principal>
|
|
40
|
+
Resource: <the protected resource>
|
|
41
|
+
Outcome: <the concrete security outcome claimed, no stronger than the trace shows>
|
|
42
|
+
Trace: <source steps from input to sink, each with path:line>
|
|
43
|
+
Evidence: <quoted code lines, with file:line>
|
|
44
|
+
Boundary: <B-number from architecture.md>
|
|
45
|
+
Attack class: <class from ATTACK-CLASSES.md or a companion>
|
|
46
|
+
Units: <ledger unit IDs, or "new" with surface × boundary × subsystem × attack class>
|
|
47
|
+
Strength: Strong | Worth verifying | Weak
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
Duplicate rule: candidates with the same source-derived root cause are one (`bc-security-audit`'s consolidation). The same location with a different root cause or outcome is two candidates. Add every new unit to the ledger at merge.
|
|
51
|
+
|
|
52
|
+
## Verdict rule
|
|
53
|
+
|
|
54
|
+
Pass 2: each advisor attacks the candidates it did not propose. It confirms with its own strength, disputes with code evidence (`file:line` showing a control on the path, or the outcome not reachable), or gives no view.
|
|
55
|
+
|
|
56
|
+
Pass 2 only orders the verification queue; it rejects nothing. Order: candidates without an unanswered code-evidenced dispute first, by share of N rating them Strong, then share of N confirming at any strength, then trace completeness; then the candidates such a dispute would drop, in the same order. Why: `bc-security-audit` sends every candidate, a likely rejection included, to a fresh reviewer, and only that reviewer may reject.
|
|
57
|
+
|
|
58
|
+
## Verification
|
|
59
|
+
|
|
60
|
+
Run `bc-security-audit` step 3 on the queue in order: one `reviewer` per candidate in a fresh session, given only the candidate's Claim, Principal, Resource, Outcome, Trace, Units and the exact claimed input and result, plus source access, the verification contract and the selected companions' constraints. Never pass strength, agreement, refinements, disputes or advisor names. Why: those are the hunters' reasoning, which the parent withholds from the verifier.
|
|
61
|
+
|
|
62
|
+
Verify every candidate in the queue. The only cap is `--max-verify N`, never time or cost: with it, verify only the first N. Every candidate past the cap stays unresolved in the ledger and is listed unverified, and the report says the run is incomplete. State in the plan and report whether a cap was set.
|
|
63
|
+
|
|
64
|
+
Then write `findings.json` from the reviewers' records, update the ledger, and run `validate_audit.py` as `bc-security-audit` step 4 says, unchanged.
|
|
65
|
+
|
|
66
|
+
## Report and filing
|
|
67
|
+
|
|
68
|
+
Write `REPORT.md` as `bc-security-audit` step 4 says, in the run folder. Add per candidate: an agreement line (for example `2 of 3 Strong, 1 disputed`) beside its verdict, which never changes the verdict; any pass-2 dispute with each side's evidence; and its boundary. List unverified candidates with their queue place. Add the roster section `bc-council-chain` asks for, with each advisor's dealt boundaries.
|
|
69
|
+
|
|
70
|
+
Then ask which findings to file, with every `confirmed` finding pre-selected; `all` files the pre-selected ones, and nothing else is filed unless the owner picks it. With a project work pipeline (a "Where things go" table in `.bc-agent/AGENTS.md`, as `bc-setup-project` sets up), each filed finding becomes a numbered item in work-planned from the project's work-item template, with `Kind: security` and `Source: bc-council-audit-security`, naming the affected area and the fix, and pointing at `.security-audit/run-N/` (git-ignored) and the finding ID for details. Write no exploit steps, input or payload in the item. Why: the work item is committed, and the run folder is not. Place it in `work/order.md` where the project's work-item rules say, and run `.bc-agent/scripts/work_index.py --check` until it passes. Number items only from the main checkout. Without a work pipeline, do not invent one: list the owner's picks in the reply and say they are not filed.
|
|
71
|
+
|
|
72
|
+
When the audit ends, do `bc-council-chain`'s cleanup.
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: bc-council-chain
|
|
3
|
+
description: "Shared recipe loaded by bc-council-* chain skills (for example bc-council-improve-architecture) that run a parent skill through the advisor council: roster, one shared map, pass 1 independent candidates, citation-checked merge, pass 2 cross-examination, advisor fallbacks and sandbox-copy cleanup. Not run directly: a chain loads it and supplies the job-specific parts. Pi only: needs the pi-subagents `subagent` tool."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Council chain recipe
|
|
7
|
+
|
|
8
|
+
A `bc-council-<job>` skill runs a parent skill through the advisor council. This file holds the council steps every chain shares. Load `bc-council-mode` with it: that skill says how to brief, launch, relay to and resume advisors, and sets the pass and roster caps. Where this file and the chain are silent, `bc-council-mode` and the chain's parent skill decide.
|
|
9
|
+
|
|
10
|
+
If the `subagent` tool is missing, stop and tell the user to install `pi-subagents` and restart Pi. If `~/.config/agent-concepts/overlays/bc-council-chain.md` exists, read it: it names this machine's roster, map-scout model and which advisors are sandboxed. Without the overlay, use the roster and routing rules below.
|
|
11
|
+
|
|
12
|
+
## What a chain must define
|
|
13
|
+
|
|
14
|
+
A chain names each of these; this recipe leaves them open:
|
|
15
|
+
|
|
16
|
+
- **Parent skill** and the pre-reading the parent does before the map (the parent skill's first step).
|
|
17
|
+
- **Map contents:** what the scout records about the code, beyond `file:line` for every claim.
|
|
18
|
+
- **Brief extras:** paths and context every advisor receives besides the map, and recorded rejections not to re-propose.
|
|
19
|
+
- **Focuses or stances** dealt to advisors, if any.
|
|
20
|
+
- **Candidate format** advisors return in pass 1, with an `Evidence:` field of `file:line` citations.
|
|
21
|
+
- **Duplicate rule:** when two candidates are the same one.
|
|
22
|
+
- **Verdict or agreement rule** that ranks candidates after pass 2, with thresholds as shares of N.
|
|
23
|
+
- **Report and filing:** what the report adds per candidate, and how chosen items are filed (header lines, hand-offs).
|
|
24
|
+
|
|
25
|
+
## 1. Roster: whoever is on the council today
|
|
26
|
+
|
|
27
|
+
The council changes over time. Never hard-code advisor names in a chain. Run `subagent({ action: "list" })` and take every executable profile whose name starts with `council-`. If the overlay sets a roster, apply it to that list: a named list keeps only those advisors, an exclusion drops the ones it names. Use the result up to the four-advisor cap in `bc-council-mode`. With more than four, ask the user which four. With fewer than two, follow `bc-council-mode`'s fallback and say so in the report. To set up advisors, start from `bc-council-mode`'s example profiles and give each a different model.
|
|
28
|
+
|
|
29
|
+
Write every threshold as a share of the roster size N, never as a fixed count. Why: a rule written for three advisors silently breaks when a fourth joins.
|
|
30
|
+
|
|
31
|
+
Before launching an advisor that runs through an external agent harness, check that its permission mode asks before edits: the harness's native tools are outside the read-only profile.
|
|
32
|
+
|
|
33
|
+
If an advisor's sandbox cannot read the run directory (some external harnesses can read only the tree under their working folder), copy the map and brief to `.git/council-<run-dir name>/` inside that tree (git ignores it) and give that advisor those paths; step 6 deletes the copy. Why: in the first live run such an advisor was refused twice and needed three launches, about 30 minutes.
|
|
34
|
+
|
|
35
|
+
## 2. One shared map
|
|
36
|
+
|
|
37
|
+
Do the chain's pre-reading yourself. Then launch one `scout` to map the code into a file in the run directory, recording what the chain's map contents name. Every claim needs a `file:line`.
|
|
38
|
+
|
|
39
|
+
Run every map scout (one, or several splitting a large codebase) on a strong model with high reasoning effort: the overlay's model if it names one, otherwise the strongest model you can run, rather than the scout role's default route. Why: every advisor judges from this map, so its depth sets the ceiling for the whole review. If that model is unavailable, use the next best, and say so in chat and in the report's roster section.
|
|
40
|
+
|
|
41
|
+
Advisors receive the map plus read access to the tree. They judge the map; they verify against the code only what they cite. Why: when each advisor scans on its own, disagreements come from what each happened to read rather than from judgment.
|
|
42
|
+
|
|
43
|
+
## 3. Pass 1: independent candidates
|
|
44
|
+
|
|
45
|
+
Give every advisor the same brief: the map path, the chain's brief extras, its focus or stance if the chain deals them, and the chain's candidate format. Advisors do not see each other's output in this pass.
|
|
46
|
+
|
|
47
|
+
## 4. Merge
|
|
48
|
+
|
|
49
|
+
First check every `file:line` in the advisors' candidates: the file exists and has that line. Mark a claim whose citation does not resolve as unverified and do not count it as evidence; if it was the candidate's only evidence, ask that advisor for the right citation in pass 2. Why: in the first live run an advisor cited a test file that does not exist, and nothing caught it.
|
|
50
|
+
|
|
51
|
+
Deduplicate by the chain's duplicate rule. When two candidates target the same thing but differ in what they claim or recommend, keep both: that is a disagreement, not a duplicate. Build a matrix: one row per candidate, one column per advisor, holding that advisor's strength or "not proposed".
|
|
52
|
+
|
|
53
|
+
## 5. Pass 2: cross-examination
|
|
54
|
+
|
|
55
|
+
Resume each advisor with the candidates it did not propose (curated per `bc-council-mode`, at most five relayed claims per advisor). For each, it must answer one of:
|
|
56
|
+
|
|
57
|
+
- **Confirm** with a strength of its own, and a refinement wherever it has one: a corrected premise, a narrower or safer direction, or a sharper reproduction, each with `file:line` evidence.
|
|
58
|
+
- **Dispute** with code evidence (`file:line`) showing the problem is absent or the direction is wrong.
|
|
59
|
+
- **No view**, with a one-line reason.
|
|
60
|
+
|
|
61
|
+
Ask for refinements in the relay, not only a verdict. Carry each refinement onto its candidate under the advisor's name ("<advisor>'s refinement: …"). Why: in the first two live reviews the most useful pass-2 work was one advisor correcting and narrowing the others' candidates; it did so unprompted, and an advisor that answers only "Confirm Strong" would lose it.
|
|
62
|
+
|
|
63
|
+
Run a third pass only when a dispute affects the ranking and advisor evidence could settle it.
|
|
64
|
+
|
|
65
|
+
Then rank by the chain's verdict rule. Never force agreement. An open dispute the code cannot settle becomes an owner decision, with each side's best evidence. Why: required consensus pushes advisors toward the safest candidate and loses the unusual finds that justify a council.
|
|
66
|
+
|
|
67
|
+
## 6. Report and cleanup
|
|
68
|
+
|
|
69
|
+
Produce the chain's report, showing each candidate's refinements under the advisor's name, with a short roster section: advisors, passes run, fallbacks. Then follow the chain's filing steps.
|
|
70
|
+
|
|
71
|
+
When the run ends, delete any `.git/council-<run-dir name>/` copy made for a sandboxed advisor (`rm -r .git/council-<run-dir name>/`).
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: bc-council-challenge-plan
|
|
3
|
+
description: "Challenge a plan or PRD through the advisor council before it is sliced: one scout maps the code the plan touches, every council advisor attacks a dealt part of the plan for wrong premises, missing cases, cheaper paths and risky order, they attack each other's objections, the owner is grilled only on the surviving ones, the answers are written into the plan, then bc-plan-to-pipeline slices it as a settled source. Use when the user says bc-council-challenge-plan or asks the council to challenge a plan. Pi only: runs on bc-council-mode, which needs the pi-subagents `subagent` tool."
|
|
4
|
+
disable-model-invocation: true
|
|
5
|
+
argument-hint: "<plan or PRD path>"
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# Council plan challenge
|
|
9
|
+
|
|
10
|
+
This skill joins four skills and copies none. Load all four before starting:
|
|
11
|
+
|
|
12
|
+
- `bc-council-chain`: the council steps every chain shares (roster, shared map, pass 1, merge, pass 2, fallbacks, cleanup) and the parts a chain must define.
|
|
13
|
+
- `bc-council-mode`: how to brief, launch, relay to and resume advisors, and the pass cap.
|
|
14
|
+
- `bc-grilling`: how to ask the owner one question at a time, recommended answer first.
|
|
15
|
+
- `bc-plan-to-pipeline`: the hand-off at the end, in its settled-source mode.
|
|
16
|
+
|
|
17
|
+
The parent is the plan itself: its path is the argument. Run the `bc-council-chain` steps in order, then the grill, the plan edits, the report and the hand-off below, without stopping between them; the owner is asked only the questions those skills and this file require (the roster question, the surviving objections). Why: a challenge that stops after a pass has changed nothing the owner can use. This file defines only the parts that recipe leaves to the chain. Where this file is silent, those skills decide.
|
|
18
|
+
|
|
19
|
+
The council never rewrites the plan. Only the owner's answers go into it. Why: the plan is the owner's decision record; an objection is a question to the owner, not an edit.
|
|
20
|
+
|
|
21
|
+
## Pre-reading and map
|
|
22
|
+
|
|
23
|
+
Pre-reading: read the plan whole, and number its sections or steps (the parts dealt below). Read the README of every area it names.
|
|
24
|
+
|
|
25
|
+
Map: the plan's code context. The scout maps the code the plan names or would touch, each claim with `file:line`: every file, function, type or behaviour the plan names, and what the code actually does there; callers and dependents of what the plan changes; existing helpers or modules that already do part of what the plan builds; tests covering those areas; and, per plan part, the plan lines that claim something about the code, each marked as matching the code, contradicting it, or unverifiable.
|
|
26
|
+
|
|
27
|
+
Brief extras: the plan path, the numbered part list, the objection kinds below, and that advisors stay read-only and propose no edits to the plan or the code.
|
|
28
|
+
|
|
29
|
+
## Focuses
|
|
30
|
+
|
|
31
|
+
Deal the plan's parts round-robin, one advisor after another, until every part is dealt (an advisor may get several parts; with more advisors than parts, dealing wraps). State each advisor's parts in chat and in the report's roster section.
|
|
32
|
+
|
|
33
|
+
Each advisor attacks its parts for every objection kind, and may still raise objections anywhere else in the plan. Why: the plan's sections are what the owner chose to split on, and every part then gets a dedicated reader.
|
|
34
|
+
|
|
35
|
+
Objection kinds:
|
|
36
|
+
|
|
37
|
+
- **Wrong premise:** the plan states something about the code or the world that is false.
|
|
38
|
+
- **Missing case:** an input, state, caller or failure the plan does not handle.
|
|
39
|
+
- **Cheaper path:** a smaller way to the same outcome, often something the code already has.
|
|
40
|
+
- **Risky order:** a step that breaks something if done before another.
|
|
41
|
+
|
|
42
|
+
## Objection format
|
|
43
|
+
|
|
44
|
+
Each advisor returns at most 8 objections (the owner can raise this per run):
|
|
45
|
+
|
|
46
|
+
```
|
|
47
|
+
### <id> <one-line title>
|
|
48
|
+
Kind: wrong premise | missing case | cheaper path | risky order
|
|
49
|
+
Plan line: "<the plan line it attacks, quoted>" (<plan path>:<line>)
|
|
50
|
+
Evidence: <file:line citations, required wherever the plan claims something about the code>
|
|
51
|
+
Objection: <what is wrong, and what happens if the plan goes ahead as written>
|
|
52
|
+
Proposed question: <the question the owner must answer, with a recommended answer>
|
|
53
|
+
Part: <the dealt part it falls under>
|
|
54
|
+
Strength: Strong | Worth asking | Weak
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
Duplicate rule: objections quoting the same plan line and making the same claim are one. Same line with a different claim is two objections.
|
|
58
|
+
|
|
59
|
+
## Verdict rule
|
|
60
|
+
|
|
61
|
+
Pass 2: each advisor attacks the objections it did not raise. It confirms with its own strength and any refinement, disputes with evidence (`file:line`, or a plan line that already answers the objection), or gives no view.
|
|
62
|
+
|
|
63
|
+
- **Dropped:** a dispute with evidence that nobody answers with evidence. List it in the report with the dispute.
|
|
64
|
+
- **Surviving:** everything else, ordered by share of N confirming it as Strong, then share of N confirming at any strength. An open dispute does not drop an objection; it goes to the owner with each side's evidence.
|
|
65
|
+
|
|
66
|
+
## Grill and plan edits
|
|
67
|
+
|
|
68
|
+
Grill the owner on the surviving objections only, one at a time, in verdict order, following `bc-grilling`: state the objection, the quoted plan line, its evidence and agreement line, and the recommended answer. The owner may answer, accept the recommendation, or reject the objection.
|
|
69
|
+
|
|
70
|
+
After each answer, write it into the plan at the line it concerns, as the owner's decision with its why. A rejected objection changes nothing in the plan. Edit only what the answer settles.
|
|
71
|
+
|
|
72
|
+
## Report
|
|
73
|
+
|
|
74
|
+
Write the report to the run directory: per objection, its kind, quoted plan line, agreement line (for example `2 of 3 Strong, 1 disputed`), refinements under the advisor's name, any dispute with each side's evidence, and the owner's answer (or "rejected"). List dropped objections with their dispute. Add the roster section `bc-council-chain` asks for, with each advisor's dealt parts.
|
|
75
|
+
|
|
76
|
+
## Hand-off
|
|
77
|
+
|
|
78
|
+
Run `bc-council-chain`'s cleanup. Then run `/bc-plan-to-pipeline` on the edited plan in its settled-source mode. Pass it the owner's answers from the grill as settled, so it asks only the questions the plan still leaves open and none the owner has already answered. Why: the owner should never be asked the same question twice.
|