@prateek_ai/agents-maker 1.0.0 → 1.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (68) hide show
  1. package/PROMPT_TEMPLATE.md +143 -0
  2. package/README.md +92 -25
  3. package/agents/brain.md +90 -0
  4. package/agents/orchestrator.md +24 -3
  5. package/agents/planpro.md +91 -0
  6. package/bin/cli.js +40 -4
  7. package/claude/agents/architect.md +182 -0
  8. package/claude/agents/brain.md +97 -0
  9. package/claude/agents/code.md +185 -0
  10. package/claude/agents/compress.md +233 -0
  11. package/claude/agents/execute.md +164 -0
  12. package/claude/agents/orchestrate.md +434 -0
  13. package/claude/agents/planpro.md +98 -0
  14. package/claude/agents/review.md +141 -0
  15. package/claude/agents/ui.md +154 -0
  16. package/claude/agents/ux.md +151 -0
  17. package/claude/commands/architect.md +15 -0
  18. package/claude/commands/brain.md +15 -0
  19. package/claude/commands/code.md +15 -0
  20. package/claude/commands/compress.md +15 -0
  21. package/claude/commands/execute.md +15 -0
  22. package/claude/commands/orchestrate.md +15 -0
  23. package/claude/commands/planpro.md +15 -0
  24. package/claude/commands/review.md +15 -0
  25. package/claude/commands/ui.md +15 -0
  26. package/claude/commands/ux.md +15 -0
  27. package/config/agents.yaml +56 -0
  28. package/context_loaders/project_summary.py +5 -0
  29. package/docs/architecture.md +318 -0
  30. package/docs/domains.md +154 -0
  31. package/docs/workflows.md +548 -0
  32. package/examples/generic_project_lifecycle.md +518 -0
  33. package/examples/proof/README.md +138 -0
  34. package/examples/proof/implement-a-python-function-that-parses-an-iso-8/grade.md +14 -0
  35. package/examples/proof/implement-a-python-function-that-parses-an-iso-8/naive_output.md +211 -0
  36. package/examples/proof/implement-a-python-function-that-parses-an-iso-8/naive_prompt.txt +1 -0
  37. package/examples/proof/implement-a-python-function-that-parses-an-iso-8/structured_output.md +210 -0
  38. package/examples/proof/implement-a-python-function-that-parses-an-iso-8/structured_user.txt +35 -0
  39. package/examples/proof/write-a-runbook-for-recovering-from-a-redis-prim/grade.md +14 -0
  40. package/examples/proof/write-a-runbook-for-recovering-from-a-redis-prim/naive_output.md +274 -0
  41. package/examples/proof/write-a-runbook-for-recovering-from-a-redis-prim/naive_prompt.txt +1 -0
  42. package/examples/proof/write-a-runbook-for-recovering-from-a-redis-prim/structured_output.md +127 -0
  43. package/examples/proof/write-a-runbook-for-recovering-from-a-redis-prim/structured_user.txt +35 -0
  44. package/package.json +10 -2
  45. package/platforms/antigravity.md +195 -0
  46. package/platforms/claude.md +305 -0
  47. package/platforms/openai.md +333 -0
  48. package/skills/analyze_repo.md +86 -86
  49. package/token_optimization/compressor.py +4 -7
  50. package/tools/_core.py +102 -0
  51. package/tools/compare_prompts.py +196 -0
  52. package/tools/generate_claude_agents.py +162 -0
  53. package/tools/generate_claude_md.py +14 -80
  54. package/tools/generate_platform_configs.py +26 -36
  55. package/tools/generate_prompt.py +79 -79
  56. package/tools/grade_proof.py +118 -0
  57. package/tools/init_project.py +11 -58
  58. package/tools/routing.py +103 -0
  59. package/tools/test_kit.py +392 -363
  60. package/tools/validate_kit.py +15 -43
  61. package/context_loaders/__pycache__/__init__.cpython-314.pyc +0 -0
  62. package/context_loaders/__pycache__/file_chunker.cpython-314.pyc +0 -0
  63. package/context_loaders/__pycache__/project_summary.cpython-314.pyc +0 -0
  64. package/context_loaders/__pycache__/repo_tree.cpython-314.pyc +0 -0
  65. package/token_optimization/__pycache__/compressor.cpython-314.pyc +0 -0
  66. package/tools/__pycache__/domain_utils.cpython-314.pyc +0 -0
  67. package/tools/__pycache__/generate_claude_md.cpython-314.pyc +0 -0
  68. package/tools/__pycache__/validate_kit.cpython-314.pyc +0 -0
@@ -25,7 +25,6 @@ Requires pyyaml (pip install pyyaml).
25
25
 
26
26
  from __future__ import annotations
27
27
 
28
- import hashlib
29
28
  import re
30
29
  import sys
31
30
  from pathlib import Path
@@ -34,6 +33,15 @@ __version__ = "1.0.0"
34
33
 
35
34
  ROOT = Path(__file__).parent.parent
36
35
 
36
+ # Allow sibling imports (domain_utils, _core) whether run as a script or module.
37
+ sys.path.insert(0, str(Path(__file__).resolve().parent))
38
+ try:
39
+ from tools._core import source_hash
40
+ from tools.domain_utils import score_domain
41
+ except ImportError:
42
+ from _core import source_hash
43
+ from domain_utils import score_domain
44
+
37
45
 
38
46
  # ---------------------------------------------------------------------------
39
47
  # Helpers
@@ -204,7 +212,8 @@ def check_output_styles(policy_cfg: dict) -> None:
204
212
  if isinstance(val, dict) and "output_style" in val:
205
213
  refs.add(val["output_style"])
206
214
 
207
- lifecycle = policy_cfg.get("generic_project_lifecycle") or {}
215
+ # generic_project_lifecycle is nested under workflows: in token_policies.yaml.
216
+ lifecycle = (policy_cfg.get("workflows") or {}).get("generic_project_lifecycle") or {}
208
217
  for phase_key, phase_val in (lifecycle.get("phases") or {}).items():
209
218
  if isinstance(phase_val, dict) and "output_style" in phase_val:
210
219
  refs.add(phase_val["output_style"])
@@ -236,40 +245,15 @@ SCORING_TESTS = [
236
245
  ]
237
246
 
238
247
 
239
- def _score(message: str, domains: dict, settings: dict) -> tuple[str, str]:
240
- msg_lower = message.lower()
241
- scores: dict[str, float] = {}
242
- for d, cfg in domains.items():
243
- if d == "general":
244
- continue
245
- strong = cfg.get("detection_signals", {}).get("strong", [])
246
- weak = cfg.get("detection_signals", {}).get("weak", [])
247
- s = sum(1.0 for sig in strong if sig in msg_lower)
248
- w = sum(0.4 for sig in weak if sig in msg_lower)
249
- scores[d] = (s + w) / 3
250
-
251
- ranked = sorted(scores.items(), key=lambda x: -x[1])
252
- top_d, top_s = ranked[0] if ranked else ("general", 0.0)
253
- sec_d, sec_s = ranked[1] if len(ranked) > 1 else ("general", 0.0)
254
-
255
- conf_t = settings.get("confidence_threshold", 0.40)
256
- amb_t = settings.get("ambiguity_threshold", 0.10)
257
-
258
- if top_s < conf_t:
259
- return "general", "low"
260
- elif (top_s - sec_s) < amb_t:
261
- return top_d, "medium"
262
- else:
263
- return top_d, "high"
264
-
265
-
266
248
  def check_domain_scoring(domain_cfg: dict) -> None:
249
+ # Uses the shared scorer (domain_utils.score_domain) — the same code the
250
+ # runtime tools use — so this check can never validate a stale copy.
267
251
  print("\n--- Domain Detection Scoring ---")
268
252
  domains = domain_cfg.get("domains") or {}
269
253
  settings = domain_cfg.get("settings") or {}
270
254
  passed = 0
271
255
  for exp_domain, exp_conf, msg in SCORING_TESTS:
272
- got_domain, got_conf = _score(msg, domains, settings)
256
+ got_domain, got_conf = score_domain(msg, domains, settings)
273
257
  if got_domain == exp_domain and got_conf == exp_conf:
274
258
  passed += 1
275
259
  else:
@@ -417,18 +401,6 @@ def check_file_inventory() -> None:
417
401
  # Check 12 — system_prompt.md freshness
418
402
  # ---------------------------------------------------------------------------
419
403
 
420
- def _compute_source_hash(root: Path) -> str:
421
- h = hashlib.sha256()
422
- agent_files = sorted((root / "agents").glob("*.md")) if (root / "agents").is_dir() else []
423
- skill_files = sorted((root / "skills").glob("*.md")) if (root / "skills").is_dir() else []
424
- for path in agent_files + skill_files:
425
- try:
426
- h.update(path.read_bytes().replace(b"\r\n", b"\n"))
427
- except (OSError, PermissionError):
428
- pass
429
- return h.hexdigest()[:16]
430
-
431
-
432
404
  def check_system_prompt_freshness() -> None:
433
405
  print("\n--- system_prompt.md Freshness ---")
434
406
  sp_path = ROOT / "system_prompt.md"
@@ -448,7 +420,7 @@ def check_system_prompt_freshness() -> None:
448
420
  return
449
421
 
450
422
  stored = m.group(1)
451
- current = _compute_source_hash(ROOT)
423
+ current = source_hash(ROOT)
452
424
  if stored != current:
453
425
  fail(
454
426
  f"system_prompt.md is stale (stored hash {stored} != current {current}). "