@laitszkin/apollo-toolkit 2.11.1 → 2.11.3

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 (34) hide show
  1. package/AGENTS.md +2 -2
  2. package/CHANGELOG.md +18 -0
  3. package/README.md +2 -2
  4. package/analyse-app-logs/README.md +12 -0
  5. package/analyse-app-logs/SKILL.md +6 -1
  6. package/analyse-app-logs/agents/openai.yaml +1 -1
  7. package/analyse-app-logs/scripts/filter_logs_by_time.py +64 -0
  8. package/analyse-app-logs/scripts/log_cli_utils.py +112 -0
  9. package/analyse-app-logs/scripts/search_logs.py +137 -0
  10. package/analyse-app-logs/tests/test_filter_logs_by_time.py +95 -0
  11. package/analyse-app-logs/tests/test_search_logs.py +100 -0
  12. package/commit-and-push/SKILL.md +17 -10
  13. package/develop-new-features/SKILL.md +17 -4
  14. package/develop-new-features/references/testing-e2e.md +1 -0
  15. package/enhance-existing-features/SKILL.md +20 -4
  16. package/enhance-existing-features/references/e2e-tests.md +1 -0
  17. package/generate-spec/SKILL.md +18 -3
  18. package/generate-spec/references/templates/checklist.md +30 -6
  19. package/generate-spec/references/templates/spec.md +7 -2
  20. package/maintain-skill-catalog/SKILL.md +3 -1
  21. package/open-github-issue/README.md +48 -6
  22. package/open-github-issue/SKILL.md +80 -5
  23. package/open-github-issue/agents/openai.yaml +2 -2
  24. package/open-github-issue/scripts/open_github_issue.py +174 -1
  25. package/open-github-issue/tests/test_open_github_issue.py +79 -0
  26. package/package.json +1 -1
  27. package/read-github-issue/SKILL.md +83 -0
  28. package/read-github-issue/agents/openai.yaml +4 -0
  29. package/{fix-github-issues/scripts/list_issues.py → read-github-issue/scripts/find_issues.py} +1 -1
  30. package/read-github-issue/scripts/read_issue.py +108 -0
  31. package/{fix-github-issues/tests/test_list_issues.py → read-github-issue/tests/test_find_issues.py} +3 -3
  32. package/read-github-issue/tests/test_read_issue.py +109 -0
  33. package/fix-github-issues/SKILL.md +0 -105
  34. package/fix-github-issues/agents/openai.yaml +0 -4
@@ -0,0 +1,109 @@
1
+ #!/usr/bin/env python3
2
+
3
+ from __future__ import annotations
4
+
5
+ import importlib.util
6
+ import io
7
+ import json
8
+ import unittest
9
+ from argparse import Namespace
10
+ from pathlib import Path
11
+ from unittest.mock import patch
12
+
13
+
14
+ SCRIPT_PATH = Path(__file__).resolve().parents[1] / "scripts" / "read_issue.py"
15
+ SPEC = importlib.util.spec_from_file_location("read_issue", SCRIPT_PATH)
16
+ MODULE = importlib.util.module_from_spec(SPEC)
17
+ SPEC.loader.exec_module(MODULE)
18
+
19
+
20
+ class ReadIssueTests(unittest.TestCase):
21
+ def test_build_command_with_repo(self) -> None:
22
+ args = Namespace(issue="123", repo="owner/repo", comments=False, json=False)
23
+
24
+ self.assertEqual(
25
+ MODULE.build_command(args),
26
+ [
27
+ "gh",
28
+ "issue",
29
+ "view",
30
+ "123",
31
+ "--json",
32
+ MODULE.ISSUE_FIELDS,
33
+ "--repo",
34
+ "owner/repo",
35
+ ],
36
+ )
37
+
38
+ def test_main_returns_error_when_gh_missing(self) -> None:
39
+ args = Namespace(issue="123", repo=None, comments=False, json=False)
40
+
41
+ with patch.object(MODULE, "parse_args", return_value=args), patch(
42
+ "subprocess.run", side_effect=FileNotFoundError
43
+ ), patch("sys.stderr", new_callable=io.StringIO) as stderr:
44
+ code = MODULE.main()
45
+
46
+ self.assertEqual(code, 1)
47
+ self.assertIn("not in PATH", stderr.getvalue())
48
+
49
+ def test_main_json_output(self) -> None:
50
+ args = Namespace(issue="123", repo=None, comments=False, json=True)
51
+ payload = {
52
+ "number": 123,
53
+ "title": "Need better retries",
54
+ "body": "detail",
55
+ "state": "OPEN",
56
+ "author": {"login": "octocat"},
57
+ "labels": [],
58
+ "assignees": [],
59
+ "comments": [],
60
+ "createdAt": "2026-03-24T00:00:00Z",
61
+ "updatedAt": "2026-03-24T01:00:00Z",
62
+ "closedAt": None,
63
+ "url": "https://github.com/owner/repo/issues/123",
64
+ }
65
+
66
+ class Result:
67
+ stdout = json.dumps(payload)
68
+
69
+ with patch.object(MODULE, "parse_args", return_value=args), patch(
70
+ "subprocess.run", return_value=Result()
71
+ ), patch("sys.stdout", new_callable=io.StringIO) as stdout:
72
+ code = MODULE.main()
73
+
74
+ self.assertEqual(code, 0)
75
+ self.assertEqual(json.loads(stdout.getvalue()), payload)
76
+
77
+ def test_print_summary_includes_comments(self) -> None:
78
+ issue = {
79
+ "number": 123,
80
+ "title": "Need better retries",
81
+ "body": "detail",
82
+ "state": "OPEN",
83
+ "author": {"login": "octocat"},
84
+ "labels": [{"name": "bug"}],
85
+ "assignees": [{"login": "alice"}],
86
+ "comments": [
87
+ {
88
+ "author": {"login": "bob"},
89
+ "createdAt": "2026-03-24T02:00:00Z",
90
+ "body": "extra context",
91
+ }
92
+ ],
93
+ "createdAt": "2026-03-24T00:00:00Z",
94
+ "updatedAt": "2026-03-24T01:00:00Z",
95
+ "closedAt": None,
96
+ "url": "https://github.com/owner/repo/issues/123",
97
+ }
98
+
99
+ with patch("sys.stdout", new_callable=io.StringIO) as stdout:
100
+ MODULE.print_summary(issue, include_comments=True)
101
+
102
+ output = stdout.getvalue()
103
+ self.assertIn("#123", output)
104
+ self.assertIn("bug", output)
105
+ self.assertIn("extra context", output)
106
+
107
+
108
+ if __name__ == "__main__":
109
+ unittest.main()
@@ -1,105 +0,0 @@
1
- ---
2
- name: fix-github-issues
3
- description: Resolve issues from remote GitHub repositories via GitHub CLI (`gh`), implement and validate fixes locally, then either open a pull request through `open-source-pr-workflow` (or `open-pr-workflow` in environments that use that alias) or hand off to `commit-and-push` when the user explicitly wants a direct push. Use when users ask to list remote issues, pick one or more issues to fix, and deliver the result through a linked PR or an explicit direct-push workflow.
4
- ---
5
-
6
- # Fix GitHub Issues
7
-
8
- ## Dependencies
9
-
10
- - Required: `systematic-debug` for diagnosis and validated fixes.
11
- - Conditional: `open-source-pr-workflow` (or `open-pr-workflow`) when the user wants a PR; `commit-and-push` when the user explicitly wants a direct commit/push flow.
12
- - Optional: none.
13
- - Fallback: If the required handoff for the user's requested delivery mode is unavailable, stop and report the blocked dependency instead of improvising another release path.
14
-
15
- ## Standards
16
-
17
- - Evidence: Verify repository context, fetch remote issue details, and derive expected behavior from issue text before coding.
18
- - Execution: Select the issue, open an isolated worktree by default, fix it through `systematic-debug`, validate locally, then hand off to the delivery workflow that matches the user's request.
19
- - Quality: Keep scope limited to the selected issue, capture exact validation commands, preserve issue linkage in the final PR or commit message, and treat temporary worktree cleanup as part of completion rather than an optional follow-up.
20
- - Output: Finish with either a linked PR or a direct pushed commit, then clean up the temporary worktree plus any matching local branch before reporting completion.
21
-
22
- ## Overview
23
-
24
- Use this skill to run an end-to-end issue-fixing loop with `gh`: discover open issues, select a target, implement and test the fix, then hand off either to `open-source-pr-workflow` for PR submission or to `commit-and-push` when the user explicitly wants a direct push.
25
-
26
- ## Prerequisites
27
-
28
- - `gh` is installed and authenticated (`gh auth status`).
29
- - The current directory is a git repository with the correct `origin`.
30
- - The repository has test or validation commands that can prove the fix.
31
-
32
- ## Workflow
33
-
34
- ### 1) Verify repository and remote context
35
-
36
- - Run `gh repo view --json nameWithOwner,isPrivate,defaultBranchRef` to confirm target repo.
37
- - If the user specifies another repository, always use `--repo <owner>/<repo>` in issue commands.
38
- - Run `git fetch --all --prune` before implementation.
39
-
40
- ### 2) List remote issues with GitHub CLI
41
-
42
- - Preferred command:
43
-
44
- ```bash
45
- python3 scripts/list_issues.py --limit 50 --state open
46
- ```
47
-
48
- - Optional filters:
49
- - `--repo owner/name`
50
- - `--label bug`
51
- - `--search "panic in parser"`
52
- - If the issue target is still unclear, present top candidates and ask the user which issue number to fix.
53
-
54
- ### 3) Read issue details before coding
55
-
56
- - Run `gh issue view <issue-number> --comments` (plus `--repo` when needed).
57
- - Identify expected behavior, edge cases, and acceptance signals from issue text/comments.
58
- - Do not guess missing requirements; ask the user when critical details are ambiguous.
59
-
60
- ### 4) Open worktree by default after issue selection
61
-
62
- - Immediately create and enter an isolated worktree once the issue number is selected and confirmed.
63
- - Use a compliant branch name (`codex/{change_type}/{changes}`) and keep all edits in that worktree.
64
- - If the user explicitly asks to stay in the current tree, follow that request; otherwise worktree is the default path.
65
-
66
- ### 5) Implement the fix with `systematic-debug`
67
-
68
- - Execute the `systematic-debug` workflow: inspect, reproduce with tests, diagnose, then apply minimal fix.
69
- - Keep scope limited to the selected issue.
70
- - Reuse existing code patterns and avoid unrelated refactors.
71
-
72
- ### 6) Validate the fix
73
-
74
- - Run focused tests/lint/build relevant to the touched area.
75
- - Capture exact commands and outcomes; these will be reused in the PR body.
76
- - Ensure the change can be linked back to the issue number.
77
-
78
- ### 7) Open PR via dependency skill
79
-
80
- - If the user explicitly asks to commit and push directly, invoke `commit-and-push` instead of opening a PR.
81
- - In direct-push mode:
82
- - keep the issue number in the commit message or final summary when appropriate
83
- - state the exact target branch the user requested
84
- - push only after validation is complete
85
- - Otherwise invoke `open-source-pr-workflow` (or `open-pr-workflow` if that alias exists in the environment).
86
- - In PR mode, provide:
87
- - issue number or link
88
- - motivation and engineering decisions
89
- - executed test commands and results
90
- - Include issue-closing reference (for example, `Closes #<issue-number>`) whenever a PR is opened.
91
-
92
- ### 8) Clean up the temporary worktree after PR creation or direct push
93
-
94
- - Once the PR is opened or the direct push is complete and no more work is needed in that isolated tree, remove the worktree you created for the fix.
95
- - Also clean up the matching local branch reference if it is no longer needed locally.
96
- - Verify the cleanup with `git worktree list` and confirm the temporary path no longer appears before finishing.
97
- - If the worktree cannot be removed because of uncommitted changes or a still-checked-out branch, resolve that state immediately instead of leaving cleanup for a later user request.
98
-
99
- ## Included Script
100
-
101
- ### `scripts/list_issues.py`
102
-
103
- - Purpose: consistent remote issue listing via `gh issue list`.
104
- - Outputs a readable table by default, or JSON with `--output json`.
105
- - Uses only GitHub CLI so it reflects remote GitHub state.
@@ -1,4 +0,0 @@
1
- interface:
2
- display_name: "Fix GitHub Issues"
3
- short_description: "Resolve remote GitHub issues, then open a PR or push directly"
4
- default_prompt: "Use $fix-github-issues to verify the target GitHub repository with gh, list and inspect remote issues, create an isolated worktree and compliant branch after issue selection, use $systematic-debug to reproduce and fix the issue with tests, validate the result, then either hand off to $open-source-pr-workflow for a linked PR or to $commit-and-push when the user explicitly wants a direct push, and finally delete the temporary worktree."