@homericintelligence/athena-opencode 0.5.0 → 0.5.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.
- package/README.md +30 -17
- package/package.json +2 -2
- package/plugin.js +20 -5
- package/skills/TECHNICAL_ENGLISH.md +78 -0
- package/skills/_cli.py +33 -22
- package/skills/_plugin.json +1 -0
- package/skills/_support/docs/dependency-resolution.md +203 -0
- package/skills/_support/docs/policies/development.md +131 -0
- package/skills/_support/docs/policies/evidence-integrity.md +40 -0
- package/skills/_support/docs/principles/README.md +565 -0
- package/skills/_support/docs/principles/details/p001-kiss.md +114 -0
- package/skills/_support/docs/principles/details/p002-yagni.md +109 -0
- package/skills/_support/docs/principles/details/p003-dry.md +126 -0
- package/skills/_support/docs/principles/details/p004-solid.md +165 -0
- package/skills/_support/docs/principles/details/p005-modularity.md +123 -0
- package/skills/_support/docs/principles/details/p006-principle-of-least-astonishment.md +115 -0
- package/skills/_support/docs/principles/details/p007-subtraction-over-addition.md +113 -0
- package/skills/_support/docs/principles/details/p008-understand-before-subtracting.md +115 -0
- package/skills/_support/docs/principles/details/p009-general-mechanisms-over-special-cases.md +108 -0
- package/skills/_support/docs/principles/details/p010-scope-fidelity.md +117 -0
- package/skills/_support/docs/principles/details/p011-minimal-coherent-change.md +128 -0
- package/skills/_support/docs/principles/details/p012-evidence-before-modification.md +115 -0
- package/skills/_support/docs/principles/details/p013-avoid-hasty-abstractions.md +112 -0
- package/skills/_support/docs/principles/details/p014-preserve-unrequested-behavior.md +110 -0
- package/skills/_support/docs/principles/details/p015-architecture-conformance.md +124 -0
- package/skills/_support/docs/principles/details/p016-separation-of-concerns.md +125 -0
- package/skills/_support/docs/principles/details/p017-high-cohesion-low-coupling.md +130 -0
- package/skills/_support/docs/principles/details/p018-information-hiding.md +128 -0
- package/skills/_support/docs/principles/details/p019-explicit-contracts.md +134 -0
- package/skills/_support/docs/principles/details/p020-executable-architecture.md +130 -0
- package/skills/_support/docs/principles/details/p021-evolutionary-and-reversible-design.md +126 -0
- package/skills/_support/docs/principles/details/p022-test-behavior-not-implementation.md +129 -0
- package/skills/_support/docs/principles/details/p023-parameterized-table-driven-testing.md +129 -0
- package/skills/_support/docs/principles/details/p024-boundary-value-testing.md +128 -0
- package/skills/_support/docs/principles/details/p025-property-based-testing-for-invariants.md +133 -0
- package/skills/_support/docs/principles/details/p026-regression-before-repair.md +134 -0
- package/skills/_support/docs/principles/details/p027-deterministic-and-hermetic-tests.md +128 -0
- package/skills/_support/docs/principles/details/p028-test-failure-paths.md +133 -0
- package/skills/_support/docs/principles/details/p029-generalize-error-policy-preserve-specific-cause.md +131 -0
- package/skills/_support/docs/principles/details/p030-nearest-responsible-error-boundary.md +133 -0
- package/skills/_support/docs/principles/details/p031-propagate-rather-than-swallow.md +131 -0
- package/skills/_support/docs/principles/details/p032-handle-once-preserve-causality.md +137 -0
- package/skills/_support/docs/principles/details/p033-state-safe-failure-semantics.md +140 -0
- package/skills/_support/docs/principles/details/p034-fail-fast.md +132 -0
- package/skills/_support/docs/principles/details/p035-fail-secure-fail-closed.md +137 -0
- package/skills/_support/docs/principles/details/p036-graceful-degradation.md +137 -0
- package/skills/_support/docs/principles/details/p037-idempotency-before-retry.md +139 -0
- package/skills/_support/docs/principles/details/p038-bounded-retry.md +145 -0
- package/skills/_support/docs/principles/details/p039-bounded-waiting.md +151 -0
- package/skills/_support/docs/principles/details/p040-bounded-resources.md +138 -0
- package/skills/_support/docs/principles/details/p041-backpressure-and-load-shedding.md +141 -0
- package/skills/_support/docs/principles/details/p042-fault-isolation-bulkheads.md +140 -0
- package/skills/_support/docs/principles/details/p043-circuit-breakers.md +148 -0
- package/skills/_support/docs/principles/details/p044-atomicity-where-possible.md +141 -0
- package/skills/_support/docs/principles/details/p045-compensation-where-atomicity-is-impossible.md +163 -0
- package/skills/_support/docs/principles/details/p046-resumability.md +138 -0
- package/skills/_support/docs/principles/details/p047-observability-is-part-of-correctness.md +134 -0
- package/skills/_support/docs/principles/details/p048-secure-by-design.md +132 -0
- package/skills/_support/docs/principles/details/p049-secure-by-default.md +126 -0
- package/skills/_support/docs/principles/details/p050-least-privilege.md +123 -0
- package/skills/_support/docs/principles/details/p051-complete-mediation.md +124 -0
- package/skills/_support/docs/principles/details/p052-separation-of-duties.md +129 -0
- package/skills/_support/docs/principles/details/p053-validate-at-trust-boundaries.md +126 -0
- package/skills/_support/docs/principles/details/p054-defense-in-depth.md +135 -0
- package/skills/_support/docs/principles/details/p055-minimize-attack-surface.md +133 -0
- package/skills/_support/docs/principles/details/p056-secrets-stay-out-of-code-and-context.md +137 -0
- package/skills/_support/docs/principles/details/p057-supply-chain-integrity.md +135 -0
- package/skills/_support/docs/principles/details/p058-bounded-agent-authority.md +137 -0
- package/skills/_support/docs/principles/details/p059-data-is-not-instruction.md +130 -0
- package/skills/_support/docs/principles/details/p060-constrain-sub-agents.md +136 -0
- package/skills/_support/docs/principles/details/p061-separate-decision-from-high-impact-execution.md +131 -0
- package/skills/_support/docs/principles/details/p062-human-approval-for-irreversible-or-high-risk-actions.md +129 -0
- package/skills/_support/docs/principles/details/p063-requirement-to-code-traceability.md +116 -0
- package/skills/_support/docs/principles/details/p064-requirement-to-test-traceability.md +116 -0
- package/skills/_support/docs/principles/details/p065-verify-before-claiming-completion.md +131 -0
- package/skills/_support/docs/principles/details/p066-preserve-existing-work.md +114 -0
- package/skills/_support/docs/principles/details/p067-no-test-cheating.md +126 -0
- package/skills/_support/docs/principles/details/p068-no-validation-bypass.md +119 -0
- package/skills/_support/docs/principles/details/p069-independent-review-for-high-risk-changes.md +129 -0
- package/skills/_support/docs/principles/details/p070-code-health-must-not-regress.md +116 -0
- package/skills/_support/docs/principles/details/p071-consistency-over-personal-preference.md +117 -0
- package/skills/_support/docs/principles/details/p072-technical-evidence-over-preference.md +122 -0
- package/skills/_support/docs/principles/details/p073-optimize-only-with-evidence.md +123 -0
- package/skills/_support/docs/principles/details/p074-prefer-existing-mechanisms.md +121 -0
- package/skills/_support/docs/principles/details/p075-make-invalid-states-hard-to-represent.md +128 -0
- package/skills/_support/docs/principles/details/p076-parse-then-validate-then-operate.md +133 -0
- package/skills/_support/docs/principles/details/p077-separate-policy-from-mechanism.md +112 -0
- package/skills/_support/docs/principles/details/p078-single-source-of-truth.md +131 -0
- package/skills/_support/docs/principles/details/p079-explicit-ownership-and-lifetimes.md +124 -0
- package/skills/_support/docs/principles/details/p080-make-concurrency-deliberate.md +122 -0
- package/skills/_support/docs/principles/details/p081-forward-progress-with-safety.md +125 -0
- package/skills/_support/docs/principles/details/p082-design-for-cancellation.md +133 -0
- package/skills/_support/docs/principles/details/p083-irreversible-actions-last.md +124 -0
- package/skills/_support/docs/principles/details/p084-prefer-local-reasoning.md +131 -0
- package/skills/_support/docs/principles/details/p085-explicit-is-better-than-implicit.md +123 -0
- package/skills/_support/docs/principles/details/p086-readability-counts.md +113 -0
- package/skills/_support/docs/principles/details/p087-comments-explain-why-code-explains-what.md +120 -0
- package/skills/_support/docs/principles/details/p088-delete-dead-code.md +125 -0
- package/skills/_support/docs/principles/details/p089-delete-obsolete-configuration-and-dependencies.md +125 -0
- package/skills/_support/docs/principles/details/p090-prefer-negative-code.md +134 -0
- package/skills/_support/docs/principles/details/p091-test-driven-development.md +149 -0
- package/skills/_support/docs/review/README.md +63 -0
- package/skills/_support/docs/review/behavior-first-testing.md +78 -0
- package/skills/_support/docs/review/common.md +400 -0
- package/skills/_support/docs/review/design-docs.md +74 -0
- package/skills/_support/docs/review/issue-planning.md +247 -0
- package/skills/_support/docs/review/language-routing.md +141 -0
- package/skills/_support/docs/review/repository-scorecard.md +170 -0
- package/skills/advise/SKILL.md +108 -74
- package/skills/advise/scripts/list_retrievable_skills.py +20 -8
- package/skills/advise/scripts/resolve_knowledge_checkout.py +533 -0
- package/skills/brainstorm/SKILL.md +163 -127
- package/skills/change-review/SKILL.md +91 -71
- package/skills/change-review/references/scope-resolution.md +69 -46
- package/skills/change-review/scripts/resolve_scope.py +144 -84
- package/skills/finalize-plan/SKILL.md +205 -139
- package/skills/git-worktrees/SKILL.md +100 -80
- package/skills/git-worktrees/scripts/prepare_worktree.py +34 -15
- package/skills/issue-review/SKILL.md +136 -79
- package/skills/learn/SKILL.md +359 -192
- package/skills/myrmidon-swarm/SKILL.md +126 -86
- package/skills/plan-issue/SKILL.md +122 -81
- package/skills/pr-review/SKILL.md +184 -116
- package/skills/pr-review/references/criteria.md +61 -37
- package/skills/pr-review/references/delivery.md +277 -101
- package/skills/pr-review/references/evidence.md +346 -149
- package/skills/pr-review/references/prevalidated.md +93 -61
- package/skills/pr-review/scripts/collect_evidence.py +312 -162
- package/skills/pr-review/scripts/deliver_go.py +701 -0
- package/skills/pr-review/scripts/diff_context.py +34 -15
- package/skills/pr-review/scripts/materialize_snapshot.py +141 -130
- package/skills/pr-review/scripts/pr_identity.py +27 -15
- package/skills/pr-review/scripts/resolve_pr.py +77 -41
- package/skills/realign/SKILL.md +516 -0
- package/skills/realign/references/aislop-integration.md +215 -0
- package/skills/realign/references/architecture-and-structure.md +271 -0
- package/skills/realign/references/control-flow-and-errors.md +344 -0
- package/skills/realign/references/tests-dependencies-and-security.md +261 -0
- package/skills/realign/scripts/resolve_assessment.py +1525 -0
- package/skills/repo-review/SKILL.md +202 -131
- package/skills/simplify/SKILL.md +174 -0
- package/skills/systematic-debugging/SKILL.md +212 -192
- package/skills/systematic-debugging/scripts/repository_evidence.py +26 -8
- package/skills/test-driven-development/SKILL.md +126 -96
- package/skills/tidy/SKILL.md +104 -59
- package/skills/tidy/scripts/run_tidy.py +54 -6
|
@@ -1,141 +1,161 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: git-worktrees
|
|
3
3
|
license: BSD-3-Clause
|
|
4
|
-
description: Use
|
|
4
|
+
description: Use for feature work that needs an isolated Git worktree. If Git does not ignore a project-local directory, use the verified temporary-directory fallback. If repository guidance requires the local directory, report the problem. In that case, stop before creation. If the helper cannot verify a clean base commit, report the problem. In that case, stop before creation. Do not delete anything.
|
|
5
5
|
argument-hint: <branch-name or feature description>
|
|
6
6
|
allowed-tools: [Bash, Read]
|
|
7
7
|
---
|
|
8
8
|
|
|
9
|
-
#
|
|
9
|
+
# Use Git worktrees
|
|
10
10
|
|
|
11
11
|
## Overview
|
|
12
12
|
|
|
13
|
-
Git worktrees
|
|
13
|
+
Git worktrees are isolated workspaces that share one repository. You can work on multiple branches
|
|
14
|
+
at the same time. You do not have to switch the active branch.
|
|
14
15
|
|
|
15
|
-
|
|
16
|
-
|
|
16
|
+
Apply the [ASD-STE100 technical-English policy](../TECHNICAL_ENGLISH.md) to this skill and to all
|
|
17
|
+
prose that it produces.
|
|
17
18
|
|
|
18
|
-
**
|
|
19
|
-
|
|
19
|
+
**Rule:** Select the directory systematically. Then complete the safety checks. These actions give
|
|
20
|
+
reliable isolation.
|
|
21
|
+
|
|
22
|
+
**Do not use this skill for `myrmidon-swarm` worktrees.** That skill creates worktrees for its
|
|
23
|
+
background subagents. Use this skill for manual development work.
|
|
20
24
|
|
|
21
25
|
## Engineering principles
|
|
22
26
|
|
|
23
|
-
Use the [canonical engineering-principles catalog](
|
|
27
|
+
Use the [canonical engineering-principles catalog](../_support/docs/principles/README.md) for these
|
|
24
28
|
workflow-specific rules:
|
|
25
29
|
|
|
26
|
-
- [P010 — Scope Fidelity](
|
|
27
|
-
branch and worktree
|
|
28
|
-
- [P012 — Evidence Before Modification](
|
|
29
|
-
guidance, the selected base revision, directory state, ignore rules, and
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
- [
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
- [
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
30
|
+
- [P010 — Scope Fidelity](../_support/docs/principles/README.md#p010): Make only the requested isolated
|
|
31
|
+
branch and worktree. Delegate cleanup and unrelated changes to the applicable workflows.
|
|
32
|
+
- [P012 — Evidence Before Modification](../_support/docs/principles/README.md#p012): Before creation,
|
|
33
|
+
examine repository guidance, the selected base revision, directory state, ignore rules, and
|
|
34
|
+
baseline checks.
|
|
35
|
+
- [P021 — Evolutionary and Reversible Design](../_support/docs/principles/README.md#p021): Put feature work
|
|
36
|
+
in an isolated worktree at the selected base commit. Only if you have user authority and can use
|
|
37
|
+
the cleanup workflow, remove the worktree.
|
|
38
|
+
- [P033 — State-Safe Failure Semantics](../_support/docs/principles/README.md#p033): If validation is not
|
|
39
|
+
satisfactory, stop before creation. If setup or a test after creation is not satisfactory, keep
|
|
40
|
+
the worktree.
|
|
41
|
+
- [P053 — Validate at Trust Boundaries](../_support/docs/principles/README.md#p053): Use the tested helper
|
|
42
|
+
to validate branch, base, path, and path-root values. Do not use these values in a Git command
|
|
43
|
+
without the helper.
|
|
44
|
+
- [P058 — Bounded Agent Authority](../_support/docs/principles/README.md#p058): Make only the named branch
|
|
45
|
+
and worktree for the requested feature. Use the selected start commit and validated destination.
|
|
46
|
+
- [P065 — Verify Before Claiming Completion](../_support/docs/principles/README.md#p065): Before you report
|
|
47
|
+
that you prepared the worktree, do the repository checks for a clean baseline. Report the path
|
|
48
|
+
and start commit.
|
|
49
|
+
- [P083 — Irreversible Actions Last](../_support/docs/principles/README.md#p083): Before creation, complete
|
|
50
|
+
the dry-run. Before creation, complete the safety validation. Use `tidy` for removal.
|
|
51
|
+
|
|
52
|
+
## Select the directory
|
|
44
53
|
|
|
45
54
|
Follow this priority order:
|
|
46
55
|
|
|
47
|
-
### 1. Check
|
|
56
|
+
### 1. Check existing directories
|
|
48
57
|
|
|
49
58
|
The tested `scripts/prepare_worktree.py` helper checks `.worktrees` and then `worktrees`. If both
|
|
50
|
-
exist, `.worktrees
|
|
59
|
+
directories exist, the helper selects `.worktrees`.
|
|
51
60
|
|
|
52
61
|
### 2. Check repository guidance
|
|
53
62
|
|
|
54
|
-
Read `AGENTS.md` and its referenced repository guidance. If
|
|
55
|
-
the helper with `--directory DIRECTORY`.
|
|
63
|
+
Read `AGENTS.md` and its referenced repository guidance. If repository guidance specifies a
|
|
64
|
+
preference, pass it to the helper with `--directory DIRECTORY`.
|
|
56
65
|
|
|
57
66
|
### 3. Portable default
|
|
58
67
|
|
|
59
|
-
|
|
60
|
-
`tempfile.gettempdir()` with `<project>-<branch>`.
|
|
61
|
-
|
|
68
|
+
If the repository does not specify a location, use the host temporary directory from
|
|
69
|
+
`tempfile.gettempdir()` with `<project>-<branch>`. On Unix-like hosts, this directory is usually
|
|
70
|
+
`/tmp`. This location keeps the worktree outside the project directory.
|
|
62
71
|
|
|
63
72
|
The helper computes the project name from the repository root.
|
|
64
73
|
|
|
65
|
-
##
|
|
74
|
+
## Verify safety
|
|
66
75
|
|
|
67
|
-
### For
|
|
76
|
+
### For project-local directories
|
|
68
77
|
|
|
69
|
-
|
|
70
|
-
|
|
78
|
+
Before you create a project-local worktree, verify that Git ignores its directory. If Git does not
|
|
79
|
+
ignore the directory, the helper stops before it makes a change.
|
|
71
80
|
|
|
72
|
-
|
|
81
|
+
#### If Git does not ignore the directory
|
|
73
82
|
|
|
74
|
-
1. Do not
|
|
75
|
-
2.
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
83
|
+
1. Do not edit `.gitignore`.
|
|
84
|
+
2. Do not commit `.gitignore`.
|
|
85
|
+
3. Do not create the project-local worktree.
|
|
86
|
+
4. If repository guidance requires the project-local directory, report the ignore-policy
|
|
87
|
+
prerequisite.
|
|
88
|
+
5. If repository guidance requires the project-local directory, stop.
|
|
89
|
+
6. Change `.gitignore` only in a separate authorized change.
|
|
90
|
+
7. After that change is validated and committed, prepare the worktree again.
|
|
91
|
+
8. If repository guidance does not require the project-local directory, get `<temporary-root>` from
|
|
92
|
+
the host.
|
|
93
|
+
9. Give preference to a safe temporary destination.
|
|
94
|
+
10. Pass `--path <temporary-root>/<project>-<branch>` and `--path-root <temporary-root>` to the helper.
|
|
95
|
+
11. Report the fallback path.
|
|
81
96
|
|
|
82
|
-
|
|
97
|
+
This check prevents Git from tracking the worktree contents.
|
|
83
98
|
|
|
84
|
-
### For
|
|
99
|
+
### For `/tmp` locations
|
|
85
100
|
|
|
86
|
-
|
|
101
|
+
You do not have to verify `.gitignore` for a path under `/tmp`. This path is outside the project.
|
|
87
102
|
|
|
88
|
-
##
|
|
103
|
+
## Create the worktree
|
|
89
104
|
|
|
90
|
-
1. Resolve
|
|
91
|
-
2.
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
105
|
+
1. Resolve the intended base commit SHA.
|
|
106
|
+
2. Record the intended base commit SHA.
|
|
107
|
+
3. Keep the target repository as the current working directory.
|
|
108
|
+
4. Resolve `scripts/prepare_worktree.py` from this installed skill directory.
|
|
109
|
+
5. Prepare `BRANCH_NAME --start-point BASE_SHA --dry-run` as the helper arguments.
|
|
110
|
+
6. If the contract requires a distinct branch and path, add exact `--path` and `--path-root` values.
|
|
111
|
+
7. If repository guidance specifies a directory, add it through `--directory`.
|
|
112
|
+
8. If an unignored local directory requires the temporary fallback, retain the exact `--path` and
|
|
113
|
+
`--path-root` values.
|
|
114
|
+
9. For this fallback, use those values for both helper calls.
|
|
115
|
+
10. Invoke the helper by its absolute path with the prepared dry-run arguments.
|
|
116
|
+
11. Create the worktree with the same arguments without `--dry-run`.
|
|
117
|
+
12. Do not replace the recorded SHA with the current `HEAD`.
|
|
118
|
+
13. Change to the returned path.
|
|
119
|
+
14. If the repository defines a bootstrap, run it.
|
|
120
|
+
15. Use the repository tests to verify a clean baseline.
|
|
121
|
+
16. Report the path, start SHA, and result.
|
|
101
122
|
|
|
102
|
-
**If tests fail:** Report failures
|
|
123
|
+
**If the tests fail:** Report the failures. Ask whether to continue or investigate.
|
|
103
124
|
|
|
104
|
-
**If tests pass:** Report ready.
|
|
125
|
+
**If the tests pass:** Report that the worktree is ready.
|
|
105
126
|
|
|
106
|
-
##
|
|
127
|
+
## Clean up
|
|
107
128
|
|
|
108
|
-
When work is
|
|
109
|
-
Hephaestus dependency
|
|
110
|
-
discovery, preservation rules, deletion prompts, rebases, and cleanup safeguards. Do not
|
|
111
|
-
that policy
|
|
129
|
+
When the work is complete, invoke `tidy` for branch and worktree cleanup. `tidy` prepares the trusted
|
|
130
|
+
Hephaestus dependency. It delegates the work directly to `hephaestus-tidy`. The interactive workflow
|
|
131
|
+
controls discovery, preservation rules, deletion prompts, rebases, and cleanup safeguards. Do not
|
|
132
|
+
duplicate that policy. Do not write deletion commands in this skill.
|
|
112
133
|
|
|
113
134
|
Preserve the worktree by default. Delivery, merge, abandonment, or a general cleanup request does
|
|
114
|
-
not
|
|
115
|
-
|
|
135
|
+
not authorize this skill to remove the worktree. Use `tidy` for each cleanup. The Hephaestus
|
|
136
|
+
workflow and the user's answers to its prompts control the removal decision.
|
|
116
137
|
|
|
117
138
|
## Quick Reference
|
|
118
139
|
|
|
119
140
|
| Situation | Action |
|
|
120
141
|
| ----------- | -------- |
|
|
121
|
-
| `.worktrees/` exists
|
|
142
|
+
| `.worktrees/` exists and is ignored | Use it. |
|
|
122
143
|
| Neither exists | Use the host temporary directory with `<project>-<branch>` |
|
|
123
|
-
| Directory not ignored | Use
|
|
124
|
-
| Tests fail at baseline | Report failures
|
|
144
|
+
| Directory is not ignored | Use an explicit temporary path. Report the path. If the repository requires a local path, stop. |
|
|
145
|
+
| Tests fail at baseline | Report the failures. Ask before you continue. |
|
|
125
146
|
|
|
126
147
|
## Failed approaches
|
|
127
148
|
|
|
128
|
-
-
|
|
129
|
-
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
## Integration
|
|
149
|
+
- Do not skip ignore verification for a project-local worktree. Git can track the worktree contents.
|
|
150
|
+
- If the baseline tests fail, do not continue unless the user explicitly tells you to continue. You
|
|
151
|
+
cannot separate new defects from existing defects.
|
|
152
|
+
- When cleanup is authorized, use `tidy`. Do not leave stale worktrees.
|
|
133
153
|
|
|
134
|
-
|
|
154
|
+
## Related workflow
|
|
135
155
|
|
|
136
156
|
- Invoke `tidy` for dependency-locked delegation to Hephaestus branch and worktree cleanup.
|
|
137
|
-
-
|
|
138
|
-
|
|
157
|
+
- Before you report completion or start cleanup, get fresh runnable evidence. Follow the
|
|
158
|
+
[evidence-integrity policy](../_support/docs/policies/evidence-integrity.md).
|
|
139
159
|
|
|
140
160
|
---
|
|
141
161
|
|
|
@@ -1,18 +1,31 @@
|
|
|
1
1
|
#!/usr/bin/env python3
|
|
2
|
-
"""
|
|
2
|
+
"""Prepare an isolated Git worktree."""
|
|
3
3
|
|
|
4
4
|
from __future__ import annotations
|
|
5
5
|
|
|
6
|
+
import importlib.util
|
|
6
7
|
import json
|
|
7
8
|
import subprocess
|
|
8
9
|
import sys
|
|
9
10
|
import tempfile
|
|
10
11
|
from pathlib import Path
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
12
|
+
from typing import TYPE_CHECKING
|
|
13
|
+
|
|
14
|
+
if TYPE_CHECKING or __package__ not in {None, ""}:
|
|
15
|
+
from skills._cli import argument_parser, run_command
|
|
16
|
+
else:
|
|
17
|
+
_cli_path = Path(__file__).resolve().parents[2] / "_cli.py"
|
|
18
|
+
_cli_spec = importlib.util.spec_from_file_location(
|
|
19
|
+
"athena_installed_cli", _cli_path
|
|
20
|
+
)
|
|
21
|
+
if _cli_spec is None or _cli_spec.loader is None:
|
|
22
|
+
raise RuntimeError(
|
|
23
|
+
f"The installed Athena CLI helper is unavailable: '{_cli_path}'."
|
|
24
|
+
)
|
|
25
|
+
_cli = importlib.util.module_from_spec(_cli_spec)
|
|
26
|
+
_cli_spec.loader.exec_module(_cli)
|
|
27
|
+
argument_parser = _cli.argument_parser
|
|
28
|
+
run_command = _cli.run_command
|
|
16
29
|
|
|
17
30
|
|
|
18
31
|
def git(
|
|
@@ -22,23 +35,27 @@ def git(
|
|
|
22
35
|
["git", *arguments], cwd=cwd, capture_output=True, text=True, check=False
|
|
23
36
|
)
|
|
24
37
|
if check and result.returncode != 0:
|
|
25
|
-
raise RuntimeError(
|
|
38
|
+
raise RuntimeError(
|
|
39
|
+
result.stderr.strip() or f"The git {' '.join(arguments)} command failed."
|
|
40
|
+
)
|
|
26
41
|
return result
|
|
27
42
|
|
|
28
43
|
|
|
29
44
|
def reject_symlinks_below(trust_root: Path, target: Path) -> None:
|
|
30
|
-
"""Reject
|
|
45
|
+
"""Reject symbolic links in a caller-controlled path below a trusted root."""
|
|
31
46
|
lexical_root = trust_root.absolute()
|
|
32
47
|
lexical_target = target.absolute()
|
|
33
48
|
try:
|
|
34
49
|
lexical_target.relative_to(lexical_root)
|
|
35
50
|
except ValueError as error:
|
|
36
51
|
raise RuntimeError(
|
|
37
|
-
f"worktree path
|
|
52
|
+
f"The worktree path is outside the trusted root: '{lexical_root}'."
|
|
38
53
|
) from error
|
|
39
54
|
for component in (*reversed(lexical_target.parents), lexical_target):
|
|
40
55
|
if component.is_symlink():
|
|
41
|
-
raise RuntimeError(
|
|
56
|
+
raise RuntimeError(
|
|
57
|
+
f"A component of the worktree path is a symbolic link: '{component}'."
|
|
58
|
+
)
|
|
42
59
|
|
|
43
60
|
|
|
44
61
|
def select_path(
|
|
@@ -66,7 +83,8 @@ def select_path(
|
|
|
66
83
|
if directory.is_dir():
|
|
67
84
|
if directory.is_symlink():
|
|
68
85
|
raise RuntimeError(
|
|
69
|
-
|
|
86
|
+
"The project-local worktree directory is a symbolic link: "
|
|
87
|
+
f"'{directory}'."
|
|
70
88
|
)
|
|
71
89
|
return (directory / branch).resolve(), True
|
|
72
90
|
project = root.name
|
|
@@ -82,7 +100,8 @@ def verify_ignored(root: Path, path: Path) -> None:
|
|
|
82
100
|
result = git(root, "check-ignore", "-q", "--", str(probe), check=False)
|
|
83
101
|
if result.returncode != 0:
|
|
84
102
|
raise RuntimeError(
|
|
85
|
-
|
|
103
|
+
"Git did not confirm that it ignores the project-local worktree directory: "
|
|
104
|
+
f"'{relative.parent}'."
|
|
86
105
|
)
|
|
87
106
|
|
|
88
107
|
|
|
@@ -102,9 +121,9 @@ def main() -> int:
|
|
|
102
121
|
root, "check-ref-format", "--branch", arguments.branch, check=False
|
|
103
122
|
)
|
|
104
123
|
if branch_check.returncode != 0:
|
|
105
|
-
raise RuntimeError(f"
|
|
124
|
+
raise RuntimeError(f"The branch name is not valid: '{arguments.branch}'.")
|
|
106
125
|
if (arguments.path is None) != (arguments.path_root is None):
|
|
107
|
-
raise RuntimeError("--path and --path-root
|
|
126
|
+
raise RuntimeError("Specify '--path' and '--path-root' together.")
|
|
108
127
|
path, project_local = select_path(
|
|
109
128
|
root,
|
|
110
129
|
arguments.branch,
|
|
@@ -121,7 +140,7 @@ def main() -> int:
|
|
|
121
140
|
if project_local:
|
|
122
141
|
verify_ignored(root, path)
|
|
123
142
|
if path.exists():
|
|
124
|
-
raise RuntimeError(f"worktree path already exists: {path}")
|
|
143
|
+
raise RuntimeError(f"The worktree path already exists: '{path}'.")
|
|
125
144
|
if not arguments.dry_run:
|
|
126
145
|
git(
|
|
127
146
|
root,
|
|
@@ -1,106 +1,163 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: issue-review
|
|
3
3
|
license: BSD-3-Clause
|
|
4
|
-
description:
|
|
4
|
+
description: Use before implementation to review a GitHub or GitLab issue and its current `plan-issue` artifact. Check architecture, scope, risk, and behavior-first verification. Use `--report-only` for read-only work.
|
|
5
5
|
argument-hint: "[--report-only] ISSUE_NUMBER_OR_URL"
|
|
6
6
|
allowed-tools: [Read, Bash, Grep, Glob, Agent, WebFetch]
|
|
7
7
|
---
|
|
8
8
|
|
|
9
9
|
# Review an issue and plan
|
|
10
10
|
|
|
11
|
-
|
|
12
|
-
|
|
11
|
+
Purpose: Review the plan before implementation. Early review helps you find architecture, scope,
|
|
12
|
+
and verification gaps before code changes start.
|
|
13
13
|
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
[
|
|
14
|
+
Apply the [ASD-STE100 technical-English policy](../TECHNICAL_ENGLISH.md) to this skill and to all
|
|
15
|
+
prose that it produces.
|
|
16
|
+
|
|
17
|
+
Use the shared [issue-planning contract](../_support/docs/review/issue-planning.md),
|
|
18
|
+
[review contract](../_support/docs/review/common.md),
|
|
19
|
+
[language routing](../_support/docs/review/language-routing.md), and
|
|
20
|
+
[behavior-first testing](../_support/docs/review/behavior-first-testing.md).
|
|
18
21
|
|
|
19
22
|
## Engineering principles
|
|
20
23
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
- [P010 Scope Fidelity](
|
|
25
|
-
plan as the
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
- [P012 Evidence Before Modification](
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
- [
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
24
|
+
Use the canonical [engineering-principles catalog](../_support/docs/principles/README.md) for these review
|
|
25
|
+
decisions:
|
|
26
|
+
|
|
27
|
+
- [P010 Scope Fidelity](../_support/docs/principles/README.md#p010): Use the current issue and canonical
|
|
28
|
+
plan as the full review target.
|
|
29
|
+
- [P066 Preserve Existing Work](../_support/docs/principles/README.md#p066): Do not rewrite historical
|
|
30
|
+
artifacts or artifacts that a different actor owns.
|
|
31
|
+
- [P012 Evidence Before Modification](../_support/docs/principles/README.md#p012): Before you accept a
|
|
32
|
+
plan, examine current requirements and repository evidence.
|
|
33
|
+
- [P063 Requirement-to-Code Traceability](../_support/docs/principles/README.md#p063): For each gap,
|
|
34
|
+
find the related requirement or contract.
|
|
35
|
+
- [P072 Technical Evidence Over Preference](../_support/docs/principles/README.md#p072): Give technical
|
|
36
|
+
evidence for each gap. Do not use personal preference as evidence.
|
|
37
|
+
- [P015 Architecture Conformance](../_support/docs/principles/README.md#p015): If a boundary violation has
|
|
38
|
+
no explanation, do not accept the plan.
|
|
39
|
+
- [P071 Consistency Over Personal Preference](../_support/docs/principles/README.md#p071): If technical
|
|
40
|
+
evidence does not show a necessary change, obey repository conventions.
|
|
41
|
+
- [P008 Understand Before Subtracting](../_support/docs/principles/README.md#p008): Before you accept
|
|
42
|
+
deletion or consolidation, examine the consumers and purpose.
|
|
38
43
|
|
|
39
44
|
## Scope and delivery
|
|
40
45
|
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
46
|
+
Use the issue as the requirements source. Review only its current canonical plan. Use the
|
|
47
|
+
issue-planning contract to identify the plan owner, marker, presence or absence, and identity. Use
|
|
48
|
+
historical plans and reviews only as background information.
|
|
49
|
+
|
|
50
|
+
If the request includes `--report-only`, this skill is read-only. Do not publish a comment. If the
|
|
51
|
+
request does not include this option, first compare the required identities. Then, confirm a safe
|
|
52
|
+
forge capability. You can then publish exactly one actor-owned structured review comment. Do not
|
|
53
|
+
expand the scope to these items:
|
|
45
54
|
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
55
|
+
- labels;
|
|
56
|
+
- assignment;
|
|
57
|
+
- implementation;
|
|
58
|
+
- commit;
|
|
59
|
+
- push;
|
|
60
|
+
- pull request;
|
|
61
|
+
- merge; or
|
|
62
|
+
- issue closure.
|
|
50
63
|
|
|
51
64
|
## Review
|
|
52
65
|
|
|
53
|
-
1. Read the issue, linked work, canonical plan, repository guidance,
|
|
54
|
-
|
|
55
|
-
2.
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
66
|
+
1. Read the issue, linked work, canonical plan, repository guidance, architecture decision records
|
|
67
|
+
(ADRs), applicable code, tests, and public contracts.
|
|
68
|
+
2. Under [P015 Architecture Conformance](../_support/docs/principles/README.md#p015), select one architecture
|
|
69
|
+
result:
|
|
70
|
+
|
|
71
|
+
- aligned;
|
|
72
|
+
- intentional and justified change; or
|
|
73
|
+
- unexplained violation.
|
|
74
|
+
|
|
75
|
+
A material violation prevents a positive assessment.
|
|
76
|
+
3. Under [P063 Requirement-to-Code Traceability](../_support/docs/principles/README.md#p063), map each
|
|
77
|
+
acceptance criterion to a concrete plan step, affected boundary, and behavior-first validation
|
|
78
|
+
step.
|
|
79
|
+
4. If the plan contains a material architecture change, verify that it includes or cites a
|
|
80
|
+
[design record](../_support/docs/review/design-docs.md).
|
|
81
|
+
5. Under [P012 Evidence Before Modification](../_support/docs/principles/README.md#p012), verify these claims
|
|
82
|
+
against current repository evidence:
|
|
83
|
+
|
|
84
|
+
- paths;
|
|
85
|
+
- symbols;
|
|
86
|
+
- commands;
|
|
87
|
+
- dependencies;
|
|
88
|
+
- assumptions;
|
|
89
|
+
- risks;
|
|
90
|
+
- migration; and
|
|
91
|
+
- rollback.
|
|
92
|
+
|
|
93
|
+
6. Apply only the language and change-surface checks that the review scope activates.
|
|
94
|
+
7. Record each not applicable (`N/A`) section and its reason.
|
|
95
|
+
8. Activate these principle checks only for their specified surfaces:
|
|
96
|
+
|
|
97
|
+
- Use [P001 KISS — Keep It Simple, Stupid](../_support/docs/principles/README.md#p001) for added
|
|
98
|
+
complexity.
|
|
99
|
+
- Use [P022 Test Behavior, Not Implementation](../_support/docs/principles/README.md#p022) for testable
|
|
100
|
+
behavior.
|
|
101
|
+
- Use
|
|
102
|
+
[P029 Generalize Error Policy; Preserve Specific Cause](../_support/docs/principles/README.md#p029) for
|
|
103
|
+
error paths.
|
|
104
|
+
- Use [P048 Secure by Design](../_support/docs/principles/README.md#p048) for security or new trust
|
|
105
|
+
boundaries.
|
|
106
|
+
|
|
107
|
+
9. Confirm that each applicable prior finding is resolved. Acknowledgment alone does not resolve a
|
|
108
|
+
finding.
|
|
109
|
+
|
|
110
|
+
Give priority to these findings:
|
|
111
|
+
|
|
112
|
+
- architecture violations;
|
|
113
|
+
- missing requirements;
|
|
114
|
+
- unsafe scope;
|
|
115
|
+
- unresolved dependencies;
|
|
116
|
+
- outcomes that cannot be tested;
|
|
117
|
+
- invalid references;
|
|
118
|
+
- nondeterministic tests;
|
|
119
|
+
- empty selections; and
|
|
120
|
+
- unsupported claims.
|
|
121
|
+
|
|
122
|
+
After a finalized epoch, do not treat generated plan text or sealed provenance as new requirements.
|
|
123
|
+
Review only a later material issue change and its current canonical plan. An unchanged finalized
|
|
124
|
+
epoch is not a new review target.
|
|
125
|
+
|
|
126
|
+
Immediately before you publish the requested comment, resolve the canonical planning identity again.
|
|
127
|
+
If one of these conditions is true, withhold the comment:
|
|
128
|
+
|
|
129
|
+
- identity drift;
|
|
130
|
+
- a foreign marker;
|
|
131
|
+
- multiple markers;
|
|
132
|
+
- a change to verified absence; or
|
|
133
|
+
- no safe forge capability.
|
|
134
|
+
|
|
135
|
+
If you withhold the comment, report the `stale` status.
|
|
136
|
+
|
|
137
|
+
Otherwise, publish exactly one actor-owned structured comment. Include a clean result or verified
|
|
138
|
+
absent-plan coverage gap.
|
|
90
139
|
|
|
91
140
|
## Failed approaches
|
|
92
141
|
|
|
93
|
-
-
|
|
142
|
+
- Do not review issues or plans outside the requested scope. Do not treat historical plans as the
|
|
94
143
|
artifact under review.
|
|
95
|
-
-
|
|
96
|
-
comment.
|
|
97
|
-
-
|
|
98
|
-
prior
|
|
99
|
-
-
|
|
144
|
+
- Do not edit the issue, labels, or assignment. If publication is authorized, report findings only in
|
|
145
|
+
the structured review comment. For `--report-only`, return the findings without publication.
|
|
146
|
+
- Do not invent acceptance criteria that the reporter did not state. Do not accept an unresolved
|
|
147
|
+
prior finding only because someone acknowledged it.
|
|
148
|
+
- After drift, do not publish the comment again. Withhold it. Report `stale`.
|
|
100
149
|
|
|
101
150
|
## Result
|
|
102
151
|
|
|
103
|
-
Return
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
152
|
+
Return these items:
|
|
153
|
+
|
|
154
|
+
- issue and plan identities;
|
|
155
|
+
- the architecture decision first;
|
|
156
|
+
- the requirement map;
|
|
157
|
+
- severity-ranked findings;
|
|
158
|
+
- test-quality coverage;
|
|
159
|
+
- `N/A` sections;
|
|
160
|
+
- residual risks; and
|
|
161
|
+
- whether you published or withheld the comment.
|
|
162
|
+
|
|
163
|
+
Do not expand the review scope to implementation or merge.
|