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,89 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: bc-plan-to-pipeline
|
|
3
|
+
description: One-command interactive planning pipeline — grill the idea (or only the questions a settled design leaves open), capture the domain model, draft a PRD, and slice it into the project's work pipeline as a work item, into ready-for-agent GitHub issues, or both. Run to go from an idea or an approved design to agent-ready work without remembering the sequence. Model-invocable when the user asks to route work into the bc planning loop; the grill remains the interactive human gate either way.
|
|
4
|
+
argument-hint: "What are we planning?"
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Plan to Pipeline
|
|
8
|
+
|
|
9
|
+
Take an idea all the way to agent-ready work **in one pass**, so you never have to remember the order of the planning skills. This is the interactive planning front of the loop. Work lands in the project's work pipeline (a work item), in an issue tracker, or both; the autonomous executor `/bc-pipeline-to-done` builds tracker issues labelled `ready-for-agent` and work items marked `Ready for agent: yes`.
|
|
10
|
+
|
|
11
|
+
## Choose the mode first
|
|
12
|
+
|
|
13
|
+
Decide both modes before step 1 and state them in one line (for example "Mode: work item only, from a settled source"), then go straight on to step 1 in the same reply: the mode line is a report, not a stopping point.
|
|
14
|
+
|
|
15
|
+
- **Tracker or no tracker.** Use the tracker when the project already plans in it (it has `ready-for-agent` issues, or its work items carry `Issue:` lines) or the user plainly asks for issues. A GitHub remote alone is not enough: many projects keep their plans only in work items, and issues created there are a second copy nobody drains. A conditional request ("file issues too if that's how it works", "if the project uses them") is not a plain ask: it defers to the project's practice, so check that practice. The mode line names the evidence for the tracker choice (for example "no tracker: no `Issue:` lines or `ready-for-agent` issues"). **No tracker** otherwise, or when the user asks for work items only: skip every issue step (the parent issue, slice issues, `ready-for-agent` labels, `Issue:` lines, `#NN` references and `pending #NN` tags) and file the plan as a work item only (see [Where project files go](#where-project-files-go)). Without a tracker and without a "Where things go" table, use the fallback change folder and its `tasks.md` as the slice list.
|
|
16
|
+
- **Raw idea or settled source.** A **settled source** is a design the owner already settled: an architecture review whose candidates the owner picked, an approved spec, a finished grilling, or an **existing work item** in work-planned (with any settled answers its producer passes along). Do not re-run the full grill on it. In step 1 ask only the questions the source leaves open, in one batch, then continue; with none open, ask nothing. A source that names its test (a bug item's failing reproduction, a review's chosen seam) settles the test seam: write it into the requirements and skip `bc-prd-drafting`'s seam check. A **raw idea** gets the full grill.
|
|
17
|
+
- **Existing work item.** Plan it in place: fill its requirements and `## Steps` in its own file (a large item's `plan.md` and `requirements.md`, turning the file into a folder only when it needs more than one slice), and keep its number, name, `Source:` and `Kind:` lines. Never create a second item for it. Why: other items, `work/order.md` and the owner's dashboard already name it.
|
|
18
|
+
- **No one to answer.** The owner is absent when they said they are away or not answering, or the run is a drain; an absent owner who adds an instruction ("just pick X") is still absent. Then, when step 1 leaves a question open, do not guess, do not ask in chat and do not wait: in the same reply, file the questions where the owner sees questions (check the project's or machine's instructions). If no place is named or the named place cannot be used, park the existing item: write `Waiting on owner: <question>` in its header (in `plan.md` for a folder item), replacing any `Ready for agent:` line, and name the item in the run report. If there is no item yet, record the questions in the run report instead. Leave the item in work-planned without a `Planned:` line, and continue with the run's next item. Filing the question does not end the run; the run ends only when every item it was asked to carry is started or has a filed question. Why: a guessed answer becomes a decision nobody made, and a run that waits on an absent owner stalls every item behind it.
|
|
19
|
+
|
|
20
|
+
Slicing (step 6) never stops for approval, in any mode.
|
|
21
|
+
|
|
22
|
+
This orchestrator composes **model-invoked disciplines only** (`bc-grilling`, `bc-domain-modeling`, `naming-things`, `bc-prd-drafting`, `bc-plan-slicing`) — never another user-invoked orchestrator. It owns the publication steps itself. User-invoked exploration tools (`bc-prototype`, `bc-improve-codebase-architecture`, `bc-triage`) can feed this command, but this command does not invoke them as nested orchestrators. A skill that files planned items (`bc-improve-codebase-architecture`, `bc-find-bugs`) runs this command on them after its own filing has finished: a handoff in sequence, not a nested call, so each run keeps its own gates.
|
|
23
|
+
|
|
24
|
+
## Where project files go
|
|
25
|
+
|
|
26
|
+
This skill names project files by role: the **glossary**, the **decisions** folder, the **work-planned** folder, the **ideas** file, the **research** folder and **requirements** (the product-level spec). Resolve each role in the "Where things go" table in the project's `.bc-agent/AGENTS.md`, and follow the work-item rules in the same file (naming, numbering, template). Why: each project has one table, so a project that keeps something elsewhere changes one place and every skill follows.
|
|
27
|
+
|
|
28
|
+
When the project has no such table, use the paths this skill used before:
|
|
29
|
+
|
|
30
|
+
- If `.bc-agent/conventions/planning-workflow.md` exists, it is the project's mapping (an older `.bc-agent/` vault): glossary in the Glossary section of `.bc-agent/project/overview.md`, ADRs in `.bc-agent/decisions/`, plans and PRDs in `.bc-agent/project/`. Follow it.
|
|
31
|
+
- Otherwise: glossary `glossary.md`, ADRs `docs/adr/`, the change folder `docs/changes/<change-slug>/` with `prd.md` and `tasks.md`, and living specs `docs/specs/<area>.md`.
|
|
32
|
+
|
|
33
|
+
**The plan is a work item** when the table exists. The fallback change folder is used only without a table; creating `docs/changes/`, `docs/specs/` or `docs/adr/` in a project with a table would scatter the plan outside the folders that show its status.
|
|
34
|
+
|
|
35
|
+
Write a `Source: <name>` line under the item's header lines, naming what produced the plan: the upstream skill (for example `bc-improve-codebase-architecture`) for a settled source, or `bc-plan-to-pipeline` for a raw idea. In a large plan it goes in `plan.md`. Next to it, write a `Kind:` line (security, bug, build, architecture, performance, tests, feature, docs, ...) when one fits; keep an upstream item's `Kind:` line. When the item will need an owner decision or action before or during its build (a choice only the owner can make, an approval, an account or store action, a hands-on check), write `Needs owner: <what the owner must decide or do, and when>`; remove it once that is settled, recording the decision as usual. Why: the owner's dashboard shows it, so the owner can plan time away. When the build changes what users see or operate (screens, controls, labels, keys, layout, styling), write `Changes UI: <what the user will see change>`, and keep it current when the plan changes; leave it off otherwise. Why: the dashboard shows it, so the owner can plan when to review UI work. When step 7 has written the item's `## Steps`, add `Planned: bc-plan-to-pipeline <YYYY-MM-DD>` below `Source:`; `Source:` keeps naming the producer. Why: the project's pickup rule plans any item without this line before it starts, and `work_index.py --check` warns about it. Place a new item in `work/order.md` where `python3 .bc-agent/scripts/work_index.py --check` says (a top kind goes near the top).
|
|
36
|
+
|
|
37
|
+
Call the feature's requirements document by the project's term: the requirements role in the table (a work item's `requirements.md` or `## Requirements` section), not "PRD", when the project names it differently. This skill says "PRD" only for brevity.
|
|
38
|
+
|
|
39
|
+
- **Small plan** (exactly one slice, with or without a tracker): one file `NNN-slug.md` in work-planned, from `.bc-agent/templates/work-item.md`. Put the feature's requirements in a `## Requirements` section above `## Steps`.
|
|
40
|
+
- **Large plan** (more than one slice, with or without a tracker): a folder `NNN-slug/` in work-planned holding two files, plus any evidence worth keeping:
|
|
41
|
+
- `plan.md` — the work-item template; its `Issue:` line holds the parent issue (none without a tracker), and its `## Steps` list the slices in dependency order, one checkbox each with title, issue `#NN` (with a tracker), blocked-by and user stories covered;
|
|
42
|
+
- `requirements.md` — the PRD.
|
|
43
|
+
Why two files: the steps already are the slice map, so a separate slices file would be a second copy that drifts.
|
|
44
|
+
|
|
45
|
+
Number items only from the main checkout: the next number is the highest across all stage folders plus one. In a git worktree, stop after step 2, add one line for the plan to the ideas file, and resume from step 3 in the main checkout; tell the user so. Why: two worktrees cannot see each other's numbers and would pick the same one. Never write a `Status:` line; the item stays in work-planned, and the agent that starts the work moves it.
|
|
46
|
+
|
|
47
|
+
In a hybrid project the glossary is shared with `bc-teach`: follow the shared-glossary rule in `bc-domain-modeling` (ask before removing or redefining a term you did not add this session).
|
|
48
|
+
|
|
49
|
+
## Pipeline
|
|
50
|
+
|
|
51
|
+
1. **Grill.** From a settled source, read it, answer what the source and the code already settle, and ask the owner only the questions left open, in one batch; skip to step 2 when none remain. From a raw idea, run `/bc-grilling`: interview one question at a time, recommended-answer-first, down every branch of the decision tree. Answer from the codebase anything you can answer yourself rather than asking. If the grill exposes a question that cannot be resolved by conversation or code reading (state model feel, UI direction, architectural runway), pause and recommend the matching pre-planning tool: `/bc-prototype` for throwaway evidence, `/bc-improve-codebase-architecture` for deep-module runway, or `/bc-triage` if the input is an existing issue backlog item that needs a drain-ready Agent Brief.
|
|
52
|
+
- **Dependencies.** Check whether the work will need a library, tool or package the project does not already declare, including test-only ones a discipline calls for (for example a property-testing library for `bc-tdd`'s property tests). For each, ask the owner once, in the same batch as any other open question: “This needs `<name>` (<why>). May the builder add it, or should it manage without it (<the alternative>)?” Record the answer in the item's requirements as a line the builder can follow, marked as the owner's answer with its date, such as `Dependencies: may add hypothesis (test only) (owner's answer, 2026-11-27)` or `Dependencies: none new; use example-based tests instead of property tests (owner's answer, 2026-11-27)`. Mark a line this way only when the owner gave that answer; never for your own guess. With nothing new needed, write `Dependencies: none new`, unmarked. Why the mark: `bc-tdd` lets a builder skip a required test level or the property library only on the owner's words, and an unmarked line looks like a planner's instruction, so in a test run every builder blocked on a line the owner had answered. The question counts as open for the absent-owner rule above. Why: the builder adds only the dependencies the item names and otherwise stops the unit to ask, so an unasked question here costs a stalled build later; in a stranger's test run a builder added Hypothesis unasked.
|
|
53
|
+
|
|
54
|
+
2. **Capture inline — don't batch.** As terms and decisions crystallize *during* the grill, run `/bc-domain-modeling`: canonical names → the glossary (a pure glossary, no implementation detail); a decision that is costly to reverse AND would surprise a future reader AND reflects a real trade-off → a record in the decisions folder. Capture the moment it crystallizes, not at the end.
|
|
55
|
+
- **Guard:** if the current directory isn't a project where a glossary and decision records belong (empty/scratch dir, unrelated files), confirm with the user before creating docs, or grill without persisting.
|
|
56
|
+
Apply `naming-things` when choosing domain or public code names during the grill.
|
|
57
|
+
|
|
58
|
+
3. **Open the plan's home and draft the PRD.** With a table, create the work item, or use the existing one you were given (see [Where project files go](#where-project-files-go)); without one, create the change folder `docs/changes/<change-slug>/` (dash-case, named for the feature). Either is the single physical home for this change's planning artifacts; without it they scatter across tracker bodies, comments, and temp files. Run `/bc-prd-drafting`: synthesize from the grill + codebase (no re-interview), sketch and confirm the test seams, and write the PRD to the standard template as the item's requirements (`## Requirements` in a small item, `requirements.md` in a large one) or as `docs/changes/<change-slug>/prd.md`. If pre-planning evidence exists that's worth keeping (a `/bc-prototype` verdict, an architecture-review excerpt), file it in the large item's folder or the change folder, or as a dated folder in the research role for a small item — these otherwise die as temp files. (Step 2's guard applies here as well: confirm before creating docs in a directory that isn't a real project.)
|
|
59
|
+
|
|
60
|
+
4. **Publish the PRD parent issue (tracker mode only; skip without a tracker).** The parent is a planning/coordination artifact, not a drainable implementation task, so do **not** label it `ready-for-agent`. Its body is a coordination pointer, not a second copy of the PRD (a duplicated PRD drifts from the canonical one): the problem/solution summary plus `Planning artifacts: <path of the work item or change folder>`.
|
|
61
|
+
```
|
|
62
|
+
gh issue create --title "PRD: <feature name>" --body-file <summary-with-pointer>
|
|
63
|
+
```
|
|
64
|
+
Keep the returned issue number as the parent and record it on the work item's `Issue:` line (in `plan.md` for a large item). Only implementation slices get the `ready-for-agent` label. A small item with a single slice skips the parent: its one slice issue goes on the `Issue:` line in step 7.
|
|
65
|
+
|
|
66
|
+
5. **Fold requirements into the living specs.** With a table, do this only when the project has a product-level spec (the requirements role's file exists, or the user confirms the project needs one); merge into the requirements role's file; otherwise skip this step, because the feature's requirements already live in its work item. Without a table, update `docs/specs/<area>.md` (create the file/dir if missing; dash-case area names, one file per capability). This is the durable, normative record of *what the system is required to do* — PRDs and issues go stale by design once their work drains, so the specs are what future grills and agents read instead of re-deriving requirements from code. Merge the PRD's resolved requirements into the relevant spec file(s):
|
|
67
|
+
- Write requirements as current truth ("The system SHALL …") with their key scenarios; rewrite superseded requirements rather than appending contradictions.
|
|
68
|
+
- Tag each new or changed requirement `(pending #<parent>)` (the single slice's issue for a small item; `(pending <work-item path>)` without a tracker) so unimplemented spec text is detectable; whoever touches the spec after the queue drains drops the tag.
|
|
69
|
+
- Stay at requirements level: design rationale belongs in decision records, implementation approach in the PRD, vocabulary in the glossary.
|
|
70
|
+
- **Guard:** same as step 2 — if this isn't a project where such docs belong, confirm before creating them.
|
|
71
|
+
|
|
72
|
+
6. **Slice.** Run `/bc-plan-slicing`: break the PRD into vertical tracer-bullet slices (prefactor first), check granularity and dependencies yourself, and continue to step 7 without waiting for approval. Show the final slices in your reply as a report, not a question. Only when the user asked in this request to review the slices first, present them as a draft and wait.
|
|
73
|
+
|
|
74
|
+
7. **Publish the slices.** Without a tracker, publish nothing: write the final breakdown into the item's `## Steps` (a large item's `plan.md`), each unchecked step with slice title, blocked-by references (by step title), user stories covered, its done-criteria (`Done when ...`) and what is out of scope (`Out of scope: ...`), or into `tasks.md` in the fallback change folder; then go to step 8. The step is the work item's Agent Brief: `/bc-pipeline-to-done` builds it without the planning conversation. When every step meets that bar, write `Ready for agent: yes` in the item's header lines, below `Planned:`; otherwise omit the line and say in the report which steps lack done-criteria or out of scope. Never write it next to a `Waiting on owner:` line. Why: the ready line is the owner's consent to unattended building, and a step without its limits gets built past them. With a tracker: in dependency order (blockers first) so real `#NN` fill each "Blocked by", each with `--label ready-for-agent` and `## Parent #<parent>`. These are the only newly-created issues that enter the drain queue. Each slice body must include an `## Agent Brief`-equivalent contract (desired behavior, key interfaces/domain concepts, acceptance criteria, out-of-scope, blockers) so `/bc-pipeline-to-done` can run AFK without prior conversation:
|
|
75
|
+
```
|
|
76
|
+
gh issue create --title "<slice title>" --label ready-for-agent --body-file <path>
|
|
77
|
+
```
|
|
78
|
+
Then record the real numbers. With a table: write the final breakdown into the item's `## Steps` (a large item's `plan.md`), each unchecked step with slice title, its issue `#NN`, blocked-by references and user stories covered; a small item's single slice goes on its `Issue:` line. The folder the item sits in and its checked steps are its status, so add no status text. Without a table: write `docs/changes/<change-slug>/tasks.md` with the same entries. It's the map of the change, written once the real numbers exist — **not** a status board: completion state lives only in the tracker (duplicated state drifts; whoever wants status runs `gh issue list`).
|
|
79
|
+
|
|
80
|
+
8. **Close out.** Restate the resolved scope; point at the work item or change folder, the glossary, decision records and spec files written, and, with a tracker, the parent issue and the slice issue numbers. Then recommend the handoff: with a tracker, **"Run `/bc-pipeline-to-done` to execute this queue autonomously."**; without one, name the work item as the next work to start, and when it carries `Ready for agent: yes`, say that `/bc-pipeline-to-done` can build it unattended.
|
|
81
|
+
|
|
82
|
+
## Guard rails
|
|
83
|
+
- This is **planning, not building** — do not write implementation code here. Code is the executor's job, one slice at a time.
|
|
84
|
+
- The grill (step 1, or the open-questions batch from a settled source) is the human checkpoint; slicing does not wait for approval. Everything after the grill runs without the user, and the drain runs AFK, so resolve open branches now — a vague issue becomes a parked issue at execution time.
|
|
85
|
+
- If the source is an existing GitHub issue, run `/bc-triage` first when it lacks an Agent Brief, has conflicting labels, or may be already implemented / out of scope.
|
|
86
|
+
- If planning depends on uncertain state logic, UI direction, or architecture shape, use `/bc-prototype` or `/bc-improve-codebase-architecture` before final PRD/slice publication; capture the verdict in the PRD rather than sending throwaway work to the drain.
|
|
87
|
+
- Keep research/evidence distinct from actual PRDs: exploratory notes and reports can feed the PRD (and may be filed in the change folder as evidence), but only the work item's requirements (or `docs/changes/<change-slug>/prd.md` without a table) are the PRD artifact — the parent issue just points at it.
|
|
88
|
+
|
|
89
|
+
For glossary discovery in legacy projects, follow `bc-domain-modeling`’s legacy glossary rule.
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: bc-prd-drafting
|
|
3
|
+
description: Draft a PRD from the current conversation and codebase — synthesize (don't interview), sketch the test seams, and write it to the standard template. Use when turning an already-resolved plan into a structured PRD document.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Drafting a PRD
|
|
7
|
+
|
|
8
|
+
Produce a PRD from what's already been discussed plus the codebase. This is the reusable **writing discipline** — it does NOT publish anywhere. The caller decides where the PRD lands: `/bc-to-spec` publishes it as a GitHub issue; `/bc-plan-to-pipeline` carries it straight into slicing; a human might paste it into a wiki.
|
|
9
|
+
|
|
10
|
+
**Do NOT interview the user** — synthesize what you already know. (If the scope is still vague, resolve it with `/bc-grilling` + `/bc-domain-modeling` first, not by interviewing here.)
|
|
11
|
+
|
|
12
|
+
## Process
|
|
13
|
+
|
|
14
|
+
1. **Explore the repo** to understand current state (if you haven't already). Use the project's `glossary.md` glossary vocabulary throughout the PRD, and respect any ADRs in the area you're touching.
|
|
15
|
+
|
|
16
|
+
2. **Sketch the seams** at which you'll test the feature. Prefer existing seams to new ones; use the highest seam possible; the fewer seams the better — the ideal is one. If new seams are needed, propose them at the highest point you can. Check with the user that these seams match their expectations before writing the PRD. (Run `/bc-codebase-design` if you need the deep-module / seam vocabulary.)
|
|
17
|
+
|
|
18
|
+
3. **Write the PRD** using the template below. Return it to the caller — do not publish it yourself.
|
|
19
|
+
|
|
20
|
+
<prd-template>
|
|
21
|
+
## Problem Statement
|
|
22
|
+
The problem the user faces, from the user's perspective.
|
|
23
|
+
|
|
24
|
+
## Solution
|
|
25
|
+
The solution, from the user's perspective.
|
|
26
|
+
|
|
27
|
+
## User Stories
|
|
28
|
+
A LONG, numbered list. Each: `As an <actor>, I want <feature>, so that <benefit>`. Be extensive — cover all aspects of the feature.
|
|
29
|
+
|
|
30
|
+
## Implementation Decisions
|
|
31
|
+
Modules built/modified and their interfaces; technical clarifications; architectural decisions; schema changes; API contracts; specific interactions. Do NOT include specific file paths or code snippets (they go stale fast). Exception: a prototype-derived snippet that encodes a decision more precisely than prose can (state machine, reducer, schema, type shape) — inline just the decision-rich part and note it came from a prototype.
|
|
32
|
+
|
|
33
|
+
## Testing Decisions
|
|
34
|
+
What makes a good test (test external behavior, not implementation detail); which modules will be tested; prior art for the tests in the codebase.
|
|
35
|
+
|
|
36
|
+
## Out of Scope
|
|
37
|
+
What's explicitly out of scope for this PRD.
|
|
38
|
+
|
|
39
|
+
## Further Notes
|
|
40
|
+
Anything else worth recording.
|
|
41
|
+
</prd-template>
|
|
42
|
+
|
|
43
|
+
For glossary discovery in legacy projects, follow `bc-domain-modeling`’s legacy glossary rule.
|
|
@@ -0,0 +1,278 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: bc-prompting-agents
|
|
3
|
+
description: Use when writing or revising instructions for a coding agent — concept bodies, AGENTS.md files, system prompts, or per-agent configs. A library of proven instruction blocks to adapt, not invent.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Prompting Agents
|
|
7
|
+
|
|
8
|
+
Reusable instruction blocks and principles distilled from OpenAI's GPT-5.2 and Codex prompting guides, Anthropic's prompting/context-engineering guidance, and Google's prompt-engineering whitepaper (see CONCEPT.md for provenance), rewritten agent-agnostically. When authoring or tuning instructions for any agent, adapt the relevant block rather than writing one from scratch — these phrasings have been optimized against production evals. Tag origin when copying verbatim so future updates can be traced.
|
|
9
|
+
|
|
10
|
+
## First: choose the altitude
|
|
11
|
+
|
|
12
|
+
Before reaching for any block below, decide how much constraint the task actually warrants. Anthropic's context-engineering guidance calls this the **right altitude**: the Goldilocks zone between brittle, hardcoded if-else process steps (fragile, high-maintenance, and insulting to a capable model) and vague high-level guidance that falsely assumes shared context. Instructions should be specific enough to transmit hard-won lessons, flexible enough that the agent applies its own reasoning.
|
|
13
|
+
|
|
14
|
+
Three principles that govern everything else in this library:
|
|
15
|
+
|
|
16
|
+
- **Explain the why.** State the motivation behind an instruction, not just the instruction — "Claude is smart enough to generalize from the explanation," and a rule whose reason is visible can be correctly applied to situations its author never imagined. A bare imperative can only be obeyed or violated. (Anthropic prompting best practices.)
|
|
17
|
+
- **Prefer general instructions over prescriptive steps.** "Think thoroughly" often beats a hand-written step-by-step plan; a strong model's reasoning frequently exceeds what its author would prescribe. Save prescriptive blocks for places where errors are costly or the failure mode is in-the-moment rationalization. (Anthropic prompting best practices.)
|
|
18
|
+
- **Context economy.** Aim for the smallest set of high-signal tokens that produces the outcome — context rot is real: recall degrades as context grows. Progressive disclosure (lean entry file, details loaded just-in-time) is this principle applied to skill structure. (Anthropic context engineering.)
|
|
19
|
+
|
|
20
|
+
The constraining blocks below (scope discipline, gates-style rules) are tools for *specific failure modes*, not a default posture. Reach for them when the cost of an error is high or when an agent under pressure predictably rationalizes — and even then, attach the why.
|
|
21
|
+
|
|
22
|
+
## Skill composition and invocation boundaries
|
|
23
|
+
|
|
24
|
+
When designing a skill suite rather than a single prompt, keep workflows small and composable instead of one process owning everything:
|
|
25
|
+
|
|
26
|
+
```
|
|
27
|
+
- Separate user-invoked orchestrators from model-invoked disciplines. User-invoked skills
|
|
28
|
+
can coordinate a session; model-invoked skills hold reusable behavior the agent should
|
|
29
|
+
reach for automatically when the task fits.
|
|
30
|
+
- A user-invoked skill may invoke model-invoked skills, but should not invoke another
|
|
31
|
+
user-invoked orchestrator; nested orchestration blurs control and makes failures harder
|
|
32
|
+
to debug.
|
|
33
|
+
- Encode shared project vocabulary and hard-to-explain decisions in durable docs close to
|
|
34
|
+
the work. A shared language reduces verbosity, improves names, and helps agents navigate
|
|
35
|
+
the codebase.
|
|
36
|
+
- Prefer small feedback-loop skills (TDD, diagnosis, domain modeling, design review) over
|
|
37
|
+
monolithic process frameworks. The user keeps control while the agent gains discipline.
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
### Loading is not authorization
|
|
41
|
+
|
|
42
|
+
Adapt this mode gate when a broad auto-trigger description can load a costly workflow:
|
|
43
|
+
|
|
44
|
+
```
|
|
45
|
+
Loading this skill defaults to guidance, not authorization for its heavy or irreversible
|
|
46
|
+
workflow. Run that workflow (fan-out, file creation, external actions) only on an explicit
|
|
47
|
+
request for it. If the request is ambiguous, ask one focused question before starting.
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
Why: broad descriptions auto-trigger on ordinary questions; loading must not silently authorize costly workflows. From Cloudflare’s security-audit-skill; see the `bc-security-audit` skill, section Choose the mode before acting, for the in-workspace example. An explicit workflow request does not bypass its action-specific safety controls.
|
|
51
|
+
|
|
52
|
+
## Standing instruction files (always-loaded context)
|
|
53
|
+
|
|
54
|
+
For the file an agent reads every session — AGENTS.md, CLAUDE.md, a system prompt. These fail by growing: every line is always loaded, and a bloated file causes the agent to ignore the rules that matter because they're lost in noise. (Claude Code best practices.)
|
|
55
|
+
|
|
56
|
+
```
|
|
57
|
+
- Pruning test, per line: "Would removing this cause the agent to make mistakes?"
|
|
58
|
+
If not, cut it.
|
|
59
|
+
- Include: commands the agent can't guess, style rules that differ from defaults,
|
|
60
|
+
testing instructions, repo etiquette (branching, PR conventions), project-specific
|
|
61
|
+
architectural decisions, environment quirks, non-obvious gotchas.
|
|
62
|
+
- Exclude: anything derivable by reading the code, standard language conventions,
|
|
63
|
+
API documentation (link instead), frequently-changing facts, tutorials,
|
|
64
|
+
file-by-file codebase descriptions, self-evident advice ("write clean code").
|
|
65
|
+
- Broadly-applicable content only; occasionally-relevant knowledge goes in
|
|
66
|
+
on-demand skills, not the always-loaded file.
|
|
67
|
+
- Diagnostics: a rule that keeps being violated despite being in the file means the
|
|
68
|
+
file is too long (prune, don't add emphasis); questions the agent asks that the
|
|
69
|
+
file already answers mean the phrasing is ambiguous.
|
|
70
|
+
- Treat the file like code: review it when behavior goes wrong, prune regularly,
|
|
71
|
+
and test edits by observing whether behavior actually shifts.
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
## Untrusted input and privileged actions
|
|
75
|
+
|
|
76
|
+
For instructions whose agent reads content it does not control and can also act. Prompt text lowers how often an agent obeys injected instructions; it does not stop it. (ECC security guide.)
|
|
77
|
+
|
|
78
|
+
```
|
|
79
|
+
- The prompt is not the security boundary. For actions that are hard to reverse or
|
|
80
|
+
leak data (shell outside the workspace, network calls carrying data, secret reads,
|
|
81
|
+
publishing, dispatching workflows), point to a control the harness enforces:
|
|
82
|
+
approval prompts, scoped tools and credentials, sandboxes, a deterministic gate
|
|
83
|
+
such as a policy-check script. Name the boundary and its enforcer; do not rely
|
|
84
|
+
on a sentence the model can be talked out of.
|
|
85
|
+
- Give the agent only the room the task needs. A reviewer does not need write
|
|
86
|
+
access; a reader of arbitrary web pages does not need secrets.
|
|
87
|
+
- When a high-risk workflow must read hostile content (arbitrary web pages, email,
|
|
88
|
+
third-party repos) and also hold powerful tools, split it: a restricted reader
|
|
89
|
+
extracts source-linked facts, and the acting agent receives only those facts and
|
|
90
|
+
still treats them as data. Skip the split for ordinary research; it costs a stage
|
|
91
|
+
and loses nuance.
|
|
92
|
+
- Durable memory is a persistence surface for injected text. A workflow that writes
|
|
93
|
+
memory should promote entries deliberately, keep project and global memory
|
|
94
|
+
separate, never store secrets, and never auto-save summaries of untrusted content.
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
## Agent-ready work shaping
|
|
98
|
+
|
|
99
|
+
For coding-agent workflows that span planning through execution, shape work so an agent can pick it up independently without losing human control:
|
|
100
|
+
|
|
101
|
+
```
|
|
102
|
+
- Stress-test vague requirements before implementation. Use a grilling/interview step to
|
|
103
|
+
expose missing decisions, then write the resolved scope as durable planning context.
|
|
104
|
+
- Convert plans into thin vertical slices ("tracer bullets") that each exercise a useful
|
|
105
|
+
path through the system and can be implemented, tested, and committed independently.
|
|
106
|
+
- Keep TDD or another fast correctness loop attached to each slice. The feedback loop is
|
|
107
|
+
what lets the agent run human-in-the-loop or unattended without drifting silently.
|
|
108
|
+
- Match how hard the check gates stopping to how unattended the run is. The ladder:
|
|
109
|
+
check requested in the prompt → a per-turn condition an evaluator re-checks → a
|
|
110
|
+
deterministic gate (script/hook that blocks finishing until it passes) → an
|
|
111
|
+
independent fresh-context agent that tries to refute the result. Each rung trades
|
|
112
|
+
setup for unattended reliability; supervised work can sit low, AFK work belongs high.
|
|
113
|
+
- Require evidence over assertion: the test output, the command run and what it
|
|
114
|
+
returned, the screenshot — reviewing evidence beats re-running verification.
|
|
115
|
+
- When an agent struggles, refine the prompt, issue, or project docs that produced the
|
|
116
|
+
struggle; do not treat the failure as only a one-off execution mistake.
|
|
117
|
+
- Codebase design is part of agent enablement: clear seams, durable vocabulary, and
|
|
118
|
+
testable modules make autonomous execution safer and cheaper.
|
|
119
|
+
- Make the project runway explicit: prerequisites, setup, dev server, typecheck, test,
|
|
120
|
+
build, and database/reset commands should be documented where the agent will find them.
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
## Output shape and verbosity
|
|
124
|
+
|
|
125
|
+
Models are prompt-sensitive on verbosity; clamp it concretely, not with "be concise":
|
|
126
|
+
|
|
127
|
+
```
|
|
128
|
+
- Default: 3–6 sentences or ≤5 bullets for typical answers; ≤2 sentences for simple yes/no questions.
|
|
129
|
+
- For complex multi-step tasks: 1 short overview paragraph, then ≤5 bullets tagged
|
|
130
|
+
What changed / Where / Risks / Next steps / Open questions.
|
|
131
|
+
- Avoid long narrative paragraphs; prefer compact bullets and short sections.
|
|
132
|
+
- Do not rephrase the user's request unless it changes semantics.
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
## Scope discipline
|
|
136
|
+
|
|
137
|
+
The strongest single lever against agents doing more than asked:
|
|
138
|
+
|
|
139
|
+
```
|
|
140
|
+
- Implement EXACTLY and ONLY what the user requests.
|
|
141
|
+
- No extra features, no added components, no embellishments.
|
|
142
|
+
- If any instruction is ambiguous, choose the simplest valid interpretation.
|
|
143
|
+
- If you notice adjacent work worth doing, call it out as optional — do not do it.
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
## Autonomy and persistence
|
|
147
|
+
|
|
148
|
+
For agents that stop too early — pair with the loop-breaker, which prevents the failure mode this block otherwise creates:
|
|
149
|
+
|
|
150
|
+
```
|
|
151
|
+
- Once given a direction, proactively gather context, plan, implement, test, and refine
|
|
152
|
+
without waiting for additional prompts at each step.
|
|
153
|
+
- Persist until the task is handled end-to-end within the current turn whenever feasible;
|
|
154
|
+
do not stop at analysis or partial fixes.
|
|
155
|
+
- Bias to action: default to implementing with reasonable assumptions; do not end your
|
|
156
|
+
turn with clarifying questions unless truly blocked.
|
|
157
|
+
- Loop-breaker: if you are re-reading or re-editing the same files without clear progress,
|
|
158
|
+
stop and end the turn with a concise summary and targeted questions.
|
|
159
|
+
```
|
|
160
|
+
|
|
161
|
+
## Ambiguity and hallucination
|
|
162
|
+
|
|
163
|
+
```
|
|
164
|
+
- If the question is ambiguous or underspecified, say so, then either ask 1–3 precise
|
|
165
|
+
clarifying questions OR present 2–3 plausible interpretations with labeled assumptions.
|
|
166
|
+
- Never fabricate exact figures, line numbers, or external references when uncertain;
|
|
167
|
+
prefer "Based on the provided context…" over absolute claims.
|
|
168
|
+
- For high-stakes outputs, re-scan your own answer before finalizing for: unstated
|
|
169
|
+
assumptions, ungrounded specifics, and overly strong language ("always", "guaranteed").
|
|
170
|
+
```
|
|
171
|
+
|
|
172
|
+
For non-interactive/research agents, invert the question rule: "Do not ask clarifying questions; cover all plausible intents with breadth and depth, stating your best-guess interpretation plainly."
|
|
173
|
+
|
|
174
|
+
## Long-context re-grounding
|
|
175
|
+
|
|
176
|
+
Reduces "lost in the scroll" errors over large inputs:
|
|
177
|
+
|
|
178
|
+
```
|
|
179
|
+
- For long inputs, first produce a short outline of the sections relevant to the request.
|
|
180
|
+
- Re-state the user's constraints explicitly before answering.
|
|
181
|
+
- Anchor claims to specific sections; quote fine details (dates, thresholds, clauses)
|
|
182
|
+
rather than speaking generically.
|
|
183
|
+
```
|
|
184
|
+
|
|
185
|
+
## Progress updates
|
|
186
|
+
|
|
187
|
+
```
|
|
188
|
+
- Send brief updates (1–2 sentences) only when starting a new major phase or when a
|
|
189
|
+
discovery changes the plan. Do not narrate routine tool calls.
|
|
190
|
+
- Each update must contain at least one concrete outcome ("Found X", "Confirmed Y").
|
|
191
|
+
```
|
|
192
|
+
|
|
193
|
+
## Tool use and parallelism
|
|
194
|
+
|
|
195
|
+
```
|
|
196
|
+
- Prefer tools over internal knowledge whenever you need fresh or user-specific data,
|
|
197
|
+
or reference specific IDs, URLs, or document titles.
|
|
198
|
+
- Think first: before any tool call, decide ALL files/resources you will need, then
|
|
199
|
+
issue independent reads as one parallel batch. Sequential calls only when the next
|
|
200
|
+
read genuinely depends on a prior result.
|
|
201
|
+
- After any write/update, briefly restate what changed, where, and what validation ran.
|
|
202
|
+
- Require an explicit verification step before high-impact operations (deletes, billing,
|
|
203
|
+
infra changes).
|
|
204
|
+
```
|
|
205
|
+
|
|
206
|
+
Naming custom tools: make names and parameters semantically exact (`semantic_search(query)`, not `search(q)`), state when/why/how to use them with good and bad examples, and make their output *look different* from similar tools' output so the model doesn't collapse into old habits.
|
|
207
|
+
|
|
208
|
+
## Plan and promise discipline
|
|
209
|
+
|
|
210
|
+
```
|
|
211
|
+
- Skip planning for straightforward tasks; never make single-step plans.
|
|
212
|
+
- The deliverable is working output, not a plan — never end a turn with only a plan.
|
|
213
|
+
- Before finishing, reconcile every stated intention: Done, Blocked (reason + targeted
|
|
214
|
+
question), or Cancelled (reason). No dangling in-progress items.
|
|
215
|
+
- Do not commit to tests/refactors you will not do now; label them optional next steps.
|
|
216
|
+
```
|
|
217
|
+
|
|
218
|
+
## Final-message style
|
|
219
|
+
|
|
220
|
+
```
|
|
221
|
+
- Lead with the outcome; jump straight in — no "Summary" preamble.
|
|
222
|
+
- Match structure to the task: plain sentences for simple confirmations, sections only
|
|
223
|
+
when they aid scanning. Reference file paths instead of dumping file contents.
|
|
224
|
+
- When offering multiple options, number them so the user can reply with a single digit.
|
|
225
|
+
```
|
|
226
|
+
|
|
227
|
+
## Working in a dirty repo
|
|
228
|
+
|
|
229
|
+
```
|
|
230
|
+
- NEVER revert changes you did not make; work with or around them.
|
|
231
|
+
- If unexpected changes appear in files you are editing, stop and ask.
|
|
232
|
+
- No destructive commands (reset --hard, checkout --) without explicit approval.
|
|
233
|
+
```
|
|
234
|
+
|
|
235
|
+
## UI anti-slop
|
|
236
|
+
|
|
237
|
+
For agents producing UI from scratch (skip when a design system exists — then the rule is the opposite: conform to it):
|
|
238
|
+
|
|
239
|
+
```
|
|
240
|
+
- Avoid safe, average-looking layouts: no default font stacks, no purple-on-white
|
|
241
|
+
defaults, no flat single-color backgrounds, no interchangeable boilerplate.
|
|
242
|
+
- Choose a clear visual direction; define tokens/CSS variables; use a few meaningful
|
|
243
|
+
animations rather than generic micro-motion. Verify in the actual host at
|
|
244
|
+
sizes appropriate to the surface; screenshots do not prove behavior.
|
|
245
|
+
```
|
|
246
|
+
|
|
247
|
+
## Technique repertoire
|
|
248
|
+
|
|
249
|
+
When designing a task prompt (rather than standing instructions), pick the lightest technique that fits — from Google's prompt-engineering whitepaper (Boonstra) and Anthropic's docs:
|
|
250
|
+
|
|
251
|
+
- **Examples over rules** for format/tone/structure: a few well-crafted examples steer more reliably than descriptions — show, don't tell. With reasoning models, examples can include the reasoning pattern itself.
|
|
252
|
+
- **Chain-of-thought / "think first"** for problems needing deliberation; **step-back prompting** (ask for the general principle, then the specific answer) when the task benefits from grounding in fundamentals.
|
|
253
|
+
- **Self-consistency** (sample multiple reasoning paths, take the consensus) when single-shot accuracy on a hard problem matters more than cost.
|
|
254
|
+
- **Self-check** as a cheap reliability win: "before finishing, verify your answer against [criteria]."
|
|
255
|
+
- **ReAct** (interleaved reasoning + tool use) is what modern agent harnesses already do — don't re-prompt it explicitly inside one.
|
|
256
|
+
|
|
257
|
+
## Maintenance technique: metaprompting
|
|
258
|
+
|
|
259
|
+
When an agent underperforms with instructions, tune the instructions rather than hand-fixing the output. Two instruments, with different blind spots:
|
|
260
|
+
|
|
261
|
+
- **Self-critique** finds friction the agent *felt*. At the end of the disappointing turn: "read your instructions, name the specific line that misled you or that you had to work around, and propose a targeted but generalized change."
|
|
262
|
+
- **Artifact grading** finds compliance the agent *believed* it had achieved — exactly where self-critique is weakest, since by its own account it complied. Grade the artifact the next reader will actually meet. The agent's response is not that artifact: a rule to mark something *in the code* is satisfied by a sentence in chat only if you grade the chat.
|
|
263
|
+
|
|
264
|
+
Start with the instrument the symptom suggests — stalling and complaints point to friction, confident-but-wrong output points to the artifact — but a real defect usually needs both: grade to see the failure, then read the instructions to find what caused it.
|
|
265
|
+
|
|
266
|
+
**Locate the mechanism before rewriting.** Examples, not a taxonomy to work through:
|
|
267
|
+
|
|
268
|
+
- a **competing rule absorbed it** — another instruction let the agent feel the obligation was discharged; a report-shaped rule will launder a mark-the-code rule every time;
|
|
269
|
+
- the **trigger never fired** — the rule was right, but nothing connected it to the situation in front of the agent;
|
|
270
|
+
- **it isn't an instruction defect** — the agent lacked the capability or the context. No rewrite fixes either.
|
|
271
|
+
|
|
272
|
+
Reaching for emphasis (ALWAYS, MUST, bold) is the reflex when the mechanism hasn't been found — and it is what an agent proposes about its own instructions for the same reason.
|
|
273
|
+
|
|
274
|
+
**Adopt only what recurs, simplified to its general form** — and mind which kind of recurrence you have. A suggestion repeated inside one session is an echo of the last answer; independent runs (fresh context, without the earlier run's reasoning) make agreement mean something; a different provider decorrelates further but does not make runs independent on its own. The same check failing twice is already evidence. The general form is the whole point: "MUST write `ceiling:` in the code, NEVER only in chat" fixes one skill; "mark it where the next reader will meet it" fixes the class.
|
|
275
|
+
|
|
276
|
+
**Prefer replacing over appending, and ask what to delete.** A tune that only ever adds is a bloat generator: every added line dilutes the ones already there, and the rule you are fixing may be failing *because* of what surrounds it. Not every finding has to become instruction weight — some belong in the concept's test notes.
|
|
277
|
+
|
|
278
|
+
**Verify by re-running the check that failed**, never by asking the agent whether it feels better now, and keep that case as a regression check. The test rule applies before redeploy.
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: bc-prototype
|
|
3
|
+
description: Build a clearly throwaway prototype to answer a design question before committing to a PRD or implementation — logic/state terminal app or UI variants.
|
|
4
|
+
disable-model-invocation: true
|
|
5
|
+
argument-hint: "What question should the prototype answer?"
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# Prototype
|
|
9
|
+
|
|
10
|
+
A prototype is throwaway code that answers one design question. It feeds the bc planning loop: learn fast, record the answer, then delete/absorb before `/bc-pipeline-to-done` executes production slices.
|
|
11
|
+
|
|
12
|
+
## Pick the branch
|
|
13
|
+
|
|
14
|
+
- **Logic/state/business rules unclear** → build a tiny interactive terminal app or script that pushes the state machine through hard cases.
|
|
15
|
+
- **UI/UX unclear** → build several radically different variants on one route/page, switchable by URL param or a small floating control.
|
|
16
|
+
|
|
17
|
+
If ambiguous and the user is not reachable, choose the branch that matches the surrounding code and state the assumption.
|
|
18
|
+
|
|
19
|
+
## Rules
|
|
20
|
+
|
|
21
|
+
1. **Throwaway from the first line.** Name files/routes with `bc-prototype`, `scratch`, or `throwaway`; don't make them look production.
|
|
22
|
+
2. **Close to context.** Place it near the module/page it informs, following existing project conventions.
|
|
23
|
+
3. **One command to run.** Use the project's task runner; print the command in the final note.
|
|
24
|
+
4. **No persistence by default.** Use memory; if persistence is the question, use a scratch DB/file clearly marked wipeable.
|
|
25
|
+
5. **Skip polish.** No tests, abstractions, or production error handling beyond runnable.
|
|
26
|
+
6. **Surface state.** Print/render relevant state after each action or variant switch.
|
|
27
|
+
7. **Delete or absorb.** When the question is answered, either delete the prototype or fold the validated decision into real work.
|
|
28
|
+
|
|
29
|
+
## Handoff to the bc loop
|
|
30
|
+
|
|
31
|
+
Before moving to `/bc-plan-to-pipeline` or implementation, capture:
|
|
32
|
+
|
|
33
|
+
- The question the prototype answered.
|
|
34
|
+
- The verdict / chosen behavior or UI direction.
|
|
35
|
+
- Any rejected alternatives worth remembering.
|
|
36
|
+
- Whether prototype files were deleted, parked, or intentionally absorbed.
|
|
37
|
+
|
|
38
|
+
Save this writeup as a dated `<YYYY-MM-DD>-prototype-<slug>/` folder in the project's research role; a costly-to-reverse verdict also gets a record in the decisions role, and a product-level requirement goes to the requirements role. Look each role up in the "Where things go" table in `.bc-agent/AGENTS.md`. Why: one table per project means a project that keeps something elsewhere changes one place, and a writeup in the research folder is where the work item that follows will cite it. Without that table, use the earlier homes: `.bc-agent/project/<feature>-notes.md`, an ADR under `docs/adr/`, or the PRD. The research role is the default home and the one to recommend. If the user explicitly names another place for the writeup, save it there, say in your report that the research role is where later work will look for it, and offer to move it. Why: the writeup is the only part of a prototype that survives and a scratch folder is where files get deleted, but where the user's own file goes is the user's call.
|
|
39
|
+
|
|
40
|
+
Do not send prototype files to `/bc-pipeline-to-done` as production acceptance criteria; the writeup is the evidence, and the prototype code is throwaway.
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: bc-qmd
|
|
3
|
+
description: Search local Markdown knowledge bases (agent wikis, notes, project vaults) with qmd local hybrid search. Use when you need prior decisions, concepts, or notes — one query across all registered collections beats walking directory trees. Also covers who may run indexing and why project-local indexes are a trap.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# qmd — local hybrid search over Markdown knowledge bases
|
|
7
|
+
|
|
8
|
+
[qmd](https://github.com/tobi/qmd) is an on-device search engine (BM25 + vector embeddings + LLM
|
|
9
|
+
reranking, all local GGUF models). Run it in **global mode**: one index, with a collection per
|
|
10
|
+
knowledge base, searchable from **any** working directory.
|
|
11
|
+
|
|
12
|
+
Reach for it whenever the question is "has this been decided/ingested/tried before?" — prior ADRs,
|
|
13
|
+
rejected ideas, concepts, findings. Check availability with `qmd collection list` (is qmd
|
|
14
|
+
installed, and does a collection cover the corpus you need?). For a corpus small enough to read
|
|
15
|
+
whole, grep and a repo's own index files are still fine.
|
|
16
|
+
|
|
17
|
+
## Searching
|
|
18
|
+
|
|
19
|
+
- `qmd query "<terms>"` — hybrid + reranking, best quality; the default. Add `--intent "<what
|
|
20
|
+
you're actually after>"` when terms are ambiguous. Unscoped queries search all collections;
|
|
21
|
+
scope with `-c <collection>` (repeatable).
|
|
22
|
+
- `qmd search "<terms>"` — BM25 keyword only, fast, no LLM; use for exact identifiers.
|
|
23
|
+
`qmd vsearch` — semantic only.
|
|
24
|
+
- Latency (measured, ~1k docs, cold CLI): `search` ≈ 0.5s, `query --no-rerank` ≈ 20s, full
|
|
25
|
+
`query` ≈ 55s (models reload per invocation). Pick the cheapest tier that answers: identifiers
|
|
26
|
+
→ `search`; exploring → `--no-rerank`; full `query` when ranking quality actually matters.
|
|
27
|
+
- Machine output: `--json`; threshold sweeps: `--all --files --min-score 0.3`.
|
|
28
|
+
- Retrieve: `qmd get "#<docid>"` (docids appear in results), `qmd get <path>:<from>:<count>` for
|
|
29
|
+
line ranges, `qmd multi-get "<glob>"` for batches.
|
|
30
|
+
- Score guide: ≥0.8 highly relevant, 0.5–0.8 moderately; below that, treat as a lead, not an
|
|
31
|
+
answer. Read the returned `Context:` line — seed collections with **authority labels** ("ADRs —
|
|
32
|
+
binding unless superseded" vs "exploratory research — not authoritative"), so a hit tells you
|
|
33
|
+
how much to trust it before you open it.
|
|
34
|
+
|
|
35
|
+
## Never create project-local indexes
|
|
36
|
+
|
|
37
|
+
Do not run `qmd init` inside a repo, even though upstream docs suggest it. A project-local
|
|
38
|
+
`.qmd/` **shadows the entire global registry** from anywhere inside that repo (verified v2.5.3) —
|
|
39
|
+
every global collection silently becomes unreachable there, and the local index can't travel
|
|
40
|
+
anyway (absolute paths, per-machine binary). If a repo's vault should be searchable, register it
|
|
41
|
+
as a global collection instead.
|
|
42
|
+
|
|
43
|
+
If you inherit a repo that already has one, `.qmd/` should be gitignored entirely: its
|
|
44
|
+
`index.yml` stores absolute paths, so committing it breaks every other machine.
|
|
45
|
+
|
|
46
|
+
## Who runs indexing
|
|
47
|
+
|
|
48
|
+
Searching is always safe. Index mutation has owners, and the pattern matters more than the exact
|
|
49
|
+
commands:
|
|
50
|
+
|
|
51
|
+
- **Adding/changing collections or contexts:** keep the collection definitions in one
|
|
52
|
+
version-controlled file and apply them with a single setup command. Never run ad-hoc
|
|
53
|
+
`qmd collection add` outside that file, or machines drift apart and a query means something
|
|
54
|
+
different depending on where you run it.
|
|
55
|
+
- **Freshness:** run `qmd update && qmd embed` on a schedule (a daily user timer works well). In
|
|
56
|
+
an AFK pipeline, only the **driver** refreshes, once at preflight; workers are search-only.
|
|
57
|
+
Concurrent re-embeds race for zero benefit, and a worker silently rebuilding the index can mask
|
|
58
|
+
a broken corpus instead of parking the run.
|
|
59
|
+
- Never modify the index SQLite directly; everything goes through the CLI. First-time machine
|
|
60
|
+
setup is `qmd pull && qmd embed` (~2GB one-time model download, Node ≥ 22).
|
|
61
|
+
|
|
62
|
+
> This workspace's own setup keeps `qmd-collections.yml` in a synced repo and applies it with a
|
|
63
|
+
> wrapper script, registering new projects by default at init. That is one
|
|
64
|
+
> implementation of the rule above, not a requirement.
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: bc-research
|
|
3
|
+
description: Research a technical question against high-trust primary sources. Use for multi-source investigations, API/documentation facts, or delegated reading legwork; keep narrow factual lookups inline.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Evidence-First Research
|
|
7
|
+
|
|
8
|
+
Investigate a focused question using sources that own the relevant claims: official documentation, specifications, source code, first-party APIs, or maintainer statements. Do not treat secondary summaries as proof when a primary source is available.
|
|
9
|
+
|
|
10
|
+
## Choose the execution shape
|
|
11
|
+
|
|
12
|
+
- **Narrow lookup:** research inline when one or two sources answer the question quickly.
|
|
13
|
+
- **Substantial investigation:** launch a background research agent so the main session can continue. Give it the question, desired decision/output, source-quality rule, and this output contract.
|
|
14
|
+
|
|
15
|
+
## Research contract
|
|
16
|
+
|
|
17
|
+
1. State the question and any material assumptions.
|
|
18
|
+
2. Trace each factual claim to the source that owns it. Prefer a stable permalink, version, or dated official document.
|
|
19
|
+
3. Separate verified facts, reasoned recommendations, and unresolved uncertainty.
|
|
20
|
+
4. Return a concise cited finding: answer, evidence, implications for the project, and remaining unknowns.
|
|
21
|
+
|
|
22
|
+
## Durable artifacts are opt-in
|
|
23
|
+
|
|
24
|
+
Do **not** create a repository note for a disposable answer. Persist one cited Markdown note only when the user asks, a project instruction requires it, or the research directly informs a durable decision, PRD, or implementation plan. Match the repo’s established research-note location and format; if none exists, propose a path before writing.
|
|
25
|
+
|
|
26
|
+
A durable note records the question, conclusion, primary-source links, relevant version/date, and open questions. It is evidence for later work, not a substitute for the actual PRD or decision record.
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# AI, LLM and agent boundaries
|
|
2
|
+
|
|
3
|
+
Load only when recon finds untrusted content flowing through a model or memory
|
|
4
|
+
into authority, another principal's context or a sensitive sink.
|
|
5
|
+
|
|
6
|
+
Map identities, capabilities, writable context/memory and output destinations.
|
|
7
|
+
Trace retrieval ACLs and cache/session keys; find every writer of persistent memory
|
|
8
|
+
and its later consumer. Check prompt role/provenance serialization, but do not call
|
|
9
|
+
persuasive text alone a vulnerability: prompts are not deterministic boundaries.
|
|
10
|
+
|
|
11
|
+
Work backward from tools through handlers, dispatch, schema, confirmation and model
|
|
12
|
+
context. Tool schemas constrain shape, not authority. Bind requester, normalized
|
|
13
|
+
arguments, final resource and exact approved action at execution, including retries,
|
|
14
|
+
queues and resumed turns. Separate confused-deputy authority from action-binding:
|
|
15
|
+
a victim may have permission but never have requested the attacker-induced action.
|
|
16
|
+
|
|
17
|
+
For MCP/delegation, check authenticated peer, tool namespace, outstanding request
|
|
18
|
+
correlation, scoped credentials and results on return. Metadata cannot grant policy.
|
|
19
|
+
Trace model output into renderers, URLs and commands using sink-specific controls.
|
|
20
|
+
|
|
21
|
+
Confirm only a code-level control failure with a concrete unauthorized/unrequested
|
|
22
|
+
action, cross-principal disclosure or durable authority change. Same-user intentional
|
|
23
|
+
use is not privilege gain. Unknown model/provider behavior or renderer/identity
|
|
24
|
+
configuration is a precise needs-validation blocker; do not execute model calls or
|
|
25
|
+
contact providers to settle it.
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
# General attack classes
|
|
2
|
+
|
|
3
|
+
Select classes by the boundary, not by checklist completion. For each, name the
|
|
4
|
+
invariant and trace a controllable input to a concrete unauthorized result. Follow
|
|
5
|
+
stored/derived copies and alternate routes; stop at the smallest demonstrated effect.
|
|
6
|
+
|
|
7
|
+
- **Injection:** compare the input's original context with SQL, HTML, shell,
|
|
8
|
+
template, path, URL or deserialization sinks. Check parameterization/encoding at
|
|
9
|
+
the final sink, including field names, metadata and second-order use.
|
|
10
|
+
- **Access control:** authenticate the caller, then bind action and final resource
|
|
11
|
+
to that caller's authority. Compare detail, list, export, batch and legacy paths;
|
|
12
|
+
a tenant field is not enforcement and authentication is not ownership.
|
|
13
|
+
- **Resources and files:** examine path normalization, symlinks, archive extraction,
|
|
14
|
+
check/use races, URL redirects and SSRF destinations. Establish lower-trust
|
|
15
|
+
control and the protected destination; unknown network topology is a blocker.
|
|
16
|
+
- **Cryptography and secrets:** trace generation, storage, verification, scope,
|
|
17
|
+
rotation and failure fallback. Verify pinned library defaults. Distinguish public
|
|
18
|
+
identifiers from credentials and weak style from actual loss of confidentiality
|
|
19
|
+
or integrity. Never copy real secrets into reports.
|
|
20
|
+
- **Business logic:** reconstruct allowed states and accounting invariants. Compare
|
|
21
|
+
negative/zero/overflow values, replay, races, stale/revoked state, partial failure,
|
|
22
|
+
cancellation and rollback only where the interface permits them.
|
|
23
|
+
- **Data leakage and feature abuse:** compare authorization across search, export,
|
|
24
|
+
backup, restore, previews, notifications, caches and error responses. State whose
|
|
25
|
+
non-public data is disclosed, not merely that two responses differ.
|
|
26
|
+
- **Chained trust:** prove every prerequisite from one component's output to the
|
|
27
|
+
next component's assumed guarantee. Do not infer later authority from an earlier
|
|
28
|
+
parser failure or assume a revoked capability is accepted without tracing it.
|
|
29
|
+
- **Shared availability:** bound attacker cost, shared resource, quota/isolation
|
|
30
|
+
failure and effect on others. Ordinary expensive work or self-impact is not a
|
|
31
|
+
shared-service outage. Do not stress-test a live service.
|
|
32
|
+
|
|
33
|
+
Unexpected code is a lead, not a finding. A missing best practice goes in hardening
|
|
34
|
+
unless a reachable boundary violation is established. Use selected domain companions
|
|
35
|
+
for additional invariants, never as a replacement for these source traces.
|