strands-coder 1.3.0__tar.gz → 1.4.0__tar.gz

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 (25) hide show
  1. {strands_coder-1.3.0 → strands_coder-1.4.0}/PKG-INFO +1 -1
  2. {strands_coder-1.3.0 → strands_coder-1.4.0}/strands_coder/context.py +73 -0
  3. {strands_coder-1.3.0 → strands_coder-1.4.0}/.github/workflows/agent.yml +0 -0
  4. {strands_coder-1.3.0 → strands_coder-1.4.0}/.github/workflows/auto-release.yml +0 -0
  5. {strands_coder-1.3.0 → strands_coder-1.4.0}/.github/workflows/control.yml +0 -0
  6. {strands_coder-1.3.0 → strands_coder-1.4.0}/.gitignore +0 -0
  7. {strands_coder-1.3.0 → strands_coder-1.4.0}/LICENSE +0 -0
  8. {strands_coder-1.3.0 → strands_coder-1.4.0}/README.md +0 -0
  9. {strands_coder-1.3.0 → strands_coder-1.4.0}/SYSTEM_PROMPT.md +0 -0
  10. {strands_coder-1.3.0 → strands_coder-1.4.0}/action.yml +0 -0
  11. {strands_coder-1.3.0 → strands_coder-1.4.0}/docs/CNAME +0 -0
  12. {strands_coder-1.3.0 → strands_coder-1.4.0}/docs/index.html +0 -0
  13. {strands_coder-1.3.0 → strands_coder-1.4.0}/pyproject.toml +0 -0
  14. {strands_coder-1.3.0 → strands_coder-1.4.0}/setup-aws-oidc.sh +0 -0
  15. {strands_coder-1.3.0 → strands_coder-1.4.0}/strands_coder/__init__.py +0 -0
  16. {strands_coder-1.3.0 → strands_coder-1.4.0}/strands_coder/agent_runner.py +0 -0
  17. {strands_coder-1.3.0 → strands_coder-1.4.0}/strands_coder/tools/__init__.py +0 -0
  18. {strands_coder-1.3.0 → strands_coder-1.4.0}/strands_coder/tools/create_subagent.py +0 -0
  19. {strands_coder-1.3.0 → strands_coder-1.4.0}/strands_coder/tools/github_tools.py +0 -0
  20. {strands_coder-1.3.0 → strands_coder-1.4.0}/strands_coder/tools/projects.py +0 -0
  21. {strands_coder-1.3.0 → strands_coder-1.4.0}/strands_coder/tools/scheduler.py +0 -0
  22. {strands_coder-1.3.0 → strands_coder-1.4.0}/strands_coder/tools/store_in_kb.py +0 -0
  23. {strands_coder-1.3.0 → strands_coder-1.4.0}/strands_coder/tools/system_prompt.py +0 -0
  24. {strands_coder-1.3.0 → strands_coder-1.4.0}/strands_coder/tools/use_github.py +0 -0
  25. {strands_coder-1.3.0 → strands_coder-1.4.0}/tools/use_langfuse.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: strands-coder
3
- Version: 1.3.0
3
+ Version: 1.4.0
4
4
  Summary: Add an AI assistant to your GitHub repositories that can review code, manage issues, and improve over time.
5
5
  Project-URL: Homepage, https://github.com/cagataycali/strands-coder
6
6
  Project-URL: Bug Tracker, https://github.com/cagataycali/strands-coder/issues
@@ -783,6 +783,74 @@ def extract_user_message() -> str:
783
783
  return ""
784
784
 
785
785
 
786
+ def load_agents_md() -> str:
787
+ """
788
+ Load AGENTS.md from the workspace for project-specific rules and learnings.
789
+
790
+ Searches for AGENTS.md in:
791
+ 1. Current working directory (repo root in CI)
792
+ 2. GITHUB_WORKSPACE env var (GitHub Actions workspace)
793
+ 3. Parent directories up to 3 levels (for monorepo support)
794
+
795
+ AGENTS.md is a living document that contains:
796
+ - Code standards and non-negotiable rules
797
+ - Learnings from past reviews and bugs
798
+ - Patterns to follow for new contributions
799
+ - Self-update protocol for autonomous agents
800
+
801
+ Returns formatted markdown for injection into system prompt.
802
+ """
803
+ search_paths = []
804
+
805
+ # 1. Current working directory
806
+ cwd = Path.cwd()
807
+ search_paths.append(cwd / "AGENTS.md")
808
+
809
+ # 2. GitHub Actions workspace
810
+ workspace = os.environ.get("GITHUB_WORKSPACE")
811
+ if workspace:
812
+ search_paths.append(Path(workspace) / "AGENTS.md")
813
+
814
+ # 3. Parent directories (up to 3 levels for monorepos)
815
+ for i in range(1, 4):
816
+ parent = cwd
817
+ for _ in range(i):
818
+ parent = parent.parent
819
+ search_paths.append(parent / "AGENTS.md")
820
+
821
+ # Deduplicate while preserving order
822
+ seen: set[str] = set()
823
+ unique_paths = []
824
+ for p in search_paths:
825
+ resolved = str(p.resolve())
826
+ if resolved not in seen:
827
+ seen.add(resolved)
828
+ unique_paths.append(p)
829
+
830
+ for agents_path in unique_paths:
831
+ try:
832
+ if agents_path.exists() and agents_path.is_file():
833
+ content = agents_path.read_text(encoding="utf-8", errors="ignore")
834
+ if content.strip():
835
+ print(f"✓ AGENTS.md loaded from {agents_path} ({len(content)} chars)")
836
+ return f"""
837
+ ---
838
+ ## 📋 AGENTS.md — Project Rules & Learnings
839
+
840
+ **Source:** `{agents_path}`
841
+ **Last Modified:** {datetime.fromtimestamp(agents_path.stat().st_mtime).strftime("%Y-%m-%d %H:%M:%S")}
842
+
843
+ {content}
844
+
845
+ ---
846
+ """
847
+ except Exception as e:
848
+ print(f"⚠ Failed to read {agents_path}: {e}")
849
+ continue
850
+
851
+ return ""
852
+
853
+
786
854
  def build_system_prompt() -> str:
787
855
  """Build comprehensive system prompt from environment variables and context."""
788
856
  # Base system prompt
@@ -797,6 +865,11 @@ def build_system_prompt() -> str:
797
865
  if input_system_prompt:
798
866
  base_prompt = f"{base_prompt}\n\n{input_system_prompt}"
799
867
 
868
+ # Add AGENTS.md project rules and learnings (loaded EARLY so all context is framed by rules)
869
+ agents_md = load_agents_md()
870
+ if agents_md:
871
+ base_prompt = f"{base_prompt}\n\n{agents_md}"
872
+
800
873
  # Add rich GitHub event context (issue threads, PR reviews, etc.)
801
874
  github_event_context = fetch_github_event_context()
802
875
  if github_event_context:
File without changes
File without changes
File without changes
File without changes
File without changes