@laitszkin/apollo-toolkit 2.11.2 → 2.11.4

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 +4 -2
  2. package/CHANGELOG.md +22 -0
  3. package/README.md +3 -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 +20 -10
  13. package/maintain-skill-catalog/SKILL.md +3 -1
  14. package/open-github-issue/README.md +48 -6
  15. package/open-github-issue/SKILL.md +80 -5
  16. package/open-github-issue/agents/openai.yaml +2 -2
  17. package/open-github-issue/scripts/open_github_issue.py +174 -1
  18. package/open-github-issue/tests/test_open_github_issue.py +79 -0
  19. package/package.json +1 -1
  20. package/production-sim-debug/LICENSE +21 -0
  21. package/production-sim-debug/README.md +91 -0
  22. package/production-sim-debug/SKILL.md +131 -0
  23. package/production-sim-debug/agents/openai.yaml +4 -0
  24. package/read-github-issue/SKILL.md +99 -0
  25. package/read-github-issue/agents/openai.yaml +4 -0
  26. package/{fix-github-issues/scripts/list_issues.py → read-github-issue/scripts/find_issues.py} +1 -1
  27. package/read-github-issue/scripts/read_issue.py +108 -0
  28. package/{fix-github-issues/tests/test_list_issues.py → read-github-issue/tests/test_find_issues.py} +3 -3
  29. package/read-github-issue/tests/test_read_issue.py +109 -0
  30. package/ship-github-issue-fix/SKILL.md +65 -0
  31. package/ship-github-issue-fix/agents/openai.yaml +4 -0
  32. package/version-release/SKILL.md +4 -1
  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()
@@ -0,0 +1,65 @@
1
+ ---
2
+ name: ship-github-issue-fix
3
+ description: Resolve a GitHub issue in an existing repository and submit the fix directly to the requested branch without opening a PR or doing release work. Use when users ask to read issue N, implement the fix, decide whether planning artifacts are needed, run the relevant tests, and commit/push the result to `main` or another specified branch.
4
+ ---
5
+
6
+ # Ship GitHub Issue Fix
7
+
8
+ ## Dependencies
9
+
10
+ - Required: `read-github-issue`, `enhance-existing-features`, and `commit-and-push`.
11
+ - Conditional: `systematic-debug` when the issue is primarily a bug investigation or failing behavior report.
12
+ - Optional: none.
13
+ - Fallback: If any required dependency is unavailable, stop and report which dependency blocked the workflow.
14
+
15
+ ## Standards
16
+
17
+ - Evidence: Read the remote issue and the real implementation before deciding scope, process, or fixes.
18
+ - Execution: Prefer the repo's existing issue-reading helpers, fall back to raw `gh issue` commands when helpers are missing, use spec planning only when the actual change surface justifies it, and push directly to the user-requested branch when submission is requested.
19
+ - Quality: Treat localized bug fixes and narrow optimizations as direct implementation work unless the explored scope proves they need shared planning; finish tests, spec backfill, docs sync, and `AGENTS.md` sync before handing off submission.
20
+ - Output: Report the issue context, chosen workflow, implemented fix, validation evidence, and commit/push result.
21
+
22
+ ## Overview
23
+
24
+ Use this skill for the recurring workflow where the user wants one GitHub issue taken from remote context through implementation and direct submission. Keep the workflow tight: fetch the issue faithfully, decide whether specs are necessary from the explored codebase, finish the fix with tests, then submit without PR or release steps.
25
+
26
+ ## Workflow
27
+
28
+ ### 1) Read the issue from the remote source first
29
+
30
+ - Start with `$read-github-issue`.
31
+ - Verify the current repository matches the intended remote before reading issue content.
32
+ - Prefer bundled issue scripts, but if they are missing or fail in the repository, immediately fall back to raw `gh issue view` / `gh issue list` so issue retrieval does not block the workflow.
33
+ - Read issue body, labels, timestamps, and comments before touching code.
34
+ - Treat user phrases such as `修復 issue 123`, `參考 issue 109 優化`, or `閱讀 issue 100 並提交到 main` as triggers for this skill.
35
+
36
+ ### 2) Explore the codebase and decide whether specs are required
37
+
38
+ - After reading the issue, inspect the real entrypoints, affected modules, tests, and existing planning files.
39
+ - Run `$enhance-existing-features` to decide whether specs are required from the actual change surface.
40
+ - Default to direct implementation for clearly localized bug fixes, regressions, narrow optimizations, or small workflow corrections, even when the issue wording sounds broad.
41
+ - Require specs when the explored change touches critical money movement, permissions, high-risk concurrency, or multi-module behavior changes that need approval traceability.
42
+ - If specs are created and approved, finish all in-scope tasks and backfill them before submission.
43
+
44
+ ### 3) Implement and validate the fix completely
45
+
46
+ - Keep the fix minimal and grounded in the actual root cause.
47
+ - Reuse existing patterns instead of adding parallel abstractions.
48
+ - If the issue is a bug or failing behavior report, bring in `$systematic-debug` for reproduction, root-cause verification, and regression coverage.
49
+ - Run the most specific relevant tests first, then expand validation as needed.
50
+ - When issue context exposed prior agent mistakes, add regression or guardrail coverage so the same failure is less likely to recur.
51
+
52
+ ### 4) Submit the fix without PR or release work
53
+
54
+ - If the user asked to commit or push, hand off to `$commit-and-push`.
55
+ - Preserve the user's explicit branch target; when the user says `push to main`, treat direct push to `main` as the default goal.
56
+ - Before the final commit, ensure any required spec backfill, docs synchronization, and `AGENTS.md` alignment are completed.
57
+ - Do not convert this flow into a PR workflow unless the user explicitly requests a PR.
58
+ - Do not perform version bumps, tags, or GitHub Releases in this skill.
59
+
60
+ ### 5) Report the shipped result
61
+
62
+ - Summarize the issue number and root cause.
63
+ - State whether specs were used or intentionally skipped.
64
+ - List the key files changed, the tests run, and whether commit/push succeeded.
65
+ - Call out any remaining blocker only when one truly prevents completion.
@@ -0,0 +1,4 @@
1
+ interface:
2
+ display_name: "Ship GitHub Issue Fix"
3
+ short_description: "Fix a GitHub issue and push directly"
4
+ default_prompt: "Use $ship-github-issue-fix to read the target GitHub issue from the current repository, decide whether specs are needed, implement the fix with appropriate tests, synchronize docs and AGENTS when needed, and commit and push directly to the requested branch without PR or release steps."
@@ -15,7 +15,7 @@ description: "Guide the agent to prepare and publish a versioned release (versio
15
15
  ## Standards
16
16
 
17
17
  - Evidence: Inspect the active change set and the release range before touching version files, tags, or changelog entries.
18
- - Execution: Use this workflow only for explicit release intent, run the required quality gates when applicable, convert completed spec sets into categorized project docs before release finalization, normalize non-standard project docs when needed, then update versions, docs, commit, tag, push, and publish the GitHub release.
18
+ - Execution: Use this workflow only for explicit release intent, run the required quality gates when applicable, convert completed spec sets into categorized project docs before release finalization, normalize non-standard project docs when needed, then update versions, docs, commit, tag, push, and publish the GitHub release; run git mutations sequentially and verify both the branch tip and release tag exist remotely before publishing the GitHub release.
19
19
  - Quality: Never guess versions, align user-facing docs with actual code, convert completed planning docs into standardized categorized project docs before the release is published, and treat the `archive-specs` structure as the release-ready documentation format.
20
20
  - Output: Produce a versioned release commit and tag, publish a matching GitHub release, and keep changelog plus relevant repository documentation synchronized.
21
21
 
@@ -91,6 +91,9 @@ Load only when needed:
91
91
  - Create the version tag locally after commit.
92
92
  11. Push
93
93
  - Push commit(s) and the release tag to the current branch before publishing the GitHub release when the hosting platform requires the tag to exist remotely.
94
+ - Do not overlap `git commit`, `git tag`, `git push`, or release-publish steps; wait for each mutation to finish before starting the next one.
95
+ - After pushing, verify the remote branch tip matches local `HEAD`, and verify the release tag exists remotely via `git ls-remote --tags <remote> <tag>`.
96
+ - If any git step finishes ambiguously or the remote hashes do not match local state, rerun the missing step sequentially and re-check before publishing the GitHub release.
94
97
  12. Publish the GitHub release
95
98
  - Create a non-draft GitHub release that matches the pushed version tag.
96
99
  - Use the release notes from the new `CHANGELOG.md` entry unless the repository has a stronger established release-note source.
@@ -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."