@homericintelligence/athena-opencode 0.4.4 → 0.5.1
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 +26 -18
- package/skills/_support/docs/dependency-resolution.md +192 -0
- package/skills/_support/docs/policies/development.md +117 -0
- package/skills/_support/docs/policies/evidence-integrity.md +40 -0
- package/skills/_support/docs/principles/README.md +542 -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 +129 -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 +59 -0
- package/skills/_support/docs/review/behavior-first-testing.md +73 -0
- package/skills/_support/docs/review/common.md +365 -0
- package/skills/_support/docs/review/design-docs.md +74 -0
- package/skills/_support/docs/review/issue-planning.md +220 -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 +102 -40
- package/skills/advise/scripts/list_retrievable_skills.py +3 -3
- package/skills/brainstorm/SKILL.md +167 -76
- package/skills/change-review/SKILL.md +99 -43
- package/skills/change-review/references/scope-resolution.md +70 -41
- package/skills/change-review/scripts/resolve_scope.py +119 -73
- package/skills/finalize-plan/SKILL.md +208 -100
- package/skills/git-worktrees/SKILL.md +108 -59
- package/skills/git-worktrees/scripts/prepare_worktree.py +16 -10
- package/skills/issue-review/SKILL.md +143 -47
- package/skills/learn/SKILL.md +284 -162
- package/skills/myrmidon-swarm/SKILL.md +136 -61
- package/skills/plan-issue/SKILL.md +129 -47
- package/skills/pr-review/SKILL.md +170 -71
- package/skills/pr-review/references/criteria.md +61 -14
- package/skills/pr-review/references/delivery.md +159 -80
- package/skills/pr-review/references/evidence.md +268 -139
- package/skills/pr-review/references/prevalidated.md +91 -48
- package/skills/pr-review/scripts/collect_evidence.py +211 -140
- package/skills/pr-review/scripts/diff_context.py +6 -4
- package/skills/pr-review/scripts/materialize_snapshot.py +112 -120
- package/skills/pr-review/scripts/pr_identity.py +27 -15
- package/skills/pr-review/scripts/resolve_pr.py +53 -31
- package/skills/repo-review/SKILL.md +209 -87
- package/skills/systematic-debugging/SKILL.md +195 -131
- package/skills/systematic-debugging/scripts/repository_evidence.py +9 -4
- package/skills/test-driven-development/SKILL.md +134 -53
- package/skills/tidy/SKILL.md +97 -33
- package/skills/tidy/scripts/run_tidy.py +3 -3
|
@@ -1,74 +1,155 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: test-driven-development
|
|
3
3
|
license: BSD-3-Clause
|
|
4
|
-
description: Use
|
|
4
|
+
description: Use this skill before you write implementation code for a feature or bug fix. Follow the RED-GREEN-REFACTOR cycle. Do not write production code until a verified test fails for the expected missing behavior. If the test has an error, correct the test before GREEN.
|
|
5
5
|
argument-hint: <feature or bugfix description>
|
|
6
6
|
allowed-tools: [Read, Write, Edit, Bash, Grep, Glob]
|
|
7
7
|
---
|
|
8
8
|
|
|
9
|
-
# Test-
|
|
9
|
+
# Test-driven development (TDD)
|
|
10
10
|
|
|
11
|
-
|
|
12
|
-
|
|
11
|
+
A focused test that fails proves that it can detect the missing product behavior. A passing test
|
|
12
|
+
proves that the smallest implementation satisfies the test.
|
|
13
13
|
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
observable product behavior and core contracts, not wording, documentation
|
|
17
|
-
layout, or a private implementation arrangement.
|
|
14
|
+
Apply the [ASD-STE100 technical-English policy](../TECHNICAL_ENGLISH.md) to this skill and to
|
|
15
|
+
all prose that it produces.
|
|
18
16
|
|
|
19
|
-
|
|
17
|
+
Use Athena's shared [behavior-first testing guidance](../_support/docs/review/behavior-first-testing.md)
|
|
18
|
+
for test criteria, determinism, and false-pass checks. Test observable product behavior and core
|
|
19
|
+
contracts. Do not test wording, documentation layout, or a private implementation arrangement.
|
|
20
20
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
21
|
+
## Engineering principles
|
|
22
|
+
|
|
23
|
+
Use Athena's [canonical engineering-principles catalog](../_support/docs/principles/README.md) for the
|
|
24
|
+
principle definitions. Use these principles in this workflow:
|
|
25
|
+
|
|
26
|
+
- [P022 — Test Behavior, Not Implementation](../_support/docs/principles/README.md#p022): Write tests for
|
|
27
|
+
observable contracts. Do not write tests for a private implementation.
|
|
28
|
+
- [P023 — Parameterized / Table-Driven Testing](../_support/docs/principles/README.md#p023): If one rule is
|
|
29
|
+
applicable to two or more test cases, use named data in a parameterized or table-driven test.
|
|
30
|
+
- [P024 — Boundary-Value Testing](../_support/docs/principles/README.md#p024): If the behavior has
|
|
31
|
+
boundaries, include values near its limits and state changes.
|
|
32
|
+
- [P025 — Property-Based Testing for Invariants](../_support/docs/principles/README.md#p025): If a small
|
|
33
|
+
example set is not sufficient for an invariant, use generated input families.
|
|
34
|
+
- [P026 — Regression Before Repair](../_support/docs/principles/README.md#p026): If it is possible, before
|
|
35
|
+
you repair the defect, add one test that fails only because of the defect.
|
|
36
|
+
- [P027 — Deterministic and Hermetic Tests](../_support/docs/principles/README.md#p027): Set environment
|
|
37
|
+
inputs to specified values. Control external boundaries. Make sure that each test gives the same
|
|
38
|
+
result each time.
|
|
39
|
+
- [P028 — Test Failure Paths, Not Just Success Paths](../_support/docs/principles/README.md#p028): If the
|
|
40
|
+
contract includes failure paths, include invalid input, dependency failure, cancellation, and
|
|
41
|
+
cleanup.
|
|
42
|
+
- [P091 — Test-Driven Development](../_support/docs/principles/README.md#p091): For a behavior change, first
|
|
43
|
+
add a test that shows the missing behavior (`RED`). Then, make the minimum code change that makes
|
|
44
|
+
the test pass (`GREEN`). After `GREEN`, make the structure better without a behavior change
|
|
45
|
+
(`REFACTOR`).
|
|
46
|
+
|
|
47
|
+
## Working rules
|
|
48
|
+
|
|
49
|
+
Use TDD for features, bug fixes, and behavior changes. For a pure refactor that preserves behavior,
|
|
50
|
+
first establish a verified green characterization baseline. Then, start at REFACTOR. Do not create
|
|
51
|
+
an artificial RED result.
|
|
52
|
+
|
|
53
|
+
If the work introduces or changes observable behavior, start with RED. Before you exempt a
|
|
54
|
+
throwaway prototype, generated code, configuration-only work, or documentation-only change, ask the
|
|
55
|
+
human partner. In a swarm, the test specialist must complete the applicable RED or green
|
|
56
|
+
characterization baseline before implementation starts.
|
|
25
57
|
|
|
26
58
|
```text
|
|
27
|
-
|
|
59
|
+
START A BEHAVIOR CHANGE WITH A FOCUSED FAILING TEST
|
|
60
|
+
START A PURE REFACTOR FROM A VERIFIED GREEN BASELINE
|
|
28
61
|
```
|
|
29
62
|
|
|
30
|
-
If you wrote in-scope implementation
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
63
|
+
If you wrote an in-scope implementation that changes behavior before RED, remove only the work that
|
|
64
|
+
you added. Then, start with RED. If a pure refactor started without a verified baseline, stop.
|
|
65
|
+
Establish a verified baseline before you continue. Preserve existing work and work that the user
|
|
66
|
+
authored. If the source or scope of the work is not clear, ask for direction.
|
|
67
|
+
|
|
68
|
+
## RED-GREEN-REFACTOR
|
|
69
|
+
|
|
70
|
+
For a refactor that preserves behavior, verify the existing characterization suite. Then, start at
|
|
71
|
+
step 5. If the intended work changes the observable contract, return to RED.
|
|
72
|
+
|
|
73
|
+
1. **RED:** Write one minimum, clearly named test under
|
|
74
|
+
[P022](../_support/docs/principles/README.md#p022).
|
|
75
|
+
|
|
76
|
+
- The test must cover one observable behavior, data contract, security property, or executable
|
|
77
|
+
artifact result.
|
|
78
|
+
- Use real code unless a real external boundary requires a controlled substitute.
|
|
79
|
+
- If the behavior requires them, apply [P023](../_support/docs/principles/README.md#p023),
|
|
80
|
+
[P024](../_support/docs/principles/README.md#p024),
|
|
81
|
+
[P025](../_support/docs/principles/README.md#p025), and
|
|
82
|
+
[P028](../_support/docs/principles/README.md#p028).
|
|
83
|
+
|
|
84
|
+
2. **Verify RED:** Verify the RED result with the focused test command for the repository.
|
|
85
|
+
|
|
86
|
+
- Before you run the command, find it in the repository.
|
|
87
|
+
- Run the focused test command.
|
|
88
|
+
- The test must fail for the expected missing behavior.
|
|
89
|
+
- The test must not stop because of a test error.
|
|
90
|
+
- For a filtered command, use the output to prove that the command selected an applicable test.
|
|
91
|
+
- Connect each C++/CMake test source to a real build target and test target.
|
|
92
|
+
- If the test passes, it covers existing behavior.
|
|
93
|
+
- If the test has an error, correct the test setup. Then, run the test again.
|
|
94
|
+
- Under [P027](../_support/docs/principles/README.md#p027), keep the test deterministic and isolated.
|
|
95
|
+
|
|
96
|
+
3. **GREEN:** Write the simplest behaviorally complete code that passes the behavior test.
|
|
97
|
+
|
|
98
|
+
- Follow [P001 — KISS — Keep It Simple, Stupid](../_support/docs/principles/README.md#p001).
|
|
99
|
+
- Prefer [P090 — Prefer Negative Code](../_support/docs/principles/README.md#p090) only if the candidate
|
|
100
|
+
solutions are equally correct.
|
|
101
|
+
- Do not add speculative features, unrelated refactors, or implementation beyond the need that
|
|
102
|
+
the test shows.
|
|
103
|
+
|
|
104
|
+
4. **Verify GREEN:** Run the applicable test suite that you found in the repository.
|
|
105
|
+
|
|
106
|
+
- The new and existing tests must pass without errors or warnings.
|
|
107
|
+
- Correct the code. Do not weaken a test.
|
|
108
|
+
|
|
109
|
+
5. **REFACTOR:** After GREEN, improve the structure without new behavior.
|
|
110
|
+
|
|
111
|
+
- Remove actual knowledge duplication under
|
|
112
|
+
[P003 — DRY — Don't Repeat Yourself](../_support/docs/principles/README.md#p003).
|
|
113
|
+
- Do not violate [P013 — AHA — Avoid Hasty Abstractions](../_support/docs/principles/README.md#p013).
|
|
114
|
+
- Protect [P070 — Code Health Must Not Regress](../_support/docs/principles/README.md#p070),
|
|
115
|
+
[P084 — Prefer Local Reasoning](../_support/docs/principles/README.md#p084), and
|
|
116
|
+
[P086 — Readability Counts](../_support/docs/principles/README.md#p086).
|
|
117
|
+
- Prefer deletion under [P090](../_support/docs/principles/README.md#p090) only if behavior and clarity
|
|
118
|
+
do not change.
|
|
119
|
+
- Keep the tests green.
|
|
120
|
+
- Start the next RED cycle.
|
|
121
|
+
|
|
122
|
+
For a documentation-only change, use existing Markdown, link, and executable-example validation.
|
|
123
|
+
Do not create production code. Do not create a text-assertion harness to produce an artificial RED
|
|
124
|
+
phase.
|
|
57
125
|
|
|
58
126
|
## Evidence before completion
|
|
59
127
|
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
suite, coverage, type, and lint commands
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
behavior and bug regression
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
128
|
+
Find commands in `AGENTS.md`, task runners, manifests, lockfiles, and required continuous
|
|
129
|
+
integration (CI) configuration. Prefer repository-native entry points. When applicable, record the
|
|
130
|
+
focused-test, applicable-suite, coverage, type-check, and lint commands. If the sources conflict or
|
|
131
|
+
you cannot find a safe command, ask the user. Do not use a command from another repository.
|
|
132
|
+
|
|
133
|
+
Before completion, confirm these conditions:
|
|
134
|
+
|
|
135
|
+
- Each changed observable behavior and bug regression has proportionate test coverage.
|
|
136
|
+
- The tests control time, services, randomness, state, and mocks when the product requires this
|
|
137
|
+
control.
|
|
138
|
+
- Focused test selection is not empty.
|
|
139
|
+
- Fresh applicable tests, type checks, and lint checks pass.
|
|
140
|
+
|
|
141
|
+
Before you claim success, follow the
|
|
142
|
+
[evidence-integrity policy](../_support/docs/policies/evidence-integrity.md). For a durable testing lesson,
|
|
143
|
+
use `learn`. The scope and delivery rules of `learn` determine if it publishes a pull request.
|
|
144
|
+
|
|
145
|
+
## Failed approaches
|
|
146
|
+
|
|
147
|
+
- Do not write production code before RED.
|
|
148
|
+
- Do not keep in-scope implementation that you wrote before the test.
|
|
149
|
+
- Do not accept a test error as RED. Correct the setup. Then, run the test until it fails for the
|
|
150
|
+
expected missing behavior.
|
|
151
|
+
- Do not weaken a test to reach GREEN. Correct the code.
|
|
152
|
+
- Do not add speculative features or unrelated refactors beyond the need that the test shows.
|
|
72
153
|
|
|
73
154
|
---
|
|
74
155
|
|
package/skills/tidy/SKILL.md
CHANGED
|
@@ -1,68 +1,132 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: tidy
|
|
3
3
|
license: BSD-3-Clause
|
|
4
|
-
description: Delegate repository branch and worktree cleanup to the dependency-locked Hephaestus tidy command. Use for tidy, cleanup, or rebase
|
|
4
|
+
description: Delegate repository branch and worktree cleanup to the dependency-locked Hephaestus tidy command. Use this skill for a tidy, cleanup, or rebase request. Stop if the trusted automation checkout or a required execution capability cannot be prepared.
|
|
5
5
|
argument-hint: "<optional: hephaestus-tidy arguments>"
|
|
6
6
|
allowed-tools: [Bash, Read]
|
|
7
7
|
---
|
|
8
8
|
|
|
9
9
|
# Tidy through Hephaestus
|
|
10
10
|
|
|
11
|
-
Use this when the user asks to tidy, clean up, or rebase
|
|
12
|
-
worktrees. Athena prepares the trusted automation dependency
|
|
13
|
-
`hephaestus-tidy
|
|
14
|
-
|
|
11
|
+
Use this skill when the user asks to tidy, clean up, or rebase local repository branches or
|
|
12
|
+
worktrees. Athena prepares the trusted automation dependency. Then, Athena delegates the complete
|
|
13
|
+
operation to `hephaestus-tidy`.
|
|
14
|
+
|
|
15
|
+
`hephaestus-tidy` controls:
|
|
16
|
+
|
|
17
|
+
- discovery;
|
|
18
|
+
- preservation rules;
|
|
19
|
+
- prompts;
|
|
20
|
+
- rebases;
|
|
21
|
+
- removal safeguards;
|
|
22
|
+
- output;
|
|
23
|
+
- final exit status.
|
|
24
|
+
|
|
25
|
+
Apply the [ASD-STE100 technical-English policy](../TECHNICAL_ENGLISH.md) to this skill and to
|
|
26
|
+
all prose that it produces.
|
|
27
|
+
|
|
28
|
+
## Engineering principles
|
|
29
|
+
|
|
30
|
+
Use the [canonical engineering-principles catalog](../_support/docs/principles/README.md) for these
|
|
31
|
+
workflow rules:
|
|
32
|
+
|
|
33
|
+
- [P010 — Scope Fidelity](../_support/docs/principles/README.md#p010): Delegate only the requested tidy,
|
|
34
|
+
cleanup, or rebase operation. Do not add a different cleanup policy for Athena.
|
|
35
|
+
- [P031 — Propagate Rather Than Swallow](../_support/docs/principles/README.md#p031): Give the delegated
|
|
36
|
+
command's output, signals, and nonzero result to the caller. Do not hide the failure. Do not
|
|
37
|
+
automatically retry it.
|
|
38
|
+
- [P035 — Fail Secure / Fail Closed](../_support/docs/principles/README.md#p035): If a dependency identity or
|
|
39
|
+
revision-binding check is not satisfactory, stop. If the checkout is not clean, stop. If a
|
|
40
|
+
necessary capability is not available, stop.
|
|
41
|
+
- [P050 — Least Privilege](../_support/docs/principles/README.md#p050): Use only the resolved dependency,
|
|
42
|
+
target repository, capabilities, and arguments that are necessary for this invocation.
|
|
43
|
+
- [P058 — Bounded Agent Authority](../_support/docs/principles/README.md#p058): When you forward arguments,
|
|
44
|
+
do not increase the user's scope, destinations, credentials, or mutation authority.
|
|
45
|
+
- [P061 — Separate Decision from High-Impact Execution](../_support/docs/principles/README.md#p061): Before
|
|
46
|
+
you start delegated execution, record the dependency, target, authority, and full command vector.
|
|
47
|
+
Validate the record. During execution, use only the recorded values.
|
|
48
|
+
- [P062 — Human Approval for Irreversible or High-Risk Actions](../_support/docs/principles/README.md#p062):
|
|
49
|
+
If the user gave authority for scoped constructive work, do not request a second approval. If the
|
|
50
|
+
user did not give authority for a destructive or irreversible action, request approval for that
|
|
51
|
+
specified action.
|
|
52
|
+
- [P083 — Irreversible Actions Last](../_support/docs/principles/README.md#p083): Before you start an
|
|
53
|
+
irreversible operation, complete the dependency and command validation.
|
|
15
54
|
|
|
16
55
|
## Inputs
|
|
17
56
|
|
|
18
|
-
Keep the target repository as the current working directory. Treat
|
|
19
|
-
|
|
20
|
-
|
|
57
|
+
Keep the target repository as the current working directory. Treat each user argument as a
|
|
58
|
+
`hephaestus-tidy` argument. Forward it without a change. If the user wants a preview, forward
|
|
59
|
+
`--dry-run`. Do not reinterpret this option. Do not add it implicitly.
|
|
60
|
+
|
|
61
|
+
Under [P053 — Validate at Trust Boundaries](../_support/docs/principles/README.md#p053), treat the arguments
|
|
62
|
+
as opaque, untrusted command-line data. Preserve the boundary of each argument. The
|
|
63
|
+
`hephaestus-tidy` parser is the nearest responsible validation boundary.
|
|
21
64
|
|
|
22
65
|
## Workflow
|
|
23
66
|
|
|
24
67
|
1. Prepare Hephaestus at `$HOME/.agent_brain/automation` under the canonical
|
|
25
|
-
[`dependency-resolution` contract](
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
68
|
+
[`dependency-resolution` contract](../_support/docs/dependency-resolution.md).
|
|
69
|
+
2. Report the resolved repository, commit SHA, and trust basis.
|
|
70
|
+
3. If resolution, authentication, checkout, update, cleanliness, identity, revision binding, or
|
|
71
|
+
automatic-fork revalidation fails, stop.
|
|
72
|
+
4. Keep the target repository as the current working directory.
|
|
73
|
+
5. Resolve `scripts/run_tidy.py` against this installed skill directory.
|
|
74
|
+
6. Invoke the absolute helper path with this operand order:
|
|
75
|
+
|
|
76
|
+
- the resolved automation checkout as the first internal operand;
|
|
77
|
+
- each user argument after the first operand, in its original order and form.
|
|
78
|
+
7. The helper replaces itself with this dependency-locked command vector:
|
|
33
79
|
|
|
34
80
|
```text
|
|
35
81
|
uv run --project <resolved-automation-checkout> --locked hephaestus-tidy <user-arguments>
|
|
36
82
|
```
|
|
37
83
|
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
84
|
+
8. Leave stdin, stdout, and stderr attached.
|
|
85
|
+
9. Do not capture the command.
|
|
86
|
+
10. Do not pipe the command.
|
|
87
|
+
11. Do not replace the command output with a summary.
|
|
88
|
+
12. Do not answer an interactive prompt from Hephaestus. The user answers each prompt.
|
|
89
|
+
13. Do not retry the command.
|
|
90
|
+
14. Do not otherwise mediate it.
|
|
91
|
+
|
|
92
|
+
Athena does not do these operations:
|
|
93
|
+
|
|
94
|
+
- worktree audit;
|
|
95
|
+
- candidate classification;
|
|
96
|
+
- removal;
|
|
97
|
+
- prompt;
|
|
98
|
+
- branch rebase;
|
|
99
|
+
- cleanup safety decision.
|
|
100
|
+
|
|
101
|
+
Do not replace the dependency-locked command with a `hephaestus-tidy` executable from `PATH`.
|
|
41
102
|
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
103
|
+
Delegation keeps existing authority for constructive actions that are in scope. It does not create
|
|
104
|
+
new authority. Keep the Hephaestus prompts attached. Do not use delegation to bypass action-bound
|
|
105
|
+
approval. This restriction applies to each destructive or other irreversible operation that the user
|
|
106
|
+
did not authorize.
|
|
45
107
|
|
|
46
108
|
## Dependency and capability failures
|
|
47
109
|
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
return the failure
|
|
51
|
-
|
|
110
|
+
Dependency preparation requires authenticated `gh`, Git, and network access. The locked command
|
|
111
|
+
requires Python 3 and `uv`. If a capability is not available or the command result is nonzero,
|
|
112
|
+
return the failure without a change. In that case, stop. Do not use a stale checkout, a repository with a
|
|
113
|
+
similar name, an ambient executable, or a second cleanup implementation.
|
|
52
114
|
|
|
53
115
|
## Failed approaches
|
|
54
116
|
|
|
55
|
-
-
|
|
56
|
-
of destructive-action prompts.
|
|
57
|
-
-
|
|
58
|
-
-
|
|
59
|
-
|
|
117
|
+
- Do not audit worktrees in Athena. Do not remove worktrees in Athena. These actions duplicate the
|
|
118
|
+
Hephaestus policy and create a second set of destructive-action prompts.
|
|
119
|
+
- Do not invoke an ambient `hephaestus-tidy`. It can bypass the resolved repository and its lockfile.
|
|
120
|
+
- Do not parse user arguments. Do not normalize user arguments. Do not reconstruct user arguments.
|
|
121
|
+
These actions change the delegated command-line contract.
|
|
122
|
+
- Do not capture the process. Do not pipe the process. These actions can change interactive behavior,
|
|
123
|
+
output, signals, or exit status.
|
|
60
124
|
|
|
61
125
|
## Output
|
|
62
126
|
|
|
63
127
|
Before execution, report the resolved Hephaestus repository, commit SHA, and trust basis. After
|
|
64
|
-
|
|
65
|
-
worktree classifications or cleanup conclusions.
|
|
128
|
+
execution starts, preserve the delegated command output and terminal result. Do not add
|
|
129
|
+
Athena-specific worktree classifications or cleanup conclusions.
|
|
66
130
|
|
|
67
131
|
## Attribution
|
|
68
132
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env python3
|
|
2
|
-
"""
|
|
2
|
+
"""Run the dependency-locked Hephaestus tidy command in place of this process."""
|
|
3
3
|
|
|
4
4
|
from __future__ import annotations
|
|
5
5
|
|
|
@@ -34,9 +34,9 @@ def main(argv: Sequence[str] | None = None) -> int:
|
|
|
34
34
|
os.execvp(command[0], command)
|
|
35
35
|
except FileNotFoundError as error:
|
|
36
36
|
missing = error.filename or command[0]
|
|
37
|
-
print(f"required command
|
|
37
|
+
print(f"The required command is not available: '{missing}'.", file=sys.stderr)
|
|
38
38
|
return 127
|
|
39
|
-
raise RuntimeError("os.execvp returned unexpectedly")
|
|
39
|
+
raise RuntimeError("The os.execvp call returned control unexpectedly.")
|
|
40
40
|
|
|
41
41
|
|
|
42
42
|
if __name__ == "__main__":
|