@homericintelligence/athena-opencode 0.4.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.
- package/LICENSE +29 -0
- package/NOTICE +22 -0
- package/README.md +45 -0
- package/package.json +29 -0
- package/plugin.js +54 -0
- package/skills/THIRD_PARTY_LICENSES.md +50 -0
- package/skills/_cli.py +152 -0
- package/skills/advise/SKILL.md +62 -0
- package/skills/advise/scripts/list_retrievable_skills.py +49 -0
- package/skills/brainstorm/SKILL.md +110 -0
- package/skills/change-review/SKILL.md +68 -0
- package/skills/change-review/references/scope-resolution.md +52 -0
- package/skills/change-review/scripts/resolve_scope.py +1219 -0
- package/skills/finalize-plan/SKILL.md +129 -0
- package/skills/git-worktrees/SKILL.md +113 -0
- package/skills/git-worktrees/scripts/prepare_worktree.py +153 -0
- package/skills/issue-review/SKILL.md +67 -0
- package/skills/learn/SKILL.md +208 -0
- package/skills/myrmidon-swarm/SKILL.md +93 -0
- package/skills/plan-issue/SKILL.md +70 -0
- package/skills/pr-review/SKILL.md +114 -0
- package/skills/pr-review/references/criteria.md +26 -0
- package/skills/pr-review/references/delivery.md +135 -0
- package/skills/pr-review/references/evidence.md +233 -0
- package/skills/pr-review/references/prevalidated.md +155 -0
- package/skills/pr-review/scripts/collect_evidence.py +1478 -0
- package/skills/pr-review/scripts/diff_context.py +74 -0
- package/skills/pr-review/scripts/materialize_snapshot.py +731 -0
- package/skills/pr-review/scripts/pr_identity.py +80 -0
- package/skills/pr-review/scripts/resolve_pr.py +258 -0
- package/skills/repo-review/SKILL.md +119 -0
- package/skills/systematic-debugging/SKILL.md +199 -0
- package/skills/systematic-debugging/scripts/repository_evidence.py +77 -0
- package/skills/test-driven-development/SKILL.md +75 -0
- package/skills/tidy/SKILL.md +71 -0
- package/skills/tidy/scripts/run_tidy.py +43 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
BSD 3-Clause License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025, Micah Villmow
|
|
4
|
+
All rights reserved.
|
|
5
|
+
|
|
6
|
+
Redistribution and use in source and binary forms, with or without
|
|
7
|
+
modification, are permitted provided that the following conditions are met:
|
|
8
|
+
|
|
9
|
+
1. Redistributions of source code must retain the above copyright notice,
|
|
10
|
+
this list of conditions and the following disclaimer.
|
|
11
|
+
|
|
12
|
+
2. Redistributions in binary form must reproduce the above copyright notice,
|
|
13
|
+
this list of conditions and the following disclaimer in the documentation
|
|
14
|
+
and/or other materials provided with the distribution.
|
|
15
|
+
|
|
16
|
+
3. Neither the name of the copyright holder nor the names of its contributors
|
|
17
|
+
may be used to endorse or promote products derived from this software
|
|
18
|
+
without specific prior written permission.
|
|
19
|
+
|
|
20
|
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
|
21
|
+
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
22
|
+
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
|
23
|
+
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
|
24
|
+
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
25
|
+
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
|
26
|
+
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
|
27
|
+
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
|
28
|
+
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
29
|
+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
package/NOTICE
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
Athena
|
|
2
|
+
Copyright (c) HomericIntelligence contributors. All rights reserved.
|
|
3
|
+
|
|
4
|
+
Athena is distributed under BSD-3-Clause. See LICENSE.
|
|
5
|
+
|
|
6
|
+
Required repositories
|
|
7
|
+
---------------------
|
|
8
|
+
|
|
9
|
+
Athena resolves Mnemosyne for knowledge and Hephaestus for automation. Their contents are cloned
|
|
10
|
+
and used separately under their own licenses; they are not copied into Athena's plugin archive.
|
|
11
|
+
|
|
12
|
+
Third-party skill attribution
|
|
13
|
+
-----------------------------
|
|
14
|
+
|
|
15
|
+
Several skills are adapted from obra/superpowers under the MIT License. The mapping, copyright,
|
|
16
|
+
source, and full license text are preserved in skills/THIRD_PARTY_LICENSES.md.
|
|
17
|
+
|
|
18
|
+
Trademarks
|
|
19
|
+
----------
|
|
20
|
+
|
|
21
|
+
"HomericIntelligence", "Athena", "Mnemosyne", "Hephaestus", and "Myrmidons" identify their
|
|
22
|
+
respective projects or themes and are not claims of endorsement by third parties.
|
package/README.md
ADDED
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
# athena-opencode
|
|
2
|
+
|
|
3
|
+
[Athena](https://github.com/HomericIntelligence/Athena) workflow skills packaged as an
|
|
4
|
+
[opencode](https://opencode.ai) plugin. Installing this plugin places the full canonical skill
|
|
5
|
+
corpus under your opencode configuration directory, where opencode discovers and loads it natively.
|
|
6
|
+
|
|
7
|
+
## Install
|
|
8
|
+
|
|
9
|
+
Add the package to the `plugin` array of your opencode configuration
|
|
10
|
+
(`~/.config/opencode/opencode.json` or a project `opencode.json`):
|
|
11
|
+
|
|
12
|
+
```json
|
|
13
|
+
{
|
|
14
|
+
"$schema": "https://opencode.ai/config.json",
|
|
15
|
+
"plugin": ["@homericintelligence/athena-opencode"]
|
|
16
|
+
}
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
Quit and restart opencode. On startup the plugin copies the bundled `skills/` corpus to:
|
|
20
|
+
|
|
21
|
+
```
|
|
22
|
+
$XDG_CONFIG_HOME/opencode/skills/athena/
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
(`~/.config/opencode/skills/athena/` by default.) The plugin only ever writes inside that
|
|
26
|
+
`athena/` namespace; other skills in your configuration are never touched. Each restart refreshes
|
|
27
|
+
the namespace to match the installed plugin version, so upgrading the npm package upgrades the
|
|
28
|
+
skills.
|
|
29
|
+
|
|
30
|
+
## Use
|
|
31
|
+
|
|
32
|
+
Invoke skills through opencode's native skill mechanism, for example by asking opencode to use the
|
|
33
|
+
`repo-review`, `pr-review`, or `plan-issue` skill. See the root
|
|
34
|
+
[`README.md`](https://github.com/HomericIntelligence/Athena#readme) for the full skill catalog,
|
|
35
|
+
dependency requirements (Git, Python 3.13, authenticated `gh` for forge routes), and capability
|
|
36
|
+
fallbacks.
|
|
37
|
+
|
|
38
|
+
## Uninstall
|
|
39
|
+
|
|
40
|
+
Remove `"@homericintelligence/athena-opencode"` from the `plugin` array, restart opencode, and delete
|
|
41
|
+
`opencode/skills/athena/` from your configuration directory if you want the files gone immediately.
|
|
42
|
+
|
|
43
|
+
## License
|
|
44
|
+
|
|
45
|
+
BSD-3-Clause. See `LICENSE` and `NOTICE`.
|
package/package.json
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@homericintelligence/athena-opencode",
|
|
3
|
+
"version": "0.4.4",
|
|
4
|
+
"description": "Athena workflow skills packaged as an opencode plugin.",
|
|
5
|
+
"license": "BSD-3-Clause",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"main": "plugin.js",
|
|
8
|
+
"files": [
|
|
9
|
+
"plugin.js",
|
|
10
|
+
"skills",
|
|
11
|
+
"README.md",
|
|
12
|
+
"LICENSE",
|
|
13
|
+
"NOTICE"
|
|
14
|
+
],
|
|
15
|
+
"repository": {
|
|
16
|
+
"type": "git",
|
|
17
|
+
"url": "https://github.com/HomericIntelligence/Athena"
|
|
18
|
+
},
|
|
19
|
+
"homepage": "https://github.com/HomericIntelligence/Athena",
|
|
20
|
+
"bugs": "https://github.com/HomericIntelligence/Athena/issues",
|
|
21
|
+
"keywords": [
|
|
22
|
+
"opencode",
|
|
23
|
+
"opencode-plugin",
|
|
24
|
+
"athena",
|
|
25
|
+
"agents",
|
|
26
|
+
"skills"
|
|
27
|
+
],
|
|
28
|
+
"private": false
|
|
29
|
+
}
|
package/plugin.js
ADDED
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { cpSync, existsSync, mkdirSync, readdirSync, rmSync } from "node:fs";
|
|
2
|
+
import { homedir } from "node:os";
|
|
3
|
+
import { dirname, join, resolve } from "node:path";
|
|
4
|
+
import { fileURLToPath } from "node:url";
|
|
5
|
+
|
|
6
|
+
const NAMESPACE = "athena";
|
|
7
|
+
|
|
8
|
+
function bundledSkillsRoot() {
|
|
9
|
+
return fileURLToPath(new URL("./skills/", import.meta.url));
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
function configBase() {
|
|
13
|
+
const override = process.env.XDG_CONFIG_HOME;
|
|
14
|
+
if (override !== undefined && override !== "") {
|
|
15
|
+
return resolve(override);
|
|
16
|
+
}
|
|
17
|
+
return join(homedir(), ".config");
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
function installTarget() {
|
|
21
|
+
return join(configBase(), "opencode", "skills", NAMESPACE);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export function syncSkills() {
|
|
25
|
+
const source = bundledSkillsRoot();
|
|
26
|
+
const target = installTarget();
|
|
27
|
+
if (!existsSync(join(source, "_cli.py"))) {
|
|
28
|
+
throw new Error(
|
|
29
|
+
`Athena skill corpus is missing next to plugin.js: ${source}`,
|
|
30
|
+
);
|
|
31
|
+
}
|
|
32
|
+
mkdirSync(dirname(target), { recursive: true });
|
|
33
|
+
rmSync(target, { recursive: true, force: true });
|
|
34
|
+
cpSync(source, target, { recursive: true });
|
|
35
|
+
return target;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
async function athenaPlugin() {
|
|
39
|
+
try {
|
|
40
|
+
syncSkills();
|
|
41
|
+
} catch (error) {
|
|
42
|
+
console.warn(`[athena-opencode] skill installation failed: ${error}`);
|
|
43
|
+
}
|
|
44
|
+
return {};
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
export default athenaPlugin;
|
|
48
|
+
|
|
49
|
+
export function bundledSkillNames() {
|
|
50
|
+
return readdirSync(bundledSkillsRoot(), { withFileTypes: true })
|
|
51
|
+
.filter((entry) => entry.isDirectory())
|
|
52
|
+
.map((entry) => entry.name)
|
|
53
|
+
.sort();
|
|
54
|
+
}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
# Third-Party Licenses
|
|
2
|
+
|
|
3
|
+
## obra/superpowers
|
|
4
|
+
|
|
5
|
+
Several skills in this directory were adapted from [obra/superpowers](https://github.com/obra/superpowers),
|
|
6
|
+
a Claude Code skills framework by Jesse Vincent / Prime Radiant.
|
|
7
|
+
|
|
8
|
+
**Source repository:** <https://github.com/obra/superpowers>
|
|
9
|
+
**License:** MIT License
|
|
10
|
+
**Copyright:** Copyright (c) 2025 Jesse Vincent
|
|
11
|
+
|
|
12
|
+
### Derived Skills
|
|
13
|
+
|
|
14
|
+
The following skills were adapted from obra/superpowers source material:
|
|
15
|
+
|
|
16
|
+
| Athena Skill | Source Skill(s) |
|
|
17
|
+
| --- | --- |
|
|
18
|
+
| `test-driven-development` | `skills/test-driven-development/SKILL.md` |
|
|
19
|
+
| `systematic-debugging` | `skills/systematic-debugging/SKILL.md` |
|
|
20
|
+
| `git-worktrees` | `skills/using-git-worktrees/SKILL.md` |
|
|
21
|
+
| `brainstorm` | `skills/brainstorming/SKILL.md` |
|
|
22
|
+
|
|
23
|
+
Each derived skill has been modified for Athena's host-neutral invocation, local policy, mandatory
|
|
24
|
+
knowledge workflow, and Greek-themed orchestration.
|
|
25
|
+
|
|
26
|
+
---
|
|
27
|
+
|
|
28
|
+
### Full MIT License Text
|
|
29
|
+
|
|
30
|
+
MIT License
|
|
31
|
+
|
|
32
|
+
Copyright (c) 2025 Jesse Vincent
|
|
33
|
+
|
|
34
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
35
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
36
|
+
in the Software without restriction, including without limitation the rights
|
|
37
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
38
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
39
|
+
furnished to do so, subject to the following conditions:
|
|
40
|
+
|
|
41
|
+
The above copyright notice and this permission notice shall be included in all
|
|
42
|
+
copies or substantial portions of the Software.
|
|
43
|
+
|
|
44
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
45
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
46
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
47
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
48
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
49
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
50
|
+
SOFTWARE.
|
package/skills/_cli.py
ADDED
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
"""Shared argparse construction for Athena's executable helpers."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
import argparse
|
|
6
|
+
import json
|
|
7
|
+
import os
|
|
8
|
+
import subprocess
|
|
9
|
+
from collections.abc import Sequence
|
|
10
|
+
from pathlib import Path
|
|
11
|
+
from typing import Any
|
|
12
|
+
|
|
13
|
+
PLUGIN_ROOT = Path(__file__).resolve().parent.parent
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
def run_command(
|
|
17
|
+
arguments: Sequence[str], **kwargs: Any
|
|
18
|
+
) -> subprocess.CompletedProcess[str]:
|
|
19
|
+
"""Run an external command or identify a missing required capability."""
|
|
20
|
+
if not arguments:
|
|
21
|
+
raise RuntimeError("required command is empty")
|
|
22
|
+
try:
|
|
23
|
+
check = kwargs.pop("check", False)
|
|
24
|
+
return subprocess.run(arguments, check=check, **kwargs)
|
|
25
|
+
except FileNotFoundError as error:
|
|
26
|
+
command = error.filename or arguments[0]
|
|
27
|
+
raise RuntimeError(f"required command unavailable: {command}") from error
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
def git_read_environment() -> dict[str, str]:
|
|
31
|
+
"""Return a hermetic environment for immutable, non-interactive Git reads."""
|
|
32
|
+
environment = {
|
|
33
|
+
key: value for key, value in os.environ.items() if not key.startswith("GIT_")
|
|
34
|
+
}
|
|
35
|
+
# `--no-replace-objects` does not disable deprecated graft files. Force Git
|
|
36
|
+
# to read an empty graft source. Strip every inherited GIT_* setting first:
|
|
37
|
+
# location, object, index, config, attribute, pathspec, and transport
|
|
38
|
+
# overrides can otherwise redirect or change a supposedly immutable read.
|
|
39
|
+
environment.update(
|
|
40
|
+
{
|
|
41
|
+
"GIT_ATTR_NOSYSTEM": "1",
|
|
42
|
+
"GIT_CONFIG_GLOBAL": os.devnull,
|
|
43
|
+
"GIT_CONFIG_NOSYSTEM": "1",
|
|
44
|
+
"GIT_CONFIG_SYSTEM": os.devnull,
|
|
45
|
+
"GIT_GRAFT_FILE": os.devnull,
|
|
46
|
+
"GIT_NO_LAZY_FETCH": "1",
|
|
47
|
+
"GIT_NO_REPLACE_OBJECTS": "1",
|
|
48
|
+
"GIT_OPTIONAL_LOCKS": "0",
|
|
49
|
+
"GIT_TERMINAL_PROMPT": "0",
|
|
50
|
+
}
|
|
51
|
+
)
|
|
52
|
+
return environment
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
def git_read_arguments() -> tuple[str, ...]:
|
|
56
|
+
"""Return Git options that disable mutable local object-graph metadata."""
|
|
57
|
+
return ("-c", "core.commitGraph=false", "--no-replace-objects")
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
def require_complete_git_history(*, cwd: Path | None = None) -> None:
|
|
61
|
+
"""Reject shallow history before deriving immutable ancestry evidence."""
|
|
62
|
+
result = run_command(
|
|
63
|
+
["git", *git_read_arguments(), "rev-parse", "--is-shallow-repository"],
|
|
64
|
+
capture_output=True,
|
|
65
|
+
cwd=cwd,
|
|
66
|
+
env=git_read_environment(),
|
|
67
|
+
text=True,
|
|
68
|
+
check=False,
|
|
69
|
+
)
|
|
70
|
+
if result.returncode != 0:
|
|
71
|
+
message = (
|
|
72
|
+
result.stderr.strip() or "git rev-parse --is-shallow-repository failed"
|
|
73
|
+
)
|
|
74
|
+
raise RuntimeError(message)
|
|
75
|
+
if result.stdout.strip() != "false":
|
|
76
|
+
raise RuntimeError(
|
|
77
|
+
"immutable review evidence requires a non-shallow repository; "
|
|
78
|
+
"use a complete source snapshot"
|
|
79
|
+
)
|
|
80
|
+
|
|
81
|
+
|
|
82
|
+
def require_unambiguous_git_merge_base(
|
|
83
|
+
base_oid: str, head_oid: str, *, cwd: Path | None = None
|
|
84
|
+
) -> str:
|
|
85
|
+
"""Return the sole immutable merge base or reject ambiguous topology."""
|
|
86
|
+
result = run_command(
|
|
87
|
+
[
|
|
88
|
+
"git",
|
|
89
|
+
*git_read_arguments(),
|
|
90
|
+
"merge-base",
|
|
91
|
+
"--all",
|
|
92
|
+
base_oid,
|
|
93
|
+
head_oid,
|
|
94
|
+
],
|
|
95
|
+
capture_output=True,
|
|
96
|
+
cwd=cwd,
|
|
97
|
+
env=git_read_environment(),
|
|
98
|
+
text=True,
|
|
99
|
+
check=False,
|
|
100
|
+
)
|
|
101
|
+
if result.returncode != 0:
|
|
102
|
+
message = result.stderr.strip() or "git merge-base failed"
|
|
103
|
+
raise RuntimeError(message)
|
|
104
|
+
merge_bases = result.stdout.splitlines()
|
|
105
|
+
if len(merge_bases) != 1 or not merge_bases[0]:
|
|
106
|
+
raise RuntimeError(
|
|
107
|
+
"immutable review evidence requires one unambiguous merge base"
|
|
108
|
+
)
|
|
109
|
+
return merge_bases[0]
|
|
110
|
+
|
|
111
|
+
|
|
112
|
+
def plugin_version() -> str:
|
|
113
|
+
"""Return the version from the canonical Codex plugin manifest."""
|
|
114
|
+
manifest = PLUGIN_ROOT / ".codex-plugin" / "plugin.json"
|
|
115
|
+
document = json.loads(manifest.read_text(encoding="utf-8"))
|
|
116
|
+
version = document.get("version") if isinstance(document, dict) else None
|
|
117
|
+
if not isinstance(version, str):
|
|
118
|
+
raise TypeError(f"plugin manifest has no string version: {manifest}")
|
|
119
|
+
return version
|
|
120
|
+
|
|
121
|
+
|
|
122
|
+
class _PluginVersionAction(argparse.Action):
|
|
123
|
+
"""Resolve the plugin version only when the option is requested."""
|
|
124
|
+
|
|
125
|
+
def __call__(
|
|
126
|
+
self,
|
|
127
|
+
parser: argparse.ArgumentParser,
|
|
128
|
+
namespace: argparse.Namespace,
|
|
129
|
+
values: str | Sequence[Any] | None,
|
|
130
|
+
option_string: str | None = None,
|
|
131
|
+
) -> None:
|
|
132
|
+
del namespace, values, option_string
|
|
133
|
+
try:
|
|
134
|
+
version = plugin_version()
|
|
135
|
+
except (OSError, TypeError, json.JSONDecodeError) as error:
|
|
136
|
+
parser.exit(
|
|
137
|
+
1, f"{parser.prog}: error: cannot read plugin version: {error}\n"
|
|
138
|
+
)
|
|
139
|
+
print(f"{parser.prog} {version}")
|
|
140
|
+
parser.exit(0)
|
|
141
|
+
|
|
142
|
+
|
|
143
|
+
def argument_parser(*, description: str | None = None) -> argparse.ArgumentParser:
|
|
144
|
+
"""Create the required parser with a consistent plugin-version action."""
|
|
145
|
+
parser = argparse.ArgumentParser(description=description)
|
|
146
|
+
parser.add_argument(
|
|
147
|
+
"--version",
|
|
148
|
+
action=_PluginVersionAction,
|
|
149
|
+
nargs=0,
|
|
150
|
+
help="show the Athena plugin version and exit",
|
|
151
|
+
)
|
|
152
|
+
return parser
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: advise
|
|
3
|
+
license: BSD-3-Clause
|
|
4
|
+
description: Retrieve trusted Mnemosyne guidance before unfamiliar planning or implementation. In planning mode, use the checked-out knowledge tree as a best effort without requiring upstream synchronization; report its revision and any trust or freshness limits.
|
|
5
|
+
argument-hint: <task description>
|
|
6
|
+
allowed-tools: [Read, Bash, Grep, Glob]
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# Advise
|
|
10
|
+
|
|
11
|
+
Why: decisions are only as reliable as the current, trusted knowledge behind them.
|
|
12
|
+
|
|
13
|
+
## Required knowledge gate
|
|
14
|
+
|
|
15
|
+
Prepare Mnemosyne at `$HOME/.agent_brain/knowledge` under the canonical
|
|
16
|
+
[`dependency-resolution` contract](../../docs/dependency-resolution.md). Report the resolved
|
|
17
|
+
repository, commit SHA, and trust basis. Outside planning mode, resolution, authentication,
|
|
18
|
+
checkout, update, or revalidation failure blocks this skill.
|
|
19
|
+
|
|
20
|
+
**Planning mode:** before searching, framing options, drafting a plan, or relying on remembered
|
|
21
|
+
guidance, inspect the existing knowledge checkout and bind retrieval to its current `HEAD` when
|
|
22
|
+
available. Do not require upstream resolution, fetch, fast-forward, or automatic-fork
|
|
23
|
+
revalidation. Use the checked-out content as a best effort, and report its repository, current
|
|
24
|
+
commit SHA, origin/trust status, and any freshness or verification limitation. A missing checkout
|
|
25
|
+
or failed inspection is a limitation to report, not a reason to stop the primary plan; return an
|
|
26
|
+
explicit `no applicable durable guidance` result and do not continue retrieval as if knowledge were
|
|
27
|
+
available. Never substitute a different repository or silently treat local content as current or
|
|
28
|
+
trusted.
|
|
29
|
+
|
|
30
|
+
## Retrieve
|
|
31
|
+
|
|
32
|
+
- Resolve this installed skill's directory and run its
|
|
33
|
+
`scripts/list_retrievable_skills.py <knowledge-root>` helper by absolute path. Treat only the
|
|
34
|
+
returned flat main-skill paths as retrieval candidates; the helper excludes notes, history, and
|
|
35
|
+
nested artifacts through the same executable contract used by `learn`. Do not replace a failed
|
|
36
|
+
helper with an ad hoc glob: outside planning mode, report the capability failure and stop; in
|
|
37
|
+
planning mode, report `no applicable durable guidance` and the limitation.
|
|
38
|
+
- Search the returned files' names, descriptions, categories, tags, triggers, failed attempts, and
|
|
39
|
+
results; use notes only after selecting a main skill that links them, and use Git and PR history
|
|
40
|
+
as provenance.
|
|
41
|
+
- Rank by intended outcome, constraints, and failure mode before title or wording. Read at most five
|
|
42
|
+
selected entries completely, preferring newer and better-verified guidance.
|
|
43
|
+
- For each result, state its version, verification, concrete relevance, non-relevance boundary,
|
|
44
|
+
contradictions, and failed approaches; clearly label unverified guidance.
|
|
45
|
+
- Surface potentially matching open Mnemosyne PRs by candidate artifact or title and report their
|
|
46
|
+
branch and URL. This is a retrieval hint, not duplicate clearance: `learn` must inspect the changed
|
|
47
|
+
content of every open PR semantically before any write.
|
|
48
|
+
|
|
49
|
+
## Recommend
|
|
50
|
+
|
|
51
|
+
Treat intent as trigger/context plus desired outcome, not session wording, names, or issue numbers.
|
|
52
|
+
Prefer one canonical entry per intent; search history before proposing a name that may have been
|
|
53
|
+
consolidated. Route repository audits to `repo-review`, PR audits to `pr-review`, and vary review
|
|
54
|
+
depth by mode. Recommend `learn` only for a verified new trigger, corrected command or parameter,
|
|
55
|
+
failure mode, or workflow.
|
|
56
|
+
|
|
57
|
+
## Output
|
|
58
|
+
|
|
59
|
+
Return the resolved `owner/Mnemosyne` revision, the bound local checkout `HEAD`, or an explicit
|
|
60
|
+
no-local-guidance status, together with a table of entry, version, verification, relevance, and
|
|
61
|
+
boundary. Include contradictions, what worked or failed, copy-ready parameters, and clearly label
|
|
62
|
+
best-effort or unverified guidance.
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
"""List flat Mnemosyne main-skill files eligible for normal retrieval."""
|
|
3
|
+
|
|
4
|
+
from __future__ import annotations
|
|
5
|
+
|
|
6
|
+
import re
|
|
7
|
+
import sys
|
|
8
|
+
from pathlib import Path
|
|
9
|
+
|
|
10
|
+
if __package__ in {None, ""}:
|
|
11
|
+
sys.path.insert(0, str(Path(__file__).resolve().parents[3]))
|
|
12
|
+
|
|
13
|
+
from skills._cli import argument_parser
|
|
14
|
+
|
|
15
|
+
COMPANION_FILE = re.compile(
|
|
16
|
+
r"(?:.*\.notes(?:-[A-Za-z0-9_-]+)?\.md|.*\.history(?:[-.].*)?)\Z"
|
|
17
|
+
)
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
def retrievable_skill_files(knowledge_root: Path) -> list[Path]:
|
|
21
|
+
"""Return sorted flat main-skill files from a Mnemosyne checkout."""
|
|
22
|
+
skills_directory = knowledge_root / "skills"
|
|
23
|
+
if not skills_directory.is_dir():
|
|
24
|
+
raise RuntimeError(
|
|
25
|
+
f"knowledge skills directory is unavailable: {skills_directory}"
|
|
26
|
+
)
|
|
27
|
+
return sorted(
|
|
28
|
+
path
|
|
29
|
+
for path in skills_directory.glob("*.md")
|
|
30
|
+
if path.is_file() and COMPANION_FILE.fullmatch(path.name) is None
|
|
31
|
+
)
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
def main() -> int:
|
|
35
|
+
parser = argument_parser(description=__doc__)
|
|
36
|
+
parser.add_argument("knowledge_root", type=Path)
|
|
37
|
+
arguments = parser.parse_args()
|
|
38
|
+
try:
|
|
39
|
+
paths = retrievable_skill_files(arguments.knowledge_root)
|
|
40
|
+
except RuntimeError as error:
|
|
41
|
+
print(error, file=sys.stderr)
|
|
42
|
+
return 1
|
|
43
|
+
for path in paths:
|
|
44
|
+
print(path.relative_to(arguments.knowledge_root).as_posix())
|
|
45
|
+
return 0
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
if __name__ == "__main__":
|
|
49
|
+
raise SystemExit(main())
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: brainstorm
|
|
3
|
+
license: BSD-3-Clause
|
|
4
|
+
description: Use before complex creative work to explore intent and requirements. Requires the Mnemosyne knowledge backend through advise and fails closed when it cannot be prepared.
|
|
5
|
+
argument-hint: <idea or feature description>
|
|
6
|
+
allowed-tools: [Read, Write, Bash, Grep, Glob, Agent]
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# Brainstorming Ideas Into Designs
|
|
10
|
+
|
|
11
|
+
Help turn ideas into fully formed designs and specs through natural collaborative dialogue.
|
|
12
|
+
|
|
13
|
+
Start by understanding the current project context, then ask questions one at a time to refine the idea. Once you understand what you're building, present the design and proceed with the requested implementation unless a requirement remains unresolved.
|
|
14
|
+
|
|
15
|
+
**DESIGN CHECKPOINT:** Present a scaled design before complex implementation. It is a shared understanding checkpoint, not a permission gate; pause only for unresolved requirements or a filesystem-destructive action.
|
|
16
|
+
|
|
17
|
+
## Anti-Pattern: "This Is Too Simple To Need A Design"
|
|
18
|
+
|
|
19
|
+
Every feature goes through this process. "Simple" projects are where unexamined assumptions cause the most wasted work. The design can be short (a few sentences), and should make assumptions and constraints visible before implementation.
|
|
20
|
+
|
|
21
|
+
## Checklist
|
|
22
|
+
|
|
23
|
+
Complete in order:
|
|
24
|
+
|
|
25
|
+
1. **Run `advise`** with the feature description to check the required knowledge backend.
|
|
26
|
+
2. **Explore project context** — check files, docs, recent commits
|
|
27
|
+
3. **Ask clarifying questions** — one at a time, understand purpose/constraints/success criteria
|
|
28
|
+
4. **Propose 2-3 approaches** — with trade-offs and your recommendation
|
|
29
|
+
5. **Present design** — in sections scaled to their complexity; ask only to resolve material ambiguity
|
|
30
|
+
6. **Persist when needed** — write `docs/specs/YYYY-MM-DD-<topic>-design.md` only when complexity,
|
|
31
|
+
project policy, or a current downstream consumer requires a durable specification
|
|
32
|
+
7. **Design self-review** — scan for placeholders, contradictions, ambiguity, and scope issues
|
|
33
|
+
8. **User confirms the design** — request file review only when a specification was persisted
|
|
34
|
+
9. **Transition to implementation** — invoke `myrmidon-swarm` for complex implementation. If an
|
|
35
|
+
installed planning skill is available, it may track the approved design; otherwise write a short
|
|
36
|
+
numbered implementation plan in the current conversation and proceed sequentially.
|
|
37
|
+
|
|
38
|
+
## The Process
|
|
39
|
+
|
|
40
|
+
**Understanding the idea:**
|
|
41
|
+
|
|
42
|
+
- Check out the current project state first (files, docs, `git log --oneline -10`)
|
|
43
|
+
- Before asking detailed questions, assess scope: if the request describes multiple independent subsystems, flag this immediately. Help the user decompose into sub-projects first.
|
|
44
|
+
- For appropriately-scoped projects, ask questions one at a time
|
|
45
|
+
- Prefer multiple choice questions when possible
|
|
46
|
+
- Only one question per message
|
|
47
|
+
- Focus on: purpose, constraints, success criteria
|
|
48
|
+
|
|
49
|
+
**Exploring approaches:**
|
|
50
|
+
|
|
51
|
+
- Propose 2-3 different approaches with trade-offs
|
|
52
|
+
- Lead with your recommended option and explain why
|
|
53
|
+
- Reference existing patterns in the target codebase
|
|
54
|
+
|
|
55
|
+
**Presenting the design:**
|
|
56
|
+
|
|
57
|
+
- Present in sections, ask after each whether it looks right
|
|
58
|
+
- Scale each section to its complexity
|
|
59
|
+
- Cover: architecture, components, data flow, error handling, testing strategy
|
|
60
|
+
- Follow Athena's local development principles: KISS, YAGNI, DRY, SOLID, modularity, and POLA
|
|
61
|
+
|
|
62
|
+
**Working in existing codebases:**
|
|
63
|
+
|
|
64
|
+
- Follow existing patterns in the target repository
|
|
65
|
+
- Invoke the `advise` skill first to check for existing implementations
|
|
66
|
+
- Don't propose unrelated refactoring — stay focused on the current goal
|
|
67
|
+
|
|
68
|
+
## After the Design
|
|
69
|
+
|
|
70
|
+
**Persist a spec only when required:**
|
|
71
|
+
|
|
72
|
+
For small changes, keep the approved design in the conversation and proceed. When complexity,
|
|
73
|
+
project policy, or a current downstream consumer requires a durable specification, save it to
|
|
74
|
+
`docs/specs/YYYY-MM-DD-<topic>-design.md` and commit it as
|
|
75
|
+
`docs(specs): add <topic> design document`.
|
|
76
|
+
|
|
77
|
+
Before writing or committing a specification, read the target repository's mutation, signing, DCO,
|
|
78
|
+
and review policy. A specification that is in scope may be written and committed without a separate
|
|
79
|
+
approval prompt; retain it in the conversation when a durable artifact is not needed.
|
|
80
|
+
|
|
81
|
+
**Spec Self-Review:**
|
|
82
|
+
|
|
83
|
+
1. **Placeholder scan:** Any "TBD", "TODO", incomplete sections? Fix them.
|
|
84
|
+
2. **Internal consistency:** Do any sections contradict each other?
|
|
85
|
+
3. **Scope check:** Is this focused enough for a single plan?
|
|
86
|
+
4. **Ambiguity check:** Can any requirement be interpreted two ways? Pick one and make it explicit.
|
|
87
|
+
|
|
88
|
+
**User Review:**
|
|
89
|
+
After self-review of a persisted specification, report its location and proceed with the requested
|
|
90
|
+
implementation unless the user requests changes:
|
|
91
|
+
> "Spec written and committed to `docs/specs/<filename>`. Please review and let me know if you want changes before we start planning implementation."
|
|
92
|
+
|
|
93
|
+
|
|
94
|
+
**Implementation:**
|
|
95
|
+
|
|
96
|
+
- Use an installed planning skill for task tracking, or write the numbered plan inline when none is
|
|
97
|
+
installed.
|
|
98
|
+
- Invoke the `myrmidon-swarm` skill for complex multi-agent work.
|
|
99
|
+
|
|
100
|
+
## Key Principles
|
|
101
|
+
|
|
102
|
+
- **One question at a time** — don't overwhelm with multiple questions
|
|
103
|
+
- **YAGNI ruthlessly** — remove unnecessary features from all designs
|
|
104
|
+
- **Explore alternatives** — always propose 2-3 approaches
|
|
105
|
+
- **Incremental validation** — present design sections and resolve material ambiguity before moving on
|
|
106
|
+
- **Invoke `advise` first** — don't propose what's already been built or debugged
|
|
107
|
+
|
|
108
|
+
---
|
|
109
|
+
|
|
110
|
+
_Adapted from [obra/superpowers](https://github.com/obra/superpowers) under the [MIT License](https://github.com/obra/superpowers/blob/main/LICENSE). Copyright (c) 2025 Jesse Vincent._
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: change-review
|
|
3
|
+
license: BSD-3-Clause
|
|
4
|
+
description: Review only the working-tree, staged, or explicit-range changes for architecture alignment, behavior, language practices, and evidence. Use before committing or opening a PR; it never edits source or posts forge comments.
|
|
5
|
+
argument-hint: "[--worktree | --staged | --range BASE..HEAD] [PATH ...]"
|
|
6
|
+
allowed-tools: [Read, Bash, Grep, Glob, Agent]
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# Change review
|
|
10
|
+
|
|
11
|
+
Why: bind the exact local change before review so findings apply to the bytes
|
|
12
|
+
that will be committed.
|
|
13
|
+
|
|
14
|
+
Use the shared [review contract](../../docs/review/common.md),
|
|
15
|
+
[language routing](../../docs/review/language-routing.md), and
|
|
16
|
+
[behavior-first testing](../../docs/review/behavior-first-testing.md).
|
|
17
|
+
|
|
18
|
+
This skill is read-only. It never edits source, stages files, creates Git
|
|
19
|
+
state, posts forge content, opens issues, or writes review notes into source.
|
|
20
|
+
|
|
21
|
+
## Bind the scope
|
|
22
|
+
|
|
23
|
+
Choose exactly one scope:
|
|
24
|
+
|
|
25
|
+
- `--worktree` (default): tracked differences from `HEAD` and non-ignored
|
|
26
|
+
untracked files;
|
|
27
|
+
- `--staged`: index changes from `HEAD`; or
|
|
28
|
+
- `--range BASE..HEAD`: the explicit Git range.
|
|
29
|
+
|
|
30
|
+
Resolve the installed [`scripts/resolve_scope.py`](scripts/resolve_scope.py)
|
|
31
|
+
from this skill directory before inspection. Read every eligible object in its
|
|
32
|
+
manifest and follow the [scope-resolution safety contract](references/scope-resolution.md).
|
|
33
|
+
Paths further restrict the selected diff and must remain inside the repository
|
|
34
|
+
root.
|
|
35
|
+
|
|
36
|
+
For a range, report immutable base and head commits. For worktree or staged
|
|
37
|
+
scope, report `HEAD`, selected paths, and the returned content-bound digest;
|
|
38
|
+
never create a commit, tree, stash, temporary index, or other Git state to
|
|
39
|
+
invent a head. Report an empty scope and never silently substitute a different
|
|
40
|
+
range.
|
|
41
|
+
|
|
42
|
+
`--staged` and `--range` exclude untracked worktree files. State that boundary
|
|
43
|
+
in the result. If resolution cannot safely cover the selected scope, report the
|
|
44
|
+
coverage gap and narrow the paths or choose a safer scope; never sample it.
|
|
45
|
+
|
|
46
|
+
## Review and deliver
|
|
47
|
+
|
|
48
|
+
Follow the shared review flow: establish architecture first, classify only
|
|
49
|
+
applicable surfaces and language profiles, inspect changed behavior and tests,
|
|
50
|
+
then de-duplicate severity-ranked evidence. Record each skipped check as N/A
|
|
51
|
+
with its reason.
|
|
52
|
+
|
|
53
|
+
For a material architecture change, require a stated design decision, ADR, or
|
|
54
|
+
[design record](../../docs/review/design-docs.md). Missing architecture evidence
|
|
55
|
+
is a blocker; do not invent it.
|
|
56
|
+
|
|
57
|
+
Return in the console or host-native read-only annotation surface:
|
|
58
|
+
|
|
59
|
+
1. scope identity, base/head or manifest digest, and files read;
|
|
60
|
+
2. architecture decision first, then applicable and N/A checks;
|
|
61
|
+
3. severity-ranked findings with exact `path:line`, impact, evidence, and a
|
|
62
|
+
proportionate remediation direction;
|
|
63
|
+
4. behavior-first testing and validation coverage; and
|
|
64
|
+
5. residual risks and unverified assumptions.
|
|
65
|
+
|
|
66
|
+
Use native source annotations only for changed locations when the host supports
|
|
67
|
+
them. Otherwise use `path:line` in the console; never simulate annotations by
|
|
68
|
+
editing source.
|