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,206 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
"""Search a Markdown agent vault without an index or third-party dependency.
|
|
3
|
+
|
|
4
|
+
This is the default single-vault reader: it reads tracked Markdown files from the vault's Git
|
|
5
|
+
repository at query time, scores them with BM25, and writes only ranked vault-
|
|
6
|
+
relative paths to stdout. It never writes the vault or a search artifact.
|
|
7
|
+
"""
|
|
8
|
+
from __future__ import annotations
|
|
9
|
+
|
|
10
|
+
import argparse
|
|
11
|
+
from collections import Counter
|
|
12
|
+
from dataclasses import dataclass
|
|
13
|
+
import math
|
|
14
|
+
import os
|
|
15
|
+
from pathlib import Path
|
|
16
|
+
import re
|
|
17
|
+
import subprocess
|
|
18
|
+
import sys
|
|
19
|
+
from typing import Iterable
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
SKIP_DIR_NAMES = {".git", ".obsidian", "scratch", "temp", "node_modules", "vendor"}
|
|
23
|
+
DEFAULT_LIMIT = 15
|
|
24
|
+
BM25_K1 = 1.2
|
|
25
|
+
BM25_B = 0.75
|
|
26
|
+
TOKEN_RE = re.compile(r"[A-Za-z0-9]+(?:['\u2019][A-Za-z0-9]+)?")
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
@dataclass(frozen=True)
|
|
30
|
+
class Document:
|
|
31
|
+
relative: str
|
|
32
|
+
term_counts: Counter[str]
|
|
33
|
+
length: int
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
@dataclass(frozen=True)
|
|
37
|
+
class RankedDocument:
|
|
38
|
+
relative: str
|
|
39
|
+
score: float
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
def git_command(repo: Path, *args: str, input_bytes: bytes | None = None) -> subprocess.CompletedProcess[bytes]:
|
|
43
|
+
try:
|
|
44
|
+
return subprocess.run(
|
|
45
|
+
["git", "-C", str(repo), *args],
|
|
46
|
+
input=input_bytes,
|
|
47
|
+
capture_output=True,
|
|
48
|
+
check=False,
|
|
49
|
+
)
|
|
50
|
+
except OSError as exc:
|
|
51
|
+
raise RuntimeError(f"could not run git: {exc}") from exc
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
def resolve_repo(vault: Path) -> Path:
|
|
55
|
+
result = git_command(vault, "rev-parse", "--show-toplevel")
|
|
56
|
+
if result.returncode != 0:
|
|
57
|
+
detail = result.stderr.decode("utf-8", errors="replace").strip()
|
|
58
|
+
raise RuntimeError(f"vault is not inside a Git repository: {vault}{': ' + detail if detail else ''}")
|
|
59
|
+
value = result.stdout.decode("utf-8", errors="strict").strip()
|
|
60
|
+
if not value:
|
|
61
|
+
raise RuntimeError(f"Git returned no repository root for vault: {vault}")
|
|
62
|
+
return Path(value).resolve()
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
def tracked_markdown_paths(vault: Path, repo: Path) -> list[tuple[str, Path]]:
|
|
66
|
+
"""Return eligible (repository-relative, absolute) tracked Markdown paths.
|
|
67
|
+
|
|
68
|
+
The candidate list comes from ``git ls-files``. ``git check-ignore
|
|
69
|
+
--no-index`` is then applied in one batch so tracked files matching an
|
|
70
|
+
ignore rule are excluded too; ``--no-index`` is intentional because a
|
|
71
|
+
tracked path would otherwise bypass the ignore rules.
|
|
72
|
+
"""
|
|
73
|
+
listed = git_command(repo, "ls-files", "-z")
|
|
74
|
+
if listed.returncode != 0:
|
|
75
|
+
detail = listed.stderr.decode("utf-8", errors="replace").strip()
|
|
76
|
+
raise RuntimeError(f"git ls-files failed: {detail or 'unknown error'}")
|
|
77
|
+
|
|
78
|
+
vault = vault.resolve()
|
|
79
|
+
candidates: list[tuple[str, Path]] = []
|
|
80
|
+
for raw in listed.stdout.split(b"\0"):
|
|
81
|
+
if not raw:
|
|
82
|
+
continue
|
|
83
|
+
relative = os.fsdecode(raw)
|
|
84
|
+
if Path(relative).suffix.lower() != ".md":
|
|
85
|
+
continue
|
|
86
|
+
path = (repo / Path(relative)).resolve()
|
|
87
|
+
try:
|
|
88
|
+
vault_relative = path.relative_to(vault)
|
|
89
|
+
except ValueError:
|
|
90
|
+
continue
|
|
91
|
+
if not path.is_file() or any(part in SKIP_DIR_NAMES for part in vault_relative.parts):
|
|
92
|
+
continue
|
|
93
|
+
candidates.append((relative, path))
|
|
94
|
+
|
|
95
|
+
if not candidates:
|
|
96
|
+
return []
|
|
97
|
+
|
|
98
|
+
check = git_command(
|
|
99
|
+
repo,
|
|
100
|
+
"check-ignore",
|
|
101
|
+
"--no-index",
|
|
102
|
+
"--stdin",
|
|
103
|
+
"-z",
|
|
104
|
+
input_bytes=b"".join(os.fsencode(relative) + b"\0" for relative, _ in candidates),
|
|
105
|
+
)
|
|
106
|
+
if check.returncode not in (0, 1):
|
|
107
|
+
detail = check.stderr.decode("utf-8", errors="replace").strip()
|
|
108
|
+
raise RuntimeError(f"git check-ignore failed: {detail or 'unknown error'}")
|
|
109
|
+
ignored = {os.fsdecode(raw) for raw in check.stdout.split(b"\0") if raw}
|
|
110
|
+
return [(relative, path) for relative, path in candidates if relative not in ignored]
|
|
111
|
+
|
|
112
|
+
|
|
113
|
+
def tokenize(value: str) -> list[str]:
|
|
114
|
+
"""Tokenize text consistently for both query terms and page content."""
|
|
115
|
+
return [match.group(0).casefold() for match in TOKEN_RE.finditer(value)]
|
|
116
|
+
|
|
117
|
+
|
|
118
|
+
def load_documents(vault: Path) -> list[Document]:
|
|
119
|
+
"""Read the eligible vault pages at query time; no on-disk state is created."""
|
|
120
|
+
repo = resolve_repo(vault)
|
|
121
|
+
documents: list[Document] = []
|
|
122
|
+
for _repo_relative, path in tracked_markdown_paths(vault, repo):
|
|
123
|
+
try:
|
|
124
|
+
content = path.read_text(encoding="utf-8", errors="replace")
|
|
125
|
+
except OSError as exc:
|
|
126
|
+
raise RuntimeError(f"could not read eligible page {path}: {exc}") from exc
|
|
127
|
+
terms = tokenize(content)
|
|
128
|
+
documents.append(Document(path.relative_to(vault.resolve()).as_posix(), Counter(terms), len(terms)))
|
|
129
|
+
return sorted(documents, key=lambda document: document.relative)
|
|
130
|
+
|
|
131
|
+
|
|
132
|
+
def rank_documents(documents: Iterable[Document], query: str, limit: int = DEFAULT_LIMIT) -> list[RankedDocument]:
|
|
133
|
+
"""Return the top ``limit`` documents using the standard BM25 formula."""
|
|
134
|
+
if limit < 1:
|
|
135
|
+
raise ValueError("limit must be at least 1")
|
|
136
|
+
query_terms = list(dict.fromkeys(tokenize(query)))
|
|
137
|
+
if not query_terms:
|
|
138
|
+
raise ValueError("query must contain at least one alphanumeric term")
|
|
139
|
+
|
|
140
|
+
corpus = list(documents)
|
|
141
|
+
if not corpus:
|
|
142
|
+
return []
|
|
143
|
+
average_length = sum(document.length for document in corpus) / len(corpus) or 1.0
|
|
144
|
+
document_frequency = {
|
|
145
|
+
term: sum(term in document.term_counts for document in corpus)
|
|
146
|
+
for term in query_terms
|
|
147
|
+
}
|
|
148
|
+
scores: list[RankedDocument] = []
|
|
149
|
+
for document in corpus:
|
|
150
|
+
score = 0.0
|
|
151
|
+
normalizer = BM25_K1 * (1 - BM25_B + BM25_B * document.length / average_length)
|
|
152
|
+
for term in query_terms:
|
|
153
|
+
term_frequency = document.term_counts.get(term, 0)
|
|
154
|
+
frequency = document_frequency[term]
|
|
155
|
+
if not term_frequency or not frequency:
|
|
156
|
+
continue
|
|
157
|
+
inverse_document_frequency = math.log(1 + (len(corpus) - frequency + 0.5) / (frequency + 0.5))
|
|
158
|
+
score += inverse_document_frequency * (
|
|
159
|
+
term_frequency * (BM25_K1 + 1) / (term_frequency + normalizer)
|
|
160
|
+
)
|
|
161
|
+
if score > 0:
|
|
162
|
+
scores.append(RankedDocument(document.relative, score))
|
|
163
|
+
scores.sort(key=lambda item: (-item.score, item.relative))
|
|
164
|
+
return scores[:limit]
|
|
165
|
+
|
|
166
|
+
|
|
167
|
+
def parse_args(argv: list[str] | None = None) -> argparse.Namespace:
|
|
168
|
+
parser = argparse.ArgumentParser(description=__doc__)
|
|
169
|
+
parser.add_argument("vault", help="path to the agent vault")
|
|
170
|
+
parser.add_argument("query", nargs="+", help="one or more search terms")
|
|
171
|
+
parser.add_argument(
|
|
172
|
+
"-n",
|
|
173
|
+
"--limit",
|
|
174
|
+
type=int,
|
|
175
|
+
default=DEFAULT_LIMIT,
|
|
176
|
+
help=f"maximum ranked paths to print (default: {DEFAULT_LIMIT})",
|
|
177
|
+
)
|
|
178
|
+
parser.add_argument(
|
|
179
|
+
"--scores",
|
|
180
|
+
action="store_true",
|
|
181
|
+
help="include the BM25 score before each path (default output is paths only)",
|
|
182
|
+
)
|
|
183
|
+
return parser.parse_args(argv)
|
|
184
|
+
|
|
185
|
+
|
|
186
|
+
def main(argv: list[str] | None = None) -> int:
|
|
187
|
+
args = parse_args(argv)
|
|
188
|
+
vault = Path(args.vault).expanduser().resolve()
|
|
189
|
+
if not vault.is_dir():
|
|
190
|
+
print(f"wiki-search: vault is not a directory: {vault}", file=sys.stderr)
|
|
191
|
+
return 2
|
|
192
|
+
try:
|
|
193
|
+
results = rank_documents(load_documents(vault), " ".join(args.query), args.limit)
|
|
194
|
+
except (RuntimeError, ValueError) as exc:
|
|
195
|
+
print(f"wiki-search: {exc}", file=sys.stderr)
|
|
196
|
+
return 2
|
|
197
|
+
for result in results:
|
|
198
|
+
if args.scores:
|
|
199
|
+
print(f"{result.score:.6f}\t{result.relative}")
|
|
200
|
+
else:
|
|
201
|
+
print(result.relative)
|
|
202
|
+
return 0
|
|
203
|
+
|
|
204
|
+
|
|
205
|
+
if __name__ == "__main__":
|
|
206
|
+
raise SystemExit(main())
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
# Work sync plan format
|
|
2
|
+
|
|
3
|
+
One message, in chat, before any write. Leave out a section with nothing in it, and say "nothing to change" when every section is empty.
|
|
4
|
+
|
|
5
|
+
```md
|
|
6
|
+
## Work sync plan — <project>, <date>
|
|
7
|
+
|
|
8
|
+
Sources read: <requirements path>, <decisions path> (latest entry: <number/date>), <research path>, <ideas path>, open issues: <yes/no, count>.
|
|
9
|
+
Stages: <the Stages: line, or "none; propose adding `Stages: now, next, later, unscheduled`">
|
|
10
|
+
|
|
11
|
+
### New items
|
|
12
|
+
| # | Title | Stage | Blocked by | From |
|
|
13
|
+
| --- | --- | --- | --- | --- |
|
|
14
|
+
| new | <title> | <stage> | <item names, or nothing> | <doc and section, or issue #N> |
|
|
15
|
+
|
|
16
|
+
### Moves
|
|
17
|
+
- work item <NNN>: <from> → <to> — <why: all steps checked / work landed in <short SHA> "<subject>">
|
|
18
|
+
|
|
19
|
+
### Fixes to existing items
|
|
20
|
+
- work item <NNN>: <what changes> — <doc that says so>
|
|
21
|
+
|
|
22
|
+
### Stale active items
|
|
23
|
+
- work item <NNN>: last commit <date> (<N> days) — <proposal>
|
|
24
|
+
|
|
25
|
+
### Stale Held by lines
|
|
26
|
+
- work item <NNN>: `Held by: <line>` — <why stale: no commit for <N> hours / session ended / malformed / item closed> — remove the line
|
|
27
|
+
|
|
28
|
+
### Ideas that became items
|
|
29
|
+
- `<idea line>` → work item <NNN>: remove the line
|
|
30
|
+
|
|
31
|
+
### Links by path
|
|
32
|
+
- <file:line>: `<path link>` → "work item <NNN>"
|
|
33
|
+
|
|
34
|
+
### Questions
|
|
35
|
+
1. <question, with both sources and their dates>
|
|
36
|
+
1. <recommended option> (recommended)
|
|
37
|
+
2. <other option>
|
|
38
|
+
|
|
39
|
+
Reply with approvals or changes (for example "all, but 2.2") and answer the questions. Approval does not answer an open question; dependent work remains open. Nothing is written until then.
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
Rules for the plan:
|
|
43
|
+
|
|
44
|
+
- Every proposed item, move and fix names the doc, issue or commit it comes from. Why: the owner checks a claim against its source, not against your summary.
|
|
45
|
+
- Numbers in "New items" stay `new` in the plan; real numbers are assigned when writing, in the main checkout.
|
|
46
|
+
- A disagreement between two docs goes under Questions, never under Fixes.
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: bc-work-sync
|
|
3
|
+
description: Bring a project's work/ folder in line with its own docs — find planned work with no item, finished or stale items, missing stages and links by path, show one plan, and write only after the owner answers it.
|
|
4
|
+
disable-model-invocation: true
|
|
5
|
+
argument-hint: "[optional focus, e.g. a stage or a doc]"
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# Sync work items with the project's docs
|
|
9
|
+
|
|
10
|
+
The project's docs say what is planned; `work/` should show the same. This skill finds where they disagree, shows the owner one plan, and changes `work/` only after the owner answers it.
|
|
11
|
+
|
|
12
|
+
If `~/.config/agent-concepts/overlays/bc-work-sync.md` exists, read it for this machine's tool names.
|
|
13
|
+
|
|
14
|
+
## Gate: plan first, write nothing until the owner answers
|
|
15
|
+
|
|
16
|
+
```
|
|
17
|
+
- Read, then show ONE plan in chat in the format of PLAN.md. Do not create, edit, move,
|
|
18
|
+
number or commit anything before the owner has answered that plan.
|
|
19
|
+
- "Just do it", "skip the plan", "you know what I want" do not lift this gate: show the
|
|
20
|
+
plan anyway, short if the owner is in a hurry. Why: the plan is where the owner catches
|
|
21
|
+
a wrong stage, a duplicate item or a doc that is stale, and a written item looks decided.
|
|
22
|
+
- Apply only what the owner approved. Answers that change the plan get a revised plan,
|
|
23
|
+
not a guess. An approval does not answer a question; leave out what depends on an
|
|
24
|
+
unanswered question and list it as still open.
|
|
25
|
+
- In a git worktree, number nothing, even when the owner names the number: add a line to
|
|
26
|
+
the ideas file and say the item is numbered in the main checkout. Why: a worktree cannot
|
|
27
|
+
see items created or uncommitted in the main checkout, so the next free number may be taken.
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
## Sources
|
|
31
|
+
|
|
32
|
+
Discover work only from the project's own docs, located through the "Where things go" table in `.bc-agent/AGENTS.md`: requirements (PRD), the decisions folder (decision log and ADRs), research, and the ideas file. Add open GitHub issues (`gh issue list --state open`) when the project uses them (items have `Issue:` lines, or the work-item rules mention issues).
|
|
33
|
+
|
|
34
|
+
Not sources for new work: code TODOs, session notes, logs, or git history. Why: they record what someone thought once, not what the project decided. `git log` is allowed only to check existing items (has this item's work already landed? when was it last touched?).
|
|
35
|
+
|
|
36
|
+
A project without the table is not ready for this skill: say so and stop.
|
|
37
|
+
|
|
38
|
+
## Stages
|
|
39
|
+
|
|
40
|
+
The project lists its stages in order on a `Stages:` line in `.bc-agent/AGENTS.md`; without one, the stages are `now, next, later, unscheduled`, and the plan proposes adding the line. Every open item (in work-planned or work-active) has a `Stage:` line directly under `Done when:` naming one of them. Every open item also has a `Blocked by:` line naming the items it waits for, or `nothing`. `python3 .bc-agent/scripts/work_index.py --check` reports a missing or unknown stage, a missing `Blocked by:` line, and blockers naming unknown, dropped or the item itself, or forming a cycle, and, in the owner's optional ranking `work/order.md`, unknown or repeated names, open items it leaves out (the message says where each goes) and items listed above one they wait on; run it while reading.
|
|
41
|
+
|
|
42
|
+
## When docs and items disagree
|
|
43
|
+
|
|
44
|
+
- **Docs win.** An item that contradicts the docs is proposed for fixing, not the docs.
|
|
45
|
+
- **Docs that disagree with each other are a question for the owner.** When the requirements doc looks stale against a newer decision-log entry, list both (file, section or decision number, date) as a question; do not pick one.
|
|
46
|
+
- **Never edit the decision log.** It is append-only; a correction is a new entry the owner writes or approves, and this skill only proposes it.
|
|
47
|
+
|
|
48
|
+
## What the plan covers
|
|
49
|
+
|
|
50
|
+
Look for each of these; [PLAN.md](PLAN.md) gives the plan's format.
|
|
51
|
+
|
|
52
|
+
1. Planned work in the docs with no item: a new item, with its proposed stage and the doc it comes from.
|
|
53
|
+
2. Items whose steps are all checked but which are not in work-done.
|
|
54
|
+
3. Active items untouched by any commit for a long time (`git log -1 --format=%cs -- <item>`; say what "long" was, default 60 days).
|
|
55
|
+
Also report stale `Held by:` lines: a line on an item no commit has touched for a day (say what "a day" was, from `git log -1 --format=%cI -- <item>`; `work_index.py --json` gives each line's own age as `held_by.age_seconds`), a line naming a session the session tool shows as ended (if none is available, report session status as unverified), a line `--check` calls malformed, and any line left in work-done or work-dropped. Propose removing each; never remove a line from a session that may still be live. Why: a line left behind by a crashed or finished agent shows the owner's dashboard work that is not happening.
|
|
56
|
+
4. Planned items whose work already landed in commits: name the commits.
|
|
57
|
+
5. Lines in the ideas file that became items: remove the line.
|
|
58
|
+
6. Open items with no or an unknown `Stage:` line, and a missing `Stages:` line.
|
|
59
|
+
7. Open items with no `Blocked by:` line, and `Blocked by:` names that are unknown, dropped (in work-dropped), the item itself or part of a cycle: propose the real blockers, or a changed plan for a dropped one. A project whose items have no `Blocked by:` lines at all needs the "Blocked by" note in bc-setup-project's `MIGRATIONS.md`; propose it.
|
|
60
|
+
8. Links to items by path in docs or other items: docs refer to items by number ("work item 012"); only the generated `work/README.md` links paths.
|
|
61
|
+
9. Questions for the owner, each with numbered options and the recommended one first.
|
|
62
|
+
|
|
63
|
+
## After the owner approves
|
|
64
|
+
|
|
65
|
+
1. Write items from `.bc-agent/templates/work-item.md` under the project's work-item rules in `.bc-agent/AGENTS.md`. Number new items only in the main checkout (`git rev-parse --path-format=absolute --git-dir` equals `git rev-parse --path-format=absolute --git-common-dir`); in a worktree, add a line to the ideas file instead and say so. Link to the docs an item comes from instead of copying their content. Set a `Kind:` line when the doc makes the kind clear (a bug, a security fix, a feature, ...), and place the item in `work/order.md` where `work_index.py --check` says.
|
|
66
|
+
2. Run `python3 .bc-agent/scripts/work_index.py`, then `python3 .bc-agent/scripts/work_index.py --check` and the project's own lint.
|
|
67
|
+
3. Commit only your own changes, with a subject naming the sync.
|
|
68
|
+
4. Get an independent review of the diff (a fresh reviewer subagent, or the owner when none is available), apply the fixes, re-run step 2 and commit them.
|
|
69
|
+
5. Publishing: run the publish policy check for this repo, its remote and the current branch, if the machine has one; the overlay named at the top of this skill names it, so read that file now if you have not. Then check the matched rule's `when:` conditions yourself. If there is no matching rule, or the check is not available, ask. Do not restate the policy.
|
|
70
|
+
|
|
71
|
+
A project scaffolded before the work index has no `.bc-agent/scripts/work_index.py`: see the "Work index" note in bc-setup-project's `MIGRATIONS.md`, and propose adopting it in the plan rather than doing it unasked.
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: bc-writing-plans
|
|
3
|
+
description: Use when an approved spec or resolved requirements need to become a detailed implementation plan before code is changed.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Writing Plans
|
|
7
|
+
|
|
8
|
+
Write plans for a capable engineer or fresh agent with little project context. The plan must be concrete enough to execute task-by-task without guessing.
|
|
9
|
+
|
|
10
|
+
Plans must be storage-safe: pytest through the guarded test runner the project's or machine's instructions name (otherwise plain `pytest`, with `tmp_path` for test fixtures and cleanup even on failure; never custom `--basetemp`); scratch folders from `mktemp -d`, never under `/tmp`; the machine's storage health check before full suites, worktrees and multi-worker launches (stop on critical or unknown health or if the configured check cannot run; if none is configured, skip it with one report line); and worktree cleanup only after proving the work's commits are in `HEAD`. Plan targeted task checks plus one shared baseline and one landing run of the full suite. The `agent-kernel` concept's Storage safety (temp files, scratch folders) and Verification sections hold their rules, when loaded. Why: unsafe commands in plans become unsafe execution.
|
|
11
|
+
|
|
12
|
+
## Scope gate
|
|
13
|
+
|
|
14
|
+
Before planning, check whether the spec contains multiple independent subsystems. If so, split into separate plans or ask the user which subsystem to plan first. One plan should produce one working, testable slice. <!-- trigger-allow: internal scope gate for standalone plan writing, not a handoff from the planning pipeline -->
|
|
15
|
+
|
|
16
|
+
## Plan location
|
|
17
|
+
|
|
18
|
+
Use the project’s stated plan location. If none exists, suggest `docs/plans/YYYY-MM-DD-<feature>.md` (or preserve an existing local convention).
|
|
19
|
+
|
|
20
|
+
## Required header
|
|
21
|
+
|
|
22
|
+
```markdown
|
|
23
|
+
# <Feature> Implementation Plan
|
|
24
|
+
|
|
25
|
+
**Goal:** <one sentence>
|
|
26
|
+
**Architecture:** <2–3 sentences about the approach and boundaries>
|
|
27
|
+
**Tech stack:** <relevant project tools/libraries>
|
|
28
|
+
**Execution note:** Work task-by-task. Use TDD where behavior changes. Verify and commit each task independently.
|
|
29
|
+
|
|
30
|
+
---
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
## Before tasks: file map
|
|
34
|
+
|
|
35
|
+
Map planned files before decomposing tasks:
|
|
36
|
+
Apply `naming-things` when choosing domain or public code names in the file map and tasks.
|
|
37
|
+
|
|
38
|
+
- Create: exact paths and responsibilities.
|
|
39
|
+
- Modify: exact paths, relevant functions/sections if known.
|
|
40
|
+
- Tests: exact test files/commands.
|
|
41
|
+
- Docs/config/migrations if applicable.
|
|
42
|
+
|
|
43
|
+
Prefer well-bounded files with clear interfaces. Follow existing project patterns; include targeted cleanup only when it directly serves this feature.
|
|
44
|
+
|
|
45
|
+
## Task shape
|
|
46
|
+
|
|
47
|
+
Each task should be small enough to implement, verify, and commit independently. Use checkbox steps.
|
|
48
|
+
|
|
49
|
+
For code changes, include:
|
|
50
|
+
|
|
51
|
+
- Failing test to write.
|
|
52
|
+
- Command to run and expected failure.
|
|
53
|
+
- Minimal implementation shape or exact code when known.
|
|
54
|
+
- Command to verify green.
|
|
55
|
+
- Commit command with explicit paths.
|
|
56
|
+
|
|
57
|
+
Never write placeholders: `TBD`, `TODO`, “add appropriate error handling”, “write tests for this”, “similar to above”, or references to functions/types not defined by earlier tasks.
|
|
58
|
+
|
|
59
|
+
## Self-review before handoff
|
|
60
|
+
|
|
61
|
+
Check:
|
|
62
|
+
|
|
63
|
+
1. Every spec requirement maps to a task.
|
|
64
|
+
2. No placeholder or vague instruction remains.
|
|
65
|
+
3. Function/type/path names are consistent across tasks.
|
|
66
|
+
4. The task order respects dependencies.
|
|
67
|
+
5. Each task has a meaningful verification command.
|
|
68
|
+
|
|
69
|
+
Fix issues inline before presenting the plan.
|
|
70
|
+
|
|
71
|
+
## Handoff
|
|
72
|
+
|
|
73
|
+
After saving the plan, offer execution modes rather than assuming one:
|
|
74
|
+
|
|
75
|
+
1. Fresh-agent/task execution, with review between tasks.
|
|
76
|
+
2. Inline execution in this session.
|
|
77
|
+
3. Stop after planning.
|
|
78
|
+
|
|
79
|
+
Do not start implementation until the user chooses or previously authorized execution.
|
package/package.json
CHANGED
|
@@ -1,6 +1,132 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "agent-concepts",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
3
|
+
"version": "0.4.0",
|
|
4
|
+
"description": "Agent skills from agent-concepts, packaged for Pi.",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"repository": {
|
|
7
|
+
"type": "git",
|
|
8
|
+
"url": "git+https://github.com/bendecastro/agent-concepts.git"
|
|
9
|
+
},
|
|
10
|
+
"keywords": [
|
|
11
|
+
"pi-package"
|
|
12
|
+
],
|
|
13
|
+
"pi": {
|
|
14
|
+
"skills": [
|
|
15
|
+
"./concepts/bc-brainstorming/body",
|
|
16
|
+
"./concepts/bc-code-review/body",
|
|
17
|
+
"./concepts/bc-codebase-design/body",
|
|
18
|
+
"./concepts/bc-codebase-docs/body",
|
|
19
|
+
"./concepts/bc-council-audit-security/body",
|
|
20
|
+
"./concepts/bc-council-chain/body",
|
|
21
|
+
"./concepts/bc-council-challenge-plan/body",
|
|
22
|
+
"./concepts/bc-council-find-bugs/body",
|
|
23
|
+
"./concepts/bc-council-improve-architecture/body",
|
|
24
|
+
"./concepts/bc-council-mode/body",
|
|
25
|
+
"./concepts/bc-delegate-investigation/body",
|
|
26
|
+
"./concepts/bc-design/body",
|
|
27
|
+
"./concepts/bc-diagnosing-bugs/body",
|
|
28
|
+
"./concepts/bc-dispatching-parallel-agents/body",
|
|
29
|
+
"./concepts/bc-domain-modeling/body",
|
|
30
|
+
"./concepts/bc-executing-plans/body",
|
|
31
|
+
"./concepts/bc-explain-visually/body",
|
|
32
|
+
"./concepts/bc-find-bugs/body",
|
|
33
|
+
"./concepts/bc-finishing-development-branch/body",
|
|
34
|
+
"./concepts/bc-grilling/body",
|
|
35
|
+
"./concepts/bc-handoff/body",
|
|
36
|
+
"./concepts/bc-improve-codebase-architecture/body",
|
|
37
|
+
"./concepts/bc-json-canvas/body",
|
|
38
|
+
"./concepts/bc-minimal-solution-ladder/body",
|
|
39
|
+
"./concepts/bc-obsidian-bases/body",
|
|
40
|
+
"./concepts/bc-obsidian-markdown/body",
|
|
41
|
+
"./concepts/bc-optimize-code/body",
|
|
42
|
+
"./concepts/bc-performance-guardrails/body",
|
|
43
|
+
"./concepts/bc-pipeline-to-done/body",
|
|
44
|
+
"./concepts/bc-plain-language/body",
|
|
45
|
+
"./concepts/bc-plan-slicing/body",
|
|
46
|
+
"./concepts/bc-plan-to-pipeline/body",
|
|
47
|
+
"./concepts/bc-prd-drafting/body",
|
|
48
|
+
"./concepts/bc-prompting-agents/body",
|
|
49
|
+
"./concepts/bc-prototype/body",
|
|
50
|
+
"./concepts/bc-qmd/body",
|
|
51
|
+
"./concepts/bc-research/body",
|
|
52
|
+
"./concepts/bc-security-audit/body",
|
|
53
|
+
"./concepts/bc-self-improve/body",
|
|
54
|
+
"./concepts/bc-seo/body",
|
|
55
|
+
"./concepts/bc-setup-project/body",
|
|
56
|
+
"./concepts/bc-subagent-driven-development/body",
|
|
57
|
+
"./concepts/bc-tdd/body",
|
|
58
|
+
"./concepts/bc-teach/body",
|
|
59
|
+
"./concepts/bc-to-spec/body",
|
|
60
|
+
"./concepts/bc-to-tickets/body",
|
|
61
|
+
"./concepts/bc-triage/body",
|
|
62
|
+
"./concepts/bc-unslop/body",
|
|
63
|
+
"./concepts/bc-using-git-worktrees/body",
|
|
64
|
+
"./concepts/bc-wiki-maintain/body",
|
|
65
|
+
"./concepts/bc-work-sync/body",
|
|
66
|
+
"./concepts/bc-writing-plans/body"
|
|
67
|
+
],
|
|
68
|
+
"extensions": [
|
|
69
|
+
"./packages/agent-kernel-pi/index.js"
|
|
70
|
+
]
|
|
71
|
+
},
|
|
72
|
+
"pi-subagents": {
|
|
73
|
+
"agents": [
|
|
74
|
+
"./concepts/bc-pipeline-to-done/body/agents"
|
|
75
|
+
]
|
|
76
|
+
},
|
|
77
|
+
"files": [
|
|
78
|
+
"concepts/bc-brainstorming/body/",
|
|
79
|
+
"concepts/bc-code-review/body/",
|
|
80
|
+
"concepts/bc-codebase-design/body/",
|
|
81
|
+
"concepts/bc-codebase-docs/body/",
|
|
82
|
+
"concepts/bc-council-audit-security/body/",
|
|
83
|
+
"concepts/bc-council-chain/body/",
|
|
84
|
+
"concepts/bc-council-challenge-plan/body/",
|
|
85
|
+
"concepts/bc-council-find-bugs/body/",
|
|
86
|
+
"concepts/bc-council-improve-architecture/body/",
|
|
87
|
+
"concepts/bc-council-mode/body/",
|
|
88
|
+
"concepts/bc-delegate-investigation/body/",
|
|
89
|
+
"concepts/bc-design/body/",
|
|
90
|
+
"concepts/bc-diagnosing-bugs/body/",
|
|
91
|
+
"concepts/bc-dispatching-parallel-agents/body/",
|
|
92
|
+
"concepts/bc-domain-modeling/body/",
|
|
93
|
+
"concepts/bc-executing-plans/body/",
|
|
94
|
+
"concepts/bc-explain-visually/body/",
|
|
95
|
+
"concepts/bc-find-bugs/body/",
|
|
96
|
+
"concepts/bc-finishing-development-branch/body/",
|
|
97
|
+
"concepts/bc-grilling/body/",
|
|
98
|
+
"concepts/bc-handoff/body/",
|
|
99
|
+
"concepts/bc-improve-codebase-architecture/body/",
|
|
100
|
+
"concepts/bc-json-canvas/body/",
|
|
101
|
+
"concepts/bc-minimal-solution-ladder/body/",
|
|
102
|
+
"concepts/bc-obsidian-bases/body/",
|
|
103
|
+
"concepts/bc-obsidian-markdown/body/",
|
|
104
|
+
"concepts/bc-optimize-code/body/",
|
|
105
|
+
"concepts/bc-performance-guardrails/body/",
|
|
106
|
+
"concepts/bc-pipeline-to-done/body/",
|
|
107
|
+
"concepts/bc-plain-language/body/",
|
|
108
|
+
"concepts/bc-plan-slicing/body/",
|
|
109
|
+
"concepts/bc-plan-to-pipeline/body/",
|
|
110
|
+
"concepts/bc-prd-drafting/body/",
|
|
111
|
+
"concepts/bc-prompting-agents/body/",
|
|
112
|
+
"concepts/bc-prototype/body/",
|
|
113
|
+
"concepts/bc-qmd/body/",
|
|
114
|
+
"concepts/bc-research/body/",
|
|
115
|
+
"concepts/bc-security-audit/body/",
|
|
116
|
+
"concepts/bc-self-improve/body/",
|
|
117
|
+
"concepts/bc-seo/body/",
|
|
118
|
+
"concepts/bc-setup-project/body/",
|
|
119
|
+
"concepts/bc-subagent-driven-development/body/",
|
|
120
|
+
"concepts/bc-tdd/body/",
|
|
121
|
+
"concepts/bc-teach/body/",
|
|
122
|
+
"concepts/bc-to-spec/body/",
|
|
123
|
+
"concepts/bc-to-tickets/body/",
|
|
124
|
+
"concepts/bc-triage/body/",
|
|
125
|
+
"concepts/bc-unslop/body/",
|
|
126
|
+
"concepts/bc-using-git-worktrees/body/",
|
|
127
|
+
"concepts/bc-wiki-maintain/body/",
|
|
128
|
+
"concepts/bc-work-sync/body/",
|
|
129
|
+
"concepts/bc-writing-plans/body/",
|
|
130
|
+
"packages/agent-kernel-pi/"
|
|
131
|
+
]
|
|
132
|
+
}
|