docs(agents): add AGENTS.md and area packs

- Add CTO/COO AGENTS.md pointing to dist prompt packs
- Add CODEOWNERS for COMMON/prompt and areas
- Add prompt_build.py used by scripts/prompts (containerized)
This commit is contained in:
2025-09-10 17:39:15 -05:00
parent d2eb0e1f79
commit 59e104a57c
5 changed files with 103 additions and 0 deletions

8
AGENTS.md Normal file
View File

@@ -0,0 +1,8 @@
Agent Guidance (Repo Base)
- Use area prompt packs generated under `dist/prompts/`:
- CTO: `dist/prompts/cto.md`
- COO: `dist/prompts/coo.md`
- To rebuild packs locally: `make prompts` (runs inside CI container).
- Keep prompts modular and concise; favor COMMON modules and minimal area deltas.

5
CODEOWNERS Normal file
View File

@@ -0,0 +1,5 @@
# Prompt packs
COMMON/prompt/** @reachableceo
CTO/** @reachableceo
COO/** @reachableceo

13
COO/AGENTS.md Normal file
View File

@@ -0,0 +1,13 @@
COO Agent Pack
Use the generated pack for agents: `dist/prompts/coo.md`.
Includes (via COMMON base):
- System persona, style, safety
- Codex CLI environment and tools
- Planning and execution principles
- Repo conventions
Notes
- COO currently uses only COMMON; areaspecific content will be added later.

13
CTO/AGENTS.md Normal file
View File

@@ -0,0 +1,13 @@
CTO Agent Pack
Use the generated pack for agents: `dist/prompts/cto.md`.
Includes (via COMMON base):
- System persona, style, safety
- Codex CLI environment and tools
- Planning and execution principles
- Repo conventions
Notes
- Keep CTOspecific additions minimal; prefer COMMON as source of truth.

64
scripts/prompt_build.py Normal file
View File

@@ -0,0 +1,64 @@
#!/usr/bin/env python3
import os, sys, yaml
def load_manifest(path):
with open(path, 'r', encoding='utf-8') as f:
return yaml.safe_load(f)
def resolve(path, seen):
m = load_manifest(path)
includes = m.get('include', []) or []
modules = m.get('modules', []) or []
for inc in includes:
resolve(inc, seen)
for mod in modules:
if mod not in seen:
seen.append(mod)
return seen
def words(s: str) -> int:
return len(s.split())
def main():
if len(sys.argv) != 3:
print("Usage: prompt_build.py <manifest> <out>", file=sys.stderr)
sys.exit(2)
manifest, out_path = sys.argv[1], sys.argv[2]
mods = resolve(manifest, [])
if not mods:
print(f"No modules resolved from {manifest}", file=sys.stderr)
sys.exit(1)
os.makedirs(os.path.dirname(out_path), exist_ok=True)
def read(p):
with open(p, 'r', encoding='utf-8') as f:
return f.read().strip() + "\n\n"
parts = ["Generated Prompt Pack\n\n"]
for m in mods:
parts.append(f"--- {m} ---\n")
parts.append(read(m))
content = "".join(parts)
# budgets
total_words = words(content)
BASE_BUDGET = 1200
if total_words > BASE_BUDGET:
print(f"ERROR: Pack exceeds budget: {total_words} > {BASE_BUDGET}", file=sys.stderr)
sys.exit(3)
ERRORS = 0
MOD_BUDGET = 400
for m in mods:
with open(m, 'r', encoding='utf-8') as f:
wc = words(f.read())
if wc > MOD_BUDGET:
print(f"ERROR: Module {m} exceeds budget: {wc} > {MOD_BUDGET}", file=sys.stderr)
ERRORS += 1
if ERRORS:
sys.exit(4)
if out_path == '-':
sys.stdout.write(content)
else:
with open(out_path, 'w', encoding='utf-8') as out:
out.write(content)
print(f"Built {out_path} with {total_words} words across {len(mods)} modules.", file=sys.stderr)
if __name__ == '__main__':
main()